/*! For license information please see server.js.LICENSE.txt */ !(function(modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { i: moduleId, l: !1, exports: {} }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.l = !0, module.exports; } __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.d = function(exports, name, getter) { __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, { enumerable: !0, get: getter }); }, __webpack_require__.r = function(exports) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(exports, "__esModule", { value: !0 }); }, __webpack_require__.t = function(value, mode) { if (1 & mode && (value = __webpack_require__(value)), 8 & mode) return value; if (4 & mode && "object" == typeof value && value && value.__esModule) return value; var ns = Object.create(null); if (__webpack_require__.r(ns), Object.defineProperty(ns, "default", { enumerable: !0, value: value }), 2 & mode && "string" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); return ns; }, __webpack_require__.n = function(module) { var getter = module && module.__esModule ? function() { return module.default; } : function() { return module; }; return __webpack_require__.d(getter, "a", getter), getter; }, __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 564); })([ function(module, exports) { module.exports = require("util"); }, function(module, exports, __webpack_require__) { (function(module) { module.exports = (function() { "use strict"; var hookCallback; function utils_hooks__hooks() { return hookCallback.apply(null, arguments); } function isArray(input) { return "[object Array]" === Object.prototype.toString.call(input); } function isDate(input) { return input instanceof Date || "[object Date]" === Object.prototype.toString.call(input); } function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } function extend(a, b) { for (var i in b) hasOwnProp(b, i) && (a[i] = b[i]); return hasOwnProp(b, "toString") && (a.toString = b.toString), hasOwnProp(b, "valueOf") && (a.valueOf = b.valueOf), a; } function create_utc__createUTC(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, !0).utc(); } function getParsingFlags(m) { return null == m._pf && (m._pf = { empty: !1, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: !1, invalidMonth: null, invalidFormat: !1, userInvalidated: !1, iso: !1 }), m._pf; } function valid__isValid(m) { if (null == m._isValid) { var flags = getParsingFlags(m); m._isValid = !(isNaN(m._d.getTime()) || !(flags.overflow < 0) || flags.empty || flags.invalidMonth || flags.invalidWeekday || flags.nullInput || flags.invalidFormat || flags.userInvalidated), m._strict && (m._isValid = m._isValid && 0 === flags.charsLeftOver && 0 === flags.unusedTokens.length && void 0 === flags.bigHour); } return m._isValid; } function valid__createInvalid(flags) { var m = create_utc__createUTC(NaN); return null != flags ? extend(getParsingFlags(m), flags) : getParsingFlags(m).userInvalidated = !0, m; } var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; if (void 0 !== from._isAMomentObject && (to._isAMomentObject = from._isAMomentObject), void 0 !== from._i && (to._i = from._i), void 0 !== from._f && (to._f = from._f), void 0 !== from._l && (to._l = from._l), void 0 !== from._strict && (to._strict = from._strict), void 0 !== from._tzm && (to._tzm = from._tzm), void 0 !== from._isUTC && (to._isUTC = from._isUTC), void 0 !== from._offset && (to._offset = from._offset), void 0 !== from._pf && (to._pf = getParsingFlags(from)), void 0 !== from._locale && (to._locale = from._locale), momentProperties.length > 0) for (i in momentProperties) void 0 !== (val = from[prop = momentProperties[i]]) && (to[prop] = val); return to; } var updateInProgress = !1; function Moment(config) { copyConfig(this, config), this._d = new Date(null != config._d ? config._d.getTime() : NaN), !1 === updateInProgress && (updateInProgress = !0, utils_hooks__hooks.updateOffset(this), updateInProgress = !1); } function isMoment(obj) { return obj instanceof Moment || null != obj && null != obj._isAMomentObject; } function absFloor(number) { return number < 0 ? Math.ceil(number) : Math.floor(number); } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; return 0 !== coercedNumber && isFinite(coercedNumber) && (value = absFloor(coercedNumber)), value; } function compareArrays(array1, array2, dontConvert) { var i, len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0; for (i = 0; i < len; i++) (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) && diffs++; return diffs + lengthDiff; } function Locale() {} var globalLocale, locales = {}; function normalizeLocale(key) { return key ? key.toLowerCase().replace("_", "-") : key; } function loadLocale(name) { var oldLocale = null; if (!locales[name] && void 0 !== module && module && module.exports) try { oldLocale = globalLocale._abbr, __webpack_require__(732)("./" + name), locale_locales__getSetGlobalLocale(oldLocale); } catch (e) {} return locales[name]; } function locale_locales__getSetGlobalLocale(key, values) { var data; return key && (data = void 0 === values ? locale_locales__getLocale(key) : defineLocale(key, values)) && (globalLocale = data), globalLocale._abbr; } function defineLocale(name, values) { return null !== values ? (values.abbr = name, locales[name] = locales[name] || new Locale, locales[name].set(values), locale_locales__getSetGlobalLocale(name), locales[name]) : (delete locales[name], null); } function locale_locales__getLocale(key) { var locale; if (key && key._locale && key._locale._abbr && (key = key._locale._abbr), !key) return globalLocale; if (!isArray(key)) { if (locale = loadLocale(key)) return locale; key = [ key ]; } return (function(names) { for (var j, next, locale, split, i = 0; i < names.length; ) { for (j = (split = normalizeLocale(names[i]).split("-")).length, next = (next = normalizeLocale(names[i + 1])) ? next.split("-") : null; j > 0; ) { if (locale = loadLocale(split.slice(0, j).join("-"))) return locale; if (next && next.length >= j && compareArrays(split, next, !0) >= j - 1) break; j--; } i++; } return null; })(key); } var aliases = {}; function addUnitAlias(unit, shorthand) { var lowerCase = unit.toLowerCase(); aliases[lowerCase] = aliases[lowerCase + "s"] = aliases[shorthand] = unit; } function normalizeUnits(units) { return "string" == typeof units ? aliases[units] || aliases[units.toLowerCase()] : void 0; } function normalizeObjectUnits(inputObject) { var normalizedProp, prop, normalizedInput = {}; for (prop in inputObject) hasOwnProp(inputObject, prop) && (normalizedProp = normalizeUnits(prop)) && (normalizedInput[normalizedProp] = inputObject[prop]); return normalizedInput; } function makeGetSet(unit, keepTime) { return function(value) { return null != value ? (get_set__set(this, unit, value), utils_hooks__hooks.updateOffset(this, keepTime), this) : get_set__get(this, unit); }; } function get_set__get(mom, unit) { return mom._d["get" + (mom._isUTC ? "UTC" : "") + unit](); } function get_set__set(mom, unit, value) { return mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value); } function getSet(units, value) { var unit; if ("object" == typeof units) for (unit in units) this.set(unit, units[unit]); else if ("function" == typeof this[units = normalizeUnits(units)]) return this[units](value); return this; } function zeroFill(number, targetLength, forceSign) { var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length; return (number >= 0 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; function addFormatToken(token, padded, ordinal, callback) { var func = callback; "string" == typeof callback && (func = function() { return this[callback](); }), token && (formatTokenFunctions[token] = func), padded && (formatTokenFunctions[padded[0]] = function() { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }), ordinal && (formatTokenFunctions[ordinal] = function() { return this.localeData().ordinal(func.apply(this, arguments), token); }); } function formatMoment(m, format) { return m.isValid() ? (format = expandFormat(format, m.localeData()), formatFunctions[format] = formatFunctions[format] || (function(format) { var i, length, input, array = format.match(formattingTokens); for (i = 0, length = array.length; i < length; i++) formatTokenFunctions[array[i]] ? array[i] = formatTokenFunctions[array[i]] : array[i] = (input = array[i]).match(/\[[\s\S]/) ? input.replace(/^\[|\]$/g, "") : input.replace(/\\/g, ""); return function(mom) { var output = ""; for (i = 0; i < length; i++) output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; return output; }; })(format), formatFunctions[format](m)) : m.localeData().invalidDate(); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } for (localFormattingTokens.lastIndex = 0; i >= 0 && localFormattingTokens.test(format); ) format = format.replace(localFormattingTokens, replaceLongDateFormatTokens), localFormattingTokens.lastIndex = 0, i -= 1; return format; } var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, regexes = {}; function addRegexToken(token, regex, strictRegex) { var sth; regexes[token] = "function" == typeof (sth = regex) && "[object Function]" === Object.prototype.toString.call(sth) ? regex : function(isStrict) { return isStrict && strictRegex ? strictRegex : regex; }; } function getParseRegexForToken(token, config) { return hasOwnProp(regexes, token) ? regexes[token](config._strict, config._locale) : new RegExp(token.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, (function(matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; })).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")); } var tokens = {}; function addParseToken(token, callback) { var i, func = callback; for ("string" == typeof token && (token = [ token ]), "number" == typeof callback && (func = function(input, array) { array[callback] = toInt(input); }), i = 0; i < token.length; i++) tokens[token[i]] = func; } function addWeekParseToken(token, callback) { addParseToken(token, (function(input, array, config, token) { config._w = config._w || {}, callback(input, config._w, config, token); })); } function addTimeToArrayFromToken(token, input, config) { null != input && hasOwnProp(tokens, token) && tokens[token](input, config._a, config, token); } function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); } addFormatToken("M", [ "MM", 2 ], "Mo", (function() { return this.month() + 1; })), addFormatToken("MMM", 0, 0, (function(format) { return this.localeData().monthsShort(this, format); })), addFormatToken("MMMM", 0, 0, (function(format) { return this.localeData().months(this, format); })), addUnitAlias("month", "M"), addRegexToken("M", match1to2), addRegexToken("MM", match1to2, match2), addRegexToken("MMM", matchWord), addRegexToken("MMMM", matchWord), addParseToken([ "M", "MM" ], (function(input, array) { array[1] = toInt(input) - 1; })), addParseToken([ "MMM", "MMMM" ], (function(input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); null != month ? array[1] = month : getParsingFlags(config).invalidMonth = input; })); var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"); var defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"); function setMonth(mom, value) { var dayOfMonth; return "string" == typeof value && "number" != typeof (value = mom.localeData().monthsParse(value)) || (dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)), mom._d["set" + (mom._isUTC ? "UTC" : "") + "Month"](value, dayOfMonth)), mom; } function getSetMonth(value) { return null != value ? (setMonth(this, value), utils_hooks__hooks.updateOffset(this, !0), this) : get_set__get(this, "Month"); } function checkOverflow(m) { var overflow, a = m._a; return a && -2 === getParsingFlags(m).overflow && (overflow = a[1] < 0 || a[1] > 11 ? 1 : a[2] < 1 || a[2] > daysInMonth(a[0], a[1]) ? 2 : a[3] < 0 || a[3] > 24 || 24 === a[3] && (0 !== a[4] || 0 !== a[5] || 0 !== a[6]) ? 3 : a[4] < 0 || a[4] > 59 ? 4 : a[5] < 0 || a[5] > 59 ? 5 : a[6] < 0 || a[6] > 999 ? 6 : -1, getParsingFlags(m)._overflowDayOfYear && (overflow < 0 || overflow > 2) && (overflow = 2), getParsingFlags(m).overflow = overflow), m; } function warn(msg) { !1 === utils_hooks__hooks.suppressDeprecationWarnings && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + msg); } function deprecate(msg, fn) { var firstTime = !0; return extend((function() { return firstTime && (warn(msg + "\n" + (new Error).stack), firstTime = !1), fn.apply(this, arguments); }), fn); } var deprecations = {}; utils_hooks__hooks.suppressDeprecationWarnings = !1; var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, isoDates = [ [ "YYYYYY-MM-DD", /[+-]\d{6}-\d{2}-\d{2}/ ], [ "YYYY-MM-DD", /\d{4}-\d{2}-\d{2}/ ], [ "GGGG-[W]WW-E", /\d{4}-W\d{2}-\d/ ], [ "GGGG-[W]WW", /\d{4}-W\d{2}/ ], [ "YYYY-DDD", /\d{4}-\d{3}/ ] ], isoTimes = [ [ "HH:mm:ss.SSSS", /(T| )\d\d:\d\d:\d\d\.\d+/ ], [ "HH:mm:ss", /(T| )\d\d:\d\d:\d\d/ ], [ "HH:mm", /(T| )\d\d:\d\d/ ], [ "HH", /(T| )\d\d/ ] ], aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; function configFromISO(config) { var i, l, string = config._i, match = from_string__isoRegex.exec(string); if (match) { for (getParsingFlags(config).iso = !0, i = 0, l = isoDates.length; i < l; i++) if (isoDates[i][1].exec(string)) { config._f = isoDates[i][0]; break; } for (i = 0, l = isoTimes.length; i < l; i++) if (isoTimes[i][1].exec(string)) { config._f += (match[6] || " ") + isoTimes[i][0]; break; } string.match(matchOffset) && (config._f += "Z"), configFromStringAndFormat(config); } else config._isValid = !1; } function createDate(y, m, d, h, M, s, ms) { var date = new Date(y, m, d, h, M, s, ms); return y < 1970 && date.setFullYear(y), date; } function createUTCDate(y) { var date = new Date(Date.UTC.apply(null, arguments)); return y < 1970 && date.setUTCFullYear(y), date; } function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } function isLeapYear(year) { return year % 4 == 0 && year % 100 != 0 || year % 400 == 0; } utils_hooks__hooks.createFromInputFallback = deprecate("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.", (function(config) { config._d = new Date(config._i + (config._useUTC ? " UTC" : "")); })), addFormatToken(0, [ "YY", 2 ], 0, (function() { return this.year() % 100; })), addFormatToken(0, [ "YYYY", 4 ], 0, "year"), addFormatToken(0, [ "YYYYY", 5 ], 0, "year"), addFormatToken(0, [ "YYYYYY", 6, !0 ], 0, "year"), addUnitAlias("year", "y"), addRegexToken("Y", matchSigned), addRegexToken("YY", match1to2, match2), addRegexToken("YYYY", match1to4, match4), addRegexToken("YYYYY", match1to6, match6), addRegexToken("YYYYYY", match1to6, match6), addParseToken([ "YYYYY", "YYYYYY" ], 0), addParseToken("YYYY", (function(input, array) { array[0] = 2 === input.length ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input); })), addParseToken("YY", (function(input, array) { array[0] = utils_hooks__hooks.parseTwoDigitYear(input); })), utils_hooks__hooks.parseTwoDigitYear = function(input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3); }; var getSetYear = makeGetSet("FullYear", !1); function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { var adjustedMoment, end = firstDayOfWeekOfYear - firstDayOfWeek, daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(); return daysToDayOfWeek > end && (daysToDayOfWeek -= 7), daysToDayOfWeek < end - 7 && (daysToDayOfWeek += 7), adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, "d"), { week: Math.ceil(adjustedMoment.dayOfYear() / 7), year: adjustedMoment.year() }; } addFormatToken("w", [ "ww", 2 ], "wo", "week"), addFormatToken("W", [ "WW", 2 ], "Wo", "isoWeek"), addUnitAlias("week", "w"), addUnitAlias("isoWeek", "W"), addRegexToken("w", match1to2), addRegexToken("ww", match1to2, match2), addRegexToken("W", match1to2), addRegexToken("WW", match1to2, match2), addWeekParseToken([ "w", "ww", "W", "WW" ], (function(input, week, config, token) { week[token.substr(0, 1)] = toInt(input); })); function defaults(a, b, c) { return null != a ? a : null != b ? b : c; } function configFromArray(config) { var i, date, currentDate, yearToUse, input = []; if (!config._d) { for (currentDate = (function(config) { var now = new Date; return config._useUTC ? [ now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() ] : [ now.getFullYear(), now.getMonth(), now.getDate() ]; })(config), config._w && null == config._a[2] && null == config._a[1] && (function(config) { var w, weekYear, week, weekday, dow, doy, temp; null != (w = config._w).GG || null != w.W || null != w.E ? (dow = 1, doy = 4, weekYear = defaults(w.GG, config._a[0], weekOfYear(local__createLocal(), 1, 4).year), week = defaults(w.W, 1), weekday = defaults(w.E, 1)) : (dow = config._locale._week.dow, doy = config._locale._week.doy, weekYear = defaults(w.gg, config._a[0], weekOfYear(local__createLocal(), dow, doy).year), week = defaults(w.w, 1), null != w.d ? (weekday = w.d) < dow && ++week : weekday = null != w.e ? w.e + dow : dow), temp = (function(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { var dayOfYear, week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, d = createUTCDate(year, 0, 1 + week1Jan).getUTCDay(); return d < firstDayOfWeek && (d += 7), { year: (dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + (weekday = null != weekday ? 1 * weekday : firstDayOfWeek)) > 0 ? year : year - 1, dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear }; })(weekYear, week, weekday, doy, dow), config._a[0] = temp.year, config._dayOfYear = temp.dayOfYear; })(config), config._dayOfYear && (yearToUse = defaults(config._a[0], currentDate[0]), config._dayOfYear > daysInYear(yearToUse) && (getParsingFlags(config)._overflowDayOfYear = !0), date = createUTCDate(yearToUse, 0, config._dayOfYear), config._a[1] = date.getUTCMonth(), config._a[2] = date.getUTCDate()), i = 0; i < 3 && null == config._a[i]; ++i) config._a[i] = input[i] = currentDate[i]; for (;i < 7; i++) config._a[i] = input[i] = null == config._a[i] ? 2 === i ? 1 : 0 : config._a[i]; 24 === config._a[3] && 0 === config._a[4] && 0 === config._a[5] && 0 === config._a[6] && (config._nextDay = !0, config._a[3] = 0), config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input), null != config._tzm && config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm), config._nextDay && (config._a[3] = 24); } } function configFromStringAndFormat(config) { if (config._f !== utils_hooks__hooks.ISO_8601) { config._a = [], getParsingFlags(config).empty = !0; var i, parsedInput, tokens, token, skipped, string = "" + config._i, stringLength = string.length, totalParsedInputLength = 0; for (tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [], i = 0; i < tokens.length; i++) token = tokens[i], (parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]) && ((skipped = string.substr(0, string.indexOf(parsedInput))).length > 0 && getParsingFlags(config).unusedInput.push(skipped), string = string.slice(string.indexOf(parsedInput) + parsedInput.length), totalParsedInputLength += parsedInput.length), formatTokenFunctions[token] ? (parsedInput ? getParsingFlags(config).empty = !1 : getParsingFlags(config).unusedTokens.push(token), addTimeToArrayFromToken(token, parsedInput, config)) : config._strict && !parsedInput && getParsingFlags(config).unusedTokens.push(token); getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength, string.length > 0 && getParsingFlags(config).unusedInput.push(string), !0 === getParsingFlags(config).bigHour && config._a[3] <= 12 && config._a[3] > 0 && (getParsingFlags(config).bigHour = void 0), config._a[3] = (function(locale, hour, meridiem) { var isPm; return null == meridiem ? hour : null != locale.meridiemHour ? locale.meridiemHour(hour, meridiem) : null != locale.isPM ? ((isPm = locale.isPM(meridiem)) && hour < 12 && (hour += 12), isPm || 12 !== hour || (hour = 0), hour) : hour; })(config._locale, config._a[3], config._meridiem), configFromArray(config), checkOverflow(config); } else configFromISO(config); } function prepareConfig(config) { var input = config._i, format = config._f; return config._locale = config._locale || locale_locales__getLocale(config._l), null === input || void 0 === format && "" === input ? valid__createInvalid({ nullInput: !0 }) : ("string" == typeof input && (config._i = input = config._locale.preparse(input)), isMoment(input) ? new Moment(checkOverflow(input)) : (isArray(format) ? (function(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (0 === config._f.length) return getParsingFlags(config).invalidFormat = !0, void (config._d = new Date(NaN)); for (i = 0; i < config._f.length; i++) currentScore = 0, tempConfig = copyConfig({}, config), null != config._useUTC && (tempConfig._useUTC = config._useUTC), tempConfig._f = config._f[i], configFromStringAndFormat(tempConfig), valid__isValid(tempConfig) && (currentScore += getParsingFlags(tempConfig).charsLeftOver, currentScore += 10 * getParsingFlags(tempConfig).unusedTokens.length, getParsingFlags(tempConfig).score = currentScore, (null == scoreToBeat || currentScore < scoreToBeat) && (scoreToBeat = currentScore, bestMoment = tempConfig)); extend(config, bestMoment || tempConfig); })(config) : format ? configFromStringAndFormat(config) : isDate(input) ? config._d = input : (function(config) { var input = config._i; void 0 === input ? config._d = new Date : isDate(input) ? config._d = new Date(+input) : "string" == typeof input ? (function(config) { var matched = aspNetJsonRegex.exec(config._i); null === matched ? (configFromISO(config), !1 === config._isValid && (delete config._isValid, utils_hooks__hooks.createFromInputFallback(config))) : config._d = new Date(+matched[1]); })(config) : isArray(input) ? (config._a = (function(arr, fn) { var i, res = []; for (i = 0; i < arr.length; ++i) res.push(fn(arr[i], i)); return res; })(input.slice(0), (function(obj) { return parseInt(obj, 10); })), configFromArray(config)) : "object" == typeof input ? (function(config) { if (!config._d) { var i = normalizeObjectUnits(config._i); config._a = [ i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond ], configFromArray(config); } })(config) : "number" == typeof input ? config._d = new Date(input) : utils_hooks__hooks.createFromInputFallback(config); })(config), config)); } function createLocalOrUTC(input, format, locale, strict, isUTC) { var res, c = {}; return "boolean" == typeof locale && (strict = locale, locale = void 0), c._isAMomentObject = !0, c._useUTC = c._isUTC = isUTC, c._l = locale, c._i = input, c._f = format, c._strict = strict, (res = new Moment(checkOverflow(prepareConfig(c))))._nextDay && (res.add(1, "d"), res._nextDay = void 0), res; } function local__createLocal(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, !1); } addFormatToken("DDD", [ "DDDD", 3 ], "DDDo", "dayOfYear"), addUnitAlias("dayOfYear", "DDD"), addRegexToken("DDD", match1to3), addRegexToken("DDDD", match3), addParseToken([ "DDD", "DDDD" ], (function(input, array, config) { config._dayOfYear = toInt(input); })), utils_hooks__hooks.ISO_8601 = function() {}; var prototypeMin = deprecate("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", (function() { var other = local__createLocal.apply(null, arguments); return other < this ? this : other; })), prototypeMax = deprecate("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", (function() { var other = local__createLocal.apply(null, arguments); return other > this ? this : other; })); function pickBy(fn, moments) { var res, i; if (1 === moments.length && isArray(moments[0]) && (moments = moments[0]), !moments.length) return local__createLocal(); for (res = moments[0], i = 1; i < moments.length; ++i) moments[i].isValid() && !moments[i][fn](res) || (res = moments[i]); return res; } function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; this._milliseconds = +milliseconds + 1e3 * seconds + 6e4 * minutes + 36e5 * hours, this._days = +days + 7 * weeks, this._months = +months + 3 * quarters + 12 * years, this._data = {}, this._locale = locale_locales__getLocale(), this._bubble(); } function isDuration(obj) { return obj instanceof Duration; } function offset(token, separator) { addFormatToken(token, 0, 0, (function() { var offset = this.utcOffset(), sign = "+"; return offset < 0 && (offset = -offset, sign = "-"), sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2); })); } offset("Z", ":"), offset("ZZ", ""), addRegexToken("Z", matchOffset), addRegexToken("ZZ", matchOffset), addParseToken([ "Z", "ZZ" ], (function(input, array, config) { config._useUTC = !0, config._tzm = offsetFromString(input); })); var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(string) { var matches = (string || "").match(matchOffset) || [], parts = ((matches[matches.length - 1] || []) + "").match(chunkOffset) || [ "-", 0, 0 ], minutes = 60 * parts[1] + toInt(parts[2]); return "+" === parts[0] ? minutes : -minutes; } function cloneWithOffset(input, model) { var res, diff; return model._isUTC ? (res = model.clone(), diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - +res, res._d.setTime(+res._d + diff), utils_hooks__hooks.updateOffset(res, !1), res) : local__createLocal(input).local(); } function getDateOffset(m) { return 15 * -Math.round(m._d.getTimezoneOffset() / 15); } function isUtc() { return this._isUTC && 0 === this._offset; } utils_hooks__hooks.updateOffset = function() {}; var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; function create__createDuration(input, key) { var sign, ret, diffRes, base, other, res, duration = input, match = null; return isDuration(input) ? duration = { ms: input._milliseconds, d: input._days, M: input._months } : "number" == typeof input ? (duration = {}, key ? duration[key] = input : duration.milliseconds = input) : (match = aspNetRegex.exec(input)) ? (sign = "-" === match[1] ? -1 : 1, duration = { y: 0, d: toInt(match[2]) * sign, h: toInt(match[3]) * sign, m: toInt(match[4]) * sign, s: toInt(match[5]) * sign, ms: toInt(match[6]) * sign }) : (match = create__isoRegex.exec(input)) ? (sign = "-" === match[1] ? -1 : 1, duration = { y: parseIso(match[2], sign), M: parseIso(match[3], sign), d: parseIso(match[4], sign), h: parseIso(match[5], sign), m: parseIso(match[6], sign), s: parseIso(match[7], sign), w: parseIso(match[8], sign) }) : null == duration ? duration = {} : "object" == typeof duration && ("from" in duration || "to" in duration) && (base = local__createLocal(duration.from), other = cloneWithOffset(other = local__createLocal(duration.to), base), base.isBefore(other) ? res = positiveMomentsDifference(base, other) : ((res = positiveMomentsDifference(other, base)).milliseconds = -res.milliseconds, res.months = -res.months), (duration = {}).ms = (diffRes = res).milliseconds, duration.M = diffRes.months), ret = new Duration(duration), isDuration(input) && hasOwnProp(input, "_locale") && (ret._locale = input._locale), ret; } function parseIso(inp, sign) { var res = inp && parseFloat(inp.replace(",", ".")); return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = { milliseconds: 0, months: 0 }; return res.months = other.month() - base.month() + 12 * (other.year() - base.year()), base.clone().add(res.months, "M").isAfter(other) && --res.months, res.milliseconds = +other - +base.clone().add(res.months, "M"), res; } function createAdder(direction, name) { return function(val, period) { var tmp; return null === period || isNaN(+period) || ((function(name, msg) { deprecations[name] || (warn(msg), deprecations[name] = !0); })(name, "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period)."), tmp = val, val = period, period = tmp), add_subtract__addSubtract(this, create__createDuration(val = "string" == typeof val ? +val : val, period), direction), this; }; } function add_subtract__addSubtract(mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; updateOffset = null == updateOffset || updateOffset, milliseconds && mom._d.setTime(+mom._d + milliseconds * isAdding), days && get_set__set(mom, "Date", get_set__get(mom, "Date") + days * isAdding), months && setMonth(mom, get_set__get(mom, "Month") + months * isAdding), updateOffset && utils_hooks__hooks.updateOffset(mom, days || months); } create__createDuration.fn = Duration.prototype; var add_subtract__add = createAdder(1, "add"), add_subtract__subtract = createAdder(-1, "subtract"); function moment_format__toISOString() { var m = this.clone().utc(); return 0 < m.year() && m.year() <= 9999 ? "function" == typeof Date.prototype.toISOString ? this.toDate().toISOString() : formatMoment(m, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]") : formatMoment(m, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"); } function locale(key) { var newLocaleData; return void 0 === key ? this._locale._abbr : (null != (newLocaleData = locale_locales__getLocale(key)) && (this._locale = newLocaleData), this); } utils_hooks__hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ"; var lang = deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", (function(key) { return void 0 === key ? this.localeData() : this.locale(key); })); function localeData() { return this._locale; } function addWeekYearFormatToken(token, getter) { addFormatToken(0, [ token, token.length ], 0, getter); } function weeksInYear(year, dow, doy) { return weekOfYear(local__createLocal([ year, 11, 31 + dow - doy ]), dow, doy).week; } addFormatToken(0, [ "gg", 2 ], 0, (function() { return this.weekYear() % 100; })), addFormatToken(0, [ "GG", 2 ], 0, (function() { return this.isoWeekYear() % 100; })), addWeekYearFormatToken("gggg", "weekYear"), addWeekYearFormatToken("ggggg", "weekYear"), addWeekYearFormatToken("GGGG", "isoWeekYear"), addWeekYearFormatToken("GGGGG", "isoWeekYear"), addUnitAlias("weekYear", "gg"), addUnitAlias("isoWeekYear", "GG"), addRegexToken("G", matchSigned), addRegexToken("g", matchSigned), addRegexToken("GG", match1to2, match2), addRegexToken("gg", match1to2, match2), addRegexToken("GGGG", match1to4, match4), addRegexToken("gggg", match1to4, match4), addRegexToken("GGGGG", match1to6, match6), addRegexToken("ggggg", match1to6, match6), addWeekParseToken([ "gggg", "ggggg", "GGGG", "GGGGG" ], (function(input, week, config, token) { week[token.substr(0, 2)] = toInt(input); })), addWeekParseToken([ "gg", "GG" ], (function(input, week, config, token) { week[token] = utils_hooks__hooks.parseTwoDigitYear(input); })), addFormatToken("Q", 0, 0, "quarter"), addUnitAlias("quarter", "Q"), addRegexToken("Q", match1), addParseToken("Q", (function(input, array) { array[1] = 3 * (toInt(input) - 1); })), addFormatToken("D", [ "DD", 2 ], "Do", "date"), addUnitAlias("date", "D"), addRegexToken("D", match1to2), addRegexToken("DD", match1to2, match2), addRegexToken("Do", (function(isStrict, locale) { return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; })), addParseToken([ "D", "DD" ], 2), addParseToken("Do", (function(input, array) { array[2] = toInt(input.match(match1to2)[0]); })); var getSetDayOfMonth = makeGetSet("Date", !0); addFormatToken("d", 0, "do", "day"), addFormatToken("dd", 0, 0, (function(format) { return this.localeData().weekdaysMin(this, format); })), addFormatToken("ddd", 0, 0, (function(format) { return this.localeData().weekdaysShort(this, format); })), addFormatToken("dddd", 0, 0, (function(format) { return this.localeData().weekdays(this, format); })), addFormatToken("e", 0, 0, "weekday"), addFormatToken("E", 0, 0, "isoWeekday"), addUnitAlias("day", "d"), addUnitAlias("weekday", "e"), addUnitAlias("isoWeekday", "E"), addRegexToken("d", match1to2), addRegexToken("e", match1to2), addRegexToken("E", match1to2), addRegexToken("dd", matchWord), addRegexToken("ddd", matchWord), addRegexToken("dddd", matchWord), addWeekParseToken([ "dd", "ddd", "dddd" ], (function(input, week, config) { var weekday = config._locale.weekdaysParse(input); null != weekday ? week.d = weekday : getParsingFlags(config).invalidWeekday = input; })), addWeekParseToken([ "d", "e", "E" ], (function(input, week, config, token) { week[token] = toInt(input); })); var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"); var defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"); var defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"); function meridiem(token, lowercase) { addFormatToken(token, 0, 0, (function() { return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); })); } function matchMeridiem(isStrict, locale) { return locale._meridiemParse; } addFormatToken("H", [ "HH", 2 ], 0, "hour"), addFormatToken("h", [ "hh", 2 ], 0, (function() { return this.hours() % 12 || 12; })), meridiem("a", !0), meridiem("A", !1), addUnitAlias("hour", "h"), addRegexToken("a", matchMeridiem), addRegexToken("A", matchMeridiem), addRegexToken("H", match1to2), addRegexToken("h", match1to2), addRegexToken("HH", match1to2, match2), addRegexToken("hh", match1to2, match2), addParseToken([ "H", "HH" ], 3), addParseToken([ "a", "A" ], (function(input, array, config) { config._isPm = config._locale.isPM(input), config._meridiem = input; })), addParseToken([ "h", "hh" ], (function(input, array, config) { array[3] = toInt(input), getParsingFlags(config).bigHour = !0; })); var getSetHour = makeGetSet("Hours", !0); addFormatToken("m", [ "mm", 2 ], 0, "minute"), addUnitAlias("minute", "m"), addRegexToken("m", match1to2), addRegexToken("mm", match1to2, match2), addParseToken([ "m", "mm" ], 4); var getSetMinute = makeGetSet("Minutes", !1); addFormatToken("s", [ "ss", 2 ], 0, "second"), addUnitAlias("second", "s"), addRegexToken("s", match1to2), addRegexToken("ss", match1to2, match2), addParseToken([ "s", "ss" ], 5); var token, getSetSecond = makeGetSet("Seconds", !1); for (addFormatToken("S", 0, 0, (function() { return ~~(this.millisecond() / 100); })), addFormatToken(0, [ "SS", 2 ], 0, (function() { return ~~(this.millisecond() / 10); })), addFormatToken(0, [ "SSS", 3 ], 0, "millisecond"), addFormatToken(0, [ "SSSS", 4 ], 0, (function() { return 10 * this.millisecond(); })), addFormatToken(0, [ "SSSSS", 5 ], 0, (function() { return 100 * this.millisecond(); })), addFormatToken(0, [ "SSSSSS", 6 ], 0, (function() { return 1e3 * this.millisecond(); })), addFormatToken(0, [ "SSSSSSS", 7 ], 0, (function() { return 1e4 * this.millisecond(); })), addFormatToken(0, [ "SSSSSSSS", 8 ], 0, (function() { return 1e5 * this.millisecond(); })), addFormatToken(0, [ "SSSSSSSSS", 9 ], 0, (function() { return 1e6 * this.millisecond(); })), addUnitAlias("millisecond", "ms"), addRegexToken("S", match1to3, match1), addRegexToken("SS", match1to3, match2), addRegexToken("SSS", match1to3, match3), token = "SSSS"; token.length <= 9; token += "S") addRegexToken(token, matchUnsigned); function parseMs(input, array) { array[6] = toInt(1e3 * ("0." + input)); } for (token = "S"; token.length <= 9; token += "S") addParseToken(token, parseMs); var getSetMillisecond = makeGetSet("Milliseconds", !1); addFormatToken("z", 0, 0, "zoneAbbr"), addFormatToken("zz", 0, 0, "zoneName"); var momentPrototype__proto = Moment.prototype; momentPrototype__proto.add = add_subtract__add, momentPrototype__proto.calendar = function(time, formats) { var now = time || local__createLocal(), sod = cloneWithOffset(now, this).startOf("day"), diff = this.diff(sod, "days", !0), format = diff < -6 ? "sameElse" : diff < -1 ? "lastWeek" : diff < 0 ? "lastDay" : diff < 1 ? "sameDay" : diff < 2 ? "nextDay" : diff < 7 ? "nextWeek" : "sameElse"; return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); }, momentPrototype__proto.clone = function() { return new Moment(this); }, momentPrototype__proto.diff = function(input, units, asFloat) { var delta, output, that = cloneWithOffset(input, this), zoneDelta = 6e4 * (that.utcOffset() - this.utcOffset()); return "year" === (units = normalizeUnits(units)) || "month" === units || "quarter" === units ? (output = (function(a, b) { var wholeMonthDiff = 12 * (b.year() - a.year()) + (b.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"); return -(wholeMonthDiff + (b - anchor < 0 ? (b - anchor) / (anchor - a.clone().add(wholeMonthDiff - 1, "months")) : (b - anchor) / (a.clone().add(wholeMonthDiff + 1, "months") - anchor))); })(this, that), "quarter" === units ? output /= 3 : "year" === units && (output /= 12)) : (delta = this - that, output = "second" === units ? delta / 1e3 : "minute" === units ? delta / 6e4 : "hour" === units ? delta / 36e5 : "day" === units ? (delta - zoneDelta) / 864e5 : "week" === units ? (delta - zoneDelta) / 6048e5 : delta), asFloat ? output : absFloor(output); }, momentPrototype__proto.endOf = function(units) { return void 0 === (units = normalizeUnits(units)) || "millisecond" === units ? this : this.startOf(units).add(1, "isoWeek" === units ? "week" : units).subtract(1, "ms"); }, momentPrototype__proto.format = function(inputString) { var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat); return this.localeData().postformat(output); }, momentPrototype__proto.from = function(time, withoutSuffix) { return this.isValid() ? create__createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix) : this.localeData().invalidDate(); }, momentPrototype__proto.fromNow = function(withoutSuffix) { return this.from(local__createLocal(), withoutSuffix); }, momentPrototype__proto.to = function(time, withoutSuffix) { return this.isValid() ? create__createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix) : this.localeData().invalidDate(); }, momentPrototype__proto.toNow = function(withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); }, momentPrototype__proto.get = getSet, momentPrototype__proto.invalidAt = function() { return getParsingFlags(this).overflow; }, momentPrototype__proto.isAfter = function(input, units) { return "millisecond" === (units = normalizeUnits(void 0 !== units ? units : "millisecond")) ? +this > +(input = isMoment(input) ? input : local__createLocal(input)) : (isMoment(input) ? +input : +local__createLocal(input)) < +this.clone().startOf(units); }, momentPrototype__proto.isBefore = function(input, units) { var inputMs; return "millisecond" === (units = normalizeUnits(void 0 !== units ? units : "millisecond")) ? +this < +(input = isMoment(input) ? input : local__createLocal(input)) : (inputMs = isMoment(input) ? +input : +local__createLocal(input), +this.clone().endOf(units) < inputMs); }, momentPrototype__proto.isBetween = function(from, to, units) { return this.isAfter(from, units) && this.isBefore(to, units); }, momentPrototype__proto.isSame = function(input, units) { var inputMs; return "millisecond" === (units = normalizeUnits(units || "millisecond")) ? +this == +(input = isMoment(input) ? input : local__createLocal(input)) : (inputMs = +local__createLocal(input), +this.clone().startOf(units) <= inputMs && inputMs <= +this.clone().endOf(units)); }, momentPrototype__proto.isValid = function() { return valid__isValid(this); }, momentPrototype__proto.lang = lang, momentPrototype__proto.locale = locale, momentPrototype__proto.localeData = localeData, momentPrototype__proto.max = prototypeMax, momentPrototype__proto.min = prototypeMin, momentPrototype__proto.parsingFlags = function() { return extend({}, getParsingFlags(this)); }, momentPrototype__proto.set = getSet, momentPrototype__proto.startOf = function(units) { switch (units = normalizeUnits(units)) { case "year": this.month(0); case "quarter": case "month": this.date(1); case "week": case "isoWeek": case "day": this.hours(0); case "hour": this.minutes(0); case "minute": this.seconds(0); case "second": this.milliseconds(0); } return "week" === units && this.weekday(0), "isoWeek" === units && this.isoWeekday(1), "quarter" === units && this.month(3 * Math.floor(this.month() / 3)), this; }, momentPrototype__proto.subtract = add_subtract__subtract, momentPrototype__proto.toArray = function() { var m = this; return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond() ]; }, momentPrototype__proto.toObject = function() { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds() }; }, momentPrototype__proto.toDate = function() { return this._offset ? new Date(+this) : this._d; }, momentPrototype__proto.toISOString = moment_format__toISOString, momentPrototype__proto.toJSON = moment_format__toISOString, momentPrototype__proto.toString = function() { return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); }, momentPrototype__proto.unix = function() { return Math.floor(+this / 1e3); }, momentPrototype__proto.valueOf = function() { return +this._d - 6e4 * (this._offset || 0); }, momentPrototype__proto.year = getSetYear, momentPrototype__proto.isLeapYear = function() { return isLeapYear(this.year()); }, momentPrototype__proto.weekYear = function(input) { var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; return null == input ? year : this.add(input - year, "y"); }, momentPrototype__proto.isoWeekYear = function(input) { var year = weekOfYear(this, 1, 4).year; return null == input ? year : this.add(input - year, "y"); }, momentPrototype__proto.quarter = momentPrototype__proto.quarters = function(input) { return null == input ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (input - 1) + this.month() % 3); }, momentPrototype__proto.month = getSetMonth, momentPrototype__proto.daysInMonth = function() { return daysInMonth(this.year(), this.month()); }, momentPrototype__proto.week = momentPrototype__proto.weeks = function(input) { var week = this.localeData().week(this); return null == input ? week : this.add(7 * (input - week), "d"); }, momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = function(input) { var week = weekOfYear(this, 1, 4).week; return null == input ? week : this.add(7 * (input - week), "d"); }, momentPrototype__proto.weeksInYear = function() { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); }, momentPrototype__proto.isoWeeksInYear = function() { return weeksInYear(this.year(), 1, 4); }, momentPrototype__proto.date = getSetDayOfMonth, momentPrototype__proto.day = momentPrototype__proto.days = function(input) { var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); return null != input ? (input = (function(input, locale) { return "string" != typeof input ? input : isNaN(input) ? "number" == typeof (input = locale.weekdaysParse(input)) ? input : null : parseInt(input, 10); })(input, this.localeData()), this.add(input - day, "d")) : day; }, momentPrototype__proto.weekday = function(input) { var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return null == input ? weekday : this.add(input - weekday, "d"); }, momentPrototype__proto.isoWeekday = function(input) { return null == input ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); }, momentPrototype__proto.dayOfYear = function(input) { var dayOfYear = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; return null == input ? dayOfYear : this.add(input - dayOfYear, "d"); }, momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour, momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute, momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond, momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond, momentPrototype__proto.utcOffset = function(input, keepLocalTime) { var localAdjust, offset = this._offset || 0; return null != input ? ("string" == typeof input && (input = offsetFromString(input)), Math.abs(input) < 16 && (input *= 60), !this._isUTC && keepLocalTime && (localAdjust = getDateOffset(this)), this._offset = input, this._isUTC = !0, null != localAdjust && this.add(localAdjust, "m"), offset !== input && (!keepLocalTime || this._changeInProgress ? add_subtract__addSubtract(this, create__createDuration(input - offset, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, utils_hooks__hooks.updateOffset(this, !0), this._changeInProgress = null)), this) : this._isUTC ? offset : getDateOffset(this); }, momentPrototype__proto.utc = function(keepLocalTime) { return this.utcOffset(0, keepLocalTime); }, momentPrototype__proto.local = function(keepLocalTime) { return this._isUTC && (this.utcOffset(0, keepLocalTime), this._isUTC = !1, keepLocalTime && this.subtract(getDateOffset(this), "m")), this; }, momentPrototype__proto.parseZone = function() { return this._tzm ? this.utcOffset(this._tzm) : "string" == typeof this._i && this.utcOffset(offsetFromString(this._i)), this; }, momentPrototype__proto.hasAlignedHourOffset = function(input) { return input = input ? local__createLocal(input).utcOffset() : 0, (this.utcOffset() - input) % 60 == 0; }, momentPrototype__proto.isDST = function() { return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset(); }, momentPrototype__proto.isDSTShifted = function() { if (void 0 !== this._isDSTShifted) return this._isDSTShifted; var c = {}; if (copyConfig(c, this), (c = prepareConfig(c))._a) { var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else this._isDSTShifted = !1; return this._isDSTShifted; }, momentPrototype__proto.isLocal = function() { return !this._isUTC; }, momentPrototype__proto.isUtcOffset = function() { return this._isUTC; }, momentPrototype__proto.isUtc = isUtc, momentPrototype__proto.isUTC = isUtc, momentPrototype__proto.zoneAbbr = function() { return this._isUTC ? "UTC" : ""; }, momentPrototype__proto.zoneName = function() { return this._isUTC ? "Coordinated Universal Time" : ""; }, momentPrototype__proto.dates = deprecate("dates accessor is deprecated. Use date instead.", getSetDayOfMonth), momentPrototype__proto.months = deprecate("months accessor is deprecated. Use month instead", getSetMonth), momentPrototype__proto.years = deprecate("years accessor is deprecated. Use year instead", getSetYear), momentPrototype__proto.zone = deprecate("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779", (function(input, keepLocalTime) { return null != input ? ("string" != typeof input && (input = -input), this.utcOffset(input, keepLocalTime), this) : -this.utcOffset(); })); var momentPrototype = momentPrototype__proto; function preParsePostFormat(string) { return string; } var prototype__proto = Locale.prototype; function lists__get(format, index, field, setter) { var locale = locale_locales__getLocale(), utc = create_utc__createUTC().set(setter, index); return locale[field](utc, format); } function list(format, index, field, count, setter) { if ("number" == typeof format && (index = format, format = void 0), format = format || "", null != index) return lists__get(format, index, field, setter); var i, out = []; for (i = 0; i < count; i++) out[i] = lists__get(format, i, field, setter); return out; } prototype__proto._calendar = { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }, prototype__proto.calendar = function(key, mom, now) { var output = this._calendar[key]; return "function" == typeof output ? output.call(mom, now) : output; }, prototype__proto._longDateFormat = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, prototype__proto.longDateFormat = function(key) { var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; return format || !formatUpper ? format : (this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, (function(val) { return val.slice(1); })), this._longDateFormat[key]); }, prototype__proto._invalidDate = "Invalid date", prototype__proto.invalidDate = function() { return this._invalidDate; }, prototype__proto._ordinal = "%d", prototype__proto.ordinal = function(number) { return this._ordinal.replace("%d", number); }, prototype__proto._ordinalParse = /\d{1,2}/, prototype__proto.preparse = preParsePostFormat, prototype__proto.postformat = preParsePostFormat, prototype__proto._relativeTime = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }, prototype__proto.relativeTime = function(number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return "function" == typeof output ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); }, prototype__proto.pastFuture = function(diff, output) { var format = this._relativeTime[diff > 0 ? "future" : "past"]; return "function" == typeof format ? format(output) : format.replace(/%s/i, output); }, prototype__proto.set = function(config) { var prop, i; for (i in config) "function" == typeof (prop = config[i]) ? this[i] = prop : this["_" + i] = prop; this._ordinalParseLenient = new RegExp(this._ordinalParse.source + "|" + /\d{1,2}/.source); }, prototype__proto.months = function(m) { return this._months[m.month()]; }, prototype__proto._months = defaultLocaleMonths, prototype__proto.monthsShort = function(m) { return this._monthsShort[m.month()]; }, prototype__proto._monthsShort = defaultLocaleMonthsShort, prototype__proto.monthsParse = function(monthName, format, strict) { var i, mom, regex; for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), i = 0; i < 12; i++) { if (mom = create_utc__createUTC([ 2e3, i ]), strict && !this._longMonthsParse[i] && (this._longMonthsParse[i] = new RegExp("^" + this.months(mom, "").replace(".", "") + "$", "i"), this._shortMonthsParse[i] = new RegExp("^" + this.monthsShort(mom, "").replace(".", "") + "$", "i")), strict || this._monthsParse[i] || (regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, ""), this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i")), strict && "MMMM" === format && this._longMonthsParse[i].test(monthName)) return i; if (strict && "MMM" === format && this._shortMonthsParse[i].test(monthName)) return i; if (!strict && this._monthsParse[i].test(monthName)) return i; } }, prototype__proto.week = function(mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; }, prototype__proto._week = { dow: 0, doy: 6 }, prototype__proto.firstDayOfYear = function() { return this._week.doy; }, prototype__proto.firstDayOfWeek = function() { return this._week.dow; }, prototype__proto.weekdays = function(m) { return this._weekdays[m.day()]; }, prototype__proto._weekdays = defaultLocaleWeekdays, prototype__proto.weekdaysMin = function(m) { return this._weekdaysMin[m.day()]; }, prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin, prototype__proto.weekdaysShort = function(m) { return this._weekdaysShort[m.day()]; }, prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort, prototype__proto.weekdaysParse = function(weekdayName) { var i, mom, regex; for (this._weekdaysParse = this._weekdaysParse || [], i = 0; i < 7; i++) if (this._weekdaysParse[i] || (mom = local__createLocal([ 2e3, 1 ]).day(i), regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, ""), this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i")), this._weekdaysParse[i].test(weekdayName)) return i; }, prototype__proto.isPM = function(input) { return "p" === (input + "").toLowerCase().charAt(0); }, prototype__proto._meridiemParse = /[ap]\.?m?\.?/i, prototype__proto.meridiem = function(hours, minutes, isLower) { return hours > 11 ? isLower ? "pm" : "PM" : isLower ? "am" : "AM"; }, locale_locales__getSetGlobalLocale("en", { ordinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function(number) { var b = number % 10; return number + (1 === toInt(number % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th"); } }), utils_hooks__hooks.lang = deprecate("moment.lang is deprecated. Use moment.locale instead.", locale_locales__getSetGlobalLocale), utils_hooks__hooks.langData = deprecate("moment.langData is deprecated. Use moment.localeData instead.", locale_locales__getLocale); var mathAbs = Math.abs; function duration_add_subtract__addSubtract(duration, input, value, direction) { var other = create__createDuration(input, value); return duration._milliseconds += direction * other._milliseconds, duration._days += direction * other._days, duration._months += direction * other._months, duration._bubble(); } function absCeil(number) { return number < 0 ? Math.floor(number) : Math.ceil(number); } function daysToMonths(days) { return 4800 * days / 146097; } function monthsToDays(months) { return 146097 * months / 4800; } function makeAs(alias) { return function() { return this.as(alias); }; } var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asYears = makeAs("y"); function makeGetter(name) { return function() { return this._data[name]; }; } var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years"); var round = Math.round, thresholds = { s: 45, m: 45, h: 22, d: 26, M: 11 }; function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } var iso_string__abs = Math.abs; function iso_string__toISOString() { var minutes, hours, seconds = iso_string__abs(this._milliseconds) / 1e3, days = iso_string__abs(this._days), months = iso_string__abs(this._months); minutes = absFloor(seconds / 60), hours = absFloor(minutes / 60), seconds %= 60, minutes %= 60; var Y = absFloor(months / 12), M = months %= 12, D = days, h = hours, m = minutes, s = seconds, total = this.asSeconds(); return total ? (total < 0 ? "-" : "") + "P" + (Y ? Y + "Y" : "") + (M ? M + "M" : "") + (D ? D + "D" : "") + (h || m || s ? "T" : "") + (h ? h + "H" : "") + (m ? m + "M" : "") + (s ? s + "S" : "") : "P0D"; } var duration_prototype__proto = Duration.prototype; return duration_prototype__proto.abs = function() { var data = this._data; return this._milliseconds = mathAbs(this._milliseconds), this._days = mathAbs(this._days), this._months = mathAbs(this._months), data.milliseconds = mathAbs(data.milliseconds), data.seconds = mathAbs(data.seconds), data.minutes = mathAbs(data.minutes), data.hours = mathAbs(data.hours), data.months = mathAbs(data.months), data.years = mathAbs(data.years), this; }, duration_prototype__proto.add = function(input, value) { return duration_add_subtract__addSubtract(this, input, value, 1); }, duration_prototype__proto.subtract = function(input, value) { return duration_add_subtract__addSubtract(this, input, value, -1); }, duration_prototype__proto.as = function(units) { var days, months, milliseconds = this._milliseconds; if ("month" === (units = normalizeUnits(units)) || "year" === units) return days = this._days + milliseconds / 864e5, months = this._months + daysToMonths(days), "month" === units ? months : months / 12; switch (days = this._days + Math.round(monthsToDays(this._months)), units) { case "week": return days / 7 + milliseconds / 6048e5; case "day": return days + milliseconds / 864e5; case "hour": return 24 * days + milliseconds / 36e5; case "minute": return 1440 * days + milliseconds / 6e4; case "second": return 86400 * days + milliseconds / 1e3; case "millisecond": return Math.floor(864e5 * days) + milliseconds; default: throw new Error("Unknown unit " + units); } }, duration_prototype__proto.asMilliseconds = asMilliseconds, duration_prototype__proto.asSeconds = asSeconds, duration_prototype__proto.asMinutes = asMinutes, duration_prototype__proto.asHours = asHours, duration_prototype__proto.asDays = asDays, duration_prototype__proto.asWeeks = asWeeks, duration_prototype__proto.asMonths = asMonths, duration_prototype__proto.asYears = asYears, duration_prototype__proto.valueOf = function() { return this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * toInt(this._months / 12); }, duration_prototype__proto._bubble = function() { var seconds, minutes, hours, years, monthsFromDays, milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data; return milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0 || (milliseconds += 864e5 * absCeil(monthsToDays(months) + days), days = 0, months = 0), data.milliseconds = milliseconds % 1e3, seconds = absFloor(milliseconds / 1e3), data.seconds = seconds % 60, minutes = absFloor(seconds / 60), data.minutes = minutes % 60, hours = absFloor(minutes / 60), data.hours = hours % 24, days += absFloor(hours / 24), months += monthsFromDays = absFloor(daysToMonths(days)), days -= absCeil(monthsToDays(monthsFromDays)), years = absFloor(months / 12), months %= 12, data.days = days, data.months = months, data.years = years, this; }, duration_prototype__proto.get = function(units) { return this[(units = normalizeUnits(units)) + "s"](); }, duration_prototype__proto.milliseconds = milliseconds, duration_prototype__proto.seconds = seconds, duration_prototype__proto.minutes = minutes, duration_prototype__proto.hours = hours, duration_prototype__proto.days = days, duration_prototype__proto.weeks = function() { return absFloor(this.days() / 7); }, duration_prototype__proto.months = months, duration_prototype__proto.years = years, duration_prototype__proto.humanize = function(withSuffix) { var locale = this.localeData(), output = (function(posNegDuration, withoutSuffix, locale) { var duration = create__createDuration(posNegDuration).abs(), seconds = round(duration.as("s")), minutes = round(duration.as("m")), hours = round(duration.as("h")), days = round(duration.as("d")), months = round(duration.as("M")), years = round(duration.as("y")), a = seconds < thresholds.s && [ "s", seconds ] || 1 === minutes && [ "m" ] || minutes < thresholds.m && [ "mm", minutes ] || 1 === hours && [ "h" ] || hours < thresholds.h && [ "hh", hours ] || 1 === days && [ "d" ] || days < thresholds.d && [ "dd", days ] || 1 === months && [ "M" ] || months < thresholds.M && [ "MM", months ] || 1 === years && [ "y" ] || [ "yy", years ]; return a[2] = withoutSuffix, a[3] = +posNegDuration > 0, a[4] = locale, substituteTimeAgo.apply(null, a); })(this, !withSuffix, locale); return withSuffix && (output = locale.pastFuture(+this, output)), locale.postformat(output); }, duration_prototype__proto.toISOString = iso_string__toISOString, duration_prototype__proto.toString = iso_string__toISOString, duration_prototype__proto.toJSON = iso_string__toISOString, duration_prototype__proto.locale = locale, duration_prototype__proto.localeData = localeData, duration_prototype__proto.toIsoString = deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", iso_string__toISOString), duration_prototype__proto.lang = lang, addFormatToken("X", 0, 0, "unix"), addFormatToken("x", 0, 0, "valueOf"), addRegexToken("x", matchSigned), addRegexToken("X", /[+-]?\d+(\.\d{1,3})?/), addParseToken("X", (function(input, array, config) { config._d = new Date(1e3 * parseFloat(input, 10)); })), addParseToken("x", (function(input, array, config) { config._d = new Date(toInt(input)); })), utils_hooks__hooks.version = "2.10.6", hookCallback = local__createLocal, utils_hooks__hooks.fn = momentPrototype, utils_hooks__hooks.min = function() { return pickBy("isBefore", [].slice.call(arguments, 0)); }, utils_hooks__hooks.max = function() { return pickBy("isAfter", [].slice.call(arguments, 0)); }, utils_hooks__hooks.utc = create_utc__createUTC, utils_hooks__hooks.unix = function(input) { return local__createLocal(1e3 * input); }, utils_hooks__hooks.months = function(format, index) { return list(format, index, "months", 12, "month"); }, utils_hooks__hooks.isDate = isDate, utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale, utils_hooks__hooks.invalid = valid__createInvalid, utils_hooks__hooks.duration = create__createDuration, utils_hooks__hooks.isMoment = isMoment, utils_hooks__hooks.weekdays = function(format, index) { return list(format, index, "weekdays", 7, "day"); }, utils_hooks__hooks.parseZone = function() { return local__createLocal.apply(null, arguments).parseZone(); }, utils_hooks__hooks.localeData = locale_locales__getLocale, utils_hooks__hooks.isDuration = isDuration, utils_hooks__hooks.monthsShort = function(format, index) { return list(format, index, "monthsShort", 12, "month"); }, utils_hooks__hooks.weekdaysMin = function(format, index) { return list(format, index, "weekdaysMin", 7, "day"); }, utils_hooks__hooks.defineLocale = defineLocale, utils_hooks__hooks.weekdaysShort = function(format, index) { return list(format, index, "weekdaysShort", 7, "day"); }, utils_hooks__hooks.normalizeUnits = normalizeUnits, utils_hooks__hooks.relativeTimeThreshold = function(threshold, limit) { return void 0 !== thresholds[threshold] && (void 0 === limit ? thresholds[threshold] : (thresholds[threshold] = limit, !0)); }, utils_hooks__hooks; })(); }).call(this, __webpack_require__(69)(module)); }, function(module, exports) { module.exports = require("fs"); }, function(module, exports) { module.exports = require("stream"); }, function(module, exports) { module.exports = require("events"); }, function(module, exports) { module.exports = require("path"); }, function(module, exports) { module.exports = require("crypto"); }, function(module, exports) { module.exports = require("url"); }, function(module, exports, __webpack_require__) { try { var util = __webpack_require__(0); if ("function" != typeof util.inherits) throw ""; module.exports = util.inherits; } catch (e) { module.exports = __webpack_require__(598); } }, function(module, exports, __webpack_require__) { "undefined" != typeof process && "renderer" === process.type ? module.exports = __webpack_require__(587) : module.exports = __webpack_require__(589); }, function(module, exports) { module.exports = require("buffer"); }, function(module, exports) { module.exports = require("http"); }, function(module, exports, __webpack_require__) { "use strict"; var byEbmlID = { 128: { name: "ChapterDisplay", level: 4, type: "m", multiple: !0, minver: 1, webm: !0, description: "Contains all possible strings to use for the chapter display." }, 131: { name: "TrackType", level: 3, type: "u", mandatory: !0, minver: 1, range: "1-254", description: "A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)." }, 133: { name: "ChapString", cppname: "ChapterString", level: 5, type: "8", mandatory: !0, minver: 1, webm: !0, description: "Contains the string to use as the chapter atom." }, 134: { name: "CodecID", level: 3, type: "s", mandatory: !0, minver: 1, description: "An ID corresponding to the codec, see the codec page for more info." }, 136: { name: "FlagDefault", cppname: "TrackFlagDefault", level: 3, type: "u", mandatory: !0, minver: 1, default: 1, range: "0-1", description: "Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)" }, 137: { name: "ChapterTrackNumber", level: 5, type: "u", mandatory: !0, multiple: !0, minver: 1, webm: !1, range: "not 0", description: "UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks." }, 145: { name: "ChapterTimeStart", level: 4, type: "u", mandatory: !0, minver: 1, webm: !0, description: "Timestamp of the start of Chapter (not scaled)." }, 146: { name: "ChapterTimeEnd", level: 4, type: "u", minver: 1, webm: !1, description: "Timestamp of the end of Chapter (timestamp excluded, not scaled)." }, 150: { name: "CueRefTime", level: 5, type: "u", mandatory: !0, minver: 2, webm: !1, description: "Timestamp of the referenced Block." }, 151: { name: "CueRefCluster", level: 5, type: "u", mandatory: !0, webm: !1, description: "The Position of the Cluster containing the referenced Block." }, 152: { name: "ChapterFlagHidden", level: 4, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, range: "0-1", description: "If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)" }, 16980: { name: "ContentCompAlgo", level: 6, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping" }, 16981: { name: "ContentCompSettings", level: 6, type: "b", minver: 1, webm: !1, description: "Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track." }, 17026: { name: "DocType", level: 1, type: "s", mandatory: !0, default: "matroska", minver: 1, description: "A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files." }, 17029: { name: "DocTypeReadVersion", level: 1, type: "u", mandatory: !0, default: 1, minver: 1, description: "The minimum DocType version an interpreter has to support to read this file." }, 17030: { name: "EBMLVersion", level: 1, type: "u", mandatory: !0, default: 1, minver: 1, description: "The version of EBML parser used to create the file." }, 17031: { name: "DocTypeVersion", level: 1, type: "u", mandatory: !0, default: 1, minver: 1, description: "The version of DocType interpreter used to create the file." }, 17476: { name: "SegmentFamily", level: 2, type: "b", multiple: !0, minver: 1, webm: !1, bytesize: 16, description: "A randomly generated unique ID that all segments related to each other must use (128 bits)." }, 17505: { name: "DateUTC", level: 2, type: "d", minver: 1, description: "Date of the origin of timestamp (value 0), i.e. production date." }, 17540: { name: "TagDefault", level: 4, type: "u", mandatory: !0, minver: 1, webm: !1, default: 1, range: "0-1", description: "Indication to know if this is the default/original language to use for the given tag. (1 bit)" }, 17541: { name: "TagBinary", level: 4, type: "b", minver: 1, webm: !1, description: "The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString." }, 17543: { name: "TagString", level: 4, type: "8", minver: 1, webm: !1, description: "The value of the Element." }, 17545: { name: "Duration", level: 2, type: "f", minver: 1, range: "> 0", description: "Duration of the segment (based on TimecodeScale)." }, 17816: { name: "ChapterFlagEnabled", level: 4, type: "u", mandatory: !0, minver: 1, webm: !1, default: 1, range: "0-1", description: "Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)" }, 18016: { name: "FileMimeType", level: 3, type: "s", mandatory: !0, minver: 1, webm: !1, description: "MIME type of the file." }, 18017: { name: "FileUsedStartTime", level: 3, type: "u", divx: !0, description: "DivX font extension" }, 18018: { name: "FileUsedEndTime", level: 3, type: "u", divx: !0, description: "DivX font extension" }, 18037: { name: "FileReferral", level: 3, type: "b", webm: !1, description: "A binary value that a track/codec can refer to when the attachment is needed." }, 20529: { name: "ContentEncodingOrder", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment." }, 20530: { name: "ContentEncodingScope", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 1, range: "not 0", description: "A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)" }, 20531: { name: "ContentEncodingType", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption" }, 20532: { name: "ContentCompression", level: 5, type: "m", minver: 1, webm: !1, description: "Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking." }, 20533: { name: "ContentEncryption", level: 5, type: "m", minver: 1, webm: !1, description: "Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise." }, 21368: { name: "CueBlockNumber", level: 4, type: "u", minver: 1, default: 1, range: "not 0", description: "Number of the Block in the specified Cluster." }, 22100: { name: "ChapterStringUID", level: 4, type: "8", mandatory: !1, minver: 3, webm: !0, description: "A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage." }, 22337: { name: "WritingApp", level: 2, type: "8", mandatory: !0, minver: 1, description: 'Writing application ("mkvmerge-0.3.3").' }, 22612: { name: "SilentTracks", cppname: "ClusterSilentTracks", level: 2, type: "m", minver: 1, webm: !1, description: "The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use." }, 25152: { name: "ContentEncoding", level: 4, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "Settings for one content encoding like compression or encryption." }, 25188: { name: "BitDepth", cppname: "AudioBitDepth", level: 4, type: "u", minver: 1, range: "not 0", description: "Bits per sample, mostly used for PCM." }, 25906: { name: "SignedElement", level: 3, type: "b", multiple: !0, webm: !1, description: "An element ID whose data will be used to compute the signature." }, 26148: { name: "TrackTranslate", level: 3, type: "m", multiple: !0, minver: 1, webm: !1, description: "The track identification for the given Chapter Codec." }, 26897: { name: "ChapProcessCommand", cppname: "ChapterProcessCommand", level: 5, type: "m", multiple: !0, minver: 1, webm: !1, description: "Contains all the commands associated to the Atom." }, 26914: { name: "ChapProcessTime", cppname: "ChapterProcessTime", level: 6, type: "u", mandatory: !0, minver: 1, webm: !1, description: "Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)." }, 26916: { name: "ChapterTranslate", level: 2, type: "m", multiple: !0, minver: 1, webm: !1, description: "A tuple of corresponding ID used by chapter codecs to represent this segment." }, 26931: { name: "ChapProcessData", cppname: "ChapterProcessData", level: 6, type: "b", mandatory: !0, minver: 1, webm: !1, description: "Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands." }, 26948: { name: "ChapProcess", cppname: "ChapterProcess", level: 4, type: "m", multiple: !0, minver: 1, webm: !1, description: "Contains all the commands associated to the Atom." }, 26965: { name: "ChapProcessCodecID", cppname: "ChapterProcessCodecID", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later." }, 29555: { name: "Tag", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "Element containing elements specific to Tracks/Chapters." }, 29572: { name: "SegmentFilename", level: 2, type: "8", minver: 1, webm: !1, description: "A filename corresponding to this segment." }, 29766: { name: "AttachmentLink", cppname: "TrackAttachmentLink", level: 3, type: "u", minver: 1, webm: !1, range: "not 0", description: "The UID of an attachment that is used by this codec." }, 2459272: { name: "CodecName", level: 3, type: "8", minver: 1, description: "A human-readable string specifying the codec." }, 408125543: { name: "Segment", level: "0", type: "m", mandatory: !0, multiple: !0, minver: 1, description: "This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment." }, 17530: { name: "TagLanguage", level: 4, type: "s", mandatory: !0, minver: 1, webm: !1, default: "und", description: "Specifies the language of the tag specified, in the Matroska languages form." }, 17827: { name: "TagName", level: 4, type: "8", mandatory: !0, minver: 1, webm: !1, description: "The name of the Tag that is going to be stored." }, 26568: { name: "SimpleTag", cppname: "TagSimple", level: 3, recursive: "1", type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "Contains general information about the target." }, 25542: { name: "TagAttachmentUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, default: 0, description: "A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment." }, 25540: { name: "TagChapterUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, default: 0, description: "A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment." }, 25545: { name: "TagEditionUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, default: 0, description: "A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment." }, 25541: { name: "TagTrackUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, default: 0, description: "A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment." }, 25546: { name: "TargetType", cppname: "TagTargetType", level: 4, type: "s", minver: 1, webm: !1, strong: "informational", description: 'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).' }, 26826: { name: "TargetTypeValue", cppname: "TagTargetTypeValue", level: 4, type: "u", minver: 1, webm: !1, default: 50, description: "A number to indicate the logical level of the target (see TargetType)." }, 25536: { name: "Targets", cppname: "TagTargets", level: 3, type: "m", mandatory: !0, minver: 1, webm: !1, description: "Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment." }, 307544935: { name: "Tags", level: 1, type: "m", multiple: !0, minver: 1, webm: !1, description: "Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here." }, 17677: { name: "ChapProcessPrivate", cppname: "ChapterProcessPrivate", level: 5, type: "b", minver: 1, webm: !1, description: 'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.' }, 17278: { name: "ChapCountry", cppname: "ChapterCountry", level: 5, type: "s", multiple: !0, minver: 1, webm: !1, description: "The countries corresponding to the string, same 2 octets as in Internet domains." }, 17276: { name: "ChapLanguage", cppname: "ChapterLanguage", level: 5, type: "s", mandatory: !0, multiple: !0, minver: 1, webm: !0, default: "eng", description: "The languages corresponding to the string, in the bibliographic ISO-639-2 form." }, 143: { name: "ChapterTrack", level: 4, type: "m", minver: 1, webm: !1, description: "List of tracks on which the chapter applies. If this element is not present, all tracks apply" }, 25539: { name: "ChapterPhysicalEquiv", level: 4, type: "u", minver: 1, webm: !1, description: 'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.' }, 28348: { name: "ChapterSegmentEditionUID", level: 4, type: "u", minver: 1, webm: !1, range: "not 0", description: "The EditionUID to play from the segment linked in ChapterSegmentUID." }, 28263: { name: "ChapterSegmentUID", level: 4, type: "b", minver: 1, webm: !1, range: ">0", bytesize: 16, description: "A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used." }, 29636: { name: "ChapterUID", level: 4, type: "u", mandatory: !0, minver: 1, webm: !0, range: "not 0", description: "A unique ID to identify the Chapter." }, 182: { name: "ChapterAtom", level: 3, recursive: "1", type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !0, description: "Contains the atom information to use as the chapter atom (apply to all tracks)." }, 17885: { name: "EditionFlagOrdered", level: 3, type: "u", minver: 1, webm: !1, default: 0, range: "0-1", description: "Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)" }, 17883: { name: "EditionFlagDefault", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, range: "0-1", description: "If a flag is set (1) the edition should be used as the default one. (1 bit)" }, 17853: { name: "EditionFlagHidden", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, range: "0-1", description: "If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)" }, 17852: { name: "EditionUID", level: 3, type: "u", minver: 1, webm: !1, range: "not 0", description: "A unique ID to identify the edition. It's useful for tagging an edition." }, 17849: { name: "EditionEntry", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !0, description: "Contains all information about a segment edition." }, 272869232: { name: "Chapters", level: 1, type: "m", minver: 1, webm: !0, description: "A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation." }, 18094: { name: "FileUID", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, range: "not 0", description: "Unique ID representing the file, as random as possible." }, 18012: { name: "FileData", level: 3, type: "b", mandatory: !0, minver: 1, webm: !1, description: "The data of the file." }, 18030: { name: "FileName", level: 3, type: "8", mandatory: !0, minver: 1, webm: !1, description: "Filename of the attached file." }, 18046: { name: "FileDescription", level: 3, type: "8", minver: 1, webm: !1, description: "A human-friendly name for the attached file." }, 24999: { name: "AttachedFile", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "An attached file." }, 423732329: { name: "Attachments", level: 1, type: "m", minver: 1, webm: !1, description: "Contain attached files." }, 235: { name: "CueRefCodecState", level: 5, type: "u", webm: !1, default: 0, description: "The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry." }, 21343: { name: "CueRefNumber", level: 5, type: "u", webm: !1, default: 1, range: "not 0", description: "Number of the referenced Block of Track X in the specified Cluster." }, 219: { name: "CueReference", level: 4, type: "m", multiple: !0, minver: 2, webm: !1, description: "The Clusters containing the required referenced Blocks." }, 234: { name: "CueCodecState", level: 4, type: "u", minver: 2, webm: !1, default: 0, description: "The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry." }, 178: { name: "CueDuration", level: 4, type: "u", mandatory: !1, minver: 4, webm: !1, description: "The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues." }, 240: { name: "CueRelativePosition", level: 4, type: "u", mandatory: !1, minver: 4, webm: !1, description: "The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.", position: "clusterRelative" }, 241: { name: "CueClusterPosition", level: 4, type: "u", mandatory: !0, minver: 1, description: "The position of the Cluster containing the required Block.", position: "segment" }, 247: { name: "CueTrack", level: 4, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "The track for which a position is given." }, 183: { name: "CueTrackPositions", level: 3, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Contain positions for different tracks corresponding to the timestamp." }, 179: { name: "CueTime", level: 3, type: "u", mandatory: !0, minver: 1, description: "Absolute timestamp according to the segment time base." }, 187: { name: "CuePoint", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Contains all information relative to a seek point in the segment." }, 475249515: { name: "Cues", level: 1, type: "m", minver: 1, description: 'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.' }, 18406: { name: "ContentSigHashAlgo", level: 6, type: "u", minver: 1, webm: !1, default: 0, description: "The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5" }, 18405: { name: "ContentSigAlgo", level: 6, type: "u", minver: 1, webm: !1, default: 0, description: "The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA" }, 18404: { name: "ContentSigKeyID", level: 6, type: "b", minver: 1, webm: !1, description: "This is the ID of the private key the data was signed with." }, 18403: { name: "ContentSignature", level: 6, type: "b", minver: 1, webm: !1, description: "A cryptographic signature of the contents." }, 18402: { name: "ContentEncKeyID", level: 6, type: "b", minver: 1, webm: !1, description: "For public key algorithms this is the ID of the public key the the data was encrypted with." }, 18401: { name: "ContentEncAlgo", level: 6, type: "u", minver: 1, webm: !1, default: 0, description: "The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES" }, 28032: { name: "ContentEncodings", level: 3, type: "m", minver: 1, webm: !1, description: "Settings for several content encoding mechanisms like compression or encryption." }, 196: { name: "TrickMasterTrackSegmentUID", level: 3, type: "b", divx: !0, bytesize: 16, description: "DivX trick track extenstions" }, 199: { name: "TrickMasterTrackUID", level: 3, type: "u", divx: !0, description: "DivX trick track extenstions" }, 198: { name: "TrickTrackFlag", level: 3, type: "u", divx: !0, default: 0, description: "DivX trick track extenstions" }, 193: { name: "TrickTrackSegmentUID", level: 3, type: "b", divx: !0, bytesize: 16, description: "DivX trick track extenstions" }, 192: { name: "TrickTrackUID", level: 3, type: "u", divx: !0, description: "DivX trick track extenstions" }, 237: { name: "TrackJoinUID", level: 5, type: "u", mandatory: !0, multiple: !0, minver: 3, webm: !1, range: "not 0", description: "The trackUID number of a track whose blocks are used to create this virtual track." }, 233: { name: "TrackJoinBlocks", level: 4, type: "m", minver: 3, webm: !1, description: "Contains the list of all tracks whose Blocks need to be combined to create this virtual track" }, 230: { name: "TrackPlaneType", level: 6, type: "u", mandatory: !0, minver: 3, webm: !1, description: "The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)." }, 229: { name: "TrackPlaneUID", level: 6, type: "u", mandatory: !0, minver: 3, webm: !1, range: "not 0", description: "The trackUID number of the track representing the plane." }, 228: { name: "TrackPlane", level: 5, type: "m", mandatory: !0, multiple: !0, minver: 3, webm: !1, description: "Contains a video plane track that need to be combined to create this 3D track" }, 227: { name: "TrackCombinePlanes", level: 4, type: "m", minver: 3, webm: !1, description: "Contains the list of all video plane tracks that need to be combined to create this 3D track" }, 226: { name: "TrackOperation", level: 3, type: "m", minver: 3, webm: !1, description: "Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject." }, 32123: { name: "ChannelPositions", cppname: "AudioPosition", level: 4, type: "b", webm: !1, description: "Table of horizontal angles for each successive channel, see appendix." }, 159: { name: "Channels", cppname: "AudioChannels", level: 4, type: "u", mandatory: !0, minver: 1, default: 1, range: "not 0", description: "Numbers of channels in the track." }, 30901: { name: "OutputSamplingFrequency", cppname: "AudioOutputSamplingFreq", level: 4, type: "f", minver: 1, default: "Sampling Frequency", range: "> 0", description: "Real output sampling frequency in Hz (used for SBR techniques)." }, 181: { name: "SamplingFrequency", cppname: "AudioSamplingFreq", level: 4, type: "f", mandatory: !0, minver: 1, default: 8e3, range: "> 0", description: "Sampling frequency in Hz." }, 225: { name: "Audio", cppname: "TrackAudio", level: 3, type: "m", minver: 1, description: "Audio settings." }, 2327523: { name: "FrameRate", cppname: "VideoFrameRate", level: 4, type: "f", range: "> 0", strong: "Informational", description: "Number of frames per second. only." }, 3126563: { name: "GammaValue", cppname: "VideoGamma", level: 4, type: "f", webm: !1, range: "> 0", description: "Gamma Value." }, 3061028: { name: "ColourSpace", cppname: "VideoColourSpace", level: 4, type: "b", minver: 1, webm: !1, bytesize: 4, description: "Same value as in AVI (32 bits)." }, 21683: { name: "AspectRatioType", cppname: "VideoAspectRatio", level: 4, type: "u", minver: 1, default: 0, description: "Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)." }, 21682: { name: "DisplayUnit", cppname: "VideoDisplayUnit", level: 4, type: "u", minver: 1, default: 0, description: "How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)." }, 21690: { name: "DisplayHeight", cppname: "VideoDisplayHeight", level: 4, type: "u", minver: 1, default: "PixelHeight", range: "not 0", description: "Height of the video frames to display. The default value is only valid when DisplayUnit is 0." }, 21680: { name: "DisplayWidth", cppname: "VideoDisplayWidth", level: 4, type: "u", minver: 1, default: "PixelWidth", range: "not 0", description: "Width of the video frames to display. The default value is only valid when DisplayUnit is 0." }, 21725: { name: "PixelCropRight", cppname: "VideoPixelCropRight", level: 4, type: "u", minver: 1, default: 0, description: "The number of video pixels to remove on the right of the image." }, 21708: { name: "PixelCropLeft", cppname: "VideoPixelCropLeft", level: 4, type: "u", minver: 1, default: 0, description: "The number of video pixels to remove on the left of the image." }, 21691: { name: "PixelCropTop", cppname: "VideoPixelCropTop", level: 4, type: "u", minver: 1, default: 0, description: "The number of video pixels to remove at the top of the image." }, 21674: { name: "PixelCropBottom", cppname: "VideoPixelCropBottom", level: 4, type: "u", minver: 1, default: 0, description: "The number of video pixels to remove at the bottom of the image (for HDTV content)." }, 186: { name: "PixelHeight", cppname: "VideoPixelHeight", level: 4, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "Height of the encoded video frames in pixels." }, 176: { name: "PixelWidth", cppname: "VideoPixelWidth", level: 4, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "Width of the encoded video frames in pixels." }, 21433: { name: "OldStereoMode", level: 4, type: "u", maxver: "0", webm: !1, divx: !1, description: "DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)." }, 21440: { name: "AlphaMode", cppname: "VideoAlphaMode", level: 4, type: "u", minver: 3, webm: !0, default: 0, description: "Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data." }, 21432: { name: "StereoMode", cppname: "VideoStereoMode", level: 4, type: "u", minver: 3, webm: !0, default: 0, description: "Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes." }, 154: { name: "FlagInterlaced", cppname: "VideoFlagInterlaced", level: 4, type: "u", mandatory: !0, minver: 2, webm: !0, default: 0, range: "0-1", description: "Set if the video is interlaced. (1 bit)" }, 224: { name: "Video", cppname: "TrackVideo", level: 3, type: "m", minver: 1, description: "Video settings." }, 26277: { name: "TrackTranslateTrackID", level: 4, type: "b", mandatory: !0, minver: 1, webm: !1, description: "The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used." }, 26303: { name: "TrackTranslateCodec", level: 4, type: "u", mandatory: !0, minver: 1, webm: !1, description: "The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)." }, 26364: { name: "TrackTranslateEditionUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, description: "Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment." }, 22203: { name: "SeekPreRoll", level: 3, type: "u", mandatory: !0, multiple: !1, default: 0, minver: 4, webm: !0, description: "After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid." }, 22186: { name: "CodecDelay", level: 3, type: "u", multiple: !1, default: 0, minver: 4, webm: !0, description: "CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster." }, 28587: { name: "TrackOverlay", level: 3, type: "u", multiple: !0, minver: 1, webm: !1, description: "Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc." }, 170: { name: "CodecDecodeAll", level: 3, type: "u", mandatory: !0, minver: 2, webm: !1, default: 1, range: "0-1", description: "The codec can decode potentially damaged data (1 bit)." }, 2536e3: { name: "CodecDownloadURL", level: 3, type: "s", multiple: !0, webm: !1, description: "A URL to download about the codec used." }, 3883072: { name: "CodecInfoURL", level: 3, type: "s", multiple: !0, webm: !1, description: "A URL to find information about the codec used." }, 3839639: { name: "CodecSettings", level: 3, type: "8", webm: !1, description: "A string describing the encoding setting used." }, 25506: { name: "CodecPrivate", level: 3, type: "b", minver: 1, description: "Private data only known to the codec." }, 2274716: { name: "Language", cppname: "TrackLanguage", level: 3, type: "s", minver: 1, default: "eng", description: "Specifies the language of the track in the Matroska languages form." }, 21358: { name: "Name", cppname: "TrackName", level: 3, type: "8", minver: 1, description: "A human-readable track name." }, 21998: { name: "MaxBlockAdditionID", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "The maximum value of BlockAdditions for this track." }, 21375: { name: "TrackOffset", level: 3, type: "i", webm: !1, default: 0, description: "A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track." }, 2306383: { name: "TrackTimecodeScale", level: 3, type: "f", mandatory: !0, minver: 1, maxver: "3", webm: !1, default: 1, range: "> 0", description: "DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)." }, 2313850: { name: "DefaultDecodedFieldDuration", cppname: "TrackDefaultDecodedFieldDuration", level: 3, type: "u", minver: 4, range: "not 0", description: "The period in nanoseconds (not scaled by TimcodeScale)\nbetween two successive fields at the output of the decoding process (see the notes)" }, 2352003: { name: "DefaultDuration", cppname: "TrackDefaultDuration", level: 3, type: "u", minver: 1, range: "not 0", description: "Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)." }, 28152: { name: "MaxCache", cppname: "TrackMaxCache", level: 3, type: "u", minver: 1, webm: !1, description: "The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed." }, 28135: { name: "MinCache", cppname: "TrackMinCache", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used." }, 156: { name: "FlagLacing", cppname: "TrackFlagLacing", level: 3, type: "u", mandatory: !0, minver: 1, default: 1, range: "0-1", description: "Set if the track may contain blocks using lacing. (1 bit)" }, 21930: { name: "FlagForced", cppname: "TrackFlagForced", level: 3, type: "u", mandatory: !0, minver: 1, default: 0, range: "0-1", description: "Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)" }, 185: { name: "FlagEnabled", cppname: "TrackFlagEnabled", level: 3, type: "u", mandatory: !0, minver: 2, webm: !0, default: 1, range: "0-1", description: "Set if the track is usable. (1 bit)" }, 29637: { name: "TrackUID", level: 3, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file." }, 215: { name: "TrackNumber", level: 3, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)." }, 174: { name: "TrackEntry", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Describes a track with all elements." }, 374648427: { name: "Tracks", level: 1, type: "m", multiple: !0, minver: 1, description: "A top-level block of information with many tracks described." }, 175: { name: "EncryptedBlock", level: 2, type: "b", multiple: !0, webm: !1, description: "Similar to EncryptedBlock Structure)" }, 202: { name: "ReferenceTimeCode", level: 4, type: "u", multiple: !1, mandatory: !0, minver: 0, webm: !1, divx: !0, description: "DivX trick track extenstions" }, 201: { name: "ReferenceOffset", level: 4, type: "u", multiple: !1, mandatory: !0, minver: 0, webm: !1, divx: !0, description: "DivX trick track extenstions" }, 200: { name: "ReferenceFrame", level: 3, type: "m", multiple: !1, minver: 0, webm: !1, divx: !0, description: "DivX trick track extenstions" }, 207: { name: "SliceDuration", level: 5, type: "u", default: 0, description: "The (scaled) duration to apply to the element." }, 206: { name: "Delay", cppname: "SliceDelay", level: 5, type: "u", default: 0, description: "The (scaled) delay to apply to the element." }, 203: { name: "BlockAdditionID", cppname: "SliceBlockAddID", level: 5, type: "u", default: 0, description: "The ID of the BlockAdditional element (0 is the main Block)." }, 205: { name: "FrameNumber", cppname: "SliceFrameNumber", level: 5, type: "u", default: 0, description: "The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)." }, 204: { name: "LaceNumber", cppname: "SliceLaceNumber", level: 5, type: "u", minver: 1, default: 0, divx: !1, description: "The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback." }, 232: { name: "TimeSlice", level: 4, type: "m", multiple: !0, minver: 1, divx: !1, description: "Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback." }, 142: { name: "Slices", level: 3, type: "m", minver: 1, divx: !1, description: "Contains slices description." }, 30114: { name: "DiscardPadding", level: 3, type: "i", minver: 4, webm: !0, description: "Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback." }, 164: { name: "CodecState", level: 3, type: "b", minver: 2, webm: !1, description: "The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry." }, 253: { name: "ReferenceVirtual", level: 3, type: "i", webm: !1, description: "Relative position of the data that should be in position of the virtual block." }, 251: { name: "ReferenceBlock", level: 3, type: "i", multiple: !0, minver: 1, description: "Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to." }, 250: { name: "ReferencePriority", cppname: "FlagReferenced", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced." }, 155: { name: "BlockDuration", level: 3, type: "u", minver: 1, default: "TrackDuration", description: 'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.' }, 165: { name: "BlockAdditional", level: 5, type: "b", mandatory: !0, minver: 1, webm: !1, description: "Interpreted by the codec as it wishes (using the BlockAddID)." }, 238: { name: "BlockAddID", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 1, range: "not 0", description: "An ID to identify the BlockAdditional level." }, 166: { name: "BlockMore", level: 4, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "Contain the BlockAdditional and some parameters." }, 30113: { name: "BlockAdditions", level: 3, type: "m", minver: 1, webm: !1, description: "Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data." }, 162: { name: "BlockVirtual", level: 3, type: "b", webm: !1, description: "A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)" }, 161: { name: "Block", level: 3, type: "b", mandatory: !0, minver: 1, description: "Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)" }, 160: { name: "BlockGroup", level: 2, type: "m", multiple: !0, minver: 1, description: "Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock." }, 163: { name: "SimpleBlock", level: 2, type: "b", multiple: !0, minver: 2, webm: !0, divx: !0, description: "Similar to SimpleBlock Structure" }, 171: { name: "PrevSize", cppname: "ClusterPrevSize", level: 2, type: "u", minver: 1, description: "Size of the previous Cluster, in octets. Can be useful for backward playing.", position: "prevCluster" }, 167: { name: "Position", cppname: "ClusterPosition", level: 2, type: "u", minver: 1, webm: !1, description: "The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.", position: "segment" }, 22743: { name: "SilentTrackNumber", cppname: "ClusterSilentTrackNumber", level: 3, type: "u", multiple: !0, minver: 1, webm: !1, description: "One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster." }, 231: { name: "Timecode", cppname: "ClusterTimecode", level: 2, type: "u", mandatory: !0, minver: 1, description: "Absolute timestamp of the cluster (based on TimecodeScale)." }, 524531317: { name: "Cluster", level: 1, type: "m", multiple: !0, minver: 1, description: "The lower level element containing the (monolithic) Block structure." }, 19840: { name: "MuxingApp", level: 2, type: "8", mandatory: !0, minver: 1, description: 'Muxing application or library ("libmatroska-0.4.3").' }, 31657: { name: "Title", level: 2, type: "8", minver: 1, webm: !1, description: "General name of the segment." }, 2807730: { name: "TimecodeScaleDenominator", level: 2, type: "u", mandatory: !0, minver: 4, default: "1000000000", description: "Timestamp scale numerator, see TimecodeScale." }, 2807729: { name: "TimecodeScale", level: 2, type: "u", mandatory: !0, minver: 1, default: "1000000", description: "Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)." }, 27045: { name: "ChapterTranslateID", level: 3, type: "b", mandatory: !0, minver: 1, webm: !1, description: "The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used." }, 27071: { name: "ChapterTranslateCodec", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, description: "The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)." }, 27132: { name: "ChapterTranslateEditionUID", level: 3, type: "u", multiple: !0, minver: 1, webm: !1, description: "Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment." }, 4096955: { name: "NextFilename", level: 2, type: "8", minver: 1, webm: !1, description: "An escaped filename corresponding to the next segment." }, 4110627: { name: "NextUID", level: 2, type: "b", minver: 1, webm: !1, bytesize: 16, description: "A unique ID to identify the next chained segment (128 bits)." }, 3965867: { name: "PrevFilename", level: 2, type: "8", minver: 1, webm: !1, description: "An escaped filename corresponding to the previous segment." }, 3979555: { name: "PrevUID", level: 2, type: "b", minver: 1, webm: !1, bytesize: 16, description: "A unique ID to identify the previous chained segment (128 bits)." }, 29604: { name: "SegmentUID", level: 2, type: "b", minver: 1, webm: !1, range: "not 0", bytesize: 16, description: "A randomly generated unique ID to identify the current segment between many others (128 bits)." }, 357149030: { name: "Info", level: 1, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Contains miscellaneous general information and statistics on the file." }, 21420: { name: "SeekPosition", level: 3, type: "u", mandatory: !0, minver: 1, description: "The position of the element in the segment in octets (0 = first level 1 element).", position: "segment" }, 21419: { name: "SeekID", level: 3, type: "b", mandatory: !0, minver: 1, description: "The binary ID corresponding to the element name.", type2: "ebmlID" }, 19899: { name: "Seek", cppname: "SeekPoint", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Contains a single seek entry to an EBML element." }, 290298740: { name: "SeekHead", cppname: "SeekHeader", level: 1, type: "m", multiple: !0, minver: 1, description: "Contains the position of other level 1 elements." }, 32379: { name: "SignatureElementList", level: 2, type: "m", multiple: !0, webm: !1, i: "Cluster|Block|BlockAdditional", description: "A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption." }, 32347: { name: "SignatureElements", level: 1, type: "m", webm: !1, description: "Contains elements that will be used to compute the signature." }, 32437: { name: "Signature", level: 1, type: "b", webm: !1, description: "The signature of the data (until a new." }, 32421: { name: "SignaturePublicKey", level: 1, type: "b", webm: !1, description: "The public key to use with the algorithm (in the case of a PKI-based signature)." }, 32410: { name: "SignatureHash", level: 1, type: "u", webm: !1, description: "Hash algorithm used (1=SHA1-160, 2=MD5)." }, 32394: { name: "SignatureAlgo", level: 1, type: "u", webm: !1, description: "Signature algorithm used (1=RSA, 2=elliptic)." }, 458458727: { name: "SignatureSlot", level: -1, type: "m", multiple: !0, webm: !1, description: "Contain signature of some (coming) elements in the stream." }, 191: { name: "CRC-32", level: -1, type: "b", minver: 1, webm: !1, description: "The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian", crc: !0 }, 236: { name: "Void", level: -1, type: "b", minver: 1, description: "Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use." }, 17139: { name: "EBMLMaxSizeLength", level: 1, type: "u", mandatory: !0, default: 8, minver: 1, description: "The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid." }, 17138: { name: "EBMLMaxIDLength", level: 1, type: "u", mandatory: !0, default: 4, minver: 1, description: "The maximum length of the IDs you'll find in this file (4 or less in Matroska)." }, 17143: { name: "EBMLReadVersion", level: 1, type: "u", mandatory: !0, default: 1, minver: 1, description: "The minimum EBML version a parser has to support to read this file." }, 440786851: { name: "EBML", level: "0", type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Set the EBML characteristics of the data to follow. Each EBML document has to start with this." } }, byName = {}, schema = { byEbmlID: byEbmlID, byName: byName }; for (var ebmlID in byEbmlID) byName[byEbmlID[ebmlID].name.replace("-", "_")] = parseInt(ebmlID, 10); module.exports = schema; }, function(module, exports, __webpack_require__) { "use strict"; var byEbmlID = { 128: { name: "ChapterDisplay", level: 4, type: "m", multiple: !0, minver: 1, webm: !0, description: "Contains all possible strings to use for the chapter display." }, 131: { name: "TrackType", level: 3, type: "u", mandatory: !0, minver: 1, range: "1-254", description: "A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)." }, 133: { name: "ChapString", cppname: "ChapterString", level: 5, type: "8", mandatory: !0, minver: 1, webm: !0, description: "Contains the string to use as the chapter atom." }, 134: { name: "CodecID", level: 3, type: "s", mandatory: !0, minver: 1, description: "An ID corresponding to the codec, see the codec page for more info." }, 136: { name: "FlagDefault", cppname: "TrackFlagDefault", level: 3, type: "u", mandatory: !0, minver: 1, default: 1, range: "0-1", description: "Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)" }, 137: { name: "ChapterTrackNumber", level: 5, type: "u", mandatory: !0, multiple: !0, minver: 1, webm: !1, range: "not 0", description: "UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks." }, 145: { name: "ChapterTimeStart", level: 4, type: "u", mandatory: !0, minver: 1, webm: !0, description: "Timestamp of the start of Chapter (not scaled)." }, 146: { name: "ChapterTimeEnd", level: 4, type: "u", minver: 1, webm: !1, description: "Timestamp of the end of Chapter (timestamp excluded, not scaled)." }, 150: { name: "CueRefTime", level: 5, type: "u", mandatory: !0, minver: 2, webm: !1, description: "Timestamp of the referenced Block." }, 151: { name: "CueRefCluster", level: 5, type: "u", mandatory: !0, webm: !1, description: "The Position of the Cluster containing the referenced Block." }, 152: { name: "ChapterFlagHidden", level: 4, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, range: "0-1", description: "If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)" }, 16980: { name: "ContentCompAlgo", level: 6, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping" }, 16981: { name: "ContentCompSettings", level: 6, type: "b", minver: 1, webm: !1, description: "Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track." }, 17026: { name: "DocType", level: 1, type: "s", mandatory: !0, default: "matroska", minver: 1, description: "A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files." }, 17029: { name: "DocTypeReadVersion", level: 1, type: "u", mandatory: !0, default: 1, minver: 1, description: "The minimum DocType version an interpreter has to support to read this file." }, 17030: { name: "EBMLVersion", level: 1, type: "u", mandatory: !0, default: 1, minver: 1, description: "The version of EBML parser used to create the file." }, 17031: { name: "DocTypeVersion", level: 1, type: "u", mandatory: !0, default: 1, minver: 1, description: "The version of DocType interpreter used to create the file." }, 17476: { name: "SegmentFamily", level: 2, type: "b", multiple: !0, minver: 1, webm: !1, bytesize: 16, description: "A randomly generated unique ID that all segments related to each other must use (128 bits)." }, 17505: { name: "DateUTC", level: 2, type: "d", minver: 1, description: "Date of the origin of timestamp (value 0), i.e. production date." }, 17540: { name: "TagDefault", level: 4, type: "u", mandatory: !0, minver: 1, webm: !1, default: 1, range: "0-1", description: "Indication to know if this is the default/original language to use for the given tag. (1 bit)" }, 17541: { name: "TagBinary", level: 4, type: "b", minver: 1, webm: !1, description: "The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString." }, 17543: { name: "TagString", level: 4, type: "8", minver: 1, webm: !1, description: "The value of the Element." }, 17545: { name: "Duration", level: 2, type: "f", minver: 1, range: "> 0", description: "Duration of the segment (based on TimecodeScale)." }, 17816: { name: "ChapterFlagEnabled", level: 4, type: "u", mandatory: !0, minver: 1, webm: !1, default: 1, range: "0-1", description: "Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)" }, 18016: { name: "FileMimeType", level: 3, type: "s", mandatory: !0, minver: 1, webm: !1, description: "MIME type of the file." }, 18017: { name: "FileUsedStartTime", level: 3, type: "u", divx: !0, description: "DivX font extension" }, 18018: { name: "FileUsedEndTime", level: 3, type: "u", divx: !0, description: "DivX font extension" }, 18037: { name: "FileReferral", level: 3, type: "b", webm: !1, description: "A binary value that a track/codec can refer to when the attachment is needed." }, 20529: { name: "ContentEncodingOrder", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment." }, 20530: { name: "ContentEncodingScope", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 1, range: "not 0", description: "A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)" }, 20531: { name: "ContentEncodingType", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption" }, 20532: { name: "ContentCompression", level: 5, type: "m", minver: 1, webm: !1, description: "Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking." }, 20533: { name: "ContentEncryption", level: 5, type: "m", minver: 1, webm: !1, description: "Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise." }, 21368: { name: "CueBlockNumber", level: 4, type: "u", minver: 1, default: 1, range: "not 0", description: "Number of the Block in the specified Cluster." }, 22100: { name: "ChapterStringUID", level: 4, type: "8", mandatory: !1, minver: 3, webm: !0, description: "A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage." }, 22337: { name: "WritingApp", level: 2, type: "8", mandatory: !0, minver: 1, description: 'Writing application ("mkvmerge-0.3.3").' }, 22612: { name: "SilentTracks", cppname: "ClusterSilentTracks", level: 2, type: "m", minver: 1, webm: !1, description: "The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use." }, 25152: { name: "ContentEncoding", level: 4, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "Settings for one content encoding like compression or encryption." }, 25188: { name: "BitDepth", cppname: "AudioBitDepth", level: 4, type: "u", minver: 1, range: "not 0", description: "Bits per sample, mostly used for PCM." }, 25906: { name: "SignedElement", level: 3, type: "b", multiple: !0, webm: !1, description: "An element ID whose data will be used to compute the signature." }, 26148: { name: "TrackTranslate", level: 3, type: "m", multiple: !0, minver: 1, webm: !1, description: "The track identification for the given Chapter Codec." }, 26897: { name: "ChapProcessCommand", cppname: "ChapterProcessCommand", level: 5, type: "m", multiple: !0, minver: 1, webm: !1, description: "Contains all the commands associated to the Atom." }, 26914: { name: "ChapProcessTime", cppname: "ChapterProcessTime", level: 6, type: "u", mandatory: !0, minver: 1, webm: !1, description: "Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)." }, 26916: { name: "ChapterTranslate", level: 2, type: "m", multiple: !0, minver: 1, webm: !1, description: "A tuple of corresponding ID used by chapter codecs to represent this segment." }, 26931: { name: "ChapProcessData", cppname: "ChapterProcessData", level: 6, type: "b", mandatory: !0, minver: 1, webm: !1, description: "Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands." }, 26948: { name: "ChapProcess", cppname: "ChapterProcess", level: 4, type: "m", multiple: !0, minver: 1, webm: !1, description: "Contains all the commands associated to the Atom." }, 26965: { name: "ChapProcessCodecID", cppname: "ChapterProcessCodecID", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later." }, 29555: { name: "Tag", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "Element containing elements specific to Tracks/Chapters." }, 29572: { name: "SegmentFilename", level: 2, type: "8", minver: 1, webm: !1, description: "A filename corresponding to this segment." }, 29766: { name: "AttachmentLink", cppname: "TrackAttachmentLink", level: 3, type: "u", minver: 1, webm: !1, range: "not 0", description: "The UID of an attachment that is used by this codec." }, 2459272: { name: "CodecName", level: 3, type: "8", minver: 1, description: "A human-readable string specifying the codec." }, 408125543: { name: "Segment", level: "0", type: "m", mandatory: !0, multiple: !0, minver: 1, description: "This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment." }, 17530: { name: "TagLanguage", level: 4, type: "s", mandatory: !0, minver: 1, webm: !1, default: "und", description: "Specifies the language of the tag specified, in the Matroska languages form." }, 17827: { name: "TagName", level: 4, type: "8", mandatory: !0, minver: 1, webm: !1, description: "The name of the Tag that is going to be stored." }, 26568: { name: "SimpleTag", cppname: "TagSimple", level: 3, recursive: "1", type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "Contains general information about the target." }, 25542: { name: "TagAttachmentUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, default: 0, description: "A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment." }, 25540: { name: "TagChapterUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, default: 0, description: "A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment." }, 25545: { name: "TagEditionUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, default: 0, description: "A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment." }, 25541: { name: "TagTrackUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, default: 0, description: "A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment." }, 25546: { name: "TargetType", cppname: "TagTargetType", level: 4, type: "s", minver: 1, webm: !1, strong: "informational", description: 'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).' }, 26826: { name: "TargetTypeValue", cppname: "TagTargetTypeValue", level: 4, type: "u", minver: 1, webm: !1, default: 50, description: "A number to indicate the logical level of the target (see TargetType)." }, 25536: { name: "Targets", cppname: "TagTargets", level: 3, type: "m", mandatory: !0, minver: 1, webm: !1, description: "Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment." }, 307544935: { name: "Tags", level: 1, type: "m", multiple: !0, minver: 1, webm: !1, description: "Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here." }, 17677: { name: "ChapProcessPrivate", cppname: "ChapterProcessPrivate", level: 5, type: "b", minver: 1, webm: !1, description: 'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.' }, 17278: { name: "ChapCountry", cppname: "ChapterCountry", level: 5, type: "s", multiple: !0, minver: 1, webm: !1, description: "The countries corresponding to the string, same 2 octets as in Internet domains." }, 17276: { name: "ChapLanguage", cppname: "ChapterLanguage", level: 5, type: "s", mandatory: !0, multiple: !0, minver: 1, webm: !0, default: "eng", description: "The languages corresponding to the string, in the bibliographic ISO-639-2 form." }, 143: { name: "ChapterTrack", level: 4, type: "m", minver: 1, webm: !1, description: "List of tracks on which the chapter applies. If this element is not present, all tracks apply" }, 25539: { name: "ChapterPhysicalEquiv", level: 4, type: "u", minver: 1, webm: !1, description: 'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.' }, 28348: { name: "ChapterSegmentEditionUID", level: 4, type: "u", minver: 1, webm: !1, range: "not 0", description: "The EditionUID to play from the segment linked in ChapterSegmentUID." }, 28263: { name: "ChapterSegmentUID", level: 4, type: "b", minver: 1, webm: !1, range: ">0", bytesize: 16, description: "A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used." }, 29636: { name: "ChapterUID", level: 4, type: "u", mandatory: !0, minver: 1, webm: !0, range: "not 0", description: "A unique ID to identify the Chapter." }, 182: { name: "ChapterAtom", level: 3, recursive: "1", type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !0, description: "Contains the atom information to use as the chapter atom (apply to all tracks)." }, 17885: { name: "EditionFlagOrdered", level: 3, type: "u", minver: 1, webm: !1, default: 0, range: "0-1", description: "Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)" }, 17883: { name: "EditionFlagDefault", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, range: "0-1", description: "If a flag is set (1) the edition should be used as the default one. (1 bit)" }, 17853: { name: "EditionFlagHidden", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, range: "0-1", description: "If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)" }, 17852: { name: "EditionUID", level: 3, type: "u", minver: 1, webm: !1, range: "not 0", description: "A unique ID to identify the edition. It's useful for tagging an edition." }, 17849: { name: "EditionEntry", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !0, description: "Contains all information about a segment edition." }, 272869232: { name: "Chapters", level: 1, type: "m", minver: 1, webm: !0, description: "A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation." }, 18094: { name: "FileUID", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, range: "not 0", description: "Unique ID representing the file, as random as possible." }, 18012: { name: "FileData", level: 3, type: "b", mandatory: !0, minver: 1, webm: !1, description: "The data of the file." }, 18030: { name: "FileName", level: 3, type: "8", mandatory: !0, minver: 1, webm: !1, description: "Filename of the attached file." }, 18046: { name: "FileDescription", level: 3, type: "8", minver: 1, webm: !1, description: "A human-friendly name for the attached file." }, 24999: { name: "AttachedFile", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "An attached file." }, 423732329: { name: "Attachments", level: 1, type: "m", minver: 1, webm: !1, description: "Contain attached files." }, 235: { name: "CueRefCodecState", level: 5, type: "u", webm: !1, default: 0, description: "The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry." }, 21343: { name: "CueRefNumber", level: 5, type: "u", webm: !1, default: 1, range: "not 0", description: "Number of the referenced Block of Track X in the specified Cluster." }, 219: { name: "CueReference", level: 4, type: "m", multiple: !0, minver: 2, webm: !1, description: "The Clusters containing the required referenced Blocks." }, 234: { name: "CueCodecState", level: 4, type: "u", minver: 2, webm: !1, default: 0, description: "The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry." }, 178: { name: "CueDuration", level: 4, type: "u", mandatory: !1, minver: 4, webm: !1, description: "The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues." }, 240: { name: "CueRelativePosition", level: 4, type: "u", mandatory: !1, minver: 4, webm: !1, description: "The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.", position: "clusterRelative" }, 241: { name: "CueClusterPosition", level: 4, type: "u", mandatory: !0, minver: 1, description: "The position of the Cluster containing the required Block.", position: "segment" }, 247: { name: "CueTrack", level: 4, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "The track for which a position is given." }, 183: { name: "CueTrackPositions", level: 3, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Contain positions for different tracks corresponding to the timestamp." }, 179: { name: "CueTime", level: 3, type: "u", mandatory: !0, minver: 1, description: "Absolute timestamp according to the segment time base." }, 187: { name: "CuePoint", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Contains all information relative to a seek point in the segment." }, 475249515: { name: "Cues", level: 1, type: "m", minver: 1, description: 'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.' }, 18406: { name: "ContentSigHashAlgo", level: 6, type: "u", minver: 1, webm: !1, default: 0, description: "The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5" }, 18405: { name: "ContentSigAlgo", level: 6, type: "u", minver: 1, webm: !1, default: 0, description: "The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA" }, 18404: { name: "ContentSigKeyID", level: 6, type: "b", minver: 1, webm: !1, description: "This is the ID of the private key the data was signed with." }, 18403: { name: "ContentSignature", level: 6, type: "b", minver: 1, webm: !1, description: "A cryptographic signature of the contents." }, 18402: { name: "ContentEncKeyID", level: 6, type: "b", minver: 1, webm: !1, description: "For public key algorithms this is the ID of the public key the the data was encrypted with." }, 18401: { name: "ContentEncAlgo", level: 6, type: "u", minver: 1, webm: !1, default: 0, description: "The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES" }, 28032: { name: "ContentEncodings", level: 3, type: "m", minver: 1, webm: !1, description: "Settings for several content encoding mechanisms like compression or encryption." }, 196: { name: "TrickMasterTrackSegmentUID", level: 3, type: "b", divx: !0, bytesize: 16, description: "DivX trick track extenstions" }, 199: { name: "TrickMasterTrackUID", level: 3, type: "u", divx: !0, description: "DivX trick track extenstions" }, 198: { name: "TrickTrackFlag", level: 3, type: "u", divx: !0, default: 0, description: "DivX trick track extenstions" }, 193: { name: "TrickTrackSegmentUID", level: 3, type: "b", divx: !0, bytesize: 16, description: "DivX trick track extenstions" }, 192: { name: "TrickTrackUID", level: 3, type: "u", divx: !0, description: "DivX trick track extenstions" }, 237: { name: "TrackJoinUID", level: 5, type: "u", mandatory: !0, multiple: !0, minver: 3, webm: !1, range: "not 0", description: "The trackUID number of a track whose blocks are used to create this virtual track." }, 233: { name: "TrackJoinBlocks", level: 4, type: "m", minver: 3, webm: !1, description: "Contains the list of all tracks whose Blocks need to be combined to create this virtual track" }, 230: { name: "TrackPlaneType", level: 6, type: "u", mandatory: !0, minver: 3, webm: !1, description: "The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)." }, 229: { name: "TrackPlaneUID", level: 6, type: "u", mandatory: !0, minver: 3, webm: !1, range: "not 0", description: "The trackUID number of the track representing the plane." }, 228: { name: "TrackPlane", level: 5, type: "m", mandatory: !0, multiple: !0, minver: 3, webm: !1, description: "Contains a video plane track that need to be combined to create this 3D track" }, 227: { name: "TrackCombinePlanes", level: 4, type: "m", minver: 3, webm: !1, description: "Contains the list of all video plane tracks that need to be combined to create this 3D track" }, 226: { name: "TrackOperation", level: 3, type: "m", minver: 3, webm: !1, description: "Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject." }, 32123: { name: "ChannelPositions", cppname: "AudioPosition", level: 4, type: "b", webm: !1, description: "Table of horizontal angles for each successive channel, see appendix." }, 159: { name: "Channels", cppname: "AudioChannels", level: 4, type: "u", mandatory: !0, minver: 1, default: 1, range: "not 0", description: "Numbers of channels in the track." }, 30901: { name: "OutputSamplingFrequency", cppname: "AudioOutputSamplingFreq", level: 4, type: "f", minver: 1, default: "Sampling Frequency", range: "> 0", description: "Real output sampling frequency in Hz (used for SBR techniques)." }, 181: { name: "SamplingFrequency", cppname: "AudioSamplingFreq", level: 4, type: "f", mandatory: !0, minver: 1, default: 8e3, range: "> 0", description: "Sampling frequency in Hz." }, 225: { name: "Audio", cppname: "TrackAudio", level: 3, type: "m", minver: 1, description: "Audio settings." }, 2327523: { name: "FrameRate", cppname: "VideoFrameRate", level: 4, type: "f", range: "> 0", strong: "Informational", description: "Number of frames per second. only." }, 3126563: { name: "GammaValue", cppname: "VideoGamma", level: 4, type: "f", webm: !1, range: "> 0", description: "Gamma Value." }, 3061028: { name: "ColourSpace", cppname: "VideoColourSpace", level: 4, type: "b", minver: 1, webm: !1, bytesize: 4, description: "Same value as in AVI (32 bits)." }, 21683: { name: "AspectRatioType", cppname: "VideoAspectRatio", level: 4, type: "u", minver: 1, default: 0, description: "Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)." }, 21682: { name: "DisplayUnit", cppname: "VideoDisplayUnit", level: 4, type: "u", minver: 1, default: 0, description: "How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)." }, 21690: { name: "DisplayHeight", cppname: "VideoDisplayHeight", level: 4, type: "u", minver: 1, default: "PixelHeight", range: "not 0", description: "Height of the video frames to display. The default value is only valid when DisplayUnit is 0." }, 21680: { name: "DisplayWidth", cppname: "VideoDisplayWidth", level: 4, type: "u", minver: 1, default: "PixelWidth", range: "not 0", description: "Width of the video frames to display. The default value is only valid when DisplayUnit is 0." }, 21725: { name: "PixelCropRight", cppname: "VideoPixelCropRight", level: 4, type: "u", minver: 1, default: 0, description: "The number of video pixels to remove on the right of the image." }, 21708: { name: "PixelCropLeft", cppname: "VideoPixelCropLeft", level: 4, type: "u", minver: 1, default: 0, description: "The number of video pixels to remove on the left of the image." }, 21691: { name: "PixelCropTop", cppname: "VideoPixelCropTop", level: 4, type: "u", minver: 1, default: 0, description: "The number of video pixels to remove at the top of the image." }, 21674: { name: "PixelCropBottom", cppname: "VideoPixelCropBottom", level: 4, type: "u", minver: 1, default: 0, description: "The number of video pixels to remove at the bottom of the image (for HDTV content)." }, 186: { name: "PixelHeight", cppname: "VideoPixelHeight", level: 4, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "Height of the encoded video frames in pixels." }, 176: { name: "PixelWidth", cppname: "VideoPixelWidth", level: 4, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "Width of the encoded video frames in pixels." }, 21433: { name: "OldStereoMode", level: 4, type: "u", maxver: "0", webm: !1, divx: !1, description: "DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)." }, 21440: { name: "AlphaMode", cppname: "VideoAlphaMode", level: 4, type: "u", minver: 3, webm: !0, default: 0, description: "Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data." }, 21432: { name: "StereoMode", cppname: "VideoStereoMode", level: 4, type: "u", minver: 3, webm: !0, default: 0, description: "Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes." }, 154: { name: "FlagInterlaced", cppname: "VideoFlagInterlaced", level: 4, type: "u", mandatory: !0, minver: 2, webm: !0, default: 0, range: "0-1", description: "Set if the video is interlaced. (1 bit)" }, 224: { name: "Video", cppname: "TrackVideo", level: 3, type: "m", minver: 1, description: "Video settings." }, 26277: { name: "TrackTranslateTrackID", level: 4, type: "b", mandatory: !0, minver: 1, webm: !1, description: "The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used." }, 26303: { name: "TrackTranslateCodec", level: 4, type: "u", mandatory: !0, minver: 1, webm: !1, description: "The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)." }, 26364: { name: "TrackTranslateEditionUID", level: 4, type: "u", multiple: !0, minver: 1, webm: !1, description: "Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment." }, 22203: { name: "SeekPreRoll", level: 3, type: "u", mandatory: !0, multiple: !1, default: 0, minver: 4, webm: !0, description: "After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid." }, 22186: { name: "CodecDelay", level: 3, type: "u", multiple: !1, default: 0, minver: 4, webm: !0, description: "CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster." }, 28587: { name: "TrackOverlay", level: 3, type: "u", multiple: !0, minver: 1, webm: !1, description: "Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc." }, 170: { name: "CodecDecodeAll", level: 3, type: "u", mandatory: !0, minver: 2, webm: !1, default: 1, range: "0-1", description: "The codec can decode potentially damaged data (1 bit)." }, 2536e3: { name: "CodecDownloadURL", level: 3, type: "s", multiple: !0, webm: !1, description: "A URL to download about the codec used." }, 3883072: { name: "CodecInfoURL", level: 3, type: "s", multiple: !0, webm: !1, description: "A URL to find information about the codec used." }, 3839639: { name: "CodecSettings", level: 3, type: "8", webm: !1, description: "A string describing the encoding setting used." }, 25506: { name: "CodecPrivate", level: 3, type: "b", minver: 1, description: "Private data only known to the codec." }, 2274716: { name: "Language", cppname: "TrackLanguage", level: 3, type: "s", minver: 1, default: "eng", description: "Specifies the language of the track in the Matroska languages form." }, 21358: { name: "Name", cppname: "TrackName", level: 3, type: "8", minver: 1, description: "A human-readable track name." }, 21998: { name: "MaxBlockAdditionID", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "The maximum value of BlockAdditions for this track." }, 21375: { name: "TrackOffset", level: 3, type: "i", webm: !1, default: 0, description: "A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track." }, 2306383: { name: "TrackTimecodeScale", level: 3, type: "f", mandatory: !0, minver: 1, maxver: "3", webm: !1, default: 1, range: "> 0", description: "DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)." }, 2313850: { name: "DefaultDecodedFieldDuration", cppname: "TrackDefaultDecodedFieldDuration", level: 3, type: "u", minver: 4, range: "not 0", description: "The period in nanoseconds (not scaled by TimcodeScale)\nbetween two successive fields at the output of the decoding process (see the notes)" }, 2352003: { name: "DefaultDuration", cppname: "TrackDefaultDuration", level: 3, type: "u", minver: 1, range: "not 0", description: "Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)." }, 28152: { name: "MaxCache", cppname: "TrackMaxCache", level: 3, type: "u", minver: 1, webm: !1, description: "The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed." }, 28135: { name: "MinCache", cppname: "TrackMinCache", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used." }, 156: { name: "FlagLacing", cppname: "TrackFlagLacing", level: 3, type: "u", mandatory: !0, minver: 1, default: 1, range: "0-1", description: "Set if the track may contain blocks using lacing. (1 bit)" }, 21930: { name: "FlagForced", cppname: "TrackFlagForced", level: 3, type: "u", mandatory: !0, minver: 1, default: 0, range: "0-1", description: "Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)" }, 185: { name: "FlagEnabled", cppname: "TrackFlagEnabled", level: 3, type: "u", mandatory: !0, minver: 2, webm: !0, default: 1, range: "0-1", description: "Set if the track is usable. (1 bit)" }, 29637: { name: "TrackUID", level: 3, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file." }, 215: { name: "TrackNumber", level: 3, type: "u", mandatory: !0, minver: 1, range: "not 0", description: "The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)." }, 174: { name: "TrackEntry", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Describes a track with all elements." }, 374648427: { name: "Tracks", level: 1, type: "m", multiple: !0, minver: 1, description: "A top-level block of information with many tracks described." }, 175: { name: "EncryptedBlock", level: 2, type: "b", multiple: !0, webm: !1, description: "Similar to EncryptedBlock Structure)" }, 202: { name: "ReferenceTimeCode", level: 4, type: "u", multiple: !1, mandatory: !0, minver: 0, webm: !1, divx: !0, description: "DivX trick track extenstions" }, 201: { name: "ReferenceOffset", level: 4, type: "u", multiple: !1, mandatory: !0, minver: 0, webm: !1, divx: !0, description: "DivX trick track extenstions" }, 200: { name: "ReferenceFrame", level: 3, type: "m", multiple: !1, minver: 0, webm: !1, divx: !0, description: "DivX trick track extenstions" }, 207: { name: "SliceDuration", level: 5, type: "u", default: 0, description: "The (scaled) duration to apply to the element." }, 206: { name: "Delay", cppname: "SliceDelay", level: 5, type: "u", default: 0, description: "The (scaled) delay to apply to the element." }, 203: { name: "BlockAdditionID", cppname: "SliceBlockAddID", level: 5, type: "u", default: 0, description: "The ID of the BlockAdditional element (0 is the main Block)." }, 205: { name: "FrameNumber", cppname: "SliceFrameNumber", level: 5, type: "u", default: 0, description: "The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)." }, 204: { name: "LaceNumber", cppname: "SliceLaceNumber", level: 5, type: "u", minver: 1, default: 0, divx: !1, description: "The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback." }, 232: { name: "TimeSlice", level: 4, type: "m", multiple: !0, minver: 1, divx: !1, description: "Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback." }, 142: { name: "Slices", level: 3, type: "m", minver: 1, divx: !1, description: "Contains slices description." }, 30114: { name: "DiscardPadding", level: 3, type: "i", minver: 4, webm: !0, description: "Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback." }, 164: { name: "CodecState", level: 3, type: "b", minver: 2, webm: !1, description: "The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry." }, 253: { name: "ReferenceVirtual", level: 3, type: "i", webm: !1, description: "Relative position of the data that should be in position of the virtual block." }, 251: { name: "ReferenceBlock", level: 3, type: "i", multiple: !0, minver: 1, description: "Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to." }, 250: { name: "ReferencePriority", cppname: "FlagReferenced", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, default: 0, description: "This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced." }, 155: { name: "BlockDuration", level: 3, type: "u", minver: 1, default: "TrackDuration", description: 'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.' }, 165: { name: "BlockAdditional", level: 5, type: "b", mandatory: !0, minver: 1, webm: !1, description: "Interpreted by the codec as it wishes (using the BlockAddID)." }, 238: { name: "BlockAddID", level: 5, type: "u", mandatory: !0, minver: 1, webm: !1, default: 1, range: "not 0", description: "An ID to identify the BlockAdditional level." }, 166: { name: "BlockMore", level: 4, type: "m", mandatory: !0, multiple: !0, minver: 1, webm: !1, description: "Contain the BlockAdditional and some parameters." }, 30113: { name: "BlockAdditions", level: 3, type: "m", minver: 1, webm: !1, description: "Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data." }, 162: { name: "BlockVirtual", level: 3, type: "b", webm: !1, description: "A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)" }, 161: { name: "Block", level: 3, type: "b", mandatory: !0, minver: 1, description: "Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)" }, 160: { name: "BlockGroup", level: 2, type: "m", multiple: !0, minver: 1, description: "Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock." }, 163: { name: "SimpleBlock", level: 2, type: "b", multiple: !0, minver: 2, webm: !0, divx: !0, description: "Similar to SimpleBlock Structure" }, 171: { name: "PrevSize", cppname: "ClusterPrevSize", level: 2, type: "u", minver: 1, description: "Size of the previous Cluster, in octets. Can be useful for backward playing.", position: "prevCluster" }, 167: { name: "Position", cppname: "ClusterPosition", level: 2, type: "u", minver: 1, webm: !1, description: "The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.", position: "segment" }, 22743: { name: "SilentTrackNumber", cppname: "ClusterSilentTrackNumber", level: 3, type: "u", multiple: !0, minver: 1, webm: !1, description: "One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster." }, 231: { name: "Timecode", cppname: "ClusterTimecode", level: 2, type: "u", mandatory: !0, minver: 1, description: "Absolute timestamp of the cluster (based on TimecodeScale)." }, 524531317: { name: "Cluster", level: 1, type: "m", multiple: !0, minver: 1, description: "The lower level element containing the (monolithic) Block structure." }, 19840: { name: "MuxingApp", level: 2, type: "8", mandatory: !0, minver: 1, description: 'Muxing application or library ("libmatroska-0.4.3").' }, 31657: { name: "Title", level: 2, type: "8", minver: 1, webm: !1, description: "General name of the segment." }, 2807730: { name: "TimecodeScaleDenominator", level: 2, type: "u", mandatory: !0, minver: 4, default: "1000000000", description: "Timestamp scale numerator, see TimecodeScale." }, 2807729: { name: "TimecodeScale", level: 2, type: "u", mandatory: !0, minver: 1, default: "1000000", description: "Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)." }, 27045: { name: "ChapterTranslateID", level: 3, type: "b", mandatory: !0, minver: 1, webm: !1, description: "The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used." }, 27071: { name: "ChapterTranslateCodec", level: 3, type: "u", mandatory: !0, minver: 1, webm: !1, description: "The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)." }, 27132: { name: "ChapterTranslateEditionUID", level: 3, type: "u", multiple: !0, minver: 1, webm: !1, description: "Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment." }, 4096955: { name: "NextFilename", level: 2, type: "8", minver: 1, webm: !1, description: "An escaped filename corresponding to the next segment." }, 4110627: { name: "NextUID", level: 2, type: "b", minver: 1, webm: !1, bytesize: 16, description: "A unique ID to identify the next chained segment (128 bits)." }, 3965867: { name: "PrevFilename", level: 2, type: "8", minver: 1, webm: !1, description: "An escaped filename corresponding to the previous segment." }, 3979555: { name: "PrevUID", level: 2, type: "b", minver: 1, webm: !1, bytesize: 16, description: "A unique ID to identify the previous chained segment (128 bits)." }, 29604: { name: "SegmentUID", level: 2, type: "b", minver: 1, webm: !1, range: "not 0", bytesize: 16, description: "A randomly generated unique ID to identify the current segment between many others (128 bits)." }, 357149030: { name: "Info", level: 1, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Contains miscellaneous general information and statistics on the file." }, 21420: { name: "SeekPosition", level: 3, type: "u", mandatory: !0, minver: 1, description: "The position of the element in the segment in octets (0 = first level 1 element).", position: "segment" }, 21419: { name: "SeekID", level: 3, type: "b", mandatory: !0, minver: 1, description: "The binary ID corresponding to the element name.", type2: "ebmlID" }, 19899: { name: "Seek", cppname: "SeekPoint", level: 2, type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Contains a single seek entry to an EBML element." }, 290298740: { name: "SeekHead", cppname: "SeekHeader", level: 1, type: "m", multiple: !0, minver: 1, description: "Contains the position of other level 1 elements." }, 32379: { name: "SignatureElementList", level: 2, type: "m", multiple: !0, webm: !1, i: "Cluster|Block|BlockAdditional", description: "A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption." }, 32347: { name: "SignatureElements", level: 1, type: "m", webm: !1, description: "Contains elements that will be used to compute the signature." }, 32437: { name: "Signature", level: 1, type: "b", webm: !1, description: "The signature of the data (until a new." }, 32421: { name: "SignaturePublicKey", level: 1, type: "b", webm: !1, description: "The public key to use with the algorithm (in the case of a PKI-based signature)." }, 32410: { name: "SignatureHash", level: 1, type: "u", webm: !1, description: "Hash algorithm used (1=SHA1-160, 2=MD5)." }, 32394: { name: "SignatureAlgo", level: 1, type: "u", webm: !1, description: "Signature algorithm used (1=RSA, 2=elliptic)." }, 458458727: { name: "SignatureSlot", level: -1, type: "m", multiple: !0, webm: !1, description: "Contain signature of some (coming) elements in the stream." }, 191: { name: "CRC-32", level: -1, type: "b", minver: 1, webm: !1, description: "The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian", crc: !0 }, 236: { name: "Void", level: -1, type: "b", minver: 1, description: "Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use." }, 17139: { name: "EBMLMaxSizeLength", level: 1, type: "u", mandatory: !0, default: 8, minver: 1, description: "The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid." }, 17138: { name: "EBMLMaxIDLength", level: 1, type: "u", mandatory: !0, default: 4, minver: 1, description: "The maximum length of the IDs you'll find in this file (4 or less in Matroska)." }, 17143: { name: "EBMLReadVersion", level: 1, type: "u", mandatory: !0, default: 1, minver: 1, description: "The minimum EBML version a parser has to support to read this file." }, 440786851: { name: "EBML", level: "0", type: "m", mandatory: !0, multiple: !0, minver: 1, description: "Set the EBML characteristics of the data to follow. Each EBML document has to start with this." } }, byName = {}, schema = { byEbmlID: byEbmlID, byName: byName }; for (var ebmlID in byEbmlID) byName[byEbmlID[ebmlID].name.replace("-", "_")] = parseInt(ebmlID, 10); module.exports = schema; }, function(module, exports, __webpack_require__) { "use strict"; var key, buffer = __webpack_require__(10), Buffer = buffer.Buffer, safer = {}; for (key in buffer) buffer.hasOwnProperty(key) && "SlowBuffer" !== key && "Buffer" !== key && (safer[key] = buffer[key]); var Safer = safer.Buffer = {}; for (key in Buffer) Buffer.hasOwnProperty(key) && "allocUnsafe" !== key && "allocUnsafeSlow" !== key && (Safer[key] = Buffer[key]); if (safer.Buffer.prototype = Buffer.prototype, Safer.from && Safer.from !== Uint8Array.from || (Safer.from = function(value, encodingOrOffset, length) { if ("number" == typeof value) throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value); if (value && void 0 === value.length) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); return Buffer(value, encodingOrOffset, length); }), Safer.alloc || (Safer.alloc = function(size, fill, encoding) { if ("number" != typeof size) throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size); if (size < 0 || size >= 2 * (1 << 30)) throw new RangeError('The value "' + size + '" is invalid for option "size"'); var buf = Buffer(size); return fill && 0 !== fill.length ? "string" == typeof encoding ? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf; }), !safer.kStringMaxLength) try { safer.kStringMaxLength = process.binding("buffer").kStringMaxLength; } catch (e) {} safer.constants || (safer.constants = { MAX_LENGTH: safer.kMaxLength }, safer.kStringMaxLength && (safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength)), module.exports = safer; }, function(module, exports, __webpack_require__) { var assert = __webpack_require__(25), Stream = __webpack_require__(3).Stream, util = __webpack_require__(0), UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; function _capitalize(str) { return str.charAt(0).toUpperCase() + str.slice(1); } function _toss(name, expected, oper, arg, actual) { throw new assert.AssertionError({ message: util.format("%s (%s) is required", name, expected), actual: void 0 === actual ? typeof arg : actual(arg), expected: expected, operator: oper || "===", stackStartFunction: _toss.caller }); } function _getClass(arg) { return Object.prototype.toString.call(arg).slice(8, -1); } function noop() {} var types = { bool: { check: function(arg) { return "boolean" == typeof arg; } }, func: { check: function(arg) { return "function" == typeof arg; } }, string: { check: function(arg) { return "string" == typeof arg; } }, object: { check: function(arg) { return "object" == typeof arg && null !== arg; } }, number: { check: function(arg) { return "number" == typeof arg && !isNaN(arg); } }, finite: { check: function(arg) { return "number" == typeof arg && !isNaN(arg) && isFinite(arg); } }, buffer: { check: function(arg) { return Buffer.isBuffer(arg); }, operator: "Buffer.isBuffer" }, array: { check: function(arg) { return Array.isArray(arg); }, operator: "Array.isArray" }, stream: { check: function(arg) { return arg instanceof Stream; }, operator: "instanceof", actual: _getClass }, date: { check: function(arg) { return arg instanceof Date; }, operator: "instanceof", actual: _getClass }, regexp: { check: function(arg) { return arg instanceof RegExp; }, operator: "instanceof", actual: _getClass }, uuid: { check: function(arg) { return "string" == typeof arg && UUID_REGEXP.test(arg); }, operator: "isUUID" } }; module.exports = (function _setExports(ndebug) { var out, keys = Object.keys(types); return out = process.env.NODE_NDEBUG ? noop : function(arg, msg) { arg || _toss(msg, "true", arg); }, keys.forEach((function(k) { if (ndebug) out[k] = noop; else { var type = types[k]; out[k] = function(arg, msg) { type.check(arg) || _toss(msg, k, type.operator, arg, type.actual); }; } })), keys.forEach((function(k) { var name = "optional" + _capitalize(k); if (ndebug) out[name] = noop; else { var type = types[k]; out[name] = function(arg, msg) { null != arg && (type.check(arg) || _toss(msg, k, type.operator, arg, type.actual)); }; } })), keys.forEach((function(k) { var name = "arrayOf" + _capitalize(k); if (ndebug) out[name] = noop; else { var type = types[k], expected = "[" + k + "]"; out[name] = function(arg, msg) { var i; for (Array.isArray(arg) || _toss(msg, expected, type.operator, arg, type.actual), i = 0; i < arg.length; i++) type.check(arg[i]) || _toss(msg, expected, type.operator, arg, type.actual); }; } })), keys.forEach((function(k) { var name = "optionalArrayOf" + _capitalize(k); if (ndebug) out[name] = noop; else { var type = types[k], expected = "[" + k + "]"; out[name] = function(arg, msg) { var i; if (null != arg) for (Array.isArray(arg) || _toss(msg, expected, type.operator, arg, type.actual), i = 0; i < arg.length; i++) type.check(arg[i]) || _toss(msg, expected, type.operator, arg, type.actual); }; } })), Object.keys(assert).forEach((function(k) { out[k] = "AssertionError" !== k && ndebug ? noop : assert[k]; })), out._setExports = _setExports, out; })(process.env.NODE_NDEBUG); }, function(module, exports, __webpack_require__) { "use strict"; var tryCatchTarget, es5 = __webpack_require__(75), canEvaluate = "undefined" == typeof navigator, errorObj = { e: {} }, globalObject = "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : void 0 !== this ? this : null; function tryCatcher() { try { var target = tryCatchTarget; return tryCatchTarget = null, target.apply(this, arguments); } catch (e) { return errorObj.e = e, errorObj; } } function isPrimitive(val) { return null == val || !0 === val || !1 === val || "string" == typeof val || "number" == typeof val; } function notEnumerableProp(obj, name, value) { if (isPrimitive(obj)) return obj; var descriptor = { value: value, configurable: !0, enumerable: !1, writable: !0 }; return es5.defineProperty(obj, name, descriptor), obj; } var inheritedDataKeys = (function() { var excludedPrototypes = [ Array.prototype, Object.prototype, Function.prototype ], isExcludedProto = function(val) { for (var i = 0; i < excludedPrototypes.length; ++i) if (excludedPrototypes[i] === val) return !0; return !1; }; if (es5.isES5) { var getKeys = Object.getOwnPropertyNames; return function(obj) { for (var ret = [], visitedKeys = Object.create(null); null != obj && !isExcludedProto(obj); ) { var keys; try { keys = getKeys(obj); } catch (e) { return ret; } for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!visitedKeys[key]) { visitedKeys[key] = !0; var desc = Object.getOwnPropertyDescriptor(obj, key); null != desc && null == desc.get && null == desc.set && ret.push(key); } } obj = es5.getPrototypeOf(obj); } return ret; }; } var hasProp = {}.hasOwnProperty; return function(obj) { if (isExcludedProto(obj)) return []; var ret = []; enumeration: for (var key in obj) if (hasProp.call(obj, key)) ret.push(key); else { for (var i = 0; i < excludedPrototypes.length; ++i) if (hasProp.call(excludedPrototypes[i], key)) continue enumeration; ret.push(key); } return ret; }; })(), thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; var rident = /^[a-z$_][a-z$_0-9]*$/i; function safeToString(obj) { try { return obj + ""; } catch (e) { return "[no string representation]"; } } function isError(obj) { return obj instanceof Error || null !== obj && "object" == typeof obj && "string" == typeof obj.message && "string" == typeof obj.name; } function canAttachTrace(obj) { return isError(obj) && es5.propertyIsWritable(obj, "stack"); } var ensureErrorObject = "stack" in new Error ? function(value) { return canAttachTrace(value) ? value : new Error(safeToString(value)); } : function(value) { if (canAttachTrace(value)) return value; try { throw new Error(safeToString(value)); } catch (err) { return err; } }; function classString(obj) { return {}.toString.call(obj); } var asArray = function(v) { return es5.isArray(v) ? v : null; }; if ("undefined" != typeof Symbol && Symbol.iterator) { var ArrayFrom = "function" == typeof Array.from ? function(v) { return Array.from(v); } : function(v) { for (var itResult, ret = [], it = v[Symbol.iterator](); !(itResult = it.next()).done; ) ret.push(itResult.value); return ret; }; asArray = function(v) { return es5.isArray(v) ? v : null != v && "function" == typeof v[Symbol.iterator] ? ArrayFrom(v) : null; }; } var isNode = "undefined" != typeof process && "[object process]" === classString(process).toLowerCase(), hasEnvVariables = "undefined" != typeof process && void 0 !== process.env; var version, ret = { isClass: function(fn) { try { if ("function" == typeof fn) { var keys = es5.names(fn.prototype), hasMethods = es5.isES5 && keys.length > 1, hasMethodsOtherThanConstructor = keys.length > 0 && !(1 === keys.length && "constructor" === keys[0]), hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) return !0; } return !1; } catch (e) { return !1; } }, isIdentifier: function(str) { return rident.test(str); }, inheritedDataKeys: inheritedDataKeys, getDataPropertyOrDefault: function(obj, key, defaultValue) { if (!es5.isES5) return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0; var desc = Object.getOwnPropertyDescriptor(obj, key); return null != desc ? null == desc.get && null == desc.set ? desc.value : defaultValue : void 0; }, thrower: function(r) { throw r; }, isArray: es5.isArray, asArray: asArray, notEnumerableProp: notEnumerableProp, isPrimitive: isPrimitive, isObject: function(value) { return "function" == typeof value || "object" == typeof value && null !== value; }, isError: isError, canEvaluate: canEvaluate, errorObj: errorObj, tryCatch: function(fn) { return tryCatchTarget = fn, tryCatcher; }, inherits: function(Child, Parent) { var hasProp = {}.hasOwnProperty; function T() { for (var propertyName in this.constructor = Child, this.constructor$ = Parent, Parent.prototype) hasProp.call(Parent.prototype, propertyName) && "$" !== propertyName.charAt(propertyName.length - 1) && (this[propertyName + "$"] = Parent.prototype[propertyName]); } return T.prototype = Parent.prototype, Child.prototype = new T, Child.prototype; }, withAppended: function(target, appendee) { var i, len = target.length, ret = new Array(len + 1); for (i = 0; i < len; ++i) ret[i] = target[i]; return ret[i] = appendee, ret; }, maybeWrapAsError: function(maybeError) { return isPrimitive(maybeError) ? new Error(safeToString(maybeError)) : maybeError; }, toFastProperties: function(obj) { function FakeConstructor() {} FakeConstructor.prototype = obj; var receiver = new FakeConstructor; function ic() { return typeof receiver.foo; } return ic(), ic(), obj; }, filledRange: function(count, prefix, suffix) { for (var ret = new Array(count), i = 0; i < count; ++i) ret[i] = prefix + i + suffix; return ret; }, toString: safeToString, canAttachTrace: canAttachTrace, ensureErrorObject: ensureErrorObject, originatesFromRejection: function(e) { return null != e && (e instanceof Error.__BluebirdErrorTypes__.OperationalError || !0 === e.isOperational); }, markAsOriginatingFromRejection: function(e) { try { notEnumerableProp(e, "isOperational", !0); } catch (ignore) {} }, classString: classString, copyDescriptors: function(from, to, filter) { for (var keys = es5.names(from), i = 0; i < keys.length; ++i) { var key = keys[i]; if (filter(key)) try { es5.defineProperty(to, key, es5.getDescriptor(from, key)); } catch (ignore) {} } }, hasDevTools: "undefined" != typeof chrome && chrome && "function" == typeof chrome.loadTimes, isNode: isNode, hasEnvVariables: hasEnvVariables, env: function(key) { return hasEnvVariables ? process.env[key] : void 0; }, global: globalObject, getNativePromise: function() { if ("function" == typeof Promise) try { var promise = new Promise((function() {})); if ("[object Promise]" === {}.toString.call(promise)) return Promise; } catch (e) {} }, domainBind: function(self, cb) { return self.bind(cb); } }; ret.isRecentNode = ret.isNode && (process.versions && process.versions.node ? version = process.versions.node.split(".").map(Number) : process.version && (version = process.version.split(".").map(Number)), 0 === version[0] && version[1] > 10 || version[0] > 0), ret.isNode && ret.toFastProperties(process); try { throw new Error; } catch (e) { ret.lastLineError = e; } module.exports = ret; }, function(module, exports, __webpack_require__) { "use strict"; var tryCatchTarget, es5 = __webpack_require__(92), canEvaluate = "undefined" == typeof navigator, errorObj = { e: {} }, globalObject = "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : void 0 !== this ? this : null; function tryCatcher() { try { var target = tryCatchTarget; return tryCatchTarget = null, target.apply(this, arguments); } catch (e) { return errorObj.e = e, errorObj; } } function isPrimitive(val) { return null == val || !0 === val || !1 === val || "string" == typeof val || "number" == typeof val; } function notEnumerableProp(obj, name, value) { if (isPrimitive(obj)) return obj; var descriptor = { value: value, configurable: !0, enumerable: !1, writable: !0 }; return es5.defineProperty(obj, name, descriptor), obj; } var inheritedDataKeys = (function() { var excludedPrototypes = [ Array.prototype, Object.prototype, Function.prototype ], isExcludedProto = function(val) { for (var i = 0; i < excludedPrototypes.length; ++i) if (excludedPrototypes[i] === val) return !0; return !1; }; if (es5.isES5) { var getKeys = Object.getOwnPropertyNames; return function(obj) { for (var ret = [], visitedKeys = Object.create(null); null != obj && !isExcludedProto(obj); ) { var keys; try { keys = getKeys(obj); } catch (e) { return ret; } for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!visitedKeys[key]) { visitedKeys[key] = !0; var desc = Object.getOwnPropertyDescriptor(obj, key); null != desc && null == desc.get && null == desc.set && ret.push(key); } } obj = es5.getPrototypeOf(obj); } return ret; }; } var hasProp = {}.hasOwnProperty; return function(obj) { if (isExcludedProto(obj)) return []; var ret = []; enumeration: for (var key in obj) if (hasProp.call(obj, key)) ret.push(key); else { for (var i = 0; i < excludedPrototypes.length; ++i) if (hasProp.call(excludedPrototypes[i], key)) continue enumeration; ret.push(key); } return ret; }; })(), thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; var rident = /^[a-z$_][a-z$_0-9]*$/i; function safeToString(obj) { try { return obj + ""; } catch (e) { return "[no string representation]"; } } function isError(obj) { return null !== obj && "object" == typeof obj && "string" == typeof obj.message && "string" == typeof obj.name; } function canAttachTrace(obj) { return isError(obj) && es5.propertyIsWritable(obj, "stack"); } var ensureErrorObject = "stack" in new Error ? function(value) { return canAttachTrace(value) ? value : new Error(safeToString(value)); } : function(value) { if (canAttachTrace(value)) return value; try { throw new Error(safeToString(value)); } catch (err) { return err; } }; function classString(obj) { return {}.toString.call(obj); } var asArray = function(v) { return es5.isArray(v) ? v : null; }; if ("undefined" != typeof Symbol && Symbol.iterator) { var ArrayFrom = "function" == typeof Array.from ? function(v) { return Array.from(v); } : function(v) { for (var itResult, ret = [], it = v[Symbol.iterator](); !(itResult = it.next()).done; ) ret.push(itResult.value); return ret; }; asArray = function(v) { return es5.isArray(v) ? v : null != v && "function" == typeof v[Symbol.iterator] ? ArrayFrom(v) : null; }; } var isNode = "undefined" != typeof process && "[object process]" === classString(process).toLowerCase(), hasEnvVariables = "undefined" != typeof process && void 0 !== process.env; var version, ret = { isClass: function(fn) { try { if ("function" == typeof fn) { var keys = es5.names(fn.prototype), hasMethods = es5.isES5 && keys.length > 1, hasMethodsOtherThanConstructor = keys.length > 0 && !(1 === keys.length && "constructor" === keys[0]), hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) return !0; } return !1; } catch (e) { return !1; } }, isIdentifier: function(str) { return rident.test(str); }, inheritedDataKeys: inheritedDataKeys, getDataPropertyOrDefault: function(obj, key, defaultValue) { if (!es5.isES5) return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0; var desc = Object.getOwnPropertyDescriptor(obj, key); return null != desc ? null == desc.get && null == desc.set ? desc.value : defaultValue : void 0; }, thrower: function(r) { throw r; }, isArray: es5.isArray, asArray: asArray, notEnumerableProp: notEnumerableProp, isPrimitive: isPrimitive, isObject: function(value) { return "function" == typeof value || "object" == typeof value && null !== value; }, isError: isError, canEvaluate: canEvaluate, errorObj: errorObj, tryCatch: function(fn) { return tryCatchTarget = fn, tryCatcher; }, inherits: function(Child, Parent) { var hasProp = {}.hasOwnProperty; function T() { for (var propertyName in this.constructor = Child, this.constructor$ = Parent, Parent.prototype) hasProp.call(Parent.prototype, propertyName) && "$" !== propertyName.charAt(propertyName.length - 1) && (this[propertyName + "$"] = Parent.prototype[propertyName]); } return T.prototype = Parent.prototype, Child.prototype = new T, Child.prototype; }, withAppended: function(target, appendee) { var i, len = target.length, ret = new Array(len + 1); for (i = 0; i < len; ++i) ret[i] = target[i]; return ret[i] = appendee, ret; }, maybeWrapAsError: function(maybeError) { return isPrimitive(maybeError) ? new Error(safeToString(maybeError)) : maybeError; }, toFastProperties: function(obj) { function FakeConstructor() {} FakeConstructor.prototype = obj; for (var l = 8; l--; ) new FakeConstructor; return obj; }, filledRange: function(count, prefix, suffix) { for (var ret = new Array(count), i = 0; i < count; ++i) ret[i] = prefix + i + suffix; return ret; }, toString: safeToString, canAttachTrace: canAttachTrace, ensureErrorObject: ensureErrorObject, originatesFromRejection: function(e) { return null != e && (e instanceof Error.__BluebirdErrorTypes__.OperationalError || !0 === e.isOperational); }, markAsOriginatingFromRejection: function(e) { try { notEnumerableProp(e, "isOperational", !0); } catch (ignore) {} }, classString: classString, copyDescriptors: function(from, to, filter) { for (var keys = es5.names(from), i = 0; i < keys.length; ++i) { var key = keys[i]; if (filter(key)) try { es5.defineProperty(to, key, es5.getDescriptor(from, key)); } catch (ignore) {} } }, hasDevTools: "undefined" != typeof chrome && chrome && "function" == typeof chrome.loadTimes, isNode: isNode, hasEnvVariables: hasEnvVariables, env: function(key) { return hasEnvVariables ? process.env[key] : void 0; }, global: globalObject, getNativePromise: function() { if ("function" == typeof Promise) try { var promise = new Promise((function() {})); if ("[object Promise]" === {}.toString.call(promise)) return Promise; } catch (e) {} }, domainBind: function(self, cb) { return self.bind(cb); } }; ret.isRecentNode = ret.isNode && (0 === (version = process.versions.node.split(".").map(Number))[0] && version[1] > 10 || version[0] > 0), ret.isNode && ret.toFastProperties(process); try { throw new Error; } catch (e) { ret.lastLineError = e; } module.exports = ret; }, function(module, exports) { module.exports = function(conf, csName, lang) { this.confidence = conf, this.charsetName = csName, this.lang = lang; }; }, function(module, exports, __webpack_require__) { "use strict"; var schema = __webpack_require__(13), tools = __webpack_require__(86); module.exports = { addAttribute: function(proto, ebmlName) { var ebmlID = schema.byName[ebmlName]; if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); var schemaInfo = schema.byEbmlID[ebmlID], type = schemaInfo.type, name = ebmlName, ret = /^([A-Z])([a-z].*)$/.exec(name); ret && (name = ret[1].toLowerCase() + ret[2]), Object.defineProperty(proto, name, { iterable: !0, get: function() { var child = this.getFirstChildByName(ebmlID); if (child) return "ebmlID" === schemaInfo.type2 ? child.getUInt() : child.getValue(); }, set: function(value) { var child = this.getFirstChildByName(ebmlID); if (child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child)), "ebmlID" === schemaInfo.type2) child.setTargetEbmlID(value); else if (schemaInfo.position) child.setTargetPosition(value); else { try { value = tools.validType(type, value); } catch (x) { throw x; } child.setValue(value); } return this; } }), Object.defineProperty(proto, "$$" + name, { iterable: !1, get: function() { return this.getFirstChildByName(ebmlID); } }), proto["get" + ebmlName] = function() { var child = this.getFirstChildByName(ebmlID); return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), child); }; }, addChild: function(proto, ebmlName) { var ebmlID = schema.byName[ebmlName]; if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); var name = ebmlName; (ret = /^([A-Z])([a-z].*)$/.exec(name)) && (name = ret[1].toLowerCase() + ret[2]); var ret, names = name; names = (ret = /(.*)y$/.exec(names)) ? ret[1] + "ies" : name + "s", Object.defineProperty(proto, names, { iterable: !0, get: function() { return this.listChildrenByName(ebmlID); } }), Object.defineProperty(proto, name, { iterable: !0, get: function() { return this.getFirstChildByName(ebmlID); } }), Object.defineProperty(proto, "$" + name, { iterable: !0, get: function() { var child = this.getFirstChildByName(ebmlID); return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), child); } }), proto["new" + ebmlName] = function() { var child = this.ownerDocument.createElement(ebmlID); return this.appendChild(child), child; }, proto["add" + ebmlName] = function(value) { var child = this.ownerDocument.createElement(ebmlID); return this.appendChild(child), child.setValue(value), child; }; }, oneChild: function(proto, ebmlName) { var ebmlID = schema.byName[ebmlName]; if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); var name = ebmlName, ret = /^([A-Z])([a-z].*)$/.exec(name); ret && (name = ret[1].toLowerCase() + ret[2]), Object.defineProperty(proto, name, { iterable: !0, get: function() { return this.getFirstChildByName(ebmlID); } }), Object.defineProperty(proto, "$" + name, { iterable: !0, get: function() { var child = this.getFirstChildByName(ebmlID); return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), child); } }), proto["set" + ebmlName] = function() { var old = this.getFirstChildByName(name); old && old.remove(); var child = this.ownerDocument.createElement(ebmlID); return this.appendChild(child), child; }; } }; }, function(module, exports, __webpack_require__) { "use strict"; var schema = __webpack_require__(12), tools = __webpack_require__(83); module.exports = { addAttribute: function(proto, ebmlName) { var ebmlID = schema.byName[ebmlName]; if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); var schemaInfo = schema.byEbmlID[ebmlID], type = schemaInfo.type, name = ebmlName, ret = /^([A-Z])([a-z].*)$/.exec(name); ret && (name = ret[1].toLowerCase() + ret[2]), Object.defineProperty(proto, name, { iterable: !0, get: function() { var child = this.getFirstChildByName(ebmlID); if (child) return "ebmlID" === schemaInfo.type2 ? child.getUInt() : child.getValue(); }, set: function(value) { var child = this.getFirstChildByName(ebmlID); if (child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child)), "ebmlID" === schemaInfo.type2) child.setTargetEbmlID(value); else if (schemaInfo.position) child.setTargetPosition(value); else { try { value = tools.validType(type, value); } catch (x) { throw console.error("Type of attribute=", schemaInfo, x), x; } child.setValue(value); } return this; } }), Object.defineProperty(proto, "$$" + name, { iterable: !1, get: function() { return this.getFirstChildByName(ebmlID); } }), proto["get" + ebmlName] = function() { var child = this.getFirstChildByName(ebmlID); return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), child); }; }, addChild: function(proto, ebmlName) { var ebmlID = schema.byName[ebmlName]; if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); var name = ebmlName; (ret = /^([A-Z])([a-z].*)$/.exec(name)) && (name = ret[1].toLowerCase() + ret[2]); var ret, names = name; names = (ret = /(.*)y$/.exec(names)) ? ret[1] + "ies" : name + "s", Object.defineProperty(proto, names, { iterable: !0, get: function() { return this.listChildrenByName(ebmlID); } }), Object.defineProperty(proto, name, { iterable: !0, get: function() { return this.getFirstChildByName(ebmlID); } }), Object.defineProperty(proto, "$" + name, { iterable: !0, get: function() { var child = this.getFirstChildByName(ebmlID); return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), child); } }), proto["new" + ebmlName] = function() { var child = this.ownerDocument.createElement(ebmlID); return this.appendChild(child), child; }, proto["add" + ebmlName] = function(value) { var child = this.ownerDocument.createElement(ebmlID); return this.appendChild(child), child.setValue(value), child; }; }, oneChild: function(proto, ebmlName) { var ebmlID = schema.byName[ebmlName]; if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); var name = ebmlName, ret = /^([A-Z])([a-z].*)$/.exec(name); ret && (name = ret[1].toLowerCase() + ret[2]), Object.defineProperty(proto, name, { iterable: !0, get: function() { return this.getFirstChildByName(ebmlID); } }), Object.defineProperty(proto, "$" + name, { iterable: !0, get: function() { var child = this.getFirstChildByName(ebmlID); return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), child); } }), proto["set" + ebmlName] = function() { var old = this.getFirstChildByName(name); old && old.remove(); var child = this.ownerDocument.createElement(ebmlID); return this.appendChild(child), child; }; } }; }, function(module, exports) { module.exports = require("https"); }, function(module, exports) { (function() { module.exports = { Element: 1, Attribute: 2, Text: 3, CData: 4, EntityReference: 5, EntityDeclaration: 6, ProcessingInstruction: 7, Comment: 8, Document: 9, DocType: 10, DocumentFragment: 11, NotationDeclaration: 12, Declaration: 201, Raw: 202, AttributeDeclaration: 203, ElementDeclaration: 204, Dummy: 205 }; }).call(this); }, function(module, exports) { module.exports = require("os"); }, function(module, exports) { module.exports = require("querystring"); }, function(module, exports) { module.exports = require("assert"); }, function(module, exports, __webpack_require__) { var buffer = __webpack_require__(10), Buffer = buffer.Buffer; function copyProps(src, dst) { for (var key in src) dst[key] = src[key]; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length); } Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow ? module.exports = buffer : (copyProps(buffer, exports), exports.Buffer = SafeBuffer), copyProps(Buffer, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) { if ("number" == typeof arg) throw new TypeError("Argument must not be a number"); return Buffer(arg, encodingOrOffset, length); }, SafeBuffer.alloc = function(size, fill, encoding) { if ("number" != typeof size) throw new TypeError("Argument must be a number"); var buf = Buffer(size); return void 0 !== fill ? "string" == typeof encoding ? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf; }, SafeBuffer.allocUnsafe = function(size) { if ("number" != typeof size) throw new TypeError("Argument must be a number"); return Buffer(size); }, SafeBuffer.allocUnsafeSlow = function(size) { if ("number" != typeof size) throw new TypeError("Argument must be a number"); return buffer.SlowBuffer(size); }; }, function(module, exports, __webpack_require__) { module.exports = Key; var edCompat, assert = __webpack_require__(15), algs = __webpack_require__(31), crypto = __webpack_require__(6), Fingerprint = __webpack_require__(109), Signature = __webpack_require__(53), DiffieHellman = __webpack_require__(264).DiffieHellman, errs = __webpack_require__(48), utils = __webpack_require__(28), PrivateKey = __webpack_require__(29); try { edCompat = __webpack_require__(521); } catch (e) {} var InvalidAlgorithmError = errs.InvalidAlgorithmError, KeyParseError = errs.KeyParseError, formats = {}; function Key(opts) { assert.object(opts, "options"), assert.arrayOfObject(opts.parts, "options.parts"), assert.string(opts.type, "options.type"), assert.optionalString(opts.comment, "options.comment"); var algInfo = algs.info[opts.type]; if ("object" != typeof algInfo) throw new InvalidAlgorithmError(opts.type); for (var sz, partLookup = {}, i = 0; i < opts.parts.length; ++i) { var part = opts.parts[i]; partLookup[part.name] = part; } if (this.type = opts.type, this.parts = opts.parts, this.part = partLookup, this.comment = void 0, this.source = opts.source, this._rfc4253Cache = opts._rfc4253Cache, this._hashCache = {}, this.curve = void 0, "ecdsa" === this.type) { var curve = this.part.curve.data.toString(); this.curve = curve, sz = algs.curves[curve].size; } else if ("ed25519" === this.type || "curve25519" === this.type) sz = 256, this.curve = "curve25519"; else { var szPart = this.part[algInfo.sizePart]; sz = 8 * (sz = szPart.data.length) - utils.countZeros(szPart.data); } this.size = sz; } formats.auto = __webpack_require__(522), formats.pem = __webpack_require__(62), formats.pkcs1 = __webpack_require__(265), formats.pkcs8 = __webpack_require__(113), formats.rfc4253 = __webpack_require__(63), formats.ssh = __webpack_require__(524), formats["ssh-private"] = __webpack_require__(165), formats.openssh = formats["ssh-private"], formats.dnssec = __webpack_require__(266), formats.putty = __webpack_require__(525), formats.ppk = formats.putty, Key.formats = formats, Key.prototype.toBuffer = function(format, options) { return void 0 === format && (format = "ssh"), assert.string(format, "format"), assert.object(formats[format], "formats[format]"), assert.optionalObject(options, "options"), "rfc4253" === format ? (void 0 === this._rfc4253Cache && (this._rfc4253Cache = formats.rfc4253.write(this)), this._rfc4253Cache) : formats[format].write(this, options); }, Key.prototype.toString = function(format, options) { return this.toBuffer(format, options).toString(); }, Key.prototype.hash = function(algo, type) { if (assert.string(algo, "algorithm"), assert.optionalString(type, "type"), void 0 === type && (type = "ssh"), algo = algo.toLowerCase(), void 0 === algs.hashAlgs[algo]) throw new InvalidAlgorithmError(algo); var buf, cacheKey = algo + "||" + type; if (this._hashCache[cacheKey]) return this._hashCache[cacheKey]; if ("ssh" === type) buf = this.toBuffer("rfc4253"); else { if ("spki" !== type) throw new Error("Hash type " + type + " not supported"); buf = formats.pkcs8.pkcs8ToBuffer(this); } var hash = crypto.createHash(algo).update(buf).digest(); return this._hashCache[cacheKey] = hash, hash; }, Key.prototype.fingerprint = function(algo, type) { void 0 === algo && (algo = "sha256"), void 0 === type && (type = "ssh"), assert.string(algo, "algorithm"), assert.string(type, "type"); var opts = { type: "key", hash: this.hash(algo, type), algorithm: algo, hashType: type }; return new Fingerprint(opts); }, Key.prototype.defaultHashAlgorithm = function() { var hashAlgo = "sha1"; return "rsa" === this.type && (hashAlgo = "sha256"), "dsa" === this.type && this.size > 1024 && (hashAlgo = "sha256"), "ed25519" === this.type && (hashAlgo = "sha512"), "ecdsa" === this.type && (hashAlgo = this.size <= 256 ? "sha256" : this.size <= 384 ? "sha384" : "sha512"), hashAlgo; }, Key.prototype.createVerify = function(hashAlgo) { if (void 0 === hashAlgo && (hashAlgo = this.defaultHashAlgorithm()), assert.string(hashAlgo, "hash algorithm"), "ed25519" === this.type && void 0 !== edCompat) return new edCompat.Verifier(this, hashAlgo); if ("curve25519" === this.type) throw new Error("Curve25519 keys are not suitable for signing or verification"); var v, nm, err; try { nm = hashAlgo.toUpperCase(), v = crypto.createVerify(nm); } catch (e) { err = e; } (void 0 === v || err instanceof Error && err.message.match(/Unknown message digest/)) && (nm = "RSA-", nm += hashAlgo.toUpperCase(), v = crypto.createVerify(nm)), assert.ok(v, "failed to create verifier"); var oldVerify = v.verify.bind(v), key = this.toBuffer("pkcs8"), curve = this.curve, self = this; return v.verify = function(signature, fmt) { if (Signature.isSignature(signature, [ 2, 0 ])) return signature.type === self.type && (!signature.hashAlgorithm || signature.hashAlgorithm === hashAlgo) && (!signature.curve || "ecdsa" !== self.type || signature.curve === curve) && oldVerify(key, signature.toBuffer("asn1")); if ("string" == typeof signature || Buffer.isBuffer(signature)) return oldVerify(key, signature, fmt); throw Signature.isSignature(signature, [ 1, 0 ]) ? new Error("signature was created by too old a version of sshpk and cannot be verified") : new TypeError("signature must be a string, Buffer, or Signature object"); }, v; }, Key.prototype.createDiffieHellman = function() { if ("rsa" === this.type) throw new Error("RSA keys do not support Diffie-Hellman"); return new DiffieHellman(this); }, Key.prototype.createDH = Key.prototype.createDiffieHellman, Key.parse = function(data, format, options) { "string" != typeof data && assert.buffer(data, "data"), void 0 === format && (format = "auto"), assert.string(format, "format"), "string" == typeof options && (options = { filename: options }), assert.optionalObject(options, "options"), void 0 === options && (options = {}), assert.optionalString(options.filename, "options.filename"), void 0 === options.filename && (options.filename = "(unnamed)"), assert.object(formats[format], "formats[format]"); try { var k = formats[format].read(data, options); return k instanceof PrivateKey && (k = k.toPublic()), k.comment || (k.comment = options.filename), k; } catch (e) { if ("KeyEncryptedError" === e.name) throw e; throw new KeyParseError(options.filename, format, e); } }, Key.isKey = function(obj, ver) { return utils.isCompatible(obj, Key, ver); }, Key.prototype._sshpkApiVersion = [ 1, 7 ], Key._oldVersionDetect = function(obj) { return assert.func(obj.toBuffer), assert.func(obj.fingerprint), obj.createDH ? [ 1, 4 ] : obj.defaultHashAlgorithm ? [ 1, 3 ] : obj.formats.auto ? [ 1, 2 ] : obj.formats.pkcs1 ? [ 1, 1 ] : [ 1, 0 ]; }; }, function(module, exports, __webpack_require__) { module.exports = { bufferSplit: function(buf, chr) { assert.buffer(buf), assert.string(chr); for (var parts = [], lastPart = 0, matches = 0, i = 0; i < buf.length; ++i) if (buf[i] === chr.charCodeAt(matches) ? ++matches : matches = buf[i] === chr.charCodeAt(0) ? 1 : 0, matches >= chr.length) { var newPart = i + 1; parts.push(buf.slice(lastPart, newPart - matches)), lastPart = newPart, matches = 0; } return lastPart <= buf.length && parts.push(buf.slice(lastPart, buf.length)), parts; }, addRSAMissing: function(key) { assert.object(key), assertCompatible(key, PrivateKey, [ 1, 1 ]); var buf, d = new jsbn(key.part.d.data); if (!key.part.dmodp) { var p = new jsbn(key.part.p.data); buf = bigintToMpBuf(d.mod(p.subtract(1))), key.part.dmodp = { name: "dmodp", data: buf }, key.parts.push(key.part.dmodp); } if (!key.part.dmodq) { var q = new jsbn(key.part.q.data); buf = bigintToMpBuf(d.mod(q.subtract(1))), key.part.dmodq = { name: "dmodq", data: buf }, key.parts.push(key.part.dmodq); } }, calculateDSAPublic: function(g, p, x) { return assert.buffer(g), assert.buffer(p), assert.buffer(x), g = new jsbn(g), p = new jsbn(p), x = new jsbn(x), bigintToMpBuf(g.modPow(x, p)); }, calculateED25519Public: function(k) { assert.buffer(k); var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); return Buffer.from(kp.publicKey); }, calculateX25519Public: function(k) { assert.buffer(k); var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); return Buffer.from(kp.publicKey); }, mpNormalize: mpNormalize, mpDenormalize: function(buf) { for (assert.buffer(buf); buf.length > 1 && 0 === buf[0]; ) buf = buf.slice(1); return buf; }, ecNormalize: function(buf, addZero) { if (assert.buffer(buf), 0 === buf[0] && 4 === buf[1]) return addZero ? buf : buf.slice(1); if (4 === buf[0]) { if (!addZero) return buf; } else { for (;0 === buf[0]; ) buf = buf.slice(1); if (2 === buf[0] || 3 === buf[0]) throw new Error("Compressed elliptic curve points are not supported"); if (4 !== buf[0]) throw new Error("Not a valid elliptic curve point"); if (!addZero) return buf; } var b = Buffer.alloc(buf.length + 1); return b[0] = 0, buf.copy(b, 1), b; }, countZeros: function(buf) { for (var o = 0, obit = 8; o < buf.length; ) { var mask = 1 << obit; if ((buf[o] & mask) === mask) break; --obit < 0 && (o++, obit = 8); } return 8 * o + (8 - obit) - 1; }, assertCompatible: assertCompatible, isCompatible: function(obj, klass, needVer) { if (null === obj || "object" != typeof obj) return !1; if (void 0 === needVer && (needVer = klass.prototype._sshpkApiVersion), obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return !0; for (var proto = Object.getPrototypeOf(obj), depth = 0; proto.constructor.name !== klass.name; ) if (!(proto = Object.getPrototypeOf(proto)) || ++depth > 3) return !1; if (proto.constructor.name !== klass.name) return !1; var ver = proto._sshpkApiVersion; return void 0 === ver && (ver = klass._oldVersionDetect(obj)), !(ver[0] != needVer[0] || ver[1] < needVer[1]); }, opensslKeyDeriv: function(cipher, salt, passphrase, count) { assert.buffer(salt, "salt"), assert.buffer(passphrase, "passphrase"), assert.number(count, "iteration count"); var D, D_prev, bufs, clen = CIPHER_LEN[cipher]; assert.object(clen, "supported cipher"), salt = salt.slice(0, 8); for (var material = Buffer.alloc(0); material.length < clen.key + clen.iv; ) { bufs = [], D_prev && bufs.push(D_prev), bufs.push(passphrase), bufs.push(salt), D = Buffer.concat(bufs); for (var j = 0; j < count; ++j) D = crypto.createHash("md5").update(D).digest(); material = Buffer.concat([ material, D ]), D_prev = D; } return { key: material.slice(0, clen.key), iv: material.slice(clen.key, clen.key + clen.iv) }; }, opensshCipherInfo: function(cipher) { var inf = {}; switch (cipher) { case "3des-cbc": inf.keySize = 24, inf.blockSize = 8, inf.opensslName = "des-ede3-cbc"; break; case "blowfish-cbc": inf.keySize = 16, inf.blockSize = 8, inf.opensslName = "bf-cbc"; break; case "aes128-cbc": case "aes128-ctr": case "aes128-gcm@openssh.com": inf.keySize = 16, inf.blockSize = 16, inf.opensslName = "aes-128-" + cipher.slice(7, 10); break; case "aes192-cbc": case "aes192-ctr": case "aes192-gcm@openssh.com": inf.keySize = 24, inf.blockSize = 16, inf.opensslName = "aes-192-" + cipher.slice(7, 10); break; case "aes256-cbc": case "aes256-ctr": case "aes256-gcm@openssh.com": inf.keySize = 32, inf.blockSize = 16, inf.opensslName = "aes-256-" + cipher.slice(7, 10); break; default: throw new Error('Unsupported openssl cipher "' + cipher + '"'); } return inf; }, publicFromPrivateECDSA: function(curveName, priv) { assert.string(curveName, "curveName"), assert.buffer(priv); var params = algs.curves[curveName], p = new jsbn(params.p), a = new jsbn(params.a), b = new jsbn(params.b), curve = new ec.ECCurveFp(p, a, b), G = curve.decodePointHex(params.G.toString("hex")), d = new jsbn(mpNormalize(priv)), pub = G.multiply(d); pub = Buffer.from(curve.encodePointHex(pub), "hex"); var parts = []; return parts.push({ name: "curve", data: Buffer.from(curveName) }), parts.push({ name: "Q", data: pub }), new Key({ type: "ecdsa", curve: curve, parts: parts }); }, zeroPadToLength: function(buf, len) { for (assert.buffer(buf), assert.number(len); buf.length > len; ) assert.equal(buf[0], 0), buf = buf.slice(1); for (;buf.length < len; ) { var b = Buffer.alloc(buf.length + 1); b[0] = 0, buf.copy(b, 1), buf = b; } return buf; }, writeBitString: function(der, buf, tag) { void 0 === tag && (tag = asn1.Ber.BitString); var b = Buffer.alloc(buf.length + 1); b[0] = 0, buf.copy(b, 1), der.writeBuffer(b, tag); }, readBitString: function(der, tag) { void 0 === tag && (tag = asn1.Ber.BitString); var buf = der.readString(tag, !0); return assert.strictEqual(buf[0], 0, "bit strings with unused bits are not supported (0x" + buf[0].toString(16) + ")"), buf.slice(1); }, pbkdf2: function(hashAlg, salt, iterations, size, passphrase) { var hkey = Buffer.alloc(salt.length + 4); salt.copy(hkey); for (var gen = 0, ts = [], i = 1; gen < size; ) { var t = T(i++); gen += t.length, ts.push(t); } return Buffer.concat(ts).slice(0, size); function T(I) { hkey.writeUInt32BE(I, hkey.length - 4); var hmac = crypto.createHmac(hashAlg, passphrase); hmac.update(hkey); for (var Ti = hmac.digest(), Uc = Ti, c = 1; c++ < iterations; ) { (hmac = crypto.createHmac(hashAlg, passphrase)).update(Uc), Uc = hmac.digest(); for (var x = 0; x < Ti.length; ++x) Ti[x] ^= Uc[x]; } return Ti; } } }; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, PrivateKey = __webpack_require__(29), Key = __webpack_require__(27), crypto = __webpack_require__(6), algs = __webpack_require__(31), asn1 = __webpack_require__(54), ec = __webpack_require__(164), jsbn = __webpack_require__(110).BigInteger, nacl = __webpack_require__(111); function assertCompatible(obj, klass, needVer, name) { if (void 0 === name && (name = "object"), assert.ok(obj, name + " must not be null"), assert.object(obj, name + " must be an object"), void 0 === needVer && (needVer = klass.prototype._sshpkApiVersion), !(obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0])) { for (var proto = Object.getPrototypeOf(obj), depth = 0; proto.constructor.name !== klass.name; ) proto = Object.getPrototypeOf(proto), assert.ok(proto && ++depth <= 3, name + " must be a " + klass.name + " instance"); assert.strictEqual(proto.constructor.name, klass.name, name + " must be a " + klass.name + " instance"); var ver = proto._sshpkApiVersion; void 0 === ver && (ver = klass._oldVersionDetect(obj)), assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1], name + " must be compatible with " + klass.name + " klass version " + needVer[0] + "." + needVer[1]); } } var CIPHER_LEN = { "des-ede3-cbc": { key: 24, iv: 8 }, "aes-128-cbc": { key: 16, iv: 16 }, "aes-256-cbc": { key: 32, iv: 16 } }; function mpNormalize(buf) { for (assert.buffer(buf); buf.length > 1 && 0 === buf[0] && 0 == (128 & buf[1]); ) buf = buf.slice(1); if (128 == (128 & buf[0])) { var b = Buffer.alloc(buf.length + 1); b[0] = 0, buf.copy(b, 1), buf = b; } return buf; } function bigintToMpBuf(bigint) { var buf = Buffer.from(bigint.toByteArray()); return mpNormalize(buf); } }, function(module, exports, __webpack_require__) { module.exports = PrivateKey; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(31), crypto = __webpack_require__(6), Signature = (__webpack_require__(109), __webpack_require__(53)), errs = __webpack_require__(48), util = __webpack_require__(0), utils = __webpack_require__(28), dhe = __webpack_require__(264), generateECDSA = dhe.generateECDSA, generateED25519 = dhe.generateED25519, edCompat = __webpack_require__(521), nacl = __webpack_require__(111), Key = __webpack_require__(27), KeyParseError = (errs.InvalidAlgorithmError, errs.KeyParseError), formats = (errs.KeyEncryptedError, {}); function PrivateKey(opts) { assert.object(opts, "options"), Key.call(this, opts), this._pubCache = void 0; } formats.auto = __webpack_require__(522), formats.pem = __webpack_require__(62), formats.pkcs1 = __webpack_require__(265), formats.pkcs8 = __webpack_require__(113), formats.rfc4253 = __webpack_require__(63), formats["ssh-private"] = __webpack_require__(165), formats.openssh = formats["ssh-private"], formats.ssh = formats["ssh-private"], formats.dnssec = __webpack_require__(266), util.inherits(PrivateKey, Key), PrivateKey.formats = formats, PrivateKey.prototype.toBuffer = function(format, options) { return void 0 === format && (format = "pkcs1"), assert.string(format, "format"), assert.object(formats[format], "formats[format]"), assert.optionalObject(options, "options"), formats[format].write(this, options); }, PrivateKey.prototype.hash = function(algo, type) { return this.toPublic().hash(algo, type); }, PrivateKey.prototype.fingerprint = function(algo, type) { return this.toPublic().fingerprint(algo, type); }, PrivateKey.prototype.toPublic = function() { if (this._pubCache) return this._pubCache; for (var algInfo = algs.info[this.type], pubParts = [], i = 0; i < algInfo.parts.length; ++i) { var p = algInfo.parts[i]; pubParts.push(this.part[p]); } return this._pubCache = new Key({ type: this.type, source: this, parts: pubParts }), this.comment && (this._pubCache.comment = this.comment), this._pubCache; }, PrivateKey.prototype.derive = function(newType) { var priv, pub, pair; if (assert.string(newType, "type"), "ed25519" === this.type && "curve25519" === newType) return 0 === (priv = this.part.k.data)[0] && (priv = priv.slice(1)), pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)), pub = Buffer.from(pair.publicKey), new PrivateKey({ type: "curve25519", parts: [ { name: "A", data: utils.mpNormalize(pub) }, { name: "k", data: utils.mpNormalize(priv) } ] }); if ("curve25519" === this.type && "ed25519" === newType) return 0 === (priv = this.part.k.data)[0] && (priv = priv.slice(1)), pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)), pub = Buffer.from(pair.publicKey), new PrivateKey({ type: "ed25519", parts: [ { name: "A", data: utils.mpNormalize(pub) }, { name: "k", data: utils.mpNormalize(priv) } ] }); throw new Error("Key derivation not supported from " + this.type + " to " + newType); }, PrivateKey.prototype.createVerify = function(hashAlgo) { return this.toPublic().createVerify(hashAlgo); }, PrivateKey.prototype.createSign = function(hashAlgo) { if (void 0 === hashAlgo && (hashAlgo = this.defaultHashAlgorithm()), assert.string(hashAlgo, "hash algorithm"), "ed25519" === this.type && void 0 !== edCompat) return new edCompat.Signer(this, hashAlgo); if ("curve25519" === this.type) throw new Error("Curve25519 keys are not suitable for signing or verification"); var v, nm, err; try { nm = hashAlgo.toUpperCase(), v = crypto.createSign(nm); } catch (e) { err = e; } (void 0 === v || err instanceof Error && err.message.match(/Unknown message digest/)) && (nm = "RSA-", nm += hashAlgo.toUpperCase(), v = crypto.createSign(nm)), assert.ok(v, "failed to create verifier"); var oldSign = v.sign.bind(v), key = this.toBuffer("pkcs1"), type = this.type, curve = this.curve; return v.sign = function() { var sig = oldSign(key); return "string" == typeof sig && (sig = Buffer.from(sig, "binary")), (sig = Signature.parse(sig, type, "asn1")).hashAlgorithm = hashAlgo, sig.curve = curve, sig; }, v; }, PrivateKey.parse = function(data, format, options) { "string" != typeof data && assert.buffer(data, "data"), void 0 === format && (format = "auto"), assert.string(format, "format"), "string" == typeof options && (options = { filename: options }), assert.optionalObject(options, "options"), void 0 === options && (options = {}), assert.optionalString(options.filename, "options.filename"), void 0 === options.filename && (options.filename = "(unnamed)"), assert.object(formats[format], "formats[format]"); try { var k = formats[format].read(data, options); return assert.ok(k instanceof PrivateKey, "key is not a private key"), k.comment || (k.comment = options.filename), k; } catch (e) { if ("KeyEncryptedError" === e.name) throw e; throw new KeyParseError(options.filename, format, e); } }, PrivateKey.isPrivateKey = function(obj, ver) { return utils.isCompatible(obj, PrivateKey, ver); }, PrivateKey.generate = function(type, options) { switch (void 0 === options && (options = {}), assert.object(options, "options"), type) { case "ecdsa": return void 0 === options.curve && (options.curve = "nistp256"), assert.string(options.curve, "options.curve"), generateECDSA(options.curve); case "ed25519": return generateED25519(); default: throw new Error('Key generation not supported with key type "' + type + '"'); } }, PrivateKey.prototype._sshpkApiVersion = [ 1, 6 ], PrivateKey._oldVersionDetect = function(obj) { return assert.func(obj.toPublic), assert.func(obj.createSign), obj.derive ? [ 1, 3 ] : obj.defaultHashAlgorithm ? [ 1, 2 ] : obj.formats.auto ? [ 1, 1 ] : [ 1, 0 ]; }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(47), _proto = (__webpack_require__(13), __webpack_require__(19)); function MasterElement(doc, tagId, ebmlId, start, length) { Element1.call(this, doc, tagId, ebmlId, start, length); } util.inherits(MasterElement, Element1), module.exports = MasterElement, _proto.oneChild(MasterElement.prototype, "CRC_32"); }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(14).Buffer, algInfo = { dsa: { parts: [ "p", "q", "g", "y" ], sizePart: "p" }, rsa: { parts: [ "e", "n" ], sizePart: "n" }, ecdsa: { parts: [ "curve", "Q" ], sizePart: "Q" }, ed25519: { parts: [ "A" ], sizePart: "A" } }; algInfo.curve25519 = algInfo.ed25519; var algPrivInfo = { dsa: { parts: [ "p", "q", "g", "y", "x" ] }, rsa: { parts: [ "n", "e", "d", "iqmp", "p", "q" ] }, ecdsa: { parts: [ "curve", "Q", "d" ] }, ed25519: { parts: [ "A", "k" ] } }; algPrivInfo.curve25519 = algPrivInfo.ed25519; var curves = { nistp256: { size: 256, pkcs8oid: "1.2.840.10045.3.1.7", p: Buffer.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g, ""), "hex"), a: Buffer.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g, ""), "hex"), b: Buffer.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g, ""), "hex"), s: Buffer.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g, ""), "hex"), n: Buffer.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g, ""), "hex"), G: Buffer.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g, ""), "hex") }, nistp384: { size: 384, pkcs8oid: "1.3.132.0.34", p: Buffer.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g, ""), "hex"), a: Buffer.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g, ""), "hex"), b: Buffer.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g, ""), "hex"), s: Buffer.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g, ""), "hex"), n: Buffer.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g, ""), "hex"), G: Buffer.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g, ""), "hex") }, nistp521: { size: 521, pkcs8oid: "1.3.132.0.35", p: Buffer.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g, ""), "hex"), a: Buffer.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g, ""), "hex"), b: Buffer.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g, ""), "hex"), s: Buffer.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g, ""), "hex"), n: Buffer.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g, ""), "hex"), G: Buffer.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g, ""), "hex") } }; module.exports = { info: algInfo, privInfo: algPrivInfo, hashAlgs: { md5: !0, sha1: !0, sha256: !0, sha384: !0, sha512: !0 }, curves: curves }; }, function(module, exports) { module.exports = require("child_process"); }, function(module, exports, __webpack_require__) { function objectToString(o) { return Object.prototype.toString.call(o); } exports.isArray = function(arg) { return Array.isArray ? Array.isArray(arg) : "[object Array]" === objectToString(arg); }, exports.isBoolean = function(arg) { return "boolean" == typeof arg; }, exports.isNull = function(arg) { return null === arg; }, exports.isNullOrUndefined = function(arg) { return null == arg; }, exports.isNumber = function(arg) { return "number" == typeof arg; }, exports.isString = function(arg) { return "string" == typeof arg; }, exports.isSymbol = function(arg) { return "symbol" == typeof arg; }, exports.isUndefined = function(arg) { return void 0 === arg; }, exports.isRegExp = function(re) { return "[object RegExp]" === objectToString(re); }, exports.isObject = function(arg) { return "object" == typeof arg && null !== arg; }, exports.isDate = function(d) { return "[object Date]" === objectToString(d); }, exports.isError = function(e) { return "[object Error]" === objectToString(e) || e instanceof Error; }, exports.isFunction = function(arg) { return "function" == typeof arg; }, exports.isPrimitive = function(arg) { return null === arg || "boolean" == typeof arg || "number" == typeof arg || "string" == typeof arg || "symbol" == typeof arg || void 0 === arg; }, exports.isBuffer = __webpack_require__(10).Buffer.isBuffer; }, function(module, exports, __webpack_require__) { "use strict"; function _interopDefault(ex) { return ex && "object" == typeof ex && "default" in ex ? ex.default : ex; } Object.defineProperty(exports, "__esModule", { value: !0 }); var Stream = _interopDefault(__webpack_require__(3)), http = _interopDefault(__webpack_require__(11)), Url = _interopDefault(__webpack_require__(7)), https = _interopDefault(__webpack_require__(21)), zlib = _interopDefault(__webpack_require__(43)); const Readable = Stream.Readable, BUFFER = Symbol("buffer"), TYPE = Symbol("type"); class Blob { constructor() { this[TYPE] = ""; const blobParts = arguments[0], options = arguments[1], buffers = []; let size = 0; if (blobParts) { const a = blobParts, length = Number(a.length); for (let i = 0; i < length; i++) { const element = a[i]; let buffer; buffer = element instanceof Buffer ? element : ArrayBuffer.isView(element) ? Buffer.from(element.buffer, element.byteOffset, element.byteLength) : element instanceof ArrayBuffer ? Buffer.from(element) : element instanceof Blob ? element[BUFFER] : Buffer.from("string" == typeof element ? element : String(element)), size += buffer.length, buffers.push(buffer); } } this[BUFFER] = Buffer.concat(buffers); let type = options && void 0 !== options.type && String(options.type).toLowerCase(); type && !/[^\u0020-\u007E]/.test(type) && (this[TYPE] = type); } get size() { return this[BUFFER].length; } get type() { return this[TYPE]; } text() { return Promise.resolve(this[BUFFER].toString()); } arrayBuffer() { const buf = this[BUFFER], ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); return Promise.resolve(ab); } stream() { const readable = new Readable; return readable._read = function() {}, readable.push(this[BUFFER]), readable.push(null), readable; } toString() { return "[object Blob]"; } slice() { const size = this.size, start = arguments[0], end = arguments[1]; let relativeStart, relativeEnd; relativeStart = void 0 === start ? 0 : start < 0 ? Math.max(size + start, 0) : Math.min(start, size), relativeEnd = void 0 === end ? size : end < 0 ? Math.max(size + end, 0) : Math.min(end, size); const span = Math.max(relativeEnd - relativeStart, 0), slicedBuffer = this[BUFFER].slice(relativeStart, relativeStart + span), blob = new Blob([], { type: arguments[2] }); return blob[BUFFER] = slicedBuffer, blob; } } function FetchError(message, type, systemError) { Error.call(this, message), this.message = message, this.type = type, systemError && (this.code = this.errno = systemError.code), Error.captureStackTrace(this, this.constructor); } let convert; Object.defineProperties(Blob.prototype, { size: { enumerable: !0 }, type: { enumerable: !0 }, slice: { enumerable: !0 } }), Object.defineProperty(Blob.prototype, Symbol.toStringTag, { value: "Blob", writable: !1, enumerable: !1, configurable: !0 }), FetchError.prototype = Object.create(Error.prototype), FetchError.prototype.constructor = FetchError, FetchError.prototype.name = "FetchError"; try { convert = __webpack_require__(566).convert; } catch (e) {} const INTERNALS = Symbol("Body internals"), PassThrough = Stream.PassThrough; function Body(body) { var _this = this, _ref = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, _ref$size = _ref.size; let size = void 0 === _ref$size ? 0 : _ref$size; var _ref$timeout = _ref.timeout; let timeout = void 0 === _ref$timeout ? 0 : _ref$timeout; null == body ? body = null : isURLSearchParams(body) ? body = Buffer.from(body.toString()) : isBlob(body) || Buffer.isBuffer(body) || ("[object ArrayBuffer]" === Object.prototype.toString.call(body) ? body = Buffer.from(body) : ArrayBuffer.isView(body) ? body = Buffer.from(body.buffer, body.byteOffset, body.byteLength) : body instanceof Stream || (body = Buffer.from(String(body)))), this[INTERNALS] = { body: body, disturbed: !1, error: null }, this.size = size, this.timeout = timeout, body instanceof Stream && body.on("error", (function(err) { const error = "AbortError" === err.name ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); _this[INTERNALS].error = error; })); } function consumeBody() { var _this4 = this; if (this[INTERNALS].disturbed) return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); if (this[INTERNALS].disturbed = !0, this[INTERNALS].error) return Body.Promise.reject(this[INTERNALS].error); let body = this.body; if (null === body) return Body.Promise.resolve(Buffer.alloc(0)); if (isBlob(body) && (body = body.stream()), Buffer.isBuffer(body)) return Body.Promise.resolve(body); if (!(body instanceof Stream)) return Body.Promise.resolve(Buffer.alloc(0)); let accum = [], accumBytes = 0, abort = !1; return new Body.Promise((function(resolve, reject) { let resTimeout; _this4.timeout && (resTimeout = setTimeout((function() { abort = !0, reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout")); }), _this4.timeout)), body.on("error", (function(err) { "AbortError" === err.name ? (abort = !0, reject(err)) : reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err)); })), body.on("data", (function(chunk) { if (!abort && null !== chunk) { if (_this4.size && accumBytes + chunk.length > _this4.size) return abort = !0, void reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); accumBytes += chunk.length, accum.push(chunk); } })), body.on("end", (function() { if (!abort) { clearTimeout(resTimeout); try { resolve(Buffer.concat(accum, accumBytes)); } catch (err) { reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); } } })); })); } function isURLSearchParams(obj) { return "object" == typeof obj && "function" == typeof obj.append && "function" == typeof obj.delete && "function" == typeof obj.get && "function" == typeof obj.getAll && "function" == typeof obj.has && "function" == typeof obj.set && ("URLSearchParams" === obj.constructor.name || "[object URLSearchParams]" === Object.prototype.toString.call(obj) || "function" == typeof obj.sort); } function isBlob(obj) { return "object" == typeof obj && "function" == typeof obj.arrayBuffer && "string" == typeof obj.type && "function" == typeof obj.stream && "function" == typeof obj.constructor && "string" == typeof obj.constructor.name && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]); } function clone(instance) { let p1, p2, body = instance.body; if (instance.bodyUsed) throw new Error("cannot clone body after it is used"); return body instanceof Stream && "function" != typeof body.getBoundary && (p1 = new PassThrough, p2 = new PassThrough, body.pipe(p1), body.pipe(p2), instance[INTERNALS].body = p1, body = p2), body; } function extractContentType(body) { return null === body ? null : "string" == typeof body ? "text/plain;charset=UTF-8" : isURLSearchParams(body) ? "application/x-www-form-urlencoded;charset=UTF-8" : isBlob(body) ? body.type || null : Buffer.isBuffer(body) || "[object ArrayBuffer]" === Object.prototype.toString.call(body) || ArrayBuffer.isView(body) ? null : "function" == typeof body.getBoundary ? `multipart/form-data;boundary=${body.getBoundary()}` : body instanceof Stream ? null : "text/plain;charset=UTF-8"; } function getTotalBytes(instance) { const body = instance.body; return null === body ? 0 : isBlob(body) ? body.size : Buffer.isBuffer(body) ? body.length : body && "function" == typeof body.getLengthSync && (body._lengthRetrievers && 0 == body._lengthRetrievers.length || body.hasKnownLength && body.hasKnownLength()) ? body.getLengthSync() : null; } Body.prototype = { get body() { return this[INTERNALS].body; }, get bodyUsed() { return this[INTERNALS].disturbed; }, arrayBuffer() { return consumeBody.call(this).then((function(buf) { return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); })); }, blob() { let ct = this.headers && this.headers.get("content-type") || ""; return consumeBody.call(this).then((function(buf) { return Object.assign(new Blob([], { type: ct.toLowerCase() }), { [BUFFER]: buf }); })); }, json() { var _this2 = this; return consumeBody.call(this).then((function(buffer) { try { return JSON.parse(buffer.toString()); } catch (err) { return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); } })); }, text() { return consumeBody.call(this).then((function(buffer) { return buffer.toString(); })); }, buffer() { return consumeBody.call(this); }, textConverted() { var _this3 = this; return consumeBody.call(this).then((function(buffer) { return (function(buffer, headers) { if ("function" != typeof convert) throw new Error("The package `encoding` must be installed to use the textConverted() function"); const ct = headers.get("content-type"); let res, str, charset = "utf-8"; return ct && (res = /charset=([^;]*)/i.exec(ct)), str = buffer.slice(0, 1024).toString(), !res && str && (res = / 0 && void 0 !== arguments[0] ? arguments[0] : void 0; if (this[MAP] = Object.create(null), init instanceof Headers) { const rawHeaders = init.raw(), headerNames = Object.keys(rawHeaders); for (const headerName of headerNames) for (const value of rawHeaders[headerName]) this.append(headerName, value); } else if (null == init) ; else { if ("object" != typeof init) throw new TypeError("Provided initializer must be an object"); { const method = init[Symbol.iterator]; if (null != method) { if ("function" != typeof method) throw new TypeError("Header pairs must be iterable"); const pairs = []; for (const pair of init) { if ("object" != typeof pair || "function" != typeof pair[Symbol.iterator]) throw new TypeError("Each header pair must be iterable"); pairs.push(Array.from(pair)); } for (const pair of pairs) { if (2 !== pair.length) throw new TypeError("Each header pair must be a name/value tuple"); this.append(pair[0], pair[1]); } } else for (const key of Object.keys(init)) { const value = init[key]; this.append(key, value); } } } } get(name) { validateName(name = `${name}`); const key = find(this[MAP], name); return void 0 === key ? null : this[MAP][key].join(", "); } forEach(callback) { let thisArg = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0, pairs = getHeaders(this), i = 0; for (;i < pairs.length; ) { var _pairs$i = pairs[i]; const name = _pairs$i[0], value = _pairs$i[1]; callback.call(thisArg, value, name, this), pairs = getHeaders(this), i++; } } set(name, value) { value = `${value}`, validateName(name = `${name}`), validateValue(value); const key = find(this[MAP], name); this[MAP][void 0 !== key ? key : name] = [ value ]; } append(name, value) { value = `${value}`, validateName(name = `${name}`), validateValue(value); const key = find(this[MAP], name); void 0 !== key ? this[MAP][key].push(value) : this[MAP][name] = [ value ]; } has(name) { return validateName(name = `${name}`), void 0 !== find(this[MAP], name); } delete(name) { validateName(name = `${name}`); const key = find(this[MAP], name); void 0 !== key && delete this[MAP][key]; } raw() { return this[MAP]; } keys() { return createHeadersIterator(this, "key"); } values() { return createHeadersIterator(this, "value"); } [Symbol.iterator]() { return createHeadersIterator(this, "key+value"); } } function getHeaders(headers) { let kind = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "key+value"; const keys = Object.keys(headers[MAP]).sort(); return keys.map("key" === kind ? function(k) { return k.toLowerCase(); } : "value" === kind ? function(k) { return headers[MAP][k].join(", "); } : function(k) { return [ k.toLowerCase(), headers[MAP][k].join(", ") ]; }); } Headers.prototype.entries = Headers.prototype[Symbol.iterator], Object.defineProperty(Headers.prototype, Symbol.toStringTag, { value: "Headers", writable: !1, enumerable: !1, configurable: !0 }), Object.defineProperties(Headers.prototype, { get: { enumerable: !0 }, forEach: { enumerable: !0 }, set: { enumerable: !0 }, append: { enumerable: !0 }, has: { enumerable: !0 }, delete: { enumerable: !0 }, keys: { enumerable: !0 }, values: { enumerable: !0 }, entries: { enumerable: !0 } }); const INTERNAL = Symbol("internal"); function createHeadersIterator(target, kind) { const iterator = Object.create(HeadersIteratorPrototype); return iterator[INTERNAL] = { target: target, kind: kind, index: 0 }, iterator; } const HeadersIteratorPrototype = Object.setPrototypeOf({ next() { if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) throw new TypeError("Value of `this` is not a HeadersIterator"); var _INTERNAL = this[INTERNAL]; const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index, values = getHeaders(target, kind); return index >= values.length ? { value: void 0, done: !0 } : (this[INTERNAL].index = index + 1, { value: values[index], done: !1 }); } }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); function exportNodeCompatibleHeaders(headers) { const obj = Object.assign({ __proto__: null }, headers[MAP]), hostHeaderKey = find(headers[MAP], "Host"); return void 0 !== hostHeaderKey && (obj[hostHeaderKey] = obj[hostHeaderKey][0]), obj; } Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { value: "HeadersIterator", writable: !1, enumerable: !1, configurable: !0 }); const INTERNALS$1 = Symbol("Response internals"), STATUS_CODES = http.STATUS_CODES; class Response { constructor() { let body = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, opts = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Body.call(this, body, opts); const status = opts.status || 200, headers = new Headers(opts.headers); if (null != body && !headers.has("Content-Type")) { const contentType = extractContentType(body); contentType && headers.append("Content-Type", contentType); } this[INTERNALS$1] = { url: opts.url, status: status, statusText: opts.statusText || STATUS_CODES[status], headers: headers, counter: opts.counter }; } get url() { return this[INTERNALS$1].url || ""; } get status() { return this[INTERNALS$1].status; } get ok() { return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; } get redirected() { return this[INTERNALS$1].counter > 0; } get statusText() { return this[INTERNALS$1].statusText; } get headers() { return this[INTERNALS$1].headers; } clone() { return new Response(clone(this), { url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected }); } } Body.mixIn(Response.prototype), Object.defineProperties(Response.prototype, { url: { enumerable: !0 }, status: { enumerable: !0 }, ok: { enumerable: !0 }, redirected: { enumerable: !0 }, statusText: { enumerable: !0 }, headers: { enumerable: !0 }, clone: { enumerable: !0 } }), Object.defineProperty(Response.prototype, Symbol.toStringTag, { value: "Response", writable: !1, enumerable: !1, configurable: !0 }); const INTERNALS$2 = Symbol("Request internals"), parse_url = Url.parse, format_url = Url.format, streamDestructionSupported = "destroy" in Stream.Readable.prototype; function isRequest(input) { return "object" == typeof input && "object" == typeof input[INTERNALS$2]; } class Request { constructor(input) { let parsedURL, init = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; isRequest(input) ? parsedURL = parse_url(input.url) : (parsedURL = input && input.href ? parse_url(input.href) : parse_url(`${input}`), input = {}); let method = init.method || input.method || "GET"; if (method = method.toUpperCase(), (null != init.body || isRequest(input) && null !== input.body) && ("GET" === method || "HEAD" === method)) throw new TypeError("Request with GET/HEAD method cannot have body"); let inputBody = null != init.body ? init.body : isRequest(input) && null !== input.body ? clone(input) : null; Body.call(this, inputBody, { timeout: init.timeout || input.timeout || 0, size: init.size || input.size || 0 }); const headers = new Headers(init.headers || input.headers || {}); if (null != inputBody && !headers.has("Content-Type")) { const contentType = extractContentType(inputBody); contentType && headers.append("Content-Type", contentType); } let signal = isRequest(input) ? input.signal : null; if ("signal" in init && (signal = init.signal), null != signal && !(function(signal) { const proto = signal && "object" == typeof signal && Object.getPrototypeOf(signal); return !(!proto || "AbortSignal" !== proto.constructor.name); })(signal)) throw new TypeError("Expected signal to be an instanceof AbortSignal"); this[INTERNALS$2] = { method: method, redirect: init.redirect || input.redirect || "follow", headers: headers, parsedURL: parsedURL, signal: signal }, this.follow = void 0 !== init.follow ? init.follow : void 0 !== input.follow ? input.follow : 20, this.compress = void 0 !== init.compress ? init.compress : void 0 === input.compress || input.compress, this.counter = init.counter || input.counter || 0, this.agent = init.agent || input.agent; } get method() { return this[INTERNALS$2].method; } get url() { return format_url(this[INTERNALS$2].parsedURL); } get headers() { return this[INTERNALS$2].headers; } get redirect() { return this[INTERNALS$2].redirect; } get signal() { return this[INTERNALS$2].signal; } clone() { return new Request(this); } } function AbortError(message) { Error.call(this, message), this.type = "aborted", this.message = message, Error.captureStackTrace(this, this.constructor); } Body.mixIn(Request.prototype), Object.defineProperty(Request.prototype, Symbol.toStringTag, { value: "Request", writable: !1, enumerable: !1, configurable: !0 }), Object.defineProperties(Request.prototype, { method: { enumerable: !0 }, url: { enumerable: !0 }, headers: { enumerable: !0 }, redirect: { enumerable: !0 }, clone: { enumerable: !0 }, signal: { enumerable: !0 } }), AbortError.prototype = Object.create(Error.prototype), AbortError.prototype.constructor = AbortError, AbortError.prototype.name = "AbortError"; const PassThrough$1 = Stream.PassThrough, resolve_url = Url.resolve; function fetch(url, opts) { if (!fetch.Promise) throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); return Body.Promise = fetch.Promise, new fetch.Promise((function(resolve, reject) { const request = new Request(url, opts), options = (function(request) { const parsedURL = request[INTERNALS$2].parsedURL, headers = new Headers(request[INTERNALS$2].headers); if (headers.has("Accept") || headers.set("Accept", "*/*"), !parsedURL.protocol || !parsedURL.hostname) throw new TypeError("Only absolute URLs are supported"); if (!/^https?:$/.test(parsedURL.protocol)) throw new TypeError("Only HTTP(S) protocols are supported"); if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); let contentLengthValue = null; if (null == request.body && /^(POST|PUT)$/i.test(request.method) && (contentLengthValue = "0"), null != request.body) { const totalBytes = getTotalBytes(request); "number" == typeof totalBytes && (contentLengthValue = String(totalBytes)); } contentLengthValue && headers.set("Content-Length", contentLengthValue), headers.has("User-Agent") || headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"), request.compress && !headers.has("Accept-Encoding") && headers.set("Accept-Encoding", "gzip,deflate"); let agent = request.agent; return "function" == typeof agent && (agent = agent(parsedURL)), headers.has("Connection") || agent || headers.set("Connection", "close"), Object.assign({}, parsedURL, { method: request.method, headers: exportNodeCompatibleHeaders(headers), agent: agent }); })(request), send = ("https:" === options.protocol ? https : http).request, signal = request.signal; let response = null; const abort = function() { let error = new AbortError("The user aborted a request."); reject(error), request.body && request.body instanceof Stream.Readable && request.body.destroy(error), response && response.body && response.body.emit("error", error); }; if (signal && signal.aborted) return void abort(); const abortAndFinalize = function() { abort(), finalize(); }, req = send(options); let reqTimeout; function finalize() { req.abort(), signal && signal.removeEventListener("abort", abortAndFinalize), clearTimeout(reqTimeout); } signal && signal.addEventListener("abort", abortAndFinalize), request.timeout && req.once("socket", (function(socket) { reqTimeout = setTimeout((function() { reject(new FetchError(`network timeout at: ${request.url}`, "request-timeout")), finalize(); }), request.timeout); })), req.on("error", (function(err) { reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err)), finalize(); })), req.on("response", (function(res) { clearTimeout(reqTimeout); const headers = (function(obj) { const headers = new Headers; for (const name of Object.keys(obj)) if (!invalidTokenRegex.test(name)) if (Array.isArray(obj[name])) for (const val of obj[name]) invalidHeaderCharRegex.test(val) || (void 0 === headers[MAP][name] ? headers[MAP][name] = [ val ] : headers[MAP][name].push(val)); else invalidHeaderCharRegex.test(obj[name]) || (headers[MAP][name] = [ obj[name] ]); return headers; })(res.headers); if (fetch.isRedirect(res.statusCode)) { const location = headers.get("Location"), locationURL = null === location ? null : resolve_url(request.url, location); switch (request.redirect) { case "error": return reject(new FetchError(`redirect mode is set to error: ${request.url}`, "no-redirect")), void finalize(); case "manual": if (null !== locationURL) try { headers.set("Location", locationURL); } catch (err) { reject(err); } break; case "follow": if (null === locationURL) break; if (request.counter >= request.follow) return reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")), void finalize(); const requestOpts = { headers: new Headers(request.headers), follow: request.follow, counter: request.counter + 1, agent: request.agent, compress: request.compress, method: request.method, body: request.body, signal: request.signal, timeout: request.timeout }; return 303 !== res.statusCode && request.body && null === getTotalBytes(request) ? (reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), void finalize()) : (303 !== res.statusCode && (301 !== res.statusCode && 302 !== res.statusCode || "POST" !== request.method) || (requestOpts.method = "GET", requestOpts.body = void 0, requestOpts.headers.delete("content-length")), resolve(fetch(new Request(locationURL, requestOpts))), void finalize()); } } res.once("end", (function() { signal && signal.removeEventListener("abort", abortAndFinalize); })); let body = res.pipe(new PassThrough$1); const response_options = { url: request.url, status: res.statusCode, statusText: res.statusMessage, headers: headers, size: request.size, timeout: request.timeout, counter: request.counter }, codings = headers.get("Content-Encoding"); if (!request.compress || "HEAD" === request.method || null === codings || 204 === res.statusCode || 304 === res.statusCode) return response = new Response(body, response_options), void resolve(response); const zlibOptions = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH }; if ("gzip" == codings || "x-gzip" == codings) return body = body.pipe(zlib.createGunzip(zlibOptions)), response = new Response(body, response_options), void resolve(response); if ("deflate" != codings && "x-deflate" != codings) { if ("br" == codings && "function" == typeof zlib.createBrotliDecompress) return body = body.pipe(zlib.createBrotliDecompress()), response = new Response(body, response_options), void resolve(response); response = new Response(body, response_options), resolve(response); } else res.pipe(new PassThrough$1).once("data", (function(chunk) { body = 8 == (15 & chunk[0]) ? body.pipe(zlib.createInflate()) : body.pipe(zlib.createInflateRaw()), response = new Response(body, response_options), resolve(response); })); })), (function(dest, instance) { const body = instance.body; null === body ? dest.end() : isBlob(body) ? body.stream().pipe(dest) : Buffer.isBuffer(body) ? (dest.write(body), dest.end()) : body.pipe(dest); })(req, request); })); } fetch.isRedirect = function(code) { return 301 === code || 302 === code || 303 === code || 307 === code || 308 === code; }, fetch.Promise = global.Promise, module.exports = exports = fetch, Object.defineProperty(exports, "__esModule", { value: !0 }), exports.default = exports, exports.Headers = Headers, exports.Request = Request, exports.Response = Response, exports.FetchError = FetchError; }, function(module, exports, __webpack_require__) { var wrappy = __webpack_require__(288); function once(fn) { var f = function() { return f.called ? f.value : (f.called = !0, f.value = fn.apply(this, arguments)); }; return f.called = !1, f; } function onceStrict(fn) { var f = function() { if (f.called) throw new Error(f.onceError); return f.called = !0, f.value = fn.apply(this, arguments); }, name = fn.name || "Function wrapped with `once`"; return f.onceError = name + " shouldn't be called more than once", f.called = !1, f; } module.exports = wrappy(once), module.exports.strict = wrappy(onceStrict), once.proto = once((function() { Object.defineProperty(Function.prototype, "once", { value: function() { return once(this); }, configurable: !0 }), Object.defineProperty(Function.prototype, "onceStrict", { value: function() { return onceStrict(this); }, configurable: !0 }); })); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(72), _proto = (__webpack_require__(12), __webpack_require__(20)); function MasterElement(doc, tagId, ebmlId, start, length) { Element1.call(this, doc, tagId, ebmlId, start, length); } util.inherits(MasterElement, Element1), module.exports = MasterElement, _proto.oneChild(MasterElement.prototype, "CRC_32"); }, function(module, exports, __webpack_require__) { (function() { var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, isEmpty, isFunction, isObject, ref, hasProp = {}.hasOwnProperty; ref = __webpack_require__(57), isObject = ref.isObject, isFunction = ref.isFunction, isEmpty = ref.isEmpty, XMLElement = null, XMLCData = null, XMLComment = null, XMLDeclaration = null, XMLDocType = null, XMLRaw = null, XMLText = null, XMLProcessingInstruction = null, module.exports = (function() { function XMLNode(parent) { this.parent = parent, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), this.children = [], XMLElement || (XMLElement = __webpack_require__(128), XMLCData = __webpack_require__(129), XMLComment = __webpack_require__(130), XMLDeclaration = __webpack_require__(131), XMLDocType = __webpack_require__(132), XMLRaw = __webpack_require__(137), XMLText = __webpack_require__(138), XMLProcessingInstruction = __webpack_require__(139)); } return XMLNode.prototype.element = function(name, attributes, text) { var childNode, item, j, k, key, lastChild, len, len1, ref1, val; if (lastChild = null, null == attributes && (attributes = {}), attributes = attributes.valueOf(), isObject(attributes) || (text = (ref1 = [ attributes, text ])[0], attributes = ref1[1]), null != name && (name = name.valueOf()), Array.isArray(name)) for (j = 0, len = name.length; j < len; j++) item = name[j], lastChild = this.element(item); else if (isFunction(name)) lastChild = this.element(name.apply()); else if (isObject(name)) { for (key in name) if (hasProp.call(name, key)) if (val = name[key], isFunction(val) && (val = val.apply()), isObject(val) && isEmpty(val) && (val = null), !this.options.ignoreDecorators && this.stringify.convertAttKey && 0 === key.indexOf(this.stringify.convertAttKey)) lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); else if (!this.options.separateArrayItems && Array.isArray(val)) for (k = 0, len1 = val.length; k < len1; k++) item = val[k], (childNode = {})[key] = item, lastChild = this.element(childNode); else isObject(val) ? (lastChild = this.element(key)).element(val) : lastChild = this.element(key, val); } else lastChild = !this.options.ignoreDecorators && this.stringify.convertTextKey && 0 === name.indexOf(this.stringify.convertTextKey) ? this.text(text) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && 0 === name.indexOf(this.stringify.convertCDataKey) ? this.cdata(text) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && 0 === name.indexOf(this.stringify.convertCommentKey) ? this.comment(text) : !this.options.ignoreDecorators && this.stringify.convertRawKey && 0 === name.indexOf(this.stringify.convertRawKey) ? this.raw(text) : !this.options.ignoreDecorators && this.stringify.convertPIKey && 0 === name.indexOf(this.stringify.convertPIKey) ? this.instruction(name.substr(this.stringify.convertPIKey.length), text) : this.node(name, attributes, text); if (null == lastChild) throw new Error("Could not create any elements with: " + name); return lastChild; }, XMLNode.prototype.insertBefore = function(name, attributes, text) { var child, i, removed; if (this.isRoot) throw new Error("Cannot insert elements at root level"); return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), child = this.parent.element(name, attributes, text), Array.prototype.push.apply(this.parent.children, removed), child; }, XMLNode.prototype.insertAfter = function(name, attributes, text) { var child, i, removed; if (this.isRoot) throw new Error("Cannot insert elements at root level"); return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), child = this.parent.element(name, attributes, text), Array.prototype.push.apply(this.parent.children, removed), child; }, XMLNode.prototype.remove = function() { var i; if (this.isRoot) throw new Error("Cannot remove the root element"); return i = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [ i, i - i + 1 ].concat([])), this.parent; }, XMLNode.prototype.node = function(name, attributes, text) { var child, ref1; return null != name && (name = name.valueOf()), attributes || (attributes = {}), attributes = attributes.valueOf(), isObject(attributes) || (text = (ref1 = [ attributes, text ])[0], attributes = ref1[1]), child = new XMLElement(this, name, attributes), null != text && child.text(text), this.children.push(child), child; }, XMLNode.prototype.text = function(value) { var child; return child = new XMLText(this, value), this.children.push(child), this; }, XMLNode.prototype.cdata = function(value) { var child; return child = new XMLCData(this, value), this.children.push(child), this; }, XMLNode.prototype.comment = function(value) { var child; return child = new XMLComment(this, value), this.children.push(child), this; }, XMLNode.prototype.commentBefore = function(value) { var i, removed; return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), this.parent.comment(value), Array.prototype.push.apply(this.parent.children, removed), this; }, XMLNode.prototype.commentAfter = function(value) { var i, removed; return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), this.parent.comment(value), Array.prototype.push.apply(this.parent.children, removed), this; }, XMLNode.prototype.raw = function(value) { var child; return child = new XMLRaw(this, value), this.children.push(child), this; }, XMLNode.prototype.instruction = function(target, value) { var insTarget, insValue, instruction, j, len; if (null != target && (target = target.valueOf()), null != value && (value = value.valueOf()), Array.isArray(target)) for (j = 0, len = target.length; j < len; j++) insTarget = target[j], this.instruction(insTarget); else if (isObject(target)) for (insTarget in target) hasProp.call(target, insTarget) && (insValue = target[insTarget], this.instruction(insTarget, insValue)); else isFunction(value) && (value = value.apply()), instruction = new XMLProcessingInstruction(this, target, value), this.children.push(instruction); return this; }, XMLNode.prototype.instructionBefore = function(target, value) { var i, removed; return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), this.parent.instruction(target, value), Array.prototype.push.apply(this.parent.children, removed), this; }, XMLNode.prototype.instructionAfter = function(target, value) { var i, removed; return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), this.parent.instruction(target, value), Array.prototype.push.apply(this.parent.children, removed), this; }, XMLNode.prototype.declaration = function(version, encoding, standalone) { var doc, xmldec; return doc = this.document(), xmldec = new XMLDeclaration(doc, version, encoding, standalone), doc.children[0] instanceof XMLDeclaration ? doc.children[0] = xmldec : doc.children.unshift(xmldec), doc.root() || doc; }, XMLNode.prototype.doctype = function(pubID, sysID) { var doc, doctype, i, j, k, len, len1, ref1, ref2; for (doc = this.document(), doctype = new XMLDocType(doc, pubID, sysID), i = j = 0, len = (ref1 = doc.children).length; j < len; i = ++j) if (ref1[i] instanceof XMLDocType) return doc.children[i] = doctype, doctype; for (i = k = 0, len1 = (ref2 = doc.children).length; k < len1; i = ++k) if (ref2[i].isRoot) return doc.children.splice(i, 0, doctype), doctype; return doc.children.push(doctype), doctype; }, XMLNode.prototype.up = function() { if (this.isRoot) throw new Error("The root node has no parent. Use doc() if you need to get the document object."); return this.parent; }, XMLNode.prototype.root = function() { var node; for (node = this; node; ) { if (node.isDocument) return node.rootObject; if (node.isRoot) return node; node = node.parent; } }, XMLNode.prototype.document = function() { var node; for (node = this; node; ) { if (node.isDocument) return node; node = node.parent; } }, XMLNode.prototype.end = function(options) { return this.document().end(options); }, XMLNode.prototype.prev = function() { var i; if ((i = this.parent.children.indexOf(this)) < 1) throw new Error("Already at the first node"); return this.parent.children[i - 1]; }, XMLNode.prototype.next = function() { var i; if (-1 === (i = this.parent.children.indexOf(this)) || i === this.parent.children.length - 1) throw new Error("Already at the last node"); return this.parent.children[i + 1]; }, XMLNode.prototype.importDocument = function(doc) { var clonedRoot; return (clonedRoot = doc.root().clone()).parent = this, clonedRoot.isRoot = !1, this.children.push(clonedRoot), this; }, XMLNode.prototype.ele = function(name, attributes, text) { return this.element(name, attributes, text); }, XMLNode.prototype.nod = function(name, attributes, text) { return this.node(name, attributes, text); }, XMLNode.prototype.txt = function(value) { return this.text(value); }, XMLNode.prototype.dat = function(value) { return this.cdata(value); }, XMLNode.prototype.com = function(value) { return this.comment(value); }, XMLNode.prototype.ins = function(target, value) { return this.instruction(target, value); }, XMLNode.prototype.doc = function() { return this.document(); }, XMLNode.prototype.dec = function(version, encoding, standalone) { return this.declaration(version, encoding, standalone); }, XMLNode.prototype.dtd = function(pubID, sysID) { return this.doctype(pubID, sysID); }, XMLNode.prototype.e = function(name, attributes, text) { return this.element(name, attributes, text); }, XMLNode.prototype.n = function(name, attributes, text) { return this.node(name, attributes, text); }, XMLNode.prototype.t = function(value) { return this.text(value); }, XMLNode.prototype.d = function(value) { return this.cdata(value); }, XMLNode.prototype.c = function(value) { return this.comment(value); }, XMLNode.prototype.r = function(value) { return this.raw(value); }, XMLNode.prototype.i = function(target, value) { return this.instruction(target, value); }, XMLNode.prototype.u = function() { return this.up(); }, XMLNode.prototype.importXMLBuilder = function(doc) { return this.importDocument(doc); }, XMLNode; })(); }).call(this); }, function(module, exports, __webpack_require__) { "use strict"; var Stream = function() { this.init = function() { var listeners = {}; this.on = function(type, listener) { listeners[type] || (listeners[type] = []), listeners[type] = listeners[type].concat(listener); }, this.off = function(type, listener) { var index; return !!listeners[type] && (index = listeners[type].indexOf(listener), listeners[type] = listeners[type].slice(), listeners[type].splice(index, 1), index > -1); }, this.trigger = function(type) { var callbacks, i, length, args; if (callbacks = listeners[type]) if (2 === arguments.length) for (length = callbacks.length, i = 0; i < length; ++i) callbacks[i].call(this, arguments[1]); else { for (args = [], i = arguments.length, i = 1; i < arguments.length; ++i) args.push(arguments[i]); for (length = callbacks.length, i = 0; i < length; ++i) callbacks[i].apply(this, args); } }, this.dispose = function() { listeners = {}; }; }; }; Stream.prototype.pipe = function(destination) { return this.on("data", (function(data) { destination.push(data); })), this.on("done", (function(flushSource) { destination.flush(flushSource); })), this.on("partialdone", (function(flushSource) { destination.partialFlush(flushSource); })), this.on("endedtimeline", (function(flushSource) { destination.endTimeline(flushSource); })), this.on("reset", (function(flushSource) { destination.reset(flushSource); })), destination; }, Stream.prototype.push = function(data) { this.trigger("data", data); }, Stream.prototype.flush = function(flushSource) { this.trigger("done", flushSource); }, Stream.prototype.partialFlush = function(flushSource) { this.trigger("partialdone", flushSource); }, Stream.prototype.endTimeline = function(flushSource) { this.trigger("endedtimeline", flushSource); }, Stream.prototype.reset = function(flushSource) { this.trigger("reset", flushSource); }, module.exports = Stream; }, function(module, exports) { module.exports = require("net"); }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(function() { var previous_async, async = {}; function noop() {} function identity(v) { return v; } function toBool(v) { return !!v; } function notId(v) { return !v; } var root = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || this; function only_once(fn) { return function() { if (null === fn) throw new Error("Callback was already called."); fn.apply(this, arguments), fn = null; }; } function _once(fn) { return function() { null !== fn && (fn.apply(this, arguments), fn = null); }; } null != root && (previous_async = root.async), async.noConflict = function() { return root.async = previous_async, async; }; var _toString = Object.prototype.toString, _isArray = Array.isArray || function(obj) { return "[object Array]" === _toString.call(obj); }; function _isArrayLike(arr) { return _isArray(arr) || "number" == typeof arr.length && arr.length >= 0 && arr.length % 1 == 0; } function _arrayEach(arr, iterator) { for (var index = -1, length = arr.length; ++index < length; ) iterator(arr[index], index, arr); } function _map(arr, iterator) { for (var index = -1, length = arr.length, result = Array(length); ++index < length; ) result[index] = iterator(arr[index], index, arr); return result; } function _range(count) { return _map(Array(count), (function(v, i) { return i; })); } function _reduce(arr, iterator, memo) { return _arrayEach(arr, (function(x, i, a) { memo = iterator(memo, x, i, a); })), memo; } function _forEachOf(object, iterator) { _arrayEach(_keys(object), (function(key) { iterator(object[key], key); })); } function _indexOf(arr, item) { for (var i = 0; i < arr.length; i++) if (arr[i] === item) return i; return -1; } var _keys = Object.keys || function(obj) { var keys = []; for (var k in obj) obj.hasOwnProperty(k) && keys.push(k); return keys; }; function _keyIterator(coll) { var len, keys, i = -1; return _isArrayLike(coll) ? (len = coll.length, function() { return ++i < len ? i : null; }) : (keys = _keys(coll), len = keys.length, function() { return ++i < len ? keys[i] : null; }); } function _restParam(func, startIndex) { return startIndex = null == startIndex ? func.length - 1 : +startIndex, function() { for (var length = Math.max(arguments.length - startIndex, 0), rest = Array(length), index = 0; index < length; index++) rest[index] = arguments[index + startIndex]; switch (startIndex) { case 0: return func.call(this, rest); case 1: return func.call(this, arguments[0], rest); } }; } function _withoutIndex(iterator) { return function(value, index, callback) { return iterator(value, callback); }; } var _setImmediate = "function" == typeof setImmediate && setImmediate, _delay = _setImmediate ? function(fn) { _setImmediate(fn); } : function(fn) { setTimeout(fn, 0); }; function _eachOfLimit(limit) { return function(obj, iterator, callback) { callback = _once(callback || noop); var nextKey = _keyIterator(obj = obj || []); if (limit <= 0) return callback(null); var done = !1, running = 0, errored = !1; !(function replenish() { if (done && running <= 0) return callback(null); for (;running < limit && !errored; ) { var key = nextKey(); if (null === key) return done = !0, void (running <= 0 && callback(null)); running += 1, iterator(obj[key], key, only_once((function(err) { running -= 1, err ? (callback(err), errored = !0) : replenish(); }))); } })(); }; } function doParallel(fn) { return function(obj, iterator, callback) { return fn(async.eachOf, obj, iterator, callback); }; } function doParallelLimit(fn) { return function(obj, limit, iterator, callback) { return fn(_eachOfLimit(limit), obj, iterator, callback); }; } function doSeries(fn) { return function(obj, iterator, callback) { return fn(async.eachOfSeries, obj, iterator, callback); }; } function _asyncMap(eachfn, arr, iterator, callback) { callback = _once(callback || noop); var results = _isArrayLike(arr = arr || []) ? [] : {}; eachfn(arr, (function(value, index, callback) { iterator(value, (function(err, v) { results[index] = v, callback(err); })); }), (function(err) { callback(err, results); })); } function _filter(eachfn, arr, iterator, callback) { var results = []; eachfn(arr, (function(x, index, callback) { iterator(x, (function(v) { v && results.push({ index: index, value: x }), callback(); })); }), (function() { callback(_map(results.sort((function(a, b) { return a.index - b.index; })), (function(x) { return x.value; }))); })); } function _reject(eachfn, arr, iterator, callback) { _filter(eachfn, arr, (function(value, cb) { iterator(value, (function(v) { cb(!v); })); }), callback); } function _createTester(eachfn, check, getResult) { return function(arr, limit, iterator, cb) { function done() { cb && cb(getResult(!1, void 0)); } function iteratee(x, _, callback) { if (!cb) return callback(); iterator(x, (function(v) { cb && check(v) && (cb(getResult(!0, x)), cb = iterator = !1), callback(); })); } arguments.length > 3 ? eachfn(arr, limit, iteratee, done) : (cb = iterator, iterator = limit, eachfn(arr, iteratee, done)); }; } function _findGetResult(v, x) { return x; } function _parallel(eachfn, tasks, callback) { callback = callback || noop; var results = _isArrayLike(tasks) ? [] : {}; eachfn(tasks, (function(task, key, callback) { task(_restParam((function(err, args) { args.length <= 1 && (args = args[0]), results[key] = args, callback(err); }))); }), (function(err) { callback(err, results); })); } function _concat(eachfn, arr, fn, callback) { var result = []; eachfn(arr, (function(x, index, cb) { fn(x, (function(err, y) { result = result.concat(y || []), cb(err); })); }), (function(err) { callback(err, result); })); } function _queue(worker, concurrency, payload) { if (null == concurrency) concurrency = 1; else if (0 === concurrency) throw new Error("Concurrency must not be zero"); function _insert(q, data, pos, callback) { if (null != callback && "function" != typeof callback) throw new Error("task callback must be a function"); if (q.started = !0, _isArray(data) || (data = [ data ]), 0 === data.length && q.idle()) return async.setImmediate((function() { q.drain(); })); _arrayEach(data, (function(task) { var item = { data: task, callback: callback || noop }; pos ? q.tasks.unshift(item) : q.tasks.push(item), q.tasks.length === q.concurrency && q.saturated(); })), async.setImmediate(q.process); } function _next(q, tasks) { return function() { workers -= 1; var removed = !1, args = arguments; _arrayEach(tasks, (function(task) { _arrayEach(workersList, (function(worker, index) { worker !== task || removed || (workersList.splice(index, 1), removed = !0); })), task.callback.apply(task, args); })), q.tasks.length + workers === 0 && q.drain(), q.process(); }; } var workers = 0, workersList = [], q = { tasks: [], concurrency: concurrency, payload: payload, saturated: noop, empty: noop, drain: noop, started: !1, paused: !1, push: function(data, callback) { _insert(q, data, !1, callback); }, kill: function() { q.drain = noop, q.tasks = []; }, unshift: function(data, callback) { _insert(q, data, !0, callback); }, process: function() { for (;!q.paused && workers < q.concurrency && q.tasks.length; ) { var tasks = q.payload ? q.tasks.splice(0, q.payload) : q.tasks.splice(0, q.tasks.length), data = _map(tasks, (function(task) { return task.data; })); 0 === q.tasks.length && q.empty(), workers += 1, workersList.push(tasks[0]); var cb = only_once(_next(q, tasks)); worker(data, cb); } }, length: function() { return q.tasks.length; }, running: function() { return workers; }, workersList: function() { return workersList; }, idle: function() { return q.tasks.length + workers === 0; }, pause: function() { q.paused = !0; }, resume: function() { if (!1 !== q.paused) { q.paused = !1; for (var resumeCount = Math.min(q.concurrency, q.tasks.length), w = 1; w <= resumeCount; w++) async.setImmediate(q.process); } } }; return q; } function _console_fn(name) { return _restParam((function(fn, args) { fn.apply(null, args.concat([ _restParam((function(err, args) { "object" == typeof console && (err ? console.error && console.error(err) : console[name] && _arrayEach(args, (function(x) { console[name](x); }))); })) ])); })); } function _times(mapper) { return function(count, iterator, callback) { mapper(_range(count), iterator, callback); }; } function _applyEach(eachfn) { return _restParam((function(fns, args) { var go = _restParam((function(args) { var that = this, callback = args.pop(); return eachfn(fns, (function(fn, _, cb) { fn.apply(that, args.concat([ cb ])); }), callback); })); return args.length ? go.apply(this, args) : go; })); } function ensureAsync(fn) { return _restParam((function(args) { var callback = args.pop(); args.push((function() { var innerArgs = arguments; sync ? async.setImmediate((function() { callback.apply(null, innerArgs); })) : callback.apply(null, innerArgs); })); var sync = !0; fn.apply(this, args), sync = !1; })); } "object" == typeof process && "function" == typeof process.nextTick ? async.nextTick = process.nextTick : async.nextTick = _delay, async.setImmediate = _setImmediate ? _delay : async.nextTick, async.forEach = async.each = function(arr, iterator, callback) { return async.eachOf(arr, _withoutIndex(iterator), callback); }, async.forEachSeries = async.eachSeries = function(arr, iterator, callback) { return async.eachOfSeries(arr, _withoutIndex(iterator), callback); }, async.forEachLimit = async.eachLimit = function(arr, limit, iterator, callback) { return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback); }, async.forEachOf = async.eachOf = function(object, iterator, callback) { callback = _once(callback || noop); for (var key, iter = _keyIterator(object = object || []), completed = 0; null != (key = iter()); ) completed += 1, iterator(object[key], key, only_once(done)); function done(err) { completed--, err ? callback(err) : null === key && completed <= 0 && callback(null); } 0 === completed && callback(null); }, async.forEachOfSeries = async.eachOfSeries = function(obj, iterator, callback) { callback = _once(callback || noop); var nextKey = _keyIterator(obj = obj || []), key = nextKey(); !(function iterate() { var sync = !0; if (null === key) return callback(null); iterator(obj[key], key, only_once((function(err) { if (err) callback(err); else { if (null === (key = nextKey())) return callback(null); sync ? async.setImmediate(iterate) : iterate(); } }))), sync = !1; })(); }, async.forEachOfLimit = async.eachOfLimit = function(obj, limit, iterator, callback) { _eachOfLimit(limit)(obj, iterator, callback); }, async.map = doParallel(_asyncMap), async.mapSeries = doSeries(_asyncMap), async.mapLimit = doParallelLimit(_asyncMap), async.inject = async.foldl = async.reduce = function(arr, memo, iterator, callback) { async.eachOfSeries(arr, (function(x, i, callback) { iterator(memo, x, (function(err, v) { memo = v, callback(err); })); }), (function(err) { callback(err, memo); })); }, async.foldr = async.reduceRight = function(arr, memo, iterator, callback) { var reversed = _map(arr, identity).reverse(); async.reduce(reversed, memo, iterator, callback); }, async.transform = function(arr, memo, iterator, callback) { 3 === arguments.length && (callback = iterator, iterator = memo, memo = _isArray(arr) ? [] : {}), async.eachOf(arr, (function(v, k, cb) { iterator(memo, v, k, cb); }), (function(err) { callback(err, memo); })); }, async.select = async.filter = doParallel(_filter), async.selectLimit = async.filterLimit = doParallelLimit(_filter), async.selectSeries = async.filterSeries = doSeries(_filter), async.reject = doParallel(_reject), async.rejectLimit = doParallelLimit(_reject), async.rejectSeries = doSeries(_reject), async.any = async.some = _createTester(async.eachOf, toBool, identity), async.someLimit = _createTester(async.eachOfLimit, toBool, identity), async.all = async.every = _createTester(async.eachOf, notId, notId), async.everyLimit = _createTester(async.eachOfLimit, notId, notId), async.detect = _createTester(async.eachOf, identity, _findGetResult), async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult), async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult), async.sortBy = function(arr, iterator, callback) { function comparator(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; } async.map(arr, (function(x, callback) { iterator(x, (function(err, criteria) { err ? callback(err) : callback(null, { value: x, criteria: criteria }); })); }), (function(err, results) { if (err) return callback(err); callback(null, _map(results.sort(comparator), (function(x) { return x.value; }))); })); }, async.auto = function(tasks, concurrency, callback) { "function" == typeof arguments[1] && (callback = concurrency, concurrency = null), callback = _once(callback || noop); var keys = _keys(tasks), remainingTasks = keys.length; if (!remainingTasks) return callback(null); concurrency || (concurrency = remainingTasks); var results = {}, runningTasks = 0, hasError = !1, listeners = []; function addListener(fn) { listeners.unshift(fn); } function removeListener(fn) { var idx = _indexOf(listeners, fn); idx >= 0 && listeners.splice(idx, 1); } function taskComplete() { remainingTasks--, _arrayEach(listeners.slice(0), (function(fn) { fn(); })); } addListener((function() { remainingTasks || callback(null, results); })), _arrayEach(keys, (function(k) { if (!hasError) { for (var dep, task = _isArray(tasks[k]) ? tasks[k] : [ tasks[k] ], taskCallback = _restParam((function(err, args) { if (runningTasks--, args.length <= 1 && (args = args[0]), err) { var safeResults = {}; _forEachOf(results, (function(val, rkey) { safeResults[rkey] = val; })), safeResults[k] = args, hasError = !0, callback(err, safeResults); } else results[k] = args, async.setImmediate(taskComplete); })), requires = task.slice(0, task.length - 1), len = requires.length; len--; ) { if (!(dep = tasks[requires[len]])) throw new Error("Has nonexistent dependency in " + requires.join(", ")); if (_isArray(dep) && _indexOf(dep, k) >= 0) throw new Error("Has cyclic dependencies"); } ready() ? (runningTasks++, task[task.length - 1](taskCallback, results)) : addListener((function listener() { ready() && (runningTasks++, removeListener(listener), task[task.length - 1](taskCallback, results)); })); } function ready() { return runningTasks < concurrency && _reduce(requires, (function(a, x) { return a && results.hasOwnProperty(x); }), !0) && !results.hasOwnProperty(k); } })); }, async.retry = function(times, task, callback) { var DEFAULT_TIMES = 5, DEFAULT_INTERVAL = 0, attempts = [], opts = { times: DEFAULT_TIMES, interval: DEFAULT_INTERVAL }; function parseTimes(acc, t) { if ("number" == typeof t) acc.times = parseInt(t, 10) || DEFAULT_TIMES; else { if ("object" != typeof t) throw new Error("Unsupported argument type for 'times': " + typeof t); acc.times = parseInt(t.times, 10) || DEFAULT_TIMES, acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL; } } var length = arguments.length; if (length < 1 || length > 3) throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)"); function wrappedTask(wrappedCallback, wrappedResults) { function retryAttempt(task, finalAttempt) { return function(seriesCallback) { task((function(err, result) { seriesCallback(!err || finalAttempt, { err: err, result: result }); }), wrappedResults); }; } function retryInterval(interval) { return function(seriesCallback) { setTimeout((function() { seriesCallback(null); }), interval); }; } for (;opts.times; ) { var finalAttempt = !(opts.times -= 1); attempts.push(retryAttempt(opts.task, finalAttempt)), !finalAttempt && opts.interval > 0 && attempts.push(retryInterval(opts.interval)); } async.series(attempts, (function(done, data) { data = data[data.length - 1], (wrappedCallback || opts.callback)(data.err, data.result); })); } return length <= 2 && "function" == typeof times && (callback = task, task = times), "function" != typeof times && parseTimes(opts, times), opts.callback = callback, opts.task = task, opts.callback ? wrappedTask() : wrappedTask; }, async.waterfall = function(tasks, callback) { if (callback = _once(callback || noop), !_isArray(tasks)) { var err = new Error("First argument to waterfall must be an array of functions"); return callback(err); } if (!tasks.length) return callback(); !(function wrapIterator(iterator) { return _restParam((function(err, args) { if (err) callback.apply(null, [ err ].concat(args)); else { var next = iterator.next(); next ? args.push(wrapIterator(next)) : args.push(callback), ensureAsync(iterator).apply(null, args); } })); })(async.iterator(tasks))(); }, async.parallel = function(tasks, callback) { _parallel(async.eachOf, tasks, callback); }, async.parallelLimit = function(tasks, limit, callback) { _parallel(_eachOfLimit(limit), tasks, callback); }, async.series = function(tasks, callback) { _parallel(async.eachOfSeries, tasks, callback); }, async.iterator = function(tasks) { return (function makeCallback(index) { function fn() { return tasks.length && tasks[index].apply(null, arguments), fn.next(); } return fn.next = function() { return index < tasks.length - 1 ? makeCallback(index + 1) : null; }, fn; })(0); }, async.apply = _restParam((function(fn, args) { return _restParam((function(callArgs) { return fn.apply(null, args.concat(callArgs)); })); })), async.concat = doParallel(_concat), async.concatSeries = doSeries(_concat), async.whilst = function(test, iterator, callback) { if (callback = callback || noop, test()) { var next = _restParam((function(err, args) { err ? callback(err) : test.apply(this, args) ? iterator(next) : callback.apply(null, [ null ].concat(args)); })); iterator(next); } else callback(null); }, async.doWhilst = function(iterator, test, callback) { var calls = 0; return async.whilst((function() { return ++calls <= 1 || test.apply(this, arguments); }), iterator, callback); }, async.until = function(test, iterator, callback) { return async.whilst((function() { return !test.apply(this, arguments); }), iterator, callback); }, async.doUntil = function(iterator, test, callback) { return async.doWhilst(iterator, (function() { return !test.apply(this, arguments); }), callback); }, async.during = function(test, iterator, callback) { callback = callback || noop; var next = _restParam((function(err, args) { err ? callback(err) : (args.push(check), test.apply(this, args)); })), check = function(err, truth) { err ? callback(err) : truth ? iterator(next) : callback(null); }; test(check); }, async.doDuring = function(iterator, test, callback) { var calls = 0; async.during((function(next) { calls++ < 1 ? next(null, !0) : test.apply(this, arguments); }), iterator, callback); }, async.queue = function(worker, concurrency) { return _queue((function(items, cb) { worker(items[0], cb); }), concurrency, 1); }, async.priorityQueue = function(worker, concurrency) { function _compareTasks(a, b) { return a.priority - b.priority; } var q = async.queue(worker, concurrency); return q.push = function(data, priority, callback) { !(function(q, data, priority, callback) { if (null != callback && "function" != typeof callback) throw new Error("task callback must be a function"); if (q.started = !0, _isArray(data) || (data = [ data ]), 0 === data.length) return async.setImmediate((function() { q.drain(); })); _arrayEach(data, (function(task) { var item = { data: task, priority: priority, callback: "function" == typeof callback ? callback : noop }; q.tasks.splice((function(sequence, item, compare) { for (var beg = -1, end = sequence.length - 1; beg < end; ) { var mid = beg + (end - beg + 1 >>> 1); compare(item, sequence[mid]) >= 0 ? beg = mid : end = mid - 1; } return beg; })(q.tasks, item, _compareTasks) + 1, 0, item), q.tasks.length === q.concurrency && q.saturated(), async.setImmediate(q.process); })); })(q, data, priority, callback); }, delete q.unshift, q; }, async.cargo = function(worker, payload) { return _queue(worker, 1, payload); }, async.log = _console_fn("log"), async.dir = _console_fn("dir"), async.memoize = function(fn, hasher) { var memo = {}, queues = {}, has = Object.prototype.hasOwnProperty; hasher = hasher || identity; var memoized = _restParam((function(args) { var callback = args.pop(), key = hasher.apply(null, args); has.call(memo, key) ? async.setImmediate((function() { callback.apply(null, memo[key]); })) : has.call(queues, key) ? queues[key].push(callback) : (queues[key] = [ callback ], fn.apply(null, args.concat([ _restParam((function(args) { memo[key] = args; var q = queues[key]; delete queues[key]; for (var i = 0, l = q.length; i < l; i++) q[i].apply(null, args); })) ]))); })); return memoized.memo = memo, memoized.unmemoized = fn, memoized; }, async.unmemoize = function(fn) { return function() { return (fn.unmemoized || fn).apply(null, arguments); }; }, async.times = _times(async.map), async.timesSeries = _times(async.mapSeries), async.timesLimit = function(count, limit, iterator, callback) { return async.mapLimit(_range(count), limit, iterator, callback); }, async.seq = function() { var fns = arguments; return _restParam((function(args) { var that = this, callback = args[args.length - 1]; "function" == typeof callback ? args.pop() : callback = noop, async.reduce(fns, args, (function(newargs, fn, cb) { fn.apply(that, newargs.concat([ _restParam((function(err, nextargs) { cb(err, nextargs); })) ])); }), (function(err, results) { callback.apply(that, [ err ].concat(results)); })); })); }, async.compose = function() { return async.seq.apply(null, Array.prototype.reverse.call(arguments)); }, async.applyEach = _applyEach(async.eachOf), async.applyEachSeries = _applyEach(async.eachOfSeries), async.forever = function(fn, callback) { var done = only_once(callback || noop), task = ensureAsync(fn); !(function next(err) { if (err) return done(err); task(next); })(); }, async.ensureAsync = ensureAsync, async.constant = _restParam((function(values) { var args = [ null ].concat(values); return function(callback) { return callback.apply(this, args); }; })), async.wrapSync = async.asyncify = function(func) { return _restParam((function(args) { var result, obj, type, callback = args.pop(); try { result = func.apply(this, args); } catch (e) { return callback(e); } ("function" == (type = typeof (obj = result)) || "object" === type && obj) && "function" == typeof result.then ? result.then((function(value) { callback(null, value); })).catch((function(err) { callback(err.message ? err : new Error(err)); })) : callback(null, result); })); }, module.exports ? module.exports = async : void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return async; }.apply(exports, [])) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); })(); }, function(module, exports, __webpack_require__) { var NGramParser = __webpack_require__(406), NGramParser_IBM420 = __webpack_require__(768); module.exports.match = function(input, ngrams, byteMap, spaceChar) { return spaceChar = spaceChar || 32, new NGramParser(ngrams, byteMap).parse(input, spaceChar); }, module.exports.matchIBM420 = function(input, ngrams, byteMap, spaceChar) { return spaceChar = spaceChar || 32, new NGramParser_IBM420(ngrams, byteMap).parse(input, spaceChar); }, module.exports.NGramsPlusLang = function(la, ng) { this.lang = la, this.ngrams = ng; }; }, function(module, exports, __webpack_require__) { (function() { var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1, hasProp = {}.hasOwnProperty; ref1 = __webpack_require__(52), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue, XMLElement = null, XMLCData = null, XMLComment = null, XMLDeclaration = null, XMLDocType = null, XMLRaw = null, XMLText = null, XMLProcessingInstruction = null, XMLDummy = null, NodeType = null, XMLNodeList = null, DocumentPosition = null, module.exports = (function() { function XMLNode(parent1) { this.parent = parent1, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), this.value = null, this.children = [], this.baseURI = null, XMLElement || (XMLElement = __webpack_require__(246), XMLCData = __webpack_require__(248), XMLComment = __webpack_require__(249), XMLDeclaration = __webpack_require__(250), XMLDocType = __webpack_require__(251), XMLRaw = __webpack_require__(256), XMLText = __webpack_require__(257), XMLProcessingInstruction = __webpack_require__(258), XMLDummy = __webpack_require__(508), NodeType = __webpack_require__(22), XMLNodeList = __webpack_require__(1109), __webpack_require__(247), DocumentPosition = __webpack_require__(1110)); } return Object.defineProperty(XMLNode.prototype, "nodeName", { get: function() { return this.name; } }), Object.defineProperty(XMLNode.prototype, "nodeType", { get: function() { return this.type; } }), Object.defineProperty(XMLNode.prototype, "nodeValue", { get: function() { return this.value; } }), Object.defineProperty(XMLNode.prototype, "parentNode", { get: function() { return this.parent; } }), Object.defineProperty(XMLNode.prototype, "childNodes", { get: function() { return this.childNodeList && this.childNodeList.nodes || (this.childNodeList = new XMLNodeList(this.children)), this.childNodeList; } }), Object.defineProperty(XMLNode.prototype, "firstChild", { get: function() { return this.children[0] || null; } }), Object.defineProperty(XMLNode.prototype, "lastChild", { get: function() { return this.children[this.children.length - 1] || null; } }), Object.defineProperty(XMLNode.prototype, "previousSibling", { get: function() { var i; return i = this.parent.children.indexOf(this), this.parent.children[i - 1] || null; } }), Object.defineProperty(XMLNode.prototype, "nextSibling", { get: function() { var i; return i = this.parent.children.indexOf(this), this.parent.children[i + 1] || null; } }), Object.defineProperty(XMLNode.prototype, "ownerDocument", { get: function() { return this.document() || null; } }), Object.defineProperty(XMLNode.prototype, "textContent", { get: function() { var child, j, len, ref2, str; if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) { for (str = "", j = 0, len = (ref2 = this.children).length; j < len; j++) (child = ref2[j]).textContent && (str += child.textContent); return str; } return null; }, set: function(value) { throw new Error("This DOM method is not implemented." + this.debugInfo()); } }), XMLNode.prototype.setParent = function(parent) { var child, j, len, ref2, results; for (this.parent = parent, parent && (this.options = parent.options, this.stringify = parent.stringify), results = [], j = 0, len = (ref2 = this.children).length; j < len; j++) child = ref2[j], results.push(child.setParent(this)); return results; }, XMLNode.prototype.element = function(name, attributes, text) { var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val; if (lastChild = null, null === attributes && null == text && (attributes = (ref2 = [ {}, null ])[0], text = ref2[1]), null == attributes && (attributes = {}), attributes = getValue(attributes), isObject(attributes) || (text = (ref3 = [ attributes, text ])[0], attributes = ref3[1]), null != name && (name = getValue(name)), Array.isArray(name)) for (j = 0, len = name.length; j < len; j++) item = name[j], lastChild = this.element(item); else if (isFunction(name)) lastChild = this.element(name.apply()); else if (isObject(name)) { for (key in name) if (hasProp.call(name, key)) if (val = name[key], isFunction(val) && (val = val.apply()), !this.options.ignoreDecorators && this.stringify.convertAttKey && 0 === key.indexOf(this.stringify.convertAttKey)) lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) lastChild = this.dummy(); else if (isObject(val) && isEmpty(val)) lastChild = this.element(key); else if (this.options.keepNullNodes || null != val) if (!this.options.separateArrayItems && Array.isArray(val)) for (k = 0, len1 = val.length; k < len1; k++) item = val[k], (childNode = {})[key] = item, lastChild = this.element(childNode); else isObject(val) ? !this.options.ignoreDecorators && this.stringify.convertTextKey && 0 === key.indexOf(this.stringify.convertTextKey) ? lastChild = this.element(val) : (lastChild = this.element(key)).element(val) : lastChild = this.element(key, val); else lastChild = this.dummy(); } else lastChild = this.options.keepNullNodes || null !== text ? !this.options.ignoreDecorators && this.stringify.convertTextKey && 0 === name.indexOf(this.stringify.convertTextKey) ? this.text(text) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && 0 === name.indexOf(this.stringify.convertCDataKey) ? this.cdata(text) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && 0 === name.indexOf(this.stringify.convertCommentKey) ? this.comment(text) : !this.options.ignoreDecorators && this.stringify.convertRawKey && 0 === name.indexOf(this.stringify.convertRawKey) ? this.raw(text) : !this.options.ignoreDecorators && this.stringify.convertPIKey && 0 === name.indexOf(this.stringify.convertPIKey) ? this.instruction(name.substr(this.stringify.convertPIKey.length), text) : this.node(name, attributes, text) : this.dummy(); if (null == lastChild) throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo()); return lastChild; }, XMLNode.prototype.insertBefore = function(name, attributes, text) { var child, i, newChild, refChild, removed; if (null != name ? name.type : void 0) return refChild = attributes, (newChild = name).setParent(this), refChild ? (i = children.indexOf(refChild), removed = children.splice(i), children.push(newChild), Array.prototype.push.apply(children, removed)) : children.push(newChild), newChild; if (this.isRoot) throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), child = this.parent.element(name, attributes, text), Array.prototype.push.apply(this.parent.children, removed), child; }, XMLNode.prototype.insertAfter = function(name, attributes, text) { var child, i, removed; if (this.isRoot) throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), child = this.parent.element(name, attributes, text), Array.prototype.push.apply(this.parent.children, removed), child; }, XMLNode.prototype.remove = function() { var i; if (this.isRoot) throw new Error("Cannot remove the root element. " + this.debugInfo()); return i = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [ i, i - i + 1 ].concat([])), this.parent; }, XMLNode.prototype.node = function(name, attributes, text) { var child, ref2; return null != name && (name = getValue(name)), attributes || (attributes = {}), attributes = getValue(attributes), isObject(attributes) || (text = (ref2 = [ attributes, text ])[0], attributes = ref2[1]), child = new XMLElement(this, name, attributes), null != text && child.text(text), this.children.push(child), child; }, XMLNode.prototype.text = function(value) { var child; return isObject(value) && this.element(value), child = new XMLText(this, value), this.children.push(child), this; }, XMLNode.prototype.cdata = function(value) { var child; return child = new XMLCData(this, value), this.children.push(child), this; }, XMLNode.prototype.comment = function(value) { var child; return child = new XMLComment(this, value), this.children.push(child), this; }, XMLNode.prototype.commentBefore = function(value) { var i, removed; return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), this.parent.comment(value), Array.prototype.push.apply(this.parent.children, removed), this; }, XMLNode.prototype.commentAfter = function(value) { var i, removed; return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), this.parent.comment(value), Array.prototype.push.apply(this.parent.children, removed), this; }, XMLNode.prototype.raw = function(value) { var child; return child = new XMLRaw(this, value), this.children.push(child), this; }, XMLNode.prototype.dummy = function() { return new XMLDummy(this); }, XMLNode.prototype.instruction = function(target, value) { var insTarget, insValue, instruction, j, len; if (null != target && (target = getValue(target)), null != value && (value = getValue(value)), Array.isArray(target)) for (j = 0, len = target.length; j < len; j++) insTarget = target[j], this.instruction(insTarget); else if (isObject(target)) for (insTarget in target) hasProp.call(target, insTarget) && (insValue = target[insTarget], this.instruction(insTarget, insValue)); else isFunction(value) && (value = value.apply()), instruction = new XMLProcessingInstruction(this, target, value), this.children.push(instruction); return this; }, XMLNode.prototype.instructionBefore = function(target, value) { var i, removed; return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), this.parent.instruction(target, value), Array.prototype.push.apply(this.parent.children, removed), this; }, XMLNode.prototype.instructionAfter = function(target, value) { var i, removed; return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), this.parent.instruction(target, value), Array.prototype.push.apply(this.parent.children, removed), this; }, XMLNode.prototype.declaration = function(version, encoding, standalone) { var doc, xmldec; return doc = this.document(), xmldec = new XMLDeclaration(doc, version, encoding, standalone), 0 === doc.children.length ? doc.children.unshift(xmldec) : doc.children[0].type === NodeType.Declaration ? doc.children[0] = xmldec : doc.children.unshift(xmldec), doc.root() || doc; }, XMLNode.prototype.dtd = function(pubID, sysID) { var doc, doctype, i, j, k, len, len1, ref2, ref3; for (doc = this.document(), doctype = new XMLDocType(doc, pubID, sysID), i = j = 0, len = (ref2 = doc.children).length; j < len; i = ++j) if (ref2[i].type === NodeType.DocType) return doc.children[i] = doctype, doctype; for (i = k = 0, len1 = (ref3 = doc.children).length; k < len1; i = ++k) if (ref3[i].isRoot) return doc.children.splice(i, 0, doctype), doctype; return doc.children.push(doctype), doctype; }, XMLNode.prototype.up = function() { if (this.isRoot) throw new Error("The root node has no parent. Use doc() if you need to get the document object."); return this.parent; }, XMLNode.prototype.root = function() { var node; for (node = this; node; ) { if (node.type === NodeType.Document) return node.rootObject; if (node.isRoot) return node; node = node.parent; } }, XMLNode.prototype.document = function() { var node; for (node = this; node; ) { if (node.type === NodeType.Document) return node; node = node.parent; } }, XMLNode.prototype.end = function(options) { return this.document().end(options); }, XMLNode.prototype.prev = function() { var i; if ((i = this.parent.children.indexOf(this)) < 1) throw new Error("Already at the first node. " + this.debugInfo()); return this.parent.children[i - 1]; }, XMLNode.prototype.next = function() { var i; if (-1 === (i = this.parent.children.indexOf(this)) || i === this.parent.children.length - 1) throw new Error("Already at the last node. " + this.debugInfo()); return this.parent.children[i + 1]; }, XMLNode.prototype.importDocument = function(doc) { var clonedRoot; return (clonedRoot = doc.root().clone()).parent = this, clonedRoot.isRoot = !1, this.children.push(clonedRoot), this; }, XMLNode.prototype.debugInfo = function(name) { var ref2, ref3; return null != (name = name || this.name) || (null != (ref2 = this.parent) ? ref2.name : void 0) ? null == name ? "parent: <" + this.parent.name + ">" : (null != (ref3 = this.parent) ? ref3.name : void 0) ? "node: <" + name + ">, parent: <" + this.parent.name + ">" : "node: <" + name + ">" : ""; }, XMLNode.prototype.ele = function(name, attributes, text) { return this.element(name, attributes, text); }, XMLNode.prototype.nod = function(name, attributes, text) { return this.node(name, attributes, text); }, XMLNode.prototype.txt = function(value) { return this.text(value); }, XMLNode.prototype.dat = function(value) { return this.cdata(value); }, XMLNode.prototype.com = function(value) { return this.comment(value); }, XMLNode.prototype.ins = function(target, value) { return this.instruction(target, value); }, XMLNode.prototype.doc = function() { return this.document(); }, XMLNode.prototype.dec = function(version, encoding, standalone) { return this.declaration(version, encoding, standalone); }, XMLNode.prototype.e = function(name, attributes, text) { return this.element(name, attributes, text); }, XMLNode.prototype.n = function(name, attributes, text) { return this.node(name, attributes, text); }, XMLNode.prototype.t = function(value) { return this.text(value); }, XMLNode.prototype.d = function(value) { return this.cdata(value); }, XMLNode.prototype.c = function(value) { return this.comment(value); }, XMLNode.prototype.r = function(value) { return this.raw(value); }, XMLNode.prototype.i = function(target, value) { return this.instruction(target, value); }, XMLNode.prototype.u = function() { return this.up(); }, XMLNode.prototype.importXMLBuilder = function(doc) { return this.importDocument(doc); }, XMLNode.prototype.replaceChild = function(newChild, oldChild) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.removeChild = function(oldChild) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.appendChild = function(newChild) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.hasChildNodes = function() { return 0 !== this.children.length; }, XMLNode.prototype.cloneNode = function(deep) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.normalize = function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.isSupported = function(feature, version) { return !0; }, XMLNode.prototype.hasAttributes = function() { return 0 !== this.attribs.length; }, XMLNode.prototype.compareDocumentPosition = function(other) { var res; return this === other ? 0 : this.document() !== other.document() ? (res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific, Math.random() < .5 ? res |= DocumentPosition.Preceding : res |= DocumentPosition.Following, res) : this.isAncestor(other) ? DocumentPosition.Contains | DocumentPosition.Preceding : this.isDescendant(other) ? DocumentPosition.Contains | DocumentPosition.Following : this.isPreceding(other) ? DocumentPosition.Preceding : DocumentPosition.Following; }, XMLNode.prototype.isSameNode = function(other) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.lookupPrefix = function(namespaceURI) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.isDefaultNamespace = function(namespaceURI) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.lookupNamespaceURI = function(prefix) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.isEqualNode = function(node) { var i, j, ref2; if (node.nodeType !== this.nodeType) return !1; if (node.children.length !== this.children.length) return !1; for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) if (!this.children[i].isEqualNode(node.children[i])) return !1; return !0; }, XMLNode.prototype.getFeature = function(feature, version) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.setUserData = function(key, data, handler) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.getUserData = function(key) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLNode.prototype.contains = function(other) { return !!other && (other === this || this.isDescendant(other)); }, XMLNode.prototype.isDescendant = function(node) { var child, j, len, ref2; for (j = 0, len = (ref2 = this.children).length; j < len; j++) { if (node === (child = ref2[j])) return !0; if (child.isDescendant(node)) return !0; } return !1; }, XMLNode.prototype.isAncestor = function(node) { return node.isDescendant(this); }, XMLNode.prototype.isPreceding = function(node) { var nodePos, thisPos; return nodePos = this.treePosition(node), thisPos = this.treePosition(this), -1 !== nodePos && -1 !== thisPos && nodePos < thisPos; }, XMLNode.prototype.isFollowing = function(node) { var nodePos, thisPos; return nodePos = this.treePosition(node), thisPos = this.treePosition(this), -1 !== nodePos && -1 !== thisPos && nodePos > thisPos; }, XMLNode.prototype.treePosition = function(node) { var found, pos; return pos = 0, found = !1, this.foreachTreeNode(this.document(), (function(childNode) { if (pos++, !found && childNode === node) return found = !0; })), found ? pos : -1; }, XMLNode.prototype.foreachTreeNode = function(node, func) { var child, j, len, ref2, res; for (node || (node = this.document()), j = 0, len = (ref2 = node.children).length; j < len; j++) { if (res = func(child = ref2[j])) return res; if (res = this.foreachTreeNode(child, func)) return res; } }, XMLNode; })(); }).call(this); }, function(module, exports) { module.exports = require("zlib"); }, function(module, exports, __webpack_require__) { var tty = __webpack_require__(117); module.exports = function(name) { function disabled() {} disabled.enabled = !1; var match = skips.some((function(re) { return re.test(name); })); if (match) return disabled; if (!(match = names.some((function(re) { return re.test(name); })))) return disabled; var c = colors[prevColor++ % colors.length]; function colored(fmt) { fmt = coerce(fmt); var curr = new Date, ms = curr - (prev[name] || curr); prev[name] = curr, fmt = " [9" + c + "m" + name + " [3" + c + "m" + fmt + "[3" + c + "m +" + humanize(ms) + "", console.error.apply(this, arguments); } function plain(fmt) { fmt = coerce(fmt), fmt = (new Date).toUTCString() + " " + name + " " + fmt, console.error.apply(this, arguments); } return colored.enabled = plain.enabled = !0, isatty || process.env.DEBUG_COLORS ? colored : plain; }; var names = [], skips = []; (process.env.DEBUG || "").split(/[\s,]+/).forEach((function(name) { "-" === (name = name.replace("*", ".*?"))[0] ? skips.push(new RegExp("^" + name.substr(1) + "$")) : names.push(new RegExp("^" + name + "$")); })); var colors = [ 6, 2, 3, 4, 5, 1 ], prev = {}, prevColor = 0, isatty = tty.isatty(2); function humanize(ms) { return ms >= 36e5 ? (ms / 36e5).toFixed(1) + "h" : ms >= 6e4 ? (ms / 6e4).toFixed(1) + "m" : ms >= 1e3 ? (ms / 1e3 | 0) + "s" : ms + "ms"; } function coerce(val) { return val instanceof Error ? val.stack || val.message : val; } }, function(module, exports, __webpack_require__) { __webpack_require__(5); var fs = __webpack_require__(2); function Mime() { this.types = Object.create(null), this.extensions = Object.create(null); } Mime.prototype.define = function(map) { for (var type in map) { for (var exts = map[type], i = 0; i < exts.length; i++) process.env.DEBUG_MIME && this.types[exts[i]] && console.warn((this._loading || "define()").replace(/.*\//, ""), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + " to " + type), this.types[exts[i]] = type; this.extensions[type] || (this.extensions[type] = exts[0]); } }, Mime.prototype.load = function(file) { this._loading = file; var map = {}; fs.readFileSync(file, "ascii").split(/[\r\n]+/).forEach((function(line) { var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/); map[fields.shift()] = fields; })), this.define(map), this._loading = null; }, Mime.prototype.lookup = function(path, fallback) { var ext = path.replace(/.*[\.\/\\]/, "").toLowerCase(); return this.types[ext] || fallback || this.default_type; }, Mime.prototype.extension = function(mimeType) { var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); return this.extensions[type]; }; var mime = new Mime; mime.define(__webpack_require__(693)), mime.default_type = mime.lookup("bin"), mime.Mime = Mime, mime.charsets = { lookup: function(mimeType, fallback) { return /^text\/|^application\/(javascript|json)/.test(mimeType) ? "UTF-8" : fallback; } }, module.exports = mime; }, function(module, exports, __webpack_require__) { "undefined" == typeof window ? module.exports = __webpack_require__(44) : module.exports = __webpack_require__(873); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element = __webpack_require__(442); function Element1(doc, tagId, ebmlId, start, length) { Element.call(this, doc, tagId, ebmlId, start, length); } __webpack_require__(13), __webpack_require__(19), util.inherits(Element1, Element), module.exports = Element1; }, function(module, exports, __webpack_require__) { __webpack_require__(15); var util = __webpack_require__(0); function FingerprintFormatError(fp, format) { Error.captureStackTrace && Error.captureStackTrace(this, FingerprintFormatError), this.name = "FingerprintFormatError", this.fingerprint = fp, this.format = format, this.message = "Fingerprint format is not supported, or is invalid: ", void 0 !== fp && (this.message += " fingerprint = " + fp), void 0 !== format && (this.message += " format = " + format); } function InvalidAlgorithmError(alg) { Error.captureStackTrace && Error.captureStackTrace(this, InvalidAlgorithmError), this.name = "InvalidAlgorithmError", this.algorithm = alg, this.message = 'Algorithm "' + alg + '" is not supported'; } function KeyParseError(name, format, innerErr) { Error.captureStackTrace && Error.captureStackTrace(this, KeyParseError), this.name = "KeyParseError", this.format = format, this.keyName = name, this.innerErr = innerErr, this.message = "Failed to parse " + name + " as a valid " + format + " format key: " + innerErr.message; } function SignatureParseError(type, format, innerErr) { Error.captureStackTrace && Error.captureStackTrace(this, SignatureParseError), this.name = "SignatureParseError", this.type = type, this.format = format, this.innerErr = innerErr, this.message = "Failed to parse the given data as a " + type + " signature in " + format + " format: " + innerErr.message; } function CertificateParseError(name, format, innerErr) { Error.captureStackTrace && Error.captureStackTrace(this, CertificateParseError), this.name = "CertificateParseError", this.format = format, this.certName = name, this.innerErr = innerErr, this.message = "Failed to parse " + name + " as a valid " + format + " format certificate: " + innerErr.message; } function KeyEncryptedError(name, format) { Error.captureStackTrace && Error.captureStackTrace(this, KeyEncryptedError), this.name = "KeyEncryptedError", this.format = format, this.keyName = name, this.message = "The " + format + " format key " + name + " is encrypted (password-protected), and no passphrase was provided in `options`"; } util.inherits(FingerprintFormatError, Error), util.inherits(InvalidAlgorithmError, Error), util.inherits(KeyParseError, Error), util.inherits(SignatureParseError, Error), util.inherits(CertificateParseError, Error), util.inherits(KeyEncryptedError, Error), module.exports = { FingerprintFormatError: FingerprintFormatError, InvalidAlgorithmError: InvalidAlgorithmError, KeyParseError: KeyParseError, SignatureParseError: SignatureParseError, KeyEncryptedError: KeyEncryptedError, CertificateParseError: CertificateParseError }; }, function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(7), parse = url.parse, Url = url.Url; function parseurl(req) { var url = req.url; if (void 0 !== url) { var parsed = req._parsedUrl; return fresh(url, parsed) ? parsed : ((parsed = fastparse(url))._raw = url, req._parsedUrl = parsed); } } function fastparse(str) { if ("string" != typeof str || 47 !== str.charCodeAt(0)) return parse(str); for (var pathname = str, query = null, search = null, i = 1; i < str.length; i++) switch (str.charCodeAt(i)) { case 63: null === search && (pathname = str.substring(0, i), query = str.substring(i + 1), search = str.substring(i)); break; case 9: case 10: case 12: case 13: case 32: case 35: case 160: case 65279: return parse(str); } var url = void 0 !== Url ? new Url : {}; return url.path = str, url.href = str, url.pathname = pathname, null !== search && (url.query = query, url.search = search), url; } function fresh(url, parsedUrl) { return "object" == typeof parsedUrl && null !== parsedUrl && (void 0 === Url || parsedUrl instanceof Url) && parsedUrl._raw === url; } module.exports = parseurl, module.exports.original = function(req) { var url = req.originalUrl; if ("string" != typeof url) return parseurl(req); var parsed = req._parsedOriginalUrl; return fresh(url, parsed) ? parsed : ((parsed = fastparse(url))._raw = url, req._parsedOriginalUrl = parsed); }; }, function(module, exports, __webpack_require__) { "use strict"; var deprecate = __webpack_require__(51)("body-parser"), parsers = Object.create(null); function createParserGetter(name) { return function() { return (function(parserName) { var parser = parsers[parserName]; if (void 0 !== parser) return parser; switch (parserName) { case "json": parser = __webpack_require__(596); break; case "raw": parser = __webpack_require__(604); break; case "text": parser = __webpack_require__(605); break; case "urlencoded": parser = __webpack_require__(606); } return parsers[parserName] = parser; })(name); }; } exports = module.exports = deprecate.function((function(options) { var opts = {}; if (options) for (var prop in options) "type" !== prop && (opts[prop] = options[prop]); var _urlencoded = exports.urlencoded(opts), _json = exports.json(opts); return function(req, res, next) { _json(req, res, (function(err) { if (err) return next(err); _urlencoded(req, res, next); })); }; }), "bodyParser: use individual json/urlencoded middlewares"), Object.defineProperty(exports, "json", { configurable: !0, enumerable: !0, get: createParserGetter("json") }), Object.defineProperty(exports, "raw", { configurable: !0, enumerable: !0, get: createParserGetter("raw") }), Object.defineProperty(exports, "text", { configurable: !0, enumerable: !0, get: createParserGetter("text") }), Object.defineProperty(exports, "urlencoded", { configurable: !0, enumerable: !0, get: createParserGetter("urlencoded") }); }, function(module, exports, __webpack_require__) { var callSiteToString = __webpack_require__(283).callSiteToString, eventListenerCount = __webpack_require__(283).eventListenerCount, relative = __webpack_require__(5).relative; module.exports = depd; var basePath = process.cwd(); function containsNamespace(str, namespace) { for (var vals = str.split(/[ ,]+/), ns = String(namespace).toLowerCase(), i = 0; i < vals.length; i++) { var val = vals[i]; if (val && ("*" === val || val.toLowerCase() === ns)) return !0; } return !1; } function convertDataDescriptorToAccessor(obj, prop, message) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop), value = descriptor.value; return descriptor.get = function() { return value; }, descriptor.writable && (descriptor.set = function(val) { return value = val; }), delete descriptor.value, delete descriptor.writable, Object.defineProperty(obj, prop, descriptor), descriptor; } function createArgumentsString(arity) { for (var str = "", i = 0; i < arity; i++) str += ", arg" + i; return str.substr(2); } function createStackString(stack) { var str = this.name + ": " + this.namespace; this.message && (str += " deprecated " + this.message); for (var i = 0; i < stack.length; i++) str += "\n at " + callSiteToString(stack[i]); return str; } function depd(namespace) { if (!namespace) throw new TypeError("argument namespace is required"); var file = callSiteLocation(getStack()[1])[0]; function deprecate(message) { log.call(deprecate, message); } return deprecate._file = file, deprecate._ignored = isignored(namespace), deprecate._namespace = namespace, deprecate._traced = istraced(namespace), deprecate._warned = Object.create(null), deprecate.function = wrapfunction, deprecate.property = wrapproperty, deprecate; } function isignored(namespace) { return !!process.noDeprecation || containsNamespace(process.env.NO_DEPRECATION || "", namespace); } function istraced(namespace) { return !!process.traceDeprecation || containsNamespace(process.env.TRACE_DEPRECATION || "", namespace); } function log(message, site) { var haslisteners = 0 !== eventListenerCount(process, "deprecation"); if (haslisteners || !this._ignored) { var caller, callFile, callSite, depSite, i = 0, seen = !1, stack = getStack(), file = this._file; for (site ? (depSite = site, (callSite = callSiteLocation(stack[1])).name = depSite.name, file = callSite[0]) : callSite = depSite = callSiteLocation(stack[i = 2]); i < stack.length; i++) if ((callFile = (caller = callSiteLocation(stack[i]))[0]) === file) seen = !0; else if (callFile === this._file) file = this._file; else if (seen) break; var key = caller ? depSite.join(":") + "__" + caller.join(":") : void 0; if (void 0 === key || !(key in this._warned)) { this._warned[key] = !0; var msg = message; if (msg || (msg = callSite !== depSite && callSite.name ? defaultMessage(callSite) : defaultMessage(depSite)), haslisteners) { var err = DeprecationError(this._namespace, msg, stack.slice(i)); process.emit("deprecation", err); } else { var output = (process.stderr.isTTY ? formatColor : formatPlain).call(this, msg, caller, stack.slice(i)); process.stderr.write(output + "\n", "utf8"); } } } } function callSiteLocation(callSite) { var file = callSite.getFileName() || "", line = callSite.getLineNumber(), colm = callSite.getColumnNumber(); callSite.isEval() && (file = callSite.getEvalOrigin() + ", " + file); var site = [ file, line, colm ]; return site.callSite = callSite, site.name = callSite.getFunctionName(), site; } function defaultMessage(site) { var callSite = site.callSite, funcName = site.name; funcName || (funcName = ""); var context = callSite.getThis(), typeName = context && callSite.getTypeName(); return "Object" === typeName && (typeName = void 0), "Function" === typeName && (typeName = context.name || typeName), typeName && callSite.getMethodName() ? typeName + "." + funcName : funcName; } function formatPlain(msg, caller, stack) { var formatted = (new Date).toUTCString() + " " + this._namespace + " deprecated " + msg; if (this._traced) { for (var i = 0; i < stack.length; i++) formatted += "\n at " + callSiteToString(stack[i]); return formatted; } return caller && (formatted += " at " + formatLocation(caller)), formatted; } function formatColor(msg, caller, stack) { var formatted = "" + this._namespace + " deprecated " + msg + ""; if (this._traced) { for (var i = 0; i < stack.length; i++) formatted += "\n at " + callSiteToString(stack[i]) + ""; return formatted; } return caller && (formatted += " " + formatLocation(caller) + ""), formatted; } function formatLocation(callSite) { return relative(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2]; } function getStack() { var limit = Error.stackTraceLimit, obj = {}, prep = Error.prepareStackTrace; Error.prepareStackTrace = prepareObjectStackTrace, Error.stackTraceLimit = Math.max(10, limit), Error.captureStackTrace(obj); var stack = obj.stack.slice(1); return Error.prepareStackTrace = prep, Error.stackTraceLimit = limit, stack; } function prepareObjectStackTrace(obj, stack) { return stack; } function wrapfunction(fn, message) { if ("function" != typeof fn) throw new TypeError("argument fn must be a function"); var args = createArgumentsString(fn.length), deprecate = this, stack = getStack(), site = callSiteLocation(stack[1]); site.name = fn.name; var deprecatedfn = eval("(function (" + args + ') {\n"use strict"\nlog.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n})'); return deprecatedfn; } function wrapproperty(obj, prop, message) { if (!obj || "object" != typeof obj && "function" != typeof obj) throw new TypeError("argument obj must be object"); var descriptor = Object.getOwnPropertyDescriptor(obj, prop); if (!descriptor) throw new TypeError("must call property on owner object"); if (!descriptor.configurable) throw new TypeError("property must be configurable"); var deprecate = this, site = callSiteLocation(getStack()[1]); site.name = prop, "value" in descriptor && (descriptor = convertDataDescriptorToAccessor(obj, prop, message)); var get = descriptor.get, set = descriptor.set; "function" == typeof get && (descriptor.get = function() { return log.call(deprecate, message, site), get.apply(this, arguments); }), "function" == typeof set && (descriptor.set = function() { return log.call(deprecate, message, site), set.apply(this, arguments); }), Object.defineProperty(obj, prop, descriptor); } function DeprecationError(namespace, message, stack) { var stackString, error = new Error; return Object.defineProperty(error, "constructor", { value: DeprecationError }), Object.defineProperty(error, "message", { configurable: !0, enumerable: !1, value: message, writable: !0 }), Object.defineProperty(error, "name", { enumerable: !1, configurable: !0, value: "DeprecationError", writable: !0 }), Object.defineProperty(error, "namespace", { configurable: !0, enumerable: !1, value: namespace, writable: !0 }), Object.defineProperty(error, "stack", { configurable: !0, enumerable: !1, get: function() { return void 0 !== stackString ? stackString : stackString = createStackString.call(this, stack); }, set: function(val) { stackString = val; } }), error; } }, function(module, exports) { (function() { var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, slice = [].slice, hasProp = {}.hasOwnProperty; assign = function() { var i, key, len, source, sources, target; if (target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [], isFunction(Object.assign)) Object.assign.apply(null, arguments); else for (i = 0, len = sources.length; i < len; i++) if (null != (source = sources[i])) for (key in source) hasProp.call(source, key) && (target[key] = source[key]); return target; }, isFunction = function(val) { return !!val && "[object Function]" === Object.prototype.toString.call(val); }, isObject = function(val) { var ref; return !!val && ("function" == (ref = typeof val) || "object" === ref); }, isArray = function(val) { return isFunction(Array.isArray) ? Array.isArray(val) : "[object Array]" === Object.prototype.toString.call(val); }, isEmpty = function(val) { var key; if (isArray(val)) return !val.length; for (key in val) if (hasProp.call(val, key)) return !1; return !0; }, isPlainObject = function(val) { var ctor, proto; return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && "function" == typeof ctor && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object); }, getValue = function(obj) { return isFunction(obj.valueOf) ? obj.valueOf() : obj; }, module.exports.assign = assign, module.exports.isFunction = isFunction, module.exports.isObject = isObject, module.exports.isArray = isArray, module.exports.isEmpty = isEmpty, module.exports.isPlainObject = isPlainObject, module.exports.getValue = getValue; }).call(this); }, function(module, exports, __webpack_require__) { module.exports = Signature; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, errs = (__webpack_require__(31), __webpack_require__(6), __webpack_require__(48)), utils = __webpack_require__(28), asn1 = __webpack_require__(54), SSHBuffer = __webpack_require__(112), InvalidAlgorithmError = errs.InvalidAlgorithmError, SignatureParseError = errs.SignatureParseError; function Signature(opts) { assert.object(opts, "options"), assert.arrayOfObject(opts.parts, "options.parts"), assert.string(opts.type, "options.type"); for (var partLookup = {}, i = 0; i < opts.parts.length; ++i) { var part = opts.parts[i]; partLookup[part.name] = part; } this.type = opts.type, this.hashAlgorithm = opts.hashAlgo, this.curve = opts.curve, this.parts = opts.parts, this.part = partLookup; } Signature.prototype.toBuffer = function(format) { var buf; void 0 === format && (format = "asn1"), assert.string(format, "format"); var stype = "ssh-" + this.type; switch (this.type) { case "rsa": switch (this.hashAlgorithm) { case "sha256": stype = "rsa-sha2-256"; break; case "sha512": stype = "rsa-sha2-512"; break; case "sha1": case void 0: break; default: throw new Error("SSH signature format does not support hash algorithm " + this.hashAlgorithm); } return "ssh" === format ? ((buf = new SSHBuffer({})).writeString(stype), buf.writePart(this.part.sig), buf.toBuffer()) : this.part.sig.data; case "ed25519": return "ssh" === format ? ((buf = new SSHBuffer({})).writeString(stype), buf.writePart(this.part.sig), buf.toBuffer()) : this.part.sig.data; case "dsa": case "ecdsa": var r, s; if ("asn1" === format) { var der = new asn1.BerWriter; return der.startSequence(), r = utils.mpNormalize(this.part.r.data), s = utils.mpNormalize(this.part.s.data), der.writeBuffer(r, asn1.Ber.Integer), der.writeBuffer(s, asn1.Ber.Integer), der.endSequence(), der.buffer; } if ("ssh" === format && "dsa" === this.type) { if ((buf = new SSHBuffer({})).writeString("ssh-dss"), (r = this.part.r.data).length > 20 && 0 === r[0] && (r = r.slice(1)), (s = this.part.s.data).length > 20 && 0 === s[0] && (s = s.slice(1)), this.hashAlgorithm && "sha1" !== this.hashAlgorithm || r.length + s.length !== 40) throw new Error("OpenSSH only supports DSA signatures with SHA1 hash"); return buf.writeBuffer(Buffer.concat([ r, s ])), buf.toBuffer(); } if ("ssh" === format && "ecdsa" === this.type) { var curve, inner = new SSHBuffer({}); r = this.part.r.data, inner.writeBuffer(r), inner.writePart(this.part.s), buf = new SSHBuffer({}), 0 === r[0] && (r = r.slice(1)); var sz = 8 * r.length; return 256 === sz ? curve = "nistp256" : 384 === sz ? curve = "nistp384" : 528 === sz && (curve = "nistp521"), buf.writeString("ecdsa-sha2-" + curve), buf.writeBuffer(inner.toBuffer()), buf.toBuffer(); } throw new Error("Invalid signature format"); default: throw new Error("Invalid signature data"); } }, Signature.prototype.toString = function(format) { return assert.optionalString(format, "format"), this.toBuffer(format).toString("base64"); }, Signature.parse = function(data, type, format) { "string" == typeof data && (data = Buffer.from(data, "base64")), assert.buffer(data, "data"), assert.string(format, "format"), assert.string(type, "type"); var opts = {}; opts.type = type.toLowerCase(), opts.parts = []; try { switch (assert.ok(data.length > 0, "signature must not be empty"), opts.type) { case "rsa": case "ed25519": return (function(data, type, format, opts) { if ("ssh" === format) { try { var buf = new SSHBuffer({ buffer: data }), head = buf.readString(); } catch (e) {} if (void 0 !== buf) { var msg = "SSH signature does not match expected type (expected " + type + ", got " + head + ")"; switch (head) { case "ssh-rsa": assert.strictEqual(type, "rsa", msg), opts.hashAlgo = "sha1"; break; case "rsa-sha2-256": assert.strictEqual(type, "rsa", msg), opts.hashAlgo = "sha256"; break; case "rsa-sha2-512": assert.strictEqual(type, "rsa", msg), opts.hashAlgo = "sha512"; break; case "ssh-ed25519": assert.strictEqual(type, "ed25519", msg), opts.hashAlgo = "sha512"; break; default: throw new Error("Unknown SSH signature type: " + head); } var sig = buf.readPart(); return assert.ok(buf.atEnd(), "extra trailing bytes"), sig.name = "sig", opts.parts.push(sig), new Signature(opts); } } return opts.parts.push({ name: "sig", data: data }), new Signature(opts); })(data, type, format, opts); case "dsa": case "ecdsa": return "asn1" === format ? (function(data, type, format, opts) { var der = new asn1.BerReader(data); der.readSequence(); var r = der.readString(asn1.Ber.Integer, !0), s = der.readString(asn1.Ber.Integer, !0); return opts.parts.push({ name: "r", data: utils.mpNormalize(r) }), opts.parts.push({ name: "s", data: utils.mpNormalize(s) }), new Signature(opts); })(data, 0, 0, opts) : "dsa" === opts.type ? (function(data, type, format, opts) { if (40 != data.length) { var buf = new SSHBuffer({ buffer: data }), d = buf.readBuffer(); "ssh-dss" === d.toString("ascii") && (d = buf.readBuffer()), assert.ok(buf.atEnd(), "extra trailing bytes"), assert.strictEqual(d.length, 40, "invalid inner length"), data = d; } return opts.parts.push({ name: "r", data: data.slice(0, 20) }), opts.parts.push({ name: "s", data: data.slice(20, 40) }), new Signature(opts); })(data, 0, 0, opts) : (function(data, type, format, opts) { var r, s, buf = new SSHBuffer({ buffer: data }), inner = buf.readBuffer(), stype = inner.toString("ascii"); if ("ecdsa-" === stype.slice(0, 6)) { var parts = stype.split("-"); switch (assert.strictEqual(parts[0], "ecdsa"), assert.strictEqual(parts[1], "sha2"), opts.curve = parts[2], opts.curve) { case "nistp256": opts.hashAlgo = "sha256"; break; case "nistp384": opts.hashAlgo = "sha384"; break; case "nistp521": opts.hashAlgo = "sha512"; break; default: throw new Error("Unsupported ECDSA curve: " + opts.curve); } inner = buf.readBuffer(), assert.ok(buf.atEnd(), "extra trailing bytes on outer"), r = (buf = new SSHBuffer({ buffer: inner })).readPart(); } else r = { data: inner }; return s = buf.readPart(), assert.ok(buf.atEnd(), "extra trailing bytes"), r.name = "r", s.name = "s", opts.parts.push(r), opts.parts.push(s), new Signature(opts); })(data, 0, 0, opts); default: throw new InvalidAlgorithmError(type); } } catch (e) { if (e instanceof InvalidAlgorithmError) throw e; throw new SignatureParseError(type, format, e); } }, Signature.isSignature = function(obj, ver) { return utils.isCompatible(obj, Signature, ver); }, Signature.prototype._sshpkApiVersion = [ 2, 1 ], Signature._oldVersionDetect = function(obj) { return assert.func(obj.toBuffer), obj.hasOwnProperty("hashAlgorithm") ? [ 2, 0 ] : [ 1, 0 ]; }; }, function(module, exports, __webpack_require__) { var Ber = __webpack_require__(1138); module.exports = { Ber: Ber, BerReader: Ber.Reader, BerWriter: Ber.Writer }; }, function(module, exports, __webpack_require__) { var extend = __webpack_require__(629); exports.DEFAULT_ANNOUNCE_PEERS = 50, exports.MAX_ANNOUNCE_PEERS = 82, exports.binaryToHex = function(str) { return new Buffer(str, "binary").toString("hex"); }, exports.hexToBinary = function(str) { return new Buffer(str, "hex").toString("binary"); }, extend(exports, __webpack_require__(630)); }, function(module, exports) { module.exports = function(model, calc) { var fn; return (fn = function(buf, previous) { return calc(buf, previous) >>> 0; }).signed = calc, fn.unsigned = fn, fn.model = model, fn; }; }, function(module, exports) { (function() { var assign, isArray, isEmpty, isFunction, isObject, isPlainObject, slice = [].slice, hasProp = {}.hasOwnProperty; assign = function() { var i, key, len, source, sources, target; if (target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [], isFunction(Object.assign)) Object.assign.apply(null, arguments); else for (i = 0, len = sources.length; i < len; i++) if (null != (source = sources[i])) for (key in source) hasProp.call(source, key) && (target[key] = source[key]); return target; }, isFunction = function(val) { return !!val && "[object Function]" === Object.prototype.toString.call(val); }, isObject = function(val) { var ref; return !!val && ("function" == (ref = typeof val) || "object" === ref); }, isArray = function(val) { return isFunction(Array.isArray) ? Array.isArray(val) : "[object Array]" === Object.prototype.toString.call(val); }, isEmpty = function(val) { var key; if (isArray(val)) return !val.length; for (key in val) if (hasProp.call(val, key)) return !1; return !0; }, isPlainObject = function(val) { var ctor, proto; return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && "function" == typeof ctor && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object); }, module.exports.assign = assign, module.exports.isFunction = isFunction, module.exports.isObject = isObject, module.exports.isArray = isArray, module.exports.isEmpty = isEmpty, module.exports.isPlainObject = isPlainObject; }).call(this); }, function(module, exports, __webpack_require__) { "use strict"; "undefined" == typeof process || !process.version || 0 === process.version.indexOf("v0.") || 0 === process.version.indexOf("v1.") && 0 !== process.version.indexOf("v1.8.") ? module.exports = { nextTick: function(fn, arg1, arg2, arg3) { if ("function" != typeof fn) throw new TypeError('"callback" argument must be a function'); var args, i, len = arguments.length; switch (len) { case 0: case 1: return process.nextTick(fn); case 2: return process.nextTick((function() { fn.call(null, arg1); })); case 3: return process.nextTick((function() { fn.call(null, arg1, arg2); })); case 4: return process.nextTick((function() { fn.call(null, arg1, arg2, arg3); })); default: for (args = new Array(len - 1), i = 0; i < args.length; ) args[i++] = arguments[i]; return process.nextTick((function() { fn.apply(null, args); })); } } } : module.exports = process; }, function(module, exports, __webpack_require__) { "use strict"; var secondsToVideoTs, secondsToAudioTs, videoTsToSeconds, audioTsToSeconds, audioTsToVideoTs, videoTsToAudioTs, metadataTsToSeconds; secondsToVideoTs = function(seconds) { return 9e4 * seconds; }, secondsToAudioTs = function(seconds, sampleRate) { return seconds * sampleRate; }, videoTsToSeconds = function(timestamp) { return timestamp / 9e4; }, audioTsToSeconds = function(timestamp, sampleRate) { return timestamp / sampleRate; }, audioTsToVideoTs = function(timestamp, sampleRate) { return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate)); }, videoTsToAudioTs = function(timestamp, sampleRate) { return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate); }, metadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) { return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts); }, module.exports = { ONE_SECOND_IN_TS: 9e4, secondsToVideoTs: secondsToVideoTs, secondsToAudioTs: secondsToAudioTs, videoTsToSeconds: videoTsToSeconds, audioTsToSeconds: audioTsToSeconds, audioTsToVideoTs: audioTsToVideoTs, videoTsToAudioTs: videoTsToAudioTs, metadataTsToSeconds: metadataTsToSeconds }; }, function(module, exports, __webpack_require__) { "use strict"; var _TypeError, _RangeError, es5 = __webpack_require__(75), Objectfreeze = es5.freeze, util = __webpack_require__(16), inherits = util.inherits, notEnumerableProp = util.notEnumerableProp; function subError(nameProperty, defaultMessage) { function SubError(message) { if (!(this instanceof SubError)) return new SubError(message); notEnumerableProp(this, "message", "string" == typeof message ? message : defaultMessage), notEnumerableProp(this, "name", nameProperty), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : Error.call(this); } return inherits(SubError, Error), SubError; } var Warning = subError("Warning", "warning"), CancellationError = subError("CancellationError", "cancellation error"), TimeoutError = subError("TimeoutError", "timeout error"), AggregateError = subError("AggregateError", "aggregate error"); try { _TypeError = TypeError, _RangeError = RangeError; } catch (e) { _TypeError = subError("TypeError", "type error"), _RangeError = subError("RangeError", "range error"); } for (var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "), i = 0; i < methods.length; ++i) "function" == typeof Array.prototype[methods[i]] && (AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]); es5.defineProperty(AggregateError.prototype, "length", { value: 0, configurable: !1, writable: !0, enumerable: !0 }), AggregateError.prototype.isOperational = !0; var level = 0; function OperationalError(message) { if (!(this instanceof OperationalError)) return new OperationalError(message); notEnumerableProp(this, "name", "OperationalError"), notEnumerableProp(this, "message", message), this.cause = message, this.isOperational = !0, message instanceof Error ? (notEnumerableProp(this, "message", message.message), notEnumerableProp(this, "stack", message.stack)) : Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); } AggregateError.prototype.toString = function() { var indent = Array(4 * level + 1).join(" "), ret = "\n" + indent + "AggregateError of:\n"; level++, indent = Array(4 * level + 1).join(" "); for (var i = 0; i < this.length; ++i) { for (var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "", lines = str.split("\n"), j = 0; j < lines.length; ++j) lines[j] = indent + lines[j]; ret += (str = lines.join("\n")) + "\n"; } return level--, ret; }, inherits(OperationalError, Error); var errorTypes = Error.__BluebirdErrorTypes__; errorTypes || (errorTypes = Objectfreeze({ CancellationError: CancellationError, TimeoutError: TimeoutError, OperationalError: OperationalError, RejectionError: OperationalError, AggregateError: AggregateError }), es5.defineProperty(Error, "__BluebirdErrorTypes__", { value: errorTypes, writable: !1, enumerable: !1, configurable: !1 })), module.exports = { Error: Error, TypeError: _TypeError, RangeError: _RangeError, CancellationError: errorTypes.CancellationError, OperationalError: errorTypes.OperationalError, TimeoutError: errorTypes.TimeoutError, AggregateError: errorTypes.AggregateError, Warning: Warning }; }, function(module, exports, __webpack_require__) { "use strict"; var extend = __webpack_require__(157), cookies = __webpack_require__(515), paramsHaveRequestBody = __webpack_require__(260).paramsHaveRequestBody; function initParams(uri, options, callback) { "function" == typeof options && (callback = options); var params = {}; return "object" == typeof options ? extend(params, options, { uri: uri }) : extend(params, "string" == typeof uri ? { uri: uri } : uri), params.callback = callback || params.callback, params; } function request(uri, options, callback) { if (void 0 === uri) throw new Error("undefined is not a valid uri or options object."); var params = initParams(uri, options, callback); if ("HEAD" === params.method && paramsHaveRequestBody(params)) throw new Error("HTTP HEAD requests MUST NOT include a request body."); return new request.Request(params); } function verbFunc(verb) { var method = verb.toUpperCase(); return function(uri, options, callback) { var params = initParams(uri, options, callback); return params.method = method, request(params, params.callback); }; } function wrapRequestMethod(method, options, requester, verb) { return function(uri, opts, callback) { var params = initParams(uri, opts, callback), target = {}; return extend(!0, target, options, params), target.pool = params.pool || options.pool, verb && (target.method = verb.toUpperCase()), "function" == typeof requester && (method = requester), method(target, target.callback); }; } request.get = verbFunc("get"), request.head = verbFunc("head"), request.options = verbFunc("options"), request.post = verbFunc("post"), request.put = verbFunc("put"), request.patch = verbFunc("patch"), request.del = verbFunc("delete"), request.delete = verbFunc("delete"), request.jar = function(store) { return cookies.jar(store); }, request.cookie = function(str) { return cookies.parse(str); }, request.defaults = function(options, requester) { var self = this; "function" == typeof (options = options || {}) && (requester = options, options = {}); var defaults = wrapRequestMethod(self, options, requester); return [ "get", "head", "post", "put", "patch", "del", "delete" ].forEach((function(verb) { defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb); })), defaults.cookie = wrapRequestMethod(self.cookie, options, requester), defaults.jar = self.jar, defaults.defaults = self.defaults, defaults; }, request.forever = function(agentOptions, optionsArg) { var options = {}; return optionsArg && extend(options, optionsArg), agentOptions && (options.agentOptions = agentOptions), options.forever = !0, request.defaults(options); }, module.exports = request, request.Request = __webpack_require__(1132), request.initParams = initParams, Object.defineProperty(request, "debug", { enumerable: !0, get: function() { return request.Request.debug; }, set: function(debug) { request.Request.debug = debug; } }); }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options, forceType) { var input = buf; "string" != typeof buf && (assert.buffer(buf, "buf"), buf = buf.toString("ascii")); for (var m, m2, lines = buf.trim().split(/[\r\n]+/g), si = -1; !m && si < lines.length; ) m = lines[++si].match(/[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); assert.ok(m, "invalid PEM header"); for (var ei = lines.length; !m2 && ei > 0; ) m2 = lines[--ei].match(/[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); assert.ok(m2, "invalid PEM footer"), assert.equal(m[2], m2[2]); var alg, type = m[2].toLowerCase(); m[1] && (assert.equal(m[1], m2[1], "PEM header and footer mismatch"), alg = m[1].trim()), lines = lines.slice(si, ei + 1); for (var cipher, key, iv, headers = {}; m = (lines = lines.slice(1))[0].match(/^([A-Za-z0-9-]+): (.+)$/); ) headers[m[1].toLowerCase()] = m[2]; if (lines = lines.slice(0, -1).join(""), buf = Buffer.from(lines, "base64"), headers["proc-type"]) { var parts = headers["proc-type"].split(","); if ("4" === parts[0] && "ENCRYPTED" === parts[1]) { if ("string" == typeof options.passphrase && (options.passphrase = Buffer.from(options.passphrase, "utf-8")), !Buffer.isBuffer(options.passphrase)) throw new errors.KeyEncryptedError(options.filename, "PEM"); parts = headers["dek-info"].split(","), assert.ok(2 === parts.length), cipher = parts[0].toLowerCase(), iv = Buffer.from(parts[1], "hex"), key = utils.opensslKeyDeriv(cipher, iv, options.passphrase, 1).key; } } if (alg && "encrypted" === alg.toLowerCase()) { var pbesEnd, eder = new asn1.BerReader(buf); eder.readSequence(), eder.readSequence(), pbesEnd = eder.offset + eder.length; var method = eder.readOID(); if ("1.2.840.113549.1.5.13" !== method) throw new Error("Unsupported PEM/PKCS8 encryption scheme: " + method); eder.readSequence(), eder.readSequence(); var kdfEnd = eder.offset + eder.length, kdfOid = eder.readOID(); if ("1.2.840.113549.1.5.12" !== kdfOid) throw new Error("Unsupported PBES2 KDF: " + kdfOid); eder.readSequence(); var salt = eder.readString(asn1.Ber.OctetString, !0), iterations = eder.readInt(), hashAlg = "sha1"; if (eder.offset < kdfEnd) { eder.readSequence(); var hashAlgOid = eder.readOID(); if (void 0 === (hashAlg = OID_TO_HASH[hashAlgOid])) throw new Error("Unsupported PBKDF2 hash: " + hashAlgOid); } eder._offset = kdfEnd, eder.readSequence(); var cipherOid = eder.readOID(); if (void 0 === (cipher = OID_TO_CIPHER[cipherOid])) throw new Error("Unsupported PBES2 cipher: " + cipherOid); if (iv = eder.readString(asn1.Ber.OctetString, !0), eder._offset = pbesEnd, buf = eder.readString(asn1.Ber.OctetString, !0), "string" == typeof options.passphrase && (options.passphrase = Buffer.from(options.passphrase, "utf-8")), !Buffer.isBuffer(options.passphrase)) throw new errors.KeyEncryptedError(options.filename, "PEM"); var cinfo = utils.opensshCipherInfo(cipher); cipher = cinfo.opensslName, key = utils.pbkdf2(hashAlg, salt, iterations, cinfo.keySize, options.passphrase), alg = void 0; } if (cipher && key && iv) { var chunk, cipherStream = crypto.createDecipheriv(cipher, key, iv), chunks = []; for (cipherStream.once("error", (function(e) { if (-1 !== e.toString().indexOf("bad decrypt")) throw new Error("Incorrect passphrase supplied, could not decrypt key"); throw e; })), cipherStream.write(buf), cipherStream.end(); null !== (chunk = cipherStream.read()); ) chunks.push(chunk); buf = Buffer.concat(chunks); } if (alg && "openssh" === alg.toLowerCase()) return sshpriv.readSSHPrivate(type, buf, options); if (alg && "ssh2" === alg.toLowerCase()) return rfc4253.readType(type, buf, options); var der = new asn1.BerReader(buf); return der.originalInput = input, der.readSequence(), alg ? (forceType && assert.strictEqual(forceType, "pkcs1"), pkcs1.readPkcs1(alg, type, der)) : (forceType && assert.strictEqual(forceType, "pkcs8"), pkcs8.readPkcs8(alg, type, der)); }, write: function(key, options, type) { assert.object(key); var header, alg = { ecdsa: "EC", rsa: "RSA", dsa: "DSA", ed25519: "EdDSA" }[key.type], der = new asn1.BerWriter; if (PrivateKey.isPrivateKey(key)) type && "pkcs8" === type ? (header = "PRIVATE KEY", pkcs8.writePkcs8(der, key)) : (type && assert.strictEqual(type, "pkcs1"), header = alg + " PRIVATE KEY", pkcs1.writePkcs1(der, key)); else { if (!Key.isKey(key)) throw new Error("key is not a Key or PrivateKey"); type && "pkcs1" === type ? (header = alg + " PUBLIC KEY", pkcs1.writePkcs1(der, key)) : (type && assert.strictEqual(type, "pkcs8"), header = "PUBLIC KEY", pkcs8.writePkcs8(der, key)); } var tmp = der.buffer.toString("base64"), len = tmp.length + tmp.length / 64 + 18 + 16 + 2 * header.length + 10, buf = Buffer.alloc(len), o = 0; o += buf.write("-----BEGIN " + header + "-----\n", o); for (var i = 0; i < tmp.length; ) { var limit = i + 64; limit > tmp.length && (limit = tmp.length), o += buf.write(tmp.slice(i, limit), o), buf[o++] = 10, i = limit; } return o += buf.write("-----END " + header + "-----\n", o), buf.slice(0, o); } }; var assert = __webpack_require__(15), asn1 = __webpack_require__(54), crypto = __webpack_require__(6), Buffer = __webpack_require__(14).Buffer, utils = (__webpack_require__(31), __webpack_require__(28)), Key = __webpack_require__(27), PrivateKey = __webpack_require__(29), pkcs1 = __webpack_require__(265), pkcs8 = __webpack_require__(113), sshpriv = __webpack_require__(165), rfc4253 = __webpack_require__(63), errors = __webpack_require__(48), OID_TO_CIPHER = { "1.2.840.113549.3.7": "3des-cbc", "2.16.840.1.101.3.4.1.2": "aes128-cbc", "2.16.840.1.101.3.4.1.42": "aes256-cbc" }, CIPHER_TO_OID = {}; Object.keys(OID_TO_CIPHER).forEach((function(k) { CIPHER_TO_OID[OID_TO_CIPHER[k]] = k; })); var OID_TO_HASH = { "1.2.840.113549.2.7": "sha1", "1.2.840.113549.2.9": "sha256", "1.2.840.113549.2.11": "sha512" }, HASH_TO_OID = {}; Object.keys(OID_TO_HASH).forEach((function(k) { HASH_TO_OID[OID_TO_HASH[k]] = k; })); }, function(module, exports, __webpack_require__) { module.exports = { read: read.bind(void 0, !1, void 0), readType: read.bind(void 0, !1), write: function(key, options) { assert.object(key); var i, alg = keyTypeToAlg(key), algInfo = algs.info[key.type]; PrivateKey.isPrivateKey(key) && (algInfo = algs.privInfo[key.type]); var parts = algInfo.parts, buf = new SSHBuffer({}); for (buf.writeString(alg), i = 0; i < parts.length; ++i) { var data = key.part[parts[i]].data; !1 !== algInfo.normalize && (data = "ed25519" === key.type ? utils.zeroPadToLength(data, 32) : utils.mpNormalize(data)), "ed25519" === key.type && "k" === parts[i] && (data = Buffer.concat([ data, key.part.A.data ])), buf.writeBuffer(data); } return buf.toBuffer(); }, readPartial: read.bind(void 0, !0), readInternal: read, keyTypeToAlg: keyTypeToAlg, algToKeyType: algToKeyType }; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(31), utils = __webpack_require__(28), Key = __webpack_require__(27), PrivateKey = __webpack_require__(29), SSHBuffer = __webpack_require__(112); function algToKeyType(alg) { if (assert.string(alg), "ssh-dss" === alg) return "dsa"; if ("ssh-rsa" === alg) return "rsa"; if ("ssh-ed25519" === alg) return "ed25519"; if ("ssh-curve25519" === alg) return "curve25519"; if (alg.match(/^ecdsa-sha2-/)) return "ecdsa"; throw new Error("Unknown algorithm " + alg); } function keyTypeToAlg(key) { if (assert.object(key), "dsa" === key.type) return "ssh-dss"; if ("rsa" === key.type) return "ssh-rsa"; if ("ed25519" === key.type) return "ssh-ed25519"; if ("curve25519" === key.type) return "ssh-curve25519"; if ("ecdsa" === key.type) return "ecdsa-sha2-" + key.part.curve.data.toString(); throw new Error("Unknown key type " + key.type); } function read(partial, type, buf, options) { "string" == typeof buf && (buf = Buffer.from(buf)), assert.buffer(buf, "buf"); var key = {}, parts = key.parts = [], sshbuf = new SSHBuffer({ buffer: buf }), alg = sshbuf.readString(); assert.ok(!sshbuf.atEnd(), "key must have at least one part"), key.type = algToKeyType(alg); var partCount = algs.info[key.type].parts.length; for (type && "private" === type && (partCount = algs.privInfo[key.type].parts.length); !sshbuf.atEnd() && parts.length < partCount; ) parts.push(sshbuf.readPart()); for (;!partial && !sshbuf.atEnd(); ) parts.push(sshbuf.readPart()); assert.ok(parts.length >= 1, "key must have at least one part"), assert.ok(partial || sshbuf.atEnd(), "leftover bytes at end of key"); var Constructor = Key, algInfo = algs.info[key.type]; if ("private" !== type && algInfo.parts.length === parts.length || (algInfo = algs.privInfo[key.type], Constructor = PrivateKey), assert.strictEqual(algInfo.parts.length, parts.length), "ecdsa" === key.type) { var res = /^ecdsa-sha2-(.+)$/.exec(alg); assert.ok(null !== res), assert.strictEqual(res[1], parts[0].data.toString()); } for (var normalized = !0, i = 0; i < algInfo.parts.length; ++i) { var nd, p = parts[i]; p.name = algInfo.parts[i], "ed25519" === key.type && "k" === p.name && (p.data = p.data.slice(0, 32)), "curve" !== p.name && !1 !== algInfo.normalize && (nd = "ed25519" === key.type ? utils.zeroPadToLength(p.data, 32) : utils.mpNormalize(p.data)).toString("binary") !== p.data.toString("binary") && (p.data = nd, normalized = !1); } return normalized && (key._rfc4253Cache = sshbuf.toBuffer()), partial && "object" == typeof partial && (partial.remainder = sshbuf.remainder(), partial.consumed = sshbuf._offset), new Constructor(key); } }, function(module, exports, __webpack_require__) { "use strict"; var _TypeError, _RangeError, es5 = __webpack_require__(92), Objectfreeze = es5.freeze, util = __webpack_require__(17), inherits = util.inherits, notEnumerableProp = util.notEnumerableProp; function subError(nameProperty, defaultMessage) { function SubError(message) { if (!(this instanceof SubError)) return new SubError(message); notEnumerableProp(this, "message", "string" == typeof message ? message : defaultMessage), notEnumerableProp(this, "name", nameProperty), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : Error.call(this); } return inherits(SubError, Error), SubError; } var Warning = subError("Warning", "warning"), CancellationError = subError("CancellationError", "cancellation error"), TimeoutError = subError("TimeoutError", "timeout error"), AggregateError = subError("AggregateError", "aggregate error"); try { _TypeError = TypeError, _RangeError = RangeError; } catch (e) { _TypeError = subError("TypeError", "type error"), _RangeError = subError("RangeError", "range error"); } for (var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "), i = 0; i < methods.length; ++i) "function" == typeof Array.prototype[methods[i]] && (AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]); es5.defineProperty(AggregateError.prototype, "length", { value: 0, configurable: !1, writable: !0, enumerable: !0 }), AggregateError.prototype.isOperational = !0; var level = 0; function OperationalError(message) { if (!(this instanceof OperationalError)) return new OperationalError(message); notEnumerableProp(this, "name", "OperationalError"), notEnumerableProp(this, "message", message), this.cause = message, this.isOperational = !0, message instanceof Error ? (notEnumerableProp(this, "message", message.message), notEnumerableProp(this, "stack", message.stack)) : Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); } AggregateError.prototype.toString = function() { var indent = Array(4 * level + 1).join(" "), ret = "\n" + indent + "AggregateError of:\n"; level++, indent = Array(4 * level + 1).join(" "); for (var i = 0; i < this.length; ++i) { for (var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "", lines = str.split("\n"), j = 0; j < lines.length; ++j) lines[j] = indent + lines[j]; ret += (str = lines.join("\n")) + "\n"; } return level--, ret; }, inherits(OperationalError, Error); var errorTypes = Error.__BluebirdErrorTypes__; errorTypes || (errorTypes = Objectfreeze({ CancellationError: CancellationError, TimeoutError: TimeoutError, OperationalError: OperationalError, RejectionError: OperationalError, AggregateError: AggregateError }), es5.defineProperty(Error, "__BluebirdErrorTypes__", { value: errorTypes, writable: !1, enumerable: !1, configurable: !1 })), module.exports = { Error: Error, TypeError: _TypeError, RangeError: _RangeError, CancellationError: errorTypes.CancellationError, OperationalError: errorTypes.OperationalError, TimeoutError: errorTypes.TimeoutError, AggregateError: errorTypes.AggregateError, Warning: Warning }; }, function(module, exports, __webpack_require__) { var fs$close, fs$closeSync, fs = __webpack_require__(2), polyfills = __webpack_require__(1275), legacy = __webpack_require__(1277), clone = __webpack_require__(1278), queue = [], util = __webpack_require__(0), debug = function() {}; function patch(fs) { polyfills(fs), fs.gracefulify = patch, fs.FileReadStream = ReadStream, fs.FileWriteStream = WriteStream, fs.createReadStream = function(path, options) { return new ReadStream(path, options); }, fs.createWriteStream = function(path, options) { return new WriteStream(path, options); }; var fs$readFile = fs.readFile; fs.readFile = function(path, options, cb) { return "function" == typeof options && (cb = options, options = null), (function go$readFile(path, options, cb) { return fs$readFile(path, options, (function(err) { !err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), retry()) : enqueue([ go$readFile, [ path, options, cb ] ]); })); })(path, options, cb); }; var fs$writeFile = fs.writeFile; fs.writeFile = function(path, data, options, cb) { return "function" == typeof options && (cb = options, options = null), (function go$writeFile(path, data, options, cb) { return fs$writeFile(path, data, options, (function(err) { !err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), retry()) : enqueue([ go$writeFile, [ path, data, options, cb ] ]); })); })(path, data, options, cb); }; var fs$appendFile = fs.appendFile; fs$appendFile && (fs.appendFile = function(path, data, options, cb) { return "function" == typeof options && (cb = options, options = null), (function go$appendFile(path, data, options, cb) { return fs$appendFile(path, data, options, (function(err) { !err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), retry()) : enqueue([ go$appendFile, [ path, data, options, cb ] ]); })); })(path, data, options, cb); }); var fs$readdir = fs.readdir; function go$readdir(args) { return fs$readdir.apply(fs, args); } if (fs.readdir = function(path, options, cb) { var args = [ path ]; return "function" != typeof options ? args.push(options) : cb = options, args.push((function(err, files) { files && files.sort && files.sort(), !err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), retry()) : enqueue([ go$readdir, [ args ] ]); })), go$readdir(args); }, "v0.8" === process.version.substr(0, 4)) { var legStreams = legacy(fs); ReadStream = legStreams.ReadStream, WriteStream = legStreams.WriteStream; } var fs$ReadStream = fs.ReadStream; fs$ReadStream && (ReadStream.prototype = Object.create(fs$ReadStream.prototype), ReadStream.prototype.open = function() { var that = this; open(that.path, that.flags, that.mode, (function(err, fd) { err ? (that.autoClose && that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd), that.read()); })); }); var fs$WriteStream = fs.WriteStream; function ReadStream(path, options) { return this instanceof ReadStream ? (fs$ReadStream.apply(this, arguments), this) : ReadStream.apply(Object.create(ReadStream.prototype), arguments); } function WriteStream(path, options) { return this instanceof WriteStream ? (fs$WriteStream.apply(this, arguments), this) : WriteStream.apply(Object.create(WriteStream.prototype), arguments); } fs$WriteStream && (WriteStream.prototype = Object.create(fs$WriteStream.prototype), WriteStream.prototype.open = function() { var that = this; open(that.path, that.flags, that.mode, (function(err, fd) { err ? (that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd)); })); }), fs.ReadStream = ReadStream, fs.WriteStream = WriteStream; var fs$open = fs.open; function open(path, flags, mode, cb) { return "function" == typeof mode && (cb = mode, mode = null), (function go$open(path, flags, mode, cb) { return fs$open(path, flags, mode, (function(err, fd) { !err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), retry()) : enqueue([ go$open, [ path, flags, mode, cb ] ]); })); })(path, flags, mode, cb); } return fs.open = open, fs; } function enqueue(elem) { debug("ENQUEUE", elem[0].name, elem[1]), queue.push(elem); } function retry() { var elem = queue.shift(); elem && (debug("RETRY", elem[0].name, elem[1]), elem[0].apply(null, elem[1])); } util.debuglog ? debug = util.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (debug = function() { var m = util.format.apply(util, arguments); m = "GFS4: " + m.split(/\n/).join("\nGFS4: "), console.error(m); }), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", (function() { debug(queue), __webpack_require__(25).equal(queue.length, 0); })), module.exports = patch(clone(fs)), process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched && (module.exports = patch(fs), fs.__patched = !0), module.exports.close = (fs$close = fs.close, function(fd, cb) { return fs$close.call(fs, fd, (function(err) { err || retry(), "function" == typeof cb && cb.apply(this, arguments); })); }), module.exports.closeSync = (fs$closeSync = fs.closeSync, function(fd) { var rval = fs$closeSync.apply(fs, arguments); return retry(), rval; }), /\bgraceful-fs\b/.test(fs.closeSync.toString()) || (fs.closeSync = module.exports.closeSync, fs.close = module.exports.close); }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(14).Buffer, bomHandling = __webpack_require__(567), iconv = module.exports; iconv.encodings = null, iconv.defaultCharUnicode = "�", iconv.defaultCharSingleByte = "?", iconv.encode = function(str, encoding, options) { str = "" + (str || ""); var encoder = iconv.getEncoder(encoding, options), res = encoder.write(str), trail = encoder.end(); return trail && trail.length > 0 ? Buffer.concat([ res, trail ]) : res; }, iconv.decode = function(buf, encoding, options) { "string" == typeof buf && (iconv.skipDecodeWarning || (console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"), iconv.skipDecodeWarning = !0), buf = Buffer.from("" + (buf || ""), "binary")); var decoder = iconv.getDecoder(encoding, options), res = decoder.write(buf), trail = decoder.end(); return trail ? res + trail : res; }, iconv.encodingExists = function(enc) { try { return iconv.getCodec(enc), !0; } catch (e) { return !1; } }, iconv.toEncoding = iconv.encode, iconv.fromEncoding = iconv.decode, iconv._codecDataCache = {}, iconv.getCodec = function(encoding) { iconv.encodings || (iconv.encodings = __webpack_require__(568)); for (var enc = iconv._canonicalizeEncoding(encoding), codecOptions = {}; ;) { var codec = iconv._codecDataCache[enc]; if (codec) return codec; var codecDef = iconv.encodings[enc]; switch (typeof codecDef) { case "string": enc = codecDef; break; case "object": for (var key in codecDef) codecOptions[key] = codecDef[key]; codecOptions.encodingName || (codecOptions.encodingName = enc), enc = codecDef.type; break; case "function": return codecOptions.encodingName || (codecOptions.encodingName = enc), codec = new codecDef(codecOptions, iconv), iconv._codecDataCache[codecOptions.encodingName] = codec, codec; default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')"); } } }, iconv._canonicalizeEncoding = function(encoding) { return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); }, iconv.getEncoder = function(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); return codec.bomAware && options && options.addBOM && (encoder = new bomHandling.PrependBOM(encoder, options)), encoder; }, iconv.getDecoder = function(encoding, options) { var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); return !codec.bomAware || options && !1 === options.stripBOM || (decoder = new bomHandling.StripBOM(decoder, options)), decoder; }; var nodeVer = "undefined" != typeof process && process.versions && process.versions.node; if (nodeVer) { var nodeVerArr = nodeVer.split(".").map(Number); (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) && __webpack_require__(582)(iconv), __webpack_require__(583)(iconv); } }, function(module, exports) { module.exports = function(a, b) { if (a && b) for (var key in b) a[key] = b[key]; return a; }; }, function(module, exports, __webpack_require__) { "use strict"; var http = __webpack_require__(11); module.exports = http.METHODS && http.METHODS.map((function(method) { return method.toLowerCase(); })) || [ "get", "post", "put", "head", "delete", "options", "trace", "copy", "lock", "mkcol", "move", "purge", "propfind", "proppatch", "unlock", "report", "mkactivity", "checkout", "merge", "m-search", "notify", "subscribe", "unsubscribe", "patch", "search", "connect" ]; }, function(module, exports) { module.exports = function(module) { return module.webpackPolyfill || (module.deprecate = function() {}, module.paths = [], module.children || (module.children = []), Object.defineProperty(module, "loaded", { enumerable: !0, get: function() { return module.l; } }), Object.defineProperty(module, "id", { enumerable: !0, get: function() { return module.i; } }), module.webpackPolyfill = 1), module; }; }, function(module, exports) { module.exports = require("tls"); }, function(module, exports) { module.exports = function(processor, concurrency) { concurrency = concurrency || 1; var waiting = [], inProg = {}, count = 0; function update() { for (;waiting.length && count < concurrency; ) !(function() { var t = waiting.shift(); inProg[t.task.id] ? inProg[t.task.id].push(t.cb) : (inProg[t.task.id] = [ t.cb ], count++, processor(t.task, (function() { var args = arguments; inProg[t.task.id] && (count--, inProg[t.task.id].forEach((function(cb) { cb.apply(null, args); })), delete inProg[t.task.id], setImmediate(update)); }))); })(); } this.push = function(task, cb) { if (!task.hasOwnProperty("id")) throw new Error("no task.id"); inProg[task.id] ? inProg[task.id].push(cb) : (waiting.push({ task: task, cb: cb }), setImmediate(update)); }, this.unshift = function(task, cb) { inProg[task.id] ? inProg[task.id].push(cb) : (waiting.unshift({ task: task, cb: cb }), setImmediate(update)); }, this.length = function() { return waiting.length; }; }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element = __webpack_require__(306); function Element1(doc, tagId, ebmlId, start, length) { Element.call(this, doc, tagId, ebmlId, start, length); } __webpack_require__(12), __webpack_require__(20), util.inherits(Element1, Element), module.exports = Element1; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2), http = __webpack_require__(11), https = __webpack_require__(21), url = __webpack_require__(7), stream = __webpack_require__(3), debug = __webpack_require__(720)("needle"), stringify = __webpack_require__(724).build, multipart = __webpack_require__(725), auth = __webpack_require__(726), cookies = __webpack_require__(727), parsers = __webpack_require__(728), decoder = __webpack_require__(729), version = __webpack_require__(730).version, user_agent = "Needle/" + version; user_agent += " (Node.js " + process.version + "; " + process.platform + " " + process.arch + ")"; var close_by_default = !http.Agent || http.Agent.defaultMaxSockets != 1 / 0, extend = Object.assign ? Object.assign : __webpack_require__(0)._extend, redirect_codes = [ 301, 302, 303, 307 ], decompressors = {}; try { var zlib = __webpack_require__(43); decompressors["x-deflate"] = zlib.Inflate, decompressors.deflate = zlib.Inflate, decompressors["x-gzip"] = zlib.Gunzip, decompressors.gzip = zlib.Gunzip; var zlib_options = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH }; } catch (e) {} var defaults = { boundary: "--------------------NODENEEDLEHTTPCLIENT", encoding: "utf8", parse_response: "all", proxy: null, accept: "*/*", user_agent: user_agent, open_timeout: 1e4, response_timeout: 0, read_timeout: 0, follow_max: 0, stream_length: -1, decode_response: !0, parse_cookies: !0, follow_set_cookies: !1, follow_set_referer: !1, follow_keep_method: !1, follow_if_same_host: !1, follow_if_same_protocol: !1 }, aliased = { options: { decode: "decode_response", parse: "parse_response", timeout: "open_timeout", follow: "follow_max" }, inverted: {} }; function keys_by_type(type) { return Object.keys(defaults).map((function(el) { if (null !== defaults[el] && defaults[el].constructor == type) return el; })).filter((function(el) { return el; })); } function is_stream(obj) { return "function" == typeof obj.pipe; } function Needle(method, uri, data, options, callback) { if ("string" != typeof uri) throw new TypeError("URL must be a string, not " + uri); this.method = method, this.uri = uri, this.data = data, "function" == typeof options ? (this.callback = options, this.options = {}) : (this.callback = callback, this.options = options); } Object.keys(aliased.options).map((function(k) { var value = aliased.options[k]; aliased.inverted[value] = k; })), Needle.prototype.setup = function(uri, options) { function get_option(key, fallback) { return void 0 !== options[key] ? options[key] : void 0 !== options[aliased.inverted[key]] ? options[aliased.inverted[key]] : fallback; } function check_value(expected, key) { var value = get_option(key), type = typeof value; if ("undefined" != type && type != expected) throw new TypeError(type + " received for " + key + ", but expected a " + expected); return type == expected ? value : defaults[key]; } var config = { http_opts: { localAddress: get_option("localAddress", void 0) }, output: options.output, proxy: get_option("proxy", defaults.proxy), parser: get_option("parse_response", defaults.parse_response), encoding: options.encoding || (options.multipart ? "binary" : defaults.encoding) }; if (keys_by_type(Boolean).forEach((function(key) { config[key] = check_value("boolean", key); })), keys_by_type(Number).forEach((function(key) { config[key] = check_value("number", key); })), "agent pfx key passphrase cert ca ciphers rejectUnauthorized secureProtocol checkServerIdentity".split(" ").forEach((function(key) { void 0 !== options[key] && (config.http_opts[key] = options[key], void 0 === options.agent && (config.http_opts.agent = !1)); })), config.headers = { accept: options.accept || defaults.accept, "user-agent": options.user_agent || defaults.user_agent }, options.content_type && (config.headers["content-type"] = options.content_type), (options.connection || close_by_default) && (config.headers.connection = options.connection || "close"), (options.compressed || defaults.compressed) && void 0 !== zlib && (config.headers["accept-encoding"] = "gzip,deflate"), options.cookies && (config.headers.cookie = cookies.write(options.cookies)), uri.match(/[^\/]@/)) { var parts = (url.parse(uri).auth || "").split(":"); options.username = parts[0], options.password = parts[1]; } if (options.username && (!options.auth || "auto" != options.auth && "digest" != options.auth ? config.headers.authorization = auth.basic(options.username, options.password) : config.credentials = [ options.username, options.password ]), config.proxy) { if (-1 === config.proxy.indexOf("http") && (config.proxy = "http://" + config.proxy), -1 !== config.proxy.indexOf("@")) { var proxy = (url.parse(config.proxy).auth || "").split(":"); options.proxy_user = proxy[0], options.proxy_pass = proxy[1]; } options.proxy_user && (config.headers["proxy-authorization"] = auth.basic(options.proxy_user, options.proxy_pass)); } for (var h in options.headers) config.headers[h.toLowerCase()] = options.headers[h]; return config; }, Needle.prototype.start = function() { var out = new stream.PassThrough({ objectMode: !1 }), uri = this.uri, data = this.data, method = this.method, callback = "function" == typeof this.options ? this.options : this.callback, options = this.options || {}; -1 === uri.indexOf("http") && (uri = uri.replace(/^(\/\/)?/, "http://")); var body, self = this, waiting = !1, config = this.setup(uri, options), json = options.json || !1 !== options.json && "application/json" == config.headers["content-type"]; if (data) if (options.multipart) { var boundary = options.boundary || defaults.boundary; waiting = !0, multipart.build(data, boundary, (function(err, parts) { if (err) throw err; config.headers["content-type"] = "multipart/form-data; boundary=" + boundary, next(parts); })); } else if (is_stream(data)) { if ("GET" == method.toUpperCase()) throw new Error("Refusing to pipe() a stream via GET. Did you mean .post?"); config.stream_length > 0 || 0 === config.stream_length && data.path ? (waiting = !0, (function(stream, given_length, cb) { given_length > 0 ? cb(given_length) : void 0 !== stream.end && stream.end !== 1 / 0 && void 0 !== stream.start ? cb(stream.end + 1 - (stream.start || 0)) : fs.stat(stream.path, (function(err, stat) { cb(stat ? stat.size - (stream.start || 0) : null); })); })(data, config.stream_length, (function(length) { data.length = length, next(data); }))) : body = data; } else Buffer.isBuffer(data) ? body = data : "GET" != method.toUpperCase() || json ? (body = "string" == typeof data ? data : json ? JSON.stringify(data) : stringify(data), body = Buffer.from(body, config.encoding)) : uri = uri.replace(/\?.*|$/, "?" + stringify(data)); function next(body) { body && (body.length && (config.headers["content-length"] = body.length), config.headers["content-type"] || (config.headers["content-type"] = json ? "application/json; charset=utf-8" : "application/x-www-form-urlencoded")), !options.json || options.accept || (options.headers || {}).accept || (config.headers.accept = "application/json"), self.send_request(1, method, uri, config, body, out, callback); } return waiting || next(body), out; }, Needle.prototype.get_request_opts = function(method, uri, config) { var opts = config.http_opts, proxy = config.proxy, remote = proxy ? url.parse(proxy) : url.parse(uri); if (opts.protocol = remote.protocol, opts.host = remote.hostname, opts.port = remote.port || ("https:" == remote.protocol ? 443 : 80), opts.path = proxy ? uri : remote.pathname + (remote.search || ""), opts.method = method, opts.headers = config.headers, !opts.headers.host) { var target = proxy ? url.parse(uri) : remote; opts.headers.host = target.hostname, target.port && -1 === [ 80, 443 ].indexOf(target.port) && (opts.headers.host += ":" + target.port); } return opts; }, Needle.prototype.should_follow = function(location, config, original) { if (!location) return !1; function matches(property) { return property = original[property], -1 !== location.indexOf(property); } return !(location === original || config.follow_if_same_host && !matches("host") || config.follow_if_same_protocol && !matches("protocol")); }, Needle.prototype.send_request = function(count, method, uri, config, post_data, out, callback) { var timer, returned = 0, self = this, request_opts = this.get_request_opts(method, uri, config), protocol = "https:" == request_opts.protocol ? https : http; function done(err, resp) { return returned++ > 0 ? debug("Already finished, stopping here.") : (timer && clearTimeout(timer), request.removeListener("error", had_error), callback ? callback(err, resp, resp ? resp.body : void 0) : void out.emit("done", err)); } function had_error(err) { debug("Request error", err), out.emit("err", err), done(err || new Error("Unknown error when making request.")); } function set_timeout(type, milisecs) { timer && clearTimeout(timer), milisecs <= 0 || (timer = setTimeout((function() { out.emit("timeout", type), request.abort(), "read" == type && done(new Error(type + " timeout")); }), milisecs)); } function on_socket_end() { this.writable || !1 !== this.destroyed || (this.destroy(), had_error(new Error("Remote end closed socket abruptly."))); } debug("Making request #" + count, request_opts); var request = protocol.request(request_opts, (function(resp) { var headers = resp.headers; if (debug("Got response", resp.statusCode, headers), out.emit("response", resp), set_timeout("read", config.read_timeout), config.parse_cookies && (headers["set-cookie"] || config.stored_cookies) && (resp.cookies = extend(config.stored_cookies || {}, cookies.read(headers["set-cookie"])), debug("Got cookies", resp.cookies)), -1 !== redirect_codes.indexOf(resp.statusCode) && self.should_follow(headers.location, config, uri)) { if (clearTimeout(timer), count <= config.follow_max) return out.emit("redirect", headers.location), config.follow_keep_method || (method = "GET", post_data = null, delete config.headers["content-length"]), config.follow_set_cookies && resp.cookies && (config.stored_cookies = resp.cookies, config.headers.cookie = cookies.write(resp.cookies)), config.follow_set_referer && (config.headers.referer = encodeURI(uri)), config.headers.host = null, debug("Redirecting to " + url.resolve(uri, headers.location)), self.send_request(++count, method, url.resolve(uri, headers.location), config, post_data, out, callback); if (config.follow_max > 0) return done(new Error("Max redirects reached. Possible loop in: " + headers.location)); } if (401 == resp.statusCode && headers["www-authenticate"] && config.credentials && !config.headers.authorization) { var auth_header = auth.header(headers["www-authenticate"], config.credentials, request_opts); if (auth_header) return config.headers.authorization = auth_header, self.send_request(count, method, uri, config, post_data, out, callback); } out.emit("header", resp.statusCode, headers), out.emit("headers", headers); var pipeline = [], mime = (function(header) { if (!header || "" === header) return {}; var found, charset = "iso-8859-1", arr = header.split(";"); return arr.length > 1 && (found = arr[1].match(/charset=(.+)/)) && (charset = found[1]), { type: arr[0], charset: charset }; })(headers["content-type"]), text_response = mime.type && -1 != mime.type.indexOf("text/"); if (headers["content-encoding"] && decompressors[headers["content-encoding"]]) { var decompressor = decompressors[headers["content-encoding"]](zlib_options); decompressor.on("error", had_error), pipeline.push(decompressor); } if (config.parser && parsers[mime.type]) { var parser_name = config.parser.toString().toLowerCase(); -1 != [ "xml", "json" ].indexOf(parser_name) && parsers[mime.type].name != parser_name || (out.parser = parsers[mime.type].name, pipeline.push(parsers[mime.type].fn()), out._writableState.objectMode = !0, out._readableState.objectMode = !0); } else text_response && config.decode_response && mime.charset && !mime.charset.match(/utf-?8$/i) && pipeline.push(decoder(mime.charset)); pipeline.push(out); for (var tmp = resp; pipeline.length; ) tmp = tmp.pipe(pipeline.shift()); if (config.output && 200 == resp.statusCode) { var file = fs.createWriteStream(config.output); file.on("error", had_error), out.on("end", (function() { file.writable && file.end(); })), file.on("close", (function() { delete out.file; })), out.on("readable", (function() { for (var chunk; null !== (chunk = this.read()); ) file.writable && file.write(chunk), resp.body && resp.body.push(chunk); })), out.file = file; } if (callback) { resp.raw = [], resp.body = [], resp.bytes = 0; var clean_pipe = new stream.PassThrough; resp.pipe(clean_pipe), clean_pipe.on("readable", (function() { for (var chunk; null != (chunk = this.read()); ) resp.bytes += chunk.length, resp.raw.push(chunk); })), config.output && 200 == resp.statusCode || out.on("readable", (function() { for (var chunk; null !== (chunk = this.read()); ) "string" == typeof chunk && (chunk = Buffer.from(chunk)), resp.body.push(chunk); })); } out.on("end", (function() { resp.body && (resp.raw = Buffer.concat(resp.raw), void 0 === resp.body[0] || Buffer.isBuffer(resp.body[0]) ? (resp.body = Buffer.concat(resp.body), (text_response || out.parser) && (resp.body = resp.body.toString())) : (resp.body = resp.body[0], out.parser && (resp.parser = out.parser))), out.file ? out.file.on("close", (function() { done(null, resp, resp.body); })) : done(null, resp, resp.body); })); })); return set_timeout("open", config.open_timeout), request.on("error", had_error), request.once("abort", (function() { timer && clearTimeout(timer); })), request.once("socket", (function(socket) { socket.connecting ? socket.once("connect", (function() { set_timeout("response", config.response_timeout); })) : set_timeout("response", config.response_timeout), socket.on_socket_end || (socket.on_socket_end = on_socket_end, socket.once("end", (function() { process.nextTick(on_socket_end.bind(socket)); }))); })), post_data ? is_stream(post_data) ? post_data.pipe(request) : (request.write(post_data, config.encoding), request.end()) : request.end(), out.request = request, out; }, "undefined" != typeof Promise && (module.exports = function() { var verb, args = [].slice.call(arguments); return (verb = args[0].match(/\.|\//) ? args.length > 2 ? "post" : "get" : args.shift()).match(/get|head/) && 2 == args.length && args.splice(1, 0, null), new Promise((function(resolve, reject) { module.exports.request(verb, args[0], args[1], args[2], (function(err, resp) { return err ? reject(err) : resolve(resp); })); })); }), module.exports.version = version, module.exports.defaults = function(obj) { for (var key in obj) { var target_key = aliased.options[key] || key; if (!defaults.hasOwnProperty(target_key) || void 0 === obj[key]) throw new Error("Invalid property for defaults:" + target_key); if ("parse_response" != target_key && "proxy" != target_key) { var valid_type = defaults[target_key].constructor.name; if (obj[key].constructor.name != valid_type) throw new TypeError("Invalid type for " + key + ", should be " + valid_type); } defaults[target_key] = obj[key]; } return defaults; }, "head get".split(" ").forEach((function(method) { module.exports[method] = function(uri, options, callback) { return new Needle(method, uri, null, options, callback).start(); }; })), "post put patch delete".split(" ").forEach((function(method) { module.exports[method] = function(uri, data, options, callback) { return new Needle(method, uri, data, options, callback).start(); }; })), module.exports.request = function(method, uri, data, opts, callback) { return new Needle(method, uri, data, opts, callback).start(); }; }, function(module, exports, __webpack_require__) { "use strict"; const codes = {}; function createErrorType(code, message, Base) { Base || (Base = Error); class NodeError extends Base { constructor(arg1, arg2, arg3) { super((function(arg1, arg2, arg3) { return "string" == typeof message ? message : message(arg1, arg2, arg3); })(arg1, arg2, arg3)); } } NodeError.prototype.name = Base.name, NodeError.prototype.code = code, codes[code] = NodeError; } function oneOf(expected, thing) { if (Array.isArray(expected)) { const len = expected.length; return expected = expected.map((i => String(i))), len > 2 ? `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1] : 2 === len ? `one of ${thing} ${expected[0]} or ${expected[1]}` : `of ${thing} ${expected[0]}`; } return `of ${thing} ${String(expected)}`; } createErrorType("ERR_INVALID_OPT_VALUE", (function(name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"'; }), TypeError), createErrorType("ERR_INVALID_ARG_TYPE", (function(name, expected, actual) { let determiner; let msg; if ("string" == typeof expected && ("not ", "not " === expected.substr(0, "not ".length)) ? (determiner = "must not be", expected = expected.replace(/^not /, "")) : determiner = "must be", str = name, (void 0 === this_len || this_len > str.length) && (this_len = str.length), " argument" === str.substring(this_len - " argument".length, this_len)) msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`; else { const type = (function(str, search, start) { return "number" != typeof start && (start = 0), !(start + ".".length > str.length) && -1 !== str.indexOf(".", start); })(name) ? "property" : "argument"; msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`; } var str, this_len; return msg += ". Received type " + typeof actual, msg; }), TypeError), createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), createErrorType("ERR_METHOD_NOT_IMPLEMENTED", (function(name) { return "The " + name + " method is not implemented"; })), createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), createErrorType("ERR_STREAM_DESTROYED", (function(name) { return "Cannot call " + name + " after a stream was destroyed"; })), createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"), createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), createErrorType("ERR_UNKNOWN_ENCODING", (function(arg) { return "Unknown encoding: " + arg; }), TypeError), createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), module.exports.codes = codes; }, function(module, exports) { var isES5 = (function() { "use strict"; return void 0 === this; })(); if (isES5) module.exports = { freeze: Object.freeze, defineProperty: Object.defineProperty, getDescriptor: Object.getOwnPropertyDescriptor, keys: Object.keys, names: Object.getOwnPropertyNames, getPrototypeOf: Object.getPrototypeOf, isArray: Array.isArray, isES5: isES5, propertyIsWritable: function(obj, prop) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop); return !(descriptor && !descriptor.writable && !descriptor.set); } }; else { var has = {}.hasOwnProperty, str = {}.toString, proto = {}.constructor.prototype, ObjectKeys = function(o) { var ret = []; for (var key in o) has.call(o, key) && ret.push(key); return ret; }; module.exports = { isArray: function(obj) { try { return "[object Array]" === str.call(obj); } catch (e) { return !1; } }, keys: ObjectKeys, names: ObjectKeys, defineProperty: function(o, key, desc) { return o[key] = desc.value, o; }, getDescriptor: function(o, key) { return { value: o[key] }; }, freeze: function(obj) { return obj; }, getPrototypeOf: function(obj) { try { return Object(obj).constructor.prototype; } catch (e) { return proto; } }, isES5: isES5, propertyIsWritable: function() { return !0; } }; } }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(26).Buffer, contentDisposition = __webpack_require__(494), contentType = __webpack_require__(118), deprecate = __webpack_require__(51)("express"), flatten = __webpack_require__(159), mime = __webpack_require__(241).mime, etag = __webpack_require__(495), proxyaddr = __webpack_require__(497), qs = __webpack_require__(177), querystring = __webpack_require__(24); function createETagGenerator(options) { return function(body, encoding) { var buf = Buffer.isBuffer(body) ? body : Buffer.from(body, encoding); return etag(buf, options); }; } function parseExtendedQueryString(str) { return qs.parse(str, { allowPrototypes: !0 }); } function newObject() { return {}; } exports.etag = createETagGenerator({ weak: !1 }), exports.wetag = createETagGenerator({ weak: !0 }), exports.isAbsolute = function(path) { return "/" === path[0] || ":" === path[1] && ("\\" === path[2] || "/" === path[2]) || "\\\\" === path.substring(0, 2) || void 0; }, exports.flatten = deprecate.function(flatten, "utils.flatten: use array-flatten npm module instead"), exports.normalizeType = function(type) { return ~type.indexOf("/") ? (function(str, index) { for (var parts = str.split(/ *; */), ret = { value: parts[0], quality: 1, params: {}, originalIndex: void 0 }, i = 1; i < parts.length; ++i) { var pms = parts[i].split(/ *= */); "q" === pms[0] ? ret.quality = parseFloat(pms[1]) : ret.params[pms[0]] = pms[1]; } return ret; })(type) : { value: mime.lookup(type), params: {} }; }, exports.normalizeTypes = function(types) { for (var ret = [], i = 0; i < types.length; ++i) ret.push(exports.normalizeType(types[i])); return ret; }, exports.contentDisposition = deprecate.function(contentDisposition, "utils.contentDisposition: use content-disposition npm module instead"), exports.compileETag = function(val) { var fn; if ("function" == typeof val) return val; switch (val) { case !0: fn = exports.wetag; break; case !1: break; case "strong": fn = exports.etag; break; case "weak": fn = exports.wetag; break; default: throw new TypeError("unknown value for etag function: " + val); } return fn; }, exports.compileQueryParser = function(val) { var fn; if ("function" == typeof val) return val; switch (val) { case !0: fn = querystring.parse; break; case !1: fn = newObject; break; case "extended": fn = parseExtendedQueryString; break; case "simple": fn = querystring.parse; break; default: throw new TypeError("unknown value for query parser function: " + val); } return fn; }, exports.compileTrust = function(val) { return "function" == typeof val ? val : !0 === val ? function() { return !0; } : "number" == typeof val ? function(a, i) { return i < val; } : ("string" == typeof val && (val = val.split(/ *, */)), proxyaddr.compile(val || [])); }, exports.setCharset = function(type, charset) { if (!type || !charset) return type; var parsed = contentType.parse(type); return parsed.parameters.charset = charset, contentType.format(parsed); }; }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__, LZString = (function() { var f = String.fromCharCode, keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", baseReverseDic = {}; function getBaseValue(alphabet, character) { if (!baseReverseDic[alphabet]) { baseReverseDic[alphabet] = {}; for (var i = 0; i < alphabet.length; i++) baseReverseDic[alphabet][alphabet.charAt(i)] = i; } return baseReverseDic[alphabet][character]; } var LZString = { compressToBase64: function(input) { if (null == input) return ""; var res = LZString._compress(input, 6, (function(a) { return keyStrBase64.charAt(a); })); switch (res.length % 4) { default: case 0: return res; case 1: return res + "==="; case 2: return res + "=="; case 3: return res + "="; } }, decompressFromBase64: function(input) { return null == input ? "" : "" == input ? null : LZString._decompress(input.length, 32, (function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); })); }, compressToUTF16: function(input) { return null == input ? "" : LZString._compress(input, 15, (function(a) { return f(a + 32); })) + " "; }, decompressFromUTF16: function(compressed) { return null == compressed ? "" : "" == compressed ? null : LZString._decompress(compressed.length, 16384, (function(index) { return compressed.charCodeAt(index) - 32; })); }, compressToUint8Array: function(uncompressed) { for (var compressed = LZString.compress(uncompressed), buf = new Uint8Array(2 * compressed.length), i = 0, TotalLen = compressed.length; i < TotalLen; i++) { var current_value = compressed.charCodeAt(i); buf[2 * i] = current_value >>> 8, buf[2 * i + 1] = current_value % 256; } return buf; }, decompressFromUint8Array: function(compressed) { if (null == compressed) return LZString.decompress(compressed); for (var buf = new Array(compressed.length / 2), i = 0, TotalLen = buf.length; i < TotalLen; i++) buf[i] = 256 * compressed[2 * i] + compressed[2 * i + 1]; var result = []; return buf.forEach((function(c) { result.push(f(c)); })), LZString.decompress(result.join("")); }, compressToEncodedURIComponent: function(input) { return null == input ? "" : LZString._compress(input, 6, (function(a) { return keyStrUriSafe.charAt(a); })); }, decompressFromEncodedURIComponent: function(input) { return null == input ? "" : "" == input ? null : (input = input.replace(/ /g, "+"), LZString._decompress(input.length, 32, (function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); }))); }, compress: function(uncompressed) { return LZString._compress(uncompressed, 16, (function(a) { return f(a); })); }, _compress: function(uncompressed, bitsPerChar, getCharFromInt) { if (null == uncompressed) return ""; var i, value, ii, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0; for (ii = 0; ii < uncompressed.length; ii += 1) if (context_c = uncompressed.charAt(ii), Object.prototype.hasOwnProperty.call(context_dictionary, context_c) || (context_dictionary[context_c] = context_dictSize++, context_dictionaryToCreate[context_c] = !0), context_wc = context_w + context_c, Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) context_w = context_wc; else { if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) { if (context_w.charCodeAt(0) < 256) { for (i = 0; i < context_numBits; i++) context_data_val <<= 1, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++; for (value = context_w.charCodeAt(0), i = 0; i < 8; i++) context_data_val = context_data_val << 1 | 1 & value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value >>= 1; } else { for (value = 1, i = 0; i < context_numBits; i++) context_data_val = context_data_val << 1 | value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value = 0; for (value = context_w.charCodeAt(0), i = 0; i < 16; i++) context_data_val = context_data_val << 1 | 1 & value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value >>= 1; } 0 == --context_enlargeIn && (context_enlargeIn = Math.pow(2, context_numBits), context_numBits++), delete context_dictionaryToCreate[context_w]; } else for (value = context_dictionary[context_w], i = 0; i < context_numBits; i++) context_data_val = context_data_val << 1 | 1 & value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value >>= 1; 0 == --context_enlargeIn && (context_enlargeIn = Math.pow(2, context_numBits), context_numBits++), context_dictionary[context_wc] = context_dictSize++, context_w = String(context_c); } if ("" !== context_w) { if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) { if (context_w.charCodeAt(0) < 256) { for (i = 0; i < context_numBits; i++) context_data_val <<= 1, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++; for (value = context_w.charCodeAt(0), i = 0; i < 8; i++) context_data_val = context_data_val << 1 | 1 & value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value >>= 1; } else { for (value = 1, i = 0; i < context_numBits; i++) context_data_val = context_data_val << 1 | value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value = 0; for (value = context_w.charCodeAt(0), i = 0; i < 16; i++) context_data_val = context_data_val << 1 | 1 & value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value >>= 1; } 0 == --context_enlargeIn && (context_enlargeIn = Math.pow(2, context_numBits), context_numBits++), delete context_dictionaryToCreate[context_w]; } else for (value = context_dictionary[context_w], i = 0; i < context_numBits; i++) context_data_val = context_data_val << 1 | 1 & value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value >>= 1; 0 == --context_enlargeIn && (context_enlargeIn = Math.pow(2, context_numBits), context_numBits++); } for (value = 2, i = 0; i < context_numBits; i++) context_data_val = context_data_val << 1 | 1 & value, context_data_position == bitsPerChar - 1 ? (context_data_position = 0, context_data.push(getCharFromInt(context_data_val)), context_data_val = 0) : context_data_position++, value >>= 1; for (;;) { if (context_data_val <<= 1, context_data_position == bitsPerChar - 1) { context_data.push(getCharFromInt(context_data_val)); break; } context_data_position++; } return context_data.join(""); }, decompress: function(compressed) { return null == compressed ? "" : "" == compressed ? null : LZString._decompress(compressed.length, 32768, (function(index) { return compressed.charCodeAt(index); })); }, _decompress: function(length, resetValue, getNextValue) { var i, w, bits, resb, maxpower, power, c, dictionary = [], enlargeIn = 4, dictSize = 4, numBits = 3, entry = "", result = [], data = { val: getNextValue(0), position: resetValue, index: 1 }; for (i = 0; i < 3; i += 1) dictionary[i] = i; for (bits = 0, maxpower = Math.pow(2, 2), power = 1; power != maxpower; ) resb = data.val & data.position, data.position >>= 1, 0 == data.position && (data.position = resetValue, data.val = getNextValue(data.index++)), bits |= (resb > 0 ? 1 : 0) * power, power <<= 1; switch (bits) { case 0: for (bits = 0, maxpower = Math.pow(2, 8), power = 1; power != maxpower; ) resb = data.val & data.position, data.position >>= 1, 0 == data.position && (data.position = resetValue, data.val = getNextValue(data.index++)), bits |= (resb > 0 ? 1 : 0) * power, power <<= 1; c = f(bits); break; case 1: for (bits = 0, maxpower = Math.pow(2, 16), power = 1; power != maxpower; ) resb = data.val & data.position, data.position >>= 1, 0 == data.position && (data.position = resetValue, data.val = getNextValue(data.index++)), bits |= (resb > 0 ? 1 : 0) * power, power <<= 1; c = f(bits); break; case 2: return ""; } for (dictionary[3] = c, w = c, result.push(c); ;) { if (data.index > length) return ""; for (bits = 0, maxpower = Math.pow(2, numBits), power = 1; power != maxpower; ) resb = data.val & data.position, data.position >>= 1, 0 == data.position && (data.position = resetValue, data.val = getNextValue(data.index++)), bits |= (resb > 0 ? 1 : 0) * power, power <<= 1; switch (c = bits) { case 0: for (bits = 0, maxpower = Math.pow(2, 8), power = 1; power != maxpower; ) resb = data.val & data.position, data.position >>= 1, 0 == data.position && (data.position = resetValue, data.val = getNextValue(data.index++)), bits |= (resb > 0 ? 1 : 0) * power, power <<= 1; dictionary[dictSize++] = f(bits), c = dictSize - 1, enlargeIn--; break; case 1: for (bits = 0, maxpower = Math.pow(2, 16), power = 1; power != maxpower; ) resb = data.val & data.position, data.position >>= 1, 0 == data.position && (data.position = resetValue, data.val = getNextValue(data.index++)), bits |= (resb > 0 ? 1 : 0) * power, power <<= 1; dictionary[dictSize++] = f(bits), c = dictSize - 1, enlargeIn--; break; case 2: return result.join(""); } if (0 == enlargeIn && (enlargeIn = Math.pow(2, numBits), numBits++), dictionary[c]) entry = dictionary[c]; else { if (c !== dictSize) return null; entry = w + w.charAt(0); } result.push(entry), dictionary[dictSize++] = w + entry.charAt(0), w = entry, 0 == --enlargeIn && (enlargeIn = Math.pow(2, numBits), numBits++); } } }; return LZString; })(); void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return LZString; }.call(exports, __webpack_require__, exports, module)) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); }, function(module, exports, __webpack_require__) { "use strict"; var extensions, types, preference, db = __webpack_require__(602), extname = __webpack_require__(5).extname, EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/, TEXT_TYPE_REGEXP = /^text\//i; function charset(type) { if (!type || "string" != typeof type) return !1; var match = EXTRACT_TYPE_REGEXP.exec(type), mime = match && db[match[1].toLowerCase()]; return mime && mime.charset ? mime.charset : !(!match || !TEXT_TYPE_REGEXP.test(match[1])) && "UTF-8"; } exports.charset = charset, exports.charsets = { lookup: charset }, exports.contentType = function(str) { if (!str || "string" != typeof str) return !1; var mime = -1 === str.indexOf("/") ? exports.lookup(str) : str; if (!mime) return !1; if (-1 === mime.indexOf("charset")) { var charset = exports.charset(mime); charset && (mime += "; charset=" + charset.toLowerCase()); } return mime; }, exports.extension = function(type) { if (!type || "string" != typeof type) return !1; var match = EXTRACT_TYPE_REGEXP.exec(type), exts = match && exports.extensions[match[1].toLowerCase()]; return !(!exts || !exts.length) && exts[0]; }, exports.extensions = Object.create(null), exports.lookup = function(path) { if (!path || "string" != typeof path) return !1; var extension = extname("x." + path).toLowerCase().substr(1); return extension && exports.types[extension] || !1; }, exports.types = Object.create(null), extensions = exports.extensions, types = exports.types, preference = [ "nginx", "apache", void 0, "iana" ], Object.keys(db).forEach((function(type) { var mime = db[type], exts = mime.extensions; if (exts && exts.length) { extensions[type] = exts; for (var i = 0; i < exts.length; i++) { var extension = exts[i]; if (types[extension]) { var from = preference.indexOf(db[types[extension]].source), to = preference.indexOf(mime.source); if ("application/octet-stream" !== types[extension] && (from > to || from === to && "application/" === types[extension].substr(0, 12))) continue; } types[extension] = type; } } })); }, function(module, exports) { module.exports = require("dgram"); }, function(module, exports, __webpack_require__) { const vm = __webpack_require__(666); module.exports = function(str, regex, timeout) { let sandbox = { str: str, re: regex, result: null }; try { vm.runInContext("result = !!str.match(re);", vm.createContext(sandbox), { timeout: timeout }); } catch (e) { console.log("Warning: regex " + regex + ' was detected as evil when tested against "' + str + '", ignoring this regex pattern'); } return sandbox.result; }; }, function(module, exports, __webpack_require__) { var paths, common = module.exports, once = __webpack_require__(35), child = __webpack_require__(32), eos = __webpack_require__(180); common.servePlaylist = function(lines, res) { lines.push(""), lines = lines.join("\n"), res.setHeader("Content-Type", "application/vnd.apple.mpegurl"), res.setHeader("Content-Length", new Buffer(lines).length), res.statusCode = 200, res.write(lines), res.end(); }, common.toSecs = function(ms) { return (ms / 1e3).toFixed(3); }, common.handleErr = function(err, res) { res.setHeader("Cache-Control", "no-cache"), res.writeHead(err.httpCode || 500), res.end(err.message || (err.toString ? err.toString() : "internal server error")); }, common.pipeProcToResp = function(p, res, next) { var procExited = !1, stdoutClosed = !1; p.stdout.pipe(res, { end: !1 }), p.on("error", (function(err) { console.error("ffsplit/ffmpeg error", err); })), p.on("exit", (function(code) { procExited = !0, 0 !== code && (res.statusCode = 500), stdoutClosed && procExited && res.end(); })), eos(p.stdout, (function() { (stdoutClosed = !0) && procExited && res.end(), next(); })), eos(res, (function(err) { stdoutClosed || p.stdout.destroy(), setTimeout((function() { procExited || (console.log("process " + p.pid + " refuses to die"), p.kill("SIGKILL")); }), 1e4), next(); })); }, common.serveFfmpeg = function(args, type, res) { if (!paths.ffmpeg) return common.handleErr(new Error("no ffmpeg found"), res); convertQueue.push((function(cb) { var next = once(cb); process.env.FFMPEG_DEBUG && console.log(args.join(" ")), res.setHeader("Content-Type", type); var p = child.spawn(paths.ffmpeg, args); common.pipeProcToResp(p, res, next), process.env.FFMPEG_DEBUG && p.stderr.pipe(process.stderr); })); }, common.streamShouldTransmux = function(stream, supportsHevc) { var type = stream.codec_type, name = stream.codec_name.toLowerCase(); return "video" == type ? -1 != name.indexOf("h264") || supportsHevc && name.indexOf("hevc") : "audio" == type ? -1 != name.indexOf("aac") : void 0; }, common.estimateBitrate = function(w, h, fps) { return h * w * fps * .11 / 1024; }, common.hasFFsplit = function(p) { return !!paths.ffsplit; }, common.init = function(pathsParam, convertQueueParam) { paths = pathsParam, convertQueue = convertQueueParam; }; }, function(module, exports, __webpack_require__) { module.exports = { crc1: __webpack_require__(684), crc8: __webpack_require__(685), crc81wire: __webpack_require__(686), crc16: __webpack_require__(687), crc16ccitt: __webpack_require__(688), crc16modbus: __webpack_require__(689), crc24: __webpack_require__(690), crc32: __webpack_require__(691) }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), debug = __webpack_require__(44)("matroska:tools"), Schema = __webpack_require__(12), dateformat = __webpack_require__(307), CLASS_A_SIZE = Math.pow(2, 7), CLASS_B_SIZE = Math.pow(2, 14), CLASS_C_SIZE = Math.pow(2, 21), CLASS_D_SIZE = Math.pow(2, 28), CLASS_E_SIZE = Math.pow(2, 35), CLASS_F_SIZE = Math.pow(2, 42), CLASS_G_SIZE = Math.pow(2, 49), MAX_7BITS = (Math.pow(2, 56), Math.pow(2, 7)), MAX_8BITS = Math.pow(2, 8), MAX_15BITS = Math.pow(2, 15), MAX_16BITS = Math.pow(2, 16), MAX_23BITS = Math.pow(2, 23), MAX_24BITS = Math.pow(2, 24), MAX_31BITS = Math.pow(2, 31), MAX_32BITS = Math.pow(2, 32), MAX_39BITS = Math.pow(2, 39), MAX_40BITS = Math.pow(2, 40), MAX_47BITS = Math.pow(2, 47), MAX_48BITS = Math.pow(2, 48), MAX_53BITS = (Math.pow(2, 52), Math.pow(2, 53)), MAX_55BITS = Math.pow(2, 55), MAX_56BITS = Math.pow(2, 56), BITSn = [ 0, 256, Math.pow(2, 16), Math.pow(2, 24), Math.pow(2, 32), Math.pow(2, 40), Math.pow(2, 48), Math.pow(2, 56) ], BUFFS = [ new Buffer([ 0 ]), new Buffer([ 1 ]), new Buffer([ 2 ]), new Buffer([ 3 ]) ], BUFFSV = [ new Buffer([ 128 ]), new Buffer([ 129 ]) ], floatBuf = new Buffer(4), tools = { readVInt: function(buffer, start, ret, keepMask) { var bs = buffer[start = start || 0]; if (!bs) throw (error = new Error("INVALID VINT format (value=0)")).code = "INVALID", error; var length = 8; if (bs >= 128) length = 1; else if (bs >= 64) length = 2; else if (bs >= 32) length = 3; else if (bs >= 16) length = 4; else if (bs >= 8) length = 5; else if (bs >= 4) length = 6; else if (bs >= 2) length = 7; else { if (!(bs >= 1)) throw (error = new Error("INVALID VINT format (length>7 bs=" + bs + ")")).code = "INVALID", error; length = 8; } if (start + length > buffer.length) return debug.enabled && debug("No enough bytes for VINT format " + start + "+" + length + ">" + buffer.length), null; ret || (ret = {}), ret.length = length; var value = bs; for (keepMask || (value &= (1 << 8 - length) - 1), length--, start++; length; ) { var error, len = Math.min(length, 6), v = buffer.readUIntBE(start, len); if (value = value * BITSn[len] + v, 7 === length && value >= MAX_40BITS) throw (error = new Error("INVALID VINT value too big (length>7 bs=" + bs + ")")).code = "INVALID", error; length -= len, start += len; } return ret.value = value, ret; }, writeVInt: function(value, buffer, offset) { if (value < 0) throw new Error("Unrepresentable value: " + value); if (value < BUFFSV.length) return BUFFSV[value]; var length = this.sizeVInt(value); return buffer || (buffer = new Buffer(length), offset = 0), this.writeVIntBuffer(value, buffer, offset), 0 === offset && buffer.length === length ? buffer : buffer.slice(offset, length); }, writeVIntBuffer: function(value, buffer, offset) { if (value < 0) throw new Error("Unrepresentable value: " + value); if (offset < 0 || isNaN(offset)) throw new Error("Invalid offset " + offset); var length = this.sizeVInt(value); if (length > 1) for (var l = length - 1, off = offset + l + 1; l; ) { var len = Math.min(l, 6); off -= len, buffer.writeUIntBE(value, off, len, !0), value /= BITSn[len], l -= len; } return buffer[offset] = value | 1 << 8 - length, length; }, readHInt: function(buffer, start, ret) { return this.readVInt(buffer, start, ret, !0); }, sizeHInt: function(value) { if (value < 0) throw new Error("Unrepresentable value: " + value); return this.sizeVInt(value / 2); }, sizeVInt: function(value) { if (value < 0) throw new Error("Unrepresentable value: " + value); return value < CLASS_A_SIZE - 1 ? 1 : value < CLASS_B_SIZE - 1 ? 2 : value < CLASS_C_SIZE - 1 ? 3 : value < CLASS_D_SIZE - 1 ? 4 : value < CLASS_E_SIZE - 1 ? 5 : value < CLASS_F_SIZE - 1 ? 6 : value < CLASS_G_SIZE - 1 ? 7 : 8; }, sizeUInt: function(value) { if (value < 0) throw new Error("Unrepresentable value: " + value); return value < MAX_8BITS ? 1 : value < MAX_16BITS ? 2 : value < MAX_24BITS ? 3 : value < MAX_32BITS ? 4 : value < MAX_40BITS ? 5 : value < MAX_48BITS ? 6 : value < MAX_56BITS ? 7 : 8; }, sizeInt: function(value) { return value > -MAX_7BITS && value < MAX_7BITS ? 1 : value > -MAX_15BITS && value < MAX_15BITS ? 2 : value > -MAX_23BITS && value < MAX_23BITS ? 3 : value > -MAX_31BITS && value < MAX_31BITS ? 4 : value > -MAX_39BITS && value < MAX_39BITS ? 5 : value > -MAX_47BITS && value < MAX_47BITS ? 6 : value > -MAX_55BITS && value < MAX_55BITS ? 7 : 8; }, sizeFloat: function(value) { return floatBuf.writeFloatBE(value, 0), floatBuf.readFloatBE(0) !== value ? 8 : 4; }, writeInt: function(newValue) { var b, size = this.sizeInt(newValue); if (1 === size) return newValue >= 0 && newValue < BUFFS.length ? BUFFS[newValue] : ((b = new Buffer(1))[0] = newValue, b); if (size < 7) return (b = new Buffer(size)).writeIntBE(0, newValue, b.length), b; if (newValue > -MAX_53BITS && newValue < MAX_53BITS) return (b = new Buffer(7))[0] = newValue / MAX_48BITS, b.writeUIntBE(newValue, 1, 6, !0), b; throw new Error("Can not encode more than 52 bits"); }, writeUInt: function(newValue) { var b, size = this.sizeUInt(newValue); if (1 === size) return newValue < BUFFS.length ? BUFFS[newValue] : ((b = new Buffer(1))[0] = newValue, b); if (size < 7) { try { (b = new Buffer(size)).writeUIntBE(newValue, 0, b.length); } catch (x) { throw new Error("newValue=" + newValue + " len=" + b.length + " " + x); } return b; } if (newValue < MAX_53BITS) return (b = new Buffer(7))[0] = newValue / MAX_48BITS, b.writeUIntBE(newValue, 1, 6, !0), b; throw new Error("Can not encode more than 52 bits"); }, convertEbmlID: function(ebmlID) { if ("number" == typeof ebmlID) return ebmlID; if ("string" == typeof ebmlID) { var desc = Schema.byName[ebmlID]; if (!desc) throw new Error("Unknown ebmlID name '" + emblID + "'"); return desc; } throw new Error("Invalid ebmlID parameter '" + ebmlID + "'"); }, writeCRC: function(crc) { for (var data = new Buffer(4), i = 0; i < 4; i++) data[i] = crc, crc >>= 8; return data; }, writeEbmlID: function(ebmlID) { for (var data = new Buffer(8), i = data.length - 1; i >= 0; i--) if (data[i] = ebmlID, !(ebmlID >>= 8)) return data.slice(i); return data; }, readCRC: function(data) { for (var len = data.length, crc = 0, i = 0; i < len; i++) crc <<= 8 + data[i]; return crc; }, formatDate: function(date) { return dateformat(date, "yyyy-mm-dd HH:MM:ss.l"); }, formatDay: function(date) { return dateformat(date, "yyyy-mm-dd"); }, formatYear: function(date) { return dateformat(date, "yyyy"); }, validType: function(type, value) { switch (type) { case "8": case "s": if ("string" == typeof value || null == value) return value; break; case "u": case "i": case "u": case "i": case "f": if ("number" == typeof value || void 0 === value) return value; break; case "d": if (util.isDate(value) || null == value) return value; break; case "b": if (Buffer.isBuffer(value) || null == value) return value; } throw new Error("Invalid value '" + value + "' for type '" + type + "'"); } }; module.exports = tools; }, function(module, exports, __webpack_require__) { module.exports = Duplex; var objectKeys = Object.keys || function(obj) { var keys = []; for (var key in obj) keys.push(key); return keys; }, util = __webpack_require__(33); util.inherits = __webpack_require__(8); var Readable = __webpack_require__(417), Writable = __webpack_require__(418); function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options), Writable.call(this, options), options && !1 === options.readable && (this.readable = !1), options && !1 === options.writable && (this.writable = !1), this.allowHalfOpen = !0, options && !1 === options.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", onend); } function onend() { this.allowHalfOpen || this._writableState.ended || process.nextTick(this.end.bind(this)); } util.inherits(Duplex, Readable), (function(xs, f) { for (var i = 0, l = xs.length; i < l; i++) method = xs[i], Duplex.prototype[method] || (Duplex.prototype[method] = Writable.prototype[method]); var method; })(objectKeys(Writable.prototype)); }, function(module, exports, __webpack_require__) { "use strict"; var pna = __webpack_require__(58), objectKeys = Object.keys || function(obj) { var keys = []; for (var key in obj) keys.push(key); return keys; }; module.exports = Duplex; var util = Object.create(__webpack_require__(33)); util.inherits = __webpack_require__(106); var Readable = __webpack_require__(425), Writable = __webpack_require__(429); util.inherits(Duplex, Readable); for (var keys = objectKeys(Writable.prototype), v = 0; v < keys.length; v++) { var method = keys[v]; Duplex.prototype[method] || (Duplex.prototype[method] = Writable.prototype[method]); } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options), Writable.call(this, options), options && !1 === options.readable && (this.readable = !1), options && !1 === options.writable && (this.writable = !1), this.allowHalfOpen = !0, options && !1 === options.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", onend); } function onend() { this.allowHalfOpen || this._writableState.ended || pna.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { enumerable: !1, get: function() { return this._writableState.highWaterMark; } }), Object.defineProperty(Duplex.prototype, "destroyed", { get: function() { return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed; }, set: function(value) { void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = value, this._writableState.destroyed = value); } }), Duplex.prototype._destroy = function(err, cb) { this.push(null), this.end(), pna.nextTick(cb, err); }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), debug = __webpack_require__(46)("matroska:tools"), Schema = __webpack_require__(13), dateformat = __webpack_require__(307), CLASS_A_SIZE = Math.pow(2, 7), CLASS_B_SIZE = Math.pow(2, 14), CLASS_C_SIZE = Math.pow(2, 21), CLASS_D_SIZE = Math.pow(2, 28), CLASS_E_SIZE = Math.pow(2, 35), CLASS_F_SIZE = Math.pow(2, 42), CLASS_G_SIZE = Math.pow(2, 49), MAX_7BITS = (Math.pow(2, 56), Math.pow(2, 7)), MAX_8BITS = Math.pow(2, 8), MAX_15BITS = Math.pow(2, 15), MAX_16BITS = Math.pow(2, 16), MAX_23BITS = Math.pow(2, 23), MAX_24BITS = Math.pow(2, 24), MAX_31BITS = Math.pow(2, 31), MAX_32BITS = Math.pow(2, 32), MAX_39BITS = Math.pow(2, 39), MAX_40BITS = Math.pow(2, 40), MAX_47BITS = Math.pow(2, 47), MAX_48BITS = Math.pow(2, 48), MAX_53BITS = (Math.pow(2, 52), Math.pow(2, 53)), MAX_55BITS = Math.pow(2, 55), MAX_56BITS = Math.pow(2, 56), BITSn = [ 0, 256, Math.pow(2, 16), Math.pow(2, 24), Math.pow(2, 32), Math.pow(2, 40), Math.pow(2, 48), Math.pow(2, 56) ], BUFFS = [ new Buffer([ 0 ]), new Buffer([ 1 ]), new Buffer([ 2 ]), new Buffer([ 3 ]) ], BUFFSV = [ new Buffer([ 128 ]), new Buffer([ 129 ]) ], floatBuf = new Buffer(4), tools = { readVInt: function(buffer, start, ret, keepMask) { var bs = buffer[start = start || 0]; if (!bs) throw (error = new Error("INVALID VINT format (value=0)")).code = "INVALID", error; var length = 8; if (bs >= 128) length = 1; else if (bs >= 64) length = 2; else if (bs >= 32) length = 3; else if (bs >= 16) length = 4; else if (bs >= 8) length = 5; else if (bs >= 4) length = 6; else if (bs >= 2) length = 7; else { if (!(bs >= 1)) throw (error = new Error("INVALID VINT format (length>7 bs=" + bs + ")")).code = "INVALID", error; length = 8; } if (start + length > buffer.length) return debug.enabled && debug("No enough bytes for VINT format " + start + "+" + length + ">" + buffer.length), null; ret || (ret = {}), ret.length = length; var value = bs; for (keepMask || (value &= (1 << 8 - length) - 1), length--, start++; length; ) { var error, len = Math.min(length, 6), v = buffer.readUIntBE(start, len); if (value = value * BITSn[len] + v, 7 === length && value >= MAX_40BITS) throw (error = new Error("INVALID VINT value too big (length>7 bs=" + bs + ")")).code = "INVALID", error; length -= len, start += len; } return ret.value = value, ret; }, writeVInt: function(value, buffer, offset) { if (value < 0) throw new Error("Unrepresentable value: " + value); if (value < BUFFSV.length) return BUFFSV[value]; var length = this.sizeVInt(value); return buffer || (buffer = new Buffer(length), offset = 0), this.writeVIntBuffer(value, buffer, offset), 0 === offset && buffer.length === length ? buffer : buffer.slice(offset, length); }, writeVIntBuffer: function(value, buffer, offset) { if (value < 0) throw new Error("Unrepresentable value: " + value); if (offset < 0 || isNaN(offset)) throw new Error("Invalid offset " + offset); var length = this.sizeVInt(value); if (length > 1) for (var l = length - 1, off = offset + l + 1; l; ) { var len = Math.min(l, 6); off -= len, buffer.writeUIntBE(value, off, len, !0), value /= BITSn[len], l -= len; } return buffer[offset] = value | 1 << 8 - length, length; }, readHInt: function(buffer, start, ret) { return this.readVInt(buffer, start, ret, !0); }, sizeHInt: function(value) { if (value < 0) throw new Error("Unrepresentable value: " + value); return this.sizeVInt(value / 2); }, sizeVInt: function(value) { if (value < 0) throw new Error("Unrepresentable value: " + value); return value < CLASS_A_SIZE - 1 ? 1 : value < CLASS_B_SIZE - 1 ? 2 : value < CLASS_C_SIZE - 1 ? 3 : value < CLASS_D_SIZE - 1 ? 4 : value < CLASS_E_SIZE - 1 ? 5 : value < CLASS_F_SIZE - 1 ? 6 : value < CLASS_G_SIZE - 1 ? 7 : 8; }, sizeUInt: function(value) { if (value < 0) throw new Error("Unrepresentable value: " + value); return value < MAX_8BITS ? 1 : value < MAX_16BITS ? 2 : value < MAX_24BITS ? 3 : value < MAX_32BITS ? 4 : value < MAX_40BITS ? 5 : value < MAX_48BITS ? 6 : value < MAX_56BITS ? 7 : 8; }, sizeInt: function(value) { return value > -MAX_7BITS && value < MAX_7BITS ? 1 : value > -MAX_15BITS && value < MAX_15BITS ? 2 : value > -MAX_23BITS && value < MAX_23BITS ? 3 : value > -MAX_31BITS && value < MAX_31BITS ? 4 : value > -MAX_39BITS && value < MAX_39BITS ? 5 : value > -MAX_47BITS && value < MAX_47BITS ? 6 : value > -MAX_55BITS && value < MAX_55BITS ? 7 : 8; }, sizeFloat: function(value) { return floatBuf.writeFloatBE(value, 0), floatBuf.readFloatBE(0) !== value ? 8 : 4; }, writeInt: function(newValue) { var b, size = this.sizeInt(newValue); if (1 === size) return newValue >= 0 && newValue < BUFFS.length ? BUFFS[newValue] : ((b = new Buffer(1))[0] = newValue, b); if (size < 7) return (b = new Buffer(size)).writeIntBE(0, newValue, b.length), b; if (newValue > -MAX_53BITS && newValue < MAX_53BITS) return (b = new Buffer(7))[0] = newValue / MAX_48BITS, b.writeUIntBE(newValue, 1, 6, !0), b; throw new Error("Can not encode more than 52 bits"); }, writeUInt: function(newValue) { var b, size = this.sizeUInt(newValue); if (1 === size) return newValue < BUFFS.length ? BUFFS[newValue] : ((b = new Buffer(1))[0] = newValue, b); if (size < 7) { try { (b = new Buffer(size)).writeUIntBE(newValue, 0, b.length); } catch (x) { throw new Error("newValue=" + newValue + " len=" + b.length + " " + x); } return b; } if (newValue < MAX_53BITS) return (b = new Buffer(7))[0] = newValue / MAX_48BITS, b.writeUIntBE(newValue, 1, 6, !0), b; throw new Error("Can not encode more than 52 bits"); }, convertEbmlID: function(ebmlID) { if ("number" == typeof ebmlID) return ebmlID; if ("string" == typeof ebmlID) { var desc = Schema.byName[ebmlID]; if (!desc) throw new Error("Unknown ebmlID name '" + emblID + "'"); return desc; } throw new Error("Invalid ebmlID parameter '" + ebmlID + "'"); }, writeCRC: function(crc) { for (var data = new Buffer(4), i = 0; i < 4; i++) data[i] = crc, crc >>= 8; return data; }, writeEbmlID: function(ebmlID) { for (var data = new Buffer(8), i = data.length - 1; i >= 0; i--) if (data[i] = ebmlID, !(ebmlID >>= 8)) return data.slice(i); return data; }, readCRC: function(data) { for (var len = data.length, crc = 0, i = 0; i < len; i++) crc <<= 8 + data[i]; return crc; }, formatDate: function(date) { return dateformat(date, "yyyy-mm-dd HH:MM:ss.l"); }, formatDay: function(date) { return dateformat(date, "yyyy-mm-dd"); }, formatYear: function(date) { return dateformat(date, "yyyy"); }, validType: function(type, value) { switch (type) { case "8": case "s": if ("string" == typeof value || null == value) return value; break; case "u": case "i": case "u": case "i": case "f": if ("number" == typeof value || void 0 === value) return value; break; case "d": if (util.isDate(value) || null == value) return value; break; case "b": if (Buffer.isBuffer(value) || null == value) return value; } throw new Error("Invalid value '" + value + "' for type '" + type + "'"); } }; module.exports = tools; }, function(module, exports, __webpack_require__) { "use strict"; var objectKeys = Object.keys || function(obj) { var keys = []; for (var key in obj) keys.push(key); return keys; }; module.exports = Duplex; var Readable = __webpack_require__(458), Writable = __webpack_require__(462); __webpack_require__(8)(Duplex, Readable); for (var keys = objectKeys(Writable.prototype), v = 0; v < keys.length; v++) { var method = keys[v]; Duplex.prototype[method] || (Duplex.prototype[method] = Writable.prototype[method]); } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options), Writable.call(this, options), this.allowHalfOpen = !0, options && (!1 === options.readable && (this.readable = !1), !1 === options.writable && (this.writable = !1), !1 === options.allowHalfOpen && (this.allowHalfOpen = !1, this.once("end", onend))); } function onend() { this._writableState.ended || process.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { enumerable: !1, get: function() { return this._writableState.highWaterMark; } }), Object.defineProperty(Duplex.prototype, "writableBuffer", { enumerable: !1, get: function() { return this._writableState && this._writableState.getBuffer(); } }), Object.defineProperty(Duplex.prototype, "writableLength", { enumerable: !1, get: function() { return this._writableState.length; } }), Object.defineProperty(Duplex.prototype, "destroyed", { enumerable: !1, get: function() { return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed; }, set: function(value) { void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = value, this._writableState.destroyed = value); } }); }, function(module, exports, __webpack_require__) { var Stream = __webpack_require__(3); "disable" === process.env.READABLE_STREAM && Stream ? (module.exports = Stream, (exports = module.exports = Stream.Readable).Readable = Stream.Readable, exports.Writable = Stream.Writable, exports.Duplex = Stream.Duplex, exports.Transform = Stream.Transform, exports.PassThrough = Stream.PassThrough, exports.Stream = Stream) : ((exports = module.exports = __webpack_require__(485)).Stream = Stream || exports, exports.Readable = exports, exports.Writable = __webpack_require__(488), exports.Duplex = __webpack_require__(89), exports.Transform = __webpack_require__(489), exports.PassThrough = __webpack_require__(1020)); }, function(module, exports, __webpack_require__) { "use strict"; var pna = __webpack_require__(58), objectKeys = Object.keys || function(obj) { var keys = []; for (var key in obj) keys.push(key); return keys; }; module.exports = Duplex; var util = __webpack_require__(33); util.inherits = __webpack_require__(8); var Readable = __webpack_require__(485), Writable = __webpack_require__(488); util.inherits(Duplex, Readable); for (var keys = objectKeys(Writable.prototype), v = 0; v < keys.length; v++) { var method = keys[v]; Duplex.prototype[method] || (Duplex.prototype[method] = Writable.prototype[method]); } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options), Writable.call(this, options), options && !1 === options.readable && (this.readable = !1), options && !1 === options.writable && (this.writable = !1), this.allowHalfOpen = !0, options && !1 === options.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", onend); } function onend() { this.allowHalfOpen || this._writableState.ended || pna.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { enumerable: !1, get: function() { return this._writableState.highWaterMark; } }), Object.defineProperty(Duplex.prototype, "destroyed", { get: function() { return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed; }, set: function(value) { void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = value, this._writableState.destroyed = value); } }), Duplex.prototype._destroy = function(err, cb) { this.push(null), this.end(), pna.nextTick(cb, err); }; }, function(module, exports) { module.exports = { PREFIX_BT: "bt:", PREFIX_LOCAL: "local:", PREFIX_IMDB: "tt", STREAM_LOCALFILE_SUBTITLE: "ADDON_STREAM_LOCALFILE", CINEMETA_URL: "https://v3-cinemeta.strem.io", METAHUB_URL: "https://images.metahub.space", METAHUB_EPISODES_URL: "https://episodes.metahub.space", INTERESTING_FILE: /.mkv$|.avi$|.mp4$|.wmv$|.vp8$|.mov$|.mpg$|.mp3$|.flac$/i, INTERESTING_TYPE: [ "movie", "series" ], MAX_INDEXED: 1e4 }; }, function(module, exports, __webpack_require__) { "use strict"; function checkDataType(dataType, data, negate) { var EQUAL = negate ? " !== " : " === ", AND = negate ? " || " : " && ", OK = negate ? "!" : "", NOT = negate ? "" : "!"; switch (dataType) { case "null": return data + EQUAL + "null"; case "array": return OK + "Array.isArray(" + data + ")"; case "object": return "(" + OK + data + AND + "typeof " + data + EQUAL + '"object"' + AND + NOT + "Array.isArray(" + data + "))"; case "integer": return "(typeof " + data + EQUAL + '"number"' + AND + NOT + "(" + data + " % 1)" + AND + data + EQUAL + data + ")"; default: return "typeof " + data + EQUAL + '"' + dataType + '"'; } } module.exports = { copy: function(o, to) { for (var key in to = to || {}, o) to[key] = o[key]; return to; }, checkDataType: checkDataType, checkDataTypes: function(dataTypes, data) { if (1 === dataTypes.length) return checkDataType(dataTypes[0], data, !0); var code = "", types = toHash(dataTypes); for (var t in types.array && types.object && (code = types.null ? "(" : "(!" + data + " || ", code += "typeof " + data + ' !== "object")', delete types.null, delete types.array, delete types.object), types.number && delete types.integer, types) code += (code ? " && " : "") + checkDataType(t, data, !0); return code; }, coerceToTypes: function(optionCoerceTypes, dataTypes) { if (Array.isArray(dataTypes)) { for (var types = [], i = 0; i < dataTypes.length; i++) { var t = dataTypes[i]; (COERCE_TO_TYPES[t] || "array" === optionCoerceTypes && "array" === t) && (types[types.length] = t); } if (types.length) return types; } else { if (COERCE_TO_TYPES[dataTypes]) return [ dataTypes ]; if ("array" === optionCoerceTypes && "array" === dataTypes) return [ "array" ]; } }, toHash: toHash, getProperty: getProperty, escapeQuotes: escapeQuotes, equal: __webpack_require__(269), ucs2length: __webpack_require__(1170), varOccurences: function(str, dataVar) { dataVar += "[^0-9]"; var matches = str.match(new RegExp(dataVar, "g")); return matches ? matches.length : 0; }, varReplace: function(str, dataVar, expr) { return dataVar += "([^0-9])", expr = expr.replace(/\$/g, "$$$$"), str.replace(new RegExp(dataVar, "g"), expr + "$1"); }, cleanUpCode: function(out) { return out.replace(EMPTY_ELSE, "").replace(EMPTY_IF_NO_ELSE, "").replace(EMPTY_IF_WITH_ELSE, "if (!($1))"); }, finalCleanUpCode: function(out, async) { var matches = out.match(ERRORS_REGEXP); return matches && 2 == matches.length && (out = async ? out.replace(REMOVE_ERRORS_ASYNC, "").replace(RETURN_ASYNC, "return data;") : out.replace(REMOVE_ERRORS, "").replace("return errors === 0;", "validate.errors = null; return true;")), (matches = out.match(ROOTDATA_REGEXP)) && 3 === matches.length ? out.replace(REMOVE_ROOTDATA, "") : out; }, schemaHasRules: function(schema, rules) { if ("boolean" == typeof schema) return !schema; for (var key in schema) if (rules[key]) return !0; }, schemaHasRulesExcept: function(schema, rules, exceptKeyword) { if ("boolean" == typeof schema) return !schema && "not" != exceptKeyword; for (var key in schema) if (key != exceptKeyword && rules[key]) return !0; }, schemaUnknownRules: function(schema, rules) { if ("boolean" != typeof schema) for (var key in schema) if (!rules[key]) return key; }, toQuotedString: toQuotedString, getPathExpr: function(currentPath, expr, jsonPointers, isNumber) { return joinPaths(currentPath, jsonPointers ? "'/' + " + expr + (isNumber ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"); }, getPath: function(currentPath, prop, jsonPointers) { return joinPaths(currentPath, toQuotedString(jsonPointers ? "/" + escapeJsonPointer(prop) : getProperty(prop))); }, getData: function($data, lvl, paths) { var up, jsonPointer, data, matches; if ("" === $data) return "rootData"; if ("/" == $data[0]) { if (!JSON_POINTER.test($data)) throw new Error("Invalid JSON-pointer: " + $data); jsonPointer = $data, data = "rootData"; } else { if (!(matches = $data.match(RELATIVE_JSON_POINTER))) throw new Error("Invalid JSON-pointer: " + $data); if (up = +matches[1], "#" == (jsonPointer = matches[2])) { if (up >= lvl) throw new Error("Cannot access property/index " + up + " levels up, current level is " + lvl); return paths[lvl - up]; } if (up > lvl) throw new Error("Cannot access data " + up + " levels up, current level is " + lvl); if (data = "data" + (lvl - up || ""), !jsonPointer) return data; } for (var expr = data, segments = jsonPointer.split("/"), i = 0; i < segments.length; i++) { var segment = segments[i]; segment && (expr += " && " + (data += getProperty(unescapeJsonPointer(segment)))); } return expr; }, unescapeFragment: function(str) { return unescapeJsonPointer(decodeURIComponent(str)); }, unescapeJsonPointer: unescapeJsonPointer, escapeFragment: function(str) { return encodeURIComponent(escapeJsonPointer(str)); }, escapeJsonPointer: escapeJsonPointer }; var COERCE_TO_TYPES = toHash([ "string", "number", "integer", "boolean", "null" ]); function toHash(arr) { for (var hash = {}, i = 0; i < arr.length; i++) hash[arr[i]] = !0; return hash; } var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i, SINGLE_QUOTE = /'|\\/g; function getProperty(key) { return "number" == typeof key ? "[" + key + "]" : IDENTIFIER.test(key) ? "." + key : "['" + escapeQuotes(key) + "']"; } function escapeQuotes(str) { return str.replace(SINGLE_QUOTE, "\\$&").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\f/g, "\\f").replace(/\t/g, "\\t"); } var EMPTY_ELSE = /else\s*{\s*}/g, EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g, EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g, ERRORS_REGEXP = /[^v.]errors/g, REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g, REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g, RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/, ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g, REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/; function toQuotedString(str) { return "'" + escapeQuotes(str) + "'"; } var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/, RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; function joinPaths(a, b) { return '""' == a ? b : (a + " + " + b).replace(/' \+ '/g, ""); } function escapeJsonPointer(str) { return str.replace(/~/g, "~0").replace(/\//g, "~1"); } function unescapeJsonPointer(str) { return str.replace(/~1/g, "/").replace(/~0/g, "~"); } }, function(module, exports) { var isES5 = (function() { "use strict"; return void 0 === this; })(); if (isES5) module.exports = { freeze: Object.freeze, defineProperty: Object.defineProperty, getDescriptor: Object.getOwnPropertyDescriptor, keys: Object.keys, names: Object.getOwnPropertyNames, getPrototypeOf: Object.getPrototypeOf, isArray: Array.isArray, isES5: isES5, propertyIsWritable: function(obj, prop) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop); return !(descriptor && !descriptor.writable && !descriptor.set); } }; else { var has = {}.hasOwnProperty, str = {}.toString, proto = {}.constructor.prototype, ObjectKeys = function(o) { var ret = []; for (var key in o) has.call(o, key) && ret.push(key); return ret; }; module.exports = { isArray: function(obj) { try { return "[object Array]" === str.call(obj); } catch (e) { return !1; } }, keys: ObjectKeys, names: ObjectKeys, defineProperty: function(o, key, desc) { return o[key] = desc.value, o; }, getDescriptor: function(o, key) { return { value: o[key] }; }, freeze: function(obj) { return obj; }, getPrototypeOf: function(obj) { try { return Object(obj).constructor.prototype; } catch (e) { return proto; } }, isES5: isES5, propertyIsWritable: function() { return !0; } }; } }, function(module, exports, __webpack_require__) { module.exports = Reader; var fs = __webpack_require__(65), Stream = __webpack_require__(3).Stream, inherits = __webpack_require__(8), path = __webpack_require__(5), getType = __webpack_require__(168), hardLinks = Reader.hardLinks = {}, Abstract = __webpack_require__(273); inherits(Reader, Abstract); var LinkReader = __webpack_require__(552); function Reader(props, currentStat) { var type, ClassType; if (!(this instanceof Reader)) return new Reader(props, currentStat); switch ("string" == typeof props && (props = { path: props }), props.type && "function" == typeof props.type ? ClassType = type = props.type : (type = getType(props), ClassType = Reader), currentStat && !type && (props[type = getType(currentStat)] = !0, props.type = type), type) { case "Directory": ClassType = __webpack_require__(553); break; case "Link": case "File": ClassType = __webpack_require__(554); break; case "SymbolicLink": ClassType = LinkReader; break; case "Socket": ClassType = __webpack_require__(1279); break; case null: ClassType = __webpack_require__(555); } if (!(this instanceof ClassType)) return new ClassType(props); Abstract.call(this), props.path || this.error("Must provide a path", null, !0), this.readable = !0, this.writable = !1, this.type = type, this.props = props, this.depth = props.depth = props.depth || 0, this.parent = props.parent || null, this.root = props.root || props.parent && props.parent.root || this, this._path = this.path = path.resolve(props.path), "win32" === process.platform && (this.path = this._path = this.path.replace(/\?/g, "_"), this._path.length >= 260 && (this._swallowErrors = !0, this._path = "\\\\?\\" + this.path.replace(/\//g, "\\"))), this.basename = props.basename = path.basename(this.path), this.dirname = props.dirname = path.dirname(this.path), props.parent = props.root = null, this.size = props.size, this.filter = "function" == typeof props.filter ? props.filter : null, "alpha" === props.sort && (props.sort = alphasort), this._stat(currentStat); } function alphasort(a, b) { return a === b ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : a.toLowerCase() < b.toLowerCase() ? -1 : a > b ? 1 : -1; } Reader.prototype._stat = function(currentStat) { var self = this, props = self.props, stat = props.follow ? "stat" : "lstat"; function statCb(er, props_) { if (er) return self.error(er); if (Object.keys(props_).forEach((function(k) { props[k] = props_[k]; })), void 0 !== self.size && props.size !== self.size) return self.error("incorrect size"); self.size = props.size; var type = getType(props); if (!1 !== props.hardlinks && "Directory" !== type && props.nlink && props.nlink > 1) { var k = props.dev + ":" + props.ino; hardLinks[k] !== self._path && hardLinks[k] ? (type = self.type = self.props.type = "Link", self.Link = self.props.Link = !0, self.linkpath = self.props.linkpath = hardLinks[k], self._stat = self._read = LinkReader.prototype._read) : hardLinks[k] = self._path; } if (self.type && self.type !== type && self.error("Unexpected type: " + type), self.filter) { var who = self._proxy || self; if (!self.filter.call(who, who, props)) return void (self._disowned || (self.abort(), self.emit("end"), self.emit("close"))); } var events = [ "_stat", "stat", "ready" ], e = 0; !(function go() { if (self._aborted) return self.emit("end"), void self.emit("close"); if (self._paused && "Directory" !== self.type) self.once("resume", go); else { var ev = events[e++]; if (!ev) return self._read(); self.emit(ev, props), go(); } })(); } currentStat ? process.nextTick(statCb.bind(null, null, currentStat)) : fs[stat](self._path, statCb); }, Reader.prototype.pipe = function(dest) { var self = this; return "function" == typeof dest.add && self.on("entry", (function(entry) { !1 === dest.add(entry) && self.pause(); })), Stream.prototype.pipe.apply(this, arguments); }, Reader.prototype.pause = function(who) { this._paused = !0, who = who || this, this.emit("pause", who), this._stream && this._stream.pause(who); }, Reader.prototype.resume = function(who) { this._paused = !1, who = who || this, this.emit("resume", who), this._stream && this._stream.resume(who), this._read(); }, Reader.prototype._read = function() { this.error("Cannot read unknown type: " + this.type); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(url) { return String(url).replace(UNMATCHED_SURROGATE_PAIR_REGEXP, "$1�$2").replace(ENCODE_CHARS_REGEXP, encodeURI); }; var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g, UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g; }, function(module, exports, __webpack_require__) { "use strict"; var matchHtmlRegExp = /["'&<>]/; module.exports = function(string) { var escape, str = "" + string, match = matchHtmlRegExp.exec(str); if (!match) return str; var html = "", index = 0, lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: escape = """; break; case 38: escape = "&"; break; case 39: escape = "'"; break; case 60: escape = "<"; break; case 62: escape = ">"; break; default: continue; } lastIndex !== index && (html += str.substring(lastIndex, index)), lastIndex = index + 1, html += escape; } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(msg, listener) { return !1 !== isFinished(msg) ? (defer(listener, null, msg), msg) : ((function(msg, listener) { var attached = msg.__onFinished; attached && attached.queue || (attached = msg.__onFinished = (function(msg) { function listener(err) { if (msg.__onFinished === listener && (msg.__onFinished = null), listener.queue) { var queue = listener.queue; listener.queue = null; for (var i = 0; i < queue.length; i++) queue[i](err, msg); } } return listener.queue = [], listener; })(msg), (function(msg, callback) { var eeMsg, eeSocket, finished = !1; function onFinish(error) { eeMsg.cancel(), eeSocket.cancel(), finished = !0, callback(error); } function onSocket(socket) { msg.removeListener("socket", onSocket), finished || eeMsg === eeSocket && (eeSocket = first([ [ socket, "error", "close" ] ], onFinish)); } eeMsg = eeSocket = first([ [ msg, "end", "finish" ] ], onFinish), msg.socket ? onSocket(msg.socket) : (msg.on("socket", onSocket), void 0 === msg.socket && (function(res, callback) { var assignSocket = res.assignSocket; "function" == typeof assignSocket && (res.assignSocket = function(socket) { assignSocket.call(this, socket), callback(socket); }); })(msg, onSocket)); })(msg, attached)), attached.queue.push(listener); })(msg, listener), msg); }, module.exports.isFinished = isFinished; var first = __webpack_require__(591), defer = "function" == typeof setImmediate ? setImmediate : function(fn) { process.nextTick(fn.bind.apply(fn, arguments)); }; function isFinished(msg) { var socket = msg.socket; return "boolean" == typeof msg.finished ? Boolean(msg.finished || socket && !socket.writable) : "boolean" == typeof msg.complete ? Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable) : void 0; } }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(value, options) { return "string" == typeof value ? parse(value) : "number" == typeof value ? format(value, options) : null; }, module.exports.format = format, module.exports.parse = parse; var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g, formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/, map = { b: 1, kb: 1024, mb: 1 << 20, gb: 1 << 30, tb: Math.pow(1024, 4), pb: Math.pow(1024, 5) }, parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; function format(value, options) { if (!Number.isFinite(value)) return null; var mag = Math.abs(value), thousandsSeparator = options && options.thousandsSeparator || "", unitSeparator = options && options.unitSeparator || "", decimalPlaces = options && void 0 !== options.decimalPlaces ? options.decimalPlaces : 2, fixedDecimals = Boolean(options && options.fixedDecimals), unit = options && options.unit || ""; unit && map[unit.toLowerCase()] || (unit = mag >= map.pb ? "PB" : mag >= map.tb ? "TB" : mag >= map.gb ? "GB" : mag >= map.mb ? "MB" : mag >= map.kb ? "KB" : "B"); var str = (value / map[unit.toLowerCase()]).toFixed(decimalPlaces); return fixedDecimals || (str = str.replace(formatDecimalsRegExp, "$1")), thousandsSeparator && (str = str.replace(formatThousandsRegExp, thousandsSeparator)), str + unitSeparator + unit; } function parse(val) { if ("number" == typeof val && !isNaN(val)) return val; if ("string" != typeof val) return null; var floatValue, results = parseRegExp.exec(val), unit = "b"; return results ? (floatValue = parseFloat(results[1]), unit = results[4].toLowerCase()) : (floatValue = parseInt(val, 10), unit = "b"), Math.floor(map[unit] * floatValue); } }, function(module, exports, __webpack_require__) { "use strict"; var deprecate = __webpack_require__(51)("http-errors"), setPrototypeOf = __webpack_require__(119), statuses = __webpack_require__(120), inherits = __webpack_require__(8), toIdentifier = __webpack_require__(599); function codeClass(status) { return Number(String(status).charAt(0) + "00"); } function nameFunc(func, name) { var desc = Object.getOwnPropertyDescriptor(func, "name"); desc && desc.configurable && (desc.value = name, Object.defineProperty(func, "name", desc)); } module.exports = function createError() { for (var err, msg, status = 500, props = {}, i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (arg instanceof Error) status = (err = arg).status || err.statusCode || status; else switch (typeof arg) { case "string": msg = arg; break; case "number": status = arg, 0 !== i && deprecate("non-first-argument status code; replace with createError(" + arg + ", ...)"); break; case "object": props = arg; } } "number" == typeof status && (status < 400 || status >= 600) && deprecate("non-error status code; use only 4xx or 5xx status codes"), ("number" != typeof status || !statuses[status] && (status < 400 || status >= 600)) && (status = 500); var HttpError = createError[status] || createError[codeClass(status)]; for (var key in err || (err = HttpError ? new HttpError(msg) : new Error(msg || statuses[status]), Error.captureStackTrace(err, createError)), HttpError && err instanceof HttpError && err.status === status || (err.expose = status < 500, err.status = err.statusCode = status), props) "status" !== key && "statusCode" !== key && (err[key] = props[key]); return err; }, module.exports.HttpError = (function() { function HttpError() { throw new TypeError("cannot construct abstract class"); } return inherits(HttpError, Error), HttpError; })(), (function(exports, codes, HttpError) { codes.forEach((function(code) { var CodeError, name = toIdentifier(statuses[code]); switch (codeClass(code)) { case 400: CodeError = (function(HttpError, name, code) { var className = name.match(/Error$/) ? name : name + "Error"; function ClientError(message) { var msg = null != message ? message : statuses[code], err = new Error(msg); return Error.captureStackTrace(err, ClientError), setPrototypeOf(err, ClientError.prototype), Object.defineProperty(err, "message", { enumerable: !0, configurable: !0, value: msg, writable: !0 }), Object.defineProperty(err, "name", { enumerable: !1, configurable: !0, value: className, writable: !0 }), err; } return inherits(ClientError, HttpError), nameFunc(ClientError, className), ClientError.prototype.status = code, ClientError.prototype.statusCode = code, ClientError.prototype.expose = !0, ClientError; })(HttpError, name, code); break; case 500: CodeError = (function(HttpError, name, code) { var className = name.match(/Error$/) ? name : name + "Error"; function ServerError(message) { var msg = null != message ? message : statuses[code], err = new Error(msg); return Error.captureStackTrace(err, ServerError), setPrototypeOf(err, ServerError.prototype), Object.defineProperty(err, "message", { enumerable: !0, configurable: !0, value: msg, writable: !0 }), Object.defineProperty(err, "name", { enumerable: !1, configurable: !0, value: className, writable: !0 }), err; } return inherits(ServerError, HttpError), nameFunc(ServerError, className), ServerError.prototype.status = code, ServerError.prototype.statusCode = code, ServerError.prototype.expose = !1, ServerError; })(HttpError, name, code); } CodeError && (exports[code] = CodeError, exports[name] = CodeError); })), exports["I'mateapot"] = deprecate.function(exports.ImATeapot, '"I\'mateapot"; use "ImATeapot" instead'); })(module.exports, statuses.codes, module.exports.HttpError); }, function(module, exports, __webpack_require__) { "use strict"; var typer = __webpack_require__(601), mime = __webpack_require__(78); function typeis(value, types_) { var i, type, types = types_, val = tryNormalizeType(value); if (!val) return !1; if (types && !Array.isArray(types)) for (types = new Array(arguments.length - 1), i = 0; i < types.length; i++) types[i] = arguments[i + 1]; if (!types || !types.length) return val; for (i = 0; i < types.length; i++) if (mimeMatch(normalize(type = types[i]), val)) return "+" === type[0] || -1 !== type.indexOf("*") ? val : type; return !1; } function hasbody(req) { return void 0 !== req.headers["transfer-encoding"] || !isNaN(req.headers["content-length"]); } function normalize(type) { if ("string" != typeof type) return !1; switch (type) { case "urlencoded": return "application/x-www-form-urlencoded"; case "multipart": return "multipart/*"; } return "+" === type[0] ? "*/*" + type : -1 === type.indexOf("/") ? mime.lookup(type) : type; } function mimeMatch(expected, actual) { if (!1 === expected) return !1; var actualParts = actual.split("/"), expectedParts = expected.split("/"); return 2 === actualParts.length && 2 === expectedParts.length && ("*" === expectedParts[0] || expectedParts[0] === actualParts[0]) && ("*+" === expectedParts[1].substr(0, 2) ? expectedParts[1].length <= actualParts[1].length + 1 && expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length) : "*" === expectedParts[1] || expectedParts[1] === actualParts[1]); } function tryNormalizeType(value) { if (!value) return null; try { return (function(value) { var type = typer.parse(value); return type.parameters = void 0, typer.format(type); })(value); } catch (err) { return null; } } module.exports = function(req, types_) { var types = types_; if (!hasbody(req)) return null; if (arguments.length > 2) { types = new Array(arguments.length - 1); for (var i = 0; i < types.length; i++) types[i] = arguments[i + 1]; } var value = req.headers["content-type"]; return typeis(value, types); }, module.exports.is = typeis, module.exports.hasBody = hasbody, module.exports.normalize = normalize, module.exports.match = mimeMatch; }, function(module, exports, __webpack_require__) { var buffer = __webpack_require__(10), Buffer = buffer.Buffer; function copyProps(src, dst) { for (var key in src) dst[key] = src[key]; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length); } Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow ? module.exports = buffer : (copyProps(buffer, exports), exports.Buffer = SafeBuffer), SafeBuffer.prototype = Object.create(Buffer.prototype), copyProps(Buffer, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) { if ("number" == typeof arg) throw new TypeError("Argument must not be a number"); return Buffer(arg, encodingOrOffset, length); }, SafeBuffer.alloc = function(size, fill, encoding) { if ("number" != typeof size) throw new TypeError("Argument must be a number"); var buf = Buffer(size); return void 0 !== fill ? "string" == typeof encoding ? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf; }, SafeBuffer.allocUnsafe = function(size) { if ("number" != typeof size) throw new TypeError("Argument must be a number"); return Buffer(size); }, SafeBuffer.allocUnsafeSlow = function(size) { if ("number" != typeof size) throw new TypeError("Argument must be a number"); return buffer.SlowBuffer(size); }; }, function(module, exports) { var hat = module.exports = function(bits, base) { if (base || (base = 16), void 0 === bits && (bits = 128), bits <= 0) return "0"; for (var digits = Math.log(Math.pow(2, bits)) / Math.log(base), i = 2; digits === 1 / 0; i *= 2) digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i; var rem = digits - Math.floor(digits), res = ""; for (i = 0; i < Math.floor(digits); i++) res = Math.floor(Math.random() * base).toString(base) + res; if (rem) { var b = Math.pow(base, rem); res = Math.floor(Math.random() * b).toString(base) + res; } var parsed = parseInt(res, base); return parsed !== 1 / 0 && parsed >= Math.pow(2, bits) ? hat(bits, base) : res; }; hat.rack = function(bits, base, expandBy) { var fn = function(data) { var iters = 0; do { if (iters++ > 10) { if (!expandBy) throw new Error("too many ID collisions, use more bits"); bits += expandBy; } var id = hat(bits, base); } while (Object.hasOwnProperty.call(hats, id)); return hats[id] = data, id; }, hats = fn.hats = {}; return fn.get = function(id) { return fn.hats[id]; }, fn.set = function(id, value) { return fn.hats[id] = value, fn; }, fn.bits = bits || 128, fn.base = base || 16, fn; }; }, function(module, exports, __webpack_require__) { var stream = __webpack_require__(3), util = __webpack_require__(0), timers = __webpack_require__(103); function createLineStream(readStream, options) { if (!readStream) throw new Error("expected readStream"); if (!readStream.readable) throw new Error("readStream must be readable"); var ls = new LineStream(options); return readStream.pipe(ls), ls; } function LineStream(options) { stream.Transform.call(this, options), options = options || {}, this._readableState.objectMode = !0, this._lineBuffer = [], this._keepEmptyLines = options.keepEmptyLines || !1, this._lastChunkEndedWithCR = !1; var self = this; this.on("pipe", (function(src) { self.encoding || src instanceof stream.Readable && (self.encoding = src._readableState.encoding); })); } module.exports = function(readStream, options) { return module.exports.createStream(readStream, options); }, module.exports.createStream = function(readStream, options) { return readStream ? createLineStream(readStream, options) : new LineStream(options); }, module.exports.createLineStream = function(readStream) { return console.log("WARNING: byline#createLineStream is deprecated and will be removed soon"), createLineStream(readStream); }, module.exports.LineStream = LineStream, util.inherits(LineStream, stream.Transform), LineStream.prototype._transform = function(chunk, encoding, done) { encoding = encoding || "utf8", Buffer.isBuffer(chunk) && ("buffer" == encoding ? (chunk = chunk.toString(), encoding = "utf8") : chunk = chunk.toString(encoding)), this._chunkEncoding = encoding; var lines = chunk.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g); this._lastChunkEndedWithCR && "\n" == chunk[0] && lines.shift(), this._lineBuffer.length > 0 && (this._lineBuffer[this._lineBuffer.length - 1] += lines[0], lines.shift()), this._lastChunkEndedWithCR = "\r" == chunk[chunk.length - 1], this._lineBuffer = this._lineBuffer.concat(lines), this._pushBuffer(encoding, 1, done); }, LineStream.prototype._pushBuffer = function(encoding, keep, done) { for (;this._lineBuffer.length > keep; ) { var line = this._lineBuffer.shift(); if ((this._keepEmptyLines || line.length > 0) && !this.push(this._reencode(line, encoding))) { var self = this; return void timers.setImmediate((function() { self._pushBuffer(encoding, keep, done); })); } } done(); }, LineStream.prototype._flush = function(done) { this._pushBuffer(this._chunkEncoding, 0, done); }, LineStream.prototype._reencode = function(line, chunkEncoding) { return this.encoding && this.encoding != chunkEncoding ? new Buffer(line, chunkEncoding).toString(this.encoding) : this.encoding ? line : new Buffer(line, chunkEncoding); }; }, function(module, exports) { module.exports = require("timers"); }, function(module, exports, __webpack_require__) { !(function(sax) { sax.parser = function(strict, opt) { return new SAXParser(strict, opt); }, sax.SAXParser = SAXParser, sax.SAXStream = SAXStream, sax.createStream = function(strict, opt) { return new SAXStream(strict, opt); }, sax.MAX_BUFFER_LENGTH = 65536; var Stream, buffers = [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ]; function SAXParser(strict, opt) { if (!(this instanceof SAXParser)) return new SAXParser(strict, opt); !(function(parser) { for (var i = 0, l = buffers.length; i < l; i++) parser[buffers[i]] = ""; })(this), this.q = this.c = "", this.bufferCheckPosition = sax.MAX_BUFFER_LENGTH, this.opt = opt || {}, this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags, this.looseCase = this.opt.lowercase ? "toLowerCase" : "toUpperCase", this.tags = [], this.closed = this.closedRoot = this.sawRoot = !1, this.tag = this.error = null, this.strict = !!strict, this.noscript = !(!strict && !this.opt.noscript), this.state = S.BEGIN, this.strictEntities = this.opt.strictEntities, this.ENTITIES = this.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES), this.attribList = [], this.opt.xmlns && (this.ns = Object.create(rootNS)), this.trackPosition = !1 !== this.opt.position, this.trackPosition && (this.position = this.line = this.column = 0), emit(this, "onready"); } sax.EVENTS = [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "opentagstart", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace" ], Object.create || (Object.create = function(o) { function F() {} return F.prototype = o, new F; }), Object.keys || (Object.keys = function(o) { var a = []; for (var i in o) o.hasOwnProperty(i) && a.push(i); return a; }), SAXParser.prototype = { end: function() { end(this); }, write: function(chunk) { if (this.error) throw this.error; if (this.closed) return error(this, "Cannot write after close. Assign an onready handler."); if (null === chunk) return end(this); "object" == typeof chunk && (chunk = chunk.toString()); for (var parser, num, entity, entityLC, numStr, i = 0, c = ""; c = charAt(chunk, i++), this.c = c, c; ) switch (this.trackPosition && (this.position++, "\n" === c ? (this.line++, this.column = 0) : this.column++), this.state) { case S.BEGIN: if (this.state = S.BEGIN_WHITESPACE, "\ufeff" === c) continue; beginWhiteSpace(this, c); continue; case S.BEGIN_WHITESPACE: beginWhiteSpace(this, c); continue; case S.TEXT: if (this.sawRoot && !this.closedRoot) { for (var starti = i - 1; c && "<" !== c && "&" !== c; ) (c = charAt(chunk, i++)) && this.trackPosition && (this.position++, "\n" === c ? (this.line++, this.column = 0) : this.column++); this.textNode += chunk.substring(starti, i - 1); } "<" !== c || this.sawRoot && this.closedRoot && !this.strict ? (isWhitespace(c) || this.sawRoot && !this.closedRoot || strictFail(this, "Text data outside of root node."), "&" === c ? this.state = S.TEXT_ENTITY : this.textNode += c) : (this.state = S.OPEN_WAKA, this.startTagPosition = this.position); continue; case S.SCRIPT: "<" === c ? this.state = S.SCRIPT_ENDING : this.script += c; continue; case S.SCRIPT_ENDING: "/" === c ? this.state = S.CLOSE_TAG : (this.script += "<" + c, this.state = S.SCRIPT); continue; case S.OPEN_WAKA: if ("!" === c) this.state = S.SGML_DECL, this.sgmlDecl = ""; else if (isWhitespace(c)) ; else if (isMatch(nameStart, c)) this.state = S.OPEN_TAG, this.tagName = c; else if ("/" === c) this.state = S.CLOSE_TAG, this.tagName = ""; else if ("?" === c) this.state = S.PROC_INST, this.procInstName = this.procInstBody = ""; else { if (strictFail(this, "Unencoded <"), this.startTagPosition + 1 < this.position) { var pad = this.position - this.startTagPosition; c = new Array(pad).join(" ") + c; } this.textNode += "<" + c, this.state = S.TEXT; } continue; case S.SGML_DECL: "[CDATA[" === (this.sgmlDecl + c).toUpperCase() ? (emitNode(this, "onopencdata"), this.state = S.CDATA, this.sgmlDecl = "", this.cdata = "") : this.sgmlDecl + c === "--" ? (this.state = S.COMMENT, this.comment = "", this.sgmlDecl = "") : "DOCTYPE" === (this.sgmlDecl + c).toUpperCase() ? (this.state = S.DOCTYPE, (this.doctype || this.sawRoot) && strictFail(this, "Inappropriately located doctype declaration"), this.doctype = "", this.sgmlDecl = "") : ">" === c ? (emitNode(this, "onsgmldeclaration", this.sgmlDecl), this.sgmlDecl = "", this.state = S.TEXT) : isQuote(c) ? (this.state = S.SGML_DECL_QUOTED, this.sgmlDecl += c) : this.sgmlDecl += c; continue; case S.SGML_DECL_QUOTED: c === this.q && (this.state = S.SGML_DECL, this.q = ""), this.sgmlDecl += c; continue; case S.DOCTYPE: ">" === c ? (this.state = S.TEXT, emitNode(this, "ondoctype", this.doctype), this.doctype = !0) : (this.doctype += c, "[" === c ? this.state = S.DOCTYPE_DTD : isQuote(c) && (this.state = S.DOCTYPE_QUOTED, this.q = c)); continue; case S.DOCTYPE_QUOTED: this.doctype += c, c === this.q && (this.q = "", this.state = S.DOCTYPE); continue; case S.DOCTYPE_DTD: this.doctype += c, "]" === c ? this.state = S.DOCTYPE : isQuote(c) && (this.state = S.DOCTYPE_DTD_QUOTED, this.q = c); continue; case S.DOCTYPE_DTD_QUOTED: this.doctype += c, c === this.q && (this.state = S.DOCTYPE_DTD, this.q = ""); continue; case S.COMMENT: "-" === c ? this.state = S.COMMENT_ENDING : this.comment += c; continue; case S.COMMENT_ENDING: "-" === c ? (this.state = S.COMMENT_ENDED, this.comment = textopts(this.opt, this.comment), this.comment && emitNode(this, "oncomment", this.comment), this.comment = "") : (this.comment += "-" + c, this.state = S.COMMENT); continue; case S.COMMENT_ENDED: ">" !== c ? (strictFail(this, "Malformed comment"), this.comment += "--" + c, this.state = S.COMMENT) : this.state = S.TEXT; continue; case S.CDATA: "]" === c ? this.state = S.CDATA_ENDING : this.cdata += c; continue; case S.CDATA_ENDING: "]" === c ? this.state = S.CDATA_ENDING_2 : (this.cdata += "]" + c, this.state = S.CDATA); continue; case S.CDATA_ENDING_2: ">" === c ? (this.cdata && emitNode(this, "oncdata", this.cdata), emitNode(this, "onclosecdata"), this.cdata = "", this.state = S.TEXT) : "]" === c ? this.cdata += "]" : (this.cdata += "]]" + c, this.state = S.CDATA); continue; case S.PROC_INST: "?" === c ? this.state = S.PROC_INST_ENDING : isWhitespace(c) ? this.state = S.PROC_INST_BODY : this.procInstName += c; continue; case S.PROC_INST_BODY: if (!this.procInstBody && isWhitespace(c)) continue; "?" === c ? this.state = S.PROC_INST_ENDING : this.procInstBody += c; continue; case S.PROC_INST_ENDING: ">" === c ? (emitNode(this, "onprocessinginstruction", { name: this.procInstName, body: this.procInstBody }), this.procInstName = this.procInstBody = "", this.state = S.TEXT) : (this.procInstBody += "?" + c, this.state = S.PROC_INST_BODY); continue; case S.OPEN_TAG: isMatch(nameBody, c) ? this.tagName += c : (newTag(this), ">" === c ? openTag(this) : "/" === c ? this.state = S.OPEN_TAG_SLASH : (isWhitespace(c) || strictFail(this, "Invalid character in tag name"), this.state = S.ATTRIB)); continue; case S.OPEN_TAG_SLASH: ">" === c ? (openTag(this, !0), closeTag(this)) : (strictFail(this, "Forward-slash in opening tag not followed by >"), this.state = S.ATTRIB); continue; case S.ATTRIB: if (isWhitespace(c)) continue; ">" === c ? openTag(this) : "/" === c ? this.state = S.OPEN_TAG_SLASH : isMatch(nameStart, c) ? (this.attribName = c, this.attribValue = "", this.state = S.ATTRIB_NAME) : strictFail(this, "Invalid attribute name"); continue; case S.ATTRIB_NAME: "=" === c ? this.state = S.ATTRIB_VALUE : ">" === c ? (strictFail(this, "Attribute without value"), this.attribValue = this.attribName, attrib(this), openTag(this)) : isWhitespace(c) ? this.state = S.ATTRIB_NAME_SAW_WHITE : isMatch(nameBody, c) ? this.attribName += c : strictFail(this, "Invalid attribute name"); continue; case S.ATTRIB_NAME_SAW_WHITE: if ("=" === c) this.state = S.ATTRIB_VALUE; else { if (isWhitespace(c)) continue; strictFail(this, "Attribute without value"), this.tag.attributes[this.attribName] = "", this.attribValue = "", emitNode(this, "onattribute", { name: this.attribName, value: "" }), this.attribName = "", ">" === c ? openTag(this) : isMatch(nameStart, c) ? (this.attribName = c, this.state = S.ATTRIB_NAME) : (strictFail(this, "Invalid attribute name"), this.state = S.ATTRIB); } continue; case S.ATTRIB_VALUE: if (isWhitespace(c)) continue; isQuote(c) ? (this.q = c, this.state = S.ATTRIB_VALUE_QUOTED) : (strictFail(this, "Unquoted attribute value"), this.state = S.ATTRIB_VALUE_UNQUOTED, this.attribValue = c); continue; case S.ATTRIB_VALUE_QUOTED: if (c !== this.q) { "&" === c ? this.state = S.ATTRIB_VALUE_ENTITY_Q : this.attribValue += c; continue; } attrib(this), this.q = "", this.state = S.ATTRIB_VALUE_CLOSED; continue; case S.ATTRIB_VALUE_CLOSED: isWhitespace(c) ? this.state = S.ATTRIB : ">" === c ? openTag(this) : "/" === c ? this.state = S.OPEN_TAG_SLASH : isMatch(nameStart, c) ? (strictFail(this, "No whitespace between attributes"), this.attribName = c, this.attribValue = "", this.state = S.ATTRIB_NAME) : strictFail(this, "Invalid attribute name"); continue; case S.ATTRIB_VALUE_UNQUOTED: if (!isAttribEnd(c)) { "&" === c ? this.state = S.ATTRIB_VALUE_ENTITY_U : this.attribValue += c; continue; } attrib(this), ">" === c ? openTag(this) : this.state = S.ATTRIB; continue; case S.CLOSE_TAG: if (this.tagName) ">" === c ? closeTag(this) : isMatch(nameBody, c) ? this.tagName += c : this.script ? (this.script += "" === c ? closeTag(this) : strictFail(this, "Invalid characters in closing tag"); continue; case S.TEXT_ENTITY: case S.ATTRIB_VALUE_ENTITY_Q: case S.ATTRIB_VALUE_ENTITY_U: var returnState, buffer; switch (this.state) { case S.TEXT_ENTITY: returnState = S.TEXT, buffer = "textNode"; break; case S.ATTRIB_VALUE_ENTITY_Q: returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"; break; case S.ATTRIB_VALUE_ENTITY_U: returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"; } ";" === c ? (this[buffer] += (num = void 0, entity = void 0, entityLC = void 0, numStr = void 0, entity = (parser = this).entity, entityLC = entity.toLowerCase(), numStr = "", parser.ENTITIES[entity] ? parser.ENTITIES[entity] : parser.ENTITIES[entityLC] ? parser.ENTITIES[entityLC] : ("#" === (entity = entityLC).charAt(0) && ("x" === entity.charAt(1) ? (entity = entity.slice(2), numStr = (num = parseInt(entity, 16)).toString(16)) : (entity = entity.slice(1), numStr = (num = parseInt(entity, 10)).toString(10))), entity = entity.replace(/^0+/, ""), isNaN(num) || numStr.toLowerCase() !== entity ? (strictFail(parser, "Invalid character entity"), "&" + parser.entity + ";") : String.fromCodePoint(num))), this.entity = "", this.state = returnState) : isMatch(this.entity.length ? entityBody : entityStart, c) ? this.entity += c : (strictFail(this, "Invalid character in entity name"), this[buffer] += "&" + this.entity + c, this.entity = "", this.state = returnState); continue; default: throw new Error(this, "Unknown state: " + this.state); } return this.position >= this.bufferCheckPosition && (function(parser) { for (var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10), maxActual = 0, i = 0, l = buffers.length; i < l; i++) { var len = parser[buffers[i]].length; if (len > maxAllowed) switch (buffers[i]) { case "textNode": closeText(parser); break; case "cdata": emitNode(parser, "oncdata", parser.cdata), parser.cdata = ""; break; case "script": emitNode(parser, "onscript", parser.script), parser.script = ""; break; default: error(parser, "Max buffer length exceeded: " + buffers[i]); } maxActual = Math.max(maxActual, len); } var m = sax.MAX_BUFFER_LENGTH - maxActual; parser.bufferCheckPosition = m + parser.position; })(this), this; }, resume: function() { return this.error = null, this; }, close: function() { return this.write(null); }, flush: function() { closeText(this), "" !== this.cdata && (emitNode(this, "oncdata", this.cdata), this.cdata = ""), "" !== this.script && (emitNode(this, "onscript", this.script), this.script = ""); } }; try { Stream = __webpack_require__(3).Stream; } catch (ex) { Stream = function() {}; } var streamWraps = sax.EVENTS.filter((function(ev) { return "error" !== ev && "end" !== ev; })); function SAXStream(strict, opt) { if (!(this instanceof SAXStream)) return new SAXStream(strict, opt); Stream.apply(this), this._parser = new SAXParser(strict, opt), this.writable = !0, this.readable = !0; var me = this; this._parser.onend = function() { me.emit("end"); }, this._parser.onerror = function(er) { me.emit("error", er), me._parser.error = null; }, this._decoder = null, streamWraps.forEach((function(ev) { Object.defineProperty(me, "on" + ev, { get: function() { return me._parser["on" + ev]; }, set: function(h) { if (!h) return me.removeAllListeners(ev), me._parser["on" + ev] = h, h; me.on(ev, h); }, enumerable: !0, configurable: !1 }); })); } SAXStream.prototype = Object.create(Stream.prototype, { constructor: { value: SAXStream } }), SAXStream.prototype.write = function(data) { if ("function" == typeof Buffer && "function" == typeof Buffer.isBuffer && Buffer.isBuffer(data)) { if (!this._decoder) { var SD = __webpack_require__(173).StringDecoder; this._decoder = new SD("utf8"); } data = this._decoder.write(data); } return this._parser.write(data.toString()), this.emit("data", data), !0; }, SAXStream.prototype.end = function(chunk) { return chunk && chunk.length && this.write(chunk), this._parser.end(), !0; }, SAXStream.prototype.on = function(ev, handler) { var me = this; return me._parser["on" + ev] || -1 === streamWraps.indexOf(ev) || (me._parser["on" + ev] = function() { var args = 1 === arguments.length ? [ arguments[0] ] : Array.apply(null, arguments); args.splice(0, 0, ev), me.emit.apply(me, args); }), Stream.prototype.on.call(me, ev, handler); }; var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace", rootNS = { xml: XML_NAMESPACE, xmlns: "http://www.w3.org/2000/xmlns/" }, nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/; function isWhitespace(c) { return " " === c || "\n" === c || "\r" === c || "\t" === c; } function isQuote(c) { return '"' === c || "'" === c; } function isAttribEnd(c) { return ">" === c || isWhitespace(c); } function isMatch(regex, c) { return regex.test(c); } function notMatch(regex, c) { return !isMatch(regex, c); } var stringFromCharCode, floor, fromCodePoint, S = 0; for (var s in sax.STATE = { BEGIN: S++, BEGIN_WHITESPACE: S++, TEXT: S++, TEXT_ENTITY: S++, OPEN_WAKA: S++, SGML_DECL: S++, SGML_DECL_QUOTED: S++, DOCTYPE: S++, DOCTYPE_QUOTED: S++, DOCTYPE_DTD: S++, DOCTYPE_DTD_QUOTED: S++, COMMENT_STARTING: S++, COMMENT: S++, COMMENT_ENDING: S++, COMMENT_ENDED: S++, CDATA: S++, CDATA_ENDING: S++, CDATA_ENDING_2: S++, PROC_INST: S++, PROC_INST_BODY: S++, PROC_INST_ENDING: S++, OPEN_TAG: S++, OPEN_TAG_SLASH: S++, ATTRIB: S++, ATTRIB_NAME: S++, ATTRIB_NAME_SAW_WHITE: S++, ATTRIB_VALUE: S++, ATTRIB_VALUE_QUOTED: S++, ATTRIB_VALUE_CLOSED: S++, ATTRIB_VALUE_UNQUOTED: S++, ATTRIB_VALUE_ENTITY_Q: S++, ATTRIB_VALUE_ENTITY_U: S++, CLOSE_TAG: S++, CLOSE_TAG_SAW_WHITE: S++, SCRIPT: S++, SCRIPT_ENDING: S++ }, sax.XML_ENTITIES = { amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, sax.ENTITIES = { amp: "&", gt: ">", lt: "<", quot: '"', apos: "'", AElig: 198, Aacute: 193, Acirc: 194, Agrave: 192, Aring: 197, Atilde: 195, Auml: 196, Ccedil: 199, ETH: 208, Eacute: 201, Ecirc: 202, Egrave: 200, Euml: 203, Iacute: 205, Icirc: 206, Igrave: 204, Iuml: 207, Ntilde: 209, Oacute: 211, Ocirc: 212, Ograve: 210, Oslash: 216, Otilde: 213, Ouml: 214, THORN: 222, Uacute: 218, Ucirc: 219, Ugrave: 217, Uuml: 220, Yacute: 221, aacute: 225, acirc: 226, aelig: 230, agrave: 224, aring: 229, atilde: 227, auml: 228, ccedil: 231, eacute: 233, ecirc: 234, egrave: 232, eth: 240, euml: 235, iacute: 237, icirc: 238, igrave: 236, iuml: 239, ntilde: 241, oacute: 243, ocirc: 244, ograve: 242, oslash: 248, otilde: 245, ouml: 246, szlig: 223, thorn: 254, uacute: 250, ucirc: 251, ugrave: 249, uuml: 252, yacute: 253, yuml: 255, copy: 169, reg: 174, nbsp: 160, iexcl: 161, cent: 162, pound: 163, curren: 164, yen: 165, brvbar: 166, sect: 167, uml: 168, ordf: 170, laquo: 171, not: 172, shy: 173, macr: 175, deg: 176, plusmn: 177, sup1: 185, sup2: 178, sup3: 179, acute: 180, micro: 181, para: 182, middot: 183, cedil: 184, ordm: 186, raquo: 187, frac14: 188, frac12: 189, frac34: 190, iquest: 191, times: 215, divide: 247, OElig: 338, oelig: 339, Scaron: 352, scaron: 353, Yuml: 376, fnof: 402, circ: 710, tilde: 732, Alpha: 913, Beta: 914, Gamma: 915, Delta: 916, Epsilon: 917, Zeta: 918, Eta: 919, Theta: 920, Iota: 921, Kappa: 922, Lambda: 923, Mu: 924, Nu: 925, Xi: 926, Omicron: 927, Pi: 928, Rho: 929, Sigma: 931, Tau: 932, Upsilon: 933, Phi: 934, Chi: 935, Psi: 936, Omega: 937, alpha: 945, beta: 946, gamma: 947, delta: 948, epsilon: 949, zeta: 950, eta: 951, theta: 952, iota: 953, kappa: 954, lambda: 955, mu: 956, nu: 957, xi: 958, omicron: 959, pi: 960, rho: 961, sigmaf: 962, sigma: 963, tau: 964, upsilon: 965, phi: 966, chi: 967, psi: 968, omega: 969, thetasym: 977, upsih: 978, piv: 982, ensp: 8194, emsp: 8195, thinsp: 8201, zwnj: 8204, zwj: 8205, lrm: 8206, rlm: 8207, ndash: 8211, mdash: 8212, lsquo: 8216, rsquo: 8217, sbquo: 8218, ldquo: 8220, rdquo: 8221, bdquo: 8222, dagger: 8224, Dagger: 8225, bull: 8226, hellip: 8230, permil: 8240, prime: 8242, Prime: 8243, lsaquo: 8249, rsaquo: 8250, oline: 8254, frasl: 8260, euro: 8364, image: 8465, weierp: 8472, real: 8476, trade: 8482, alefsym: 8501, larr: 8592, uarr: 8593, rarr: 8594, darr: 8595, harr: 8596, crarr: 8629, lArr: 8656, uArr: 8657, rArr: 8658, dArr: 8659, hArr: 8660, forall: 8704, part: 8706, exist: 8707, empty: 8709, nabla: 8711, isin: 8712, notin: 8713, ni: 8715, prod: 8719, sum: 8721, minus: 8722, lowast: 8727, radic: 8730, prop: 8733, infin: 8734, ang: 8736, and: 8743, or: 8744, cap: 8745, cup: 8746, int: 8747, there4: 8756, sim: 8764, cong: 8773, asymp: 8776, ne: 8800, equiv: 8801, le: 8804, ge: 8805, sub: 8834, sup: 8835, nsub: 8836, sube: 8838, supe: 8839, oplus: 8853, otimes: 8855, perp: 8869, sdot: 8901, lceil: 8968, rceil: 8969, lfloor: 8970, rfloor: 8971, lang: 9001, rang: 9002, loz: 9674, spades: 9824, clubs: 9827, hearts: 9829, diams: 9830 }, Object.keys(sax.ENTITIES).forEach((function(key) { var e = sax.ENTITIES[key], s = "number" == typeof e ? String.fromCharCode(e) : e; sax.ENTITIES[key] = s; })), sax.STATE) sax.STATE[sax.STATE[s]] = s; function emit(parser, event, data) { parser[event] && parser[event](data); } function emitNode(parser, nodeType, data) { parser.textNode && closeText(parser), emit(parser, nodeType, data); } function closeText(parser) { parser.textNode = textopts(parser.opt, parser.textNode), parser.textNode && emit(parser, "ontext", parser.textNode), parser.textNode = ""; } function textopts(opt, text) { return opt.trim && (text = text.trim()), opt.normalize && (text = text.replace(/\s+/g, " ")), text; } function error(parser, er) { return closeText(parser), parser.trackPosition && (er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c), er = new Error(er), parser.error = er, emit(parser, "onerror", er), parser; } function end(parser) { return parser.sawRoot && !parser.closedRoot && strictFail(parser, "Unclosed root tag"), parser.state !== S.BEGIN && parser.state !== S.BEGIN_WHITESPACE && parser.state !== S.TEXT && error(parser, "Unexpected end"), closeText(parser), parser.c = "", parser.closed = !0, emit(parser, "onend"), SAXParser.call(parser, parser.strict, parser.opt), parser; } function strictFail(parser, message) { if ("object" != typeof parser || !(parser instanceof SAXParser)) throw new Error("bad call to strictFail"); parser.strict && error(parser, message); } function newTag(parser) { parser.strict || (parser.tagName = parser.tagName[parser.looseCase]()); var parent = parser.tags[parser.tags.length - 1] || parser, tag = parser.tag = { name: parser.tagName, attributes: {} }; parser.opt.xmlns && (tag.ns = parent.ns), parser.attribList.length = 0, emitNode(parser, "onopentagstart", tag); } function qname(name, attribute) { var qualName = name.indexOf(":") < 0 ? [ "", name ] : name.split(":"), prefix = qualName[0], local = qualName[1]; return attribute && "xmlns" === name && (prefix = "xmlns", local = ""), { prefix: prefix, local: local }; } function attrib(parser) { if (parser.strict || (parser.attribName = parser.attribName[parser.looseCase]()), -1 !== parser.attribList.indexOf(parser.attribName) || parser.tag.attributes.hasOwnProperty(parser.attribName)) parser.attribName = parser.attribValue = ""; else { if (parser.opt.xmlns) { var qn = qname(parser.attribName, !0), prefix = qn.prefix, local = qn.local; if ("xmlns" === prefix) if ("xml" === local && parser.attribValue !== XML_NAMESPACE) strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser.attribValue); else if ("xmlns" === local && "http://www.w3.org/2000/xmlns/" !== parser.attribValue) strictFail(parser, "xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: " + parser.attribValue); else { var tag = parser.tag, parent = parser.tags[parser.tags.length - 1] || parser; tag.ns === parent.ns && (tag.ns = Object.create(parent.ns)), tag.ns[local] = parser.attribValue; } parser.attribList.push([ parser.attribName, parser.attribValue ]); } else parser.tag.attributes[parser.attribName] = parser.attribValue, emitNode(parser, "onattribute", { name: parser.attribName, value: parser.attribValue }); parser.attribName = parser.attribValue = ""; } } function openTag(parser, selfClosing) { if (parser.opt.xmlns) { var tag = parser.tag, qn = qname(parser.tagName); tag.prefix = qn.prefix, tag.local = qn.local, tag.uri = tag.ns[qn.prefix] || "", tag.prefix && !tag.uri && (strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName)), tag.uri = qn.prefix); var parent = parser.tags[parser.tags.length - 1] || parser; tag.ns && parent.ns !== tag.ns && Object.keys(tag.ns).forEach((function(p) { emitNode(parser, "onopennamespace", { prefix: p, uri: tag.ns[p] }); })); for (var i = 0, l = parser.attribList.length; i < l; i++) { var nv = parser.attribList[i], name = nv[0], value = nv[1], qualName = qname(name, !0), prefix = qualName.prefix, local = qualName.local, uri = "" === prefix ? "" : tag.ns[prefix] || "", a = { name: name, value: value, prefix: prefix, local: local, uri: uri }; prefix && "xmlns" !== prefix && !uri && (strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix)), a.uri = prefix), parser.tag.attributes[name] = a, emitNode(parser, "onattribute", a); } parser.attribList.length = 0; } parser.tag.isSelfClosing = !!selfClosing, parser.sawRoot = !0, parser.tags.push(parser.tag), emitNode(parser, "onopentag", parser.tag), selfClosing || (parser.noscript || "script" !== parser.tagName.toLowerCase() ? parser.state = S.TEXT : parser.state = S.SCRIPT, parser.tag = null, parser.tagName = ""), parser.attribName = parser.attribValue = "", parser.attribList.length = 0; } function closeTag(parser) { if (!parser.tagName) return strictFail(parser, "Weird empty close tag."), parser.textNode += "", void (parser.state = S.TEXT); if (parser.script) { if ("script" !== parser.tagName) return parser.script += "", parser.tagName = "", void (parser.state = S.SCRIPT); emitNode(parser, "onscript", parser.script), parser.script = ""; } var t = parser.tags.length, tagName = parser.tagName; parser.strict || (tagName = tagName[parser.looseCase]()); for (var closeTo = tagName; t-- && parser.tags[t].name !== closeTo; ) strictFail(parser, "Unexpected close tag"); if (t < 0) return strictFail(parser, "Unmatched closing tag: " + parser.tagName), parser.textNode += "", void (parser.state = S.TEXT); parser.tagName = tagName; for (var s = parser.tags.length; s-- > t; ) { var tag = parser.tag = parser.tags.pop(); parser.tagName = parser.tag.name, emitNode(parser, "onclosetag", parser.tagName); var x = {}; for (var i in tag.ns) x[i] = tag.ns[i]; var parent = parser.tags[parser.tags.length - 1] || parser; parser.opt.xmlns && tag.ns !== parent.ns && Object.keys(tag.ns).forEach((function(p) { var n = tag.ns[p]; emitNode(parser, "onclosenamespace", { prefix: p, uri: n }); })); } 0 === t && (parser.closedRoot = !0), parser.tagName = parser.attribValue = parser.attribName = "", parser.attribList.length = 0, parser.state = S.TEXT; } function beginWhiteSpace(parser, c) { "<" === c ? (parser.state = S.OPEN_WAKA, parser.startTagPosition = parser.position) : isWhitespace(c) || (strictFail(parser, "Non-whitespace before first tag."), parser.textNode = c, parser.state = S.TEXT); } function charAt(chunk, i) { var result = ""; return i < chunk.length && (result = chunk.charAt(i)), result; } S = sax.STATE, String.fromCodePoint || (stringFromCharCode = String.fromCharCode, floor = Math.floor, fromCodePoint = function() { var highSurrogate, lowSurrogate, MAX_SIZE = 16384, codeUnits = [], index = -1, length = arguments.length; if (!length) return ""; for (var result = ""; ++index < length; ) { var codePoint = Number(arguments[index]); if (!isFinite(codePoint) || codePoint < 0 || codePoint > 1114111 || floor(codePoint) !== codePoint) throw RangeError("Invalid code point: " + codePoint); codePoint <= 65535 ? codeUnits.push(codePoint) : (highSurrogate = 55296 + ((codePoint -= 65536) >> 10), lowSurrogate = codePoint % 1024 + 56320, codeUnits.push(highSurrogate, lowSurrogate)), (index + 1 === length || codeUnits.length > MAX_SIZE) && (result += stringFromCharCode.apply(null, codeUnits), codeUnits.length = 0); } return result; }, Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", { value: fromCodePoint, configurable: !0, writable: !0 }) : String.fromCodePoint = fromCodePoint); })(exports); }, function(module, exports, __webpack_require__) { var util = __webpack_require__(0), fs = __webpack_require__(2), path = __webpack_require__(5), pkg = __webpack_require__(412), isPositiveInteger = __webpack_require__(399), appPath = __webpack_require__(413); module.exports = (function(appPath, args) { var self = { get serverVersion() { return pkg.version; }, set serverVersion(_) {} }; util._extend(self, void 0); var p = path.join(appPath, "server-settings.json"); return self.extend = function(opts) { util._extend(self, opts); }, self.save = function(cb) { fs.writeFile(p, JSON.stringify(self, null, 4), cb); }, self.load = function() { try { Object.assign(self, JSON.parse(fs.readFileSync(p).toString())), self.save((function() {})); } catch (e) { console.error("Cannot update settings", e.message); } }, self.appPath = appPath, self.cacheRoot = self.hasOwnProperty("cacheRoot") ? self.cacheRoot : appPath, self.cacheSize = process.env.DISABLE_CACHING ? 0 : self.hasOwnProperty("cacheSize") ? self.cacheSize : "android" === process.platform ? 0 : 2147483648, self.btMaxConnections = isPositiveInteger(self.btMaxConnections) ? self.btMaxConnections : 55, self.btHandshakeTimeout = isPositiveInteger(self.btHandshakeTimeout) ? self.btHandshakeTimeout : 2e4, self.btRequestTimeout = isPositiveInteger(self.btRequestTimeout || self.btConnectionTimeout) ? self.btRequestTimeout : 4e3, self.btDownloadSpeedSoftLimit = isPositiveInteger(self.btDownloadSpeedSoftLimit) ? self.btDownloadSpeedSoftLimit : 2621440, self.btDownloadSpeedHardLimit = isPositiveInteger(self.btDownloadSpeedHardLimit) ? self.btDownloadSpeedHardLimit : 3670016, self.btMinPeersForStable = isPositiveInteger(self.btMinPeersForStable) ? self.btMinPeersForStable : 5, self.remoteHttps = "string" == typeof self.remoteHttps ? self.remoteHttps : "", self.localAddonEnabled = !!self.hasOwnProperty("localAddonEnabled") && self.localAddonEnabled, self.transcodeHorsepower = self.transcodeHorsepower ? self.transcodeHorsepower : .75, self.transcodeMaxBitRate = isPositiveInteger(self.transcodeMaxBitRate) ? self.transcodeMaxBitRate : 0, self.transcodeConcurrency = isPositiveInteger(self.transcodeConcurrency) ? self.transcodeConcurrency : 1, self.transcodeTrackConcurrency = isPositiveInteger(self.transcodeTrackConcurrency) ? self.transcodeTrackConcurrency : 1, self.transcodeHardwareAccel = !self.hasOwnProperty("transcodeHardwareAccel") || self.transcodeHardwareAccel, self.transcodeProfile = self.hasOwnProperty("transcodeProfile") ? self.transcodeProfile : null, self.allTranscodeProfiles = [], self.transcodeMaxWidth = self.hasOwnProperty("transcodeMaxWidth") ? self.transcodeMaxWidth : 1920, self.proxyStreamsEnabled = !!self.hasOwnProperty("proxyStreamsEnabled") && self.proxyStreamsEnabled, self.load(), self; })(appPath); }, function(module, exports, __webpack_require__) { try { var util = __webpack_require__(0); if ("function" != typeof util.inherits) throw ""; module.exports = util.inherits; } catch (e) { module.exports = __webpack_require__(850); } }, function(module, exports, __webpack_require__) { const miniget = __webpack_require__(156); exports.between = (haystack, left, right) => { let pos; if (left instanceof RegExp) { const match = haystack.match(left); if (!match) return ""; pos = match.index + match[0].length; } else { if (pos = haystack.indexOf(left), -1 === pos) return ""; pos += left.length; } return pos = (haystack = haystack.slice(pos)).indexOf(right), -1 === pos ? "" : haystack = haystack.slice(0, pos); }, exports.parseAbbreviatedNumber = string => { const match = string.replace(",", ".").replace(" ", "").match(/([\d,.]+)([MK]?)/); if (match) { let [, num, multi] = match; return num = parseFloat(num), Math.round("M" === multi ? 1e6 * num : "K" === multi ? 1e3 * num : num); } return null; }, exports.cutAfterJSON = mixedJson => { let open, close; if ("[" === mixedJson[0] ? (open = "[", close = "]") : "{" === mixedJson[0] && (open = "{", close = "}"), !open) throw new Error(`Can't cut unsupported JSON (need to begin with [ or { ) but got: ${mixedJson[0]}`); let i, isString = !1, isEscaped = !1, counter = 0; for (i = 0; i < mixedJson.length; i++) if ('"' !== mixedJson[i] || isEscaped) { if (isEscaped = "\\" === mixedJson[i] && !isEscaped, !isString && (mixedJson[i] === open ? counter++ : mixedJson[i] === close && counter--, 0 === counter)) return mixedJson.substr(0, i + 1); } else isString = !isString; throw Error("Can't cut unsupported JSON (no matching closing bracket found)"); }, exports.playError = (player_response, statuses, ErrorType = Error) => { let playability = player_response && player_response.playabilityStatus; return playability && statuses.includes(playability.status) ? new ErrorType(playability.reason || playability.messages && playability.messages[0]) : null; }, exports.exposedMiniget = (url, options = {}, requestOptionsOverwrite) => { const req = miniget(url, requestOptionsOverwrite || options.requestOptions); return "function" == typeof options.requestCallback && options.requestCallback(req), req; }, exports.deprecate = (obj, prop, value, oldPath, newPath) => { Object.defineProperty(obj, prop, { get: () => (console.warn(`\`${oldPath}\` will be removed in a near future release, use \`${newPath}\` instead.`), value) }); }; const pkg = __webpack_require__(469); exports.lastUpdateCheck = 0, exports.checkForUpdates = () => !process.env.YTDL_NO_UPDATE && !pkg.version.startsWith("0.0.0-") && Date.now() - exports.lastUpdateCheck >= 432e5 ? (exports.lastUpdateCheck = Date.now(), miniget("https://api.github.com/repos/fent/node-ytdl-core/releases/latest", { headers: { "User-Agent": "ytdl-core" } }).text().then((response => { JSON.parse(response).tag_name !== `v${pkg.version}` && console.warn('WARNING: ytdl-core is out of date! Update with "npm install ytdl-core@latest".'); }), (err => { console.warn("Error checking for updates:", err.message), console.warn("You can disable this check by setting the `YTDL_NO_UPDATE` env variable."); }))) : null; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("router"), flatten = __webpack_require__(512).flatten, Layer = __webpack_require__(513), methods = __webpack_require__(68), mixin = __webpack_require__(67), parseUrl = __webpack_require__(49), Route = __webpack_require__(1121), setPrototypeOf = __webpack_require__(1122), slice = Array.prototype.slice, defer = "function" == typeof setImmediate ? setImmediate : function(fn) { process.nextTick(fn.bind.apply(fn, arguments)); }; function Router(options) { if (!(this instanceof Router)) return new Router(options); var opts = options || {}; function router(req, res, next) { router.handle(req, res, next); } return setPrototypeOf(router, this), router.caseSensitive = opts.caseSensitive, router.mergeParams = opts.mergeParams, router.params = {}, router.strict = opts.strict, router.stack = [], router; } function matchLayer(layer, path) { try { return layer.match(path); } catch (err) { return err; } } module.exports = Router, module.exports.Route = Route, Router.prototype = function() {}, Router.prototype.param = function(name, fn) { if (!name) throw new TypeError("argument name is required"); if ("string" != typeof name) throw new TypeError("argument name must be a string"); if (!fn) throw new TypeError("argument fn is required"); if ("function" != typeof fn) throw new TypeError("argument fn must be a function"); var params = this.params[name]; return params || (params = this.params[name] = []), params.push(fn), this; }, Router.prototype.handle = function(req, res, callback) { if (!callback) throw new TypeError("argument callback is required"); debug("dispatching %s %s", req.method, req.url); var methods, old, fn, idx = 0, protohost = (function(url) { if ("string" == typeof url && 0 !== url.length && "/" !== url[0]) { var searchIndex = url.indexOf("?"), pathLength = -1 !== searchIndex ? searchIndex : url.length, fqdnIndex = url.substring(0, pathLength).indexOf("://"); return -1 !== fqdnIndex ? url.substring(0, url.indexOf("/", 3 + fqdnIndex)) : void 0; } })(req.url) || "", removed = "", self = this, slashAdded = !1, sync = 0, paramcalled = {}, stack = this.stack, parentParams = req.params, parentUrl = req.baseUrl || "", done = (function(fn, obj) { for (var props = new Array(arguments.length - 2), vals = new Array(arguments.length - 2), i = 0; i < props.length; i++) props[i] = arguments[i + 2], vals[i] = obj[props[i]]; return function() { for (var i = 0; i < props.length; i++) obj[props[i]] = vals[i]; return fn.apply(this, arguments); }; })(callback, req, "baseUrl", "next", "params"); function next(err) { var layerError = "route" === err ? null : err; if (slashAdded && (req.url = req.url.slice(1), slashAdded = !1), 0 !== removed.length && (req.baseUrl = parentUrl, req.url = protohost + removed + req.url.slice(protohost.length), removed = ""), "router" !== layerError) if (idx >= stack.length) defer(done, layerError); else { if (++sync > 100) return defer(next, err); var layer, match, route, path = (function(req) { try { return parseUrl(req).pathname; } catch (err) { return; } })(req); if (null == path) return done(layerError); for (;!0 !== match && idx < stack.length; ) if (match = matchLayer(layer = stack[idx++], path), route = layer.route, "boolean" != typeof match && (layerError = layerError || match), !0 === match && route) if (layerError) match = !1; else { var method = req.method, has_method = route._handles_method(method); !has_method && "OPTIONS" === method && methods && methods.push.apply(methods, route._methods()), has_method || "HEAD" === method || (match = !1); } if (!0 !== match) return done(layerError); route && (req.route = route), req.params = self.mergeParams ? (function(params, parent) { if ("object" != typeof parent || !parent) return params; var obj = mixin({}, parent); if (!(0 in params) || !(0 in parent)) return mixin(obj, params); for (var i = 0, o = 0; i in params; ) i++; for (;o in parent; ) o++; for (i--; i >= 0; i--) params[i + o] = params[i], i < o && delete params[i]; return mixin(obj, params); })(layer.params, parentParams) : layer.params; var layerPath = layer.path; self.process_params(layer, paramcalled, req, res, (function(err) { err ? next(layerError || err) : route ? layer.handle_request(req, res, next) : (function(layer, layerError, layerPath, path) { if (0 !== layerPath.length) { if (layerPath !== path.substring(0, layerPath.length)) return void next(layerError); var c = path[layerPath.length]; if (c && "/" !== c) return void next(layerError); debug("trim prefix (%s) from url %s", layerPath, req.url), removed = layerPath, req.url = protohost + req.url.slice(protohost.length + removed.length), protohost || "/" === req.url[0] || (req.url = "/" + req.url, slashAdded = !0), req.baseUrl = parentUrl + ("/" === removed[removed.length - 1] ? removed.substring(0, removed.length - 1) : removed); } debug("%s %s : %s", layer.name, layerPath, req.originalUrl), layerError ? layer.handle_error(layerError, req, res, next) : layer.handle_request(req, res, next); })(layer, layerError, layerPath, path), sync = 0; })); } else defer(done, null); } req.next = next, "OPTIONS" === req.method && (old = done, fn = (function(res, methods) { return function(fn, err) { if (err || 0 === methods.length) return fn(err); !(function(res, methods, next) { try { !(function(res, methods) { for (var options = Object.create(null), i = 0; i < methods.length; i++) options[methods[i]] = !0; var allow = Object.keys(options).sort().join(", "); res.setHeader("Allow", allow), res.setHeader("Content-Length", Buffer.byteLength(allow)), res.setHeader("Content-Type", "text/plain"), res.setHeader("X-Content-Type-Options", "nosniff"), res.end(allow); })(res, methods); } catch (err) { next(err); } })(res, methods, fn); }; })(res, methods = []), done = function() { var args = new Array(arguments.length + 1); args[0] = old; for (var i = 0, len = arguments.length; i < len; i++) args[i + 1] = arguments[i]; fn.apply(this, args); }), req.baseUrl = parentUrl, req.originalUrl = req.originalUrl || req.url, next(); }, Router.prototype.process_params = function(layer, called, req, res, done) { var params = this.params, keys = layer.keys; if (!keys || 0 === keys.length) return done(); var name, key, paramVal, paramCallbacks, paramCalled, i = 0, paramIndex = 0; function param(err) { return err ? done(err) : i >= keys.length ? done() : (paramIndex = 0, key = keys[i++], name = key.name, paramVal = req.params[name], paramCallbacks = params[name], paramCalled = called[name], void 0 !== paramVal && paramCallbacks ? paramCalled && (paramCalled.match === paramVal || paramCalled.error && "route" !== paramCalled.error) ? (req.params[name] = paramCalled.value, param(paramCalled.error)) : (called[name] = paramCalled = { error: null, match: paramVal, value: paramVal }, void paramCallback()) : param()); } function paramCallback(err) { var fn = paramCallbacks[paramIndex++]; if (paramCalled.value = req.params[key.name], err) return paramCalled.error = err, void param(err); if (!fn) return param(); try { fn(req, res, paramCallback, paramVal, key.name); } catch (e) { paramCallback(e); } } param(); }, Router.prototype.use = function(handler) { var offset = 0, path = "/"; if ("function" != typeof handler) { for (var arg = handler; Array.isArray(arg) && 0 !== arg.length; ) arg = arg[0]; "function" != typeof arg && (offset = 1, path = handler); } var callbacks = flatten(slice.call(arguments, offset)); if (0 === callbacks.length) throw new TypeError("argument handler is required"); for (var i = 0; i < callbacks.length; i++) { var fn = callbacks[i]; if ("function" != typeof fn) throw new TypeError("argument handler must be a function"); debug("use %o %s", path, fn.name || ""); var layer = new Layer(path, { sensitive: this.caseSensitive, strict: !1, end: !1 }, fn); layer.route = void 0, this.stack.push(layer); } return this; }, Router.prototype.route = function(path) { var route = new Route(path), layer = new Layer(path, { sensitive: this.caseSensitive, strict: this.strict, end: !0 }, (function(req, res, next) { route.dispatch(req, res, next); })); return layer.route = route, this.stack.push(layer), route; }, methods.concat("all").forEach((function(method) { Router.prototype[method] = function(path) { var route = this.route(path); return route[method].apply(route, slice.call(arguments, 1)), this; }; })); }, function(module, exports, __webpack_require__) { module.exports = Fingerprint; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(31), crypto = __webpack_require__(6), errs = __webpack_require__(48), Key = __webpack_require__(27), PrivateKey = __webpack_require__(29), Certificate = __webpack_require__(114), utils = __webpack_require__(28), FingerprintFormatError = errs.FingerprintFormatError, InvalidAlgorithmError = errs.InvalidAlgorithmError; function Fingerprint(opts) { if (assert.object(opts, "options"), assert.string(opts.type, "options.type"), assert.buffer(opts.hash, "options.hash"), assert.string(opts.algorithm, "options.algorithm"), this.algorithm = opts.algorithm.toLowerCase(), !0 !== algs.hashAlgs[this.algorithm]) throw new InvalidAlgorithmError(this.algorithm); this.hash = opts.hash, this.type = opts.type, this.hashType = opts.hashType; } Fingerprint.prototype.toString = function(format) { switch (void 0 === format && (format = "md5" === this.algorithm || "spki" === this.hashType ? "hex" : "base64"), assert.string(format), format) { case "hex": return "spki" === this.hashType ? this.hash.toString("hex") : this.hash.toString("hex").replace(/(.{2})(?=.)/g, "$1:"); case "base64": return "spki" === this.hashType ? this.hash.toString("base64") : (alg = this.algorithm, h = this.hash.toString("base64"), alg.toUpperCase() + ":" + h.replace(/=*$/, "")); default: throw new FingerprintFormatError(void 0, format); } var alg, h; }, Fingerprint.prototype.matches = function(other) { assert.object(other, "key or certificate"), "key" === this.type && "ssh" !== this.hashType ? (utils.assertCompatible(other, Key, [ 1, 7 ], "key with spki"), PrivateKey.isPrivateKey(other) && utils.assertCompatible(other, PrivateKey, [ 1, 6 ], "privatekey with spki support")) : "key" === this.type ? utils.assertCompatible(other, Key, [ 1, 0 ], "key") : utils.assertCompatible(other, Certificate, [ 1, 0 ], "certificate"); var theirHash = other.hash(this.algorithm, this.hashType), theirHash2 = crypto.createHash(this.algorithm).update(theirHash).digest("base64"); return void 0 === this.hash2 && (this.hash2 = crypto.createHash(this.algorithm).update(this.hash).digest("base64")), this.hash2 === theirHash2; }; var base64RE = /^[A-Za-z0-9+\/=]+$/, hexRE = /^[a-fA-F0-9]+$/; Fingerprint.parse = function(fp, options) { var alg, hash, enAlgs; assert.string(fp, "fingerprint"), Array.isArray(options) && (enAlgs = options, options = {}), assert.optionalObject(options, "options"), void 0 === options && (options = {}), void 0 !== options.enAlgs && (enAlgs = options.enAlgs), void 0 !== options.algorithms && (enAlgs = options.algorithms), assert.optionalArrayOfString(enAlgs, "algorithms"); var hashType = "ssh"; void 0 !== options.hashType && (hashType = options.hashType), assert.string(hashType, "options.hashType"); var parts = fp.split(":"); if (2 == parts.length) { if (alg = parts[0].toLowerCase(), !base64RE.test(parts[1])) throw new FingerprintFormatError(fp); try { hash = Buffer.from(parts[1], "base64"); } catch (e) { throw new FingerprintFormatError(fp); } } else if (parts.length > 2) { if (alg = "md5", "md5" === parts[0].toLowerCase() && (parts = parts.slice(1)), parts = (parts = parts.map((function(p) { for (;p.length < 2; ) p = "0" + p; if (p.length > 2) throw new FingerprintFormatError(fp); return p; }))).join(""), !hexRE.test(parts) || parts.length % 2 != 0) throw new FingerprintFormatError(fp); try { hash = Buffer.from(parts, "hex"); } catch (e) { throw new FingerprintFormatError(fp); } } else { if (hexRE.test(fp)) hash = Buffer.from(fp, "hex"); else { if (!base64RE.test(fp)) throw new FingerprintFormatError(fp); hash = Buffer.from(fp, "base64"); } switch (hash.length) { case 32: alg = "sha256"; break; case 16: alg = "md5"; break; case 20: alg = "sha1"; break; case 64: alg = "sha512"; break; default: throw new FingerprintFormatError(fp); } void 0 === options.hashType && (hashType = "spki"); } if (void 0 === alg) throw new FingerprintFormatError(fp); if (void 0 === algs.hashAlgs[alg]) throw new InvalidAlgorithmError(alg); if (void 0 !== enAlgs && -1 === (enAlgs = enAlgs.map((function(a) { return a.toLowerCase(); }))).indexOf(alg)) throw new InvalidAlgorithmError(alg); return new Fingerprint({ algorithm: alg, hash: hash, type: options.type || "key", hashType: hashType }); }, Fingerprint.isFingerprint = function(obj, ver) { return utils.isCompatible(obj, Fingerprint, ver); }, Fingerprint.prototype._sshpkApiVersion = [ 1, 2 ], Fingerprint._oldVersionDetect = function(obj) { return assert.func(obj.toString), assert.func(obj.matches), [ 1, 0 ]; }; }, function(module, exports, __webpack_require__) { (function() { var dbits; function BigInteger(a, b, c) { null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b)); } function nbi() { return new BigInteger(null); } var inBrowser = "undefined" != typeof navigator; inBrowser && "Microsoft Internet Explorer" == navigator.appName ? (BigInteger.prototype.am = function(i, x, w, j, c, n) { for (var xl = 32767 & x, xh = x >> 15; --n >= 0; ) { var l = 32767 & this[i], h = this[i++] >> 15, m = xh * l + h * xl; c = ((l = xl * l + ((32767 & m) << 15) + w[j] + (1073741823 & c)) >>> 30) + (m >>> 15) + xh * h + (c >>> 30), w[j++] = 1073741823 & l; } return c; }, dbits = 30) : inBrowser && "Netscape" != navigator.appName ? (BigInteger.prototype.am = function(i, x, w, j, c, n) { for (;--n >= 0; ) { var v = x * this[i++] + w[j] + c; c = Math.floor(v / 67108864), w[j++] = 67108863 & v; } return c; }, dbits = 26) : (BigInteger.prototype.am = function(i, x, w, j, c, n) { for (var xl = 16383 & x, xh = x >> 14; --n >= 0; ) { var l = 16383 & this[i], h = this[i++] >> 14, m = xh * l + h * xl; c = ((l = xl * l + ((16383 & m) << 14) + w[j] + c) >> 28) + (m >> 14) + xh * h, w[j++] = 268435455 & l; } return c; }, dbits = 28), BigInteger.prototype.DB = dbits, BigInteger.prototype.DM = (1 << dbits) - 1, BigInteger.prototype.DV = 1 << dbits, BigInteger.prototype.FV = Math.pow(2, 52), BigInteger.prototype.F1 = 52 - dbits, BigInteger.prototype.F2 = 2 * dbits - 52; var rr, vv, BI_RC = new Array; for (rr = "0".charCodeAt(0), vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; for (rr = "a".charCodeAt(0), vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; for (rr = "A".charCodeAt(0), vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; function int2char(n) { return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(n); } function intAt(s, i) { var c = BI_RC[s.charCodeAt(i)]; return null == c ? -1 : c; } function nbv(i) { var r = nbi(); return r.fromInt(i), r; } function nbits(x) { var t, r = 1; return 0 != (t = x >>> 16) && (x = t, r += 16), 0 != (t = x >> 8) && (x = t, r += 8), 0 != (t = x >> 4) && (x = t, r += 4), 0 != (t = x >> 2) && (x = t, r += 2), 0 != (t = x >> 1) && (x = t, r += 1), r; } function Classic(m) { this.m = m; } function Montgomery(m) { this.m = m, this.mp = m.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << m.DB - 15) - 1, this.mt2 = 2 * m.t; } function op_and(x, y) { return x & y; } function op_or(x, y) { return x | y; } function op_xor(x, y) { return x ^ y; } function op_andnot(x, y) { return x & ~y; } function lbit(x) { if (0 == x) return -1; var r = 0; return 0 == (65535 & x) && (x >>= 16, r += 16), 0 == (255 & x) && (x >>= 8, r += 8), 0 == (15 & x) && (x >>= 4, r += 4), 0 == (3 & x) && (x >>= 2, r += 2), 0 == (1 & x) && ++r, r; } function cbit(x) { for (var r = 0; 0 != x; ) x &= x - 1, ++r; return r; } function NullExp() {} function nNop(x) { return x; } function Barrett(m) { this.r2 = nbi(), this.q3 = nbi(), BigInteger.ONE.dlShiftTo(2 * m.t, this.r2), this.mu = this.r2.divide(m), this.m = m; } Classic.prototype.convert = function(x) { return x.s < 0 || x.compareTo(this.m) >= 0 ? x.mod(this.m) : x; }, Classic.prototype.revert = function(x) { return x; }, Classic.prototype.reduce = function(x) { x.divRemTo(this.m, null, x); }, Classic.prototype.mulTo = function(x, y, r) { x.multiplyTo(y, r), this.reduce(r); }, Classic.prototype.sqrTo = function(x, r) { x.squareTo(r), this.reduce(r); }, Montgomery.prototype.convert = function(x) { var r = nbi(); return x.abs().dlShiftTo(this.m.t, r), r.divRemTo(this.m, null, r), x.s < 0 && r.compareTo(BigInteger.ZERO) > 0 && this.m.subTo(r, r), r; }, Montgomery.prototype.revert = function(x) { var r = nbi(); return x.copyTo(r), this.reduce(r), r; }, Montgomery.prototype.reduce = function(x) { for (;x.t <= this.mt2; ) x[x.t++] = 0; for (var i = 0; i < this.m.t; ++i) { var j = 32767 & x[i], u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM; for (x[j = i + this.m.t] += this.m.am(0, u0, x, i, 0, this.m.t); x[j] >= x.DV; ) x[j] -= x.DV, x[++j]++; } x.clamp(), x.drShiftTo(this.m.t, x), x.compareTo(this.m) >= 0 && x.subTo(this.m, x); }, Montgomery.prototype.mulTo = function(x, y, r) { x.multiplyTo(y, r), this.reduce(r); }, Montgomery.prototype.sqrTo = function(x, r) { x.squareTo(r), this.reduce(r); }, BigInteger.prototype.copyTo = function(r) { for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]; r.t = this.t, r.s = this.s; }, BigInteger.prototype.fromInt = function(x) { this.t = 1, this.s = x < 0 ? -1 : 0, x > 0 ? this[0] = x : x < -1 ? this[0] = x + this.DV : this.t = 0; }, BigInteger.prototype.fromString = function(s, b) { var k; if (16 == b) k = 4; else if (8 == b) k = 3; else if (256 == b) k = 8; else if (2 == b) k = 1; else if (32 == b) k = 5; else { if (4 != b) return void this.fromRadix(s, b); k = 2; } this.t = 0, this.s = 0; for (var i = s.length, mi = !1, sh = 0; --i >= 0; ) { var x = 8 == k ? 255 & s[i] : intAt(s, i); x < 0 ? "-" == s.charAt(i) && (mi = !0) : (mi = !1, 0 == sh ? this[this.t++] = x : sh + k > this.DB ? (this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh, this[this.t++] = x >> this.DB - sh) : this[this.t - 1] |= x << sh, (sh += k) >= this.DB && (sh -= this.DB)); } 8 == k && 0 != (128 & s[0]) && (this.s = -1, sh > 0 && (this[this.t - 1] |= (1 << this.DB - sh) - 1 << sh)), this.clamp(), mi && BigInteger.ZERO.subTo(this, this); }, BigInteger.prototype.clamp = function() { for (var c = this.s & this.DM; this.t > 0 && this[this.t - 1] == c; ) --this.t; }, BigInteger.prototype.dlShiftTo = function(n, r) { var i; for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]; for (i = n - 1; i >= 0; --i) r[i] = 0; r.t = this.t + n, r.s = this.s; }, BigInteger.prototype.drShiftTo = function(n, r) { for (var i = n; i < this.t; ++i) r[i - n] = this[i]; r.t = Math.max(this.t - n, 0), r.s = this.s; }, BigInteger.prototype.lShiftTo = function(n, r) { var i, bs = n % this.DB, cbs = this.DB - bs, bm = (1 << cbs) - 1, ds = Math.floor(n / this.DB), c = this.s << bs & this.DM; for (i = this.t - 1; i >= 0; --i) r[i + ds + 1] = this[i] >> cbs | c, c = (this[i] & bm) << bs; for (i = ds - 1; i >= 0; --i) r[i] = 0; r[ds] = c, r.t = this.t + ds + 1, r.s = this.s, r.clamp(); }, BigInteger.prototype.rShiftTo = function(n, r) { r.s = this.s; var ds = Math.floor(n / this.DB); if (ds >= this.t) r.t = 0; else { var bs = n % this.DB, cbs = this.DB - bs, bm = (1 << bs) - 1; r[0] = this[ds] >> bs; for (var i = ds + 1; i < this.t; ++i) r[i - ds - 1] |= (this[i] & bm) << cbs, r[i - ds] = this[i] >> bs; bs > 0 && (r[this.t - ds - 1] |= (this.s & bm) << cbs), r.t = this.t - ds, r.clamp(); } }, BigInteger.prototype.subTo = function(a, r) { for (var i = 0, c = 0, m = Math.min(a.t, this.t); i < m; ) c += this[i] - a[i], r[i++] = c & this.DM, c >>= this.DB; if (a.t < this.t) { for (c -= a.s; i < this.t; ) c += this[i], r[i++] = c & this.DM, c >>= this.DB; c += this.s; } else { for (c += this.s; i < a.t; ) c -= a[i], r[i++] = c & this.DM, c >>= this.DB; c -= a.s; } r.s = c < 0 ? -1 : 0, c < -1 ? r[i++] = this.DV + c : c > 0 && (r[i++] = c), r.t = i, r.clamp(); }, BigInteger.prototype.multiplyTo = function(a, r) { var x = this.abs(), y = a.abs(), i = x.t; for (r.t = i + y.t; --i >= 0; ) r[i] = 0; for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t); r.s = 0, r.clamp(), this.s != a.s && BigInteger.ZERO.subTo(r, r); }, BigInteger.prototype.squareTo = function(r) { for (var x = this.abs(), i = r.t = 2 * x.t; --i >= 0; ) r[i] = 0; for (i = 0; i < x.t - 1; ++i) { var c = x.am(i, x[i], r, 2 * i, 0, 1); (r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV && (r[i + x.t] -= x.DV, r[i + x.t + 1] = 1); } r.t > 0 && (r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1)), r.s = 0, r.clamp(); }, BigInteger.prototype.divRemTo = function(m, q, r) { var pm = m.abs(); if (!(pm.t <= 0)) { var pt = this.abs(); if (pt.t < pm.t) return null != q && q.fromInt(0), void (null != r && this.copyTo(r)); null == r && (r = nbi()); var y = nbi(), ts = this.s, ms = m.s, nsh = this.DB - nbits(pm[pm.t - 1]); nsh > 0 ? (pm.lShiftTo(nsh, y), pt.lShiftTo(nsh, r)) : (pm.copyTo(y), pt.copyTo(r)); var ys = y.t, y0 = y[ys - 1]; if (0 != y0) { var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0), d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2, i = r.t, j = i - ys, t = null == q ? nbi() : q; for (y.dlShiftTo(j, t), r.compareTo(t) >= 0 && (r[r.t++] = 1, r.subTo(t, r)), BigInteger.ONE.dlShiftTo(ys, t), t.subTo(y, y); y.t < ys; ) y[y.t++] = 0; for (;--j >= 0; ) { var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2); if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) for (y.dlShiftTo(j, t), r.subTo(t, r); r[i] < --qd; ) r.subTo(t, r); } null != q && (r.drShiftTo(ys, q), ts != ms && BigInteger.ZERO.subTo(q, q)), r.t = ys, r.clamp(), nsh > 0 && r.rShiftTo(nsh, r), ts < 0 && BigInteger.ZERO.subTo(r, r); } } }, BigInteger.prototype.invDigit = function() { if (this.t < 1) return 0; var x = this[0]; if (0 == (1 & x)) return 0; var y = 3 & x; return (y = (y = (y = (y = y * (2 - (15 & x) * y) & 15) * (2 - (255 & x) * y) & 255) * (2 - ((65535 & x) * y & 65535)) & 65535) * (2 - x * y % this.DV) % this.DV) > 0 ? this.DV - y : -y; }, BigInteger.prototype.isEven = function() { return 0 == (this.t > 0 ? 1 & this[0] : this.s); }, BigInteger.prototype.exp = function(e, z) { if (e > 4294967295 || e < 1) return BigInteger.ONE; var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e) - 1; for (g.copyTo(r); --i >= 0; ) if (z.sqrTo(r, r2), (e & 1 << i) > 0) z.mulTo(r2, g, r); else { var t = r; r = r2, r2 = t; } return z.revert(r); }, BigInteger.prototype.toString = function(b) { if (this.s < 0) return "-" + this.negate().toString(b); var k; if (16 == b) k = 4; else if (8 == b) k = 3; else if (2 == b) k = 1; else if (32 == b) k = 5; else { if (4 != b) return this.toRadix(b); k = 2; } var d, km = (1 << k) - 1, m = !1, r = "", i = this.t, p = this.DB - i * this.DB % k; if (i-- > 0) for (p < this.DB && (d = this[i] >> p) > 0 && (m = !0, r = int2char(d)); i >= 0; ) p < k ? (d = (this[i] & (1 << p) - 1) << k - p, d |= this[--i] >> (p += this.DB - k)) : (d = this[i] >> (p -= k) & km, p <= 0 && (p += this.DB, --i)), d > 0 && (m = !0), m && (r += int2char(d)); return m ? r : "0"; }, BigInteger.prototype.negate = function() { var r = nbi(); return BigInteger.ZERO.subTo(this, r), r; }, BigInteger.prototype.abs = function() { return this.s < 0 ? this.negate() : this; }, BigInteger.prototype.compareTo = function(a) { var r = this.s - a.s; if (0 != r) return r; var i = this.t; if (0 != (r = i - a.t)) return this.s < 0 ? -r : r; for (;--i >= 0; ) if (0 != (r = this[i] - a[i])) return r; return 0; }, BigInteger.prototype.bitLength = function() { return this.t <= 0 ? 0 : this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM); }, BigInteger.prototype.mod = function(a) { var r = nbi(); return this.abs().divRemTo(a, null, r), this.s < 0 && r.compareTo(BigInteger.ZERO) > 0 && a.subTo(r, r), r; }, BigInteger.prototype.modPowInt = function(e, m) { var z; return z = e < 256 || m.isEven() ? new Classic(m) : new Montgomery(m), this.exp(e, z); }, BigInteger.ZERO = nbv(0), BigInteger.ONE = nbv(1), NullExp.prototype.convert = nNop, NullExp.prototype.revert = nNop, NullExp.prototype.mulTo = function(x, y, r) { x.multiplyTo(y, r); }, NullExp.prototype.sqrTo = function(x, r) { x.squareTo(r); }, Barrett.prototype.convert = function(x) { if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m); if (x.compareTo(this.m) < 0) return x; var r = nbi(); return x.copyTo(r), this.reduce(r), r; }, Barrett.prototype.revert = function(x) { return x; }, Barrett.prototype.reduce = function(x) { for (x.drShiftTo(this.m.t - 1, this.r2), x.t > this.m.t + 1 && (x.t = this.m.t + 1, x.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); x.compareTo(this.r2) < 0; ) x.dAddOffset(1, this.m.t + 1); for (x.subTo(this.r2, x); x.compareTo(this.m) >= 0; ) x.subTo(this.m, x); }, Barrett.prototype.mulTo = function(x, y, r) { x.multiplyTo(y, r), this.reduce(r); }, Barrett.prototype.sqrTo = function(x, r) { x.squareTo(r), this.reduce(r); }; var rng_state, rng_pool, rng_pptr, lowprimes = [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 ], lplim = (1 << 26) / lowprimes[lowprimes.length - 1]; function rng_seed_time() { var x; x = (new Date).getTime(), rng_pool[rng_pptr++] ^= 255 & x, rng_pool[rng_pptr++] ^= x >> 8 & 255, rng_pool[rng_pptr++] ^= x >> 16 & 255, rng_pool[rng_pptr++] ^= x >> 24 & 255, rng_pptr >= rng_psize && (rng_pptr -= rng_psize); } if (BigInteger.prototype.chunkSize = function(r) { return Math.floor(Math.LN2 * this.DB / Math.log(r)); }, BigInteger.prototype.toRadix = function(b) { if (null == b && (b = 10), 0 == this.signum() || b < 2 || b > 36) return "0"; var cs = this.chunkSize(b), a = Math.pow(b, cs), d = nbv(a), y = nbi(), z = nbi(), r = ""; for (this.divRemTo(d, y, z); y.signum() > 0; ) r = (a + z.intValue()).toString(b).substr(1) + r, y.divRemTo(d, y, z); return z.intValue().toString(b) + r; }, BigInteger.prototype.fromRadix = function(s, b) { this.fromInt(0), null == b && (b = 10); for (var cs = this.chunkSize(b), d = Math.pow(b, cs), mi = !1, j = 0, w = 0, i = 0; i < s.length; ++i) { var x = intAt(s, i); x < 0 ? "-" == s.charAt(i) && 0 == this.signum() && (mi = !0) : (w = b * w + x, ++j >= cs && (this.dMultiply(d), this.dAddOffset(w, 0), j = 0, w = 0)); } j > 0 && (this.dMultiply(Math.pow(b, j)), this.dAddOffset(w, 0)), mi && BigInteger.ZERO.subTo(this, this); }, BigInteger.prototype.fromNumber = function(a, b, c) { if ("number" == typeof b) if (a < 2) this.fromInt(1); else for (this.fromNumber(a, c), this.testBit(a - 1) || this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(b); ) this.dAddOffset(2, 0), this.bitLength() > a && this.subTo(BigInteger.ONE.shiftLeft(a - 1), this); else { var x = new Array, t = 7 & a; x.length = 1 + (a >> 3), b.nextBytes(x), t > 0 ? x[0] &= (1 << t) - 1 : x[0] = 0, this.fromString(x, 256); } }, BigInteger.prototype.bitwiseTo = function(a, op, r) { var i, f, m = Math.min(a.t, this.t); for (i = 0; i < m; ++i) r[i] = op(this[i], a[i]); if (a.t < this.t) { for (f = a.s & this.DM, i = m; i < this.t; ++i) r[i] = op(this[i], f); r.t = this.t; } else { for (f = this.s & this.DM, i = m; i < a.t; ++i) r[i] = op(f, a[i]); r.t = a.t; } r.s = op(this.s, a.s), r.clamp(); }, BigInteger.prototype.changeBit = function(n, op) { var r = BigInteger.ONE.shiftLeft(n); return this.bitwiseTo(r, op, r), r; }, BigInteger.prototype.addTo = function(a, r) { for (var i = 0, c = 0, m = Math.min(a.t, this.t); i < m; ) c += this[i] + a[i], r[i++] = c & this.DM, c >>= this.DB; if (a.t < this.t) { for (c += a.s; i < this.t; ) c += this[i], r[i++] = c & this.DM, c >>= this.DB; c += this.s; } else { for (c += this.s; i < a.t; ) c += a[i], r[i++] = c & this.DM, c >>= this.DB; c += a.s; } r.s = c < 0 ? -1 : 0, c > 0 ? r[i++] = c : c < -1 && (r[i++] = this.DV + c), r.t = i, r.clamp(); }, BigInteger.prototype.dMultiply = function(n) { this[this.t] = this.am(0, n - 1, this, 0, 0, this.t), ++this.t, this.clamp(); }, BigInteger.prototype.dAddOffset = function(n, w) { if (0 != n) { for (;this.t <= w; ) this[this.t++] = 0; for (this[w] += n; this[w] >= this.DV; ) this[w] -= this.DV, ++w >= this.t && (this[this.t++] = 0), ++this[w]; } }, BigInteger.prototype.multiplyLowerTo = function(a, n, r) { var j, i = Math.min(this.t + a.t, n); for (r.s = 0, r.t = i; i > 0; ) r[--i] = 0; for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t); for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i); r.clamp(); }, BigInteger.prototype.multiplyUpperTo = function(a, n, r) { --n; var i = r.t = this.t + a.t - n; for (r.s = 0; --i >= 0; ) r[i] = 0; for (i = Math.max(n - this.t, 0); i < a.t; ++i) r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n); r.clamp(), r.drShiftTo(1, r); }, BigInteger.prototype.modInt = function(n) { if (n <= 0) return 0; var d = this.DV % n, r = this.s < 0 ? n - 1 : 0; if (this.t > 0) if (0 == d) r = this[0] % n; else for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n; return r; }, BigInteger.prototype.millerRabin = function(t) { var n1 = this.subtract(BigInteger.ONE), k = n1.getLowestSetBit(); if (k <= 0) return !1; var r = n1.shiftRight(k); (t = t + 1 >> 1) > lowprimes.length && (t = lowprimes.length); for (var a = nbi(), i = 0; i < t; ++i) { a.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]); var y = a.modPow(r, this); if (0 != y.compareTo(BigInteger.ONE) && 0 != y.compareTo(n1)) { for (var j = 1; j++ < k && 0 != y.compareTo(n1); ) if (0 == (y = y.modPowInt(2, this)).compareTo(BigInteger.ONE)) return !1; if (0 != y.compareTo(n1)) return !1; } } return !0; }, BigInteger.prototype.clone = function() { var r = nbi(); return this.copyTo(r), r; }, BigInteger.prototype.intValue = function() { if (this.s < 0) { if (1 == this.t) return this[0] - this.DV; if (0 == this.t) return -1; } else { if (1 == this.t) return this[0]; if (0 == this.t) return 0; } return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]; }, BigInteger.prototype.byteValue = function() { return 0 == this.t ? this.s : this[0] << 24 >> 24; }, BigInteger.prototype.shortValue = function() { return 0 == this.t ? this.s : this[0] << 16 >> 16; }, BigInteger.prototype.signum = function() { return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1; }, BigInteger.prototype.toByteArray = function() { var i = this.t, r = new Array; r[0] = this.s; var d, p = this.DB - i * this.DB % 8, k = 0; if (i-- > 0) for (p < this.DB && (d = this[i] >> p) != (this.s & this.DM) >> p && (r[k++] = d | this.s << this.DB - p); i >= 0; ) p < 8 ? (d = (this[i] & (1 << p) - 1) << 8 - p, d |= this[--i] >> (p += this.DB - 8)) : (d = this[i] >> (p -= 8) & 255, p <= 0 && (p += this.DB, --i)), 0 != (128 & d) && (d |= -256), 0 == k && (128 & this.s) != (128 & d) && ++k, (k > 0 || d != this.s) && (r[k++] = d); return r; }, BigInteger.prototype.equals = function(a) { return 0 == this.compareTo(a); }, BigInteger.prototype.min = function(a) { return this.compareTo(a) < 0 ? this : a; }, BigInteger.prototype.max = function(a) { return this.compareTo(a) > 0 ? this : a; }, BigInteger.prototype.and = function(a) { var r = nbi(); return this.bitwiseTo(a, op_and, r), r; }, BigInteger.prototype.or = function(a) { var r = nbi(); return this.bitwiseTo(a, op_or, r), r; }, BigInteger.prototype.xor = function(a) { var r = nbi(); return this.bitwiseTo(a, op_xor, r), r; }, BigInteger.prototype.andNot = function(a) { var r = nbi(); return this.bitwiseTo(a, op_andnot, r), r; }, BigInteger.prototype.not = function() { for (var r = nbi(), i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]; return r.t = this.t, r.s = ~this.s, r; }, BigInteger.prototype.shiftLeft = function(n) { var r = nbi(); return n < 0 ? this.rShiftTo(-n, r) : this.lShiftTo(n, r), r; }, BigInteger.prototype.shiftRight = function(n) { var r = nbi(); return n < 0 ? this.lShiftTo(-n, r) : this.rShiftTo(n, r), r; }, BigInteger.prototype.getLowestSetBit = function() { for (var i = 0; i < this.t; ++i) if (0 != this[i]) return i * this.DB + lbit(this[i]); return this.s < 0 ? this.t * this.DB : -1; }, BigInteger.prototype.bitCount = function() { for (var r = 0, x = this.s & this.DM, i = 0; i < this.t; ++i) r += cbit(this[i] ^ x); return r; }, BigInteger.prototype.testBit = function(n) { var j = Math.floor(n / this.DB); return j >= this.t ? 0 != this.s : 0 != (this[j] & 1 << n % this.DB); }, BigInteger.prototype.setBit = function(n) { return this.changeBit(n, op_or); }, BigInteger.prototype.clearBit = function(n) { return this.changeBit(n, op_andnot); }, BigInteger.prototype.flipBit = function(n) { return this.changeBit(n, op_xor); }, BigInteger.prototype.add = function(a) { var r = nbi(); return this.addTo(a, r), r; }, BigInteger.prototype.subtract = function(a) { var r = nbi(); return this.subTo(a, r), r; }, BigInteger.prototype.multiply = function(a) { var r = nbi(); return this.multiplyTo(a, r), r; }, BigInteger.prototype.divide = function(a) { var r = nbi(); return this.divRemTo(a, r, null), r; }, BigInteger.prototype.remainder = function(a) { var r = nbi(); return this.divRemTo(a, null, r), r; }, BigInteger.prototype.divideAndRemainder = function(a) { var q = nbi(), r = nbi(); return this.divRemTo(a, q, r), new Array(q, r); }, BigInteger.prototype.modPow = function(e, m) { var k, z, i = e.bitLength(), r = nbv(1); if (i <= 0) return r; k = i < 18 ? 1 : i < 48 ? 3 : i < 144 ? 4 : i < 768 ? 5 : 6, z = i < 8 ? new Classic(m) : m.isEven() ? new Barrett(m) : new Montgomery(m); var g = new Array, n = 3, k1 = k - 1, km = (1 << k) - 1; if (g[1] = z.convert(this), k > 1) { var g2 = nbi(); for (z.sqrTo(g[1], g2); n <= km; ) g[n] = nbi(), z.mulTo(g2, g[n - 2], g[n]), n += 2; } var w, t, j = e.t - 1, is1 = !0, r2 = nbi(); for (i = nbits(e[j]) - 1; j >= 0; ) { for (i >= k1 ? w = e[j] >> i - k1 & km : (w = (e[j] & (1 << i + 1) - 1) << k1 - i, j > 0 && (w |= e[j - 1] >> this.DB + i - k1)), n = k; 0 == (1 & w); ) w >>= 1, --n; if ((i -= n) < 0 && (i += this.DB, --j), is1) g[w].copyTo(r), is1 = !1; else { for (;n > 1; ) z.sqrTo(r, r2), z.sqrTo(r2, r), n -= 2; n > 0 ? z.sqrTo(r, r2) : (t = r, r = r2, r2 = t), z.mulTo(r2, g[w], r); } for (;j >= 0 && 0 == (e[j] & 1 << i); ) z.sqrTo(r, r2), t = r, r = r2, r2 = t, --i < 0 && (i = this.DB - 1, --j); } return z.revert(r); }, BigInteger.prototype.modInverse = function(m) { var ac = m.isEven(); if (this.isEven() && ac || 0 == m.signum()) return BigInteger.ZERO; for (var u = m.clone(), v = this.clone(), a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); 0 != u.signum(); ) { for (;u.isEven(); ) u.rShiftTo(1, u), ac ? (a.isEven() && b.isEven() || (a.addTo(this, a), b.subTo(m, b)), a.rShiftTo(1, a)) : b.isEven() || b.subTo(m, b), b.rShiftTo(1, b); for (;v.isEven(); ) v.rShiftTo(1, v), ac ? (c.isEven() && d.isEven() || (c.addTo(this, c), d.subTo(m, d)), c.rShiftTo(1, c)) : d.isEven() || d.subTo(m, d), d.rShiftTo(1, d); u.compareTo(v) >= 0 ? (u.subTo(v, u), ac && a.subTo(c, a), b.subTo(d, b)) : (v.subTo(u, v), ac && c.subTo(a, c), d.subTo(b, d)); } return 0 != v.compareTo(BigInteger.ONE) ? BigInteger.ZERO : d.compareTo(m) >= 0 ? d.subtract(m) : d.signum() < 0 ? (d.addTo(m, d), d.signum() < 0 ? d.add(m) : d) : d; }, BigInteger.prototype.pow = function(e) { return this.exp(e, new NullExp); }, BigInteger.prototype.gcd = function(a) { var x = this.s < 0 ? this.negate() : this.clone(), y = a.s < 0 ? a.negate() : a.clone(); if (x.compareTo(y) < 0) { var t = x; x = y, y = t; } var i = x.getLowestSetBit(), g = y.getLowestSetBit(); if (g < 0) return x; for (i < g && (g = i), g > 0 && (x.rShiftTo(g, x), y.rShiftTo(g, y)); x.signum() > 0; ) (i = x.getLowestSetBit()) > 0 && x.rShiftTo(i, x), (i = y.getLowestSetBit()) > 0 && y.rShiftTo(i, y), x.compareTo(y) >= 0 ? (x.subTo(y, x), x.rShiftTo(1, x)) : (y.subTo(x, y), y.rShiftTo(1, y)); return g > 0 && y.lShiftTo(g, y), y; }, BigInteger.prototype.isProbablePrime = function(t) { var i, x = this.abs(); if (1 == x.t && x[0] <= lowprimes[lowprimes.length - 1]) { for (i = 0; i < lowprimes.length; ++i) if (x[0] == lowprimes[i]) return !0; return !1; } if (x.isEven()) return !1; for (i = 1; i < lowprimes.length; ) { for (var m = lowprimes[i], j = i + 1; j < lowprimes.length && m < lplim; ) m *= lowprimes[j++]; for (m = x.modInt(m); i < j; ) if (m % lowprimes[i++] == 0) return !1; } return x.millerRabin(t); }, BigInteger.prototype.square = function() { var r = nbi(); return this.squareTo(r), r; }, BigInteger.prototype.Barrett = Barrett, null == rng_pool) { var t; if (rng_pool = new Array, rng_pptr = 0, "undefined" != typeof window && window.crypto) if (window.crypto.getRandomValues) { var ua = new Uint8Array(32); for (window.crypto.getRandomValues(ua), t = 0; t < 32; ++t) rng_pool[rng_pptr++] = ua[t]; } else if ("Netscape" == navigator.appName && navigator.appVersion < "5") { var z = window.crypto.random(32); for (t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = 255 & z.charCodeAt(t); } for (;rng_pptr < rng_psize; ) t = Math.floor(65536 * Math.random()), rng_pool[rng_pptr++] = t >>> 8, rng_pool[rng_pptr++] = 255 & t; rng_pptr = 0, rng_seed_time(); } function rng_get_byte() { if (null == rng_state) { for (rng_seed_time(), (rng_state = new Arcfour).init(rng_pool), rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0; rng_pptr = 0; } return rng_state.next(); } function SecureRandom() {} function Arcfour() { this.i = 0, this.j = 0, this.S = new Array; } SecureRandom.prototype.nextBytes = function(ba) { var i; for (i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); }, Arcfour.prototype.init = function(key) { var i, j, t; for (i = 0; i < 256; ++i) this.S[i] = i; for (j = 0, i = 0; i < 256; ++i) j = j + this.S[i] + key[i % key.length] & 255, t = this.S[i], this.S[i] = this.S[j], this.S[j] = t; this.i = 0, this.j = 0; }, Arcfour.prototype.next = function() { var t; return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255]; }; var rng_psize = 256; BigInteger.SecureRandom = SecureRandom, BigInteger.BigInteger = BigInteger, module.exports = BigInteger; }).call(this); }, function(module, exports, __webpack_require__) { !(function(nacl) { "use strict"; var gf = function(init) { var i, r = new Float64Array(16); if (init) for (i = 0; i < init.length; i++) r[i] = init[i]; return r; }, randombytes = function() { throw new Error("no PRNG"); }, _0 = new Uint8Array(16), _9 = new Uint8Array(32); _9[0] = 9; var gf0 = gf(), gf1 = gf([ 1 ]), _121665 = gf([ 56129, 1 ]), D = gf([ 30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995 ]), D2 = gf([ 61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222 ]), X = gf([ 54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553 ]), Y = gf([ 26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214 ]), I = gf([ 41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139 ]); function ts64(x, i, h, l) { x[i] = h >> 24 & 255, x[i + 1] = h >> 16 & 255, x[i + 2] = h >> 8 & 255, x[i + 3] = 255 & h, x[i + 4] = l >> 24 & 255, x[i + 5] = l >> 16 & 255, x[i + 6] = l >> 8 & 255, x[i + 7] = 255 & l; } function vn(x, xi, y, yi, n) { var i, d = 0; for (i = 0; i < n; i++) d |= x[xi + i] ^ y[yi + i]; return (1 & d - 1 >>> 8) - 1; } function crypto_verify_16(x, xi, y, yi) { return vn(x, xi, y, yi, 16); } function crypto_verify_32(x, xi, y, yi) { return vn(x, xi, y, yi, 32); } function crypto_core_salsa20(out, inp, k, c) { !(function(o, p, k, c) { for (var u, j0 = 255 & c[0] | (255 & c[1]) << 8 | (255 & c[2]) << 16 | (255 & c[3]) << 24, j1 = 255 & k[0] | (255 & k[1]) << 8 | (255 & k[2]) << 16 | (255 & k[3]) << 24, j2 = 255 & k[4] | (255 & k[5]) << 8 | (255 & k[6]) << 16 | (255 & k[7]) << 24, j3 = 255 & k[8] | (255 & k[9]) << 8 | (255 & k[10]) << 16 | (255 & k[11]) << 24, j4 = 255 & k[12] | (255 & k[13]) << 8 | (255 & k[14]) << 16 | (255 & k[15]) << 24, j5 = 255 & c[4] | (255 & c[5]) << 8 | (255 & c[6]) << 16 | (255 & c[7]) << 24, j6 = 255 & p[0] | (255 & p[1]) << 8 | (255 & p[2]) << 16 | (255 & p[3]) << 24, j7 = 255 & p[4] | (255 & p[5]) << 8 | (255 & p[6]) << 16 | (255 & p[7]) << 24, j8 = 255 & p[8] | (255 & p[9]) << 8 | (255 & p[10]) << 16 | (255 & p[11]) << 24, j9 = 255 & p[12] | (255 & p[13]) << 8 | (255 & p[14]) << 16 | (255 & p[15]) << 24, j10 = 255 & c[8] | (255 & c[9]) << 8 | (255 & c[10]) << 16 | (255 & c[11]) << 24, j11 = 255 & k[16] | (255 & k[17]) << 8 | (255 & k[18]) << 16 | (255 & k[19]) << 24, j12 = 255 & k[20] | (255 & k[21]) << 8 | (255 & k[22]) << 16 | (255 & k[23]) << 24, j13 = 255 & k[24] | (255 & k[25]) << 8 | (255 & k[26]) << 16 | (255 & k[27]) << 24, j14 = 255 & k[28] | (255 & k[29]) << 8 | (255 & k[30]) << 16 | (255 & k[31]) << 24, j15 = 255 & c[12] | (255 & c[13]) << 8 | (255 & c[14]) << 16 | (255 & c[15]) << 24, x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, i = 0; i < 20; i += 2) x0 ^= (u = (x12 ^= (u = (x8 ^= (u = (x4 ^= (u = x0 + x12 | 0) << 7 | u >>> 25) + x0 | 0) << 9 | u >>> 23) + x4 | 0) << 13 | u >>> 19) + x8 | 0) << 18 | u >>> 14, x5 ^= (u = (x1 ^= (u = (x13 ^= (u = (x9 ^= (u = x5 + x1 | 0) << 7 | u >>> 25) + x5 | 0) << 9 | u >>> 23) + x9 | 0) << 13 | u >>> 19) + x13 | 0) << 18 | u >>> 14, x10 ^= (u = (x6 ^= (u = (x2 ^= (u = (x14 ^= (u = x10 + x6 | 0) << 7 | u >>> 25) + x10 | 0) << 9 | u >>> 23) + x14 | 0) << 13 | u >>> 19) + x2 | 0) << 18 | u >>> 14, x15 ^= (u = (x11 ^= (u = (x7 ^= (u = (x3 ^= (u = x15 + x11 | 0) << 7 | u >>> 25) + x15 | 0) << 9 | u >>> 23) + x3 | 0) << 13 | u >>> 19) + x7 | 0) << 18 | u >>> 14, x0 ^= (u = (x3 ^= (u = (x2 ^= (u = (x1 ^= (u = x0 + x3 | 0) << 7 | u >>> 25) + x0 | 0) << 9 | u >>> 23) + x1 | 0) << 13 | u >>> 19) + x2 | 0) << 18 | u >>> 14, x5 ^= (u = (x4 ^= (u = (x7 ^= (u = (x6 ^= (u = x5 + x4 | 0) << 7 | u >>> 25) + x5 | 0) << 9 | u >>> 23) + x6 | 0) << 13 | u >>> 19) + x7 | 0) << 18 | u >>> 14, x10 ^= (u = (x9 ^= (u = (x8 ^= (u = (x11 ^= (u = x10 + x9 | 0) << 7 | u >>> 25) + x10 | 0) << 9 | u >>> 23) + x11 | 0) << 13 | u >>> 19) + x8 | 0) << 18 | u >>> 14, x15 ^= (u = (x14 ^= (u = (x13 ^= (u = (x12 ^= (u = x15 + x14 | 0) << 7 | u >>> 25) + x15 | 0) << 9 | u >>> 23) + x12 | 0) << 13 | u >>> 19) + x13 | 0) << 18 | u >>> 14; x0 = x0 + j0 | 0, x1 = x1 + j1 | 0, x2 = x2 + j2 | 0, x3 = x3 + j3 | 0, x4 = x4 + j4 | 0, x5 = x5 + j5 | 0, x6 = x6 + j6 | 0, x7 = x7 + j7 | 0, x8 = x8 + j8 | 0, x9 = x9 + j9 | 0, x10 = x10 + j10 | 0, x11 = x11 + j11 | 0, x12 = x12 + j12 | 0, x13 = x13 + j13 | 0, x14 = x14 + j14 | 0, x15 = x15 + j15 | 0, o[0] = x0 >>> 0 & 255, o[1] = x0 >>> 8 & 255, o[2] = x0 >>> 16 & 255, o[3] = x0 >>> 24 & 255, o[4] = x1 >>> 0 & 255, o[5] = x1 >>> 8 & 255, o[6] = x1 >>> 16 & 255, o[7] = x1 >>> 24 & 255, o[8] = x2 >>> 0 & 255, o[9] = x2 >>> 8 & 255, o[10] = x2 >>> 16 & 255, o[11] = x2 >>> 24 & 255, o[12] = x3 >>> 0 & 255, o[13] = x3 >>> 8 & 255, o[14] = x3 >>> 16 & 255, o[15] = x3 >>> 24 & 255, o[16] = x4 >>> 0 & 255, o[17] = x4 >>> 8 & 255, o[18] = x4 >>> 16 & 255, o[19] = x4 >>> 24 & 255, o[20] = x5 >>> 0 & 255, o[21] = x5 >>> 8 & 255, o[22] = x5 >>> 16 & 255, o[23] = x5 >>> 24 & 255, o[24] = x6 >>> 0 & 255, o[25] = x6 >>> 8 & 255, o[26] = x6 >>> 16 & 255, o[27] = x6 >>> 24 & 255, o[28] = x7 >>> 0 & 255, o[29] = x7 >>> 8 & 255, o[30] = x7 >>> 16 & 255, o[31] = x7 >>> 24 & 255, o[32] = x8 >>> 0 & 255, o[33] = x8 >>> 8 & 255, o[34] = x8 >>> 16 & 255, o[35] = x8 >>> 24 & 255, o[36] = x9 >>> 0 & 255, o[37] = x9 >>> 8 & 255, o[38] = x9 >>> 16 & 255, o[39] = x9 >>> 24 & 255, o[40] = x10 >>> 0 & 255, o[41] = x10 >>> 8 & 255, o[42] = x10 >>> 16 & 255, o[43] = x10 >>> 24 & 255, o[44] = x11 >>> 0 & 255, o[45] = x11 >>> 8 & 255, o[46] = x11 >>> 16 & 255, o[47] = x11 >>> 24 & 255, o[48] = x12 >>> 0 & 255, o[49] = x12 >>> 8 & 255, o[50] = x12 >>> 16 & 255, o[51] = x12 >>> 24 & 255, o[52] = x13 >>> 0 & 255, o[53] = x13 >>> 8 & 255, o[54] = x13 >>> 16 & 255, o[55] = x13 >>> 24 & 255, o[56] = x14 >>> 0 & 255, o[57] = x14 >>> 8 & 255, o[58] = x14 >>> 16 & 255, o[59] = x14 >>> 24 & 255, o[60] = x15 >>> 0 & 255, o[61] = x15 >>> 8 & 255, o[62] = x15 >>> 16 & 255, o[63] = x15 >>> 24 & 255; })(out, inp, k, c); } function crypto_core_hsalsa20(out, inp, k, c) { !(function(o, p, k, c) { for (var u, x0 = 255 & c[0] | (255 & c[1]) << 8 | (255 & c[2]) << 16 | (255 & c[3]) << 24, x1 = 255 & k[0] | (255 & k[1]) << 8 | (255 & k[2]) << 16 | (255 & k[3]) << 24, x2 = 255 & k[4] | (255 & k[5]) << 8 | (255 & k[6]) << 16 | (255 & k[7]) << 24, x3 = 255 & k[8] | (255 & k[9]) << 8 | (255 & k[10]) << 16 | (255 & k[11]) << 24, x4 = 255 & k[12] | (255 & k[13]) << 8 | (255 & k[14]) << 16 | (255 & k[15]) << 24, x5 = 255 & c[4] | (255 & c[5]) << 8 | (255 & c[6]) << 16 | (255 & c[7]) << 24, x6 = 255 & p[0] | (255 & p[1]) << 8 | (255 & p[2]) << 16 | (255 & p[3]) << 24, x7 = 255 & p[4] | (255 & p[5]) << 8 | (255 & p[6]) << 16 | (255 & p[7]) << 24, x8 = 255 & p[8] | (255 & p[9]) << 8 | (255 & p[10]) << 16 | (255 & p[11]) << 24, x9 = 255 & p[12] | (255 & p[13]) << 8 | (255 & p[14]) << 16 | (255 & p[15]) << 24, x10 = 255 & c[8] | (255 & c[9]) << 8 | (255 & c[10]) << 16 | (255 & c[11]) << 24, x11 = 255 & k[16] | (255 & k[17]) << 8 | (255 & k[18]) << 16 | (255 & k[19]) << 24, x12 = 255 & k[20] | (255 & k[21]) << 8 | (255 & k[22]) << 16 | (255 & k[23]) << 24, x13 = 255 & k[24] | (255 & k[25]) << 8 | (255 & k[26]) << 16 | (255 & k[27]) << 24, x14 = 255 & k[28] | (255 & k[29]) << 8 | (255 & k[30]) << 16 | (255 & k[31]) << 24, x15 = 255 & c[12] | (255 & c[13]) << 8 | (255 & c[14]) << 16 | (255 & c[15]) << 24, i = 0; i < 20; i += 2) x0 ^= (u = (x12 ^= (u = (x8 ^= (u = (x4 ^= (u = x0 + x12 | 0) << 7 | u >>> 25) + x0 | 0) << 9 | u >>> 23) + x4 | 0) << 13 | u >>> 19) + x8 | 0) << 18 | u >>> 14, x5 ^= (u = (x1 ^= (u = (x13 ^= (u = (x9 ^= (u = x5 + x1 | 0) << 7 | u >>> 25) + x5 | 0) << 9 | u >>> 23) + x9 | 0) << 13 | u >>> 19) + x13 | 0) << 18 | u >>> 14, x10 ^= (u = (x6 ^= (u = (x2 ^= (u = (x14 ^= (u = x10 + x6 | 0) << 7 | u >>> 25) + x10 | 0) << 9 | u >>> 23) + x14 | 0) << 13 | u >>> 19) + x2 | 0) << 18 | u >>> 14, x15 ^= (u = (x11 ^= (u = (x7 ^= (u = (x3 ^= (u = x15 + x11 | 0) << 7 | u >>> 25) + x15 | 0) << 9 | u >>> 23) + x3 | 0) << 13 | u >>> 19) + x7 | 0) << 18 | u >>> 14, x0 ^= (u = (x3 ^= (u = (x2 ^= (u = (x1 ^= (u = x0 + x3 | 0) << 7 | u >>> 25) + x0 | 0) << 9 | u >>> 23) + x1 | 0) << 13 | u >>> 19) + x2 | 0) << 18 | u >>> 14, x5 ^= (u = (x4 ^= (u = (x7 ^= (u = (x6 ^= (u = x5 + x4 | 0) << 7 | u >>> 25) + x5 | 0) << 9 | u >>> 23) + x6 | 0) << 13 | u >>> 19) + x7 | 0) << 18 | u >>> 14, x10 ^= (u = (x9 ^= (u = (x8 ^= (u = (x11 ^= (u = x10 + x9 | 0) << 7 | u >>> 25) + x10 | 0) << 9 | u >>> 23) + x11 | 0) << 13 | u >>> 19) + x8 | 0) << 18 | u >>> 14, x15 ^= (u = (x14 ^= (u = (x13 ^= (u = (x12 ^= (u = x15 + x14 | 0) << 7 | u >>> 25) + x15 | 0) << 9 | u >>> 23) + x12 | 0) << 13 | u >>> 19) + x13 | 0) << 18 | u >>> 14; o[0] = x0 >>> 0 & 255, o[1] = x0 >>> 8 & 255, o[2] = x0 >>> 16 & 255, o[3] = x0 >>> 24 & 255, o[4] = x5 >>> 0 & 255, o[5] = x5 >>> 8 & 255, o[6] = x5 >>> 16 & 255, o[7] = x5 >>> 24 & 255, o[8] = x10 >>> 0 & 255, o[9] = x10 >>> 8 & 255, o[10] = x10 >>> 16 & 255, o[11] = x10 >>> 24 & 255, o[12] = x15 >>> 0 & 255, o[13] = x15 >>> 8 & 255, o[14] = x15 >>> 16 & 255, o[15] = x15 >>> 24 & 255, o[16] = x6 >>> 0 & 255, o[17] = x6 >>> 8 & 255, o[18] = x6 >>> 16 & 255, o[19] = x6 >>> 24 & 255, o[20] = x7 >>> 0 & 255, o[21] = x7 >>> 8 & 255, o[22] = x7 >>> 16 & 255, o[23] = x7 >>> 24 & 255, o[24] = x8 >>> 0 & 255, o[25] = x8 >>> 8 & 255, o[26] = x8 >>> 16 & 255, o[27] = x8 >>> 24 & 255, o[28] = x9 >>> 0 & 255, o[29] = x9 >>> 8 & 255, o[30] = x9 >>> 16 & 255, o[31] = x9 >>> 24 & 255; })(out, inp, k, c); } var sigma = new Uint8Array([ 101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107 ]); function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { var u, i, z = new Uint8Array(16), x = new Uint8Array(64); for (i = 0; i < 16; i++) z[i] = 0; for (i = 0; i < 8; i++) z[i] = n[i]; for (;b >= 64; ) { for (crypto_core_salsa20(x, z, k, sigma), i = 0; i < 64; i++) c[cpos + i] = m[mpos + i] ^ x[i]; for (u = 1, i = 8; i < 16; i++) u = u + (255 & z[i]) | 0, z[i] = 255 & u, u >>>= 8; b -= 64, cpos += 64, mpos += 64; } if (b > 0) for (crypto_core_salsa20(x, z, k, sigma), i = 0; i < b; i++) c[cpos + i] = m[mpos + i] ^ x[i]; return 0; } function crypto_stream_salsa20(c, cpos, b, n, k) { var u, i, z = new Uint8Array(16), x = new Uint8Array(64); for (i = 0; i < 16; i++) z[i] = 0; for (i = 0; i < 8; i++) z[i] = n[i]; for (;b >= 64; ) { for (crypto_core_salsa20(x, z, k, sigma), i = 0; i < 64; i++) c[cpos + i] = x[i]; for (u = 1, i = 8; i < 16; i++) u = u + (255 & z[i]) | 0, z[i] = 255 & u, u >>>= 8; b -= 64, cpos += 64; } if (b > 0) for (crypto_core_salsa20(x, z, k, sigma), i = 0; i < b; i++) c[cpos + i] = x[i]; return 0; } function crypto_stream(c, cpos, d, n, k) { var s = new Uint8Array(32); crypto_core_hsalsa20(s, n, k, sigma); for (var sn = new Uint8Array(8), i = 0; i < 8; i++) sn[i] = n[i + 16]; return crypto_stream_salsa20(c, cpos, d, sn, s); } function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { var s = new Uint8Array(32); crypto_core_hsalsa20(s, n, k, sigma); for (var sn = new Uint8Array(8), i = 0; i < 8; i++) sn[i] = n[i + 16]; return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); } var poly1305 = function(key) { var t0, t1, t2, t3, t4, t5, t6, t7; this.buffer = new Uint8Array(16), this.r = new Uint16Array(10), this.h = new Uint16Array(10), this.pad = new Uint16Array(8), this.leftover = 0, this.fin = 0, t0 = 255 & key[0] | (255 & key[1]) << 8, this.r[0] = 8191 & t0, t1 = 255 & key[2] | (255 & key[3]) << 8, this.r[1] = 8191 & (t0 >>> 13 | t1 << 3), t2 = 255 & key[4] | (255 & key[5]) << 8, this.r[2] = 7939 & (t1 >>> 10 | t2 << 6), t3 = 255 & key[6] | (255 & key[7]) << 8, this.r[3] = 8191 & (t2 >>> 7 | t3 << 9), t4 = 255 & key[8] | (255 & key[9]) << 8, this.r[4] = 255 & (t3 >>> 4 | t4 << 12), this.r[5] = t4 >>> 1 & 8190, t5 = 255 & key[10] | (255 & key[11]) << 8, this.r[6] = 8191 & (t4 >>> 14 | t5 << 2), t6 = 255 & key[12] | (255 & key[13]) << 8, this.r[7] = 8065 & (t5 >>> 11 | t6 << 5), t7 = 255 & key[14] | (255 & key[15]) << 8, this.r[8] = 8191 & (t6 >>> 8 | t7 << 8), this.r[9] = t7 >>> 5 & 127, this.pad[0] = 255 & key[16] | (255 & key[17]) << 8, this.pad[1] = 255 & key[18] | (255 & key[19]) << 8, this.pad[2] = 255 & key[20] | (255 & key[21]) << 8, this.pad[3] = 255 & key[22] | (255 & key[23]) << 8, this.pad[4] = 255 & key[24] | (255 & key[25]) << 8, this.pad[5] = 255 & key[26] | (255 & key[27]) << 8, this.pad[6] = 255 & key[28] | (255 & key[29]) << 8, this.pad[7] = 255 & key[30] | (255 & key[31]) << 8; }; function crypto_onetimeauth(out, outpos, m, mpos, n, k) { var s = new poly1305(k); return s.update(m, mpos, n), s.finish(out, outpos), 0; } function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { var x = new Uint8Array(16); return crypto_onetimeauth(x, 0, m, mpos, n, k), crypto_verify_16(h, hpos, x, 0); } function crypto_secretbox(c, m, d, n, k) { var i; if (d < 32) return -1; for (crypto_stream_xor(c, 0, m, 0, d, n, k), crypto_onetimeauth(c, 16, c, 32, d - 32, c), i = 0; i < 16; i++) c[i] = 0; return 0; } function crypto_secretbox_open(m, c, d, n, k) { var i, x = new Uint8Array(32); if (d < 32) return -1; if (crypto_stream(x, 0, 32, n, k), 0 !== crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x)) return -1; for (crypto_stream_xor(m, 0, c, 0, d, n, k), i = 0; i < 32; i++) m[i] = 0; return 0; } function set25519(r, a) { var i; for (i = 0; i < 16; i++) r[i] = 0 | a[i]; } function car25519(o) { var i, v, c = 1; for (i = 0; i < 16; i++) v = o[i] + c + 65535, c = Math.floor(v / 65536), o[i] = v - 65536 * c; o[0] += c - 1 + 37 * (c - 1); } function sel25519(p, q, b) { for (var t, c = ~(b - 1), i = 0; i < 16; i++) t = c & (p[i] ^ q[i]), p[i] ^= t, q[i] ^= t; } function pack25519(o, n) { var i, j, b, m = gf(), t = gf(); for (i = 0; i < 16; i++) t[i] = n[i]; for (car25519(t), car25519(t), car25519(t), j = 0; j < 2; j++) { for (m[0] = t[0] - 65517, i = 1; i < 15; i++) m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1), m[i - 1] &= 65535; m[15] = t[15] - 32767 - (m[14] >> 16 & 1), b = m[15] >> 16 & 1, m[14] &= 65535, sel25519(t, m, 1 - b); } for (i = 0; i < 16; i++) o[2 * i] = 255 & t[i], o[2 * i + 1] = t[i] >> 8; } function neq25519(a, b) { var c = new Uint8Array(32), d = new Uint8Array(32); return pack25519(c, a), pack25519(d, b), crypto_verify_32(c, 0, d, 0); } function par25519(a) { var d = new Uint8Array(32); return pack25519(d, a), 1 & d[0]; } function unpack25519(o, n) { var i; for (i = 0; i < 16; i++) o[i] = n[2 * i] + (n[2 * i + 1] << 8); o[15] &= 32767; } function A(o, a, b) { for (var i = 0; i < 16; i++) o[i] = a[i] + b[i]; } function Z(o, a, b) { for (var i = 0; i < 16; i++) o[i] = a[i] - b[i]; } function M(o, a, b) { var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; t0 += (v = a[0]) * b0, t1 += v * b1, t2 += v * b2, t3 += v * b3, t4 += v * b4, t5 += v * b5, t6 += v * b6, t7 += v * b7, t8 += v * b8, t9 += v * b9, t10 += v * b10, t11 += v * b11, t12 += v * b12, t13 += v * b13, t14 += v * b14, t15 += v * b15, t1 += (v = a[1]) * b0, t2 += v * b1, t3 += v * b2, t4 += v * b3, t5 += v * b4, t6 += v * b5, t7 += v * b6, t8 += v * b7, t9 += v * b8, t10 += v * b9, t11 += v * b10, t12 += v * b11, t13 += v * b12, t14 += v * b13, t15 += v * b14, t16 += v * b15, t2 += (v = a[2]) * b0, t3 += v * b1, t4 += v * b2, t5 += v * b3, t6 += v * b4, t7 += v * b5, t8 += v * b6, t9 += v * b7, t10 += v * b8, t11 += v * b9, t12 += v * b10, t13 += v * b11, t14 += v * b12, t15 += v * b13, t16 += v * b14, t17 += v * b15, t3 += (v = a[3]) * b0, t4 += v * b1, t5 += v * b2, t6 += v * b3, t7 += v * b4, t8 += v * b5, t9 += v * b6, t10 += v * b7, t11 += v * b8, t12 += v * b9, t13 += v * b10, t14 += v * b11, t15 += v * b12, t16 += v * b13, t17 += v * b14, t18 += v * b15, t4 += (v = a[4]) * b0, t5 += v * b1, t6 += v * b2, t7 += v * b3, t8 += v * b4, t9 += v * b5, t10 += v * b6, t11 += v * b7, t12 += v * b8, t13 += v * b9, t14 += v * b10, t15 += v * b11, t16 += v * b12, t17 += v * b13, t18 += v * b14, t19 += v * b15, t5 += (v = a[5]) * b0, t6 += v * b1, t7 += v * b2, t8 += v * b3, t9 += v * b4, t10 += v * b5, t11 += v * b6, t12 += v * b7, t13 += v * b8, t14 += v * b9, t15 += v * b10, t16 += v * b11, t17 += v * b12, t18 += v * b13, t19 += v * b14, t20 += v * b15, t6 += (v = a[6]) * b0, t7 += v * b1, t8 += v * b2, t9 += v * b3, t10 += v * b4, t11 += v * b5, t12 += v * b6, t13 += v * b7, t14 += v * b8, t15 += v * b9, t16 += v * b10, t17 += v * b11, t18 += v * b12, t19 += v * b13, t20 += v * b14, t21 += v * b15, t7 += (v = a[7]) * b0, t8 += v * b1, t9 += v * b2, t10 += v * b3, t11 += v * b4, t12 += v * b5, t13 += v * b6, t14 += v * b7, t15 += v * b8, t16 += v * b9, t17 += v * b10, t18 += v * b11, t19 += v * b12, t20 += v * b13, t21 += v * b14, t22 += v * b15, t8 += (v = a[8]) * b0, t9 += v * b1, t10 += v * b2, t11 += v * b3, t12 += v * b4, t13 += v * b5, t14 += v * b6, t15 += v * b7, t16 += v * b8, t17 += v * b9, t18 += v * b10, t19 += v * b11, t20 += v * b12, t21 += v * b13, t22 += v * b14, t23 += v * b15, t9 += (v = a[9]) * b0, t10 += v * b1, t11 += v * b2, t12 += v * b3, t13 += v * b4, t14 += v * b5, t15 += v * b6, t16 += v * b7, t17 += v * b8, t18 += v * b9, t19 += v * b10, t20 += v * b11, t21 += v * b12, t22 += v * b13, t23 += v * b14, t24 += v * b15, t10 += (v = a[10]) * b0, t11 += v * b1, t12 += v * b2, t13 += v * b3, t14 += v * b4, t15 += v * b5, t16 += v * b6, t17 += v * b7, t18 += v * b8, t19 += v * b9, t20 += v * b10, t21 += v * b11, t22 += v * b12, t23 += v * b13, t24 += v * b14, t25 += v * b15, t11 += (v = a[11]) * b0, t12 += v * b1, t13 += v * b2, t14 += v * b3, t15 += v * b4, t16 += v * b5, t17 += v * b6, t18 += v * b7, t19 += v * b8, t20 += v * b9, t21 += v * b10, t22 += v * b11, t23 += v * b12, t24 += v * b13, t25 += v * b14, t26 += v * b15, t12 += (v = a[12]) * b0, t13 += v * b1, t14 += v * b2, t15 += v * b3, t16 += v * b4, t17 += v * b5, t18 += v * b6, t19 += v * b7, t20 += v * b8, t21 += v * b9, t22 += v * b10, t23 += v * b11, t24 += v * b12, t25 += v * b13, t26 += v * b14, t27 += v * b15, t13 += (v = a[13]) * b0, t14 += v * b1, t15 += v * b2, t16 += v * b3, t17 += v * b4, t18 += v * b5, t19 += v * b6, t20 += v * b7, t21 += v * b8, t22 += v * b9, t23 += v * b10, t24 += v * b11, t25 += v * b12, t26 += v * b13, t27 += v * b14, t28 += v * b15, t14 += (v = a[14]) * b0, t15 += v * b1, t16 += v * b2, t17 += v * b3, t18 += v * b4, t19 += v * b5, t20 += v * b6, t21 += v * b7, t22 += v * b8, t23 += v * b9, t24 += v * b10, t25 += v * b11, t26 += v * b12, t27 += v * b13, t28 += v * b14, t29 += v * b15, t15 += (v = a[15]) * b0, t1 += 38 * (t17 += v * b2), t2 += 38 * (t18 += v * b3), t3 += 38 * (t19 += v * b4), t4 += 38 * (t20 += v * b5), t5 += 38 * (t21 += v * b6), t6 += 38 * (t22 += v * b7), t7 += 38 * (t23 += v * b8), t8 += 38 * (t24 += v * b9), t9 += 38 * (t25 += v * b10), t10 += 38 * (t26 += v * b11), t11 += 38 * (t27 += v * b12), t12 += 38 * (t28 += v * b13), t13 += 38 * (t29 += v * b14), t14 += 38 * (t30 += v * b15), t0 = (v = (t0 += 38 * (t16 += v * b1)) + (c = 1) + 65535) - 65536 * (c = Math.floor(v / 65536)), t1 = (v = t1 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t2 = (v = t2 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t3 = (v = t3 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t4 = (v = t4 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t5 = (v = t5 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t6 = (v = t6 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t7 = (v = t7 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t8 = (v = t8 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t9 = (v = t9 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t10 = (v = t10 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t11 = (v = t11 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t12 = (v = t12 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t13 = (v = t13 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t14 = (v = t14 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t15 = (v = t15 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t0 = (v = (t0 += c - 1 + 37 * (c - 1)) + (c = 1) + 65535) - 65536 * (c = Math.floor(v / 65536)), t1 = (v = t1 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t2 = (v = t2 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t3 = (v = t3 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t4 = (v = t4 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t5 = (v = t5 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t6 = (v = t6 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t7 = (v = t7 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t8 = (v = t8 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t9 = (v = t9 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t10 = (v = t10 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t11 = (v = t11 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t12 = (v = t12 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t13 = (v = t13 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t14 = (v = t14 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t15 = (v = t15 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t0 += c - 1 + 37 * (c - 1), o[0] = t0, o[1] = t1, o[2] = t2, o[3] = t3, o[4] = t4, o[5] = t5, o[6] = t6, o[7] = t7, o[8] = t8, o[9] = t9, o[10] = t10, o[11] = t11, o[12] = t12, o[13] = t13, o[14] = t14, o[15] = t15; } function S(o, a) { M(o, a, a); } function inv25519(o, i) { var a, c = gf(); for (a = 0; a < 16; a++) c[a] = i[a]; for (a = 253; a >= 0; a--) S(c, c), 2 !== a && 4 !== a && M(c, c, i); for (a = 0; a < 16; a++) o[a] = c[a]; } function crypto_scalarmult(q, n, p) { var r, i, z = new Uint8Array(32), x = new Float64Array(80), a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); for (i = 0; i < 31; i++) z[i] = n[i]; for (z[31] = 127 & n[31] | 64, z[0] &= 248, unpack25519(x, p), i = 0; i < 16; i++) b[i] = x[i], d[i] = a[i] = c[i] = 0; for (a[0] = d[0] = 1, i = 254; i >= 0; --i) sel25519(a, b, r = z[i >>> 3] >>> (7 & i) & 1), sel25519(c, d, r), A(e, a, c), Z(a, a, c), A(c, b, d), Z(b, b, d), S(d, e), S(f, a), M(a, c, a), M(c, b, e), A(e, a, c), Z(a, a, c), S(b, a), Z(c, d, f), M(a, c, _121665), A(a, a, d), M(c, c, a), M(a, d, f), M(d, b, x), S(b, e), sel25519(a, b, r), sel25519(c, d, r); for (i = 0; i < 16; i++) x[i + 16] = a[i], x[i + 32] = c[i], x[i + 48] = b[i], x[i + 64] = d[i]; var x32 = x.subarray(32), x16 = x.subarray(16); return inv25519(x32, x32), M(x16, x16, x32), pack25519(q, x16), 0; } function crypto_scalarmult_base(q, n) { return crypto_scalarmult(q, n, _9); } function crypto_box_keypair(y, x) { return randombytes(x, 32), crypto_scalarmult_base(y, x); } function crypto_box_beforenm(k, y, x) { var s = new Uint8Array(32); return crypto_scalarmult(s, x, y), crypto_core_hsalsa20(k, _0, s, sigma); } poly1305.prototype.blocks = function(m, mpos, bytes) { for (var t0, t1, t2, t3, t4, t5, t6, t7, c, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, hibit = this.fin ? 0 : 2048, h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9], r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; bytes >= 16; ) d0 = c = 0, d0 += (h0 += 8191 & (t0 = 255 & m[mpos + 0] | (255 & m[mpos + 1]) << 8)) * r0, d0 += (h1 += 8191 & (t0 >>> 13 | (t1 = 255 & m[mpos + 2] | (255 & m[mpos + 3]) << 8) << 3)) * (5 * r9), d0 += (h2 += 8191 & (t1 >>> 10 | (t2 = 255 & m[mpos + 4] | (255 & m[mpos + 5]) << 8) << 6)) * (5 * r8), d0 += (h3 += 8191 & (t2 >>> 7 | (t3 = 255 & m[mpos + 6] | (255 & m[mpos + 7]) << 8) << 9)) * (5 * r7), c = (d0 += (h4 += 8191 & (t3 >>> 4 | (t4 = 255 & m[mpos + 8] | (255 & m[mpos + 9]) << 8) << 12)) * (5 * r6)) >>> 13, d0 &= 8191, d0 += (h5 += t4 >>> 1 & 8191) * (5 * r5), d0 += (h6 += 8191 & (t4 >>> 14 | (t5 = 255 & m[mpos + 10] | (255 & m[mpos + 11]) << 8) << 2)) * (5 * r4), d0 += (h7 += 8191 & (t5 >>> 11 | (t6 = 255 & m[mpos + 12] | (255 & m[mpos + 13]) << 8) << 5)) * (5 * r3), d0 += (h8 += 8191 & (t6 >>> 8 | (t7 = 255 & m[mpos + 14] | (255 & m[mpos + 15]) << 8) << 8)) * (5 * r2), d1 = c += (d0 += (h9 += t7 >>> 5 | hibit) * (5 * r1)) >>> 13, d1 += h0 * r1, d1 += h1 * r0, d1 += h2 * (5 * r9), d1 += h3 * (5 * r8), c = (d1 += h4 * (5 * r7)) >>> 13, d1 &= 8191, d1 += h5 * (5 * r6), d1 += h6 * (5 * r5), d1 += h7 * (5 * r4), d1 += h8 * (5 * r3), c += (d1 += h9 * (5 * r2)) >>> 13, d1 &= 8191, d2 = c, d2 += h0 * r2, d2 += h1 * r1, d2 += h2 * r0, d2 += h3 * (5 * r9), c = (d2 += h4 * (5 * r8)) >>> 13, d2 &= 8191, d2 += h5 * (5 * r7), d2 += h6 * (5 * r6), d2 += h7 * (5 * r5), d2 += h8 * (5 * r4), d3 = c += (d2 += h9 * (5 * r3)) >>> 13, d3 += h0 * r3, d3 += h1 * r2, d3 += h2 * r1, d3 += h3 * r0, c = (d3 += h4 * (5 * r9)) >>> 13, d3 &= 8191, d3 += h5 * (5 * r8), d3 += h6 * (5 * r7), d3 += h7 * (5 * r6), d3 += h8 * (5 * r5), d4 = c += (d3 += h9 * (5 * r4)) >>> 13, d4 += h0 * r4, d4 += h1 * r3, d4 += h2 * r2, d4 += h3 * r1, c = (d4 += h4 * r0) >>> 13, d4 &= 8191, d4 += h5 * (5 * r9), d4 += h6 * (5 * r8), d4 += h7 * (5 * r7), d4 += h8 * (5 * r6), d5 = c += (d4 += h9 * (5 * r5)) >>> 13, d5 += h0 * r5, d5 += h1 * r4, d5 += h2 * r3, d5 += h3 * r2, c = (d5 += h4 * r1) >>> 13, d5 &= 8191, d5 += h5 * r0, d5 += h6 * (5 * r9), d5 += h7 * (5 * r8), d5 += h8 * (5 * r7), d6 = c += (d5 += h9 * (5 * r6)) >>> 13, d6 += h0 * r6, d6 += h1 * r5, d6 += h2 * r4, d6 += h3 * r3, c = (d6 += h4 * r2) >>> 13, d6 &= 8191, d6 += h5 * r1, d6 += h6 * r0, d6 += h7 * (5 * r9), d6 += h8 * (5 * r8), d7 = c += (d6 += h9 * (5 * r7)) >>> 13, d7 += h0 * r7, d7 += h1 * r6, d7 += h2 * r5, d7 += h3 * r4, c = (d7 += h4 * r3) >>> 13, d7 &= 8191, d7 += h5 * r2, d7 += h6 * r1, d7 += h7 * r0, d7 += h8 * (5 * r9), d8 = c += (d7 += h9 * (5 * r8)) >>> 13, d8 += h0 * r8, d8 += h1 * r7, d8 += h2 * r6, d8 += h3 * r5, c = (d8 += h4 * r4) >>> 13, d8 &= 8191, d8 += h5 * r3, d8 += h6 * r2, d8 += h7 * r1, d8 += h8 * r0, d9 = c += (d8 += h9 * (5 * r9)) >>> 13, d9 += h0 * r9, d9 += h1 * r8, d9 += h2 * r7, d9 += h3 * r6, c = (d9 += h4 * r5) >>> 13, d9 &= 8191, d9 += h5 * r4, d9 += h6 * r3, d9 += h7 * r2, d9 += h8 * r1, h0 = d0 = 8191 & (c = (c = ((c += (d9 += h9 * r0) >>> 13) << 2) + c | 0) + (d0 &= 8191) | 0), h1 = d1 += c >>>= 13, h2 = d2 &= 8191, h3 = d3 &= 8191, h4 = d4 &= 8191, h5 = d5 &= 8191, h6 = d6 &= 8191, h7 = d7 &= 8191, h8 = d8 &= 8191, h9 = d9 &= 8191, mpos += 16, bytes -= 16; this.h[0] = h0, this.h[1] = h1, this.h[2] = h2, this.h[3] = h3, this.h[4] = h4, this.h[5] = h5, this.h[6] = h6, this.h[7] = h7, this.h[8] = h8, this.h[9] = h9; }, poly1305.prototype.finish = function(mac, macpos) { var c, mask, f, i, g = new Uint16Array(10); if (this.leftover) { for (i = this.leftover, this.buffer[i++] = 1; i < 16; i++) this.buffer[i] = 0; this.fin = 1, this.blocks(this.buffer, 0, 16); } for (c = this.h[1] >>> 13, this.h[1] &= 8191, i = 2; i < 10; i++) this.h[i] += c, c = this.h[i] >>> 13, this.h[i] &= 8191; for (this.h[0] += 5 * c, c = this.h[0] >>> 13, this.h[0] &= 8191, this.h[1] += c, c = this.h[1] >>> 13, this.h[1] &= 8191, this.h[2] += c, g[0] = this.h[0] + 5, c = g[0] >>> 13, g[0] &= 8191, i = 1; i < 10; i++) g[i] = this.h[i] + c, c = g[i] >>> 13, g[i] &= 8191; for (g[9] -= 8192, mask = (1 ^ c) - 1, i = 0; i < 10; i++) g[i] &= mask; for (mask = ~mask, i = 0; i < 10; i++) this.h[i] = this.h[i] & mask | g[i]; for (this.h[0] = 65535 & (this.h[0] | this.h[1] << 13), this.h[1] = 65535 & (this.h[1] >>> 3 | this.h[2] << 10), this.h[2] = 65535 & (this.h[2] >>> 6 | this.h[3] << 7), this.h[3] = 65535 & (this.h[3] >>> 9 | this.h[4] << 4), this.h[4] = 65535 & (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14), this.h[5] = 65535 & (this.h[6] >>> 2 | this.h[7] << 11), this.h[6] = 65535 & (this.h[7] >>> 5 | this.h[8] << 8), this.h[7] = 65535 & (this.h[8] >>> 8 | this.h[9] << 5), f = this.h[0] + this.pad[0], this.h[0] = 65535 & f, i = 1; i < 8; i++) f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0, this.h[i] = 65535 & f; mac[macpos + 0] = this.h[0] >>> 0 & 255, mac[macpos + 1] = this.h[0] >>> 8 & 255, mac[macpos + 2] = this.h[1] >>> 0 & 255, mac[macpos + 3] = this.h[1] >>> 8 & 255, mac[macpos + 4] = this.h[2] >>> 0 & 255, mac[macpos + 5] = this.h[2] >>> 8 & 255, mac[macpos + 6] = this.h[3] >>> 0 & 255, mac[macpos + 7] = this.h[3] >>> 8 & 255, mac[macpos + 8] = this.h[4] >>> 0 & 255, mac[macpos + 9] = this.h[4] >>> 8 & 255, mac[macpos + 10] = this.h[5] >>> 0 & 255, mac[macpos + 11] = this.h[5] >>> 8 & 255, mac[macpos + 12] = this.h[6] >>> 0 & 255, mac[macpos + 13] = this.h[6] >>> 8 & 255, mac[macpos + 14] = this.h[7] >>> 0 & 255, mac[macpos + 15] = this.h[7] >>> 8 & 255; }, poly1305.prototype.update = function(m, mpos, bytes) { var i, want; if (this.leftover) { for ((want = 16 - this.leftover) > bytes && (want = bytes), i = 0; i < want; i++) this.buffer[this.leftover + i] = m[mpos + i]; if (bytes -= want, mpos += want, this.leftover += want, this.leftover < 16) return; this.blocks(this.buffer, 0, 16), this.leftover = 0; } if (bytes >= 16 && (want = bytes - bytes % 16, this.blocks(m, mpos, want), mpos += want, bytes -= want), bytes) { for (i = 0; i < bytes; i++) this.buffer[this.leftover + i] = m[mpos + i]; this.leftover += bytes; } }; var crypto_box_afternm = crypto_secretbox, crypto_box_open_afternm = crypto_secretbox_open, K = [ 1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591 ]; function crypto_hashblocks_hl(hh, hl, m, n) { for (var bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d, wh = new Int32Array(16), wl = new Int32Array(16), ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7], pos = 0; n >= 128; ) { for (i = 0; i < 16; i++) j = 8 * i + pos, wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3], wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; for (i = 0; i < 80; i++) if (bh0 = ah0, bh1 = ah1, bh2 = ah2, bh3 = ah3, bh4 = ah4, bh5 = ah5, bh6 = ah6, bl0 = al0, bl1 = al1, bl2 = al2, bl3 = al3, bl4 = al4, bl5 = al5, bl6 = al6, a = 65535 & (l = al7), b = l >>> 16, c = 65535 & (h = ah7), d = h >>> 16, a += 65535 & (l = (al4 >>> 14 | ah4 << 18) ^ (al4 >>> 18 | ah4 << 14) ^ (ah4 >>> 9 | al4 << 23)), b += l >>> 16, c += 65535 & (h = (ah4 >>> 14 | al4 << 18) ^ (ah4 >>> 18 | al4 << 14) ^ (al4 >>> 9 | ah4 << 23)), d += h >>> 16, a += 65535 & (l = al4 & al5 ^ ~al4 & al6), b += l >>> 16, c += 65535 & (h = ah4 & ah5 ^ ~ah4 & ah6), d += h >>> 16, a += 65535 & (l = K[2 * i + 1]), b += l >>> 16, c += 65535 & (h = K[2 * i]), d += h >>> 16, h = wh[i % 16], b += (l = wl[i % 16]) >>> 16, c += 65535 & h, d += h >>> 16, c += (b += (a += 65535 & l) >>> 16) >>> 16, a = 65535 & (l = tl = 65535 & a | b << 16), b = l >>> 16, c = 65535 & (h = th = 65535 & c | (d += c >>> 16) << 16), d = h >>> 16, a += 65535 & (l = (al0 >>> 28 | ah0 << 4) ^ (ah0 >>> 2 | al0 << 30) ^ (ah0 >>> 7 | al0 << 25)), b += l >>> 16, c += 65535 & (h = (ah0 >>> 28 | al0 << 4) ^ (al0 >>> 2 | ah0 << 30) ^ (al0 >>> 7 | ah0 << 25)), d += h >>> 16, b += (l = al0 & al1 ^ al0 & al2 ^ al1 & al2) >>> 16, c += 65535 & (h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2), d += h >>> 16, bh7 = 65535 & (c += (b += (a += 65535 & l) >>> 16) >>> 16) | (d += c >>> 16) << 16, bl7 = 65535 & a | b << 16, a = 65535 & (l = bl3), b = l >>> 16, c = 65535 & (h = bh3), d = h >>> 16, b += (l = tl) >>> 16, c += 65535 & (h = th), d += h >>> 16, ah1 = bh0, ah2 = bh1, ah3 = bh2, ah4 = bh3 = 65535 & (c += (b += (a += 65535 & l) >>> 16) >>> 16) | (d += c >>> 16) << 16, ah5 = bh4, ah6 = bh5, ah7 = bh6, ah0 = bh7, al1 = bl0, al2 = bl1, al3 = bl2, al4 = bl3 = 65535 & a | b << 16, al5 = bl4, al6 = bl5, al7 = bl6, al0 = bl7, i % 16 == 15) for (j = 0; j < 16; j++) h = wh[j], a = 65535 & (l = wl[j]), b = l >>> 16, c = 65535 & h, d = h >>> 16, h = wh[(j + 9) % 16], a += 65535 & (l = wl[(j + 9) % 16]), b += l >>> 16, c += 65535 & h, d += h >>> 16, th = wh[(j + 1) % 16], a += 65535 & (l = ((tl = wl[(j + 1) % 16]) >>> 1 | th << 31) ^ (tl >>> 8 | th << 24) ^ (tl >>> 7 | th << 25)), b += l >>> 16, c += 65535 & (h = (th >>> 1 | tl << 31) ^ (th >>> 8 | tl << 24) ^ th >>> 7), d += h >>> 16, th = wh[(j + 14) % 16], b += (l = ((tl = wl[(j + 14) % 16]) >>> 19 | th << 13) ^ (th >>> 29 | tl << 3) ^ (tl >>> 6 | th << 26)) >>> 16, c += 65535 & (h = (th >>> 19 | tl << 13) ^ (tl >>> 29 | th << 3) ^ th >>> 6), d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, wh[j] = 65535 & c | d << 16, wl[j] = 65535 & a | b << 16; a = 65535 & (l = al0), b = l >>> 16, c = 65535 & (h = ah0), d = h >>> 16, h = hh[0], b += (l = hl[0]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, hh[0] = ah0 = 65535 & c | d << 16, hl[0] = al0 = 65535 & a | b << 16, a = 65535 & (l = al1), b = l >>> 16, c = 65535 & (h = ah1), d = h >>> 16, h = hh[1], b += (l = hl[1]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, hh[1] = ah1 = 65535 & c | d << 16, hl[1] = al1 = 65535 & a | b << 16, a = 65535 & (l = al2), b = l >>> 16, c = 65535 & (h = ah2), d = h >>> 16, h = hh[2], b += (l = hl[2]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, hh[2] = ah2 = 65535 & c | d << 16, hl[2] = al2 = 65535 & a | b << 16, a = 65535 & (l = al3), b = l >>> 16, c = 65535 & (h = ah3), d = h >>> 16, h = hh[3], b += (l = hl[3]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, hh[3] = ah3 = 65535 & c | d << 16, hl[3] = al3 = 65535 & a | b << 16, a = 65535 & (l = al4), b = l >>> 16, c = 65535 & (h = ah4), d = h >>> 16, h = hh[4], b += (l = hl[4]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, hh[4] = ah4 = 65535 & c | d << 16, hl[4] = al4 = 65535 & a | b << 16, a = 65535 & (l = al5), b = l >>> 16, c = 65535 & (h = ah5), d = h >>> 16, h = hh[5], b += (l = hl[5]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, hh[5] = ah5 = 65535 & c | d << 16, hl[5] = al5 = 65535 & a | b << 16, a = 65535 & (l = al6), b = l >>> 16, c = 65535 & (h = ah6), d = h >>> 16, h = hh[6], b += (l = hl[6]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, hh[6] = ah6 = 65535 & c | d << 16, hl[6] = al6 = 65535 & a | b << 16, a = 65535 & (l = al7), b = l >>> 16, c = 65535 & (h = ah7), d = h >>> 16, h = hh[7], b += (l = hl[7]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, hh[7] = ah7 = 65535 & c | d << 16, hl[7] = al7 = 65535 & a | b << 16, pos += 128, n -= 128; } return n; } function crypto_hash(out, m, n) { var i, hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), b = n; for (hh[0] = 1779033703, hh[1] = 3144134277, hh[2] = 1013904242, hh[3] = 2773480762, hh[4] = 1359893119, hh[5] = 2600822924, hh[6] = 528734635, hh[7] = 1541459225, hl[0] = 4089235720, hl[1] = 2227873595, hl[2] = 4271175723, hl[3] = 1595750129, hl[4] = 2917565137, hl[5] = 725511199, hl[6] = 4215389547, hl[7] = 327033209, crypto_hashblocks_hl(hh, hl, m, n), n %= 128, i = 0; i < n; i++) x[i] = m[b - n + i]; for (x[n] = 128, x[(n = 256 - 128 * (n < 112 ? 1 : 0)) - 9] = 0, ts64(x, n - 8, b / 536870912 | 0, b << 3), crypto_hashblocks_hl(hh, hl, x, n), i = 0; i < 8; i++) ts64(out, 8 * i, hh[i], hl[i]); return 0; } function add(p, q) { var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); Z(a, p[1], p[0]), Z(t, q[1], q[0]), M(a, a, t), A(b, p[0], p[1]), A(t, q[0], q[1]), M(b, b, t), M(c, p[3], q[3]), M(c, c, D2), M(d, p[2], q[2]), A(d, d, d), Z(e, b, a), Z(f, d, c), A(g, d, c), A(h, b, a), M(p[0], e, f), M(p[1], h, g), M(p[2], g, f), M(p[3], e, h); } function cswap(p, q, b) { var i; for (i = 0; i < 4; i++) sel25519(p[i], q[i], b); } function pack(r, p) { var tx = gf(), ty = gf(), zi = gf(); inv25519(zi, p[2]), M(tx, p[0], zi), M(ty, p[1], zi), pack25519(r, ty), r[31] ^= par25519(tx) << 7; } function scalarmult(p, q, s) { var b, i; for (set25519(p[0], gf0), set25519(p[1], gf1), set25519(p[2], gf1), set25519(p[3], gf0), i = 255; i >= 0; --i) cswap(p, q, b = s[i / 8 | 0] >> (7 & i) & 1), add(q, p), add(p, p), cswap(p, q, b); } function scalarbase(p, s) { var q = [ gf(), gf(), gf(), gf() ]; set25519(q[0], X), set25519(q[1], Y), set25519(q[2], gf1), M(q[3], X, Y), scalarmult(p, q, s); } function crypto_sign_keypair(pk, sk, seeded) { var i, d = new Uint8Array(64), p = [ gf(), gf(), gf(), gf() ]; for (seeded || randombytes(sk, 32), crypto_hash(d, sk, 32), d[0] &= 248, d[31] &= 127, d[31] |= 64, scalarbase(p, d), pack(pk, p), i = 0; i < 32; i++) sk[i + 32] = pk[i]; return 0; } var crypto, L = new Float64Array([ 237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 ]); function modL(r, x) { var carry, i, j, k; for (i = 63; i >= 32; --i) { for (carry = 0, j = i - 32, k = i - 12; j < k; ++j) x[j] += carry - 16 * x[i] * L[j - (i - 32)], carry = x[j] + 128 >> 8, x[j] -= 256 * carry; x[j] += carry, x[i] = 0; } for (carry = 0, j = 0; j < 32; j++) x[j] += carry - (x[31] >> 4) * L[j], carry = x[j] >> 8, x[j] &= 255; for (j = 0; j < 32; j++) x[j] -= carry * L[j]; for (i = 0; i < 32; i++) x[i + 1] += x[i] >> 8, r[i] = 255 & x[i]; } function reduce(r) { var i, x = new Float64Array(64); for (i = 0; i < 64; i++) x[i] = r[i]; for (i = 0; i < 64; i++) r[i] = 0; modL(r, x); } function crypto_sign(sm, m, n, sk) { var i, j, d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64), x = new Float64Array(64), p = [ gf(), gf(), gf(), gf() ]; crypto_hash(d, sk, 32), d[0] &= 248, d[31] &= 127, d[31] |= 64; var smlen = n + 64; for (i = 0; i < n; i++) sm[64 + i] = m[i]; for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i]; for (crypto_hash(r, sm.subarray(32), n + 32), reduce(r), scalarbase(p, r), pack(sm, p), i = 32; i < 64; i++) sm[i] = sk[i]; for (crypto_hash(h, sm, n + 64), reduce(h), i = 0; i < 64; i++) x[i] = 0; for (i = 0; i < 32; i++) x[i] = r[i]; for (i = 0; i < 32; i++) for (j = 0; j < 32; j++) x[i + j] += h[i] * d[j]; return modL(sm.subarray(32), x), smlen; } function crypto_sign_open(m, sm, n, pk) { var i, t = new Uint8Array(32), h = new Uint8Array(64), p = [ gf(), gf(), gf(), gf() ], q = [ gf(), gf(), gf(), gf() ]; if (n < 64) return -1; if ((function(r, p) { var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); return set25519(r[2], gf1), unpack25519(r[1], p), S(num, r[1]), M(den, num, D), Z(num, num, r[2]), A(den, r[2], den), S(den2, den), S(den4, den2), M(den6, den4, den2), M(t, den6, num), M(t, t, den), (function(o, i) { var a, c = gf(); for (a = 0; a < 16; a++) c[a] = i[a]; for (a = 250; a >= 0; a--) S(c, c), 1 !== a && M(c, c, i); for (a = 0; a < 16; a++) o[a] = c[a]; })(t, t), M(t, t, num), M(t, t, den), M(t, t, den), M(r[0], t, den), S(chk, r[0]), M(chk, chk, den), neq25519(chk, num) && M(r[0], r[0], I), S(chk, r[0]), M(chk, chk, den), neq25519(chk, num) ? -1 : (par25519(r[0]) === p[31] >> 7 && Z(r[0], gf0, r[0]), M(r[3], r[0], r[1]), 0); })(q, pk)) return -1; for (i = 0; i < n; i++) m[i] = sm[i]; for (i = 0; i < 32; i++) m[i + 32] = pk[i]; if (crypto_hash(h, m, n), reduce(h), scalarmult(p, q, h), scalarbase(q, sm.subarray(32)), add(p, q), pack(t, p), n -= 64, crypto_verify_32(sm, 0, t, 0)) { for (i = 0; i < n; i++) m[i] = 0; return -1; } for (i = 0; i < n; i++) m[i] = sm[i + 64]; return n; } function checkLengths(k, n) { if (32 !== k.length) throw new Error("bad key size"); if (24 !== n.length) throw new Error("bad nonce size"); } function checkArrayTypes() { var t, i; for (i = 0; i < arguments.length; i++) if ("[object Uint8Array]" !== (t = Object.prototype.toString.call(arguments[i]))) throw new TypeError("unexpected type " + t + ", use Uint8Array"); } function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; } nacl.lowlevel = { crypto_core_hsalsa20: crypto_core_hsalsa20, crypto_stream_xor: crypto_stream_xor, crypto_stream: crypto_stream, crypto_stream_salsa20_xor: crypto_stream_salsa20_xor, crypto_stream_salsa20: crypto_stream_salsa20, crypto_onetimeauth: crypto_onetimeauth, crypto_onetimeauth_verify: crypto_onetimeauth_verify, crypto_verify_16: crypto_verify_16, crypto_verify_32: crypto_verify_32, crypto_secretbox: crypto_secretbox, crypto_secretbox_open: crypto_secretbox_open, crypto_scalarmult: crypto_scalarmult, crypto_scalarmult_base: crypto_scalarmult_base, crypto_box_beforenm: crypto_box_beforenm, crypto_box_afternm: crypto_box_afternm, crypto_box: function(c, m, d, n, y, x) { var k = new Uint8Array(32); return crypto_box_beforenm(k, y, x), crypto_box_afternm(c, m, d, n, k); }, crypto_box_open: function(m, c, d, n, y, x) { var k = new Uint8Array(32); return crypto_box_beforenm(k, y, x), crypto_box_open_afternm(m, c, d, n, k); }, crypto_box_keypair: crypto_box_keypair, crypto_hash: crypto_hash, crypto_sign: crypto_sign, crypto_sign_keypair: crypto_sign_keypair, crypto_sign_open: crypto_sign_open, crypto_secretbox_KEYBYTES: 32, crypto_secretbox_NONCEBYTES: 24, crypto_secretbox_ZEROBYTES: 32, crypto_secretbox_BOXZEROBYTES: 16, crypto_scalarmult_BYTES: 32, crypto_scalarmult_SCALARBYTES: 32, crypto_box_PUBLICKEYBYTES: 32, crypto_box_SECRETKEYBYTES: 32, crypto_box_BEFORENMBYTES: 32, crypto_box_NONCEBYTES: 24, crypto_box_ZEROBYTES: 32, crypto_box_BOXZEROBYTES: 16, crypto_sign_BYTES: 64, crypto_sign_PUBLICKEYBYTES: 32, crypto_sign_SECRETKEYBYTES: 64, crypto_sign_SEEDBYTES: 32, crypto_hash_BYTES: 64 }, nacl.util || (nacl.util = {}, nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() { throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js"); }), nacl.randomBytes = function(n) { var b = new Uint8Array(n); return randombytes(b, n), b; }, nacl.secretbox = function(msg, nonce, key) { checkArrayTypes(msg, nonce, key), checkLengths(key, nonce); for (var m = new Uint8Array(32 + msg.length), c = new Uint8Array(m.length), i = 0; i < msg.length; i++) m[i + 32] = msg[i]; return crypto_secretbox(c, m, m.length, nonce, key), c.subarray(16); }, nacl.secretbox.open = function(box, nonce, key) { checkArrayTypes(box, nonce, key), checkLengths(key, nonce); for (var c = new Uint8Array(16 + box.length), m = new Uint8Array(c.length), i = 0; i < box.length; i++) c[i + 16] = box[i]; return !(c.length < 32) && 0 === crypto_secretbox_open(m, c, c.length, nonce, key) && m.subarray(32); }, nacl.secretbox.keyLength = 32, nacl.secretbox.nonceLength = 24, nacl.secretbox.overheadLength = 16, nacl.scalarMult = function(n, p) { if (checkArrayTypes(n, p), 32 !== n.length) throw new Error("bad n size"); if (32 !== p.length) throw new Error("bad p size"); var q = new Uint8Array(32); return crypto_scalarmult(q, n, p), q; }, nacl.scalarMult.base = function(n) { if (checkArrayTypes(n), 32 !== n.length) throw new Error("bad n size"); var q = new Uint8Array(32); return crypto_scalarmult_base(q, n), q; }, nacl.scalarMult.scalarLength = 32, nacl.scalarMult.groupElementLength = 32, nacl.box = function(msg, nonce, publicKey, secretKey) { var k = nacl.box.before(publicKey, secretKey); return nacl.secretbox(msg, nonce, k); }, nacl.box.before = function(publicKey, secretKey) { checkArrayTypes(publicKey, secretKey), (function(pk, sk) { if (32 !== pk.length) throw new Error("bad public key size"); if (32 !== sk.length) throw new Error("bad secret key size"); })(publicKey, secretKey); var k = new Uint8Array(32); return crypto_box_beforenm(k, publicKey, secretKey), k; }, nacl.box.after = nacl.secretbox, nacl.box.open = function(msg, nonce, publicKey, secretKey) { var k = nacl.box.before(publicKey, secretKey); return nacl.secretbox.open(msg, nonce, k); }, nacl.box.open.after = nacl.secretbox.open, nacl.box.keyPair = function() { var pk = new Uint8Array(32), sk = new Uint8Array(32); return crypto_box_keypair(pk, sk), { publicKey: pk, secretKey: sk }; }, nacl.box.keyPair.fromSecretKey = function(secretKey) { if (checkArrayTypes(secretKey), 32 !== secretKey.length) throw new Error("bad secret key size"); var pk = new Uint8Array(32); return crypto_scalarmult_base(pk, secretKey), { publicKey: pk, secretKey: new Uint8Array(secretKey) }; }, nacl.box.publicKeyLength = 32, nacl.box.secretKeyLength = 32, nacl.box.sharedKeyLength = 32, nacl.box.nonceLength = 24, nacl.box.overheadLength = nacl.secretbox.overheadLength, nacl.sign = function(msg, secretKey) { if (checkArrayTypes(msg, secretKey), 64 !== secretKey.length) throw new Error("bad secret key size"); var signedMsg = new Uint8Array(64 + msg.length); return crypto_sign(signedMsg, msg, msg.length, secretKey), signedMsg; }, nacl.sign.open = function(signedMsg, publicKey) { if (2 !== arguments.length) throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?"); if (checkArrayTypes(signedMsg, publicKey), 32 !== publicKey.length) throw new Error("bad public key size"); var tmp = new Uint8Array(signedMsg.length), mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); if (mlen < 0) return null; for (var m = new Uint8Array(mlen), i = 0; i < m.length; i++) m[i] = tmp[i]; return m; }, nacl.sign.detached = function(msg, secretKey) { for (var signedMsg = nacl.sign(msg, secretKey), sig = new Uint8Array(64), i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; return sig; }, nacl.sign.detached.verify = function(msg, sig, publicKey) { if (checkArrayTypes(msg, sig, publicKey), 64 !== sig.length) throw new Error("bad signature size"); if (32 !== publicKey.length) throw new Error("bad public key size"); var i, sm = new Uint8Array(64 + msg.length), m = new Uint8Array(64 + msg.length); for (i = 0; i < 64; i++) sm[i] = sig[i]; for (i = 0; i < msg.length; i++) sm[i + 64] = msg[i]; return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; }, nacl.sign.keyPair = function() { var pk = new Uint8Array(32), sk = new Uint8Array(64); return crypto_sign_keypair(pk, sk), { publicKey: pk, secretKey: sk }; }, nacl.sign.keyPair.fromSecretKey = function(secretKey) { if (checkArrayTypes(secretKey), 64 !== secretKey.length) throw new Error("bad secret key size"); for (var pk = new Uint8Array(32), i = 0; i < pk.length; i++) pk[i] = secretKey[32 + i]; return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; }, nacl.sign.keyPair.fromSeed = function(seed) { if (checkArrayTypes(seed), 32 !== seed.length) throw new Error("bad seed size"); for (var pk = new Uint8Array(32), sk = new Uint8Array(64), i = 0; i < 32; i++) sk[i] = seed[i]; return crypto_sign_keypair(pk, sk, !0), { publicKey: pk, secretKey: sk }; }, nacl.sign.publicKeyLength = 32, nacl.sign.secretKeyLength = 64, nacl.sign.seedLength = 32, nacl.sign.signatureLength = 64, nacl.hash = function(msg) { checkArrayTypes(msg); var h = new Uint8Array(64); return crypto_hash(h, msg, msg.length), h; }, nacl.hash.hashLength = 64, nacl.verify = function(x, y) { return checkArrayTypes(x, y), 0 !== x.length && 0 !== y.length && x.length === y.length && 0 === vn(x, 0, y, 0, x.length); }, nacl.setPRNG = function(fn) { randombytes = fn; }, (crypto = "undefined" != typeof self ? self.crypto || self.msCrypto : null) && crypto.getRandomValues ? nacl.setPRNG((function(x, n) { var i, v = new Uint8Array(n); for (i = 0; i < n; i += 65536) crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, 65536))); for (i = 0; i < n; i++) x[i] = v[i]; cleanup(v); })) : (crypto = __webpack_require__(6)) && crypto.randomBytes && nacl.setPRNG((function(x, n) { var i, v = crypto.randomBytes(n); for (i = 0; i < n; i++) x[i] = v[i]; cleanup(v); })); })(module.exports ? module.exports : self.nacl = self.nacl || {}); }, function(module, exports, __webpack_require__) { module.exports = SSHBuffer; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer; function SSHBuffer(opts) { assert.object(opts, "options"), void 0 !== opts.buffer && assert.buffer(opts.buffer, "options.buffer"), this._size = opts.buffer ? opts.buffer.length : 1024, this._buffer = opts.buffer || Buffer.alloc(this._size), this._offset = 0; } SSHBuffer.prototype.toBuffer = function() { return this._buffer.slice(0, this._offset); }, SSHBuffer.prototype.atEnd = function() { return this._offset >= this._buffer.length; }, SSHBuffer.prototype.remainder = function() { return this._buffer.slice(this._offset); }, SSHBuffer.prototype.skip = function(n) { this._offset += n; }, SSHBuffer.prototype.expand = function() { this._size *= 2; var buf = Buffer.alloc(this._size); this._buffer.copy(buf, 0), this._buffer = buf; }, SSHBuffer.prototype.readPart = function() { return { data: this.readBuffer() }; }, SSHBuffer.prototype.readBuffer = function() { var len = this._buffer.readUInt32BE(this._offset); this._offset += 4, assert.ok(this._offset + len <= this._buffer.length, "length out of bounds at +0x" + this._offset.toString(16) + " (data truncated?)"); var buf = this._buffer.slice(this._offset, this._offset + len); return this._offset += len, buf; }, SSHBuffer.prototype.readString = function() { return this.readBuffer().toString(); }, SSHBuffer.prototype.readCString = function() { for (var offset = this._offset; offset < this._buffer.length && 0 !== this._buffer[offset]; ) offset++; assert.ok(offset < this._buffer.length, "c string does not terminate"); var str = this._buffer.slice(this._offset, offset).toString(); return this._offset = offset + 1, str; }, SSHBuffer.prototype.readInt = function() { var v = this._buffer.readUInt32BE(this._offset); return this._offset += 4, v; }, SSHBuffer.prototype.readInt64 = function() { assert.ok(this._offset + 8 < this._buffer.length, "buffer not long enough to read Int64"); var v = this._buffer.slice(this._offset, this._offset + 8); return this._offset += 8, v; }, SSHBuffer.prototype.readChar = function() { return this._buffer[this._offset++]; }, SSHBuffer.prototype.writeBuffer = function(buf) { for (;this._offset + 4 + buf.length > this._size; ) this.expand(); this._buffer.writeUInt32BE(buf.length, this._offset), this._offset += 4, buf.copy(this._buffer, this._offset), this._offset += buf.length; }, SSHBuffer.prototype.writeString = function(str) { this.writeBuffer(Buffer.from(str, "utf8")); }, SSHBuffer.prototype.writeCString = function(str) { for (;this._offset + 1 + str.length > this._size; ) this.expand(); this._buffer.write(str, this._offset), this._offset += str.length, this._buffer[this._offset++] = 0; }, SSHBuffer.prototype.writeInt = function(v) { for (;this._offset + 4 > this._size; ) this.expand(); this._buffer.writeUInt32BE(v, this._offset), this._offset += 4; }, SSHBuffer.prototype.writeInt64 = function(v) { if (assert.buffer(v, "value"), v.length > 8) { for (var lead = v.slice(0, v.length - 8), i = 0; i < lead.length; ++i) assert.strictEqual(lead[i], 0, "must fit in 64 bits of precision"); v = v.slice(v.length - 8, v.length); } for (;this._offset + 8 > this._size; ) this.expand(); v.copy(this._buffer, this._offset), this._offset += 8; }, SSHBuffer.prototype.writeChar = function(v) { for (;this._offset + 1 > this._size; ) this.expand(); this._buffer[this._offset++] = v; }, SSHBuffer.prototype.writePart = function(p) { this.writeBuffer(p.data); }, SSHBuffer.prototype.write = function(buf) { for (;this._offset + buf.length > this._size; ) this.expand(); buf.copy(this._buffer, this._offset), this._offset += buf.length; }; }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { return pem.read(buf, options, "pkcs8"); }, readPkcs8: function(alg, type, der) { der.peek() === asn1.Ber.Integer && (assert.strictEqual(type, "private", "unexpected Integer at start of public key"), der.readString(asn1.Ber.Integer, !0)), der.readSequence(); var next = der.offset + der.length, oid = der.readOID(); switch (oid) { case "1.2.840.113549.1.1.1": return der._offset = next, "public" === type ? (function(der) { der.readSequence(asn1.Ber.BitString), der.readByte(), der.readSequence(); var n = readMPInt(der, "modulus"), e = readMPInt(der, "exponent"), key = { type: "rsa", source: der.originalInput, parts: [ { name: "e", data: e }, { name: "n", data: n } ] }; return new Key(key); })(der) : (function(der) { der.readSequence(asn1.Ber.OctetString), der.readSequence(); var ver = readMPInt(der, "version"); assert.equal(ver[0], 0, "unknown RSA private key version"); var n = readMPInt(der, "modulus"), e = readMPInt(der, "public exponent"), d = readMPInt(der, "private exponent"), p = readMPInt(der, "prime1"), q = readMPInt(der, "prime2"), dmodp = readMPInt(der, "exponent1"), dmodq = readMPInt(der, "exponent2"), iqmp = readMPInt(der, "iqmp"); return new PrivateKey({ type: "rsa", parts: [ { name: "n", data: n }, { name: "e", data: e }, { name: "d", data: d }, { name: "iqmp", data: iqmp }, { name: "p", data: p }, { name: "q", data: q }, { name: "dmodp", data: dmodp }, { name: "dmodq", data: dmodq } ] }); })(der); case "1.2.840.10040.4.1": return "public" === type ? (function(der) { der.readSequence(); var p = readMPInt(der, "p"), q = readMPInt(der, "q"), g = readMPInt(der, "g"); der.readSequence(asn1.Ber.BitString), der.readByte(); var y = readMPInt(der, "y"); return new Key({ type: "dsa", parts: [ { name: "p", data: p }, { name: "q", data: q }, { name: "g", data: g }, { name: "y", data: y } ] }); })(der) : (function(der) { der.readSequence(); var p = readMPInt(der, "p"), q = readMPInt(der, "q"), g = readMPInt(der, "g"); der.readSequence(asn1.Ber.OctetString); var x = readMPInt(der, "x"), y = utils.calculateDSAPublic(g, p, x); return new PrivateKey({ type: "dsa", parts: [ { name: "p", data: p }, { name: "q", data: q }, { name: "g", data: g }, { name: "y", data: y }, { name: "x", data: x } ] }); })(der); case "1.2.840.10045.2.1": return "public" === type ? (function(der) { var curveName = readECDSACurve(der); assert.string(curveName, "a known elliptic curve"); var Q = der.readString(asn1.Ber.BitString, !0); Q = utils.ecNormalize(Q); var key = { type: "ecdsa", parts: [ { name: "curve", data: Buffer.from(curveName) }, { name: "Q", data: Q } ] }; return new Key(key); })(der) : (function(der) { var curveName = readECDSACurve(der); assert.string(curveName, "a known elliptic curve"), der.readSequence(asn1.Ber.OctetString), der.readSequence(); var version = readMPInt(der, "version"); assert.equal(version[0], 1, "unknown version of ECDSA key"); var Q, d = der.readString(asn1.Ber.OctetString, !0); 160 == der.peek() && (der.readSequence(160), der._offset += der.length), 161 == der.peek() && (der.readSequence(161), Q = der.readString(asn1.Ber.BitString, !0), Q = utils.ecNormalize(Q)), void 0 === Q && (Q = utils.publicFromPrivateECDSA(curveName, d).part.Q.data); var key = { type: "ecdsa", parts: [ { name: "curve", data: Buffer.from(curveName) }, { name: "Q", data: Q }, { name: "d", data: d } ] }; return new PrivateKey(key); })(der); case "1.3.101.112": return "public" === type ? (function(der) { 0 === der.peek() && der.readByte(); var A = utils.readBitString(der), key = { type: "ed25519", parts: [ { name: "A", data: utils.zeroPadToLength(A, 32) } ] }; return new Key(key); })(der) : (function(der) { 0 === der.peek() && der.readByte(), der.readSequence(asn1.Ber.OctetString); var A, k = der.readString(asn1.Ber.OctetString, !0); k = utils.zeroPadToLength(k, 32), der.peek() === asn1.Ber.BitString ? (A = utils.readBitString(der), A = utils.zeroPadToLength(A, 32)) : A = utils.calculateED25519Public(k); var key = { type: "ed25519", parts: [ { name: "A", data: utils.zeroPadToLength(A, 32) }, { name: "k", data: utils.zeroPadToLength(k, 32) } ] }; return new PrivateKey(key); })(der); case "1.3.101.110": return "public" === type ? (function(der) { var A = utils.readBitString(der), key = { type: "curve25519", parts: [ { name: "A", data: utils.zeroPadToLength(A, 32) } ] }; return new Key(key); })(der) : (function(der) { 0 === der.peek() && der.readByte(), der.readSequence(asn1.Ber.OctetString); var k = der.readString(asn1.Ber.OctetString, !0); k = utils.zeroPadToLength(k, 32); var A = utils.calculateX25519Public(k), key = { type: "curve25519", parts: [ { name: "A", data: utils.zeroPadToLength(A, 32) }, { name: "k", data: utils.zeroPadToLength(k, 32) } ] }; return new PrivateKey(key); })(der); default: throw new Error("Unknown key type OID " + oid); } }, write: function(key, options) { return pem.write(key, options, "pkcs8"); }, writePkcs8: writePkcs8, pkcs8ToBuffer: function(key) { var der = new asn1.BerWriter; return writePkcs8(der, key), der.buffer; }, readECDSACurve: readECDSACurve, writeECDSACurve: writeECDSACurve }; var assert = __webpack_require__(15), asn1 = __webpack_require__(54), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(31), utils = __webpack_require__(28), Key = __webpack_require__(27), PrivateKey = __webpack_require__(29), pem = __webpack_require__(62); function readMPInt(der, nm) { return assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + " is not an Integer"), utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)); } function readECDSACurve(der) { var curveName, curveNames, j, c, cd; if (der.peek() === asn1.Ber.OID) { var oid = der.readOID(); for (curveNames = Object.keys(algs.curves), j = 0; j < curveNames.length; ++j) if (c = curveNames[j], (cd = algs.curves[c]).pkcs8oid === oid) { curveName = c; break; } } else { der.readSequence(); var version = der.readString(asn1.Ber.Integer, !0); assert.strictEqual(version[0], 1, "ECDSA key not version 1"); var curve = {}; der.readSequence(); var fieldTypeOid = der.readOID(); assert.strictEqual(fieldTypeOid, "1.2.840.10045.1.1", "ECDSA key is not from a prime-field"); var p = curve.p = utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)); curve.size = 8 * p.length - utils.countZeros(p), der.readSequence(), curve.a = utils.mpNormalize(der.readString(asn1.Ber.OctetString, !0)), curve.b = utils.mpNormalize(der.readString(asn1.Ber.OctetString, !0)), der.peek() === asn1.Ber.BitString && (curve.s = der.readString(asn1.Ber.BitString, !0)), curve.G = der.readString(asn1.Ber.OctetString, !0), assert.strictEqual(curve.G[0], 4, "uncompressed G is required"), curve.n = utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)), curve.h = utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)), assert.strictEqual(curve.h[0], 1, "a cofactor=1 curve is required"), curveNames = Object.keys(algs.curves); var ks = Object.keys(curve); for (j = 0; j < curveNames.length; ++j) { c = curveNames[j], cd = algs.curves[c]; for (var equal = !0, i = 0; i < ks.length; ++i) { var k = ks[i]; if (void 0 !== cd[k]) if ("object" == typeof cd[k] && void 0 !== cd[k].equals) { if (!cd[k].equals(curve[k])) { equal = !1; break; } } else if (Buffer.isBuffer(cd[k])) { if (cd[k].toString("binary") !== curve[k].toString("binary")) { equal = !1; break; } } else if (cd[k] !== curve[k]) { equal = !1; break; } } if (equal) { curveName = c; break; } } } return curveName; } function writePkcs8(der, key) { if (der.startSequence(), PrivateKey.isPrivateKey(key)) { var sillyInt = Buffer.from([ 0 ]); der.writeBuffer(sillyInt, asn1.Ber.Integer); } switch (der.startSequence(), key.type) { case "rsa": der.writeOID("1.2.840.113549.1.1.1"), PrivateKey.isPrivateKey(key) ? (function(key, der) { der.writeNull(), der.endSequence(), der.startSequence(asn1.Ber.OctetString), der.startSequence(); var version = Buffer.from([ 0 ]); der.writeBuffer(version, asn1.Ber.Integer), der.writeBuffer(key.part.n.data, asn1.Ber.Integer), der.writeBuffer(key.part.e.data, asn1.Ber.Integer), der.writeBuffer(key.part.d.data, asn1.Ber.Integer), der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), key.part.dmodp && key.part.dmodq || utils.addRSAMissing(key), der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer), der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer), der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer), der.endSequence(), der.endSequence(); })(key, der) : (function(key, der) { der.writeNull(), der.endSequence(), der.startSequence(asn1.Ber.BitString), der.writeByte(0), der.startSequence(), der.writeBuffer(key.part.n.data, asn1.Ber.Integer), der.writeBuffer(key.part.e.data, asn1.Ber.Integer), der.endSequence(), der.endSequence(); })(key, der); break; case "dsa": der.writeOID("1.2.840.10040.4.1"), PrivateKey.isPrivateKey(key) ? (function(key, der) { der.startSequence(), der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), der.writeBuffer(key.part.g.data, asn1.Ber.Integer), der.endSequence(), der.endSequence(), der.startSequence(asn1.Ber.OctetString), der.writeBuffer(key.part.x.data, asn1.Ber.Integer), der.endSequence(); })(key, der) : (function(key, der) { der.startSequence(), der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), der.writeBuffer(key.part.g.data, asn1.Ber.Integer), der.endSequence(), der.endSequence(), der.startSequence(asn1.Ber.BitString), der.writeByte(0), der.writeBuffer(key.part.y.data, asn1.Ber.Integer), der.endSequence(); })(key, der); break; case "ecdsa": der.writeOID("1.2.840.10045.2.1"), PrivateKey.isPrivateKey(key) ? (function(key, der) { writeECDSACurve(key, der), der.endSequence(), der.startSequence(asn1.Ber.OctetString), der.startSequence(); var version = Buffer.from([ 1 ]); der.writeBuffer(version, asn1.Ber.Integer), der.writeBuffer(key.part.d.data, asn1.Ber.OctetString), der.startSequence(161); var Q = utils.ecNormalize(key.part.Q.data, !0); der.writeBuffer(Q, asn1.Ber.BitString), der.endSequence(), der.endSequence(), der.endSequence(); })(key, der) : (function(key, der) { writeECDSACurve(key, der), der.endSequence(); var Q = utils.ecNormalize(key.part.Q.data, !0); der.writeBuffer(Q, asn1.Ber.BitString); })(key, der); break; case "ed25519": if (der.writeOID("1.3.101.112"), PrivateKey.isPrivateKey(key)) throw new Error("Ed25519 private keys in pkcs8 format are not supported"); !(function(key, der) { der.endSequence(), utils.writeBitString(der, key.part.A.data); })(key, der); break; default: throw new Error("Unsupported key type: " + key.type); } der.endSequence(); } function writeECDSACurve(key, der) { var curve = algs.curves[key.curve]; if (curve.pkcs8oid) der.writeOID(curve.pkcs8oid); else { der.startSequence(); var version = Buffer.from([ 1 ]); der.writeBuffer(version, asn1.Ber.Integer), der.startSequence(), der.writeOID("1.2.840.10045.1.1"), der.writeBuffer(curve.p, asn1.Ber.Integer), der.endSequence(), der.startSequence(); var a = curve.p; 0 === a[0] && (a = a.slice(1)), der.writeBuffer(a, asn1.Ber.OctetString), der.writeBuffer(curve.b, asn1.Ber.OctetString), der.writeBuffer(curve.s, asn1.Ber.BitString), der.endSequence(), der.writeBuffer(curve.G, asn1.Ber.OctetString), der.writeBuffer(curve.n, asn1.Ber.Integer); var h = curve.h; h || (h = Buffer.from([ 1 ])), der.writeBuffer(h, asn1.Ber.Integer), der.endSequence(); } } }, function(module, exports, __webpack_require__) { module.exports = Certificate; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(31), crypto = __webpack_require__(6), Fingerprint = __webpack_require__(109), errs = (__webpack_require__(53), __webpack_require__(48)), utils = (__webpack_require__(0), __webpack_require__(28)), Key = __webpack_require__(27), PrivateKey = __webpack_require__(29), Identity = __webpack_require__(115), formats = {}; formats.openssh = __webpack_require__(1143), formats.x509 = __webpack_require__(526), formats.pem = __webpack_require__(1144); var CertificateParseError = errs.CertificateParseError, InvalidAlgorithmError = errs.InvalidAlgorithmError; function Certificate(opts) { assert.object(opts, "options"), assert.arrayOfObject(opts.subjects, "options.subjects"), utils.assertCompatible(opts.subjects[0], Identity, [ 1, 0 ], "options.subjects"), utils.assertCompatible(opts.subjectKey, Key, [ 1, 0 ], "options.subjectKey"), utils.assertCompatible(opts.issuer, Identity, [ 1, 0 ], "options.issuer"), void 0 !== opts.issuerKey && utils.assertCompatible(opts.issuerKey, Key, [ 1, 0 ], "options.issuerKey"), assert.object(opts.signatures, "options.signatures"), assert.buffer(opts.serial, "options.serial"), assert.date(opts.validFrom, "options.validFrom"), assert.date(opts.validUntil, "optons.validUntil"), assert.optionalArrayOfString(opts.purposes, "options.purposes"), this._hashCache = {}, this.subjects = opts.subjects, this.issuer = opts.issuer, this.subjectKey = opts.subjectKey, this.issuerKey = opts.issuerKey, this.signatures = opts.signatures, this.serial = opts.serial, this.validFrom = opts.validFrom, this.validUntil = opts.validUntil, this.purposes = opts.purposes; } Certificate.formats = formats, Certificate.prototype.toBuffer = function(format, options) { return void 0 === format && (format = "x509"), assert.string(format, "format"), assert.object(formats[format], "formats[format]"), assert.optionalObject(options, "options"), formats[format].write(this, options); }, Certificate.prototype.toString = function(format, options) { return void 0 === format && (format = "pem"), this.toBuffer(format, options).toString(); }, Certificate.prototype.fingerprint = function(algo) { void 0 === algo && (algo = "sha256"), assert.string(algo, "algorithm"); var opts = { type: "certificate", hash: this.hash(algo), algorithm: algo }; return new Fingerprint(opts); }, Certificate.prototype.hash = function(algo) { if (assert.string(algo, "algorithm"), algo = algo.toLowerCase(), void 0 === algs.hashAlgs[algo]) throw new InvalidAlgorithmError(algo); if (this._hashCache[algo]) return this._hashCache[algo]; var hash = crypto.createHash(algo).update(this.toBuffer("x509")).digest(); return this._hashCache[algo] = hash, hash; }, Certificate.prototype.isExpired = function(when) { return void 0 === when && (when = new Date), !(when.getTime() >= this.validFrom.getTime() && when.getTime() < this.validUntil.getTime()); }, Certificate.prototype.isSignedBy = function(issuerCert) { return utils.assertCompatible(issuerCert, Certificate, [ 1, 0 ], "issuer"), !!this.issuer.equals(issuerCert.subjects[0]) && !(this.issuer.purposes && this.issuer.purposes.length > 0 && -1 === this.issuer.purposes.indexOf("ca")) && this.isSignedByKey(issuerCert.subjectKey); }, Certificate.prototype.getExtension = function(keyOrOid) { return assert.string(keyOrOid, "keyOrOid"), this.getExtensions().filter((function(maybeExt) { return "x509" === maybeExt.format ? maybeExt.oid === keyOrOid : "openssh" === maybeExt.format && maybeExt.name === keyOrOid; }))[0]; }, Certificate.prototype.getExtensions = function() { var exts = [], x509 = this.signatures.x509; x509 && x509.extras && x509.extras.exts && x509.extras.exts.forEach((function(ext) { ext.format = "x509", exts.push(ext); })); var openssh = this.signatures.openssh; return openssh && openssh.exts && openssh.exts.forEach((function(ext) { ext.format = "openssh", exts.push(ext); })), exts; }, Certificate.prototype.isSignedByKey = function(issuerKey) { if (utils.assertCompatible(issuerKey, Key, [ 1, 2 ], "issuerKey"), void 0 !== this.issuerKey) return this.issuerKey.fingerprint("sha512").matches(issuerKey); var fmt = Object.keys(this.signatures)[0], valid = formats[fmt].verify(this, issuerKey); return valid && (this.issuerKey = issuerKey), valid; }, Certificate.prototype.signWith = function(key) { utils.assertCompatible(key, PrivateKey, [ 1, 2 ], "key"); for (var fmts = Object.keys(formats), didOne = !1, i = 0; i < fmts.length; ++i) "pem" !== fmts[i] && !0 === formats[fmts[i]].sign(this, key) && (didOne = !0); if (!didOne) throw new Error("Failed to sign the certificate for any available certificate formats"); }, Certificate.createSelfSigned = function(subjectOrSubjects, key, options) { var subjects; subjects = Array.isArray(subjectOrSubjects) ? subjectOrSubjects : [ subjectOrSubjects ], assert.arrayOfObject(subjects), subjects.forEach((function(subject) { utils.assertCompatible(subject, Identity, [ 1, 0 ], "subject"); })), utils.assertCompatible(key, PrivateKey, [ 1, 2 ], "private key"), assert.optionalObject(options, "options"), void 0 === options && (options = {}), assert.optionalObject(options.validFrom, "options.validFrom"), assert.optionalObject(options.validUntil, "options.validUntil"); var validFrom = options.validFrom, validUntil = options.validUntil; if (void 0 === validFrom && (validFrom = new Date), void 0 === validUntil) { assert.optionalNumber(options.lifetime, "options.lifetime"); var lifetime = options.lifetime; void 0 === lifetime && (lifetime = 31536e4), (validUntil = new Date).setTime(validUntil.getTime() + 1e3 * lifetime); } assert.optionalBuffer(options.serial, "options.serial"); var serial = options.serial; void 0 === serial && (serial = Buffer.from("0000000000000001", "hex")); var purposes = options.purposes; if (void 0 === purposes && (purposes = []), -1 === purposes.indexOf("signature") && purposes.push("signature"), -1 === purposes.indexOf("ca") && purposes.push("ca"), -1 === purposes.indexOf("crl") && purposes.push("crl"), purposes.length <= 3) { var hostSubjects = subjects.filter((function(subject) { return "host" === subject.type; })), userSubjects = subjects.filter((function(subject) { return "user" === subject.type; })); hostSubjects.length > 0 && -1 === purposes.indexOf("serverAuth") && purposes.push("serverAuth"), userSubjects.length > 0 && -1 === purposes.indexOf("clientAuth") && purposes.push("clientAuth"), (userSubjects.length > 0 || hostSubjects.length > 0) && (-1 === purposes.indexOf("keyAgreement") && purposes.push("keyAgreement"), "rsa" === key.type && -1 === purposes.indexOf("encryption") && purposes.push("encryption")); } var cert = new Certificate({ subjects: subjects, issuer: subjects[0], subjectKey: key.toPublic(), issuerKey: key.toPublic(), signatures: {}, serial: serial, validFrom: validFrom, validUntil: validUntil, purposes: purposes }); return cert.signWith(key), cert; }, Certificate.create = function(subjectOrSubjects, key, issuer, issuerKey, options) { var subjects; subjects = Array.isArray(subjectOrSubjects) ? subjectOrSubjects : [ subjectOrSubjects ], assert.arrayOfObject(subjects), subjects.forEach((function(subject) { utils.assertCompatible(subject, Identity, [ 1, 0 ], "subject"); })), utils.assertCompatible(key, Key, [ 1, 0 ], "key"), PrivateKey.isPrivateKey(key) && (key = key.toPublic()), utils.assertCompatible(issuer, Identity, [ 1, 0 ], "issuer"), utils.assertCompatible(issuerKey, PrivateKey, [ 1, 2 ], "issuer key"), assert.optionalObject(options, "options"), void 0 === options && (options = {}), assert.optionalObject(options.validFrom, "options.validFrom"), assert.optionalObject(options.validUntil, "options.validUntil"); var validFrom = options.validFrom, validUntil = options.validUntil; if (void 0 === validFrom && (validFrom = new Date), void 0 === validUntil) { assert.optionalNumber(options.lifetime, "options.lifetime"); var lifetime = options.lifetime; void 0 === lifetime && (lifetime = 31536e4), (validUntil = new Date).setTime(validUntil.getTime() + 1e3 * lifetime); } assert.optionalBuffer(options.serial, "options.serial"); var serial = options.serial; void 0 === serial && (serial = Buffer.from("0000000000000001", "hex")); var purposes = options.purposes; void 0 === purposes && (purposes = []), -1 === purposes.indexOf("signature") && purposes.push("signature"), !0 === options.ca && (-1 === purposes.indexOf("ca") && purposes.push("ca"), -1 === purposes.indexOf("crl") && purposes.push("crl")); var hostSubjects = subjects.filter((function(subject) { return "host" === subject.type; })), userSubjects = subjects.filter((function(subject) { return "user" === subject.type; })); hostSubjects.length > 0 && -1 === purposes.indexOf("serverAuth") && purposes.push("serverAuth"), userSubjects.length > 0 && -1 === purposes.indexOf("clientAuth") && purposes.push("clientAuth"), (userSubjects.length > 0 || hostSubjects.length > 0) && (-1 === purposes.indexOf("keyAgreement") && purposes.push("keyAgreement"), "rsa" === key.type && -1 === purposes.indexOf("encryption") && purposes.push("encryption")); var cert = new Certificate({ subjects: subjects, issuer: issuer, subjectKey: key, issuerKey: issuerKey.toPublic(), signatures: {}, serial: serial, validFrom: validFrom, validUntil: validUntil, purposes: purposes }); return cert.signWith(issuerKey), cert; }, Certificate.parse = function(data, format, options) { "string" != typeof data && assert.buffer(data, "data"), void 0 === format && (format = "auto"), assert.string(format, "format"), "string" == typeof options && (options = { filename: options }), assert.optionalObject(options, "options"), void 0 === options && (options = {}), assert.optionalString(options.filename, "options.filename"), void 0 === options.filename && (options.filename = "(unnamed)"), assert.object(formats[format], "formats[format]"); try { return formats[format].read(data, options); } catch (e) { throw new CertificateParseError(options.filename, format, e); } }, Certificate.isCertificate = function(obj, ver) { return utils.isCompatible(obj, Certificate, ver); }, Certificate.prototype._sshpkApiVersion = [ 1, 1 ], Certificate._oldVersionDetect = function(obj) { return [ 1, 0 ]; }; }, function(module, exports, __webpack_require__) { module.exports = Identity; var assert = __webpack_require__(15), utils = (__webpack_require__(31), __webpack_require__(6), __webpack_require__(109), __webpack_require__(53), __webpack_require__(48), __webpack_require__(0), __webpack_require__(28)), asn1 = __webpack_require__(54), Buffer = __webpack_require__(14).Buffer, DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i, oids = { cn: "2.5.4.3", o: "2.5.4.10", ou: "2.5.4.11", l: "2.5.4.7", s: "2.5.4.8", c: "2.5.4.6", sn: "2.5.4.4", postalCode: "2.5.4.17", serialNumber: "2.5.4.5", street: "2.5.4.9", x500UniqueIdentifier: "2.5.4.45", role: "2.5.4.72", telephoneNumber: "2.5.4.20", description: "2.5.4.13", dc: "0.9.2342.19200300.100.1.25", uid: "0.9.2342.19200300.100.1.1", mail: "0.9.2342.19200300.100.1.3", title: "2.5.4.12", gn: "2.5.4.42", initials: "2.5.4.43", pseudonym: "2.5.4.65", emailAddress: "1.2.840.113549.1.9.1" }, unoids = {}; function Identity(opts) { var self = this; if (assert.object(opts, "options"), assert.arrayOfObject(opts.components, "options.components"), this.components = opts.components, this.componentLookup = {}, this.components.forEach((function(c) { c.name && !c.oid && (c.oid = oids[c.name]), c.oid && !c.name && (c.name = unoids[c.oid]), void 0 === self.componentLookup[c.name] && (self.componentLookup[c.name] = []), self.componentLookup[c.name].push(c); })), this.componentLookup.cn && this.componentLookup.cn.length > 0 && (this.cn = this.componentLookup.cn[0].value), assert.optionalString(opts.type, "options.type"), void 0 === opts.type) 1 === this.components.length && this.componentLookup.cn && 1 === this.componentLookup.cn.length && this.componentLookup.cn[0].value.match(DNS_NAME_RE) ? (this.type = "host", this.hostname = this.componentLookup.cn[0].value) : this.componentLookup.dc && this.components.length === this.componentLookup.dc.length ? (this.type = "host", this.hostname = this.componentLookup.dc.map((function(c) { return c.value; })).join(".")) : this.componentLookup.uid && this.components.length === this.componentLookup.uid.length ? (this.type = "user", this.uid = this.componentLookup.uid[0].value) : this.componentLookup.cn && 1 === this.componentLookup.cn.length && this.componentLookup.cn[0].value.match(DNS_NAME_RE) ? (this.type = "host", this.hostname = this.componentLookup.cn[0].value) : this.componentLookup.uid && 1 === this.componentLookup.uid.length ? (this.type = "user", this.uid = this.componentLookup.uid[0].value) : this.componentLookup.mail && 1 === this.componentLookup.mail.length ? (this.type = "email", this.email = this.componentLookup.mail[0].value) : this.componentLookup.cn && 1 === this.componentLookup.cn.length ? (this.type = "user", this.uid = this.componentLookup.cn[0].value) : this.type = "unknown"; else if (this.type = opts.type, "host" === this.type) this.hostname = opts.hostname; else if ("user" === this.type) this.uid = opts.uid; else { if ("email" !== this.type) throw new Error("Unknown type " + this.type); this.email = opts.email; } } Object.keys(oids).forEach((function(k) { unoids[oids[k]] = k; })), Identity.prototype.toString = function() { return this.components.map((function(c) { var n = c.name.toUpperCase(); n = n.replace(/=/g, "\\="); var v = c.value; return n + "=" + v.replace(/,/g, "\\,"); })).join(", "); }, Identity.prototype.get = function(name, asArray) { assert.string(name, "name"); var arr = this.componentLookup[name]; if (void 0 !== arr && 0 !== arr.length) { if (!asArray && arr.length > 1) throw new Error("Multiple values for attribute " + name); return asArray ? arr.map((function(c) { return c.value; })) : arr[0].value; } }, Identity.prototype.toArray = function(idx) { return this.components.map((function(c) { return { name: c.name, value: c.value }; })); }; var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/, NOT_IA5 = /[^\x00-\x7f]/; function globMatch(a, b) { if ("**" === a || "**" === b) return !0; var aParts = a.split("."), bParts = b.split("."); if (aParts.length !== bParts.length) return !1; for (var i = 0; i < aParts.length; ++i) if ("*" !== aParts[i] && "*" !== bParts[i] && aParts[i] !== bParts[i]) return !1; return !0; } Identity.prototype.toAsn1 = function(der, tag) { der.startSequence(tag), this.components.forEach((function(c) { if (der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set), der.startSequence(), der.writeOID(c.oid), c.asn1type === asn1.Ber.Utf8String || c.value.match(NOT_IA5)) { var v = Buffer.from(c.value, "utf8"); der.writeBuffer(v, asn1.Ber.Utf8String); } else if (c.asn1type === asn1.Ber.IA5String || c.value.match(NOT_PRINTABLE)) der.writeString(c.value, asn1.Ber.IA5String); else { var type = asn1.Ber.PrintableString; void 0 !== c.asn1type && (type = c.asn1type), der.writeString(c.value, type); } der.endSequence(), der.endSequence(); })), der.endSequence(); }, Identity.prototype.equals = function(other) { if (!Identity.isIdentity(other, [ 1, 0 ])) return !1; if (other.components.length !== this.components.length) return !1; for (var i = 0; i < this.components.length; ++i) { if (this.components[i].oid !== other.components[i].oid) return !1; if (!globMatch(this.components[i].value, other.components[i].value)) return !1; } return !0; }, Identity.forHost = function(hostname) { return assert.string(hostname, "hostname"), new Identity({ type: "host", hostname: hostname, components: [ { name: "cn", value: hostname } ] }); }, Identity.forUser = function(uid) { return assert.string(uid, "uid"), new Identity({ type: "user", uid: uid, components: [ { name: "uid", value: uid } ] }); }, Identity.forEmail = function(email) { return assert.string(email, "email"), new Identity({ type: "email", email: email, components: [ { name: "mail", value: email } ] }); }, Identity.parseDN = function(dn) { assert.string(dn, "dn"); for (var parts = [ "" ], idx = 0, rem = dn; rem.length > 0; ) { var m; if (null !== (m = /^,/.exec(rem))) parts[++idx] = "", rem = rem.slice(m[0].length); else if (null !== (m = /^\\,/.exec(rem))) parts[idx] += ",", rem = rem.slice(m[0].length); else if (null !== (m = /^\\./.exec(rem))) parts[idx] += m[0], rem = rem.slice(m[0].length); else { if (null === (m = /^[^\\,]+/.exec(rem))) throw new Error("Failed to parse DN"); parts[idx] += m[0], rem = rem.slice(m[0].length); } } return new Identity({ components: parts.map((function(c) { for (var eqPos = (c = c.trim()).indexOf("="); eqPos > 0 && "\\" === c.charAt(eqPos - 1); ) eqPos = c.indexOf("=", eqPos + 1); if (-1 === eqPos) throw new Error("Failed to parse DN"); return { name: c.slice(0, eqPos).toLowerCase().replace(/\\=/g, "="), value: c.slice(eqPos + 1) }; })) }); }, Identity.fromArray = function(components) { return assert.arrayOfObject(components, "components"), components.forEach((function(cmp) { if (assert.object(cmp, "component"), assert.string(cmp.name, "component.name"), !Buffer.isBuffer(cmp.value) && "string" != typeof cmp.value) throw new Error("Invalid component value"); })), new Identity({ components: components }); }, Identity.parseAsn1 = function(der, top) { var components = []; der.readSequence(top); for (var end = der.offset + der.length; der.offset < end; ) { der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); var after = der.offset + der.length; der.readSequence(); var value, oid = der.readOID(), type = der.peek(); switch (type) { case asn1.Ber.PrintableString: case asn1.Ber.IA5String: case asn1.Ber.OctetString: case asn1.Ber.T61String: value = der.readString(type); break; case asn1.Ber.Utf8String: value = (value = der.readString(type, !0)).toString("utf8"); break; case asn1.Ber.CharacterString: case asn1.Ber.BMPString: value = (value = der.readString(type, !0)).toString("utf16le"); break; default: throw new Error("Unknown asn1 type " + type); } components.push({ oid: oid, asn1type: type, value: value }), der._offset = after; } return der._offset = end, new Identity({ components: components }); }, Identity.isIdentity = function(obj, ver) { return utils.isCompatible(obj, Identity, ver); }, Identity.prototype._sshpkApiVersion = [ 1, 0 ], Identity._oldVersionDetect = function(obj) { return [ 1, 0 ]; }; }, function(module, exports, __webpack_require__) { module.exports = Writer; var fs = __webpack_require__(65), inherits = __webpack_require__(8), rimraf = __webpack_require__(556), mkdir = __webpack_require__(186), path = __webpack_require__(5), umask = "win32" === process.platform ? 0 : process.umask(), getType = __webpack_require__(168), Abstract = __webpack_require__(273); inherits(Writer, Abstract), Writer.dirmode = parseInt("0777", 8) & ~umask, Writer.filemode = parseInt("0666", 8) & ~umask; var DirWriter = __webpack_require__(557), LinkWriter = __webpack_require__(558), FileWriter = __webpack_require__(559), ProxyWriter = __webpack_require__(560); function Writer(props, current) { "string" == typeof props && (props = { path: props }); var ClassType = Writer; switch (getType(props)) { case "Directory": ClassType = DirWriter; break; case "File": ClassType = FileWriter; break; case "Link": case "SymbolicLink": ClassType = LinkWriter; break; default: ClassType = ProxyWriter; } if (!(this instanceof ClassType)) return new ClassType(props); Abstract.call(this), props.path || this.error("Must provide a path", null, !0), this.type = props.type, this.props = props, this.depth = props.depth || 0, this.clobber = !1 !== props.clobber || props.clobber, this.parent = props.parent || null, this.root = props.root || props.parent && props.parent.root || this, this._path = this.path = path.resolve(props.path), "win32" === process.platform && (this.path = this._path = this.path.replace(/\?/g, "_"), this._path.length >= 260 && (this._swallowErrors = !0, this._path = "\\\\?\\" + this.path.replace(/\//g, "\\"))), this.basename = path.basename(props.path), this.dirname = path.dirname(props.path), this.linkpath = props.linkpath || null, props.parent = props.root = null, this.size = props.size, "string" == typeof props.mode && (props.mode = parseInt(props.mode, 8)), this.readable = !1, this.writable = !0, this._buffer = [], this.ready = !1, this.filter = "function" == typeof props.filter ? props.filter : null, this._stat(current); } function create(self) { mkdir(path.dirname(self._path), Writer.dirmode, (function(er, made) { return er ? self.error(er) : (self._madeDir = made, self._create()); })); } function endChmod(self, want, current, path, cb) { var wantMode = want.mode, chmod = want.follow || "SymbolicLink" !== self.type ? "chmod" : "lchmod"; if (!fs[chmod]) return cb(); if ("number" != typeof wantMode) return cb(); var curMode = current.mode & parseInt("0777", 8); if ((wantMode &= parseInt("0777", 8)) === curMode) return cb(); fs[chmod](path, wantMode, cb); } function endChown(self, want, current, path, cb) { if ("win32" === process.platform) return cb(); if (!process.getuid || 0 !== process.getuid()) return cb(); if ("number" != typeof want.uid && "number" != typeof want.gid) return cb(); if (current.uid === want.uid && current.gid === want.gid) return cb(); var chown = self.props.follow || "SymbolicLink" !== self.type ? "chown" : "lchown"; if (!fs[chown]) return cb(); "number" != typeof want.uid && (want.uid = current.uid), "number" != typeof want.gid && (want.gid = current.gid), fs[chown](path, want.uid, want.gid, cb); } function endUtimes(self, want, current, path, cb) { if (!fs.utimes || "win32" === process.platform) return cb(); var utimes = want.follow || "SymbolicLink" !== self.type ? "utimes" : "lutimes"; if ("lutimes" !== utimes || fs[utimes] || (utimes = "utimes"), !fs[utimes]) return cb(); var curA = current.atime, curM = current.mtime, meA = want.atime, meM = want.mtime; if (void 0 === meA && (meA = curA), void 0 === meM && (meM = curM), isDate(meA) || (meA = new Date(meA)), isDate(meM) || (meA = new Date(meM)), meA.getTime() === curA.getTime() && meM.getTime() === curM.getTime()) return cb(); fs[utimes](path, meA, meM, cb); } function endMadeDir(self, p, cb) { var made = self._madeDir, d = path.dirname(p); !(function(self, p, cb) { var dirProps = {}; Object.keys(self.props).forEach((function(k) { dirProps[k] = self.props[k], "mode" === k && "Directory" !== self.type && (dirProps[k] = dirProps[k] | parseInt("0111", 8)); })); var todo = 3, errState = null; function next(er) { if (!errState) return er ? cb(errState = er) : 0 == --todo ? cb() : void 0; } fs.stat(p, (function(er, current) { if (er) return cb(errState = er); endChmod(self, dirProps, current, p, next), endChown(self, dirProps, current, p, next), endUtimes(self, dirProps, current, p, next); })); })(self, d, (function(er) { return er ? cb(er) : d === made ? cb() : void endMadeDir(self, d, cb); })); } function isDate(d) { return "object" == typeof d && "[object Date]" === (function(d) { return Object.prototype.toString.call(d); })(d); } Writer.prototype._create = function() { var self = this; fs[self.props.follow ? "stat" : "lstat"](self._path, (function(er) { if (er) return self.warn("Cannot create " + self._path + "\nUnsupported type: " + self.type, "ENOTSUP"); self._finish(); })); }, Writer.prototype._stat = function(current) { var self = this, stat = self.props.follow ? "stat" : "lstat", who = self._proxy || self; function statCb(er, current) { return self.filter && !self.filter.call(who, who, current) ? (self._aborted = !0, self.emit("end"), void self.emit("close")) : er || !current ? create(self) : (self._old = current, getType(current) !== self.type || "File" === self.type && current.nlink > 1 ? rimraf(self._path, (function(er) { if (er) return self.error(er); self._old = null, create(self); })) : void create(self)); } current ? statCb(null, current) : fs[stat](self._path, statCb); }, Writer.prototype._finish = function() { var self = this; if (self._finishing) ; else { self._finishing = !0; var todo = 0, errState = null, done = !1; if (self._old) self._old.atime = new Date(0), self._old.mtime = new Date(0), setProps(self._old); else { var stat = self.props.follow ? "stat" : "lstat"; fs[stat](self._path, (function(er, current) { if (er) return "ENOENT" !== er.code || "Link" !== self.type && "SymbolicLink" !== self.type || "win32" !== process.platform ? self.error(er) : (self.ready = !0, self.emit("ready"), self.emit("end"), self.emit("close"), void (self.end = self._finish = function() {})); setProps(self._old = current); })); } } function setProps(current) { todo += 3, endChmod(self, self.props, current, self._path, next("chmod")), endChown(self, self.props, current, self._path, next("chown")), endUtimes(self, self.props, current, self._path, next("utimes")); } function next(what) { return function(er) { if (!errState) { if (er) return er.fstream_finish_call = what, self.error(errState = er); if (!(--todo > 0 || done)) { if (done = !0, !self._madeDir) return end(); endMadeDir(self, self._path, end); } } function end(er) { if (er) return er.fstream_finish_call = "setupMadeDir", self.error(er); self.emit("end"), self.emit("close"); } }; } }, Writer.prototype.pipe = function() { this.error("Can't pipe from writable stream"); }, Writer.prototype.add = function() { this.error("Can't add to non-Directory type"); }, Writer.prototype.write = function() { return !0; }; }, function(module, exports) { module.exports = require("tty"); }, function(module, exports, __webpack_require__) { "use strict"; var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g, TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/, TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/, QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g, QUOTE_REGEXP = /([\\"])/g, TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; function qstring(val) { var str = String(val); if (TOKEN_REGEXP.test(str)) return str; if (str.length > 0 && !TEXT_REGEXP.test(str)) throw new TypeError("invalid parameter value"); return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"'; } function ContentType(type) { this.parameters = Object.create(null), this.type = type; } exports.format = function(obj) { if (!obj || "object" != typeof obj) throw new TypeError("argument obj is required"); var parameters = obj.parameters, type = obj.type; if (!type || !TYPE_REGEXP.test(type)) throw new TypeError("invalid type"); var string = type; if (parameters && "object" == typeof parameters) for (var param, params = Object.keys(parameters).sort(), i = 0; i < params.length; i++) { if (param = params[i], !TOKEN_REGEXP.test(param)) throw new TypeError("invalid parameter name"); string += "; " + param + "=" + qstring(parameters[param]); } return string; }, exports.parse = function(string) { if (!string) throw new TypeError("argument string is required"); var header = "object" == typeof string ? (function(obj) { var header; if ("function" == typeof obj.getHeader ? header = obj.getHeader("content-type") : "object" == typeof obj.headers && (header = obj.headers && obj.headers["content-type"]), "string" != typeof header) throw new TypeError("content-type header is missing from object"); return header; })(string) : string; if ("string" != typeof header) throw new TypeError("argument string is required to be a string"); var index = header.indexOf(";"), type = -1 !== index ? header.substr(0, index).trim() : header.trim(); if (!TYPE_REGEXP.test(type)) throw new TypeError("invalid media type"); var obj = new ContentType(type.toLowerCase()); if (-1 !== index) { var key, match, value; for (PARAM_REGEXP.lastIndex = index; match = PARAM_REGEXP.exec(header); ) { if (match.index !== index) throw new TypeError("invalid parameter format"); index += match[0].length, key = match[1].toLowerCase(), '"' === (value = match[2])[0] && (value = value.substr(1, value.length - 2).replace(QESC_REGEXP, "$1")), obj.parameters[key] = value; } if (index !== header.length) throw new TypeError("invalid parameter format"); } return obj; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(obj, proto) { return obj.__proto__ = proto, obj; } : function(obj, proto) { for (var prop in proto) obj.hasOwnProperty(prop) || (obj[prop] = proto[prop]); return obj; }); }, function(module, exports, __webpack_require__) { "use strict"; var codes = __webpack_require__(597); function status(code) { if ("number" == typeof code) { if (!status[code]) throw new Error("invalid status code: " + code); return code; } if ("string" != typeof code) throw new TypeError("code must be a number or string"); var n = parseInt(code, 10); if (!isNaN(n)) { if (!status[n]) throw new Error("invalid status code: " + n); return n; } if (!(n = status[code.toLowerCase()])) throw new Error('invalid status message: "' + code + '"'); return n; } module.exports = status, status.STATUS_CODES = codes, status.codes = (function(statuses, codes) { var arr = []; return Object.keys(codes).forEach((function(code) { var message = codes[code], status = Number(code); statuses[status] = message, statuses[message] = status, statuses[message.toLowerCase()] = status, arr.push(status); })), arr; })(status, codes), status.redirect = { 300: !0, 301: !0, 302: !0, 303: !0, 305: !0, 307: !0, 308: !0 }, status.empty = { 204: !0, 205: !0, 304: !0 }, status.retry = { 502: !0, 503: !0, 504: !0 }; }, function(module, exports, __webpack_require__) { "use strict"; var createError = __webpack_require__(98), getBody = __webpack_require__(600), iconv = __webpack_require__(66), onFinished = __webpack_require__(96), zlib = __webpack_require__(43); module.exports = function(req, res, next, parse, debug, options) { var length, stream, opts = options; req._body = !0; var encoding = null !== opts.encoding ? opts.encoding : null, verify = opts.verify; try { stream = (function(req, debug, inflate) { var stream, encoding = (req.headers["content-encoding"] || "identity").toLowerCase(), length = req.headers["content-length"]; if (debug('content-encoding "%s"', encoding), !1 === inflate && "identity" !== encoding) throw createError(415, "content encoding unsupported", { encoding: encoding, type: "encoding.unsupported" }); switch (encoding) { case "deflate": stream = zlib.createInflate(), debug("inflate body"), req.pipe(stream); break; case "gzip": stream = zlib.createGunzip(), debug("gunzip body"), req.pipe(stream); break; case "identity": (stream = req).length = length; break; default: throw createError(415, 'unsupported content encoding "' + encoding + '"', { encoding: encoding, type: "encoding.unsupported" }); } return stream; })(req, debug, opts.inflate), length = stream.length, stream.length = void 0; } catch (err) { return next(err); } if (opts.length = length, opts.encoding = verify ? null : encoding, null === opts.encoding && null !== encoding && !iconv.encodingExists(encoding)) return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { charset: encoding.toLowerCase(), type: "charset.unsupported" })); debug("read body"), getBody(stream, opts, (function(error, body) { var _error; if (error) return _error = "encoding.unsupported" === error.type ? createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { charset: encoding.toLowerCase(), type: "charset.unsupported" }) : createError(400, error), stream.resume(), void onFinished(req, (function() { next(createError(400, _error)); })); if (verify) try { debug("verify body"), verify(req, res, body, encoding); } catch (err) { return void next(createError(403, err, { body: body, type: err.type || "entity.verify.failed" })); } var str = body; try { debug("parse body"), str = "string" != typeof body && null !== encoding ? iconv.decode(body, encoding) : body, req.body = parse(str); } catch (err) { return void next(createError(400, err, { body: str, type: err.type || "entity.parse.failed" })); } next(); })); }; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("router"), flatten = __webpack_require__(286), Layer = __webpack_require__(287), methods = __webpack_require__(68), mixin = __webpack_require__(67), parseUrl = __webpack_require__(49), Route = __webpack_require__(609), setPrototypeOf = __webpack_require__(610), slice = Array.prototype.slice, defer = "function" == typeof setImmediate ? setImmediate : function(fn) { process.nextTick(fn.bind.apply(fn, arguments)); }; function Router(options) { if (!(this instanceof Router)) return new Router(options); var opts = options || {}; function router(req, res, next) { router.handle(req, res, next); } return setPrototypeOf(router, this), router.caseSensitive = opts.caseSensitive, router.mergeParams = opts.mergeParams, router.params = {}, router.strict = opts.strict, router.stack = [], router; } function matchLayer(layer, path) { try { return layer.match(path); } catch (err) { return err; } } module.exports = Router, module.exports.Route = Route, Router.prototype = function() {}, Router.prototype.param = function(name, fn) { if (!name) throw new TypeError("argument name is required"); if ("string" != typeof name) throw new TypeError("argument name must be a string"); if (!fn) throw new TypeError("argument fn is required"); if ("function" != typeof fn) throw new TypeError("argument fn must be a function"); var params = this.params[name]; return params || (params = this.params[name] = []), params.push(fn), this; }, Router.prototype.handle = function(req, res, callback) { if (!callback) throw new TypeError("argument callback is required"); debug("dispatching %s %s", req.method, req.url); var methods, old, fn, idx = 0, protohost = (function(url) { if ("string" == typeof url && 0 !== url.length && "/" !== url[0]) { var searchIndex = url.indexOf("?"), pathLength = -1 !== searchIndex ? searchIndex : url.length, fqdnIndex = url.substr(0, pathLength).indexOf("://"); return -1 !== fqdnIndex ? url.substr(0, url.indexOf("/", 3 + fqdnIndex)) : void 0; } })(req.url) || "", removed = "", self = this, slashAdded = !1, paramcalled = {}, stack = this.stack, parentParams = req.params, parentUrl = req.baseUrl || "", done = (function(fn, obj) { for (var props = new Array(arguments.length - 2), vals = new Array(arguments.length - 2), i = 0; i < props.length; i++) props[i] = arguments[i + 2], vals[i] = obj[props[i]]; return function() { for (var i = 0; i < props.length; i++) obj[props[i]] = vals[i]; return fn.apply(this, arguments); }; })(callback, req, "baseUrl", "next", "params"); function next(err) { var layerError = "route" === err ? null : err; if (slashAdded && (req.url = req.url.substr(1), slashAdded = !1), 0 !== removed.length && (req.baseUrl = parentUrl, req.url = protohost + removed + req.url.substr(protohost.length), removed = ""), "router" !== layerError) if (idx >= stack.length) defer(done, layerError); else { var layer, match, route, path = (function(req) { try { return parseUrl(req).pathname; } catch (err) { return; } })(req); if (null == path) return done(layerError); for (;!0 !== match && idx < stack.length; ) if (match = matchLayer(layer = stack[idx++], path), route = layer.route, "boolean" != typeof match && (layerError = layerError || match), !0 === match && route) if (layerError) match = !1; else { var method = req.method, has_method = route._handles_method(method); !has_method && "OPTIONS" === method && methods && methods.push.apply(methods, route._methods()), has_method || "HEAD" === method || (match = !1); } if (!0 !== match) return done(layerError); route && (req.route = route), req.params = self.mergeParams ? (function(params, parent) { if ("object" != typeof parent || !parent) return params; var obj = mixin({}, parent); if (!(0 in params) || !(0 in parent)) return mixin(obj, params); for (var i = 0, o = 0; i in params; ) i++; for (;o in parent; ) o++; for (i--; i >= 0; i--) params[i + o] = params[i], i < o && delete params[i]; return mixin(obj, params); })(layer.params, parentParams) : layer.params; var layerPath = layer.path; self.process_params(layer, paramcalled, req, res, (function(err) { return err ? next(layerError || err) : route ? layer.handle_request(req, res, next) : void (function(layer, layerError, layerPath, path) { if (0 !== layerPath.length) { var c = path[layerPath.length]; if (c && "/" !== c) return void next(layerError); debug("trim prefix (%s) from url %s", layerPath, req.url), removed = layerPath, req.url = protohost + req.url.substr(protohost.length + removed.length), protohost || "/" === req.url[0] || (req.url = "/" + req.url, slashAdded = !0), req.baseUrl = parentUrl + ("/" === removed[removed.length - 1] ? removed.substring(0, removed.length - 1) : removed); } debug("%s %s : %s", layer.name, layerPath, req.originalUrl), layerError ? layer.handle_error(layerError, req, res, next) : layer.handle_request(req, res, next); })(layer, layerError, layerPath, path); })); } else defer(done, null); } req.next = next, "OPTIONS" === req.method && (old = done, fn = (function(res, methods) { return function(fn, err) { if (err || 0 === methods.length) return fn(err); !(function(res, methods, next) { try { !(function(res, methods) { for (var options = Object.create(null), i = 0; i < methods.length; i++) options[methods[i]] = !0; var allow = Object.keys(options).sort().join(", "); res.setHeader("Allow", allow), res.setHeader("Content-Length", Buffer.byteLength(allow)), res.setHeader("Content-Type", "text/plain"), res.setHeader("X-Content-Type-Options", "nosniff"), res.end(allow); })(res, methods); } catch (err) { next(err); } })(res, methods, fn); }; })(res, methods = []), done = function() { var args = new Array(arguments.length + 1); args[0] = old; for (var i = 0, len = arguments.length; i < len; i++) args[i + 1] = arguments[i]; fn.apply(this, args); }), req.baseUrl = parentUrl, req.originalUrl = req.originalUrl || req.url, next(); }, Router.prototype.process_params = function(layer, called, req, res, done) { var params = this.params, keys = layer.keys; if (!keys || 0 === keys.length) return done(); var name, key, paramVal, paramCallbacks, paramCalled, i = 0, paramIndex = 0; function param(err) { return err ? done(err) : i >= keys.length ? done() : (paramIndex = 0, key = keys[i++], name = key.name, paramVal = req.params[name], paramCallbacks = params[name], paramCalled = called[name], void 0 !== paramVal && paramCallbacks ? paramCalled && (paramCalled.match === paramVal || paramCalled.error && "route" !== paramCalled.error) ? (req.params[name] = paramCalled.value, param(paramCalled.error)) : (called[name] = paramCalled = { error: null, match: paramVal, value: paramVal }, void paramCallback()) : param()); } function paramCallback(err) { var fn = paramCallbacks[paramIndex++]; if (paramCalled.value = req.params[key.name], err) return paramCalled.error = err, void param(err); if (!fn) return param(); try { fn(req, res, paramCallback, paramVal, key.name); } catch (e) { paramCallback(e); } } param(); }, Router.prototype.use = function(handler) { var offset = 0, path = "/"; if ("function" != typeof handler) { for (var arg = handler; Array.isArray(arg) && 0 !== arg.length; ) arg = arg[0]; "function" != typeof arg && (offset = 1, path = handler); } var callbacks = flatten(slice.call(arguments, offset)); if (0 === callbacks.length) throw new TypeError("argument handler is required"); for (var i = 0; i < callbacks.length; i++) { var fn = callbacks[i]; if ("function" != typeof fn) throw new TypeError("argument handler must be a function"); debug("use %o %s", path, fn.name || ""); var layer = new Layer(path, { sensitive: this.caseSensitive, strict: !1, end: !1 }, fn); layer.route = void 0, this.stack.push(layer); } return this; }, Router.prototype.route = function(path) { var route = new Route(path), layer = new Layer(path, { sensitive: this.caseSensitive, strict: this.strict, end: !0 }, (function(req, res, next) { route.dispatch(req, res, next); })); return layer.route = route, this.stack.push(layer), route; }, methods.concat("all").forEach((function(method) { Router.prototype[method] = function(path) { var route = this.route(path); return route[method].apply(route, slice.call(arguments, 1)), this; }; })); }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw new TypeError("Arguments must be Buffers"); if (a === b) return !0; if ("function" == typeof a.equals) return a.equals(b); if (a.length !== b.length) return !1; for (var i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1; return !0; }; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(6).randomBytes; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(list, compare, sorted) { return 0 === list.length ? list : compare ? (sorted || list.sort(compare), (function(list, compare) { for (var ptr = 1, len = list.length, a = list[0], b = list[0], i = 1; i < len; ++i) if (b = a, compare(a = list[i], b)) { if (i === ptr) { ptr++; continue; } list[ptr++] = a; } return list.length = ptr, list; })(list, compare)) : (sorted || list.sort(), (function(list) { for (var ptr = 1, len = list.length, a = list[0], b = list[0], i = 1; i < len; ++i, b = a) if (b = a, (a = list[i]) !== b) { if (i === ptr) { ptr++; continue; } list[ptr++] = a; } return list.length = ptr, list; })(list)); }; }, function(module, exports, __webpack_require__) { var zlib = __webpack_require__(43), AVAILABLE_WINDOW_BITS = [ 8, 9, 10, 11, 12, 13, 14, 15 ]; function PerMessageDeflate(options, isServer, maxPayload) { if (this instanceof PerMessageDeflate == 0) throw new TypeError("Classes can't be function-called"); this._options = options || {}, this._isServer = !!isServer, this._inflate = null, this._deflate = null, this.params = null, this._maxPayload = maxPayload || 0; } PerMessageDeflate.extensionName = "permessage-deflate", PerMessageDeflate.prototype.offer = function() { var params = {}; return this._options.serverNoContextTakeover && (params.server_no_context_takeover = !0), this._options.clientNoContextTakeover && (params.client_no_context_takeover = !0), this._options.serverMaxWindowBits && (params.server_max_window_bits = this._options.serverMaxWindowBits), this._options.clientMaxWindowBits ? params.client_max_window_bits = this._options.clientMaxWindowBits : null == this._options.clientMaxWindowBits && (params.client_max_window_bits = !0), params; }, PerMessageDeflate.prototype.accept = function(paramsList) { var params; return paramsList = this.normalizeParams(paramsList), params = this._isServer ? this.acceptAsServer(paramsList) : this.acceptAsClient(paramsList), this.params = params, params; }, PerMessageDeflate.prototype.cleanup = function() { this._inflate && (this._inflate.writeInProgress ? this._inflate.pendingClose = !0 : (this._inflate.close && this._inflate.close(), this._inflate = null)), this._deflate && (this._deflate.writeInProgress ? this._deflate.pendingClose = !0 : (this._deflate.close && this._deflate.close(), this._deflate = null)); }, PerMessageDeflate.prototype.acceptAsServer = function(paramsList) { var accepted = {}; if (!paramsList.some((function(params) { if (accepted = {}, (!1 !== this._options.serverNoContextTakeover || !params.server_no_context_takeover) && (!1 !== this._options.serverMaxWindowBits || !params.server_max_window_bits) && !("number" == typeof this._options.serverMaxWindowBits && "number" == typeof params.server_max_window_bits && this._options.serverMaxWindowBits > params.server_max_window_bits) && ("number" != typeof this._options.clientMaxWindowBits || params.client_max_window_bits)) return (this._options.serverNoContextTakeover || params.server_no_context_takeover) && (accepted.server_no_context_takeover = !0), this._options.clientNoContextTakeover && (accepted.client_no_context_takeover = !0), !1 !== this._options.clientNoContextTakeover && params.client_no_context_takeover && (accepted.client_no_context_takeover = !0), "number" == typeof this._options.serverMaxWindowBits ? accepted.server_max_window_bits = this._options.serverMaxWindowBits : "number" == typeof params.server_max_window_bits && (accepted.server_max_window_bits = params.server_max_window_bits), "number" == typeof this._options.clientMaxWindowBits ? accepted.client_max_window_bits = this._options.clientMaxWindowBits : !1 !== this._options.clientMaxWindowBits && "number" == typeof params.client_max_window_bits && (accepted.client_max_window_bits = params.client_max_window_bits), !0; }), this)) throw new Error("Doesn't support the offered configuration"); return accepted; }, PerMessageDeflate.prototype.acceptAsClient = function(paramsList) { var params = paramsList[0]; if (null != this._options.clientNoContextTakeover && !1 === this._options.clientNoContextTakeover && params.client_no_context_takeover) throw new Error('Invalid value for "client_no_context_takeover"'); if (null != this._options.clientMaxWindowBits) { if (!1 === this._options.clientMaxWindowBits && params.client_max_window_bits) throw new Error('Invalid value for "client_max_window_bits"'); if ("number" == typeof this._options.clientMaxWindowBits && (!params.client_max_window_bits || params.client_max_window_bits > this._options.clientMaxWindowBits)) throw new Error('Invalid value for "client_max_window_bits"'); } return params; }, PerMessageDeflate.prototype.normalizeParams = function(paramsList) { return paramsList.map((function(params) { return Object.keys(params).forEach((function(key) { var value = params[key]; if (value.length > 1) throw new Error("Multiple extension parameters for " + key); switch (value = value[0], key) { case "server_no_context_takeover": case "client_no_context_takeover": if (!0 !== value) throw new Error("invalid extension parameter value for " + key + " (" + value + ")"); params[key] = !0; break; case "server_max_window_bits": case "client_max_window_bits": if ("string" == typeof value && (value = parseInt(value, 10), !~AVAILABLE_WINDOW_BITS.indexOf(value))) throw new Error("invalid extension parameter value for " + key + " (" + value + ")"); if (!this._isServer && !0 === value) throw new Error("Missing extension parameter value for " + key); params[key] = value; break; default: throw new Error("Not defined extension parameter (" + key + ")"); } }), this), params; }), this); }, PerMessageDeflate.prototype.decompress = function(data, fin, callback) { var endpoint = this._isServer ? "client" : "server"; if (!this._inflate) { var maxWindowBits = this.params[endpoint + "_max_window_bits"]; this._inflate = zlib.createInflateRaw({ windowBits: "number" == typeof maxWindowBits ? maxWindowBits : 15 }); } this._inflate.writeInProgress = !0; var self = this, buffers = [], cumulativeBufferLength = 0; function onError(err) { cleanup(), callback(err); } function onData(data) { void 0 !== self._maxPayload && null !== self._maxPayload && self._maxPayload > 0 && (cumulativeBufferLength += data.length) > self._maxPayload ? (buffers = [], cleanup(), callback({ type: 1009 })) : buffers.push(data); } function cleanup() { self._inflate && (self._inflate.removeListener("error", onError), self._inflate.removeListener("data", onData), self._inflate.writeInProgress = !1, (fin && self.params[endpoint + "_no_context_takeover"] || self._inflate.pendingClose) && (self._inflate.close && self._inflate.close(), self._inflate = null)); } this._inflate.on("error", onError).on("data", onData), this._inflate.write(data), fin && this._inflate.write(new Buffer([ 0, 0, 255, 255 ])), this._inflate.flush((function() { cleanup(), callback(null, Buffer.concat(buffers)); })); }, PerMessageDeflate.prototype.compress = function(data, fin, callback) { var endpoint = this._isServer ? "server" : "client"; if (!this._deflate) { var maxWindowBits = this.params[endpoint + "_max_window_bits"]; this._deflate = zlib.createDeflateRaw({ flush: zlib.Z_SYNC_FLUSH, windowBits: "number" == typeof maxWindowBits ? maxWindowBits : 15, memLevel: this._options.memLevel || 8 }); } this._deflate.writeInProgress = !0; var self = this, buffers = []; function onError(err) { cleanup(), callback(err); } function onData(data) { buffers.push(data); } function cleanup() { self._deflate && (self._deflate.removeListener("error", onError), self._deflate.removeListener("data", onData), self._deflate.writeInProgress = !1, (fin && self.params[endpoint + "_no_context_takeover"] || self._deflate.pendingClose) && (self._deflate.close && self._deflate.close(), self._deflate = null)); } this._deflate.on("error", onError).on("data", onData), this._deflate.write(data), this._deflate.flush((function() { cleanup(); var data = Buffer.concat(buffers); fin && (data = data.slice(0, data.length - 4)), callback(null, data); })); }, module.exports = PerMessageDeflate; }, function(module, exports, __webpack_require__) { var ip = exports, {Buffer: Buffer} = __webpack_require__(10), os = __webpack_require__(23); ip.toBuffer = function(ip, buff, offset) { var result; if (offset = ~~offset, this.isV4Format(ip)) result = buff || new Buffer(offset + 4), ip.split(/\./g).map((byte => { result[offset++] = 255 & parseInt(byte, 10); })); else if (this.isV6Format(ip)) { var i, sections = ip.split(":", 8); for (i = 0; i < sections.length; i++) { var v4Buffer; this.isV4Format(sections[i]) && (v4Buffer = this.toBuffer(sections[i]), sections[i] = v4Buffer.slice(0, 2).toString("hex")), v4Buffer && ++i < 8 && sections.splice(i, 0, v4Buffer.slice(2, 4).toString("hex")); } if ("" === sections[0]) for (;sections.length < 8; ) sections.unshift("0"); else if ("" === sections[sections.length - 1]) for (;sections.length < 8; ) sections.push("0"); else if (sections.length < 8) { for (i = 0; i < sections.length && "" !== sections[i]; i++) ; var argv = [ i, 1 ]; for (i = 9 - sections.length; i > 0; i--) argv.push("0"); sections.splice.apply(sections, argv); } for (result = buff || new Buffer(offset + 16), i = 0; i < sections.length; i++) { var word = parseInt(sections[i], 16); result[offset++] = word >> 8 & 255, result[offset++] = 255 & word; } } if (!result) throw Error(`Invalid ip address: ${ip}`); return result; }, ip.toString = function(buff, offset, length) { offset = ~~offset; var i, result = []; if (4 === (length = length || buff.length - offset)) { for (i = 0; i < length; i++) result.push(buff[offset + i]); result = result.join("."); } else if (16 === length) { for (i = 0; i < length; i += 2) result.push(buff.readUInt16BE(offset + i).toString(16)); result = (result = (result = result.join(":")).replace(/(^|:)0(:0)*:0(:|$)/, "$1::$3")).replace(/:{3,4}/, "::"); } return result; }; var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/, ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; function _normalizeFamily(family) { return 4 === family ? "ipv4" : 6 === family ? "ipv6" : family ? family.toLowerCase() : "ipv4"; } ip.isV4Format = function(ip) { return ipv4Regex.test(ip); }, ip.isV6Format = function(ip) { return ipv6Regex.test(ip); }, ip.fromPrefixLen = function(prefixlen, family) { var len = 4; "ipv6" === (family = prefixlen > 32 ? "ipv6" : _normalizeFamily(family)) && (len = 16); for (var buff = new Buffer(len), i = 0, n = buff.length; i < n; ++i) { var bits = 8; prefixlen < 8 && (bits = prefixlen), prefixlen -= bits, buff[i] = 255 & ~(255 >> bits); } return ip.toString(buff); }, ip.mask = function(addr, mask) { addr = ip.toBuffer(addr), mask = ip.toBuffer(mask); var i, result = new Buffer(Math.max(addr.length, mask.length)); if (addr.length === mask.length) for (i = 0; i < addr.length; i++) result[i] = addr[i] & mask[i]; else if (4 === mask.length) for (i = 0; i < mask.length; i++) result[i] = addr[addr.length - 4 + i] & mask[i]; else { for (i = 0; i < result.length - 6; i++) result[i] = 0; for (result[10] = 255, result[11] = 255, i = 0; i < addr.length; i++) result[i + 12] = addr[i] & mask[i + 12]; i += 12; } for (;i < result.length; i++) result[i] = 0; return ip.toString(result); }, ip.cidr = function(cidrString) { var cidrParts = cidrString.split("/"), addr = cidrParts[0]; if (2 !== cidrParts.length) throw new Error(`invalid CIDR subnet: ${addr}`); var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.mask(addr, mask); }, ip.subnet = function(addr, mask) { for (var networkAddress = ip.toLong(ip.mask(addr, mask)), maskBuffer = ip.toBuffer(mask), maskLength = 0, i = 0; i < maskBuffer.length; i++) if (255 === maskBuffer[i]) maskLength += 8; else for (var octet = 255 & maskBuffer[i]; octet; ) octet = octet << 1 & 255, maskLength++; var numberOfAddresses = Math.pow(2, 32 - maskLength); return { networkAddress: ip.fromLong(networkAddress), firstAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress) : ip.fromLong(networkAddress + 1), lastAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress + numberOfAddresses - 1) : ip.fromLong(networkAddress + numberOfAddresses - 2), broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), subnetMask: mask, subnetMaskLength: maskLength, numHosts: numberOfAddresses <= 2 ? numberOfAddresses : numberOfAddresses - 2, length: numberOfAddresses, contains: other => networkAddress === ip.toLong(ip.mask(other, mask)) }; }, ip.cidrSubnet = function(cidrString) { var cidrParts = cidrString.split("/"), addr = cidrParts[0]; if (2 !== cidrParts.length) throw new Error(`invalid CIDR subnet: ${addr}`); var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.subnet(addr, mask); }, ip.not = function(addr) { for (var buff = ip.toBuffer(addr), i = 0; i < buff.length; i++) buff[i] = 255 ^ buff[i]; return ip.toString(buff); }, ip.or = function(a, b) { var i; if (a = ip.toBuffer(a), b = ip.toBuffer(b), a.length === b.length) { for (i = 0; i < a.length; ++i) a[i] |= b[i]; return ip.toString(a); } var buff = a, other = b; b.length > a.length && (buff = b, other = a); var offset = buff.length - other.length; for (i = offset; i < buff.length; ++i) buff[i] |= other[i - offset]; return ip.toString(buff); }, ip.isEqual = function(a, b) { var i; if (a = ip.toBuffer(a), b = ip.toBuffer(b), a.length === b.length) { for (i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1; return !0; } if (4 === b.length) { var t = b; b = a, a = t; } for (i = 0; i < 10; i++) if (0 !== b[i]) return !1; var word = b.readUInt16BE(10); if (0 !== word && 65535 !== word) return !1; for (i = 0; i < 4; i++) if (a[i] !== b[i + 12]) return !1; return !0; }, ip.isPrivate = function(addr) { return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^f[cd][0-9a-f]{2}:/i.test(addr) || /^fe80:/i.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }, ip.isPublic = function(addr) { return !ip.isPrivate(addr); }, ip.isLoopback = function(addr) { return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }, ip.loopback = function(family) { if ("ipv4" !== (family = _normalizeFamily(family)) && "ipv6" !== family) throw new Error("family must be ipv4 or ipv6"); return "ipv4" === family ? "127.0.0.1" : "fe80::1"; }, ip.address = function(name, family) { var interfaces = os.networkInterfaces(); if (family = _normalizeFamily(family), name && "private" !== name && "public" !== name) { var res = interfaces[name].filter((details => _normalizeFamily(details.family) === family)); if (0 === res.length) return; return res[0].address; } var all = Object.keys(interfaces).map((nic => { var addresses = interfaces[nic].filter((details => (details.family = _normalizeFamily(details.family), details.family === family && !ip.isLoopback(details.address) && (!name || ("public" === name ? ip.isPrivate(details.address) : ip.isPublic(details.address)))))); return addresses.length ? addresses[0].address : void 0; })).filter(Boolean); return all.length ? all[0] : ip.loopback(family); }, ip.toLong = function(ip) { var ipl = 0; return ip.split(".").forEach((octet => { ipl <<= 8, ipl += parseInt(octet); })), ipl >>> 0; }, ip.fromLong = function(ipl) { return `${ipl >>> 24}.${ipl >> 16 & 255}.${ipl >> 8 & 255}.${255 & ipl}`; }; }, function(module, exports, __webpack_require__) { (function() { var XMLAttribute, XMLNode, isFunction, isObject, ref, hasProp = {}.hasOwnProperty; ref = __webpack_require__(57), isObject = ref.isObject, isFunction = ref.isFunction, XMLNode = __webpack_require__(37), XMLAttribute = __webpack_require__(400), module.exports = (function(superClass) { function XMLElement(parent, name, attributes) { if (XMLElement.__super__.constructor.call(this, parent), null == name) throw new Error("Missing element name"); this.name = this.stringify.eleName(name), this.attributes = {}, null != attributes && this.attribute(attributes), parent.isDocument && (this.isRoot = !0, this.documentObject = parent, parent.rootObject = this); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLElement, superClass), XMLElement.prototype.clone = function() { var att, attName, clonedSelf, ref1; for (attName in (clonedSelf = Object.create(this)).isRoot && (clonedSelf.documentObject = null), clonedSelf.attributes = {}, ref1 = this.attributes) hasProp.call(ref1, attName) && (att = ref1[attName], clonedSelf.attributes[attName] = att.clone()); return clonedSelf.children = [], this.children.forEach((function(child) { var clonedChild; return (clonedChild = child.clone()).parent = clonedSelf, clonedSelf.children.push(clonedChild); })), clonedSelf; }, XMLElement.prototype.attribute = function(name, value) { var attName, attValue; if (null != name && (name = name.valueOf()), isObject(name)) for (attName in name) hasProp.call(name, attName) && (attValue = name[attName], this.attribute(attName, attValue)); else isFunction(value) && (value = value.apply()), this.options.skipNullAttributes && null == value || (this.attributes[name] = new XMLAttribute(this, name, value)); return this; }, XMLElement.prototype.removeAttribute = function(name) { var attName, i, len; if (null == name) throw new Error("Missing attribute name"); if (name = name.valueOf(), Array.isArray(name)) for (i = 0, len = name.length; i < len; i++) attName = name[i], delete this.attributes[attName]; else delete this.attributes[name]; return this; }, XMLElement.prototype.toString = function(options) { return this.options.writer.set(options).element(this); }, XMLElement.prototype.att = function(name, value) { return this.attribute(name, value); }, XMLElement.prototype.a = function(name, value) { return this.attribute(name, value); }, XMLElement; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLCData(parent, text) { if (XMLCData.__super__.constructor.call(this, parent), null == text) throw new Error("Missing CDATA text"); this.text = this.stringify.cdata(text); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLCData, superClass), XMLCData.prototype.clone = function() { return Object.create(this); }, XMLCData.prototype.toString = function(options) { return this.options.writer.set(options).cdata(this); }, XMLCData; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLComment(parent, text) { if (XMLComment.__super__.constructor.call(this, parent), null == text) throw new Error("Missing comment text"); this.text = this.stringify.comment(text); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLComment, superClass), XMLComment.prototype.clone = function() { return Object.create(this); }, XMLComment.prototype.toString = function(options) { return this.options.writer.set(options).comment(this); }, XMLComment; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, isObject, hasProp = {}.hasOwnProperty; isObject = __webpack_require__(57).isObject, XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLDeclaration(parent, version, encoding, standalone) { var ref; XMLDeclaration.__super__.constructor.call(this, parent), isObject(version) && (version = (ref = version).version, encoding = ref.encoding, standalone = ref.standalone), version || (version = "1.0"), this.version = this.stringify.xmlVersion(version), null != encoding && (this.encoding = this.stringify.xmlEncoding(encoding)), null != standalone && (this.standalone = this.stringify.xmlStandalone(standalone)); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDeclaration, superClass), XMLDeclaration.prototype.toString = function(options) { return this.options.writer.set(options).declaration(this); }, XMLDeclaration; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLNode, isObject, hasProp = {}.hasOwnProperty; isObject = __webpack_require__(57).isObject, XMLNode = __webpack_require__(37), XMLDTDAttList = __webpack_require__(133), XMLDTDEntity = __webpack_require__(134), XMLDTDElement = __webpack_require__(135), XMLDTDNotation = __webpack_require__(136), module.exports = (function(superClass) { function XMLDocType(parent, pubID, sysID) { var ref, ref1; XMLDocType.__super__.constructor.call(this, parent), this.documentObject = parent, isObject(pubID) && (pubID = (ref = pubID).pubID, sysID = ref.sysID), null == sysID && (sysID = (ref1 = [ pubID, sysID ])[0], pubID = ref1[1]), null != pubID && (this.pubID = this.stringify.dtdPubID(pubID)), null != sysID && (this.sysID = this.stringify.dtdSysID(sysID)); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDocType, superClass), XMLDocType.prototype.element = function(name, value) { var child; return child = new XMLDTDElement(this, name, value), this.children.push(child), this; }, XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { var child; return child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue), this.children.push(child), this; }, XMLDocType.prototype.entity = function(name, value) { var child; return child = new XMLDTDEntity(this, !1, name, value), this.children.push(child), this; }, XMLDocType.prototype.pEntity = function(name, value) { var child; return child = new XMLDTDEntity(this, !0, name, value), this.children.push(child), this; }, XMLDocType.prototype.notation = function(name, value) { var child; return child = new XMLDTDNotation(this, name, value), this.children.push(child), this; }, XMLDocType.prototype.toString = function(options) { return this.options.writer.set(options).docType(this); }, XMLDocType.prototype.ele = function(name, value) { return this.element(name, value); }, XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); }, XMLDocType.prototype.ent = function(name, value) { return this.entity(name, value); }, XMLDocType.prototype.pent = function(name, value) { return this.pEntity(name, value); }, XMLDocType.prototype.not = function(name, value) { return this.notation(name, value); }, XMLDocType.prototype.up = function() { return this.root() || this.documentObject; }, XMLDocType; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { if (XMLDTDAttList.__super__.constructor.call(this, parent), null == elementName) throw new Error("Missing DTD element name"); if (null == attributeName) throw new Error("Missing DTD attribute name"); if (!attributeType) throw new Error("Missing DTD attribute type"); if (!defaultValueType) throw new Error("Missing DTD attribute default"); if (0 !== defaultValueType.indexOf("#") && (defaultValueType = "#" + defaultValueType), !defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT"); if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) throw new Error("Default value only applies to #FIXED or #DEFAULT"); this.elementName = this.stringify.eleName(elementName), this.attributeName = this.stringify.attName(attributeName), this.attributeType = this.stringify.dtdAttType(attributeType), this.defaultValue = this.stringify.dtdAttDefault(defaultValue), this.defaultValueType = defaultValueType; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDTDAttList, superClass), XMLDTDAttList.prototype.toString = function(options) { return this.options.writer.set(options).dtdAttList(this); }, XMLDTDAttList; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, isObject, hasProp = {}.hasOwnProperty; isObject = __webpack_require__(57).isObject, XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLDTDEntity(parent, pe, name, value) { if (XMLDTDEntity.__super__.constructor.call(this, parent), null == name) throw new Error("Missing entity name"); if (null == value) throw new Error("Missing entity value"); if (this.pe = !!pe, this.name = this.stringify.eleName(name), isObject(value)) { if (!value.pubID && !value.sysID) throw new Error("Public and/or system identifiers are required for an external entity"); if (value.pubID && !value.sysID) throw new Error("System identifier is required for a public external entity"); if (null != value.pubID && (this.pubID = this.stringify.dtdPubID(value.pubID)), null != value.sysID && (this.sysID = this.stringify.dtdSysID(value.sysID)), null != value.nData && (this.nData = this.stringify.dtdNData(value.nData)), this.pe && this.nData) throw new Error("Notation declaration is not allowed in a parameter entity"); } else this.value = this.stringify.dtdEntityValue(value); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDTDEntity, superClass), XMLDTDEntity.prototype.toString = function(options) { return this.options.writer.set(options).dtdEntity(this); }, XMLDTDEntity; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLDTDElement(parent, name, value) { if (XMLDTDElement.__super__.constructor.call(this, parent), null == name) throw new Error("Missing DTD element name"); value || (value = "(#PCDATA)"), Array.isArray(value) && (value = "(" + value.join(",") + ")"), this.name = this.stringify.eleName(name), this.value = this.stringify.dtdElementValue(value); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDTDElement, superClass), XMLDTDElement.prototype.toString = function(options) { return this.options.writer.set(options).dtdElement(this); }, XMLDTDElement; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLDTDNotation(parent, name, value) { if (XMLDTDNotation.__super__.constructor.call(this, parent), null == name) throw new Error("Missing notation name"); if (!value.pubID && !value.sysID) throw new Error("Public or system identifiers are required for an external entity"); this.name = this.stringify.eleName(name), null != value.pubID && (this.pubID = this.stringify.dtdPubID(value.pubID)), null != value.sysID && (this.sysID = this.stringify.dtdSysID(value.sysID)); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDTDNotation, superClass), XMLDTDNotation.prototype.toString = function(options) { return this.options.writer.set(options).dtdNotation(this); }, XMLDTDNotation; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLRaw(parent, text) { if (XMLRaw.__super__.constructor.call(this, parent), null == text) throw new Error("Missing raw text"); this.value = this.stringify.raw(text); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLRaw, superClass), XMLRaw.prototype.clone = function() { return Object.create(this); }, XMLRaw.prototype.toString = function(options) { return this.options.writer.set(options).raw(this); }, XMLRaw; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLText(parent, text) { if (XMLText.__super__.constructor.call(this, parent), null == text) throw new Error("Missing element text"); this.value = this.stringify.eleText(text); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLText, superClass), XMLText.prototype.clone = function() { return Object.create(this); }, XMLText.prototype.toString = function(options) { return this.options.writer.set(options).text(this); }, XMLText; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(37), module.exports = (function(superClass) { function XMLProcessingInstruction(parent, target, value) { if (XMLProcessingInstruction.__super__.constructor.call(this, parent), null == target) throw new Error("Missing instruction target"); this.target = this.stringify.insTarget(target), value && (this.value = this.stringify.insValue(value)); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLProcessingInstruction, superClass), XMLProcessingInstruction.prototype.clone = function() { return Object.create(this); }, XMLProcessingInstruction.prototype.toString = function(options) { return this.options.writer.set(options).processingInstruction(this); }, XMLProcessingInstruction; })(XMLNode); }).call(this); }, function(module, exports) { exports.codeUnit16FromBytes = function(hi, lo) { return (255 & hi) << 8 | 255 & lo; }, exports.adjustConfidence = function(codeUnit, confidence) { return 0 == codeUnit ? confidence -= 10 : (codeUnit >= 32 && codeUnit <= 255 || 10 == codeUnit) && (confidence += 10), confidence < 0 ? confidence = 0 : confidence > 100 && (confidence = 100), confidence; }; }, function(module, exports) { function iteratedChar(input) { this.charValue = 0, this.index = 0, this.nextIndex = 0, this.error = !1, this.done = !1, this.input = input, this.inputLength = input.length; } iteratedChar.prototype = { reset: function() { this.charValue = 0, this.index = -1, this.nextIndex = 0, this.error = !1, this.done = !1; }, nextByte: function() { return this.nextIndex >= this.inputLength ? (this.done = !0, -1) : 255 & this.input[this.nextIndex++]; } }, module.exports = function(commonChars, nextChar) { return function(input) { var doubleByteCharCount = 0, commonCharCount = 0, badCharCount = 0, totalCharCount = 0, confidence = 0, iter = new iteratedChar(input); detectBlock: { for (iter.reset(); nextChar(iter); ) { if (totalCharCount++, iter.error) badCharCount++; else { var cv = 4294967295 & iter.charValue; !(cv <= 255) && (doubleByteCharCount++, null != commonChars && commonChars.indexOf(cv) >= 0 && commonCharCount++); } if (badCharCount >= 2 && 5 * badCharCount >= doubleByteCharCount) break detectBlock; } if (doubleByteCharCount <= 10 && 0 == badCharCount) confidence = 0 == doubleByteCharCount && totalCharCount < 10 ? 0 : 10; else if (doubleByteCharCount < 20 * badCharCount) confidence = 0; else if (null == commonChars) (confidence = 30 + doubleByteCharCount - 20 * badCharCount) > 100 && (confidence = 100); else { var scaleFactor = 90 / Math.log(doubleByteCharCount / 4); confidence = Math.log(commonCharCount + 1) * scaleFactor + 10, confidence = Math.min(confidence, 100); } } return confidence; }; }; }, function(module, exports, __webpack_require__) { var path = __webpack_require__(5), fs = __webpack_require__(2), _0777 = parseInt("0777", 8); function mkdirP(p, opts, f, made) { "function" == typeof opts ? (f = opts, opts = {}) : opts && "object" == typeof opts || (opts = { mode: opts }); var mode = opts.mode, xfs = opts.fs || fs; void 0 === mode && (mode = _0777), made || (made = null); var cb = f || function() {}; p = path.resolve(p), xfs.mkdir(p, mode, (function(er) { if (!er) return cb(null, made = made || p); if ("ENOENT" === er.code) { if (path.dirname(p) === p) return cb(er); mkdirP(path.dirname(p), opts, (function(er, made) { er ? cb(er, made) : mkdirP(p, opts, cb, made); })); } else xfs.stat(p, (function(er2, stat) { er2 || !stat.isDirectory() ? cb(er, made) : cb(null, made); })); })); } module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP, mkdirP.sync = function sync(p, opts, made) { opts && "object" == typeof opts || (opts = { mode: opts }); var mode = opts.mode, xfs = opts.fs || fs; void 0 === mode && (mode = _0777), made || (made = null), p = path.resolve(p); try { xfs.mkdirSync(p, mode), made = made || p; } catch (err0) { if ("ENOENT" === err0.code) made = sync(path.dirname(p), opts, made), sync(p, opts, made); else { var stat; try { stat = xfs.statSync(p); } catch (err1) { throw err0; } if (!stat.isDirectory()) throw err0; } } return made; }; }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__, __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __createBinding; !(function(factory) { var root = "object" == typeof global ? global : "object" == typeof self ? self : "object" == typeof this ? this : {}; function createExporter(exports, previous) { return exports !== root && ("function" == typeof Object.create ? Object.defineProperty(exports, "__esModule", { value: !0 }) : exports.__esModule = !0), function(id, v) { return exports[id] = previous ? previous(id, v) : v; }; } __WEBPACK_AMD_DEFINE_RESULT__ = function(exports) { !(function(exporter) { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { d.__proto__ = b; } || function(d, b) { for (var p in b) Object.prototype.hasOwnProperty.call(b, p) && (d[p] = b[p]); }; __extends = function(d, b) { if ("function" != typeof b && null !== b) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); function __() { this.constructor = d; } extendStatics(d, b), d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __); }, __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) for (var p in s = arguments[i]) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]); return t; }, __rest = function(s, e) { var t = {}; for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]); if (null != s && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]); } return t; }, __decorate = function(decorators, target, key, desc) { var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r); return c > 3 && r && Object.defineProperty(target, key, r), r; }, __param = function(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; }, __metadata = function(metadataKey, metadataValue) { if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(metadataKey, metadataValue); }, __awaiter = function(thisArg, _arguments, P, generator) { return new (P || (P = Promise))((function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : (function(value) { return value instanceof P ? value : new P((function(resolve) { resolve(value); })); })(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); })); }, __generator = function(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (1 & t[0]) throw t[1]; return t[1]; }, trys: [], ops: [] }; return g = { next: verb(0), throw: verb(1), return: verb(2) }, "function" == typeof Symbol && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function(v) { return (function(op) { if (f) throw new TypeError("Generator is already executing."); for (;_; ) try { if (f = 1, y && (t = 2 & op[0] ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; switch (y = 0, t && (op = [ 2 & op[0], t.value ]), op[0]) { case 0: case 1: t = op; break; case 4: return _.label++, { value: op[1], done: !1 }; case 5: _.label++, y = op[1], op = [ 0 ]; continue; case 7: op = _.ops.pop(), _.trys.pop(); continue; default: if (!((t = (t = _.trys).length > 0 && t[t.length - 1]) || 6 !== op[0] && 2 !== op[0])) { _ = 0; continue; } if (3 === op[0] && (!t || op[1] > t[0] && op[1] < t[3])) { _.label = op[1]; break; } if (6 === op[0] && _.label < t[1]) { _.label = t[1], t = op; break; } if (t && _.label < t[2]) { _.label = t[2], _.ops.push(op); break; } t[2] && _.ops.pop(), _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [ 6, e ], y = 0; } finally { f = t = 0; } if (5 & op[0]) throw op[1]; return { value: op[0] ? op[1] : void 0, done: !0 }; })([ n, v ]); }; } }, __exportStar = function(m, o) { for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(o, p) || __createBinding(o, m, p); }, __createBinding = Object.create ? function(o, m, k, k2) { void 0 === k2 && (k2 = k), Object.defineProperty(o, k2, { enumerable: !0, get: function() { return m[k]; } }); } : function(o, m, k, k2) { void 0 === k2 && (k2 = k), o[k2] = m[k]; }, __values = function(o) { var s = "function" == typeof Symbol && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && "number" == typeof o.length) return { next: function() { return o && i >= o.length && (o = void 0), { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }, __read = function(o, n) { var m = "function" == typeof Symbol && o[Symbol.iterator]; if (!m) return o; var r, e, i = m.call(o), ar = []; try { for (;(void 0 === n || n-- > 0) && !(r = i.next()).done; ) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { r && !r.done && (m = i.return) && m.call(i); } finally { if (e) throw e.error; } } return ar; }, __spread = function() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; }, __spreadArrays = function() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; var r = Array(s), k = 0; for (i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }, __spreadArray = function(to, from, pack) { if (pack || 2 === arguments.length) for (var ar, i = 0, l = from.length; i < l; i++) !ar && i in from || (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]); return to.concat(ar || Array.prototype.slice.call(from)); }, __await = function(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }, __asyncGenerator = function(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var i, g = generator.apply(thisArg, _arguments || []), q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { return this; }, i; function verb(n) { g[n] && (i[n] = function(v) { return new Promise((function(a, b) { q.push([ n, v, a, b ]) > 1 || resume(n, v); })); }); } function resume(n, v) { try { (r = g[n](v)).value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } catch (e) { settle(q[0][3], e); } var r; } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { f(v), q.shift(), q.length && resume(q[0][0], q[0][1]); } }, __asyncDelegator = function(o) { var i, p; return i = {}, verb("next"), verb("throw", (function(e) { throw e; })), verb("return"), i[Symbol.iterator] = function() { return this; }, i; function verb(n, f) { i[n] = o[n] ? function(v) { return (p = !p) ? { value: __await(o[n](v)), done: "return" === n } : f ? f(v) : v; } : f; } }, __asyncValues = function(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var i, m = o[Symbol.asyncIterator]; return m ? m.call(o) : (o = __values(o), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { return this; }, i); function verb(n) { i[n] = o[n] && function(v) { return new Promise((function(resolve, reject) { !(function(resolve, reject, d, v) { Promise.resolve(v).then((function(v) { resolve({ value: v, done: d }); }), reject); })(resolve, reject, (v = o[n](v)).done, v.value); })); }; } }, __makeTemplateObject = function(cooked, raw) { return Object.defineProperty ? Object.defineProperty(cooked, "raw", { value: raw }) : cooked.raw = raw, cooked; }; var __setModuleDefault = Object.create ? function(o, v) { Object.defineProperty(o, "default", { enumerable: !0, value: v }); } : function(o, v) { o.default = v; }; __importStar = function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k); return __setModuleDefault(result, mod), result; }, __importDefault = function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }, __classPrivateFieldGet = function(receiver, state, kind, f) { if ("a" === kind && !f) throw new TypeError("Private accessor was defined without a getter"); if ("function" == typeof state ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return "m" === kind ? f : "a" === kind ? f.call(receiver) : f ? f.value : state.get(receiver); }, __classPrivateFieldSet = function(receiver, state, value, kind, f) { if ("m" === kind) throw new TypeError("Private method is not writable"); if ("a" === kind && !f) throw new TypeError("Private accessor was defined without a setter"); if ("function" == typeof state ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return "a" === kind ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; }, exporter("__extends", __extends), exporter("__assign", __assign), exporter("__rest", __rest), exporter("__decorate", __decorate), exporter("__param", __param), exporter("__metadata", __metadata), exporter("__awaiter", __awaiter), exporter("__generator", __generator), exporter("__exportStar", __exportStar), exporter("__createBinding", __createBinding), exporter("__values", __values), exporter("__read", __read), exporter("__spread", __spread), exporter("__spreadArrays", __spreadArrays), exporter("__spreadArray", __spreadArray), exporter("__await", __await), exporter("__asyncGenerator", __asyncGenerator), exporter("__asyncDelegator", __asyncDelegator), exporter("__asyncValues", __asyncValues), exporter("__makeTemplateObject", __makeTemplateObject), exporter("__importStar", __importStar), exporter("__importDefault", __importDefault), exporter("__classPrivateFieldGet", __classPrivateFieldGet), exporter("__classPrivateFieldSet", __classPrivateFieldSet); })(createExporter(root, createExporter(exports))); }.apply(exports, [ exports ]), void 0 === __WEBPACK_AMD_DEFINE_RESULT__ || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); })(); }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.E_CANCELED = exports.E_ALREADY_LOCKED = exports.E_TIMEOUT = void 0, exports.E_TIMEOUT = new Error("timeout while waiting for mutex to become available"), exports.E_ALREADY_LOCKED = new Error("mutex already locked"), exports.E_CANCELED = new Error("request for lock canceled"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Segment(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Segment, start, length); } util.inherits(Segment, MasterElement), module.exports = Segment, Segment.prototype.toString = function() { return "[Segment #" + this.tagId + "]"; }, _proto.oneChild(Segment.prototype, "Info"), _proto.oneChild(Segment.prototype, "SeekHead"), _proto.oneChild(Segment.prototype, "Attachments"), _proto.oneChild(Segment.prototype, "Tracks"), _proto.oneChild(Segment.prototype, "Tags"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Segment = __webpack_require__(145), schema = __webpack_require__(13); function Segment1(doc, elementId, start, length) { Segment.call(this, doc, elementId, start, length); } function verifyCRC(element) { if (element.children) { var children = element.children || [], found = !1; children.forEach((function(c) { c.ebmlID === schema.byName.CRC_32 && (children[0] !== c ? c.remove() : found = !0); })), found || (element.$crc_32 = 0); } } function verifySeek(seekHeadElements, targetElement) { seekHeadElements.forEach((function(seekHead) { var found = !1; if (seekHead.seeks.forEach((function(seek) { if (seek.seekID === targetElement.ebmlID) return found = !0, !1; })), !found) { var newSeek = seekHead.newSeek(); newSeek.seekID = targetElement.ebmlID, newSeek.seekPosition = targetElement; } })); } util.inherits(Segment1, Segment), module.exports = Segment1, Segment1.prototype.normalize = function(options, callback) { "function" == typeof options && (callback = options, options = null), options = options || {}; var self = this, cluster = this.getFirstChildByName(schema.byName.Cluster), seekHeadElements = this.listChildrenByName(schema.byName.SeekHead); return seekHeadElements.forEach((function(seekHeadElement) { self.moveChildBefore(seekHeadElement, cluster), verifyCRC(seekHeadElement); })), this.eachChildByName(schema.byName.Info, (function(infoElement) { self.moveChildBefore(infoElement, cluster), verifyCRC(infoElement), verifySeek(seekHeadElements, infoElement); })), this.eachChildByName(schema.byName.Tracks, (function(tracksElement) { self.moveChildBefore(tracksElement, cluster), verifyCRC(tracksElement), verifySeek(seekHeadElements, tracksElement); })), this.eachChildByName(schema.byName.Cues, (function(cuesElement) { self.moveChildBefore(cuesElement, cluster), verifyCRC(cuesElement), verifySeek(seekHeadElements, cuesElement); })), this.eachChildByName(schema.byName.Void, (function(voidElement) { voidElement.remove(); })), this.eachChildByName(schema.byName.Tags, (function(tagsElement) { self.moveChildBefore(tagsElement, null), verifyCRC(tagsElement), verifySeek(seekHeadElements, tagsElement); })), this.eachChildByName(schema.byName.Attachments, (function(attachementsElement) { self.moveChildBefore(attachementsElement, null), verifyCRC(attachementsElement), verifySeek(seekHeadElements, attachementsElement); })), this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { verifyCRC(attachedFile); })), callback(); }; }, function(module, exports, __webpack_require__) { "use strict"; var crc32 = __webpack_require__(82).crc32, fs = __webpack_require__(2), Mime = __webpack_require__(45), Path = __webpack_require__(5), util = __webpack_require__(0), Segment1 = __webpack_require__(146), schema = __webpack_require__(13), tools = __webpack_require__(86); function Segment2(doc, tagId, start, length) { Segment1.call(this, doc, tagId, start, length); } function targetIn(id, elements) { if (!elements || !elements.length) return !1; for (var i = 0; i < elements.length; i++) if (elements[i].getValue() === id) return !0; return !1; } util.inherits(Segment2, Segment1), module.exports = Segment2, Segment2.prototype.addFileAttachment = function(path, description, mimeType, fileName, callback) { if ("function" == typeof description && 2 == arguments.length ? (callback = description, description = void 0) : "function" == typeof mimeType && 3 == arguments.length ? (callback = mimeType, mimeType = void 0) : "function" == typeof fileName && 4 == arguments.length && (callback = fileName, fileName = void 0), "function" != typeof callback) return this.addFileAttachmentSync(path, description, mimeType, fileName); if ("string" != typeof path || !path) return callback("Invalid path '" + path + "'"); var self = this; fs.stat(path, (function(error, stats) { if (error) return callback(error); fileName || (fileName = Path.basename(path)), mimeType || (mimeType = Mime.lookup(path)); var attachedFileTag = self._addAttachment({ path: path, description: description, size: stats.size, fileName: fileName, mimeType: mimeType, date: stats.mtime }); callback(null, attachedFileTag); })); }, Segment2.prototype.getAttachmentByFileName = function(filename) { return this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { var fn = attachedFile.getFirstChildByName(schema.byName.FileName); if (fn && fn.getValue() === filename) return attachedFile; })); }, Segment2.prototype.getAttachmentByFileUID = function(fileUID) { return this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { var fn = attachedFile.getFirstChildByName(schema.byName.FileUID); if (fn && fn.getValue() === fileUID) return attachedFile; })); }, Segment2.prototype.addFileAttachmentSync = function(path, description, mimeType, fileName) { if ("string" != typeof path || !path) throw new Error("Invalid path '" + path + "'"); var stats = fs.statSync(path); return fileName || (fileName = Path.basename(path)), mimeType || (mimeType = Mime.lookup(path)), this._addAttachment({ path: path, description: description, size: stats.size, fileName: fileName, mimeType: mimeType, date: stats.mtime }); }, Segment2.prototype.addStreamAttachment = function(stream, fileName, mimeType, size, description, callback) { return "number" != typeof size ? callback("Invalid size for attachment '" + size + "'") : "string" == typeof mimeType && mimeType.length ? "string" == typeof fileName && fileName.length ? ("function" == typeof description && (callback = description, description = void 0), void callback(null, this._addAttachment({ stream: stream, description: description, size: size, fileName: fileName, mimeType: mimeType }))) : callback("Invalid fileName for attachment '" + fileName + "'") : callback("Invalid mimeType for attachment '" + mimeType + "'"); }, Segment2.prototype._addAttachment = function(desc) { this.ownerDocument; var attachedFile = this.$attachments.$attachedFile; attachedFile.$crc_32 = 0, attachedFile.fileName = desc.fileName, attachedFile.fileMimeType = desc.mimeType, desc.description && (attachedFile.fileDescription = desc.description); var uid = crc32(desc.fileName + "$" + desc.mimeType + "$" + desc.description + "$" + desc.size); attachedFile.fileUID = uid; var getStream, info, fileData = attachedFile.getFileData(); return fileData.dataSize = desc.size, "function" == typeof desc.stream ? (getStream = desc.stream, info = "*function*") : desc.path && (getStream = function(options, callback) { callback(null, fs.createReadStream(desc.path, options)); }, info = desc.path), fileData._dataSource = { getStream: getStream, info: info }, attachedFile; }, Segment2.prototype.getTagByTargetType = function(targetInfos) { for (var tags = this.listChildrenByName(schema.byName.Tag), i = 0; i < tags.length; i++) { var tag = tags[i], targets = tag.targets; if (targets && !targets.empty) { if (!(void 0 !== targetInfos.targetTypeValue && targetInfos.targetTypeValue !== targets.targetTypeValue || void 0 !== targetInfos.targetType && targetInfos.targetType !== targets.targetType)) { var tus = targets.tagTrackUIDs; if (void 0 !== targetInfos.tagTrackUID) { if (!targetIn(targetInfos.tagTrackUID, tus)) continue; } else if (tus && tus.length) continue; var tes = targets.tagEditionUIDs; if (void 0 !== targetInfos.tagEditionUID) { if (!targetIn(targetInfos.tagEditionUID, tes)) continue; } else if (tes && tes.length) continue; var tcs = targets.tagChapterUIDs; if (void 0 !== targetInfos.tagChapterUID) { if (!targetIn(targetInfos.tagChapterUID, tcs)) continue; } else if (tcs && tcs.length) continue; var tas = targets.tagAttachmentUIDs; if (void 0 !== targetInfos.tagAttachmentUID) { if (!targetIn(targetInfos.tagAttachmentUID, tas)) continue; } else if (tas && tas.length) continue; return tag; } } else if (!targetInfos) return tag; } }, Segment2.prototype.addSimpleTagSync = function(targetInfos, name, language, defaultLanguage, value) { var tag; if (targetInfos.ebmlID === schema.byName.SimpleTag) tag = targetInfos; else if (!(tag = this.getTagByTargetType(targetInfos))) { var targets = (tag = this.$tags.newTag()).$targets; targetInfos && (targetInfos.tagAttachmentUID && targets.addTagAttachmentUID(targetInfos.tagAttachmentUID), targetInfos.targetTypeValue && (targets.targetTypeValue = targetInfos.targetTypeValue), targetInfos.targetType && (targets.targetType = targetInfos.targetType)); } var simpleTag = tag.newSimpleTag(); return simpleTag.tagName = name, simpleTag.tagLanguage = language || "und", simpleTag.tagDefault = defaultLanguage ? 1 : 0, null == value ? simpleTag : Buffer.isBuffer(value) ? (simpleTag.tagBinary = value, simpleTag) : (value instanceof Date && (value = tools.formatDate(value)), value = String(value), simpleTag.tagString = value, simpleTag); }; }, function(module, exports, __webpack_require__) { "use strict"; var _AdtsStream, Stream = __webpack_require__(38), ONE_SECOND_IN_TS = __webpack_require__(59).ONE_SECOND_IN_TS, ADTS_SAMPLING_FREQUENCIES = [ 96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350 ]; (_AdtsStream = function(handlePartialSegments) { var buffer, frameNum = 0; _AdtsStream.prototype.init.call(this), this.skipWarn_ = function(start, end) { this.trigger("log", { level: "warn", message: "adts skiping bytes " + start + " to " + end + " in frame " + frameNum + " outside syncword" }); }, this.push = function(packet) { var frameLength, protectionSkipBytes, oldBuffer, sampleCount, adtsFrameDuration, i = 0; if (handlePartialSegments || (frameNum = 0), "audio" === packet.type) { var skip; for (buffer && buffer.length ? (oldBuffer = buffer, (buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength)).set(oldBuffer), buffer.set(packet.data, oldBuffer.byteLength)) : buffer = packet.data; i + 7 < buffer.length; ) if (255 === buffer[i] && 240 == (246 & buffer[i + 1])) { if ("number" == typeof skip && (this.skipWarn_(skip, i), skip = null), protectionSkipBytes = 2 * (1 & ~buffer[i + 1]), frameLength = (3 & buffer[i + 3]) << 11 | buffer[i + 4] << 3 | (224 & buffer[i + 5]) >> 5, adtsFrameDuration = (sampleCount = 1024 * (1 + (3 & buffer[i + 6]))) * ONE_SECOND_IN_TS / ADTS_SAMPLING_FREQUENCIES[(60 & buffer[i + 2]) >>> 2], buffer.byteLength - i < frameLength) break; this.trigger("data", { pts: packet.pts + frameNum * adtsFrameDuration, dts: packet.dts + frameNum * adtsFrameDuration, sampleCount: sampleCount, audioobjecttype: 1 + (buffer[i + 2] >>> 6 & 3), channelcount: (1 & buffer[i + 2]) << 2 | (192 & buffer[i + 3]) >>> 6, samplerate: ADTS_SAMPLING_FREQUENCIES[(60 & buffer[i + 2]) >>> 2], samplingfrequencyindex: (60 & buffer[i + 2]) >>> 2, samplesize: 16, data: buffer.subarray(i + 7 + protectionSkipBytes, i + frameLength) }), frameNum++, i += frameLength; } else "number" != typeof skip && (skip = i), i++; "number" == typeof skip && (this.skipWarn_(skip, i), skip = null), buffer = buffer.subarray(i); } }, this.flush = function() { frameNum = 0, this.trigger("done"); }, this.reset = function() { buffer = void 0, this.trigger("reset"); }, this.endTimeline = function() { buffer = void 0, this.trigger("endedtimeline"); }; }).prototype = new Stream, module.exports = _AdtsStream; }, function(module, exports, __webpack_require__) { "use strict"; var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS, videoSample, audioSample, audioTrun, videoTrun, trunHeader, UINT32_MAX = Math.pow(2, 32) - 1; !(function() { var i; if (types = { avc1: [], avcC: [], btrt: [], dinf: [], dref: [], esds: [], ftyp: [], hdlr: [], mdat: [], mdhd: [], mdia: [], mfhd: [], minf: [], moof: [], moov: [], mp4a: [], mvex: [], mvhd: [], pasp: [], sdtp: [], smhd: [], stbl: [], stco: [], stsc: [], stsd: [], stsz: [], stts: [], styp: [], tfdt: [], tfhd: [], traf: [], trak: [], trun: [], trex: [], tkhd: [], vmhd: [] }, "undefined" != typeof Uint8Array) { for (i in types) types.hasOwnProperty(i) && (types[i] = [ i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3) ]); MAJOR_BRAND = new Uint8Array([ "i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0) ]), AVC1_BRAND = new Uint8Array([ "a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0) ]), MINOR_VERSION = new Uint8Array([ 0, 0, 0, 1 ]), VIDEO_HDLR = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114, 0 ]), AUDIO_HDLR = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0 ]), HDLR_TYPES = { video: VIDEO_HDLR, audio: AUDIO_HDLR }, DREF = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1 ]), SMHD = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0 ]), STCO = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0 ]), STSC = STCO, STSZ = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]), STTS = STCO, VMHD = new Uint8Array([ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 ]); } })(), box = function(type) { var i, result, payload = [], size = 0; for (i = 1; i < arguments.length; i++) payload.push(arguments[i]); for (i = payload.length; i--; ) size += payload[i].byteLength; for (result = new Uint8Array(size + 8), new DataView(result.buffer, result.byteOffset, result.byteLength).setUint32(0, result.byteLength), result.set(type, 4), i = 0, size = 8; i < payload.length; i++) result.set(payload[i], size), size += payload[i].byteLength; return result; }, dinf = function() { return box(types.dinf, box(types.dref, DREF)); }, esds = function(track) { return box(types.esds, new Uint8Array([ 0, 0, 0, 0, 3, 25, 0, 0, 0, 4, 17, 64, 21, 0, 6, 0, 0, 0, 218, 192, 0, 0, 218, 192, 5, 2, track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1, track.samplingfrequencyindex << 7 | track.channelcount << 3, 6, 1, 2 ])); }, ftyp = function() { return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND); }, hdlr = function(type) { return box(types.hdlr, HDLR_TYPES[type]); }, mdat = function(data) { return box(types.mdat, data); }, mdhd = function(track) { var result = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 1, 95, 144, track.duration >>> 24 & 255, track.duration >>> 16 & 255, track.duration >>> 8 & 255, 255 & track.duration, 85, 196, 0, 0 ]); return track.samplerate && (result[12] = track.samplerate >>> 24 & 255, result[13] = track.samplerate >>> 16 & 255, result[14] = track.samplerate >>> 8 & 255, result[15] = 255 & track.samplerate), box(types.mdhd, result); }, mdia = function(track) { return box(types.mdia, mdhd(track), hdlr(track.type), minf(track)); }, mfhd = function(sequenceNumber) { return box(types.mfhd, new Uint8Array([ 0, 0, 0, 0, (4278190080 & sequenceNumber) >> 24, (16711680 & sequenceNumber) >> 16, (65280 & sequenceNumber) >> 8, 255 & sequenceNumber ])); }, minf = function(track) { return box(types.minf, "video" === track.type ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track)); }, moof = function(sequenceNumber, tracks) { for (var trackFragments = [], i = tracks.length; i--; ) trackFragments[i] = traf(tracks[i]); return box.apply(null, [ types.moof, mfhd(sequenceNumber) ].concat(trackFragments)); }, moov = function(tracks) { for (var i = tracks.length, boxes = []; i--; ) boxes[i] = trak(tracks[i]); return box.apply(null, [ types.moov, mvhd(4294967295) ].concat(boxes).concat(mvex(tracks))); }, mvex = function(tracks) { for (var i = tracks.length, boxes = []; i--; ) boxes[i] = trex(tracks[i]); return box.apply(null, [ types.mvex ].concat(boxes)); }, mvhd = function(duration) { var bytes = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 95, 144, (4278190080 & duration) >> 24, (16711680 & duration) >> 16, (65280 & duration) >> 8, 255 & duration, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255 ]); return box(types.mvhd, bytes); }, sdtp = function(track) { var flags, i, samples = track.samples || [], bytes = new Uint8Array(4 + samples.length); for (i = 0; i < samples.length; i++) flags = samples[i].flags, bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy; return box(types.sdtp, bytes); }, stbl = function(track) { return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO)); }, stsd = function(track) { return box(types.stsd, new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1 ]), "video" === track.type ? videoSample(track) : audioSample(track)); }, videoSample = function(track) { var i, avc1Box, sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = []; for (i = 0; i < sps.length; i++) sequenceParameterSets.push((65280 & sps[i].byteLength) >>> 8), sequenceParameterSets.push(255 & sps[i].byteLength), sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); for (i = 0; i < pps.length; i++) pictureParameterSets.push((65280 & pps[i].byteLength) >>> 8), pictureParameterSets.push(255 & pps[i].byteLength), pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i])); if (avc1Box = [ types.avc1, new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (65280 & track.width) >> 8, 255 & track.width, (65280 & track.height) >> 8, 255 & track.height, 0, 72, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 1, 19, 118, 105, 100, 101, 111, 106, 115, 45, 99, 111, 110, 116, 114, 105, 98, 45, 104, 108, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 17, 17 ]), box(types.avcC, new Uint8Array([ 1, track.profileIdc, track.profileCompatibility, track.levelIdc, 255 ].concat([ sps.length ], sequenceParameterSets, [ pps.length ], pictureParameterSets))), box(types.btrt, new Uint8Array([ 0, 28, 156, 128, 0, 45, 198, 192, 0, 45, 198, 192 ])) ], track.sarRatio) { var hSpacing = track.sarRatio[0], vSpacing = track.sarRatio[1]; avc1Box.push(box(types.pasp, new Uint8Array([ (4278190080 & hSpacing) >> 24, (16711680 & hSpacing) >> 16, (65280 & hSpacing) >> 8, 255 & hSpacing, (4278190080 & vSpacing) >> 24, (16711680 & vSpacing) >> 16, (65280 & vSpacing) >> 8, 255 & vSpacing ]))); } return box.apply(null, avc1Box); }, audioSample = function(track) { return box(types.mp4a, new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, (65280 & track.channelcount) >> 8, 255 & track.channelcount, (65280 & track.samplesize) >> 8, 255 & track.samplesize, 0, 0, 0, 0, (65280 & track.samplerate) >> 8, 255 & track.samplerate, 0, 0 ]), esds(track)); }, tkhd = function(track) { var result = new Uint8Array([ 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, (4278190080 & track.id) >> 24, (16711680 & track.id) >> 16, (65280 & track.id) >> 8, 255 & track.id, 0, 0, 0, 0, (4278190080 & track.duration) >> 24, (16711680 & track.duration) >> 16, (65280 & track.duration) >> 8, 255 & track.duration, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, (65280 & track.width) >> 8, 255 & track.width, 0, 0, (65280 & track.height) >> 8, 255 & track.height, 0, 0 ]); return box(types.tkhd, result); }, traf = function(track) { var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime; return trackFragmentHeader = box(types.tfhd, new Uint8Array([ 0, 0, 0, 58, (4278190080 & track.id) >> 24, (16711680 & track.id) >> 16, (65280 & track.id) >> 8, 255 & track.id, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ])), upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / (UINT32_MAX + 1)), lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % (UINT32_MAX + 1)), trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([ 1, 0, 0, 0, upperWordBaseMediaDecodeTime >>> 24 & 255, upperWordBaseMediaDecodeTime >>> 16 & 255, upperWordBaseMediaDecodeTime >>> 8 & 255, 255 & upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime >>> 24 & 255, lowerWordBaseMediaDecodeTime >>> 16 & 255, lowerWordBaseMediaDecodeTime >>> 8 & 255, 255 & lowerWordBaseMediaDecodeTime ])), "audio" === track.type ? (trackFragmentRun = trun(track, 92), box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun)) : (sampleDependencyTable = sdtp(track), trackFragmentRun = trun(track, sampleDependencyTable.length + 92), box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable)); }, trak = function(track) { return track.duration = track.duration || 4294967295, box(types.trak, tkhd(track), mdia(track)); }, trex = function(track) { var result = new Uint8Array([ 0, 0, 0, 0, (4278190080 & track.id) >> 24, (16711680 & track.id) >> 16, (65280 & track.id) >> 8, 255 & track.id, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 ]); return "video" !== track.type && (result[result.length - 1] = 0), box(types.trex, result); }, trunHeader = function(samples, offset) { var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0; return samples.length && (void 0 !== samples[0].duration && (durationPresent = 1), void 0 !== samples[0].size && (sizePresent = 2), void 0 !== samples[0].flags && (flagsPresent = 4), void 0 !== samples[0].compositionTimeOffset && (compositionTimeOffset = 8)), [ 0, 0, durationPresent | sizePresent | flagsPresent | compositionTimeOffset, 1, (4278190080 & samples.length) >>> 24, (16711680 & samples.length) >>> 16, (65280 & samples.length) >>> 8, 255 & samples.length, (4278190080 & offset) >>> 24, (16711680 & offset) >>> 16, (65280 & offset) >>> 8, 255 & offset ]; }, videoTrun = function(track, offset) { var bytesOffest, bytes, header, samples, sample, i; for (offset += 20 + 16 * (samples = track.samples || []).length, header = trunHeader(samples, offset), (bytes = new Uint8Array(header.length + 16 * samples.length)).set(header), bytesOffest = header.length, i = 0; i < samples.length; i++) sample = samples[i], bytes[bytesOffest++] = (4278190080 & sample.duration) >>> 24, bytes[bytesOffest++] = (16711680 & sample.duration) >>> 16, bytes[bytesOffest++] = (65280 & sample.duration) >>> 8, bytes[bytesOffest++] = 255 & sample.duration, bytes[bytesOffest++] = (4278190080 & sample.size) >>> 24, bytes[bytesOffest++] = (16711680 & sample.size) >>> 16, bytes[bytesOffest++] = (65280 & sample.size) >>> 8, bytes[bytesOffest++] = 255 & sample.size, bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn, bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample, bytes[bytesOffest++] = 61440 & sample.flags.degradationPriority, bytes[bytesOffest++] = 15 & sample.flags.degradationPriority, bytes[bytesOffest++] = (4278190080 & sample.compositionTimeOffset) >>> 24, bytes[bytesOffest++] = (16711680 & sample.compositionTimeOffset) >>> 16, bytes[bytesOffest++] = (65280 & sample.compositionTimeOffset) >>> 8, bytes[bytesOffest++] = 255 & sample.compositionTimeOffset; return box(types.trun, bytes); }, audioTrun = function(track, offset) { var bytes, bytesOffest, header, samples, sample, i; for (offset += 20 + 8 * (samples = track.samples || []).length, header = trunHeader(samples, offset), (bytes = new Uint8Array(header.length + 8 * samples.length)).set(header), bytesOffest = header.length, i = 0; i < samples.length; i++) sample = samples[i], bytes[bytesOffest++] = (4278190080 & sample.duration) >>> 24, bytes[bytesOffest++] = (16711680 & sample.duration) >>> 16, bytes[bytesOffest++] = (65280 & sample.duration) >>> 8, bytes[bytesOffest++] = 255 & sample.duration, bytes[bytesOffest++] = (4278190080 & sample.size) >>> 24, bytes[bytesOffest++] = (16711680 & sample.size) >>> 16, bytes[bytesOffest++] = (65280 & sample.size) >>> 8, bytes[bytesOffest++] = 255 & sample.size; return box(types.trun, bytes); }, trun = function(track, offset) { return "audio" === track.type ? audioTrun(track, offset) : videoTrun(track, offset); }, module.exports = { ftyp: ftyp, mdat: mdat, moof: moof, moov: moov, initSegment: function(tracks) { var result, fileType = ftyp(), movie = moov(tracks); return (result = new Uint8Array(fileType.byteLength + movie.byteLength)).set(fileType), result.set(movie, fileType.byteLength), result; } }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { toUnsigned: function(value) { return value >>> 0; }, toHexString: function(value) { return ("00" + value.toString(16)).slice(-2); } }; }, function(module, exports, __webpack_require__) { "use strict"; var ONE_SECOND_IN_TS = __webpack_require__(59).ONE_SECOND_IN_TS; module.exports = { clearDtsInfo: function(track) { delete track.minSegmentDts, delete track.maxSegmentDts, delete track.minSegmentPts, delete track.maxSegmentPts; }, calculateTrackBaseMediaDecodeTime: function(track, keepOriginalTimestamps) { var baseMediaDecodeTime, minSegmentDts = track.minSegmentDts; return keepOriginalTimestamps || (minSegmentDts -= track.timelineStartInfo.dts), baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime, baseMediaDecodeTime += minSegmentDts, baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime), "audio" === track.type && (baseMediaDecodeTime *= track.samplerate / ONE_SECOND_IN_TS, baseMediaDecodeTime = Math.floor(baseMediaDecodeTime)), baseMediaDecodeTime; }, collectDtsInfo: function(track, data) { "number" == typeof data.pts && (void 0 === track.timelineStartInfo.pts && (track.timelineStartInfo.pts = data.pts), void 0 === track.minSegmentPts ? track.minSegmentPts = data.pts : track.minSegmentPts = Math.min(track.minSegmentPts, data.pts), void 0 === track.maxSegmentPts ? track.maxSegmentPts = data.pts : track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts)), "number" == typeof data.dts && (void 0 === track.timelineStartInfo.dts && (track.timelineStartInfo.dts = data.dts), void 0 === track.minSegmentDts ? track.minSegmentDts = data.dts : track.minSegmentDts = Math.min(track.minSegmentDts, data.dts), void 0 === track.maxSegmentDts ? track.maxSegmentDts = data.dts : track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts)); } }; }, function(module, exports, __webpack_require__) { "use strict"; var _TransportPacketStream, _TransportParseStream, _ElementaryStream, Stream = __webpack_require__(38), CaptionStream = __webpack_require__(451), StreamTypes = __webpack_require__(153), TimestampRolloverStream = __webpack_require__(453).TimestampRolloverStream; (_TransportPacketStream = function() { var buffer = new Uint8Array(188), bytesInBuffer = 0; _TransportPacketStream.prototype.init.call(this), this.push = function(bytes) { var everything, startIndex = 0, endIndex = 188; for (bytesInBuffer ? ((everything = new Uint8Array(bytes.byteLength + bytesInBuffer)).set(buffer.subarray(0, bytesInBuffer)), everything.set(bytes, bytesInBuffer), bytesInBuffer = 0) : everything = bytes; endIndex < everything.byteLength; ) 71 !== everything[startIndex] || 71 !== everything[endIndex] ? (startIndex++, endIndex++) : (this.trigger("data", everything.subarray(startIndex, endIndex)), startIndex += 188, endIndex += 188); startIndex < everything.byteLength && (buffer.set(everything.subarray(startIndex), 0), bytesInBuffer = everything.byteLength - startIndex); }, this.flush = function() { 188 === bytesInBuffer && 71 === buffer[0] && (this.trigger("data", buffer), bytesInBuffer = 0), this.trigger("done"); }, this.endTimeline = function() { this.flush(), this.trigger("endedtimeline"); }, this.reset = function() { bytesInBuffer = 0, this.trigger("reset"); }; }).prototype = new Stream, (_TransportParseStream = function() { var parsePsi, parsePat, parsePmt, self; _TransportParseStream.prototype.init.call(this), self = this, this.packetsWaitingForPmt = [], this.programMapTable = void 0, parsePsi = function(payload, psi) { var offset = 0; psi.payloadUnitStartIndicator && (offset += payload[offset] + 1), "pat" === psi.type ? parsePat(payload.subarray(offset), psi) : parsePmt(payload.subarray(offset), psi); }, parsePat = function(payload, pat) { pat.section_number = payload[7], pat.last_section_number = payload[8], self.pmtPid = (31 & payload[10]) << 8 | payload[11], pat.pmtPid = self.pmtPid; }, parsePmt = function(payload, pmt) { var tableEnd, offset; if (1 & payload[5]) { for (self.programMapTable = { video: null, audio: null, "timed-metadata": {} }, tableEnd = 3 + ((15 & payload[1]) << 8 | payload[2]) - 4, offset = 12 + ((15 & payload[10]) << 8 | payload[11]); offset < tableEnd; ) { var streamType = payload[offset], pid = (31 & payload[offset + 1]) << 8 | payload[offset + 2]; streamType === StreamTypes.H264_STREAM_TYPE && null === self.programMapTable.video ? self.programMapTable.video = pid : streamType === StreamTypes.ADTS_STREAM_TYPE && null === self.programMapTable.audio ? self.programMapTable.audio = pid : streamType === StreamTypes.METADATA_STREAM_TYPE && (self.programMapTable["timed-metadata"][pid] = streamType), offset += 5 + ((15 & payload[offset + 3]) << 8 | payload[offset + 4]); } pmt.programMapTable = self.programMapTable; } }, this.push = function(packet) { var result = {}, offset = 4; if (result.payloadUnitStartIndicator = !!(64 & packet[1]), result.pid = 31 & packet[1], result.pid <<= 8, result.pid |= packet[2], (48 & packet[3]) >>> 4 > 1 && (offset += packet[offset] + 1), 0 === result.pid) result.type = "pat", parsePsi(packet.subarray(offset), result), this.trigger("data", result); else if (result.pid === this.pmtPid) for (result.type = "pmt", parsePsi(packet.subarray(offset), result), this.trigger("data", result); this.packetsWaitingForPmt.length; ) this.processPes_.apply(this, this.packetsWaitingForPmt.shift()); else void 0 === this.programMapTable ? this.packetsWaitingForPmt.push([ packet, offset, result ]) : this.processPes_(packet, offset, result); }, this.processPes_ = function(packet, offset, result) { result.pid === this.programMapTable.video ? result.streamType = StreamTypes.H264_STREAM_TYPE : result.pid === this.programMapTable.audio ? result.streamType = StreamTypes.ADTS_STREAM_TYPE : result.streamType = this.programMapTable["timed-metadata"][result.pid], result.type = "pes", result.data = packet.subarray(offset), this.trigger("data", result); }; }).prototype = new Stream, _TransportParseStream.STREAM_TYPES = { h264: 27, adts: 15 }, _ElementaryStream = function() { var programMapTable, self = this, segmentHadPmt = !1, video = { data: [], size: 0 }, audio = { data: [], size: 0 }, timedMetadata = { data: [], size: 0 }, flushStream = function(stream, type, forceFlush) { var packetFlushable, fragment, packetData = new Uint8Array(stream.size), event = { type: type }, i = 0, offset = 0; if (stream.data.length && !(stream.size < 9)) { for (event.trackId = stream.data[0].pid, i = 0; i < stream.data.length; i++) fragment = stream.data[i], packetData.set(fragment.data, offset), offset += fragment.data.byteLength; var payload, pes, ptsDtsFlags, startPrefix; pes = event, startPrefix = (payload = packetData)[0] << 16 | payload[1] << 8 | payload[2], pes.data = new Uint8Array, 1 === startPrefix && (pes.packetLength = 6 + (payload[4] << 8 | payload[5]), pes.dataAlignmentIndicator = 0 != (4 & payload[6]), 192 & (ptsDtsFlags = payload[7]) && (pes.pts = (14 & payload[9]) << 27 | (255 & payload[10]) << 20 | (254 & payload[11]) << 12 | (255 & payload[12]) << 5 | (254 & payload[13]) >>> 3, pes.pts *= 4, pes.pts += (6 & payload[13]) >>> 1, pes.dts = pes.pts, 64 & ptsDtsFlags && (pes.dts = (14 & payload[14]) << 27 | (255 & payload[15]) << 20 | (254 & payload[16]) << 12 | (255 & payload[17]) << 5 | (254 & payload[18]) >>> 3, pes.dts *= 4, pes.dts += (6 & payload[18]) >>> 1)), pes.data = payload.subarray(9 + payload[8])), packetFlushable = "video" === type || event.packetLength <= stream.size, (forceFlush || packetFlushable) && (stream.size = 0, stream.data.length = 0), packetFlushable && self.trigger("data", event); } }; _ElementaryStream.prototype.init.call(this), this.push = function(data) { ({ pat: function() {}, pes: function() { var stream, streamType; switch (data.streamType) { case StreamTypes.H264_STREAM_TYPE: stream = video, streamType = "video"; break; case StreamTypes.ADTS_STREAM_TYPE: stream = audio, streamType = "audio"; break; case StreamTypes.METADATA_STREAM_TYPE: stream = timedMetadata, streamType = "timed-metadata"; break; default: return; } data.payloadUnitStartIndicator && flushStream(stream, streamType, !0), stream.data.push(data), stream.size += data.data.byteLength; }, pmt: function() { var event = { type: "metadata", tracks: [] }; null !== (programMapTable = data.programMapTable).video && event.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +programMapTable.video, codec: "avc", type: "video" }), null !== programMapTable.audio && event.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +programMapTable.audio, codec: "adts", type: "audio" }), segmentHadPmt = !0, self.trigger("data", event); } })[data.type](); }, this.reset = function() { video.size = 0, video.data.length = 0, audio.size = 0, audio.data.length = 0, this.trigger("reset"); }, this.flushStreams_ = function() { flushStream(video, "video"), flushStream(audio, "audio"), flushStream(timedMetadata, "timed-metadata"); }, this.flush = function() { if (!segmentHadPmt && programMapTable) { var pmt = { type: "metadata", tracks: [] }; null !== programMapTable.video && pmt.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +programMapTable.video, codec: "avc", type: "video" }), null !== programMapTable.audio && pmt.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +programMapTable.audio, codec: "adts", type: "audio" }), self.trigger("data", pmt); } segmentHadPmt = !1, this.flushStreams_(), this.trigger("done"); }; }, _ElementaryStream.prototype = new Stream; var m2ts = { PAT_PID: 0, MP2T_PACKET_LENGTH: 188, TransportPacketStream: _TransportPacketStream, TransportParseStream: _TransportParseStream, ElementaryStream: _ElementaryStream, TimestampRolloverStream: TimestampRolloverStream, CaptionStream: CaptionStream.CaptionStream, Cea608Stream: CaptionStream.Cea608Stream, Cea708Stream: CaptionStream.Cea708Stream, MetadataStream: __webpack_require__(885) }; for (var type in StreamTypes) StreamTypes.hasOwnProperty(type) && (m2ts[type] = StreamTypes[type]); module.exports = m2ts; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { H264_STREAM_TYPE: 27, ADTS_STREAM_TYPE: 15, METADATA_STREAM_TYPE: 21 }; }, function(module, exports, __webpack_require__) { "use strict"; var ADTS_SAMPLING_FREQUENCIES = [ 96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350 ], parseId3TagSize = function(header, byteIndex) { var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9]; return returnSize = returnSize >= 0 ? returnSize : 0, (16 & header[byteIndex + 5]) >> 4 ? returnSize + 20 : returnSize + 10; }, getId3Offset = function getId3Offset(data, offset) { return data.length - offset < 10 || data[offset] !== "I".charCodeAt(0) || data[offset + 1] !== "D".charCodeAt(0) || data[offset + 2] !== "3".charCodeAt(0) ? offset : getId3Offset(data, offset += parseId3TagSize(data, offset)); }, parseSyncSafeInteger = function(data) { return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3]; }; module.exports = { isLikelyAacData: function(data) { var offset = getId3Offset(data, 0); return data.length >= offset + 2 && 255 == (255 & data[offset]) && 240 == (240 & data[offset + 1]) && 16 == (22 & data[offset + 1]); }, parseId3TagSize: parseId3TagSize, parseAdtsSize: function(header, byteIndex) { var lowThree = (224 & header[byteIndex + 5]) >> 5, middle = header[byteIndex + 4] << 3; return 6144 & header[byteIndex + 3] | middle | lowThree; }, parseType: function(header, byteIndex) { return header[byteIndex] === "I".charCodeAt(0) && header[byteIndex + 1] === "D".charCodeAt(0) && header[byteIndex + 2] === "3".charCodeAt(0) ? "timed-metadata" : !0 & header[byteIndex] && 240 == (240 & header[byteIndex + 1]) ? "audio" : null; }, parseSampleRate: function(packet) { for (var i = 0; i + 5 < packet.length; ) { if (255 === packet[i] && 240 == (246 & packet[i + 1])) return ADTS_SAMPLING_FREQUENCIES[(60 & packet[i + 2]) >>> 2]; i++; } return null; }, parseAacTimestamp: function(packet) { var frameStart, frameSize, frame; frameStart = 10, 64 & packet[5] && (frameStart += 4, frameStart += parseSyncSafeInteger(packet.subarray(10, 14))); do { if ((frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8))) < 1) return null; if ("PRIV" === String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3])) { frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10); for (var i = 0; i < frame.byteLength; i++) if (0 === frame[i]) { var owner = unescape((function(bytes, start, end) { var i, result = ""; for (i = 0; i < end; i++) result += "%" + ("00" + bytes[i].toString(16)).slice(-2); return result; })(frame, 0, i)); if ("com.apple.streaming.transportStreamTimestamp" === owner) { var d = frame.subarray(i + 1), size = (1 & d[3]) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2; return (size *= 4) + (3 & d[7]); } break; } } frameStart += 10, frameStart += frameSize; } while (frameStart < packet.byteLength); return null; } }; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(26).Buffer, isEncoding = Buffer.isEncoding || function(encoding) { switch ((encoding = "" + encoding) && encoding.toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": case "raw": return !0; default: return !1; } }; function StringDecoder(encoding) { var nb; switch (this.encoding = (function(enc) { var nenc = (function(enc) { if (!enc) return "utf8"; for (var retried; ;) switch (enc) { 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 enc; default: if (retried) return; enc = ("" + enc).toLowerCase(), retried = !0; } })(enc); if ("string" != typeof nenc && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; })(encoding), this.encoding) { case "utf16le": this.text = utf16Text, this.end = utf16End, nb = 4; break; case "utf8": this.fillLast = utf8FillLast, nb = 4; break; case "base64": this.text = base64Text, this.end = base64End, nb = 3; break; default: return this.write = simpleWrite, void (this.end = simpleEnd); } this.lastNeed = 0, this.lastTotal = 0, this.lastChar = Buffer.allocUnsafe(nb); } function utf8CheckByte(byte) { return byte <= 127 ? 0 : byte >> 5 == 6 ? 2 : byte >> 4 == 14 ? 3 : byte >> 3 == 30 ? 4 : byte >> 6 == 2 ? -1 : -2; } function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed, r = (function(self, buf, p) { if (128 != (192 & buf[0])) return self.lastNeed = 0, "�"; if (self.lastNeed > 1 && buf.length > 1) { if (128 != (192 & buf[1])) return self.lastNeed = 1, "�"; if (self.lastNeed > 2 && buf.length > 2 && 128 != (192 & buf[2])) return self.lastNeed = 2, "�"; } })(this, buf); return void 0 !== r ? r : this.lastNeed <= buf.length ? (buf.copy(this.lastChar, p, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (buf.copy(this.lastChar, p, 0, buf.length), void (this.lastNeed -= buf.length)); } function utf16Text(buf, i) { if ((buf.length - i) % 2 == 0) { var r = buf.toString("utf16le", i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 55296 && c <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = buf[buf.length - 2], this.lastChar[1] = buf[buf.length - 1], r.slice(0, -1); } return r; } return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = buf[buf.length - 1], buf.toString("utf16le", i, buf.length - 1); } function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ""; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString("utf16le", 0, end); } return r; } function base64Text(buf, i) { var n = (buf.length - i) % 3; return 0 === n ? buf.toString("base64", i) : (this.lastNeed = 3 - n, this.lastTotal = 3, 1 === n ? this.lastChar[0] = buf[buf.length - 1] : (this.lastChar[0] = buf[buf.length - 2], this.lastChar[1] = buf[buf.length - 1]), buf.toString("base64", i, buf.length - n)); } function base64End(buf) { var r = buf && buf.length ? this.write(buf) : ""; return this.lastNeed ? r + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : r; } function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ""; } exports.StringDecoder = StringDecoder, StringDecoder.prototype.write = function(buf) { if (0 === buf.length) return ""; var r, i; if (this.lastNeed) { if (void 0 === (r = this.fillLast(buf))) return ""; i = this.lastNeed, this.lastNeed = 0; } else i = 0; return i < buf.length ? r ? r + this.text(buf, i) : this.text(buf, i) : r || ""; }, StringDecoder.prototype.end = function(buf) { var r = buf && buf.length ? this.write(buf) : ""; return this.lastNeed ? r + "�" : r; }, StringDecoder.prototype.text = function(buf, i) { var total = (function(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); return nb >= 0 ? (nb > 0 && (self.lastNeed = nb - 1), nb) : --j < i || -2 === nb ? 0 : (nb = utf8CheckByte(buf[j])) >= 0 ? (nb > 0 && (self.lastNeed = nb - 2), nb) : --j < i || -2 === nb ? 0 : (nb = utf8CheckByte(buf[j])) >= 0 ? (nb > 0 && (2 === nb ? nb = 0 : self.lastNeed = nb - 3), nb) : 0; })(this, buf, i); if (!this.lastNeed) return buf.toString("utf8", i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); return buf.copy(this.lastChar, 0, end), buf.toString("utf8", i, end); }, StringDecoder.prototype.fillLast = function(buf) { if (this.lastNeed <= buf.length) return buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length), this.lastNeed -= buf.length; }; }, function(module, exports, __webpack_require__) { "use strict"; var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; const http_1 = __importDefault(__webpack_require__(11)), https_1 = __importDefault(__webpack_require__(21)), url_1 = __webpack_require__(7), stream_1 = __webpack_require__(3), httpLibs = { "http:": http_1.default, "https:": https_1.default }, redirectStatusCodes = new Set([ 301, 302, 303, 307, 308 ]), retryStatusCodes = new Set([ 429, 503 ]), requestEvents = [ "connect", "continue", "information", "socket", "timeout", "upgrade" ], responseEvents = [ "aborted" ]; function Miniget(url, options = {}) { var _a; const opts = Object.assign({}, Miniget.defaultOptions, options), stream = new stream_1.PassThrough({ highWaterMark: opts.highWaterMark }); let activeRequest, activeResponse, activeDecodedStream; stream.destroyed = stream.aborted = !1; let retryTimeout, contentLength, rangeEnd, redirects = 0, retries = 0, reconnects = 0, acceptRanges = !1, rangeStart = 0, downloaded = 0; if (null === (_a = opts.headers) || void 0 === _a ? void 0 : _a.Range) { let r = /bytes=(\d+)-(\d+)?/.exec(`${opts.headers.Range}`); r && (rangeStart = parseInt(r[1], 10), rangeEnd = parseInt(r[2], 10)); } opts.acceptEncoding && (opts.headers = Object.assign({ "Accept-Encoding": Object.keys(opts.acceptEncoding).join(", ") }, opts.headers)); const reconnectIfEndedEarly = err => !!("HEAD" !== options.method && acceptRanges && downloaded !== contentLength && reconnects++ < opts.maxReconnects) && ((err => { activeDecodedStream = null, retries = 0; let inc = opts.backoff.inc, ms = Math.min(inc, opts.backoff.max); retryTimeout = setTimeout(doDownload, ms), stream.emit("reconnect", reconnects, err); })(err), !0), retryRequest = retryOptions => { if (stream.destroyed) return !1; if (activeDecodedStream && downloaded > 0) return reconnectIfEndedEarly(retryOptions.err); if ((!retryOptions.err || "ENOTFOUND" === retryOptions.err.message) && retries++ < opts.maxRetries) { let ms = retryOptions.retryAfter || Math.min(retries * opts.backoff.inc, opts.backoff.max); return retryTimeout = setTimeout(doDownload, ms), stream.emit("retry", retries, retryOptions.err), !0; } return !1; }, forwardEvents = (ee, events) => { for (let event of events) ee.on(event, stream.emit.bind(stream, event)); }, doDownload = () => { let httpLib, parsed = {}; try { let urlObj = "string" == typeof url ? new url_1.URL(url) : url; parsed = Object.assign({}, { host: urlObj.host, hostname: urlObj.hostname, path: urlObj.pathname + urlObj.search + urlObj.hash, port: urlObj.port, protocol: urlObj.protocol }), urlObj.username && (parsed.auth = `${urlObj.username}:${urlObj.password}`), httpLib = httpLibs[String(parsed.protocol)]; } catch (err) {} if (!httpLib) return void stream.emit("error", new Miniget.MinigetError(`Invalid URL: ${url}`)); if (Object.assign(parsed, opts), acceptRanges && downloaded > 0) { let start = downloaded + rangeStart, end = rangeEnd || ""; parsed.headers = Object.assign({}, parsed.headers, { Range: `bytes=${start}-${end}` }); } if (opts.transform) { try { parsed = opts.transform(parsed); } catch (err) { return void stream.emit("error", err); } if ((!parsed || parsed.protocol) && (httpLib = httpLibs[String(null == parsed ? void 0 : parsed.protocol)], !httpLib)) return void stream.emit("error", new Miniget.MinigetError("Invalid URL object from `transform` function")); } const onError = err => { stream.destroyed || stream.readableEnded || stream._readableState.ended || (cleanup(), retryRequest({ err: err }) ? activeRequest.removeListener("close", onRequestClose) : stream.emit("error", err)); }, onRequestClose = () => { cleanup(), retryRequest({}); }, cleanup = () => { activeRequest.removeListener("close", onRequestClose), null == activeResponse || activeResponse.removeListener("data", onData), null == activeDecodedStream || activeDecodedStream.removeListener("end", onEnd); }, onData = chunk => { downloaded += chunk.length; }, onEnd = () => { cleanup(), reconnectIfEndedEarly() || stream.end(); }; activeRequest = httpLib.request(parsed, (res => { if (!stream.destroyed) if (redirectStatusCodes.has(res.statusCode)) { if (redirects++ >= opts.maxRedirects) stream.emit("error", new Miniget.MinigetError("Too many redirects")); else { if (!res.headers.location) { let err = new Miniget.MinigetError("Redirect status code given with no location", res.statusCode); return stream.emit("error", err), void cleanup(); } url = res.headers.location, setTimeout(doDownload, 1e3 * parseInt(res.headers["retry-after"] || "0", 10)), stream.emit("redirect", url); } cleanup(); } else if (retryStatusCodes.has(res.statusCode)) { if (!retryRequest({ retryAfter: parseInt(res.headers["retry-after"] || "0", 10) })) { let err = new Miniget.MinigetError(`Status code: ${res.statusCode}`, res.statusCode); stream.emit("error", err); } cleanup(); } else { if (res.statusCode && (res.statusCode < 200 || res.statusCode >= 400)) { let err = new Miniget.MinigetError(`Status code: ${res.statusCode}`, res.statusCode); return res.statusCode >= 500 ? onError(err) : stream.emit("error", err), void cleanup(); } if (activeDecodedStream = res, opts.acceptEncoding && res.headers["content-encoding"]) for (let enc of res.headers["content-encoding"].split(", ").reverse()) { let fn = opts.acceptEncoding[enc]; fn && (activeDecodedStream = activeDecodedStream.pipe(fn()), activeDecodedStream.on("error", onError)); } contentLength || (contentLength = parseInt(`${res.headers["content-length"]}`, 10), acceptRanges = "bytes" === res.headers["accept-ranges"] && contentLength > 0 && opts.maxReconnects > 0), res.on("data", onData), activeDecodedStream.on("end", onEnd), activeDecodedStream.pipe(stream, { end: !acceptRanges }), activeResponse = res, stream.emit("response", res), res.on("error", onError), forwardEvents(res, responseEvents); } })), activeRequest.on("error", onError), activeRequest.on("close", onRequestClose), forwardEvents(activeRequest, requestEvents), stream.destroyed && streamDestroy(...destroyArgs), stream.emit("request", activeRequest), activeRequest.end(); }; let destroyArgs; stream.abort = err => { console.warn("`MinigetStream#abort()` has been deprecated in favor of `MinigetStream#destroy()`"), stream.aborted = !0, stream.emit("abort"), stream.destroy(err); }; const streamDestroy = err => { activeRequest.destroy(err), null == activeDecodedStream || activeDecodedStream.unpipe(stream), null == activeDecodedStream || activeDecodedStream.destroy(), clearTimeout(retryTimeout); }; return stream._destroy = (...args) => { stream.destroyed = !0, activeRequest ? streamDestroy(...args) : destroyArgs = args; }, stream.text = () => new Promise(((resolve, reject) => { let body = ""; stream.setEncoding("utf8"), stream.on("data", (chunk => body += chunk)), stream.on("end", (() => resolve(body))), stream.on("error", reject); })), process.nextTick(doDownload), stream; } Miniget.MinigetError = class extends Error { constructor(message, statusCode) { super(message), this.statusCode = statusCode; } }, Miniget.defaultOptions = { maxRedirects: 10, maxRetries: 2, maxReconnects: 0, backoff: { inc: 100, max: 1e4 } }, module.exports = Miniget; }, function(module, exports, __webpack_require__) { "use strict"; var hasOwn = Object.prototype.hasOwnProperty, toStr = Object.prototype.toString, defineProperty = Object.defineProperty, gOPD = Object.getOwnPropertyDescriptor, isArray = function(arr) { return "function" == typeof Array.isArray ? Array.isArray(arr) : "[object Array]" === toStr.call(arr); }, isPlainObject = function(obj) { if (!obj || "[object Object]" !== toStr.call(obj)) return !1; var key, hasOwnConstructor = hasOwn.call(obj, "constructor"), hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf"); if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) return !1; for (key in obj) ; return void 0 === key || hasOwn.call(obj, key); }, setProperty = function(target, options) { defineProperty && "__proto__" === options.name ? defineProperty(target, options.name, { enumerable: !0, configurable: !0, value: options.newValue, writable: !0 }) : target[options.name] = options.newValue; }, getProperty = function(obj, name) { if ("__proto__" === name) { if (!hasOwn.call(obj, name)) return; if (gOPD) return gOPD(obj, name).value; } return obj[name]; }; module.exports = function extend() { var options, name, src, copy, copyIsArray, clone, target = arguments[0], i = 1, length = arguments.length, deep = !1; for ("boolean" == typeof target && (deep = target, target = arguments[1] || {}, i = 2), (null == target || "object" != typeof target && "function" != typeof target) && (target = {}); i < length; ++i) if (null != (options = arguments[i])) for (name in options) src = getProperty(target, name), target !== (copy = getProperty(options, name)) && (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy))) ? (copyIsArray ? (copyIsArray = !1, clone = src && isArray(src) ? src : []) : clone = src && isPlainObject(src) ? src : {}, setProperty(target, { name: name, newValue: extend(deep, clone, copy) })) : void 0 !== copy && setProperty(target, { name: name, newValue: copy })); return target; }; }, function(module, exports, __webpack_require__) { var rng = __webpack_require__(995), bytesToUuid = __webpack_require__(996); module.exports = function(options, buf, offset) { var i = buf && offset || 0; "string" == typeof options && (buf = "binary" === options ? new Array(16) : null, options = null); var rnds = (options = options || {}).random || (options.rng || rng)(); if (rnds[6] = 15 & rnds[6] | 64, rnds[8] = 63 & rnds[8] | 128, buf) for (var ii = 0; ii < 16; ++ii) buf[i + ii] = rnds[ii]; return buf || bytesToUuid(rnds); }; }, function(module, exports, __webpack_require__) { "use strict"; function flattenWithDepth(array, result, depth) { for (var i = 0; i < array.length; i++) { var value = array[i]; depth > 0 && Array.isArray(value) ? flattenWithDepth(value, result, depth - 1) : result.push(value); } return result; } function flattenForever(array, result) { for (var i = 0; i < array.length; i++) { var value = array[i]; Array.isArray(value) ? flattenForever(value, result) : result.push(value); } return result; } module.exports = function(array, depth) { return null == depth ? flattenForever(array, []) : flattenWithDepth(array, [], depth); }; }, function(module, exports, __webpack_require__) { (function() { var XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(42), module.exports = (function(superClass) { function XMLCharacterData(parent) { XMLCharacterData.__super__.constructor.call(this, parent), this.value = ""; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLCharacterData, superClass), Object.defineProperty(XMLCharacterData.prototype, "data", { get: function() { return this.value; }, set: function(value) { return this.value = value || ""; } }), Object.defineProperty(XMLCharacterData.prototype, "length", { get: function() { return this.value.length; } }), Object.defineProperty(XMLCharacterData.prototype, "textContent", { get: function() { return this.value; }, set: function(value) { return this.value = value || ""; } }), XMLCharacterData.prototype.clone = function() { return Object.create(this); }, XMLCharacterData.prototype.substringData = function(offset, count) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLCharacterData.prototype.appendData = function(arg) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLCharacterData.prototype.insertData = function(offset, arg) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLCharacterData.prototype.deleteData = function(offset, count) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLCharacterData.prototype.replaceData = function(offset, count, arg) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLCharacterData.prototype.isEqualNode = function(node) { return !!XMLCharacterData.__super__.isEqualNode.apply(this, arguments).isEqualNode(node) && node.data === this.data; }, XMLCharacterData; })(XMLNode); }).call(this); }, function(module, exports) { (function() { module.exports = { None: 0, OpenTag: 1, InsideTag: 2, CloseTag: 3 }; }).call(this); }, function(module, exports) { const cache = {}; function getRandom() { return (Math.random() + 1).toString(36).substring(7); } module.exports = { set: (data, createKey) => { let key = createKey || getRandom(); for (;cache[key]; ) key = getRandom(); return cache[key] = data, key; }, get: key => cache[key] || null }; }, function(module, exports, __webpack_require__) { var assert = __webpack_require__(15), sshpk = __webpack_require__(261), util = __webpack_require__(0), HASH_ALGOS = { sha1: !0, sha256: !0, sha512: !0 }, PK_ALGOS = { rsa: !0, dsa: !0, ecdsa: !0 }; function HttpSignatureError(message, caller) { Error.captureStackTrace && Error.captureStackTrace(this, caller || HttpSignatureError), this.message = message, this.name = caller.name; } function InvalidAlgorithmError(message) { HttpSignatureError.call(this, message, InvalidAlgorithmError); } util.inherits(HttpSignatureError, Error), util.inherits(InvalidAlgorithmError, HttpSignatureError), module.exports = { HASH_ALGOS: HASH_ALGOS, PK_ALGOS: PK_ALGOS, HttpSignatureError: HttpSignatureError, InvalidAlgorithmError: InvalidAlgorithmError, validateAlgorithm: function(algorithm) { var alg = algorithm.toLowerCase().split("-"); if (2 !== alg.length) throw new InvalidAlgorithmError(alg[0].toUpperCase() + " is not a valid algorithm"); if ("hmac" !== alg[0] && !PK_ALGOS[alg[0]]) throw new InvalidAlgorithmError(alg[0].toUpperCase() + " type keys are not supported"); if (!HASH_ALGOS[alg[1]]) throw new InvalidAlgorithmError(alg[1].toUpperCase() + " is not a supported hash algorithm"); return alg; }, sshKeyToPEM: function(key) { return assert.string(key, "ssh_key"), sshpk.parseKey(key, "ssh").toString("pem"); }, fingerprint: function(key) { return assert.string(key, "ssh_key"), sshpk.parseKey(key, "ssh").fingerprint("md5").toString("hex"); }, pemToRsaSSHKey: function(pem, comment) { assert.equal("string", typeof pem, "typeof pem"); var k = sshpk.parseKey(pem, "pem"); return k.comment = comment, k.toString("ssh"); } }; }, function(module, exports, __webpack_require__) { var BigInteger = __webpack_require__(110).BigInteger, Barrett = BigInteger.prototype.Barrett; function ECFieldElementFp(q, x) { this.x = x, this.q = q; } function ECPointFp(curve, x, y, z) { this.curve = curve, this.x = x, this.y = y, this.z = null == z ? BigInteger.ONE : z, this.zinv = null; } function ECCurveFp(q, a, b) { this.q = q, this.a = this.fromBigInteger(a), this.b = this.fromBigInteger(b), this.infinity = new ECPointFp(this, null, null), this.reducer = new Barrett(this.q); } ECFieldElementFp.prototype.equals = function(other) { return other == this || this.q.equals(other.q) && this.x.equals(other.x); }, ECFieldElementFp.prototype.toBigInteger = function() { return this.x; }, ECFieldElementFp.prototype.negate = function() { return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); }, ECFieldElementFp.prototype.add = function(b) { return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); }, ECFieldElementFp.prototype.subtract = function(b) { return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); }, ECFieldElementFp.prototype.multiply = function(b) { return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); }, ECFieldElementFp.prototype.square = function() { return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); }, ECFieldElementFp.prototype.divide = function(b) { return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); }, ECPointFp.prototype.getX = function() { null == this.zinv && (this.zinv = this.z.modInverse(this.curve.q)); var r = this.x.toBigInteger().multiply(this.zinv); return this.curve.reduce(r), this.curve.fromBigInteger(r); }, ECPointFp.prototype.getY = function() { null == this.zinv && (this.zinv = this.z.modInverse(this.curve.q)); var r = this.y.toBigInteger().multiply(this.zinv); return this.curve.reduce(r), this.curve.fromBigInteger(r); }, ECPointFp.prototype.equals = function(other) { return other == this || (this.isInfinity() ? other.isInfinity() : other.isInfinity() ? this.isInfinity() : !!other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q).equals(BigInteger.ZERO) && other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q).equals(BigInteger.ZERO)); }, ECPointFp.prototype.isInfinity = function() { return null == this.x && null == this.y || this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); }, ECPointFp.prototype.negate = function() { return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); }, ECPointFp.prototype.add = function(b) { if (this.isInfinity()) return b; if (b.isInfinity()) return this; var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q), v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); if (BigInteger.ZERO.equals(v)) return BigInteger.ZERO.equals(u) ? this.twice() : this.curve.getInfinity(); var THREE = new BigInteger("3"), x1 = this.x.toBigInteger(), y1 = this.y.toBigInteger(), v2 = (b.x.toBigInteger(), b.y.toBigInteger(), v.square()), v3 = v2.multiply(v), x1v2 = x1.multiply(v2), zu2 = u.square().multiply(this.z), x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q), y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q), z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); }, ECPointFp.prototype.twice = function() { if (this.isInfinity()) return this; if (0 == this.y.toBigInteger().signum()) return this.curve.getInfinity(); var THREE = new BigInteger("3"), x1 = this.x.toBigInteger(), y1 = this.y.toBigInteger(), y1z1 = y1.multiply(this.z), y1sqz1 = y1z1.multiply(y1).mod(this.curve.q), a = this.curve.a.toBigInteger(), w = x1.square().multiply(THREE); BigInteger.ZERO.equals(a) || (w = w.add(this.z.square().multiply(a))); var x3 = (w = w.mod(this.curve.q)).square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q), y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q), z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); }, ECPointFp.prototype.multiply = function(k) { if (this.isInfinity()) return this; if (0 == k.signum()) return this.curve.getInfinity(); var i, e = k, h = e.multiply(new BigInteger("3")), neg = this.negate(), R = this; for (i = h.bitLength() - 2; i > 0; --i) { R = R.twice(); var hBit = h.testBit(i); hBit != e.testBit(i) && (R = R.add(hBit ? this : neg)); } return R; }, ECPointFp.prototype.multiplyTwo = function(j, x, k) { var i; i = j.bitLength() > k.bitLength() ? j.bitLength() - 1 : k.bitLength() - 1; for (var R = this.curve.getInfinity(), both = this.add(x); i >= 0; ) R = R.twice(), j.testBit(i) ? R = k.testBit(i) ? R.add(both) : R.add(this) : k.testBit(i) && (R = R.add(x)), --i; return R; }, ECCurveFp.prototype.getQ = function() { return this.q; }, ECCurveFp.prototype.getA = function() { return this.a; }, ECCurveFp.prototype.getB = function() { return this.b; }, ECCurveFp.prototype.equals = function(other) { return other == this || this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b); }, ECCurveFp.prototype.getInfinity = function() { return this.infinity; }, ECCurveFp.prototype.fromBigInteger = function(x) { return new ECFieldElementFp(this.q, x); }, ECCurveFp.prototype.reduce = function(x) { this.reducer.reduce(x); }, ECCurveFp.prototype.encodePointHex = function(p) { if (p.isInfinity()) return "00"; var xHex = p.getX().toBigInteger().toString(16), yHex = p.getY().toBigInteger().toString(16), oLen = this.getQ().toString(16).length; for (oLen % 2 != 0 && oLen++; xHex.length < oLen; ) xHex = "0" + xHex; for (;yHex.length < oLen; ) yHex = "0" + yHex; return "04" + xHex + yHex; }, ECCurveFp.prototype.decodePointHex = function(s) { var yIsEven; switch (parseInt(s.substr(0, 2), 16)) { case 0: return this.infinity; case 2: yIsEven = !1; case 3: null == yIsEven && (yIsEven = !0); var len = s.length - 2, xHex = s.substr(2, len), x = this.fromBigInteger(new BigInteger(xHex, 16)), beta = x.multiply(x.square().add(this.getA())).add(this.getB()).sqrt(); if (null == beta) throw "Invalid point compression"; var betaValue = beta.toBigInteger(); return betaValue.testBit(0) != yIsEven && (beta = this.fromBigInteger(this.getQ().subtract(betaValue))), new ECPointFp(this, x, beta); case 4: case 6: case 7: len = (s.length - 2) / 2, xHex = s.substr(2, len); var yHex = s.substr(len + 2, len); return new ECPointFp(this, this.fromBigInteger(new BigInteger(xHex, 16)), this.fromBigInteger(new BigInteger(yHex, 16))); default: return null; } }, ECCurveFp.prototype.encodeCompressedPointHex = function(p) { if (p.isInfinity()) return "00"; var xHex = p.getX().toBigInteger().toString(16), oLen = this.getQ().toString(16).length; for (oLen % 2 != 0 && oLen++; xHex.length < oLen; ) xHex = "0" + xHex; return (p.getY().toBigInteger().isEven() ? "02" : "03") + xHex; }, ECFieldElementFp.prototype.getR = function() { if (null != this.r) return this.r; this.r = null; var bitLength = this.q.bitLength(); return bitLength > 128 && -1 == this.q.shiftRight(bitLength - 64).intValue() && (this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q)), this.r; }, ECFieldElementFp.prototype.modMult = function(x1, x2) { return this.modReduce(x1.multiply(x2)); }, ECFieldElementFp.prototype.modReduce = function(x) { if (null != this.getR()) { for (var qLen = q.bitLength(); x.bitLength() > qLen + 1; ) { var u = x.shiftRight(qLen), v = x.subtract(u.shiftLeft(qLen)); this.getR().equals(BigInteger.ONE) || (u = u.multiply(this.getR())), x = u.add(v); } for (;x.compareTo(q) >= 0; ) x = x.subtract(q); } else x = x.mod(q); return x; }, ECFieldElementFp.prototype.sqrt = function() { if (!this.q.testBit(0)) throw "unsupported"; if (this.q.testBit(1)) { var z = new ECFieldElementFp(this.q, this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE), this.q)); return z.square().equals(this) ? z : null; } var qMinusOne = this.q.subtract(BigInteger.ONE), legendreExponent = qMinusOne.shiftRight(1); if (!this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)) return null; var U, V, k = qMinusOne.shiftRight(2).shiftLeft(1).add(BigInteger.ONE), Q = this.x, fourQ = modDouble(modDouble(Q)); do { var P; do { P = new BigInteger(this.q.bitLength(), new SecureRandom); } while (P.compareTo(this.q) >= 0 || !P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne)); var result = this.lucasSequence(P, Q, k); if (U = result[0], V = result[1], this.modMult(V, V).equals(fourQ)) return V.testBit(0) && (V = V.add(q)), V = V.shiftRight(1), new ECFieldElementFp(q, V); } while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); return null; }, ECFieldElementFp.prototype.lucasSequence = function(P, Q, k) { for (var n = k.bitLength(), s = k.getLowestSetBit(), Uh = BigInteger.ONE, Vl = BigInteger.TWO, Vh = P, Ql = BigInteger.ONE, Qh = BigInteger.ONE, j = n - 1; j >= s + 1; --j) Ql = this.modMult(Ql, Qh), k.testBit(j) ? (Qh = this.modMult(Ql, Q), Uh = this.modMult(Uh, Vh), Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))), Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)))) : (Qh = Ql, Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)), Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))), Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)))); for (Ql = this.modMult(Ql, Qh), Qh = this.modMult(Ql, Q), Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)), Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))), Ql = this.modMult(Ql, Qh), j = 1; j <= s; ++j) Uh = this.modMult(Uh, Vl), Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))), Ql = this.modMult(Ql, Ql); return [ Uh, Vl ]; }, exports = { ECCurveFp: ECCurveFp, ECPointFp: ECPointFp, ECFieldElementFp: ECFieldElementFp }, module.exports = exports; }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { return pem.read(buf, options); }, readSSHPrivate: function(type, buf, options) { var magic = (buf = new SSHBuffer({ buffer: buf })).readCString(); assert.strictEqual(magic, "openssh-key-v1", "bad magic string"); var cipher = buf.readString(), kdf = buf.readString(), kdfOpts = buf.readBuffer(); if (1 !== buf.readInt()) throw new Error("OpenSSH-format key file contains multiple keys: this is unsupported."); var pubKey = buf.readBuffer(); if ("public" === type) return assert.ok(buf.atEnd(), "excess bytes left after key"), rfc4253.read(pubKey); var privKeyBlob = buf.readBuffer(); assert.ok(buf.atEnd(), "excess bytes left after key"); var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts }); switch (kdf) { case "none": if ("none" !== cipher) throw new Error('OpenSSH-format key uses KDF "none" but specifies a cipher other than "none"'); break; case "bcrypt": var salt = kdfOptsBuf.readBuffer(), rounds = kdfOptsBuf.readInt(), cinf = utils.opensshCipherInfo(cipher); if (void 0 === bcrypt && (bcrypt = __webpack_require__(523)), "string" == typeof options.passphrase && (options.passphrase = Buffer.from(options.passphrase, "utf-8")), !Buffer.isBuffer(options.passphrase)) throw new errors.KeyEncryptedError(options.filename, "OpenSSH"); var pass = new Uint8Array(options.passphrase), salti = new Uint8Array(salt), out = new Uint8Array(cinf.keySize + cinf.blockSize); if (0 !== bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, rounds)) throw new Error("bcrypt_pbkdf function returned failure, parameters invalid"); var ckey = (out = Buffer.from(out)).slice(0, cinf.keySize), iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize), cipherStream = crypto.createDecipheriv(cinf.opensslName, ckey, iv); cipherStream.setAutoPadding(!1); var chunk, chunks = []; for (cipherStream.once("error", (function(e) { if (-1 !== e.toString().indexOf("bad decrypt")) throw new Error("Incorrect passphrase supplied, could not decrypt key"); throw e; })), cipherStream.write(privKeyBlob), cipherStream.end(); null !== (chunk = cipherStream.read()); ) chunks.push(chunk); privKeyBlob = Buffer.concat(chunks); break; default: throw new Error('OpenSSH-format key uses unknown KDF "' + kdf + '"'); } if ((buf = new SSHBuffer({ buffer: privKeyBlob })).readInt() !== buf.readInt()) throw new Error("Incorrect passphrase supplied, could not decrypt key"); var ret = {}, key = rfc4253.readInternal(ret, "private", buf.remainder()); buf.skip(ret.consumed); var comment = buf.readString(); return key.comment = comment, key; }, write: function(key, options) { var pubKey; pubKey = PrivateKey.isPrivateKey(key) ? key.toPublic() : key; var passphrase, privBuf, cipher = "none", kdf = "none", kdfopts = Buffer.alloc(0), cinf = { blockSize: 8 }; if (void 0 !== options && ("string" == typeof (passphrase = options.passphrase) && (passphrase = Buffer.from(passphrase, "utf-8")), void 0 !== passphrase && (assert.buffer(passphrase, "options.passphrase"), assert.optionalString(options.cipher, "options.cipher"), void 0 === (cipher = options.cipher) && (cipher = "aes128-ctr"), cinf = utils.opensshCipherInfo(cipher), kdf = "bcrypt")), PrivateKey.isPrivateKey(key)) { privBuf = new SSHBuffer({}); var checkInt = crypto.randomBytes(4).readUInt32BE(0); privBuf.writeInt(checkInt), privBuf.writeInt(checkInt), privBuf.write(key.toBuffer("rfc4253")), privBuf.writeString(key.comment || ""); for (var n = 1; privBuf._offset % cinf.blockSize != 0; ) privBuf.writeChar(n++); privBuf = privBuf.toBuffer(); } switch (kdf) { case "none": break; case "bcrypt": var salt = crypto.randomBytes(16), kdfssh = new SSHBuffer({}); kdfssh.writeBuffer(salt), kdfssh.writeInt(16), kdfopts = kdfssh.toBuffer(), void 0 === bcrypt && (bcrypt = __webpack_require__(523)); var pass = new Uint8Array(passphrase), salti = new Uint8Array(salt), out = new Uint8Array(cinf.keySize + cinf.blockSize); if (0 !== bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, 16)) throw new Error("bcrypt_pbkdf function returned failure, parameters invalid"); var ckey = (out = Buffer.from(out)).slice(0, cinf.keySize), iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize), cipherStream = crypto.createCipheriv(cinf.opensslName, ckey, iv); cipherStream.setAutoPadding(!1); var chunk, chunks = []; for (cipherStream.once("error", (function(e) { throw e; })), cipherStream.write(privBuf), cipherStream.end(); null !== (chunk = cipherStream.read()); ) chunks.push(chunk); privBuf = Buffer.concat(chunks); break; default: throw new Error("Unsupported kdf " + kdf); } var header, buf = new SSHBuffer({}); buf.writeCString("openssh-key-v1"), buf.writeString(cipher), buf.writeString(kdf), buf.writeBuffer(kdfopts), buf.writeInt(1), buf.writeBuffer(pubKey.toBuffer("rfc4253")), privBuf && buf.writeBuffer(privBuf), buf = buf.toBuffer(), header = PrivateKey.isPrivateKey(key) ? "OPENSSH PRIVATE KEY" : "OPENSSH PUBLIC KEY"; var tmp = buf.toString("base64"), len = tmp.length + tmp.length / 70 + 18 + 16 + 2 * header.length + 10, o = 0; o += (buf = Buffer.alloc(len)).write("-----BEGIN " + header + "-----\n", o); for (var i = 0; i < tmp.length; ) { var limit = i + 70; limit > tmp.length && (limit = tmp.length), o += buf.write(tmp.slice(i, limit), o), buf[o++] = 10, i = limit; } return o += buf.write("-----END " + header + "-----\n", o), buf.slice(0, o); } }; var bcrypt, assert = __webpack_require__(15), Buffer = (__webpack_require__(54), __webpack_require__(14).Buffer), utils = (__webpack_require__(31), __webpack_require__(28)), crypto = __webpack_require__(6), PrivateKey = (__webpack_require__(27), __webpack_require__(29)), pem = __webpack_require__(62), rfc4253 = __webpack_require__(63), SSHBuffer = __webpack_require__(112), errors = __webpack_require__(48); }, function(module, exports) { const cache = {}; function getRandom() { return (Math.random() + 1).toString(36).substring(7); } module.exports = { set: (data, createKey) => { let key = createKey || getRandom(); for (;cache[key]; ) key = getRandom(); return cache[key] = data, key; }, get: key => cache[key] || null }; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(10).Buffer; void 0 === Buffer.from && (Buffer.from = function(a, b, c) { return new Buffer(a, b, c); }, Buffer.alloc = Buffer.from), module.exports = Buffer; }, function(module, exports) { module.exports = function(st) { var type, types = [ "Directory", "File", "SymbolicLink", "Link", "BlockDevice", "CharacterDevice", "FIFO", "Socket" ]; if (st.type && -1 !== types.indexOf(st.type)) return st[st.type] = !0, st.type; for (var i = 0, l = types.length; i < l; i++) { var is = st[type = types[i]] || st["is" + type]; if ("function" == typeof is && (is = is.call(st)), is) return st[type] = !0, st.type = type, type; } return null; }; }, function(module, exports) { const cache = {}; function getRandom() { return (Math.random() + 1).toString(36).substring(7); } module.exports = { set: (data, createKey) => { let key = createKey || getRandom(); for (;cache[key]; ) key = getRandom(); return cache[key] = data, key; }, get: key => cache[key] || null }; }, function(module, exports) { const cache = {}; function getRandom() { return (Math.random() + 1).toString(36).substring(7); } module.exports = { set: (data, createKey) => { let key = createKey || getRandom(); for (;cache[key]; ) key = getRandom(); return cache[key] = data, key; }, get: key => cache[key] || null }; }, function(module, exports) { const cache = {}; function getRandom() { return (Math.random() + 1).toString(36).substring(7); } module.exports = { set: (data, createKey) => { let key = createKey || getRandom(); for (;cache[key]; ) key = getRandom(); return cache[key] = data, key; }, get: key => cache[key] || null }; }, function(module, exports, __webpack_require__) { var url = __webpack_require__(7), os = __webpack_require__(23), events = __webpack_require__(4), path = __webpack_require__(5), util = __webpack_require__(0), fs = __webpack_require__(2), fetch = __webpack_require__(34), connect = __webpack_require__(586), rangeParser = __webpack_require__(176), bodyParser = __webpack_require__(50), Router = __webpack_require__(122), mime = __webpack_require__(611), pump = __webpack_require__(179), PeerSearch = __webpack_require__(613), parseTorrentFile = __webpack_require__(302), EngineFS = new events.EventEmitter, Counter = __webpack_require__(663), GuessFileIdx = __webpack_require__(664), spoofedPeerId = __webpack_require__(665), safeStatelessRegex = __webpack_require__(80), IH_REGEX = new RegExp("([0-9A-Fa-f]){40}", "g"); EngineFS.STREAM_TIMEOUT = 3e4, EngineFS.ENGINE_TIMEOUT = 6e4; var engines = {}; function createEngine(infoHash, options, cb) { options.stream && !options.torrent && (options.torrent = options.stream), EngineFS.beforeCreateEngine(infoHash, (function() { if (!EngineFS.engine) throw new Error("EngineFS requires EngineFS.engine to point to engine constructor"); "function" == typeof options && (cb = options, options = null), cb = cb || function() {}, EngineFS.once("engine-ready:" + infoHash, (function() { cb(null, engines[infoHash]); })), (options = util._extend(EngineFS.getDefaults(infoHash), options || {})).path = options.path || EngineFS.getCachePath(infoHash), Emit([ "engine-create", infoHash, options ]); var torrent = options.torrent || "magnet:?xt=urn:btih:" + infoHash; options.id = spoofedPeerId(); var isNew = !engines[infoHash], e = engines[infoHash] = engines[infoHash] || EngineFS.engine(torrent, options); if (e.swarm.resume(), e.options = options, isNew && options.peerSearch) { var peerSources = []; peerSources = ((torrent || {}).announce || []).length ? peerSources.concat(torrent.announce).map((function(src) { return "tracker:" + src; })).concat("dht:" + infoHash) : options.peerSearch.sources, new PeerSearch(peerSources, e.swarm, options.peerSearch); } if (isNew && options.swarmCap) { var updater = updateSwarmCap.bind(null, e, options.swarmCap); e.swarm.on("wire", updater), e.swarm.on("wire-disconnect", updater), e.on("download", updater); } options.growler && e.setFloodedPulse && e.setFloodedPulse(options.growler.flood, options.growler.pulse), isNew && (e.on("error", (function(err) { EngineFS.emit("engine-error:" + infoHash, err), EngineFS.emit("engine-error", infoHash, err); })), e.on("invalid-piece", (function(p) { EngineFS.emit("engine-invalid-piece:" + infoHash, p), EngineFS.emit("engine-invalid-piece", infoHash, p); })), Emit([ "engine-created", infoHash ])), e.ready((function() { EngineFS.emit("engine-ready:" + infoHash, e.torrent), EngineFS.emit("engine-ready", infoHash, e.torrent); })); })); } function updateSwarmCap(e, opts) { var unchoked = e.swarm.wires.filter((function(peer) { return !peer.peerChoking; })).length, primaryCond = !0; opts.maxSpeed && (primaryCond = e.swarm.downloadSpeed() > opts.maxSpeed), opts.maxBuffer && (primaryCond = (function(e) { var buf = 0, n = 0, b = 0; return e.selection.forEach((function(sel) { if (sel.readFrom > 0 && sel.selectTo > 0) { var bufferPieces = sel.selectTo - sel.readFrom, prog = (sel.from + sel.offset - sel.readFrom) / bufferPieces; b += prog, n++; } })), n > 0 && (buf = b / n), buf; })(e) > opts.maxBuffer); var minPeerCond = unchoked > opts.minPeers; primaryCond && minPeerCond ? e.swarm.pause() : e.swarm.resume(); } function getSelections(infoHash) { return (engines[infoHash.toLowerCase()] || {}).selection || []; } function getEngine(infoHash) { return engines[infoHash.toLowerCase()]; } function existsEngine(infoHash) { return !!engines[infoHash.toLowerCase()]; } function removeEngine(infoHash, cb) { existsEngine(infoHash) ? engines[infoHash.toLowerCase()].destroy((function() { Emit([ "engine-destroyed", infoHash ]), delete engines[infoHash.toLowerCase()], cb && cb(); })) : cb && cb(); } function listEngines() { return Object.keys(engines); } EngineFS.getDefaults = function(ih) { return { peerSearch: { min: 40, max: 200, sources: [ "dht:" + ih ] }, dht: !1, tracker: !1 }; }, EngineFS.getCachePath = function(ih) { return path.join(os.tmpdir(), ih); }, EngineFS.beforeCreateEngine = function(hash, cb) { cb(); }; var router = Router(), externalRouter = Router(); function prewarmStream(hash, idx) { engines[hash] && engines[hash].ready((function() { engines[hash].files[idx].select(); })); } var jsonHead = { "Content-Type": "application/json" }; function handleTorrent(req, res, next) { var u = url.parse(req.url, !0), trackers = u.query.tr && [].concat(u.query.tr), fileMustInclude = u.query.f && [].concat(u.query.f), isRegex = /^\/(.*)\/(.*)$/; fileMustInclude = (fileMustInclude || []).map((function(el) { if ((el || "").match(isRegex)) { var parts = isRegex.exec(el); try { return new RegExp(parts[1], parts[2]); } catch (e) {} } return el; })), (function(path, trackers, fileMustInclude, cb) { var parts = path.split("/").filter((function(x) { return x; })); if (parts[0] && parts[0].match(IH_REGEX)) { var infoHash = parts[0].toLowerCase(), i = Number(parts[1] || -1), opts = {}; if (trackers) { const defaults = EngineFS.getDefaults(infoHash); opts.peerSearch = { min: defaults.peerSearch.min, max: defaults.peerSearch.max, sources: trackers }; } createEngine(infoHash, opts, (function(err, engine) { if (err) return cb(err); if ((fileMustInclude || []).length && engine.files.find((function(file, idx) { return !!fileMustInclude.find((function(reg) { return reg = "string" == typeof reg ? new RegExp(reg) : reg, !!safeStatelessRegex(file.name, reg, 500) && (i = idx, !0); })); })), isNaN(i)) { var name = decodeURIComponent(parts[1]); if (engine.files.some((function(file, idx) { if (name === file.name) return i = idx, !0; })), isNaN(i)) return cb(new Error("Cannot parse path: info hash received, but invalid file index or file name")); } else if (-1 === i) { var engineStats = getStatistics(engine); engineStats.files && (i = GuessFileIdx(engineStats.files, {})); } if (!engine.files[i]) return cb(new Error("Torrent does not contain file with index " + i)); cb(null, engine.files[i], engine); })); } else { if (parts[0] && 64 == parts[0].length) return cb(new Error("Not implemented yet")); cb(new Error("Cannot parse path")); } })(u.pathname, trackers, fileMustInclude, (function(err, handle, e) { if (err) return console.error(err), res.statusCode = 500, res.end(); if (u.query.external) return res.statusCode = 307, res.setHeader("Location", "/" + e.infoHash + "/" + encodeURIComponent(handle.name) + (u.query.download ? "?download=1" : "")), res.end(); EngineFS.emit("stream-open", e.infoHash, e.files.indexOf(handle)); var closed = !1, emitClose = function() { closed || (closed = !0, EngineFS.emit("stream-close", e.infoHash, e.files.indexOf(handle))); }; res.on("finish", emitClose), res.on("close", emitClose), req.connection.setTimeout(864e5); var range = req.headers.range; range && range.endsWith("-") && (EngineFS.getDefaults(e.infoHash).circularBuffer || prewarmStream(e.infoHash, e.files.indexOf(handle))), range = range && rangeParser(handle.length, range)[0], res.setHeader("Accept-Ranges", "bytes"), res.setHeader("Content-Type", mime.lookup(handle.name)), res.setHeader("Cache-Control", "max-age=0, no-cache"), u.query.download && res.setHeader("Content-Disposition", 'attachment; filename="' + handle.name + '";'), u.query.subtitles && res.setHeader("CaptionInfo.sec", u.query.subtitles); var opts = {}; return req.headers["enginefs-prio"] && (opts.priority = parseInt(req.headers["enginefs-prio"]) || 1), range ? (res.statusCode = 206, res.setHeader("Content-Length", range.end - range.start + 1), res.setHeader("Content-Range", "bytes " + range.start + "-" + range.end + "/" + handle.length), "HEAD" === req.method ? res.end() : void pump(handle.createReadStream(util._extend(range, opts)), res)) : (res.setHeader("Content-Length", handle.length), "HEAD" === req.method ? res.end() : void pump(handle.createReadStream(opts), res)); })); } function createApp() { var app = connect(); return app.use((function(req, res, next) { util._extend(req, url.parse(req.url, !0)), EngineFS.loggingEnabled && console.log("-> " + req.method + " " + url.parse(req.url).path + " " + (req.headers.range || "")), next(); })), app.use(bodyParser.json({ limit: "3mb" })), app.use(bodyParser.urlencoded({ extended: !0 })), app.use(externalRouter), app.use(router), app; } function sendCORSHeaders(req, res, next) { if ("OPTIONS" === req.method && req.headers.origin) return res.setHeader("Access-Control-Allow-Origin", "*"), res.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS"), res.setHeader("Access-Control-Allow-Headers", req.headers["access-control-request-headers"] || "Range"), res.setHeader("Access-Control-Max-Age", "1728000"), res.end(), !0; req.headers.origin && res.setHeader("Access-Control-Allow-Origin", "*"), next && next(); } function sendDLNAHeaders(req, res, next) { res.setHeader("transferMode.dlna.org", "Streaming"), res.setHeader("contentFeatures.dlna.org", "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000"), next && next(); } function getStatistics(e, idx) { if (!e) return null; var s = { infoHash: e.infoHash, name: e.torrent && e.torrent.name, peers: e.swarm.wires.length, unchoked: e.swarm.wires.filter((function(peer) { return !peer.peerChoking; })).length, queued: e.swarm.queued, unique: Object.keys(e.swarm._peers).length, connectionTries: e.swarm.tries, swarmPaused: e.swarm.paused, swarmConnections: e.swarm.connections.length, swarmSize: e.swarm.size, selections: e.selection, wires: void 0 !== idx ? null : e.swarm.wires.filter((function(peer) { return !peer.peerChoking; })).map((function(wire) { return { requests: wire.requests.length, address: wire.peerAddress, amInterested: wire.amInterested, isSeeder: wire.isSeeder, downSpeed: wire.downloadSpeed(), upSpeed: wire.uploadSpeed() }; })), files: e.torrent && e.torrent.files, downloaded: e.swarm.downloaded, uploaded: e.swarm.uploaded, downloadSpeed: e.swarm.downloadSpeed(), uploadSpeed: e.swarm.downloadSpeed(), sources: e.swarm.peerSearch && e.swarm.peerSearch.stats(), peerSearchRunning: e.swarm.peerSearch ? e.swarm.peerSearch.isRunning() : void 0, opts: e.options }; return !isNaN(idx) && e.torrent && e.torrent.files[idx] && util._extend(s, (function(e, file) { var stats = {}; stats.streamLen = file.length, stats.streamName = file.name; for (var startPiece = file.offset / e.torrent.pieceLength | 0, endPiece = (file.offset + file.length - 1) / e.torrent.pieceLength | 0, availablePieces = 0, i = startPiece; i <= endPiece; i++) e.bitfield.get(i) && availablePieces++; var filePieces = Math.ceil(file.length / e.torrent.pieceLength); return stats.streamProgress = availablePieces / filePieces, stats; })(e, e.torrent.files[idx])), s; } function Emit(args) { EngineFS.emit.apply(EngineFS, args), EngineFS.emit(args.join(":")); } router.use(sendCORSHeaders), router.get("/favicon.ico", (function(req, res) { res.writeHead(404, jsonHead), res.end(); })), router.get("/:infoHash/stats.json", (function(req, res) { res.writeHead(200, jsonHead), res.end(JSON.stringify(getStatistics(engines[req.params.infoHash]))); })), router.get("/:infoHash/:idx/stats.json", (function(req, res) { res.writeHead(200, jsonHead), res.end(JSON.stringify(getStatistics(engines[req.params.infoHash], req.params.idx))); })), router.get("/stats.json", (function(req, res) { res.writeHead(200, jsonHead); var stats = {}; for (ih in req.url.match("sys=1") && (stats.sys = { loadavg: os.loadavg(), cpus: os.cpus() }), engines) stats[ih] = getStatistics(engines[ih]); res.end(JSON.stringify(stats)); })), router.all("/:infoHash/create", (function(req, res) { var ih = req.params.infoHash.toLowerCase(), body = req.body || {}; createEngine(ih, body, (function() { res.writeHead(200, jsonHead); var engineStats = getStatistics(engines[ih]); if (engineStats.files) { if ((body.fileMustInclude || []).length) { var isRegex = /^\/(.*)\/(.*)$/; fileMustInclude = body.fileMustInclude.map((function(el) { if ((el || "").match(isRegex)) { var parts = isRegex.exec(el); try { return new RegExp(parts[1], parts[2]); } catch (e) {} } return el; })), engineStats.files.find((function(file, idx) { return !!fileMustInclude.find((function(reg) { return reg = "string" == typeof reg ? new RegExp(reg) : reg, !!safeStatelessRegex(file.name, reg, 500) && (engineStats.guessedFileIdx = idx, !0); })); })); } body.guessFileIdx && !engineStats.hasOwnProperty("guessedFileIdx") && (engineStats.guessedFileIdx = GuessFileIdx(engineStats.files, body.guessFileIdx)); } res.end(JSON.stringify(engineStats)); })); })), router.all("/create", (function(req, res) { var from = req.body.from, blob = req.body.blob; if ("string" == typeof blob) onBlob(null, Buffer.from(blob, "hex")); else { if ("string" != typeof from) return onErr(); 0 === from.indexOf("http") ? fetch(from).then((function(res) { return res.buffer(); })).then((function(buf) { onBlob(null, buf); })).catch(onErr) : fs.readFile(req.body.from, onBlob); } function onBlob(err, blob) { if (err) return onErr(err); var ih = null, parsed = null; try { ih = (parsed = parseTorrentFile(blob)).infoHash.toLowerCase(); } catch (e) { return onErr(e); } createEngine(ih, { torrent: parsed }, (function(err, res) { err ? onErr(err) : onSuccess(res); })); } function onErr(err) { res.writeHead(500), res.end(), console.error(err); } function onSuccess(result) { res.writeHead(200, jsonHead), res.end(JSON.stringify(getStatistics(result))); } })), router.get("/:infoHash/remove", (function(req, res) { removeEngine(req.params.infoHash, (function() { res.writeHead(200, jsonHead), res.end(JSON.stringify({})); })); })), router.get("/removeAll", (function(req, res) { for (ih in engines) removeEngine(ih); res.writeHead(200, jsonHead), res.end(JSON.stringify({})); })), router.get("/:infoHash/:idx", sendDLNAHeaders, handleTorrent), router.get("/:infoHash/:idx/*", sendDLNAHeaders, handleTorrent), EngineFS.on("stream-open", (function(infoHash, fileIndex) { var e = getEngine(infoHash); e.ready((function() { var file = e.torrent.files[fileIndex]; if (!file.__cacheEvents) { file.__cacheEvents = !0, EngineFS.emit("stream-created", infoHash, fileIndex, file); for (var startPiece = file.offset / e.torrent.pieceLength | 0, endPiece = (file.offset + file.length - 1) / e.torrent.pieceLength | 0, fpieces = [], i = startPiece; i <= endPiece; i++) e.bitfield.get(i) || fpieces.push(i); var filePieces = Math.ceil(file.length / e.torrent.pieceLength), onDownload = function(p) { if (void 0 !== p) { var idx = fpieces.indexOf(p); if (-1 == idx) return; fpieces.splice(idx, 1); } if (EngineFS.emit("stream-progress:" + infoHash + ":" + fileIndex, (filePieces - fpieces.length) / filePieces, fpath), !fpieces.length) { var fpath = e.store.getDest && e.store.getDest(fileIndex); EngineFS.emit("stream-cached:" + infoHash + ":" + fileIndex, fpath, file), EngineFS.emit("stream-cached", infoHash, fileIndex, fpath, file), e.removeListener("download", onDownload), e.removeListener("verify", onDownload); } }; e.on("verify", onDownload), onDownload(); var vLen = e.torrent.realPieceLength || e.torrent.verificationLen || e.torrent.pieceLength, ratio = (startPiece = file.offset / vLen | 0, endPiece = (file.offset + file.length - 1) / vLen | 0, vLen / e.torrent.pieceLength); e.buffer || e.select(startPiece * ratio, (endPiece + 1) * ratio, !1); } })); })), new Counter(EngineFS, "stream-open", "stream-close", (function(hash, idx) { return hash + ":" + idx; }), (function(hash, idx) { Emit([ "stream-active", hash, idx ]); }), (function(hash, idx) { existsEngine(hash) && Emit([ "stream-inactive", hash, idx ]); }), (function() { return EngineFS.STREAM_TIMEOUT; })), new Counter(EngineFS, "stream-open", "stream-close", (function(hash, idx) { return hash; }), (function(hash) { Emit([ "engine-active", hash ]); }), (function(hash) { existsEngine(hash) && Emit([ "engine-inactive", hash ]); }), (function() { return EngineFS.ENGINE_TIMEOUT; })), new Counter(EngineFS, "stream-created", "stream-cached", (function(hash, idx) { return hash; }), (function() {}), (function(hash) { existsEngine(hash) && Emit([ "engine-idle", hash ]); }), (function() { return EngineFS.STREAM_TIMEOUT; })), EngineFS.http = function(port) { var server = __webpack_require__(11).createServer(createApp()); return port && server.listen(port), server; }, EngineFS.app = createApp, EngineFS.sendCORSHeaders = sendCORSHeaders, EngineFS.sendDLNAHeaders = sendDLNAHeaders, EngineFS.create = createEngine, EngineFS.exists = existsEngine, EngineFS.getFilename = function(infoHash, fileIdx) { return !!existsEngine(infoHash) && (getEngine(infoHash).files[fileIdx] || {}).name; }, EngineFS.remove = removeEngine, EngineFS.settings = function(infoHash, settings) { var e = engines[infoHash]; e && (settings.hasOwnProperty("writeQueue") && e.store.writequeue && e.ready((function() { "PAUSE" == settings.writeQueue ? (e.store.writequeue.pause(), setTimeout((function() { e.store.writequeue.resume(); }), 5e4)) : e.store.writequeue.resume(); })), "PAUSE" == settings.swarm && e.swarm.pause(), "RESUME" == settings.swarm && e.swarm.resume()); }, EngineFS.stats = function(infoHash, idx) { return engines[infoHash] ? getStatistics(engines[infoHash], idx) : null; }, EngineFS.list = listEngines, EngineFS.getSelections = getSelections, EngineFS.keepConcurrency = function(hash, concurrency) { const enginesCount = listEngines().length + 1; if (!concurrency || enginesCount <= concurrency) return Promise.resolve(); console.log("keep concurrency", concurrency); const enginesToRemove = listEngines().filter((ih => ih.toLowerCase() !== hash.toLowerCase() && 0 === getSelections(ih).length)).slice(0, enginesCount - concurrency); return enginesToRemove.length ? new Promise((resolve => { enginesToRemove.forEach(((ih, idx) => { console.log(`remove engine ${ih}`), removeEngine(ih, (() => { idx === enginesToRemove.length - 1 && resolve(); })); })); })) : Promise.resolve(); }, EngineFS.prewarmStream = prewarmStream, EngineFS.router = externalRouter, EngineFS.loggingEnabled = !1, EngineFS.getRootRouter = function() { return router; }, module.exports = EngineFS; }, function(module, exports) { module.exports = require("string_decoder"); }, function(module) { module.exports = [ [ "0", "\0", 127, "€" ], [ "8140", "丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪", 5, "乲乴", 9, "乿", 6, "亇亊" ], [ "8180", "亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂", 6, "伋伌伒", 4, "伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾", 4, "佄佅佇", 5, "佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢" ], [ "8240", "侤侫侭侰", 4, "侶", 8, "俀俁係俆俇俈俉俋俌俍俒", 4, "俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿", 11 ], [ "8280", "個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯", 10, "倻倽倿偀偁偂偄偅偆偉偊偋偍偐", 4, "偖偗偘偙偛偝", 7, "偦", 5, "偭", 8, "偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎", 20, "傤傦傪傫傭", 4, "傳", 6, "傼" ], [ "8340", "傽", 17, "僐", 5, "僗僘僙僛", 10, "僨僩僪僫僯僰僱僲僴僶", 4, "僼", 9, "儈" ], [ "8380", "儉儊儌", 5, "儓", 13, "儢", 28, "兂兇兊兌兎兏児兒兓兗兘兙兛兝", 4, "兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦", 4, "冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒", 5 ], [ "8440", "凘凙凚凜凞凟凢凣凥", 5, "凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄", 5, "剋剎剏剒剓剕剗剘" ], [ "8480", "剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳", 9, "剾劀劃", 4, "劉", 6, "劑劒劔", 6, "劜劤劥劦劧劮劯劰労", 9, "勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務", 5, "勠勡勢勣勥", 10, "勱", 7, "勻勼勽匁匂匃匄匇匉匊匋匌匎" ], [ "8540", "匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯", 9, "匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏" ], [ "8580", "厐", 4, "厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯", 6, "厷厸厹厺厼厽厾叀參", 4, "収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝", 4, "呣呥呧呩", 7, "呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡" ], [ "8640", "咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠", 4, "哫哬哯哰哱哴", 5, "哻哾唀唂唃唄唅唈唊", 4, "唒唓唕", 5, "唜唝唞唟唡唥唦" ], [ "8680", "唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋", 4, "啑啒啓啔啗", 4, "啝啞啟啠啢啣啨啩啫啯", 5, "啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠", 6, "喨", 8, "喲喴営喸喺喼喿", 4, "嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗", 4, "嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸", 4, "嗿嘂嘃嘄嘅" ], [ "8740", "嘆嘇嘊嘋嘍嘐", 7, "嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀", 11, "噏", 4, "噕噖噚噛噝", 4 ], [ "8780", "噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽", 7, "嚇", 6, "嚐嚑嚒嚔", 14, "嚤", 10, "嚰", 6, "嚸嚹嚺嚻嚽", 12, "囋", 8, "囕囖囘囙囜団囥", 5, "囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國", 6 ], [ "8840", "園", 9, "圝圞圠圡圢圤圥圦圧圫圱圲圴", 4, "圼圽圿坁坃坄坅坆坈坉坋坒", 4, "坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀" ], [ "8880", "垁垇垈垉垊垍", 4, "垔", 6, "垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹", 8, "埄", 6, "埌埍埐埑埓埖埗埛埜埞埡埢埣埥", 7, "埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥", 4, "堫", 4, "報堲堳場堶", 7 ], [ "8940", "堾", 5, "塅", 6, "塎塏塐塒塓塕塖塗塙", 4, "塟", 5, "塦", 4, "塭", 16, "塿墂墄墆墇墈墊墋墌" ], [ "8980", "墍", 4, "墔", 4, "墛墜墝墠", 7, "墪", 17, "墽墾墿壀壂壃壄壆", 10, "壒壓壔壖", 13, "壥", 5, "壭壯壱売壴壵壷壸壺", 7, "夃夅夆夈", 4, "夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻" ], [ "8a40", "夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛", 4, "奡奣奤奦", 12, "奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦" ], [ "8a80", "妧妬妭妰妱妳", 5, "妺妼妽妿", 6, "姇姈姉姌姍姎姏姕姖姙姛姞", 4, "姤姦姧姩姪姫姭", 11, "姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪", 6, "娳娵娷", 4, "娽娾娿婁", 4, "婇婈婋", 9, "婖婗婘婙婛", 5 ], [ "8b40", "婡婣婤婥婦婨婩婫", 8, "婸婹婻婼婽婾媀", 17, "媓", 6, "媜", 13, "媫媬" ], [ "8b80", "媭", 4, "媴媶媷媹", 4, "媿嫀嫃", 5, "嫊嫋嫍", 4, "嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬", 4, "嫲", 22, "嬊", 11, "嬘", 25, "嬳嬵嬶嬸", 7, "孁", 6 ], [ "8c40", "孈", 7, "孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏" ], [ "8c80", "寑寔", 8, "寠寢寣實寧審", 4, "寯寱", 6, "寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧", 6, "屰屲", 6, "屻屼屽屾岀岃", 4, "岉岊岋岎岏岒岓岕岝", 4, "岤", 4 ], [ "8d40", "岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅", 5, "峌", 5, "峓", 5, "峚", 6, "峢峣峧峩峫峬峮峯峱", 9, "峼", 4 ], [ "8d80", "崁崄崅崈", 5, "崏", 4, "崕崗崘崙崚崜崝崟", 4, "崥崨崪崫崬崯", 4, "崵", 7, "崿", 7, "嵈嵉嵍", 10, "嵙嵚嵜嵞", 10, "嵪嵭嵮嵰嵱嵲嵳嵵", 12, "嶃", 21, "嶚嶛嶜嶞嶟嶠" ], [ "8e40", "嶡", 21, "嶸", 12, "巆", 6, "巎", 12, "巜巟巠巣巤巪巬巭" ], [ "8e80", "巰巵巶巸", 4, "巿帀帄帇帉帊帋帍帎帒帓帗帞", 7, "帨", 4, "帯帰帲", 4, "帹帺帾帿幀幁幃幆", 5, "幍", 6, "幖", 4, "幜幝幟幠幣", 14, "幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨", 4, "庮", 4, "庴庺庻庼庽庿", 6 ], [ "8f40", "廆廇廈廋", 5, "廔廕廗廘廙廚廜", 11, "廩廫", 8, "廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤" ], [ "8f80", "弨弫弬弮弰弲", 6, "弻弽弾弿彁", 14, "彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢", 5, "復徫徬徯", 5, "徶徸徹徺徻徾", 4, "忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇" ], [ "9040", "怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰", 4, "怶", 4, "怽怾恀恄", 6, "恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀" ], [ "9080", "悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽", 7, "惇惈惉惌", 4, "惒惓惔惖惗惙惛惞惡", 4, "惪惱惲惵惷惸惻", 4, "愂愃愄愅愇愊愋愌愐", 4, "愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬", 18, "慀", 6 ], [ "9140", "慇慉態慍慏慐慒慓慔慖", 6, "慞慟慠慡慣慤慥慦慩", 6, "慱慲慳慴慶慸", 18, "憌憍憏", 4, "憕" ], [ "9180", "憖", 6, "憞", 8, "憪憫憭", 9, "憸", 5, "憿懀懁懃", 4, "應懌", 4, "懓懕", 16, "懧", 13, "懶", 8, "戀", 5, "戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸", 4, "扂扄扅扆扊" ], [ "9240", "扏扐払扖扗扙扚扜", 6, "扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋", 5, "抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁" ], [ "9280", "拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳", 5, "挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖", 7, "捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙", 6, "採掤掦掫掯掱掲掵掶掹掻掽掿揀" ], [ "9340", "揁揂揃揅揇揈揊揋揌揑揓揔揕揗", 6, "揟揢揤", 4, "揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆", 4, "損搎搑搒搕", 5, "搝搟搢搣搤" ], [ "9380", "搥搧搨搩搫搮", 5, "搵", 4, "搻搼搾摀摂摃摉摋", 6, "摓摕摖摗摙", 4, "摟", 7, "摨摪摫摬摮", 9, "摻", 6, "撃撆撈", 8, "撓撔撗撘撚撛撜撝撟", 4, "撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆", 6, "擏擑擓擔擕擖擙據" ], [ "9440", "擛擜擝擟擠擡擣擥擧", 24, "攁", 7, "攊", 7, "攓", 4, "攙", 8 ], [ "9480", "攢攣攤攦", 4, "攬攭攰攱攲攳攷攺攼攽敀", 4, "敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數", 14, "斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱", 7, "斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘", 7, "旡旣旤旪旫" ], [ "9540", "旲旳旴旵旸旹旻", 4, "昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷", 4, "昽昿晀時晄", 6, "晍晎晐晑晘" ], [ "9580", "晙晛晜晝晞晠晢晣晥晧晩", 4, "晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘", 4, "暞", 8, "暩", 4, "暯", 4, "暵暶暷暸暺暻暼暽暿", 25, "曚曞", 7, "曧曨曪", 5, "曱曵曶書曺曻曽朁朂會" ], [ "9640", "朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠", 5, "朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗", 4, "杝杢杣杤杦杧杫杬杮東杴杶" ], [ "9680", "杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹", 7, "柂柅", 9, "柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵", 7, "柾栁栂栃栄栆栍栐栒栔栕栘", 4, "栞栟栠栢", 6, "栫", 6, "栴栵栶栺栻栿桇桋桍桏桒桖", 5 ], [ "9740", "桜桝桞桟桪桬", 7, "桵桸", 8, "梂梄梇", 7, "梐梑梒梔梕梖梘", 9, "梣梤梥梩梪梫梬梮梱梲梴梶梷梸" ], [ "9780", "梹", 6, "棁棃", 5, "棊棌棎棏棐棑棓棔棖棗棙棛", 4, "棡棢棤", 9, "棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆", 4, "椌椏椑椓", 11, "椡椢椣椥", 7, "椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃", 16, "楕楖楘楙楛楜楟" ], [ "9840", "楡楢楤楥楧楨楩楪楬業楯楰楲", 4, "楺楻楽楾楿榁榃榅榊榋榌榎", 5, "榖榗榙榚榝", 9, "榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽" ], [ "9880", "榾榿槀槂", 7, "構槍槏槑槒槓槕", 5, "槜槝槞槡", 11, "槮槯槰槱槳", 9, "槾樀", 9, "樋", 11, "標", 5, "樠樢", 5, "権樫樬樭樮樰樲樳樴樶", 6, "樿", 4, "橅橆橈", 7, "橑", 6, "橚" ], [ "9940", "橜", 4, "橢橣橤橦", 10, "橲", 6, "橺橻橽橾橿檁檂檃檅", 8, "檏檒", 4, "檘", 7, "檡", 5 ], [ "9980", "檧檨檪檭", 114, "欥欦欨", 6 ], [ "9a40", "欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍", 11, "歚", 7, "歨歩歫", 13, "歺歽歾歿殀殅殈" ], [ "9a80", "殌殎殏殐殑殔殕殗殘殙殜", 4, "殢", 7, "殫", 7, "殶殸", 6, "毀毃毄毆", 4, "毌毎毐毑毘毚毜", 4, "毢", 7, "毬毭毮毰毱毲毴毶毷毸毺毻毼毾", 6, "氈", 4, "氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋", 4, "汑汒汓汖汘" ], [ "9b40", "汙汚汢汣汥汦汧汫", 4, "汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘" ], [ "9b80", "泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟", 5, "洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽", 4, "涃涄涆涇涊涋涍涏涐涒涖", 4, "涜涢涥涬涭涰涱涳涴涶涷涹", 5, "淁淂淃淈淉淊" ], [ "9c40", "淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽", 7, "渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵" ], [ "9c80", "渶渷渹渻", 7, "湅", 7, "湏湐湑湒湕湗湙湚湜湝湞湠", 10, "湬湭湯", 14, "満溁溂溄溇溈溊", 4, "溑", 6, "溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪", 5 ], [ "9d40", "滰滱滲滳滵滶滷滸滺", 7, "漃漄漅漇漈漊", 4, "漐漑漒漖", 9, "漡漢漣漥漦漧漨漬漮漰漲漴漵漷", 6, "漿潀潁潂" ], [ "9d80", "潃潄潅潈潉潊潌潎", 9, "潙潚潛潝潟潠潡潣潤潥潧", 5, "潯潰潱潳潵潶潷潹潻潽", 6, "澅澆澇澊澋澏", 12, "澝澞澟澠澢", 4, "澨", 10, "澴澵澷澸澺", 5, "濁濃", 5, "濊", 6, "濓", 10, "濟濢濣濤濥" ], [ "9e40", "濦", 7, "濰", 32, "瀒", 7, "瀜", 6, "瀤", 6 ], [ "9e80", "瀫", 9, "瀶瀷瀸瀺", 17, "灍灎灐", 13, "灟", 11, "灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞", 12, "炰炲炴炵炶為炾炿烄烅烆烇烉烋", 12, "烚" ], [ "9f40", "烜烝烞烠烡烢烣烥烪烮烰", 6, "烸烺烻烼烾", 10, "焋", 4, "焑焒焔焗焛", 10, "焧", 7, "焲焳焴" ], [ "9f80", "焵焷", 13, "煆煇煈煉煋煍煏", 12, "煝煟", 4, "煥煩", 4, "煯煰煱煴煵煶煷煹煻煼煾", 5, "熅", 4, "熋熌熍熎熐熑熒熓熕熖熗熚", 4, "熡", 6, "熩熪熫熭", 5, "熴熶熷熸熺", 8, "燄", 9, "燏", 4 ], [ "a040", "燖", 9, "燡燢燣燤燦燨", 5, "燯", 9, "燺", 11, "爇", 19 ], [ "a080", "爛爜爞", 9, "爩爫爭爮爯爲爳爴爺爼爾牀", 6, "牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅", 4, "犌犎犐犑犓", 11, "犠", 11, "犮犱犲犳犵犺", 6, "狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛" ], [ "a1a1", " 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈", 7, "〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓" ], [ "a2a1", "ⅰ", 9 ], [ "a2b1", "⒈", 19, "⑴", 19, "①", 9 ], [ "a2e5", "㈠", 9 ], [ "a2f1", "Ⅰ", 11 ], [ "a3a1", "!"#¥%", 88, " ̄" ], [ "a4a1", "ぁ", 82 ], [ "a5a1", "ァ", 85 ], [ "a6a1", "Α", 16, "Σ", 6 ], [ "a6c1", "α", 16, "σ", 6 ], [ "a6e0", "︵︶︹︺︿﹀︽︾﹁﹂﹃﹄" ], [ "a6ee", "︻︼︷︸︱" ], [ "a6f4", "︳︴" ], [ "a7a1", "А", 5, "ЁЖ", 25 ], [ "a7d1", "а", 5, "ёж", 25 ], [ "a840", "ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═", 35, "▁", 6 ], [ "a880", "█", 7, "▓▔▕▼▽◢◣◤◥☉⊕〒〝〞" ], [ "a8a1", "āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ" ], [ "a8bd", "ńň" ], [ "a8c0", "ɡ" ], [ "a8c5", "ㄅ", 36 ], [ "a940", "〡", 8, "㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦" ], [ "a959", "℡㈱" ], [ "a95c", "‐" ], [ "a960", "ー゛゜ヽヾ〆ゝゞ﹉", 9, "﹔﹕﹖﹗﹙", 8 ], [ "a980", "﹢", 4, "﹨﹩﹪﹫" ], [ "a996", "〇" ], [ "a9a4", "─", 75 ], [ "aa40", "狜狝狟狢", 5, "狪狫狵狶狹狽狾狿猀猂猄", 5, "猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀", 8 ], [ "aa80", "獉獊獋獌獎獏獑獓獔獕獖獘", 7, "獡", 10, "獮獰獱" ], [ "ab40", "獲", 11, "獿", 4, "玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣", 5, "玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃", 4 ], [ "ab80", "珋珌珎珒", 6, "珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳", 4 ], [ "ac40", "珸", 10, "琄琇琈琋琌琍琎琑", 8, "琜", 5, "琣琤琧琩琫琭琯琱琲琷", 4, "琽琾琿瑀瑂", 11 ], [ "ac80", "瑎", 6, "瑖瑘瑝瑠", 12, "瑮瑯瑱", 4, "瑸瑹瑺" ], [ "ad40", "瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑", 10, "璝璟", 7, "璪", 15, "璻", 12 ], [ "ad80", "瓈", 9, "瓓", 8, "瓝瓟瓡瓥瓧", 6, "瓰瓱瓲" ], [ "ae40", "瓳瓵瓸", 6, "甀甁甂甃甅", 7, "甎甐甒甔甕甖甗甛甝甞甠", 4, "甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘" ], [ "ae80", "畝", 7, "畧畨畩畫", 6, "畳畵當畷畺", 4, "疀疁疂疄疅疇" ], [ "af40", "疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦", 4, "疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇" ], [ "af80", "瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄" ], [ "b040", "癅", 6, "癎", 5, "癕癗", 4, "癝癟癠癡癢癤", 6, "癬癭癮癰", 7, "癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛" ], [ "b080", "皜", 7, "皥", 8, "皯皰皳皵", 9, "盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥" ], [ "b140", "盄盇盉盋盌盓盕盙盚盜盝盞盠", 4, "盦", 7, "盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎", 10, "眛眜眝眞眡眣眤眥眧眪眫" ], [ "b180", "眬眮眰", 4, "眹眻眽眾眿睂睄睅睆睈", 7, "睒", 7, "睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳" ], [ "b240", "睝睞睟睠睤睧睩睪睭", 11, "睺睻睼瞁瞂瞃瞆", 5, "瞏瞐瞓", 11, "瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶", 4 ], [ "b280", "瞼瞾矀", 12, "矎", 8, "矘矙矚矝", 4, "矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖" ], [ "b340", "矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃", 5, "砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚" ], [ "b380", "硛硜硞", 11, "硯", 7, "硸硹硺硻硽", 6, "场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚" ], [ "b440", "碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨", 7, "碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚", 9 ], [ "b480", "磤磥磦磧磩磪磫磭", 4, "磳磵磶磸磹磻", 5, "礂礃礄礆", 6, "础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮" ], [ "b540", "礍", 5, "礔", 9, "礟", 4, "礥", 14, "礵", 4, "礽礿祂祃祄祅祇祊", 8, "祔祕祘祙祡祣" ], [ "b580", "祤祦祩祪祫祬祮祰", 6, "祹祻", 4, "禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠" ], [ "b640", "禓", 6, "禛", 11, "禨", 10, "禴", 4, "禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙", 5, "秠秡秢秥秨秪" ], [ "b680", "秬秮秱", 6, "秹秺秼秾秿稁稄稅稇稈稉稊稌稏", 4, "稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二" ], [ "b740", "稝稟稡稢稤", 14, "稴稵稶稸稺稾穀", 5, "穇", 9, "穒", 4, "穘", 16 ], [ "b780", "穩", 6, "穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服" ], [ "b840", "窣窤窧窩窪窫窮", 4, "窴", 10, "竀", 10, "竌", 9, "竗竘竚竛竜竝竡竢竤竧", 5, "竮竰竱竲竳" ], [ "b880", "竴", 4, "竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹" ], [ "b940", "笯笰笲笴笵笶笷笹笻笽笿", 5, "筆筈筊筍筎筓筕筗筙筜筞筟筡筣", 10, "筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆", 6, "箎箏" ], [ "b980", "箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹", 7, "篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈" ], [ "ba40", "篅篈築篊篋篍篎篏篐篒篔", 4, "篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲", 4, "篸篹篺篻篽篿", 7, "簈簉簊簍簎簐", 5, "簗簘簙" ], [ "ba80", "簚", 4, "簠", 5, "簨簩簫", 12, "簹", 5, "籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖" ], [ "bb40", "籃", 9, "籎", 36, "籵", 5, "籾", 9 ], [ "bb80", "粈粊", 6, "粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴", 4, "粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕" ], [ "bc40", "粿糀糂糃糄糆糉糋糎", 6, "糘糚糛糝糞糡", 6, "糩", 5, "糰", 7, "糹糺糼", 13, "紋", 5 ], [ "bc80", "紑", 14, "紡紣紤紥紦紨紩紪紬紭紮細", 6, "肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件" ], [ "bd40", "紷", 54, "絯", 7 ], [ "bd80", "絸", 32, "健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸" ], [ "be40", "継", 12, "綧", 6, "綯", 42 ], [ "be80", "線", 32, "尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻" ], [ "bf40", "緻", 62 ], [ "bf80", "縺縼", 4, "繂", 4, "繈", 21, "俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀" ], [ "c040", "繞", 35, "纃", 23, "纜纝纞" ], [ "c080", "纮纴纻纼绖绤绬绹缊缐缞缷缹缻", 6, "罃罆", 9, "罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐" ], [ "c140", "罖罙罛罜罝罞罠罣", 4, "罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂", 7, "羋羍羏", 4, "羕", 4, "羛羜羠羢羣羥羦羨", 6, "羱" ], [ "c180", "羳", 4, "羺羻羾翀翂翃翄翆翇翈翉翋翍翏", 4, "翖翗翙", 5, "翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿" ], [ "c240", "翤翧翨翪翫翬翭翯翲翴", 6, "翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫", 5, "耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗" ], [ "c280", "聙聛", 13, "聫", 5, "聲", 11, "隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫" ], [ "c340", "聾肁肂肅肈肊肍", 5, "肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇", 4, "胏", 6, "胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋" ], [ "c380", "脌脕脗脙脛脜脝脟", 12, "脭脮脰脳脴脵脷脹", 4, "脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸" ], [ "c440", "腀", 5, "腇腉腍腎腏腒腖腗腘腛", 4, "腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃", 4, "膉膋膌膍膎膐膒", 5, "膙膚膞", 4, "膤膥" ], [ "c480", "膧膩膫", 7, "膴", 5, "膼膽膾膿臄臅臇臈臉臋臍", 6, "摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁" ], [ "c540", "臔", 14, "臤臥臦臨臩臫臮", 4, "臵", 5, "臽臿舃與", 4, "舎舏舑舓舕", 5, "舝舠舤舥舦舧舩舮舲舺舼舽舿" ], [ "c580", "艀艁艂艃艅艆艈艊艌艍艎艐", 7, "艙艛艜艝艞艠", 7, "艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗" ], [ "c640", "艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸" ], [ "c680", "苺苼", 4, "茊茋茍茐茒茓茖茘茙茝", 9, "茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐" ], [ "c740", "茾茿荁荂荄荅荈荊", 4, "荓荕", 4, "荝荢荰", 6, "荹荺荾", 6, "莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡", 6, "莬莭莮" ], [ "c780", "莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠" ], [ "c840", "菮華菳", 4, "菺菻菼菾菿萀萂萅萇萈萉萊萐萒", 5, "萙萚萛萞", 5, "萩", 7, "萲", 5, "萹萺萻萾", 7, "葇葈葉" ], [ "c880", "葊", 6, "葒", 4, "葘葝葞葟葠葢葤", 4, "葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁" ], [ "c940", "葽", 4, "蒃蒄蒅蒆蒊蒍蒏", 7, "蒘蒚蒛蒝蒞蒟蒠蒢", 12, "蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗" ], [ "c980", "蓘", 4, "蓞蓡蓢蓤蓧", 4, "蓭蓮蓯蓱", 10, "蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳" ], [ "ca40", "蔃", 8, "蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢", 8, "蔭", 9, "蔾", 4, "蕄蕅蕆蕇蕋", 10 ], [ "ca80", "蕗蕘蕚蕛蕜蕝蕟", 4, "蕥蕦蕧蕩", 8, "蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱" ], [ "cb40", "薂薃薆薈", 6, "薐", 10, "薝", 6, "薥薦薧薩薫薬薭薱", 5, "薸薺", 6, "藂", 6, "藊", 4, "藑藒" ], [ "cb80", "藔藖", 5, "藝", 6, "藥藦藧藨藪", 14, "恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔" ], [ "cc40", "藹藺藼藽藾蘀", 4, "蘆", 10, "蘒蘓蘔蘕蘗", 15, "蘨蘪", 13, "蘹蘺蘻蘽蘾蘿虀" ], [ "cc80", "虁", 11, "虒虓處", 4, "虛虜虝號虠虡虣", 7, "獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃" ], [ "cd40", "虭虯虰虲", 6, "蚃", 6, "蚎", 4, "蚔蚖", 5, "蚞", 4, "蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻", 4, "蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜" ], [ "cd80", "蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威" ], [ "ce40", "蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀", 6, "蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚", 5, "蝡蝢蝦", 7, "蝯蝱蝲蝳蝵" ], [ "ce80", "蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎", 4, "螔螕螖螘", 6, "螠", 4, "巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺" ], [ "cf40", "螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁", 4, "蟇蟈蟉蟌", 4, "蟔", 6, "蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯", 9 ], [ "cf80", "蟺蟻蟼蟽蟿蠀蠁蠂蠄", 5, "蠋", 7, "蠔蠗蠘蠙蠚蠜", 4, "蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓" ], [ "d040", "蠤", 13, "蠳", 5, "蠺蠻蠽蠾蠿衁衂衃衆", 5, "衎", 5, "衕衖衘衚", 6, "衦衧衪衭衯衱衳衴衵衶衸衹衺" ], [ "d080", "衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗", 4, "袝", 4, "袣袥", 5, "小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄" ], [ "d140", "袬袮袯袰袲", 4, "袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚", 4, "裠裡裦裧裩", 6, "裲裵裶裷裺裻製裿褀褁褃", 5 ], [ "d180", "褉褋", 4, "褑褔", 4, "褜", 4, "褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶" ], [ "d240", "褸", 8, "襂襃襅", 24, "襠", 5, "襧", 19, "襼" ], [ "d280", "襽襾覀覂覄覅覇", 26, "摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐" ], [ "d340", "覢", 30, "觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴", 6 ], [ "d380", "觻", 4, "訁", 5, "計", 21, "印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉" ], [ "d440", "訞", 31, "訿", 8, "詉", 21 ], [ "d480", "詟", 25, "詺", 6, "浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧" ], [ "d540", "誁", 7, "誋", 7, "誔", 46 ], [ "d580", "諃", 32, "铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政" ], [ "d640", "諤", 34, "謈", 27 ], [ "d680", "謤謥謧", 30, "帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑" ], [ "d740", "譆", 31, "譧", 4, "譭", 25 ], [ "d780", "讇", 24, "讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座" ], [ "d840", "谸", 8, "豂豃豄豅豈豊豋豍", 7, "豖豗豘豙豛", 5, "豣", 6, "豬", 6, "豴豵豶豷豻", 6, "貃貄貆貇" ], [ "d880", "貈貋貍", 6, "貕貖貗貙", 20, "亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝" ], [ "d940", "貮", 62 ], [ "d980", "賭", 32, "佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼" ], [ "da40", "贎", 14, "贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸", 8, "趂趃趆趇趈趉趌", 4, "趒趓趕", 9, "趠趡" ], [ "da80", "趢趤", 12, "趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺" ], [ "db40", "跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾", 6, "踆踇踈踋踍踎踐踑踒踓踕", 7, "踠踡踤", 4, "踫踭踰踲踳踴踶踷踸踻踼踾" ], [ "db80", "踿蹃蹅蹆蹌", 4, "蹓", 5, "蹚", 11, "蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝" ], [ "dc40", "蹳蹵蹷", 4, "蹽蹾躀躂躃躄躆躈", 6, "躑躒躓躕", 6, "躝躟", 11, "躭躮躰躱躳", 6, "躻", 7 ], [ "dc80", "軃", 10, "軏", 21, "堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥" ], [ "dd40", "軥", 62 ], [ "dd80", "輤", 32, "荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺" ], [ "de40", "轅", 32, "轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆" ], [ "de80", "迉", 4, "迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖" ], [ "df40", "這逜連逤逥逧", 5, "逰", 4, "逷逹逺逽逿遀遃遅遆遈", 4, "過達違遖遙遚遜", 5, "遤遦遧適遪遫遬遯", 4, "遶", 6, "遾邁" ], [ "df80", "還邅邆邇邉邊邌", 4, "邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼" ], [ "e040", "郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅", 19, "鄚鄛鄜" ], [ "e080", "鄝鄟鄠鄡鄤", 10, "鄰鄲", 6, "鄺", 8, "酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼" ], [ "e140", "酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀", 4, "醆醈醊醎醏醓", 6, "醜", 5, "醤", 5, "醫醬醰醱醲醳醶醷醸醹醻" ], [ "e180", "醼", 10, "釈釋釐釒", 9, "針", 8, "帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺" ], [ "e240", "釦", 62 ], [ "e280", "鈥", 32, "狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧", 5, "饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂" ], [ "e340", "鉆", 45, "鉵", 16 ], [ "e380", "銆", 7, "銏", 24, "恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾" ], [ "e440", "銨", 5, "銯", 24, "鋉", 31 ], [ "e480", "鋩", 32, "洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑" ], [ "e540", "錊", 51, "錿", 10 ], [ "e580", "鍊", 31, "鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣" ], [ "e640", "鍬", 34, "鎐", 27 ], [ "e680", "鎬", 29, "鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩" ], [ "e740", "鏎", 7, "鏗", 54 ], [ "e780", "鐎", 32, "纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡", 6, "缪缫缬缭缯", 4, "缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬" ], [ "e840", "鐯", 14, "鐿", 43, "鑬鑭鑮鑯" ], [ "e880", "鑰", 20, "钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹" ], [ "e940", "锧锳锽镃镈镋镕镚镠镮镴镵長", 7, "門", 42 ], [ "e980", "閫", 32, "椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋" ], [ "ea40", "闌", 27, "闬闿阇阓阘阛阞阠阣", 6, "阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗" ], [ "ea80", "陘陙陚陜陝陞陠陣陥陦陫陭", 4, "陳陸", 12, "隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰" ], [ "eb40", "隌階隑隒隓隕隖隚際隝", 9, "隨", 7, "隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖", 9, "雡", 6, "雫" ], [ "eb80", "雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗", 4, "霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻" ], [ "ec40", "霡", 8, "霫霬霮霯霱霳", 4, "霺霻霼霽霿", 18, "靔靕靗靘靚靜靝靟靣靤靦靧靨靪", 7 ], [ "ec80", "靲靵靷", 4, "靽", 7, "鞆", 4, "鞌鞎鞏鞐鞓鞕鞖鞗鞙", 4, "臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐" ], [ "ed40", "鞞鞟鞡鞢鞤", 6, "鞬鞮鞰鞱鞳鞵", 46 ], [ "ed80", "韤韥韨韮", 4, "韴韷", 23, "怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨" ], [ "ee40", "頏", 62 ], [ "ee80", "顎", 32, "睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶", 4, "钼钽钿铄铈", 6, "铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪" ], [ "ef40", "顯", 5, "颋颎颒颕颙颣風", 37, "飏飐飔飖飗飛飜飝飠", 4 ], [ "ef80", "飥飦飩", 30, "铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒", 4, "锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤", 8, "镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔" ], [ "f040", "餈", 4, "餎餏餑", 28, "餯", 26 ], [ "f080", "饊", 9, "饖", 12, "饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨", 4, "鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦", 6, "鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙" ], [ "f140", "馌馎馚", 10, "馦馧馩", 47 ], [ "f180", "駙", 32, "瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃" ], [ "f240", "駺", 62 ], [ "f280", "騹", 32, "颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒" ], [ "f340", "驚", 17, "驲骃骉骍骎骔骕骙骦骩", 6, "骲骳骴骵骹骻骽骾骿髃髄髆", 4, "髍髎髏髐髒體髕髖髗髙髚髛髜" ], [ "f380", "髝髞髠髢髣髤髥髧髨髩髪髬髮髰", 8, "髺髼", 6, "鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋" ], [ "f440", "鬇鬉", 5, "鬐鬑鬒鬔", 10, "鬠鬡鬢鬤", 10, "鬰鬱鬳", 7, "鬽鬾鬿魀魆魊魋魌魎魐魒魓魕", 5 ], [ "f480", "魛", 32, "簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤" ], [ "f540", "魼", 62 ], [ "f580", "鮻", 32, "酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜" ], [ "f640", "鯜", 62 ], [ "f680", "鰛", 32, "觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅", 5, "龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞", 5, "鲥", 4, "鲫鲭鲮鲰", 7, "鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋" ], [ "f740", "鰼", 62 ], [ "f780", "鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾", 4, "鳈鳉鳑鳒鳚鳛鳠鳡鳌", 4, "鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄" ], [ "f840", "鳣", 62 ], [ "f880", "鴢", 32 ], [ "f940", "鵃", 62 ], [ "f980", "鶂", 32 ], [ "fa40", "鶣", 62 ], [ "fa80", "鷢", 32 ], [ "fb40", "鸃", 27, "鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴", 9, "麀" ], [ "fb80", "麁麃麄麅麆麉麊麌", 5, "麔", 8, "麞麠", 5, "麧麨麩麪" ], [ "fc40", "麫", 8, "麵麶麷麹麺麼麿", 4, "黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰", 8, "黺黽黿", 6 ], [ "fc80", "鼆", 4, "鼌鼏鼑鼒鼔鼕鼖鼘鼚", 5, "鼡鼣", 8, "鼭鼮鼰鼱" ], [ "fd40", "鼲", 4, "鼸鼺鼼鼿", 4, "齅", 10, "齒", 38 ], [ "fd80", "齹", 5, "龁龂龍", 11, "龜龝龞龡", 4, "郎凉秊裏隣" ], [ "fe40", "兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩" ] ]; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(stream) { if (!stream) throw new TypeError("argument stream is required"); if ("function" != typeof stream.unpipe) { if ((function(stream) { for (var listeners = stream.listeners("data"), i = 0; i < listeners.length; i++) if ("ondata" === listeners[i].name) return !0; return !1; })(stream)) for (var listener, listeners = stream.listeners("close"), i = 0; i < listeners.length; i++) "cleanup" !== (listener = listeners[i]).name && "onclose" !== listener.name || listener.call(stream); } else stream.unpipe(); }; }, function(module, exports, __webpack_require__) { "use strict"; function mapWithIndex(range, index) { return { start: range.start, end: range.end, index: index }; } function mapWithoutIndex(range) { return { start: range.start, end: range.end }; } function sortByRangeIndex(a, b) { return a.index - b.index; } function sortByRangeStart(a, b) { return a.start - b.start; } module.exports = function(size, str, options) { if ("string" != typeof str) throw new TypeError("argument str must be a string"); var index = str.indexOf("="); if (-1 === index) return -2; var arr = str.slice(index + 1).split(","), ranges = []; ranges.type = str.slice(0, index); for (var i = 0; i < arr.length; i++) { var range = arr[i].split("-"), start = parseInt(range[0], 10), end = parseInt(range[1], 10); isNaN(start) ? (start = size - end, end = size - 1) : isNaN(end) && (end = size - 1), end > size - 1 && (end = size - 1), isNaN(start) || isNaN(end) || start > end || start < 0 || ranges.push({ start: start, end: end }); } return ranges.length < 1 ? -1 : options && options.combine ? (function(ranges) { for (var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart), j = 0, i = 1; i < ordered.length; i++) { var range = ordered[i], current = ordered[j]; range.start > current.end + 1 ? ordered[++j] = range : range.end > current.end && (current.end = range.end, current.index = Math.min(current.index, range.index)); } ordered.length = j + 1; var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex); return combined.type = ranges.type, combined; })(ranges) : ranges; }; }, function(module, exports, __webpack_require__) { "use strict"; var stringify = __webpack_require__(607), parse = __webpack_require__(608), formats = __webpack_require__(285); module.exports = { formats: formats, parse: parse, stringify: stringify }; }, function(module, exports) { module.exports = function pathtoRegexp(path, keys, options) { keys = keys || []; var m, strict = (options = options || {}).strict, end = !1 !== options.end, flags = options.sensitive ? "" : "i", extraOffset = 0, keysOffset = keys.length, i = 0, name = 0; if (path instanceof RegExp) { for (;m = MATCHING_GROUP_REGEXP.exec(path.source); ) keys.push({ name: name++, optional: !1, offset: m.index }); return path; } if (Array.isArray(path)) return path = path.map((function(value) { return pathtoRegexp(value, keys, options).source; })), new RegExp("(?:" + path.join("|") + ")", flags); for (path = ("^" + path + (strict ? "" : "/" === path[path.length - 1] ? "?" : "/?")).replace(/\/\(/g, "/(?:").replace(/([\/\.])/g, "\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, (function(match, slash, format, key, capture, star, optional, offset) { slash = slash || "", format = format || "", capture = capture || "([^\\/" + format + "]+?)", optional = optional || "", keys.push({ name: key, optional: !!optional, offset: offset + extraOffset }); var result = (optional ? "" : slash) + "(?:" + format + (optional ? slash : "") + capture + (star ? "((?:[\\/" + format + "].+?)?)" : "") + ")" + optional; return extraOffset += result.length - match.length, result; })).replace(/\*/g, (function(star, index) { for (var len = keys.length; len-- > keysOffset && keys[len].offset > index; ) keys[len].offset += 3; return "(.*)"; })); m = MATCHING_GROUP_REGEXP.exec(path); ) { for (var escapeCount = 0, index = m.index; "\\" === path.charAt(--index); ) escapeCount++; escapeCount % 2 != 1 && ((keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) && keys.splice(keysOffset + i, 0, { name: name++, optional: !1, offset: m.index }), i++); } return path += end ? "$" : "/" === path[path.length - 1] ? "" : "(?=\\/|$)", new RegExp(path, flags); }; var MATCHING_GROUP_REGEXP = /\((?!\?)/g; }, function(module, exports, __webpack_require__) { var once = __webpack_require__(35), eos = __webpack_require__(180), fs = __webpack_require__(2), noop = function() {}, isFn = function(fn) { return "function" == typeof fn; }, destroyer = function(stream, reading, writing, callback) { callback = once(callback); var closed = !1; stream.on("close", (function() { closed = !0; })), eos(stream, { readable: reading, writable: writing }, (function(err) { if (err) return callback(err); closed = !0, callback(); })); var destroyed = !1; return function(err) { if (!closed && !destroyed) return destroyed = !0, (function(stream) { return !!fs && (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close); })(stream) ? stream.close(noop) : (function(stream) { return stream.setHeader && isFn(stream.abort); })(stream) ? stream.abort() : isFn(stream.destroy) ? stream.destroy() : void callback(err || new Error("stream was destroyed")); }; }, call = function(fn) { fn(); }, pipe = function(from, to) { return from.pipe(to); }; module.exports = function() { var error, streams = Array.prototype.slice.call(arguments), callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop; if (Array.isArray(streams[0]) && (streams = streams[0]), streams.length < 2) throw new Error("pump requires two streams per minimum"); var destroys = streams.map((function(stream, i) { var reading = i < streams.length - 1; return destroyer(stream, reading, i > 0, (function(err) { error || (error = err), err && destroys.forEach(call), reading || (destroys.forEach(call), callback(error)); })); })); return streams.reduce(pipe); }; }, function(module, exports, __webpack_require__) { var once = __webpack_require__(35), noop = function() {}, eos = function(stream, opts, callback) { if ("function" == typeof opts) return eos(stream, null, opts); opts || (opts = {}), callback = once(callback || noop); var ws = stream._writableState, rs = stream._readableState, readable = opts.readable || !1 !== opts.readable && stream.readable, writable = opts.writable || !1 !== opts.writable && stream.writable, cancelled = !1, onlegacyfinish = function() { stream.writable || onfinish(); }, onfinish = function() { writable = !1, readable || callback.call(stream); }, onend = function() { readable = !1, writable || callback.call(stream); }, onexit = function(exitCode) { callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null); }, onerror = function(err) { callback.call(stream, err); }, onclose = function() { process.nextTick(onclosenexttick); }, onclosenexttick = function() { if (!cancelled) return (!readable || rs && rs.ended && !rs.destroyed) && (!writable || ws && ws.ended && !ws.destroyed) ? void 0 : callback.call(stream, new Error("premature close")); }, onrequest = function() { stream.req.on("finish", onfinish); }; return (function(stream) { return stream.setHeader && "function" == typeof stream.abort; })(stream) ? (stream.on("complete", onfinish), stream.on("abort", onclose), stream.req ? onrequest() : stream.on("request", onrequest)) : writable && !ws && (stream.on("end", onlegacyfinish), stream.on("close", onlegacyfinish)), (function(stream) { return stream.stdio && Array.isArray(stream.stdio) && 3 === stream.stdio.length; })(stream) && stream.on("exit", onexit), stream.on("end", onend), stream.on("finish", onfinish), !1 !== opts.error && stream.on("error", onerror), stream.on("close", onclose), function() { cancelled = !0, stream.removeListener("complete", onfinish), stream.removeListener("abort", onclose), stream.removeListener("request", onrequest), stream.req && stream.req.removeListener("finish", onfinish), stream.removeListener("end", onlegacyfinish), stream.removeListener("close", onlegacyfinish), stream.removeListener("finish", onfinish), stream.removeListener("exit", onexit), stream.removeListener("end", onend), stream.removeListener("error", onerror), stream.removeListener("close", onclose); }; }; module.exports = eos; }, function(module, exports, __webpack_require__) { var bencode = module.exports; bencode.encode = __webpack_require__(616), bencode.decode = __webpack_require__(617), bencode.byteLength = bencode.encodingLength = function(value) { return bencode.encode(value).length; }; }, function(module, exports, __webpack_require__) { var crypto = __webpack_require__(6); function sha1sync(buf) { return crypto.createHash("sha1").update(buf).digest("hex"); } module.exports = function(buf, cb) { var hash = sha1sync(buf); process.nextTick((function() { cb(hash); })); }, module.exports.sync = sha1sync; }, function(module, exports, __webpack_require__) { (function(module) { (function() { var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR; ipaddr = {}, null !== module && module.exports ? module.exports = ipaddr : this.ipaddr = ipaddr, matchCIDR = function(first, second, partSize, cidrBits) { var part, shift; if (first.length !== second.length) throw new Error("ipaddr: cannot match CIDR for objects with different lengths"); for (part = 0; cidrBits > 0; ) { if ((shift = partSize - cidrBits) < 0 && (shift = 0), first[part] >> shift != second[part] >> shift) return !1; cidrBits -= partSize, part += 1; } return !0; }, ipaddr.subnetMatch = function(address, rangeList, defaultName) { var k, len, rangeName, rangeSubnets, subnet; for (rangeName in null == defaultName && (defaultName = "unicast"), rangeList) for (!(rangeSubnets = rangeList[rangeName])[0] || rangeSubnets[0] instanceof Array || (rangeSubnets = [ rangeSubnets ]), k = 0, len = rangeSubnets.length; k < len; k++) if (subnet = rangeSubnets[k], address.kind() === subnet[0].kind() && address.match.apply(address, subnet)) return rangeName; return defaultName; }, ipaddr.IPv4 = (function() { function IPv4(octets) { var k, len, octet; if (4 !== octets.length) throw new Error("ipaddr: ipv4 octet count should be 4"); for (k = 0, len = octets.length; k < len; k++) if (!(0 <= (octet = octets[k]) && octet <= 255)) throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); this.octets = octets; } return IPv4.prototype.kind = function() { return "ipv4"; }, IPv4.prototype.toString = function() { return this.octets.join("."); }, IPv4.prototype.toNormalizedString = function() { return this.toString(); }, IPv4.prototype.toByteArray = function() { return this.octets.slice(0); }, IPv4.prototype.match = function(other, cidrRange) { var ref; if (void 0 === cidrRange && (other = (ref = other)[0], cidrRange = ref[1]), "ipv4" !== other.kind()) throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); return matchCIDR(this.octets, other.octets, 8, cidrRange); }, IPv4.prototype.SpecialRanges = { unspecified: [ [ new IPv4([ 0, 0, 0, 0 ]), 8 ] ], broadcast: [ [ new IPv4([ 255, 255, 255, 255 ]), 32 ] ], multicast: [ [ new IPv4([ 224, 0, 0, 0 ]), 4 ] ], linkLocal: [ [ new IPv4([ 169, 254, 0, 0 ]), 16 ] ], loopback: [ [ new IPv4([ 127, 0, 0, 0 ]), 8 ] ], carrierGradeNat: [ [ new IPv4([ 100, 64, 0, 0 ]), 10 ] ], private: [ [ new IPv4([ 10, 0, 0, 0 ]), 8 ], [ new IPv4([ 172, 16, 0, 0 ]), 12 ], [ new IPv4([ 192, 168, 0, 0 ]), 16 ] ], reserved: [ [ new IPv4([ 192, 0, 0, 0 ]), 24 ], [ new IPv4([ 192, 0, 2, 0 ]), 24 ], [ new IPv4([ 192, 88, 99, 0 ]), 24 ], [ new IPv4([ 198, 51, 100, 0 ]), 24 ], [ new IPv4([ 203, 0, 113, 0 ]), 24 ], [ new IPv4([ 240, 0, 0, 0 ]), 4 ] ] }, IPv4.prototype.range = function() { return ipaddr.subnetMatch(this, this.SpecialRanges); }, IPv4.prototype.toIPv4MappedAddress = function() { return ipaddr.IPv6.parse("::ffff:" + this.toString()); }, IPv4.prototype.prefixLengthFromSubnetMask = function() { var cidr, i, k, octet, stop, zeros, zerotable; for (zerotable = { 0: 8, 128: 7, 192: 6, 224: 5, 240: 4, 248: 3, 252: 2, 254: 1, 255: 0 }, cidr = 0, stop = !1, i = k = 3; k >= 0; i = k += -1) { if (!((octet = this.octets[i]) in zerotable)) return null; if (zeros = zerotable[octet], stop && 0 !== zeros) return null; 8 !== zeros && (stop = !0), cidr += zeros; } return 32 - cidr; }, IPv4; })(), ipv4Part = "(0?\\d+|0x[a-f0-9]+)", ipv4Regexes = { fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", "i"), longValue: new RegExp("^" + ipv4Part + "$", "i") }, ipaddr.IPv4.parser = function(string) { var match, parseIntAuto, part, shift, value; if (parseIntAuto = function(string) { return "0" === string[0] && "x" !== string[1] ? parseInt(string, 8) : parseInt(string); }, match = string.match(ipv4Regexes.fourOctet)) return (function() { var k, len, ref, results; for (results = [], k = 0, len = (ref = match.slice(1, 6)).length; k < len; k++) part = ref[k], results.push(parseIntAuto(part)); return results; })(); if (match = string.match(ipv4Regexes.longValue)) { if ((value = parseIntAuto(match[1])) > 4294967295 || value < 0) throw new Error("ipaddr: address outside defined range"); return (function() { var k, results; for (results = [], shift = k = 0; k <= 24; shift = k += 8) results.push(value >> shift & 255); return results; })().reverse(); } return null; }, ipaddr.IPv6 = (function() { function IPv6(parts, zoneId) { var i, k, l, len, part, ref; if (16 === parts.length) for (this.parts = [], i = k = 0; k <= 14; i = k += 2) this.parts.push(parts[i] << 8 | parts[i + 1]); else { if (8 !== parts.length) throw new Error("ipaddr: ipv6 part count should be 8 or 16"); this.parts = parts; } for (l = 0, len = (ref = this.parts).length; l < len; l++) if (!(0 <= (part = ref[l]) && part <= 65535)) throw new Error("ipaddr: ipv6 part should fit in 16 bits"); zoneId && (this.zoneId = zoneId); } return IPv6.prototype.kind = function() { return "ipv6"; }, IPv6.prototype.toString = function() { return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::"); }, IPv6.prototype.toRFC5952String = function() { var bestMatchIndex, bestMatchLength, match, regex, string; for (regex = /((^|:)(0(:|$)){2,})/g, string = this.toNormalizedString(), bestMatchIndex = 0, bestMatchLength = -1; match = regex.exec(string); ) match[0].length > bestMatchLength && (bestMatchIndex = match.index, bestMatchLength = match[0].length); return bestMatchLength < 0 ? string : string.substring(0, bestMatchIndex) + "::" + string.substring(bestMatchIndex + bestMatchLength); }, IPv6.prototype.toByteArray = function() { var bytes, k, len, part, ref; for (bytes = [], k = 0, len = (ref = this.parts).length; k < len; k++) part = ref[k], bytes.push(part >> 8), bytes.push(255 & part); return bytes; }, IPv6.prototype.toNormalizedString = function() { var addr, part, suffix; return addr = function() { var k, len, ref, results; for (results = [], k = 0, len = (ref = this.parts).length; k < len; k++) part = ref[k], results.push(part.toString(16)); return results; }.call(this).join(":"), suffix = "", this.zoneId && (suffix = "%" + this.zoneId), addr + suffix; }, IPv6.prototype.toFixedLengthString = function() { var addr, part, suffix; return addr = function() { var k, len, ref, results; for (results = [], k = 0, len = (ref = this.parts).length; k < len; k++) part = ref[k], results.push(part.toString(16).padStart(4, "0")); return results; }.call(this).join(":"), suffix = "", this.zoneId && (suffix = "%" + this.zoneId), addr + suffix; }, IPv6.prototype.match = function(other, cidrRange) { var ref; if (void 0 === cidrRange && (other = (ref = other)[0], cidrRange = ref[1]), "ipv6" !== other.kind()) throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); return matchCIDR(this.parts, other.parts, 16, cidrRange); }, IPv6.prototype.SpecialRanges = { unspecified: [ new IPv6([ 0, 0, 0, 0, 0, 0, 0, 0 ]), 128 ], linkLocal: [ new IPv6([ 65152, 0, 0, 0, 0, 0, 0, 0 ]), 10 ], multicast: [ new IPv6([ 65280, 0, 0, 0, 0, 0, 0, 0 ]), 8 ], loopback: [ new IPv6([ 0, 0, 0, 0, 0, 0, 0, 1 ]), 128 ], uniqueLocal: [ new IPv6([ 64512, 0, 0, 0, 0, 0, 0, 0 ]), 7 ], ipv4Mapped: [ new IPv6([ 0, 0, 0, 0, 0, 65535, 0, 0 ]), 96 ], rfc6145: [ new IPv6([ 0, 0, 0, 0, 65535, 0, 0, 0 ]), 96 ], rfc6052: [ new IPv6([ 100, 65435, 0, 0, 0, 0, 0, 0 ]), 96 ], "6to4": [ new IPv6([ 8194, 0, 0, 0, 0, 0, 0, 0 ]), 16 ], teredo: [ new IPv6([ 8193, 0, 0, 0, 0, 0, 0, 0 ]), 32 ], reserved: [ [ new IPv6([ 8193, 3512, 0, 0, 0, 0, 0, 0 ]), 32 ] ] }, IPv6.prototype.range = function() { return ipaddr.subnetMatch(this, this.SpecialRanges); }, IPv6.prototype.isIPv4MappedAddress = function() { return "ipv4Mapped" === this.range(); }, IPv6.prototype.toIPv4Address = function() { var high, low, ref; if (!this.isIPv4MappedAddress()) throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); return high = (ref = this.parts.slice(-2))[0], low = ref[1], new ipaddr.IPv4([ high >> 8, 255 & high, low >> 8, 255 & low ]); }, IPv6.prototype.prefixLengthFromSubnetMask = function() { var cidr, i, k, part, stop, zeros, zerotable; for (zerotable = { 0: 16, 32768: 15, 49152: 14, 57344: 13, 61440: 12, 63488: 11, 64512: 10, 65024: 9, 65280: 8, 65408: 7, 65472: 6, 65504: 5, 65520: 4, 65528: 3, 65532: 2, 65534: 1, 65535: 0 }, cidr = 0, stop = !1, i = k = 7; k >= 0; i = k += -1) { if (!((part = this.parts[i]) in zerotable)) return null; if (zeros = zerotable[part], stop && 0 !== zeros) return null; 16 !== zeros && (stop = !0), cidr += zeros; } return 128 - cidr; }, IPv6; })(), ipv6Part = "(?:[0-9a-f]+::?)+", ipv6Regexes = { zoneIndex: new RegExp("%[0-9a-z]{1,}", "i"), native: new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?(%[0-9a-z]{1,})?$", "i"), transitional: new RegExp("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "(%[0-9a-z]{1,})?$", "i") }, expandIPv6 = function(string, parts) { var colonCount, lastColon, part, replacement, replacementCount, zoneId; if (string.indexOf("::") !== string.lastIndexOf("::")) return null; for ((zoneId = (string.match(ipv6Regexes.zoneIndex) || [])[0]) && (zoneId = zoneId.substring(1), string = string.replace(/%.+$/, "")), colonCount = 0, lastColon = -1; (lastColon = string.indexOf(":", lastColon + 1)) >= 0; ) colonCount++; if ("::" === string.substr(0, 2) && colonCount--, "::" === string.substr(-2, 2) && colonCount--, colonCount > parts) return null; for (replacementCount = parts - colonCount, replacement = ":"; replacementCount--; ) replacement += "0:"; return ":" === (string = string.replace("::", replacement))[0] && (string = string.slice(1)), ":" === string[string.length - 1] && (string = string.slice(0, -1)), { parts: parts = (function() { var k, len, ref, results; for (results = [], k = 0, len = (ref = string.split(":")).length; k < len; k++) part = ref[k], results.push(parseInt(part, 16)); return results; })(), zoneId: zoneId }; }, ipaddr.IPv6.parser = function(string) { var addr, k, len, match, octet, octets, zoneId; if (ipv6Regexes.native.test(string)) return expandIPv6(string, 8); if ((match = string.match(ipv6Regexes.transitional)) && (zoneId = match[6] || "", (addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6)).parts)) { for (k = 0, len = (octets = [ parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5]) ]).length; k < len; k++) if (!(0 <= (octet = octets[k]) && octet <= 255)) return null; return addr.parts.push(octets[0] << 8 | octets[1]), addr.parts.push(octets[2] << 8 | octets[3]), { parts: addr.parts, zoneId: addr.zoneId }; } return null; }, ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) { return null !== this.parser(string); }, ipaddr.IPv4.isValid = function(string) { try { return new this(this.parser(string)), !0; } catch (error1) { return !1; } }, ipaddr.IPv4.isValidFourPartDecimal = function(string) { return !(!ipaddr.IPv4.isValid(string) || !string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)); }, ipaddr.IPv6.isValid = function(string) { var addr; if ("string" == typeof string && -1 === string.indexOf(":")) return !1; try { return new this((addr = this.parser(string)).parts, addr.zoneId), !0; } catch (error1) { return !1; } }, ipaddr.IPv4.parse = function(string) { var parts; if (null === (parts = this.parser(string))) throw new Error("ipaddr: string is not formatted like ip address"); return new this(parts); }, ipaddr.IPv6.parse = function(string) { var addr; if (null === (addr = this.parser(string)).parts) throw new Error("ipaddr: string is not formatted like ip address"); return new this(addr.parts, addr.zoneId); }, ipaddr.IPv4.parseCIDR = function(string) { var maskLength, match, parsed; if ((match = string.match(/^(.+)\/(\d+)$/)) && (maskLength = parseInt(match[2])) >= 0 && maskLength <= 32) return parsed = [ this.parse(match[1]), maskLength ], Object.defineProperty(parsed, "toString", { value: function() { return this.join("/"); } }), parsed; throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); }, ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) { var filledOctetCount, j, octets; if ((prefix = parseInt(prefix)) < 0 || prefix > 32) throw new Error("ipaddr: invalid IPv4 prefix length"); for (octets = [ 0, 0, 0, 0 ], j = 0, filledOctetCount = Math.floor(prefix / 8); j < filledOctetCount; ) octets[j] = 255, j++; return filledOctetCount < 4 && (octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - prefix % 8), new this(octets); }, ipaddr.IPv4.broadcastAddressFromCIDR = function(string) { var cidr, i, ipInterfaceOctets, octets, subnetMaskOctets; try { for (ipInterfaceOctets = (cidr = this.parseCIDR(string))[0].toByteArray(), subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(), octets = [], i = 0; i < 4; ) octets.push(parseInt(ipInterfaceOctets[i], 10) | 255 ^ parseInt(subnetMaskOctets[i], 10)), i++; return new this(octets); } catch (error1) { throw new Error("ipaddr: the address does not have IPv4 CIDR format"); } }, ipaddr.IPv4.networkAddressFromCIDR = function(string) { var cidr, i, ipInterfaceOctets, octets, subnetMaskOctets; try { for (ipInterfaceOctets = (cidr = this.parseCIDR(string))[0].toByteArray(), subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(), octets = [], i = 0; i < 4; ) octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10)), i++; return new this(octets); } catch (error1) { throw new Error("ipaddr: the address does not have IPv4 CIDR format"); } }, ipaddr.IPv6.parseCIDR = function(string) { var maskLength, match, parsed; if ((match = string.match(/^(.+)\/(\d+)$/)) && (maskLength = parseInt(match[2])) >= 0 && maskLength <= 128) return parsed = [ this.parse(match[1]), maskLength ], Object.defineProperty(parsed, "toString", { value: function() { return this.join("/"); } }), parsed; throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); }, ipaddr.isValid = function(string) { return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string); }, ipaddr.parse = function(string) { if (ipaddr.IPv6.isValid(string)) return ipaddr.IPv6.parse(string); if (ipaddr.IPv4.isValid(string)) return ipaddr.IPv4.parse(string); throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format"); }, ipaddr.parseCIDR = function(string) { try { return ipaddr.IPv6.parseCIDR(string); } catch (error1) { try { return ipaddr.IPv4.parseCIDR(string); } catch (error1) { throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); } } }, ipaddr.fromByteArray = function(bytes) { var length; if (4 === (length = bytes.length)) return new ipaddr.IPv4(bytes); if (16 === length) return new ipaddr.IPv6(bytes); throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); }, ipaddr.process = function(string) { var addr; return "ipv6" === (addr = this.parse(string)).kind() && addr.isIPv4MappedAddress() ? addr.toIPv4Address() : addr; }; }).call(this); }).call(this, __webpack_require__(69)(module)); }, function(module, exports, __webpack_require__) { module.exports = Tracker; var EventEmitter = __webpack_require__(4).EventEmitter; function Tracker(client, announceUrl) { EventEmitter.call(this), this.client = client, this.announceUrl = announceUrl, this.interval = null, this.destroyed = !1; } __webpack_require__(8)(Tracker, EventEmitter), Tracker.prototype.setInterval = function(intervalMs) { if (null == intervalMs && (intervalMs = this.DEFAULT_ANNOUNCE_INTERVAL), clearInterval(this.interval), intervalMs) { var update = this.announce.bind(this, this.client._defaultAnnounceOpts()); this.interval = setInterval(update, intervalMs), this.interval.unref && this.interval.unref(); } }; }, function(module, exports) { module.exports = isTypedArray, isTypedArray.strict = isStrictTypedArray, isTypedArray.loose = isLooseTypedArray; var toString = Object.prototype.toString, names = { "[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 isTypedArray(arr) { return isStrictTypedArray(arr) || isLooseTypedArray(arr); } function isStrictTypedArray(arr) { return arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array; } function isLooseTypedArray(arr) { return names[toString.call(arr)]; } }, function(module, exports, __webpack_require__) { var path = __webpack_require__(5), fs = __webpack_require__(2), _0777 = parseInt("0777", 8); function mkdirP(p, opts, f, made) { "function" == typeof opts ? (f = opts, opts = {}) : opts && "object" == typeof opts || (opts = { mode: opts }); var mode = opts.mode, xfs = opts.fs || fs; void 0 === mode && (mode = _0777 & ~process.umask()), made || (made = null); var cb = f || function() {}; p = path.resolve(p), xfs.mkdir(p, mode, (function(er) { if (!er) return cb(null, made = made || p); "ENOENT" === er.code ? mkdirP(path.dirname(p), opts, (function(er, made) { er ? cb(er, made) : mkdirP(p, opts, cb, made); })) : xfs.stat(p, (function(er2, stat) { er2 || !stat.isDirectory() ? cb(er, made) : cb(null, made); })); })); } module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP, mkdirP.sync = function sync(p, opts, made) { opts && "object" == typeof opts || (opts = { mode: opts }); var mode = opts.mode, xfs = opts.fs || fs; void 0 === mode && (mode = _0777 & ~process.umask()), made || (made = null), p = path.resolve(p); try { xfs.mkdirSync(p, mode), made = made || p; } catch (err0) { if ("ENOENT" === err0.code) made = sync(path.dirname(p), opts, made), sync(p, opts, made); else { var stat; try { stat = xfs.statSync(p); } catch (err1) { throw err0; } if (!stat.isDirectory()) throw err0; } } return made; }; }, function(module, exports, __webpack_require__) { "use strict"; var assert = __webpack_require__(25), util = (__webpack_require__(2), __webpack_require__(0)), debug = __webpack_require__(44)("matroska:abstractSource"), Source = __webpack_require__(308), tools = __webpack_require__(83); function AbstractSource() { this._vints = [], this._vintsSize = 0; } module.exports = AbstractSource, util.inherits(AbstractSource, Source), AbstractSource.prototype.writeCompleteTag = function(session, tag, callback) { assert("number" == typeof tag.start, "Invalid start index of tag #" + tag.tagId), assert("number" == typeof tag.end, "Invalid start index of tag #" + tag.tagId); var self = this; this._flush(session, (function(error) { if (error) return callback(error); var start = tag.start, end = tag.end, modified = tag._modified; modified && (start = modified.start, end = modified.end), self.getStream({ start: start, end: end - 1 }, (function(error, stream) { if (error) return callback(error); stream.on("end", callback), stream.on("error", callback), stream.pipe(session.stream, { end: !1 }); })); })); }, AbstractSource.prototype.writeTagData = function(session, data, callback) { if (!data) throw new Error("No data !"); if (this.writeVInt(session, data.length), this._vintsSize + data.length < 65536) return this._vints.push(data), this._vintsSize += data.length, void setImmediate(callback); this._flush(session, (function(error) { if (error) return callback(error); session.stream.write(data, callback); })); }, AbstractSource.prototype.writeTagDataSource = function(session, dataSize, dataSource, callback) { this.writeVInt(session, dataSize), this._flush(session, (function(error) { if (error) return callback(error); dataSource.getStream(session, (function(error, stream) { if (error) return callback(error); stream.pipe(session.stream, { end: !1 }), stream.on("error", callback), stream.on("end", callback); })); })); }, AbstractSource.prototype.writeVInt = function(session, value) { if ("number" != typeof value) throw new Error("Invalid value (" + value + ")"); var buffer = tools.writeVInt(value); this._vints.push(buffer), this._vintsSize += buffer.length; }, AbstractSource.prototype.writeHInt = function(session, value) { if ("number" != typeof value) throw new Error("Invalid value (" + value + ")"); var buffer = value; Buffer.isBuffer(buffer) || (buffer = tools.writeUInt(value)), this._vints.push(buffer), this._vintsSize += buffer.length; }, AbstractSource.prototype._flush = function(session, callback) { var buffer, vints = this._vints; if (!this._vintsSize) return callback(); buffer = 1 === vints.length ? vints[0] : Buffer.concat(vints), this._vints = [], this._vintsSize = 0, session.stream.write(buffer, callback); }, AbstractSource.prototype.getTagDataStream = function(tag, callback) { debug.enabled && debug("Get data stream of #" + tag.tagId + " start=" + tag.start + " end=" + tag.end + " modified=", modified); var end = tag.end, modified = tag._modified; modified && (end = modified.end); var start = end - tag.getDataSize(); debug.enabled && debug("Open stream " + this.filename + " start=" + start + " end=" + end + " size=" + tag.dataSize), this.getStream({}, { start: start, end: end - 1 }, (function(error, stream) { return error ? callback(error) : callback(null, stream); })); }, AbstractSource.prototype.end = function(session, callback) { var self = this; this._flush(session, (function(error) { if (error) return callback(error); self._end(session, callback); })); }, AbstractSource.prototype._end = function(session, callback) { callback(); }, AbstractSource.prototype.release = function(callback) { this.end(this, callback); }; }, function(module, exports, __webpack_require__) { (function() { "use strict"; var builder, defaults, parser, processors, hasProp = {}.hasOwnProperty; defaults = __webpack_require__(189), builder = __webpack_require__(741), parser = __webpack_require__(746), processors = __webpack_require__(403), exports.defaults = defaults.defaults, exports.processors = processors, exports.ValidationError = (function(superClass) { function ValidationError(message) { this.message = message; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(ValidationError, Error), ValidationError; })(), exports.Builder = builder.Builder, exports.Parser = parser.Parser, exports.parseString = parser.parseString; }).call(this); }, function(module, exports) { (function() { exports.defaults = { .1: { explicitCharkey: !1, trim: !0, normalize: !0, normalizeTags: !1, attrkey: "@", charkey: "#", explicitArray: !1, ignoreAttrs: !1, mergeAttrs: !1, explicitRoot: !1, validator: null, xmlns: !1, explicitChildren: !1, childkey: "@@", charsAsChildren: !1, includeWhiteChars: !1, async: !1, strict: !0, attrNameProcessors: null, attrValueProcessors: null, tagNameProcessors: null, valueProcessors: null, emptyTag: "" }, .2: { explicitCharkey: !1, trim: !1, normalize: !1, normalizeTags: !1, attrkey: "$", charkey: "_", explicitArray: !0, ignoreAttrs: !1, mergeAttrs: !1, explicitRoot: !0, validator: null, xmlns: !1, explicitChildren: !1, preserveChildrenOrder: !1, childkey: "$$", charsAsChildren: !1, includeWhiteChars: !1, async: !1, strict: !0, attrNameProcessors: null, attrValueProcessors: null, tagNameProcessors: null, valueProcessors: null, rootName: "root", xmldec: { version: "1.0", encoding: "UTF-8", standalone: !0 }, doctype: null, renderOpts: { pretty: !0, indent: " ", newline: "\n" }, headless: !1, chunkSize: 1e4, emptyTag: "", cdata: !1 } }; }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, hasProp = {}.hasOwnProperty; XMLDeclaration = __webpack_require__(131), XMLDocType = __webpack_require__(132), XMLCData = __webpack_require__(129), XMLComment = __webpack_require__(130), XMLElement = __webpack_require__(128), XMLRaw = __webpack_require__(137), XMLText = __webpack_require__(138), XMLProcessingInstruction = __webpack_require__(139), XMLDTDAttList = __webpack_require__(133), XMLDTDElement = __webpack_require__(135), XMLDTDEntity = __webpack_require__(134), XMLDTDNotation = __webpack_require__(136), XMLWriterBase = __webpack_require__(402), module.exports = (function(superClass) { function XMLStringWriter(options) { XMLStringWriter.__super__.constructor.call(this, options); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLStringWriter, superClass), XMLStringWriter.prototype.document = function(doc) { var child, i, len, r, ref; for (this.textispresent = !1, r = "", i = 0, len = (ref = doc.children).length; i < len; i++) child = ref[i], r += function() { switch (!1) { case !(child instanceof XMLDeclaration): return this.declaration(child); case !(child instanceof XMLDocType): return this.docType(child); case !(child instanceof XMLComment): return this.comment(child); case !(child instanceof XMLProcessingInstruction): return this.processingInstruction(child); default: return this.element(child, 0); } }.call(this); return this.pretty && r.slice(-this.newline.length) === this.newline && (r = r.slice(0, -this.newline.length)), r; }, XMLStringWriter.prototype.attribute = function(att) { return " " + att.name + '="' + att.value + '"'; }, XMLStringWriter.prototype.cdata = function(node, level) { return this.space(level) + "" + this.newline; }, XMLStringWriter.prototype.comment = function(node, level) { return this.space(level) + "\x3c!-- " + node.text + " --\x3e" + this.newline; }, XMLStringWriter.prototype.declaration = function(node, level) { var r; return r = this.space(level), r += '") + this.newline; }, XMLStringWriter.prototype.docType = function(node, level) { var child, i, len, r, ref; if (level || (level = 0), r = this.space(level), r += " 0) { for (r += " [", r += this.newline, i = 0, len = (ref = node.children).length; i < len; i++) child = ref[i], r += function() { switch (!1) { case !(child instanceof XMLDTDAttList): return this.dtdAttList(child, level + 1); case !(child instanceof XMLDTDElement): return this.dtdElement(child, level + 1); case !(child instanceof XMLDTDEntity): return this.dtdEntity(child, level + 1); case !(child instanceof XMLDTDNotation): return this.dtdNotation(child, level + 1); case !(child instanceof XMLCData): return this.cdata(child, level + 1); case !(child instanceof XMLComment): return this.comment(child, level + 1); case !(child instanceof XMLProcessingInstruction): return this.processingInstruction(child, level + 1); default: throw new Error("Unknown DTD node type: " + child.constructor.name); } }.call(this); r += "]"; } return (r += this.spacebeforeslash + ">") + this.newline; }, XMLStringWriter.prototype.element = function(node, level) { var att, child, i, j, len, len1, name, r, ref, ref1, ref2, space, textispresentwasset; for (name in level || (level = 0), textispresentwasset = !1, this.textispresent ? (this.newline = "", this.pretty = !1) : (this.newline = this.newlinedefault, this.pretty = this.prettydefault), r = "", r += (space = this.space(level)) + "<" + node.name, ref = node.attributes) hasProp.call(ref, name) && (att = ref[name], r += this.attribute(att)); if (0 === node.children.length || node.children.every((function(e) { return "" === e.value; }))) this.allowEmpty ? r += ">" + this.newline : r += this.spacebeforeslash + "/>" + this.newline; else if (this.pretty && 1 === node.children.length && null != node.children[0].value) r += ">", r += node.children[0].value, r += "" + this.newline; else { if (this.dontprettytextnodes) for (i = 0, len = (ref1 = node.children).length; i < len; i++) if (null != (child = ref1[i]).value) { this.textispresent++, textispresentwasset = !0; break; } for (this.textispresent && (this.newline = "", this.pretty = !1, space = this.space(level)), r += ">" + this.newline, j = 0, len1 = (ref2 = node.children).length; j < len1; j++) child = ref2[j], r += function() { switch (!1) { case !(child instanceof XMLCData): return this.cdata(child, level + 1); case !(child instanceof XMLComment): return this.comment(child, level + 1); case !(child instanceof XMLElement): return this.element(child, level + 1); case !(child instanceof XMLRaw): return this.raw(child, level + 1); case !(child instanceof XMLText): return this.text(child, level + 1); case !(child instanceof XMLProcessingInstruction): return this.processingInstruction(child, level + 1); default: throw new Error("Unknown XML node type: " + child.constructor.name); } }.call(this); textispresentwasset && this.textispresent--, this.textispresent || (this.newline = this.newlinedefault, this.pretty = this.prettydefault), r += space + "" + this.newline; } return r; }, XMLStringWriter.prototype.processingInstruction = function(node, level) { var r; return r = this.space(level) + "") + this.newline; }, XMLStringWriter.prototype.raw = function(node, level) { return this.space(level) + node.value + this.newline; }, XMLStringWriter.prototype.text = function(node, level) { return this.space(level) + node.value + this.newline; }, XMLStringWriter.prototype.dtdAttList = function(node, level) { var r; return r = this.space(level) + "") + this.newline; }, XMLStringWriter.prototype.dtdElement = function(node, level) { return this.space(level) + "" + this.newline; }, XMLStringWriter.prototype.dtdEntity = function(node, level) { var r; return r = this.space(level) + "") + this.newline; }, XMLStringWriter.prototype.dtdNotation = function(node, level) { var r; return r = this.space(level) + "") + this.newline; }, XMLStringWriter.prototype.openNode = function(node, level) { var att, name, r, ref; if (level || (level = 0), node instanceof XMLElement) { for (name in r = this.space(level) + "<" + node.name, ref = node.attributes) hasProp.call(ref, name) && (att = ref[name], r += this.attribute(att)); return r + (node.children ? ">" : "/>") + this.newline; } return r = this.space(level) + "") + this.newline; }, XMLStringWriter.prototype.closeNode = function(node, level) { switch (level || (level = 0), !1) { case !(node instanceof XMLElement): return this.space(level) + "" + this.newline; case !(node instanceof XMLDocType): return this.space(level) + "]>" + this.newline; } }, XMLStringWriter; })(XMLWriterBase); }).call(this); }, function(module, exports) { module.exports = function(text, textLen, escapeSequences) { var i, j, escN, quality, hits = 0, misses = 0, shifts = 0; scanInput: for (i = 0; i < textLen; i++) { if (27 == text[i]) { checkEscapes: for (escN = 0; escN < escapeSequences.length; escN++) { var seq = escapeSequences[escN]; if (!(textLen - i < seq.length)) { for (j = 1; j < seq.length; j++) if (seq[j] != text[i + j]) continue checkEscapes; hits++, i += seq.length - 1; continue scanInput; } } misses++; } 14 != text[i] && 15 != text[i] || shifts++; } return 0 == hits ? 0 : (quality = (100 * hits - 100 * misses) / (hits + misses), hits + shifts < 5 && (quality -= 10 * (5 - (hits + shifts))), quality < 0 && (quality = 0), quality); }; }, function(module, exports, __webpack_require__) { var proto = {}; function mix(from, into) { for (var key in from) into[key] = from[key]; } module.exports = proto, proto.from = __webpack_require__(784), proto.to = __webpack_require__(785), proto.is = __webpack_require__(786), proto.subarray = __webpack_require__(787), proto.join = __webpack_require__(788), proto.copy = __webpack_require__(789), proto.create = __webpack_require__(790), mix(__webpack_require__(791), proto), mix(__webpack_require__(792), proto); }, function(module, exports) { module.exports = { mediacodec: { audio: { decoders: {}, encoders: {} }, video: { inputArgs: [], decoders: { libx264: "h264_mediacodec", hevc: "hevc_mediacodec", mpeg2: "mpeg2_mediacodec", mpeg4: "mpeg4_mediacodec", vp8: "vp8_mediacodec", vp9: "vp9_mediacodec" }, encoders: {} } }, videotoolbox: { audio: { decoders: {}, encoders: { aac: "aac_at" } }, video: { inputArgs: [ "-init_hw_device", "videotoolbox=vt", "-hwaccel", "videotoolbox" ], decoders: {}, encoders: { libx264: "h264_videotoolbox", hevc: "hevc_videotoolbox" }, pixelFormat: "nv12", extraOutputArgs: [ "-b:v", "{bitrate}", "-maxrate", "{bitrate}", "-bufsize", "{bufsize}" ] } }, "qsv-win": { audio: { decoders: {}, encoders: {} }, video: { inputArgs: [ "-init_hw_device", "d3d11va=dx11:,vendor=0x8086", "-init_hw_device", "qsv=qs@dx11", "-filter_hw_device", "qs", "-hwaccel", "d3d11va", "-hwaccel_output_format", "d3d11", "-threads", "3" ], decoders: {}, encoders: { libx264: "h264_qsv", hevc: "hevc_qsv", vp9: "vp9_qsv", mpeg2video: "mpeg2_qsv" }, preset: "veryfast", pixelFormat: "nv12", scalePrefix: "hwmap=derive_device=qsv,", scale: "scale_qsv", resizeHeightAuto: "-1", scaleExtra: "", wrapSwFilters: [ "hwdownload", "hwupload" ], hwFilters: [ "hwmap=derive_device=qsv", "format=qsv" ], extraOutputArgs: [ "-look_ahead", "0", "-b:v", "{bitrate}", "-maxrate", "{bitrate}", "-bufsize", "{bufsize}" ] } }, "qsv-linux": { audio: { decoders: {}, encoders: {} }, video: { inputArgs: [ "-init_hw_device", "vaapi=va:,driver=iHD,kernel_driver=i915", "-init_hw_device", "qsv=qs@va", "-filter_hw_device", "qs", "-hwaccel", "vaapi", "-hwaccel_output_format", "vaapi" ], decoders: {}, encoders: { libx264: "h264_qsv", hevc: "hevc_qsv", vp9: "vp9_qsv", mpeg2video: "mpeg2_qsv" }, preset: "veryfast", pixelFormat: "nv12", scale: "scale_vaapi", scaleExtra: ":mode=fast", wrapSwFilters: [ "hwdownload", "hwupload_vaapi" ], hwFilters: [ "hwmap=derive_device=qsv", "format=qsv" ], extraOutputArgs: [ "-look_ahead", "0", "-b:v", "{bitrate}", "-maxrate", "{bitrate}", "-bufsize", "{bufsize}" ] } }, amf: { audio: { decoders: {}, encoders: {} }, video: { inputArgs: [ "-init_hw_device", "d3d11va=dx11:,vendor=0x1002", "-init_hw_device", "opencl=ocl@dx11", "-filter_hw_device", "ocl", "-hwaccel", "d3d11va", "-hwaccel_output_format", "d3d11" ], decoders: {}, encoders: { libx264: "h264_amf", hevc: "hevc_amf" }, scalePrefix: "hwmap=derive_device=opencl,", scale: "scale_opencl", scaleExtra: "", pixelFormat: "nv12", wrapSwFilters: [ "hwdownload", "hwupload_vaapi" ], hwFilters: [ "hwmap=derive_device=d3d11va:reverse=1", "format=d3d11" ], extraOutputArgs: [ "-quality", "speed", "-rc", "cbr", "-qmin", "0", "-qmax", "32", "-b:v", "{bitrate}", "-maxrate", "{bitrate}", "-bufsize", "{bufsize}" ] } }, "nvenc-win": { audio: { decoders: {}, encoders: {} }, video: { inputArgs: [ "-init_hw_device", "cuda=cu:0", "-filter_hw_device", "cu", "-hwaccel", "cuda", "-hwaccel_output_format", "cuda", "-threads", "1" ], decoders: {}, encoders: { libx264: "h264_nvenc", hevc: "hevc_nvenc" }, preset: "p1", tune: "ull", scale: "scale_cuda", scaleExtra: "", pixelFormat: "yuv420p", wrapSwFilters: [ "hwdownload", "hwupload_cuda" ], extraOutputArgs: [ "-b:v", "{bitrate}", "-maxrate", "{bitrate}", "-bufsize", "{bufsize}" ], noH264Level: !0 } }, "nvenc-linux": { audio: { decoders: {}, encoders: {} }, video: { inputArgs: [ "-init_hw_device", "cuda=cu:0", "-filter_hw_device", "cu", "-hwaccel", "cuda", "-hwaccel_output_format", "cuda" ], decoders: { hevc: "hevc_cuvid", libx264: "h264_cuvid", av1: "av1_cuvid", mpeg1: "mpeg1_cuvid", mpeg2: "mpeg2_cuvid", mpeg4: "mpeg4_cuvid", vc1: "vc1_cuvid", vp8: "vp8_cuvid", vp9: "vp9_cuvid" }, encoders: { libx264: "h264_nvenc", hevc: "hevc_nvenc" }, preset: "p1", tune: "ull", scale: "scale_cuda", scaleExtra: "", pixelFormat: "yuv420p", wrapSwFilters: [ "hwdownload", "hwupload_cuda" ], extraOutputArgs: [ "-b:v", "{bitrate}", "-maxrate", "{bitrate}", "-bufsize", "{bufsize}" ] } }, "vaapi-renderD128": { audio: { decoders: {}, encoders: {} }, video: { inputArgs: [ "-init_hw_device", "vaapi=va:/dev/dri/renderD128", "-filter_hw_device", "va", "-hwaccel", "vaapi", "-hwaccel_output_format", "vaapi" ], decoders: {}, encoders: { libx264: "h264_vaapi", hevc: "hevc_vaapi", mpeg2: "mpeg2_vaapi", vp8: "vp8_vaapi", vp9: "vp9_vaapi" }, pixelFormat: "nv12", scale: "scale_vaapi", scaleExtra: ":mode=fast", wrapSwFilters: [ "hwdownload", "hwupload_vaapi" ], extraOutputArgs: [ "-rc_mode", "VBR", "-b:v", "{bitrate}", "-maxrate", "{bitrate}", "-bufsize", "{bufsize}" ], noH264Level: !0 } }, v4l2m2m: { audio: { decoders: {}, encoders: {} }, video: { inputArgs: [ "-hwaccel", "drm" ], decoders: { hevc: "hevc" }, encoders: { libx264: "h264_v4l2m2m", hevc: "hevc_v4l2m2m", mpeg2: "mpeg2_v4l2m2m", mpeg4: "mpeg4_v4l2m2m", vp8: "vp8_v4l2m2m", vp9: "vp9_v4l2m2m" }, scale: "scale_v4l2m2m", scaleExtra: "", pixelFormat: "nv12", wrapSwFilters: [ "hwdownload", "hwupload" ], extraOutputArgs: [ "-b:v", "{bitrate}", "-maxrate", "{bitrate}", "-bufsize", "{bufsize}" ] } } }; }, function(module, exports, __webpack_require__) { const EventEmitter = __webpack_require__(4), bridge = "android" !== process.platform || process.env.UNITY_ENV ? null : process._linkedBinding("android_bridge"), events = {}, eventEmitter = new EventEmitter; module.exports = { dispatch: (event, data) => { null !== bridge && bridge.dispatch(event, JSON.stringify(data)); }, on: (event, cb) => { null !== bridge && (events[event] || (events[event] = !0, bridge.setListener(event, (data => { eventEmitter.emit(event, JSON.parse(data)); }))), eventEmitter.on(event, cb)); }, off: (event, cb) => { null !== bridge && eventEmitter.off(event, cb); } }; }, function(module, exports, __webpack_require__) { exports.encode = function Bencode(obj) { var n, buf, buffer = null; switch (typeof obj) { case "string": return (function(obj) { var blen = Buffer.byteLength(obj), len = blen.toString(10), buf = new Buffer(len.length + 1 + blen); return buf.write(len, 0, "ascii"), buf.write(":", len.length, "ascii"), buf.write(obj, len.length + 1, "utf8"), buf; })(obj); case "number": return n = obj.toString(10), (buf = new Buffer(n.length + 2)).write("i", 0), buf.write(n, 1), buf.write("e", n.length + 1), buf; case "object": return obj instanceof Array ? (function(obj) { var func = function(obj, pos) { return obj.forEach((function(o) { var elem = new Bencode(o); ensure(elem.length, pos), elem.copy(buffer, pos, 0), pos += elem.length; })), pos; }; return assemble(obj, "l", func); })(obj) : Buffer.isBuffer(obj) ? (function(obj) { var len = obj.length.toString(10), buf = new Buffer(len.length + 1 + obj.length); return buf.write(len, 0, "ascii"), buf.write(":", len.length, "ascii"), obj.copy(buf, len.length + 1, 0), buf; })(obj) : (function(obj) { var func = function(obj, pos) { return Object.keys(obj).sort().forEach((function(key) { var val = new Bencode(obj[key]); ensure((key = new Bencode(key)).length + val.length, pos), key.copy(buffer, pos, 0), pos += key.length, val.copy(buffer, pos, 0), pos += val.length; })), pos; }; return assemble(obj, "d", func); })(obj); } function assemble(obj, prefix, func) { var pos = 0; return ensure(1024, 0), buffer.write(prefix, pos++), ensure(1, pos = func(obj, pos)), buffer.write("e", pos++), buffer.slice(0, pos); } function ensure(num, pos) { if (buffer) { if (buffer.length > num + pos + 1) return; var buf2 = new Buffer(buffer.length + num); buffer.copy(buf2, 0, 0), buffer = buf2; } else buffer = new Buffer(num); } }, exports.decoder = Bdecode, exports.decode = function(buffer, encoding) { var decoder = new Bdecode; return decoder.decode(buffer, encoding), decoder.result()[0]; }, exports.Stream = Stream; var inherits = __webpack_require__(0).inherits, Transform = __webpack_require__(3).Transform, I = "i".charCodeAt(0), L = "l".charCodeAt(0), E = "e".charCodeAt(0), D = "d".charCodeAt(0), COLON = ":".charCodeAt(0), DASH = "-".charCodeAt(0); function BdecodeSMachine(cb, cb_list, cb_dict, cb_end) { var depth = 0, state = 0; this.consistent = function() { return 0 === state && 0 === depth; }; var strLen = 0, str = "", _int = 0, neg = !1; function integer(value) { return "number" == typeof value && (function(val, min, max) { return 48 <= val && val <= 57; })(value); } this.parse = function(buffer, encoding) { "string" == typeof buffer && (buffer = new Buffer(buffer, encoding || "utf8")); for (var pos = 0; pos !== buffer.length; ++pos) switch (state) { case 0: switch (buffer[pos]) { case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: state = 1, strLen = 0, strLen += buffer[pos] - 48; break; case I: state = 4, _int = 0, neg = !1; break; case L: state = 0, depth += 1, cb_list(); break; case D: state = 0, depth += 1, cb_dict(); break; case E: if (state = 0, (depth -= 1) < 0) throw new Error("end with no beginning: " + pos); cb_end(); } break; case 1: integer(buffer[pos]) ? (strLen *= 10, strLen += buffer[pos] - 48) : (str = new Buffer(strLen), pos -= 1, state = 3); break; case 3: if (buffer[pos] !== COLON) throw new Error("not a colon at: " + pos.toString(16)); state = 2, 0 === strLen && (cb(new Buffer(0)), state = 0); break; case 2: 0 === strLen ? (cb(str), state = 0) : (str[str.length - strLen] = buffer[pos], 0 == (strLen -= 1) && (cb(str), state = 0)); break; case 4: if (state = 5, buffer[pos] === DASH) { neg = !0; break; } case 5: if (integer(buffer[pos])) _int *= 10, _int += buffer[pos] - 48; else { if (buffer[pos] !== E) throw new Error("not part of int at:" + pos.toString(16)); cb(neg ? 0 - _int : _int), state = 0; } } }; } function Bdecode() { var DICTIONARY_START = {}, LIST_START = {}, ctx = new (function() { var self = this, stack = []; this.cb = function(o) { stack.push(o); }, this.cb_list = function() { self.cb(LIST_START); }, this.cb_dict = function() { self.cb(DICTIONARY_START); }, this.cb_end = function() { for (var obj = null, tmp_stack = []; void 0 !== (obj = stack.pop()); ) { if (LIST_START === obj) { for (var obj2 = null, list = []; void 0 !== (obj2 = tmp_stack.pop()); ) list.push(obj2); self.cb(list); break; } if (DICTIONARY_START === obj) { for (var key = null, val = null, dic = {}; void 0 !== (key = tmp_stack.pop()) && void 0 !== (val = tmp_stack.pop()); ) dic[key.toString()] = val; if (void 0 !== key && void 0 === dic[key]) throw new Error("uneven number of keys and values A"); self.cb(dic); break; } tmp_stack.push(obj); } if (tmp_stack.length > 0) throw new Error("uneven number of keys and values B"); }, this.result = function() { return stack; }; }), smachine = new BdecodeSMachine(ctx.cb, ctx.cb_list, ctx.cb_dict, ctx.cb_end); this.result = function() { if (!smachine.consistent()) throw new Error("not in consistent state. More bytes coming?"); return ctx.result(); }, this.decode = function(buf, encoding) { smachine.parse(buf, encoding); }; } function Stream(options) { (options = options || {}).objectMode = !0, Transform.call(this, options), this._decoder = new Bdecode; } inherits(Stream, Transform), Stream.prototype._transform = function(chunk, encoding, callback) { try { this._decoder.decode(chunk, encoding), callback(null); } catch (err) { callback(err); } }, Stream.prototype._flush = function(callback) { this.push(this._decoder.result()[0]), callback(null); }; }, function(module, exports, __webpack_require__) { module.exports = glob; var rp = __webpack_require__(423), minimatch = __webpack_require__(197), inherits = (minimatch.Minimatch, __webpack_require__(8)), EE = __webpack_require__(4).EventEmitter, path = __webpack_require__(5), assert = __webpack_require__(25), isAbsolute = __webpack_require__(198), globSync = __webpack_require__(838), common = __webpack_require__(424), setopts = common.setopts, ownProp = common.ownProp, inflight = __webpack_require__(839), childrenIgnored = (__webpack_require__(0), common.childrenIgnored), isIgnored = common.isIgnored, once = __webpack_require__(35); function glob(pattern, options, cb) { if ("function" == typeof options && (cb = options, options = {}), options || (options = {}), options.sync) { if (cb) throw new TypeError("callback provided to sync glob"); return globSync(pattern, options); } return new Glob(pattern, options, cb); } glob.sync = globSync; var GlobSync = glob.GlobSync = globSync.GlobSync; function Glob(pattern, options, cb) { if ("function" == typeof options && (cb = options, options = null), options && options.sync) { if (cb) throw new TypeError("callback provided to sync glob"); return new GlobSync(pattern, options); } if (!(this instanceof Glob)) return new Glob(pattern, options, cb); setopts(this, pattern, options), this._didRealPath = !1; var n = this.minimatch.set.length; this.matches = new Array(n), "function" == typeof cb && (cb = once(cb), this.on("error", cb), this.on("end", (function(matches) { cb(null, matches); }))); var self = this; if (this._processing = 0, this._emitQueue = [], this._processQueue = [], this.paused = !1, this.noprocess) return this; if (0 === n) return done(); for (var i = 0; i < n; i++) this._process(this.minimatch.set[i], i, !1, done); function done() { --self._processing, self._processing <= 0 && self._finish(); } } glob.glob = glob, glob.hasMagic = function(pattern, options_) { var options = (function(origin, add) { if (null === add || "object" != typeof add) return origin; for (var keys = Object.keys(add), i = keys.length; i--; ) origin[keys[i]] = add[keys[i]]; return origin; })({}, options_); options.noprocess = !0; var set = new Glob(pattern, options).minimatch.set; if (!pattern) return !1; if (set.length > 1) return !0; for (var j = 0; j < set[0].length; j++) if ("string" != typeof set[0][j]) return !0; return !1; }, glob.Glob = Glob, inherits(Glob, EE), Glob.prototype._finish = function() { if (assert(this instanceof Glob), !this.aborted) { if (this.realpath && !this._didRealpath) return this._realpath(); common.finish(this), this.emit("end", this.found); } }, Glob.prototype._realpath = function() { if (!this._didRealpath) { this._didRealpath = !0; var n = this.matches.length; if (0 === n) return this._finish(); for (var self = this, i = 0; i < this.matches.length; i++) this._realpathSet(i, next); } function next() { 0 == --n && self._finish(); } }, Glob.prototype._realpathSet = function(index, cb) { var matchset = this.matches[index]; if (!matchset) return cb(); var found = Object.keys(matchset), self = this, n = found.length; if (0 === n) return cb(); var set = this.matches[index] = Object.create(null); found.forEach((function(p, i) { p = self._makeAbs(p), rp.realpath(p, self.realpathCache, (function(er, real) { er ? "stat" === er.syscall ? set[p] = !0 : self.emit("error", er) : set[real] = !0, 0 == --n && (self.matches[index] = set, cb()); })); })); }, Glob.prototype._mark = function(p) { return common.mark(this, p); }, Glob.prototype._makeAbs = function(f) { return common.makeAbs(this, f); }, Glob.prototype.abort = function() { this.aborted = !0, this.emit("abort"); }, Glob.prototype.pause = function() { this.paused || (this.paused = !0, this.emit("pause")); }, Glob.prototype.resume = function() { if (this.paused) { if (this.emit("resume"), this.paused = !1, this._emitQueue.length) { var eq = this._emitQueue.slice(0); this._emitQueue.length = 0; for (var i = 0; i < eq.length; i++) { var e = eq[i]; this._emitMatch(e[0], e[1]); } } if (this._processQueue.length) { var pq = this._processQueue.slice(0); for (this._processQueue.length = 0, i = 0; i < pq.length; i++) { var p = pq[i]; this._processing--, this._process(p[0], p[1], p[2], p[3]); } } } }, Glob.prototype._process = function(pattern, index, inGlobStar, cb) { if (assert(this instanceof Glob), assert("function" == typeof cb), !this.aborted) if (this._processing++, this.paused) this._processQueue.push([ pattern, index, inGlobStar, cb ]); else { for (var prefix, n = 0; "string" == typeof pattern[n]; ) n++; switch (n) { case pattern.length: return void this._processSimple(pattern.join("/"), index, cb); case 0: prefix = null; break; default: prefix = pattern.slice(0, n).join("/"); } var read, remain = pattern.slice(n); null === prefix ? read = "." : isAbsolute(prefix) || isAbsolute(pattern.join("/")) ? (prefix && isAbsolute(prefix) || (prefix = "/" + prefix), read = prefix) : read = prefix; var abs = this._makeAbs(read); if (childrenIgnored(this, read)) return cb(); remain[0] === minimatch.GLOBSTAR ? this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) : this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb); } }, Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) { var self = this; this._readdir(abs, inGlobStar, (function(er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb); })); }, Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) { if (!entries) return cb(); for (var pn = remain[0], negate = !!this.minimatch.negate, rawGlob = pn._glob, dotOk = this.dot || "." === rawGlob.charAt(0), matchedEntries = [], i = 0; i < entries.length; i++) ("." !== (e = entries[i]).charAt(0) || dotOk) && (negate && !prefix ? !e.match(pn) : e.match(pn)) && matchedEntries.push(e); var len = matchedEntries.length; if (0 === len) return cb(); if (1 === remain.length && !this.mark && !this.stat) { for (this.matches[index] || (this.matches[index] = Object.create(null)), i = 0; i < len; i++) { var e = matchedEntries[i]; prefix && (e = "/" !== prefix ? prefix + "/" + e : prefix + e), "/" !== e.charAt(0) || this.nomount || (e = path.join(this.root, e)), this._emitMatch(index, e); } return cb(); } for (remain.shift(), i = 0; i < len; i++) e = matchedEntries[i], prefix && (e = "/" !== prefix ? prefix + "/" + e : prefix + e), this._process([ e ].concat(remain), index, inGlobStar, cb); cb(); }, Glob.prototype._emitMatch = function(index, e) { if (!this.aborted && !isIgnored(this, e)) if (this.paused) this._emitQueue.push([ index, e ]); else { var abs = isAbsolute(e) ? e : this._makeAbs(e); if (this.mark && (e = this._mark(e)), this.absolute && (e = abs), !this.matches[index][e]) { if (this.nodir) { var c = this.cache[abs]; if ("DIR" === c || Array.isArray(c)) return; } this.matches[index][e] = !0; var st = this.statCache[abs]; st && this.emit("stat", e, st), this.emit("match", e); } } }, Glob.prototype._readdirInGlobStar = function(abs, cb) { if (!this.aborted) { if (this.follow) return this._readdir(abs, !1, cb); var self = this, lstatcb = inflight("lstat\0" + abs, (function(er, lstat) { if (er && "ENOENT" === er.code) return cb(); var isSym = lstat && lstat.isSymbolicLink(); self.symlinks[abs] = isSym, isSym || !lstat || lstat.isDirectory() ? self._readdir(abs, !1, cb) : (self.cache[abs] = "FILE", cb()); })); lstatcb && self.fs.lstat(abs, lstatcb); } }, Glob.prototype._readdir = function(abs, inGlobStar, cb) { if (!this.aborted && (cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb))) { if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb); if (ownProp(this.cache, abs)) { var c = this.cache[abs]; if (!c || "FILE" === c) return cb(); if (Array.isArray(c)) return cb(null, c); } this.fs.readdir(abs, (function(self, abs, cb) { return function(er, entries) { er ? self._readdirError(abs, er, cb) : self._readdirEntries(abs, entries, cb); }; })(this, abs, cb)); } }, Glob.prototype._readdirEntries = function(abs, entries, cb) { if (!this.aborted) { if (!this.mark && !this.stat) for (var i = 0; i < entries.length; i++) { var e = entries[i]; e = "/" === abs ? abs + e : abs + "/" + e, this.cache[e] = !0; } return this.cache[abs] = entries, cb(null, entries); } }, Glob.prototype._readdirError = function(f, er, cb) { if (!this.aborted) { switch (er.code) { case "ENOTSUP": case "ENOTDIR": var abs = this._makeAbs(f); if (this.cache[abs] = "FILE", abs === this.cwdAbs) { var error = new Error(er.code + " invalid cwd " + this.cwd); error.path = this.cwd, error.code = er.code, this.emit("error", error), this.abort(); } break; case "ENOENT": case "ELOOP": case "ENAMETOOLONG": case "UNKNOWN": this.cache[this._makeAbs(f)] = !1; break; default: this.cache[this._makeAbs(f)] = !1, this.strict && (this.emit("error", er), this.abort()), this.silent || console.error("glob error", er); } return cb(); } }, Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) { var self = this; this._readdir(abs, inGlobStar, (function(er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb); })); }, Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) { if (!entries) return cb(); var remainWithoutGlobStar = remain.slice(1), gspref = prefix ? [ prefix ] : [], noGlobStar = gspref.concat(remainWithoutGlobStar); this._process(noGlobStar, index, !1, cb); var isSym = this.symlinks[abs], len = entries.length; if (isSym && inGlobStar) return cb(); for (var i = 0; i < len; i++) if ("." !== entries[i].charAt(0) || this.dot) { var instead = gspref.concat(entries[i], remainWithoutGlobStar); this._process(instead, index, !0, cb); var below = gspref.concat(entries[i], remain); this._process(below, index, !0, cb); } cb(); }, Glob.prototype._processSimple = function(prefix, index, cb) { var self = this; this._stat(prefix, (function(er, exists) { self._processSimple2(prefix, index, er, exists, cb); })); }, Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) { if (this.matches[index] || (this.matches[index] = Object.create(null)), !exists) return cb(); if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix); "/" === prefix.charAt(0) ? prefix = path.join(this.root, prefix) : (prefix = path.resolve(this.root, prefix), trail && (prefix += "/")); } "win32" === process.platform && (prefix = prefix.replace(/\\/g, "/")), this._emitMatch(index, prefix), cb(); }, Glob.prototype._stat = function(f, cb) { var abs = this._makeAbs(f), needDir = "/" === f.slice(-1); if (f.length > this.maxLength) return cb(); if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs]; if (Array.isArray(c) && (c = "DIR"), !needDir || "DIR" === c) return cb(null, c); if (needDir && "FILE" === c) return cb(); } var stat = this.statCache[abs]; if (void 0 !== stat) { if (!1 === stat) return cb(null, stat); var type = stat.isDirectory() ? "DIR" : "FILE"; return needDir && "FILE" === type ? cb() : cb(null, type, stat); } var self = this, statcb = inflight("stat\0" + abs, (function(er, lstat) { if (lstat && lstat.isSymbolicLink()) return self.fs.stat(abs, (function(er, stat) { er ? self._stat2(f, abs, null, lstat, cb) : self._stat2(f, abs, er, stat, cb); })); self._stat2(f, abs, er, lstat, cb); })); statcb && self.fs.lstat(abs, statcb); }, Glob.prototype._stat2 = function(f, abs, er, stat, cb) { if (er && ("ENOENT" === er.code || "ENOTDIR" === er.code)) return this.statCache[abs] = !1, cb(); var needDir = "/" === f.slice(-1); if (this.statCache[abs] = stat, "/" === abs.slice(-1) && stat && !stat.isDirectory()) return cb(null, !1, stat); var c = !0; return stat && (c = stat.isDirectory() ? "DIR" : "FILE"), this.cache[abs] = this.cache[abs] || c, needDir && "FILE" === c ? cb() : cb(null, c, stat); }; }, function(module, exports, __webpack_require__) { module.exports = minimatch, minimatch.Minimatch = Minimatch; var path = (function() { try { return __webpack_require__(5); } catch (e) {} })() || { sep: "/" }; minimatch.sep = path.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}, expand = __webpack_require__(835), plTypes = { "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, "?": { open: "(?:", close: ")?" }, "+": { open: "(?:", close: ")+" }, "*": { open: "(?:", close: ")*" }, "@": { open: "(?:", close: ")" } }, reSpecials = "().*{}+?[]^$\\!".split("").reduce((function(set, c) { return set[c] = !0, set; }), {}), slashSplit = /\/+/; function ext(a, b) { b = b || {}; var t = {}; return Object.keys(a).forEach((function(k) { t[k] = a[k]; })), Object.keys(b).forEach((function(k) { t[k] = b[k]; })), t; } function minimatch(p, pattern, options) { return assertValidPattern(pattern), options || (options = {}), !(!options.nocomment && "#" === pattern.charAt(0)) && new Minimatch(pattern, options).match(p); } function Minimatch(pattern, options) { if (!(this instanceof Minimatch)) return new Minimatch(pattern, options); assertValidPattern(pattern), options || (options = {}), pattern = pattern.trim(), options.allowWindowsEscape || "/" === path.sep || (pattern = pattern.split(path.sep).join("/")), this.options = options, this.set = [], this.pattern = pattern, this.regexp = null, this.negate = !1, this.comment = !1, this.empty = !1, this.partial = !!options.partial, this.make(); } function braceExpand(pattern, options) { return options || (options = this instanceof Minimatch ? this.options : {}), pattern = void 0 === pattern ? this.pattern : pattern, assertValidPattern(pattern), options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern) ? [ pattern ] : expand(pattern); } minimatch.filter = function(pattern, options) { return options = options || {}, function(p, i, list) { return minimatch(p, pattern, options); }; }, minimatch.defaults = function(def) { if (!def || "object" != typeof def || !Object.keys(def).length) return minimatch; var orig = minimatch, m = function(p, pattern, options) { return orig(p, pattern, ext(def, options)); }; return (m.Minimatch = function(pattern, options) { return new orig.Minimatch(pattern, ext(def, options)); }).defaults = function(options) { return orig.defaults(ext(def, options)).Minimatch; }, m.filter = function(pattern, options) { return orig.filter(pattern, ext(def, options)); }, m.defaults = function(options) { return orig.defaults(ext(def, options)); }, m.makeRe = function(pattern, options) { return orig.makeRe(pattern, ext(def, options)); }, m.braceExpand = function(pattern, options) { return orig.braceExpand(pattern, ext(def, options)); }, m.match = function(list, pattern, options) { return orig.match(list, pattern, ext(def, options)); }, m; }, Minimatch.defaults = function(def) { return minimatch.defaults(def).Minimatch; }, Minimatch.prototype.debug = function() {}, Minimatch.prototype.make = function() { var pattern = this.pattern, options = this.options; if (options.nocomment || "#" !== pattern.charAt(0)) if (pattern) { this.parseNegate(); var set = this.globSet = this.braceExpand(); options.debug && (this.debug = function() { console.error.apply(console, arguments); }), this.debug(this.pattern, set), set = this.globParts = set.map((function(s) { return s.split(slashSplit); })), this.debug(this.pattern, set), set = set.map((function(s, si, set) { return s.map(this.parse, this); }), this), this.debug(this.pattern, set), set = set.filter((function(s) { return -1 === s.indexOf(!1); })), this.debug(this.pattern, set), this.set = set; } else this.empty = !0; else this.comment = !0; }, Minimatch.prototype.parseNegate = function() { var pattern = this.pattern, negate = !1, negateOffset = 0; if (!this.options.nonegate) { for (var i = 0, l = pattern.length; i < l && "!" === pattern.charAt(i); i++) negate = !negate, negateOffset++; negateOffset && (this.pattern = pattern.substr(negateOffset)), this.negate = negate; } }, minimatch.braceExpand = function(pattern, options) { return braceExpand(pattern, options); }, Minimatch.prototype.braceExpand = braceExpand; var assertValidPattern = function(pattern) { if ("string" != typeof pattern) throw new TypeError("invalid pattern"); if (pattern.length > 65536) throw new TypeError("pattern is too long"); }; Minimatch.prototype.parse = function(pattern, isSub) { assertValidPattern(pattern); var options = this.options; if ("**" === pattern) { if (!options.noglobstar) return GLOBSTAR; pattern = "*"; } if ("" === pattern) return ""; var stateChar, re = "", hasMagic = !!options.nocase, escaping = !1, patternListStack = [], negativeLists = [], inClass = !1, reClassStart = -1, classStart = -1, patternStart = "." === pattern.charAt(0) ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", self = this; function clearStateChar() { if (stateChar) { switch (stateChar) { case "*": re += "[^/]*?", hasMagic = !0; break; case "?": re += "[^/]", hasMagic = !0; break; default: re += "\\" + stateChar; } self.debug("clearStateChar %j %j", stateChar, re), stateChar = !1; } } for (var c, i = 0, len = pattern.length; i < len && (c = pattern.charAt(i)); i++) if (this.debug("%s\t%s %s %j", pattern, i, re, c), escaping && reSpecials[c]) re += "\\" + c, escaping = !1; else switch (c) { case "/": return !1; case "\\": clearStateChar(), escaping = !0; continue; case "?": case "*": case "+": case "@": case "!": if (this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c), inClass) { this.debug(" in class"), "!" === c && i === classStart + 1 && (c = "^"), re += c; continue; } self.debug("call clearStateChar %j", stateChar), clearStateChar(), stateChar = c, options.noext && clearStateChar(); continue; case "(": if (inClass) { re += "("; continue; } if (!stateChar) { re += "\\("; continue; } patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }), re += "!" === stateChar ? "(?:(?!(?:" : "(?:", this.debug("plType %j %j", stateChar, re), stateChar = !1; continue; case ")": if (inClass || !patternListStack.length) { re += "\\)"; continue; } clearStateChar(), hasMagic = !0; var pl = patternListStack.pop(); re += pl.close, "!" === pl.type && negativeLists.push(pl), pl.reEnd = re.length; continue; case "|": if (inClass || !patternListStack.length || escaping) { re += "\\|", escaping = !1; continue; } clearStateChar(), re += "|"; continue; case "[": if (clearStateChar(), inClass) { re += "\\" + c; continue; } inClass = !0, classStart = i, reClassStart = re.length, re += c; continue; case "]": if (i === classStart + 1 || !inClass) { re += "\\" + c, escaping = !1; continue; } var cs = pattern.substring(classStart + 1, i); try { RegExp("[" + cs + "]"); } catch (er) { var sp = this.parse(cs, SUBPARSE); re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]", hasMagic = hasMagic || sp[1], inClass = !1; continue; } hasMagic = !0, inClass = !1, re += c; continue; default: clearStateChar(), escaping ? escaping = !1 : !reSpecials[c] || "^" === c && inClass || (re += "\\"), re += c; } for (inClass && (cs = pattern.substr(classStart + 1), sp = this.parse(cs, SUBPARSE), re = re.substr(0, reClassStart) + "\\[" + sp[0], hasMagic = hasMagic || sp[1]), pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length); this.debug("setting tail", re, pl), tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (function(_, $1, $2) { return $2 || ($2 = "\\"), $1 + $1 + $2 + "|"; })), this.debug("tail=%j\n %s", tail, tail, pl, re); var t = "*" === pl.type ? "[^/]*?" : "?" === pl.type ? "[^/]" : "\\" + pl.type; hasMagic = !0, re = re.slice(0, pl.reStart) + t + "\\(" + tail; } clearStateChar(), escaping && (re += "\\\\"); var addPatternStart = !1; switch (re.charAt(0)) { case "[": case ".": case "(": addPatternStart = !0; } for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n], nlBefore = re.slice(0, nl.reStart), nlFirst = re.slice(nl.reStart, nl.reEnd - 8), nlLast = re.slice(nl.reEnd - 8, nl.reEnd), nlAfter = re.slice(nl.reEnd); nlLast += nlAfter; var openParensBefore = nlBefore.split("(").length - 1, cleanAfter = nlAfter; for (i = 0; i < openParensBefore; i++) cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); var dollar = ""; "" === (nlAfter = cleanAfter) && isSub !== SUBPARSE && (dollar = "$"), re = nlBefore + nlFirst + nlAfter + dollar + nlLast; } if ("" !== re && hasMagic && (re = "(?=.)" + re), addPatternStart && (re = patternStart + re), isSub === SUBPARSE) return [ re, hasMagic ]; if (!hasMagic) return pattern.replace(/\\(.)/g, "$1"); var flags = options.nocase ? "i" : ""; try { var regExp = new RegExp("^" + re + "$", flags); } catch (er) { return new RegExp("$."); } return regExp._glob = pattern, regExp._src = re, regExp; }; var SUBPARSE = {}; minimatch.makeRe = function(pattern, options) { return new Minimatch(pattern, options || {}).makeRe(); }, Minimatch.prototype.makeRe = function() { if (this.regexp || !1 === this.regexp) return this.regexp; var set = this.set; if (!set.length) return this.regexp = !1, this.regexp; var options = this.options, twoStar = options.noglobstar ? "[^/]*?" : options.dot ? "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?" : "(?:(?!(?:\\/|^)\\.).)*?", flags = options.nocase ? "i" : "", re = set.map((function(pattern) { return pattern.map((function(p) { return p === GLOBSTAR ? twoStar : "string" == typeof p ? p.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") : p._src; })).join("\\/"); })).join("|"); re = "^(?:" + re + ")$", this.negate && (re = "^(?!" + re + ").*$"); try { this.regexp = new RegExp(re, flags); } catch (ex) { this.regexp = !1; } return this.regexp; }, minimatch.match = function(list, pattern, options) { var mm = new Minimatch(pattern, options = options || {}); return list = list.filter((function(f) { return mm.match(f); })), mm.options.nonull && !list.length && list.push(pattern), list; }, Minimatch.prototype.match = function(f, partial) { if (void 0 === partial && (partial = this.partial), this.debug("match", f, this.pattern), this.comment) return !1; if (this.empty) return "" === f; if ("/" === f && partial) return !0; var options = this.options; "/" !== path.sep && (f = f.split(path.sep).join("/")), f = f.split(slashSplit), this.debug(this.pattern, "split", f); var filename, i, set = this.set; for (this.debug(this.pattern, "set", set), i = f.length - 1; i >= 0 && !(filename = f[i]); i--) ; for (i = 0; i < set.length; i++) { var pattern = set[i], file = f; if (options.matchBase && 1 === pattern.length && (file = [ filename ]), this.matchOne(file, pattern, partial)) return !!options.flipNegate || !this.negate; } return !options.flipNegate && this.negate; }, Minimatch.prototype.matchOne = function(file, pattern, partial) { var options = this.options; this.debug("matchOne", { this: this, file: file, pattern: pattern }), this.debug("matchOne", file.length, pattern.length); for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { this.debug("matchOne loop"); var hit, p = pattern[pi], f = file[fi]; if (this.debug(pattern, p, f), !1 === p) return !1; if (p === GLOBSTAR) { this.debug("GLOBSTAR", [ pattern, p, f ]); var fr = fi, pr = pi + 1; if (pr === pl) { for (this.debug("** at the end"); fi < fl; fi++) if ("." === file[fi] || ".." === file[fi] || !options.dot && "." === file[fi].charAt(0)) return !1; return !0; } for (;fr < fl; ) { var swallowee = file[fr]; if (this.debug("\nglobstar while", file, fr, pattern, pr, swallowee), this.matchOne(file.slice(fr), pattern.slice(pr), partial)) return this.debug("globstar found match!", fr, fl, swallowee), !0; if ("." === swallowee || ".." === swallowee || !options.dot && "." === swallowee.charAt(0)) { this.debug("dot detected!", file, fr, pattern, pr); break; } this.debug("globstar swallow a segment, and continue"), fr++; } return !(!partial || (this.debug("\n>>> no match, partial?", file, fr, pattern, pr), fr !== fl)); } if ("string" == typeof p ? (hit = f === p, this.debug("string match", p, f, hit)) : (hit = f.match(p), this.debug("pattern match", p, f, hit)), !hit) return !1; } if (fi === fl && pi === pl) return !0; if (fi === fl) return partial; if (pi === pl) return fi === fl - 1 && "" === file[fi]; throw new Error("wtf?"); }; }, function(module, exports, __webpack_require__) { "use strict"; function posix(path) { return "/" === path.charAt(0); } function win32(path) { var result = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(path), device = result[1] || "", isUnc = Boolean(device && ":" !== device.charAt(1)); return Boolean(result[2] || isUnc); } module.exports = "win32" === process.platform ? win32 : posix, module.exports.posix = posix, module.exports.win32 = win32; }, function(module, exports, __webpack_require__) { var factory; factory = function() { var root = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || Function("return this")() || {}, ArrayProto = Array.prototype, ObjProto = Object.prototype, SymbolProto = "undefined" != typeof Symbol ? Symbol.prototype : null, push = ArrayProto.push, slice = ArrayProto.slice, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty, supportsArrayBuffer = "undefined" != typeof ArrayBuffer, supportsDataView = "undefined" != typeof DataView, nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeCreate = Object.create, nativeIsView = supportsArrayBuffer && ArrayBuffer.isView, _isNaN = isNaN, _isFinite = isFinite, hasEnumBug = !{ toString: null }.propertyIsEnumerable("toString"), nonEnumerableProps = [ "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString" ], MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; function restArguments(func, startIndex) { return startIndex = null == startIndex ? func.length - 1 : +startIndex, function() { for (var length = Math.max(arguments.length - startIndex, 0), rest = Array(length), index = 0; index < length; index++) rest[index] = arguments[index + startIndex]; switch (startIndex) { case 0: return func.call(this, rest); case 1: return func.call(this, arguments[0], rest); case 2: return func.call(this, arguments[0], arguments[1], rest); } var args = Array(startIndex + 1); for (index = 0; index < startIndex; index++) args[index] = arguments[index]; return args[startIndex] = rest, func.apply(this, args); }; } function isObject(obj) { var type = typeof obj; return "function" === type || "object" === type && !!obj; } function isUndefined(obj) { return void 0 === obj; } function isBoolean(obj) { return !0 === obj || !1 === obj || "[object Boolean]" === toString.call(obj); } function tagTester(name) { var tag = "[object " + name + "]"; return function(obj) { return toString.call(obj) === tag; }; } var isString = tagTester("String"), isNumber = tagTester("Number"), isDate = tagTester("Date"), isRegExp = tagTester("RegExp"), isError = tagTester("Error"), isSymbol = tagTester("Symbol"), isArrayBuffer = tagTester("ArrayBuffer"), isFunction = tagTester("Function"), nodelist = root.document && root.document.childNodes; "object" != typeof Int8Array && "function" != typeof nodelist && (isFunction = function(obj) { return "function" == typeof obj || !1; }); var isFunction$1 = isFunction, hasObjectTag = tagTester("Object"), hasStringTagBug = supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))), isIE11 = "undefined" != typeof Map && hasObjectTag(new Map), isDataView = tagTester("DataView"), isDataView$1 = hasStringTagBug ? function(obj) { return null != obj && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer); } : isDataView, isArray = nativeIsArray || tagTester("Array"); function has$1(obj, key) { return null != obj && hasOwnProperty.call(obj, key); } var isArguments = tagTester("Arguments"); !(function() { isArguments(arguments) || (isArguments = function(obj) { return has$1(obj, "callee"); }); })(); var isArguments$1 = isArguments; function isNaN$1(obj) { return isNumber(obj) && _isNaN(obj); } function constant(value) { return function() { return value; }; } function createSizePropertyCheck(getSizeProperty) { return function(collection) { var sizeProperty = getSizeProperty(collection); return "number" == typeof sizeProperty && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; }; } function shallowProperty(key) { return function(obj) { return null == obj ? void 0 : obj[key]; }; } var getByteLength = shallowProperty("byteLength"), isBufferLike = createSizePropertyCheck(getByteLength), typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/, isTypedArray$1 = supportsArrayBuffer ? function(obj) { return nativeIsView ? nativeIsView(obj) && !isDataView$1(obj) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); } : constant(!1), getLength = shallowProperty("length"); function collectNonEnumProps(obj, keys) { keys = (function(keys) { for (var hash = {}, l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = !0; return { contains: function(key) { return !0 === hash[key]; }, push: function(key) { return hash[key] = !0, keys.push(key); } }; })(keys); var nonEnumIdx = nonEnumerableProps.length, constructor = obj.constructor, proto = isFunction$1(constructor) && constructor.prototype || ObjProto, prop = "constructor"; for (has$1(obj, prop) && !keys.contains(prop) && keys.push(prop); nonEnumIdx--; ) (prop = nonEnumerableProps[nonEnumIdx]) in obj && obj[prop] !== proto[prop] && !keys.contains(prop) && keys.push(prop); } function keys(obj) { if (!isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) has$1(obj, key) && keys.push(key); return hasEnumBug && collectNonEnumProps(obj, keys), keys; } function isMatch(object, attrs) { var _keys = keys(attrs), length = _keys.length; if (null == object) return !length; for (var obj = Object(object), i = 0; i < length; i++) { var key = _keys[i]; if (attrs[key] !== obj[key] || !(key in obj)) return !1; } return !0; } function _$1(obj) { return obj instanceof _$1 ? obj : this instanceof _$1 ? void (this._wrapped = obj) : new _$1(obj); } function toBufferView(bufferSource) { return new Uint8Array(bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, getByteLength(bufferSource)); } function eq(a, b, aStack, bStack) { if (a === b) return 0 !== a || 1 / a == 1 / b; if (null == a || null == b) return !1; if (a != a) return b != b; var type = typeof a; return ("function" === type || "object" === type || "object" == typeof b) && deepEq(a, b, aStack, bStack); } function deepEq(a, b, aStack, bStack) { a instanceof _$1 && (a = a._wrapped), b instanceof _$1 && (b = b._wrapped); var className = toString.call(a); if (className !== toString.call(b)) return !1; if (hasStringTagBug && "[object Object]" == className && isDataView$1(a)) { if (!isDataView$1(b)) return !1; className = "[object DataView]"; } switch (className) { case "[object RegExp]": case "[object String]": return "" + a == "" + b; case "[object Number]": return +a != +a ? +b != +b : 0 == +a ? 1 / +a == 1 / b : +a == +b; case "[object Date]": case "[object Boolean]": return +a == +b; case "[object Symbol]": return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); case "[object ArrayBuffer]": case "[object DataView]": return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); } var areArrays = "[object Array]" === className; if (!areArrays && isTypedArray$1(a)) { if (getByteLength(a) !== getByteLength(b)) return !1; if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return !0; areArrays = !0; } if (!areArrays) { if ("object" != typeof a || "object" != typeof b) return !1; var aCtor = a.constructor, bCtor = b.constructor; if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && isFunction$1(bCtor) && bCtor instanceof bCtor) && "constructor" in a && "constructor" in b) return !1; } bStack = bStack || []; for (var length = (aStack = aStack || []).length; length--; ) if (aStack[length] === a) return bStack[length] === b; if (aStack.push(a), bStack.push(b), areArrays) { if ((length = a.length) !== b.length) return !1; for (;length--; ) if (!eq(a[length], b[length], aStack, bStack)) return !1; } else { var key, _keys = keys(a); if (length = _keys.length, keys(b).length !== length) return !1; for (;length--; ) if (!has$1(b, key = _keys[length]) || !eq(a[key], b[key], aStack, bStack)) return !1; } return aStack.pop(), bStack.pop(), !0; } function allKeys(obj) { if (!isObject(obj)) return []; var keys = []; for (var key in obj) keys.push(key); return hasEnumBug && collectNonEnumProps(obj, keys), keys; } function ie11fingerprint(methods) { var length = getLength(methods); return function(obj) { if (null == obj) return !1; var keys = allKeys(obj); if (getLength(keys)) return !1; for (var i = 0; i < length; i++) if (!isFunction$1(obj[methods[i]])) return !1; return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); }; } _$1.VERSION = "1.13.2", _$1.prototype.value = function() { return this._wrapped; }, _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value, _$1.prototype.toString = function() { return String(this._wrapped); }; var forEachName = "forEach", commonInit = [ "clear", "delete" ], mapTail = [ "get", "has", "set" ], mapMethods = commonInit.concat(forEachName, mapTail), weakMapMethods = commonInit.concat(mapTail), setMethods = [ "add" ].concat(commonInit, forEachName, "has"), isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester("Map"), isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester("WeakMap"), isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester("Set"), isWeakSet = tagTester("WeakSet"); function values(obj) { for (var _keys = keys(obj), length = _keys.length, values = Array(length), i = 0; i < length; i++) values[i] = obj[_keys[i]]; return values; } function invert(obj) { for (var result = {}, _keys = keys(obj), i = 0, length = _keys.length; i < length; i++) result[obj[_keys[i]]] = _keys[i]; return result; } function functions(obj) { var names = []; for (var key in obj) isFunction$1(obj[key]) && names.push(key); return names.sort(); } function createAssigner(keysFunc, defaults) { return function(obj) { var length = arguments.length; if (defaults && (obj = Object(obj)), length < 2 || null == obj) return obj; for (var index = 1; index < length; index++) for (var source = arguments[index], keys = keysFunc(source), l = keys.length, i = 0; i < l; i++) { var key = keys[i]; defaults && void 0 !== obj[key] || (obj[key] = source[key]); } return obj; }; } var extend = createAssigner(allKeys), extendOwn = createAssigner(keys), defaults = createAssigner(allKeys, !0); function baseCreate(prototype) { if (!isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); var Ctor = function() {}; Ctor.prototype = prototype; var result = new Ctor; return Ctor.prototype = null, result; } function toPath$1(path) { return isArray(path) ? path : [ path ]; } function toPath(path) { return _$1.toPath(path); } function deepGet(obj, path) { for (var length = path.length, i = 0; i < length; i++) { if (null == obj) return; obj = obj[path[i]]; } return length ? obj : void 0; } function get(object, path, defaultValue) { var value = deepGet(object, toPath(path)); return isUndefined(value) ? defaultValue : value; } function identity(value) { return value; } function matcher(attrs) { return attrs = extendOwn({}, attrs), function(obj) { return isMatch(obj, attrs); }; } function property(path) { return path = toPath(path), function(obj) { return deepGet(obj, path); }; } function optimizeCb(func, context, argCount) { if (void 0 === context) return func; switch (null == argCount ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; } function baseIteratee(value, context, argCount) { return null == value ? identity : isFunction$1(value) ? optimizeCb(value, context, argCount) : isObject(value) && !isArray(value) ? matcher(value) : property(value); } function iteratee(value, context) { return baseIteratee(value, context, 1 / 0); } function cb(value, context, argCount) { return _$1.iteratee !== iteratee ? _$1.iteratee(value, context) : baseIteratee(value, context, argCount); } function noop() {} function random(min, max) { return null == max && (max = min, min = 0), min + Math.floor(Math.random() * (max - min + 1)); } _$1.toPath = toPath$1, _$1.iteratee = iteratee; var now = Date.now || function() { return (new Date).getTime(); }; function createEscaper(map) { var escaper = function(match) { return map[match]; }, source = "(?:" + keys(map).join("|") + ")", testRegexp = RegExp(source), replaceRegexp = RegExp(source, "g"); return function(string) { return string = null == string ? "" : "" + string, testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; } var escapeMap = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }, _escape = createEscaper(escapeMap), _unescape = createEscaper(invert(escapeMap)), templateSettings = _$1.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }, noMatch = /(.)^/, escapes = { "'": "'", "\\": "\\", "\r": "r", "\n": "n", "\u2028": "u2028", "\u2029": "u2029" }, escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; function escapeChar(match) { return "\\" + escapes[match]; } var bareIdentifier = /^\s*(\w|\$)+\s*$/, idCounter = 0; function executeBound(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prototype), result = sourceFunc.apply(self, args); return isObject(result) ? result : self; } var partial = restArguments((function(func, boundArgs) { var placeholder = partial.placeholder, bound = function() { for (var position = 0, length = boundArgs.length, args = Array(length), i = 0; i < length; i++) args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; for (;position < arguments.length; ) args.push(arguments[position++]); return executeBound(func, bound, this, this, args); }; return bound; })); partial.placeholder = _$1; var bind = restArguments((function(func, context, args) { if (!isFunction$1(func)) throw new TypeError("Bind must be called on a function"); var bound = restArguments((function(callArgs) { return executeBound(func, bound, context, this, args.concat(callArgs)); })); return bound; })), isArrayLike = createSizePropertyCheck(getLength); function flatten$1(input, depth, strict, output) { if (output = output || [], depth || 0 === depth) { if (depth <= 0) return output.concat(input); } else depth = 1 / 0; for (var idx = output.length, i = 0, length = getLength(input); i < length; i++) { var value = input[i]; if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) if (depth > 1) flatten$1(value, depth - 1, strict, output), idx = output.length; else for (var j = 0, len = value.length; j < len; ) output[idx++] = value[j++]; else strict || (output[idx++] = value); } return output; } var bindAll = restArguments((function(obj, keys) { var index = (keys = flatten$1(keys, !1, !1)).length; if (index < 1) throw new Error("bindAll must be passed function names"); for (;index--; ) { var key = keys[index]; obj[key] = bind(obj[key], obj); } return obj; })), delay = restArguments((function(func, wait, args) { return setTimeout((function() { return func.apply(null, args); }), wait); })), defer = partial(delay, _$1, 1); function negate(predicate) { return function() { return !predicate.apply(this, arguments); }; } function before(times, func) { var memo; return function() { return --times > 0 && (memo = func.apply(this, arguments)), times <= 1 && (func = null), memo; }; } var once = partial(before, 2); function findKey(obj, predicate, context) { predicate = cb(predicate, context); for (var key, _keys = keys(obj), i = 0, length = _keys.length; i < length; i++) if (predicate(obj[key = _keys[i]], key, obj)) return key; } function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); for (var length = getLength(array), index = dir > 0 ? 0 : length - 1; index >= 0 && index < length; index += dir) if (predicate(array[index], index, array)) return index; return -1; }; } var findIndex = createPredicateIndexFinder(1), findLastIndex = createPredicateIndexFinder(-1); function sortedIndex(array, obj, iteratee, context) { for (var value = (iteratee = cb(iteratee, context, 1))(obj), low = 0, high = getLength(array); low < high; ) { var mid = Math.floor((low + high) / 2); iteratee(array[mid]) < value ? low = mid + 1 : high = mid; } return low; } function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if ("number" == typeof idx) dir > 0 ? i = idx >= 0 ? idx : Math.max(idx + length, i) : length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; else if (sortedIndex && idx && length) return array[idx = sortedIndex(array, item)] === item ? idx : -1; if (item != item) return (idx = predicateFind(slice.call(array, i, length), isNaN$1)) >= 0 ? idx + i : -1; for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) if (array[idx] === item) return idx; return -1; }; } var indexOf = createIndexFinder(1, findIndex, sortedIndex), lastIndexOf = createIndexFinder(-1, findLastIndex); function find(obj, predicate, context) { var key = (isArrayLike(obj) ? findIndex : findKey)(obj, predicate, context); if (void 0 !== key && -1 !== key) return obj[key]; } function each(obj, iteratee, context) { var i, length; if (iteratee = optimizeCb(iteratee, context), isArrayLike(obj)) for (i = 0, length = obj.length; i < length; i++) iteratee(obj[i], i, obj); else { var _keys = keys(obj); for (i = 0, length = _keys.length; i < length; i++) iteratee(obj[_keys[i]], _keys[i], obj); } return obj; } function map(obj, iteratee, context) { iteratee = cb(iteratee, context); for (var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, results = Array(length), index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; } function createReduce(dir) { var reducer = function(obj, iteratee, memo, initial) { var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, index = dir > 0 ? 0 : length - 1; for (initial || (memo = obj[_keys ? _keys[index] : index], index += dir); index >= 0 && index < length; index += dir) { var currentKey = _keys ? _keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }; return function(obj, iteratee, memo, context) { var initial = arguments.length >= 3; return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); }; } var reduce = createReduce(1), reduceRight = createReduce(-1); function filter(obj, predicate, context) { var results = []; return predicate = cb(predicate, context), each(obj, (function(value, index, list) { predicate(value, index, list) && results.push(value); })), results; } function every(obj, predicate, context) { predicate = cb(predicate, context); for (var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return !1; } return !0; } function some(obj, predicate, context) { predicate = cb(predicate, context); for (var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return !0; } return !1; } function contains(obj, item, fromIndex, guard) { return isArrayLike(obj) || (obj = values(obj)), ("number" != typeof fromIndex || guard) && (fromIndex = 0), indexOf(obj, item, fromIndex) >= 0; } var invoke = restArguments((function(obj, path, args) { var contextPath, func; return isFunction$1(path) ? func = path : (path = toPath(path), contextPath = path.slice(0, -1), path = path[path.length - 1]), map(obj, (function(context) { var method = func; if (!method) { if (contextPath && contextPath.length && (context = deepGet(context, contextPath)), null == context) return; method = context[path]; } return null == method ? method : method.apply(context, args); })); })); function pluck(obj, key) { return map(obj, property(key)); } function max(obj, iteratee, context) { var value, computed, result = -1 / 0, lastComputed = -1 / 0; if (null == iteratee || "number" == typeof iteratee && "object" != typeof obj[0] && null != obj) for (var i = 0, length = (obj = isArrayLike(obj) ? obj : values(obj)).length; i < length; i++) null != (value = obj[i]) && value > result && (result = value); else iteratee = cb(iteratee, context), each(obj, (function(v, index, list) { ((computed = iteratee(v, index, list)) > lastComputed || computed === -1 / 0 && result === -1 / 0) && (result = v, lastComputed = computed); })); return result; } var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; function toArray(obj) { return obj ? isArray(obj) ? slice.call(obj) : isString(obj) ? obj.match(reStrSymbol) : isArrayLike(obj) ? map(obj, identity) : values(obj) : []; } function sample(obj, n, guard) { if (null == n || guard) return isArrayLike(obj) || (obj = values(obj)), obj[random(obj.length - 1)]; var sample = toArray(obj), length = getLength(sample); n = Math.max(Math.min(n, length), 0); for (var last = length - 1, index = 0; index < n; index++) { var rand = random(index, last), temp = sample[index]; sample[index] = sample[rand], sample[rand] = temp; } return sample.slice(0, n); } function group(behavior, partition) { return function(obj, iteratee, context) { var result = partition ? [ [], [] ] : {}; return iteratee = cb(iteratee, context), each(obj, (function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); })), result; }; } var groupBy = group((function(result, value, key) { has$1(result, key) ? result[key].push(value) : result[key] = [ value ]; })), indexBy = group((function(result, value, key) { result[key] = value; })), countBy = group((function(result, value, key) { has$1(result, key) ? result[key]++ : result[key] = 1; })), partition = group((function(result, value, pass) { result[pass ? 0 : 1].push(value); }), !0); function keyInObj(value, key, obj) { return key in obj; } var pick = restArguments((function(obj, keys) { var result = {}, iteratee = keys[0]; if (null == obj) return result; isFunction$1(iteratee) ? (keys.length > 1 && (iteratee = optimizeCb(iteratee, keys[1])), keys = allKeys(obj)) : (iteratee = keyInObj, keys = flatten$1(keys, !1, !1), obj = Object(obj)); for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i], value = obj[key]; iteratee(value, key, obj) && (result[key] = value); } return result; })), omit = restArguments((function(obj, keys) { var context, iteratee = keys[0]; return isFunction$1(iteratee) ? (iteratee = negate(iteratee), keys.length > 1 && (context = keys[1])) : (keys = map(flatten$1(keys, !1, !1), String), iteratee = function(value, key) { return !contains(keys, key); }), pick(obj, iteratee, context); })); function initial(array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (null == n || guard ? 1 : n))); } function first(array, n, guard) { return null == array || array.length < 1 ? null == n || guard ? void 0 : [] : null == n || guard ? array[0] : initial(array, array.length - n); } function rest(array, n, guard) { return slice.call(array, null == n || guard ? 1 : n); } var difference = restArguments((function(array, rest) { return rest = flatten$1(rest, !0, !0), filter(array, (function(value) { return !contains(rest, value); })); })), without = restArguments((function(array, otherArrays) { return difference(array, otherArrays); })); function uniq(array, isSorted, iteratee, context) { isBoolean(isSorted) || (context = iteratee, iteratee = isSorted, isSorted = !1), null != iteratee && (iteratee = cb(iteratee, context)); for (var result = [], seen = [], i = 0, length = getLength(array); i < length; i++) { var value = array[i], computed = iteratee ? iteratee(value, i, array) : value; isSorted && !iteratee ? (i && seen === computed || result.push(value), seen = computed) : iteratee ? contains(seen, computed) || (seen.push(computed), result.push(value)) : contains(result, value) || result.push(value); } return result; } var union = restArguments((function(arrays) { return uniq(flatten$1(arrays, !0, !0)); })); function unzip(array) { for (var length = array && max(array, getLength).length || 0, result = Array(length), index = 0; index < length; index++) result[index] = pluck(array, index); return result; } var zip = restArguments(unzip); function chainResult(instance, obj) { return instance._chain ? _$1(obj).chain() : obj; } function mixin(obj) { return each(functions(obj), (function(name) { var func = _$1[name] = obj[name]; _$1.prototype[name] = function() { var args = [ this._wrapped ]; return push.apply(args, arguments), chainResult(this, func.apply(_$1, args)); }; })), _$1; } each([ "pop", "push", "reverse", "shift", "sort", "splice", "unshift" ], (function(name) { var method = ArrayProto[name]; _$1.prototype[name] = function() { var obj = this._wrapped; return null != obj && (method.apply(obj, arguments), "shift" !== name && "splice" !== name || 0 !== obj.length || delete obj[0]), chainResult(this, obj); }; })), each([ "concat", "join", "slice" ], (function(name) { var method = ArrayProto[name]; _$1.prototype[name] = function() { var obj = this._wrapped; return null != obj && (obj = method.apply(obj, arguments)), chainResult(this, obj); }; })); var allExports = { __proto__: null, VERSION: "1.13.2", restArguments: restArguments, isObject: isObject, isNull: function(obj) { return null === obj; }, isUndefined: isUndefined, isBoolean: isBoolean, isElement: function(obj) { return !(!obj || 1 !== obj.nodeType); }, isString: isString, isNumber: isNumber, isDate: isDate, isRegExp: isRegExp, isError: isError, isSymbol: isSymbol, isArrayBuffer: isArrayBuffer, isDataView: isDataView$1, isArray: isArray, isFunction: isFunction$1, isArguments: isArguments$1, isFinite: function(obj) { return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); }, isNaN: isNaN$1, isTypedArray: isTypedArray$1, isEmpty: function(obj) { if (null == obj) return !0; var length = getLength(obj); return "number" == typeof length && (isArray(obj) || isString(obj) || isArguments$1(obj)) ? 0 === length : 0 === getLength(keys(obj)); }, isMatch: isMatch, isEqual: function(a, b) { return eq(a, b); }, isMap: isMap, isWeakMap: isWeakMap, isSet: isSet, isWeakSet: isWeakSet, keys: keys, allKeys: allKeys, values: values, pairs: function(obj) { for (var _keys = keys(obj), length = _keys.length, pairs = Array(length), i = 0; i < length; i++) pairs[i] = [ _keys[i], obj[_keys[i]] ]; return pairs; }, invert: invert, functions: functions, methods: functions, extend: extend, extendOwn: extendOwn, assign: extendOwn, defaults: defaults, create: function(prototype, props) { var result = baseCreate(prototype); return props && extendOwn(result, props), result; }, clone: function(obj) { return isObject(obj) ? isArray(obj) ? obj.slice() : extend({}, obj) : obj; }, tap: function(obj, interceptor) { return interceptor(obj), obj; }, get: get, has: function(obj, path) { for (var length = (path = toPath(path)).length, i = 0; i < length; i++) { var key = path[i]; if (!has$1(obj, key)) return !1; obj = obj[key]; } return !!length; }, mapObject: function(obj, iteratee, context) { iteratee = cb(iteratee, context); for (var _keys = keys(obj), length = _keys.length, results = {}, index = 0; index < length; index++) { var currentKey = _keys[index]; results[currentKey] = iteratee(obj[currentKey], currentKey, obj); } return results; }, identity: identity, constant: constant, noop: noop, toPath: toPath$1, property: property, propertyOf: function(obj) { return null == obj ? noop : function(path) { return get(obj, path); }; }, matcher: matcher, matches: matcher, times: function(n, iteratee, context) { var accum = Array(Math.max(0, n)); iteratee = optimizeCb(iteratee, context, 1); for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }, random: random, now: now, escape: _escape, unescape: _unescape, templateSettings: templateSettings, template: function(text, settings, oldSettings) { !settings && oldSettings && (settings = oldSettings), settings = defaults({}, settings, _$1.templateSettings); var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join("|") + "|$", "g"), index = 0, source = "__p+='"; text.replace(matcher, (function(match, escape, interpolate, evaluate, offset) { return source += text.slice(index, offset).replace(escapeRegExp, escapeChar), index = offset + match.length, escape ? source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'" : interpolate ? source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'" : evaluate && (source += "';\n" + evaluate + "\n__p+='"), match; })), source += "';\n"; var render, argument = settings.variable; if (argument) { if (!bareIdentifier.test(argument)) throw new Error("variable is not a bare identifier: " + argument); } else source = "with(obj||{}){\n" + source + "}\n", argument = "obj"; source = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + source + "return __p;\n"; try { render = new Function(argument, "_", source); } catch (e) { throw e.source = source, e; } var template = function(data) { return render.call(this, data, _$1); }; return template.source = "function(" + argument + "){\n" + source + "}", template; }, result: function(obj, path, fallback) { var length = (path = toPath(path)).length; if (!length) return isFunction$1(fallback) ? fallback.call(obj) : fallback; for (var i = 0; i < length; i++) { var prop = null == obj ? void 0 : obj[path[i]]; void 0 === prop && (prop = fallback, i = length), obj = isFunction$1(prop) ? prop.call(obj) : prop; } return obj; }, uniqueId: function(prefix) { var id = ++idCounter + ""; return prefix ? prefix + id : id; }, chain: function(obj) { var instance = _$1(obj); return instance._chain = !0, instance; }, iteratee: iteratee, partial: partial, bind: bind, bindAll: bindAll, memoize: function(func, hasher) { var memoize = function(key) { var cache = memoize.cache, address = "" + (hasher ? hasher.apply(this, arguments) : key); return has$1(cache, address) || (cache[address] = func.apply(this, arguments)), cache[address]; }; return memoize.cache = {}, memoize; }, delay: delay, defer: defer, throttle: function(func, wait, options) { var timeout, context, args, result, previous = 0; options || (options = {}); var later = function() { previous = !1 === options.leading ? 0 : now(), timeout = null, result = func.apply(context, args), timeout || (context = args = null); }, throttled = function() { var _now = now(); previous || !1 !== options.leading || (previous = _now); var remaining = wait - (_now - previous); return context = this, args = arguments, remaining <= 0 || remaining > wait ? (timeout && (clearTimeout(timeout), timeout = null), previous = _now, result = func.apply(context, args), timeout || (context = args = null)) : timeout || !1 === options.trailing || (timeout = setTimeout(later, remaining)), result; }; return throttled.cancel = function() { clearTimeout(timeout), previous = 0, timeout = context = args = null; }, throttled; }, debounce: function(func, wait, immediate) { var timeout, previous, args, result, context, later = function() { var passed = now() - previous; wait > passed ? timeout = setTimeout(later, wait - passed) : (timeout = null, immediate || (result = func.apply(context, args)), timeout || (args = context = null)); }, debounced = restArguments((function(_args) { return context = this, args = _args, previous = now(), timeout || (timeout = setTimeout(later, wait), immediate && (result = func.apply(context, args))), result; })); return debounced.cancel = function() { clearTimeout(timeout), timeout = args = context = null; }, debounced; }, wrap: function(func, wrapper) { return partial(wrapper, func); }, negate: negate, compose: function() { var args = arguments, start = args.length - 1; return function() { for (var i = start, result = args[start].apply(this, arguments); i--; ) result = args[i].call(this, result); return result; }; }, after: function(times, func) { return function() { if (--times < 1) return func.apply(this, arguments); }; }, before: before, once: once, findKey: findKey, findIndex: findIndex, findLastIndex: findLastIndex, sortedIndex: sortedIndex, indexOf: indexOf, lastIndexOf: lastIndexOf, find: find, detect: find, findWhere: function(obj, attrs) { return find(obj, matcher(attrs)); }, each: each, forEach: each, map: map, collect: map, reduce: reduce, foldl: reduce, inject: reduce, reduceRight: reduceRight, foldr: reduceRight, filter: filter, select: filter, reject: function(obj, predicate, context) { return filter(obj, negate(cb(predicate)), context); }, every: every, all: every, some: some, any: some, contains: contains, includes: contains, include: contains, invoke: invoke, pluck: pluck, where: function(obj, attrs) { return filter(obj, matcher(attrs)); }, max: max, min: function(obj, iteratee, context) { var value, computed, result = 1 / 0, lastComputed = 1 / 0; if (null == iteratee || "number" == typeof iteratee && "object" != typeof obj[0] && null != obj) for (var i = 0, length = (obj = isArrayLike(obj) ? obj : values(obj)).length; i < length; i++) null != (value = obj[i]) && value < result && (result = value); else iteratee = cb(iteratee, context), each(obj, (function(v, index, list) { ((computed = iteratee(v, index, list)) < lastComputed || computed === 1 / 0 && result === 1 / 0) && (result = v, lastComputed = computed); })); return result; }, shuffle: function(obj) { return sample(obj, 1 / 0); }, sample: sample, sortBy: function(obj, iteratee, context) { var index = 0; return iteratee = cb(iteratee, context), pluck(map(obj, (function(value, key, list) { return { value: value, index: index++, criteria: iteratee(value, key, list) }; })).sort((function(left, right) { var a = left.criteria, b = right.criteria; if (a !== b) { if (a > b || void 0 === a) return 1; if (a < b || void 0 === b) return -1; } return left.index - right.index; })), "value"); }, groupBy: groupBy, indexBy: indexBy, countBy: countBy, partition: partition, toArray: toArray, size: function(obj) { return null == obj ? 0 : isArrayLike(obj) ? obj.length : keys(obj).length; }, pick: pick, omit: omit, first: first, head: first, take: first, initial: initial, last: function(array, n, guard) { return null == array || array.length < 1 ? null == n || guard ? void 0 : [] : null == n || guard ? array[array.length - 1] : rest(array, Math.max(0, array.length - n)); }, rest: rest, tail: rest, drop: rest, compact: function(array) { return filter(array, Boolean); }, flatten: function(array, depth) { return flatten$1(array, depth, !1); }, without: without, uniq: uniq, unique: uniq, union: union, intersection: function(array) { for (var result = [], argsLength = arguments.length, i = 0, length = getLength(array); i < length; i++) { var item = array[i]; if (!contains(result, item)) { var j; for (j = 1; j < argsLength && contains(arguments[j], item); j++) ; j === argsLength && result.push(item); } } return result; }, difference: difference, unzip: unzip, transpose: unzip, zip: zip, object: function(list, values) { for (var result = {}, i = 0, length = getLength(list); i < length; i++) values ? result[list[i]] = values[i] : result[list[i][0]] = list[i][1]; return result; }, range: function(start, stop, step) { null == stop && (stop = start || 0, start = 0), step || (step = stop < start ? -1 : 1); for (var length = Math.max(Math.ceil((stop - start) / step), 0), range = Array(length), idx = 0; idx < length; idx++, start += step) range[idx] = start; return range; }, chunk: function(array, count) { if (null == count || count < 1) return []; for (var result = [], i = 0, length = array.length; i < length; ) result.push(slice.call(array, i, i += count)); return result; }, mixin: mixin, default: _$1 }, _ = mixin(allExports); return _._ = _, _; }, module.exports = factory(); }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(841); }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(0).deprecate; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(47), schema = __webpack_require__(13), _proto = __webpack_require__(19); function AttachedFile(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.AttachedFile, start, length); } util.inherits(AttachedFile, Element1), module.exports = AttachedFile, AttachedFile.prototype.toString = function() { return "[AttachedFile #" + this.tagId + "]"; }, _proto.addAttribute(AttachedFile.prototype, "FileName"), _proto.addAttribute(AttachedFile.prototype, "FileMimeType"), _proto.addAttribute(AttachedFile.prototype, "FileDescription"), _proto.addAttribute(AttachedFile.prototype, "FileData"), _proto.addAttribute(AttachedFile.prototype, "FileUID"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Attachments(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Attachments, start, length); } util.inherits(Attachments, MasterElement), module.exports = Attachments, Attachments.prototype.toString = function() { return "[Attachments #" + this.tagId + "]"; }, _proto.addChild(Attachments.prototype, "AttachedFile"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(47), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Audio(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.Audio, start, length); } util.inherits(Audio, Element1), module.exports = Audio, Audio.prototype.toString = function() { return "[Audio #" + this.tagId + "]"; }, _proto.addAttribute(Audio.prototype, "SamplingFrequency"), _proto.addAttribute(Audio.prototype, "OutputSamplingFrequency"), _proto.addAttribute(Audio.prototype, "Channels"), _proto.addAttribute(Audio.prototype, "BitDepth"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(47), schema = __webpack_require__(13), EMPTY_BUFFER = (__webpack_require__(19), new Buffer([])); function CRC_32(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.CRC_32, start, length), this.data = EMPTY_BUFFER, this.type = "b"; } util.inherits(CRC_32, Element1), module.exports = CRC_32, CRC_32.prototype.toString = function() { return "[CRC-32 #" + this.tagId + "]"; }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function CuePoint(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.CuePoint, start, length); } util.inherits(CuePoint, MasterElement), module.exports = CuePoint, CuePoint.prototype.toString = function() { return "[CuePoint #" + this.tagId + "]"; }, _proto.addAttribute(CuePoint.prototype, "CueTime"), _proto.addChild(CuePoint.prototype, "CueTrackPositions"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(47), schema = __webpack_require__(13), _proto = __webpack_require__(19); function CueReference(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.CueReference, start, length); } util.inherits(CueReference, Element1), module.exports = CueReference, CueReference.prototype.toString = function() { return "[CueReference #" + this.tagId + "]"; }, _proto.addAttribute(CueReference.prototype, "CueRefTime"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Cues(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Cues, start, length); } util.inherits(Cues, MasterElement), module.exports = Cues, Cues.prototype.toString = function() { return "[Cues #" + this.tagId + "]"; }, _proto.addChild(Cues.prototype, "CuePoint"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function CueTrackPositions(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.CueTrackPositions, start, length); } util.inherits(CueTrackPositions, MasterElement), module.exports = CueTrackPositions, CueTrackPositions.prototype.toString = function() { return "[CueTrackPositions #" + this.tagId + "]"; }, _proto.addAttribute(CueTrackPositions.prototype, "CueTrack"), _proto.addAttribute(CueTrackPositions.prototype, "CueClusterPosition"), _proto.addAttribute(CueTrackPositions.prototype, "CueRelativePosition"), _proto.addAttribute(CueTrackPositions.prototype, "CueDuration"), _proto.addAttribute(CueTrackPositions.prototype, "CueBlockNumber"), _proto.addAttribute(CueTrackPositions.prototype, "CueCodecState"), _proto.addChild(CueTrackPositions.prototype, "CueReference"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Info(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Info, start, length); } util.inherits(Info, MasterElement), module.exports = Info, Info.prototype.toString = function() { return "[Info #" + this.tagId + "]"; }, _proto.addAttribute(Info.prototype, "SegmentUID"), _proto.addAttribute(Info.prototype, "SegmentFilename"), _proto.addAttribute(Info.prototype, "PrevUID"), _proto.addAttribute(Info.prototype, "PrevFilename"), _proto.addAttribute(Info.prototype, "NextUID"), _proto.addAttribute(Info.prototype, "NextFilename"), _proto.addAttribute(Info.prototype, "SegmentFamily"), _proto.addChild(Info.prototype, "ChapterTranslate"), _proto.addAttribute(Info.prototype, "TimecodeScale"), _proto.addAttribute(Info.prototype, "Duration"), _proto.addAttribute(Info.prototype, "DateUTC"), _proto.addAttribute(Info.prototype, "Title"), _proto.addAttribute(Info.prototype, "MuxingApp"), _proto.addAttribute(Info.prototype, "WritingApp"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(47), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Seek(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.Seek, start, length); } util.inherits(Seek, Element1), module.exports = Seek, Seek.prototype.toString = function() { return "[Seek #" + this.tagId + "]"; }, _proto.addAttribute(Seek.prototype, "SeekID"), _proto.addAttribute(Seek.prototype, "SeekPosition"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function SeekHead(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.SeekHead, start, length); } util.inherits(SeekHead, MasterElement), module.exports = SeekHead, SeekHead.prototype.toString = function() { return "[SeekHead #" + this.tagId + "]"; }, _proto.addChild(SeekHead.prototype, "Seek"); }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(40), __webpack_require__(2), __webpack_require__(45), __webpack_require__(5); var util = __webpack_require__(0), Segment2 = __webpack_require__(147); function Segment3(doc, tagId, start, length) { Segment2.call(this, doc, tagId, start, length); } __webpack_require__(13), util.inherits(Segment3, Segment2), module.exports = Segment3, Segment3.prototype.findTagByName = function(tagName) {}; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function SimpleTag(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.SimpleTag, start, length); } util.inherits(SimpleTag, MasterElement), module.exports = SimpleTag, SimpleTag.prototype.toString = function() { return "[SimpleTag #" + this.tagId + "]"; }, _proto.addChild(SimpleTag.prototype, "SimpleTag"), _proto.addAttribute(SimpleTag.prototype, "TagName"), _proto.addAttribute(SimpleTag.prototype, "TagLanguage"), _proto.addAttribute(SimpleTag.prototype, "TagDefault"), _proto.addAttribute(SimpleTag.prototype, "TagString"), _proto.addAttribute(SimpleTag.prototype, "TagBinary"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Tag(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Tag, start, length); } util.inherits(Tag, MasterElement), module.exports = Tag, Tag.prototype.toString = function() { return "[Tag #" + this.tagId + "]"; }, _proto.oneChild(Tag.prototype, "Targets", !0), _proto.addChild(Tag.prototype, "SimpleTag"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Tags(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Tags, start, length); } util.inherits(Tags, MasterElement), module.exports = Tags, Tags.prototype.toString = function() { return "[Tags #" + this.tagId + "]"; }, _proto.addChild(Tags.prototype, "Tag"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Targets(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Targets, start, length); } util.inherits(Targets, MasterElement), module.exports = Targets, Targets.prototype.toString = function() { return "[Targets #" + this.tagId + "]"; }, _proto.addAttribute(Targets.prototype, "TargetTypeValue"), _proto.addAttribute(Targets.prototype, "TargetType"), _proto.addChild(Targets.prototype, "TagTrackUID"), _proto.addChild(Targets.prototype, "TagEditionUID"), _proto.addChild(Targets.prototype, "TagChapterUID"), _proto.addChild(Targets.prototype, "TagAttachmentUID"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function TrackEntry(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.TrackEntry, start, length); } util.inherits(TrackEntry, MasterElement), module.exports = TrackEntry, TrackEntry.prototype.toString = function() { return "[TrackEntry #" + this.tagId + "]"; }, _proto.addAttribute(TrackEntry.prototype, "TrackNumber"), _proto.addAttribute(TrackEntry.prototype, "TrackUID"), _proto.addAttribute(TrackEntry.prototype, "TrackType"), _proto.addAttribute(TrackEntry.prototype, "FlagEnabled"), _proto.addAttribute(TrackEntry.prototype, "FlagDefault"), _proto.addAttribute(TrackEntry.prototype, "FlagForced"), _proto.addAttribute(TrackEntry.prototype, "FlagLacing"), _proto.addAttribute(TrackEntry.prototype, "MinCache"), _proto.addAttribute(TrackEntry.prototype, "MaxCache"), _proto.addAttribute(TrackEntry.prototype, "DefaultDuration"), _proto.addAttribute(TrackEntry.prototype, "DefaultDecodedFieldDuration"), _proto.addAttribute(TrackEntry.prototype, "MaxBlockAdditionID"), _proto.addAttribute(TrackEntry.prototype, "Name"), _proto.addAttribute(TrackEntry.prototype, "CodecID"), _proto.addAttribute(TrackEntry.prototype, "CodecPrivate"), _proto.addAttribute(TrackEntry.prototype, "CodecName"), _proto.addAttribute(TrackEntry.prototype, "AttachmentLink"), _proto.addAttribute(TrackEntry.prototype, "CodecDecodeAll"), _proto.addAttribute(TrackEntry.prototype, "TrackOverlay"), _proto.addAttribute(TrackEntry.prototype, "CodecDelay"), _proto.addAttribute(TrackEntry.prototype, "SeekPreRoll"), _proto.addChild(TrackEntry.prototype, "TrackTranslate"), _proto.oneChild(TrackEntry.prototype, "Video"), _proto.oneChild(TrackEntry.prototype, "Audio"), _proto.addChild(TrackEntry.prototype, "TrackOperation"), _proto.addChild(TrackEntry.prototype, "ContentEncodings"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(30), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Tracks(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Tracks, start, length); } util.inherits(Tracks, MasterElement), module.exports = Tracks, Tracks.prototype.toString = function() { return "[Tracks #" + this.tagId + "]"; }, _proto.addChild(Tracks.prototype, "TrackEntry"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(47), schema = __webpack_require__(13), _proto = __webpack_require__(19); function Video(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.Video, start, length); } util.inherits(Video, Element1), module.exports = Video, Video.prototype.toString = function() { return "[Video #" + this.tagId + "]"; }, _proto.addAttribute(Video.prototype, "FlagInterlaced"), _proto.addAttribute(Video.prototype, "StereoMode"), _proto.addAttribute(Video.prototype, "AlphaMode"), _proto.addAttribute(Video.prototype, "PixelWidth"), _proto.addAttribute(Video.prototype, "PixelHeight"), _proto.addAttribute(Video.prototype, "PixelCropBottom"), _proto.addAttribute(Video.prototype, "PixelCropTop"), _proto.addAttribute(Video.prototype, "PixelCropLeft"), _proto.addAttribute(Video.prototype, "PixelCropRight"), _proto.addAttribute(Video.prototype, "DisplayWidth"), _proto.addAttribute(Video.prototype, "DisplayHeight"), _proto.addAttribute(Video.prototype, "DisplayUnit"), _proto.addAttribute(Video.prototype, "AspectRatioType"), _proto.addAttribute(Video.prototype, "ColourSpace"); }, function(module, exports, __webpack_require__) { "use strict"; var assert = __webpack_require__(25), util = (__webpack_require__(2), __webpack_require__(0)), debug = __webpack_require__(46)("matroska:abstractSource"), Source = __webpack_require__(443), tools = __webpack_require__(86); function AbstractSource() { this._vints = [], this._vintsSize = 0; } module.exports = AbstractSource, util.inherits(AbstractSource, Source), AbstractSource.prototype.writeCompleteTag = function(session, tag, callback) { assert("number" == typeof tag.start, "Invalid start index of tag #" + tag.tagId), assert("number" == typeof tag.end, "Invalid start index of tag #" + tag.tagId); var self = this; this._flush(session, (function(error) { if (error) return callback(error); var start = tag.start, end = tag.end, modified = tag._modified; modified && (start = modified.start, end = modified.end), self.getStream({ start: start, end: end - 1 }, (function(error, stream) { if (error) return callback(error); stream.on("end", callback), stream.on("error", callback), stream.pipe(session.stream, { end: !1 }); })); })); }, AbstractSource.prototype.writeTagData = function(session, data, callback) { if (!data) throw new Error("No data !"); if (this.writeVInt(session, data.length), this._vintsSize + data.length < 65536) return this._vints.push(data), this._vintsSize += data.length, void setImmediate(callback); this._flush(session, (function(error) { if (error) return callback(error); session.stream.write(data, callback); })); }, AbstractSource.prototype.writeTagDataSource = function(session, dataSize, dataSource, callback) { this.writeVInt(session, dataSize), this._flush(session, (function(error) { if (error) return callback(error); dataSource.getStream(session, (function(error, stream) { if (error) return callback(error); stream.pipe(session.stream, { end: !1 }), stream.on("error", callback), stream.on("end", callback); })); })); }, AbstractSource.prototype.writeVInt = function(session, value) { if ("number" != typeof value) throw new Error("Invalid value (" + value + ")"); var buffer = tools.writeVInt(value); this._vints.push(buffer), this._vintsSize += buffer.length; }, AbstractSource.prototype.writeHInt = function(session, value) { if ("number" != typeof value) throw new Error("Invalid value (" + value + ")"); var buffer = value; Buffer.isBuffer(buffer) || (buffer = tools.writeUInt(value)), this._vints.push(buffer), this._vintsSize += buffer.length; }, AbstractSource.prototype._flush = function(session, callback) { var buffer, vints = this._vints; if (!this._vintsSize) return callback(); buffer = 1 === vints.length ? vints[0] : Buffer.concat(vints), this._vints = [], this._vintsSize = 0, session.stream.write(buffer, callback); }, AbstractSource.prototype.getTagDataStream = function(tag, callback) { debug.enabled && debug("Get data stream of #" + tag.tagId + " start=" + tag.start + " end=" + tag.end + " modified=", modified); var end = tag.end, modified = tag._modified; modified && (end = modified.end); var start = end - tag.getDataSize(); debug.enabled && debug("Open stream " + this.filename + " start=" + start + " end=" + end + " size=" + tag.dataSize), this.getStream({}, { start: start, end: end - 1 }, (function(error, stream) { return error ? callback(error) : callback(null, stream); })); }, AbstractSource.prototype.end = function(session, callback) { var self = this; this._flush(session, (function(error) { if (error) return callback(error); self._end(session, callback); })); }, AbstractSource.prototype._end = function(session, callback) { callback(); }, AbstractSource.prototype.release = function(callback) { this.end(this, callback); }; }, function(module, exports, __webpack_require__) { "use strict"; var _H264Stream, _NalByteStream, PROFILES_WITH_OPTIONAL_SPS_DATA, Stream = __webpack_require__(38), ExpGolomb = __webpack_require__(880); (_NalByteStream = function() { var i, buffer, syncPoint = 0; _NalByteStream.prototype.init.call(this), this.push = function(data) { var swapBuffer; buffer ? ((swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength)).set(buffer), swapBuffer.set(data.data, buffer.byteLength), buffer = swapBuffer) : buffer = data.data; for (var len = buffer.byteLength; syncPoint < len - 3; syncPoint++) if (1 === buffer[syncPoint + 2]) { i = syncPoint + 5; break; } for (;i < len; ) switch (buffer[i]) { case 0: if (0 !== buffer[i - 1]) { i += 2; break; } if (0 !== buffer[i - 2]) { i++; break; } syncPoint + 3 !== i - 2 && this.trigger("data", buffer.subarray(syncPoint + 3, i - 2)); do { i++; } while (1 !== buffer[i] && i < len); syncPoint = i - 2, i += 3; break; case 1: if (0 !== buffer[i - 1] || 0 !== buffer[i - 2]) { i += 3; break; } this.trigger("data", buffer.subarray(syncPoint + 3, i - 2)), syncPoint = i - 2, i += 3; break; default: i += 3; } buffer = buffer.subarray(syncPoint), i -= syncPoint, syncPoint = 0; }, this.reset = function() { buffer = null, syncPoint = 0, this.trigger("reset"); }, this.flush = function() { buffer && buffer.byteLength > 3 && this.trigger("data", buffer.subarray(syncPoint + 3)), buffer = null, syncPoint = 0, this.trigger("done"); }, this.endTimeline = function() { this.flush(), this.trigger("endedtimeline"); }; }).prototype = new Stream, PROFILES_WITH_OPTIONAL_SPS_DATA = { 100: !0, 110: !0, 122: !0, 244: !0, 44: !0, 83: !0, 86: !0, 118: !0, 128: !0, 138: !0, 139: !0, 134: !0 }, (_H264Stream = function() { var self, trackId, currentPts, currentDts, discardEmulationPreventionBytes, readSequenceParameterSet, skipScalingList, nalByteStream = new _NalByteStream; _H264Stream.prototype.init.call(this), self = this, this.push = function(packet) { "video" === packet.type && (trackId = packet.trackId, currentPts = packet.pts, currentDts = packet.dts, nalByteStream.push(packet)); }, nalByteStream.on("data", (function(data) { var event = { trackId: trackId, pts: currentPts, dts: currentDts, data: data, nalUnitTypeCode: 31 & data[0] }; switch (event.nalUnitTypeCode) { case 5: event.nalUnitType = "slice_layer_without_partitioning_rbsp_idr"; break; case 6: event.nalUnitType = "sei_rbsp", event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1)); break; case 7: event.nalUnitType = "seq_parameter_set_rbsp", event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1)), event.config = readSequenceParameterSet(event.escapedRBSP); break; case 8: event.nalUnitType = "pic_parameter_set_rbsp"; break; case 9: event.nalUnitType = "access_unit_delimiter_rbsp"; } self.trigger("data", event); })), nalByteStream.on("done", (function() { self.trigger("done"); })), nalByteStream.on("partialdone", (function() { self.trigger("partialdone"); })), nalByteStream.on("reset", (function() { self.trigger("reset"); })), nalByteStream.on("endedtimeline", (function() { self.trigger("endedtimeline"); })), this.flush = function() { nalByteStream.flush(); }, this.partialFlush = function() { nalByteStream.partialFlush(); }, this.reset = function() { nalByteStream.reset(); }, this.endTimeline = function() { nalByteStream.endTimeline(); }, skipScalingList = function(count, expGolombDecoder) { var j, lastScale = 8, nextScale = 8; for (j = 0; j < count; j++) 0 !== nextScale && (nextScale = (lastScale + expGolombDecoder.readExpGolomb() + 256) % 256), lastScale = 0 === nextScale ? lastScale : nextScale; }, discardEmulationPreventionBytes = function(data) { for (var newLength, newData, length = data.byteLength, emulationPreventionBytesPositions = [], i = 1; i < length - 2; ) 0 === data[i] && 0 === data[i + 1] && 3 === data[i + 2] ? (emulationPreventionBytesPositions.push(i + 2), i += 2) : i++; if (0 === emulationPreventionBytesPositions.length) return data; newLength = length - emulationPreventionBytesPositions.length, newData = new Uint8Array(newLength); var sourceIndex = 0; for (i = 0; i < newLength; sourceIndex++, i++) sourceIndex === emulationPreventionBytesPositions[0] && (sourceIndex++, emulationPreventionBytesPositions.shift()), newData[i] = data[sourceIndex]; return newData; }, readSequenceParameterSet = function(data) { var expGolombDecoder, profileIdc, levelIdc, profileCompatibility, chromaFormatIdc, picOrderCntType, numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1, picHeightInMapUnitsMinus1, frameMbsOnlyFlag, scalingListCount, i, frameCropLeftOffset = 0, frameCropRightOffset = 0, frameCropTopOffset = 0, frameCropBottomOffset = 0, sarRatio = [ 1, 1 ]; if (profileIdc = (expGolombDecoder = new ExpGolomb(data)).readUnsignedByte(), profileCompatibility = expGolombDecoder.readUnsignedByte(), levelIdc = expGolombDecoder.readUnsignedByte(), expGolombDecoder.skipUnsignedExpGolomb(), PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc] && (3 === (chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb()) && expGolombDecoder.skipBits(1), expGolombDecoder.skipUnsignedExpGolomb(), expGolombDecoder.skipUnsignedExpGolomb(), expGolombDecoder.skipBits(1), expGolombDecoder.readBoolean())) for (scalingListCount = 3 !== chromaFormatIdc ? 8 : 12, i = 0; i < scalingListCount; i++) expGolombDecoder.readBoolean() && skipScalingList(i < 6 ? 16 : 64, expGolombDecoder); if (expGolombDecoder.skipUnsignedExpGolomb(), 0 === (picOrderCntType = expGolombDecoder.readUnsignedExpGolomb())) expGolombDecoder.readUnsignedExpGolomb(); else if (1 === picOrderCntType) for (expGolombDecoder.skipBits(1), expGolombDecoder.skipExpGolomb(), expGolombDecoder.skipExpGolomb(), numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb(), i = 0; i < numRefFramesInPicOrderCntCycle; i++) expGolombDecoder.skipExpGolomb(); if (expGolombDecoder.skipUnsignedExpGolomb(), expGolombDecoder.skipBits(1), picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb(), picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb(), 0 === (frameMbsOnlyFlag = expGolombDecoder.readBits(1)) && expGolombDecoder.skipBits(1), expGolombDecoder.skipBits(1), expGolombDecoder.readBoolean() && (frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb(), frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb(), frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb(), frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb()), expGolombDecoder.readBoolean() && expGolombDecoder.readBoolean()) { switch (expGolombDecoder.readUnsignedByte()) { case 1: sarRatio = [ 1, 1 ]; break; case 2: sarRatio = [ 12, 11 ]; break; case 3: sarRatio = [ 10, 11 ]; break; case 4: sarRatio = [ 16, 11 ]; break; case 5: sarRatio = [ 40, 33 ]; break; case 6: sarRatio = [ 24, 11 ]; break; case 7: sarRatio = [ 20, 11 ]; break; case 8: sarRatio = [ 32, 11 ]; break; case 9: sarRatio = [ 80, 33 ]; break; case 10: sarRatio = [ 18, 11 ]; break; case 11: sarRatio = [ 15, 11 ]; break; case 12: sarRatio = [ 64, 33 ]; break; case 13: sarRatio = [ 160, 99 ]; break; case 14: sarRatio = [ 4, 3 ]; break; case 15: sarRatio = [ 3, 2 ]; break; case 16: sarRatio = [ 2, 1 ]; break; case 255: sarRatio = [ expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte() ]; } sarRatio && (sarRatio[0], sarRatio[1]); } return { profileIdc: profileIdc, levelIdc: levelIdc, profileCompatibility: profileCompatibility, width: 16 * (picWidthInMbsMinus1 + 1) - 2 * frameCropLeftOffset - 2 * frameCropRightOffset, height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - 2 * frameCropTopOffset - 2 * frameCropBottomOffset, sarRatio: sarRatio }; }; }).prototype = new Stream, module.exports = { H264Stream: _H264Stream, NalByteStream: _NalByteStream }; }, function(module, exports, __webpack_require__) { "use strict"; var toUnsigned = __webpack_require__(150).toUnsigned, parseType = __webpack_require__(224); module.exports = function findBox(data, path) { var i, size, type, end, subresults, results = []; if (!path.length) return null; for (i = 0; i < data.byteLength; ) size = toUnsigned(data[i] << 24 | data[i + 1] << 16 | data[i + 2] << 8 | data[i + 3]), type = parseType(data.subarray(i + 4, i + 8)), end = size > 1 ? i + size : data.byteLength, type === path[0] && (1 === path.length ? results.push(data.subarray(i + 8, end)) : (subresults = findBox(data.subarray(i + 8, end), path.slice(1))).length && (results = results.concat(subresults))), i = end; return results; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(buffer) { var result = ""; return result += String.fromCharCode(buffer[0]), result += String.fromCharCode(buffer[1]), (result += String.fromCharCode(buffer[2])) + String.fromCharCode(buffer[3]); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(data) { var i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), trackId: view.getUint32(4) }, baseDataOffsetPresent = 1 & result.flags[2], sampleDescriptionIndexPresent = 2 & result.flags[2], defaultSampleDurationPresent = 8 & result.flags[2], defaultSampleSizePresent = 16 & result.flags[2], defaultSampleFlagsPresent = 32 & result.flags[2], durationIsEmpty = 65536 & result.flags[0], defaultBaseIsMoof = 131072 & result.flags[0]; return i = 8, baseDataOffsetPresent && (i += 4, result.baseDataOffset = view.getUint32(12), i += 4), sampleDescriptionIndexPresent && (result.sampleDescriptionIndex = view.getUint32(i), i += 4), defaultSampleDurationPresent && (result.defaultSampleDuration = view.getUint32(i), i += 4), defaultSampleSizePresent && (result.defaultSampleSize = view.getUint32(i), i += 4), defaultSampleFlagsPresent && (result.defaultSampleFlags = view.getUint32(i)), durationIsEmpty && (result.durationIsEmpty = !0), !baseDataOffsetPresent && defaultBaseIsMoof && (result.baseDataOffsetIsMoof = !0), result; }; }, function(module, exports, __webpack_require__) { "use strict"; var parseSampleFlags = __webpack_require__(883); module.exports = function(data) { var sample, result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), samples: [] }, view = new DataView(data.buffer, data.byteOffset, data.byteLength), dataOffsetPresent = 1 & result.flags[2], firstSampleFlagsPresent = 4 & result.flags[2], sampleDurationPresent = 1 & result.flags[1], sampleSizePresent = 2 & result.flags[1], sampleFlagsPresent = 4 & result.flags[1], sampleCompositionTimeOffsetPresent = 8 & result.flags[1], sampleCount = view.getUint32(4), offset = 8; for (dataOffsetPresent && (result.dataOffset = view.getInt32(offset), offset += 4), firstSampleFlagsPresent && sampleCount && (sample = { flags: parseSampleFlags(data.subarray(offset, offset + 4)) }, offset += 4, sampleDurationPresent && (sample.duration = view.getUint32(offset), offset += 4), sampleSizePresent && (sample.size = view.getUint32(offset), offset += 4), sampleCompositionTimeOffsetPresent && (1 === result.version ? sample.compositionTimeOffset = view.getInt32(offset) : sample.compositionTimeOffset = view.getUint32(offset), offset += 4), result.samples.push(sample), sampleCount--); sampleCount--; ) sample = {}, sampleDurationPresent && (sample.duration = view.getUint32(offset), offset += 4), sampleSizePresent && (sample.size = view.getUint32(offset), offset += 4), sampleFlagsPresent && (sample.flags = parseSampleFlags(data.subarray(offset, offset + 4)), offset += 4), sampleCompositionTimeOffsetPresent && (1 === result.version ? sample.compositionTimeOffset = view.getInt32(offset) : sample.compositionTimeOffset = view.getUint32(offset), offset += 4), result.samples.push(sample); return result; }; }, function(module, exports, __webpack_require__) { "use strict"; var toUnsigned = __webpack_require__(150).toUnsigned; module.exports = function(data) { var result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), baseMediaDecodeTime: toUnsigned(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]) }; return 1 === result.version && (result.baseMediaDecodeTime *= Math.pow(2, 32), result.baseMediaDecodeTime += toUnsigned(data[8] << 24 | data[9] << 16 | data[10] << 8 | data[11])), result; }; }, function(module, exports, __webpack_require__) { "use strict"; var _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream, Stream = __webpack_require__(38), mp4 = __webpack_require__(149), frameUtils = __webpack_require__(449), audioFrameUtils = __webpack_require__(450), trackDecodeInfo = __webpack_require__(151), m2ts = __webpack_require__(152), clock = __webpack_require__(59), AdtsStream = __webpack_require__(148), H264Stream = __webpack_require__(222).H264Stream, AacStream = __webpack_require__(454), isLikelyAacData = __webpack_require__(154).isLikelyAacData, ONE_SECOND_IN_TS = __webpack_require__(59).ONE_SECOND_IN_TS, AUDIO_PROPERTIES = __webpack_require__(455), VIDEO_PROPERTIES = __webpack_require__(456), arrayEquals = function(a, b) { var i; if (a.length !== b.length) return !1; for (i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1; return !0; }, generateSegmentTimingInfo = function(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) { return { start: { dts: baseMediaDecodeTime, pts: baseMediaDecodeTime + (startPts - startDts) }, end: { dts: baseMediaDecodeTime + (endDts - startDts), pts: baseMediaDecodeTime + (endPts - startPts) }, prependedContentDuration: prependedContentDuration, baseMediaDecodeTime: baseMediaDecodeTime }; }; (_AudioSegmentStream = function(track, options) { var adtsFrames = [], sequenceNumber = 0, earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = 1 / 0; options = options || {}, _AudioSegmentStream.prototype.init.call(this), this.push = function(data) { trackDecodeInfo.collectDtsInfo(track, data), track && AUDIO_PROPERTIES.forEach((function(prop) { track[prop] = data[prop]; })), adtsFrames.push(data); }, this.setEarliestDts = function(earliestDts) { earliestAllowedDts = earliestDts; }, this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) { videoBaseMediaDecodeTime = baseMediaDecodeTime; }, this.setAudioAppendStart = function(timestamp) { audioAppendStartTs = timestamp; }, this.flush = function() { var frames, moof, mdat, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed; 0 !== adtsFrames.length ? (frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts), track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps), videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime), track.samples = audioFrameUtils.generateSampleTable(frames), mdat = mp4.mdat(audioFrameUtils.concatenateFrameData(frames)), adtsFrames = [], moof = mp4.moof(sequenceNumber, [ track ]), boxes = new Uint8Array(moof.byteLength + mdat.byteLength), sequenceNumber++, boxes.set(moof), boxes.set(mdat, moof.byteLength), trackDecodeInfo.clearDtsInfo(track), frameDuration = Math.ceil(1024 * ONE_SECOND_IN_TS / track.samplerate), frames.length && (segmentDuration = frames.length * frameDuration, this.trigger("segmentTimingInfo", generateSegmentTimingInfo(clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate), frames[0].dts, frames[0].pts, frames[0].dts + segmentDuration, frames[0].pts + segmentDuration, videoClockCyclesOfSilencePrefixed || 0)), this.trigger("timingInfo", { start: frames[0].pts, end: frames[0].pts + segmentDuration })), this.trigger("data", { track: track, boxes: boxes }), this.trigger("done", "AudioSegmentStream")) : this.trigger("done", "AudioSegmentStream"); }, this.reset = function() { trackDecodeInfo.clearDtsInfo(track), adtsFrames = [], this.trigger("reset"); }; }).prototype = new Stream, (_VideoSegmentStream = function(track, options) { var config, pps, sequenceNumber = 0, nalUnits = [], gopsToAlignWith = []; options = options || {}, _VideoSegmentStream.prototype.init.call(this), delete track.minPTS, this.gopCache_ = [], this.push = function(nalUnit) { trackDecodeInfo.collectDtsInfo(track, nalUnit), "seq_parameter_set_rbsp" !== nalUnit.nalUnitType || config || (config = nalUnit.config, track.sps = [ nalUnit.data ], VIDEO_PROPERTIES.forEach((function(prop) { track[prop] = config[prop]; }), this)), "pic_parameter_set_rbsp" !== nalUnit.nalUnitType || pps || (pps = nalUnit.data, track.pps = [ nalUnit.data ]), nalUnits.push(nalUnit); }, this.flush = function() { for (var frames, gopForFusion, gops, moof, mdat, boxes, firstGop, lastGop, prependedContentDuration = 0; nalUnits.length && "access_unit_delimiter_rbsp" !== nalUnits[0].nalUnitType; ) nalUnits.shift(); if (0 === nalUnits.length) return this.resetStream_(), void this.trigger("done", "VideoSegmentStream"); if (frames = frameUtils.groupNalsIntoFrames(nalUnits), (gops = frameUtils.groupFramesIntoGops(frames))[0][0].keyFrame || ((gopForFusion = this.getGopForFusion_(nalUnits[0], track)) ? (prependedContentDuration = gopForFusion.duration, gops.unshift(gopForFusion), gops.byteLength += gopForFusion.byteLength, gops.nalCount += gopForFusion.nalCount, gops.pts = gopForFusion.pts, gops.dts = gopForFusion.dts, gops.duration += gopForFusion.duration) : gops = frameUtils.extendFirstKeyFrame(gops)), gopsToAlignWith.length) { var alignedGops; if (!(alignedGops = options.alignGopsAtEnd ? this.alignGopsAtEnd_(gops) : this.alignGopsAtStart_(gops))) return this.gopCache_.unshift({ gop: gops.pop(), pps: track.pps, sps: track.sps }), this.gopCache_.length = Math.min(6, this.gopCache_.length), nalUnits = [], this.resetStream_(), void this.trigger("done", "VideoSegmentStream"); trackDecodeInfo.clearDtsInfo(track), gops = alignedGops; } trackDecodeInfo.collectDtsInfo(track, gops), track.samples = frameUtils.generateSampleTable(gops), mdat = mp4.mdat(frameUtils.concatenateNalData(gops)), track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps), this.trigger("processedGopsInfo", gops.map((function(gop) { return { pts: gop.pts, dts: gop.dts, byteLength: gop.byteLength }; }))), firstGop = gops[0], lastGop = gops[gops.length - 1], this.trigger("segmentTimingInfo", generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration)), this.trigger("timingInfo", { start: gops[0].pts, end: gops[gops.length - 1].pts + gops[gops.length - 1].duration }), this.gopCache_.unshift({ gop: gops.pop(), pps: track.pps, sps: track.sps }), this.gopCache_.length = Math.min(6, this.gopCache_.length), nalUnits = [], this.trigger("baseMediaDecodeTime", track.baseMediaDecodeTime), this.trigger("timelineStartInfo", track.timelineStartInfo), moof = mp4.moof(sequenceNumber, [ track ]), boxes = new Uint8Array(moof.byteLength + mdat.byteLength), sequenceNumber++, boxes.set(moof), boxes.set(mdat, moof.byteLength), this.trigger("data", { track: track, boxes: boxes }), this.resetStream_(), this.trigger("done", "VideoSegmentStream"); }, this.reset = function() { this.resetStream_(), nalUnits = [], this.gopCache_.length = 0, gopsToAlignWith.length = 0, this.trigger("reset"); }, this.resetStream_ = function() { trackDecodeInfo.clearDtsInfo(track), config = void 0, pps = void 0; }, this.getGopForFusion_ = function(nalUnit) { var dtsDistance, nearestGopObj, currentGop, currentGopObj, i, nearestDistance = 1 / 0; for (i = 0; i < this.gopCache_.length; i++) currentGop = (currentGopObj = this.gopCache_[i]).gop, track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0]) && track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]) && (currentGop.dts < track.timelineStartInfo.dts || (dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration) >= -1e4 && dtsDistance <= 45e3 && (!nearestGopObj || nearestDistance > dtsDistance) && (nearestGopObj = currentGopObj, nearestDistance = dtsDistance)); return nearestGopObj ? nearestGopObj.gop : null; }, this.alignGopsAtStart_ = function(gops) { var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops; for (byteLength = gops.byteLength, nalCount = gops.nalCount, duration = gops.duration, alignIndex = gopIndex = 0; alignIndex < gopsToAlignWith.length && gopIndex < gops.length && (align = gopsToAlignWith[alignIndex], gop = gops[gopIndex], align.pts !== gop.pts); ) gop.pts > align.pts ? alignIndex++ : (gopIndex++, byteLength -= gop.byteLength, nalCount -= gop.nalCount, duration -= gop.duration); return 0 === gopIndex ? gops : gopIndex === gops.length ? null : ((alignedGops = gops.slice(gopIndex)).byteLength = byteLength, alignedGops.duration = duration, alignedGops.nalCount = nalCount, alignedGops.pts = alignedGops[0].pts, alignedGops.dts = alignedGops[0].dts, alignedGops); }, this.alignGopsAtEnd_ = function(gops) { var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound, trimIndex; for (alignIndex = gopsToAlignWith.length - 1, gopIndex = gops.length - 1, alignEndIndex = null, matchFound = !1; alignIndex >= 0 && gopIndex >= 0; ) { if (align = gopsToAlignWith[alignIndex], gop = gops[gopIndex], align.pts === gop.pts) { matchFound = !0; break; } align.pts > gop.pts ? alignIndex-- : (alignIndex === gopsToAlignWith.length - 1 && (alignEndIndex = gopIndex), gopIndex--); } if (!matchFound && null === alignEndIndex) return null; if (0 === (trimIndex = matchFound ? gopIndex : alignEndIndex)) return gops; var alignedGops = gops.slice(trimIndex), metadata = alignedGops.reduce((function(total, gop) { return total.byteLength += gop.byteLength, total.duration += gop.duration, total.nalCount += gop.nalCount, total; }), { byteLength: 0, duration: 0, nalCount: 0 }); return alignedGops.byteLength = metadata.byteLength, alignedGops.duration = metadata.duration, alignedGops.nalCount = metadata.nalCount, alignedGops.pts = alignedGops[0].pts, alignedGops.dts = alignedGops[0].dts, alignedGops; }, this.alignGopsWith = function(newGopsToAlignWith) { gopsToAlignWith = newGopsToAlignWith; }; }).prototype = new Stream, (_CoalesceStream = function(options, metadataStream) { this.numberOfTracks = 0, this.metadataStream = metadataStream, void 0 !== (options = options || {}).remux ? this.remuxTracks = !!options.remux : this.remuxTracks = !0, "boolean" == typeof options.keepOriginalTimestamps ? this.keepOriginalTimestamps = options.keepOriginalTimestamps : this.keepOriginalTimestamps = !1, this.pendingTracks = [], this.videoTrack = null, this.pendingBoxes = [], this.pendingCaptions = [], this.pendingMetadata = [], this.pendingBytes = 0, this.emittedTracks = 0, _CoalesceStream.prototype.init.call(this), this.push = function(output) { return output.text ? this.pendingCaptions.push(output) : output.frames ? this.pendingMetadata.push(output) : (this.pendingTracks.push(output.track), this.pendingBytes += output.boxes.byteLength, "video" === output.track.type && (this.videoTrack = output.track, this.pendingBoxes.push(output.boxes)), void ("audio" === output.track.type && (this.audioTrack = output.track, this.pendingBoxes.unshift(output.boxes)))); }; }).prototype = new Stream, _CoalesceStream.prototype.flush = function(flushSource) { var caption, id3, initSegment, i, offset = 0, event = { captions: [], captionStreams: {}, metadata: [], info: {} }, timelineStartPts = 0; if (this.pendingTracks.length < this.numberOfTracks) { if ("VideoSegmentStream" !== flushSource && "AudioSegmentStream" !== flushSource) return; if (this.remuxTracks) return; if (0 === this.pendingTracks.length) return this.emittedTracks++, void (this.emittedTracks >= this.numberOfTracks && (this.trigger("done"), this.emittedTracks = 0)); } if (this.videoTrack ? (timelineStartPts = this.videoTrack.timelineStartInfo.pts, VIDEO_PROPERTIES.forEach((function(prop) { event.info[prop] = this.videoTrack[prop]; }), this)) : this.audioTrack && (timelineStartPts = this.audioTrack.timelineStartInfo.pts, AUDIO_PROPERTIES.forEach((function(prop) { event.info[prop] = this.audioTrack[prop]; }), this)), this.videoTrack || this.audioTrack) { for (1 === this.pendingTracks.length ? event.type = this.pendingTracks[0].type : event.type = "combined", this.emittedTracks += this.pendingTracks.length, initSegment = mp4.initSegment(this.pendingTracks), event.initSegment = new Uint8Array(initSegment.byteLength), event.initSegment.set(initSegment), event.data = new Uint8Array(this.pendingBytes), i = 0; i < this.pendingBoxes.length; i++) event.data.set(this.pendingBoxes[i], offset), offset += this.pendingBoxes[i].byteLength; for (i = 0; i < this.pendingCaptions.length; i++) (caption = this.pendingCaptions[i]).startTime = clock.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps), caption.endTime = clock.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps), event.captionStreams[caption.stream] = !0, event.captions.push(caption); for (i = 0; i < this.pendingMetadata.length; i++) (id3 = this.pendingMetadata[i]).cueTime = clock.metadataTsToSeconds(id3.pts, timelineStartPts, this.keepOriginalTimestamps), event.metadata.push(id3); for (event.metadata.dispatchType = this.metadataStream.dispatchType, this.pendingTracks.length = 0, this.videoTrack = null, this.pendingBoxes.length = 0, this.pendingCaptions.length = 0, this.pendingBytes = 0, this.pendingMetadata.length = 0, this.trigger("data", event), i = 0; i < event.captions.length; i++) caption = event.captions[i], this.trigger("caption", caption); for (i = 0; i < event.metadata.length; i++) id3 = event.metadata[i], this.trigger("id3Frame", id3); } this.emittedTracks >= this.numberOfTracks && (this.trigger("done"), this.emittedTracks = 0); }, _CoalesceStream.prototype.setRemux = function(val) { this.remuxTracks = val; }, (_Transmuxer = function(options) { var videoTrack, audioTrack, self = this, hasFlushed = !0; _Transmuxer.prototype.init.call(this), options = options || {}, this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0, this.transmuxPipeline_ = {}, this.setupAacPipeline = function() { var pipeline = {}; this.transmuxPipeline_ = pipeline, pipeline.type = "aac", pipeline.metadataStream = new m2ts.MetadataStream, pipeline.aacStream = new AacStream, pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream("audio"), pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream("timed-metadata"), pipeline.adtsStream = new AdtsStream, pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream), pipeline.headOfPipeline = pipeline.aacStream, pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream), pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream), pipeline.metadataStream.on("timestamp", (function(frame) { pipeline.aacStream.setTimestamp(frame.timeStamp); })), pipeline.aacStream.on("data", (function(data) { "timed-metadata" !== data.type && "audio" !== data.type || pipeline.audioSegmentStream || (audioTrack = audioTrack || { timelineStartInfo: { baseMediaDecodeTime: self.baseMediaDecodeTime }, codec: "adts", type: "audio" }, pipeline.coalesceStream.numberOfTracks++, pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options), pipeline.audioSegmentStream.on("log", self.getLogTrigger_("audioSegmentStream")), pipeline.audioSegmentStream.on("timingInfo", self.trigger.bind(self, "audioTimingInfo")), pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream), self.trigger("trackinfo", { hasAudio: !!audioTrack, hasVideo: !!videoTrack })); })), pipeline.coalesceStream.on("data", this.trigger.bind(this, "data")), pipeline.coalesceStream.on("done", this.trigger.bind(this, "done")); }, this.setupTsPipeline = function() { var pipeline = {}; this.transmuxPipeline_ = pipeline, pipeline.type = "ts", pipeline.metadataStream = new m2ts.MetadataStream, pipeline.packetStream = new m2ts.TransportPacketStream, pipeline.parseStream = new m2ts.TransportParseStream, pipeline.elementaryStream = new m2ts.ElementaryStream, pipeline.timestampRolloverStream = new m2ts.TimestampRolloverStream, pipeline.adtsStream = new AdtsStream, pipeline.h264Stream = new H264Stream, pipeline.captionStream = new m2ts.CaptionStream(options), pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream), pipeline.headOfPipeline = pipeline.packetStream, pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream), pipeline.timestampRolloverStream.pipe(pipeline.h264Stream), pipeline.timestampRolloverStream.pipe(pipeline.adtsStream), pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream), pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream), pipeline.elementaryStream.on("data", (function(data) { var i; if ("metadata" === data.type) { for (i = data.tracks.length; i--; ) videoTrack || "video" !== data.tracks[i].type ? audioTrack || "audio" !== data.tracks[i].type || ((audioTrack = data.tracks[i]).timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime) : (videoTrack = data.tracks[i]).timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime; videoTrack && !pipeline.videoSegmentStream && (pipeline.coalesceStream.numberOfTracks++, pipeline.videoSegmentStream = new _VideoSegmentStream(videoTrack, options), pipeline.videoSegmentStream.on("log", self.getLogTrigger_("videoSegmentStream")), pipeline.videoSegmentStream.on("timelineStartInfo", (function(timelineStartInfo) { audioTrack && !options.keepOriginalTimestamps && (audioTrack.timelineStartInfo = timelineStartInfo, pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self.baseMediaDecodeTime)); })), pipeline.videoSegmentStream.on("processedGopsInfo", self.trigger.bind(self, "gopInfo")), pipeline.videoSegmentStream.on("segmentTimingInfo", self.trigger.bind(self, "videoSegmentTimingInfo")), pipeline.videoSegmentStream.on("baseMediaDecodeTime", (function(baseMediaDecodeTime) { audioTrack && pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime); })), pipeline.videoSegmentStream.on("timingInfo", self.trigger.bind(self, "videoTimingInfo")), pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream)), audioTrack && !pipeline.audioSegmentStream && (pipeline.coalesceStream.numberOfTracks++, pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options), pipeline.audioSegmentStream.on("log", self.getLogTrigger_("audioSegmentStream")), pipeline.audioSegmentStream.on("timingInfo", self.trigger.bind(self, "audioTimingInfo")), pipeline.audioSegmentStream.on("segmentTimingInfo", self.trigger.bind(self, "audioSegmentTimingInfo")), pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream)), self.trigger("trackinfo", { hasAudio: !!audioTrack, hasVideo: !!videoTrack }); } })), pipeline.coalesceStream.on("data", this.trigger.bind(this, "data")), pipeline.coalesceStream.on("id3Frame", (function(id3Frame) { id3Frame.dispatchType = pipeline.metadataStream.dispatchType, self.trigger("id3Frame", id3Frame); })), pipeline.coalesceStream.on("caption", this.trigger.bind(this, "caption")), pipeline.coalesceStream.on("done", this.trigger.bind(this, "done")); }, this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) { var pipeline = this.transmuxPipeline_; options.keepOriginalTimestamps || (this.baseMediaDecodeTime = baseMediaDecodeTime), audioTrack && (audioTrack.timelineStartInfo.dts = void 0, audioTrack.timelineStartInfo.pts = void 0, trackDecodeInfo.clearDtsInfo(audioTrack), pipeline.audioTimestampRolloverStream && pipeline.audioTimestampRolloverStream.discontinuity()), videoTrack && (pipeline.videoSegmentStream && (pipeline.videoSegmentStream.gopCache_ = []), videoTrack.timelineStartInfo.dts = void 0, videoTrack.timelineStartInfo.pts = void 0, trackDecodeInfo.clearDtsInfo(videoTrack), pipeline.captionStream.reset()), pipeline.timestampRolloverStream && pipeline.timestampRolloverStream.discontinuity(); }, this.setAudioAppendStart = function(timestamp) { audioTrack && this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp); }, this.setRemux = function(val) { var pipeline = this.transmuxPipeline_; options.remux = val, pipeline && pipeline.coalesceStream && pipeline.coalesceStream.setRemux(val); }, this.alignGopsWith = function(gopsToAlignWith) { videoTrack && this.transmuxPipeline_.videoSegmentStream && this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith); }, this.getLogTrigger_ = function(key) { var self = this; return function(event) { event.stream = key, self.trigger("log", event); }; }, this.push = function(data) { if (hasFlushed) { var isAac = isLikelyAacData(data); if (isAac && "aac" !== this.transmuxPipeline_.type ? this.setupAacPipeline() : isAac || "ts" === this.transmuxPipeline_.type || this.setupTsPipeline(), this.transmuxPipeline_) for (var keys = Object.keys(this.transmuxPipeline_), i = 0; i < keys.length; i++) { var key = keys[i]; "headOfPipeline" !== key && this.transmuxPipeline_[key].on && this.transmuxPipeline_[key].on("log", this.getLogTrigger_(key)); } hasFlushed = !1; } this.transmuxPipeline_.headOfPipeline.push(data); }, this.flush = function() { hasFlushed = !0, this.transmuxPipeline_.headOfPipeline.flush(); }, this.endTimeline = function() { this.transmuxPipeline_.headOfPipeline.endTimeline(); }, this.reset = function() { this.transmuxPipeline_.headOfPipeline && this.transmuxPipeline_.headOfPipeline.reset(); }, this.resetCaptions = function() { this.transmuxPipeline_.captionStream && this.transmuxPipeline_.captionStream.reset(); }; }).prototype = new Stream, module.exports = { Transmuxer: _Transmuxer, VideoSegmentStream: _VideoSegmentStream, AudioSegmentStream: _AudioSegmentStream, AUDIO_PROPERTIES: AUDIO_PROPERTIES, VIDEO_PROPERTIES: VIDEO_PROPERTIES, generateSegmentTimingInfo: generateSegmentTimingInfo }; }, function(module, exports, __webpack_require__) { "use strict"; var _FlvTag; (_FlvTag = function(type, extraData) { var i, adHoc = 0, bufferStartSize = 16384, prepareWrite = function(flv, count) { var bytes, minLength = flv.position + count; minLength < flv.bytes.byteLength || ((bytes = new Uint8Array(2 * minLength)).set(flv.bytes.subarray(0, flv.position), 0), flv.bytes = bytes, flv.view = new DataView(flv.bytes.buffer)); }, widthBytes = _FlvTag.widthBytes || new Uint8Array("width".length), heightBytes = _FlvTag.heightBytes || new Uint8Array("height".length), videocodecidBytes = _FlvTag.videocodecidBytes || new Uint8Array("videocodecid".length); if (!_FlvTag.widthBytes) { for (i = 0; i < "width".length; i++) widthBytes[i] = "width".charCodeAt(i); for (i = 0; i < "height".length; i++) heightBytes[i] = "height".charCodeAt(i); for (i = 0; i < "videocodecid".length; i++) videocodecidBytes[i] = "videocodecid".charCodeAt(i); _FlvTag.widthBytes = widthBytes, _FlvTag.heightBytes = heightBytes, _FlvTag.videocodecidBytes = videocodecidBytes; } switch (this.keyFrame = !1, type) { case _FlvTag.VIDEO_TAG: this.length = 16, bufferStartSize *= 6; break; case _FlvTag.AUDIO_TAG: this.length = 13, this.keyFrame = !0; break; case _FlvTag.METADATA_TAG: this.length = 29, this.keyFrame = !0; break; default: throw new Error("Unknown FLV tag type"); } this.bytes = new Uint8Array(bufferStartSize), this.view = new DataView(this.bytes.buffer), this.bytes[0] = type, this.position = this.length, this.keyFrame = extraData, this.pts = 0, this.dts = 0, this.writeBytes = function(bytes, offset, length) { var end, start = offset || 0; end = start + (length = length || bytes.byteLength), prepareWrite(this, length), this.bytes.set(bytes.subarray(start, end), this.position), this.position += length, this.length = Math.max(this.length, this.position); }, this.writeByte = function(byte) { prepareWrite(this, 1), this.bytes[this.position] = byte, this.position++, this.length = Math.max(this.length, this.position); }, this.writeShort = function(short) { prepareWrite(this, 2), this.view.setUint16(this.position, short), this.position += 2, this.length = Math.max(this.length, this.position); }, this.negIndex = function(pos) { return this.bytes[this.length - pos]; }, this.nalUnitSize = function() { return 0 === adHoc ? 0 : this.length - (adHoc + 4); }, this.startNalUnit = function() { if (adHoc > 0) throw new Error("Attempted to create new NAL wihout closing the old one"); adHoc = this.length, this.length += 4, this.position = this.length; }, this.endNalUnit = function(nalContainer) { var nalStart, nalLength; this.length === adHoc + 4 ? this.length -= 4 : adHoc > 0 && (nalStart = adHoc + 4, nalLength = this.length - nalStart, this.position = adHoc, this.view.setUint32(this.position, nalLength), this.position = this.length, nalContainer && nalContainer.push(this.bytes.subarray(nalStart, nalStart + nalLength))), adHoc = 0; }, this.writeMetaDataDouble = function(key, val) { var i; if (prepareWrite(this, 2 + key.length + 9), this.view.setUint16(this.position, key.length), this.position += 2, "width" === key) this.bytes.set(widthBytes, this.position), this.position += 5; else if ("height" === key) this.bytes.set(heightBytes, this.position), this.position += 6; else if ("videocodecid" === key) this.bytes.set(videocodecidBytes, this.position), this.position += 12; else for (i = 0; i < key.length; i++) this.bytes[this.position] = key.charCodeAt(i), this.position++; this.position++, this.view.setFloat64(this.position, val), this.position += 8, this.length = Math.max(this.length, this.position), ++adHoc; }, this.writeMetaDataBoolean = function(key, val) { var i; for (prepareWrite(this, 2), this.view.setUint16(this.position, key.length), this.position += 2, i = 0; i < key.length; i++) prepareWrite(this, 1), this.bytes[this.position] = key.charCodeAt(i), this.position++; prepareWrite(this, 2), this.view.setUint8(this.position, 1), this.position++, this.view.setUint8(this.position, val ? 1 : 0), this.position++, this.length = Math.max(this.length, this.position), ++adHoc; }, this.finalize = function() { var dtsDelta, len; switch (this.bytes[0]) { case _FlvTag.VIDEO_TAG: this.bytes[11] = 7 | (this.keyFrame || extraData ? 16 : 32), this.bytes[12] = extraData ? 0 : 1, dtsDelta = this.pts - this.dts, this.bytes[13] = (16711680 & dtsDelta) >>> 16, this.bytes[14] = (65280 & dtsDelta) >>> 8, this.bytes[15] = (255 & dtsDelta) >>> 0; break; case _FlvTag.AUDIO_TAG: this.bytes[11] = 175, this.bytes[12] = extraData ? 0 : 1; break; case _FlvTag.METADATA_TAG: this.position = 11, this.view.setUint8(this.position, 2), this.position++, this.view.setUint16(this.position, 10), this.position += 2, this.bytes.set([ 111, 110, 77, 101, 116, 97, 68, 97, 116, 97 ], this.position), this.position += 10, this.bytes[this.position] = 8, this.position++, this.view.setUint32(this.position, adHoc), this.position = this.length, this.bytes.set([ 0, 0, 9 ], this.position), this.position += 3, this.length = this.position; } return len = this.length - 11, this.bytes[1] = (16711680 & len) >>> 16, this.bytes[2] = (65280 & len) >>> 8, this.bytes[3] = (255 & len) >>> 0, this.bytes[4] = (16711680 & this.dts) >>> 16, this.bytes[5] = (65280 & this.dts) >>> 8, this.bytes[6] = (255 & this.dts) >>> 0, this.bytes[7] = (4278190080 & this.dts) >>> 24, this.bytes[8] = 0, this.bytes[9] = 0, this.bytes[10] = 0, prepareWrite(this, 4), this.view.setUint32(this.length, this.length), this.length += 4, this.position += 4, this.bytes = this.bytes.subarray(0, this.length), this.frameTime = _FlvTag.frameTime(this.bytes), this; }; }).AUDIO_TAG = 8, _FlvTag.VIDEO_TAG = 9, _FlvTag.METADATA_TAG = 18, _FlvTag.isAudioFrame = function(tag) { return _FlvTag.AUDIO_TAG === tag[0]; }, _FlvTag.isVideoFrame = function(tag) { return _FlvTag.VIDEO_TAG === tag[0]; }, _FlvTag.isMetaData = function(tag) { return _FlvTag.METADATA_TAG === tag[0]; }, _FlvTag.isKeyFrame = function(tag) { return _FlvTag.isVideoFrame(tag) ? 23 === tag[11] : !!_FlvTag.isAudioFrame(tag) || !!_FlvTag.isMetaData(tag); }, _FlvTag.frameTime = function(tag) { var pts = tag[4] << 16; return pts |= tag[5] << 8, (pts |= tag[6] << 0) | tag[7] << 24; }, module.exports = _FlvTag; }, function(module, exports, __webpack_require__) { "use strict"; var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(74).codes.ERR_STREAM_PREMATURE_CLOSE; function noop() {} module.exports = function eos(stream, opts, callback) { if ("function" == typeof opts) return eos(stream, null, opts); opts || (opts = {}), callback = (function(callback) { var called = !1; return function() { if (!called) { called = !0; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; callback.apply(this, args); } }; })(callback || noop); var readable = opts.readable || !1 !== opts.readable && stream.readable, writable = opts.writable || !1 !== opts.writable && stream.writable, onlegacyfinish = function() { stream.writable || onfinish(); }, writableEnded = stream._writableState && stream._writableState.finished, onfinish = function() { writable = !1, writableEnded = !0, readable || callback.call(stream); }, readableEnded = stream._readableState && stream._readableState.endEmitted, onend = function() { readable = !1, readableEnded = !0, writable || callback.call(stream); }, onerror = function(err) { callback.call(stream, err); }, onclose = function() { var err; return readable && !readableEnded ? (stream._readableState && stream._readableState.ended || (err = new ERR_STREAM_PREMATURE_CLOSE), callback.call(stream, err)) : writable && !writableEnded ? (stream._writableState && stream._writableState.ended || (err = new ERR_STREAM_PREMATURE_CLOSE), callback.call(stream, err)) : void 0; }, onrequest = function() { stream.req.on("finish", onfinish); }; return (function(stream) { return stream.setHeader && "function" == typeof stream.abort; })(stream) ? (stream.on("complete", onfinish), stream.on("abort", onclose), stream.req ? onrequest() : stream.on("request", onrequest)) : writable && !stream._writableState && (stream.on("end", onlegacyfinish), stream.on("close", onlegacyfinish)), stream.on("end", onend), stream.on("finish", onfinish), !1 !== opts.error && stream.on("error", onerror), stream.on("close", onclose), function() { stream.removeListener("complete", onfinish), stream.removeListener("abort", onclose), stream.removeListener("request", onrequest), stream.req && stream.req.removeListener("finish", onfinish), stream.removeListener("end", onlegacyfinish), stream.removeListener("close", onlegacyfinish), stream.removeListener("finish", onfinish), stream.removeListener("end", onend), stream.removeListener("error", onerror), stream.removeListener("close", onclose); }; }; }, function(module, exports, __webpack_require__) { const readChunk = __webpack_require__(912); module.exports = readChunk; }, function(module, exports, __webpack_require__) { "use strict"; var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; const stream_1 = __webpack_require__(3), url_1 = __webpack_require__(7), miniget_1 = __importDefault(__webpack_require__(156)), m3u8_parser_1 = __importDefault(__webpack_require__(941)), dash_mpd_parser_1 = __importDefault(__webpack_require__(942)), queue_1 = __importDefault(__webpack_require__(943)), parse_time_1 = __webpack_require__(472), supportedParsers = { m3u8: m3u8_parser_1.default, "dash-mpd": dash_mpd_parser_1.default }; let m3u8stream = (playlistURL, options = {}) => { const stream = new stream_1.PassThrough, chunkReadahead = options.chunkReadahead || 3, liveBuffer = options.liveBuffer || 2e4, requestOptions = options.requestOptions, Parser = supportedParsers[options.parser || (/\.mpd$/.test(playlistURL) ? "dash-mpd" : "m3u8")]; if (!Parser) throw TypeError(`parser '${options.parser}' not supported`); let begin = 0; void 0 !== options.begin && (begin = "string" == typeof options.begin ? parse_time_1.humanStr(options.begin) : Math.max(options.begin - liveBuffer, 0)); const forwardEvents = req => { for (let event of [ "abort", "request", "response", "redirect", "retry", "reconnect" ]) req.on(event, stream.emit.bind(stream, event)); }; let currSegment; const streamQueue = new queue_1.default(((req, callback) => { currSegment = req; let size = 0; req.on("data", (chunk => size += chunk.length)), req.pipe(stream, { end: !1 }), req.on("end", (() => callback(void 0, size))); }), { concurrency: 1 }); let segmentNumber = 0, downloaded = 0; const requestQueue = new queue_1.default(((segment, callback) => { let options = Object.assign({}, requestOptions); segment.range && (options.headers = Object.assign({}, options.headers, { Range: `bytes=${segment.range.start}-${segment.range.end}` })); let req = miniget_1.default(url_1.resolve(playlistURL, segment.url), options); req.on("error", callback), forwardEvents(req), streamQueue.push(req, ((err, size) => { downloaded += +size, stream.emit("progress", { num: ++segmentNumber, size: size, duration: segment.duration, url: segment.url }, requestQueue.total, downloaded), callback(); })); }), { concurrency: chunkReadahead }), onError = err => { ended || (stream.emit("error", err), stream.end()); }; let refreshThreshold, minRefreshTime, refreshTimeout, lastRefresh, fetchingPlaylist = !0, ended = !1, isStatic = !1; const onQueuedEnd = err => { if (currSegment = null, err) onError(err); else if (!fetchingPlaylist && !ended && !isStatic && requestQueue.tasks.length + requestQueue.active <= refreshThreshold) { let ms = Math.max(0, minRefreshTime - (Date.now() - lastRefresh)); fetchingPlaylist = !0, refreshTimeout = setTimeout(refreshPlaylist, ms); } else !ended && !isStatic || requestQueue.tasks.length || requestQueue.active || stream.end(); }; let currPlaylist, lastSeq, starttime = 0; const refreshPlaylist = () => { lastRefresh = Date.now(), currPlaylist = miniget_1.default(playlistURL, requestOptions), currPlaylist.on("error", onError), forwardEvents(currPlaylist); const parser = currPlaylist.pipe(new Parser(options.id)); parser.on("starttime", (a => { starttime || (starttime = a, "string" == typeof options.begin && begin >= 0 && (begin += starttime)); })), parser.on("endlist", (() => { isStatic = !0; })), parser.on("endearly", currPlaylist.unpipe.bind(currPlaylist, parser)); let addedItems = []; const addItem = item => { if (!item.init) { if (item.seq <= lastSeq) return; lastSeq = item.seq; } begin = item.time, requestQueue.push(item, onQueuedEnd), addedItems.push(item); }; let tailedItems = [], tailedItemsDuration = 0; parser.on("item", (item => { let timedItem = Object.assign({ time: starttime }, item); if (begin <= timedItem.time) addItem(timedItem); else for (tailedItems.push(timedItem), tailedItemsDuration += timedItem.duration; tailedItems.length > 1 && tailedItemsDuration - tailedItems[0].duration > liveBuffer; ) tailedItemsDuration -= tailedItems.shift().duration; starttime += timedItem.duration; })), parser.on("end", (() => { currPlaylist = null, !addedItems.length && tailedItems.length && tailedItems.forEach((item => { addItem(item); })), refreshThreshold = Math.max(1, Math.ceil(.01 * addedItems.length)), minRefreshTime = addedItems.reduce(((total, item) => item.duration + total), 0), fetchingPlaylist = !1, onQueuedEnd(); })); }; return refreshPlaylist(), stream.end = () => { ended = !0, streamQueue.die(), requestQueue.die(), clearTimeout(refreshTimeout), null == currPlaylist || currPlaylist.destroy(), null == currSegment || currSegment.destroy(), stream_1.PassThrough.prototype.end.call(stream, null); }, stream; }; m3u8stream.parseTimestamp = parse_time_1.humanStr, module.exports = m3u8stream; }, function(module, exports, __webpack_require__) { var child = __webpack_require__(32), fetch = __webpack_require__(34), mime = __webpack_require__(78), fs = __webpack_require__(2), path = __webpack_require__(5), URL = __webpack_require__(7).URL, castingUtils = { getMime: function(mimeURL) { var type = mime.lookup(mimeURL); return type ? Promise.resolve(type) : fetch(mimeURL, { method: "HEAD" }).then((function(res) { return res.headers.get("content-type"); })); }, getRemoteFileMeta: function(metaURL) { if (console.log(metaURL), metaURL.startsWith("file://")) { var metaPath = decodeURI(new URL(metaURL).pathname).replace(/^\/([a-z]+:\/)/i, "$1").replace("/", path.sep); return new Promise((function(resolve, reject) { fs.stat(metaPath, (function(err, stats) { err ? reject(err) : resolve({ type: mime.lookup(metaPath), lenght: stats.size }); })); })); } return fetch(metaURL, { method: "HEAD", timeout: 5e3 }).then((function(fres) { return { type: fres.headers.get("content-type"), length: fres.headers.get("content-length") }; })); }, getVideoInfo: function(ffmpegPath, videoURL) { return new Promise((function(resolve, reject) { videoURL.startsWith("file://") && (videoURL = decodeURI(new URL(videoURL).pathname).replace(/^\/([a-z]+:\/)/i, "$1").replace("/", path.sep)); var data = "", propsProc = child.spawn(ffmpegPath, [ "-i", videoURL ]); propsProc.stderr.on("data", (function(chunk) { data += chunk; })), propsProc.stderr.on("end", (function() { if (!data) return reject(new Error("No data")); var matches = data.match(/duration: (\d+:\d+:\d+.\d+)/i), duration = 0; matches && (duration = castingUtils.HMSToSec(matches[1])); var streams = data.split("\n").filter((function(line) { return line.trim().startsWith("Stream"); })).map((function(line) { var codec = line.match(/#(\d+:\d+)(?:\((\w{3})\)|):\s(\w+):\s(\w+)(?:\s([^,]+),\s(\w+\([^)]+\)|[^,]+),\s([^,]+),\s(.*?)(?:\s(\(default\)))?$)?/m); if (!codec) return console.log('castingUtils: Cannot parse stream "' + line + '"'), null; const stream = { id: codec[1], lang: codec[2] || "und", type: codec[3], codec: codec[4], default: !!codec[9], misc: codec[8] }; switch (stream.type) { case "Video": stream.pixfmt = codec[6], stream.vidfmt = codec[7]; break; case "Audio": stream.frequency = codec[6], stream.channels = codec[7]; } return stream; })).filter((function(stream) { return null !== stream; })); resolve({ duration: duration, streams: streams }); })); })); }, secToHMS: function(s) { var h = Math.floor(s / 3600); s -= 3600 * h; var m = Math.floor(s / 60); return s -= 60 * m, [ h, m, s = Math.floor(s) ].map((function() { return ("0" + v).slice(-2); })).join(":"); }, HMSToSec: function(hms) { var matches = hms.match(/(\d+):(\d+):(\d+)(?:.(\d+))?/i); return matches ? 3600 * parseInt(matches[1], 10) + 60 * parseInt(matches[2], 10) + parseInt(matches[3], 10) + parseInt(matches[4] || 0, 10) / 100 : -1; } }; module.exports = castingUtils; }, function(module, exports, __webpack_require__) { "use strict"; var old; "undefined" != typeof Promise && (old = Promise); var bluebird = __webpack_require__(963)(); bluebird.noConflict = function() { try { Promise === bluebird && (Promise = old); } catch (e) {} return bluebird; }, module.exports = bluebird; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { alive: "ssdp:alive", bye: "ssdp:byebye", all: "ssdp:all", advertiseAlive: "advertise-alive", advertiseBye: "advertise-bye", notify: "notify", msearch: "m-search" }; }, function(module, exports, __webpack_require__) { "use strict"; !(function() { var inherits = __webpack_require__(0).inherits, EventEmitter = __webpack_require__(4).EventEmitter, dgram = __webpack_require__(79), os = __webpack_require__(23), net = __webpack_require__(39), constants = __webpack_require__(235), regex = { http: /HTTP\/\d{1}\.\d{1} \d+ .*/, ssdp: /^([^:]+):\s*(.*)$/ }, version_node = process.version.substr(1), version_module = __webpack_require__(478).version, version_name = __webpack_require__(478).name, self = function(opts) { var that = this; opts = opts || {}, this.running = !1, this.sig = opts.sig || "node.js/" + version_node + " " + version_name + "/" + version_module, this.multicastIp = 0 !== net.isIP(opts.multicastIp) ? opts.multicastIp : "239.255.255.250", this.multicast = opts.multicast || !0, this.port = opts.port || 1900, this.host = this.multicastIp + ":" + this.port, this.ttl = opts.ttl || 1, this.bindHost = opts.bindHost || !1, this.bindPort = opts.bindPort || 0, this.allowWildcards = opts.allowWildcards || !1, this.reuseAddr = opts.reuseAddr || !0, this.multicastLoopback = opts.multicastLoopback || !1, this.sockets = [], this.interfaces = (function() { var localAddresses = []; if (that.bindHost && 4 === net.isIP(that.bindHost)) localAddresses.push(that.bindHost); else { var osInterfaces = os.networkInterfaces(); for (var osInterface in osInterfaces) for (var osAddresses = osInterfaces[osInterface], i = 0; i < osAddresses.length; i++) { var osAddress = osAddresses[i]; osAddress.internal || "IPv4" === osAddress.family && localAddresses.push(osAddress.address); } } return localAddresses; })(); }; inherits(self, EventEmitter), self.prototype.stop = function() { for (var i = 0; i < this.sockets.length; i++) { var socket = this.sockets[i]; socket && socket.close(); } this.running = !1, this.sockets = [], this.emit("stop", !0); }, self.prototype.start = function() { if (!this.running) { this.running = !0; for (var i = 0; i < this.interfaces.length; i++) { var iface = this.interfaces[i], skt = this.createSocket(iface, this.bindPort); this.sockets.push(skt); } this.emit("start", !0); } }, self.prototype.createSocket = function(address, port) { var that = this, socket = dgram.createSocket({ type: "udp4", reuseAddr: that.reuseAddr, toString: function() { return that.type; } }); return socket.on("error", (function(err) { that.emit("error", { type: "socket", socket: socket, error: err }); })), socket.on("message", (function(message, referrer) { that.emit("message", { message: message, referrer: referrer }), that.parseMessage(message, referrer); })), socket.on("listening", (function() { try { var addr = socket.address(); } catch (e) { return void that.emit("error", { type: "listenSocket", socket: socket }); } var addMember = function() { try { that.multicast && socket.addMembership(that.multicastIp, address), socket.setMulticastTTL(that.ttl), socket.setMulticastLoopback(that.multicastLoopback); } catch (e) { "ENODEV" === e.code || "EADDRNOAVAIL" === e.code ? (that.emit("delay", { type: "socketMembership", address: addr.address, port: addr.port }), setTimeout((function() { addMember(); }), 5e3)) : that.emit("error", { type: "socketMembership", address: addr, error: e }); } }; addMember(); })), socket.bind({ port: port, address: address }, (function() { that.emit("bind", socket); })), socket; }, self.prototype.parseMessage = function(msg, rinfo) { var type = (msg = msg.toString()).split("\r\n").shift(); regex.http.test(type) ? this.parseResponse(msg, rinfo) : this.parseCommand(msg, rinfo); }, self.prototype.parseCommand = function(msg, rinfo) { var method = this.getMethod(msg), headers = this.getHeaders(msg); switch (method) { case constants.notify: this.notify(headers, msg, rinfo); break; case constants.msearch: this.msearch(headers, msg, rinfo); break; default: this.emit("error", { type: "command", subType: "unhandled", message: msg, rinfo: rinfo }); } }, self.prototype.notify = function(headers, msg, rinfo) { if (headers.NTS) switch (headers.NTS.toLowerCase()) { case constants.alive: this.emit(constants.advertiseAlive, { headers: headers, rinfo: rinfo }); break; case constants.bye: this.emit(constants.advertiseBye, { headers: headers, rinfo: rinfo }); break; default: this.emit("error", { type: "notify", subType: "unhandled", message: msg, rinfo: rinfo }); } }, self.prototype.msearch = function(headers, msg, rinfo) { headers.MAN && headers.MX && headers.ST && this.emit("msearch", headers, msg, rinfo); }, self.prototype.parseResponse = function(msg, rinfo) { var headers = this.getHeaders(msg), statusCode = this.getStatusCode(msg); this.emit("response", headers, statusCode, rinfo); }, self.prototype.getSSDPHeader = function(method, headers, isResponse) { var message = []; for (var header in method = method.toUpperCase(), isResponse ? message.push("HTTP/1.1 " + method) : message.push(method + " * HTTP/1.1"), headers) message.push(header + ": " + headers[header]); return message.push("\r\n"), message.join("\r\n"); }, self.prototype.getMethod = function(msg) { return (msg.split("\r\n").shift().split(" ")[0] || "").toLowerCase(); }, self.prototype.getStatusCode = function(msg) { var type = msg.split("\r\n").shift().split(" "); return parseInt(type[1], 10); }, self.prototype.getHeaders = function(msg) { for (var lines = msg.split("\r\n"), headers = {}, i = 0; i < lines.length; i++) { var line = lines[i]; if (line.length) { var pairs = line.match(regex.ssdp); pairs && (headers[pairs[1].toUpperCase()] = pairs[2]); } } return headers; }, self.prototype.send = function(message, host, port) { for (var targetHost = host || this.multicastIp, targetPort = port || this.port, self = this, i = 0; i < this.sockets.length; i++) this.sockets[i].send(message, 0, message.length, targetPort, targetHost, (function(err) { err ? self.emit("error", { type: "send", error: err }) : self.emit("send", message, targetHost, targetPort); })); }, module.exports = self; })(); }, function(module, exports, __webpack_require__) { __webpack_require__(2); var ProtoBuf = __webpack_require__(1001), cast_channel = __webpack_require__(1005), extensions = ProtoBuf.loadJson(cast_channel).build("extensions.api.cast_channel"); [ "CastMessage", "AuthChallenge", "AuthResponse", "AuthError", "DeviceAuthMessage" ].forEach((function(message) { module.exports[message] = { serialize: function(data) { return new extensions[message](data).encode().toBuffer(); }, parse: function(data) { return extensions[message].decode(data); } }; })); }, function(module, exports, __webpack_require__) { var sprintf = __webpack_require__(239).sprintf, utils = __webpack_require__(483), ElementPath = __webpack_require__(1011), TreeBuilder = __webpack_require__(484).TreeBuilder, get_parser = __webpack_require__(1013).get_parser, constants = __webpack_require__(1017), element_ids = 0; function Element(tag, attrib) { this._id = element_ids++, this.tag = tag, this.attrib = {}, this.text = null, this.tail = null, this._children = [], attrib && (this.attrib = utils.merge(this.attrib, attrib)); } function Comment(text) { var element = new Element(Comment); return text && (element.text = text), element; } function CData(text) { var element = new Element(CData); return text && (element.text = text), element; } function ProcessingInstruction(target, text) { var element = new Element(ProcessingInstruction); return element.text = target, text && (element.text = element.text + " " + text), element; } function QName(text_or_uri, tag) { tag && (text_or_uri = sprintf("{%s}%s", text_or_uri, tag)), this.text = text_or_uri; } function ElementTree(element) { this._root = element; } Element.prototype.toString = function() { return sprintf("", this.tag, this._id); }, Element.prototype.makeelement = function(tag, attrib) { return new Element(tag, attrib); }, Element.prototype.len = function() { return this._children.length; }, Element.prototype.getItem = function(index) { return this._children[index]; }, Element.prototype.setItem = function(index, element) { this._children[index] = element; }, Element.prototype.delItem = function(index) { this._children.splice(index, 1); }, Element.prototype.getSlice = function(start, stop) { return this._children.slice(start, stop); }, Element.prototype.setSlice = function(start, stop, elements) { var i, k = 0; for (i = start; i < stop; i++, k++) this._children[i] = elements[k]; }, Element.prototype.delSlice = function(start, stop) { this._children.splice(start, stop - start); }, Element.prototype.append = function(element) { this._children.push(element); }, Element.prototype.extend = function(elements) { this._children.concat(elements); }, Element.prototype.insert = function(index, element) { this._children[index] = element; }, Element.prototype.remove = function(element) { this._children = this._children.filter((function(e) { return e._id !== element._id; })); }, Element.prototype.getchildren = function() { return this._children; }, Element.prototype.find = function(path) { return ElementPath.find(this, path); }, Element.prototype.findtext = function(path, defvalue) { return ElementPath.findtext(this, path, defvalue); }, Element.prototype.findall = function(path, defvalue) { return ElementPath.findall(this, path, defvalue); }, Element.prototype.clear = function() { this.attrib = {}, this._children = [], this.text = null, this.tail = null; }, Element.prototype.get = function(key, defvalue) { return void 0 !== this.attrib[key] ? this.attrib[key] : defvalue; }, Element.prototype.set = function(key, value) { this.attrib[key] = value; }, Element.prototype.keys = function() { return Object.keys(this.attrib); }, Element.prototype.items = function() { return utils.items(this.attrib); }, Element.prototype.iter = function(tag, callback) { var i; for ("*" === tag && (tag = null), null !== tag && this.tag !== tag || callback(this), i = 0; i < this._children.length; i++) this._children[i].iter(tag, (function(e) { callback(e); })); }, Element.prototype.itertext = function(callback) { this.iter(null, (function(e) { e.text && callback(e.text), e.tail && callback(e.tail); })); }, QName.prototype.toString = function() { return this.text; }, ElementTree.prototype.getroot = function() { return this._root; }, ElementTree.prototype._setroot = function(element) { this._root = element; }, ElementTree.prototype.parse = function(source, parser) { return parser || (parser = new ((parser = get_parser(constants.DEFAULT_PARSER)).XMLParser)(new TreeBuilder)), parser.feed(source), this._root = parser.close(), this._root; }, ElementTree.prototype.iter = function(tag, callback) { this._root.iter(tag, callback); }, ElementTree.prototype.find = function(path) { return this._root.find(path); }, ElementTree.prototype.findtext = function(path, defvalue) { return this._root.findtext(path, defvalue); }, ElementTree.prototype.findall = function(path) { return this._root.findall(path); }, ElementTree.prototype.write = function(options) { var sb = []; if (!1 !== (options = utils.merge({ encoding: "utf-8", xml_declaration: null, default_namespace: null, method: "xml" }, options)).xml_declaration && sb.push("\n"), "text" === options.method) _serialize_text(sb, self._root, encoding); else { var qnames, namespaces, indent, indent_string, x = (function(elem, encoding, default_namespace) { var qnames = {}, namespaces = {}; function add_qname(qname) { if ("{" === qname[0]) { var tmp = qname.substring(1).split("}", 2), uri = tmp[0], tag = tmp[1], prefix = namespaces[uri]; void 0 === prefix && (void 0 === (prefix = _namespace_map[uri]) && (prefix = "ns" + Object.keys(namespaces).length), "xml" !== prefix && (namespaces[uri] = prefix)), qnames[qname] = prefix ? sprintf("%s:%s", prefix, tag) : tag; } else { if (default_namespace) throw new Error("cannot use non-qualified names with default_namespace option"); qnames[qname] = qname; } } return default_namespace && (namespaces[default_namespace] = ""), elem.iter(null, (function(e) { var tag = e.tag, text = e.text, items = e.items(); if (tag instanceof QName && void 0 === qnames[tag.text]) add_qname(tag.text); else if ("string" == typeof tag) add_qname(tag); else if (null !== tag && tag !== Comment && tag !== CData && tag !== ProcessingInstruction) throw new Error("Invalid tag type for serialization: " + tag); text instanceof QName && void 0 === qnames[text.text] && add_qname(text.text), items.forEach((function(item) { var key = item[0], value = item[1]; key instanceof QName && (key = key.text), void 0 === qnames[key] && add_qname(key), value instanceof QName && void 0 === qnames[value.text] && add_qname(value.text); })); })), [ qnames, namespaces ]; })(this._root, options.encoding, options.default_namespace); if (qnames = x[0], namespaces = x[1], options.hasOwnProperty("indent") ? (indent = 0, indent_string = new Array(options.indent + 1).join(" ")) : indent = !1, "xml" !== options.method) throw new Error("unknown serialization method " + options.method); _serialize_xml((function(data) { sb.push(data); }), this._root, options.encoding, qnames, namespaces, indent, indent_string); } return sb.join(""); }; var _namespace_map = { "http://www.w3.org/XML/1998/namespace": "xml", "http://www.w3.org/1999/xhtml": "html", "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", "http://schemas.xmlsoap.org/wsdl/": "wsdl", "http://www.w3.org/2001/XMLSchema": "xs", "http://www.w3.org/2001/XMLSchema-instance": "xsi", "http://purl.org/dc/elements/1.1/": "dc" }; function _escape(text, encoding, isAttribute, isText) { return text && (text = (text = (text = (text = text.toString()).replace(/&/g, "&")).replace(//g, ">"), isText || (text = (text = text.replace(/\n/g, " ")).replace(/\r/g, " ")), isAttribute && (text = text.replace(/"/g, """))), text; } function _escape_attrib(text, encoding) { return _escape(text, 0, !0); } function _escape_cdata(text, encoding) { return _escape(text, 0, !1); } function _escape_text(text, encoding) { return _escape(text, 0, !1, !0); } function _serialize_xml(write, elem, encoding, qnames, namespaces, indent, indent_string) { var items, tag = elem.tag, text = elem.text, newlines = indent || 0 === indent; write(Array(indent + 1).join(indent_string)), tag === Comment ? write(sprintf("\x3c!--%s--\x3e", _escape_cdata(text))) : tag === ProcessingInstruction ? write(sprintf("", _escape_cdata(text))) : tag === CData ? write(sprintf("", text = text || "")) : void 0 === (tag = qnames[tag]) ? (text && write(_escape_text(text)), elem.iter((function(e) { _serialize_xml(write, e, encoding, qnames, null, !!newlines && indent + 1, indent_string); }))) : (write("<" + tag), ((items = elem.items()) || namespaces) && (items.sort(), items.forEach((function(item) { var k = item[0], v = item[1]; k instanceof QName && (k = k.text), v = v instanceof QName ? qnames[v.text] : _escape_attrib(v), write(sprintf(' %s="%s"', qnames[k], v)); })), namespaces && ((items = utils.items(namespaces)).sort((function(a, b) { return a[1] < b[1]; })), items.forEach((function(item) { var k = item[1], v = item[0]; k && (k = ":" + k), write(sprintf(' xmlns%s="%s"', k, _escape_attrib(v))); })))), text || elem.len() ? (text && text.toString().match(/^\s*$/) && (text = null), write(">"), !text && newlines && write("\n"), text && write(_escape_text(text)), elem._children.forEach((function(e) { _serialize_xml(write, e, encoding, qnames, null, !!newlines && indent + 1, indent_string); })), !text && indent && write(Array(indent + 1).join(indent_string)), write("")) : write(" />")), newlines && write("\n"); } exports.PI = ProcessingInstruction, exports.Comment = Comment, exports.CData = CData, exports.ProcessingInstruction = ProcessingInstruction, exports.SubElement = function(parent, tag, attrib) { var element = parent.makeelement(tag, attrib); return parent.append(element), element; }, exports.QName = QName, exports.ElementTree = ElementTree, exports.ElementPath = ElementPath, exports.Element = function(tag, attrib) { return new Element(tag, attrib); }, exports.XML = function(data) { return (new ElementTree).parse(data); }, exports.parse = function(source, parser) { var tree = new ElementTree; return tree.parse(source, parser), tree; }, exports.register_namespace = function(prefix, uri) { if (/ns\d+$/.test(prefix)) throw new Error("Prefix format reserved for internal use"); _namespace_map.hasOwnProperty(uri) && _namespace_map[uri] === prefix && delete _namespace_map[uri], _namespace_map[uri] = prefix; }, exports.tostring = function(element, options) { return new ElementTree(element).write(options); }; }, function(module, exports) { var cache = {}, TO_ESCAPE = { "'": "\\'", "\n": "\\n" }; function populate(formatter) { var i, key = formatter, prev = 0, arg = 1, builder = "return '"; for (i = 0; i < formatter.length; i++) if ("%" === formatter[i]) switch (formatter[i + 1]) { case "s": builder += formatter.slice(prev, i) + "' + arguments[" + arg + "] + '", prev = i + 2, arg++; break; case "j": builder += formatter.slice(prev, i) + "' + JSON.stringify(arguments[" + arg + "]) + '", prev = i + 2, arg++; break; case "%": builder += formatter.slice(prev, i + 1), prev = i + 2, i++; } else TO_ESCAPE[formatter[i]] && (builder += formatter.slice(prev, i) + TO_ESCAPE[formatter[i]], prev = i + 1); builder += formatter.slice(prev) + "';", cache[key] = new Function(builder); } exports.sprintf = function(formatter, var_args) { return cache[formatter] || populate(formatter), cache[formatter].apply(null, arguments); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(1026); }, function(module, exports, __webpack_require__) { "use strict"; var createError = __webpack_require__(98), debug = __webpack_require__(9)("send"), deprecate = __webpack_require__(51)("send"), destroy = __webpack_require__(1033), encodeUrl = __webpack_require__(94), escapeHtml = __webpack_require__(95), etag = __webpack_require__(495), fresh = __webpack_require__(496), fs = __webpack_require__(2), mime = __webpack_require__(45), ms = __webpack_require__(1034), onFinished = __webpack_require__(96), parseRange = __webpack_require__(176), path = __webpack_require__(5), statuses = __webpack_require__(120), Stream = __webpack_require__(3), util = __webpack_require__(0), extname = path.extname, join = path.join, normalize = path.normalize, resolve = path.resolve, sep = path.sep, BYTES_RANGE_REGEXP = /^ *bytes=/, UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/; function SendStream(req, path, options) { Stream.call(this); var opts = options || {}; if (this.options = opts, this.path = path, this.req = req, this._acceptRanges = void 0 === opts.acceptRanges || Boolean(opts.acceptRanges), this._cacheControl = void 0 === opts.cacheControl || Boolean(opts.cacheControl), this._etag = void 0 === opts.etag || Boolean(opts.etag), this._dotfiles = void 0 !== opts.dotfiles ? opts.dotfiles : "ignore", "ignore" !== this._dotfiles && "allow" !== this._dotfiles && "deny" !== this._dotfiles) throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"'); this._hidden = Boolean(opts.hidden), void 0 !== opts.hidden && deprecate("hidden: use dotfiles: '" + (this._hidden ? "allow" : "ignore") + "' instead"), void 0 === opts.dotfiles && (this._dotfiles = void 0), this._extensions = void 0 !== opts.extensions ? normalizeList(opts.extensions, "extensions option") : [], this._immutable = void 0 !== opts.immutable && Boolean(opts.immutable), this._index = void 0 !== opts.index ? normalizeList(opts.index, "index option") : [ "index.html" ], this._lastModified = void 0 === opts.lastModified || Boolean(opts.lastModified), this._maxage = opts.maxAge || opts.maxage, this._maxage = "string" == typeof this._maxage ? ms(this._maxage) : Number(this._maxage), this._maxage = isNaN(this._maxage) ? 0 : Math.min(Math.max(0, this._maxage), 31536e6), this._root = opts.root ? resolve(opts.root) : null, !this._root && opts.from && this.from(opts.from); } function contentRange(type, size, range) { return type + " " + (range ? range.start + "-" + range.end : "*") + "/" + size; } function createHtmlDocument(title, body) { return '\n\n\n\n' + title + "\n\n\n
" + body + "
\n\n\n"; } function getHeaderNames(res) { return "function" != typeof res.getHeaderNames ? Object.keys(res._headers || {}) : res.getHeaderNames(); } function hasListeners(emitter, type) { return ("function" != typeof emitter.listenerCount ? emitter.listeners(type).length : emitter.listenerCount(type)) > 0; } function normalizeList(val, name) { for (var list = [].concat(val || []), i = 0; i < list.length; i++) if ("string" != typeof list[i]) throw new TypeError(name + " must be array of strings or false"); return list; } function parseHttpDate(date) { var timestamp = date && Date.parse(date); return "number" == typeof timestamp ? timestamp : NaN; } module.exports = function(req, path, options) { return new SendStream(req, path, options); }, module.exports.mime = mime, util.inherits(SendStream, Stream), SendStream.prototype.etag = deprecate.function((function(val) { return this._etag = Boolean(val), debug("etag %s", this._etag), this; }), "send.etag: pass etag as option"), SendStream.prototype.hidden = deprecate.function((function(val) { return this._hidden = Boolean(val), this._dotfiles = void 0, debug("hidden %s", this._hidden), this; }), "send.hidden: use dotfiles option"), SendStream.prototype.index = deprecate.function((function(paths) { var index = paths ? normalizeList(paths, "paths argument") : []; return debug("index %o", paths), this._index = index, this; }), "send.index: pass index as option"), SendStream.prototype.root = function(path) { return this._root = resolve(String(path)), debug("root %s", this._root), this; }, SendStream.prototype.from = deprecate.function(SendStream.prototype.root, "send.from: pass root as option"), SendStream.prototype.root = deprecate.function(SendStream.prototype.root, "send.root: pass root as option"), SendStream.prototype.maxage = deprecate.function((function(maxAge) { return this._maxage = "string" == typeof maxAge ? ms(maxAge) : Number(maxAge), this._maxage = isNaN(this._maxage) ? 0 : Math.min(Math.max(0, this._maxage), 31536e6), debug("max-age %d", this._maxage), this; }), "send.maxage: pass maxAge as option"), SendStream.prototype.error = function(status, err) { if (hasListeners(this, "error")) return this.emit("error", createError(status, err, { expose: !1 })); var res = this.res, msg = statuses[status] || String(status), doc = createHtmlDocument("Error", escapeHtml(msg)); !(function(res) { for (var headers = getHeaderNames(res), i = 0; i < headers.length; i++) res.removeHeader(headers[i]); })(res), err && err.headers && (function(res, headers) { for (var keys = Object.keys(headers), i = 0; i < keys.length; i++) { var key = keys[i]; res.setHeader(key, headers[key]); } })(res, err.headers), res.statusCode = status, res.setHeader("Content-Type", "text/html; charset=UTF-8"), res.setHeader("Content-Length", Buffer.byteLength(doc)), res.setHeader("Content-Security-Policy", "default-src 'none'"), res.setHeader("X-Content-Type-Options", "nosniff"), res.end(doc); }, SendStream.prototype.hasTrailingSlash = function() { return "/" === this.path[this.path.length - 1]; }, SendStream.prototype.isConditionalGET = function() { return this.req.headers["if-match"] || this.req.headers["if-unmodified-since"] || this.req.headers["if-none-match"] || this.req.headers["if-modified-since"]; }, SendStream.prototype.isPreconditionFailure = function() { var req = this.req, res = this.res, match = req.headers["if-match"]; if (match) { var etag = res.getHeader("ETag"); return !etag || "*" !== match && (function(str) { for (var end = 0, list = [], start = 0, i = 0, len = str.length; i < len; i++) switch (str.charCodeAt(i)) { case 32: start === end && (start = end = i + 1); break; case 44: list.push(str.substring(start, end)), start = end = i + 1; break; default: end = i + 1; } return list.push(str.substring(start, end)), list; })(match).every((function(match) { return match !== etag && match !== "W/" + etag && "W/" + match !== etag; })); } var unmodifiedSince = parseHttpDate(req.headers["if-unmodified-since"]); if (!isNaN(unmodifiedSince)) { var lastModified = parseHttpDate(res.getHeader("Last-Modified")); return isNaN(lastModified) || lastModified > unmodifiedSince; } return !1; }, SendStream.prototype.removeContentHeaderFields = function() { for (var res = this.res, headers = getHeaderNames(res), i = 0; i < headers.length; i++) { var header = headers[i]; "content-" === header.substr(0, 8) && "content-location" !== header && res.removeHeader(header); } }, SendStream.prototype.notModified = function() { var res = this.res; debug("not modified"), this.removeContentHeaderFields(), res.statusCode = 304, res.end(); }, SendStream.prototype.headersAlreadySent = function() { var err = new Error("Can't set headers after they are sent."); debug("headers already sent"), this.error(500, err); }, SendStream.prototype.isCachable = function() { var statusCode = this.res.statusCode; return statusCode >= 200 && statusCode < 300 || 304 === statusCode; }, SendStream.prototype.onStatError = function(error) { switch (error.code) { case "ENAMETOOLONG": case "ENOENT": case "ENOTDIR": this.error(404, error); break; default: this.error(500, error); } }, SendStream.prototype.isFresh = function() { return fresh(this.req.headers, { etag: this.res.getHeader("ETag"), "last-modified": this.res.getHeader("Last-Modified") }); }, SendStream.prototype.isRangeFresh = function() { var ifRange = this.req.headers["if-range"]; if (!ifRange) return !0; if (-1 !== ifRange.indexOf('"')) { var etag = this.res.getHeader("ETag"); return Boolean(etag && -1 !== ifRange.indexOf(etag)); } return parseHttpDate(this.res.getHeader("Last-Modified")) <= parseHttpDate(ifRange); }, SendStream.prototype.redirect = function(path) { var res = this.res; if (hasListeners(this, "directory")) this.emit("directory", res, path); else if (this.hasTrailingSlash()) this.error(403); else { var loc = encodeUrl((function(str) { for (var i = 0; i < str.length && "/" === str[i]; i++) ; return i > 1 ? "/" + str.substr(i) : str; })(this.path + "/")), doc = createHtmlDocument("Redirecting", 'Redirecting to ' + escapeHtml(loc) + ""); res.statusCode = 301, res.setHeader("Content-Type", "text/html; charset=UTF-8"), res.setHeader("Content-Length", Buffer.byteLength(doc)), res.setHeader("Content-Security-Policy", "default-src 'none'"), res.setHeader("X-Content-Type-Options", "nosniff"), res.setHeader("Location", loc), res.end(doc); } }, SendStream.prototype.pipe = function(res) { var root = this._root; this.res = res; var parts, path = (function(path) { try { return decodeURIComponent(path); } catch (err) { return -1; } })(this.path); if (-1 === path) return this.error(400), res; if (~path.indexOf("\0")) return this.error(400), res; if (null !== root) { if (path && (path = normalize("." + sep + path)), UP_PATH_REGEXP.test(path)) return debug('malicious path "%s"', path), this.error(403), res; parts = path.split(sep), path = normalize(join(root, path)); } else { if (UP_PATH_REGEXP.test(path)) return debug('malicious path "%s"', path), this.error(403), res; parts = normalize(path).split(sep), path = resolve(path); } if ((function(parts) { for (var i = 0; i < parts.length; i++) { var part = parts[i]; if (part.length > 1 && "." === part[0]) return !0; } return !1; })(parts)) { var access = this._dotfiles; switch (void 0 === access && (access = "." === parts[parts.length - 1][0] ? this._hidden ? "allow" : "ignore" : "allow"), debug('%s dotfile "%s"', access, path), access) { case "allow": break; case "deny": return this.error(403), res; default: return this.error(404), res; } } return this._index.length && this.hasTrailingSlash() ? (this.sendIndex(path), res) : (this.sendFile(path), res); }, SendStream.prototype.send = function(path, stat) { var len = stat.size, options = this.options, opts = {}, res = this.res, req = this.req, ranges = req.headers.range, offset = options.start || 0; if ((function(res) { return "boolean" != typeof res.headersSent ? Boolean(res._header) : res.headersSent; })(res)) this.headersAlreadySent(); else { if (debug('pipe "%s"', path), this.setHeader(path, stat), this.type(path), this.isConditionalGET()) { if (this.isPreconditionFailure()) return void this.error(412); if (this.isCachable() && this.isFresh()) return void this.notModified(); } if (len = Math.max(0, len - offset), void 0 !== options.end) { var bytes = options.end - offset + 1; len > bytes && (len = bytes); } if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { if (ranges = parseRange(len, ranges, { combine: !0 }), this.isRangeFresh() || (debug("range stale"), ranges = -2), -1 === ranges) return debug("range unsatisfiable"), res.setHeader("Content-Range", contentRange("bytes", len)), this.error(416, { headers: { "Content-Range": res.getHeader("Content-Range") } }); -2 !== ranges && 1 === ranges.length && (debug("range %j", ranges), res.statusCode = 206, res.setHeader("Content-Range", contentRange("bytes", len, ranges[0])), offset += ranges[0].start, len = ranges[0].end - ranges[0].start + 1); } for (var prop in options) opts[prop] = options[prop]; opts.start = offset, opts.end = Math.max(offset, offset + len - 1), res.setHeader("Content-Length", len), "HEAD" !== req.method ? this.stream(path, opts) : res.end(); } }, SendStream.prototype.sendFile = function(path) { var i = 0, self = this; function next(err) { if (self._extensions.length <= i) return err ? self.onStatError(err) : self.error(404); var p = path + "." + self._extensions[i++]; debug('stat "%s"', p), fs.stat(p, (function(err, stat) { return err ? next(err) : stat.isDirectory() ? next() : (self.emit("file", p, stat), void self.send(p, stat)); })); } debug('stat "%s"', path), fs.stat(path, (function(err, stat) { return err && "ENOENT" === err.code && !extname(path) && path[path.length - 1] !== sep ? next(err) : err ? self.onStatError(err) : stat.isDirectory() ? self.redirect(path) : (self.emit("file", path, stat), void self.send(path, stat)); })); }, SendStream.prototype.sendIndex = function(path) { var i = -1, self = this; !(function next(err) { if (++i >= self._index.length) return err ? self.onStatError(err) : self.error(404); var p = join(path, self._index[i]); debug('stat "%s"', p), fs.stat(p, (function(err, stat) { return err ? next(err) : stat.isDirectory() ? next() : (self.emit("file", p, stat), void self.send(p, stat)); })); })(); }, SendStream.prototype.stream = function(path, options) { var finished = !1, self = this, res = this.res, stream = fs.createReadStream(path, options); this.emit("stream", stream), stream.pipe(res), onFinished(res, (function() { finished = !0, destroy(stream); })), stream.on("error", (function(err) { finished || (finished = !0, destroy(stream), self.onStatError(err)); })), stream.on("end", (function() { self.emit("end"); })); }, SendStream.prototype.type = function(path) { var res = this.res; if (!res.getHeader("Content-Type")) { var type = mime.lookup(path); if (type) { var charset = mime.charsets.lookup(type); debug("content-type %s", type), res.setHeader("Content-Type", type + (charset ? "; charset=" + charset : "")); } else debug("no content-type"); } }, SendStream.prototype.setHeader = function(path, stat) { var res = this.res; if (this.emit("headers", res, path, stat), this._acceptRanges && !res.getHeader("Accept-Ranges") && (debug("accept ranges"), res.setHeader("Accept-Ranges", "bytes")), this._cacheControl && !res.getHeader("Cache-Control")) { var cacheControl = "public, max-age=" + Math.floor(this._maxage / 1e3); this._immutable && (cacheControl += ", immutable"), debug("cache-control %s", cacheControl), res.setHeader("Cache-Control", cacheControl); } if (this._lastModified && !res.getHeader("Last-Modified")) { var modified = stat.mtime.toUTCString(); debug("modified %s", modified), res.setHeader("Last-Modified", modified); } if (this._etag && !res.getHeader("ETag")) { var val = etag(stat); debug("etag %s", val), res.setHeader("ETag", val); } }; }, function(module, exports, __webpack_require__) { var helpers = { yearSimilar: function(parsedYear, altYear) { return !parsedYear || !altYear || (parsedYear = parseInt(parsedYear), (altYear = parseInt(altYear)) >= parsedYear - 1 && altYear <= parsedYear + 1); }, levenshteinDistance: function(s1, s2) { var longer = s1, shorter = s2; s1.length < s2.length && (longer = s2, shorter = s1); var longerLength = longer.length; return 0 == longerLength ? 1 : (longerLength - (function(s1, s2) { s1 = s1.toLowerCase(), s2 = s2.toLowerCase(); for (var costs = new Array, i = 0; i <= s1.length; i++) { for (var lastValue = i, j = 0; j <= s2.length; j++) if (0 == i) costs[j] = j; else if (j > 0) { var newValue = costs[j - 1]; s1.charAt(i - 1) != s2.charAt(j - 1) && (newValue = Math.min(Math.min(newValue, lastValue), costs[j]) + 1), costs[j - 1] = lastValue, lastValue = newValue; } i > 0 && (costs[s2.length] = lastValue); } return costs[s2.length]; })(longer, shorter)) / parseFloat(longerLength); }, sanitizeName: function(name) { return name.replace(/[^a-zA-Z0-9 ]/g, "").toLowerCase().replace("the ", "").replace(/\s+/g, " ").trim(); }, nameSimilar: function(parsedName, altName) { return parsedName && altName ? (parsedName = helpers.sanitizeName(parsedName)) == (altName = helpers.sanitizeName(altName)) ? 1 : helpers.levenshteinDistance(parsedName, altName) : 0; }, nameAlmostSimilar: function(parsedName, altName) { return !!(parsedName && altName && (parsedName = helpers.sanitizeName(parsedName), altName = helpers.sanitizeName(altName), parsedName.startsWith(altName) || parsedName.endsWith(altName) || altName.startsWith(parsedName) || altName.endsWith(parsedName))); }, simplifyName: function(args) { if (!args || !args.name) return null; var name = args.name.toLowerCase().trim().replace(/\([^\(]+\)$/, "").replace(/&/g, "and").replace(/[^0-9a-z ]+/g, " ").split(" ").filter((function(r) { return r; })).join(" "); return args.year && name.endsWith(" " + args.year) && (name = name.replace(new RegExp(" " + args.year + "$", "i"), "")), name; }, parseSearchTerm: function(searchTerm) { return searchTerm && "string" == typeof searchTerm ? (0, __webpack_require__(1067).remove)(searchTerm.replace(/[^\u0000-\u036F][ \t]*/gm, "")) : null; } }; module.exports = helpers; }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(function() { var root, previous_async, async = {}; function only_once(fn) { var called = !1; return function() { if (called) throw new Error("Callback was already called."); called = !0, fn.apply(root, arguments); }; } null != (root = this) && (previous_async = root.async), async.noConflict = function() { return root.async = previous_async, async; }; var _toString = Object.prototype.toString, _isArray = Array.isArray || function(obj) { return "[object Array]" === _toString.call(obj); }, _each = function(arr, iterator) { for (var i = 0; i < arr.length; i += 1) iterator(arr[i], i, arr); }, _map = function(arr, iterator) { if (arr.map) return arr.map(iterator); var results = []; return _each(arr, (function(x, i, a) { results.push(iterator(x, i, a)); })), results; }, _keys = function(obj) { if (Object.keys) return Object.keys(obj); var keys = []; for (var k in obj) obj.hasOwnProperty(k) && keys.push(k); return keys; }; "undefined" != typeof process && process.nextTick ? (async.nextTick = process.nextTick, "undefined" != typeof setImmediate ? async.setImmediate = function(fn) { setImmediate(fn); } : async.setImmediate = async.nextTick) : "function" == typeof setImmediate ? (async.nextTick = function(fn) { setImmediate(fn); }, async.setImmediate = async.nextTick) : (async.nextTick = function(fn) { setTimeout(fn, 0); }, async.setImmediate = async.nextTick), async.each = function(arr, iterator, callback) { if (callback = callback || function() {}, !arr.length) return callback(); var completed = 0; function done(err) { err ? (callback(err), callback = function() {}) : (completed += 1) >= arr.length && callback(); } _each(arr, (function(x) { iterator(x, only_once(done)); })); }, async.forEach = async.each, async.eachSeries = function(arr, iterator, callback) { if (callback = callback || function() {}, !arr.length) return callback(); var completed = 0, iterate = function() { iterator(arr[completed], (function(err) { err ? (callback(err), callback = function() {}) : (completed += 1) >= arr.length ? callback() : iterate(); })); }; iterate(); }, async.forEachSeries = async.eachSeries, async.eachLimit = function(arr, limit, iterator, callback) { _eachLimit(limit).apply(null, [ arr, iterator, callback ]); }, async.forEachLimit = async.eachLimit; var _eachLimit = function(limit) { return function(arr, iterator, callback) { if (callback = callback || function() {}, !arr.length || limit <= 0) return callback(); var completed = 0, started = 0, running = 0; !(function replenish() { if (completed >= arr.length) return callback(); for (;running < limit && started < arr.length; ) running += 1, iterator(arr[(started += 1) - 1], (function(err) { err ? (callback(err), callback = function() {}) : (running -= 1, (completed += 1) >= arr.length ? callback() : replenish()); })); })(); }; }, doParallel = function(fn) { return function() { var args = Array.prototype.slice.call(arguments); return fn.apply(null, [ async.each ].concat(args)); }; }, doSeries = function(fn) { return function() { var args = Array.prototype.slice.call(arguments); return fn.apply(null, [ async.eachSeries ].concat(args)); }; }, _asyncMap = function(eachfn, arr, iterator, callback) { if (arr = _map(arr, (function(x, i) { return { index: i, value: x }; })), callback) { var results = []; eachfn(arr, (function(x, callback) { iterator(x.value, (function(err, v) { results[x.index] = v, callback(err); })); }), (function(err) { callback(err, results); })); } else eachfn(arr, (function(x, callback) { iterator(x.value, (function(err) { callback(err); })); })); }; async.map = doParallel(_asyncMap), async.mapSeries = doSeries(_asyncMap), async.mapLimit = function(arr, limit, iterator, callback) { return _mapLimit(limit)(arr, iterator, callback); }; var _mapLimit = function(limit) { return (function(limit, fn) { return function() { var args = Array.prototype.slice.call(arguments); return fn.apply(null, [ _eachLimit(limit) ].concat(args)); }; })(limit, _asyncMap); }; async.reduce = function(arr, memo, iterator, callback) { async.eachSeries(arr, (function(x, callback) { iterator(memo, x, (function(err, v) { memo = v, callback(err); })); }), (function(err) { callback(err, memo); })); }, async.inject = async.reduce, async.foldl = async.reduce, async.reduceRight = function(arr, memo, iterator, callback) { var reversed = _map(arr, (function(x) { return x; })).reverse(); async.reduce(reversed, memo, iterator, callback); }, async.foldr = async.reduceRight; var _filter = function(eachfn, arr, iterator, callback) { var results = []; eachfn(arr = _map(arr, (function(x, i) { return { index: i, value: x }; })), (function(x, callback) { iterator(x.value, (function(v) { v && results.push(x), callback(); })); }), (function(err) { callback(_map(results.sort((function(a, b) { return a.index - b.index; })), (function(x) { return x.value; }))); })); }; async.filter = doParallel(_filter), async.filterSeries = doSeries(_filter), async.select = async.filter, async.selectSeries = async.filterSeries; var _reject = function(eachfn, arr, iterator, callback) { var results = []; eachfn(arr = _map(arr, (function(x, i) { return { index: i, value: x }; })), (function(x, callback) { iterator(x.value, (function(v) { v || results.push(x), callback(); })); }), (function(err) { callback(_map(results.sort((function(a, b) { return a.index - b.index; })), (function(x) { return x.value; }))); })); }; async.reject = doParallel(_reject), async.rejectSeries = doSeries(_reject); var _detect = function(eachfn, arr, iterator, main_callback) { eachfn(arr, (function(x, callback) { iterator(x, (function(result) { result ? (main_callback(x), main_callback = function() {}) : callback(); })); }), (function(err) { main_callback(); })); }; async.detect = doParallel(_detect), async.detectSeries = doSeries(_detect), async.some = function(arr, iterator, main_callback) { async.each(arr, (function(x, callback) { iterator(x, (function(v) { v && (main_callback(!0), main_callback = function() {}), callback(); })); }), (function(err) { main_callback(!1); })); }, async.any = async.some, async.every = function(arr, iterator, main_callback) { async.each(arr, (function(x, callback) { iterator(x, (function(v) { v || (main_callback(!1), main_callback = function() {}), callback(); })); }), (function(err) { main_callback(!0); })); }, async.all = async.every, async.sortBy = function(arr, iterator, callback) { async.map(arr, (function(x, callback) { iterator(x, (function(err, criteria) { err ? callback(err) : callback(null, { value: x, criteria: criteria }); })); }), (function(err, results) { if (err) return callback(err); callback(null, _map(results.sort((function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; })), (function(x) { return x.value; }))); })); }, async.auto = function(tasks, callback) { callback = callback || function() {}; var keys = _keys(tasks), remainingTasks = keys.length; if (!remainingTasks) return callback(); var results = {}, listeners = [], addListener = function(fn) { listeners.unshift(fn); }, taskComplete = function() { remainingTasks--, _each(listeners.slice(0), (function(fn) { fn(); })); }; addListener((function() { if (!remainingTasks) { var theCallback = callback; callback = function() {}, theCallback(null, results); } })), _each(keys, (function(k) { var task = _isArray(tasks[k]) ? tasks[k] : [ tasks[k] ], taskCallback = function(err) { var args = Array.prototype.slice.call(arguments, 1); if (args.length <= 1 && (args = args[0]), err) { var safeResults = {}; _each(_keys(results), (function(rkey) { safeResults[rkey] = results[rkey]; })), safeResults[k] = args, callback(err, safeResults), callback = function() {}; } else results[k] = args, async.setImmediate(taskComplete); }, requires = task.slice(0, Math.abs(task.length - 1)) || [], ready = function() { return iterator = function(a, x) { return a && results.hasOwnProperty(x); }, memo = !0, ((arr = requires).reduce ? arr.reduce(iterator, memo) : (_each(arr, (function(x, i, a) { memo = iterator(memo, x); })), memo)) && !results.hasOwnProperty(k); var arr, iterator, memo; }; if (ready()) task[task.length - 1](taskCallback, results); else { var listener = function() { ready() && ((function(fn) { for (var i = 0; i < listeners.length; i += 1) if (listeners[i] === fn) return void listeners.splice(i, 1); })(listener), task[task.length - 1](taskCallback, results)); }; addListener(listener); } })); }, async.retry = function(times, task, callback) { var attempts = []; "function" == typeof times && (callback = task, task = times, times = 5), times = parseInt(times, 10) || 5; var wrappedTask = function(wrappedCallback, wrappedResults) { for (var retryAttempt = function(task, finalAttempt) { return function(seriesCallback) { task((function(err, result) { seriesCallback(!err || finalAttempt, { err: err, result: result }); }), wrappedResults); }; }; times; ) attempts.push(retryAttempt(task, !(times -= 1))); async.series(attempts, (function(done, data) { data = data[data.length - 1], (wrappedCallback || callback)(data.err, data.result); })); }; return callback ? wrappedTask() : wrappedTask; }, async.waterfall = function(tasks, callback) { if (callback = callback || function() {}, !_isArray(tasks)) { var err = new Error("First argument to waterfall must be an array of functions"); return callback(err); } if (!tasks.length) return callback(); var wrapIterator = function(iterator) { return function(err) { if (err) callback.apply(null, arguments), callback = function() {}; else { var args = Array.prototype.slice.call(arguments, 1), next = iterator.next(); next ? args.push(wrapIterator(next)) : args.push(callback), async.setImmediate((function() { iterator.apply(null, args); })); } }; }; wrapIterator(async.iterator(tasks))(); }; var _parallel = function(eachfn, tasks, callback) { if (callback = callback || function() {}, _isArray(tasks)) eachfn.map(tasks, (function(fn, callback) { fn && fn((function(err) { var args = Array.prototype.slice.call(arguments, 1); args.length <= 1 && (args = args[0]), callback.call(null, err, args); })); }), callback); else { var results = {}; eachfn.each(_keys(tasks), (function(k, callback) { tasks[k]((function(err) { var args = Array.prototype.slice.call(arguments, 1); args.length <= 1 && (args = args[0]), results[k] = args, callback(err); })); }), (function(err) { callback(err, results); })); } }; async.parallel = function(tasks, callback) { _parallel({ map: async.map, each: async.each }, tasks, callback); }, async.parallelLimit = function(tasks, limit, callback) { _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); }, async.series = function(tasks, callback) { if (callback = callback || function() {}, _isArray(tasks)) async.mapSeries(tasks, (function(fn, callback) { fn && fn((function(err) { var args = Array.prototype.slice.call(arguments, 1); args.length <= 1 && (args = args[0]), callback.call(null, err, args); })); }), callback); else { var results = {}; async.eachSeries(_keys(tasks), (function(k, callback) { tasks[k]((function(err) { var args = Array.prototype.slice.call(arguments, 1); args.length <= 1 && (args = args[0]), results[k] = args, callback(err); })); }), (function(err) { callback(err, results); })); } }, async.iterator = function(tasks) { var makeCallback = function(index) { var fn = function() { return tasks.length && tasks[index].apply(null, arguments), fn.next(); }; return fn.next = function() { return index < tasks.length - 1 ? makeCallback(index + 1) : null; }, fn; }; return makeCallback(0); }, async.apply = function(fn) { var args = Array.prototype.slice.call(arguments, 1); return function() { return fn.apply(null, args.concat(Array.prototype.slice.call(arguments))); }; }; var _concat = function(eachfn, arr, fn, callback) { var r = []; eachfn(arr, (function(x, cb) { fn(x, (function(err, y) { r = r.concat(y || []), cb(err); })); }), (function(err) { callback(err, r); })); }; async.concat = doParallel(_concat), async.concatSeries = doSeries(_concat), async.whilst = function(test, iterator, callback) { test() ? iterator((function(err) { if (err) return callback(err); async.whilst(test, iterator, callback); })) : callback(); }, async.doWhilst = function(iterator, test, callback) { iterator((function(err) { if (err) return callback(err); var args = Array.prototype.slice.call(arguments, 1); test.apply(null, args) ? async.doWhilst(iterator, test, callback) : callback(); })); }, async.until = function(test, iterator, callback) { test() ? callback() : iterator((function(err) { if (err) return callback(err); async.until(test, iterator, callback); })); }, async.doUntil = function(iterator, test, callback) { iterator((function(err) { if (err) return callback(err); var args = Array.prototype.slice.call(arguments, 1); test.apply(null, args) ? callback() : async.doUntil(iterator, test, callback); })); }, async.queue = function(worker, concurrency) { function _insert(q, data, pos, callback) { if (q.started || (q.started = !0), _isArray(data) || (data = [ data ]), 0 == data.length) return async.setImmediate((function() { q.drain && q.drain(); })); _each(data, (function(task) { var item = { data: task, callback: "function" == typeof callback ? callback : null }; pos ? q.tasks.unshift(item) : q.tasks.push(item), q.saturated && q.tasks.length === q.concurrency && q.saturated(), async.setImmediate(q.process); })); } void 0 === concurrency && (concurrency = 1); var workers = 0, q = { tasks: [], concurrency: concurrency, saturated: null, empty: null, drain: null, started: !1, paused: !1, push: function(data, callback) { _insert(q, data, !1, callback); }, kill: function() { q.drain = null, q.tasks = []; }, unshift: function(data, callback) { _insert(q, data, !0, callback); }, process: function() { if (!q.paused && workers < q.concurrency && q.tasks.length) { var task = q.tasks.shift(); q.empty && 0 === q.tasks.length && q.empty(), workers += 1; var cb = only_once((function() { workers -= 1, task.callback && task.callback.apply(task, arguments), q.drain && q.tasks.length + workers === 0 && q.drain(), q.process(); })); worker(task.data, cb); } }, length: function() { return q.tasks.length; }, running: function() { return workers; }, idle: function() { return q.tasks.length + workers === 0; }, pause: function() { !0 !== q.paused && (q.paused = !0); }, resume: function() { if (!1 !== q.paused) { q.paused = !1; for (var w = 1; w <= q.concurrency; w++) async.setImmediate(q.process); } } }; return q; }, async.priorityQueue = function(worker, concurrency) { function _compareTasks(a, b) { return a.priority - b.priority; } var q = async.queue(worker, concurrency); return q.push = function(data, priority, callback) { !(function(q, data, priority, callback) { if (q.started || (q.started = !0), _isArray(data) || (data = [ data ]), 0 == data.length) return async.setImmediate((function() { q.drain && q.drain(); })); _each(data, (function(task) { var item = { data: task, priority: priority, callback: "function" == typeof callback ? callback : null }; q.tasks.splice((function(sequence, item, compare) { for (var beg = -1, end = sequence.length - 1; beg < end; ) { var mid = beg + (end - beg + 1 >>> 1); compare(item, sequence[mid]) >= 0 ? beg = mid : end = mid - 1; } return beg; })(q.tasks, item, _compareTasks) + 1, 0, item), q.saturated && q.tasks.length === q.concurrency && q.saturated(), async.setImmediate(q.process); })); })(q, data, priority, callback); }, delete q.unshift, q; }, async.cargo = function(worker, payload) { var working = !1, tasks = [], cargo = { tasks: tasks, payload: payload, saturated: null, empty: null, drain: null, drained: !0, push: function(data, callback) { _isArray(data) || (data = [ data ]), _each(data, (function(task) { tasks.push({ data: task, callback: "function" == typeof callback ? callback : null }), cargo.drained = !1, cargo.saturated && tasks.length === payload && cargo.saturated(); })), async.setImmediate(cargo.process); }, process: function process() { if (!working) { if (0 === tasks.length) return cargo.drain && !cargo.drained && cargo.drain(), void (cargo.drained = !0); var ts = "number" == typeof payload ? tasks.splice(0, payload) : tasks.splice(0, tasks.length), ds = _map(ts, (function(task) { return task.data; })); cargo.empty && cargo.empty(), working = !0, worker(ds, (function() { working = !1; var args = arguments; _each(ts, (function(data) { data.callback && data.callback.apply(null, args); })), process(); })); } }, length: function() { return tasks.length; }, running: function() { return working; } }; return cargo; }; var _console_fn = function(name) { return function(fn) { var args = Array.prototype.slice.call(arguments, 1); fn.apply(null, args.concat([ function(err) { var args = Array.prototype.slice.call(arguments, 1); "undefined" != typeof console && (err ? console.error && console.error(err) : console[name] && _each(args, (function(x) { console[name](x); }))); } ])); }; }; async.log = _console_fn("log"), async.dir = _console_fn("dir"), async.memoize = function(fn, hasher) { var memo = {}, queues = {}; hasher = hasher || function(x) { return x; }; var memoized = function() { var args = Array.prototype.slice.call(arguments), callback = args.pop(), key = hasher.apply(null, args); key in memo ? async.nextTick((function() { callback.apply(null, memo[key]); })) : key in queues ? queues[key].push(callback) : (queues[key] = [ callback ], fn.apply(null, args.concat([ function() { memo[key] = arguments; var q = queues[key]; delete queues[key]; for (var i = 0, l = q.length; i < l; i++) q[i].apply(null, arguments); } ]))); }; return memoized.memo = memo, memoized.unmemoized = fn, memoized; }, async.unmemoize = function(fn) { return function() { return (fn.unmemoized || fn).apply(null, arguments); }; }, async.times = function(count, iterator, callback) { for (var counter = [], i = 0; i < count; i++) counter.push(i); return async.map(counter, iterator, callback); }, async.timesSeries = function(count, iterator, callback) { for (var counter = [], i = 0; i < count; i++) counter.push(i); return async.mapSeries(counter, iterator, callback); }, async.seq = function() { var fns = arguments; return function() { var that = this, args = Array.prototype.slice.call(arguments), callback = args.pop(); async.reduce(fns, args, (function(newargs, fn, cb) { fn.apply(that, newargs.concat([ function() { var err = arguments[0], nextargs = Array.prototype.slice.call(arguments, 1); cb(err, nextargs); } ])); }), (function(err, results) { callback.apply(that, [ err ].concat(results)); })); }; }, async.compose = function() { return async.seq.apply(null, Array.prototype.reverse.call(arguments)); }; var _applyEach = function(eachfn, fns) { var go = function() { var that = this, args = Array.prototype.slice.call(arguments), callback = args.pop(); return eachfn(fns, (function(fn, cb) { fn.apply(that, args.concat([ cb ])); }), callback); }; if (arguments.length > 2) { var args = Array.prototype.slice.call(arguments, 2); return go.apply(this, args); } return go; }; async.applyEach = doParallel(_applyEach), async.applyEachSeries = doSeries(_applyEach), async.forever = function(fn, callback) { !(function next(err) { if (err) { if (callback) return callback(err); throw err; } fn(next); })(); }, module.exports ? module.exports = async : void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return async; }.apply(exports, [])) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); })(); }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(1090); }, function(module, exports) { (function() { exports.defaults = { .1: { explicitCharkey: !1, trim: !0, normalize: !0, normalizeTags: !1, attrkey: "@", charkey: "#", explicitArray: !1, ignoreAttrs: !1, mergeAttrs: !1, explicitRoot: !1, validator: null, xmlns: !1, explicitChildren: !1, childkey: "@@", charsAsChildren: !1, includeWhiteChars: !1, async: !1, strict: !0, attrNameProcessors: null, attrValueProcessors: null, tagNameProcessors: null, valueProcessors: null, emptyTag: "" }, .2: { explicitCharkey: !1, trim: !1, normalize: !1, normalizeTags: !1, attrkey: "$", charkey: "_", explicitArray: !0, ignoreAttrs: !1, mergeAttrs: !1, explicitRoot: !0, validator: null, xmlns: !1, explicitChildren: !1, preserveChildrenOrder: !1, childkey: "$$", charsAsChildren: !1, includeWhiteChars: !1, async: !1, strict: !0, attrNameProcessors: null, attrValueProcessors: null, tagNameProcessors: null, valueProcessors: null, rootName: "root", xmldec: { version: "1.0", encoding: "UTF-8", standalone: !0 }, doctype: null, renderOpts: { pretty: !0, indent: " ", newline: "\n" }, headless: !1, chunkSize: 1e4, emptyTag: "", cdata: !1 } }; }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLAttribute, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref, hasProp = {}.hasOwnProperty; ref = __webpack_require__(52), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue, XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), XMLAttribute = __webpack_require__(507), XMLNamedNodeMap = __webpack_require__(247), module.exports = (function(superClass) { function XMLElement(parent, name, attributes) { var child, j, len, ref1; if (XMLElement.__super__.constructor.call(this, parent), null == name) throw new Error("Missing element name. " + this.debugInfo()); if (this.name = this.stringify.name(name), this.type = NodeType.Element, this.attribs = {}, this.schemaTypeInfo = null, null != attributes && this.attribute(attributes), parent.type === NodeType.Document && (this.isRoot = !0, this.documentObject = parent, parent.rootObject = this, parent.children)) for (j = 0, len = (ref1 = parent.children).length; j < len; j++) if ((child = ref1[j]).type === NodeType.DocType) { child.name = this.name; break; } } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLElement, superClass), Object.defineProperty(XMLElement.prototype, "tagName", { get: function() { return this.name; } }), Object.defineProperty(XMLElement.prototype, "namespaceURI", { get: function() { return ""; } }), Object.defineProperty(XMLElement.prototype, "prefix", { get: function() { return ""; } }), Object.defineProperty(XMLElement.prototype, "localName", { get: function() { return this.name; } }), Object.defineProperty(XMLElement.prototype, "id", { get: function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); } }), Object.defineProperty(XMLElement.prototype, "className", { get: function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); } }), Object.defineProperty(XMLElement.prototype, "classList", { get: function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); } }), Object.defineProperty(XMLElement.prototype, "attributes", { get: function() { return this.attributeMap && this.attributeMap.nodes || (this.attributeMap = new XMLNamedNodeMap(this.attribs)), this.attributeMap; } }), XMLElement.prototype.clone = function() { var att, attName, clonedSelf, ref1; for (attName in (clonedSelf = Object.create(this)).isRoot && (clonedSelf.documentObject = null), clonedSelf.attribs = {}, ref1 = this.attribs) hasProp.call(ref1, attName) && (att = ref1[attName], clonedSelf.attribs[attName] = att.clone()); return clonedSelf.children = [], this.children.forEach((function(child) { var clonedChild; return (clonedChild = child.clone()).parent = clonedSelf, clonedSelf.children.push(clonedChild); })), clonedSelf; }, XMLElement.prototype.attribute = function(name, value) { var attName, attValue; if (null != name && (name = getValue(name)), isObject(name)) for (attName in name) hasProp.call(name, attName) && (attValue = name[attName], this.attribute(attName, attValue)); else isFunction(value) && (value = value.apply()), this.options.keepNullAttributes && null == value ? this.attribs[name] = new XMLAttribute(this, name, "") : null != value && (this.attribs[name] = new XMLAttribute(this, name, value)); return this; }, XMLElement.prototype.removeAttribute = function(name) { var attName, j, len; if (null == name) throw new Error("Missing attribute name. " + this.debugInfo()); if (name = getValue(name), Array.isArray(name)) for (j = 0, len = name.length; j < len; j++) attName = name[j], delete this.attribs[attName]; else delete this.attribs[name]; return this; }, XMLElement.prototype.toString = function(options) { return this.options.writer.element(this, this.options.writer.filterOptions(options)); }, XMLElement.prototype.att = function(name, value) { return this.attribute(name, value); }, XMLElement.prototype.a = function(name, value) { return this.attribute(name, value); }, XMLElement.prototype.getAttribute = function(name) { return this.attribs.hasOwnProperty(name) ? this.attribs[name].value : null; }, XMLElement.prototype.setAttribute = function(name, value) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.getAttributeNode = function(name) { return this.attribs.hasOwnProperty(name) ? this.attribs[name] : null; }, XMLElement.prototype.setAttributeNode = function(newAttr) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.removeAttributeNode = function(oldAttr) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.getElementsByTagName = function(name) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.getAttributeNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.removeAttributeNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.getAttributeNodeNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.setAttributeNodeNS = function(newAttr) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.hasAttribute = function(name) { return this.attribs.hasOwnProperty(name); }, XMLElement.prototype.hasAttributeNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.setIdAttribute = function(name, isId) { return this.attribs.hasOwnProperty(name) ? this.attribs[name].isId : isId; }, XMLElement.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.setIdAttributeNode = function(idAttr, isId) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.getElementsByTagName = function(tagname) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.getElementsByClassName = function(classNames) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLElement.prototype.isEqualNode = function(node) { var i, j, ref1; if (!XMLElement.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) return !1; if (node.namespaceURI !== this.namespaceURI) return !1; if (node.prefix !== this.prefix) return !1; if (node.localName !== this.localName) return !1; if (node.attribs.length !== this.attribs.length) return !1; for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) if (!this.attribs[i].isEqualNode(node.attribs[i])) return !1; return !0; }, XMLElement; })(XMLNode); }).call(this); }, function(module, exports) { (function() { module.exports = (function() { function XMLNamedNodeMap(nodes) { this.nodes = nodes; } return Object.defineProperty(XMLNamedNodeMap.prototype, "length", { get: function() { return Object.keys(this.nodes).length || 0; } }), XMLNamedNodeMap.prototype.clone = function() { return this.nodes = null; }, XMLNamedNodeMap.prototype.getNamedItem = function(name) { return this.nodes[name]; }, XMLNamedNodeMap.prototype.setNamedItem = function(node) { var oldNode; return oldNode = this.nodes[node.nodeName], this.nodes[node.nodeName] = node, oldNode || null; }, XMLNamedNodeMap.prototype.removeNamedItem = function(name) { var oldNode; return oldNode = this.nodes[name], delete this.nodes[name], oldNode || null; }, XMLNamedNodeMap.prototype.item = function(index) { return this.nodes[Object.keys(this.nodes)[index]] || null; }, XMLNamedNodeMap.prototype.getNamedItemNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented."); }, XMLNamedNodeMap.prototype.setNamedItemNS = function(node) { throw new Error("This DOM method is not implemented."); }, XMLNamedNodeMap.prototype.removeNamedItemNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented."); }, XMLNamedNodeMap; })(); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLCharacterData, hasProp = {}.hasOwnProperty; NodeType = __webpack_require__(22), XMLCharacterData = __webpack_require__(160), module.exports = (function(superClass) { function XMLCData(parent, text) { if (XMLCData.__super__.constructor.call(this, parent), null == text) throw new Error("Missing CDATA text. " + this.debugInfo()); this.name = "#cdata-section", this.type = NodeType.CData, this.value = this.stringify.cdata(text); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLCData, superClass), XMLCData.prototype.clone = function() { return Object.create(this); }, XMLCData.prototype.toString = function(options) { return this.options.writer.cdata(this, this.options.writer.filterOptions(options)); }, XMLCData; })(XMLCharacterData); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLCharacterData, hasProp = {}.hasOwnProperty; NodeType = __webpack_require__(22), XMLCharacterData = __webpack_require__(160), module.exports = (function(superClass) { function XMLComment(parent, text) { if (XMLComment.__super__.constructor.call(this, parent), null == text) throw new Error("Missing comment text. " + this.debugInfo()); this.name = "#comment", this.type = NodeType.Comment, this.value = this.stringify.comment(text); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLComment, superClass), XMLComment.prototype.clone = function() { return Object.create(this); }, XMLComment.prototype.toString = function(options) { return this.options.writer.comment(this, this.options.writer.filterOptions(options)); }, XMLComment; })(XMLCharacterData); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLNode, isObject, hasProp = {}.hasOwnProperty; isObject = __webpack_require__(52).isObject, XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), module.exports = (function(superClass) { function XMLDeclaration(parent, version, encoding, standalone) { var ref; XMLDeclaration.__super__.constructor.call(this, parent), isObject(version) && (version = (ref = version).version, encoding = ref.encoding, standalone = ref.standalone), version || (version = "1.0"), this.type = NodeType.Declaration, this.version = this.stringify.xmlVersion(version), null != encoding && (this.encoding = this.stringify.xmlEncoding(encoding)), null != standalone && (this.standalone = this.stringify.xmlStandalone(standalone)); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDeclaration, superClass), XMLDeclaration.prototype.toString = function(options) { return this.options.writer.declaration(this, this.options.writer.filterOptions(options)); }, XMLDeclaration; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLNamedNodeMap, XMLNode, isObject, hasProp = {}.hasOwnProperty; isObject = __webpack_require__(52).isObject, XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), XMLDTDAttList = __webpack_require__(252), XMLDTDEntity = __webpack_require__(253), XMLDTDElement = __webpack_require__(254), XMLDTDNotation = __webpack_require__(255), XMLNamedNodeMap = __webpack_require__(247), module.exports = (function(superClass) { function XMLDocType(parent, pubID, sysID) { var child, i, len, ref, ref1, ref2; if (XMLDocType.__super__.constructor.call(this, parent), this.type = NodeType.DocType, parent.children) for (i = 0, len = (ref = parent.children).length; i < len; i++) if ((child = ref[i]).type === NodeType.Element) { this.name = child.name; break; } this.documentObject = parent, isObject(pubID) && (pubID = (ref1 = pubID).pubID, sysID = ref1.sysID), null == sysID && (sysID = (ref2 = [ pubID, sysID ])[0], pubID = ref2[1]), null != pubID && (this.pubID = this.stringify.dtdPubID(pubID)), null != sysID && (this.sysID = this.stringify.dtdSysID(sysID)); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDocType, superClass), Object.defineProperty(XMLDocType.prototype, "entities", { get: function() { var child, i, len, nodes, ref; for (nodes = {}, i = 0, len = (ref = this.children).length; i < len; i++) (child = ref[i]).type !== NodeType.EntityDeclaration || child.pe || (nodes[child.name] = child); return new XMLNamedNodeMap(nodes); } }), Object.defineProperty(XMLDocType.prototype, "notations", { get: function() { var child, i, len, nodes, ref; for (nodes = {}, i = 0, len = (ref = this.children).length; i < len; i++) (child = ref[i]).type === NodeType.NotationDeclaration && (nodes[child.name] = child); return new XMLNamedNodeMap(nodes); } }), Object.defineProperty(XMLDocType.prototype, "publicId", { get: function() { return this.pubID; } }), Object.defineProperty(XMLDocType.prototype, "systemId", { get: function() { return this.sysID; } }), Object.defineProperty(XMLDocType.prototype, "internalSubset", { get: function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); } }), XMLDocType.prototype.element = function(name, value) { var child; return child = new XMLDTDElement(this, name, value), this.children.push(child), this; }, XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { var child; return child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue), this.children.push(child), this; }, XMLDocType.prototype.entity = function(name, value) { var child; return child = new XMLDTDEntity(this, !1, name, value), this.children.push(child), this; }, XMLDocType.prototype.pEntity = function(name, value) { var child; return child = new XMLDTDEntity(this, !0, name, value), this.children.push(child), this; }, XMLDocType.prototype.notation = function(name, value) { var child; return child = new XMLDTDNotation(this, name, value), this.children.push(child), this; }, XMLDocType.prototype.toString = function(options) { return this.options.writer.docType(this, this.options.writer.filterOptions(options)); }, XMLDocType.prototype.ele = function(name, value) { return this.element(name, value); }, XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); }, XMLDocType.prototype.ent = function(name, value) { return this.entity(name, value); }, XMLDocType.prototype.pent = function(name, value) { return this.pEntity(name, value); }, XMLDocType.prototype.not = function(name, value) { return this.notation(name, value); }, XMLDocType.prototype.up = function() { return this.root() || this.documentObject; }, XMLDocType.prototype.isEqualNode = function(node) { return !!XMLDocType.__super__.isEqualNode.apply(this, arguments).isEqualNode(node) && node.name === this.name && node.publicId === this.publicId && node.systemId === this.systemId; }, XMLDocType; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), module.exports = (function(superClass) { function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { if (XMLDTDAttList.__super__.constructor.call(this, parent), null == elementName) throw new Error("Missing DTD element name. " + this.debugInfo()); if (null == attributeName) throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName)); if (!attributeType) throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName)); if (!defaultValueType) throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName)); if (0 !== defaultValueType.indexOf("#") && (defaultValueType = "#" + defaultValueType), !defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName)); if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName)); this.elementName = this.stringify.name(elementName), this.type = NodeType.AttributeDeclaration, this.attributeName = this.stringify.name(attributeName), this.attributeType = this.stringify.dtdAttType(attributeType), defaultValue && (this.defaultValue = this.stringify.dtdAttDefault(defaultValue)), this.defaultValueType = defaultValueType; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDTDAttList, superClass), XMLDTDAttList.prototype.toString = function(options) { return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options)); }, XMLDTDAttList; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLNode, isObject, hasProp = {}.hasOwnProperty; isObject = __webpack_require__(52).isObject, XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), module.exports = (function(superClass) { function XMLDTDEntity(parent, pe, name, value) { if (XMLDTDEntity.__super__.constructor.call(this, parent), null == name) throw new Error("Missing DTD entity name. " + this.debugInfo(name)); if (null == value) throw new Error("Missing DTD entity value. " + this.debugInfo(name)); if (this.pe = !!pe, this.name = this.stringify.name(name), this.type = NodeType.EntityDeclaration, isObject(value)) { if (!value.pubID && !value.sysID) throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name)); if (value.pubID && !value.sysID) throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name)); if (this.internal = !1, null != value.pubID && (this.pubID = this.stringify.dtdPubID(value.pubID)), null != value.sysID && (this.sysID = this.stringify.dtdSysID(value.sysID)), null != value.nData && (this.nData = this.stringify.dtdNData(value.nData)), this.pe && this.nData) throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name)); } else this.value = this.stringify.dtdEntityValue(value), this.internal = !0; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDTDEntity, superClass), Object.defineProperty(XMLDTDEntity.prototype, "publicId", { get: function() { return this.pubID; } }), Object.defineProperty(XMLDTDEntity.prototype, "systemId", { get: function() { return this.sysID; } }), Object.defineProperty(XMLDTDEntity.prototype, "notationName", { get: function() { return this.nData || null; } }), Object.defineProperty(XMLDTDEntity.prototype, "inputEncoding", { get: function() { return null; } }), Object.defineProperty(XMLDTDEntity.prototype, "xmlEncoding", { get: function() { return null; } }), Object.defineProperty(XMLDTDEntity.prototype, "xmlVersion", { get: function() { return null; } }), XMLDTDEntity.prototype.toString = function(options) { return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options)); }, XMLDTDEntity; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), module.exports = (function(superClass) { function XMLDTDElement(parent, name, value) { if (XMLDTDElement.__super__.constructor.call(this, parent), null == name) throw new Error("Missing DTD element name. " + this.debugInfo()); value || (value = "(#PCDATA)"), Array.isArray(value) && (value = "(" + value.join(",") + ")"), this.name = this.stringify.name(name), this.type = NodeType.ElementDeclaration, this.value = this.stringify.dtdElementValue(value); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDTDElement, superClass), XMLDTDElement.prototype.toString = function(options) { return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options)); }, XMLDTDElement; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), module.exports = (function(superClass) { function XMLDTDNotation(parent, name, value) { if (XMLDTDNotation.__super__.constructor.call(this, parent), null == name) throw new Error("Missing DTD notation name. " + this.debugInfo(name)); if (!value.pubID && !value.sysID) throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name)); this.name = this.stringify.name(name), this.type = NodeType.NotationDeclaration, null != value.pubID && (this.pubID = this.stringify.dtdPubID(value.pubID)), null != value.sysID && (this.sysID = this.stringify.dtdSysID(value.sysID)); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDTDNotation, superClass), Object.defineProperty(XMLDTDNotation.prototype, "publicId", { get: function() { return this.pubID; } }), Object.defineProperty(XMLDTDNotation.prototype, "systemId", { get: function() { return this.sysID; } }), XMLDTDNotation.prototype.toString = function(options) { return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options)); }, XMLDTDNotation; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLNode, hasProp = {}.hasOwnProperty; NodeType = __webpack_require__(22), XMLNode = __webpack_require__(42), module.exports = (function(superClass) { function XMLRaw(parent, text) { if (XMLRaw.__super__.constructor.call(this, parent), null == text) throw new Error("Missing raw text. " + this.debugInfo()); this.type = NodeType.Raw, this.value = this.stringify.raw(text); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLRaw, superClass), XMLRaw.prototype.clone = function() { return Object.create(this); }, XMLRaw.prototype.toString = function(options) { return this.options.writer.raw(this, this.options.writer.filterOptions(options)); }, XMLRaw; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLCharacterData, hasProp = {}.hasOwnProperty; NodeType = __webpack_require__(22), XMLCharacterData = __webpack_require__(160), module.exports = (function(superClass) { function XMLText(parent, text) { if (XMLText.__super__.constructor.call(this, parent), null == text) throw new Error("Missing element text. " + this.debugInfo()); this.name = "#text", this.type = NodeType.Text, this.value = this.stringify.text(text); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLText, superClass), Object.defineProperty(XMLText.prototype, "isElementContentWhitespace", { get: function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); } }), Object.defineProperty(XMLText.prototype, "wholeText", { get: function() { var next, prev, str; for (str = "", prev = this.previousSibling; prev; ) str = prev.data + str, prev = prev.previousSibling; for (str += this.data, next = this.nextSibling; next; ) str += next.data, next = next.nextSibling; return str; } }), XMLText.prototype.clone = function() { return Object.create(this); }, XMLText.prototype.toString = function(options) { return this.options.writer.text(this, this.options.writer.filterOptions(options)); }, XMLText.prototype.splitText = function(offset) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLText.prototype.replaceWholeText = function(content) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLText; })(XMLCharacterData); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLCharacterData, hasProp = {}.hasOwnProperty; NodeType = __webpack_require__(22), XMLCharacterData = __webpack_require__(160), module.exports = (function(superClass) { function XMLProcessingInstruction(parent, target, value) { if (XMLProcessingInstruction.__super__.constructor.call(this, parent), null == target) throw new Error("Missing instruction target. " + this.debugInfo()); this.type = NodeType.ProcessingInstruction, this.target = this.stringify.insTarget(target), this.name = this.target, value && (this.value = this.stringify.insValue(value)); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLProcessingInstruction, superClass), XMLProcessingInstruction.prototype.clone = function() { return Object.create(this); }, XMLProcessingInstruction.prototype.toString = function(options) { return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options)); }, XMLProcessingInstruction.prototype.isEqualNode = function(node) { return !!XMLProcessingInstruction.__super__.isEqualNode.apply(this, arguments).isEqualNode(node) && node.target === this.target; }, XMLProcessingInstruction; })(XMLCharacterData); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLWriterBase, hasProp = {}.hasOwnProperty; XMLWriterBase = __webpack_require__(510), module.exports = (function(superClass) { function XMLStringWriter(options) { XMLStringWriter.__super__.constructor.call(this, options); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLStringWriter, superClass), XMLStringWriter.prototype.document = function(doc, options) { var child, i, len, r, ref; for (options = this.filterOptions(options), r = "", i = 0, len = (ref = doc.children).length; i < len; i++) child = ref[i], r += this.writeChildNode(child, options, 0); return options.pretty && r.slice(-options.newline.length) === options.newline && (r = r.slice(0, -options.newline.length)), r; }, XMLStringWriter; })(XMLWriterBase); }).call(this); }, function(module, exports, __webpack_require__) { "use strict"; var jsonSafeStringify = __webpack_require__(1131), crypto = __webpack_require__(6), Buffer = __webpack_require__(26).Buffer, defer = "undefined" == typeof setImmediate ? process.nextTick : setImmediate; exports.paramsHaveRequestBody = function(params) { return params.body || params.requestBodyStream || params.json && "boolean" != typeof params.json || params.multipart; }, exports.safeStringify = function(obj, replacer) { var ret; try { ret = JSON.stringify(obj, replacer); } catch (e) { ret = jsonSafeStringify(obj, replacer); } return ret; }, exports.md5 = function(str) { return crypto.createHash("md5").update(str).digest("hex"); }, exports.isReadStream = function(rs) { return rs.readable && rs.path && rs.mode; }, exports.toBase64 = function(str) { return Buffer.from(str || "", "utf8").toString("base64"); }, exports.copy = function(obj) { var o = {}; return Object.keys(obj).forEach((function(i) { o[i] = obj[i]; })), o; }, exports.version = function() { var numbers = process.version.replace("v", "").split("."); return { major: parseInt(numbers[0], 10), minor: parseInt(numbers[1], 10), patch: parseInt(numbers[2], 10) }; }, exports.defer = defer; }, function(module, exports, __webpack_require__) { var Key = __webpack_require__(27), Fingerprint = __webpack_require__(109), Signature = __webpack_require__(53), PrivateKey = __webpack_require__(29), Certificate = __webpack_require__(114), Identity = __webpack_require__(115), errs = __webpack_require__(48); module.exports = { Key: Key, parseKey: Key.parse, Fingerprint: Fingerprint, parseFingerprint: Fingerprint.parse, Signature: Signature, parseSignature: Signature.parse, PrivateKey: PrivateKey, parsePrivateKey: PrivateKey.parse, generatePrivateKey: PrivateKey.generate, Certificate: Certificate, parseCertificate: Certificate.parse, createSelfSignedCertificate: Certificate.createSelfSigned, createCertificate: Certificate.create, Identity: Identity, identityFromDN: Identity.parseDN, identityForHost: Identity.forHost, identityForUser: Identity.forUser, identityForEmail: Identity.forEmail, identityFromArray: Identity.fromArray, FingerprintFormatError: errs.FingerprintFormatError, InvalidAlgorithmError: errs.InvalidAlgorithmError, KeyParseError: errs.KeyParseError, SignatureParseError: errs.SignatureParseError, KeyEncryptedError: errs.KeyEncryptedError, CertificateParseError: errs.CertificateParseError }; }, function(module, exports) { module.exports = { newInvalidAsn1Error: function(msg) { var e = new Error; return e.name = "InvalidAsn1Error", e.message = msg || "", e; } }; }, function(module, exports) { module.exports = { EOC: 0, Boolean: 1, Integer: 2, BitString: 3, OctetString: 4, Null: 5, OID: 6, ObjectDescriptor: 7, External: 8, Real: 9, Enumeration: 10, PDV: 11, Utf8String: 12, RelativeOID: 13, Sequence: 16, Set: 17, NumericString: 18, PrintableString: 19, T61String: 20, VideotexString: 21, IA5String: 22, UTCTime: 23, GeneralizedTime: 24, GraphicString: 25, VisibleString: 26, GeneralString: 28, UniversalString: 29, CharacterString: 30, BMPString: 31, Constructor: 32, Context: 128 }; }, function(module, exports, __webpack_require__) { module.exports = { DiffieHellman: DiffieHellman, generateECDSA: function(curve) { var parts = []; if (CRYPTO_HAVE_ECDH) { var osCurve = { nistp256: "prime256v1", nistp384: "secp384r1", nistp521: "secp521r1" }[curve], dh = crypto.createECDH(osCurve); return dh.generateKeys(), parts.push({ name: "curve", data: Buffer.from(curve) }), parts.push({ name: "Q", data: dh.getPublicKey() }), parts.push({ name: "d", data: dh.getPrivateKey() }), new PrivateKey({ type: "ecdsa", curve: curve, parts: parts }); } var ecParams = new X9ECParameters(curve), n = ecParams.getN(), cByteLen = Math.ceil((n.bitLength() + 64) / 8), c = new jsbn(crypto.randomBytes(cByteLen)), n1 = n.subtract(jsbn.ONE), priv = c.mod(n1).add(jsbn.ONE), pub = ecParams.getG().multiply(priv); return priv = Buffer.from(priv.toByteArray()), pub = Buffer.from(ecParams.getCurve().encodePointHex(pub), "hex"), parts.push({ name: "curve", data: Buffer.from(curve) }), parts.push({ name: "Q", data: pub }), parts.push({ name: "d", data: priv }), new PrivateKey({ type: "ecdsa", curve: curve, parts: parts }); }, generateED25519: function() { var pair = nacl.sign.keyPair(), priv = Buffer.from(pair.secretKey), pub = Buffer.from(pair.publicKey); assert.strictEqual(priv.length, 64), assert.strictEqual(pub.length, 32); var parts = []; return parts.push({ name: "A", data: pub }), parts.push({ name: "k", data: priv.slice(0, 32) }), new PrivateKey({ type: "ed25519", parts: parts }); } }; var assert = __webpack_require__(15), crypto = __webpack_require__(6), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(31), utils = __webpack_require__(28), nacl = __webpack_require__(111), Key = __webpack_require__(27), PrivateKey = __webpack_require__(29), CRYPTO_HAVE_ECDH = void 0 !== crypto.createECDH, ec = (__webpack_require__(1141), __webpack_require__(164)), jsbn = __webpack_require__(110).BigInteger; function DiffieHellman(key) { if (utils.assertCompatible(key, Key, [ 1, 4 ], "key"), this._isPriv = PrivateKey.isPrivateKey(key, [ 1, 3 ]), this._algo = key.type, this._curve = key.curve, this._key = key, "dsa" === key.type) { if (!CRYPTO_HAVE_ECDH) throw new Error("Due to bugs in the node 0.10 crypto API, node 0.12.x or later is required to use DH"); this._dh = crypto.createDiffieHellman(key.part.p.data, void 0, key.part.g.data, void 0), this._p = key.part.p, this._g = key.part.g, this._isPriv && this._dh.setPrivateKey(key.part.x.data), this._dh.setPublicKey(key.part.y.data); } else if ("ecdsa" === key.type) { if (!CRYPTO_HAVE_ECDH) return this._ecParams = new X9ECParameters(this._curve), void (this._isPriv && (this._priv = new ECPrivate(this._ecParams, key.part.d.data))); var curve = { nistp256: "prime256v1", nistp384: "secp384r1", nistp521: "secp521r1" }[key.curve]; if (this._dh = crypto.createECDH(curve), "object" != typeof this._dh || "function" != typeof this._dh.setPrivateKey) return CRYPTO_HAVE_ECDH = !1, void DiffieHellman.call(this, key); this._isPriv && this._dh.setPrivateKey(key.part.d.data), this._dh.setPublicKey(key.part.Q.data); } else { if ("curve25519" !== key.type) throw new Error("DH not supported for " + key.type + " keys"); this._isPriv && (utils.assertCompatible(key, PrivateKey, [ 1, 5 ], "key"), this._priv = key.part.k.data); } } function X9ECParameters(name) { var params = algs.curves[name]; assert.object(params); var p = new jsbn(params.p), a = new jsbn(params.a), b = new jsbn(params.b), n = new jsbn(params.n), h = jsbn.ONE, curve = new ec.ECCurveFp(p, a, b), G = curve.decodePointHex(params.G.toString("hex")); this.curve = curve, this.g = G, this.n = n, this.h = h; } function ECPublic(params, buffer) { this._params = params, 0 === buffer[0] && (buffer = buffer.slice(1)), this._pub = params.getCurve().decodePointHex(buffer.toString("hex")); } function ECPrivate(params, buffer) { this._params = params, this._priv = new jsbn(utils.mpNormalize(buffer)); } DiffieHellman.prototype.getPublicKey = function() { return this._isPriv ? this._key.toPublic() : this._key; }, DiffieHellman.prototype.getPrivateKey = function() { return this._isPriv ? this._key : void 0; }, DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey, DiffieHellman.prototype._keyCheck = function(pk, isPub) { if (assert.object(pk, "key"), isPub || utils.assertCompatible(pk, PrivateKey, [ 1, 3 ], "key"), utils.assertCompatible(pk, Key, [ 1, 4 ], "key"), pk.type !== this._algo) throw new Error("A " + pk.type + " key cannot be used in " + this._algo + " Diffie-Hellman"); if (pk.curve !== this._curve) throw new Error("A key from the " + pk.curve + " curve cannot be used with a " + this._curve + " Diffie-Hellman"); "dsa" === pk.type && (assert.deepEqual(pk.part.p, this._p, "DSA key prime does not match"), assert.deepEqual(pk.part.g, this._g, "DSA key generator does not match")); }, DiffieHellman.prototype.setKey = function(pk) { if (this._keyCheck(pk), "dsa" === pk.type) this._dh.setPrivateKey(pk.part.x.data), this._dh.setPublicKey(pk.part.y.data); else if ("ecdsa" === pk.type) CRYPTO_HAVE_ECDH ? (this._dh.setPrivateKey(pk.part.d.data), this._dh.setPublicKey(pk.part.Q.data)) : this._priv = new ECPrivate(this._ecParams, pk.part.d.data); else if ("curve25519" === pk.type) { var k = pk.part.k; pk.part.k || (k = pk.part.r), this._priv = k.data, 0 === this._priv[0] && (this._priv = this._priv.slice(1)), this._priv = this._priv.slice(0, 32); } this._key = pk, this._isPriv = !0; }, DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey, DiffieHellman.prototype.computeSecret = function(otherpk) { if (this._keyCheck(otherpk, !0), !this._isPriv) throw new Error("DH exchange has not been initialized with a private key yet"); var pub; if ("dsa" === this._algo) return this._dh.computeSecret(otherpk.part.y.data); if ("ecdsa" === this._algo) return CRYPTO_HAVE_ECDH ? this._dh.computeSecret(otherpk.part.Q.data) : (pub = new ECPublic(this._ecParams, otherpk.part.Q.data), this._priv.deriveSharedSecret(pub)); if ("curve25519" === this._algo) { for (pub = otherpk.part.A.data; 0 === pub[0] && pub.length > 32; ) pub = pub.slice(1); var priv = this._priv; assert.strictEqual(pub.length, 32), assert.strictEqual(priv.length, 32); var secret = nacl.box.before(new Uint8Array(pub), new Uint8Array(priv)); return Buffer.from(secret); } throw new Error("Invalid algorithm: " + this._algo); }, DiffieHellman.prototype.generateKey = function() { var priv, pub, parts = []; if ("dsa" === this._algo) return this._dh.generateKeys(), parts.push({ name: "p", data: this._p.data }), parts.push({ name: "q", data: this._key.part.q.data }), parts.push({ name: "g", data: this._g.data }), parts.push({ name: "y", data: this._dh.getPublicKey() }), parts.push({ name: "x", data: this._dh.getPrivateKey() }), this._key = new PrivateKey({ type: "dsa", parts: parts }), this._isPriv = !0, this._key; if ("ecdsa" === this._algo) { if (CRYPTO_HAVE_ECDH) return this._dh.generateKeys(), parts.push({ name: "curve", data: Buffer.from(this._curve) }), parts.push({ name: "Q", data: this._dh.getPublicKey() }), parts.push({ name: "d", data: this._dh.getPrivateKey() }), this._key = new PrivateKey({ type: "ecdsa", curve: this._curve, parts: parts }), this._isPriv = !0, this._key; var n = this._ecParams.getN(), r = new jsbn(crypto.randomBytes(n.bitLength())), n1 = n.subtract(jsbn.ONE); return priv = r.mod(n1).add(jsbn.ONE), pub = this._ecParams.getG().multiply(priv), priv = Buffer.from(priv.toByteArray()), pub = Buffer.from(this._ecParams.getCurve().encodePointHex(pub), "hex"), this._priv = new ECPrivate(this._ecParams, priv), parts.push({ name: "curve", data: Buffer.from(this._curve) }), parts.push({ name: "Q", data: pub }), parts.push({ name: "d", data: priv }), this._key = new PrivateKey({ type: "ecdsa", curve: this._curve, parts: parts }), this._isPriv = !0, this._key; } if ("curve25519" === this._algo) { var pair = nacl.box.keyPair(); return priv = Buffer.from(pair.secretKey), pub = Buffer.from(pair.publicKey), priv = Buffer.concat([ priv, pub ]), assert.strictEqual(priv.length, 64), assert.strictEqual(pub.length, 32), parts.push({ name: "A", data: pub }), parts.push({ name: "k", data: priv }), this._key = new PrivateKey({ type: "curve25519", parts: parts }), this._isPriv = !0, this._key; } throw new Error("Invalid algorithm: " + this._algo); }, DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey, X9ECParameters.prototype.getCurve = function() { return this.curve; }, X9ECParameters.prototype.getG = function() { return this.g; }, X9ECParameters.prototype.getN = function() { return this.n; }, X9ECParameters.prototype.getH = function() { return this.h; }, ECPrivate.prototype.deriveSharedSecret = function(pubKey) { assert.ok(pubKey instanceof ECPublic); var S = pubKey._pub.multiply(this._priv); return Buffer.from(S.getX().toBigInteger().toByteArray()); }; }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { return pem.read(buf, options, "pkcs1"); }, readPkcs1: function(alg, type, der) { switch (alg) { case "RSA": if ("public" === type) return (function(der) { var n = readMPInt(der, "modulus"), e = readMPInt(der, "exponent"); return new Key({ type: "rsa", parts: [ { name: "e", data: e }, { name: "n", data: n } ] }); })(der); if ("private" === type) return (function(der) { var version = readMPInt(der, "version"); assert.strictEqual(version[0], 0); var n = readMPInt(der, "modulus"), e = readMPInt(der, "public exponent"), d = readMPInt(der, "private exponent"), p = readMPInt(der, "prime1"), q = readMPInt(der, "prime2"), dmodp = readMPInt(der, "exponent1"), dmodq = readMPInt(der, "exponent2"), iqmp = readMPInt(der, "iqmp"); return new PrivateKey({ type: "rsa", parts: [ { name: "n", data: n }, { name: "e", data: e }, { name: "d", data: d }, { name: "iqmp", data: iqmp }, { name: "p", data: p }, { name: "q", data: q }, { name: "dmodp", data: dmodp }, { name: "dmodq", data: dmodq } ] }); })(der); throw new Error("Unknown key type: " + type); case "DSA": if ("public" === type) return (function(der) { var y = readMPInt(der, "y"), p = readMPInt(der, "p"), q = readMPInt(der, "q"), g = readMPInt(der, "g"); return new Key({ type: "dsa", parts: [ { name: "y", data: y }, { name: "p", data: p }, { name: "q", data: q }, { name: "g", data: g } ] }); })(der); if ("private" === type) return (function(der) { var version = readMPInt(der, "version"); assert.strictEqual(version.readUInt8(0), 0); var p = readMPInt(der, "p"), q = readMPInt(der, "q"), g = readMPInt(der, "g"), y = readMPInt(der, "y"), x = readMPInt(der, "x"); return new PrivateKey({ type: "dsa", parts: [ { name: "p", data: p }, { name: "q", data: q }, { name: "g", data: g }, { name: "y", data: y }, { name: "x", data: x } ] }); })(der); throw new Error("Unknown key type: " + type); case "EC": case "ECDSA": if ("private" === type) return (function(der) { var version = readMPInt(der, "version"); assert.strictEqual(version.readUInt8(0), 1); var d = der.readString(asn1.Ber.OctetString, !0); der.readSequence(160); var curve = readECDSACurve(der); assert.string(curve, "a known elliptic curve"), der.readSequence(161); var Q = der.readString(asn1.Ber.BitString, !0); Q = utils.ecNormalize(Q); var key = { type: "ecdsa", parts: [ { name: "curve", data: Buffer.from(curve) }, { name: "Q", data: Q }, { name: "d", data: d } ] }; return new PrivateKey(key); })(der); if ("public" === type) return (function(der) { der.readSequence(); var oid = der.readOID(); assert.strictEqual(oid, "1.2.840.10045.2.1", "must be ecPublicKey"); for (var curve, curveOid = der.readOID(), curves = Object.keys(algs.curves), j = 0; j < curves.length; ++j) { var c = curves[j]; if (algs.curves[c].pkcs8oid === curveOid) { curve = c; break; } } assert.string(curve, "a known ECDSA named curve"); var Q = der.readString(asn1.Ber.BitString, !0); Q = utils.ecNormalize(Q); var key = { type: "ecdsa", parts: [ { name: "curve", data: Buffer.from(curve) }, { name: "Q", data: Q } ] }; return new Key(key); })(der); throw new Error("Unknown key type: " + type); case "EDDSA": case "EdDSA": if ("private" === type) return (function(der) { var version = readMPInt(der, "version"); assert.strictEqual(version.readUInt8(0), 1); var k = der.readString(asn1.Ber.OctetString, !0); der.readSequence(160); var oid = der.readOID(); assert.strictEqual(oid, "1.3.101.112", "the ed25519 curve identifier"), der.readSequence(161); var A = utils.readBitString(der), key = { type: "ed25519", parts: [ { name: "A", data: utils.zeroPadToLength(A, 32) }, { name: "k", data: k } ] }; return new PrivateKey(key); })(der); throw new Error(type + " keys not supported with EdDSA"); default: throw new Error("Unknown key algo: " + alg); } }, write: function(key, options) { return pem.write(key, options, "pkcs1"); }, writePkcs1: function(der, key) { switch (der.startSequence(), key.type) { case "rsa": PrivateKey.isPrivateKey(key) ? (function(der, key) { var ver = Buffer.from([ 0 ]); der.writeBuffer(ver, asn1.Ber.Integer), der.writeBuffer(key.part.n.data, asn1.Ber.Integer), der.writeBuffer(key.part.e.data, asn1.Ber.Integer), der.writeBuffer(key.part.d.data, asn1.Ber.Integer), der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), key.part.dmodp && key.part.dmodq || utils.addRSAMissing(key), der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer), der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer), der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); })(der, key) : (function(der, key) { der.writeBuffer(key.part.n.data, asn1.Ber.Integer), der.writeBuffer(key.part.e.data, asn1.Ber.Integer); })(der, key); break; case "dsa": PrivateKey.isPrivateKey(key) ? (function(der, key) { var ver = Buffer.from([ 0 ]); der.writeBuffer(ver, asn1.Ber.Integer), der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), der.writeBuffer(key.part.g.data, asn1.Ber.Integer), der.writeBuffer(key.part.y.data, asn1.Ber.Integer), der.writeBuffer(key.part.x.data, asn1.Ber.Integer); })(der, key) : (function(der, key) { der.writeBuffer(key.part.y.data, asn1.Ber.Integer), der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), der.writeBuffer(key.part.g.data, asn1.Ber.Integer); })(der, key); break; case "ecdsa": PrivateKey.isPrivateKey(key) ? (function(der, key) { var ver = Buffer.from([ 1 ]); der.writeBuffer(ver, asn1.Ber.Integer), der.writeBuffer(key.part.d.data, asn1.Ber.OctetString), der.startSequence(160); var curve = key.part.curve.data.toString(), curveOid = algs.curves[curve].pkcs8oid; assert.string(curveOid, "a known ECDSA named curve"), der.writeOID(curveOid), der.endSequence(), der.startSequence(161); var Q = utils.ecNormalize(key.part.Q.data, !0); der.writeBuffer(Q, asn1.Ber.BitString), der.endSequence(); })(der, key) : (function(der, key) { der.startSequence(), der.writeOID("1.2.840.10045.2.1"); var curve = key.part.curve.data.toString(), curveOid = algs.curves[curve].pkcs8oid; assert.string(curveOid, "a known ECDSA named curve"), der.writeOID(curveOid), der.endSequence(); var Q = utils.ecNormalize(key.part.Q.data, !0); der.writeBuffer(Q, asn1.Ber.BitString); })(der, key); break; case "ed25519": PrivateKey.isPrivateKey(key) ? (function(der, key) { var ver = Buffer.from([ 1 ]); der.writeBuffer(ver, asn1.Ber.Integer), der.writeBuffer(key.part.k.data, asn1.Ber.OctetString), der.startSequence(160), der.writeOID("1.3.101.112"), der.endSequence(), der.startSequence(161), utils.writeBitString(der, key.part.A.data), der.endSequence(); })(der, key) : (function(der, key) { throw new Error("Public keys are not supported for EdDSA PKCS#1"); })(); break; default: throw new Error("Unknown key algo: " + key.type); } der.endSequence(); } }; var assert = __webpack_require__(15), asn1 = __webpack_require__(54), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(31), utils = __webpack_require__(28), Key = __webpack_require__(27), PrivateKey = __webpack_require__(29), pem = __webpack_require__(62), readECDSACurve = __webpack_require__(113).readECDSACurve; function readMPInt(der, nm) { return assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + " is not an Integer"), utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)); } }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { "string" != typeof buf && (assert.buffer(buf, "buf"), buf = buf.toString("ascii")); var lines = buf.split("\n"); if (lines[0].match(/^Private-key-format\: v1/)) { var algElems = lines[1].split(" "), algoNum = parseInt(algElems[1], 10), algoName = algElems[2]; if (!supportedAlgosById[algoNum]) throw new Error("Unsupported algorithm: " + algoName); return (function(alg, elements) { if (supportedAlgosById[alg].match(/^RSA-/)) return (function(elements) { var rsaParams = {}; elements.forEach((function(element) { "Modulus:" === element.split(" ")[0] ? rsaParams.n = elementToBuf(element) : "PublicExponent:" === element.split(" ")[0] ? rsaParams.e = elementToBuf(element) : "PrivateExponent:" === element.split(" ")[0] ? rsaParams.d = elementToBuf(element) : "Prime1:" === element.split(" ")[0] ? rsaParams.p = elementToBuf(element) : "Prime2:" === element.split(" ")[0] ? rsaParams.q = elementToBuf(element) : "Exponent1:" === element.split(" ")[0] ? rsaParams.dmodp = elementToBuf(element) : "Exponent2:" === element.split(" ")[0] ? rsaParams.dmodq = elementToBuf(element) : "Coefficient:" === element.split(" ")[0] && (rsaParams.iqmp = elementToBuf(element)); })); var key = { type: "rsa", parts: [ { name: "e", data: utils.mpNormalize(rsaParams.e) }, { name: "n", data: utils.mpNormalize(rsaParams.n) }, { name: "d", data: utils.mpNormalize(rsaParams.d) }, { name: "p", data: utils.mpNormalize(rsaParams.p) }, { name: "q", data: utils.mpNormalize(rsaParams.q) }, { name: "dmodp", data: utils.mpNormalize(rsaParams.dmodp) }, { name: "dmodq", data: utils.mpNormalize(rsaParams.dmodq) }, { name: "iqmp", data: utils.mpNormalize(rsaParams.iqmp) } ] }; return new PrivateKey(key); })(elements); if ("ECDSA-P384-SHA384" === supportedAlgosById[alg] || "ECDSA-P256-SHA256" === supportedAlgosById[alg]) { var d = Buffer.from(elements[0].split(" ")[1], "base64"), curve = "nistp384", size = 384; "ECDSA-P256-SHA256" === supportedAlgosById[alg] && (curve = "nistp256", size = 256); var Q = utils.publicFromPrivateECDSA(curve, d).part.Q.data, ecdsaKey = { type: "ecdsa", curve: curve, size: size, parts: [ { name: "curve", data: Buffer.from(curve) }, { name: "d", data: d }, { name: "Q", data: Q } ] }; return new PrivateKey(ecdsaKey); } throw new Error("Unsupported algorithm: " + supportedAlgosById[alg]); })(algoNum, lines.slice(2)); } for (var line = 0; lines[line].match(/^\;/); ) line++; if ((lines[line].match(/\. IN KEY /) || lines[line].match(/\. IN DNSKEY /)) && 0 === lines[line + 1].length) return (function(keyString) { var elems = keyString.split(" "), algorithm = parseInt(elems[5], 10); if (!supportedAlgosById[algorithm]) throw new Error("Unsupported algorithm: " + algorithm); var base64key = elems.slice(6, elems.length).join(), keyBuffer = Buffer.from(base64key, "base64"); if (supportedAlgosById[algorithm].match(/^RSA-/)) { var publicExponentLen = keyBuffer.readUInt8(0); if (3 != publicExponentLen && 1 != publicExponentLen) throw new Error("Cannot parse dnssec key: unsupported exponent length"); var publicExponent = keyBuffer.slice(1, publicExponentLen + 1); publicExponent = utils.mpNormalize(publicExponent); var modulus = keyBuffer.slice(1 + publicExponentLen); modulus = utils.mpNormalize(modulus); var rsaKey = { type: "rsa", parts: [] }; return rsaKey.parts.push({ name: "e", data: publicExponent }), rsaKey.parts.push({ name: "n", data: modulus }), new Key(rsaKey); } if ("ECDSA-P384-SHA384" === supportedAlgosById[algorithm] || "ECDSA-P256-SHA256" === supportedAlgosById[algorithm]) { var curve = "nistp384", size = 384; supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/) && (curve = "nistp256", size = 256); var ecdsaKey = { type: "ecdsa", curve: curve, size: size, parts: [ { name: "curve", data: Buffer.from(curve) }, { name: "Q", data: utils.ecNormalize(keyBuffer) } ] }; return new Key(ecdsaKey); } throw new Error("Unsupported algorithm: " + supportedAlgosById[algorithm]); })(lines[line]); throw new Error("Cannot parse dnssec key"); }, write: function(key, options) { if (PrivateKey.isPrivateKey(key)) { if ("rsa" === key.type) return (function(key, options) { key.part.dmodp && key.part.dmodq || utils.addRSAMissing(key); var out = ""; out += "Private-key-format: v1.3\n", out += "Algorithm: " + (function(opts) { if (opts && opts.hashAlgo && "sha1" !== opts.hashAlgo) { if ("sha256" === opts.hashAlgo) return "8 (RSASHA256)"; if ("sha512" === opts.hashAlgo) return "10 (RSASHA512)"; throw new Error("Unknown or unsupported hash: " + opts.hashAlgo); } return "5 (RSASHA1)"; })(options) + "\n", out += "Modulus: " + utils.mpDenormalize(key.part.n.data).toString("base64") + "\n", out += "PublicExponent: " + utils.mpDenormalize(key.part.e.data).toString("base64") + "\n", out += "PrivateExponent: " + utils.mpDenormalize(key.part.d.data).toString("base64") + "\n", out += "Prime1: " + utils.mpDenormalize(key.part.p.data).toString("base64") + "\n", out += "Prime2: " + utils.mpDenormalize(key.part.q.data).toString("base64") + "\n", out += "Exponent1: " + utils.mpDenormalize(key.part.dmodp.data).toString("base64") + "\n", out += "Exponent2: " + utils.mpDenormalize(key.part.dmodq.data).toString("base64") + "\n", out += "Coefficient: " + utils.mpDenormalize(key.part.iqmp.data).toString("base64") + "\n"; var timestamp = new Date; return out += "Created: " + dnssecTimestamp(timestamp) + "\n", out += "Publish: " + dnssecTimestamp(timestamp) + "\n", out += "Activate: " + dnssecTimestamp(timestamp) + "\n", Buffer.from(out, "ascii"); })(key, options); if ("ecdsa" === key.type) return (function(key, options) { var out = ""; if (out += "Private-key-format: v1.3\n", "nistp256" === key.curve) out += "Algorithm: 13 (ECDSAP256SHA256)\n"; else { if ("nistp384" !== key.curve) throw new Error("Unsupported curve"); out += "Algorithm: 14 (ECDSAP384SHA384)\n"; } out += "PrivateKey: " + key.part.d.data.toString("base64") + "\n"; var timestamp = new Date; return out += "Created: " + dnssecTimestamp(timestamp) + "\n", out += "Publish: " + dnssecTimestamp(timestamp) + "\n", out += "Activate: " + dnssecTimestamp(timestamp) + "\n", Buffer.from(out, "ascii"); })(key); throw new Error("Unsupported algorithm: " + key.type); } throw Key.isKey(key) ? new Error('Format "dnssec" only supports writing private keys') : new Error("key is not a Key or PrivateKey"); } }; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, Key = __webpack_require__(27), PrivateKey = __webpack_require__(29), utils = __webpack_require__(28), supportedAlgos = (__webpack_require__(112), __webpack_require__(264), { "rsa-sha1": 5, "rsa-sha256": 8, "rsa-sha512": 10, "ecdsa-p256-sha256": 13, "ecdsa-p384-sha384": 14 }), supportedAlgosById = {}; function elementToBuf(e) { return Buffer.from(e.split(" ")[1], "base64"); } function dnssecTimestamp(date) { var timestampStr = date.getFullYear() + "" + (date.getMonth() + 1) + date.getUTCDate(); return (timestampStr += "" + date.getUTCHours() + date.getUTCMinutes()) + date.getUTCSeconds(); } Object.keys(supportedAlgos).forEach((function(k) { supportedAlgosById[supportedAlgos[k]] = k.toUpperCase(); })); }, function(module, exports) { function Caseless(dict) { this.dict = dict || {}; } Caseless.prototype.set = function(name, value, clobber) { if ("object" != typeof name) { void 0 === clobber && (clobber = !0); var has = this.has(name); return !clobber && has ? this.dict[has] = this.dict[has] + "," + value : this.dict[has || name] = value, has; } for (var i in name) this.set(i, name[i], value); }, Caseless.prototype.has = function(name) { for (var keys = Object.keys(this.dict), i = (name = name.toLowerCase(), 0); i < keys.length; i++) if (keys[i].toLowerCase() === name) return keys[i]; return !1; }, Caseless.prototype.get = function(name) { var result, _key; name = name.toLowerCase(); var headers = this.dict; return Object.keys(headers).forEach((function(key) { _key = key.toLowerCase(), name === _key && (result = headers[key]); })), result; }, Caseless.prototype.swap = function(name) { var has = this.has(name); if (has !== name) { if (!has) throw new Error('There is no header than matches "' + name + '"'); this.dict[name] = this.dict[has], delete this.dict[has]; } }, Caseless.prototype.del = function(name) { var has = this.has(name); return delete this.dict[has || name]; }, module.exports = function(dict) { return new Caseless(dict); }, module.exports.httpify = function(resp, headers) { var c = new Caseless(headers); return resp.setHeader = function(key, value, clobber) { if (void 0 !== value) return c.set(key, value, clobber); }, resp.hasHeader = function(key) { return c.has(key); }, resp.getHeader = function(key) { return c.get(key); }, resp.removeHeader = function(key) { return c.del(key); }, resp.headers = c.dict, c; }; }, function(module, exports, __webpack_require__) { "use strict"; var URI = __webpack_require__(1169), equal = __webpack_require__(269), util = __webpack_require__(91), SchemaObject = __webpack_require__(538), traverse = __webpack_require__(1171); function resolve(compile, root, ref) { var refVal = this._refs[ref]; if ("string" == typeof refVal) { if (!this._refs[refVal]) return resolve.call(this, compile, root, refVal); refVal = this._refs[refVal]; } if ((refVal = refVal || this._schemas[ref]) instanceof SchemaObject) return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal); var schema, v, baseId, res = resolveSchema.call(this, root, ref); return res && (schema = res.schema, root = res.root, baseId = res.baseId), schema instanceof SchemaObject ? v = schema.validate || compile.call(this, schema.schema, root, void 0, baseId) : void 0 !== schema && (v = inlineRef(schema, this._opts.inlineRefs) ? schema : compile.call(this, schema, root, void 0, baseId)), v; } function resolveSchema(root, ref) { var p = URI.parse(ref), refPath = _getFullPath(p), baseId = getFullPath(this._getId(root.schema)); if (0 === Object.keys(root.schema).length || refPath !== baseId) { var id = normalizeId(refPath), refVal = this._refs[id]; if ("string" == typeof refVal) return resolveRecursive.call(this, root, refVal, p); if (refVal instanceof SchemaObject) refVal.validate || this._compile(refVal), root = refVal; else { if (!((refVal = this._schemas[id]) instanceof SchemaObject)) return; if (refVal.validate || this._compile(refVal), id == normalizeId(ref)) return { schema: refVal, root: root, baseId: baseId }; root = refVal; } if (!root.schema) return; baseId = getFullPath(this._getId(root.schema)); } return getJsonPointer.call(this, p, baseId, root.schema, root); } function resolveRecursive(root, ref, parsedRef) { var res = resolveSchema.call(this, root, ref); if (res) { var schema = res.schema, baseId = res.baseId; root = res.root; var id = this._getId(schema); return id && (baseId = resolveUrl(baseId, id)), getJsonPointer.call(this, parsedRef, baseId, schema, root); } } module.exports = resolve, resolve.normalizeId = normalizeId, resolve.fullPath = getFullPath, resolve.url = resolveUrl, resolve.ids = function(schema) { var schemaId = normalizeId(this._getId(schema)), baseIds = { "": schemaId }, fullPaths = { "": getFullPath(schemaId, !1) }, localRefs = {}, self = this; return traverse(schema, { allKeys: !0 }, (function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if ("" !== jsonPtr) { var id = self._getId(sch), baseId = baseIds[parentJsonPtr], fullPath = fullPaths[parentJsonPtr] + "/" + parentKeyword; if (void 0 !== keyIndex && (fullPath += "/" + ("number" == typeof keyIndex ? keyIndex : util.escapeFragment(keyIndex))), "string" == typeof id) { id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id); var refVal = self._refs[id]; if ("string" == typeof refVal && (refVal = self._refs[refVal]), refVal && refVal.schema) { if (!equal(sch, refVal.schema)) throw new Error('id "' + id + '" resolves to more than one schema'); } else if (id != normalizeId(fullPath)) if ("#" == id[0]) { if (localRefs[id] && !equal(sch, localRefs[id])) throw new Error('id "' + id + '" resolves to more than one schema'); localRefs[id] = sch; } else self._refs[id] = fullPath; } baseIds[jsonPtr] = baseId, fullPaths[jsonPtr] = fullPath; } })), localRefs; }, resolve.inlineRef = inlineRef, resolve.schema = resolveSchema; var PREVENT_SCOPE_CHANGE = util.toHash([ "properties", "patternProperties", "enum", "dependencies", "definitions" ]); function getJsonPointer(parsedRef, baseId, schema, root) { if (parsedRef.fragment = parsedRef.fragment || "", "/" == parsedRef.fragment.slice(0, 1)) { for (var parts = parsedRef.fragment.split("/"), i = 1; i < parts.length; i++) { var part = parts[i]; if (part) { if (void 0 === (schema = schema[part = util.unescapeFragment(part)])) break; var id; if (!PREVENT_SCOPE_CHANGE[part] && ((id = this._getId(schema)) && (baseId = resolveUrl(baseId, id)), schema.$ref)) { var $ref = resolveUrl(baseId, schema.$ref), res = resolveSchema.call(this, root, $ref); res && (schema = res.schema, root = res.root, baseId = res.baseId); } } } return void 0 !== schema && schema !== root.schema ? { schema: schema, root: root, baseId: baseId } : void 0; } } var SIMPLE_INLINED = util.toHash([ "type", "format", "pattern", "maxLength", "minLength", "maxProperties", "minProperties", "maxItems", "minItems", "maximum", "minimum", "uniqueItems", "multipleOf", "required", "enum" ]); function inlineRef(schema, limit) { return !1 !== limit && (void 0 === limit || !0 === limit ? checkNoRef(schema) : limit ? countKeys(schema) <= limit : void 0); } function checkNoRef(schema) { var item; if (Array.isArray(schema)) { for (var i = 0; i < schema.length; i++) if ("object" == typeof (item = schema[i]) && !checkNoRef(item)) return !1; } else for (var key in schema) { if ("$ref" == key) return !1; if ("object" == typeof (item = schema[key]) && !checkNoRef(item)) return !1; } return !0; } function countKeys(schema) { var item, count = 0; if (Array.isArray(schema)) { for (var i = 0; i < schema.length; i++) if ("object" == typeof (item = schema[i]) && (count += countKeys(item)), count == 1 / 0) return 1 / 0; } else for (var key in schema) { if ("$ref" == key) return 1 / 0; if (SIMPLE_INLINED[key]) count++; else if ("object" == typeof (item = schema[key]) && (count += countKeys(item) + 1), count == 1 / 0) return 1 / 0; } return count; } function getFullPath(id, normalize) { return !1 !== normalize && (id = normalizeId(id)), _getFullPath(URI.parse(id)); } function _getFullPath(p) { return URI.serialize(p).split("#")[0] + "#"; } var TRAILING_SLASH_HASH = /#\/?$/; function normalizeId(id) { return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; } function resolveUrl(baseId, id) { return id = normalizeId(id), URI.resolve(baseId, id); } }, function(module, exports, __webpack_require__) { "use strict"; var isArray = Array.isArray, keyList = Object.keys, hasProp = Object.prototype.hasOwnProperty; module.exports = function equal(a, b) { if (a === b) return !0; if (a && b && "object" == typeof a && "object" == typeof b) { var i, length, key, arrA = isArray(a), arrB = isArray(b); if (arrA && arrB) { if ((length = a.length) != b.length) return !1; for (i = length; 0 != i--; ) if (!equal(a[i], b[i])) return !1; return !0; } if (arrA != arrB) return !1; var dateA = a instanceof Date, dateB = b instanceof Date; if (dateA != dateB) return !1; if (dateA && dateB) return a.getTime() == b.getTime(); var regexpA = a instanceof RegExp, regexpB = b instanceof RegExp; if (regexpA != regexpB) return !1; if (regexpA && regexpB) return a.toString() == b.toString(); var keys = keyList(a); if ((length = keys.length) !== keyList(b).length) return !1; for (i = length; 0 != i--; ) if (!hasProp.call(b, keys[i])) return !1; for (i = length; 0 != i--; ) if (!equal(a[key = keys[i]], b[key])) return !1; return !0; } return a != a && b != b; }; }, function(module, exports, __webpack_require__) { "use strict"; var resolve = __webpack_require__(268); function MissingRefError(baseId, ref, message) { this.message = message || MissingRefError.message(baseId, ref), this.missingRef = resolve.url(baseId, ref), this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); } function errorSubclass(Subclass) { return Subclass.prototype = Object.create(Error.prototype), Subclass.prototype.constructor = Subclass, Subclass; } module.exports = { Validation: errorSubclass((function(errors) { this.message = "validation failed", this.errors = errors, this.ajv = this.validation = !0; })), MissingRef: errorSubclass(MissingRefError) }, MissingRefError.message = function(baseId, ref) { return "can't resolve reference " + ref + " from id " + baseId; }; }, function(module, exports) { const isRegex = /^\/(.*)\/(.*)$/; module.exports = function(req) { let opts = {}; try { opts = JSON.parse(req.query.o); } catch (e) {} return (opts.fileMustInclude || []).length && (opts.fileMustInclude = opts.fileMustInclude.map((el => { if ((el || "").match(isRegex)) { const parts = isRegex.exec(el); try { return new RegExp(parts[1], parts[2]); } catch (e) {} } return el; }))), { opts: opts, query: req.query }; }; }, function(module, exports) { const parseUIntLE = function(buffer, offset, size) { var result; switch (size) { case 1: result = buffer.readUInt8(offset); break; case 2: result = buffer.readUInt16LE(offset); break; case 4: result = buffer.readUInt32LE(offset); break; case 8: result = Number(buffer.readBigUInt64LE(offset)); break; default: throw new Error("Unsupported UInt LE size!"); } return result; }; module.exports = { parse: function(buffer, format) { var result = {}, offset = 0; for (const [key, size] of format) buffer.length >= offset + size ? result[key] = parseUIntLE(buffer, offset, size) : result[key] = null, offset += size; return result; } }; }, function(module, exports, __webpack_require__) { module.exports = Abstract; var Stream = __webpack_require__(3).Stream; function Abstract() { Stream.call(this); } function decorate(er, code, self) { return er instanceof Error || (er = new Error(er)), er.code = er.code || code, er.path = er.path || self.path, er.fstream_type = er.fstream_type || self.type, er.fstream_path = er.fstream_path || self.path, self._path !== self.path && (er.fstream_unc_path = er.fstream_unc_path || self._path), self.linkpath && (er.fstream_linkpath = er.fstream_linkpath || self.linkpath), er.fstream_class = er.fstream_class || self.constructor.name, er.fstream_stack = er.fstream_stack || (new Error).stack.split(/\n/).slice(3).map((function(s) { return s.replace(/^ {4}at /, ""); })), er; } __webpack_require__(8)(Abstract, Stream), Abstract.prototype.on = function(ev, fn) { return "ready" === ev && this.ready ? process.nextTick(fn.bind(this)) : Stream.prototype.on.call(this, ev, fn), this; }, Abstract.prototype.abort = function() { this._aborted = !0, this.emit("abort"); }, Abstract.prototype.destroy = function() {}, Abstract.prototype.warn = function(msg, code) { var er = decorate(msg, code, this); this.listeners("warn") ? this.emit("warn", er) : console.error("%s %s\npath = %s\nsyscall = %s\nfstream_type = %s\nfstream_path = %s\nfstream_unc_path = %s\nfstream_class = %s\nfstream_stack =\n%s\n", code || "UNKNOWN", er.stack, er.path, er.syscall, er.fstream_type, er.fstream_path, er.fstream_unc_path, er.fstream_class, er.fstream_stack.join("\n")); }, Abstract.prototype.info = function(msg, code) { this.emit("info", msg, code); }, Abstract.prototype.error = function(msg, code, th) { var er = decorate(msg, code, this); if (th) throw er; this.emit("error", er); }; }, function(module, exports) { module.exports = function collect(stream) { if (!stream._collected) { if (stream._paused) return stream.on("resume", collect.bind(null, stream)); stream._collected = !0, stream.pause(), stream.on("data", save), stream.on("end", save); var buf = []; stream.on("entry", saveEntry); var orig, entryBuffer = []; stream.on("proxy", (function(p) { p.pause(); })), stream.pipe = (orig = stream.pipe, function(dest) { var e = 0; return (function unblockEntry() { var entry = entryBuffer[e++]; if (!entry) return stream.removeListener("entry", saveEntry), stream.removeListener("data", save), stream.removeListener("end", save), stream.pipe = orig, dest && stream.pipe(dest), buf.forEach((function(b) { b ? stream.emit("data", b) : stream.emit("end"); })), void stream.resume(); entry.on("end", unblockEntry), dest ? dest.add(entry) : stream.emit("entry", entry); })(), dest; }); } function save(b) { "string" == typeof b && (b = new Buffer(b)), Buffer.isBuffer(b) && !b.length || buf.push(b); } function saveEntry(e) { collect(e), entryBuffer.push(e); } }; }, function(module, exports) { const isRegex = /^\/(.*)\/(.*)$/; module.exports = function(req) { let opts = {}; try { opts = JSON.parse(req.query.o); } catch (e) {} return (opts.fileMustInclude || []).length && (opts.fileMustInclude = opts.fileMustInclude.map((el => { if ((el || "").match(isRegex)) { const parts = isRegex.exec(el); try { return new RegExp(parts[1], parts[2]); } catch (e) {} } return el; }))), { opts: opts, query: req.query }; }; }, function(module, exports, __webpack_require__) { "use strict"; function _optionalChain(ops) { let lastAccessLHS, value = ops[0], i = 1; for (;i < ops.length; ) { const op = ops[i], fn = ops[i + 1]; if (i += 2, ("optionalAccess" === op || "optionalCall" === op) && null == value) return; "access" === op || "optionalAccess" === op ? (lastAccessLHS = value, value = fn(value)) : "call" !== op && "optionalCall" !== op || (value = fn(((...args) => value.call(lastAccessLHS, ...args))), lastAccessLHS = void 0); } return value; } Object.defineProperty(exports, "__esModule", { value: !0 }); var RarFileChunk = class _RarFileChunk { constructor(fileMedia, startOffset, endOffset) { this.fileMedia = fileMedia, this.startOffset = startOffset, this.endOffset = endOffset; } padEnd(endPadding) { return new _RarFileChunk(this.fileMedia, this.startOffset, this.endOffset - endPadding); } padStart(startPadding) { return new _RarFileChunk(this.fileMedia, this.startOffset + startPadding, this.endOffset); } get length() { return Math.max(0, this.endOffset - this.startOffset); } async getStream() { return (await this.fileMedia).createReadStream({ start: this.startOffset, end: this.endOffset }); } }, _stream = __webpack_require__(3), InnerFileStream = class extends _stream.Readable { constructor(rarFileChunks, options) { super(options), this.rarFileChunks = rarFileChunks; } pushData(data) { this.push(data) || _optionalChain([ this, "access", _ => _.stream, "optionalAccess", _2 => _2.pause, "call", _3 => _3() ]); } get isStarted() { return !!this.stream; } async next() { const chunk = this.rarFileChunks.shift(); chunk ? (this.stream = await chunk.getStream(), _optionalChain([ this, "access", _4 => _4.stream, "optionalAccess", _5 => _5.on, "call", _6 => _6("data", (data => this.pushData(data))) ]), _optionalChain([ this, "access", _7 => _7.stream, "optionalAccess", _8 => _8.on, "call", _9 => _9("end", (() => this.next())) ])) : this.push(null); } _read() { this.isStarted ? _optionalChain([ this, "access", _10 => _10.stream, "optionalAccess", _11 => _11.resume, "call", _12 => _12() ]) : this.next(); } }; exports.MergeStreams = function(streams, rarFiles) { const fileChunks = streams.map(((el, ij) => ({ name: "file.zip", chunk: new RarFileChunk(rarFiles[ij], 0, rarFiles[ij].length - 1) }))).flat(), grouped = (fn = f => f.name, object = fileChunks.reduce(((prev, curr) => { const groupKey = fn(curr), group = prev[groupKey] || []; return group.push(curr), { ...prev, [groupKey]: group }; }), {}), mapper = value => value.map((v => v.chunk)), Object.fromEntries(Object.entries(object).map((([key, value]) => [ key, mapper(value) ])))); var object, mapper, fn; return Object.entries(grouped).map((([name, chunks2]) => new class { constructor(name, rarFileChunks) { this.name = name, this.rarFileChunks = rarFileChunks, this.length = rarFileChunks.map((c => c.length)).reduce(((s, n) => s + n)), this.chunkMap = this.calculateChunkMap(rarFileChunks), this.name = name; } async readToEnd() { return (async stream => new Promise(((resolve, reject) => { const buffers = []; stream.on("error", reject), stream.on("data", (data => buffers.push(data))), stream.on("end", (() => resolve(Buffer.concat(buffers)))); })))(await this.createReadStream({ start: 0, end: this.length - 1 })); } getChunksToStream(fileStart, fileEnd) { const {index: startIndex, start: startOffset} = this.findMappedChunk(fileStart); let {index: endIndex, end: endOffset} = this.findMappedChunk(fileEnd); const chunksToStream = this.rarFileChunks.slice(startIndex, endIndex + 1), last = chunksToStream.length - 1; chunksToStream[0] = chunksToStream[0].padStart(Math.abs(startOffset - fileStart)); let diff = Math.abs(endOffset - fileEnd); return diff === this.rarFileChunks.length && (diff = 0), 0 !== diff && (chunksToStream[last] = chunksToStream[last].padEnd(diff)), chunksToStream; } createReadStream(interval) { interval || (interval = { start: 0, end: this.length - 1 }); let {start: start, end: end} = interval; if (start < 0 || end >= this.length) throw Error("Illegal start/end offset"); return Promise.resolve(new InnerFileStream(this.getChunksToStream(start, end))); } calculateChunkMap(rarFileChunks) { const chunkMap = []; let index = 0, fileOffset = 0; for (const chunk of rarFileChunks) { const start = fileOffset, end = fileOffset + chunk.length; fileOffset = end + 1, chunkMap.push({ index: index, start: start, end: end, chunk: chunk }), index++; } return chunkMap; } findMappedChunk(offset) { let selectedMap = this.chunkMap[0]; for (const chunkMapping of this.chunkMap) if (offset >= chunkMapping.start && offset <= chunkMapping.end) { selectedMap = chunkMapping; break; } return selectedMap; } }(name, chunks2))); }; }, function(module, exports) { const isRegex = /^\/(.*)\/(.*)$/; module.exports = function(req) { let opts = {}; try { opts = JSON.parse(req.query.o); } catch (e) {} return (opts.fileMustInclude || []).length && (opts.fileMustInclude = opts.fileMustInclude.map((el => { if ((el || "").match(isRegex)) { const parts = isRegex.exec(el); try { return new RegExp(parts[1], parts[2]); } catch (e) {} } return el; }))), { opts: opts, query: req.query }; }; }, function(module, exports) { const isRegex = /^\/(.*)\/(.*)$/; module.exports = function(req) { let opts = {}; try { opts = JSON.parse(req.query.o); } catch (e) {} return (opts.fileMustInclude || []).length && (opts.fileMustInclude = opts.fileMustInclude.map((el => { if ((el || "").match(isRegex)) { const parts = isRegex.exec(el); try { return new RegExp(parts[1], parts[2]); } catch (e) {} } return el; }))), { opts: opts, query: req.query }; }; }, function(module, exports) { const isRegex = /^\/(.*)\/(.*)$/; module.exports = function(req) { let opts = {}; try { opts = JSON.parse(req.query.o); } catch (e) {} return (opts.fileMustInclude || []).length && (opts.fileMustInclude = opts.fileMustInclude.map((el => { if ((el || "").match(isRegex)) { const parts = isRegex.exec(el); try { return new RegExp(parts[1], parts[2]); } catch (e) {} } return el; }))), { opts: opts, query: req.query }; }; }, function(module) { module.exports = [ [ "a140", "", 62 ], [ "a180", "", 32 ], [ "a240", "", 62 ], [ "a280", "", 32 ], [ "a2ab", "", 5 ], [ "a2e3", "€" ], [ "a2ef", "" ], [ "a2fd", "" ], [ "a340", "", 62 ], [ "a380", "", 31, " " ], [ "a440", "", 62 ], [ "a480", "", 32 ], [ "a4f4", "", 10 ], [ "a540", "", 62 ], [ "a580", "", 32 ], [ "a5f7", "", 7 ], [ "a640", "", 62 ], [ "a680", "", 32 ], [ "a6b9", "", 7 ], [ "a6d9", "", 6 ], [ "a6ec", "" ], [ "a6f3", "" ], [ "a6f6", "", 8 ], [ "a740", "", 62 ], [ "a780", "", 32 ], [ "a7c2", "", 14 ], [ "a7f2", "", 12 ], [ "a896", "", 10 ], [ "a8bc", "" ], [ "a8bf", "ǹ" ], [ "a8c1", "" ], [ "a8ea", "", 20 ], [ "a958", "" ], [ "a95b", "" ], [ "a95d", "" ], [ "a989", "〾⿰", 11 ], [ "a997", "", 12 ], [ "a9f0", "", 14 ], [ "aaa1", "", 93 ], [ "aba1", "", 93 ], [ "aca1", "", 93 ], [ "ada1", "", 93 ], [ "aea1", "", 93 ], [ "afa1", "", 93 ], [ "d7fa", "", 4 ], [ "f8a1", "", 93 ], [ "f9a1", "", 93 ], [ "faa1", "", 93 ], [ "fba1", "", 93 ], [ "fca1", "", 93 ], [ "fda1", "", 93 ], [ "fe50", "⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌" ], [ "fe80", "䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓", 6, "䶮", 93 ] ]; }, function(module) { module.exports = [ [ "0", "\0", 127 ], [ "a140", " ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚" ], [ "a1a1", "﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢", 4, "~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/" ], [ "a240", "\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁", 7, "▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭" ], [ "a2a1", "╮╰╯═╞╪╡◢◣◥◤╱╲╳0", 9, "Ⅰ", 9, "〡", 8, "十卄卅A", 25, "a", 21 ], [ "a340", "wxyzΑ", 16, "Σ", 6, "α", 16, "σ", 6, "ㄅ", 10 ], [ "a3a1", "ㄐ", 25, "˙ˉˊˇˋ" ], [ "a3e1", "€" ], [ "a440", "一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才" ], [ "a4a1", "丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙" ], [ "a540", "世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外" ], [ "a5a1", "央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全" ], [ "a640", "共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年" ], [ "a6a1", "式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣" ], [ "a740", "作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍" ], [ "a7a1", "均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠" ], [ "a840", "杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒" ], [ "a8a1", "芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵" ], [ "a940", "咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居" ], [ "a9a1", "屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊" ], [ "aa40", "昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠" ], [ "aaa1", "炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附" ], [ "ab40", "陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品" ], [ "aba1", "哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷" ], [ "ac40", "拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗" ], [ "aca1", "活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄" ], [ "ad40", "耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥" ], [ "ada1", "迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪" ], [ "ae40", "哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙" ], [ "aea1", "恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓" ], [ "af40", "浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷" ], [ "afa1", "砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃" ], [ "b040", "虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡" ], [ "b0a1", "陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀" ], [ "b140", "娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽" ], [ "b1a1", "情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺" ], [ "b240", "毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶" ], [ "b2a1", "瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼" ], [ "b340", "莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途" ], [ "b3a1", "部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠" ], [ "b440", "婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍" ], [ "b4a1", "插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋" ], [ "b540", "溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘" ], [ "b5a1", "窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁" ], [ "b640", "詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑" ], [ "b6a1", "間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼" ], [ "b740", "媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業" ], [ "b7a1", "楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督" ], [ "b840", "睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫" ], [ "b8a1", "腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊" ], [ "b940", "辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴" ], [ "b9a1", "飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇" ], [ "ba40", "愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢" ], [ "baa1", "滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬" ], [ "bb40", "罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤" ], [ "bba1", "說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜" ], [ "bc40", "劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂" ], [ "bca1", "慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃" ], [ "bd40", "瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯" ], [ "bda1", "翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞" ], [ "be40", "輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉" ], [ "bea1", "鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡" ], [ "bf40", "濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊" ], [ "bfa1", "縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚" ], [ "c040", "錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇" ], [ "c0a1", "嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬" ], [ "c140", "瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪" ], [ "c1a1", "薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁" ], [ "c240", "駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘" ], [ "c2a1", "癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦" ], [ "c340", "鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸" ], [ "c3a1", "獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類" ], [ "c440", "願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼" ], [ "c4a1", "纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴" ], [ "c540", "護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬" ], [ "c5a1", "禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒" ], [ "c640", "讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲" ], [ "c940", "乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕" ], [ "c9a1", "氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋" ], [ "ca40", "汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘" ], [ "caa1", "吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇" ], [ "cb40", "杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓" ], [ "cba1", "芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢" ], [ "cc40", "坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋" ], [ "cca1", "怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲" ], [ "cd40", "泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺" ], [ "cda1", "矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏" ], [ "ce40", "哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛" ], [ "cea1", "峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺" ], [ "cf40", "柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂" ], [ "cfa1", "洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀" ], [ "d040", "穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪" ], [ "d0a1", "苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱" ], [ "d140", "唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧" ], [ "d1a1", "恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤" ], [ "d240", "毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸" ], [ "d2a1", "牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐" ], [ "d340", "笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢" ], [ "d3a1", "荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐" ], [ "d440", "酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅" ], [ "d4a1", "唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏" ], [ "d540", "崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟" ], [ "d5a1", "捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉" ], [ "d640", "淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏" ], [ "d6a1", "痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟" ], [ "d740", "耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷" ], [ "d7a1", "蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪" ], [ "d840", "釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷" ], [ "d8a1", "堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔" ], [ "d940", "惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒" ], [ "d9a1", "晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞" ], [ "da40", "湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖" ], [ "daa1", "琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥" ], [ "db40", "罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳" ], [ "dba1", "菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺" ], [ "dc40", "軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈" ], [ "dca1", "隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆" ], [ "dd40", "媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤" ], [ "dda1", "搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼" ], [ "de40", "毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓" ], [ "dea1", "煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓" ], [ "df40", "稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯" ], [ "dfa1", "腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤" ], [ "e040", "觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿" ], [ "e0a1", "遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠" ], [ "e140", "凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠" ], [ "e1a1", "寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉" ], [ "e240", "榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊" ], [ "e2a1", "漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓" ], [ "e340", "禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞" ], [ "e3a1", "耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻" ], [ "e440", "裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍" ], [ "e4a1", "銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘" ], [ "e540", "噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉" ], [ "e5a1", "憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒" ], [ "e640", "澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙" ], [ "e6a1", "獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟" ], [ "e740", "膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢" ], [ "e7a1", "蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧" ], [ "e840", "踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓" ], [ "e8a1", "銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮" ], [ "e940", "噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺" ], [ "e9a1", "憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸" ], [ "ea40", "澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙" ], [ "eaa1", "瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘" ], [ "eb40", "蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠" ], [ "eba1", "諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌" ], [ "ec40", "錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕" ], [ "eca1", "魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎" ], [ "ed40", "檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶" ], [ "eda1", "瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞" ], [ "ee40", "蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞" ], [ "eea1", "謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜" ], [ "ef40", "鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰" ], [ "efa1", "鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶" ], [ "f040", "璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒" ], [ "f0a1", "臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧" ], [ "f140", "蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪" ], [ "f1a1", "鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰" ], [ "f240", "徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛" ], [ "f2a1", "礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕" ], [ "f340", "譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦" ], [ "f3a1", "鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲" ], [ "f440", "嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩" ], [ "f4a1", "禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿" ], [ "f540", "鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛" ], [ "f5a1", "鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥" ], [ "f640", "蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺" ], [ "f6a1", "騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚" ], [ "f740", "糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊" ], [ "f7a1", "驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾" ], [ "f840", "讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏" ], [ "f8a1", "齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚" ], [ "f940", "纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊" ], [ "f9a1", "龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓" ] ]; }, function(module, exports, __webpack_require__) { var prevTime; function createDebug(namespace) { function debug() { if (debug.enabled) { var self = debug, curr = +new Date, ms = curr - (prevTime || curr); self.diff = ms, self.prev = prevTime, self.curr = curr, prevTime = curr; for (var args = new Array(arguments.length), i = 0; i < args.length; i++) args[i] = arguments[i]; args[0] = exports.coerce(args[0]), "string" != typeof args[0] && args.unshift("%O"); var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (function(match, format) { if ("%%" === match) return match; index++; var formatter = exports.formatters[format]; if ("function" == typeof formatter) { var val = args[index]; match = formatter.call(self, val), args.splice(index, 1), index--; } return match; })), exports.formatArgs.call(self, args); var logFn = debug.log || exports.log || console.log.bind(console); logFn.apply(self, args); } } return debug.namespace = namespace, debug.enabled = exports.enabled(namespace), debug.useColors = exports.useColors(), debug.color = (function(namespace) { var i, hash = 0; for (i in namespace) hash = (hash << 5) - hash + namespace.charCodeAt(i), hash |= 0; return exports.colors[Math.abs(hash) % exports.colors.length]; })(namespace), "function" == typeof exports.init && exports.init(debug), debug; } (exports = module.exports = createDebug.debug = createDebug.default = createDebug).coerce = function(val) { return val instanceof Error ? val.stack || val.message : val; }, exports.disable = function() { exports.enable(""); }, exports.enable = function(namespaces) { exports.save(namespaces), exports.names = [], exports.skips = []; for (var split = ("string" == typeof namespaces ? namespaces : "").split(/[\s,]+/), len = split.length, i = 0; i < len; i++) split[i] && ("-" === (namespaces = split[i].replace(/\*/g, ".*?"))[0] ? exports.skips.push(new RegExp("^" + namespaces.substr(1) + "$")) : exports.names.push(new RegExp("^" + namespaces + "$"))); }, exports.enabled = function(name) { var i, len; for (i = 0, len = exports.skips.length; i < len; i++) if (exports.skips[i].test(name)) return !1; for (i = 0, len = exports.names.length; i < len; i++) if (exports.names[i].test(name)) return !0; return !1; }, exports.humanize = __webpack_require__(588), exports.names = [], exports.skips = [], exports.formatters = {}; }, function(module, exports, __webpack_require__) { "use strict"; var EventEmitter = __webpack_require__(4).EventEmitter; function lazyProperty(obj, prop, getter) { Object.defineProperty(obj, prop, { configurable: !0, enumerable: !0, get: function() { var val = getter(); return Object.defineProperty(obj, prop, { configurable: !0, enumerable: !0, value: val }), val; } }); } function toString(obj) { return obj.toString(); } lazyProperty(module.exports, "callSiteToString", (function() { var limit = Error.stackTraceLimit, obj = {}, prep = Error.prepareStackTrace; Error.prepareStackTrace = function(obj, stack) { return stack; }, Error.stackTraceLimit = 2, Error.captureStackTrace(obj); var stack = obj.stack.slice(); return Error.prepareStackTrace = prep, Error.stackTraceLimit = limit, stack[0].toString ? toString : __webpack_require__(594); })), lazyProperty(module.exports, "eventListenerCount", (function() { return EventEmitter.listenerCount || __webpack_require__(595); })); }, function(module, exports, __webpack_require__) { "use strict"; var has = Object.prototype.hasOwnProperty, isArray = Array.isArray, hexTable = (function() { for (var array = [], i = 0; i < 256; ++i) array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); return array; })(), arrayToObject = function(source, options) { for (var obj = options && options.plainObjects ? Object.create(null) : {}, i = 0; i < source.length; ++i) void 0 !== source[i] && (obj[i] = source[i]); return obj; }; module.exports = { arrayToObject: arrayToObject, assign: function(target, source) { return Object.keys(source).reduce((function(acc, key) { return acc[key] = source[key], acc; }), target); }, combine: function(a, b) { return [].concat(a, b); }, compact: function(value) { for (var queue = [ { obj: { o: value }, prop: "o" } ], refs = [], i = 0; i < queue.length; ++i) for (var item = queue[i], obj = item.obj[item.prop], keys = Object.keys(obj), j = 0; j < keys.length; ++j) { var key = keys[j], val = obj[key]; "object" == typeof val && null !== val && -1 === refs.indexOf(val) && (queue.push({ obj: obj, prop: key }), refs.push(val)); } return (function(queue) { for (;queue.length > 1; ) { var item = queue.pop(), obj = item.obj[item.prop]; if (isArray(obj)) { for (var compacted = [], j = 0; j < obj.length; ++j) void 0 !== obj[j] && compacted.push(obj[j]); item.obj[item.prop] = compacted; } } })(queue), value; }, decode: function(str, decoder, charset) { var strWithoutPlus = str.replace(/\+/g, " "); if ("iso-8859-1" === charset) return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); try { return decodeURIComponent(strWithoutPlus); } catch (e) { return strWithoutPlus; } }, encode: function(str, defaultEncoder, charset) { if (0 === str.length) return str; var string = "string" == typeof str ? str : String(str); if ("iso-8859-1" === charset) return escape(string).replace(/%u[0-9a-f]{4}/gi, (function($0) { return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; })); for (var out = "", i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); 45 === c || 46 === c || 95 === c || 126 === c || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 ? out += string.charAt(i) : c < 128 ? out += hexTable[c] : c < 2048 ? out += hexTable[192 | c >> 6] + hexTable[128 | 63 & c] : c < 55296 || c >= 57344 ? out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | 63 & c] : (i += 1, c = 65536 + ((1023 & c) << 10 | 1023 & string.charCodeAt(i)), out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | 63 & c]); } return out; }, isBuffer: function(obj) { return !(!obj || "object" != typeof obj || !(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj))); }, isRegExp: function(obj) { return "[object RegExp]" === Object.prototype.toString.call(obj); }, merge: function merge(target, source, options) { if (!source) return target; if ("object" != typeof source) { if (isArray(target)) target.push(source); else { if (!target || "object" != typeof target) return [ target, source ]; (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) && (target[source] = !0); } return target; } if (!target || "object" != typeof target) return [ target ].concat(source); var mergeTarget = target; return isArray(target) && !isArray(source) && (mergeTarget = arrayToObject(target, options)), isArray(target) && isArray(source) ? (source.forEach((function(item, i) { if (has.call(target, i)) { var targetItem = target[i]; targetItem && "object" == typeof targetItem && item && "object" == typeof item ? target[i] = merge(targetItem, item, options) : target.push(item); } else target[i] = item; })), target) : Object.keys(source).reduce((function(acc, key) { var value = source[key]; return has.call(acc, key) ? acc[key] = merge(acc[key], value, options) : acc[key] = value, acc; }), mergeTarget); } }; }, function(module, exports, __webpack_require__) { "use strict"; var replace = String.prototype.replace, percentTwenties = /%20/g; module.exports = { default: "RFC3986", formatters: { RFC1738: function(value) { return replace.call(value, percentTwenties, "+"); }, RFC3986: function(value) { return value; } }, RFC1738: "RFC1738", RFC3986: "RFC3986" }; }, function(module, exports, __webpack_require__) { "use strict"; function flattenFrom(array) { return flattenDown(array, []); } function flattenFromDepth(array, depth) { if ("number" != typeof depth) throw new TypeError("Expected the depth to be a number"); return flattenDownDepth(array, [], depth); } function flattenDown(array, result) { for (var i = 0; i < array.length; i++) { var value = array[i]; Array.isArray(value) ? flattenDown(value, result) : result.push(value); } return result; } function flattenDownDepth(array, result, depth) { depth--; for (var i = 0; i < array.length; i++) { var value = array[i]; depth > -1 && Array.isArray(value) ? flattenDownDepth(value, result, depth) : result.push(value); } return result; } module.exports = function(array) { if (!Array.isArray(array)) throw new TypeError("Expected value to be an array"); return flattenFrom(array); }, module.exports.from = flattenFrom, module.exports.depth = function(array, depth) { if (!Array.isArray(array)) throw new TypeError("Expected value to be an array"); return flattenFromDepth(array, depth); }, module.exports.fromDepth = flattenFromDepth; }, function(module, exports, __webpack_require__) { "use strict"; var pathRegexp = __webpack_require__(178), debug = __webpack_require__(9)("router:layer"), hasOwnProperty = Object.prototype.hasOwnProperty; function Layer(path, options, fn) { if (!(this instanceof Layer)) return new Layer(path, options, fn); debug("new %o", path); var opts = options || {}; this.handle = fn, this.name = fn.name || "", this.params = void 0, this.path = void 0, this.regexp = pathRegexp(path, this.keys = [], opts), this.regexp.fast_star = "*" === path, this.regexp.fast_slash = "/" === path && !1 === opts.end; } function decode_param(val) { if ("string" != typeof val || 0 === val.length) return val; try { return decodeURIComponent(val); } catch (err) { throw err instanceof URIError && (err.message = "Failed to decode param '" + val + "'", err.status = 400), err; } } module.exports = Layer, Layer.prototype.handle_error = function(error, req, res, next) { var fn = this.handle; if (4 !== fn.length) return next(error); try { fn(error, req, res, next); } catch (err) { next(err); } }, Layer.prototype.handle_request = function(req, res, next) { var fn = this.handle; if (fn.length > 3) return next(); try { fn(req, res, next); } catch (err) { next(err); } }, Layer.prototype.match = function(path) { var match; if (null != path) { if (this.regexp.fast_slash) return this.params = {}, this.path = "", !0; if (this.regexp.fast_star) return this.params = { 0: decode_param(path) }, this.path = path, !0; match = this.regexp.exec(path); } if (!match) return this.params = void 0, this.path = void 0, !1; this.params = {}, this.path = match[0]; for (var keys = this.keys, params = this.params, i = 1; i < match.length; i++) { var prop = keys[i - 1].name, val = decode_param(match[i]); void 0 === val && hasOwnProperty.call(params, prop) || (params[prop] = val); } return !0; }; }, function(module, exports) { module.exports = function wrappy(fn, cb) { if (fn && cb) return wrappy(fn)(cb); if ("function" != typeof fn) throw new TypeError("need wrapper function"); return Object.keys(fn).forEach((function(k) { wrapper[k] = fn[k]; })), wrapper; function wrapper() { for (var args = new Array(arguments.length), i = 0; i < args.length; i++) args[i] = arguments[i]; var ret = fn.apply(this, args), cb = args[args.length - 1]; return "function" == typeof ret && ret !== cb && Object.keys(cb).forEach((function(k) { ret[k] = cb[k]; })), ret; } }; }, function(module, exports, __webpack_require__) { module.exports = DHT; var bencode = __webpack_require__(181), Buffer = __webpack_require__(26).Buffer, debug = __webpack_require__(9)("bittorrent-dht"), equals = __webpack_require__(123), EventEmitter = __webpack_require__(4).EventEmitter, inherits = __webpack_require__(8), KBucket = __webpack_require__(618), krpc = __webpack_require__(619), LRU = __webpack_require__(623), randombytes = __webpack_require__(124), simpleSha1 = __webpack_require__(182); function DHT(opts) { if (!(this instanceof DHT)) return new DHT(opts); opts || (opts = {}); var self = this; this._tables = LRU({ maxAge: 3e5, max: opts.maxTables || 1e3 }), this._values = LRU(opts.maxValues || 1e3), this._peers = new PeerStore(opts.maxPeers || 1e4), this._secrets = null, this._hash = opts.hash || sha1, this._hashLength = this._hash(Buffer.from("")).length, this._rpc = opts.krpc || krpc(Object.assign({ idLength: this._hashLength }, opts)), this._rpc.on("query", (function(query, peer) { self._onquery(query, peer); })), this._rpc.on("node", (function(node) { self.emit("node", node); })), this._rpc.on("warning", (function(err) { self.emit("warning", err); })), this._rpc.on("error", (function(err) { self.emit("error", err); })), this._rpc.on("listening", (function() { self.listening = !0, self._debug("listening %d", self.address().port), self.emit("listening"); })), this._rotateSecrets(), this._verify = opts.verify || null, this._host = opts.host || null, this._interval = setInterval((function() { self._rotateSecrets(); }), 3e5), this._runningBucketCheck = !1, this._bucketCheckTimeout = null, this._bucketOutdatedTimeSpan = opts.timeBucketOutdated || 9e5, this.listening = !1, this.destroyed = !1, this.nodeId = this._rpc.id, this.nodes = this._rpc.nodes, this.nodes.on("ping", (function(nodes, contact) { self._debug("received ping", nodes, contact), self._checkAndRemoveNodes(nodes, (function(_, removed) { removed && (self._debug("added new node:", contact), self.addNode(contact)), self._debug("no node added, all other nodes ok"); })); })), process.nextTick((function() { self.destroyed || self._bootstrap(!1 !== opts.bootstrap); })), EventEmitter.call(this), this._debug("new DHT %s", this.nodeId); } function noop() {} function sha1(buf) { return Buffer.from(simpleSha1.sync(buf), "hex"); } function createGetResponse(id, token, value) { var r = { id: id, token: token, v: value.v }; return value.sig && (r.sig = value.sig, r.k = value.k, value.salt && (r.salt = value.salt), "number" == typeof value.seq && (r.seq = value.seq)), r; } function parseIp(buf, offset) { return buf[offset++] + "." + buf[offset++] + "." + buf[offset++] + "." + buf[offset++]; } function encodeSigData(msg) { var ref = { seq: msg.seq || 0, v: msg.v }; return msg.salt && (ref.salt = msg.salt), bencode.encode(ref).slice(1, -1); } function toNode(node) { return { host: node.host, port: node.port }; } function PeerStore(max) { this.max = max || 1e4, this.used = 0, this.peers = LRU(1 / 0); } function swap(list, a, b) { if (a !== b) { var tmp = list[a]; list[a] = list[b], list[b] = tmp, list[a].index = a, list[b].index = b; } } function toBuffer(str) { if (Buffer.isBuffer(str)) return str; if ("string" == typeof str) return Buffer.from(str, "hex"); throw new Error("Pass a buffer or a string"); } inherits(DHT, EventEmitter), DHT.prototype._setBucketCheckInterval = function() { var self = this; function checkBucket() { if (Date.now() - self._rpc.nodes.metadata.lastChange < self._bucketOutdatedTimeSpan) return queueNext(); self._pingAll((function() { self.destroyed || (self.nodes.toArray().length < 1 && self._bootstrap(!0), queueNext()); })); } function queueNext() { if (self._runningBucketCheck && !self.destroyed) { var nextTimeout = Math.floor(6e4 * Math.random() + 3e4); self._bucketCheckTimeout = setTimeout(checkBucket, nextTimeout); } } this._runningBucketCheck = !0, queueNext(); }, DHT.prototype._pingAll = function(cb) { this._checkAndRemoveNodes(this.nodes.toArray(), cb); }, DHT.prototype.removeBucketCheckInterval = function() { this._runningBucketCheck = !1, clearTimeout(this._bucketCheckTimeout); }, DHT.prototype.updateBucketTimestamp = function() { this._rpc.nodes.metadata.lastChange = Date.now(); }, DHT.prototype._checkAndRemoveNodes = function(nodes, cb) { var self = this; this._checkNodes(nodes, (function(_, node) { node && self.removeNode(node.id), cb(null, node); })); }, DHT.prototype._checkNodes = function(nodes, cb) { var self = this; !(function test(acc) { if (!acc.length) return cb(null); var current = acc.pop(); self._sendPing(current, (function(err) { if (!err) return self.updateBucketTimestamp(), test(acc); self._sendPing(current, (function(er) { return err ? cb(null, current) : (self.updateBucketTimestamp(), test(acc)); })); })); })(nodes); }, DHT.prototype.addNode = function(node) { var self = this; if (node.id) { node.id = toBuffer(node.id); var old = !!this._rpc.nodes.get(node.id); return this._rpc.nodes.add(node), void (old || (this.emit("node", node), this.updateBucketTimestamp())); } this._sendPing(node, (function(_, node) { node && self.addNode(node); })); }, DHT.prototype.removeNode = function(id) { this._rpc.nodes.remove(toBuffer(id)); }, DHT.prototype._sendPing = function(node, cb) { var self = this, expectedId = node.id; this._rpc.query(node, { q: "ping" }, (function(err, pong, node) { return err ? cb(err) : pong.r && pong.r.id && Buffer.isBuffer(pong.r.id) && pong.r.id.length === self._hashLength ? Buffer.isBuffer(expectedId) && !expectedId.equals(pong.r.id) ? cb(new Error("Unexpected node id")) : (self.updateBucketTimestamp(), void cb(null, { id: pong.r.id, host: node.host || node.address, port: node.port })) : cb(new Error("Bad reply")); })); }, DHT.prototype.toJSON = function() { var self = this, values = {}; return Object.keys(this._values.cache).forEach((function(key) { var value = self._values.cache[key].value; values[key] = { v: value.v.toString("hex"), id: value.id.toString("hex") }, null != value.seq && (values[key].seq = value.seq), null != value.sig && (values[key].sig = value.sig.toString("hex")), null != value.k && (values[key].k = value.k.toString("hex")); })), { nodes: this._rpc.nodes.toArray().map(toNode), values: values }; }, DHT.prototype.put = function(opts, cb) { (Buffer.isBuffer(opts) || "string" == typeof opts) && (opts = { v: opts }); var isMutable = !!opts.k; if (void 0 === opts.v) throw new Error("opts.v not given"); if (opts.v.length >= 1e3) throw new Error("v must be less than 1000 bytes in put()"); if (isMutable && void 0 !== opts.cas && "number" != typeof opts.cas) throw new Error("opts.cas must be an integer if provided"); if (isMutable && !opts.k) throw new Error("opts.k ed25519 public key required for mutable put"); if (isMutable && 32 !== opts.k.length) throw new Error("opts.k ed25519 public key must be 32 bytes"); if (isMutable && "function" != typeof opts.sign && !Buffer.isBuffer(opts.sig)) throw new Error("opts.sign function or options.sig signature is required for mutable put"); if (isMutable && opts.salt && opts.salt.length > 64) throw new Error("opts.salt is > 64 bytes long"); if (isMutable && void 0 === opts.seq) throw new Error("opts.seq not provided for a mutable update"); if (isMutable && "number" != typeof opts.seq) throw new Error("opts.seq not an integer"); return this._put(opts, cb); }, DHT.prototype._put = function(opts, cb) { cb || (cb = noop); var isMutable = !!opts.k, v = "string" == typeof opts.v ? Buffer.from(opts.v) : opts.v, key = isMutable ? this._hash(opts.salt ? Buffer.concat([ opts.k, opts.salt ]) : opts.k) : this._hash(bencode.encode(v)), table = this._tables.get(key.toString("hex")); if (!table) return this._preput(key, opts, cb); var message = { q: "put", a: { id: this._rpc.id, token: null, v: v } }; return isMutable && ("number" == typeof opts.cas && (message.a.cas = opts.cas), opts.salt && (message.a.salt = opts.salt), message.a.k = opts.k, message.a.seq = opts.seq, "function" == typeof opts.sign ? message.a.sig = opts.sign(encodeSigData(message.a)) : Buffer.isBuffer(opts.sig) && (message.a.sig = opts.sig)), this._values.set(key.toString("hex"), message.a), this._rpc.queryAll(table.closest(key), message, null, (function(err, n) { if (err) return cb(err, key, n); cb(null, key, n); })), key; }, DHT.prototype._preput = function(key, opts, cb) { var self = this; return this._closest(key, { q: "get", a: { id: this._rpc.id, target: key } }, null, (function(err, n) { if (err) return cb(err); self.put(opts, cb); })), key; }, DHT.prototype.get = function(key, opts, cb) { key = toBuffer(key), "function" == typeof opts && (cb = opts, opts = null), opts || (opts = {}); var verify = opts.verify || this._verify, hash = this._hash, value = this._values.get(key.toString("hex")) || null; if (value) return value = createGetResponse(this._rpc.id, null, value), process.nextTick(done); function done(err) { if (err) return cb(err); cb(null, value); } this._closest(key, { q: "get", a: { id: this._rpc.id, target: key } }, (function(message) { var r = message.r; if (!r || !r.v) return !0; if (r.k || r.sig) { if (!verify || !r.sig || !r.k) return !0; if (!verify(r.sig, encodeSigData(r), r.k)) return !0; if (equals(hash(r.salt ? Buffer.concat([ r.k, r.salt ]) : r.k), key)) return value = r, !1; } else if (equals(hash(bencode.encode(r.v)), key)) return value = r, !1; return !0; }), done); }, DHT.prototype.announce = function(infoHash, port, cb) { if ("function" == typeof port) return this.announce(infoHash, 0, port); infoHash = toBuffer(infoHash), cb || (cb = noop); var table = this._tables.get(infoHash.toString("hex")); if (!table) return this._preannounce(infoHash, port, cb); if (this._host) { var dhtPort = this.listening ? this.address().port : 0; this._addPeer({ host: this._host, port: port || dhtPort }, infoHash, { host: this._host, port: dhtPort }); } var message = { q: "announce_peer", a: { id: this._rpc.id, token: null, info_hash: infoHash, port: port, implied_port: port ? 0 : 1 } }; this._debug("announce %s %d", infoHash, port), this._rpc.queryAll(table.closest(infoHash), message, null, cb); }, DHT.prototype._preannounce = function(infoHash, port, cb) { var self = this; this.lookup(infoHash, (function(err) { return self.destroyed ? cb(new Error("dht is destroyed")) : err ? cb(err) : void self.announce(infoHash, port, cb); })); }, DHT.prototype.lookup = function(infoHash, cb) { infoHash = toBuffer(infoHash), cb || (cb = noop); var self = this, aborted = !1; function emit(values, from) { values || (values = self._peers.get(infoHash.toString("hex"))); for (var peers = (function(buf) { var peers = []; try { for (var i = 0; i < buf.length; i++) { var port = buf[i].readUInt16BE(4); port && peers.push({ host: parseIp(buf[i], 0), port: port }); } } catch (err) {} return peers; })(values), i = 0; i < peers.length; i++) self.emit("peer", peers[i], infoHash, from || null); } return this._debug("lookup %s", infoHash), process.nextTick(emit), this._closest(infoHash, { q: "get_peers", a: { id: this._rpc.id, info_hash: infoHash } }, (function(message, node) { if (aborted) return !1; message.r.values && emit(message.r.values, node); }), cb), function() { aborted = !0; }; }, DHT.prototype.address = function() { return this._rpc.address(); }, DHT.prototype.listen = function() { this._rpc.bind.apply(this._rpc, arguments), this.updateBucketTimestamp(), this._setBucketCheckInterval(); }, DHT.prototype.destroy = function(cb) { if (this.destroyed) cb && process.nextTick(cb); else { this.destroyed = !0; var self = this; clearInterval(this._interval), this.removeBucketCheckInterval(), this._debug("destroying"), this._rpc.destroy((function() { self.emit("close"), cb && cb(); })); } }, DHT.prototype._onquery = function(query, peer) { var q = query.q.toString(); if (this._debug("received %s query from %s:%d", q, peer.address, peer.port), query.a) switch (q) { case "ping": return this._rpc.response(peer, query, { id: this._rpc.id }); case "find_node": return this._onfindnode(query, peer); case "get_peers": return this._ongetpeers(query, peer); case "announce_peer": return this._onannouncepeer(query, peer); case "get": return this._onget(query, peer); case "put": return this._onput(query, peer); } }, DHT.prototype._onfindnode = function(query, peer) { var target = query.a.target; if (!target) return this._rpc.error(peer, query, [ 203, "`find_node` missing required `a.target` field" ]); this.emit("find_node", target); var nodes = this._rpc.nodes.closest(target); this._rpc.response(peer, query, { id: this._rpc.id }, nodes); }, DHT.prototype._ongetpeers = function(query, peer) { var host = peer.address || peer.host, infoHash = query.a.info_hash; if (!infoHash) return this._rpc.error(peer, query, [ 203, "`get_peers` missing required `a.info_hash` field" ]); this.emit("get_peers", infoHash); var r = { id: this._rpc.id, token: this._generateToken(host) }, peers = this._peers.get(infoHash.toString("hex")); peers.length ? (r.values = peers, this._rpc.response(peer, query, r)) : this._rpc.response(peer, query, r, this._rpc.nodes.closest(infoHash)); }, DHT.prototype._onannouncepeer = function(query, peer) { var host = peer.address || peer.host, port = query.a.implied_port ? peer.port : query.a.port; if (!(!port || "number" != typeof port || port <= 0 || port > 65535)) { var infoHash = query.a.info_hash, token = query.a.token; if (infoHash && token) { if (!this._validateToken(host, token)) return this._rpc.error(peer, query, [ 203, "cannot `announce_peer` with bad token" ]); this.emit("announce_peer", infoHash, { host: host, port: peer.port }), this._addPeer({ host: host, port: port }, infoHash, { host: host, port: peer.port }), this._rpc.response(peer, query, { id: this._rpc.id }); } } }, DHT.prototype._addPeer = function(peer, infoHash, from) { this._peers.add(infoHash.toString("hex"), (function(host, port) { for (var buf = Buffer.allocUnsafe(6), ip = host.split("."), i = 0; i < 4; i++) buf[i] = parseInt(ip[i] || 0, 10); return buf.writeUInt16BE(port, 4), buf; })(peer.host, peer.port)), this.emit("announce", peer, infoHash, from); }, DHT.prototype._onget = function(query, peer) { var host = peer.address || peer.host, target = query.a.target; if (target) { var token = this._generateToken(host), value = this._values.get(target.toString("hex")); if (this.emit("get", target, value), value) this._rpc.response(peer, query, createGetResponse(this._rpc.id, token, value)); else { var nodes = this._rpc.nodes.closest(target); this._rpc.response(peer, query, { id: this._rpc.id, token: token }, nodes); } } }, DHT.prototype._onput = function(query, peer) { var host = peer.address || peer.host, a = query.a; if (a) { var v = query.a.v; if (v) { var id = query.a.id; if (id) { var token = a.token; if (token) { if (!this._validateToken(host, token)) return this._rpc.error(peer, query, [ 203, "cannot `put` with bad token" ]); if (v.length > 1e3) return this._rpc.error(peer, query, [ 205, "data payload too large" ]); var isMutable = !(!a.k && !a.sig); if (!isMutable || a.k || a.sig) { var key = isMutable ? this._hash(a.salt ? Buffer.concat([ a.k, a.salt ]) : a.k) : this._hash(bencode.encode(v)), keyHex = key.toString("hex"); if (this.emit("put", key, v), isMutable) { if (!this._verify) return this._rpc.error(peer, query, [ 400, "verification not supported" ]); if (!this._verify(a.sig, encodeSigData(a), a.k)) return; var prev = this._values.get(keyHex); if (prev && "number" == typeof a.cas && prev.seq !== a.cas) return this._rpc.error(peer, query, [ 301, "CAS mismatch, re-read and try again" ]); if (prev && "number" == typeof prev.seq && !(a.seq > prev.seq)) return this._rpc.error(peer, query, [ 302, "sequence number less than current" ]); this._values.set(keyHex, { v: v, k: a.k, salt: a.salt, sig: a.sig, seq: a.seq, id: id }); } else this._values.set(keyHex, { v: v, id: id }); this._rpc.response(peer, query, { id: this._rpc.id }); } } } } } }, DHT.prototype._bootstrap = function(populate) { var self = this; if (!populate) return process.nextTick(ready); function ready() { self.ready || (self._debug("emit ready"), self.ready = !0, self.emit("ready")); } this._rpc.populate(self._rpc.id, { q: "find_node", a: { id: self._rpc.id, target: self._rpc.id } }, ready); }, DHT.prototype._closest = function(target, message, onmessage, cb) { var self = this, table = new KBucket({ localNodeId: target, numberOfNodesPerKBucket: this._rpc.k }); this._rpc.closest(target, message, (function(message, node) { return !message.r || (message.r.token && message.r.id && Buffer.isBuffer(message.r.id) && message.r.id.length === self._hashLength && (self._debug("found node %s (target: %s)", message.r.id, target), table.add({ id: message.r.id, host: node.host || node.address, port: node.port, token: message.r.token })), !onmessage || onmessage(message, node)); }), (function(err, n) { if (err) return cb(err); self._tables.set(target.toString("hex"), table), self._debug("visited %d nodes", n), cb(null, n); })); }, DHT.prototype._debug = function() { if (debug.enabled) { var args = [].slice.call(arguments); args[0] = "[" + this.nodeId.toString("hex").substring(0, 7) + "] " + args[0]; for (var i = 1; i < args.length; i++) Buffer.isBuffer(args[i]) && (args[i] = args[i].toString("hex")); debug.apply(null, args); } }, DHT.prototype._validateToken = function(host, token) { var tokenA = this._generateToken(host, this._secrets[0]), tokenB = this._generateToken(host, this._secrets[1]); return equals(token, tokenA) || equals(token, tokenB); }, DHT.prototype._generateToken = function(host, secret) { return secret || (secret = this._secrets[0]), this._hash(Buffer.concat([ Buffer.from(host), secret ])); }, DHT.prototype._rotateSecrets = function() { this._secrets ? (this._secrets[1] = this._secrets[0], this._secrets[0] = randombytes(this._hashLength)) : this._secrets = [ randombytes(this._hashLength), randombytes(this._hashLength) ]; }, PeerStore.prototype.add = function(key, peer) { var peers = this.peers.get(key); peers || (peers = { values: [], map: LRU(1 / 0) }, this.peers.set(key, peers)); var id = peer.toString("hex"); if (!peers.map.get(id)) { var node = { index: peers.values.length, peer: peer }; peers.map.set(id, node), peers.values.push(node), ++this.used > this.max && this._evict(); } }, PeerStore.prototype._evict = function() { var a = this.peers.peek(this.peers.tail), b = a.map.remove(a.map.tail), values = a.values; swap(values, b.index, values.length - 1), values.pop(), this.used--, values.length || this.peers.remove(this.peers.tail); }, PeerStore.prototype.get = function(key) { var node = this.peers.get(key); return node ? (function(values, n) { for (var len = Math.min(values.length, 100), ptr = 0, res = new Array(len), i = 0; i < len; i++) { var next = ptr + Math.random() * (values.length - ptr) | 0; res[ptr] = values[next].peer, swap(values, ptr++, next); } return res; })(node.values) : []; }; }, function(module, exports, __webpack_require__) { module.exports = { encode: __webpack_require__(632), decode: __webpack_require__(633) }; }, function(module, exports, __webpack_require__) { var ipaddr = __webpack_require__(183), compact2string = function(buf) { switch (buf.length) { case 6: return buf[0] + "." + buf[1] + "." + buf[2] + "." + buf[3] + ":" + buf.readUInt16BE(4); case 18: for (var hexGroups = [], i = 0; i < 8; i++) hexGroups.push(buf.readUInt16BE(2 * i).toString(16)); return "[" + ipaddr.parse(hexGroups.join(":")).toString() + "]:" + buf.readUInt16BE(16); default: throw new Error("Invalid Compact IP/PORT, It should contain 6 or 18 bytes"); } }; compact2string.multi = function(buf) { if (buf.length % 6 != 0) throw new Error("buf length isn't multiple of compact IP/PORTs (6 bytes)"); for (var output = [], i = 0; i <= buf.length - 1; i += 6) output.push(compact2string(buf.slice(i, i + 6))); return output; }, compact2string.multi6 = function(buf) { if (buf.length % 18 != 0) throw new Error("buf length isn't multiple of compact IP6/PORTs (18 bytes)"); for (var output = [], i = 0; i <= buf.length - 1; i += 18) output.push(compact2string(buf.slice(i, i + 18))); return output; }, module.exports = compact2string; }, function(module, exports) { module.exports = function(stream, cb) { var chunks = []; stream.on("data", (function(chunk) { chunks.push(chunk); })), stream.once("end", (function() { cb && cb(null, Buffer.concat(chunks)), cb = null; })), stream.once("error", (function(err) { cb && cb(err), cb = null; })); }; }, function(module, exports, __webpack_require__) { "use strict"; const PassThrough = __webpack_require__(3).PassThrough, zlib = __webpack_require__(43), mimicResponse = __webpack_require__(636); module.exports = response => { if (-1 === [ "gzip", "deflate" ].indexOf(response.headers["content-encoding"])) return response; const unzip = zlib.createUnzip(), stream = new PassThrough; return mimicResponse(response, stream), unzip.on("error", (err => { "Z_BUF_ERROR" !== err.code ? stream.emit("error", err) : stream.end(); })), response.pipe(unzip).pipe(stream), stream; }; }, function(module, exports, __webpack_require__) { "use strict"; var WS = module.exports = __webpack_require__(295); WS.Server = __webpack_require__(652), WS.Sender = __webpack_require__(297), WS.Receiver = __webpack_require__(300), WS.createServer = function(options, fn) { var server = new WS.Server(options); return "function" == typeof fn && server.on("connection", fn), server; }, WS.connect = WS.createConnection = function(address, fn) { var client = new WS(address); return "function" == typeof fn && client.on("open", fn), client; }; }, function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(7), util = __webpack_require__(0), http = __webpack_require__(11), https = __webpack_require__(21), crypto = __webpack_require__(6), stream = __webpack_require__(3), Ultron = __webpack_require__(643), Options = __webpack_require__(296), Sender = __webpack_require__(297), Receiver = __webpack_require__(300), SenderHixie = __webpack_require__(650), ReceiverHixie = __webpack_require__(651), Extensions = __webpack_require__(301), PerMessageDeflate = __webpack_require__(126), EventEmitter = __webpack_require__(4).EventEmitter; function WebSocket(address, protocols, options) { if (this instanceof WebSocket == 0) return new WebSocket(address, protocols, options); EventEmitter.call(this), protocols && !Array.isArray(protocols) && "object" == typeof protocols && (options = protocols, protocols = null), "string" == typeof protocols && (protocols = [ protocols ]), Array.isArray(protocols) || (protocols = []), this._socket = null, this._ultron = null, this._closeReceived = !1, this.bytesReceived = 0, this.readyState = null, this.supports = {}, this.extensions = {}, this._binaryType = "nodebuffer", Array.isArray(address) ? initAsServerClient.apply(this, address.concat(options)) : initAsClient.apply(this, [ address, protocols, options ]); } function MessageEvent(dataArg, isBinary, target) { this.type = "message", this.data = dataArg, this.target = target, this.binary = isBinary; } function CloseEvent(code, reason, target) { this.type = "close", this.wasClean = void 0 === code || 1e3 === code, this.code = code, this.reason = reason, this.target = target; } function OpenEvent(target) { this.type = "open", this.target = target; } function buildHostHeader(isSecure, hostname, port) { var headerHost = hostname; return hostname && (isSecure && 443 != port || !isSecure && 80 != port) && (headerHost = headerHost + ":" + port), headerHost; } function initAsServerClient(req, socket, upgradeHead, options) { options = new Options({ protocolVersion: 13, protocol: null, extensions: {}, maxPayload: 0 }).merge(options), this.protocol = options.value.protocol, this.protocolVersion = options.value.protocolVersion, this.extensions = options.value.extensions, this.supports.binary = "hixie-76" !== this.protocolVersion, this.upgradeReq = req, this.readyState = WebSocket.CONNECTING, this._isServer = !0, this.maxPayload = options.value.maxPayload, "hixie-76" === options.value.protocolVersion ? establishConnection.call(this, ReceiverHixie, SenderHixie, socket, upgradeHead) : establishConnection.call(this, Receiver, Sender, socket, upgradeHead); } function initAsClient(address, protocols, options) { if (8 !== (options = new Options({ origin: null, protocolVersion: 13, host: null, headers: null, protocol: protocols.join(","), agent: null, pfx: null, key: null, passphrase: null, cert: null, ca: null, ciphers: null, rejectUnauthorized: null, perMessageDeflate: !0, localAddress: null }).merge(options)).value.protocolVersion && 13 !== options.value.protocolVersion) throw new Error("unsupported protocol version"); var serverUrl = url.parse(address), isUnixSocket = "ws+unix:" === serverUrl.protocol; if (!serverUrl.host && !isUnixSocket) throw new Error("invalid url"); var perMessageDeflate, isSecure = "wss:" === serverUrl.protocol || "https:" === serverUrl.protocol, httpObj = isSecure ? https : http, port = serverUrl.port || (isSecure ? 443 : 80), auth = serverUrl.auth, extensionsOffer = {}; options.value.perMessageDeflate && (perMessageDeflate = new PerMessageDeflate(!0 !== typeof options.value.perMessageDeflate ? options.value.perMessageDeflate : {}, !1), extensionsOffer[PerMessageDeflate.extensionName] = perMessageDeflate.offer()), this._isServer = !1, this.url = address, this.protocolVersion = options.value.protocolVersion, this.supports.binary = "hixie-76" !== this.protocolVersion; var key = new Buffer(options.value.protocolVersion + "-" + Date.now()).toString("base64"), shasum = crypto.createHash("sha1"); shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); var expectedServerKey = shasum.digest("base64"), agent = options.value.agent, headerHost = buildHostHeader(isSecure, serverUrl.hostname, port), requestOptions = { port: port, host: serverUrl.hostname, headers: { Connection: "Upgrade", Upgrade: "websocket", Host: headerHost, "Sec-WebSocket-Version": options.value.protocolVersion, "Sec-WebSocket-Key": key } }; if (auth && (requestOptions.headers.Authorization = "Basic " + new Buffer(auth).toString("base64")), options.value.protocol && (requestOptions.headers["Sec-WebSocket-Protocol"] = options.value.protocol), options.value.host && (requestOptions.headers.Host = options.value.host), options.value.headers) for (var header in options.value.headers) options.value.headers.hasOwnProperty(header) && (requestOptions.headers[header] = options.value.headers[header]); Object.keys(extensionsOffer).length && (requestOptions.headers["Sec-WebSocket-Extensions"] = Extensions.format(extensionsOffer)), (options.isDefinedAndNonNull("pfx") || options.isDefinedAndNonNull("key") || options.isDefinedAndNonNull("passphrase") || options.isDefinedAndNonNull("cert") || options.isDefinedAndNonNull("ca") || options.isDefinedAndNonNull("ciphers") || options.isDefinedAndNonNull("rejectUnauthorized")) && (options.isDefinedAndNonNull("pfx") && (requestOptions.pfx = options.value.pfx), options.isDefinedAndNonNull("key") && (requestOptions.key = options.value.key), options.isDefinedAndNonNull("passphrase") && (requestOptions.passphrase = options.value.passphrase), options.isDefinedAndNonNull("cert") && (requestOptions.cert = options.value.cert), options.isDefinedAndNonNull("ca") && (requestOptions.ca = options.value.ca), options.isDefinedAndNonNull("ciphers") && (requestOptions.ciphers = options.value.ciphers), options.isDefinedAndNonNull("rejectUnauthorized") && (requestOptions.rejectUnauthorized = options.value.rejectUnauthorized), agent || (agent = new httpObj.Agent(requestOptions))), requestOptions.path = serverUrl.path || "/", agent && (requestOptions.agent = agent), isUnixSocket && (requestOptions.socketPath = serverUrl.pathname), options.value.localAddress && (requestOptions.localAddress = options.value.localAddress), options.value.origin && (options.value.protocolVersion < 13 ? requestOptions.headers["Sec-WebSocket-Origin"] = options.value.origin : requestOptions.headers.Origin = options.value.origin); var self = this, req = httpObj.request(requestOptions); req.on("error", (function(error) { self.emit("error", error), cleanupWebsocketResources.call(self, error); })), req.once("response", (function(res) { var error; self.emit("unexpected-response", req, res) || (error = new Error("unexpected server response (" + res.statusCode + ")"), req.abort(), self.emit("error", error)), cleanupWebsocketResources.call(self, error); })), req.once("upgrade", (function(res, socket, upgradeHead) { if (self.readyState === WebSocket.CLOSED) return self.emit("close"), self.removeAllListeners(), void socket.end(); var serverKey = res.headers["sec-websocket-accept"]; if (void 0 === serverKey || serverKey !== expectedServerKey) return self.emit("error", "invalid server key"), self.removeAllListeners(), void socket.end(); var serverProt = res.headers["sec-websocket-protocol"], protList = (options.value.protocol || "").split(/, */), protError = null; if (!options.value.protocol && serverProt ? protError = "server sent a subprotocol even though none requested" : options.value.protocol && !serverProt ? protError = "server sent no subprotocol even though requested" : serverProt && -1 === protList.indexOf(serverProt) && (protError = "server responded with an invalid protocol"), protError) return self.emit("error", protError), self.removeAllListeners(), void socket.end(); serverProt && (self.protocol = serverProt); var serverExtensions = Extensions.parse(res.headers["sec-websocket-extensions"]); if (perMessageDeflate && serverExtensions[PerMessageDeflate.extensionName]) { try { perMessageDeflate.accept(serverExtensions[PerMessageDeflate.extensionName]); } catch (err) { return self.emit("error", "invalid extension parameter"), self.removeAllListeners(), void socket.end(); } self.extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } establishConnection.call(self, Receiver, Sender, socket, upgradeHead), req.removeAllListeners(), req = null, agent = null; })), req.end(), this.readyState = WebSocket.CONNECTING; } function establishConnection(ReceiverClass, SenderClass, socket, upgradeHead) { var ultron = this._ultron = new Ultron(socket), called = !1, self = this; function firstHandler(data) { called || self.readyState === WebSocket.CLOSED || (called = !0, socket.removeListener("data", firstHandler), ultron.on("data", realHandler), upgradeHead && upgradeHead.length > 0 && (realHandler(upgradeHead), upgradeHead = null), data && realHandler(data)); } function realHandler(data) { self.bytesReceived += data.length, self._receiver.add(data); } socket.setTimeout(0), socket.setNoDelay(!0), this._receiver = new ReceiverClass(this.extensions, this.maxPayload), this._socket = socket, ultron.on("end", cleanupWebsocketResources.bind(this)), ultron.on("close", cleanupWebsocketResources.bind(this)), ultron.on("error", cleanupWebsocketResources.bind(this)), ultron.on("data", firstHandler), process.nextTick(firstHandler), self._receiver.ontext = function(data, flags) { flags = flags || {}, self.emit("message", data, flags); }, self._receiver.onbinary = function(data, flags) { (flags = flags || {}).binary = !0, self.emit("message", data, flags); }, self._receiver.onping = function(data, flags) { flags = flags || {}, self.pong(data, { mask: !self._isServer, binary: !0 === flags.binary }, !0), self.emit("ping", data, flags); }, self._receiver.onpong = function(data, flags) { self.emit("pong", data, flags || {}); }, self._receiver.onclose = function(code, data, flags) { flags = flags || {}, self._closeReceived = !0, self.close(code, data); }, self._receiver.onerror = function(reason, errorCode) { self.close(void 0 !== errorCode ? errorCode : 1002, ""), self.emit("error", reason instanceof Error ? reason : new Error(reason)); }, this._sender = new SenderClass(socket, this.extensions), this._sender.on("error", (function(error) { self.close(1002, ""), self.emit("error", error); })), this.readyState = WebSocket.OPEN, this.emit("open"); } function startQueue(instance) { instance._queue = instance._queue || []; } function executeQueueSends(instance) { var queue = instance._queue; if (void 0 !== queue) { delete instance._queue; for (var i = 0, l = queue.length; i < l; ++i) queue[i](); } } function cleanupWebsocketResources(error) { if (this.readyState !== WebSocket.CLOSED) { if (this.readyState = WebSocket.CLOSED, clearTimeout(this._closeTimer), this._closeTimer = null, !error && this._closeReceived || (this._closeCode = 1006), this.emit("close", this._closeCode || 1e3, this._closeMessage || ""), this._socket) { this._ultron && this._ultron.destroy(), this._socket.on("error", (function() { try { this.destroy(); } catch (e) {} })); try { error ? this._socket.destroy() : this._socket.end(); } catch (e) {} this._socket = null, this._ultron = null; } this._sender && (this._sender.removeAllListeners(), this._sender = null), this._receiver && (this._receiver.cleanup(), this._receiver = null), this.extensions[PerMessageDeflate.extensionName] && this.extensions[PerMessageDeflate.extensionName].cleanup(), this.extensions = null, this.removeAllListeners(), this.on("error", (function() {})), delete this._queue; } } util.inherits(WebSocket, EventEmitter), [ "CONNECTING", "OPEN", "CLOSING", "CLOSED" ].forEach((function(state, index) { WebSocket.prototype[state] = WebSocket[state] = index; })), WebSocket.prototype.close = function(code, data) { if (this.readyState !== WebSocket.CLOSED) if (this.readyState !== WebSocket.CONNECTING) if (this.readyState !== WebSocket.CLOSING) { var self = this; try { this.readyState = WebSocket.CLOSING, this._closeCode = code, this._closeMessage = data; var mask = !this._isServer; this._sender.close(code, data, mask, (function(err) { err && self.emit("error", err), self._closeReceived && self._isServer ? self.terminate() : (clearTimeout(self._closeTimer), self._closeTimer = setTimeout(cleanupWebsocketResources.bind(self, !0), 3e4)); })); } catch (e) { this.emit("error", e); } } else this._closeReceived && this._isServer && this.terminate(); else this.readyState = WebSocket.CLOSED; }, WebSocket.prototype.pause = function() { if (this.readyState !== WebSocket.OPEN) throw new Error("not opened"); return this._socket.pause(); }, WebSocket.prototype.ping = function(data, options, dontFailWhenClosed) { if (this.readyState !== WebSocket.OPEN) { if (!0 === dontFailWhenClosed) return; throw new Error("not opened"); } void 0 === (options = options || {}).mask && (options.mask = !this._isServer), this._sender.ping(data, options); }, WebSocket.prototype.pong = function(data, options, dontFailWhenClosed) { if (this.readyState !== WebSocket.OPEN) { if (!0 === dontFailWhenClosed) return; throw new Error("not opened"); } void 0 === (options = options || {}).mask && (options.mask = !this._isServer), this._sender.pong(data, options); }, WebSocket.prototype.resume = function() { if (this.readyState !== WebSocket.OPEN) throw new Error("not opened"); return this._socket.resume(); }, WebSocket.prototype.send = function(data, options, cb) { if ("function" == typeof options && (cb = options, options = {}), this.readyState === WebSocket.OPEN) if (data || (data = ""), this._queue) { var self = this; this._queue.push((function() { self.send(data, options, cb); })); } else { (options = options || {}).fin = !0, void 0 === options.binary && (options.binary = data instanceof ArrayBuffer || data instanceof Buffer || data instanceof Uint8Array || data instanceof Uint16Array || data instanceof Uint32Array || data instanceof Int8Array || data instanceof Int16Array || data instanceof Int32Array || data instanceof Float32Array || data instanceof Float64Array), void 0 === options.mask && (options.mask = !this._isServer), void 0 === options.compress && (options.compress = !0), this.extensions[PerMessageDeflate.extensionName] || (options.compress = !1); var readable = "function" == typeof stream.Readable ? stream.Readable : stream.Stream; data instanceof readable ? (startQueue(this), self = this, (function(instance, stream, options, cb) { stream.on("data", (function(data) { instance.readyState === WebSocket.OPEN ? (options.fin = !1, instance._sender.send(data, options)) : cb(new Error("not opened")); })), stream.on("end", (function() { instance.readyState === WebSocket.OPEN ? (options.fin = !0, instance._sender.send(null, options), cb(null)) : cb(new Error("not opened")); })); })(this, data, options, (function(error) { process.nextTick((function() { executeQueueSends(self); })), "function" == typeof cb && cb(error); }))) : this._sender.send(data, options, cb); } else { if ("function" != typeof cb) throw new Error("not opened"); cb(new Error("not opened")); } }, WebSocket.prototype.stream = function(options, cb) { "function" == typeof options && (cb = options, options = {}); var self = this; if ("function" != typeof cb) throw new Error("callback must be provided"); if (this.readyState === WebSocket.OPEN) this._queue ? this._queue.push((function() { self.stream(options, cb); })) : (void 0 === (options = options || {}).mask && (options.mask = !this._isServer), void 0 === options.compress && (options.compress = !0), this.extensions[PerMessageDeflate.extensionName] || (options.compress = !1), startQueue(this), process.nextTick(cb.bind(null, null, (function send(data, final) { try { if (self.readyState !== WebSocket.OPEN) throw new Error("not opened"); options.fin = !0 === final, self._sender.send(data, options), final ? executeQueueSends(self) : process.nextTick(cb.bind(null, null, send)); } catch (e) { "function" == typeof cb ? cb(e) : (delete self._queue, self.emit("error", e)); } })))); else { if ("function" != typeof cb) throw new Error("not opened"); cb(new Error("not opened")); } }, WebSocket.prototype.terminate = function() { if (this.readyState !== WebSocket.CLOSED) if (this._socket) { this.readyState = WebSocket.CLOSING; try { this._socket.end(); } catch (e) { return void cleanupWebsocketResources.call(this, !0); } this._closeTimer && clearTimeout(this._closeTimer), this._closeTimer = setTimeout(cleanupWebsocketResources.bind(this, !0), 3e4); } else this.readyState === WebSocket.CONNECTING && cleanupWebsocketResources.call(this, !0); }, Object.defineProperty(WebSocket.prototype, "bufferedAmount", { get: function() { var amount = 0; return this._socket && (amount = this._socket.bufferSize || 0), amount; } }), Object.defineProperty(WebSocket.prototype, "binaryType", { get: function() { return this._binaryType; }, set: function(type) { if ("arraybuffer" !== type && "nodebuffer" !== type) throw new SyntaxError('unsupported binaryType: must be either "nodebuffer" or "arraybuffer"'); this._binaryType = type; } }), [ "open", "error", "close", "message" ].forEach((function(method) { Object.defineProperty(WebSocket.prototype, "on" + method, { get: function() { var listener = this.listeners(method)[0]; return listener ? listener._listener ? listener._listener : listener : void 0; }, set: function(listener) { this.removeAllListeners(method), this.addEventListener(method, listener); } }); })), WebSocket.prototype.addEventListener = function(method, listener) { var target = this; function onMessage(data, flags) { flags.binary && "arraybuffer" === this.binaryType && (data = new Uint8Array(data).buffer), listener.call(target, new MessageEvent(data, !!flags.binary, target)); } function onClose(code, message) { listener.call(target, new CloseEvent(code, message, target)); } function onError(event) { event.type = "error", event.target = target, listener.call(target, event); } function onOpen() { listener.call(target, new OpenEvent(target)); } "function" == typeof listener && ("message" === method ? (onMessage._listener = listener, this.on(method, onMessage)) : "close" === method ? (onClose._listener = listener, this.on(method, onClose)) : "error" === method ? (onError._listener = listener, this.on(method, onError)) : "open" === method ? (onOpen._listener = listener, this.on(method, onOpen)) : this.on(method, listener)); }, module.exports = WebSocket, module.exports.buildHostHeader = buildHostHeader; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2); module.exports = function(defaults) { var internalValues = {}, values = this.value = {}; Object.keys(defaults).forEach((function(key) { internalValues[key] = defaults[key], Object.defineProperty(values, key, { get: function() { return internalValues[key]; }, configurable: !1, enumerable: !0 }); })), this.reset = function() { return Object.keys(defaults).forEach((function(key) { internalValues[key] = defaults[key]; })), this; }, this.merge = function(options, required) { if (options = options || {}, "[object Array]" === Object.prototype.toString.call(required)) { for (var missing = [], i = 0, l = required.length; i < l; ++i) { var key = required[i]; key in options || missing.push(key); } if (missing.length > 0) throw missing.length > 1 ? new Error("options " + missing.slice(0, missing.length - 1).join(", ") + " and " + missing[missing.length - 1] + " must be defined") : new Error("option " + missing[0] + " must be defined"); } return Object.keys(options).forEach((function(key) { key in internalValues && (internalValues[key] = options[key]); })), this; }, this.copy = function(keys) { var obj = {}; return Object.keys(defaults).forEach((function(key) { -1 !== keys.indexOf(key) && (obj[key] = values[key]); })), obj; }, this.read = function(filename, cb) { if ("function" == typeof cb) { var self = this; fs.readFile(filename, (function(error, data) { if (error) return cb(error); var conf = JSON.parse(data); self.merge(conf), cb(); })); } else { var conf = JSON.parse(fs.readFileSync(filename)); this.merge(conf); } return this; }, this.isDefined = function(key) { return void 0 !== values[key]; }, this.isDefinedAndNonNull = function(key) { return null != values[key]; }, Object.freeze(values), Object.freeze(this); }; }, function(module, exports, __webpack_require__) { var events = __webpack_require__(4), util = __webpack_require__(0), crypto = __webpack_require__(6), ErrorCodes = (events.EventEmitter, __webpack_require__(298)), bufferUtil = __webpack_require__(299), PerMessageDeflate = __webpack_require__(126); function Sender(socket, extensions) { if (this instanceof Sender == 0) throw new TypeError("Classes can't be function-called"); events.EventEmitter.call(this), this._socket = socket, this.extensions = extensions || {}, this.firstFragment = !0, this.compress = !1, this.messageHandlers = [], this.processing = !1; } function writeUInt16BE(value, offset) { this[offset] = (65280 & value) >> 8, this[offset + 1] = 255 & value; } function writeUInt32BE(value, offset) { this[offset] = (4278190080 & value) >> 24, this[offset + 1] = (16711680 & value) >> 16, this[offset + 2] = (65280 & value) >> 8, this[offset + 3] = 255 & value; } function getArrayBuffer(data) { for (var array = new Uint8Array(data.buffer || data), l = data.byteLength || data.length, o = data.byteOffset || 0, buffer = new Buffer(l), i = 0; i < l; ++i) buffer[i] = array[o + i]; return buffer; } util.inherits(Sender, events.EventEmitter), Sender.prototype.close = function(code, data, mask, cb) { if (void 0 !== code && ("number" != typeof code || !ErrorCodes.isValidErrorCode(code))) throw new Error("first argument must be a valid error code number"); code = code || 1e3; var dataBuffer = new Buffer(2 + (data ? Buffer.byteLength(data) : 0)); writeUInt16BE.call(dataBuffer, code, 0), dataBuffer.length > 2 && dataBuffer.write(data, 2); var self = this; this.messageHandlers.push((function() { self.frameAndSend(8, dataBuffer, !0, mask), "function" == typeof cb && cb(); })), this.flush(); }, Sender.prototype.ping = function(data, options) { var mask = options && options.mask, self = this; this.messageHandlers.push((function() { self.frameAndSend(9, data || "", !0, mask); })), this.flush(); }, Sender.prototype.pong = function(data, options) { var mask = options && options.mask, self = this; this.messageHandlers.push((function() { self.frameAndSend(10, data || "", !0, mask); })), this.flush(); }, Sender.prototype.send = function(data, options, cb) { var finalFragment = !options || !1 !== options.fin, mask = options && options.mask, compress = options && options.compress, opcode = options && options.binary ? 2 : 1; !1 === this.firstFragment ? (opcode = 0, compress = !1) : (this.firstFragment = !1, this.compress = compress), finalFragment && (this.firstFragment = !0); var compressFragment = this.compress, self = this; this.messageHandlers.push((function() { data && compressFragment ? (self.processing = !0, self.applyExtensions(data, finalFragment, compressFragment, (function(err, data) { err ? "function" == typeof cb ? cb(err) : self.emit("error", err) : (self.frameAndSend(opcode, data, finalFragment, mask, compress, cb), self.processing = !1, self.flush()); }))) : self.frameAndSend(opcode, data, finalFragment, mask, compress, cb); })), this.flush(); }, Sender.prototype.frameAndSend = function(opcode, data, finalFragment, maskData, compressed, cb) { var canModifyData = !1; if (data) { Buffer.isBuffer(data) || (canModifyData = !0, !data || void 0 === data.byteLength && void 0 === data.buffer ? ("number" == typeof data && (data = data.toString()), data = new Buffer(data)) : data = getArrayBuffer(data)); var dataLength = data.length, dataOffset = maskData ? 6 : 2, secondByte = dataLength; dataLength >= 65536 ? (dataOffset += 8, secondByte = 127) : dataLength > 125 && (dataOffset += 2, secondByte = 126); var mergeBuffers = dataLength < 32768 || maskData && !canModifyData, outputBuffer = new Buffer(mergeBuffers ? dataLength + dataOffset : dataOffset); switch (outputBuffer[0] = finalFragment ? 128 | opcode : opcode, compressed && (outputBuffer[0] |= 64), secondByte) { case 126: writeUInt16BE.call(outputBuffer, dataLength, 2); break; case 127: writeUInt32BE.call(outputBuffer, 0, 2), writeUInt32BE.call(outputBuffer, dataLength, 6); } if (maskData) { outputBuffer[1] = 128 | secondByte; var mask = crypto.randomBytes(4); if (outputBuffer[dataOffset - 4] = mask[0], outputBuffer[dataOffset - 3] = mask[1], outputBuffer[dataOffset - 2] = mask[2], outputBuffer[dataOffset - 1] = mask[3], mergeBuffers) { bufferUtil.mask(data, mask, outputBuffer, dataOffset, dataLength); try { this._socket.write(outputBuffer, "binary", cb); } catch (e) { "function" == typeof cb ? cb(e) : this.emit("error", e); } } else { bufferUtil.mask(data, mask, data, 0, dataLength); try { this._socket.write(outputBuffer, "binary"), this._socket.write(data, "binary", cb); } catch (e) { "function" == typeof cb ? cb(e) : this.emit("error", e); } } } else if (outputBuffer[1] = secondByte, mergeBuffers) { data.copy(outputBuffer, dataOffset); try { this._socket.write(outputBuffer, "binary", cb); } catch (e) { "function" == typeof cb ? cb(e) : this.emit("error", e); } } else try { this._socket.write(outputBuffer, "binary"), this._socket.write(data, "binary", cb); } catch (e) { "function" == typeof cb ? cb(e) : this.emit("error", e); } } else try { this._socket.write(new Buffer([ opcode | (finalFragment ? 128 : 0), 0 | (maskData ? 128 : 0) ].concat(maskData ? [ 0, 0, 0, 0 ] : [])), "binary", cb); } catch (e) { "function" == typeof cb ? cb(e) : this.emit("error", e); } }, Sender.prototype.flush = function() { for (;!this.processing && this.messageHandlers.length; ) this.messageHandlers.shift()(); }, Sender.prototype.applyExtensions = function(data, fin, compress, callback) { (data.buffer || data) instanceof ArrayBuffer && (data = getArrayBuffer(data)), this.extensions[PerMessageDeflate.extensionName].compress(data, fin, callback); }, module.exports = Sender; }, function(module, exports) { module.exports = { isValidErrorCode: function(code) { return code >= 1e3 && code <= 1011 && 1004 != code && 1005 != code && 1006 != code || code >= 3e3 && code <= 4999; }, 1e3: "normal", 1001: "going away", 1002: "protocol error", 1003: "unsupported data", 1004: "reserved", 1005: "reserved for extensions", 1006: "reserved for extensions", 1007: "inconsistent or invalid data", 1008: "policy violation", 1009: "message too big", 1010: "extension handshake missing", 1011: "an unexpected condition prevented the request from being fulfilled" }; }, function(module, exports, __webpack_require__) { "use strict"; var bufferUtil; try { bufferUtil = __webpack_require__(644); } catch (e) { bufferUtil = __webpack_require__(645); } module.exports = bufferUtil.BufferUtil || bufferUtil; }, function(module, exports, __webpack_require__) { __webpack_require__(0); var isValidUTF8 = __webpack_require__(646), ErrorCodes = __webpack_require__(298), BufferPool = __webpack_require__(649), bufferUtil = __webpack_require__(299), PerMessageDeflate = __webpack_require__(126); function Receiver(extensions, maxPayload) { if (this instanceof Receiver == 0) throw new TypeError("Classes can't be function-called"); "number" == typeof extensions && (maxPayload = extensions, extensions = {}); var fragmentedPoolPrevUsed = -1; this.fragmentedBufferPool = new BufferPool(1024, (function(db, length) { return db.used + length; }), (function(db) { return fragmentedPoolPrevUsed = fragmentedPoolPrevUsed >= 0 ? Math.ceil((fragmentedPoolPrevUsed + db.used) / 2) : db.used; })); var unfragmentedPoolPrevUsed = -1; this.unfragmentedBufferPool = new BufferPool(1024, (function(db, length) { return db.used + length; }), (function(db) { return unfragmentedPoolPrevUsed = unfragmentedPoolPrevUsed >= 0 ? Math.ceil((unfragmentedPoolPrevUsed + db.used) / 2) : db.used; })), this.extensions = extensions || {}, this.maxPayload = maxPayload || 0, this.currentPayloadLength = 0, this.state = { activeFragmentedOperation: null, lastFragment: !1, masked: !1, opcode: 0, fragmentedOperation: !1 }, this.overflow = [], this.headerBuffer = new Buffer(10), this.expectOffset = 0, this.expectBuffer = null, this.expectHandler = null, this.currentMessage = [], this.currentMessageLength = 0, this.messageHandlers = [], this.expectHeader(2, this.processPacket), this.dead = !1, this.processing = !1, this.onerror = function() {}, this.ontext = function() {}, this.onbinary = function() {}, this.onclose = function() {}, this.onping = function() {}, this.onpong = function() {}; } function readUInt16BE(start) { return (this[start] << 8) + this[start + 1]; } function readUInt32BE(start) { return (this[start] << 24) + (this[start + 1] << 16) + (this[start + 2] << 8) + this[start + 3]; } function fastCopy(length, srcBuffer, dstBuffer, dstOffset) { switch (length) { default: srcBuffer.copy(dstBuffer, dstOffset, 0, length); break; case 16: dstBuffer[dstOffset + 15] = srcBuffer[15]; case 15: dstBuffer[dstOffset + 14] = srcBuffer[14]; case 14: dstBuffer[dstOffset + 13] = srcBuffer[13]; case 13: dstBuffer[dstOffset + 12] = srcBuffer[12]; case 12: dstBuffer[dstOffset + 11] = srcBuffer[11]; case 11: dstBuffer[dstOffset + 10] = srcBuffer[10]; case 10: dstBuffer[dstOffset + 9] = srcBuffer[9]; case 9: dstBuffer[dstOffset + 8] = srcBuffer[8]; case 8: dstBuffer[dstOffset + 7] = srcBuffer[7]; case 7: dstBuffer[dstOffset + 6] = srcBuffer[6]; case 6: dstBuffer[dstOffset + 5] = srcBuffer[5]; case 5: dstBuffer[dstOffset + 4] = srcBuffer[4]; case 4: dstBuffer[dstOffset + 3] = srcBuffer[3]; case 3: dstBuffer[dstOffset + 2] = srcBuffer[2]; case 2: dstBuffer[dstOffset + 1] = srcBuffer[1]; case 1: dstBuffer[dstOffset] = srcBuffer[0]; } } function clone(obj) { var cloned = {}; for (var k in obj) obj.hasOwnProperty(k) && (cloned[k] = obj[k]); return cloned; } module.exports = Receiver, Receiver.prototype.add = function(data) { if (!this.dead) { var dataLength = data.length; if (0 != dataLength) if (null != this.expectBuffer) { var toRead = Math.min(dataLength, this.expectBuffer.length - this.expectOffset); for (fastCopy(toRead, data, this.expectBuffer, this.expectOffset), this.expectOffset += toRead, toRead < dataLength && this.overflow.push(data.slice(toRead)); this.expectBuffer && this.expectOffset == this.expectBuffer.length; ) { var bufferForHandler = this.expectBuffer; this.expectBuffer = null, this.expectOffset = 0, this.expectHandler.call(this, bufferForHandler); } } else this.overflow.push(data); } }, Receiver.prototype.cleanup = function() { this.dead = !0, this.overflow = null, this.headerBuffer = null, this.expectBuffer = null, this.expectHandler = null, this.unfragmentedBufferPool = null, this.fragmentedBufferPool = null, this.state = null, this.currentMessage = null, this.onerror = null, this.ontext = null, this.onbinary = null, this.onclose = null, this.onping = null, this.onpong = null; }, Receiver.prototype.expectHeader = function(length, handler) { if (0 != length) { this.expectBuffer = this.headerBuffer.slice(this.expectOffset, this.expectOffset + length), this.expectHandler = handler; for (var toRead = length; toRead > 0 && this.overflow.length > 0; ) { var fromOverflow = this.overflow.pop(); toRead < fromOverflow.length && this.overflow.push(fromOverflow.slice(toRead)); var read = Math.min(fromOverflow.length, toRead); fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset), this.expectOffset += read, toRead -= read; } } else handler(null); }, Receiver.prototype.expectData = function(length, handler) { if (0 != length) { this.expectBuffer = this.allocateFromPool(length, this.state.fragmentedOperation), this.expectHandler = handler; for (var toRead = length; toRead > 0 && this.overflow.length > 0; ) { var fromOverflow = this.overflow.pop(); toRead < fromOverflow.length && this.overflow.push(fromOverflow.slice(toRead)); var read = Math.min(fromOverflow.length, toRead); fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset), this.expectOffset += read, toRead -= read; } } else handler(null); }, Receiver.prototype.allocateFromPool = function(length, isFragmented) { return (isFragmented ? this.fragmentedBufferPool : this.unfragmentedBufferPool).get(length); }, Receiver.prototype.processPacket = function(data) { if (this.extensions[PerMessageDeflate.extensionName]) { if (0 != (48 & data[0])) return void this.error("reserved fields (2, 3) must be empty", 1002); } else if (0 != (112 & data[0])) return void this.error("reserved fields must be empty", 1002); this.state.lastFragment = 128 == (128 & data[0]), this.state.masked = 128 == (128 & data[1]); var compressed = 64 == (64 & data[0]), opcode = 15 & data[0]; if (0 === opcode) { if (compressed) return void this.error("continuation frame cannot have the Per-message Compressed bits", 1002); if (this.state.fragmentedOperation = !0, this.state.opcode = this.state.activeFragmentedOperation, 1 != this.state.opcode && 2 != this.state.opcode) return void this.error("continuation frame cannot follow current opcode", 1002); } else { if (opcode < 3 && null != this.state.activeFragmentedOperation) return void this.error("data frames after the initial data frame must have opcode 0", 1002); if (opcode >= 8 && compressed) return void this.error("control frames cannot have the Per-message Compressed bits", 1002); this.state.compressed = compressed, this.state.opcode = opcode, !1 === this.state.lastFragment ? (this.state.fragmentedOperation = !0, this.state.activeFragmentedOperation = opcode) : this.state.fragmentedOperation = !1; } var handler = opcodes[this.state.opcode]; void 0 === handler ? this.error("no handler for opcode " + this.state.opcode, 1002) : handler.start.call(this, data); }, Receiver.prototype.endPacket = function() { this.dead || (this.state.fragmentedOperation ? this.state.lastFragment && this.fragmentedBufferPool.reset(!0) : this.unfragmentedBufferPool.reset(!0), this.expectOffset = 0, this.expectBuffer = null, this.expectHandler = null, this.state.lastFragment && this.state.opcode === this.state.activeFragmentedOperation && (this.state.activeFragmentedOperation = null), this.currentPayloadLength = 0, this.state.lastFragment = !1, this.state.opcode = null != this.state.activeFragmentedOperation ? this.state.activeFragmentedOperation : 0, this.state.masked = !1, this.expectHeader(2, this.processPacket)); }, Receiver.prototype.reset = function() { this.dead || (this.state = { activeFragmentedOperation: null, lastFragment: !1, masked: !1, opcode: 0, fragmentedOperation: !1 }, this.fragmentedBufferPool.reset(!0), this.unfragmentedBufferPool.reset(!0), this.expectOffset = 0, this.expectBuffer = null, this.expectHandler = null, this.overflow = [], this.currentMessage = [], this.currentMessageLength = 0, this.messageHandlers = [], this.currentPayloadLength = 0); }, Receiver.prototype.unmask = function(mask, buf, binary) { return null != mask && null != buf && bufferUtil.unmask(buf, mask), binary ? buf : null != buf ? buf.toString("utf8") : ""; }, Receiver.prototype.error = function(reason, protocolErrorCode) { if (!this.dead) return this.reset(), "string" == typeof reason ? this.onerror(new Error(reason), protocolErrorCode) : reason.constructor == Error ? this.onerror(reason, protocolErrorCode) : this.onerror(new Error("An error occured"), protocolErrorCode), this; }, Receiver.prototype.flush = function() { if (!this.processing && !this.dead) { var handler = this.messageHandlers.shift(); if (handler) { this.processing = !0; var self = this; handler((function() { self.processing = !1, self.flush(); })); } } }, Receiver.prototype.applyExtensions = function(messageBuffer, fin, compressed, callback) { var self = this; compressed ? this.extensions[PerMessageDeflate.extensionName].decompress(messageBuffer, fin, (function(err, buffer) { self.dead || (err ? callback(new Error("invalid compressed data")) : callback(null, buffer)); })) : callback(null, messageBuffer); }, Receiver.prototype.maxPayloadExceeded = function(length) { if (void 0 === this.maxPayload || null === this.maxPayload || this.maxPayload < 1) return !1; var fullLength = this.currentPayloadLength + length; return fullLength < this.maxPayload ? (this.currentPayloadLength = fullLength, !1) : (this.error("payload cannot exceed " + this.maxPayload + " bytes", 1009), this.messageBuffer = [], this.cleanup(), !0); }; var opcodes = { 1: { start: function(data) { var self = this, firstLength = 127 & data[1]; if (firstLength < 126) { if (self.maxPayloadExceeded(firstLength)) return void self.error("Maximumpayload exceeded in compressed text message. Aborting...", 1009); opcodes[1].getData.call(self, firstLength); } else 126 == firstLength ? self.expectHeader(2, (function(data) { var length = readUInt16BE.call(data, 0); self.maxPayloadExceeded(length) ? self.error("Maximumpayload exceeded in compressed text message. Aborting...", 1009) : opcodes[1].getData.call(self, length); })) : 127 == firstLength && self.expectHeader(8, (function(data) { if (0 == readUInt32BE.call(data, 0)) { var length = readUInt32BE.call(data, 4); self.maxPayloadExceeded(length) ? self.error("Maximumpayload exceeded in compressed text message. Aborting...", 1009) : opcodes[1].getData.call(self, readUInt32BE.call(data, 4)); } else self.error("packets with length spanning more than 32 bit is currently not supported", 1008); })); }, getData: function(length) { var self = this; self.state.masked ? self.expectHeader(4, (function(data) { var mask = data; self.expectData(length, (function(data) { opcodes[1].finish.call(self, mask, data); })); })) : self.expectData(length, (function(data) { opcodes[1].finish.call(self, null, data); })); }, finish: function(mask, data) { var self = this, packet = this.unmask(mask, data, !0) || new Buffer(0), state = clone(this.state); this.messageHandlers.push((function(callback) { self.applyExtensions(packet, state.lastFragment, state.compressed, (function(err, buffer) { if (err) return 1009 === err.type ? self.error("Maximumpayload exceeded in compressed text message. Aborting...", 1009) : self.error(err.message, 1007); if (null != buffer) { if (!(0 == self.maxPayload || self.maxPayload > 0 && self.currentMessageLength + buffer.length < self.maxPayload)) return self.currentMessage = null, self.currentMessage = [], self.currentMessageLength = 0, void self.error(new Error("Maximum payload exceeded. maxPayload: " + self.maxPayload), 1009); self.currentMessage.push(buffer), self.currentMessageLength += buffer.length; } if (state.lastFragment) { var messageBuffer = Buffer.concat(self.currentMessage); if (self.currentMessage = [], self.currentMessageLength = 0, !isValidUTF8(messageBuffer)) return void self.error("invalid utf8 sequence", 1007); self.ontext(messageBuffer.toString("utf8"), { masked: state.masked, buffer: messageBuffer }); } callback(); })); })), this.flush(), this.endPacket(); } }, 2: { start: function(data) { var self = this, firstLength = 127 & data[1]; if (firstLength < 126) { if (self.maxPayloadExceeded(firstLength)) return void self.error("Max payload exceeded in compressed text message. Aborting...", 1009); opcodes[2].getData.call(self, firstLength); } else 126 == firstLength ? self.expectHeader(2, (function(data) { var length = readUInt16BE.call(data, 0); self.maxPayloadExceeded(length) ? self.error("Max payload exceeded in compressed text message. Aborting...", 1009) : opcodes[2].getData.call(self, length); })) : 127 == firstLength && self.expectHeader(8, (function(data) { if (0 == readUInt32BE.call(data, 0)) { var length = readUInt32BE.call(data, 4, !0); self.maxPayloadExceeded(length) ? self.error("Max payload exceeded in compressed text message. Aborting...", 1009) : opcodes[2].getData.call(self, length); } else self.error("packets with length spanning more than 32 bit is currently not supported", 1008); })); }, getData: function(length) { var self = this; self.state.masked ? self.expectHeader(4, (function(data) { var mask = data; self.expectData(length, (function(data) { opcodes[2].finish.call(self, mask, data); })); })) : self.expectData(length, (function(data) { opcodes[2].finish.call(self, null, data); })); }, finish: function(mask, data) { var self = this, packet = this.unmask(mask, data, !0) || new Buffer(0), state = clone(this.state); this.messageHandlers.push((function(callback) { self.applyExtensions(packet, state.lastFragment, state.compressed, (function(err, buffer) { if (err) return 1009 === err.type ? self.error("Max payload exceeded in compressed binary message. Aborting...", 1009) : self.error(err.message, 1007); if (null != buffer) { if (!(0 == self.maxPayload || self.maxPayload > 0 && self.currentMessageLength + buffer.length < self.maxPayload)) return self.currentMessage = null, self.currentMessage = [], self.currentMessageLength = 0, void self.error(new Error("Maximum payload exceeded"), 1009); self.currentMessage.push(buffer), self.currentMessageLength += buffer.length; } if (state.lastFragment) { var messageBuffer = Buffer.concat(self.currentMessage); self.currentMessage = [], self.currentMessageLength = 0, self.onbinary(messageBuffer, { masked: state.masked, buffer: messageBuffer }); } callback(); })); })), this.flush(), this.endPacket(); } }, 8: { start: function(data) { if (0 != this.state.lastFragment) { var firstLength = 127 & data[1]; firstLength < 126 ? opcodes[8].getData.call(this, firstLength) : this.error("control frames cannot have more than 125 bytes of data", 1002); } else this.error("fragmented close is not supported", 1002); }, getData: function(length) { var self = this; self.state.masked ? self.expectHeader(4, (function(data) { var mask = data; self.expectData(length, (function(data) { opcodes[8].finish.call(self, mask, data); })); })) : self.expectData(length, (function(data) { opcodes[8].finish.call(self, null, data); })); }, finish: function(mask, data) { var self = this; data = self.unmask(mask, data, !0); var state = clone(this.state); this.messageHandlers.push((function() { if (data && 1 == data.length) self.error("close packets with data must be at least two bytes long", 1002); else { var code = data && data.length > 1 ? readUInt16BE.call(data, 0) : 1e3; if (ErrorCodes.isValidErrorCode(code)) { var message = ""; if (data && data.length > 2) { var messageBuffer = data.slice(2); if (!isValidUTF8(messageBuffer)) return void self.error("invalid utf8 sequence", 1007); message = messageBuffer.toString("utf8"); } self.onclose(code, message, { masked: state.masked }), self.reset(); } else self.error("invalid error code", 1002); } })), this.flush(); } }, 9: { start: function(data) { if (0 != this.state.lastFragment) { var firstLength = 127 & data[1]; firstLength < 126 ? opcodes[9].getData.call(this, firstLength) : this.error("control frames cannot have more than 125 bytes of data", 1002); } else this.error("fragmented ping is not supported", 1002); }, getData: function(length) { var self = this; self.state.masked ? self.expectHeader(4, (function(data) { var mask = data; self.expectData(length, (function(data) { opcodes[9].finish.call(self, mask, data); })); })) : self.expectData(length, (function(data) { opcodes[9].finish.call(self, null, data); })); }, finish: function(mask, data) { var self = this; data = this.unmask(mask, data, !0); var state = clone(this.state); this.messageHandlers.push((function(callback) { self.onping(data, { masked: state.masked, binary: !0 }), callback(); })), this.flush(), this.endPacket(); } }, 10: { start: function(data) { if (0 != this.state.lastFragment) { var firstLength = 127 & data[1]; firstLength < 126 ? opcodes[10].getData.call(this, firstLength) : this.error("control frames cannot have more than 125 bytes of data", 1002); } else this.error("fragmented pong is not supported", 1002); }, getData: function(length) { var self = this; this.state.masked ? this.expectHeader(4, (function(data) { var mask = data; self.expectData(length, (function(data) { opcodes[10].finish.call(self, mask, data); })); })) : this.expectData(length, (function(data) { opcodes[10].finish.call(self, null, data); })); }, finish: function(mask, data) { var self = this; data = self.unmask(mask, data, !0); var state = clone(this.state); this.messageHandlers.push((function(callback) { self.onpong(data, { masked: state.masked, binary: !0 }), callback(); })), this.flush(), this.endPacket(); } } }; }, function(module, exports, __webpack_require__) { var util = __webpack_require__(0); exports.parse = function(value) { var extensions = {}; return (value = value || "").split(",").forEach((function(v) { var params = v.split(";"), token = params.shift().trim(); if (void 0 === extensions[token]) extensions[token] = []; else if (!extensions.hasOwnProperty(token)) return; var parsedParams = {}; params.forEach((function(param) { var parts = param.trim().split("="), key = parts[0], value = parts[1]; void 0 === value ? value = !0 : ('"' === value[0] && (value = value.slice(1)), '"' === value[value.length - 1] && (value = value.slice(0, value.length - 1))), void 0 === parsedParams[key] ? parsedParams[key] = [ value ] : parsedParams.hasOwnProperty(key) && parsedParams[key].push(value); })), extensions[token].push(parsedParams); })), extensions; }, exports.format = function(value) { return Object.keys(value).map((function(token) { var paramsList = value[token]; return util.isArray(paramsList) || (paramsList = [ paramsList ]), paramsList.map((function(params) { return [ token ].concat(Object.keys(params).map((function(k) { var p = params[k]; return util.isArray(p) || (p = [ p ]), p.map((function(v) { return !0 === v ? k : k + "=" + v; })).join("; "); }))).join("; "); })).join(", "); })).join(", "); }; }, function(module, exports, __webpack_require__) { module.exports = decodeTorrentFile, module.exports.decode = decodeTorrentFile, module.exports.encode = function(parsed) { var torrent = { info: parsed.info }; return torrent["announce-list"] = (parsed.announce || []).map((function(url) { return torrent.announce || (torrent.announce = url), [ url = Buffer.from(url, "utf8") ]; })), torrent["url-list"] = parsed.urlList || [], parsed.created && (torrent["creation date"] = parsed.created.getTime() / 1e3 | 0), parsed.createdBy && (torrent["created by"] = parsed.createdBy), parsed.comment && (torrent.comment = parsed.comment), bencode.encode(torrent); }; var bencode = __webpack_require__(181), path = __webpack_require__(5), sha1 = __webpack_require__(182), uniq = __webpack_require__(125); function decodeTorrentFile(torrent) { Buffer.isBuffer(torrent) && (torrent = bencode.decode(torrent)), ensure(torrent.info, "info"), ensure(torrent.info["name.utf-8"] || torrent.info.name, "info.name"), ensure(torrent.info["piece length"], "info['piece length']"), ensure(torrent.info.pieces, "info.pieces"), torrent.info.files ? torrent.info.files.forEach((function(file) { ensure("number" == typeof file.length, "info.files[0].length"), ensure(file["path.utf-8"] || file.path, "info.files[0].path"); })) : ensure("number" == typeof torrent.info.length, "info.length"); var result = {}; result.info = torrent.info, result.infoBuffer = bencode.encode(torrent.info), result.infoHash = sha1.sync(result.infoBuffer), result.infoHashBuffer = Buffer.from(result.infoHash, "hex"), result.name = (torrent.info["name.utf-8"] || torrent.info.name).toString(), void 0 !== torrent.info.private && (result.private = !!torrent.info.private), torrent["creation date"] && (result.created = new Date(1e3 * torrent["creation date"])), torrent["created by"] && (result.createdBy = torrent["created by"].toString()), Buffer.isBuffer(torrent.comment) && (result.comment = torrent.comment.toString()), result.announce = [], torrent["announce-list"] && torrent["announce-list"].length ? torrent["announce-list"].forEach((function(urls) { urls.forEach((function(url) { result.announce.push(url.toString()); })); })) : torrent.announce && result.announce.push(torrent.announce.toString()), Buffer.isBuffer(torrent["url-list"]) && (torrent["url-list"] = torrent["url-list"].length > 0 ? [ torrent["url-list"] ] : []), result.urlList = (torrent["url-list"] || []).map((function(url) { return url.toString(); })), uniq(result.announce), uniq(result.urlList); var files = torrent.info.files || [ torrent.info ]; result.files = files.map((function(file, i) { var parts = [].concat(result.name, file["path.utf-8"] || file.path || []).map((function(p) { return p.toString(); })); return { path: path.join.apply(null, [ path.sep ].concat(parts)).slice(1), name: parts[parts.length - 1], length: file.length, offset: files.slice(0, i).reduce(sumLength, 0) }; })), result.length = files.reduce(sumLength, 0); var lastFile = result.files[result.files.length - 1]; return result.pieceLength = torrent.info["piece length"], result.lastPieceLength = (lastFile.offset + lastFile.length) % result.pieceLength || result.pieceLength, result.pieces = (function(buf) { for (var pieces = [], i = 0; i < buf.length; i += 20) pieces.push(buf.slice(i, i + 20).toString("hex")); return pieces; })(torrent.info.pieces), result; } function sumLength(sum, file) { return sum + file.length; } function ensure(bool, fieldName) { if (!bool) throw new Error("Torrent is missing required field: " + fieldName); } }, function(module, exports) { var movieKeywords = [ "1080p", "720p", "480p", "blurayrip", "brrip", "divx", "dvdrip", "hdrip", "hdtv", "tvrip", "xvid", "camrip" ], excluded = {}; movieKeywords.forEach((function(x) { excluded[x] = 1; })); var SEGMENTS_SPLIT = /\.| |-|;|_/g; module.exports = function(filePath, options) { options = options || {}; var meta = {}, segments = filePath.replace(/\\/g, "/").split("/").reverse().filter((function(x) { return x; })).slice(0, 3), firstNameSplit = segments[0].split(/\.| |_/); function saneSeason() { return meta.hasOwnProperty("season") && !isNaN(meta.season); } function saneEpisode() { return Array.isArray(meta.episode) && meta.episode.length; } [ segments[0], segments[1] ].filter((function(x) { return x; })).forEach((function(seg) { for (var matches, regex = /\b\d{4}\b/g; matches = regex.exec(seg); ) { var number = parseInt(matches[0], 10); number >= 1900 && number <= 2030 && (meta.year = number); } })); var pad = function(x) { return ("00" + x).slice(-2); }; [ segments[0], segments[1] ].filter((function(x) { return x; })).forEach((function(seg) { var aired = seg.match(/(\d\d\d\d)(\.|-| )(\d\d)(\.|-| )(\d\d)/); if (aired && aired[1]) { var year = parseInt(aired[1], 10); year >= 1900 && year <= 2030 && (meta.aired = [ year, pad(aired[3]), pad(aired[5]) ].join("-")); } })), [ segments[0], segments[1] ].forEach((function(seg) { seg && seg.split(/\.| |_/).forEach((function(x, i) { var seasonMatch = x.match(/S(\d{1,2})/i); seasonMatch && (meta.season = parseInt(seasonMatch[1], 10)); var episodeMatch = x.match(/(?<=\W|\d)E(\d{2})/gi); episodeMatch && (meta.episode = episodeMatch.map((function(y) { return parseInt(y.slice(1), 10); }))); var xStampMatch = x.match(/(\d\d?)x(\d\d?)/i); xStampMatch && (meta.season = parseInt(xStampMatch[1], 10), meta.episode = [ parseInt(xStampMatch[2], 10) ]); })); var fullMatch = seg && seg.replace(/\.| |;|_/g, " ").match(/^([a-zA-Z0-9,-?!'& ]*) S(\d{1,2})E(\d{2})/i); !meta.name && meta.season && meta.episode && fullMatch && fullMatch[1] && (meta.name = fullMatch[1]); })); var dotStampMatch = segments[0].match(/[^\da-zA-Z](\d\d?)\.(\d\d?)[^\da-zA-Z]/i); if (saneSeason() && saneEpisode() || !dotStampMatch || meta.year || (meta.season = parseInt(dotStampMatch[1], 10), meta.episode = [ parseInt(dotStampMatch[2], 10) ]), !(saneSeason() && saneEpisode() || options.strict)) { var stamp = firstNameSplit.reverse().map((function(x) { return x.match(new RegExp("\\d\\d\\d\\d?e")) && (x = x.slice(0, -1)), x.match(new RegExp("s\\d\\d\\d\\d?")) && (x = x.slice(1)), x; })).filter((function(x) { return !isNaN(x) && (3 == x.length || !meta.year && 4 == x.length); }))[0]; stamp && (!meta.year || meta.year && firstNameSplit.indexOf(stamp.toString()) < firstNameSplit.indexOf(meta.year.toString())) && (meta.episode = [ parseInt(stamp.slice(-2), 10) ], meta.season = parseInt(stamp.slice(0, -2), 10)); } if (!saneSeason()) { var seasonMatch = segments.join("/").match(/season(\.| )?(\d{1,2})/gi); seasonMatch && (meta.season = parseInt(seasonMatch[0].match(/\d/g).join(""), 10)); var seasonEpMatch = segments.join("/").match(/Season (\d{1,2}) - (\d{1,2})/i); seasonEpMatch && (meta.season = parseInt(seasonEpMatch[1], 10), meta.episode = [ parseInt(seasonEpMatch[2], 10) ]); } if (!saneEpisode()) { var episodeMatch = segments.join("/").match(/ep(isode)?(\.| )?(\d+)/gi); episodeMatch && (meta.episode = [ parseInt(episodeMatch[0].match(/\d/g).join(""), 10) ]); } var isSample, canBeMovie, diskNumberMatch = segments[0].match(/[ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck]|d)[ _.-]*(\d)[^\d]/); return diskNumberMatch && (meta.diskNumber = parseInt(diskNumberMatch[1], 10)), (options.fromInside ? segments : [].concat(segments).reverse()).forEach((function(seg, i) { if (seg == segments[0]) { var sourcePrefix = (seg = seg.split(".").slice(0, -1).join(".")).match(/^\[(.*?)\]/); sourcePrefix && (seg = seg.slice(sourcePrefix[0].length)); } var squareBracket = seg.indexOf("["); squareBracket > -1 && (seg = seg.slice(0, squareBracket)); var segSplit = seg.split(SEGMENTS_SPLIT), nameParts = []; isSample = isSample || seg.match(/^sample/i) || seg.match(/^etrg/i), meta.name || (segSplit.some((function(word, i) { if (!(word.match("^[a-zA-Z,?!'&]*$") || !isNaN(word) && word.length <= 2 || !isNaN(word) && 0 == i) || excluded[word.toLowerCase()] || [ "ep", "episode", "season" ].indexOf(word.toLowerCase()) > -1 && !isNaN(segSplit[i + 1])) return !0; nameParts.push(word); })), (1 != nameParts.length || isNaN(nameParts[0])) && (meta.name = nameParts.filter((function(x) { return x && x.length > 0; })).map((function(x) { return x[0].toUpperCase() + x.slice(1).toLowerCase(); })).join(" "))); })), isSample = isSample || "sample" == (segments[1] || "").toLowerCase(), canBeMovie = options.strict ? meta.hasOwnProperty("year") : meta.hasOwnProperty("year") || meta.hasOwnProperty("diskNumber") || movieKeywords.some((function(keyword) { return segments.join("/").toLowerCase().search(keyword) > -1; })), meta.name && meta.aired && (meta.type = "series"), meta.name && saneSeason() && saneEpisode() ? meta.type = "series" : meta.name && canBeMovie ? meta.type = "movie" : "movie" != meta.type && meta.name && saneSeason() ? meta.type = "extras" : meta.type = "other", options.fileLength && options.fileLength < 1024 * (meta.type.match(/movie/) ? 80 : 50) * 1024 && meta.type.match(/movie|series/) && !isSample && (meta.type = "other"), ("series" != meta.type || meta.aired) && (delete meta.episode, delete meta.season), "series" == meta.type && meta.year && (meta.aired = meta.aired || meta.year, delete meta.year), meta.type += isSample ? "-sample" : "", meta.name = meta.name && meta.name.toLowerCase().trim().replace(/\([^\(]+\)$/, "").replace(/&/g, "and").replace(/[^0-9a-z ]+/g, " ").split(" ").filter((function(r) { return r; })).join(" "), options.hints && options.hints.imdb_id && (meta.imdb_id = options.hints.imdb_id), meta.tag = [], filePath.match(/1080p/i) && (meta.tag.push("hd"), meta.tag.push("1080p")), filePath.match(/720p/i) && meta.tag.push("720p"), filePath.match(/480p/i) && meta.tag.push("480p"), isSample && meta.tag.push("sample"), meta; }; }, function(module, exports, __webpack_require__) { __webpack_require__(81); var paths, once = __webpack_require__(35), child = __webpack_require__(32), byline = __webpack_require__(102), retrieveKeyframes = __webpack_require__(678).get, SUPPORTED_QUALITIES = [ 320, 480, 720 ], instances = {}, videoApi = module.exports; videoApi.probeVideo = function(mri, cb) { if (!paths.ffmpeg) return cb(new Error("no ffmpeg found; call HLS.locateExecutables()")); var res = { streams: [] }, err = null, p = child.spawn(paths.ffmpeg, [ "-i", mri ]), probeTimeout = setTimeout((function() { err = { message: "cannot probe within 20000", httpCode: 504 }, ready(), p.kill("SIGKILL"); }), 2e4), ready = once((function() { clearTimeout(probeTimeout), cb(err, err ? null : res); })); process.env.FFMPEG_DEBUG && p.stderr.pipe(process.stderr); var parsing = !1; byline.createStream(p.stderr).on("data", (function(line) { if ((line = line.toString()).match("Input #0")) { parsing = !0; var containers = line.toLowerCase().split(/\s*,\s*/).slice(1, -1); containers.indexOf("mp4") >= 0 ? res.container = "mp4" : containers.indexOf("matroska") >= 0 ? res.container = "matroska" : res.container = containers[0]; } else if (parsing && " " != line[0]) parsing = !1; else if (parsing) { var durMatch = line.match(/Duration: (\d\d):(\d\d):(\d\d(\.\d\d)?)/i); durMatch && (res.duration = 60 * parseFloat(durMatch[1]) * 60 * 1e3 + 60 * parseFloat(durMatch[2]) * 1e3 + 1e3 * parseFloat(durMatch[3]), (bitrateMatch = line.match(/bitrate: (\d+)/i)) && (res.bitrate = 1e3 * parseInt(bitrateMatch[1], 10))); var streamMatch = line.match(/Stream #0:(\d\d?)(?:\((\w+)\))?/); if (streamMatch) { var streamParts = line.split(/\s*:\s*/), codecParts = streamParts[3].split(/ |,/), dimParts = streamParts[3].match(/([0-9]{3,4})x([0-9]{3,4})/), fpsMatch = line.match(/([0-9]{2})(\.)?([0-9]{2})? fps/), bitrateMatch = line.match(/([0-9]{3,4}) kb\/s/); res.streams[streamMatch[1]] = { codec_type: streamParts[2].toLowerCase(), codec_name: codecParts[0].toLowerCase(), size: dimParts ? [ parseInt(dimParts[1], 10), parseInt(dimParts[2], 10) ] : null, stream: parseInt(streamMatch[1]), default: codecParts.indexOf("(default)") >= 0, bitrate: bitrateMatch ? 1e3 * parseInt(bitrateMatch[0], 10) : null, fps: fpsMatch ? parseFloat(fpsMatch[0]) : null, lang: streamMatch[2] }; } } })).on("finish", (function() { res.duration && (err = null), process.env.FFMPEG_DEBUG && console.log(err, res), ready(); })), p.on("exit", (function(code) { 0 !== code && (err = { code: code, message: "process exited with bad code: " + code }); })), p.on("error", (function(e) { err = e; })); }, videoApi.prepare = function(task, cb) { if (!paths.ffmpeg) return cb(new Error("no ffmpeg found; call HLS.locateExecutables()")); var segmentsUniform, segmentsByFrame, src = task.from, opts = task.opts || {}; if (instances[src]) return cb(null, instances[src]); var instance = null; function doneWithVideo() { if (!instance) return cb(new Error("internal error - no video instanceo")); instance.segmentsByFrame = segmentsByFrame, instance.segmentsUniform = segmentsUniform, opts.waitForSubs ? (once(cb), setTimeout(doneWithSubs, 12e3), allSubs[opts.waitForSubs] ? doneWithSubs() : evs.once("subtitles:" + opts.waitForSubs, doneWithSubs)) : doneWithSubs(); } function doneWithSubs() { instances[src] = instance, cb(null, instances[src]); } videoApi.probeVideo(src, (function(err, res) { if (err) return cb(err); if ((instance = res).from = src, instance.videoStream = instance.streams.find((function(x) { return "video" == x.codec_type; })), !instance.videoStream) return cb({ message: "no video stream found", httpCode: 415 }); if (!instance.duration) return cb({ message: "no video stream duration", httpCode: 415 }); var qualities = SUPPORTED_QUALITIES.filter((function(x) { return x <= instance.videoStream.size[1] + 0; })); qualities.length || (qualities = [ instance.videoStream.size[1] ]), instance.qualities = qualities, segmentsUniform = []; for (var i = 0; i != Math.ceil(instance.duration / 6e3); i++) { var at = 6e3 * i; segmentsUniform.push({ at: at, duration: at + 6e3 > instance.duration ? instance.duration - at : 6e3 }); } instance.container && instance.container.match(/matroska|mp4/) ? (function(src, container, cb) { cb = once(cb); var t = setTimeout((function() { cb({ message: "retrieveKeyframes timed out", httpCode: 504 }); }), 1e4); retrieveKeyframes(src, container, (function(err, res) { clearTimeout(t), cb(err, res); })); })(src, instance.container, (function(err, keyframes) { if (err) return cb({ httpCode: 500, message: err.message || err.toString() }); keyframes && (segmentsByFrame = [], keyframes.forEach((function(frame, i) { frame.timestamp = frame.dts, keyframes[i + 1] && (keyframes[i + 1].timestamp = keyframes[i + 1].dts); var dur = (keyframes[i + 1] ? keyframes[i + 1].timestamp : instance.duration) - frame.timestamp, lastSeg = segmentsByFrame[segmentsByFrame.length - 1]; lastSeg && lastSeg.duration < 1 ? lastSeg.duration += dur : segmentsByFrame.push({ at: Math.floor(frame.timestamp), dts: frame.dts, duration: Math.floor(dur) }); }))), doneWithVideo(); })) : doneWithVideo(); })); }, videoApi.init = function(pathsParam, prepareQueueParam) { paths = pathsParam; }; }, function(module, exports, __webpack_require__) { "use strict"; var async = __webpack_require__(40), fs = __webpack_require__(2), util = __webpack_require__(0), debug = (__webpack_require__(82).crc32, __webpack_require__(44)("matroska:document")), schema = __webpack_require__(12), Element = __webpack_require__(306), tools = __webpack_require__(83), tagClasses = {}; function Document() { this.type = "D", this._name = "Document", this.tagId = 0, this._nextTagId = 1, this.ownerDocument = this, this.masterType = !0; } function removeList(list, tag) { if (!list || !list.length) return !1; var idx = list.indexOf(tag); return !(idx < 0 || (list.splice(idx, 1), 0)); } tagClasses[schema.byName.Segment] = __webpack_require__(692), tagClasses[schema.byName.Attachments] = __webpack_require__(697), tagClasses[schema.byName.AttachedFile] = __webpack_require__(698), tagClasses[schema.byName.Tags] = __webpack_require__(699), tagClasses[schema.byName.Tag] = __webpack_require__(700), tagClasses[schema.byName.Targets] = __webpack_require__(701), tagClasses[schema.byName.SimpleTag] = __webpack_require__(702), tagClasses[schema.byName.SeekHead] = __webpack_require__(703), tagClasses[schema.byName.Seek] = __webpack_require__(704), tagClasses[schema.byName.Info] = __webpack_require__(705), tagClasses[schema.byName.Tracks] = __webpack_require__(706), tagClasses[schema.byName.TrackEntry] = __webpack_require__(707), tagClasses[schema.byName.Video] = __webpack_require__(708), tagClasses[schema.byName.Audio] = __webpack_require__(709), tagClasses[schema.byName.CRC_32] = __webpack_require__(710), tagClasses[schema.byName.Cues] = __webpack_require__(711), tagClasses[schema.byName.CuePoint] = __webpack_require__(712), tagClasses[schema.byName.CueReference] = __webpack_require__(713), tagClasses[schema.byName.CueTrackPositions] = __webpack_require__(714), util.inherits(Document, Element), module.exports = Document, Document.prototype.createElement = function(ebmlID, start, length) { var tagClass = tagClasses[ebmlID]; return tagClass ? new tagClass(this, this._nextTagId++, start, length) : new Element(this, this._nextTagId++, ebmlID, start, length); }, Document.prototype._registerPosition = function(tag) { this._positions || (this._positions = []), this._positions.push(tag), this._modified && tag._markModified(); }, Document.prototype._unregisterPosition = function(tag) { return removeList(this._positions, tag); }, Document.prototype._registerCRC = function(tag) { this._crcs || (this._crcs = []), this._crcs.push(tag); }, Document.prototype._unregisterCRC = function(tag) { return removeList(this._crcs, tag); }, Document.prototype._markModified = function() { if (!this._modified) { if (this._partial) throw new Error("Can not modify a partial parsed document"); this._modified = !0, this._positions && this._positions.forEach((function(child) { child._markModified(); })); } }, Document.prototype._buildLinks = function() { if (!this._linksBuilt && (this._linksBuilt = !0, this._positions)) { var self = this; this._positions.forEach((function(child) { var offset = child.getValue(), parent1 = child.getLevel1(), targetType = child._positionTargetType; switch (targetType) { case "segment": break; case "clusterRelative": var cp = child.parent.cueClusterPosition; if (!cp) throw console.log("parent=", child.parent), new Error("Invalid cluster relative without a cueClusterPosition"); offset += cp._positionTarget ? cp._positionTarget.getContentPosition() : cp; break; default: throw new Error("Not supported ! (" + targetType + ")"); } var target = parent1.getTagByPosition(offset, !0); debug.enabled && debug("Position #" + parent1.tagId + " " + offset + "=> " + (target ? "#" + target.tagID : "null")), target && "start" === target.position ? child._positionTarget = target.target : self._partial || debug("Can not find target for offset=" + offset + " doc=" + self); })); } }, Document.prototype.write = function(stream, options, callback) { "function" == typeof options && 2 === arguments.length && (callback = options, options = null), options = options || {}; var self = this; if (this._partial) return callback(new Error("The document is not complete")); this._prepareDocument(options, (function(error) { if (error) return callback(error); self._computePositions((function(error) { if (error) return callback(error); var source = self.source; self._updateCRC32((function(error) { if (error) return callback(error); var closeStream = !1; "string" == typeof stream && (console.log("Write to file ", stream), stream = fs.createWriteStream(stream), closeStream = !0); var writeSession = { stream: stream, options: options }; self._write(writeSession, source, (function(error) { if (error) return callback(error); source.end(writeSession, (function(error) { return error ? callback(error) : closeStream ? void stream.end(callback) : callback(); })); })); })); })); })); }, Document.prototype._prepareDocument = function(options, callback) { return callback(); }, Document.prototype._write = function(output, source, callback) { async.eachSeries(this.children, (function(child, callback) { child._write(output, source, callback); }), callback); }, Document.prototype._computePositions = function(estimatedFileSize, callback) { if (!this._positions || !this._positions.length) return callback(); "function" == typeof estimatedFileSize && (callback = estimatedFileSize, estimatedFileSize = null), estimatedFileSize || (estimatedFileSize = 0, this.children.forEach((function(child) { var s = child._getSize(); estimatedFileSize += s; }))); var bits = 8 * tools.sizeUInt(estimatedFileSize), max = Math.pow(2, bits) - 1, error = !1; if (this._positions.forEach((function(child) { child.setUInt(max); var target = child._positionTarget; return target ? child.getLevel1() !== target.getLevel1() ? (console.error("Target and source have not the same Level1 target=" + target._name + "#" + target.tagId), void (error = !0)) : void 0 : (console.error("No target for tag '" + child._name + "' #" + child.tagId), void (error = !0)); })), error) return callback(error); for (var tx = 1, times = 5, changes = 1; changes && times; times--, tx++) changes = 0, this._positions.forEach((function(child) { var target = child._positionTarget, level1 = target.getLevel1(), newPosition = target.getPosition() - level1.getContentPosition(); newPosition !== child.getUInt() && (child.setUInt(newPosition), changes++); })), console.log("Position pass #" + tx + ": " + changes + " modified positions"); return callback(); }, Document.prototype._updateCRC32 = function(callback) { var crcs = this._crcs; if (!crcs || !crcs.length) return console.log("No crc to compute ", crcs), callback(); function depth(t) { for (var ret = 0; t; t = t.parent) ret++; return ret; } console.log(crcs.length + " crc to compute ..."), crcs.sort((function(t1, t2) { return depth(t2) - depth(t1); })), async.eachSeries(crcs, (function(crcTag, callback) { crcTag.parent._computeChildrenCRC(!0, null, (function(error, crc) { return error ? callback(error) : crcTag.data && crc == crcTag.getCRCValue() ? callback() : (crcTag.setCRCValue(crc), void callback()); })); }), callback); }, Document.prototype.getTagById = function(tagId) { if (isNaN(tagId)) throw new Error("Tag identifier is not supported (" + tagId + ")"); return this.deepWalk((function(child) { if (child.tagId === tagId) return child; })); }, Document.prototype.toString = function() { return "[Document source=" + this.source + "]"; }; }, function(module, exports, __webpack_require__) { "use strict"; var assert = __webpack_require__(25), async = __webpack_require__(40), crc32 = __webpack_require__(82).crc32, stream = __webpack_require__(3), util = __webpack_require__(0), fs = __webpack_require__(2), debug = __webpack_require__(44)("matroska:element"), schema = __webpack_require__(12), tools = __webpack_require__(83), MillenniumTime = Date.UTC(2001, 0, 1); function Element(doc, tagId, ebmlID, start, length) { if (!doc || "D" !== doc.type) throw new Error("Invalid document"); this.ownerDocument = doc, this.tagId = tagId; var schemaInfo = schema.byEbmlID[ebmlID]; schemaInfo || (console.error("Unknown schemaID ", ebmlID && "0x" + ebmlID.toString(16), "tagId=", tagId, "start=" + start + " length=" + length + " source=", doc.source), schemaInfo = { type: "unknown", name: "EBMLID(0x" + ebmlID.toString(16) + ")" }), this.ebmlID = ebmlID, this.schemaInfo = schemaInfo, this.type = schemaInfo.type, this._name = schemaInfo.name, isNaN(start) || (this.start = start, this.length = length || 0, this.end = this.start + this.length), "m" === this.type && (this.masterType = !0); } function addCRC(crc, value) { var old = crc.value; crc.value = void 0 === old ? crc32(value) : crc32(value, crc.value); } module.exports = Element, Element.prototype._setDataSize = function(dataSize, lengthTagSize) { this.dataSize = dataSize, this.lengthTagSize = lengthTagSize, this.length += dataSize + lengthTagSize, this.end = this.start + this.length; }, Element.prototype._setData = function(data) { this.data = data; }, Element.prototype.getFirstChildByName = function(name) { return this.eachChildByName(name, (function(child) { return child; })); }, Element.prototype.listChildrenByName = function(name) { var ls = []; return this.eachChildByName(name, (function(child) { ls.push(child); })), ls; }, Element.prototype.eachChildByName = function(name, func) { var ebmlID = tools.convertEbmlID(name); if (func || (func = function(child) { return child; }), this.children) for (var children = this.children.slice(0); children.length; ) { var child = children.shift(); if (child.ebmlID !== ebmlID) { if (child.children) { var sp = [ 0, 0 ].concat(child.children); children.splice.apply(children, sp); } } else { var ret = func(child); if (void 0 !== ret) return ret; } } }, Element.prototype.getDirectChildByName = function(name) { var ebmlID = tools.convertEbmlID(name), children = this.children; if (children && children.length) { for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.ebmlID === ebmlID) return child; } return null; } }, Element.prototype.loadData = function(callback) { return callback("Not filled yet"); }, Element.prototype.getString = function() { return this.getBuffer().toString("ascii"); }, Element.prototype.getUTF8 = function() { return this.getBuffer().toString("utf8"); }, Element.prototype.getValue = function() { switch (this.type) { case "s": return this.getString(); case "8": return this.getUTF8(); case "i": return this.getInt(); case "u": var u = this.getUInt(); return 0 !== u && 1 !== u || !this.schemaInfo || "0-1" !== this.schemaInfo.range || (u = u > 0), u; case "b": return this.data; case "f": return this.getFloat(); case "d": return this.getDate(); } throw new Error("Type not supported !"); }, Element.prototype.getBuffer = function() { if (!this.data) throw new Error("Data is not loaded ! (tagId=#" + this.tagId + ")"); return this.data; }, Element.prototype.getInt = function() { var data = this.getBuffer(), f = data.readIntBE(0, Math.min(data.length, 6)); if (data.length <= 6) return f; for (var i = 6; i < data.length; i++) f = 256 * f + data[i]; return f; }, Element.prototype.getUInt = function() { var data = this.getBuffer(), f = data.readUIntBE(0, Math.min(data.length, 6)); if (data.length <= 6) return f; for (var i = 6; i < data.length; i++) f = 256 * f + data[i]; return f; }, Element.prototype.getDataSize = function() { return this.data ? this.data.length : this.dataSize || 0; }, Element.prototype.getCRCValue = function() { var data = this.getBuffer(); if (!data || 4 != data.length || "b" !== this.type) throw new Error("Invalid data"); return tools.readCRC(data); }, Element.prototype.setFileDataSource = function(path, callback) { var self = this; fs.stat(path, (function(error, stats) { return self.data = void 0, self.type = "b", self.dataSize = stats.size, self._dataSource = { getStream: function(options, callback) { return "function" == typeof options && (callback = options, options = null), callback(null, fs.createReadStream(path, options)); }, info: path }, self._markModified(), callback(null, self); })); }, Element.prototype.setCRCValue = function(crc) { var data = tools.writeCRC(crc); this.data = data, this.type = "b", this._markModified(); }, Element.prototype.getFloat = function() { var data = this.getBuffer(); switch (data.length) { case 4: return data.readFloatBE(0); case 8: return data.readDoubleBE(0); } throw new Error("Illegal float size " + data.length + "."); }, Element.prototype.getDateNanos = function() { return this.getUInt(); }, Element.prototype.getDate = function() { var f = this.getBuffer().readUIntBE(0, 6); return new Date(MillenniumTime + 256 * f * 256 / 1e3 / 1e3); }, Element.prototype.print = function(level) { level = level || 0; var s = " " + (this.start || 0); s = s.substring(s.length - 10); var si = this.tagId + " "; if (s += "#" + si.substring(0, 5) + " ", level) for (var i = 0; i < level; i++) s += " "; s += "* " + this._name; var dataLength = this.data && this.data.length || this.dataSize || ""; try { if (this.masterType) "D" === this.type && (s += " " + this.source), void 0 === this.start || (s += " children[size=" + (this.end - this.start) + "]"); else if ("u" === this.type) s += " u[" + dataLength + "]=" + this.getUInt(); else if ("i" === this.type) s += " i[" + dataLength + "]=" + this.getInt(); else if ("s" === this.type) s += " s[" + dataLength + "]='" + this.getString() + "'"; else if ("8" === this.type) s += " 8[" + dataLength + "]='" + (dataLength && this.getUTF8()) + "'"; else if ("f" === this.type) s += " f[" + dataLength + "]=" + this.getFloat(); else if ("d" === this.type) s += " d[" + dataLength + "]=" + this.getDate(); else if ("b" === this.type) if (this.dataSize || this.data) if (s += " b[" + dataLength + "]", this.data) { if (s += "=" + this.data.slice(0, Math.min(32, this.data.length)).toString("hex"), this.ebmlID === schema.byName.SeekID) { var targetEbmlID = this.getUInt(), tid = schema.byEbmlID[targetEbmlID]; s += tid ? " => " + tid.name : " => ? "; } } else this._dataSource && (s += " {dataSource=" + this._dataSource.info + "}"); else s += " b[]"; this._positionTarget && (s += " [=>#" + this._positionTarget.tagId + "]"), this._modified && (s += " [MODIFIED]"); } catch (x) { s += " error=" + x, debug.enabled && debug("Error for node #" + this.id, x); } return s += "\n", this.children && this.children.forEach((function(child) { s += child.print(level + 1); })), s; }, Element.prototype.setString = function(newValue) { this.data = new Buffer(newValue, "ascii"), this.type = "s", this._markModified(); }, Element.prototype.setUTF8 = function(newValue) { this.data = new Buffer(newValue, "utf8"), this.type = "8", this._markModified(); }, Element.prototype.setInt = function(newValue) { var b = tools.writeInt(newValue); this.data = b, this.type = "i", this._markModified(); }, Element.prototype.setUInt = function(newValue) { var b = tools.writeUInt(newValue); this.data = b, this.type = "u", this._markModified(); }, Element.prototype.setFloat = function(newValue) { var b = new Buffer(4); b.writeFloatBE(newValue, 0), b.readFloatBE(0) !== newValue && (b = new Buffer(8)).writeDoubleBE(newValue, 0), this.type = "f", this.data = b, this._markModified(); }, Element.prototype.setDateNanos = function(newValue) { return this.setDate(newValue); }, Element.prototype.setDate = function(newValue) { var b = new Buffer(8); if (newValue.getTime) { var ms = newValue.getTime(); newValue = 3.90625 * (ms - MillenniumTime) * 3.90625; } else isNaN(newValue) || (newValue /= 65536); if ("number" != typeof newValue) throw new Error("Invalid date value '" + newValue + "'"); b.writeUIntBE(newValue, 0, 6), this.type = "d", this.data = b, this._markModified(); }, Element.prototype.setData = function(newValue) { this.data = new Buffer(newValue), this.type = "b", this._markModified(); }, Element.prototype._markModified = function() { if (!this._modified) { this._modified = { start: this.start, end: this.end }, this.start = void 0, this.end = void 0, this.length = void 0, this.lengthTagSize = void 0; var parent = this.parent; parent && parent._markModified(); } }, Element.prototype.setValue = function(newValue) { if ("string" == typeof newValue) return "s" === this.type ? void this.setString(newValue) : void this.setUTF8(newValue); if ("boolean" == typeof newValue && (newValue = newValue ? 1 : 0), "number" == typeof newValue) return Math.floor(newValue) !== newValue ? void this.setFloat(newValue) : newValue >= 0 ? void this.setUInt(newValue) : void this.setInt(newValue); if (newValue && newValue.getTime) this.setDate(newValue); else { if (!Buffer.isBuffer(newValue) && !util.isArray(newValue)) throw new Error("Unsupported type of value (" + newValue + ")"); this.setData(newValue); } }, Element.prototype.setTargetPosition = function(target) { this._positionTarget = target; }, Element.prototype.setTargetEbmlID = function(ebmlID) { ebmlID.ebmlID && (ebmlID = ebmlID.ebmlID); var data = tools.writeEbmlID(ebmlID); this.setData(data); }, Element.prototype._getSize = function() { if (!this._modified && void 0 !== this.start) return assert("number" == typeof this.end, "End of #" + this.tagId + " is not a number"), assert("number" == typeof this.start, "Start of #" + this.tagId + " is not a number"), this.end - this.start; if (!this.masterType) { var dataLength = this.getDataSize(); return assert("number" == typeof dataLength, "Data size of #" + this.tagId + " is not a number"), tools.sizeHInt(this.ebmlID) + tools.sizeVInt(dataLength) + dataLength; } var totalSize = 0; return this.children && this.children.forEach((function(child) { var s = child._getSize(); assert("number" == typeof s, "Size of #" + child.tagId + " is not a number"), totalSize += s; })), tools.sizeHInt(this.ebmlID) + tools.sizeVInt(totalSize) + totalSize; }, Element.prototype._optimizeData = function() { if (!this.data) return 0; if ("u" === this.type) { var u = this.getUInt(); return tools.sizeUInt(u) !== this.data.length ? (this.setUInt(u), 1) : 0; } if ("i" === this.type) { var i = this.getInt(); return tools.sizeInt(i) !== this.data.length ? (this.setInt(i), 1) : 0; } if ("f" === this.type) { var f = this.getFloat(); return tools.sizeFloat(f) !== this.data.length ? (this.setFloat(f), 1) : 0; } return 0; }, Element.prototype._write = function(output, source, callback) { if (this._modified || this._dataSource) { var ebmlID = this.schemaInfo._ebmlID; if (ebmlID || (ebmlID = tools.writeUInt(this.ebmlID), this.schemaInfo._ebmlID = ebmlID), source.writeHInt(output, this.ebmlID), !this.masterType) return !this.data && this._dataSource ? void source.writeTagDataSource(output, this.dataSize, this._dataSource, callback) : void source.writeTagData(output, this.data, callback); var children = this.children; if (!children) return source.writeVInt(output, 0), callback(); var totalSize = 0; children.forEach((function(child) { totalSize += child._getSize(); })), source.writeVInt(output, totalSize), async.eachSeries(children, (function(child, callback) { child._write(output, source, callback); }), callback); } else source.writeCompleteTag(output, this, callback); }, Element.prototype._childrenPosition = function(position) { var start = this.start, end = this.end, modified = this._modified; if (modified && (start = modified.start, end = modified.end), position < start || position >= end) return null; if (position === start) return { position: "start", target: this }; var children = this.children; if (children) for (var i = 0; i < children.length; i++) { var ret = children[i]._childrenPosition(position); if (ret) return ret; } return { position: "middle", target: this }; }, Element.prototype.getTagByPosition = function(position, contentOffset) { return position += contentOffset ? this.getContentPosition() : this.getPosition(), this._childrenPosition(position); }, Element.prototype.remove = function() { if (!this.parent) throw new Error("No parent !"); return this.parent.removeChild(this); }, Element.prototype.removeChild = function(child) { if (!this.children) return !1; var idx = this.children.indexOf(child); if (idx < 0) return !1; this.children.splice(idx, 1), child.parent._markModified(), child.parent = null; var doc = this.ownerDocument; return child.deepWalk((function(c) { var schemaInfo = c.schemaInfo; schemaInfo && (c._positionTargetType && (c._positionTargetType = void 0, doc._unregisterPosition(c)), schemaInfo.crc && doc._unregisterCRC(c)); })), !0; }, Element.prototype.appendChild = function(child, noUpdate) { if (!this.masterType) throw console.error(this), new Error("Element " + this._name + "/" + this.ebmlID + "/" + this.type + " is not a master type"); return this.insertBefore(child, null, noUpdate); }, Element.prototype.insertBefore = function(child, beforeChild, noUpdate) { child.parent && child.remove(), this.children || (this.children = []); var doc = this.ownerDocument; if (child.deepWalk((function(c) { var schemaInfo = c.schemaInfo; schemaInfo && (schemaInfo.position && (c._positionTargetType = schemaInfo.position, doc._registerPosition(c)), schemaInfo.crc && doc._registerCRC(c)); })), beforeChild) { var idx = this.children.indexOf(beforeChild); if (idx >= 0) return this.children.splice(idx, 0, child), child.parent = this, void (!1 !== noUpdate && this._markModified()); } this.children.push(child), child.parent = this, !1 !== noUpdate && this._markModified(); }, Element.prototype.getLevel1 = function() { for (var p = this; p; p = p.parent) if ("D" === p.parent.type) return p; }, Element.prototype.getPosition = function() { var parent = this.parent; if (!parent) return 0; var pos = parent.getContentPosition(), children = parent.children; if (children) for (var i = 0; i < children.length; i++) { var child = children[i]; if (child === this) break; pos += child._getSize(); } return pos; }, Element.prototype.getContentPosition = function() { if (!this.parent) return 0; var pos = this.getPosition() + tools.sizeHInt(this.ebmlID); if (!this.masterType) { var dataLength = this.getDataSize(); return pos + tools.sizeVInt(dataLength); } if (this.lengthTagSize) return pos + this.lengthTagSize; var totalSize = 0; return this.children && this.children.forEach((function(child) { totalSize += child._getSize(); })), pos + tools.sizeVInt(totalSize); }, Element.prototype.eachChild = function(callback) { var children = this.children; children && children.length && children.forEach(callback); }, Element.prototype.getDataStream = function(callback) { if (this.data) { var bufferStream = new stream.PassThrough; return bufferStream.end(this.data), void callback(null, bufferStream); } this._dataSource ? this._dataSource.getStream(callback) : this.ownerDocument.source.getTagDataStream(this, callback); }, Element.prototype.computeCRC = function(crc, callback) { if (addCRC(crc = crc || {}, tools.writeUInt(this.ebmlID)), this.masterType) { var c2 = this.children, csize = 0; return c2 && c2.forEach((function(c3) { csize += c3._getSize(); })), addCRC(crc, tools.writeVInt(csize)), c2 ? void setImmediate(this._computeChildrenCRC.bind(this, !1, crc, callback)) : callback(null, crc.value); } if (this.data) return addCRC(crc, tools.writeVInt(this.data.length)), addCRC(crc, this.data), callback(null, crc.value); addCRC(crc, tools.writeVInt(this.dataSize)), this.getDataStream((function(error, stream) { if (error) return callback(error); !(function(stream, crc, callback) { stream.on("readable", (function() { var buffer = stream.read(); if (!buffer) return callback(null); addCRC(crc, buffer); })); })(stream, crc, (function(error) { if (error) return callback(error); callback(null, crc.value); })); })); }, Element.prototype.moveChildBefore = function(child, beforeChild) { var children = this.children; if (!children) throw new Error("This tag has no children " + this); var idx = children.indexOf(child); if (idx < 0) throw new Error("Can not find the child '" + child + "' parent=" + this); var bidx = 0; if (beforeChild) { if ((bidx = children.indexOf(beforeChild)) < 0) throw new Error("Can not find the before child '" + beforeChild + "' parent=" + this); } else { if (idx === children.length - 1) return; bidx = children.length; } return children.splice(idx, 1), children.splice(bidx - (idx < bidx ? 1 : 0), 0, child), this._markModified(), !0; }, Element.prototype._computeChildrenCRC = function(ignoreCRCTag, crc, callback) { crc = crc || {}; var children = this.children; if (!children || !children.length) return callback(null, crc.value); async.eachSeries(children, (function(child, callback) { if (ignoreCRCTag && child.ebmlID === schema.byName.CRC_32) return callback(null); child.computeCRC(crc, callback); }), (function(error) { return error ? callback(error) : callback(null, crc.value); })); }, Element.prototype.deepWalk = function(func) { if (void 0 !== (ret = func(this))) return ret; var children = this.children; if (children) for (children = children.slice(0); children.length; ) { var ret, child = children.shift(); if (void 0 !== (ret = func(child))) return ret; if (child.children) { var sp = [ 0, 0 ].concat(child.children); children.splice.apply(children, sp); } } }, Element.prototype.toString = function() { return "[Element #" + this.tagId + "]"; }, Element.prototype.setMkvFormatDate = function(date) { this.setUTF8(tools.formatDate(value)); }, Element.prototype.isModified = function() { return !!this._modified; }, Object.defineProperty(Element.prototype, "firstChild", { iterable: !0, get: function() { var children = this.children; return children && children.length ? children[0] : null; } }), Object.defineProperty(Element.prototype, "lastChild", { iterable: !0, get: function() { var children = this.children; return children && children.length ? children[children.length - 1] : null; } }), Object.defineProperty(Element.prototype, "empty", { iterable: !0, get: function() { var children = this.children; return !children || !children.length; } }); }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(function(global) { "use strict"; var token, timezone, timezoneClip, dateFormat = (token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g, timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, timezoneClip = /[^-+\dA-Z]/g, function(date, mask, utc, gmt) { if (1 !== arguments.length || "string" !== kindOf(date) || /\d/.test(date) || (mask = date, date = void 0), (date = date || new Date) instanceof Date || (date = new Date(date)), isNaN(date)) throw TypeError("Invalid date"); var maskSlice = (mask = String(dateFormat.masks[mask] || mask || dateFormat.masks.default)).slice(0, 4); "UTC:" !== maskSlice && "GMT:" !== maskSlice || (mask = mask.slice(4), utc = !0, "GMT:" === maskSlice && (gmt = !0)); var _ = utc ? "getUTC" : "get", d = date[_ + "Date"](), D = date[_ + "Day"](), m = date[_ + "Month"](), y = date[_ + "FullYear"](), H = date[_ + "Hours"](), M = date[_ + "Minutes"](), s = date[_ + "Seconds"](), L = date[_ + "Milliseconds"](), o = utc ? 0 : date.getTimezoneOffset(), W = getWeek(date), N = getDayOfWeek(date), flags = { d: d, dd: pad(d), ddd: dateFormat.i18n.dayNames[D], dddd: dateFormat.i18n.dayNames[D + 7], m: m + 1, mm: pad(m + 1), mmm: dateFormat.i18n.monthNames[m], mmmm: dateFormat.i18n.monthNames[m + 12], yy: String(y).slice(2), yyyy: y, h: H % 12 || 12, hh: pad(H % 12 || 12), H: H, HH: pad(H), M: M, MM: pad(M), s: s, ss: pad(s), l: pad(L, 3), L: pad(Math.round(L / 10)), t: H < 12 ? "a" : "p", tt: H < 12 ? "am" : "pm", T: H < 12 ? "A" : "P", TT: H < 12 ? "AM" : "PM", Z: gmt ? "GMT" : utc ? "UTC" : (String(date).match(timezone) || [ "" ]).pop().replace(timezoneClip, ""), o: (o > 0 ? "-" : "+") + pad(100 * Math.floor(Math.abs(o) / 60) + Math.abs(o) % 60, 4), S: [ "th", "st", "nd", "rd" ][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10], W: W, N: N }; return mask.replace(token, (function(match) { return match in flags ? flags[match] : match.slice(1, match.length - 1); })); }); function pad(val, len) { for (val = String(val), len = len || 2; val.length < len; ) val = "0" + val; return val; } function getWeek(date) { var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate()); targetThursday.setDate(targetThursday.getDate() - (targetThursday.getDay() + 6) % 7 + 3); var firstThursday = new Date(targetThursday.getFullYear(), 0, 4); firstThursday.setDate(firstThursday.getDate() - (firstThursday.getDay() + 6) % 7 + 3); var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset(); targetThursday.setHours(targetThursday.getHours() - ds); var weekDiff = (targetThursday - firstThursday) / 6048e5; return 1 + Math.floor(weekDiff); } function getDayOfWeek(date) { var dow = date.getDay(); return 0 === dow && (dow = 7), dow; } function kindOf(val) { return null === val ? "null" : void 0 === val ? "undefined" : "object" != typeof val ? typeof val : Array.isArray(val) ? "array" : {}.toString.call(val).slice(8, -1).toLowerCase(); } dateFormat.masks = { default: "ddd mmm dd yyyy HH:MM:ss", shortDate: "m/d/yy", mediumDate: "mmm d, yyyy", longDate: "mmmm d, yyyy", fullDate: "dddd, mmmm d, yyyy", shortTime: "h:MM TT", mediumTime: "h:MM:ss TT", longTime: "h:MM:ss TT Z", isoDate: "yyyy-mm-dd", isoTime: "HH:MM:ss", isoDateTime: "yyyy-mm-dd'T'HH:MM:sso", isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'", expiresHeaderFormat: "ddd, dd mmm yyyy HH:MM:ss Z" }, dateFormat.i18n = { dayNames: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] }, void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return dateFormat; }.call(exports, __webpack_require__, exports, module)) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); })(); }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(44)("matroska:source"), module.exports = function() {}; }, function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(2), util = __webpack_require__(0), debug = __webpack_require__(44)("matroska:fileSource"), AbstractSource = __webpack_require__(187), fileSourceKey = 0; function FileSource(filename) { AbstractSource.call(this), this.filename = filename; } util.inherits(FileSource, AbstractSource), module.exports = FileSource, FileSource.prototype.getStream = function(session, options, callback) { switch (arguments.length) { case 1: callback = session, session = null; break; case 2: callback = options, options = null; } (session = session || {}).$fileSourceKey = fileSourceKey++; var fd = session._fd; if (fd) { var params = { flags: "r", fd: fd, autoClose: !1 }; "number" == typeof options.start && (params.start = options.start), "number" == typeof options.end && (params.end = options.end), debug("GetStream", params, " fd=", session._fd); var stream = fs.createReadStream(this.filename, params); return stream.destroy = function() {}, callback(null, stream); } var self = this; fs.open(this.filename, "r", (function(error, fd) { if (error) return callback(error); session._fd = fd, self.getStream(session, options, callback); })); }, FileSource.prototype._end = function(session, callback) { if (debug("Close", session._fd), !session._fd) return callback(); fs.close(session._fd, (function(error) { return delete session._fd, callback(error); })); }, FileSource.prototype.toString = function() { return "[FileSource file=" + this.filename + "]"; }; }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(2); var util = __webpack_require__(0), debug = __webpack_require__(44)("matroska:httpSource"), http = __webpack_require__(715).http, Url = __webpack_require__(7), AbstractSource = __webpack_require__(187), httpSourceKey = 0; function HttpSource(url, configuration) { AbstractSource.call(this), this.configuration = configuration || {}, this.url = url; } util.inherits(HttpSource, AbstractSource), module.exports = HttpSource, HttpSource.prototype.getStream = function(session, params, callback) { switch (arguments.length) { case 1: callback = session, session = null; break; case 2: callback = options, options = null; } (session = session || {}).$httpSourceKey = httpSourceKey++; var options = Url.parse(this.url); options.headers = options.headers || {}, this.configuration.userAgent && (options.headers["User-Agent"] = this.configuration.userAgent), params.start && (options.headers.Range = "bytes=" + params.start + "-" + (params.end ? params.end : "")), debug.enabled && debug("Http request ", options, params); var request = http.get(options, (function(response) { if (debug("Response=", response.statusCode, response.statusMessage), 2 !== Math.floor(response.statusCode / 100)) return callback(new Error("Invalid status '" + response.statusCode + "' message='" + response.statusMessage + "' for url=" + url)); if (params.start) { var pr, crange = response.headers["content-range"]; if (crange) { var rr = /bytes (\d+)-(\d+)\/(\d+)/g.exec(crange); pr = rr && parseInt(rr[1], 10); } if (pr !== params.start) return callback(new Error("Invalid start range")); } debug("Response stream ..."), callback(null, response); })); request.on("error", (function(error) { debug("Error:", error), callback(error + " for url=" + this.url); })); }, HttpSource.prototype._end = function(session, callback) { debug("Close"), callback(); }, HttpSource.prototype.toString = function() { return "[HttpSource url=" + this.url + "]"; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(env) { function selectColor(namespace) { for (var hash = 0, i = 0; i < namespace.length; i++) hash = (hash << 5) - hash + namespace.charCodeAt(i), hash |= 0; return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } function createDebug(namespace) { var prevTime; function debug() { if (debug.enabled) { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; var self = debug, curr = Number(new Date), ms = curr - (prevTime || curr); self.diff = ms, self.prev = prevTime, self.curr = curr, prevTime = curr, args[0] = createDebug.coerce(args[0]), "string" != typeof args[0] && args.unshift("%O"); var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (function(match, format) { if ("%%" === match) return match; index++; var formatter = createDebug.formatters[format]; if ("function" == typeof formatter) { var val = args[index]; match = formatter.call(self, val), args.splice(index, 1), index--; } return match; })), createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } } return debug.namespace = namespace, debug.enabled = createDebug.enabled(namespace), debug.useColors = createDebug.useColors(), debug.color = selectColor(namespace), debug.destroy = destroy, debug.extend = extend, "function" == typeof createDebug.init && createDebug.init(debug), createDebug.instances.push(debug), debug; } function destroy() { var index = createDebug.instances.indexOf(this); return -1 !== index && (createDebug.instances.splice(index, 1), !0); } function extend(namespace, delimiter) { return createDebug(this.namespace + (void 0 === delimiter ? ":" : delimiter) + namespace); } return createDebug.debug = createDebug, createDebug.default = createDebug, createDebug.coerce = function(val) { return val instanceof Error ? val.stack || val.message : val; }, createDebug.disable = function() { createDebug.enable(""); }, createDebug.enable = function(namespaces) { var i; createDebug.save(namespaces), createDebug.names = [], createDebug.skips = []; var split = ("string" == typeof namespaces ? namespaces : "").split(/[\s,]+/), len = split.length; for (i = 0; i < len; i++) split[i] && ("-" === (namespaces = split[i].replace(/\*/g, ".*?"))[0] ? createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$")) : createDebug.names.push(new RegExp("^" + namespaces + "$"))); for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } }, createDebug.enabled = function(name) { if ("*" === name[name.length - 1]) return !0; var i, len; for (i = 0, len = createDebug.skips.length; i < len; i++) if (createDebug.skips[i].test(name)) return !1; for (i = 0, len = createDebug.names.length; i < len; i++) if (createDebug.names[i].test(name)) return !0; return !1; }, createDebug.humanize = __webpack_require__(312), Object.keys(env).forEach((function(key) { createDebug[key] = env[key]; })), createDebug.instances = [], createDebug.names = [], createDebug.skips = [], createDebug.formatters = {}, createDebug.selectColor = selectColor, createDebug.enable(createDebug.load()), createDebug; }; }, function(module, exports) { var s = 1e3, m = 60 * s, h = 60 * m, d = 24 * h; function plural(ms, msAbs, n, name) { var isPlural = msAbs >= 1.5 * n; return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } module.exports = function(val, options) { options = options || {}; var ms, msAbs, type = typeof val; if ("string" === type && val.length > 0) return (function(str) { if (!((str = String(str)).length > 100)) { 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) { var n = parseFloat(match[1]); switch ((match[2] || "ms").toLowerCase()) { case "years": case "year": case "yrs": case "yr": case "y": return 315576e5 * n; case "weeks": case "week": case "w": return 6048e5 * n; 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; } } } })(val); if ("number" === type && isFinite(val)) return options.long ? (ms = val, (msAbs = Math.abs(ms)) >= d ? plural(ms, msAbs, d, "day") : msAbs >= h ? plural(ms, msAbs, h, "hour") : msAbs >= m ? plural(ms, msAbs, m, "minute") : msAbs >= s ? plural(ms, msAbs, s, "second") : ms + " ms") : (function(ms) { var msAbs = Math.abs(ms); return msAbs >= d ? Math.round(ms / d) + "d" : msAbs >= h ? Math.round(ms / h) + "h" : msAbs >= m ? Math.round(ms / m) + "m" : msAbs >= s ? Math.round(ms / s) + "s" : ms + "ms"; })(val); throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val)); }; }, function(module, exports, __webpack_require__) { "use strict"; const os = __webpack_require__(23), hasFlag = __webpack_require__(723), env = process.env; let forceColor; function getSupportLevel(stream) { const level = (function(stream) { if (!1 === forceColor) return 0; if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3; if (hasFlag("color=256")) return 2; if (stream && !stream.isTTY && !0 !== forceColor) return 0; const min = forceColor ? 1 : 0; if ("win32" === process.platform) { const osRelease = os.release().split("."); return Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ? Number(osRelease[2]) >= 14931 ? 3 : 2 : 1; } if ("CI" in env) return [ "TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI" ].some((sign => sign in env)) || "codeship" === env.CI_NAME ? 1 : min; if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; if ("truecolor" === env.COLORTERM) return 3; if ("TERM_PROGRAM" in env) { const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": return version >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } return /-256(color)?$/i.test(env.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM) || "COLORTERM" in env ? 1 : (env.TERM, min); })(stream); return (function(level) { return 0 !== level && { level: level, hasBasic: !0, has256: level >= 2, has16m: level >= 3 }; })(level); } hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") ? forceColor = !1 : (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) && (forceColor = !0), "FORCE_COLOR" in env && (forceColor = 0 === env.FORCE_COLOR.length || 0 !== parseInt(env.FORCE_COLOR, 10)), module.exports = { supportsColor: getSupportLevel, stdout: getSupportLevel(process.stdout), stderr: getSupportLevel(process.stderr) }; }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("af", { months: "Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"), monthsShort: "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"), weekdays: "Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"), weekdaysShort: "Son_Maa_Din_Woe_Don_Vry_Sat".split("_"), weekdaysMin: "So_Ma_Di_Wo_Do_Vr_Sa".split("_"), meridiemParse: /vm|nm/i, isPM: function(input) { return /^nm$/i.test(input); }, meridiem: function(hours, minutes, isLower) { return hours < 12 ? isLower ? "vm" : "VM" : isLower ? "nm" : "NM"; }, longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Vandag om] LT", nextDay: "[Môre om] LT", nextWeek: "dddd [om] LT", lastDay: "[Gister om] LT", lastWeek: "[Laas] dddd [om] LT", sameElse: "L" }, relativeTime: { future: "oor %s", past: "%s gelede", s: "'n paar sekondes", m: "'n minuut", mm: "%d minute", h: "'n uur", hh: "%d ure", d: "'n dag", dd: "%d dae", M: "'n maand", MM: "%d maande", y: "'n jaar", yy: "%d jaar" }, ordinalParse: /\d{1,2}(ste|de)/, ordinal: function(number) { return number + (1 === number || 8 === number || number >= 20 ? "ste" : "de"); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "١", 2: "٢", 3: "٣", 4: "٤", 5: "٥", 6: "٦", 7: "٧", 8: "٨", 9: "٩", 0: "٠" }, numberMap = { "١": "1", "٢": "2", "٣": "3", "٤": "4", "٥": "5", "٦": "6", "٧": "7", "٨": "8", "٩": "9", "٠": "0" }, pluralForm = function(n) { return 0 === n ? 0 : 1 === n ? 1 : 2 === n ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; }, plurals = { s: [ "أقل من ثانية", "ثانية واحدة", [ "ثانيتان", "ثانيتين" ], "%d ثوان", "%d ثانية", "%d ثانية" ], m: [ "أقل من دقيقة", "دقيقة واحدة", [ "دقيقتان", "دقيقتين" ], "%d دقائق", "%d دقيقة", "%d دقيقة" ], h: [ "أقل من ساعة", "ساعة واحدة", [ "ساعتان", "ساعتين" ], "%d ساعات", "%d ساعة", "%d ساعة" ], d: [ "أقل من يوم", "يوم واحد", [ "يومان", "يومين" ], "%d أيام", "%d يومًا", "%d يوم" ], M: [ "أقل من شهر", "شهر واحد", [ "شهران", "شهرين" ], "%d أشهر", "%d شهرا", "%d شهر" ], y: [ "أقل من عام", "عام واحد", [ "عامان", "عامين" ], "%d أعوام", "%d عامًا", "%d عام" ] }, pluralize = function(u) { return function(number, withoutSuffix, string, isFuture) { var f = pluralForm(number), str = plurals[u][pluralForm(number)]; return 2 === f && (str = str[withoutSuffix ? 0 : 1]), str.replace(/%d/i, number); }; }, months = [ "كانون الثاني يناير", "شباط فبراير", "آذار مارس", "نيسان أبريل", "أيار مايو", "حزيران يونيو", "تموز يوليو", "آب أغسطس", "أيلول سبتمبر", "تشرين الأول أكتوبر", "تشرين الثاني نوفمبر", "كانون الأول ديسمبر" ]; moment.defineLocale("ar", { months: months, monthsShort: months, weekdays: "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), weekdaysShort: "أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"), weekdaysMin: "ح_ن_ث_ر_خ_ج_س".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "D/‏M/‏YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, meridiemParse: /ص|م/, isPM: function(input) { return "م" === input; }, meridiem: function(hour, minute, isLower) { return hour < 12 ? "ص" : "م"; }, calendar: { sameDay: "[اليوم عند الساعة] LT", nextDay: "[غدًا عند الساعة] LT", nextWeek: "dddd [عند الساعة] LT", lastDay: "[أمس عند الساعة] LT", lastWeek: "dddd [عند الساعة] LT", sameElse: "L" }, relativeTime: { future: "بعد %s", past: "منذ %s", s: pluralize("s"), m: pluralize("m"), mm: pluralize("m"), h: pluralize("h"), hh: pluralize("h"), d: pluralize("d"), dd: pluralize("d"), M: pluralize("M"), MM: pluralize("M"), y: pluralize("y"), yy: pluralize("y") }, preparse: function(string) { return string.replace(/\u200f/g, "").replace(/[١٢٣٤٥٦٧٨٩٠]/g, (function(match) { return numberMap[match]; })).replace(/،/g, ","); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })).replace(/,/g, "،"); }, week: { dow: 6, doy: 12 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ar-ma", { months: "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), monthsShort: "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), weekdays: "الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), weekdaysShort: "احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"), weekdaysMin: "ح_ن_ث_ر_خ_ج_س".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[اليوم على الساعة] LT", nextDay: "[غدا على الساعة] LT", nextWeek: "dddd [على الساعة] LT", lastDay: "[أمس على الساعة] LT", lastWeek: "dddd [على الساعة] LT", sameElse: "L" }, relativeTime: { future: "في %s", past: "منذ %s", s: "ثوان", m: "دقيقة", mm: "%d دقائق", h: "ساعة", hh: "%d ساعات", d: "يوم", dd: "%d أيام", M: "شهر", MM: "%d أشهر", y: "سنة", yy: "%d سنوات" }, week: { dow: 6, doy: 12 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "١", 2: "٢", 3: "٣", 4: "٤", 5: "٥", 6: "٦", 7: "٧", 8: "٨", 9: "٩", 0: "٠" }, numberMap = { "١": "1", "٢": "2", "٣": "3", "٤": "4", "٥": "5", "٦": "6", "٧": "7", "٨": "8", "٩": "9", "٠": "0" }; moment.defineLocale("ar-sa", { months: "يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"), monthsShort: "يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"), weekdays: "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), weekdaysShort: "أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"), weekdaysMin: "ح_ن_ث_ر_خ_ج_س".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, meridiemParse: /ص|م/, isPM: function(input) { return "م" === input; }, meridiem: function(hour, minute, isLower) { return hour < 12 ? "ص" : "م"; }, calendar: { sameDay: "[اليوم على الساعة] LT", nextDay: "[غدا على الساعة] LT", nextWeek: "dddd [على الساعة] LT", lastDay: "[أمس على الساعة] LT", lastWeek: "dddd [على الساعة] LT", sameElse: "L" }, relativeTime: { future: "في %s", past: "منذ %s", s: "ثوان", m: "دقيقة", mm: "%d دقائق", h: "ساعة", hh: "%d ساعات", d: "يوم", dd: "%d أيام", M: "شهر", MM: "%d أشهر", y: "سنة", yy: "%d سنوات" }, preparse: function(string) { return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, (function(match) { return numberMap[match]; })).replace(/،/g, ","); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })).replace(/,/g, "،"); }, week: { dow: 6, doy: 12 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ar-tn", { months: "جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"), monthsShort: "جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"), weekdays: "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), weekdaysShort: "أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"), weekdaysMin: "ح_ن_ث_ر_خ_ج_س".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[اليوم على الساعة] LT", nextDay: "[غدا على الساعة] LT", nextWeek: "dddd [على الساعة] LT", lastDay: "[أمس على الساعة] LT", lastWeek: "dddd [على الساعة] LT", sameElse: "L" }, relativeTime: { future: "في %s", past: "منذ %s", s: "ثوان", m: "دقيقة", mm: "%d دقائق", h: "ساعة", hh: "%d ساعات", d: "يوم", dd: "%d أيام", M: "شهر", MM: "%d أشهر", y: "سنة", yy: "%d سنوات" }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var suffixes = { 1: "-inci", 5: "-inci", 8: "-inci", 70: "-inci", 80: "-inci", 2: "-nci", 7: "-nci", 20: "-nci", 50: "-nci", 3: "-üncü", 4: "-üncü", 100: "-üncü", 6: "-ncı", 9: "-uncu", 10: "-uncu", 30: "-uncu", 60: "-ıncı", 90: "-ıncı" }; moment.defineLocale("az", { months: "yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"), monthsShort: "yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"), weekdays: "Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"), weekdaysShort: "Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"), weekdaysMin: "Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[bugün saat] LT", nextDay: "[sabah saat] LT", nextWeek: "[gələn həftə] dddd [saat] LT", lastDay: "[dünən] LT", lastWeek: "[keçən həftə] dddd [saat] LT", sameElse: "L" }, relativeTime: { future: "%s sonra", past: "%s əvvəl", s: "birneçə saniyyə", m: "bir dəqiqə", mm: "%d dəqiqə", h: "bir saat", hh: "%d saat", d: "bir gün", dd: "%d gün", M: "bir ay", MM: "%d ay", y: "bir il", yy: "%d il" }, meridiemParse: /gecə|səhər|gündüz|axşam/, isPM: function(input) { return /^(gündüz|axşam)$/.test(input); }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "gecə" : hour < 12 ? "səhər" : hour < 17 ? "gündüz" : "axşam"; }, ordinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/, ordinal: function(number) { if (0 === number) return number + "-ıncı"; var a = number % 10; return number + (suffixes[a] || suffixes[number % 100 - a] || suffixes[number >= 100 ? 100 : null]); }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function relativeTimeWithPlural(number, withoutSuffix, key) { return "m" === key ? withoutSuffix ? "хвіліна" : "хвіліну" : "h" === key ? withoutSuffix ? "гадзіна" : "гадзіну" : number + " " + (num = +number, forms = { mm: withoutSuffix ? "хвіліна_хвіліны_хвілін" : "хвіліну_хвіліны_хвілін", hh: withoutSuffix ? "гадзіна_гадзіны_гадзін" : "гадзіну_гадзіны_гадзін", dd: "дзень_дні_дзён", MM: "месяц_месяцы_месяцаў", yy: "год_гады_гадоў" }[key].split("_"), num % 10 == 1 && num % 100 != 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); var num, forms; } moment.defineLocale("be", { months: function(m, format) { return { nominative: "студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_"), accusative: "студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_") }[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(format) ? "accusative" : "nominative"][m.month()]; }, monthsShort: "студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"), weekdays: function(m, format) { return { nominative: "нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"), accusative: "нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_") }[/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/.test(format) ? "accusative" : "nominative"][m.day()]; }, weekdaysShort: "нд_пн_ат_ср_чц_пт_сб".split("_"), weekdaysMin: "нд_пн_ат_ср_чц_пт_сб".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY г.", LLL: "D MMMM YYYY г., HH:mm", LLLL: "dddd, D MMMM YYYY г., HH:mm" }, calendar: { sameDay: "[Сёння ў] LT", nextDay: "[Заўтра ў] LT", lastDay: "[Учора ў] LT", nextWeek: function() { return "[У] dddd [ў] LT"; }, lastWeek: function() { switch (this.day()) { case 0: case 3: case 5: case 6: return "[У мінулую] dddd [ў] LT"; case 1: case 2: case 4: return "[У мінулы] dddd [ў] LT"; } }, sameElse: "L" }, relativeTime: { future: "праз %s", past: "%s таму", s: "некалькі секунд", m: relativeTimeWithPlural, mm: relativeTimeWithPlural, h: relativeTimeWithPlural, hh: relativeTimeWithPlural, d: "дзень", dd: relativeTimeWithPlural, M: "месяц", MM: relativeTimeWithPlural, y: "год", yy: relativeTimeWithPlural }, meridiemParse: /ночы|раніцы|дня|вечара/, isPM: function(input) { return /^(дня|вечара)$/.test(input); }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "ночы" : hour < 12 ? "раніцы" : hour < 17 ? "дня" : "вечара"; }, ordinalParse: /\d{1,2}-(і|ы|га)/, ordinal: function(number, period) { switch (period) { case "M": case "d": case "DDD": case "w": case "W": return number % 10 != 2 && number % 10 != 3 || number % 100 == 12 || number % 100 == 13 ? number + "-ы" : number + "-і"; case "D": return number + "-га"; default: return number; } }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("bg", { months: "януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"), monthsShort: "янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"), weekdays: "неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"), weekdaysShort: "нед_пон_вто_сря_чет_пет_съб".split("_"), weekdaysMin: "нд_пн_вт_ср_чт_пт_сб".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "D.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY H:mm", LLLL: "dddd, D MMMM YYYY H:mm" }, calendar: { sameDay: "[Днес в] LT", nextDay: "[Утре в] LT", nextWeek: "dddd [в] LT", lastDay: "[Вчера в] LT", lastWeek: function() { switch (this.day()) { case 0: case 3: case 6: return "[В изминалата] dddd [в] LT"; case 1: case 2: case 4: case 5: return "[В изминалия] dddd [в] LT"; } }, sameElse: "L" }, relativeTime: { future: "след %s", past: "преди %s", s: "няколко секунди", m: "минута", mm: "%d минути", h: "час", hh: "%d часа", d: "ден", dd: "%d дни", M: "месец", MM: "%d месеца", y: "година", yy: "%d години" }, ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, ordinal: function(number) { var lastDigit = number % 10, last2Digits = number % 100; return 0 === number ? number + "-ев" : 0 === last2Digits ? number + "-ен" : last2Digits > 10 && last2Digits < 20 ? number + "-ти" : 1 === lastDigit ? number + "-ви" : 2 === lastDigit ? number + "-ри" : 7 === lastDigit || 8 === lastDigit ? number + "-ми" : number + "-ти"; }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "১", 2: "২", 3: "৩", 4: "৪", 5: "৫", 6: "৬", 7: "৭", 8: "৮", 9: "৯", 0: "০" }, numberMap = { "১": "1", "২": "2", "৩": "3", "৪": "4", "৫": "5", "৬": "6", "৭": "7", "৮": "8", "৯": "9", "০": "0" }; moment.defineLocale("bn", { months: "জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"), monthsShort: "জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"), weekdays: "রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার".split("_"), weekdaysShort: "রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি".split("_"), weekdaysMin: "রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"), longDateFormat: { LT: "A h:mm সময়", LTS: "A h:mm:ss সময়", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY, A h:mm সময়", LLLL: "dddd, D MMMM YYYY, A h:mm সময়" }, calendar: { sameDay: "[আজ] LT", nextDay: "[আগামীকাল] LT", nextWeek: "dddd, LT", lastDay: "[গতকাল] LT", lastWeek: "[গত] dddd, LT", sameElse: "L" }, relativeTime: { future: "%s পরে", past: "%s আগে", s: "কএক সেকেন্ড", m: "এক মিনিট", mm: "%d মিনিট", h: "এক ঘন্টা", hh: "%d ঘন্টা", d: "এক দিন", dd: "%d দিন", M: "এক মাস", MM: "%d মাস", y: "এক বছর", yy: "%d বছর" }, preparse: function(string) { return string.replace(/[১২৩৪৫৬৭৮৯০]/g, (function(match) { return numberMap[match]; })); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })); }, meridiemParse: /রাত|সকাল|দুপুর|বিকেল|রাত/, isPM: function(input) { return /^(দুপুর|বিকেল|রাত)$/.test(input); }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "রাত" : hour < 10 ? "সকাল" : hour < 17 ? "দুপুর" : hour < 20 ? "বিকেল" : "রাত"; }, week: { dow: 0, doy: 6 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "༡", 2: "༢", 3: "༣", 4: "༤", 5: "༥", 6: "༦", 7: "༧", 8: "༨", 9: "༩", 0: "༠" }, numberMap = { "༡": "1", "༢": "2", "༣": "3", "༤": "4", "༥": "5", "༦": "6", "༧": "7", "༨": "8", "༩": "9", "༠": "0" }; moment.defineLocale("bo", { months: "ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"), monthsShort: "ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"), weekdays: "གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"), weekdaysShort: "ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"), weekdaysMin: "ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"), longDateFormat: { LT: "A h:mm", LTS: "A h:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY, A h:mm", LLLL: "dddd, D MMMM YYYY, A h:mm" }, calendar: { sameDay: "[དི་རིང] LT", nextDay: "[སང་ཉིན] LT", nextWeek: "[བདུན་ཕྲག་རྗེས་མ], LT", lastDay: "[ཁ་སང] LT", lastWeek: "[བདུན་ཕྲག་མཐའ་མ] dddd, LT", sameElse: "L" }, relativeTime: { future: "%s ལ་", past: "%s སྔན་ལ", s: "ལམ་སང", m: "སྐར་མ་གཅིག", mm: "%d སྐར་མ", h: "ཆུ་ཚོད་གཅིག", hh: "%d ཆུ་ཚོད", d: "ཉིན་གཅིག", dd: "%d ཉིན་", M: "ཟླ་བ་གཅིག", MM: "%d ཟླ་བ", y: "ལོ་གཅིག", yy: "%d ལོ" }, preparse: function(string) { return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, (function(match) { return numberMap[match]; })); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, isPM: function(input) { return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input); }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "མཚན་མོ" : hour < 10 ? "ཞོགས་ཀས" : hour < 17 ? "ཉིན་གུང" : hour < 20 ? "དགོང་དག" : "མཚན་མོ"; }, week: { dow: 0, doy: 6 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function relativeTimeWithMutation(number, withoutSuffix, key) { return number + " " + (function(text, number) { return 2 === number ? (function(text) { var mutationTable = { m: "v", b: "v", d: "z" }; return void 0 === mutationTable[text.charAt(0)] ? text : mutationTable[text.charAt(0)] + text.substring(1); })(text) : text; })({ mm: "munutenn", MM: "miz", dd: "devezh" }[key], number); } function lastNumber(number) { return number > 9 ? lastNumber(number % 10) : number; } moment.defineLocale("br", { months: "Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"), monthsShort: "Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"), weekdays: "Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"), weekdaysShort: "Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"), weekdaysMin: "Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"), longDateFormat: { LT: "h[e]mm A", LTS: "h[e]mm:ss A", L: "DD/MM/YYYY", LL: "D [a viz] MMMM YYYY", LLL: "D [a viz] MMMM YYYY h[e]mm A", LLLL: "dddd, D [a viz] MMMM YYYY h[e]mm A" }, calendar: { sameDay: "[Hiziv da] LT", nextDay: "[Warc'hoazh da] LT", nextWeek: "dddd [da] LT", lastDay: "[Dec'h da] LT", lastWeek: "dddd [paset da] LT", sameElse: "L" }, relativeTime: { future: "a-benn %s", past: "%s 'zo", s: "un nebeud segondennoù", m: "ur vunutenn", mm: relativeTimeWithMutation, h: "un eur", hh: "%d eur", d: "un devezh", dd: relativeTimeWithMutation, M: "ur miz", MM: relativeTimeWithMutation, y: "ur bloaz", yy: function(number) { switch (lastNumber(number)) { case 1: case 3: case 4: case 5: case 9: return number + " bloaz"; default: return number + " vloaz"; } } }, ordinalParse: /\d{1,2}(añ|vet)/, ordinal: function(number) { return number + (1 === number ? "añ" : "vet"); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function translate(number, withoutSuffix, key) { var result = number + " "; switch (key) { case "m": return withoutSuffix ? "jedna minuta" : "jedne minute"; case "mm": return result + (1 === number ? "minuta" : 2 === number || 3 === number || 4 === number ? "minute" : "minuta"); case "h": return withoutSuffix ? "jedan sat" : "jednog sata"; case "hh": return result + (1 === number ? "sat" : 2 === number || 3 === number || 4 === number ? "sata" : "sati"); case "dd": return result + (1 === number ? "dan" : "dana"); case "MM": return result + (1 === number ? "mjesec" : 2 === number || 3 === number || 4 === number ? "mjeseca" : "mjeseci"); case "yy": return result + (1 === number ? "godina" : 2 === number || 3 === number || 4 === number ? "godine" : "godina"); } } moment.defineLocale("bs", { months: "januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"), monthsShort: "jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"), weekdays: "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), weekdaysShort: "ned._pon._uto._sri._čet._pet._sub.".split("_"), weekdaysMin: "ne_po_ut_sr_če_pe_su".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD. MM. YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd, D. MMMM YYYY H:mm" }, calendar: { sameDay: "[danas u] LT", nextDay: "[sutra u] LT", nextWeek: function() { switch (this.day()) { case 0: return "[u] [nedjelju] [u] LT"; case 3: return "[u] [srijedu] [u] LT"; case 6: return "[u] [subotu] [u] LT"; case 1: case 2: case 4: case 5: return "[u] dddd [u] LT"; } }, lastDay: "[jučer u] LT", lastWeek: function() { switch (this.day()) { case 0: case 3: return "[prošlu] dddd [u] LT"; case 6: return "[prošle] [subote] [u] LT"; case 1: case 2: case 4: case 5: return "[prošli] dddd [u] LT"; } }, sameElse: "L" }, relativeTime: { future: "za %s", past: "prije %s", s: "par sekundi", m: translate, mm: translate, h: translate, hh: translate, d: "dan", dd: translate, M: "mjesec", MM: translate, y: "godinu", yy: translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ca", { months: "gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"), monthsShort: "gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"), weekdays: "diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"), weekdaysShort: "dg._dl._dt._dc._dj._dv._ds.".split("_"), weekdaysMin: "Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"), longDateFormat: { LT: "H:mm", LTS: "LT:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY H:mm", LLLL: "dddd D MMMM YYYY H:mm" }, calendar: { sameDay: function() { return "[avui a " + (1 !== this.hours() ? "les" : "la") + "] LT"; }, nextDay: function() { return "[demà a " + (1 !== this.hours() ? "les" : "la") + "] LT"; }, nextWeek: function() { return "dddd [a " + (1 !== this.hours() ? "les" : "la") + "] LT"; }, lastDay: function() { return "[ahir a " + (1 !== this.hours() ? "les" : "la") + "] LT"; }, lastWeek: function() { return "[el] dddd [passat a " + (1 !== this.hours() ? "les" : "la") + "] LT"; }, sameElse: "L" }, relativeTime: { future: "en %s", past: "fa %s", s: "uns segons", m: "un minut", mm: "%d minuts", h: "una hora", hh: "%d hores", d: "un dia", dd: "%d dies", M: "un mes", MM: "%d mesos", y: "un any", yy: "%d anys" }, ordinalParse: /\d{1,2}(r|n|t|è|a)/, ordinal: function(number, period) { var output = 1 === number ? "r" : 2 === number ? "n" : 3 === number ? "r" : 4 === number ? "t" : "è"; return "w" !== period && "W" !== period || (output = "a"), number + output; }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var months = "leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"), monthsShort = "led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"); function plural(n) { return n > 1 && n < 5 && 1 != ~~(n / 10); } function translate(number, withoutSuffix, key, isFuture) { var result = number + " "; switch (key) { case "s": return withoutSuffix || isFuture ? "pár sekund" : "pár sekundami"; case "m": return withoutSuffix ? "minuta" : isFuture ? "minutu" : "minutou"; case "mm": return withoutSuffix || isFuture ? result + (plural(number) ? "minuty" : "minut") : result + "minutami"; case "h": return withoutSuffix ? "hodina" : isFuture ? "hodinu" : "hodinou"; case "hh": return withoutSuffix || isFuture ? result + (plural(number) ? "hodiny" : "hodin") : result + "hodinami"; case "d": return withoutSuffix || isFuture ? "den" : "dnem"; case "dd": return withoutSuffix || isFuture ? result + (plural(number) ? "dny" : "dní") : result + "dny"; case "M": return withoutSuffix || isFuture ? "měsíc" : "měsícem"; case "MM": return withoutSuffix || isFuture ? result + (plural(number) ? "měsíce" : "měsíců") : result + "měsíci"; case "y": return withoutSuffix || isFuture ? "rok" : "rokem"; case "yy": return withoutSuffix || isFuture ? result + (plural(number) ? "roky" : "let") : result + "lety"; } } moment.defineLocale("cs", { months: months, monthsShort: monthsShort, monthsParse: (function(months, monthsShort) { var i, _monthsParse = []; for (i = 0; i < 12; i++) _monthsParse[i] = new RegExp("^" + months[i] + "$|^" + monthsShort[i] + "$", "i"); return _monthsParse; })(months, monthsShort), weekdays: "neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"), weekdaysShort: "ne_po_út_st_čt_pá_so".split("_"), weekdaysMin: "ne_po_út_st_čt_pá_so".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd D. MMMM YYYY H:mm" }, calendar: { sameDay: "[dnes v] LT", nextDay: "[zítra v] LT", nextWeek: function() { switch (this.day()) { case 0: return "[v neděli v] LT"; case 1: case 2: return "[v] dddd [v] LT"; case 3: return "[ve středu v] LT"; case 4: return "[ve čtvrtek v] LT"; case 5: return "[v pátek v] LT"; case 6: return "[v sobotu v] LT"; } }, lastDay: "[včera v] LT", lastWeek: function() { switch (this.day()) { case 0: return "[minulou neděli v] LT"; case 1: case 2: return "[minulé] dddd [v] LT"; case 3: return "[minulou středu v] LT"; case 4: case 5: return "[minulý] dddd [v] LT"; case 6: return "[minulou sobotu v] LT"; } }, sameElse: "L" }, relativeTime: { future: "za %s", past: "před %s", s: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("cv", { months: "кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"), monthsShort: "кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"), weekdays: "вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"), weekdaysShort: "выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"), weekdaysMin: "вр_тн_ыт_юн_кҫ_эр_шм".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD-MM-YYYY", LL: "YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]", LLL: "YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm", LLLL: "dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm" }, calendar: { sameDay: "[Паян] LT [сехетре]", nextDay: "[Ыран] LT [сехетре]", lastDay: "[Ӗнер] LT [сехетре]", nextWeek: "[Ҫитес] dddd LT [сехетре]", lastWeek: "[Иртнӗ] dddd LT [сехетре]", sameElse: "L" }, relativeTime: { future: function(output) { return output + (/сехет$/i.exec(output) ? "рен" : /ҫул$/i.exec(output) ? "тан" : "ран"); }, past: "%s каялла", s: "пӗр-ик ҫеккунт", m: "пӗр минут", mm: "%d минут", h: "пӗр сехет", hh: "%d сехет", d: "пӗр кун", dd: "%d кун", M: "пӗр уйӑх", MM: "%d уйӑх", y: "пӗр ҫул", yy: "%d ҫул" }, ordinalParse: /\d{1,2}-мӗш/, ordinal: "%d-мӗш", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("cy", { months: "Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"), monthsShort: "Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"), weekdays: "Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"), weekdaysShort: "Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"), weekdaysMin: "Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Heddiw am] LT", nextDay: "[Yfory am] LT", nextWeek: "dddd [am] LT", lastDay: "[Ddoe am] LT", lastWeek: "dddd [diwethaf am] LT", sameElse: "L" }, relativeTime: { future: "mewn %s", past: "%s yn ôl", s: "ychydig eiliadau", m: "munud", mm: "%d munud", h: "awr", hh: "%d awr", d: "diwrnod", dd: "%d diwrnod", M: "mis", MM: "%d mis", y: "blwyddyn", yy: "%d flynedd" }, ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/, ordinal: function(number) { var output = ""; return number > 20 ? output = 40 === number || 50 === number || 60 === number || 80 === number || 100 === number ? "fed" : "ain" : number > 0 && (output = [ "", "af", "il", "ydd", "ydd", "ed", "ed", "ed", "fed", "fed", "fed", "eg", "fed", "eg", "eg", "fed", "eg", "eg", "fed", "eg", "fed" ][number]), number + output; }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("da", { months: "januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"), monthsShort: "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), weekdays: "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), weekdaysShort: "søn_man_tir_ons_tor_fre_lør".split("_"), weekdaysMin: "sø_ma_ti_on_to_fr_lø".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY HH:mm", LLLL: "dddd [d.] D. MMMM YYYY HH:mm" }, calendar: { sameDay: "[I dag kl.] LT", nextDay: "[I morgen kl.] LT", nextWeek: "dddd [kl.] LT", lastDay: "[I går kl.] LT", lastWeek: "[sidste] dddd [kl] LT", sameElse: "L" }, relativeTime: { future: "om %s", past: "%s siden", s: "få sekunder", m: "et minut", mm: "%d minutter", h: "en time", hh: "%d timer", d: "en dag", dd: "%d dage", M: "en måned", MM: "%d måneder", y: "et år", yy: "%d år" }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: [ "eine Minute", "einer Minute" ], h: [ "eine Stunde", "einer Stunde" ], d: [ "ein Tag", "einem Tag" ], dd: [ number + " Tage", number + " Tagen" ], M: [ "ein Monat", "einem Monat" ], MM: [ number + " Monate", number + " Monaten" ], y: [ "ein Jahr", "einem Jahr" ], yy: [ number + " Jahre", number + " Jahren" ] }; return withoutSuffix ? format[key][0] : format[key][1]; } moment.defineLocale("de", { months: "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), monthsShort: "Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), weekdays: "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), weekdaysShort: "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), weekdaysMin: "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY HH:mm", LLLL: "dddd, D. MMMM YYYY HH:mm" }, calendar: { sameDay: "[Heute um] LT [Uhr]", sameElse: "L", nextDay: "[Morgen um] LT [Uhr]", nextWeek: "dddd [um] LT [Uhr]", lastDay: "[Gestern um] LT [Uhr]", lastWeek: "[letzten] dddd [um] LT [Uhr]" }, relativeTime: { future: "in %s", past: "vor %s", s: "ein paar Sekunden", m: processRelativeTime, mm: "%d Minuten", h: processRelativeTime, hh: "%d Stunden", d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: [ "eine Minute", "einer Minute" ], h: [ "eine Stunde", "einer Stunde" ], d: [ "ein Tag", "einem Tag" ], dd: [ number + " Tage", number + " Tagen" ], M: [ "ein Monat", "einem Monat" ], MM: [ number + " Monate", number + " Monaten" ], y: [ "ein Jahr", "einem Jahr" ], yy: [ number + " Jahre", number + " Jahren" ] }; return withoutSuffix ? format[key][0] : format[key][1]; } moment.defineLocale("de-at", { months: "Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), monthsShort: "Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), weekdays: "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), weekdaysShort: "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), weekdaysMin: "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY HH:mm", LLLL: "dddd, D. MMMM YYYY HH:mm" }, calendar: { sameDay: "[Heute um] LT [Uhr]", sameElse: "L", nextDay: "[Morgen um] LT [Uhr]", nextWeek: "dddd [um] LT [Uhr]", lastDay: "[Gestern um] LT [Uhr]", lastWeek: "[letzten] dddd [um] LT [Uhr]" }, relativeTime: { future: "in %s", past: "vor %s", s: "ein paar Sekunden", m: processRelativeTime, mm: "%d Minuten", h: processRelativeTime, hh: "%d Stunden", d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("el", { monthsNominativeEl: "Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"), monthsGenitiveEl: "Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"), months: function(momentToFormat, format) { return /D/.test(format.substring(0, format.indexOf("MMMM"))) ? this._monthsGenitiveEl[momentToFormat.month()] : this._monthsNominativeEl[momentToFormat.month()]; }, monthsShort: "Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"), weekdays: "Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"), weekdaysShort: "Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"), weekdaysMin: "Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"), meridiem: function(hours, minutes, isLower) { return hours > 11 ? isLower ? "μμ" : "ΜΜ" : isLower ? "πμ" : "ΠΜ"; }, isPM: function(input) { return "μ" === (input + "").toLowerCase()[0]; }, meridiemParse: /[ΠΜ]\.?Μ?\.?/i, longDateFormat: { LT: "h:mm A", LTS: "h:mm:ss A", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY h:mm A", LLLL: "dddd, D MMMM YYYY h:mm A" }, calendarEl: { sameDay: "[Σήμερα {}] LT", nextDay: "[Αύριο {}] LT", nextWeek: "dddd [{}] LT", lastDay: "[Χθες {}] LT", lastWeek: function() { return 6 === this.day() ? "[το προηγούμενο] dddd [{}] LT" : "[την προηγούμενη] dddd [{}] LT"; }, sameElse: "L" }, calendar: function(key, mom) { var output = this._calendarEl[key], hours = mom && mom.hours(); return "function" == typeof output && (output = output.apply(mom)), output.replace("{}", hours % 12 == 1 ? "στη" : "στις"); }, relativeTime: { future: "σε %s", past: "%s πριν", s: "λίγα δευτερόλεπτα", m: "ένα λεπτό", mm: "%d λεπτά", h: "μία ώρα", hh: "%d ώρες", d: "μία μέρα", dd: "%d μέρες", M: "ένας μήνας", MM: "%d μήνες", y: "ένας χρόνος", yy: "%d χρόνια" }, ordinalParse: /\d{1,2}η/, ordinal: "%dη", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("en-au", { months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), longDateFormat: { LT: "h:mm A", LTS: "h:mm:ss A", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY h:mm A", LLLL: "dddd, D MMMM YYYY h:mm A" }, calendar: { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }, relativeTime: { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }, ordinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function(number) { var b = number % 10; return number + (1 == ~~(number % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th"); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("en-ca", { months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), longDateFormat: { LT: "h:mm A", LTS: "h:mm:ss A", L: "YYYY-MM-DD", LL: "D MMMM, YYYY", LLL: "D MMMM, YYYY h:mm A", LLLL: "dddd, D MMMM, YYYY h:mm A" }, calendar: { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }, relativeTime: { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }, ordinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function(number) { var b = number % 10; return number + (1 == ~~(number % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th"); } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("en-gb", { months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }, relativeTime: { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }, ordinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function(number) { var b = number % 10; return number + (1 == ~~(number % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th"); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("eo", { months: "januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"), monthsShort: "jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"), weekdays: "Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"), weekdaysShort: "Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"), weekdaysMin: "Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY-MM-DD", LL: "D[-an de] MMMM, YYYY", LLL: "D[-an de] MMMM, YYYY HH:mm", LLLL: "dddd, [la] D[-an de] MMMM, YYYY HH:mm" }, meridiemParse: /[ap]\.t\.m/i, isPM: function(input) { return "p" === input.charAt(0).toLowerCase(); }, meridiem: function(hours, minutes, isLower) { return hours > 11 ? isLower ? "p.t.m." : "P.T.M." : isLower ? "a.t.m." : "A.T.M."; }, calendar: { sameDay: "[Hodiaŭ je] LT", nextDay: "[Morgaŭ je] LT", nextWeek: "dddd [je] LT", lastDay: "[Hieraŭ je] LT", lastWeek: "[pasinta] dddd [je] LT", sameElse: "L" }, relativeTime: { future: "je %s", past: "antaŭ %s", s: "sekundoj", m: "minuto", mm: "%d minutoj", h: "horo", hh: "%d horoj", d: "tago", dd: "%d tagoj", M: "monato", MM: "%d monatoj", y: "jaro", yy: "%d jaroj" }, ordinalParse: /\d{1,2}a/, ordinal: "%da", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var monthsShortDot = "Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"), monthsShort = "Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic".split("_"); moment.defineLocale("es", { months: "Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"), monthsShort: function(m, format) { return /-MMM-/.test(format) ? monthsShort[m.month()] : monthsShortDot[m.month()]; }, weekdays: "Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"), weekdaysShort: "Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"), weekdaysMin: "Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY H:mm", LLLL: "dddd, D [de] MMMM [de] YYYY H:mm" }, calendar: { sameDay: function() { return "[hoy a la" + (1 !== this.hours() ? "s" : "") + "] LT"; }, nextDay: function() { return "[mañana a la" + (1 !== this.hours() ? "s" : "") + "] LT"; }, nextWeek: function() { return "dddd [a la" + (1 !== this.hours() ? "s" : "") + "] LT"; }, lastDay: function() { return "[ayer a la" + (1 !== this.hours() ? "s" : "") + "] LT"; }, lastWeek: function() { return "[el] dddd [pasado a la" + (1 !== this.hours() ? "s" : "") + "] LT"; }, sameElse: "L" }, relativeTime: { future: "en %s", past: "hace %s", s: "unos segundos", m: "un minuto", mm: "%d minutos", h: "una hora", hh: "%d horas", d: "un día", dd: "%d días", M: "un mes", MM: "%d meses", y: "un año", yy: "%d años" }, ordinalParse: /\d{1,2}º/, ordinal: "%dº", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: [ "mõne sekundi", "mõni sekund", "paar sekundit" ], m: [ "ühe minuti", "üks minut" ], mm: [ number + " minuti", number + " minutit" ], h: [ "ühe tunni", "tund aega", "üks tund" ], hh: [ number + " tunni", number + " tundi" ], d: [ "ühe päeva", "üks päev" ], M: [ "kuu aja", "kuu aega", "üks kuu" ], MM: [ number + " kuu", number + " kuud" ], y: [ "ühe aasta", "aasta", "üks aasta" ], yy: [ number + " aasta", number + " aastat" ] }; return withoutSuffix ? format[key][2] ? format[key][2] : format[key][1] : isFuture ? format[key][0] : format[key][1]; } moment.defineLocale("et", { months: "jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"), monthsShort: "jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"), weekdays: "pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"), weekdaysShort: "P_E_T_K_N_R_L".split("_"), weekdaysMin: "P_E_T_K_N_R_L".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd, D. MMMM YYYY H:mm" }, calendar: { sameDay: "[Täna,] LT", nextDay: "[Homme,] LT", nextWeek: "[Järgmine] dddd LT", lastDay: "[Eile,] LT", lastWeek: "[Eelmine] dddd LT", sameElse: "L" }, relativeTime: { future: "%s pärast", past: "%s tagasi", s: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: "%d päeva", M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("eu", { months: "urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"), monthsShort: "urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"), weekdays: "igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"), weekdaysShort: "ig._al._ar._az._og._ol._lr.".split("_"), weekdaysMin: "ig_al_ar_az_og_ol_lr".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY-MM-DD", LL: "YYYY[ko] MMMM[ren] D[a]", LLL: "YYYY[ko] MMMM[ren] D[a] HH:mm", LLLL: "dddd, YYYY[ko] MMMM[ren] D[a] HH:mm", l: "YYYY-M-D", ll: "YYYY[ko] MMM D[a]", lll: "YYYY[ko] MMM D[a] HH:mm", llll: "ddd, YYYY[ko] MMM D[a] HH:mm" }, calendar: { sameDay: "[gaur] LT[etan]", nextDay: "[bihar] LT[etan]", nextWeek: "dddd LT[etan]", lastDay: "[atzo] LT[etan]", lastWeek: "[aurreko] dddd LT[etan]", sameElse: "L" }, relativeTime: { future: "%s barru", past: "duela %s", s: "segundo batzuk", m: "minutu bat", mm: "%d minutu", h: "ordu bat", hh: "%d ordu", d: "egun bat", dd: "%d egun", M: "hilabete bat", MM: "%d hilabete", y: "urte bat", yy: "%d urte" }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "۱", 2: "۲", 3: "۳", 4: "۴", 5: "۵", 6: "۶", 7: "۷", 8: "۸", 9: "۹", 0: "۰" }, numberMap = { "۱": "1", "۲": "2", "۳": "3", "۴": "4", "۵": "5", "۶": "6", "۷": "7", "۸": "8", "۹": "9", "۰": "0" }; moment.defineLocale("fa", { months: "ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"), monthsShort: "ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"), weekdays: "یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"), weekdaysShort: "یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"), weekdaysMin: "ی_د_س_چ_پ_ج_ش".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, meridiemParse: /قبل از ظهر|بعد از ظهر/, isPM: function(input) { return /بعد از ظهر/.test(input); }, meridiem: function(hour, minute, isLower) { return hour < 12 ? "قبل از ظهر" : "بعد از ظهر"; }, calendar: { sameDay: "[امروز ساعت] LT", nextDay: "[فردا ساعت] LT", nextWeek: "dddd [ساعت] LT", lastDay: "[دیروز ساعت] LT", lastWeek: "dddd [پیش] [ساعت] LT", sameElse: "L" }, relativeTime: { future: "در %s", past: "%s پیش", s: "چندین ثانیه", m: "یک دقیقه", mm: "%d دقیقه", h: "یک ساعت", hh: "%d ساعت", d: "یک روز", dd: "%d روز", M: "یک ماه", MM: "%d ماه", y: "یک سال", yy: "%d سال" }, preparse: function(string) { return string.replace(/[۰-۹]/g, (function(match) { return numberMap[match]; })).replace(/،/g, ","); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })).replace(/,/g, "،"); }, ordinalParse: /\d{1,2}م/, ordinal: "%dم", week: { dow: 6, doy: 12 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var numbersPast = "nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "), numbersFuture = [ "nolla", "yhden", "kahden", "kolmen", "neljän", "viiden", "kuuden", numbersPast[7], numbersPast[8], numbersPast[9] ]; function translate(number, withoutSuffix, key, isFuture) { var result = ""; switch (key) { case "s": return isFuture ? "muutaman sekunnin" : "muutama sekunti"; case "m": return isFuture ? "minuutin" : "minuutti"; case "mm": result = isFuture ? "minuutin" : "minuuttia"; break; case "h": return isFuture ? "tunnin" : "tunti"; case "hh": result = isFuture ? "tunnin" : "tuntia"; break; case "d": return isFuture ? "päivän" : "päivä"; case "dd": result = isFuture ? "päivän" : "päivää"; break; case "M": return isFuture ? "kuukauden" : "kuukausi"; case "MM": result = isFuture ? "kuukauden" : "kuukautta"; break; case "y": return isFuture ? "vuoden" : "vuosi"; case "yy": result = isFuture ? "vuoden" : "vuotta"; } return (function(number, isFuture) { return number < 10 ? isFuture ? numbersFuture[number] : numbersPast[number] : number; })(number, isFuture) + " " + result; } moment.defineLocale("fi", { months: "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"), monthsShort: "tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"), weekdays: "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"), weekdaysShort: "su_ma_ti_ke_to_pe_la".split("_"), weekdaysMin: "su_ma_ti_ke_to_pe_la".split("_"), longDateFormat: { LT: "HH.mm", LTS: "HH.mm.ss", L: "DD.MM.YYYY", LL: "Do MMMM[ta] YYYY", LLL: "Do MMMM[ta] YYYY, [klo] HH.mm", LLLL: "dddd, Do MMMM[ta] YYYY, [klo] HH.mm", l: "D.M.YYYY", ll: "Do MMM YYYY", lll: "Do MMM YYYY, [klo] HH.mm", llll: "ddd, Do MMM YYYY, [klo] HH.mm" }, calendar: { sameDay: "[tänään] [klo] LT", nextDay: "[huomenna] [klo] LT", nextWeek: "dddd [klo] LT", lastDay: "[eilen] [klo] LT", lastWeek: "[viime] dddd[na] [klo] LT", sameElse: "L" }, relativeTime: { future: "%s päästä", past: "%s sitten", s: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("fo", { months: "januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"), monthsShort: "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), weekdays: "sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"), weekdaysShort: "sun_mán_týs_mik_hós_frí_ley".split("_"), weekdaysMin: "su_má_tý_mi_hó_fr_le".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D. MMMM, YYYY HH:mm" }, calendar: { sameDay: "[Í dag kl.] LT", nextDay: "[Í morgin kl.] LT", nextWeek: "dddd [kl.] LT", lastDay: "[Í gjár kl.] LT", lastWeek: "[síðstu] dddd [kl] LT", sameElse: "L" }, relativeTime: { future: "um %s", past: "%s síðani", s: "fá sekund", m: "ein minutt", mm: "%d minuttir", h: "ein tími", hh: "%d tímar", d: "ein dagur", dd: "%d dagar", M: "ein mánaði", MM: "%d mánaðir", y: "eitt ár", yy: "%d ár" }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("fr", { months: "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), monthsShort: "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"), weekdaysMin: "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Aujourd'hui à] LT", nextDay: "[Demain à] LT", nextWeek: "dddd [à] LT", lastDay: "[Hier à] LT", lastWeek: "dddd [dernier à] LT", sameElse: "L" }, relativeTime: { future: "dans %s", past: "il y a %s", s: "quelques secondes", m: "une minute", mm: "%d minutes", h: "une heure", hh: "%d heures", d: "un jour", dd: "%d jours", M: "un mois", MM: "%d mois", y: "un an", yy: "%d ans" }, ordinalParse: /\d{1,2}(er|)/, ordinal: function(number) { return number + (1 === number ? "er" : ""); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("fr-ca", { months: "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), monthsShort: "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"), weekdaysMin: "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY-MM-DD", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Aujourd'hui à] LT", nextDay: "[Demain à] LT", nextWeek: "dddd [à] LT", lastDay: "[Hier à] LT", lastWeek: "dddd [dernier à] LT", sameElse: "L" }, relativeTime: { future: "dans %s", past: "il y a %s", s: "quelques secondes", m: "une minute", mm: "%d minutes", h: "une heure", hh: "%d heures", d: "un jour", dd: "%d jours", M: "un mois", MM: "%d mois", y: "un an", yy: "%d ans" }, ordinalParse: /\d{1,2}(er|e)/, ordinal: function(number) { return number + (1 === number ? "er" : "e"); } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var monthsShortWithDots = "jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"), monthsShortWithoutDots = "jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"); moment.defineLocale("fy", { months: "jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"), monthsShort: function(m, format) { return /-MMM-/.test(format) ? monthsShortWithoutDots[m.month()] : monthsShortWithDots[m.month()]; }, weekdays: "snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"), weekdaysShort: "si._mo._ti._wo._to._fr._so.".split("_"), weekdaysMin: "Si_Mo_Ti_Wo_To_Fr_So".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD-MM-YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[hjoed om] LT", nextDay: "[moarn om] LT", nextWeek: "dddd [om] LT", lastDay: "[juster om] LT", lastWeek: "[ôfrûne] dddd [om] LT", sameElse: "L" }, relativeTime: { future: "oer %s", past: "%s lyn", s: "in pear sekonden", m: "ien minút", mm: "%d minuten", h: "ien oere", hh: "%d oeren", d: "ien dei", dd: "%d dagen", M: "ien moanne", MM: "%d moannen", y: "ien jier", yy: "%d jierren" }, ordinalParse: /\d{1,2}(ste|de)/, ordinal: function(number) { return number + (1 === number || 8 === number || number >= 20 ? "ste" : "de"); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("gl", { months: "Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"), monthsShort: "Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"), weekdays: "Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"), weekdaysShort: "Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"), weekdaysMin: "Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY H:mm", LLLL: "dddd D MMMM YYYY H:mm" }, calendar: { sameDay: function() { return "[hoxe " + (1 !== this.hours() ? "ás" : "á") + "] LT"; }, nextDay: function() { return "[mañá " + (1 !== this.hours() ? "ás" : "á") + "] LT"; }, nextWeek: function() { return "dddd [" + (1 !== this.hours() ? "ás" : "a") + "] LT"; }, lastDay: function() { return "[onte " + (1 !== this.hours() ? "á" : "a") + "] LT"; }, lastWeek: function() { return "[o] dddd [pasado " + (1 !== this.hours() ? "ás" : "a") + "] LT"; }, sameElse: "L" }, relativeTime: { future: function(str) { return "uns segundos" === str ? "nuns segundos" : "en " + str; }, past: "hai %s", s: "uns segundos", m: "un minuto", mm: "%d minutos", h: "unha hora", hh: "%d horas", d: "un día", dd: "%d días", M: "un mes", MM: "%d meses", y: "un ano", yy: "%d anos" }, ordinalParse: /\d{1,2}º/, ordinal: "%dº", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("he", { months: "ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"), monthsShort: "ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"), weekdays: "ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"), weekdaysShort: "א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"), weekdaysMin: "א_ב_ג_ד_ה_ו_ש".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [ב]MMMM YYYY", LLL: "D [ב]MMMM YYYY HH:mm", LLLL: "dddd, D [ב]MMMM YYYY HH:mm", l: "D/M/YYYY", ll: "D MMM YYYY", lll: "D MMM YYYY HH:mm", llll: "ddd, D MMM YYYY HH:mm" }, calendar: { sameDay: "[היום ב־]LT", nextDay: "[מחר ב־]LT", nextWeek: "dddd [בשעה] LT", lastDay: "[אתמול ב־]LT", lastWeek: "[ביום] dddd [האחרון בשעה] LT", sameElse: "L" }, relativeTime: { future: "בעוד %s", past: "לפני %s", s: "מספר שניות", m: "דקה", mm: "%d דקות", h: "שעה", hh: function(number) { return 2 === number ? "שעתיים" : number + " שעות"; }, d: "יום", dd: function(number) { return 2 === number ? "יומיים" : number + " ימים"; }, M: "חודש", MM: function(number) { return 2 === number ? "חודשיים" : number + " חודשים"; }, y: "שנה", yy: function(number) { return 2 === number ? "שנתיים" : number % 10 == 0 && 10 !== number ? number + " שנה" : number + " שנים"; } } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "१", 2: "२", 3: "३", 4: "४", 5: "५", 6: "६", 7: "७", 8: "८", 9: "९", 0: "०" }, numberMap = { "१": "1", "२": "2", "३": "3", "४": "4", "५": "5", "६": "6", "७": "7", "८": "8", "९": "9", "०": "0" }; moment.defineLocale("hi", { months: "जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"), monthsShort: "जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"), weekdays: "रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"), weekdaysShort: "रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"), weekdaysMin: "र_सो_मं_बु_गु_शु_श".split("_"), longDateFormat: { LT: "A h:mm बजे", LTS: "A h:mm:ss बजे", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY, A h:mm बजे", LLLL: "dddd, D MMMM YYYY, A h:mm बजे" }, calendar: { sameDay: "[आज] LT", nextDay: "[कल] LT", nextWeek: "dddd, LT", lastDay: "[कल] LT", lastWeek: "[पिछले] dddd, LT", sameElse: "L" }, relativeTime: { future: "%s में", past: "%s पहले", s: "कुछ ही क्षण", m: "एक मिनट", mm: "%d मिनट", h: "एक घंटा", hh: "%d घंटे", d: "एक दिन", dd: "%d दिन", M: "एक महीने", MM: "%d महीने", y: "एक वर्ष", yy: "%d वर्ष" }, preparse: function(string) { return string.replace(/[१२३४५६७८९०]/g, (function(match) { return numberMap[match]; })); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })); }, meridiemParse: /रात|सुबह|दोपहर|शाम/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "रात" === meridiem ? hour < 4 ? hour : hour + 12 : "सुबह" === meridiem ? hour : "दोपहर" === meridiem ? hour >= 10 ? hour : hour + 12 : "शाम" === meridiem ? hour + 12 : void 0; }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "रात" : hour < 10 ? "सुबह" : hour < 17 ? "दोपहर" : hour < 20 ? "शाम" : "रात"; }, week: { dow: 0, doy: 6 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function translate(number, withoutSuffix, key) { var result = number + " "; switch (key) { case "m": return withoutSuffix ? "jedna minuta" : "jedne minute"; case "mm": return result + (1 === number ? "minuta" : 2 === number || 3 === number || 4 === number ? "minute" : "minuta"); case "h": return withoutSuffix ? "jedan sat" : "jednog sata"; case "hh": return result + (1 === number ? "sat" : 2 === number || 3 === number || 4 === number ? "sata" : "sati"); case "dd": return result + (1 === number ? "dan" : "dana"); case "MM": return result + (1 === number ? "mjesec" : 2 === number || 3 === number || 4 === number ? "mjeseca" : "mjeseci"); case "yy": return result + (1 === number ? "godina" : 2 === number || 3 === number || 4 === number ? "godine" : "godina"); } } moment.defineLocale("hr", { months: "siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"), monthsShort: "sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"), weekdays: "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), weekdaysShort: "ned._pon._uto._sri._čet._pet._sub.".split("_"), weekdaysMin: "ne_po_ut_sr_če_pe_su".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD. MM. YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd, D. MMMM YYYY H:mm" }, calendar: { sameDay: "[danas u] LT", nextDay: "[sutra u] LT", nextWeek: function() { switch (this.day()) { case 0: return "[u] [nedjelju] [u] LT"; case 3: return "[u] [srijedu] [u] LT"; case 6: return "[u] [subotu] [u] LT"; case 1: case 2: case 4: case 5: return "[u] dddd [u] LT"; } }, lastDay: "[jučer u] LT", lastWeek: function() { switch (this.day()) { case 0: case 3: return "[prošlu] dddd [u] LT"; case 6: return "[prošle] [subote] [u] LT"; case 1: case 2: case 4: case 5: return "[prošli] dddd [u] LT"; } }, sameElse: "L" }, relativeTime: { future: "za %s", past: "prije %s", s: "par sekundi", m: translate, mm: translate, h: translate, hh: translate, d: "dan", dd: translate, M: "mjesec", MM: translate, y: "godinu", yy: translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var weekEndings = "vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" "); function translate(number, withoutSuffix, key, isFuture) { var num = number; switch (key) { case "s": return isFuture || withoutSuffix ? "néhány másodperc" : "néhány másodperce"; case "m": return "egy" + (isFuture || withoutSuffix ? " perc" : " perce"); case "mm": return num + (isFuture || withoutSuffix ? " perc" : " perce"); case "h": return "egy" + (isFuture || withoutSuffix ? " óra" : " órája"); case "hh": return num + (isFuture || withoutSuffix ? " óra" : " órája"); case "d": return "egy" + (isFuture || withoutSuffix ? " nap" : " napja"); case "dd": return num + (isFuture || withoutSuffix ? " nap" : " napja"); case "M": return "egy" + (isFuture || withoutSuffix ? " hónap" : " hónapja"); case "MM": return num + (isFuture || withoutSuffix ? " hónap" : " hónapja"); case "y": return "egy" + (isFuture || withoutSuffix ? " év" : " éve"); case "yy": return num + (isFuture || withoutSuffix ? " év" : " éve"); } return ""; } function week(isFuture) { return (isFuture ? "" : "[múlt] ") + "[" + weekEndings[this.day()] + "] LT[-kor]"; } moment.defineLocale("hu", { months: "január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"), monthsShort: "jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"), weekdays: "vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"), weekdaysShort: "vas_hét_kedd_sze_csüt_pén_szo".split("_"), weekdaysMin: "v_h_k_sze_cs_p_szo".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "YYYY.MM.DD.", LL: "YYYY. MMMM D.", LLL: "YYYY. MMMM D. H:mm", LLLL: "YYYY. MMMM D., dddd H:mm" }, meridiemParse: /de|du/i, isPM: function(input) { return "u" === input.charAt(1).toLowerCase(); }, meridiem: function(hours, minutes, isLower) { return hours < 12 ? !0 === isLower ? "de" : "DE" : !0 === isLower ? "du" : "DU"; }, calendar: { sameDay: "[ma] LT[-kor]", nextDay: "[holnap] LT[-kor]", nextWeek: function() { return week.call(this, !0); }, lastDay: "[tegnap] LT[-kor]", lastWeek: function() { return week.call(this, !1); }, sameElse: "L" }, relativeTime: { future: "%s múlva", past: "%s", s: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("hy-am", { months: function(m, format) { return { nominative: "հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_"), accusative: "հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_") }[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(format) ? "accusative" : "nominative"][m.month()]; }, monthsShort: function(m, format) { return "հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_")[m.month()]; }, weekdays: function(m, format) { return "կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_")[m.day()]; }, weekdaysShort: "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), weekdaysMin: "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY թ.", LLL: "D MMMM YYYY թ., HH:mm", LLLL: "dddd, D MMMM YYYY թ., HH:mm" }, calendar: { sameDay: "[այսօր] LT", nextDay: "[վաղը] LT", lastDay: "[երեկ] LT", nextWeek: function() { return "dddd [օրը ժամը] LT"; }, lastWeek: function() { return "[անցած] dddd [օրը ժամը] LT"; }, sameElse: "L" }, relativeTime: { future: "%s հետո", past: "%s առաջ", s: "մի քանի վայրկյան", m: "րոպե", mm: "%d րոպե", h: "ժամ", hh: "%d ժամ", d: "օր", dd: "%d օր", M: "ամիս", MM: "%d ամիս", y: "տարի", yy: "%d տարի" }, meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/, isPM: function(input) { return /^(ցերեկվա|երեկոյան)$/.test(input); }, meridiem: function(hour) { return hour < 4 ? "գիշերվա" : hour < 12 ? "առավոտվա" : hour < 17 ? "ցերեկվա" : "երեկոյան"; }, ordinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/, ordinal: function(number, period) { switch (period) { case "DDD": case "w": case "W": case "DDDo": return 1 === number ? number + "-ին" : number + "-րդ"; default: return number; } }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("id", { months: "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"), monthsShort: "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"), weekdays: "Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"), weekdaysShort: "Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"), weekdaysMin: "Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"), longDateFormat: { LT: "HH.mm", LTS: "HH.mm.ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [pukul] HH.mm", LLLL: "dddd, D MMMM YYYY [pukul] HH.mm" }, meridiemParse: /pagi|siang|sore|malam/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "pagi" === meridiem ? hour : "siang" === meridiem ? hour >= 11 ? hour : hour + 12 : "sore" === meridiem || "malam" === meridiem ? hour + 12 : void 0; }, meridiem: function(hours, minutes, isLower) { return hours < 11 ? "pagi" : hours < 15 ? "siang" : hours < 19 ? "sore" : "malam"; }, calendar: { sameDay: "[Hari ini pukul] LT", nextDay: "[Besok pukul] LT", nextWeek: "dddd [pukul] LT", lastDay: "[Kemarin pukul] LT", lastWeek: "dddd [lalu pukul] LT", sameElse: "L" }, relativeTime: { future: "dalam %s", past: "%s yang lalu", s: "beberapa detik", m: "semenit", mm: "%d menit", h: "sejam", hh: "%d jam", d: "sehari", dd: "%d hari", M: "sebulan", MM: "%d bulan", y: "setahun", yy: "%d tahun" }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function plural(n) { return n % 100 == 11 || n % 10 != 1; } function translate(number, withoutSuffix, key, isFuture) { var result = number + " "; switch (key) { case "s": return withoutSuffix || isFuture ? "nokkrar sekúndur" : "nokkrum sekúndum"; case "m": return withoutSuffix ? "mínúta" : "mínútu"; case "mm": return plural(number) ? result + (withoutSuffix || isFuture ? "mínútur" : "mínútum") : withoutSuffix ? result + "mínúta" : result + "mínútu"; case "hh": return plural(number) ? result + (withoutSuffix || isFuture ? "klukkustundir" : "klukkustundum") : result + "klukkustund"; case "d": return withoutSuffix ? "dagur" : isFuture ? "dag" : "degi"; case "dd": return plural(number) ? withoutSuffix ? result + "dagar" : result + (isFuture ? "daga" : "dögum") : withoutSuffix ? result + "dagur" : result + (isFuture ? "dag" : "degi"); case "M": return withoutSuffix ? "mánuður" : isFuture ? "mánuð" : "mánuði"; case "MM": return plural(number) ? withoutSuffix ? result + "mánuðir" : result + (isFuture ? "mánuði" : "mánuðum") : withoutSuffix ? result + "mánuður" : result + (isFuture ? "mánuð" : "mánuði"); case "y": return withoutSuffix || isFuture ? "ár" : "ári"; case "yy": return plural(number) ? result + (withoutSuffix || isFuture ? "ár" : "árum") : result + (withoutSuffix || isFuture ? "ár" : "ári"); } } moment.defineLocale("is", { months: "janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"), monthsShort: "jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"), weekdays: "sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"), weekdaysShort: "sun_mán_þri_mið_fim_fös_lau".split("_"), weekdaysMin: "Su_Má_Þr_Mi_Fi_Fö_La".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY [kl.] H:mm", LLLL: "dddd, D. MMMM YYYY [kl.] H:mm" }, calendar: { sameDay: "[í dag kl.] LT", nextDay: "[á morgun kl.] LT", nextWeek: "dddd [kl.] LT", lastDay: "[í gær kl.] LT", lastWeek: "[síðasta] dddd [kl.] LT", sameElse: "L" }, relativeTime: { future: "eftir %s", past: "fyrir %s síðan", s: translate, m: translate, mm: translate, h: "klukkustund", hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("it", { months: "gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"), monthsShort: "gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"), weekdays: "Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"), weekdaysShort: "Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"), weekdaysMin: "D_L_Ma_Me_G_V_S".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Oggi alle] LT", nextDay: "[Domani alle] LT", nextWeek: "dddd [alle] LT", lastDay: "[Ieri alle] LT", lastWeek: function() { return 0 === this.day() ? "[la scorsa] dddd [alle] LT" : "[lo scorso] dddd [alle] LT"; }, sameElse: "L" }, relativeTime: { future: function(s) { return (/^[0-9].+$/.test(s) ? "tra" : "in") + " " + s; }, past: "%s fa", s: "alcuni secondi", m: "un minuto", mm: "%d minuti", h: "un'ora", hh: "%d ore", d: "un giorno", dd: "%d giorni", M: "un mese", MM: "%d mesi", y: "un anno", yy: "%d anni" }, ordinalParse: /\d{1,2}º/, ordinal: "%dº", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ja", { months: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), weekdays: "日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"), weekdaysShort: "日_月_火_水_木_金_土".split("_"), weekdaysMin: "日_月_火_水_木_金_土".split("_"), longDateFormat: { LT: "Ah時m分", LTS: "Ah時m分s秒", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah時m分", LLLL: "YYYY年M月D日Ah時m分 dddd" }, meridiemParse: /午前|午後/i, isPM: function(input) { return "午後" === input; }, meridiem: function(hour, minute, isLower) { return hour < 12 ? "午前" : "午後"; }, calendar: { sameDay: "[今日] LT", nextDay: "[明日] LT", nextWeek: "[来週]dddd LT", lastDay: "[昨日] LT", lastWeek: "[前週]dddd LT", sameElse: "L" }, relativeTime: { future: "%s後", past: "%s前", s: "数秒", m: "1分", mm: "%d分", h: "1時間", hh: "%d時間", d: "1日", dd: "%d日", M: "1ヶ月", MM: "%dヶ月", y: "1年", yy: "%d年" } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("jv", { months: "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"), monthsShort: "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"), weekdays: "Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"), weekdaysShort: "Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"), weekdaysMin: "Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"), longDateFormat: { LT: "HH.mm", LTS: "HH.mm.ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [pukul] HH.mm", LLLL: "dddd, D MMMM YYYY [pukul] HH.mm" }, meridiemParse: /enjing|siyang|sonten|ndalu/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "enjing" === meridiem ? hour : "siyang" === meridiem ? hour >= 11 ? hour : hour + 12 : "sonten" === meridiem || "ndalu" === meridiem ? hour + 12 : void 0; }, meridiem: function(hours, minutes, isLower) { return hours < 11 ? "enjing" : hours < 15 ? "siyang" : hours < 19 ? "sonten" : "ndalu"; }, calendar: { sameDay: "[Dinten puniko pukul] LT", nextDay: "[Mbenjang pukul] LT", nextWeek: "dddd [pukul] LT", lastDay: "[Kala wingi pukul] LT", lastWeek: "dddd [kepengker pukul] LT", sameElse: "L" }, relativeTime: { future: "wonten ing %s", past: "%s ingkang kepengker", s: "sawetawis detik", m: "setunggal menit", mm: "%d menit", h: "setunggal jam", hh: "%d jam", d: "sedinten", dd: "%d dinten", M: "sewulan", MM: "%d wulan", y: "setaun", yy: "%d taun" }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ka", { months: function(m, format) { return { nominative: "იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"), accusative: "იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_") }[/D[oD] *MMMM?/.test(format) ? "accusative" : "nominative"][m.month()]; }, monthsShort: "იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"), weekdays: function(m, format) { return { nominative: "კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"), accusative: "კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_") }[/(წინა|შემდეგ)/.test(format) ? "accusative" : "nominative"][m.day()]; }, weekdaysShort: "კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"), weekdaysMin: "კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"), longDateFormat: { LT: "h:mm A", LTS: "h:mm:ss A", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY h:mm A", LLLL: "dddd, D MMMM YYYY h:mm A" }, calendar: { sameDay: "[დღეს] LT[-ზე]", nextDay: "[ხვალ] LT[-ზე]", lastDay: "[გუშინ] LT[-ზე]", nextWeek: "[შემდეგ] dddd LT[-ზე]", lastWeek: "[წინა] dddd LT-ზე", sameElse: "L" }, relativeTime: { future: function(s) { return /(წამი|წუთი|საათი|წელი)/.test(s) ? s.replace(/ი$/, "ში") : s + "ში"; }, past: function(s) { return /(წამი|წუთი|საათი|დღე|თვე)/.test(s) ? s.replace(/(ი|ე)$/, "ის წინ") : /წელი/.test(s) ? s.replace(/წელი$/, "წლის წინ") : void 0; }, s: "რამდენიმე წამი", m: "წუთი", mm: "%d წუთი", h: "საათი", hh: "%d საათი", d: "დღე", dd: "%d დღე", M: "თვე", MM: "%d თვე", y: "წელი", yy: "%d წელი" }, ordinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/, ordinal: function(number) { return 0 === number ? number : 1 === number ? number + "-ლი" : number < 20 || number <= 100 && number % 20 == 0 || number % 100 == 0 ? "მე-" + number : number + "-ე"; }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("km", { months: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), monthsShort: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), weekdays: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), weekdaysShort: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), weekdaysMin: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[ថ្ងៃនៈ ម៉ោង] LT", nextDay: "[ស្អែក ម៉ោង] LT", nextWeek: "dddd [ម៉ោង] LT", lastDay: "[ម្សិលមិញ ម៉ោង] LT", lastWeek: "dddd [សប្តាហ៍មុន] [ម៉ោង] LT", sameElse: "L" }, relativeTime: { future: "%sទៀត", past: "%sមុន", s: "ប៉ុន្មានវិនាទី", m: "មួយនាទី", mm: "%d នាទី", h: "មួយម៉ោង", hh: "%d ម៉ោង", d: "មួយថ្ងៃ", dd: "%d ថ្ងៃ", M: "មួយខែ", MM: "%d ខែ", y: "មួយឆ្នាំ", yy: "%d ឆ្នាំ" }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ko", { months: "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), monthsShort: "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), weekdays: "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"), weekdaysShort: "일_월_화_수_목_금_토".split("_"), weekdaysMin: "일_월_화_수_목_금_토".split("_"), longDateFormat: { LT: "A h시 m분", LTS: "A h시 m분 s초", L: "YYYY.MM.DD", LL: "YYYY년 MMMM D일", LLL: "YYYY년 MMMM D일 A h시 m분", LLLL: "YYYY년 MMMM D일 dddd A h시 m분" }, calendar: { sameDay: "오늘 LT", nextDay: "내일 LT", nextWeek: "dddd LT", lastDay: "어제 LT", lastWeek: "지난주 dddd LT", sameElse: "L" }, relativeTime: { future: "%s 후", past: "%s 전", s: "몇초", ss: "%d초", m: "일분", mm: "%d분", h: "한시간", hh: "%d시간", d: "하루", dd: "%d일", M: "한달", MM: "%d달", y: "일년", yy: "%d년" }, ordinalParse: /\d{1,2}일/, ordinal: "%d일", meridiemParse: /오전|오후/, isPM: function(token) { return "오후" === token; }, meridiem: function(hour, minute, isUpper) { return hour < 12 ? "오전" : "오후"; } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: [ "eng Minutt", "enger Minutt" ], h: [ "eng Stonn", "enger Stonn" ], d: [ "een Dag", "engem Dag" ], M: [ "ee Mount", "engem Mount" ], y: [ "ee Joer", "engem Joer" ] }; return withoutSuffix ? format[key][0] : format[key][1]; } function eifelerRegelAppliesToNumber(number) { if (number = parseInt(number, 10), isNaN(number)) return !1; if (number < 0) return !0; if (number < 10) return 4 <= number && number <= 7; if (number < 100) { var lastDigit = number % 10; return eifelerRegelAppliesToNumber(0 === lastDigit ? number / 10 : lastDigit); } if (number < 1e4) { for (;number >= 10; ) number /= 10; return eifelerRegelAppliesToNumber(number); } return eifelerRegelAppliesToNumber(number /= 1e3); } moment.defineLocale("lb", { months: "Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), monthsShort: "Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), weekdays: "Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"), weekdaysShort: "So._Mé._Dë._Më._Do._Fr._Sa.".split("_"), weekdaysMin: "So_Mé_Dë_Më_Do_Fr_Sa".split("_"), longDateFormat: { LT: "H:mm [Auer]", LTS: "H:mm:ss [Auer]", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm [Auer]", LLLL: "dddd, D. MMMM YYYY H:mm [Auer]" }, calendar: { sameDay: "[Haut um] LT", sameElse: "L", nextDay: "[Muer um] LT", nextWeek: "dddd [um] LT", lastDay: "[Gëschter um] LT", lastWeek: function() { switch (this.day()) { case 2: case 4: return "[Leschten] dddd [um] LT"; default: return "[Leschte] dddd [um] LT"; } } }, relativeTime: { future: function(string) { return eifelerRegelAppliesToNumber(string.substr(0, string.indexOf(" "))) ? "a " + string : "an " + string; }, past: function(string) { return eifelerRegelAppliesToNumber(string.substr(0, string.indexOf(" "))) ? "viru " + string : "virun " + string; }, s: "e puer Sekonnen", m: processRelativeTime, mm: "%d Minutten", h: processRelativeTime, hh: "%d Stonnen", d: processRelativeTime, dd: "%d Deeg", M: processRelativeTime, MM: "%d Méint", y: processRelativeTime, yy: "%d Joer" }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var units = { m: "minutė_minutės_minutę", mm: "minutės_minučių_minutes", h: "valanda_valandos_valandą", hh: "valandos_valandų_valandas", d: "diena_dienos_dieną", dd: "dienos_dienų_dienas", M: "mėnuo_mėnesio_mėnesį", MM: "mėnesiai_mėnesių_mėnesius", y: "metai_metų_metus", yy: "metai_metų_metus" }, weekDays = "sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"); function translateSingular(number, withoutSuffix, key, isFuture) { return withoutSuffix ? forms(key)[0] : isFuture ? forms(key)[1] : forms(key)[2]; } function special(number) { return number % 10 == 0 || number > 10 && number < 20; } function forms(key) { return units[key].split("_"); } function translate(number, withoutSuffix, key, isFuture) { var result = number + " "; return 1 === number ? result + translateSingular(0, withoutSuffix, key[0], isFuture) : withoutSuffix ? result + (special(number) ? forms(key)[1] : forms(key)[0]) : isFuture ? result + forms(key)[1] : result + (special(number) ? forms(key)[1] : forms(key)[2]); } moment.defineLocale("lt", { months: function(m, format) { return { nominative: "sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"), accusative: "sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_") }[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(format) ? "accusative" : "nominative"][m.month()]; }, monthsShort: "sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"), weekdays: function(moment, format) { var nominative = -1 === format.indexOf("dddd HH:mm"), weekDay = weekDays[moment.day()]; return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + "į"; }, weekdaysShort: "Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"), weekdaysMin: "S_P_A_T_K_Pn_Š".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY-MM-DD", LL: "YYYY [m.] MMMM D [d.]", LLL: "YYYY [m.] MMMM D [d.], HH:mm [val.]", LLLL: "YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]", l: "YYYY-MM-DD", ll: "YYYY [m.] MMMM D [d.]", lll: "YYYY [m.] MMMM D [d.], HH:mm [val.]", llll: "YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]" }, calendar: { sameDay: "[Šiandien] LT", nextDay: "[Rytoj] LT", nextWeek: "dddd LT", lastDay: "[Vakar] LT", lastWeek: "[Praėjusį] dddd LT", sameElse: "L" }, relativeTime: { future: "po %s", past: "prieš %s", s: function(number, withoutSuffix, key, isFuture) { return withoutSuffix ? "kelios sekundės" : isFuture ? "kelių sekundžių" : "kelias sekundes"; }, m: translateSingular, mm: translate, h: translateSingular, hh: translate, d: translateSingular, dd: translate, M: translateSingular, MM: translate, y: translateSingular, yy: translate }, ordinalParse: /\d{1,2}-oji/, ordinal: function(number) { return number + "-oji"; }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var units = { m: "minūtes_minūtēm_minūte_minūtes".split("_"), mm: "minūtes_minūtēm_minūte_minūtes".split("_"), h: "stundas_stundām_stunda_stundas".split("_"), hh: "stundas_stundām_stunda_stundas".split("_"), d: "dienas_dienām_diena_dienas".split("_"), dd: "dienas_dienām_diena_dienas".split("_"), M: "mēneša_mēnešiem_mēnesis_mēneši".split("_"), MM: "mēneša_mēnešiem_mēnesis_mēneši".split("_"), y: "gada_gadiem_gads_gadi".split("_"), yy: "gada_gadiem_gads_gadi".split("_") }; function format(forms, number, withoutSuffix) { return withoutSuffix ? number % 10 == 1 && 11 !== number ? forms[2] : forms[3] : number % 10 == 1 && 11 !== number ? forms[0] : forms[1]; } function relativeTimeWithPlural(number, withoutSuffix, key) { return number + " " + format(units[key], number, withoutSuffix); } function relativeTimeWithSingular(number, withoutSuffix, key) { return format(units[key], number, withoutSuffix); } moment.defineLocale("lv", { months: "janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"), monthsShort: "jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"), weekdays: "svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"), weekdaysShort: "Sv_P_O_T_C_Pk_S".split("_"), weekdaysMin: "Sv_P_O_T_C_Pk_S".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY.", LL: "YYYY. [gada] D. MMMM", LLL: "YYYY. [gada] D. MMMM, HH:mm", LLLL: "YYYY. [gada] D. MMMM, dddd, HH:mm" }, calendar: { sameDay: "[Šodien pulksten] LT", nextDay: "[Rīt pulksten] LT", nextWeek: "dddd [pulksten] LT", lastDay: "[Vakar pulksten] LT", lastWeek: "[Pagājušā] dddd [pulksten] LT", sameElse: "L" }, relativeTime: { future: "pēc %s", past: "pirms %s", s: function(number, withoutSuffix) { return withoutSuffix ? "dažas sekundes" : "dažām sekundēm"; }, m: relativeTimeWithSingular, mm: relativeTimeWithPlural, h: relativeTimeWithSingular, hh: relativeTimeWithPlural, d: relativeTimeWithSingular, dd: relativeTimeWithPlural, M: relativeTimeWithSingular, MM: relativeTimeWithPlural, y: relativeTimeWithSingular, yy: relativeTimeWithPlural }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var translator = { words: { m: [ "jedan minut", "jednog minuta" ], mm: [ "minut", "minuta", "minuta" ], h: [ "jedan sat", "jednog sata" ], hh: [ "sat", "sata", "sati" ], dd: [ "dan", "dana", "dana" ], MM: [ "mjesec", "mjeseca", "mjeseci" ], yy: [ "godina", "godine", "godina" ] }, correctGrammaticalCase: function(number, wordKey) { return 1 === number ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]; }, translate: function(number, withoutSuffix, key) { var wordKey = translator.words[key]; return 1 === key.length ? withoutSuffix ? wordKey[0] : wordKey[1] : number + " " + translator.correctGrammaticalCase(number, wordKey); } }; moment.defineLocale("me", { months: [ "januar", "februar", "mart", "april", "maj", "jun", "jul", "avgust", "septembar", "oktobar", "novembar", "decembar" ], monthsShort: [ "jan.", "feb.", "mar.", "apr.", "maj", "jun", "jul", "avg.", "sep.", "okt.", "nov.", "dec." ], weekdays: [ "nedjelja", "ponedjeljak", "utorak", "srijeda", "četvrtak", "petak", "subota" ], weekdaysShort: [ "ned.", "pon.", "uto.", "sri.", "čet.", "pet.", "sub." ], weekdaysMin: [ "ne", "po", "ut", "sr", "če", "pe", "su" ], longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD. MM. YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd, D. MMMM YYYY H:mm" }, calendar: { sameDay: "[danas u] LT", nextDay: "[sjutra u] LT", nextWeek: function() { switch (this.day()) { case 0: return "[u] [nedjelju] [u] LT"; case 3: return "[u] [srijedu] [u] LT"; case 6: return "[u] [subotu] [u] LT"; case 1: case 2: case 4: case 5: return "[u] dddd [u] LT"; } }, lastDay: "[juče u] LT", lastWeek: function() { return [ "[prošle] [nedjelje] [u] LT", "[prošlog] [ponedjeljka] [u] LT", "[prošlog] [utorka] [u] LT", "[prošle] [srijede] [u] LT", "[prošlog] [četvrtka] [u] LT", "[prošlog] [petka] [u] LT", "[prošle] [subote] [u] LT" ][this.day()]; }, sameElse: "L" }, relativeTime: { future: "za %s", past: "prije %s", s: "nekoliko sekundi", m: translator.translate, mm: translator.translate, h: translator.translate, hh: translator.translate, d: "dan", dd: translator.translate, M: "mjesec", MM: translator.translate, y: "godinu", yy: translator.translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("mk", { months: "јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"), monthsShort: "јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"), weekdays: "недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"), weekdaysShort: "нед_пон_вто_сре_чет_пет_саб".split("_"), weekdaysMin: "нe_пo_вт_ср_че_пе_сa".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "D.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY H:mm", LLLL: "dddd, D MMMM YYYY H:mm" }, calendar: { sameDay: "[Денес во] LT", nextDay: "[Утре во] LT", nextWeek: "dddd [во] LT", lastDay: "[Вчера во] LT", lastWeek: function() { switch (this.day()) { case 0: case 3: case 6: return "[Во изминатата] dddd [во] LT"; case 1: case 2: case 4: case 5: return "[Во изминатиот] dddd [во] LT"; } }, sameElse: "L" }, relativeTime: { future: "после %s", past: "пред %s", s: "неколку секунди", m: "минута", mm: "%d минути", h: "час", hh: "%d часа", d: "ден", dd: "%d дена", M: "месец", MM: "%d месеци", y: "година", yy: "%d години" }, ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, ordinal: function(number) { var lastDigit = number % 10, last2Digits = number % 100; return 0 === number ? number + "-ев" : 0 === last2Digits ? number + "-ен" : last2Digits > 10 && last2Digits < 20 ? number + "-ти" : 1 === lastDigit ? number + "-ви" : 2 === lastDigit ? number + "-ри" : 7 === lastDigit || 8 === lastDigit ? number + "-ми" : number + "-ти"; }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ml", { months: "ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"), monthsShort: "ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"), weekdays: "ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"), weekdaysShort: "ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"), weekdaysMin: "ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"), longDateFormat: { LT: "A h:mm -നു", LTS: "A h:mm:ss -നു", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY, A h:mm -നു", LLLL: "dddd, D MMMM YYYY, A h:mm -നു" }, calendar: { sameDay: "[ഇന്ന്] LT", nextDay: "[നാളെ] LT", nextWeek: "dddd, LT", lastDay: "[ഇന്നലെ] LT", lastWeek: "[കഴിഞ്ഞ] dddd, LT", sameElse: "L" }, relativeTime: { future: "%s കഴിഞ്ഞ്", past: "%s മുൻപ്", s: "അൽപ നിമിഷങ്ങൾ", m: "ഒരു മിനിറ്റ്", mm: "%d മിനിറ്റ്", h: "ഒരു മണിക്കൂർ", hh: "%d മണിക്കൂർ", d: "ഒരു ദിവസം", dd: "%d ദിവസം", M: "ഒരു മാസം", MM: "%d മാസം", y: "ഒരു വർഷം", yy: "%d വർഷം" }, meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, isPM: function(input) { return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input); }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "രാത്രി" : hour < 12 ? "രാവിലെ" : hour < 17 ? "ഉച്ച കഴിഞ്ഞ്" : hour < 20 ? "വൈകുന്നേരം" : "രാത്രി"; } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "१", 2: "२", 3: "३", 4: "४", 5: "५", 6: "६", 7: "७", 8: "८", 9: "९", 0: "०" }, numberMap = { "१": "1", "२": "2", "३": "3", "४": "4", "५": "5", "६": "6", "७": "7", "८": "8", "९": "9", "०": "0" }; moment.defineLocale("mr", { months: "जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"), monthsShort: "जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"), weekdays: "रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"), weekdaysShort: "रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"), weekdaysMin: "र_सो_मं_बु_गु_शु_श".split("_"), longDateFormat: { LT: "A h:mm वाजता", LTS: "A h:mm:ss वाजता", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY, A h:mm वाजता", LLLL: "dddd, D MMMM YYYY, A h:mm वाजता" }, calendar: { sameDay: "[आज] LT", nextDay: "[उद्या] LT", nextWeek: "dddd, LT", lastDay: "[काल] LT", lastWeek: "[मागील] dddd, LT", sameElse: "L" }, relativeTime: { future: "%s नंतर", past: "%s पूर्वी", s: "सेकंद", m: "एक मिनिट", mm: "%d मिनिटे", h: "एक तास", hh: "%d तास", d: "एक दिवस", dd: "%d दिवस", M: "एक महिना", MM: "%d महिने", y: "एक वर्ष", yy: "%d वर्षे" }, preparse: function(string) { return string.replace(/[१२३४५६७८९०]/g, (function(match) { return numberMap[match]; })); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })); }, meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "रात्री" === meridiem ? hour < 4 ? hour : hour + 12 : "सकाळी" === meridiem ? hour : "दुपारी" === meridiem ? hour >= 10 ? hour : hour + 12 : "सायंकाळी" === meridiem ? hour + 12 : void 0; }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "रात्री" : hour < 10 ? "सकाळी" : hour < 17 ? "दुपारी" : hour < 20 ? "सायंकाळी" : "रात्री"; }, week: { dow: 0, doy: 6 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ms", { months: "Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"), monthsShort: "Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"), weekdays: "Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"), weekdaysShort: "Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"), weekdaysMin: "Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"), longDateFormat: { LT: "HH.mm", LTS: "HH.mm.ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [pukul] HH.mm", LLLL: "dddd, D MMMM YYYY [pukul] HH.mm" }, meridiemParse: /pagi|tengahari|petang|malam/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "pagi" === meridiem ? hour : "tengahari" === meridiem ? hour >= 11 ? hour : hour + 12 : "petang" === meridiem || "malam" === meridiem ? hour + 12 : void 0; }, meridiem: function(hours, minutes, isLower) { return hours < 11 ? "pagi" : hours < 15 ? "tengahari" : hours < 19 ? "petang" : "malam"; }, calendar: { sameDay: "[Hari ini pukul] LT", nextDay: "[Esok pukul] LT", nextWeek: "dddd [pukul] LT", lastDay: "[Kelmarin pukul] LT", lastWeek: "dddd [lepas pukul] LT", sameElse: "L" }, relativeTime: { future: "dalam %s", past: "%s yang lepas", s: "beberapa saat", m: "seminit", mm: "%d minit", h: "sejam", hh: "%d jam", d: "sehari", dd: "%d hari", M: "sebulan", MM: "%d bulan", y: "setahun", yy: "%d tahun" }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ms-my", { months: "Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"), monthsShort: "Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"), weekdays: "Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"), weekdaysShort: "Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"), weekdaysMin: "Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"), longDateFormat: { LT: "HH.mm", LTS: "HH.mm.ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [pukul] HH.mm", LLLL: "dddd, D MMMM YYYY [pukul] HH.mm" }, meridiemParse: /pagi|tengahari|petang|malam/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "pagi" === meridiem ? hour : "tengahari" === meridiem ? hour >= 11 ? hour : hour + 12 : "petang" === meridiem || "malam" === meridiem ? hour + 12 : void 0; }, meridiem: function(hours, minutes, isLower) { return hours < 11 ? "pagi" : hours < 15 ? "tengahari" : hours < 19 ? "petang" : "malam"; }, calendar: { sameDay: "[Hari ini pukul] LT", nextDay: "[Esok pukul] LT", nextWeek: "dddd [pukul] LT", lastDay: "[Kelmarin pukul] LT", lastWeek: "dddd [lepas pukul] LT", sameElse: "L" }, relativeTime: { future: "dalam %s", past: "%s yang lepas", s: "beberapa saat", m: "seminit", mm: "%d minit", h: "sejam", hh: "%d jam", d: "sehari", dd: "%d hari", M: "sebulan", MM: "%d bulan", y: "setahun", yy: "%d tahun" }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "၁", 2: "၂", 3: "၃", 4: "၄", 5: "၅", 6: "၆", 7: "၇", 8: "၈", 9: "၉", 0: "၀" }, numberMap = { "၁": "1", "၂": "2", "၃": "3", "၄": "4", "၅": "5", "၆": "6", "၇": "7", "၈": "8", "၉": "9", "၀": "0" }; moment.defineLocale("my", { months: "ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"), monthsShort: "ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"), weekdays: "တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"), weekdaysShort: "နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"), weekdaysMin: "နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[ယနေ.] LT [မှာ]", nextDay: "[မနက်ဖြန်] LT [မှာ]", nextWeek: "dddd LT [မှာ]", lastDay: "[မနေ.က] LT [မှာ]", lastWeek: "[ပြီးခဲ့သော] dddd LT [မှာ]", sameElse: "L" }, relativeTime: { future: "လာမည့် %s မှာ", past: "လွန်ခဲ့သော %s က", s: "စက္ကန်.အနည်းငယ်", m: "တစ်မိနစ်", mm: "%d မိနစ်", h: "တစ်နာရီ", hh: "%d နာရီ", d: "တစ်ရက်", dd: "%d ရက်", M: "တစ်လ", MM: "%d လ", y: "တစ်နှစ်", yy: "%d နှစ်" }, preparse: function(string) { return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, (function(match) { return numberMap[match]; })); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("nb", { months: "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), monthsShort: "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), weekdays: "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), weekdaysShort: "søn_man_tirs_ons_tors_fre_lør".split("_"), weekdaysMin: "sø_ma_ti_on_to_fr_lø".split("_"), longDateFormat: { LT: "H.mm", LTS: "H.mm.ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY [kl.] H.mm", LLLL: "dddd D. MMMM YYYY [kl.] H.mm" }, calendar: { sameDay: "[i dag kl.] LT", nextDay: "[i morgen kl.] LT", nextWeek: "dddd [kl.] LT", lastDay: "[i går kl.] LT", lastWeek: "[forrige] dddd [kl.] LT", sameElse: "L" }, relativeTime: { future: "om %s", past: "for %s siden", s: "noen sekunder", m: "ett minutt", mm: "%d minutter", h: "en time", hh: "%d timer", d: "en dag", dd: "%d dager", M: "en måned", MM: "%d måneder", y: "ett år", yy: "%d år" }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var symbolMap = { 1: "१", 2: "२", 3: "३", 4: "४", 5: "५", 6: "६", 7: "७", 8: "८", 9: "९", 0: "०" }, numberMap = { "१": "1", "२": "2", "३": "3", "४": "4", "५": "5", "६": "6", "७": "7", "८": "8", "९": "9", "०": "0" }; moment.defineLocale("ne", { months: "जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"), monthsShort: "जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"), weekdays: "आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"), weekdaysShort: "आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"), weekdaysMin: "आइ._सो._मङ्_बु._बि._शु._श.".split("_"), longDateFormat: { LT: "Aको h:mm बजे", LTS: "Aको h:mm:ss बजे", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY, Aको h:mm बजे", LLLL: "dddd, D MMMM YYYY, Aको h:mm बजे" }, preparse: function(string) { return string.replace(/[१२३४५६७८९०]/g, (function(match) { return numberMap[match]; })); }, postformat: function(string) { return string.replace(/\d/g, (function(match) { return symbolMap[match]; })); }, meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "राती" === meridiem ? hour < 3 ? hour : hour + 12 : "बिहान" === meridiem ? hour : "दिउँसो" === meridiem ? hour >= 10 ? hour : hour + 12 : "बेलुका" === meridiem || "साँझ" === meridiem ? hour + 12 : void 0; }, meridiem: function(hour, minute, isLower) { return hour < 3 ? "राती" : hour < 10 ? "बिहान" : hour < 15 ? "दिउँसो" : hour < 18 ? "बेलुका" : hour < 20 ? "साँझ" : "राती"; }, calendar: { sameDay: "[आज] LT", nextDay: "[भोली] LT", nextWeek: "[आउँदो] dddd[,] LT", lastDay: "[हिजो] LT", lastWeek: "[गएको] dddd[,] LT", sameElse: "L" }, relativeTime: { future: "%sमा", past: "%s अगाडी", s: "केही समय", m: "एक मिनेट", mm: "%d मिनेट", h: "एक घण्टा", hh: "%d घण्टा", d: "एक दिन", dd: "%d दिन", M: "एक महिना", MM: "%d महिना", y: "एक बर्ष", yy: "%d बर्ष" }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var monthsShortWithDots = "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"), monthsShortWithoutDots = "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"); moment.defineLocale("nl", { months: "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"), monthsShort: function(m, format) { return /-MMM-/.test(format) ? monthsShortWithoutDots[m.month()] : monthsShortWithDots[m.month()]; }, weekdays: "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"), weekdaysShort: "zo._ma._di._wo._do._vr._za.".split("_"), weekdaysMin: "Zo_Ma_Di_Wo_Do_Vr_Za".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD-MM-YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[vandaag om] LT", nextDay: "[morgen om] LT", nextWeek: "dddd [om] LT", lastDay: "[gisteren om] LT", lastWeek: "[afgelopen] dddd [om] LT", sameElse: "L" }, relativeTime: { future: "over %s", past: "%s geleden", s: "een paar seconden", m: "één minuut", mm: "%d minuten", h: "één uur", hh: "%d uur", d: "één dag", dd: "%d dagen", M: "één maand", MM: "%d maanden", y: "één jaar", yy: "%d jaar" }, ordinalParse: /\d{1,2}(ste|de)/, ordinal: function(number) { return number + (1 === number || 8 === number || number >= 20 ? "ste" : "de"); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("nn", { months: "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), monthsShort: "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), weekdays: "sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"), weekdaysShort: "sun_mån_tys_ons_tor_fre_lau".split("_"), weekdaysMin: "su_må_ty_on_to_fr_lø".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[I dag klokka] LT", nextDay: "[I morgon klokka] LT", nextWeek: "dddd [klokka] LT", lastDay: "[I går klokka] LT", lastWeek: "[Føregåande] dddd [klokka] LT", sameElse: "L" }, relativeTime: { future: "om %s", past: "for %s sidan", s: "nokre sekund", m: "eit minutt", mm: "%d minutt", h: "ein time", hh: "%d timar", d: "ein dag", dd: "%d dagar", M: "ein månad", MM: "%d månader", y: "eit år", yy: "%d år" }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var monthsNominative = "styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"), monthsSubjective = "stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"); function plural(n) { return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 != 1; } function translate(number, withoutSuffix, key) { var result = number + " "; switch (key) { case "m": return withoutSuffix ? "minuta" : "minutę"; case "mm": return result + (plural(number) ? "minuty" : "minut"); case "h": return withoutSuffix ? "godzina" : "godzinę"; case "hh": return result + (plural(number) ? "godziny" : "godzin"); case "MM": return result + (plural(number) ? "miesiące" : "miesięcy"); case "yy": return result + (plural(number) ? "lata" : "lat"); } } moment.defineLocale("pl", { months: function(momentToFormat, format) { return "" === format ? "(" + monthsSubjective[momentToFormat.month()] + "|" + monthsNominative[momentToFormat.month()] + ")" : /D MMMM/.test(format) ? monthsSubjective[momentToFormat.month()] : monthsNominative[momentToFormat.month()]; }, monthsShort: "sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"), weekdays: "niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"), weekdaysShort: "nie_pon_wt_śr_czw_pt_sb".split("_"), weekdaysMin: "N_Pn_Wt_Śr_Cz_Pt_So".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Dziś o] LT", nextDay: "[Jutro o] LT", nextWeek: "[W] dddd [o] LT", lastDay: "[Wczoraj o] LT", lastWeek: function() { switch (this.day()) { case 0: return "[W zeszłą niedzielę o] LT"; case 3: return "[W zeszłą środę o] LT"; case 6: return "[W zeszłą sobotę o] LT"; default: return "[W zeszły] dddd [o] LT"; } }, sameElse: "L" }, relativeTime: { future: "za %s", past: "%s temu", s: "kilka sekund", m: translate, mm: translate, h: translate, hh: translate, d: "1 dzień", dd: "%d dni", M: "miesiąc", MM: translate, y: "rok", yy: translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("pt", { months: "Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"), monthsShort: "Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"), weekdays: "Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"), weekdaysShort: "Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"), weekdaysMin: "Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY HH:mm", LLLL: "dddd, D [de] MMMM [de] YYYY HH:mm" }, calendar: { sameDay: "[Hoje às] LT", nextDay: "[Amanhã às] LT", nextWeek: "dddd [às] LT", lastDay: "[Ontem às] LT", lastWeek: function() { return 0 === this.day() || 6 === this.day() ? "[Último] dddd [às] LT" : "[Última] dddd [às] LT"; }, sameElse: "L" }, relativeTime: { future: "em %s", past: "há %s", s: "segundos", m: "um minuto", mm: "%d minutos", h: "uma hora", hh: "%d horas", d: "um dia", dd: "%d dias", M: "um mês", MM: "%d meses", y: "um ano", yy: "%d anos" }, ordinalParse: /\d{1,2}º/, ordinal: "%dº", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("pt-br", { months: "Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"), monthsShort: "Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"), weekdays: "Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"), weekdaysShort: "Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"), weekdaysMin: "Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY [às] HH:mm", LLLL: "dddd, D [de] MMMM [de] YYYY [às] HH:mm" }, calendar: { sameDay: "[Hoje às] LT", nextDay: "[Amanhã às] LT", nextWeek: "dddd [às] LT", lastDay: "[Ontem às] LT", lastWeek: function() { return 0 === this.day() || 6 === this.day() ? "[Último] dddd [às] LT" : "[Última] dddd [às] LT"; }, sameElse: "L" }, relativeTime: { future: "em %s", past: "%s atrás", s: "poucos segundos", m: "um minuto", mm: "%d minutos", h: "uma hora", hh: "%d horas", d: "um dia", dd: "%d dias", M: "um mês", MM: "%d meses", y: "um ano", yy: "%d anos" }, ordinalParse: /\d{1,2}º/, ordinal: "%dº" }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function relativeTimeWithPlural(number, withoutSuffix, key) { var separator = " "; return (number % 100 >= 20 || number >= 100 && number % 100 == 0) && (separator = " de "), number + separator + { mm: "minute", hh: "ore", dd: "zile", MM: "luni", yy: "ani" }[key]; } moment.defineLocale("ro", { months: "ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"), monthsShort: "ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"), weekdays: "duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"), weekdaysShort: "Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"), weekdaysMin: "Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY H:mm", LLLL: "dddd, D MMMM YYYY H:mm" }, calendar: { sameDay: "[azi la] LT", nextDay: "[mâine la] LT", nextWeek: "dddd [la] LT", lastDay: "[ieri la] LT", lastWeek: "[fosta] dddd [la] LT", sameElse: "L" }, relativeTime: { future: "peste %s", past: "%s în urmă", s: "câteva secunde", m: "un minut", mm: relativeTimeWithPlural, h: "o oră", hh: relativeTimeWithPlural, d: "o zi", dd: relativeTimeWithPlural, M: "o lună", MM: relativeTimeWithPlural, y: "un an", yy: relativeTimeWithPlural }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function relativeTimeWithPlural(number, withoutSuffix, key) { return "m" === key ? withoutSuffix ? "минута" : "минуту" : number + " " + (num = +number, forms = { mm: withoutSuffix ? "минута_минуты_минут" : "минуту_минуты_минут", hh: "час_часа_часов", dd: "день_дня_дней", MM: "месяц_месяца_месяцев", yy: "год_года_лет" }[key].split("_"), num % 10 == 1 && num % 100 != 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); var num, forms; } moment.defineLocale("ru", { months: function(m, format) { return { nominative: "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), accusative: "января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_") }[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(format) ? "accusative" : "nominative"][m.month()]; }, monthsShort: function(m, format) { return { nominative: "янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"), accusative: "янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_") }[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(format) ? "accusative" : "nominative"][m.month()]; }, weekdays: function(m, format) { return { nominative: "воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"), accusative: "воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_") }[/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/.test(format) ? "accusative" : "nominative"][m.day()]; }, weekdaysShort: "вс_пн_вт_ср_чт_пт_сб".split("_"), weekdaysMin: "вс_пн_вт_ср_чт_пт_сб".split("_"), monthsParse: [ /^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i ], longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY г.", LLL: "D MMMM YYYY г., HH:mm", LLLL: "dddd, D MMMM YYYY г., HH:mm" }, calendar: { sameDay: "[Сегодня в] LT", nextDay: "[Завтра в] LT", lastDay: "[Вчера в] LT", nextWeek: function() { return 2 === this.day() ? "[Во] dddd [в] LT" : "[В] dddd [в] LT"; }, lastWeek: function(now) { if (now.week() === this.week()) return 2 === this.day() ? "[Во] dddd [в] LT" : "[В] dddd [в] LT"; switch (this.day()) { case 0: return "[В прошлое] dddd [в] LT"; case 1: case 2: case 4: return "[В прошлый] dddd [в] LT"; case 3: case 5: case 6: return "[В прошлую] dddd [в] LT"; } }, sameElse: "L" }, relativeTime: { future: "через %s", past: "%s назад", s: "несколько секунд", m: relativeTimeWithPlural, mm: relativeTimeWithPlural, h: "час", hh: relativeTimeWithPlural, d: "день", dd: relativeTimeWithPlural, M: "месяц", MM: relativeTimeWithPlural, y: "год", yy: relativeTimeWithPlural }, meridiemParse: /ночи|утра|дня|вечера/i, isPM: function(input) { return /^(дня|вечера)$/.test(input); }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "ночи" : hour < 12 ? "утра" : hour < 17 ? "дня" : "вечера"; }, ordinalParse: /\d{1,2}-(й|го|я)/, ordinal: function(number, period) { switch (period) { case "M": case "d": case "DDD": return number + "-й"; case "D": return number + "-го"; case "w": case "W": return number + "-я"; default: return number; } }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("si", { months: "ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"), monthsShort: "ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"), weekdays: "ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"), weekdaysShort: "ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"), weekdaysMin: "ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"), longDateFormat: { LT: "a h:mm", LTS: "a h:mm:ss", L: "YYYY/MM/DD", LL: "YYYY MMMM D", LLL: "YYYY MMMM D, a h:mm", LLLL: "YYYY MMMM D [වැනි] dddd, a h:mm:ss" }, calendar: { sameDay: "[අද] LT[ට]", nextDay: "[හෙට] LT[ට]", nextWeek: "dddd LT[ට]", lastDay: "[ඊයේ] LT[ට]", lastWeek: "[පසුගිය] dddd LT[ට]", sameElse: "L" }, relativeTime: { future: "%sකින්", past: "%sකට පෙර", s: "තත්පර කිහිපය", m: "මිනිත්තුව", mm: "මිනිත්තු %d", h: "පැය", hh: "පැය %d", d: "දිනය", dd: "දින %d", M: "මාසය", MM: "මාස %d", y: "වසර", yy: "වසර %d" }, ordinalParse: /\d{1,2} වැනි/, ordinal: function(number) { return number + " වැනි"; }, meridiem: function(hours, minutes, isLower) { return hours > 11 ? isLower ? "ප.ව." : "පස් වරු" : isLower ? "පෙ.ව." : "පෙර වරු"; } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var months = "január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"), monthsShort = "jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"); function plural(n) { return n > 1 && n < 5; } function translate(number, withoutSuffix, key, isFuture) { var result = number + " "; switch (key) { case "s": return withoutSuffix || isFuture ? "pár sekúnd" : "pár sekundami"; case "m": return withoutSuffix ? "minúta" : isFuture ? "minútu" : "minútou"; case "mm": return withoutSuffix || isFuture ? result + (plural(number) ? "minúty" : "minút") : result + "minútami"; case "h": return withoutSuffix ? "hodina" : isFuture ? "hodinu" : "hodinou"; case "hh": return withoutSuffix || isFuture ? result + (plural(number) ? "hodiny" : "hodín") : result + "hodinami"; case "d": return withoutSuffix || isFuture ? "deň" : "dňom"; case "dd": return withoutSuffix || isFuture ? result + (plural(number) ? "dni" : "dní") : result + "dňami"; case "M": return withoutSuffix || isFuture ? "mesiac" : "mesiacom"; case "MM": return withoutSuffix || isFuture ? result + (plural(number) ? "mesiace" : "mesiacov") : result + "mesiacmi"; case "y": return withoutSuffix || isFuture ? "rok" : "rokom"; case "yy": return withoutSuffix || isFuture ? result + (plural(number) ? "roky" : "rokov") : result + "rokmi"; } } moment.defineLocale("sk", { months: months, monthsShort: monthsShort, monthsParse: (function(months, monthsShort) { var i, _monthsParse = []; for (i = 0; i < 12; i++) _monthsParse[i] = new RegExp("^" + months[i] + "$|^" + monthsShort[i] + "$", "i"); return _monthsParse; })(months, monthsShort), weekdays: "nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"), weekdaysShort: "ne_po_ut_st_št_pi_so".split("_"), weekdaysMin: "ne_po_ut_st_št_pi_so".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd D. MMMM YYYY H:mm" }, calendar: { sameDay: "[dnes o] LT", nextDay: "[zajtra o] LT", nextWeek: function() { switch (this.day()) { case 0: return "[v nedeľu o] LT"; case 1: case 2: return "[v] dddd [o] LT"; case 3: return "[v stredu o] LT"; case 4: return "[vo štvrtok o] LT"; case 5: return "[v piatok o] LT"; case 6: return "[v sobotu o] LT"; } }, lastDay: "[včera o] LT", lastWeek: function() { switch (this.day()) { case 0: return "[minulú nedeľu o] LT"; case 1: case 2: case 4: case 5: return "[minulý] dddd [o] LT"; case 3: return "[minulú stredu o] LT"; case 6: return "[minulú sobotu o] LT"; } }, sameElse: "L" }, relativeTime: { future: "za %s", past: "pred %s", s: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function processRelativeTime(number, withoutSuffix, key, isFuture) { var result = number + " "; switch (key) { case "s": return withoutSuffix || isFuture ? "nekaj sekund" : "nekaj sekundami"; case "m": return withoutSuffix ? "ena minuta" : "eno minuto"; case "mm": return result + (1 === number ? withoutSuffix ? "minuta" : "minuto" : 2 === number ? withoutSuffix || isFuture ? "minuti" : "minutama" : number < 5 ? withoutSuffix || isFuture ? "minute" : "minutami" : withoutSuffix || isFuture ? "minut" : "minutami"); case "h": return withoutSuffix ? "ena ura" : "eno uro"; case "hh": return result + (1 === number ? withoutSuffix ? "ura" : "uro" : 2 === number ? withoutSuffix || isFuture ? "uri" : "urama" : number < 5 ? withoutSuffix || isFuture ? "ure" : "urami" : withoutSuffix || isFuture ? "ur" : "urami"); case "d": return withoutSuffix || isFuture ? "en dan" : "enim dnem"; case "dd": return result + (1 === number ? withoutSuffix || isFuture ? "dan" : "dnem" : 2 === number ? withoutSuffix || isFuture ? "dni" : "dnevoma" : withoutSuffix || isFuture ? "dni" : "dnevi"); case "M": return withoutSuffix || isFuture ? "en mesec" : "enim mesecem"; case "MM": return result + (1 === number ? withoutSuffix || isFuture ? "mesec" : "mesecem" : 2 === number ? withoutSuffix || isFuture ? "meseca" : "mesecema" : number < 5 ? withoutSuffix || isFuture ? "mesece" : "meseci" : withoutSuffix || isFuture ? "mesecev" : "meseci"); case "y": return withoutSuffix || isFuture ? "eno leto" : "enim letom"; case "yy": return result + (1 === number ? withoutSuffix || isFuture ? "leto" : "letom" : 2 === number ? withoutSuffix || isFuture ? "leti" : "letoma" : number < 5 ? withoutSuffix || isFuture ? "leta" : "leti" : withoutSuffix || isFuture ? "let" : "leti"); } } moment.defineLocale("sl", { months: "januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"), monthsShort: "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), weekdays: "nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"), weekdaysShort: "ned._pon._tor._sre._čet._pet._sob.".split("_"), weekdaysMin: "ne_po_to_sr_če_pe_so".split("_"), longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD. MM. YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd, D. MMMM YYYY H:mm" }, calendar: { sameDay: "[danes ob] LT", nextDay: "[jutri ob] LT", nextWeek: function() { switch (this.day()) { case 0: return "[v] [nedeljo] [ob] LT"; case 3: return "[v] [sredo] [ob] LT"; case 6: return "[v] [soboto] [ob] LT"; case 1: case 2: case 4: case 5: return "[v] dddd [ob] LT"; } }, lastDay: "[včeraj ob] LT", lastWeek: function() { switch (this.day()) { case 0: return "[prejšnjo] [nedeljo] [ob] LT"; case 3: return "[prejšnjo] [sredo] [ob] LT"; case 6: return "[prejšnjo] [soboto] [ob] LT"; case 1: case 2: case 4: case 5: return "[prejšnji] dddd [ob] LT"; } }, sameElse: "L" }, relativeTime: { future: "čez %s", past: "pred %s", s: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("sq", { months: "Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"), monthsShort: "Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"), weekdays: "E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"), weekdaysShort: "Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"), weekdaysMin: "D_H_Ma_Më_E_P_Sh".split("_"), meridiemParse: /PD|MD/, isPM: function(input) { return "M" === input.charAt(0); }, meridiem: function(hours, minutes, isLower) { return hours < 12 ? "PD" : "MD"; }, longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Sot në] LT", nextDay: "[Nesër në] LT", nextWeek: "dddd [në] LT", lastDay: "[Dje në] LT", lastWeek: "dddd [e kaluar në] LT", sameElse: "L" }, relativeTime: { future: "në %s", past: "%s më parë", s: "disa sekonda", m: "një minutë", mm: "%d minuta", h: "një orë", hh: "%d orë", d: "një ditë", dd: "%d ditë", M: "një muaj", MM: "%d muaj", y: "një vit", yy: "%d vite" }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var translator = { words: { m: [ "jedan minut", "jedne minute" ], mm: [ "minut", "minute", "minuta" ], h: [ "jedan sat", "jednog sata" ], hh: [ "sat", "sata", "sati" ], dd: [ "dan", "dana", "dana" ], MM: [ "mesec", "meseca", "meseci" ], yy: [ "godina", "godine", "godina" ] }, correctGrammaticalCase: function(number, wordKey) { return 1 === number ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]; }, translate: function(number, withoutSuffix, key) { var wordKey = translator.words[key]; return 1 === key.length ? withoutSuffix ? wordKey[0] : wordKey[1] : number + " " + translator.correctGrammaticalCase(number, wordKey); } }; moment.defineLocale("sr", { months: [ "januar", "februar", "mart", "april", "maj", "jun", "jul", "avgust", "septembar", "oktobar", "novembar", "decembar" ], monthsShort: [ "jan.", "feb.", "mar.", "apr.", "maj", "jun", "jul", "avg.", "sep.", "okt.", "nov.", "dec." ], weekdays: [ "nedelja", "ponedeljak", "utorak", "sreda", "četvrtak", "petak", "subota" ], weekdaysShort: [ "ned.", "pon.", "uto.", "sre.", "čet.", "pet.", "sub." ], weekdaysMin: [ "ne", "po", "ut", "sr", "če", "pe", "su" ], longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD. MM. YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd, D. MMMM YYYY H:mm" }, calendar: { sameDay: "[danas u] LT", nextDay: "[sutra u] LT", nextWeek: function() { switch (this.day()) { case 0: return "[u] [nedelju] [u] LT"; case 3: return "[u] [sredu] [u] LT"; case 6: return "[u] [subotu] [u] LT"; case 1: case 2: case 4: case 5: return "[u] dddd [u] LT"; } }, lastDay: "[juče u] LT", lastWeek: function() { return [ "[prošle] [nedelje] [u] LT", "[prošlog] [ponedeljka] [u] LT", "[prošlog] [utorka] [u] LT", "[prošle] [srede] [u] LT", "[prošlog] [četvrtka] [u] LT", "[prošlog] [petka] [u] LT", "[prošle] [subote] [u] LT" ][this.day()]; }, sameElse: "L" }, relativeTime: { future: "za %s", past: "pre %s", s: "nekoliko sekundi", m: translator.translate, mm: translator.translate, h: translator.translate, hh: translator.translate, d: "dan", dd: translator.translate, M: "mesec", MM: translator.translate, y: "godinu", yy: translator.translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var translator = { words: { m: [ "један минут", "једне минуте" ], mm: [ "минут", "минуте", "минута" ], h: [ "један сат", "једног сата" ], hh: [ "сат", "сата", "сати" ], dd: [ "дан", "дана", "дана" ], MM: [ "месец", "месеца", "месеци" ], yy: [ "година", "године", "година" ] }, correctGrammaticalCase: function(number, wordKey) { return 1 === number ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]; }, translate: function(number, withoutSuffix, key) { var wordKey = translator.words[key]; return 1 === key.length ? withoutSuffix ? wordKey[0] : wordKey[1] : number + " " + translator.correctGrammaticalCase(number, wordKey); } }; moment.defineLocale("sr-cyrl", { months: [ "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар" ], monthsShort: [ "јан.", "феб.", "мар.", "апр.", "мај", "јун", "јул", "авг.", "сеп.", "окт.", "нов.", "дец." ], weekdays: [ "недеља", "понедељак", "уторак", "среда", "четвртак", "петак", "субота" ], weekdaysShort: [ "нед.", "пон.", "уто.", "сре.", "чет.", "пет.", "суб." ], weekdaysMin: [ "не", "по", "ут", "ср", "че", "пе", "су" ], longDateFormat: { LT: "H:mm", LTS: "H:mm:ss", L: "DD. MM. YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd, D. MMMM YYYY H:mm" }, calendar: { sameDay: "[данас у] LT", nextDay: "[сутра у] LT", nextWeek: function() { switch (this.day()) { case 0: return "[у] [недељу] [у] LT"; case 3: return "[у] [среду] [у] LT"; case 6: return "[у] [суботу] [у] LT"; case 1: case 2: case 4: case 5: return "[у] dddd [у] LT"; } }, lastDay: "[јуче у] LT", lastWeek: function() { return [ "[прошле] [недеље] [у] LT", "[прошлог] [понедељка] [у] LT", "[прошлог] [уторка] [у] LT", "[прошле] [среде] [у] LT", "[прошлог] [четвртка] [у] LT", "[прошлог] [петка] [у] LT", "[прошле] [суботе] [у] LT" ][this.day()]; }, sameElse: "L" }, relativeTime: { future: "за %s", past: "пре %s", s: "неколико секунди", m: translator.translate, mm: translator.translate, h: translator.translate, hh: translator.translate, d: "дан", dd: translator.translate, M: "месец", MM: translator.translate, y: "годину", yy: translator.translate }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("sv", { months: "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"), monthsShort: "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), weekdays: "söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"), weekdaysShort: "sön_mån_tis_ons_tor_fre_lör".split("_"), weekdaysMin: "sö_må_ti_on_to_fr_lö".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY-MM-DD", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[Idag] LT", nextDay: "[Imorgon] LT", lastDay: "[Igår] LT", nextWeek: "[På] dddd LT", lastWeek: "[I] dddd[s] LT", sameElse: "L" }, relativeTime: { future: "om %s", past: "för %s sedan", s: "några sekunder", m: "en minut", mm: "%d minuter", h: "en timme", hh: "%d timmar", d: "en dag", dd: "%d dagar", M: "en månad", MM: "%d månader", y: "ett år", yy: "%d år" }, ordinalParse: /\d{1,2}(e|a)/, ordinal: function(number) { var b = number % 10; return number + (1 == ~~(number % 100 / 10) ? "e" : 1 === b || 2 === b ? "a" : "e"); }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("ta", { months: "ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"), monthsShort: "ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"), weekdays: "ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"), weekdaysShort: "ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"), weekdaysMin: "ஞா_தி_செ_பு_வி_வெ_ச".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY, HH:mm", LLLL: "dddd, D MMMM YYYY, HH:mm" }, calendar: { sameDay: "[இன்று] LT", nextDay: "[நாளை] LT", nextWeek: "dddd, LT", lastDay: "[நேற்று] LT", lastWeek: "[கடந்த வாரம்] dddd, LT", sameElse: "L" }, relativeTime: { future: "%s இல்", past: "%s முன்", s: "ஒரு சில விநாடிகள்", m: "ஒரு நிமிடம்", mm: "%d நிமிடங்கள்", h: "ஒரு மணி நேரம்", hh: "%d மணி நேரம்", d: "ஒரு நாள்", dd: "%d நாட்கள்", M: "ஒரு மாதம்", MM: "%d மாதங்கள்", y: "ஒரு வருடம்", yy: "%d ஆண்டுகள்" }, ordinalParse: /\d{1,2}வது/, ordinal: function(number) { return number + "வது"; }, meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, meridiem: function(hour, minute, isLower) { return hour < 2 ? " யாமம்" : hour < 6 ? " வைகறை" : hour < 10 ? " காலை" : hour < 14 ? " நண்பகல்" : hour < 18 ? " எற்பாடு" : hour < 22 ? " மாலை" : " யாமம்"; }, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "யாமம்" === meridiem ? hour < 2 ? hour : hour + 12 : "வைகறை" === meridiem || "காலை" === meridiem || "நண்பகல்" === meridiem && hour >= 10 ? hour : hour + 12; }, week: { dow: 0, doy: 6 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("th", { months: "มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"), monthsShort: "มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"), weekdays: "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"), weekdaysShort: "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"), weekdaysMin: "อา._จ._อ._พ._พฤ._ศ._ส.".split("_"), longDateFormat: { LT: "H นาฬิกา m นาที", LTS: "H นาฬิกา m นาที s วินาที", L: "YYYY/MM/DD", LL: "D MMMM YYYY", LLL: "D MMMM YYYY เวลา H นาฬิกา m นาที", LLLL: "วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที" }, meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/, isPM: function(input) { return "หลังเที่ยง" === input; }, meridiem: function(hour, minute, isLower) { return hour < 12 ? "ก่อนเที่ยง" : "หลังเที่ยง"; }, calendar: { sameDay: "[วันนี้ เวลา] LT", nextDay: "[พรุ่งนี้ เวลา] LT", nextWeek: "dddd[หน้า เวลา] LT", lastDay: "[เมื่อวานนี้ เวลา] LT", lastWeek: "[วัน]dddd[ที่แล้ว เวลา] LT", sameElse: "L" }, relativeTime: { future: "อีก %s", past: "%sที่แล้ว", s: "ไม่กี่วินาที", m: "1 นาที", mm: "%d นาที", h: "1 ชั่วโมง", hh: "%d ชั่วโมง", d: "1 วัน", dd: "%d วัน", M: "1 เดือน", MM: "%d เดือน", y: "1 ปี", yy: "%d ปี" } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("tl-ph", { months: "Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"), monthsShort: "Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"), weekdays: "Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"), weekdaysShort: "Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"), weekdaysMin: "Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "MM/D/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY HH:mm", LLLL: "dddd, MMMM DD, YYYY HH:mm" }, calendar: { sameDay: "[Ngayon sa] LT", nextDay: "[Bukas sa] LT", nextWeek: "dddd [sa] LT", lastDay: "[Kahapon sa] LT", lastWeek: "dddd [huling linggo] LT", sameElse: "L" }, relativeTime: { future: "sa loob ng %s", past: "%s ang nakalipas", s: "ilang segundo", m: "isang minuto", mm: "%d minuto", h: "isang oras", hh: "%d oras", d: "isang araw", dd: "%d araw", M: "isang buwan", MM: "%d buwan", y: "isang taon", yy: "%d taon" }, ordinalParse: /\d{1,2}/, ordinal: function(number) { return number; }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; var suffixes = { 1: "'inci", 5: "'inci", 8: "'inci", 70: "'inci", 80: "'inci", 2: "'nci", 7: "'nci", 20: "'nci", 50: "'nci", 3: "'üncü", 4: "'üncü", 100: "'üncü", 6: "'ncı", 9: "'uncu", 10: "'uncu", 30: "'uncu", 60: "'ıncı", 90: "'ıncı" }; moment.defineLocale("tr", { months: "Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"), monthsShort: "Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"), weekdays: "Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"), weekdaysShort: "Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"), weekdaysMin: "Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm" }, calendar: { sameDay: "[bugün saat] LT", nextDay: "[yarın saat] LT", nextWeek: "[haftaya] dddd [saat] LT", lastDay: "[dün] LT", lastWeek: "[geçen hafta] dddd [saat] LT", sameElse: "L" }, relativeTime: { future: "%s sonra", past: "%s önce", s: "birkaç saniye", m: "bir dakika", mm: "%d dakika", h: "bir saat", hh: "%d saat", d: "bir gün", dd: "%d gün", M: "bir ay", MM: "%d ay", y: "bir yıl", yy: "%d yıl" }, ordinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/, ordinal: function(number) { if (0 === number) return number + "'ıncı"; var a = number % 10; return number + (suffixes[a] || suffixes[number % 100 - a] || suffixes[number >= 100 ? 100 : null]); }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: [ "viensas secunds", "'iensas secunds" ], m: [ "'n míut", "'iens míut" ], mm: [ number + " míuts", " " + number + " míuts" ], h: [ "'n þora", "'iensa þora" ], hh: [ number + " þoras", " " + number + " þoras" ], d: [ "'n ziua", "'iensa ziua" ], dd: [ number + " ziuas", " " + number + " ziuas" ], M: [ "'n mes", "'iens mes" ], MM: [ number + " mesen", " " + number + " mesen" ], y: [ "'n ar", "'iens ar" ], yy: [ number + " ars", " " + number + " ars" ] }; return isFuture || withoutSuffix ? format[key][0] : format[key][1].trim(); } moment.defineLocale("tzl", { months: "Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"), monthsShort: "Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"), weekdays: "Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"), weekdaysShort: "Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"), weekdaysMin: "Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"), longDateFormat: { LT: "HH.mm", LTS: "LT.ss", L: "DD.MM.YYYY", LL: "D. MMMM [dallas] YYYY", LLL: "D. MMMM [dallas] YYYY LT", LLLL: "dddd, [li] D. MMMM [dallas] YYYY LT" }, meridiem: function(hours, minutes, isLower) { return hours > 11 ? isLower ? "d'o" : "D'O" : isLower ? "d'a" : "D'A"; }, calendar: { sameDay: "[oxhi à] LT", nextDay: "[demà à] LT", nextWeek: "dddd [à] LT", lastDay: "[ieiri à] LT", lastWeek: "[sür el] dddd [lasteu à] LT", sameElse: "L" }, relativeTime: { future: "osprei %s", past: "ja%s", s: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime }, ordinalParse: /\d{1,2}\./, ordinal: "%d.", week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("tzm", { months: "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), monthsShort: "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), weekdays: "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), weekdaysShort: "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), weekdaysMin: "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[ⴰⵙⴷⵅ ⴴ] LT", nextDay: "[ⴰⵙⴽⴰ ⴴ] LT", nextWeek: "dddd [ⴴ] LT", lastDay: "[ⴰⵚⴰⵏⵜ ⴴ] LT", lastWeek: "dddd [ⴴ] LT", sameElse: "L" }, relativeTime: { future: "ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s", past: "ⵢⴰⵏ %s", s: "ⵉⵎⵉⴽ", m: "ⵎⵉⵏⵓⴺ", mm: "%d ⵎⵉⵏⵓⴺ", h: "ⵙⴰⵄⴰ", hh: "%d ⵜⴰⵙⵙⴰⵄⵉⵏ", d: "ⴰⵙⵙ", dd: "%d oⵙⵙⴰⵏ", M: "ⴰⵢoⵓⵔ", MM: "%d ⵉⵢⵢⵉⵔⵏ", y: "ⴰⵙⴳⴰⵙ", yy: "%d ⵉⵙⴳⴰⵙⵏ" }, week: { dow: 6, doy: 12 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("tzm-latn", { months: "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), monthsShort: "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), weekdays: "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), weekdaysShort: "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), weekdaysMin: "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, calendar: { sameDay: "[asdkh g] LT", nextDay: "[aska g] LT", nextWeek: "dddd [g] LT", lastDay: "[assant g] LT", lastWeek: "dddd [g] LT", sameElse: "L" }, relativeTime: { future: "dadkh s yan %s", past: "yan %s", s: "imik", m: "minuḍ", mm: "%d minuḍ", h: "saɛa", hh: "%d tassaɛin", d: "ass", dd: "%d ossan", M: "ayowr", MM: "%d iyyirn", y: "asgas", yy: "%d isgasn" }, week: { dow: 6, doy: 12 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; function relativeTimeWithPlural(number, withoutSuffix, key) { return "m" === key ? withoutSuffix ? "хвилина" : "хвилину" : "h" === key ? withoutSuffix ? "година" : "годину" : number + " " + (num = +number, forms = { mm: "хвилина_хвилини_хвилин", hh: "година_години_годин", dd: "день_дні_днів", MM: "місяць_місяці_місяців", yy: "рік_роки_років" }[key].split("_"), num % 10 == 1 && num % 100 != 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); var num, forms; } function processHoursFunction(str) { return function() { return str + "о" + (11 === this.hours() ? "б" : "") + "] LT"; }; } moment.defineLocale("uk", { months: function(m, format) { return { nominative: "січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"), accusative: "січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_") }[/D[oD]? *MMMM?/.test(format) ? "accusative" : "nominative"][m.month()]; }, monthsShort: "січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"), weekdays: function(m, format) { return { nominative: "неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"), accusative: "неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"), genitive: "неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_") }[/(\[[ВвУу]\]) ?dddd/.test(format) ? "accusative" : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format) ? "genitive" : "nominative"][m.day()]; }, weekdaysShort: "нд_пн_вт_ср_чт_пт_сб".split("_"), weekdaysMin: "нд_пн_вт_ср_чт_пт_сб".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY р.", LLL: "D MMMM YYYY р., HH:mm", LLLL: "dddd, D MMMM YYYY р., HH:mm" }, calendar: { sameDay: processHoursFunction("[Сьогодні "), nextDay: processHoursFunction("[Завтра "), lastDay: processHoursFunction("[Вчора "), nextWeek: processHoursFunction("[У] dddd ["), lastWeek: function() { switch (this.day()) { case 0: case 3: case 5: case 6: return processHoursFunction("[Минулої] dddd [").call(this); case 1: case 2: case 4: return processHoursFunction("[Минулого] dddd [").call(this); } }, sameElse: "L" }, relativeTime: { future: "за %s", past: "%s тому", s: "декілька секунд", m: relativeTimeWithPlural, mm: relativeTimeWithPlural, h: "годину", hh: relativeTimeWithPlural, d: "день", dd: relativeTimeWithPlural, M: "місяць", MM: relativeTimeWithPlural, y: "рік", yy: relativeTimeWithPlural }, meridiemParse: /ночі|ранку|дня|вечора/, isPM: function(input) { return /^(дня|вечора)$/.test(input); }, meridiem: function(hour, minute, isLower) { return hour < 4 ? "ночі" : hour < 12 ? "ранку" : hour < 17 ? "дня" : "вечора"; }, ordinalParse: /\d{1,2}-(й|го)/, ordinal: function(number, period) { switch (period) { case "M": case "d": case "DDD": case "w": case "W": return number + "-й"; case "D": return number + "-го"; default: return number; } }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("uz", { months: "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), monthsShort: "янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"), weekdays: "Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"), weekdaysShort: "Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"), weekdaysMin: "Як_Ду_Се_Чо_Па_Жу_Ша".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "D MMMM YYYY, dddd HH:mm" }, calendar: { sameDay: "[Бугун соат] LT [да]", nextDay: "[Эртага] LT [да]", nextWeek: "dddd [куни соат] LT [да]", lastDay: "[Кеча соат] LT [да]", lastWeek: "[Утган] dddd [куни соат] LT [да]", sameElse: "L" }, relativeTime: { future: "Якин %s ичида", past: "Бир неча %s олдин", s: "фурсат", m: "бир дакика", mm: "%d дакика", h: "бир соат", hh: "%d соат", d: "бир кун", dd: "%d кун", M: "бир ой", MM: "%d ой", y: "бир йил", yy: "%d йил" }, week: { dow: 1, doy: 7 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("vi", { months: "tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"), monthsShort: "Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"), weekdays: "chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"), weekdaysShort: "CN_T2_T3_T4_T5_T6_T7".split("_"), weekdaysMin: "CN_T2_T3_T4_T5_T6_T7".split("_"), longDateFormat: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM [năm] YYYY", LLL: "D MMMM [năm] YYYY HH:mm", LLLL: "dddd, D MMMM [năm] YYYY HH:mm", l: "DD/M/YYYY", ll: "D MMM YYYY", lll: "D MMM YYYY HH:mm", llll: "ddd, D MMM YYYY HH:mm" }, calendar: { sameDay: "[Hôm nay lúc] LT", nextDay: "[Ngày mai lúc] LT", nextWeek: "dddd [tuần tới lúc] LT", lastDay: "[Hôm qua lúc] LT", lastWeek: "dddd [tuần rồi lúc] LT", sameElse: "L" }, relativeTime: { future: "%s tới", past: "%s trước", s: "vài giây", m: "một phút", mm: "%d phút", h: "một giờ", hh: "%d giờ", d: "một ngày", dd: "%d ngày", M: "một tháng", MM: "%d tháng", y: "một năm", yy: "%d năm" }, ordinalParse: /\d{1,2}/, ordinal: function(number) { return number; }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("zh-cn", { months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), longDateFormat: { LT: "Ah点mm分", LTS: "Ah点m分s秒", L: "YYYY-MM-DD", LL: "YYYY年MMMD日", LLL: "YYYY年MMMD日Ah点mm分", LLLL: "YYYY年MMMD日ddddAh点mm分", l: "YYYY-MM-DD", ll: "YYYY年MMMD日", lll: "YYYY年MMMD日Ah点mm分", llll: "YYYY年MMMD日ddddAh点mm分" }, meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "凌晨" === meridiem || "早上" === meridiem || "上午" === meridiem ? hour : "下午" === meridiem || "晚上" === meridiem ? hour + 12 : hour >= 11 ? hour : hour + 12; }, meridiem: function(hour, minute, isLower) { var hm = 100 * hour + minute; return hm < 600 ? "凌晨" : hm < 900 ? "早上" : hm < 1130 ? "上午" : hm < 1230 ? "中午" : hm < 1800 ? "下午" : "晚上"; }, calendar: { sameDay: function() { return 0 === this.minutes() ? "[今天]Ah[点整]" : "[今天]LT"; }, nextDay: function() { return 0 === this.minutes() ? "[明天]Ah[点整]" : "[明天]LT"; }, lastDay: function() { return 0 === this.minutes() ? "[昨天]Ah[点整]" : "[昨天]LT"; }, nextWeek: function() { var startOfWeek, prefix; return startOfWeek = moment().startOf("week"), prefix = this.unix() - startOfWeek.unix() >= 604800 ? "[下]" : "[本]", 0 === this.minutes() ? prefix + "dddAh点整" : prefix + "dddAh点mm"; }, lastWeek: function() { var startOfWeek, prefix; return startOfWeek = moment().startOf("week"), prefix = this.unix() < startOfWeek.unix() ? "[上]" : "[本]", 0 === this.minutes() ? prefix + "dddAh点整" : prefix + "dddAh点mm"; }, sameElse: "LL" }, ordinalParse: /\d{1,2}(日|月|周)/, ordinal: function(number, period) { switch (period) { case "d": case "D": case "DDD": return number + "日"; case "M": return number + "月"; case "w": case "W": return number + "周"; default: return number; } }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, week: { dow: 1, doy: 4 } }); })(__webpack_require__(1)); }, function(module, exports, __webpack_require__) { !(function(moment) { "use strict"; moment.defineLocale("zh-tw", { months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "週日_週一_週二_週三_週四_週五_週六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), longDateFormat: { LT: "Ah點mm分", LTS: "Ah點m分s秒", L: "YYYY年MMMD日", LL: "YYYY年MMMD日", LLL: "YYYY年MMMD日Ah點mm分", LLLL: "YYYY年MMMD日ddddAh點mm分", l: "YYYY年MMMD日", ll: "YYYY年MMMD日", lll: "YYYY年MMMD日Ah點mm分", llll: "YYYY年MMMD日ddddAh點mm分" }, meridiemParse: /早上|上午|中午|下午|晚上/, meridiemHour: function(hour, meridiem) { return 12 === hour && (hour = 0), "早上" === meridiem || "上午" === meridiem ? hour : "中午" === meridiem ? hour >= 11 ? hour : hour + 12 : "下午" === meridiem || "晚上" === meridiem ? hour + 12 : void 0; }, meridiem: function(hour, minute, isLower) { var hm = 100 * hour + minute; return hm < 900 ? "早上" : hm < 1130 ? "上午" : hm < 1230 ? "中午" : hm < 1800 ? "下午" : "晚上"; }, calendar: { sameDay: "[今天]LT", nextDay: "[明天]LT", nextWeek: "[下]ddddLT", lastDay: "[昨天]LT", lastWeek: "[上]ddddLT", sameElse: "L" }, ordinalParse: /\d{1,2}(日|月|週)/, ordinal: function(number, period) { switch (period) { case "d": case "D": case "DDD": return number + "日"; case "M": return number + "月"; case "w": case "W": return number + "週"; default: return number; } }, relativeTime: { future: "%s內", past: "%s前", s: "幾秒", m: "一分鐘", mm: "%d分鐘", h: "一小時", hh: "%d小時", d: "一天", dd: "%d天", M: "一個月", MM: "%d個月", y: "一年", yy: "%d年" } }); })(__webpack_require__(1)); }, function(module, exports) { var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; function isPositiveInteger(x) { return "[object Number]" === Object.prototype.toString.call(x) && x % 1 == 0 && x > 0; } module.exports = isPositiveInteger, module.exports.isSafePositiveInteger = function(x) { return isPositiveInteger(x) && x <= MAX_SAFE_INTEGER; }; }, function(module, exports) { (function() { module.exports = (function() { function XMLAttribute(parent, name, value) { if (this.options = parent.options, this.stringify = parent.stringify, null == name) throw new Error("Missing attribute name of element " + parent.name); if (null == value) throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name); this.name = this.stringify.attName(name), this.value = this.stringify.attValue(value); } return XMLAttribute.prototype.clone = function() { return Object.create(this); }, XMLAttribute.prototype.toString = function(options) { return this.options.writer.set(options).attribute(this); }, XMLAttribute; })(); }).call(this); }, function(module, exports) { (function() { var hasProp = {}.hasOwnProperty; module.exports = (function() { function XMLStringifier(options) { var fn, me, key, ref, value; for (key in this.assertLegalChar = (fn = this.assertLegalChar, me = this, function() { return fn.apply(me, arguments); }), options || (options = {}), this.noDoubleEncoding = options.noDoubleEncoding, ref = options.stringify || {}) hasProp.call(ref, key) && (value = ref[key], this[key] = value); } return XMLStringifier.prototype.eleName = function(val) { return val = "" + val || "", this.assertLegalChar(val); }, XMLStringifier.prototype.eleText = function(val) { return val = "" + val || "", this.assertLegalChar(this.elEscape(val)); }, XMLStringifier.prototype.cdata = function(val) { return val = (val = "" + val || "").replace("]]>", "]]]]>"), this.assertLegalChar(val); }, XMLStringifier.prototype.comment = function(val) { if ((val = "" + val || "").match(/--/)) throw new Error("Comment text cannot contain double-hypen: " + val); return this.assertLegalChar(val); }, XMLStringifier.prototype.raw = function(val) { return "" + val || ""; }, XMLStringifier.prototype.attName = function(val) { return "" + val || ""; }, XMLStringifier.prototype.attValue = function(val) { return val = "" + val || "", this.attEscape(val); }, XMLStringifier.prototype.insTarget = function(val) { return "" + val || ""; }, XMLStringifier.prototype.insValue = function(val) { if ((val = "" + val || "").match(/\?>/)) throw new Error("Invalid processing instruction value: " + val); return val; }, XMLStringifier.prototype.xmlVersion = function(val) { if (!(val = "" + val || "").match(/1\.[0-9]+/)) throw new Error("Invalid version number: " + val); return val; }, XMLStringifier.prototype.xmlEncoding = function(val) { if (!(val = "" + val || "").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) throw new Error("Invalid encoding: " + val); return val; }, XMLStringifier.prototype.xmlStandalone = function(val) { return val ? "yes" : "no"; }, XMLStringifier.prototype.dtdPubID = function(val) { return "" + val || ""; }, XMLStringifier.prototype.dtdSysID = function(val) { return "" + val || ""; }, XMLStringifier.prototype.dtdElementValue = function(val) { return "" + val || ""; }, XMLStringifier.prototype.dtdAttType = function(val) { return "" + val || ""; }, XMLStringifier.prototype.dtdAttDefault = function(val) { return null != val ? "" + val || "" : val; }, XMLStringifier.prototype.dtdEntityValue = function(val) { return "" + val || ""; }, XMLStringifier.prototype.dtdNData = function(val) { return "" + val || ""; }, XMLStringifier.prototype.convertAttKey = "@", XMLStringifier.prototype.convertPIKey = "?", XMLStringifier.prototype.convertTextKey = "#text", XMLStringifier.prototype.convertCDataKey = "#cdata", XMLStringifier.prototype.convertCommentKey = "#comment", XMLStringifier.prototype.convertRawKey = "#raw", XMLStringifier.prototype.assertLegalChar = function(str) { var res; if (res = str.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/)) throw new Error("Invalid character in string: " + str + " at index " + res.index); return str; }, XMLStringifier.prototype.elEscape = function(str) { var ampregex; return ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, str.replace(ampregex, "&").replace(//g, ">").replace(/\r/g, " "); }, XMLStringifier.prototype.attEscape = function(str) { var ampregex; return ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, str.replace(ampregex, "&").replace(/ 0 ? new Array(indent).join(this.indent) : ""; }, XMLWriterBase; })(); }).call(this); }, function(module, exports) { (function() { "use strict"; var prefixMatch; prefixMatch = new RegExp(/(?!xmlns)^.*:/), exports.normalize = function(str) { return str.toLowerCase(); }, exports.firstCharLowerCase = function(str) { return str.charAt(0).toLowerCase() + str.slice(1); }, exports.stripPrefix = function(str) { return str.replace(prefixMatch, ""); }, exports.parseNumbers = function(str) { return isNaN(str) || (str = str % 1 == 0 ? parseInt(str, 10) : parseFloat(str)), str; }, exports.parseBooleans = function(str) { return /^(?:true|false)$/i.test(str) && (str = "true" === str.toLowerCase()), str; }; }).call(this); }, function(module, exports, __webpack_require__) { var CharsetMatch = __webpack_require__(18); module.exports = function(getChar, name) { return function(input) { var limit = input.length / 4 * 4, numValid = 0, numInvalid = 0, hasBOM = !1, confidence = 0; if (0 == limit) return null; 65279 == getChar(input, 0) && (hasBOM = !0); for (var i = 0; i < limit; i += 4) { var ch = getChar(input, i); ch < 0 || ch >= 1114111 || ch >= 55296 && ch <= 57343 ? numInvalid += 1 : numValid += 1; } return hasBOM && 0 == numInvalid ? confidence = 100 : hasBOM && numValid > 10 * numInvalid ? confidence = 80 : numValid > 3 && 0 == numInvalid ? confidence = 100 : numValid > 0 && 0 == numInvalid ? confidence = 80 : numValid > 10 * numInvalid && (confidence = 25), 0 == confidence ? null : new CharsetMatch(confidence, name); }; }; }, function(module, exports, __webpack_require__) { function nextChar(it) { it.index = it.nextIndex, it.error = !1; var firstByte, secondByte = 0, thirdByte = 0; return (firstByte = it.charValue = it.nextByte()) < 0 ? it.done = !0 : firstByte <= 141 || (secondByte = it.nextByte(), it.charValue = it.charValue << 8 | secondByte, firstByte >= 161 && firstByte <= 254 ? secondByte < 161 && (it.error = !0) : 142 != firstByte ? 143 == firstByte && (thirdByte = it.nextByte(), it.charValue = it.charValue << 8 | thirdByte, thirdByte < 161 && (it.error = !0)) : secondByte < 161 && (it.error = !0)), 0 == it.done; } __webpack_require__(18); var base = __webpack_require__(141); module.exports = function(commonChars) { return base(commonChars, nextChar); }; }, function(module, exports) { function NGramParser(theNgramList, theByteMap) { this.byteIndex = 0, this.ngram = 0, this.ngramList = theNgramList, this.byteMap = theByteMap, this.ngramCount = 0, this.hitCount = 0; } NGramParser.prototype = { lookup: function(thisNgram) { this.ngramCount += 1, NGramParser.search(this.ngramList, thisNgram) >= 0 && (this.hitCount += 1); }, addByte: function(b) { this.ngram = (this.ngram << 8) + (255 & b) & NGramParser.N_GRAM_MASK, this.lookup(this.ngram); }, nextByte: function(input) { return this.byteIndex >= input.length ? -1 : 255 & input[this.byteIndex++]; }, parseCharacters: function(input) { for (var b, ignoreSpace = !1; (b = this.nextByte(input)) >= 0; ) { var mb = this.byteMap[b]; 0 != mb && (mb == this.spaceChar && ignoreSpace || this.addByte(mb), ignoreSpace = mb == this.spaceChar); } }, parse: function(input, spaceCh) { this.spaceChar = spaceCh || 32, this.parseCharacters(input), this.addByte(this.spaceChar); var rawPercent = this.hitCount / this.ngramCount; return rawPercent > .33 ? 98 : 300 * rawPercent; } }, NGramParser.N_GRAM_MASK = 16777215, NGramParser.search = function(table, value) { var index = 0; return table[index + 32] <= value && (index += 32), table[index + 16] <= value && (index += 16), table[index + 8] <= value && (index += 8), table[index + 4] <= value && (index += 4), table[index + 2] <= value && (index += 2), table[index + 1] <= value && (index += 1), table[index] > value && (index -= 1), index < 0 || table[index] != value ? -1 : index; }, module.exports = NGramParser; }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; (function() { var root = this, previousUnderscore = root._, ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype, push = ArrayProto.push, slice = ArrayProto.slice, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty, nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeBind = FuncProto.bind, nativeCreate = Object.create, Ctor = function() {}, _ = function(obj) { return obj instanceof _ ? obj : this instanceof _ ? void (this._wrapped = obj) : new _(obj); }; module.exports && (exports = module.exports = _), exports._ = _, _.VERSION = "1.8.3"; var optimizeCb = function(func, context, argCount) { if (void 0 === context) return func; switch (null == argCount ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; case 2: return function(value, other) { return func.call(context, value, other); }; case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; }, cb = function(value, context, argCount) { return null == value ? _.identity : _.isFunction(value) ? optimizeCb(value, context, argCount) : _.isObject(value) ? _.matcher(value) : _.property(value); }; _.iteratee = function(value, context) { return cb(value, context, 1 / 0); }; var createAssigner = function(keysFunc, undefinedOnly) { return function(obj) { var length = arguments.length; if (length < 2 || null == obj) return obj; for (var index = 1; index < length; index++) for (var source = arguments[index], keys = keysFunc(source), l = keys.length, i = 0; i < l; i++) { var key = keys[i]; undefinedOnly && void 0 !== obj[key] || (obj[key] = source[key]); } return obj; }; }, baseCreate = function(prototype) { if (!_.isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); Ctor.prototype = prototype; var result = new Ctor; return Ctor.prototype = null, result; }, property = function(key) { return function(obj) { return null == obj ? void 0 : obj[key]; }; }, MAX_ARRAY_INDEX = Math.pow(2, 53) - 1, getLength = property("length"), isArrayLike = function(collection) { var length = getLength(collection); return "number" == typeof length && length >= 0 && length <= MAX_ARRAY_INDEX; }; function createReduce(dir) { function iterator(obj, iteratee, memo, keys, index, length) { for (;index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; } return function(obj, iteratee, memo, context) { iteratee = optimizeCb(iteratee, context, 4); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = dir > 0 ? 0 : length - 1; return arguments.length < 3 && (memo = obj[keys ? keys[index] : index], index += dir), iterator(obj, iteratee, memo, keys, index, length); }; } _.each = _.forEach = function(obj, iteratee, context) { var i, length; if (iteratee = optimizeCb(iteratee, context), isArrayLike(obj)) for (i = 0, length = obj.length; i < length; i++) iteratee(obj[i], i, obj); else { var keys = _.keys(obj); for (i = 0, length = keys.length; i < length; i++) iteratee(obj[keys[i]], keys[i], obj); } return obj; }, _.map = _.collect = function(obj, iteratee, context) { iteratee = cb(iteratee, context); for (var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, results = Array(length), index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; }, _.reduce = _.foldl = _.inject = createReduce(1), _.reduceRight = _.foldr = createReduce(-1), _.find = _.detect = function(obj, predicate, context) { var key; if (void 0 !== (key = isArrayLike(obj) ? _.findIndex(obj, predicate, context) : _.findKey(obj, predicate, context)) && -1 !== key) return obj[key]; }, _.filter = _.select = function(obj, predicate, context) { var results = []; return predicate = cb(predicate, context), _.each(obj, (function(value, index, list) { predicate(value, index, list) && results.push(value); })), results; }, _.reject = function(obj, predicate, context) { return _.filter(obj, _.negate(cb(predicate)), context); }, _.every = _.all = function(obj, predicate, context) { predicate = cb(predicate, context); for (var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return !1; } return !0; }, _.some = _.any = function(obj, predicate, context) { predicate = cb(predicate, context); for (var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return !0; } return !1; }, _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { return isArrayLike(obj) || (obj = _.values(obj)), ("number" != typeof fromIndex || guard) && (fromIndex = 0), _.indexOf(obj, item, fromIndex) >= 0; }, _.invoke = function(obj, method) { var args = slice.call(arguments, 2), isFunc = _.isFunction(method); return _.map(obj, (function(value) { var func = isFunc ? method : value[method]; return null == func ? func : func.apply(value, args); })); }, _.pluck = function(obj, key) { return _.map(obj, _.property(key)); }, _.where = function(obj, attrs) { return _.filter(obj, _.matcher(attrs)); }, _.findWhere = function(obj, attrs) { return _.find(obj, _.matcher(attrs)); }, _.max = function(obj, iteratee, context) { var value, computed, result = -1 / 0, lastComputed = -1 / 0; if (null == iteratee && null != obj) for (var i = 0, length = (obj = isArrayLike(obj) ? obj : _.values(obj)).length; i < length; i++) (value = obj[i]) > result && (result = value); else iteratee = cb(iteratee, context), _.each(obj, (function(value, index, list) { ((computed = iteratee(value, index, list)) > lastComputed || computed === -1 / 0 && result === -1 / 0) && (result = value, lastComputed = computed); })); return result; }, _.min = function(obj, iteratee, context) { var value, computed, result = 1 / 0, lastComputed = 1 / 0; if (null == iteratee && null != obj) for (var i = 0, length = (obj = isArrayLike(obj) ? obj : _.values(obj)).length; i < length; i++) (value = obj[i]) < result && (result = value); else iteratee = cb(iteratee, context), _.each(obj, (function(value, index, list) { ((computed = iteratee(value, index, list)) < lastComputed || computed === 1 / 0 && result === 1 / 0) && (result = value, lastComputed = computed); })); return result; }, _.shuffle = function(obj) { for (var rand, set = isArrayLike(obj) ? obj : _.values(obj), length = set.length, shuffled = Array(length), index = 0; index < length; index++) (rand = _.random(0, index)) !== index && (shuffled[index] = shuffled[rand]), shuffled[rand] = set[index]; return shuffled; }, _.sample = function(obj, n, guard) { return null == n || guard ? (isArrayLike(obj) || (obj = _.values(obj)), obj[_.random(obj.length - 1)]) : _.shuffle(obj).slice(0, Math.max(0, n)); }, _.sortBy = function(obj, iteratee, context) { return iteratee = cb(iteratee, context), _.pluck(_.map(obj, (function(value, index, list) { return { value: value, index: index, criteria: iteratee(value, index, list) }; })).sort((function(left, right) { var a = left.criteria, b = right.criteria; if (a !== b) { if (a > b || void 0 === a) return 1; if (a < b || void 0 === b) return -1; } return left.index - right.index; })), "value"); }; var group = function(behavior) { return function(obj, iteratee, context) { var result = {}; return iteratee = cb(iteratee, context), _.each(obj, (function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); })), result; }; }; _.groupBy = group((function(result, value, key) { _.has(result, key) ? result[key].push(value) : result[key] = [ value ]; })), _.indexBy = group((function(result, value, key) { result[key] = value; })), _.countBy = group((function(result, value, key) { _.has(result, key) ? result[key]++ : result[key] = 1; })), _.toArray = function(obj) { return obj ? _.isArray(obj) ? slice.call(obj) : isArrayLike(obj) ? _.map(obj, _.identity) : _.values(obj) : []; }, _.size = function(obj) { return null == obj ? 0 : isArrayLike(obj) ? obj.length : _.keys(obj).length; }, _.partition = function(obj, predicate, context) { predicate = cb(predicate, context); var pass = [], fail = []; return _.each(obj, (function(value, key, obj) { (predicate(value, key, obj) ? pass : fail).push(value); })), [ pass, fail ]; }, _.first = _.head = _.take = function(array, n, guard) { if (null != array) return null == n || guard ? array[0] : _.initial(array, array.length - n); }, _.initial = function(array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (null == n || guard ? 1 : n))); }, _.last = function(array, n, guard) { if (null != array) return null == n || guard ? array[array.length - 1] : _.rest(array, Math.max(0, array.length - n)); }, _.rest = _.tail = _.drop = function(array, n, guard) { return slice.call(array, null == n || guard ? 1 : n); }, _.compact = function(array) { return _.filter(array, _.identity); }; var flatten = function(input, shallow, strict, startIndex) { for (var output = [], idx = 0, i = startIndex || 0, length = getLength(input); i < length; i++) { var value = input[i]; if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { shallow || (value = flatten(value, shallow, strict)); var j = 0, len = value.length; for (output.length += len; j < len; ) output[idx++] = value[j++]; } else strict || (output[idx++] = value); } return output; }; function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); for (var length = getLength(array), index = dir > 0 ? 0 : length - 1; index >= 0 && index < length; index += dir) if (predicate(array[index], index, array)) return index; return -1; }; } function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if ("number" == typeof idx) dir > 0 ? i = idx >= 0 ? idx : Math.max(idx + length, i) : length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; else if (sortedIndex && idx && length) return array[idx = sortedIndex(array, item)] === item ? idx : -1; if (item != item) return (idx = predicateFind(slice.call(array, i, length), _.isNaN)) >= 0 ? idx + i : -1; for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) if (array[idx] === item) return idx; return -1; }; } _.flatten = function(array, shallow) { return flatten(array, shallow, !1); }, _.without = function(array) { return _.difference(array, slice.call(arguments, 1)); }, _.uniq = _.unique = function(array, isSorted, iteratee, context) { _.isBoolean(isSorted) || (context = iteratee, iteratee = isSorted, isSorted = !1), null != iteratee && (iteratee = cb(iteratee, context)); for (var result = [], seen = [], i = 0, length = getLength(array); i < length; i++) { var value = array[i], computed = iteratee ? iteratee(value, i, array) : value; isSorted ? (i && seen === computed || result.push(value), seen = computed) : iteratee ? _.contains(seen, computed) || (seen.push(computed), result.push(value)) : _.contains(result, value) || result.push(value); } return result; }, _.union = function() { return _.uniq(flatten(arguments, !0, !0)); }, _.intersection = function(array) { for (var result = [], argsLength = arguments.length, i = 0, length = getLength(array); i < length; i++) { var item = array[i]; if (!_.contains(result, item)) { for (var j = 1; j < argsLength && _.contains(arguments[j], item); j++) ; j === argsLength && result.push(item); } } return result; }, _.difference = function(array) { var rest = flatten(arguments, !0, !0, 1); return _.filter(array, (function(value) { return !_.contains(rest, value); })); }, _.zip = function() { return _.unzip(arguments); }, _.unzip = function(array) { for (var length = array && _.max(array, getLength).length || 0, result = Array(length), index = 0; index < length; index++) result[index] = _.pluck(array, index); return result; }, _.object = function(list, values) { for (var result = {}, i = 0, length = getLength(list); i < length; i++) values ? result[list[i]] = values[i] : result[list[i][0]] = list[i][1]; return result; }, _.findIndex = createPredicateIndexFinder(1), _.findLastIndex = createPredicateIndexFinder(-1), _.sortedIndex = function(array, obj, iteratee, context) { for (var value = (iteratee = cb(iteratee, context, 1))(obj), low = 0, high = getLength(array); low < high; ) { var mid = Math.floor((low + high) / 2); iteratee(array[mid]) < value ? low = mid + 1 : high = mid; } return low; }, _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex), _.lastIndexOf = createIndexFinder(-1, _.findLastIndex), _.range = function(start, stop, step) { null == stop && (stop = start || 0, start = 0), step = step || 1; for (var length = Math.max(Math.ceil((stop - start) / step), 0), range = Array(length), idx = 0; idx < length; idx++, start += step) range[idx] = start; return range; }; var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prototype), result = sourceFunc.apply(self, args); return _.isObject(result) ? result : self; }; _.bind = function(func, context) { if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); if (!_.isFunction(func)) throw new TypeError("Bind must be called on a function"); var args = slice.call(arguments, 2), bound = function() { return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); }; return bound; }, _.partial = function(func) { var boundArgs = slice.call(arguments, 1), bound = function() { for (var position = 0, length = boundArgs.length, args = Array(length), i = 0; i < length; i++) args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; for (;position < arguments.length; ) args.push(arguments[position++]); return executeBound(func, bound, this, this, args); }; return bound; }, _.bindAll = function(obj) { var i, key, length = arguments.length; if (length <= 1) throw new Error("bindAll must be passed function names"); for (i = 1; i < length; i++) obj[key = arguments[i]] = _.bind(obj[key], obj); return obj; }, _.memoize = function(func, hasher) { var memoize = function(key) { var cache = memoize.cache, address = "" + (hasher ? hasher.apply(this, arguments) : key); return _.has(cache, address) || (cache[address] = func.apply(this, arguments)), cache[address]; }; return memoize.cache = {}, memoize; }, _.delay = function(func, wait) { var args = slice.call(arguments, 2); return setTimeout((function() { return func.apply(null, args); }), wait); }, _.defer = _.partial(_.delay, _, 1), _.throttle = function(func, wait, options) { var context, args, result, timeout = null, previous = 0; options || (options = {}); var later = function() { previous = !1 === options.leading ? 0 : _.now(), timeout = null, result = func.apply(context, args), timeout || (context = args = null); }; return function() { var now = _.now(); previous || !1 !== options.leading || (previous = now); var remaining = wait - (now - previous); return context = this, args = arguments, remaining <= 0 || remaining > wait ? (timeout && (clearTimeout(timeout), timeout = null), previous = now, result = func.apply(context, args), timeout || (context = args = null)) : timeout || !1 === options.trailing || (timeout = setTimeout(later, remaining)), result; }; }, _.debounce = function(func, wait, immediate) { var timeout, args, context, timestamp, result, later = function() { var last = _.now() - timestamp; last < wait && last >= 0 ? timeout = setTimeout(later, wait - last) : (timeout = null, immediate || (result = func.apply(context, args), timeout || (context = args = null))); }; return function() { context = this, args = arguments, timestamp = _.now(); var callNow = immediate && !timeout; return timeout || (timeout = setTimeout(later, wait)), callNow && (result = func.apply(context, args), context = args = null), result; }; }, _.wrap = function(func, wrapper) { return _.partial(wrapper, func); }, _.negate = function(predicate) { return function() { return !predicate.apply(this, arguments); }; }, _.compose = function() { var args = arguments, start = args.length - 1; return function() { for (var i = start, result = args[start].apply(this, arguments); i--; ) result = args[i].call(this, result); return result; }; }, _.after = function(times, func) { return function() { if (--times < 1) return func.apply(this, arguments); }; }, _.before = function(times, func) { var memo; return function() { return --times > 0 && (memo = func.apply(this, arguments)), times <= 1 && (func = null), memo; }; }, _.once = _.partial(_.before, 2); var hasEnumBug = !{ toString: null }.propertyIsEnumerable("toString"), nonEnumerableProps = [ "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString" ]; function collectNonEnumProps(obj, keys) { var nonEnumIdx = nonEnumerableProps.length, constructor = obj.constructor, proto = _.isFunction(constructor) && constructor.prototype || ObjProto, prop = "constructor"; for (_.has(obj, prop) && !_.contains(keys, prop) && keys.push(prop); nonEnumIdx--; ) (prop = nonEnumerableProps[nonEnumIdx]) in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop) && keys.push(prop); } _.keys = function(obj) { if (!_.isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) _.has(obj, key) && keys.push(key); return hasEnumBug && collectNonEnumProps(obj, keys), keys; }, _.allKeys = function(obj) { if (!_.isObject(obj)) return []; var keys = []; for (var key in obj) keys.push(key); return hasEnumBug && collectNonEnumProps(obj, keys), keys; }, _.values = function(obj) { for (var keys = _.keys(obj), length = keys.length, values = Array(length), i = 0; i < length; i++) values[i] = obj[keys[i]]; return values; }, _.mapObject = function(obj, iteratee, context) { iteratee = cb(iteratee, context); for (var currentKey, keys = _.keys(obj), length = keys.length, results = {}, index = 0; index < length; index++) results[currentKey = keys[index]] = iteratee(obj[currentKey], currentKey, obj); return results; }, _.pairs = function(obj) { for (var keys = _.keys(obj), length = keys.length, pairs = Array(length), i = 0; i < length; i++) pairs[i] = [ keys[i], obj[keys[i]] ]; return pairs; }, _.invert = function(obj) { for (var result = {}, keys = _.keys(obj), i = 0, length = keys.length; i < length; i++) result[obj[keys[i]]] = keys[i]; return result; }, _.functions = _.methods = function(obj) { var names = []; for (var key in obj) _.isFunction(obj[key]) && names.push(key); return names.sort(); }, _.extend = createAssigner(_.allKeys), _.extendOwn = _.assign = createAssigner(_.keys), _.findKey = function(obj, predicate, context) { predicate = cb(predicate, context); for (var key, keys = _.keys(obj), i = 0, length = keys.length; i < length; i++) if (predicate(obj[key = keys[i]], key, obj)) return key; }, _.pick = function(object, oiteratee, context) { var iteratee, keys, result = {}, obj = object; if (null == obj) return result; _.isFunction(oiteratee) ? (keys = _.allKeys(obj), iteratee = optimizeCb(oiteratee, context)) : (keys = flatten(arguments, !1, !1, 1), iteratee = function(value, key, obj) { return key in obj; }, obj = Object(obj)); for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i], value = obj[key]; iteratee(value, key, obj) && (result[key] = value); } return result; }, _.omit = function(obj, iteratee, context) { if (_.isFunction(iteratee)) iteratee = _.negate(iteratee); else { var keys = _.map(flatten(arguments, !1, !1, 1), String); iteratee = function(value, key) { return !_.contains(keys, key); }; } return _.pick(obj, iteratee, context); }, _.defaults = createAssigner(_.allKeys, !0), _.create = function(prototype, props) { var result = baseCreate(prototype); return props && _.extendOwn(result, props), result; }, _.clone = function(obj) { return _.isObject(obj) ? _.isArray(obj) ? obj.slice() : _.extend({}, obj) : obj; }, _.tap = function(obj, interceptor) { return interceptor(obj), obj; }, _.isMatch = function(object, attrs) { var keys = _.keys(attrs), length = keys.length; if (null == object) return !length; for (var obj = Object(object), i = 0; i < length; i++) { var key = keys[i]; if (attrs[key] !== obj[key] || !(key in obj)) return !1; } return !0; }; var eq = function(a, b, aStack, bStack) { if (a === b) return 0 !== a || 1 / a == 1 / b; if (null == a || null == b) return a === b; a instanceof _ && (a = a._wrapped), b instanceof _ && (b = b._wrapped); var className = toString.call(a); if (className !== toString.call(b)) return !1; switch (className) { case "[object RegExp]": case "[object String]": return "" + a == "" + b; case "[object Number]": return +a != +a ? +b != +b : 0 == +a ? 1 / +a == 1 / b : +a == +b; case "[object Date]": case "[object Boolean]": return +a == +b; } var areArrays = "[object Array]" === className; if (!areArrays) { if ("object" != typeof a || "object" != typeof b) return !1; var aCtor = a.constructor, bCtor = b.constructor; if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && _.isFunction(bCtor) && bCtor instanceof bCtor) && "constructor" in a && "constructor" in b) return !1; } bStack = bStack || []; for (var length = (aStack = aStack || []).length; length--; ) if (aStack[length] === a) return bStack[length] === b; if (aStack.push(a), bStack.push(b), areArrays) { if ((length = a.length) !== b.length) return !1; for (;length--; ) if (!eq(a[length], b[length], aStack, bStack)) return !1; } else { var key, keys = _.keys(a); if (length = keys.length, _.keys(b).length !== length) return !1; for (;length--; ) if (key = keys[length], !_.has(b, key) || !eq(a[key], b[key], aStack, bStack)) return !1; } return aStack.pop(), bStack.pop(), !0; }; _.isEqual = function(a, b) { return eq(a, b); }, _.isEmpty = function(obj) { return null == obj || (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) ? 0 === obj.length : 0 === _.keys(obj).length); }, _.isElement = function(obj) { return !(!obj || 1 !== obj.nodeType); }, _.isArray = nativeIsArray || function(obj) { return "[object Array]" === toString.call(obj); }, _.isObject = function(obj) { var type = typeof obj; return "function" === type || "object" === type && !!obj; }, _.each([ "Arguments", "Function", "String", "Number", "Date", "RegExp", "Error" ], (function(name) { _["is" + name] = function(obj) { return toString.call(obj) === "[object " + name + "]"; }; })), _.isArguments(arguments) || (_.isArguments = function(obj) { return _.has(obj, "callee"); }), "object" != typeof Int8Array && (_.isFunction = function(obj) { return "function" == typeof obj || !1; }), _.isFinite = function(obj) { return isFinite(obj) && !isNaN(parseFloat(obj)); }, _.isNaN = function(obj) { return _.isNumber(obj) && obj !== +obj; }, _.isBoolean = function(obj) { return !0 === obj || !1 === obj || "[object Boolean]" === toString.call(obj); }, _.isNull = function(obj) { return null === obj; }, _.isUndefined = function(obj) { return void 0 === obj; }, _.has = function(obj, key) { return null != obj && hasOwnProperty.call(obj, key); }, _.noConflict = function() { return root._ = previousUnderscore, this; }, _.identity = function(value) { return value; }, _.constant = function(value) { return function() { return value; }; }, _.noop = function() {}, _.property = property, _.propertyOf = function(obj) { return null == obj ? function() {} : function(key) { return obj[key]; }; }, _.matcher = _.matches = function(attrs) { return attrs = _.extendOwn({}, attrs), function(obj) { return _.isMatch(obj, attrs); }; }, _.times = function(n, iteratee, context) { var accum = Array(Math.max(0, n)); iteratee = optimizeCb(iteratee, context, 1); for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }, _.random = function(min, max) { return null == max && (max = min, min = 0), min + Math.floor(Math.random() * (max - min + 1)); }, _.now = Date.now || function() { return (new Date).getTime(); }; var escapeMap = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }, unescapeMap = _.invert(escapeMap), createEscaper = function(map) { var escaper = function(match) { return map[match]; }, source = "(?:" + _.keys(map).join("|") + ")", testRegexp = RegExp(source), replaceRegexp = RegExp(source, "g"); return function(string) { return string = null == string ? "" : "" + string, testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; }; _.escape = createEscaper(escapeMap), _.unescape = createEscaper(unescapeMap), _.result = function(object, property, fallback) { var value = null == object ? void 0 : object[property]; return void 0 === value && (value = fallback), _.isFunction(value) ? value.call(object) : value; }; var idCounter = 0; _.uniqueId = function(prefix) { var id = ++idCounter + ""; return prefix ? prefix + id : id; }, _.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; var noMatch = /(.)^/, escapes = { "'": "'", "\\": "\\", "\r": "r", "\n": "n", "\u2028": "u2028", "\u2029": "u2029" }, escaper = /\\|'|\r|\n|\u2028|\u2029/g, escapeChar = function(match) { return "\\" + escapes[match]; }; _.template = function(text, settings, oldSettings) { !settings && oldSettings && (settings = oldSettings), settings = _.defaults({}, settings, _.templateSettings); var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join("|") + "|$", "g"), index = 0, source = "__p+='"; text.replace(matcher, (function(match, escape, interpolate, evaluate, offset) { return source += text.slice(index, offset).replace(escaper, escapeChar), index = offset + match.length, escape ? source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'" : interpolate ? source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'" : evaluate && (source += "';\n" + evaluate + "\n__p+='"), match; })), source += "';\n", settings.variable || (source = "with(obj||{}){\n" + source + "}\n"), source = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + source + "return __p;\n"; try { var render = new Function(settings.variable || "obj", "_", source); } catch (e) { throw e.source = source, e; } var template = function(data) { return render.call(this, data, _); }, argument = settings.variable || "obj"; return template.source = "function(" + argument + "){\n" + source + "}", template; }, _.chain = function(obj) { var instance = _(obj); return instance._chain = !0, instance; }; var result = function(instance, obj) { return instance._chain ? _(obj).chain() : obj; }; _.mixin = function(obj) { _.each(_.functions(obj), (function(name) { var func = _[name] = obj[name]; _.prototype[name] = function() { var args = [ this._wrapped ]; return push.apply(args, arguments), result(this, func.apply(_, args)); }; })); }, _.mixin(_), _.each([ "pop", "push", "reverse", "shift", "sort", "splice", "unshift" ], (function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; return method.apply(obj, arguments), "shift" !== name && "splice" !== name || 0 !== obj.length || delete obj[0], result(this, obj); }; })), _.each([ "concat", "join", "slice" ], (function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { return result(this, method.apply(this._wrapped, arguments)); }; })), _.prototype.value = function() { return this._wrapped; }, _.prototype.valueOf = _.prototype.toJSON = _.prototype.value, _.prototype.toString = function() { return "" + this._wrapped; }, void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return _; }.apply(exports, [])) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); }).call(this); }, function(module, exports, __webpack_require__) { var xmlBuilder = __webpack_require__(799), dateFormatter = __webpack_require__(409); function serializeValue(value, xml) { for (var stack = [ { value: value, xml: xml } ], current = null, valueNode = null, next = null; stack.length > 0; ) if (void 0 !== (current = stack[stack.length - 1]).index) (next = getNextItemsFrame(current)) ? stack.push(next) : stack.pop(); else switch (valueNode = current.xml.ele("value"), typeof current.value) { case "boolean": appendBoolean(current.value, valueNode), stack.pop(); break; case "string": appendString(current.value, valueNode), stack.pop(); break; case "number": appendNumber(current.value, valueNode), stack.pop(); break; case "object": null === current.value ? (valueNode.ele("nil"), stack.pop()) : current.value instanceof Date ? (appendDatetime(current.value, valueNode), stack.pop()) : Buffer.isBuffer(current.value) ? (appendBuffer(current.value, valueNode), stack.pop()) : (Array.isArray(current.value) ? current.xml = valueNode.ele("array").ele("data") : (current.xml = valueNode.ele("struct"), current.keys = Object.keys(current.value)), current.index = 0, (next = getNextItemsFrame(current)) ? stack.push(next) : stack.pop()); break; default: stack.pop(); } } function getNextItemsFrame(frame) { var nextFrame = null; if (frame.keys) { if (frame.index < frame.keys.length) { var key = frame.keys[frame.index++], member = frame.xml.ele("member").ele("name").text(key).up(); nextFrame = { value: frame.value[key], xml: member }; } } else frame.index < frame.value.length && (nextFrame = { value: frame.value[frame.index], xml: frame.xml }, frame.index++); return nextFrame; } function appendBoolean(value, xml) { xml.ele("boolean").txt(value ? 1 : 0); } exports.serializeMethodCall = function(method, params) { params = params || []; var xml = xmlBuilder.create().begin("methodCall", { version: "1.0" }).ele("methodName").txt(method).up().ele("params"); return params.forEach((function(param) { serializeValue(param, xml.ele("param")); })), xml.doc().toString(); }, exports.serializeMethodResponse = function(result) { var xml = xmlBuilder.create().begin("methodResponse", { version: "1.0" }).ele("params").ele("param"); return serializeValue(result, xml), xml.doc().toString(); }, exports.serializeFault = function(fault) { var xml = xmlBuilder.create().begin("methodResponse", { version: "1.0" }).ele("fault"); return serializeValue(fault, xml), xml.doc().toString(); }; var illegalChars = /^(?![^<&]*]]>[^<&]*)[^<&]*$/; function appendString(value, xml) { 0 === value.length ? xml.ele("string") : illegalChars.test(value) ? xml.ele("string").txt(value) : xml.ele("string").d(value); } function appendNumber(value, xml) { value % 1 == 0 ? xml.ele("int").txt(value) : xml.ele("double").txt(value); } function appendDatetime(value, xml) { xml.ele("dateTime.iso8601").txt(dateFormatter.encodeIso8601(value)); } function appendBuffer(value, xml) { xml.ele("base64").txt(value.toString("base64")); } }, function(module, exports) { var dateFormatter = exports, iso8601 = new RegExp("([0-9]{4})([-]?([0-9]{2})([-]?([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?"); function zeroPad(digit, length) { for (var padded = "" + digit; padded.length < length; ) padded = "0" + padded; return padded; } dateFormatter.decodeIso8601 = function(time) { var dateParts = time.toString().match(iso8601); if (!dateParts) throw new Error("Expected a ISO8601 datetime but got '" + time + "'"); var date = new Date(dateParts[1], 0, 1); return dateParts[3] && date.setMonth(dateParts[3] - 1), dateParts[5] && date.setDate(dateParts[5]), dateParts[7] && date.setHours(dateParts[7]), dateParts[8] && date.setMinutes(dateParts[8]), dateParts[10] && date.setSeconds(dateParts[10]), dateParts[12] && date.setMilliseconds(1e3 * Number("0." + dateParts[12])), date; }, dateFormatter.encodeIso8601 = function(date) { return zeroPad(date.getFullYear(), 4) + zeroPad(date.getMonth() + 1, 2) + zeroPad(date.getDate(), 2) + "T" + zeroPad(date.getHours(), 2) + ":" + zeroPad(date.getMinutes(), 2) + ":" + zeroPad(date.getSeconds(), 2); }; }, function(module, exports, __webpack_require__) { var sax = __webpack_require__(802), dateFormatter = __webpack_require__(409), Deserializer = function(encoding) { this.type = null, this.responseType = null, this.stack = [], this.marks = [], this.data = [], this.methodname = null, this.encoding = encoding || "utf8", this.value = !1, this.callback = null, this.error = null, this.parser = sax.createStream(), this.parser.on("opentag", this.onOpentag.bind(this)), this.parser.on("closetag", this.onClosetag.bind(this)), this.parser.on("text", this.onText.bind(this)), this.parser.on("end", this.onDone.bind(this)), this.parser.on("error", this.onError.bind(this)); }; Deserializer.prototype.deserializeMethodResponse = function(stream, callback) { var that = this; this.callback = function(error, result) { error ? callback(error) : result.length > 1 ? callback(new Error("Response has more than one param")) : "methodresponse" !== that.type ? callback(new Error("Not a method response")) : that.responseType ? callback(null, result[0]) : callback(new Error("Invalid method response")); }, stream.setEncoding(this.encoding), stream.on("error", this.onError.bind(this)), stream.pipe(this.parser); }, Deserializer.prototype.deserializeMethodCall = function(stream, callback) { var that = this; this.callback = function(error, result) { error ? callback(error) : "methodcall" !== that.type ? callback(new Error("Not a method call")) : that.methodname ? callback(null, that.methodname, result) : callback(new Error("Method call did not contain a method name")); }, stream.setEncoding(this.encoding), stream.on("error", this.onError.bind(this)), stream.pipe(this.parser); }, Deserializer.prototype.onDone = function() { this.error || (null === this.type || this.marks.length ? this.callback(new Error("Invalid XML-RPC message")) : "fault" === this.responseType ? this.callback((function(fault) { var error = new Error("XML-RPC fault" + (fault.faultString ? ": " + fault.faultString : "")); return error.code = fault.faultCode, error.faultCode = fault.faultCode, error.faultString = fault.faultString, error; })(this.stack[0])) : this.callback(void 0, this.stack)); }, Deserializer.prototype.onError = function(msg) { this.error || (this.error = "string" == typeof msg ? new Error(msg) : msg, this.callback(this.error)); }, Deserializer.prototype.push = function(value) { this.stack.push(value); }, Deserializer.prototype.onOpentag = function(node) { "ARRAY" !== node.name && "STRUCT" !== node.name || this.marks.push(this.stack.length), this.data = [], this.value = "VALUE" === node.name; }, Deserializer.prototype.onText = function(text) { this.data.push(text); }, Deserializer.prototype.onClosetag = function(el) { var data = this.data.join(""); try { switch (el) { case "BOOLEAN": this.endBoolean(data); break; case "INT": case "I4": this.endInt(data); break; case "I8": this.endI8(data); break; case "DOUBLE": this.endDouble(data); break; case "STRING": case "NAME": this.endString(data); break; case "ARRAY": this.endArray(data); break; case "STRUCT": this.endStruct(data); break; case "BASE64": this.endBase64(data); break; case "DATETIME.ISO8601": this.endDateTime(data); break; case "VALUE": this.endValue(data); break; case "PARAMS": this.endParams(data); break; case "FAULT": this.endFault(data); break; case "METHODRESPONSE": this.endMethodResponse(data); break; case "METHODNAME": this.endMethodName(data); break; case "METHODCALL": this.endMethodCall(data); break; case "NIL": this.endNil(data); break; case "DATA": case "PARAM": case "MEMBER": break; default: this.onError("Unknown XML-RPC tag '" + el + "'"); } } catch (e) { this.onError(e); } }, Deserializer.prototype.endNil = function(data) { this.push(null), this.value = !1; }, Deserializer.prototype.endBoolean = function(data) { if ("1" === data) this.push(!0); else { if ("0" !== data) throw new Error("Illegal boolean value '" + data + "'"); this.push(!1); } this.value = !1; }, Deserializer.prototype.endInt = function(data) { var value = parseInt(data, 10); if (isNaN(value)) throw new Error("Expected an integer but got '" + data + "'"); this.push(value), this.value = !1; }, Deserializer.prototype.endDouble = function(data) { var value = parseFloat(data); if (isNaN(value)) throw new Error("Expected a double but got '" + data + "'"); this.push(value), this.value = !1; }, Deserializer.prototype.endString = function(data) { this.push(data), this.value = !1; }, Deserializer.prototype.endArray = function(data) { var mark = this.marks.pop(); this.stack.splice(mark, this.stack.length - mark, this.stack.slice(mark)), this.value = !1; }, Deserializer.prototype.endStruct = function(data) { for (var mark = this.marks.pop(), struct = {}, items = this.stack.slice(mark), i = 0; i < items.length; i += 2) struct[items[i]] = items[i + 1]; this.stack.splice(mark, this.stack.length - mark, struct), this.value = !1; }, Deserializer.prototype.endBase64 = function(data) { var buffer = new Buffer(data, "base64"); this.push(buffer), this.value = !1; }, Deserializer.prototype.endDateTime = function(data) { var date = dateFormatter.decodeIso8601(data); this.push(date), this.value = !1; }; var isInteger = /^-?\d+$/; Deserializer.prototype.endI8 = function(data) { if (!isInteger.test(data)) throw new Error("Expected integer (I8) value but got '" + data + "'"); this.endString(data); }, Deserializer.prototype.endValue = function(data) { this.value && this.endString(data); }, Deserializer.prototype.endParams = function(data) { this.responseType = "params"; }, Deserializer.prototype.endFault = function(data) { this.responseType = "fault"; }, Deserializer.prototype.endMethodResponse = function(data) { this.type = "methodresponse"; }, Deserializer.prototype.endMethodName = function(data) { this.methodname = data; }, Deserializer.prototype.endMethodCall = function(data) { this.type = "methodcall"; }, module.exports = Deserializer; }, function(module, exports, __webpack_require__) { const profiles = __webpack_require__(193), profiler = __webpack_require__(807), applyProfile = __webpack_require__(811); module.exports = { profiles: profiles, profiler: profiler, applyProfile: applyProfile }; }, function(module) { module.exports = { name: "stremio-server", version: "4.20.16", stremioRuntimeVersion: "4.0", description: "Stremio HTTP server", main: "init.js", scripts: { deps: "NODE_OPTIONS=--openssl-legacy-provider yarn install --network-concurrency 1", build: "export NODE_OPTIONS=--openssl-legacy-provider; node prepare.js && webpack --config webpack.config.desktop.js", "build-android": "export NODE_OPTIONS=--openssl-legacy-provider; node prepare.js && webpack --config webpack.config.android.js", "build-tizen": "export NODE_OPTIONS=--openssl-legacy-provider; node prepare.js && webpack -p --define process.env.TIZEN_ENV='1' --define process.env.TV_ENV='1' --config webpack.config.tizen.js", "build-webos": "export NODE_OPTIONS=--openssl-legacy-provider; node prepare.js && webpack -p --define process.env.WEBOS_ENV='1' --define process.env.TV_ENV='1' --config webpack.config.webos.js", "build-unity": "export NODE_OPTIONS=--openssl-legacy-provider; node prepare.js && webpack -p --define process.env.UNITY_ENV='1' --config webpack.config.unity.js", "build-updater-tizen": "export NODE_OPTIONS=--openssl-legacy-provider; node prepare.js && webpack -p --define process.env.TIZEN_ENV='1' --define process.env.TV_ENV='1' --config webpack.config.updater-tizen.js", "build-updater-webos": "export NODE_OPTIONS=--openssl-legacy-provider; node prepare.js && webpack -p --define process.env.WEBOS_ENV='1' --define process.env.TV_ENV='1' --config webpack.config.updater-webos.js", test: "jest" }, keywords: [ "server" ], dependencies: { JSONStream: "^1.3.5", "async-mutex": "^0.3.2", bluebird: "^3.5.0", castv2: "Ivshti/node-castv2", debounce: "^1.0.0", "dns-txt": "^2.0.2", enginefs: "https://github.com/Stremio/enginefs#3a70b36f873307cd83fb3178bb891f73cf73aa87", "ffmpeg-ffprobe-static": "4.3.1-rc.6", "follow-redirects": "^1.13.3", "get-tracks-data": "^0.8.2", ip: "^1.1.5", "is-positive-integer": "^1.1.1", "mime-types": "^2.1.15", minimist: "1.2.x", mkdirp: "0.5.1", moment: "2.10.6", "mp4-stream": "^3.1.0", "multicast-dns": "^6.1.1", "mux.js": "5.12.2", "node-fetch": "^2.2.0", "node-matroska": "https://github.com/Stremio/node-matroska#3ed3d8f3fb3c70a305136c876ef4a4db204cae86", "node-ssdp-js": "https://github.com/Ivshti/node-ssdp-js-1#patch-2", once: "^1.4.0", open: "0.x.x", opensubtitles: "0.0.4", portfinder: "1.0.32", pump: "^1.0.2", router: "^1.3.0", "stremio-cast": "git+ssh://git@github.com/Stremio/stremio-cast", "stremio-hls-middleware": "git+ssh://git@github.com/Stremio/stremio-hls-middleware.git#c84254f4e19e7a35017132385702e81b5e6fc674", "stremio-local-addon": "https://github.com/Stremio/stremio-local-addon#be2e9c25f4d4bda4e76cdeccc523ee374e1f4b47", "subtitles-grouping": "1.5.4", tmp: "^0.0.31", "torrent-stream": "git+ssh://git@github.com/Stremio/torrent-stream.git#4d9eaff84e3b7a1008314daa007d5feb6fa26388", "tree-kill": "^1.2.2", "upnp-mediarenderer-client": "1.2.4", "vtt.js": "^0.13.0", walk: "2.x.x", xml2js: "0.4.x", xmlbuilder: "4.2.0", "ytdl-core": "4.9.0", "rar-http": "git+ssh://git@github.com/Stremio/rar5-http#7e661b7a001ba45fd6cf5edfe688f7abd1716a9c", "zip-http": "git+ssh://git@github.com/Stremio/zip-http#897a59fabae5809f72a0426262eda6225aa971bd", "@babel/plugin-transform-spread": "7.25.9", "nzb-http": "git+ssh://git@github.com/Stremio/nzb-http.git#b3c03a3bb8a8b03e9689cc85e83629fc30aa97fb", "7z-http": "git+ssh://git@github.com/Stremio/7z-http.git#f24d29035ddee487c280e4fe4609d21af7920522", "tar-http": "git+ssh://git@github.com/Stremio/tar-http.git#502c3dafa2d50fe9a6b6e54e798b13305f4665d8", "gzip-http": "git+ssh://git@github.com/Stremio/gzip-http.git#876b9cea2ad83923513d9c4d85bb7d3f794590dc", "ftp-http": "git+ssh://git@github.com/Stremio/ftp-http.git#8a9ae06317401452aeccdb5e795c8985354c19d9" }, author: "Smart Code LTD", license: "MIT", devDependencies: { "@babel/core": "7.20.5", "@babel/polyfill": "7.12.1", "@babel/preset-env": "7.16.0", "@berhalak/dedup-resolve-webpack-plugin": "0.1.1", "babel-loader": "8.2.3", "core-js": "^3.21.1", jest: "^24.9.0", "jest-json-schema": "^2.1.0", "m3u8-parser": "^4.7.0", "string-replace-loader": "3.1.0", "terser-webpack-plugin": "^4", webpack: "^4.34.0", "webpack-cli": "^3.3.4", "webpack-merge": "=5.2.0" } }; }, function(module, exports, __webpack_require__) { var pkg = __webpack_require__(412), path = __webpack_require__(5), os = __webpack_require__(23); if (!(appPath = process.env.APP_PATH)) { var appPath = path.join(os.tmpdir(), pkg.name); "linux" === process.platform ? appPath = path.join(process.env.HOME, "." + pkg.name) : "darwin" === process.platform ? appPath = path.join(process.env.HOME, "Library", "Application Support", pkg.name) : "win32" === process.platform ? appPath = path.join(process.env.APPDATA, "stremio", pkg.name) : console.error("Unable to determine application path - export 'APP_PATH' instead"); } module.exports = appPath; }, function(module, exports, __webpack_require__) { var doClean, enginefs = __webpack_require__(172), walk = __webpack_require__(808), child = __webpack_require__(32), fs = __webpack_require__(2), path = __webpack_require__(5), once = __webpack_require__(35), os = __webpack_require__(23); function getDiskSpace(cachePath, cb) { if (cb = once(cb), process.env.TIZEN_ENV || process.env.WEBOS_ENV) cb(null); else if (process.platform.match(/^win/)) try { var cacheDrive = cachePath.split(":").shift().toUpperCase(); child.exec("wmic logicaldisk where drivetype=3 get caption,size,freespace", (function(err, stdout, stderr) { var line = stdout.split(/\n|\r/).filter((function(x) { return x; })).filter((function(x) { return 0 == x.indexOf(cacheDrive); })).map((function(x) { return x.split(/\t| /).filter((function(x) { return x; })); })).shift(); if (!line) return cb(null); cb({ size: parseInt(line[2]), free: parseInt(line[1]) }); })); } catch (e) { cb(null); } else if (process.env.TV_ENV || process.platform.match(/linux|android/)) { var unit_value = { K: Math.pow(2, 10), M: Math.pow(2, 20), G: Math.pow(2, 30), T: Math.pow(2, 40), P: Math.pow(2, 50), E: Math.pow(2, 60), Z: Math.pow(2, 70), Y: Math.pow(2, 80), R: Math.pow(2, 90), Q: Math.pow(2, 100) }, parseValue = function(value) { return parseFloat(value.replace(/([\d.]+)(\w?)/, (function(_, val, unit) { return parseFloat(val, 10) * (unit_value[unit] || unit_value.K); })), 10); }; try { child.exec(`df -k ${cachePath} 2>/dev/null || true`, (function(err, stdout) { var [headers, stats] = stdout.split("\n").map((function(l) { return l.split(/\s+/); })), size_id = headers.findIndex((function(h) { return "Size" === h || h.endsWith("-blocks"); })), avail_id = headers.findIndex((function(h) { return [ "avail", "free" ].includes(h.slice(0, 5).toLowerCase()); })); if (-1 === avail_id || -1 === size_id) return cb(null); cb({ size: parseValue(stats[size_id]), free: parseValue(stats[avail_id]) }); })); } catch (e) { cb(null); } } else if (process.platform.match(/darwin/)) try { child.exec("df '" + cachePath + "'", (function(err, stdout, stderr) { var line = stdout.split(/\n|\r/).filter((function(x) { return x; })).slice(1).map((function(x) { return x.split(/\t| /).filter((function(x) { return x; })); })).shift(); if (!line) return cb(null); cb({ size: 512 * parseInt(line[1]), free: parseInt(512 * line[3]) }); })); } catch (e) { cb(null); } else setTimeout((function() { cb(); }), 1500), cb(null); } function clearCache(cachePath, toSize, requiredSize, callback) { if (toSize == 1 / 0) return callback && callback({}); var files = [], engines = enginefs.list(), walker = walk.walk(cachePath); walker.on("file", (function(root, file, next) { var ih = root.split(path.sep).pop(); file.name && (files.push({ mtime: file.mtime, atime: file.atime, size: file.size, path: path.join(root, file.name), omit: -1 != engines.indexOf(ih) }), next()); })), walker.on("end", (function() { var cacheSize = (files = files.sort((function(b, a) { return a.atime.getTime() - b.atime.getTime(); }))).map((function(x) { return x.size; })).reduce((function(a, b) { return a + b; }), 0); getDiskSpace(cachePath, (function(space) { space && (toSize = Math.min(toSize, cacheSize + space.free - requiredSize || toSize)); var sizeSum = 0, deleted = 0; files.forEach((function(f) { (sizeSum += f.size) > toSize && !f.omit && (deleted++, fs.unlink(f.path, (function(e) { e && console.error(e); }))); })), console.log("Resizing cache size to " + Math.round(toSize / 1048576) + "MB from " + Math.round(cacheSize / 1048576) + "MB by deleting " + deleted + " files"), callback && callback({ current: cacheSize, to: toSize, deleted: deleted }); })); })); } function getCacheLocations(callback) { process.platform.match(/^win/) ? child.exec("wmic logicaldisk where drivetype=3 get caption", (function(err, stdout, stderr) { var prio = [ "E", "D" ]; callback(null, stdout.split(/\n|\r| /).filter((function(x) { return x; })).slice(1).filter((function(drive) { return "Q" != drive[0]; })).sort((function(a, b) { return (prio.indexOf(a[0]) > -1) - (prio.indexOf(b[0]) > -1); })).map((function(d) { return d[0] + ":\\"; }))); })) : (process.platform.match(/linux/), callback(null, [])); } module.exports = { getDiskSpace: getDiskSpace, getCacheLocations: getCacheLocations, clearCache: clearCache, getOptions: function(cb) { getCacheLocations((function(err, locations) { if (err) return cb(err); var interfaces = process.env.NO_NETWORK_INTERFACES ? [] : os.networkInterfaces(), addresses = [].concat.apply([], Object.keys(interfaces).map((function(networkInterface) { return interfaces[networkInterface].map((function(address) { return { address: address.address, netmask: address.netmask, cird: address.cird, family: address.family, internal: address.internal, interface: networkInterface }; })); }))).filter((function(address) { return "IPv4" === address.family && !address.internal; })).map((function(record) { return { name: record.address, val: record.address }; })), opts = [ { id: "localAddonEnabled", label: "ENABLE_LOCAL_FILES_ADDON", type: "checkbox" }, { id: "remoteHttps", label: "ENABLE_REMOTE_HTTPS_CONN", type: "select", class: "https", icon: !0, selections: [ { name: "Disabled", val: "" } ].concat(addresses) }, { id: "cacheSize", label: "CACHING", type: "select", class: "caching", icon: !0, selections: [ { name: "no caching", val: 0 }, { name: "2GB", val: 2147483648 }, { name: "5GB", val: 5368709120 }, { name: "10GB", val: 10737418240 }, { name: "∞", val: 1 / 0 } ] } ]; locations.length && opts.push({ id: "cacheRoot", label: "SETTINGS_CACHING_DRIVE", type: "select", class: "caching", selections: locations.map((function(p) { return { val: p, name: p.slice(0, 2) }; })) }), cb(null, opts); })); }, setOptionValues: function(vals, cb) { doClean && clearTimeout(doClean), vals.cacheSize, doClean = setTimeout((function() { doClean = null, clearCache(enginefs.getCachePath(""), vals.cacheSize, 0, cb); }), 1e4); } }; }, function(module, exports, __webpack_require__) { "use strict"; (function(__dirname) { function getPath(name) { const os = __webpack_require__(23), path = __webpack_require__(5), binaries = Object.assign(Object.create(null), { darwin: [ "x64" ], linux: [ "x64", "ia32", "arm64", "arm" ], win32: [ "x64", "ia32" ] }), platform = process.env.npm_config_platform || os.platform(), arch = process.env.npm_config_arch || os.arch(); return binaries[platform] && -1 !== binaries[platform].indexOf(arch) ? path.join(__dirname, "win32" === platform ? name + ".exe" : name) : null; } exports.ffmpegPath = getPath("ffmpeg"), exports.ffprobePath = getPath("ffprobe"); }).call(this, "/"); }, function(module, exports) { var tick = 1, timer = setInterval((function() { tick = tick + 1 & 65535; }), 250); timer.unref && timer.unref(), module.exports = function(seconds) { var size = 4 * (seconds || 5), buffer = [ 0 ], pointer = 1, last = tick - 1 & 65535; return function(delta) { var dist = tick - last & 65535; for (dist > size && (dist = size), last = tick; dist--; ) pointer === size && (pointer = 0), buffer[pointer] = buffer[0 === pointer ? size - 1 : pointer - 1], pointer++; delta && (buffer[pointer - 1] += delta); var top = buffer[pointer - 1], btm = buffer.length < size ? 0 : buffer[pointer === size ? 0 : pointer]; return buffer.length < 4 ? top : 4 * (top - btm) / buffer.length; }; }; }, function(module, exports, __webpack_require__) { module.exports = Readable; var isArray = __webpack_require__(826), Buffer = __webpack_require__(10).Buffer; Readable.ReadableState = ReadableState; var EE = __webpack_require__(4).EventEmitter; EE.listenerCount || (EE.listenerCount = function(emitter, type) { return emitter.listeners(type).length; }); var StringDecoder, Stream = __webpack_require__(3), util = __webpack_require__(33); util.inherits = __webpack_require__(8); var debug = __webpack_require__(0); function ReadableState(options, stream) { var Duplex = __webpack_require__(84), hwm = (options = options || {}).highWaterMark, defaultHwm = options.objectMode ? 16 : 16384; this.highWaterMark = hwm || 0 === hwm ? hwm : defaultHwm, this.highWaterMark = ~~this.highWaterMark, this.buffer = [], this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.objectMode = !!options.objectMode, stream instanceof Duplex && (this.objectMode = this.objectMode || !!options.readableObjectMode), this.defaultEncoding = options.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, options.encoding && (StringDecoder || (StringDecoder = __webpack_require__(419).StringDecoder), this.decoder = new StringDecoder(options.encoding), this.encoding = options.encoding); } function Readable(options) { if (__webpack_require__(84), !(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this), this.readable = !0, Stream.call(this); } function readableAddChunk(stream, state, chunk, encoding, addToFront) { var er = (function(state, chunk) { var er = null; return util.isBuffer(chunk) || util.isString(chunk) || util.isNullOrUndefined(chunk) || state.objectMode || (er = new TypeError("Invalid non-string/buffer chunk")), er; })(state, chunk); if (er) stream.emit("error", er); else if (util.isNullOrUndefined(chunk)) state.reading = !1, state.ended || (function(stream, state) { if (state.decoder && !state.ended) { var chunk = state.decoder.end(); chunk && chunk.length && (state.buffer.push(chunk), state.length += state.objectMode ? 1 : chunk.length); } state.ended = !0, emitReadable(stream); })(stream, state); else if (state.objectMode || chunk && chunk.length > 0) if (state.ended && !addToFront) { var e = new Error("stream.push() after EOF"); stream.emit("error", e); } else state.endEmitted && addToFront ? (e = new Error("stream.unshift() after end event"), stream.emit("error", e)) : (!state.decoder || addToFront || encoding || (chunk = state.decoder.write(chunk)), addToFront || (state.reading = !1), state.flowing && 0 === state.length && !state.sync ? (stream.emit("data", chunk), stream.read(0)) : (state.length += state.objectMode ? 1 : chunk.length, addToFront ? state.buffer.unshift(chunk) : state.buffer.push(chunk), state.needReadable && emitReadable(stream)), (function(stream, state) { state.readingMore || (state.readingMore = !0, process.nextTick((function() { !(function(stream, state) { for (var len = state.length; !state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark && (debug("maybeReadMore read 0"), stream.read(0), len !== state.length); ) len = state.length; state.readingMore = !1; })(stream, state); }))); })(stream, state)); else addToFront || (state.reading = !1); return (function(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || 0 === state.length); })(state); } function howMuchToRead(n, state) { return 0 === state.length && state.ended ? 0 : state.objectMode ? 0 === n ? 0 : 1 : isNaN(n) || util.isNull(n) ? state.flowing && state.buffer.length ? state.buffer[0].length : state.length : n <= 0 ? 0 : (n > state.highWaterMark && (state.highWaterMark = (function(n) { if (n >= 8388608) n = 8388608; else { n--; for (var p = 1; p < 32; p <<= 1) n |= n >> p; n++; } return n; })(n)), n > state.length ? state.ended ? state.length : (state.needReadable = !0, 0) : n); } function emitReadable(stream) { var state = stream._readableState; state.needReadable = !1, state.emittedReadable || (debug("emitReadable", state.flowing), state.emittedReadable = !0, state.sync ? process.nextTick((function() { emitReadable_(stream); })) : emitReadable_(stream)); } function emitReadable_(stream) { debug("emit readable"), stream.emit("readable"), flow(stream); } function flow(stream) { var state = stream._readableState; if (debug("flow", state.flowing), state.flowing) do { var chunk = stream.read(); } while (null !== chunk && state.flowing); } function fromList(n, state) { var ret, list = state.buffer, length = state.length, stringMode = !!state.decoder, objectMode = !!state.objectMode; if (0 === list.length) return null; if (0 === length) ret = null; else if (objectMode) ret = list.shift(); else if (!n || n >= length) ret = stringMode ? list.join("") : Buffer.concat(list, length), list.length = 0; else if (n < list[0].length) ret = (buf = list[0]).slice(0, n), list[0] = buf.slice(n); else if (n === list[0].length) ret = list.shift(); else { ret = stringMode ? "" : new Buffer(n); for (var c = 0, i = 0, l = list.length; i < l && c < n; i++) { var buf = list[0], cpy = Math.min(n - c, buf.length); stringMode ? ret += buf.slice(0, cpy) : buf.copy(ret, c, 0, cpy), cpy < buf.length ? list[0] = buf.slice(cpy) : list.shift(), c += cpy; } } return ret; } function endReadable(stream) { var state = stream._readableState; if (state.length > 0) throw new Error("endReadable called on non-empty stream"); state.endEmitted || (state.ended = !0, process.nextTick((function() { state.endEmitted || 0 !== state.length || (state.endEmitted = !0, stream.readable = !1, stream.emit("end")); }))); } debug = debug && debug.debuglog ? debug.debuglog("stream") : function() {}, util.inherits(Readable, Stream), Readable.prototype.push = function(chunk, encoding) { var state = this._readableState; return util.isString(chunk) && !state.objectMode && (encoding = encoding || state.defaultEncoding) !== state.encoding && (chunk = new Buffer(chunk, encoding), encoding = ""), readableAddChunk(this, state, chunk, encoding, !1); }, Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, this._readableState, chunk, "", !0); }, Readable.prototype.setEncoding = function(enc) { return StringDecoder || (StringDecoder = __webpack_require__(419).StringDecoder), this._readableState.decoder = new StringDecoder(enc), this._readableState.encoding = enc, this; }, Readable.prototype.read = function(n) { debug("read", n); var state = this._readableState, nOrig = n; if ((!util.isNumber(n) || n > 0) && (state.emittedReadable = !1), 0 === n && state.needReadable && (state.length >= state.highWaterMark || state.ended)) return debug("read: emitReadable", state.length, state.ended), 0 === state.length && state.ended ? endReadable(this) : emitReadable(this), null; if (0 === (n = howMuchToRead(n, state)) && state.ended) return 0 === state.length && endReadable(this), null; var ret, doRead = state.needReadable; return debug("need readable", doRead), (0 === state.length || state.length - n < state.highWaterMark) && debug("length less than watermark", doRead = !0), (state.ended || state.reading) && debug("reading or ended", doRead = !1), doRead && (debug("do read"), state.reading = !0, state.sync = !0, 0 === state.length && (state.needReadable = !0), this._read(state.highWaterMark), state.sync = !1), doRead && !state.reading && (n = howMuchToRead(nOrig, state)), ret = n > 0 ? fromList(n, state) : null, util.isNull(ret) && (state.needReadable = !0, n = 0), state.length -= n, 0 !== state.length || state.ended || (state.needReadable = !0), nOrig !== n && state.ended && 0 === state.length && endReadable(this), util.isNull(ret) || this.emit("data", ret), ret; }, Readable.prototype._read = function(n) { this.emit("error", new Error("not implemented")); }, Readable.prototype.pipe = function(dest, pipeOpts) { var src = this, state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [ state.pipes, dest ]; break; default: state.pipes.push(dest); } state.pipesCount += 1, debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); var endFn = pipeOpts && !1 === pipeOpts.end || dest === process.stdout || dest === process.stderr ? cleanup : onend; function onunpipe(readable) { debug("onunpipe"), readable === src && cleanup(); } function onend() { debug("onend"), dest.end(); } state.endEmitted ? process.nextTick(endFn) : src.once("end", endFn), dest.on("unpipe", onunpipe); var ondrain = (function(src) { return function() { var state = src._readableState; debug("pipeOnDrain", state.awaitDrain), state.awaitDrain && state.awaitDrain--, 0 === state.awaitDrain && EE.listenerCount(src, "data") && (state.flowing = !0, flow(src)); }; })(src); function cleanup() { debug("cleanup"), dest.removeListener("close", onclose), dest.removeListener("finish", onfinish), dest.removeListener("drain", ondrain), dest.removeListener("error", onerror), dest.removeListener("unpipe", onunpipe), src.removeListener("end", onend), src.removeListener("end", cleanup), src.removeListener("data", ondata), !state.awaitDrain || dest._writableState && !dest._writableState.needDrain || ondrain(); } function ondata(chunk) { debug("ondata"), !1 === dest.write(chunk) && (debug("false write response, pause", src._readableState.awaitDrain), src._readableState.awaitDrain++, src.pause()); } function onerror(er) { debug("onerror", er), unpipe(), dest.removeListener("error", onerror), 0 === EE.listenerCount(dest, "error") && dest.emit("error", er); } function onclose() { dest.removeListener("finish", onfinish), unpipe(); } function onfinish() { debug("onfinish"), dest.removeListener("close", onclose), unpipe(); } function unpipe() { debug("unpipe"), src.unpipe(dest); } return dest.on("drain", ondrain), src.on("data", ondata), dest._events && dest._events.error ? isArray(dest._events.error) ? dest._events.error.unshift(onerror) : dest._events.error = [ onerror, dest._events.error ] : dest.on("error", onerror), dest.once("close", onclose), dest.once("finish", onfinish), dest.emit("pipe", src), state.flowing || (debug("pipe resume"), src.resume()), dest; }, Readable.prototype.unpipe = function(dest) { var state = this._readableState; if (0 === state.pipesCount) return this; if (1 === state.pipesCount) return dest && dest !== state.pipes || (dest || (dest = state.pipes), state.pipes = null, state.pipesCount = 0, state.flowing = !1, dest && dest.emit("unpipe", this)), this; if (!dest) { var dests = state.pipes, len = state.pipesCount; state.pipes = null, state.pipesCount = 0, state.flowing = !1; for (var i = 0; i < len; i++) dests[i].emit("unpipe", this); return this; } return -1 === (i = (function(xs, x) { for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i; return -1; })(state.pipes, dest)) || (state.pipes.splice(i, 1), state.pipesCount -= 1, 1 === state.pipesCount && (state.pipes = state.pipes[0]), dest.emit("unpipe", this)), this; }, Readable.prototype.on = function(ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if ("data" === ev && !1 !== this._readableState.flowing && this.resume(), "readable" === ev && this.readable) { var state = this._readableState; if (!state.readableListening) if (state.readableListening = !0, state.emittedReadable = !1, state.needReadable = !0, state.reading) state.length && emitReadable(this); else { var self = this; process.nextTick((function() { debug("readable nexttick read 0"), self.read(0); })); } } return res; }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.resume = function() { var state = this._readableState; return state.flowing || (debug("resume"), state.flowing = !0, state.reading || (debug("resume read 0"), this.read(0)), (function(stream, state) { state.resumeScheduled || (state.resumeScheduled = !0, process.nextTick((function() { !(function(stream, state) { state.resumeScheduled = !1, stream.emit("resume"), flow(stream), state.flowing && !state.reading && stream.read(0); })(stream, state); }))); })(this, state)), this; }, Readable.prototype.pause = function() { return debug("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (debug("pause"), this._readableState.flowing = !1, this.emit("pause")), this; }, Readable.prototype.wrap = function(stream) { var state = this._readableState, paused = !1, self = this; for (var i in stream.on("end", (function() { if (debug("wrapped end"), state.decoder && !state.ended) { var chunk = state.decoder.end(); chunk && chunk.length && self.push(chunk); } self.push(null); })), stream.on("data", (function(chunk) { debug("wrapped data"), state.decoder && (chunk = state.decoder.write(chunk)), chunk && (state.objectMode || chunk.length) && (self.push(chunk) || (paused = !0, stream.pause())); })), stream) util.isFunction(stream[i]) && util.isUndefined(this[i]) && (this[i] = (function(method) { return function() { return stream[method].apply(stream, arguments); }; })(i)); return (function(xs, f) { for (var i = 0, l = xs.length; i < l; i++) ev = xs[i], stream.on(ev, self.emit.bind(self, ev)); var ev; })([ "error", "close", "destroy", "pause", "resume" ]), self._read = function(n) { debug("wrapped _read", n), paused && (paused = !1, stream.resume()); }, self; }, Readable._fromList = fromList; }, function(module, exports, __webpack_require__) { module.exports = Writable; var Buffer = __webpack_require__(10).Buffer; Writable.WritableState = WritableState; var util = __webpack_require__(33); util.inherits = __webpack_require__(8); var Stream = __webpack_require__(3); function WriteReq(chunk, encoding, cb) { this.chunk = chunk, this.encoding = encoding, this.callback = cb; } function WritableState(options, stream) { var Duplex = __webpack_require__(84), hwm = (options = options || {}).highWaterMark, defaultHwm = options.objectMode ? 16 : 16384; this.highWaterMark = hwm || 0 === hwm ? hwm : defaultHwm, this.objectMode = !!options.objectMode, stream instanceof Duplex && (this.objectMode = this.objectMode || !!options.writableObjectMode), this.highWaterMark = ~~this.highWaterMark, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1; var noDecode = !1 === options.decodeStrings; this.decodeStrings = !noDecode, this.defaultEncoding = options.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(er) { !(function(stream, er) { var state = stream._writableState, sync = state.sync, cb = state.writecb; if ((function(state) { state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0; })(state), er) !(function(stream, state, sync, er, cb) { sync ? process.nextTick((function() { state.pendingcb--, cb(er); })) : (state.pendingcb--, cb(er)), stream._writableState.errorEmitted = !0, stream.emit("error", er); })(stream, state, sync, er, cb); else { var finished = needFinish(stream, state); finished || state.corked || state.bufferProcessing || !state.buffer.length || clearBuffer(stream, state), sync ? process.nextTick((function() { afterWrite(stream, state, finished, cb); })) : afterWrite(stream, state, finished, cb); } })(stream, er); }, this.writecb = null, this.writelen = 0, this.buffer = [], this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1; } function Writable(options) { var Duplex = __webpack_require__(84); if (!(this instanceof Writable || this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this), this.writable = !0, Stream.call(this); } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, writev ? stream._writev(chunk, state.onwrite) : stream._write(chunk, encoding, state.onwrite), state.sync = !1; } function afterWrite(stream, state, finished, cb) { finished || (function(stream, state) { 0 === state.length && state.needDrain && (state.needDrain = !1, stream.emit("drain")); })(stream, state), state.pendingcb--, cb(), finishMaybe(stream, state); } function clearBuffer(stream, state) { if (state.bufferProcessing = !0, stream._writev && state.buffer.length > 1) { for (var cbs = [], c = 0; c < state.buffer.length; c++) cbs.push(state.buffer[c].callback); state.pendingcb++, doWrite(stream, state, !0, state.length, state.buffer, "", (function(err) { for (var i = 0; i < cbs.length; i++) state.pendingcb--, cbs[i](err); })), state.buffer = []; } else { for (c = 0; c < state.buffer.length; c++) { var entry = state.buffer[c], chunk = entry.chunk, encoding = entry.encoding, cb = entry.callback, len = state.objectMode ? 1 : chunk.length; if (doWrite(stream, state, !1, len, chunk, encoding, cb), state.writing) { c++; break; } } c < state.buffer.length ? state.buffer = state.buffer.slice(c) : state.buffer.length = 0; } state.bufferProcessing = !1; } function needFinish(stream, state) { return state.ending && 0 === state.length && !state.finished && !state.writing; } function prefinish(stream, state) { state.prefinished || (state.prefinished = !0, stream.emit("prefinish")); } function finishMaybe(stream, state) { var need = needFinish(0, state); return need && (0 === state.pendingcb ? (prefinish(stream, state), state.finished = !0, stream.emit("finish")) : prefinish(stream, state)), need; } util.inherits(Writable, Stream), Writable.prototype.pipe = function() { this.emit("error", new Error("Cannot pipe. Not readable.")); }, Writable.prototype.write = function(chunk, encoding, cb) { var state = this._writableState, ret = !1; return util.isFunction(encoding) && (cb = encoding, encoding = null), util.isBuffer(chunk) ? encoding = "buffer" : encoding || (encoding = state.defaultEncoding), util.isFunction(cb) || (cb = function() {}), state.ended ? (function(stream, state, cb) { var er = new Error("write after end"); stream.emit("error", er), process.nextTick((function() { cb(er); })); })(this, 0, cb) : (function(stream, state, chunk, cb) { var valid = !0; if (!(util.isBuffer(chunk) || util.isString(chunk) || util.isNullOrUndefined(chunk) || state.objectMode)) { var er = new TypeError("Invalid non-string/buffer chunk"); stream.emit("error", er), process.nextTick((function() { cb(er); })), valid = !1; } return valid; })(this, state, chunk, cb) && (state.pendingcb++, ret = (function(stream, state, chunk, encoding, cb) { chunk = (function(state, chunk, encoding) { return !state.objectMode && !1 !== state.decodeStrings && util.isString(chunk) && (chunk = new Buffer(chunk, encoding)), chunk; })(state, chunk, encoding), util.isBuffer(chunk) && (encoding = "buffer"); var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; return ret || (state.needDrain = !0), state.writing || state.corked ? state.buffer.push(new WriteReq(chunk, encoding, cb)) : doWrite(stream, state, !1, len, chunk, encoding, cb), ret; })(this, state, chunk, encoding, cb)), ret; }, Writable.prototype.cork = function() { this._writableState.corked++; }, Writable.prototype.uncork = function() { var state = this._writableState; state.corked && (state.corked--, state.writing || state.corked || state.finished || state.bufferProcessing || !state.buffer.length || clearBuffer(this, state)); }, Writable.prototype._write = function(chunk, encoding, cb) { cb(new Error("not implemented")); }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; util.isFunction(chunk) ? (cb = chunk, chunk = null, encoding = null) : util.isFunction(encoding) && (cb = encoding, encoding = null), util.isNullOrUndefined(chunk) || this.write(chunk, encoding), state.corked && (state.corked = 1, this.uncork()), state.ending || state.finished || (function(stream, state, cb) { state.ending = !0, finishMaybe(stream, state), cb && (state.finished ? process.nextTick(cb) : stream.once("finish", cb)), state.ended = !0; })(this, state, cb); }; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(10).Buffer, isBufferEncoding = Buffer.isEncoding || function(encoding) { switch (encoding && encoding.toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": case "raw": return !0; default: return !1; } }, StringDecoder = exports.StringDecoder = function(encoding) { switch (this.encoding = (encoding || "utf8").toLowerCase().replace(/[-_]/, ""), (function(encoding) { if (encoding && !isBufferEncoding(encoding)) throw new Error("Unknown encoding: " + encoding); })(encoding), this.encoding) { case "utf8": this.surrogateSize = 3; break; case "ucs2": case "utf16le": this.surrogateSize = 2, this.detectIncompleteChar = utf16DetectIncompleteChar; break; case "base64": this.surrogateSize = 3, this.detectIncompleteChar = base64DetectIncompleteChar; break; default: return void (this.write = passThroughWrite); } this.charBuffer = new Buffer(6), this.charReceived = 0, this.charLength = 0; }; function passThroughWrite(buffer) { return buffer.toString(this.encoding); } function utf16DetectIncompleteChar(buffer) { this.charReceived = buffer.length % 2, this.charLength = this.charReceived ? 2 : 0; } function base64DetectIncompleteChar(buffer) { this.charReceived = buffer.length % 3, this.charLength = this.charReceived ? 3 : 0; } StringDecoder.prototype.write = function(buffer) { for (var charStr = ""; this.charLength; ) { var available = buffer.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : buffer.length; if (buffer.copy(this.charBuffer, this.charReceived, 0, available), this.charReceived += available, this.charReceived < this.charLength) return ""; if (buffer = buffer.slice(available, buffer.length), !((charCode = (charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding)).charCodeAt(charStr.length - 1)) >= 55296 && charCode <= 56319)) { if (this.charReceived = this.charLength = 0, 0 === buffer.length) return charStr; break; } this.charLength += this.surrogateSize, charStr = ""; } this.detectIncompleteChar(buffer); var charCode, end = buffer.length; if (this.charLength && (buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end), end -= this.charReceived), end = (charStr += buffer.toString(this.encoding, 0, end)).length - 1, (charCode = charStr.charCodeAt(end)) >= 55296 && charCode <= 56319) { var size = this.surrogateSize; return this.charLength += size, this.charReceived += size, this.charBuffer.copy(this.charBuffer, size, 0, size), buffer.copy(this.charBuffer, 0, 0, size), charStr.substring(0, end); } return charStr; }, StringDecoder.prototype.detectIncompleteChar = function(buffer) { for (var i = buffer.length >= 3 ? 3 : buffer.length; i > 0; i--) { var c = buffer[buffer.length - i]; if (1 == i && c >> 5 == 6) { this.charLength = 2; break; } if (i <= 2 && c >> 4 == 14) { this.charLength = 3; break; } if (i <= 3 && c >> 3 == 30) { this.charLength = 4; break; } } this.charReceived = i; }, StringDecoder.prototype.end = function(buffer) { var res = ""; if (buffer && buffer.length && (res = this.write(buffer)), this.charReceived) { var cr = this.charReceived, buf = this.charBuffer, enc = this.encoding; res += buf.slice(0, cr).toString(enc); } return res; }; }, function(module, exports, __webpack_require__) { module.exports = Transform; var Duplex = __webpack_require__(84), util = __webpack_require__(33); function TransformState(options, stream) { this.afterTransform = function(er, data) { return (function(stream, er, data) { var ts = stream._transformState; ts.transforming = !1; var cb = ts.writecb; if (!cb) return stream.emit("error", new Error("no writecb in Transform class")); ts.writechunk = null, ts.writecb = null, util.isNullOrUndefined(data) || stream.push(data), cb && cb(er); var rs = stream._readableState; rs.reading = !1, (rs.needReadable || rs.length < rs.highWaterMark) && stream._read(rs.highWaterMark); })(stream, er, data); }, this.needTransform = !1, this.transforming = !1, this.writecb = null, this.writechunk = null; } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options), this._transformState = new TransformState(options, this); var stream = this; this._readableState.needReadable = !0, this._readableState.sync = !1, this.once("prefinish", (function() { util.isFunction(this._flush) ? this._flush((function(er) { done(stream, er); })) : done(stream); })); } function done(stream, er) { if (er) return stream.emit("error", er); var ws = stream._writableState, ts = stream._transformState; if (ws.length) throw new Error("calling transform done when ws.length != 0"); if (ts.transforming) throw new Error("calling transform done when still transforming"); return stream.push(null); } util.inherits = __webpack_require__(8), util.inherits(Transform, Duplex), Transform.prototype.push = function(chunk, encoding) { return this._transformState.needTransform = !1, Duplex.prototype.push.call(this, chunk, encoding); }, Transform.prototype._transform = function(chunk, encoding, cb) { throw new Error("not implemented"); }, Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; if (ts.writecb = cb, ts.writechunk = chunk, ts.writeencoding = encoding, !ts.transforming) { var rs = this._readableState; (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark); } }, Transform.prototype._read = function(n) { var ts = this._transformState; util.isNull(ts.writechunk) || !ts.writecb || ts.transforming ? ts.needTransform = !0 : (ts.transforming = !0, this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform)); }; }, function(module, exports) { var toString = Object.prototype.toString, isModern = "undefined" != typeof Buffer && "function" == typeof Buffer.alloc && "function" == typeof Buffer.allocUnsafe && "function" == typeof Buffer.from; module.exports = function(value, encodingOrOffset, length) { if ("number" == typeof value) throw new TypeError('"value" argument must not be a number'); return input = value, "ArrayBuffer" === toString.call(input).slice(8, -1) ? (function(obj, byteOffset, length) { byteOffset >>>= 0; var maxLength = obj.byteLength - byteOffset; if (maxLength < 0) throw new RangeError("'offset' is out of bounds"); if (void 0 === length) length = maxLength; else if ((length >>>= 0) > maxLength) throw new RangeError("'length' is out of bounds"); return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))); })(value, encodingOrOffset, length) : "string" == typeof value ? (function(string, encoding) { if ("string" == typeof encoding && "" !== encoding || (encoding = "utf8"), !Buffer.isEncoding(encoding)) throw new TypeError('"encoding" must be a valid string encoding'); return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding); })(value, encodingOrOffset) : isModern ? Buffer.from(value) : new Buffer(value); var input; }; }, function(module, exports, __webpack_require__) { var bufferFill = __webpack_require__(830), allocUnsafe = __webpack_require__(831); module.exports = function(size, fill, encoding) { if ("number" != typeof size) throw new TypeError('"size" argument must be a number'); if (size < 0) throw new RangeError('"size" argument must not be negative'); if (Buffer.alloc) return Buffer.alloc(size, fill, encoding); var buffer = allocUnsafe(size); return 0 === size ? buffer : void 0 === fill ? bufferFill(buffer, 0) : ("string" != typeof encoding && (encoding = void 0), bufferFill(buffer, fill, encoding)); }; }, function(module, exports, __webpack_require__) { module.exports = realpath, realpath.realpath = realpath, realpath.sync = realpathSync, realpath.realpathSync = realpathSync, realpath.monkeypatch = function() { fs.realpath = realpath, fs.realpathSync = realpathSync; }, realpath.unmonkeypatch = function() { fs.realpath = origRealpath, fs.realpathSync = origRealpathSync; }; var fs = __webpack_require__(2), origRealpath = fs.realpath, origRealpathSync = fs.realpathSync, version = process.version, ok = /^v[0-5]\./.test(version), old = __webpack_require__(834); function newError(er) { return er && "realpath" === er.syscall && ("ELOOP" === er.code || "ENOMEM" === er.code || "ENAMETOOLONG" === er.code); } function realpath(p, cache, cb) { if (ok) return origRealpath(p, cache, cb); "function" == typeof cache && (cb = cache, cache = null), origRealpath(p, cache, (function(er, result) { newError(er) ? old.realpath(p, cache, cb) : cb(er, result); })); } function realpathSync(p, cache) { if (ok) return origRealpathSync(p, cache); try { return origRealpathSync(p, cache); } catch (er) { if (newError(er)) return old.realpathSync(p, cache); throw er; } } }, function(module, exports, __webpack_require__) { function ownProp(obj, field) { return Object.prototype.hasOwnProperty.call(obj, field); } exports.setopts = function(self, pattern, options) { if (options || (options = {}), options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) throw new Error("base matching requires globstar"); pattern = "**/" + pattern; } self.silent = !!options.silent, self.pattern = pattern, self.strict = !1 !== options.strict, self.realpath = !!options.realpath, self.realpathCache = options.realpathCache || Object.create(null), self.follow = !!options.follow, self.dot = !!options.dot, self.mark = !!options.mark, self.nodir = !!options.nodir, self.nodir && (self.mark = !0), self.sync = !!options.sync, self.nounique = !!options.nounique, self.nonull = !!options.nonull, self.nosort = !!options.nosort, self.nocase = !!options.nocase, self.stat = !!options.stat, self.noprocess = !!options.noprocess, self.absolute = !!options.absolute, self.fs = options.fs || fs, self.maxLength = options.maxLength || 1 / 0, self.cache = options.cache || Object.create(null), self.statCache = options.statCache || Object.create(null), self.symlinks = options.symlinks || Object.create(null), (function(self, options) { self.ignore = options.ignore || [], Array.isArray(self.ignore) || (self.ignore = [ self.ignore ]), self.ignore.length && (self.ignore = self.ignore.map(ignoreMap)); })(self, options), self.changedCwd = !1; var cwd = process.cwd(); ownProp(options, "cwd") ? (self.cwd = path.resolve(options.cwd), self.changedCwd = self.cwd !== cwd) : self.cwd = cwd, self.root = options.root || path.resolve(self.cwd, "/"), self.root = path.resolve(self.root), "win32" === process.platform && (self.root = self.root.replace(/\\/g, "/")), self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd), "win32" === process.platform && (self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")), self.nomount = !!options.nomount, options.nonegate = !0, options.nocomment = !0, self.minimatch = new Minimatch(pattern, options), self.options = self.minimatch.options; }, exports.ownProp = ownProp, exports.makeAbs = makeAbs, exports.finish = function(self) { for (var nou = self.nounique, all = nou ? [] : Object.create(null), i = 0, l = self.matches.length; i < l; i++) { var matches = self.matches[i]; if (matches && 0 !== Object.keys(matches).length) { var m = Object.keys(matches); nou ? all.push.apply(all, m) : m.forEach((function(m) { all[m] = !0; })); } else if (self.nonull) { var literal = self.minimatch.globSet[i]; nou ? all.push(literal) : all[literal] = !0; } } if (nou || (all = Object.keys(all)), self.nosort || (all = all.sort(alphasort)), self.mark) { for (i = 0; i < all.length; i++) all[i] = self._mark(all[i]); self.nodir && (all = all.filter((function(e) { var notDir = !/\/$/.test(e), c = self.cache[e] || self.cache[makeAbs(self, e)]; return notDir && c && (notDir = "DIR" !== c && !Array.isArray(c)), notDir; }))); } self.ignore.length && (all = all.filter((function(m) { return !isIgnored(self, m); }))), self.found = all; }, exports.mark = function(self, p) { var abs = makeAbs(self, p), c = self.cache[abs], m = p; if (c) { var isDir = "DIR" === c || Array.isArray(c), slash = "/" === p.slice(-1); if (isDir && !slash ? m += "/" : !isDir && slash && (m = m.slice(0, -1)), m !== p) { var mabs = makeAbs(self, m); self.statCache[mabs] = self.statCache[abs], self.cache[mabs] = self.cache[abs]; } } return m; }, exports.isIgnored = isIgnored, exports.childrenIgnored = function(self, path) { return !!self.ignore.length && self.ignore.some((function(item) { return !(!item.gmatcher || !item.gmatcher.match(path)); })); }; var fs = __webpack_require__(2), path = __webpack_require__(5), minimatch = __webpack_require__(197), isAbsolute = __webpack_require__(198), Minimatch = minimatch.Minimatch; function alphasort(a, b) { return a.localeCompare(b, "en"); } function ignoreMap(pattern) { var gmatcher = null; if ("/**" === pattern.slice(-3)) { var gpattern = pattern.replace(/(\/\*\*)+$/, ""); gmatcher = new Minimatch(gpattern, { dot: !0 }); } return { matcher: new Minimatch(pattern, { dot: !0 }), gmatcher: gmatcher }; } function makeAbs(self, f) { var abs = f; return abs = "/" === f.charAt(0) ? path.join(self.root, f) : isAbsolute(f) || "" === f ? f : self.changedCwd ? path.resolve(self.cwd, f) : path.resolve(f), "win32" === process.platform && (abs = abs.replace(/\\/g, "/")), abs; } function isIgnored(self, path) { return !!self.ignore.length && self.ignore.some((function(item) { return item.matcher.match(path) || !(!item.gmatcher || !item.gmatcher.match(path)); })); } }, function(module, exports, __webpack_require__) { "use strict"; var pna = __webpack_require__(58); module.exports = Readable; var Duplex, isArray = __webpack_require__(426); Readable.ReadableState = ReadableState, __webpack_require__(4).EventEmitter; var EElistenerCount = function(emitter, type) { return emitter.listeners(type).length; }, Stream = __webpack_require__(427), Buffer = __webpack_require__(26).Buffer, OurUint8Array = global.Uint8Array || function() {}, util = Object.create(__webpack_require__(33)); util.inherits = __webpack_require__(106); var debugUtil = __webpack_require__(0), debug = void 0; debug = debugUtil && debugUtil.debuglog ? debugUtil.debuglog("stream") : function() {}; var StringDecoder, BufferList = __webpack_require__(851), destroyImpl = __webpack_require__(428); util.inherits(Readable, Stream); var kProxyEvents = [ "error", "close", "destroy", "pause", "resume" ]; function ReadableState(options, stream) { options = options || {}; var isDuplex = stream instanceof (Duplex = Duplex || __webpack_require__(85)); this.objectMode = !!options.objectMode, isDuplex && (this.objectMode = this.objectMode || !!options.readableObjectMode); var hwm = options.highWaterMark, readableHwm = options.readableHighWaterMark, defaultHwm = this.objectMode ? 16 : 16384; this.highWaterMark = hwm || 0 === hwm ? hwm : isDuplex && (readableHwm || 0 === readableHwm) ? readableHwm : defaultHwm, this.highWaterMark = Math.floor(this.highWaterMark), this.buffer = new BufferList, this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.destroyed = !1, this.defaultEncoding = options.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, options.encoding && (StringDecoder || (StringDecoder = __webpack_require__(430).StringDecoder), this.decoder = new StringDecoder(options.encoding), this.encoding = options.encoding); } function Readable(options) { if (Duplex = Duplex || __webpack_require__(85), !(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this), this.readable = !0, options && ("function" == typeof options.read && (this._read = options.read), "function" == typeof options.destroy && (this._destroy = options.destroy)), Stream.call(this); } function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { var er, state = stream._readableState; return null === chunk ? (state.reading = !1, (function(stream, state) { if (!state.ended) { if (state.decoder) { var chunk = state.decoder.end(); chunk && chunk.length && (state.buffer.push(chunk), state.length += state.objectMode ? 1 : chunk.length); } state.ended = !0, emitReadable(stream); } })(stream, state)) : (skipChunkCheck || (er = (function(state, chunk) { var er, obj; return obj = chunk, Buffer.isBuffer(obj) || obj instanceof OurUint8Array || "string" == typeof chunk || void 0 === chunk || state.objectMode || (er = new TypeError("Invalid non-string/buffer chunk")), er; })(state, chunk)), er ? stream.emit("error", er) : state.objectMode || chunk && chunk.length > 0 ? ("string" == typeof chunk || state.objectMode || Object.getPrototypeOf(chunk) === Buffer.prototype || (chunk = (function(chunk) { return Buffer.from(chunk); })(chunk)), addToFront ? state.endEmitted ? stream.emit("error", new Error("stream.unshift() after end event")) : addChunk(stream, state, chunk, !0) : state.ended ? stream.emit("error", new Error("stream.push() after EOF")) : (state.reading = !1, state.decoder && !encoding ? (chunk = state.decoder.write(chunk), state.objectMode || 0 !== chunk.length ? addChunk(stream, state, chunk, !1) : maybeReadMore(stream, state)) : addChunk(stream, state, chunk, !1))) : addToFront || (state.reading = !1)), (function(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || 0 === state.length); })(state); } function addChunk(stream, state, chunk, addToFront) { state.flowing && 0 === state.length && !state.sync ? (stream.emit("data", chunk), stream.read(0)) : (state.length += state.objectMode ? 1 : chunk.length, addToFront ? state.buffer.unshift(chunk) : state.buffer.push(chunk), state.needReadable && emitReadable(stream)), maybeReadMore(stream, state); } function howMuchToRead(n, state) { return n <= 0 || 0 === state.length && state.ended ? 0 : state.objectMode ? 1 : n != n ? state.flowing && state.length ? state.buffer.head.data.length : state.length : (n > state.highWaterMark && (state.highWaterMark = (function(n) { return n >= 8388608 ? n = 8388608 : (n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++), n; })(n)), n <= state.length ? n : state.ended ? state.length : (state.needReadable = !0, 0)); } function emitReadable(stream) { var state = stream._readableState; state.needReadable = !1, state.emittedReadable || (debug("emitReadable", state.flowing), state.emittedReadable = !0, state.sync ? pna.nextTick(emitReadable_, stream) : emitReadable_(stream)); } function emitReadable_(stream) { debug("emit readable"), stream.emit("readable"), flow(stream); } function maybeReadMore(stream, state) { state.readingMore || (state.readingMore = !0, pna.nextTick(maybeReadMore_, stream, state)); } function maybeReadMore_(stream, state) { for (var len = state.length; !state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark && (debug("maybeReadMore read 0"), stream.read(0), len !== state.length); ) len = state.length; state.readingMore = !1; } function nReadingNextTick(self) { debug("readable nexttick read 0"), self.read(0); } function resume_(stream, state) { state.reading || (debug("resume read 0"), stream.read(0)), state.resumeScheduled = !1, state.awaitDrain = 0, stream.emit("resume"), flow(stream), state.flowing && !state.reading && stream.read(0); } function flow(stream) { var state = stream._readableState; for (debug("flow", state.flowing); state.flowing && null !== stream.read(); ) ; } function fromList(n, state) { return 0 === state.length ? null : (state.objectMode ? ret = state.buffer.shift() : !n || n >= state.length ? (ret = state.decoder ? state.buffer.join("") : 1 === state.buffer.length ? state.buffer.head.data : state.buffer.concat(state.length), state.buffer.clear()) : ret = (function(n, list, hasStrings) { var ret; return n < list.head.data.length ? (ret = list.head.data.slice(0, n), list.head.data = list.head.data.slice(n)) : ret = n === list.head.data.length ? list.shift() : hasStrings ? (function(n, list) { var p = list.head, c = 1, ret = p.data; for (n -= ret.length; p = p.next; ) { var str = p.data, nb = n > str.length ? str.length : n; if (nb === str.length ? ret += str : ret += str.slice(0, n), 0 == (n -= nb)) { nb === str.length ? (++c, p.next ? list.head = p.next : list.head = list.tail = null) : (list.head = p, p.data = str.slice(nb)); break; } ++c; } return list.length -= c, ret; })(n, list) : (function(n, list) { var ret = Buffer.allocUnsafe(n), p = list.head, c = 1; for (p.data.copy(ret), n -= p.data.length; p = p.next; ) { var buf = p.data, nb = n > buf.length ? buf.length : n; if (buf.copy(ret, ret.length - n, 0, nb), 0 == (n -= nb)) { nb === buf.length ? (++c, p.next ? list.head = p.next : list.head = list.tail = null) : (list.head = p, p.data = buf.slice(nb)); break; } ++c; } return list.length -= c, ret; })(n, list), ret; })(n, state.buffer, state.decoder), ret); var ret; } function endReadable(stream) { var state = stream._readableState; if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); state.endEmitted || (state.ended = !0, pna.nextTick(endReadableNT, state, stream)); } function endReadableNT(state, stream) { state.endEmitted || 0 !== state.length || (state.endEmitted = !0, stream.readable = !1, stream.emit("end")); } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i; return -1; } Object.defineProperty(Readable.prototype, "destroyed", { get: function() { return void 0 !== this._readableState && this._readableState.destroyed; }, set: function(value) { this._readableState && (this._readableState.destroyed = value); } }), Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) { this.push(null), cb(err); }, Readable.prototype.push = function(chunk, encoding) { var skipChunkCheck, state = this._readableState; return state.objectMode ? skipChunkCheck = !0 : "string" == typeof chunk && ((encoding = encoding || state.defaultEncoding) !== state.encoding && (chunk = Buffer.from(chunk, encoding), encoding = ""), skipChunkCheck = !0), readableAddChunk(this, chunk, encoding, !1, skipChunkCheck); }, Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, !0, !1); }, Readable.prototype.isPaused = function() { return !1 === this._readableState.flowing; }, Readable.prototype.setEncoding = function(enc) { return StringDecoder || (StringDecoder = __webpack_require__(430).StringDecoder), this._readableState.decoder = new StringDecoder(enc), this._readableState.encoding = enc, this; }, Readable.prototype.read = function(n) { debug("read", n), n = parseInt(n, 10); var state = this._readableState, nOrig = n; if (0 !== n && (state.emittedReadable = !1), 0 === n && state.needReadable && (state.length >= state.highWaterMark || state.ended)) return debug("read: emitReadable", state.length, state.ended), 0 === state.length && state.ended ? endReadable(this) : emitReadable(this), null; if (0 === (n = howMuchToRead(n, state)) && state.ended) return 0 === state.length && endReadable(this), null; var ret, doRead = state.needReadable; return debug("need readable", doRead), (0 === state.length || state.length - n < state.highWaterMark) && debug("length less than watermark", doRead = !0), state.ended || state.reading ? debug("reading or ended", doRead = !1) : doRead && (debug("do read"), state.reading = !0, state.sync = !0, 0 === state.length && (state.needReadable = !0), this._read(state.highWaterMark), state.sync = !1, state.reading || (n = howMuchToRead(nOrig, state))), null === (ret = n > 0 ? fromList(n, state) : null) ? (state.needReadable = !0, n = 0) : state.length -= n, 0 === state.length && (state.ended || (state.needReadable = !0), nOrig !== n && state.ended && endReadable(this)), null !== ret && this.emit("data", ret), ret; }, Readable.prototype._read = function(n) { this.emit("error", new Error("_read() is not implemented")); }, Readable.prototype.pipe = function(dest, pipeOpts) { var src = this, state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [ state.pipes, dest ]; break; default: state.pipes.push(dest); } state.pipesCount += 1, debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); var endFn = pipeOpts && !1 === pipeOpts.end || dest === process.stdout || dest === process.stderr ? unpipe : onend; function onend() { debug("onend"), dest.end(); } state.endEmitted ? pna.nextTick(endFn) : src.once("end", endFn), dest.on("unpipe", (function onunpipe(readable, unpipeInfo) { debug("onunpipe"), readable === src && unpipeInfo && !1 === unpipeInfo.hasUnpiped && (unpipeInfo.hasUnpiped = !0, debug("cleanup"), dest.removeListener("close", onclose), dest.removeListener("finish", onfinish), dest.removeListener("drain", ondrain), dest.removeListener("error", onerror), dest.removeListener("unpipe", onunpipe), src.removeListener("end", onend), src.removeListener("end", unpipe), src.removeListener("data", ondata), cleanedUp = !0, !state.awaitDrain || dest._writableState && !dest._writableState.needDrain || ondrain()); })); var ondrain = (function(src) { return function() { var state = src._readableState; debug("pipeOnDrain", state.awaitDrain), state.awaitDrain && state.awaitDrain--, 0 === state.awaitDrain && EElistenerCount(src, "data") && (state.flowing = !0, flow(src)); }; })(src); dest.on("drain", ondrain); var cleanedUp = !1, increasedAwaitDrain = !1; function ondata(chunk) { debug("ondata"), increasedAwaitDrain = !1, !1 !== dest.write(chunk) || increasedAwaitDrain || ((1 === state.pipesCount && state.pipes === dest || state.pipesCount > 1 && -1 !== indexOf(state.pipes, dest)) && !cleanedUp && (debug("false write response, pause", src._readableState.awaitDrain), src._readableState.awaitDrain++, increasedAwaitDrain = !0), src.pause()); } function onerror(er) { debug("onerror", er), unpipe(), dest.removeListener("error", onerror), 0 === EElistenerCount(dest, "error") && dest.emit("error", er); } function onclose() { dest.removeListener("finish", onfinish), unpipe(); } function onfinish() { debug("onfinish"), dest.removeListener("close", onclose), unpipe(); } function unpipe() { debug("unpipe"), src.unpipe(dest); } return src.on("data", ondata), (function(emitter, event, fn) { if ("function" == typeof emitter.prependListener) return emitter.prependListener("error", fn); emitter._events && emitter._events.error ? isArray(emitter._events.error) ? emitter._events.error.unshift(fn) : emitter._events.error = [ fn, emitter._events.error ] : emitter.on("error", fn); })(dest, 0, onerror), dest.once("close", onclose), dest.once("finish", onfinish), dest.emit("pipe", src), state.flowing || (debug("pipe resume"), src.resume()), dest; }, Readable.prototype.unpipe = function(dest) { var state = this._readableState, unpipeInfo = { hasUnpiped: !1 }; if (0 === state.pipesCount) return this; if (1 === state.pipesCount) return dest && dest !== state.pipes || (dest || (dest = state.pipes), state.pipes = null, state.pipesCount = 0, state.flowing = !1, dest && dest.emit("unpipe", this, unpipeInfo)), this; if (!dest) { var dests = state.pipes, len = state.pipesCount; state.pipes = null, state.pipesCount = 0, state.flowing = !1; for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, unpipeInfo); return this; } var index = indexOf(state.pipes, dest); return -1 === index || (state.pipes.splice(index, 1), state.pipesCount -= 1, 1 === state.pipesCount && (state.pipes = state.pipes[0]), dest.emit("unpipe", this, unpipeInfo)), this; }, Readable.prototype.on = function(ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if ("data" === ev) !1 !== this._readableState.flowing && this.resume(); else if ("readable" === ev) { var state = this._readableState; state.endEmitted || state.readableListening || (state.readableListening = state.needReadable = !0, state.emittedReadable = !1, state.reading ? state.length && emitReadable(this) : pna.nextTick(nReadingNextTick, this)); } return res; }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.resume = function() { var state = this._readableState; return state.flowing || (debug("resume"), state.flowing = !0, (function(stream, state) { state.resumeScheduled || (state.resumeScheduled = !0, pna.nextTick(resume_, stream, state)); })(this, state)), this; }, Readable.prototype.pause = function() { return debug("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (debug("pause"), this._readableState.flowing = !1, this.emit("pause")), this; }, Readable.prototype.wrap = function(stream) { var _this = this, state = this._readableState, paused = !1; for (var i in stream.on("end", (function() { if (debug("wrapped end"), state.decoder && !state.ended) { var chunk = state.decoder.end(); chunk && chunk.length && _this.push(chunk); } _this.push(null); })), stream.on("data", (function(chunk) { debug("wrapped data"), state.decoder && (chunk = state.decoder.write(chunk)), state.objectMode && null == chunk || (state.objectMode || chunk && chunk.length) && (_this.push(chunk) || (paused = !0, stream.pause())); })), stream) void 0 === this[i] && "function" == typeof stream[i] && (this[i] = (function(method) { return function() { return stream[method].apply(stream, arguments); }; })(i)); for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); return this._read = function(n) { debug("wrapped _read", n), paused && (paused = !1, stream.resume()); }, this; }, Object.defineProperty(Readable.prototype, "readableHighWaterMark", { enumerable: !1, get: function() { return this._readableState.highWaterMark; } }), Readable._fromList = fromList; }, function(module, exports) { var toString = {}.toString; module.exports = Array.isArray || function(arr) { return "[object Array]" == toString.call(arr); }; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(3); }, function(module, exports, __webpack_require__) { "use strict"; var pna = __webpack_require__(58); function emitErrorNT(self, err) { self.emit("error", err); } module.exports = { destroy: function(err, cb) { var _this = this, readableDestroyed = this._readableState && this._readableState.destroyed, writableDestroyed = this._writableState && this._writableState.destroyed; return readableDestroyed || writableDestroyed ? (cb ? cb(err) : !err || this._writableState && this._writableState.errorEmitted || pna.nextTick(emitErrorNT, this, err), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(err || null, (function(err) { !cb && err ? (pna.nextTick(emitErrorNT, _this, err), _this._writableState && (_this._writableState.errorEmitted = !0)) : cb && cb(err); })), this); }, undestroy: function() { this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1); } }; }, function(module, exports, __webpack_require__) { "use strict"; var pna = __webpack_require__(58); function CorkedRequest(state) { var _this = this; this.next = null, this.entry = null, this.finish = function() { !(function(corkReq, state, err) { var entry = corkReq.entry; for (corkReq.entry = null; entry; ) { var cb = entry.callback; state.pendingcb--, cb(undefined), entry = entry.next; } state.corkedRequestsFree ? state.corkedRequestsFree.next = corkReq : state.corkedRequestsFree = corkReq; })(_this, state); }; } module.exports = Writable; var Duplex, asyncWrite = !process.browser && [ "v0.10", "v0.9." ].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; Writable.WritableState = WritableState; var util = Object.create(__webpack_require__(33)); util.inherits = __webpack_require__(106); var realHasInstance, internalUtil = { deprecate: __webpack_require__(201) }, Stream = __webpack_require__(427), Buffer = __webpack_require__(26).Buffer, OurUint8Array = global.Uint8Array || function() {}, destroyImpl = __webpack_require__(428); function nop() {} function WritableState(options, stream) { Duplex = Duplex || __webpack_require__(85), options = options || {}; var isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode, isDuplex && (this.objectMode = this.objectMode || !!options.writableObjectMode); var hwm = options.highWaterMark, writableHwm = options.writableHighWaterMark, defaultHwm = this.objectMode ? 16 : 16384; this.highWaterMark = hwm || 0 === hwm ? hwm : isDuplex && (writableHwm || 0 === writableHwm) ? writableHwm : defaultHwm, this.highWaterMark = Math.floor(this.highWaterMark), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1; var noDecode = !1 === options.decodeStrings; this.decodeStrings = !noDecode, this.defaultEncoding = options.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(er) { !(function(stream, er) { var state = stream._writableState, sync = state.sync, cb = state.writecb; if ((function(state) { state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0; })(state), er) !(function(stream, state, sync, er, cb) { --state.pendingcb, sync ? (pna.nextTick(cb, er), pna.nextTick(finishMaybe, stream, state), stream._writableState.errorEmitted = !0, stream.emit("error", er)) : (cb(er), stream._writableState.errorEmitted = !0, stream.emit("error", er), finishMaybe(stream, state)); })(stream, state, sync, er, cb); else { var finished = needFinish(state); finished || state.corked || state.bufferProcessing || !state.bufferedRequest || clearBuffer(stream, state), sync ? asyncWrite(afterWrite, stream, state, finished, cb) : afterWrite(stream, state, finished, cb); } })(stream, er); }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new CorkedRequest(this); } function Writable(options) { if (Duplex = Duplex || __webpack_require__(85), !(realHasInstance.call(Writable, this) || this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this), this.writable = !0, options && ("function" == typeof options.write && (this._write = options.write), "function" == typeof options.writev && (this._writev = options.writev), "function" == typeof options.destroy && (this._destroy = options.destroy), "function" == typeof options.final && (this._final = options.final)), Stream.call(this); } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, writev ? stream._writev(chunk, state.onwrite) : stream._write(chunk, encoding, state.onwrite), state.sync = !1; } function afterWrite(stream, state, finished, cb) { finished || (function(stream, state) { 0 === state.length && state.needDrain && (state.needDrain = !1, stream.emit("drain")); })(stream, state), state.pendingcb--, cb(), finishMaybe(stream, state); } function clearBuffer(stream, state) { state.bufferProcessing = !0; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { var l = state.bufferedRequestCount, buffer = new Array(l), holder = state.corkedRequestsFree; holder.entry = entry; for (var count = 0, allBuffers = !0; entry; ) buffer[count] = entry, entry.isBuf || (allBuffers = !1), entry = entry.next, count += 1; buffer.allBuffers = allBuffers, doWrite(stream, state, !0, state.length, buffer, "", holder.finish), state.pendingcb++, state.lastBufferedRequest = null, holder.next ? (state.corkedRequestsFree = holder.next, holder.next = null) : state.corkedRequestsFree = new CorkedRequest(state), state.bufferedRequestCount = 0; } else { for (;entry; ) { var chunk = entry.chunk, encoding = entry.encoding, cb = entry.callback; if (doWrite(stream, state, !1, state.objectMode ? 1 : chunk.length, chunk, encoding, cb), entry = entry.next, state.bufferedRequestCount--, state.writing) break; } null === entry && (state.lastBufferedRequest = null); } state.bufferedRequest = entry, state.bufferProcessing = !1; } function needFinish(state) { return state.ending && 0 === state.length && null === state.bufferedRequest && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final((function(err) { state.pendingcb--, err && stream.emit("error", err), state.prefinished = !0, stream.emit("prefinish"), finishMaybe(stream, state); })); } function finishMaybe(stream, state) { var need = needFinish(state); return need && ((function(stream, state) { state.prefinished || state.finalCalled || ("function" == typeof stream._final ? (state.pendingcb++, state.finalCalled = !0, pna.nextTick(callFinal, stream, state)) : (state.prefinished = !0, stream.emit("prefinish"))); })(stream, state), 0 === state.pendingcb && (state.finished = !0, stream.emit("finish"))), need; } util.inherits(Writable, Stream), WritableState.prototype.getBuffer = function() { for (var current = this.bufferedRequest, out = []; current; ) out.push(current), current = current.next; return out; }, (function() { try { Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate((function() { return this.getBuffer(); }), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch (_) {} })(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (realHasInstance = Function.prototype[Symbol.hasInstance], Object.defineProperty(Writable, Symbol.hasInstance, { value: function(object) { return !!realHasInstance.call(this, object) || this === Writable && object && object._writableState instanceof WritableState; } })) : realHasInstance = function(object) { return object instanceof this; }, Writable.prototype.pipe = function() { this.emit("error", new Error("Cannot pipe, not readable")); }, Writable.prototype.write = function(chunk, encoding, cb) { var obj, state = this._writableState, ret = !1, isBuf = !state.objectMode && (obj = chunk, Buffer.isBuffer(obj) || obj instanceof OurUint8Array); return isBuf && !Buffer.isBuffer(chunk) && (chunk = (function(chunk) { return Buffer.from(chunk); })(chunk)), "function" == typeof encoding && (cb = encoding, encoding = null), isBuf ? encoding = "buffer" : encoding || (encoding = state.defaultEncoding), "function" != typeof cb && (cb = nop), state.ended ? (function(stream, cb) { var er = new Error("write after end"); stream.emit("error", er), pna.nextTick(cb, er); })(this, cb) : (isBuf || (function(stream, state, chunk, cb) { var valid = !0, er = !1; return null === chunk ? er = new TypeError("May not write null values to stream") : "string" == typeof chunk || void 0 === chunk || state.objectMode || (er = new TypeError("Invalid non-string/buffer chunk")), er && (stream.emit("error", er), pna.nextTick(cb, er), valid = !1), valid; })(this, state, chunk, cb)) && (state.pendingcb++, ret = (function(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = (function(state, chunk, encoding) { return state.objectMode || !1 === state.decodeStrings || "string" != typeof chunk || (chunk = Buffer.from(chunk, encoding)), chunk; })(state, chunk, encoding); chunk !== newChunk && (isBuf = !0, encoding = "buffer", chunk = newChunk); } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; if (ret || (state.needDrain = !0), state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }, last ? last.next = state.lastBufferedRequest : state.bufferedRequest = state.lastBufferedRequest, state.bufferedRequestCount += 1; } else doWrite(stream, state, !1, len, chunk, encoding, cb); return ret; })(this, state, isBuf, chunk, encoding, cb)), ret; }, Writable.prototype.cork = function() { this._writableState.corked++; }, Writable.prototype.uncork = function() { var state = this._writableState; state.corked && (state.corked--, state.writing || state.corked || state.finished || state.bufferProcessing || !state.bufferedRequest || clearBuffer(this, state)); }, Writable.prototype.setDefaultEncoding = function(encoding) { if ("string" == typeof encoding && (encoding = encoding.toLowerCase()), !([ "hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw" ].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding); return this._writableState.defaultEncoding = encoding, this; }, Object.defineProperty(Writable.prototype, "writableHighWaterMark", { enumerable: !1, get: function() { return this._writableState.highWaterMark; } }), Writable.prototype._write = function(chunk, encoding, cb) { cb(new Error("_write() is not implemented")); }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; "function" == typeof chunk ? (cb = chunk, chunk = null, encoding = null) : "function" == typeof encoding && (cb = encoding, encoding = null), null != chunk && this.write(chunk, encoding), state.corked && (state.corked = 1, this.uncork()), state.ending || state.finished || (function(stream, state, cb) { state.ending = !0, finishMaybe(stream, state), cb && (state.finished ? pna.nextTick(cb) : stream.once("finish", cb)), state.ended = !0, stream.writable = !1; })(this, state, cb); }, Object.defineProperty(Writable.prototype, "destroyed", { get: function() { return void 0 !== this._writableState && this._writableState.destroyed; }, set: function(value) { this._writableState && (this._writableState.destroyed = value); } }), Writable.prototype.destroy = destroyImpl.destroy, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) { this.end(), cb(err); }; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(26).Buffer, isEncoding = Buffer.isEncoding || function(encoding) { switch ((encoding = "" + encoding) && encoding.toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": case "raw": return !0; default: return !1; } }; function StringDecoder(encoding) { var nb; switch (this.encoding = (function(enc) { var nenc = (function(enc) { if (!enc) return "utf8"; for (var retried; ;) switch (enc) { 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 enc; default: if (retried) return; enc = ("" + enc).toLowerCase(), retried = !0; } })(enc); if ("string" != typeof nenc && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; })(encoding), this.encoding) { case "utf16le": this.text = utf16Text, this.end = utf16End, nb = 4; break; case "utf8": this.fillLast = utf8FillLast, nb = 4; break; case "base64": this.text = base64Text, this.end = base64End, nb = 3; break; default: return this.write = simpleWrite, void (this.end = simpleEnd); } this.lastNeed = 0, this.lastTotal = 0, this.lastChar = Buffer.allocUnsafe(nb); } function utf8CheckByte(byte) { return byte <= 127 ? 0 : byte >> 5 == 6 ? 2 : byte >> 4 == 14 ? 3 : byte >> 3 == 30 ? 4 : byte >> 6 == 2 ? -1 : -2; } function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed, r = (function(self, buf, p) { if (128 != (192 & buf[0])) return self.lastNeed = 0, "�"; if (self.lastNeed > 1 && buf.length > 1) { if (128 != (192 & buf[1])) return self.lastNeed = 1, "�"; if (self.lastNeed > 2 && buf.length > 2 && 128 != (192 & buf[2])) return self.lastNeed = 2, "�"; } })(this, buf); return void 0 !== r ? r : this.lastNeed <= buf.length ? (buf.copy(this.lastChar, p, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (buf.copy(this.lastChar, p, 0, buf.length), void (this.lastNeed -= buf.length)); } function utf16Text(buf, i) { if ((buf.length - i) % 2 == 0) { var r = buf.toString("utf16le", i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 55296 && c <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = buf[buf.length - 2], this.lastChar[1] = buf[buf.length - 1], r.slice(0, -1); } return r; } return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = buf[buf.length - 1], buf.toString("utf16le", i, buf.length - 1); } function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ""; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString("utf16le", 0, end); } return r; } function base64Text(buf, i) { var n = (buf.length - i) % 3; return 0 === n ? buf.toString("base64", i) : (this.lastNeed = 3 - n, this.lastTotal = 3, 1 === n ? this.lastChar[0] = buf[buf.length - 1] : (this.lastChar[0] = buf[buf.length - 2], this.lastChar[1] = buf[buf.length - 1]), buf.toString("base64", i, buf.length - n)); } function base64End(buf) { var r = buf && buf.length ? this.write(buf) : ""; return this.lastNeed ? r + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : r; } function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ""; } exports.StringDecoder = StringDecoder, StringDecoder.prototype.write = function(buf) { if (0 === buf.length) return ""; var r, i; if (this.lastNeed) { if (void 0 === (r = this.fillLast(buf))) return ""; i = this.lastNeed, this.lastNeed = 0; } else i = 0; return i < buf.length ? r ? r + this.text(buf, i) : this.text(buf, i) : r || ""; }, StringDecoder.prototype.end = function(buf) { var r = buf && buf.length ? this.write(buf) : ""; return this.lastNeed ? r + "�" : r; }, StringDecoder.prototype.text = function(buf, i) { var total = (function(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); return nb >= 0 ? (nb > 0 && (self.lastNeed = nb - 1), nb) : --j < i || -2 === nb ? 0 : (nb = utf8CheckByte(buf[j])) >= 0 ? (nb > 0 && (self.lastNeed = nb - 2), nb) : --j < i || -2 === nb ? 0 : (nb = utf8CheckByte(buf[j])) >= 0 ? (nb > 0 && (2 === nb ? nb = 0 : self.lastNeed = nb - 3), nb) : 0; })(this, buf, i); if (!this.lastNeed) return buf.toString("utf8", i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); return buf.copy(this.lastChar, 0, end), buf.toString("utf8", i, end); }, StringDecoder.prototype.fillLast = function(buf) { if (this.lastNeed <= buf.length) return buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length), this.lastNeed -= buf.length; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = Transform; var Duplex = __webpack_require__(85), util = Object.create(__webpack_require__(33)); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = !1; var cb = ts.writecb; if (!cb) return this.emit("error", new Error("write callback called multiple times")); ts.writechunk = null, ts.writecb = null, null != data && this.push(data), cb(er); var rs = this._readableState; rs.reading = !1, (rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark); } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options), this._transformState = { afterTransform: afterTransform.bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = !0, this._readableState.sync = !1, options && ("function" == typeof options.transform && (this._transform = options.transform), "function" == typeof options.flush && (this._flush = options.flush)), this.on("prefinish", prefinish); } function prefinish() { var _this = this; "function" == typeof this._flush ? this._flush((function(er, data) { done(_this, er, data); })) : done(this, null, null); } function done(stream, er, data) { if (er) return stream.emit("error", er); if (null != data && stream.push(data), stream._writableState.length) throw new Error("Calling transform done when ws.length != 0"); if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming"); return stream.push(null); } util.inherits = __webpack_require__(106), util.inherits(Transform, Duplex), Transform.prototype.push = function(chunk, encoding) { return this._transformState.needTransform = !1, Duplex.prototype.push.call(this, chunk, encoding); }, Transform.prototype._transform = function(chunk, encoding, cb) { throw new Error("_transform() is not implemented"); }, Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; if (ts.writecb = cb, ts.writechunk = chunk, ts.writeencoding = encoding, !ts.transforming) { var rs = this._readableState; (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark); } }, Transform.prototype._read = function(n) { var ts = this._transformState; null !== ts.writechunk && ts.writecb && !ts.transforming ? (ts.transforming = !0, this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform)) : ts.needTransform = !0; }, Transform.prototype._destroy = function(err, cb) { var _this2 = this; Duplex.prototype._destroy.call(this, err, (function(err2) { cb(err2), _this2.emit("close"); })); }; }, function(module, exports, __webpack_require__) { const {ffprobe: ffprobe} = __webpack_require__(433), JSONStream = __webpack_require__(864), probeCache = []; module.exports = function(options = {}) { const cached = probeCache.find((el => el.mediaURL === options.mediaURL)); if (cached) return process.env.HLS_DEBUG && console.log("HLSV2:probe:info used cached result"), Promise.resolve(cached.result); const timeout = "number" == typeof options.timeout ? options.timeout : 12e4; return new Promise((async (resolve, reject) => { let probeProcess, result = null; try { const FFprobeProc = new ffprobe(options); probeProcess = await FFprobeProc.create(); } catch (error) { return void reject(error); } const timeoutId = setTimeout((() => { probeProcess.destroy(); }), timeout); probeProcess.events.once("close", ((code, signal) => { clearTimeout(timeoutId), null === code ? reject(new Error(`Probe process has been terminated with signal: ${signal}`)) : code > 0 ? reject(new Error(`Probe process exited with code: ${code}`)) : null === result ? reject(new Error("Probe process failed")) : (probeCache.unshift({ mediaURL: options.mediaURL, result: result }), probeCache.length > 3 && probeCache.pop(), resolve(result)); })), probeProcess.stream.pipe(JSONStream.parse()).once("data", (({streams: streams = [], format: format = {}} = {}) => { const formatName = format.format_name, formatDuration = parseFloat(format.duration), formatBitRate = parseInt(format.bit_rate || 0, 10), formatMaxBitRate = parseInt(format.max_bit_rate || 0, 10); result = { format: { name: "string" == typeof formatName ? formatName : "unknown", duration: !isNaN(formatDuration) && isFinite(formatDuration) ? formatDuration : null }, streams: streams.map((stream => { const id = streams.filter((({codec_type: codec_type}) => codec_type === stream.codec_type)).findIndex((({index: index}) => index === stream.index)), index = parseInt(stream.index, 10), track = stream.codec_type, codec = stream.codec_name, streamBitRate = parseInt(stream.bit_rate || 0, 10), streamMaxBitRate = parseInt(stream.max_bit_rate || 0, 10), bps = parseInt((stream.tags || []).BPS || 0, 10), numberOfBytes = parseInt((stream.tags || []).NUMBER_OF_BYTES || 0, 10), startTime = parseFloat(stream.start_time), startTimeTs = parseInt(stream.start_pts, 10), timescale = "string" == typeof stream.time_base ? parseInt(stream.time_base.slice(stream.time_base.indexOf("/") + 1), 10) : NaN, width = parseInt(stream.width, 10), height = parseInt(stream.height, 10), frameRate = "string" == typeof stream.r_frame_rate ? parseInt(stream.r_frame_rate.slice(0, stream.r_frame_rate.indexOf("/")), 10) / parseInt(stream.r_frame_rate.slice(stream.r_frame_rate.indexOf("/") + 1), 10) : NaN, numberOfFrames = parseInt(stream.nb_frames, 10), hasBFrames = "number" == typeof stream.has_b_frames && stream.has_b_frames > 0, isHdr = "bt2020nc" === stream.color_space && "smpte2084" === stream.color_transfer && "bt2020" === stream.color_primaries, isDoVi = "dvhe" === stream.codec_tag_string, sampleRate = parseInt(stream.sample_rate, 10), channels = parseInt(stream.channels, 10), channelLayout = stream.channel_layout, title = stream.tags ? stream.tags.title : null, language = stream.tags ? stream.tags.language : null; return { id: id, index: !isNaN(index) && isFinite(index) ? index : -1, track: "string" == typeof track ? track : "unknown", codec: "string" == typeof codec ? codec : "unknown", streamBitRate: streamBitRate, streamMaxBitRate: streamMaxBitRate, startTime: !isNaN(startTime) && isFinite(startTime) ? startTime : null, startTimeTs: !isNaN(startTimeTs) && isFinite(startTimeTs) ? startTimeTs : null, timescale: !isNaN(timescale) && isFinite(timescale) ? timescale : 1, ..."video" === track ? { width: !isNaN(width) && isFinite(width) ? width : null, height: !isNaN(height) && isFinite(height) ? height : null, frameRate: !isNaN(frameRate) && isFinite(frameRate) ? frameRate : null, numberOfFrames: !isNaN(numberOfFrames) && isFinite(numberOfFrames) ? numberOfFrames : null, isHdr: isHdr, isDoVi: isDoVi, hasBFrames: hasBFrames, formatBitRate: formatBitRate, formatMaxBitRate: formatMaxBitRate, bps: bps, numberOfBytes: numberOfBytes, formatDuration: formatDuration } : {}, ..."audio" === track ? { sampleRate: !isNaN(sampleRate) && isFinite(sampleRate) ? sampleRate : null, channels: !isNaN(channels) && isFinite(channels) ? channels : null, channelLayout: "string" == typeof channelLayout ? channelLayout : "unknown", title: "string" == typeof title ? title : null, language: "string" == typeof language ? language : null } : {}, ..."subtitle" === track ? { title: "string" == typeof title ? title : null, language: "string" == typeof language ? language : null } : {} }; })) }; })); })); }; }, function(module, exports, __webpack_require__) { const ffmpeg = __webpack_require__(857), ffprobe = __webpack_require__(863); module.exports = { ffmpeg: ffmpeg, ffprobe: ffprobe }; }, function(module, exports, __webpack_require__) { "use strict"; var childProcess = __webpack_require__(32), spawn = childProcess.spawn, exec = childProcess.exec; function killAll(tree, signal, callback) { var killed = {}; try { Object.keys(tree).forEach((function(pid) { tree[pid].forEach((function(pidpid) { killed[pidpid] || (killPid(pidpid, signal), killed[pidpid] = 1); })), killed[pid] || (killPid(pid, signal), killed[pid] = 1); })); } catch (err) { if (callback) return callback(err); throw err; } if (callback) return callback(); } function killPid(pid, signal) { try { process.kill(parseInt(pid, 10), signal); } catch (err) { if ("ESRCH" !== err.code) throw err; } } function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) { var ps = spawnChildProcessesList(parentPid), allData = ""; ps.stdout.on("data", (function(data) { data = data.toString("ascii"), allData += data; })), ps.on("close", (function(code) { delete pidsToProcess[parentPid], 0 == code ? allData.match(/\d+/g).forEach((function(pid) { pid = parseInt(pid, 10), tree[parentPid].push(pid), tree[pid] = [], pidsToProcess[pid] = 1, buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb); })) : 0 == Object.keys(pidsToProcess).length && cb(); })); } module.exports = function(pid, signal, callback) { if ("function" == typeof signal && void 0 === callback && (callback = signal, signal = void 0), pid = parseInt(pid), Number.isNaN(pid)) { if (callback) return callback(new Error("pid must be a number")); throw new Error("pid must be a number"); } var tree = {}, pidsToProcess = {}; switch (tree[pid] = [], pidsToProcess[pid] = 1, process.platform) { case "win32": exec("taskkill /pid " + pid + " /T /F", callback); break; case "darwin": buildProcessTree(pid, tree, pidsToProcess, (function(parentPid) { return spawn("pgrep", [ "-P", parentPid ]); }), (function() { killAll(tree, signal, callback); })); break; default: buildProcessTree(pid, tree, pidsToProcess, (function(parentPid) { return spawn("ps", [ "-o", "pid", "--no-headers", "--ppid", parentPid ]); }), (function() { killAll(tree, signal, callback); })); } }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(env) { function selectColor(namespace) { for (var hash = 0, i = 0; i < namespace.length; i++) hash = (hash << 5) - hash + namespace.charCodeAt(i), hash |= 0; return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } function createDebug(namespace) { var prevTime; function debug() { if (debug.enabled) { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; var self = debug, curr = Number(new Date), ms = curr - (prevTime || curr); self.diff = ms, self.prev = prevTime, self.curr = curr, prevTime = curr, args[0] = createDebug.coerce(args[0]), "string" != typeof args[0] && args.unshift("%O"); var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (function(match, format) { if ("%%" === match) return match; index++; var formatter = createDebug.formatters[format]; if ("function" == typeof formatter) { var val = args[index]; match = formatter.call(self, val), args.splice(index, 1), index--; } return match; })), createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } } return debug.namespace = namespace, debug.enabled = createDebug.enabled(namespace), debug.useColors = createDebug.useColors(), debug.color = selectColor(namespace), debug.destroy = destroy, debug.extend = extend, "function" == typeof createDebug.init && createDebug.init(debug), createDebug.instances.push(debug), debug; } function destroy() { var index = createDebug.instances.indexOf(this); return -1 !== index && (createDebug.instances.splice(index, 1), !0); } function extend(namespace, delimiter) { return createDebug(this.namespace + (void 0 === delimiter ? ":" : delimiter) + namespace); } return createDebug.debug = createDebug, createDebug.default = createDebug, createDebug.coerce = function(val) { return val instanceof Error ? val.stack || val.message : val; }, createDebug.disable = function() { createDebug.enable(""); }, createDebug.enable = function(namespaces) { var i; createDebug.save(namespaces), createDebug.names = [], createDebug.skips = []; var split = ("string" == typeof namespaces ? namespaces : "").split(/[\s,]+/), len = split.length; for (i = 0; i < len; i++) split[i] && ("-" === (namespaces = split[i].replace(/\*/g, ".*?"))[0] ? createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$")) : createDebug.names.push(new RegExp("^" + namespaces + "$"))); for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } }, createDebug.enabled = function(name) { if ("*" === name[name.length - 1]) return !0; var i, len; for (i = 0, len = createDebug.skips.length; i < len; i++) if (createDebug.skips[i].test(name)) return !1; for (i = 0, len = createDebug.names.length; i < len; i++) if (createDebug.names[i].test(name)) return !0; return !1; }, createDebug.humanize = __webpack_require__(312), Object.keys(env).forEach((function(key) { createDebug[key] = env[key]; })), createDebug.instances = [], createDebug.names = [], createDebug.skips = [], createDebug.formatters = {}, createDebug.selectColor = selectColor, createDebug.enable(createDebug.load()), createDebug; }; }, function(module, exports) { module.exports = process.env.HLSV2_REMOTE ? "remote" : "local"; }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.tryAcquire = exports.withTimeout = exports.Semaphore = exports.Mutex = void 0; var tslib_1 = __webpack_require__(143), Mutex_1 = __webpack_require__(868); Object.defineProperty(exports, "Mutex", { enumerable: !0, get: function() { return Mutex_1.default; } }); var Semaphore_1 = __webpack_require__(438); Object.defineProperty(exports, "Semaphore", { enumerable: !0, get: function() { return Semaphore_1.default; } }); var withTimeout_1 = __webpack_require__(439); Object.defineProperty(exports, "withTimeout", { enumerable: !0, get: function() { return withTimeout_1.withTimeout; } }); var tryAcquire_1 = __webpack_require__(869); Object.defineProperty(exports, "tryAcquire", { enumerable: !0, get: function() { return tryAcquire_1.tryAcquire; } }), (0, tslib_1.__exportStar)(__webpack_require__(144), exports); }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); var tslib_1 = __webpack_require__(143), errors_1 = __webpack_require__(144), Semaphore = (function() { function Semaphore(_maxConcurrency, _cancelError) { if (void 0 === _cancelError && (_cancelError = errors_1.E_CANCELED), this._maxConcurrency = _maxConcurrency, this._cancelError = _cancelError, this._queue = [], this._waiters = [], _maxConcurrency <= 0) throw new Error("semaphore must be initialized to a positive value"); this._value = _maxConcurrency; } return Semaphore.prototype.acquire = function() { var _this = this, locked = this.isLocked(), ticketPromise = new Promise((function(resolve, reject) { return _this._queue.push({ resolve: resolve, reject: reject }); })); return locked || this._dispatch(), ticketPromise; }, Semaphore.prototype.runExclusive = function(callback) { return (0, tslib_1.__awaiter)(this, void 0, void 0, (function() { var _a, value, release; return (0, tslib_1.__generator)(this, (function(_b) { switch (_b.label) { case 0: return [ 4, this.acquire() ]; case 1: _a = _b.sent(), value = _a[0], release = _a[1], _b.label = 2; case 2: return _b.trys.push([ 2, , 4, 5 ]), [ 4, callback(value) ]; case 3: return [ 2, _b.sent() ]; case 4: return release(), [ 7 ]; case 5: return [ 2 ]; } })); })); }, Semaphore.prototype.waitForUnlock = function() { return (0, tslib_1.__awaiter)(this, void 0, void 0, (function() { var _this = this; return (0, tslib_1.__generator)(this, (function(_a) { return this.isLocked() ? [ 2, new Promise((function(resolve) { return _this._waiters.push({ resolve: resolve }); })) ] : [ 2, Promise.resolve() ]; })); })); }, Semaphore.prototype.isLocked = function() { return this._value <= 0; }, Semaphore.prototype.release = function() { if (this._maxConcurrency > 1) throw new Error("this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead"); if (this._currentReleaser) { var releaser = this._currentReleaser; this._currentReleaser = void 0, releaser(); } }, Semaphore.prototype.cancel = function() { var _this = this; this._queue.forEach((function(ticket) { return ticket.reject(_this._cancelError); })), this._queue = []; }, Semaphore.prototype._dispatch = function() { var _this = this, nextTicket = this._queue.shift(); if (nextTicket) { var released = !1; this._currentReleaser = function() { released || (released = !0, _this._value++, _this._resolveWaiters(), _this._dispatch()); }, nextTicket.resolve([ this._value--, this._currentReleaser ]); } }, Semaphore.prototype._resolveWaiters = function() { this._waiters.forEach((function(waiter) { return waiter.resolve(); })), this._waiters = []; }, Semaphore; })(); exports.default = Semaphore; }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.withTimeout = void 0; var tslib_1 = __webpack_require__(143), errors_1 = __webpack_require__(144); exports.withTimeout = function(sync, timeout, timeoutError) { var _this = this; return void 0 === timeoutError && (timeoutError = errors_1.E_TIMEOUT), { acquire: function() { return new Promise((function(resolve, reject) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, (function() { var isTimeout, handle, ticket, e_1; return (0, tslib_1.__generator)(this, (function(_a) { switch (_a.label) { case 0: isTimeout = !1, handle = setTimeout((function() { isTimeout = !0, reject(timeoutError); }), timeout), _a.label = 1; case 1: return _a.trys.push([ 1, 3, , 4 ]), [ 4, sync.acquire() ]; case 2: return ticket = _a.sent(), isTimeout ? (Array.isArray(ticket) ? ticket[1] : ticket)() : (clearTimeout(handle), resolve(ticket)), [ 3, 4 ]; case 3: return e_1 = _a.sent(), isTimeout || (clearTimeout(handle), reject(e_1)), [ 3, 4 ]; case 4: return [ 2 ]; } })); })); })); }, runExclusive: function(callback) { return (0, tslib_1.__awaiter)(this, void 0, void 0, (function() { var release, ticket; return (0, tslib_1.__generator)(this, (function(_a) { switch (_a.label) { case 0: release = function() {}, _a.label = 1; case 1: return _a.trys.push([ 1, , 7, 8 ]), [ 4, this.acquire() ]; case 2: return ticket = _a.sent(), Array.isArray(ticket) ? (release = ticket[1], [ 4, callback(ticket[0]) ]) : [ 3, 4 ]; case 3: return [ 2, _a.sent() ]; case 4: return release = ticket, [ 4, callback() ]; case 5: return [ 2, _a.sent() ]; case 6: return [ 3, 8 ]; case 7: return release(), [ 7 ]; case 8: return [ 2 ]; } })); })); }, release: function() { sync.release(); }, cancel: function() { return sync.cancel(); }, waitForUnlock: function() { return sync.waitForUnlock(); }, isLocked: function() { return sync.isLocked(); } }; }; }, function(module, exports, __webpack_require__) { const retrieveMatroskaSamples = __webpack_require__(870), retrieveMP4Samples = __webpack_require__(879); module.exports = { matroska: retrieveMatroskaSamples, mp4: retrieveMP4Samples }; }, function(module, exports, __webpack_require__) { "use strict"; var async = __webpack_require__(40), fs = __webpack_require__(2), util = __webpack_require__(0), debug = (__webpack_require__(82).crc32, __webpack_require__(46)("matroska:document")), schema = __webpack_require__(13), Element = __webpack_require__(442), tools = __webpack_require__(86); __webpack_require__(202), __webpack_require__(203), __webpack_require__(204), __webpack_require__(205), __webpack_require__(206), __webpack_require__(207), __webpack_require__(208), __webpack_require__(209), __webpack_require__(47), __webpack_require__(210), __webpack_require__(30), __webpack_require__(211), __webpack_require__(212), __webpack_require__(145), __webpack_require__(146), __webpack_require__(147), __webpack_require__(213), __webpack_require__(214), __webpack_require__(215), __webpack_require__(216), __webpack_require__(217), __webpack_require__(218), __webpack_require__(219), __webpack_require__(220); var tagClasses = {}; function Document() { this.type = "D", this._name = "Document", this.tagId = 0, this._nextTagId = 1, this.ownerDocument = this, this.masterType = !0; } function removeList(list, tag) { if (!list || !list.length) return !1; var idx = list.indexOf(tag); return !(idx < 0 || (list.splice(idx, 1), 0)); } tagClasses[schema.byName.Segment] = "segment3", tagClasses[schema.byName.Attachments] = "attachments", tagClasses[schema.byName.AttachedFile] = "attachedFile", tagClasses[schema.byName.Tags] = "tags", tagClasses[schema.byName.Tag] = "tag", tagClasses[schema.byName.Targets] = "targets", tagClasses[schema.byName.SimpleTag] = "simpleTag", tagClasses[schema.byName.SeekHead] = "seekHead", tagClasses[schema.byName.Seek] = "seek", tagClasses[schema.byName.Info] = "info", tagClasses[schema.byName.Tracks] = "tracks", tagClasses[schema.byName.TrackEntry] = "trackEntry", tagClasses[schema.byName.Video] = "video", tagClasses[schema.byName.Audio] = "audio", tagClasses[schema.byName.CRC_32] = "crc-32", tagClasses[schema.byName.Cues] = "cues", tagClasses[schema.byName.CuePoint] = "cuePoint", tagClasses[schema.byName.CueReference] = "cueReference", tagClasses[schema.byName.CueTrackPositions] = "cueTrackPositions", util.inherits(Document, Element), module.exports = Document, Document.prototype.createElement = function(ebmlID, start, length) { var element, tagClass = tagClasses[ebmlID]; return tagClass ? ("string" == typeof tagClass && (tagClass = __webpack_require__(876)("./" + tagClass), tagClasses[ebmlID] = tagClass), element = new tagClass(this, this._nextTagId++, start, length)) : element = new Element(this, this._nextTagId++, ebmlID, start, length), element; }, Document.prototype._registerPosition = function(tag) { this._positions || (this._positions = []), this._positions.push(tag), this._modified && tag._markModified(); }, Document.prototype._unregisterPosition = function(tag) { return removeList(this._positions, tag); }, Document.prototype._registerCRC = function(tag) { this._crcs || (this._crcs = []), this._crcs.push(tag); }, Document.prototype._unregisterCRC = function(tag) { return removeList(this._crcs, tag); }, Document.prototype._markModified = function() { if (!this._modified) { if (this._partial) throw new Error("Can not modify a partial parsed document"); this._modified = !0, this._positions && this._positions.forEach((function(child) { child._markModified(); })); } }, Document.prototype._buildLinks = function() { if (!this._linksBuilt && (this._linksBuilt = !0, this._positions)) { var self = this; this._positions.forEach((function(child) { var offset = child.getValue(), parent1 = child.getLevel1(), targetType = child._positionTargetType; switch (targetType) { case "segment": break; case "clusterRelative": var cp = child.parent.cueClusterPosition; if (!cp) throw new Error("Invalid cluster relative without a cueClusterPosition"); offset += cp._positionTarget ? cp._positionTarget.getContentPosition() : cp; break; default: throw new Error("Not supported ! (" + targetType + ")"); } var target = parent1.getTagByPosition(offset, !0); debug.enabled && debug("Position #" + parent1.tagId + " " + offset + "=> " + (target ? "#" + target.tagID : "null")), target && "start" === target.position ? child._positionTarget = target.target : self._partial || debug("Can not find target for offset=" + offset + " doc=" + self); })); } }, Document.prototype.write = function(stream, options, callback) { "function" == typeof options && 2 === arguments.length && (callback = options, options = null), options = options || {}; var self = this; if (this._partial) return callback(new Error("The document is not complete")); this._prepareDocument(options, (function(error) { if (error) return callback(error); self._computePositions((function(error) { if (error) return callback(error); var source = self.source; self._updateCRC32((function(error) { if (error) return callback(error); var closeStream = !1; "string" == typeof stream && (stream = fs.createWriteStream(stream), closeStream = !0); var writeSession = { stream: stream, options: options }; self._write(writeSession, source, (function(error) { if (error) return callback(error); source.end(writeSession, (function(error) { return error ? callback(error) : closeStream ? void stream.end(callback) : callback(); })); })); })); })); })); }, Document.prototype._prepareDocument = function(options, callback) { return callback(); }, Document.prototype._write = function(output, source, callback) { async.eachSeries(this.children, (function(child, callback) { child._write(output, source, callback); }), callback); }, Document.prototype._computePositions = function(estimatedFileSize, callback) { if (!this._positions || !this._positions.length) return callback(); "function" == typeof estimatedFileSize && (callback = estimatedFileSize, estimatedFileSize = null), estimatedFileSize || (estimatedFileSize = 0, this.children.forEach((function(child) { var s = child._getSize(); estimatedFileSize += s; }))); var bits = 8 * tools.sizeUInt(estimatedFileSize), max = Math.pow(2, bits) - 1, error = !1; if (this._positions.forEach((function(child) { child.setUInt(max); var target = child._positionTarget; target && child.getLevel1() === target.getLevel1() || (error = !0); })), error) return callback(error); for (var tx = 1, times = 5, changes = 1; changes && times; times--, tx++) changes = 0, this._positions.forEach((function(child) { var target = child._positionTarget, level1 = target.getLevel1(), newPosition = target.getPosition() - level1.getContentPosition(); newPosition !== child.getUInt() && (child.setUInt(newPosition), changes++); })); return callback(); }, Document.prototype._updateCRC32 = function(callback) { var crcs = this._crcs; if (!crcs || !crcs.length) return callback(); function depth(t) { for (var ret = 0; t; t = t.parent) ret++; return ret; } crcs.sort((function(t1, t2) { return depth(t2) - depth(t1); })), async.eachSeries(crcs, (function(crcTag, callback) { crcTag.parent._computeChildrenCRC(!0, null, (function(error, crc) { return error ? callback(error) : crcTag.data && crc == crcTag.getCRCValue() ? callback() : (crcTag.setCRCValue(crc), void callback()); })); }), callback); }, Document.prototype.getTagById = function(tagId) { if (isNaN(tagId)) throw new Error("Tag identifier is not supported (" + tagId + ")"); return this.deepWalk((function(child) { if (child.tagId === tagId) return child; })); }, Document.prototype.toString = function() { return "[Document source=" + this.source + "]"; }; }, function(module, exports, __webpack_require__) { "use strict"; var assert = __webpack_require__(25), async = __webpack_require__(40), crc32 = __webpack_require__(82).crc32, stream = __webpack_require__(3), util = __webpack_require__(0), fs = __webpack_require__(2), debug = __webpack_require__(46)("matroska:element"), schema = __webpack_require__(13), tools = __webpack_require__(86), MillenniumTime = Date.UTC(2001, 0, 1); function Element(doc, tagId, ebmlID, start, length) { if (!doc || "D" !== doc.type) throw new Error("Invalid document"); this.ownerDocument = doc, this.tagId = tagId; var schemaInfo = schema.byEbmlID[ebmlID]; schemaInfo || (schemaInfo = { type: "unknown", name: "EBMLID(0x" + ebmlID.toString(16) + ")" }), this.ebmlID = ebmlID, this.schemaInfo = schemaInfo, this.type = schemaInfo.type, this._name = schemaInfo.name, isNaN(start) || (this.start = start, this.length = length || 0, this.end = this.start + this.length), "m" === this.type && (this.masterType = !0); } function addCRC(crc, value) { var old = crc.value; crc.value = void 0 === old ? crc32(value) : crc32(value, crc.value); } module.exports = Element, Element.prototype._setDataSize = function(dataSize, lengthTagSize) { this.dataSize = dataSize, this.lengthTagSize = lengthTagSize, this.length += dataSize + lengthTagSize, this.end = this.start + this.length; }, Element.prototype._setData = function(data) { this.data = data; }, Element.prototype.getFirstChildByName = function(name) { return this.eachChildByName(name, (function(child) { return child; })); }, Element.prototype.listChildrenByName = function(name) { var ls = []; return this.eachChildByName(name, (function(child) { ls.push(child); })), ls; }, Element.prototype.eachChildByName = function(name, func) { var ebmlID = tools.convertEbmlID(name); if (func || (func = function(child) { return child; }), this.children) for (var children = this.children.slice(0); children.length; ) { var child = children.shift(); if (child.ebmlID !== ebmlID) { if (child.children) { var sp = [ 0, 0 ].concat(child.children); children.splice.apply(children, sp); } } else { var ret = func(child); if (void 0 !== ret) return ret; } } }, Element.prototype.getDirectChildByName = function(name) { var ebmlID = tools.convertEbmlID(name), children = this.children; if (children && children.length) { for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.ebmlID === ebmlID) return child; } return null; } }, Element.prototype.loadData = function(callback) { return callback("Not filled yet"); }, Element.prototype.getString = function() { return this.getBuffer().toString("ascii"); }, Element.prototype.getUTF8 = function() { return this.getBuffer().toString("utf8"); }, Element.prototype.getValue = function() { switch (this.type) { case "s": return this.getString(); case "8": return this.getUTF8(); case "i": return this.getInt(); case "u": var u = this.getUInt(); return 0 !== u && 1 !== u || !this.schemaInfo || "0-1" !== this.schemaInfo.range || (u = u > 0), u; case "b": return this.data; case "f": return this.getFloat(); case "d": return this.getDate(); } throw new Error("Type not supported !"); }, Element.prototype.getBuffer = function() { if (!this.data) throw new Error("Data is not loaded ! (tagId=#" + this.tagId + ")"); return this.data; }, Element.prototype.getInt = function() { var data = this.getBuffer(), f = data.readIntBE(0, Math.min(data.length, 6)); if (data.length <= 6) return f; for (var i = 6; i < data.length; i++) f = 256 * f + data[i]; return f; }, Element.prototype.getUInt = function() { var data = this.getBuffer(), f = data.readUIntBE(0, Math.min(data.length, 6)); if (data.length <= 6) return f; for (var i = 6; i < data.length; i++) f = 256 * f + data[i]; return f; }, Element.prototype.getDataSize = function() { return this.data ? this.data.length : this.dataSize || 0; }, Element.prototype.getCRCValue = function() { var data = this.getBuffer(); if (!data || 4 != data.length || "b" !== this.type) throw new Error("Invalid data"); return tools.readCRC(data); }, Element.prototype.setFileDataSource = function(path, callback) { var self = this; fs.stat(path, (function(error, stats) { return self.data = void 0, self.type = "b", self.dataSize = stats.size, self._dataSource = { getStream: function(options, callback) { return "function" == typeof options && (callback = options, options = null), callback(null, fs.createReadStream(path, options)); }, info: path }, self._markModified(), callback(null, self); })); }, Element.prototype.setCRCValue = function(crc) { var data = tools.writeCRC(crc); this.data = data, this.type = "b", this._markModified(); }, Element.prototype.getFloat = function() { var data = this.getBuffer(); switch (data.length) { case 4: return data.readFloatBE(0); case 8: return data.readDoubleBE(0); } throw new Error("Illegal float size " + data.length + "."); }, Element.prototype.getDateNanos = function() { return this.getUInt(); }, Element.prototype.getDate = function() { var f = this.getBuffer().readUIntBE(0, 6); return new Date(MillenniumTime + 256 * f * 256 / 1e3 / 1e3); }, Element.prototype.print = function(level) { level = level || 0; var s = " " + (this.start || 0); s = s.substring(s.length - 10); var si = this.tagId + " "; if (s += "#" + si.substring(0, 5) + " ", level) for (var i = 0; i < level; i++) s += " "; s += "* " + this._name; var dataLength = this.data && this.data.length || this.dataSize || ""; try { if (this.masterType) "D" === this.type && (s += " " + this.source), void 0 === this.start || (s += " children[size=" + (this.end - this.start) + "]"); else if ("u" === this.type) s += " u[" + dataLength + "]=" + this.getUInt(); else if ("i" === this.type) s += " i[" + dataLength + "]=" + this.getInt(); else if ("s" === this.type) s += " s[" + dataLength + "]='" + this.getString() + "'"; else if ("8" === this.type) s += " 8[" + dataLength + "]='" + (dataLength && this.getUTF8()) + "'"; else if ("f" === this.type) s += " f[" + dataLength + "]=" + this.getFloat(); else if ("d" === this.type) s += " d[" + dataLength + "]=" + this.getDate(); else if ("b" === this.type) if (this.dataSize || this.data) if (s += " b[" + dataLength + "]", this.data) { if (s += "=" + this.data.slice(0, Math.min(32, this.data.length)).toString("hex"), this.ebmlID === schema.byName.SeekID) { var targetEbmlID = this.getUInt(), tid = schema.byEbmlID[targetEbmlID]; s += tid ? " => " + tid.name : " => ? "; } } else this._dataSource && (s += " {dataSource=" + this._dataSource.info + "}"); else s += " b[]"; this._positionTarget && (s += " [=>#" + this._positionTarget.tagId + "]"), this._modified && (s += " [MODIFIED]"); } catch (x) { s += " error=" + x, debug.enabled && debug("Error for node #" + this.id, x); } return s += "\n", this.children && this.children.forEach((function(child) { s += child.print(level + 1); })), s; }, Element.prototype.setString = function(newValue) { this.data = new Buffer(newValue, "ascii"), this.type = "s", this._markModified(); }, Element.prototype.setUTF8 = function(newValue) { this.data = new Buffer(newValue, "utf8"), this.type = "8", this._markModified(); }, Element.prototype.setInt = function(newValue) { var b = tools.writeInt(newValue); this.data = b, this.type = "i", this._markModified(); }, Element.prototype.setUInt = function(newValue) { var b = tools.writeUInt(newValue); this.data = b, this.type = "u", this._markModified(); }, Element.prototype.setFloat = function(newValue) { var b = new Buffer(4); b.writeFloatBE(newValue, 0), b.readFloatBE(0) !== newValue && (b = new Buffer(8)).writeDoubleBE(newValue, 0), this.type = "f", this.data = b, this._markModified(); }, Element.prototype.setDateNanos = function(newValue) { return this.setDate(newValue); }, Element.prototype.setDate = function(newValue) { var b = new Buffer(8); if (newValue.getTime) { var ms = newValue.getTime(); newValue = 3.90625 * (ms - MillenniumTime) * 3.90625; } else isNaN(newValue) || (newValue /= 65536); if ("number" != typeof newValue) throw new Error("Invalid date value '" + newValue + "'"); b.writeUIntBE(newValue, 0, 6), this.type = "d", this.data = b, this._markModified(); }, Element.prototype.setData = function(newValue) { this.data = new Buffer(newValue), this.type = "b", this._markModified(); }, Element.prototype._markModified = function() { if (!this._modified) { this._modified = { start: this.start, end: this.end }, this.start = void 0, this.end = void 0, this.length = void 0, this.lengthTagSize = void 0; var parent = this.parent; parent && parent._markModified(); } }, Element.prototype.setValue = function(newValue) { if ("string" == typeof newValue) return "s" === this.type ? void this.setString(newValue) : void this.setUTF8(newValue); if ("boolean" == typeof newValue && (newValue = newValue ? 1 : 0), "number" == typeof newValue) return Math.floor(newValue) !== newValue ? void this.setFloat(newValue) : newValue >= 0 ? void this.setUInt(newValue) : void this.setInt(newValue); if (newValue && newValue.getTime) this.setDate(newValue); else { if (!Buffer.isBuffer(newValue) && !util.isArray(newValue)) throw new Error("Unsupported type of value (" + newValue + ")"); this.setData(newValue); } }, Element.prototype.setTargetPosition = function(target) { this._positionTarget = target; }, Element.prototype.setTargetEbmlID = function(ebmlID) { ebmlID.ebmlID && (ebmlID = ebmlID.ebmlID); var data = tools.writeEbmlID(ebmlID); this.setData(data); }, Element.prototype._getSize = function() { if (!this._modified && void 0 !== this.start) return assert("number" == typeof this.end, "End of #" + this.tagId + " is not a number"), assert("number" == typeof this.start, "Start of #" + this.tagId + " is not a number"), this.end - this.start; if (!this.masterType) { var dataLength = this.getDataSize(); return assert("number" == typeof dataLength, "Data size of #" + this.tagId + " is not a number"), tools.sizeHInt(this.ebmlID) + tools.sizeVInt(dataLength) + dataLength; } var totalSize = 0; return this.children && this.children.forEach((function(child) { var s = child._getSize(); assert("number" == typeof s, "Size of #" + child.tagId + " is not a number"), totalSize += s; })), tools.sizeHInt(this.ebmlID) + tools.sizeVInt(totalSize) + totalSize; }, Element.prototype._optimizeData = function() { if (!this.data) return 0; if ("u" === this.type) { var u = this.getUInt(); return tools.sizeUInt(u) !== this.data.length ? (this.setUInt(u), 1) : 0; } if ("i" === this.type) { var i = this.getInt(); return tools.sizeInt(i) !== this.data.length ? (this.setInt(i), 1) : 0; } if ("f" === this.type) { var f = this.getFloat(); return tools.sizeFloat(f) !== this.data.length ? (this.setFloat(f), 1) : 0; } return 0; }, Element.prototype._write = function(output, source, callback) { if (this._modified || this._dataSource) { var ebmlID = this.schemaInfo._ebmlID; if (ebmlID || (ebmlID = tools.writeUInt(this.ebmlID), this.schemaInfo._ebmlID = ebmlID), source.writeHInt(output, this.ebmlID), !this.masterType) return !this.data && this._dataSource ? void source.writeTagDataSource(output, this.dataSize, this._dataSource, callback) : void source.writeTagData(output, this.data, callback); var children = this.children; if (!children) return source.writeVInt(output, 0), callback(); var totalSize = 0; children.forEach((function(child) { totalSize += child._getSize(); })), source.writeVInt(output, totalSize), async.eachSeries(children, (function(child, callback) { child._write(output, source, callback); }), callback); } else source.writeCompleteTag(output, this, callback); }, Element.prototype._childrenPosition = function(position) { var start = this.start, end = this.end, modified = this._modified; if (modified && (start = modified.start, end = modified.end), position < start || position >= end) return null; if (position === start) return { position: "start", target: this }; var children = this.children; if (children) for (var i = 0; i < children.length; i++) { var ret = children[i]._childrenPosition(position); if (ret) return ret; } return { position: "middle", target: this }; }, Element.prototype.getTagByPosition = function(position, contentOffset) { return position += contentOffset ? this.getContentPosition() : this.getPosition(), this._childrenPosition(position); }, Element.prototype.remove = function() { if (!this.parent) throw new Error("No parent !"); return this.parent.removeChild(this); }, Element.prototype.removeChild = function(child) { if (!this.children) return !1; var idx = this.children.indexOf(child); if (idx < 0) return !1; this.children.splice(idx, 1), child.parent._markModified(), child.parent = null; var doc = this.ownerDocument; return child.deepWalk((function(c) { var schemaInfo = c.schemaInfo; schemaInfo && (c._positionTargetType && (c._positionTargetType = void 0, doc._unregisterPosition(c)), schemaInfo.crc && doc._unregisterCRC(c)); })), !0; }, Element.prototype.appendChild = function(child, noUpdate) { if (!this.masterType) throw new Error("Element " + this._name + "/" + this.ebmlID + "/" + this.type + " is not a master type"); return this.insertBefore(child, null, noUpdate); }, Element.prototype.insertBefore = function(child, beforeChild, noUpdate) { child.parent && child.remove(), this.children || (this.children = []); var doc = this.ownerDocument; if (child.deepWalk((function(c) { var schemaInfo = c.schemaInfo; schemaInfo && (schemaInfo.position && (c._positionTargetType = schemaInfo.position, doc._registerPosition(c)), schemaInfo.crc && doc._registerCRC(c)); })), beforeChild) { var idx = this.children.indexOf(beforeChild); if (idx >= 0) return this.children.splice(idx, 0, child), child.parent = this, void (!1 !== noUpdate && this._markModified()); } this.children.push(child), child.parent = this, !1 !== noUpdate && this._markModified(); }, Element.prototype.getLevel1 = function() { for (var p = this; p; p = p.parent) if ("D" === p.parent.type) return p; }, Element.prototype.getPosition = function() { var parent = this.parent; if (!parent) return 0; var pos = parent.getContentPosition(), children = parent.children; if (children) for (var i = 0; i < children.length; i++) { var child = children[i]; if (child === this) break; pos += child._getSize(); } return pos; }, Element.prototype.getContentPosition = function() { if (!this.parent) return 0; var pos = this.getPosition() + tools.sizeHInt(this.ebmlID); if (!this.masterType) { var dataLength = this.getDataSize(); return pos + tools.sizeVInt(dataLength); } if (this.lengthTagSize) return pos + this.lengthTagSize; var totalSize = 0; return this.children && this.children.forEach((function(child) { totalSize += child._getSize(); })), pos + tools.sizeVInt(totalSize); }, Element.prototype.eachChild = function(callback) { var children = this.children; children && children.length && children.forEach(callback); }, Element.prototype.getDataStream = function(callback) { if (this.data) { var bufferStream = new stream.PassThrough; return bufferStream.end(this.data), void callback(null, bufferStream); } this._dataSource ? this._dataSource.getStream(callback) : this.ownerDocument.source.getTagDataStream(this, callback); }, Element.prototype.computeCRC = function(crc, callback) { if (addCRC(crc = crc || {}, tools.writeUInt(this.ebmlID)), this.masterType) { var c2 = this.children, csize = 0; return c2 && c2.forEach((function(c3) { csize += c3._getSize(); })), addCRC(crc, tools.writeVInt(csize)), c2 ? void setImmediate(this._computeChildrenCRC.bind(this, !1, crc, callback)) : callback(null, crc.value); } if (this.data) return addCRC(crc, tools.writeVInt(this.data.length)), addCRC(crc, this.data), callback(null, crc.value); addCRC(crc, tools.writeVInt(this.dataSize)), this.getDataStream((function(error, stream) { if (error) return callback(error); !(function(stream, crc, callback) { stream.on("readable", (function() { var buffer = stream.read(); if (!buffer) return callback(null); addCRC(crc, buffer); })); })(stream, crc, (function(error) { if (error) return callback(error); callback(null, crc.value); })); })); }, Element.prototype.moveChildBefore = function(child, beforeChild) { var children = this.children; if (!children) throw new Error("This tag has no children " + this); var idx = children.indexOf(child); if (idx < 0) throw new Error("Can not find the child '" + child + "' parent=" + this); var bidx = 0; if (beforeChild) { if ((bidx = children.indexOf(beforeChild)) < 0) throw new Error("Can not find the before child '" + beforeChild + "' parent=" + this); } else { if (idx === children.length - 1) return; bidx = children.length; } return children.splice(idx, 1), children.splice(bidx - (idx < bidx ? 1 : 0), 0, child), this._markModified(), !0; }, Element.prototype._computeChildrenCRC = function(ignoreCRCTag, crc, callback) { crc = crc || {}; var children = this.children; if (!children || !children.length) return callback(null, crc.value); async.eachSeries(children, (function(child, callback) { if (ignoreCRCTag && child.ebmlID === schema.byName.CRC_32) return callback(null); child.computeCRC(crc, callback); }), (function(error) { return error ? callback(error) : callback(null, crc.value); })); }, Element.prototype.deepWalk = function(func) { if (void 0 !== (ret = func(this))) return ret; var children = this.children; if (children) for (children = children.slice(0); children.length; ) { var ret, child = children.shift(); if (void 0 !== (ret = func(child))) return ret; if (child.children) { var sp = [ 0, 0 ].concat(child.children); children.splice.apply(children, sp); } } }, Element.prototype.toString = function() { return "[Element #" + this.tagId + "]"; }, Element.prototype.setMkvFormatDate = function(date) { this.setUTF8(tools.formatDate(value)); }, Element.prototype.isModified = function() { return !!this._modified; }, Object.defineProperty(Element.prototype, "firstChild", { iterable: !0, get: function() { var children = this.children; return children && children.length ? children[0] : null; } }), Object.defineProperty(Element.prototype, "lastChild", { iterable: !0, get: function() { var children = this.children; return children && children.length ? children[children.length - 1] : null; } }), Object.defineProperty(Element.prototype, "empty", { iterable: !0, get: function() { var children = this.children; return !children || !children.length; } }); }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(46)("matroska:source"), module.exports = function() {}; }, function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(2), util = __webpack_require__(0), debug = __webpack_require__(46)("matroska:fileSource"), AbstractSource = __webpack_require__(221), fileSourceKey = 0; function FileSource(filename) { AbstractSource.call(this), this.filename = filename; } util.inherits(FileSource, AbstractSource), module.exports = FileSource, FileSource.prototype.getStream = function(session, options, callback) { switch (arguments.length) { case 1: callback = session, session = null; break; case 2: callback = options, options = null; } (session = session || {}).$fileSourceKey = fileSourceKey++; var fd = session._fd; if (fd) { var params = { flags: "r", fd: fd, autoClose: !1 }; "number" == typeof options.start && (params.start = options.start), "number" == typeof options.end && (params.end = options.end), debug("GetStream", params, " fd=", session._fd); var stream = fs.createReadStream(this.filename, params); return stream.destroy = function() {}, callback(null, stream); } var self = this; fs.open(this.filename, "r", (function(error, fd) { if (error) return callback(error); session._fd = fd, self.getStream(session, options, callback); })); }, FileSource.prototype._end = function(session, callback) { if (debug("Close", session._fd), !session._fd) return callback(); fs.close(session._fd, (function(error) { return delete session._fd, callback(error); })); }, FileSource.prototype.toString = function() { return "[FileSource file=" + this.filename + "]"; }; }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(2); var util = __webpack_require__(0), debug = __webpack_require__(46)("matroska:httpSource"), http = __webpack_require__(446).http, https = __webpack_require__(446).https, Url = __webpack_require__(7), AbstractSource = __webpack_require__(221), httpSourceKey = 0; function HttpSource(url, configuration) { AbstractSource.call(this), this.configuration = configuration || {}, this.url = url; } util.inherits(HttpSource, AbstractSource), module.exports = HttpSource, HttpSource.prototype.getStream = function(session, params, callback) { switch (arguments.length) { case 1: callback = session, session = null; break; case 2: callback = options, options = null; } (session = session || {}).$httpSourceKey = httpSourceKey++; var options = Url.parse(this.url); options.headers = options.headers || {}, this.configuration.userAgent && (options.headers["User-Agent"] = this.configuration.userAgent), params.start && (options.headers.Range = "bytes=" + params.start + "-" + (params.end ? params.end : "")), debug.enabled && debug("Http request ", options, params); var get = "https:" === options.protocol ? https.get : http.get, request = get(options, (function(response) { if (debug("Response=", response.statusCode, response.statusMessage), 2 !== Math.floor(response.statusCode / 100)) return callback(new Error("Invalid status '" + response.statusCode + "' message='" + response.statusMessage + "' for url=" + this.url)); if (params.start) { var pr, crange = response.headers["content-range"]; if (crange) { var rr = /bytes (\d+)-(\d+)\/(\d+)/g.exec(crange); pr = rr && parseInt(rr[1], 10); } if (pr !== params.start) return callback(new Error("Invalid start range")); } debug("Response stream ..."), callback(null, response); })); request.on("error", (function(error) { debug("Error:", error), callback(error + " for url=" + this.url); })); }, HttpSource.prototype._end = function(session, callback) { debug("Close"), callback(); }, HttpSource.prototype.toString = function() { return "[HttpSource url=" + this.url + "]"; }; }, function(module, exports, __webpack_require__) { var url = __webpack_require__(7), URL = url.URL, http = __webpack_require__(11), https = __webpack_require__(21), Writable = __webpack_require__(3).Writable, assert = __webpack_require__(25), debug = __webpack_require__(877), useNativeURL = !1; try { assert(new URL); } catch (error) { useNativeURL = "ERR_INVALID_URL" === error.code; } var preservedUrlFields = [ "auth", "host", "hostname", "href", "path", "pathname", "port", "protocol", "query", "search", "hash" ], events = [ "abort", "aborted", "connect", "error", "socket", "timeout" ], eventHandlers = Object.create(null); events.forEach((function(event) { eventHandlers[event] = function(arg1, arg2, arg3) { this._redirectable.emit(event, arg1, arg2, arg3); }; })); var InvalidUrlError = createErrorType("ERR_INVALID_URL", "Invalid URL", TypeError), RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE", "Redirected request failed"), TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded", RedirectionError), MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit"), WriteAfterEndError = createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"), destroy = Writable.prototype.destroy || noop; function RedirectableRequest(options, responseCallback) { Writable.call(this), this._sanitizeOptions(options), this._options = options, this._ended = !1, this._ending = !1, this._redirectCount = 0, this._redirects = [], this._requestBodyLength = 0, this._requestBodyBuffers = [], responseCallback && this.on("response", responseCallback); var self = this; this._onNativeResponse = function(response) { try { self._processResponse(response); } catch (cause) { self.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause: cause })); } }, this._performRequest(); } function wrap(protocols) { var exports = { maxRedirects: 21, maxBodyLength: 10485760 }, nativeProtocols = {}; return Object.keys(protocols).forEach((function(scheme) { var protocol = scheme + ":", nativeProtocol = nativeProtocols[protocol] = protocols[scheme], wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); Object.defineProperties(wrappedProtocol, { request: { value: function(input, options, callback) { return (function(value) { return URL && value instanceof URL; })(input) ? input = spreadUrlObject(input) : isString(input) ? input = spreadUrlObject(parseUrl(input)) : (callback = options, options = validateUrl(input), input = { protocol: protocol }), isFunction(options) && (callback = options, options = null), (options = Object.assign({ maxRedirects: exports.maxRedirects, maxBodyLength: exports.maxBodyLength }, input, options)).nativeProtocols = nativeProtocols, isString(options.host) || isString(options.hostname) || (options.hostname = "::1"), assert.equal(options.protocol, protocol, "protocol mismatch"), debug("options", options), new RedirectableRequest(options, callback); }, configurable: !0, enumerable: !0, writable: !0 }, get: { value: function(input, options, callback) { var wrappedRequest = wrappedProtocol.request(input, options, callback); return wrappedRequest.end(), wrappedRequest; }, configurable: !0, enumerable: !0, writable: !0 } }); })), exports; } function noop() {} function parseUrl(input) { var parsed; if (useNativeURL) parsed = new URL(input); else if (!isString((parsed = validateUrl(url.parse(input))).protocol)) throw new InvalidUrlError({ input: input }); return parsed; } function validateUrl(input) { if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) throw new InvalidUrlError({ input: input.href || input }); if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) throw new InvalidUrlError({ input: input.href || input }); return input; } function spreadUrlObject(urlObject, target) { var spread = target || {}; for (var key of preservedUrlFields) spread[key] = urlObject[key]; return spread.hostname.startsWith("[") && (spread.hostname = spread.hostname.slice(1, -1)), "" !== spread.port && (spread.port = Number(spread.port)), spread.path = spread.search ? spread.pathname + spread.search : spread.pathname, spread; } function removeMatchingHeaders(regex, headers) { var lastValue; for (var header in headers) regex.test(header) && (lastValue = headers[header], delete headers[header]); return null == lastValue ? void 0 : String(lastValue).trim(); } function createErrorType(code, message, baseClass) { function CustomError(properties) { Error.captureStackTrace(this, this.constructor), Object.assign(this, properties || {}), this.code = code, this.message = this.cause ? message + ": " + this.cause.message : message; } return CustomError.prototype = new (baseClass || Error), Object.defineProperties(CustomError.prototype, { constructor: { value: CustomError, enumerable: !1 }, name: { value: "Error [" + code + "]", enumerable: !1 } }), CustomError; } function destroyRequest(request, error) { for (var event of events) request.removeListener(event, eventHandlers[event]); request.on("error", noop), request.destroy(error); } function isString(value) { return "string" == typeof value || value instanceof String; } function isFunction(value) { return "function" == typeof value; } RedirectableRequest.prototype = Object.create(Writable.prototype), RedirectableRequest.prototype.abort = function() { destroyRequest(this._currentRequest), this._currentRequest.abort(), this.emit("abort"); }, RedirectableRequest.prototype.destroy = function(error) { return destroyRequest(this._currentRequest, error), destroy.call(this, error), this; }, RedirectableRequest.prototype.write = function(data, encoding, callback) { if (this._ending) throw new WriteAfterEndError; if (!isString(data) && !(function(value) { return "object" == typeof value && "length" in value; })(data)) throw new TypeError("data should be a string, Buffer or Uint8Array"); isFunction(encoding) && (callback = encoding, encoding = null), 0 !== data.length ? this._requestBodyLength + data.length <= this._options.maxBodyLength ? (this._requestBodyLength += data.length, this._requestBodyBuffers.push({ data: data, encoding: encoding }), this._currentRequest.write(data, encoding, callback)) : (this.emit("error", new MaxBodyLengthExceededError), this.abort()) : callback && callback(); }, RedirectableRequest.prototype.end = function(data, encoding, callback) { if (isFunction(data) ? (callback = data, data = encoding = null) : isFunction(encoding) && (callback = encoding, encoding = null), data) { var self = this, currentRequest = this._currentRequest; this.write(data, encoding, (function() { self._ended = !0, currentRequest.end(null, null, callback); })), this._ending = !0; } else this._ended = this._ending = !0, this._currentRequest.end(null, null, callback); }, RedirectableRequest.prototype.setHeader = function(name, value) { this._options.headers[name] = value, this._currentRequest.setHeader(name, value); }, RedirectableRequest.prototype.removeHeader = function(name) { delete this._options.headers[name], this._currentRequest.removeHeader(name); }, RedirectableRequest.prototype.setTimeout = function(msecs, callback) { var self = this; function destroyOnTimeout(socket) { socket.setTimeout(msecs), socket.removeListener("timeout", socket.destroy), socket.addListener("timeout", socket.destroy); } function startTimer(socket) { self._timeout && clearTimeout(self._timeout), self._timeout = setTimeout((function() { self.emit("timeout"), clearTimer(); }), msecs), destroyOnTimeout(socket); } function clearTimer() { self._timeout && (clearTimeout(self._timeout), self._timeout = null), self.removeListener("abort", clearTimer), self.removeListener("error", clearTimer), self.removeListener("response", clearTimer), self.removeListener("close", clearTimer), callback && self.removeListener("timeout", callback), self.socket || self._currentRequest.removeListener("socket", startTimer); } return callback && this.on("timeout", callback), this.socket ? startTimer(this.socket) : this._currentRequest.once("socket", startTimer), this.on("socket", destroyOnTimeout), this.on("abort", clearTimer), this.on("error", clearTimer), this.on("response", clearTimer), this.on("close", clearTimer), this; }, [ "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive" ].forEach((function(method) { RedirectableRequest.prototype[method] = function(a, b) { return this._currentRequest[method](a, b); }; })), [ "aborted", "connection", "socket" ].forEach((function(property) { Object.defineProperty(RedirectableRequest.prototype, property, { get: function() { return this._currentRequest[property]; } }); })), RedirectableRequest.prototype._sanitizeOptions = function(options) { if (options.headers || (options.headers = {}), options.host && (options.hostname || (options.hostname = options.host), delete options.host), !options.pathname && options.path) { var searchPos = options.path.indexOf("?"); searchPos < 0 ? options.pathname = options.path : (options.pathname = options.path.substring(0, searchPos), options.search = options.path.substring(searchPos)); } }, RedirectableRequest.prototype._performRequest = function() { var protocol = this._options.protocol, nativeProtocol = this._options.nativeProtocols[protocol]; if (!nativeProtocol) throw new TypeError("Unsupported protocol " + protocol); if (this._options.agents) { var scheme = protocol.slice(0, -1); this._options.agent = this._options.agents[scheme]; } var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); for (var event of (request._redirectable = this, events)) request.on(event, eventHandlers[event]); if (this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : this._options.path, this._isRedirect) { var i = 0, self = this, buffers = this._requestBodyBuffers; !(function writeNext(error) { if (request === self._currentRequest) if (error) self.emit("error", error); else if (i < buffers.length) { var buffer = buffers[i++]; request.finished || request.write(buffer.data, buffer.encoding, writeNext); } else self._ended && request.end(); })(); } }, RedirectableRequest.prototype._processResponse = function(response) { var statusCode = response.statusCode; this._options.trackRedirects && this._redirects.push({ url: this._currentUrl, headers: response.headers, statusCode: statusCode }); var requestHeaders, location = response.headers.location; if (!location || !1 === this._options.followRedirects || statusCode < 300 || statusCode >= 400) return response.responseUrl = this._currentUrl, response.redirects = this._redirects, this.emit("response", response), void (this._requestBodyBuffers = []); if (destroyRequest(this._currentRequest), response.destroy(), ++this._redirectCount > this._options.maxRedirects) throw new TooManyRedirectsError; var beforeRedirect = this._options.beforeRedirect; beforeRedirect && (requestHeaders = Object.assign({ Host: response.req.getHeader("host") }, this._options.headers)); var method = this._options.method; ((301 === statusCode || 302 === statusCode) && "POST" === this._options.method || 303 === statusCode && !/^(?:GET|HEAD)$/.test(this._options.method)) && (this._options.method = "GET", this._requestBodyBuffers = [], removeMatchingHeaders(/^content-/i, this._options.headers)); var relative, base, currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers), currentUrlParts = parseUrl(this._currentUrl), currentHost = currentHostHeader || currentUrlParts.host, currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })), redirectUrl = (relative = location, base = currentUrl, useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative))); if (debug("redirecting to", redirectUrl.href), this._isRedirect = !0, spreadUrlObject(redirectUrl, this._options), (redirectUrl.protocol !== currentUrlParts.protocol && "https:" !== redirectUrl.protocol || redirectUrl.host !== currentHost && !(function(subdomain, domain) { assert(isString(subdomain) && isString(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && "." === subdomain[dot] && subdomain.endsWith(domain); })(redirectUrl.host, currentHost)) && removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers), isFunction(beforeRedirect)) { var responseDetails = { headers: response.headers, statusCode: statusCode }, requestDetails = { url: currentUrl, method: method, headers: requestHeaders }; beforeRedirect(this._options, responseDetails, requestDetails), this._sanitizeOptions(this._options); } this._performRequest(); }, module.exports = wrap({ http: http, https: https }), module.exports.wrap = wrap; }, function(module, exports, __webpack_require__) { "use strict"; var muxjs = { codecs: __webpack_require__(448), mp4: __webpack_require__(881), flv: __webpack_require__(887), mp2t: __webpack_require__(892), partial: __webpack_require__(893) }; muxjs.mp4.tools = __webpack_require__(897), muxjs.flv.tools = __webpack_require__(899), muxjs.mp2t.tools = __webpack_require__(900), module.exports = muxjs; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { Adts: __webpack_require__(148), h264: __webpack_require__(222) }; }, function(module, exports, __webpack_require__) { "use strict"; var sampleForFrame = function(frame, dataOffset) { var sample = { size: 0, flags: { isLeading: 0, dependsOn: 1, isDependedOn: 0, hasRedundancy: 0, degradationPriority: 0, isNonSyncSample: 1 } }; return sample.dataOffset = dataOffset, sample.compositionTimeOffset = frame.pts - frame.dts, sample.duration = frame.duration, sample.size = 4 * frame.length, sample.size += frame.byteLength, frame.keyFrame && (sample.flags.dependsOn = 2, sample.flags.isNonSyncSample = 0), sample; }; module.exports = { groupNalsIntoFrames: function(nalUnits) { var i, currentNal, currentFrame = [], frames = []; for (frames.byteLength = 0, frames.nalCount = 0, frames.duration = 0, currentFrame.byteLength = 0, i = 0; i < nalUnits.length; i++) "access_unit_delimiter_rbsp" === (currentNal = nalUnits[i]).nalUnitType ? (currentFrame.length && (currentFrame.duration = currentNal.dts - currentFrame.dts, frames.byteLength += currentFrame.byteLength, frames.nalCount += currentFrame.length, frames.duration += currentFrame.duration, frames.push(currentFrame)), (currentFrame = [ currentNal ]).byteLength = currentNal.data.byteLength, currentFrame.pts = currentNal.pts, currentFrame.dts = currentNal.dts) : ("slice_layer_without_partitioning_rbsp_idr" === currentNal.nalUnitType && (currentFrame.keyFrame = !0), currentFrame.duration = currentNal.dts - currentFrame.dts, currentFrame.byteLength += currentNal.data.byteLength, currentFrame.push(currentNal)); return frames.length && (!currentFrame.duration || currentFrame.duration <= 0) && (currentFrame.duration = frames[frames.length - 1].duration), frames.byteLength += currentFrame.byteLength, frames.nalCount += currentFrame.length, frames.duration += currentFrame.duration, frames.push(currentFrame), frames; }, groupFramesIntoGops: function(frames) { var i, currentFrame, currentGop = [], gops = []; for (currentGop.byteLength = 0, currentGop.nalCount = 0, currentGop.duration = 0, currentGop.pts = frames[0].pts, currentGop.dts = frames[0].dts, gops.byteLength = 0, gops.nalCount = 0, gops.duration = 0, gops.pts = frames[0].pts, gops.dts = frames[0].dts, i = 0; i < frames.length; i++) (currentFrame = frames[i]).keyFrame ? (currentGop.length && (gops.push(currentGop), gops.byteLength += currentGop.byteLength, gops.nalCount += currentGop.nalCount, gops.duration += currentGop.duration), (currentGop = [ currentFrame ]).nalCount = currentFrame.length, currentGop.byteLength = currentFrame.byteLength, currentGop.pts = currentFrame.pts, currentGop.dts = currentFrame.dts, currentGop.duration = currentFrame.duration) : (currentGop.duration += currentFrame.duration, currentGop.nalCount += currentFrame.length, currentGop.byteLength += currentFrame.byteLength, currentGop.push(currentFrame)); return gops.length && currentGop.duration <= 0 && (currentGop.duration = gops[gops.length - 1].duration), gops.byteLength += currentGop.byteLength, gops.nalCount += currentGop.nalCount, gops.duration += currentGop.duration, gops.push(currentGop), gops; }, extendFirstKeyFrame: function(gops) { var currentGop; return !gops[0][0].keyFrame && gops.length > 1 && (currentGop = gops.shift(), gops.byteLength -= currentGop.byteLength, gops.nalCount -= currentGop.nalCount, gops[0][0].dts = currentGop.dts, gops[0][0].pts = currentGop.pts, gops[0][0].duration += currentGop.duration), gops; }, generateSampleTable: function(gops, baseDataOffset) { var h, i, sample, currentGop, currentFrame, dataOffset = baseDataOffset || 0, samples = []; for (h = 0; h < gops.length; h++) for (currentGop = gops[h], i = 0; i < currentGop.length; i++) currentFrame = currentGop[i], dataOffset += (sample = sampleForFrame(currentFrame, dataOffset)).size, samples.push(sample); return samples; }, concatenateNalData: function(gops) { var h, i, j, currentGop, currentFrame, currentNal, dataOffset = 0, nalsByteLength = gops.byteLength, numberOfNals = gops.nalCount, data = new Uint8Array(nalsByteLength + 4 * numberOfNals), view = new DataView(data.buffer); for (h = 0; h < gops.length; h++) for (currentGop = gops[h], i = 0; i < currentGop.length; i++) for (currentFrame = currentGop[i], j = 0; j < currentFrame.length; j++) currentNal = currentFrame[j], view.setUint32(dataOffset, currentNal.data.byteLength), dataOffset += 4, data.set(currentNal.data, dataOffset), dataOffset += currentNal.data.byteLength; return data; }, generateSampleTableForFrame: function(frame, baseDataOffset) { var sample, samples = []; return sample = sampleForFrame(frame, baseDataOffset || 0), samples.push(sample), samples; }, concatenateNalDataForFrame: function(frame) { var i, currentNal, dataOffset = 0, nalsByteLength = frame.byteLength, numberOfNals = frame.length, data = new Uint8Array(nalsByteLength + 4 * numberOfNals), view = new DataView(data.buffer); for (i = 0; i < frame.length; i++) currentNal = frame[i], view.setUint32(dataOffset, currentNal.data.byteLength), dataOffset += 4, data.set(currentNal.data, dataOffset), dataOffset += currentNal.data.byteLength; return data; } }; }, function(module, exports, __webpack_require__) { "use strict"; var coneOfSilence = __webpack_require__(884), clock = __webpack_require__(59); module.exports = { prefixWithSilence: function(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) { var baseMediaDecodeTimeTs, frameDuration, silentFrame, i, firstFrame, audioGapDuration = 0, audioFillFrameCount = 0, audioFillDuration = 0; if (frames.length && (baseMediaDecodeTimeTs = clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate), frameDuration = Math.ceil(clock.ONE_SECOND_IN_TS / (track.samplerate / 1024)), audioAppendStartTs && videoBaseMediaDecodeTime && (audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime), audioFillDuration = (audioFillFrameCount = Math.floor(audioGapDuration / frameDuration)) * frameDuration), !(audioFillFrameCount < 1 || audioFillDuration > clock.ONE_SECOND_IN_TS / 2))) { for ((silentFrame = coneOfSilence()[track.samplerate]) || (silentFrame = frames[0].data), i = 0; i < audioFillFrameCount; i++) firstFrame = frames[0], frames.splice(0, 0, { data: silentFrame, dts: firstFrame.dts - frameDuration, pts: firstFrame.pts - frameDuration }); return track.baseMediaDecodeTime -= Math.floor(clock.videoTsToAudioTs(audioFillDuration, track.samplerate)), audioFillDuration; } }, trimAdtsFramesByEarliestDts: function(adtsFrames, track, earliestAllowedDts) { return track.minSegmentDts >= earliestAllowedDts ? adtsFrames : (track.minSegmentDts = 1 / 0, adtsFrames.filter((function(currentFrame) { return currentFrame.dts >= earliestAllowedDts && (track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts), track.minSegmentPts = track.minSegmentDts, !0); }))); }, generateSampleTable: function(frames) { var i, currentFrame, samples = []; for (i = 0; i < frames.length; i++) currentFrame = frames[i], samples.push({ size: currentFrame.data.byteLength, duration: 1024 }); return samples; }, concatenateFrameData: function(frames) { var i, currentFrame, dataOffset = 0, data = new Uint8Array((function(array) { var i, sum = 0; for (i = 0; i < array.length; i++) sum += array[i].data.byteLength; return sum; })(frames)); for (i = 0; i < frames.length; i++) currentFrame = frames[i], data.set(currentFrame.data, dataOffset), dataOffset += currentFrame.data.byteLength; return data; } }; }, function(module, exports, __webpack_require__) { "use strict"; var Stream = __webpack_require__(38), cea708Parser = __webpack_require__(452), CaptionStream = function CaptionStream(options) { options = options || {}, CaptionStream.prototype.init.call(this), this.parse708captions_ = "boolean" != typeof options.parse708captions || options.parse708captions, this.captionPackets_ = [], this.ccStreams_ = [ new Cea608Stream(0, 0), new Cea608Stream(0, 1), new Cea608Stream(1, 0), new Cea608Stream(1, 1) ], this.parse708captions_ && (this.cc708Stream_ = new Cea708Stream), this.reset(), this.ccStreams_.forEach((function(cc) { cc.on("data", this.trigger.bind(this, "data")), cc.on("partialdone", this.trigger.bind(this, "partialdone")), cc.on("done", this.trigger.bind(this, "done")); }), this), this.parse708captions_ && (this.cc708Stream_.on("data", this.trigger.bind(this, "data")), this.cc708Stream_.on("partialdone", this.trigger.bind(this, "partialdone")), this.cc708Stream_.on("done", this.trigger.bind(this, "done"))); }; (CaptionStream.prototype = new Stream).push = function(event) { var sei, userData, newCaptionPackets; if ("sei_rbsp" === event.nalUnitType && (sei = cea708Parser.parseSei(event.escapedRBSP)).payload && sei.payloadType === cea708Parser.USER_DATA_REGISTERED_ITU_T_T35 && (userData = cea708Parser.parseUserData(sei))) if (event.dts < this.latestDts_) this.ignoreNextEqualDts_ = !0; else { if (event.dts === this.latestDts_ && this.ignoreNextEqualDts_) return this.numSameDts_--, void (this.numSameDts_ || (this.ignoreNextEqualDts_ = !1)); newCaptionPackets = cea708Parser.parseCaptionPackets(event.pts, userData), this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets), this.latestDts_ !== event.dts && (this.numSameDts_ = 0), this.numSameDts_++, this.latestDts_ = event.dts; } }, CaptionStream.prototype.flushCCStreams = function(flushType) { this.ccStreams_.forEach((function(cc) { return "flush" === flushType ? cc.flush() : cc.partialFlush(); }), this); }, CaptionStream.prototype.flushStream = function(flushType) { this.captionPackets_.length ? (this.captionPackets_.forEach((function(elem, idx) { elem.presortIndex = idx; })), this.captionPackets_.sort((function(a, b) { return a.pts === b.pts ? a.presortIndex - b.presortIndex : a.pts - b.pts; })), this.captionPackets_.forEach((function(packet) { packet.type < 2 ? this.dispatchCea608Packet(packet) : this.dispatchCea708Packet(packet); }), this), this.captionPackets_.length = 0, this.flushCCStreams(flushType)) : this.flushCCStreams(flushType); }, CaptionStream.prototype.flush = function() { return this.flushStream("flush"); }, CaptionStream.prototype.partialFlush = function() { return this.flushStream("partialFlush"); }, CaptionStream.prototype.reset = function() { this.latestDts_ = null, this.ignoreNextEqualDts_ = !1, this.numSameDts_ = 0, this.activeCea608Channel_ = [ null, null ], this.ccStreams_.forEach((function(ccStream) { ccStream.reset(); })); }, CaptionStream.prototype.dispatchCea608Packet = function(packet) { this.setsTextOrXDSActive(packet) ? this.activeCea608Channel_[packet.type] = null : this.setsChannel1Active(packet) ? this.activeCea608Channel_[packet.type] = 0 : this.setsChannel2Active(packet) && (this.activeCea608Channel_[packet.type] = 1), null !== this.activeCea608Channel_[packet.type] && this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet); }, CaptionStream.prototype.setsChannel1Active = function(packet) { return 4096 == (30720 & packet.ccData); }, CaptionStream.prototype.setsChannel2Active = function(packet) { return 6144 == (30720 & packet.ccData); }, CaptionStream.prototype.setsTextOrXDSActive = function(packet) { return 256 == (28928 & packet.ccData) || 4138 == (30974 & packet.ccData) || 6186 == (30974 & packet.ccData); }, CaptionStream.prototype.dispatchCea708Packet = function(packet) { this.parse708captions_ && this.cc708Stream_.push(packet); }; var CHARACTER_TRANSLATION_708 = { 127: 9834, 4128: 32, 4129: 160, 4133: 8230, 4138: 352, 4140: 338, 4144: 9608, 4145: 8216, 4146: 8217, 4147: 8220, 4148: 8221, 4149: 8226, 4153: 8482, 4154: 353, 4156: 339, 4157: 8480, 4159: 376, 4214: 8539, 4215: 8540, 4216: 8541, 4217: 8542, 4218: 9168, 4219: 9124, 4220: 9123, 4221: 9135, 4222: 9126, 4223: 9121, 4256: 12600 }, within708TextBlock = function(b) { return 32 <= b && b <= 127 || 160 <= b && b <= 255; }, Cea708Window = function(windowNum) { this.windowNum = windowNum, this.reset(); }; Cea708Window.prototype.reset = function() { this.clearText(), this.pendingNewLine = !1, this.winAttr = {}, this.penAttr = {}, this.penLoc = {}, this.penColor = {}, this.visible = 0, this.rowLock = 0, this.columnLock = 0, this.priority = 0, this.relativePositioning = 0, this.anchorVertical = 0, this.anchorHorizontal = 0, this.anchorPoint = 0, this.rowCount = 1, this.virtualRowCount = this.rowCount + 1, this.columnCount = 41, this.windowStyle = 0, this.penStyle = 0; }, Cea708Window.prototype.getText = function() { return this.rows.join("\n"); }, Cea708Window.prototype.clearText = function() { this.rows = [ "" ], this.rowIdx = 0; }, Cea708Window.prototype.newLine = function(pts) { for (this.rows.length >= this.virtualRowCount && "function" == typeof this.beforeRowOverflow && this.beforeRowOverflow(pts), this.rows.length > 0 && (this.rows.push(""), this.rowIdx++); this.rows.length > this.virtualRowCount; ) this.rows.shift(), this.rowIdx--; }, Cea708Window.prototype.isEmpty = function() { return 0 === this.rows.length || 1 === this.rows.length && "" === this.rows[0]; }, Cea708Window.prototype.addText = function(text) { this.rows[this.rowIdx] += text; }, Cea708Window.prototype.backspace = function() { if (!this.isEmpty()) { var row = this.rows[this.rowIdx]; this.rows[this.rowIdx] = row.substr(0, row.length - 1); } }; var Cea708Service = function(serviceNum) { this.serviceNum = serviceNum, this.text = "", this.currentWindow = new Cea708Window(-1), this.windows = []; }; Cea708Service.prototype.init = function(pts, beforeRowOverflow) { this.startPts = pts; for (var win = 0; win < 8; win++) this.windows[win] = new Cea708Window(win), "function" == typeof beforeRowOverflow && (this.windows[win].beforeRowOverflow = beforeRowOverflow); }, Cea708Service.prototype.setCurrentWindow = function(windowNum) { this.currentWindow = this.windows[windowNum]; }; var Cea708Stream = function Cea708Stream() { Cea708Stream.prototype.init.call(this); var self = this; this.current708Packet = null, this.services = {}, this.push = function(packet) { 3 === packet.type ? (self.new708Packet(), self.add708Bytes(packet)) : (null === self.current708Packet && self.new708Packet(), self.add708Bytes(packet)); }; }; Cea708Stream.prototype = new Stream, Cea708Stream.prototype.new708Packet = function() { null !== this.current708Packet && this.push708Packet(), this.current708Packet = { data: [], ptsVals: [] }; }, Cea708Stream.prototype.add708Bytes = function(packet) { var data = packet.ccData, byte0 = data >>> 8, byte1 = 255 & data; this.current708Packet.ptsVals.push(packet.pts), this.current708Packet.data.push(byte0), this.current708Packet.data.push(byte1); }, Cea708Stream.prototype.push708Packet = function() { var packet708 = this.current708Packet, packetData = packet708.data, serviceNum = null, blockSize = null, i = 0, b = packetData[i++]; for (packet708.seq = b >> 6, packet708.sizeCode = 63 & b; i < packetData.length; i++) blockSize = 31 & (b = packetData[i++]), 7 == (serviceNum = b >> 5) && blockSize > 0 && (serviceNum = b = packetData[i++]), this.pushServiceBlock(serviceNum, i, blockSize), blockSize > 0 && (i += blockSize - 1); }, Cea708Stream.prototype.pushServiceBlock = function(serviceNum, start, size) { var b, i = start, packetData = this.current708Packet.data, service = this.services[serviceNum]; for (service || (service = this.initService(serviceNum, i)); i < start + size && i < packetData.length; i++) b = packetData[i], within708TextBlock(b) ? i = this.handleText(i, service) : 16 === b ? i = this.extendedCommands(i, service) : 128 <= b && b <= 135 ? i = this.setCurrentWindow(i, service) : 152 <= b && b <= 159 ? i = this.defineWindow(i, service) : 136 === b ? i = this.clearWindows(i, service) : 140 === b ? i = this.deleteWindows(i, service) : 137 === b ? i = this.displayWindows(i, service) : 138 === b ? i = this.hideWindows(i, service) : 139 === b ? i = this.toggleWindows(i, service) : 151 === b ? i = this.setWindowAttributes(i, service) : 144 === b ? i = this.setPenAttributes(i, service) : 145 === b ? i = this.setPenColor(i, service) : 146 === b ? i = this.setPenLocation(i, service) : 143 === b ? service = this.reset(i, service) : 8 === b ? service.currentWindow.backspace() : 12 === b ? service.currentWindow.clearText() : 13 === b ? service.currentWindow.pendingNewLine = !0 : 14 === b ? service.currentWindow.clearText() : 141 === b && i++; }, Cea708Stream.prototype.extendedCommands = function(i, service) { var b = this.current708Packet.data[++i]; return within708TextBlock(b) && (i = this.handleText(i, service, !0)), i; }, Cea708Stream.prototype.getPts = function(byteIndex) { return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)]; }, Cea708Stream.prototype.initService = function(serviceNum, i) { var self = this; return this.services[serviceNum] = new Cea708Service(serviceNum), this.services[serviceNum].init(this.getPts(i), (function(pts) { self.flushDisplayed(pts, self.services[serviceNum]); })), this.services[serviceNum]; }, Cea708Stream.prototype.handleText = function(i, service, isExtended) { var code, newCode, b = this.current708Packet.data[i], char = (newCode = CHARACTER_TRANSLATION_708[code = (isExtended ? 4096 : 0) | b] || code, 4096 & code && code === newCode ? "" : String.fromCharCode(newCode)), win = service.currentWindow; return win.pendingNewLine && !win.isEmpty() && win.newLine(this.getPts(i)), win.pendingNewLine = !1, win.addText(char), i; }, Cea708Stream.prototype.setCurrentWindow = function(i, service) { var windowNum = 7 & this.current708Packet.data[i]; return service.setCurrentWindow(windowNum), i; }, Cea708Stream.prototype.defineWindow = function(i, service) { var packetData = this.current708Packet.data, b = packetData[i], windowNum = 7 & b; service.setCurrentWindow(windowNum); var win = service.currentWindow; return b = packetData[++i], win.visible = (32 & b) >> 5, win.rowLock = (16 & b) >> 4, win.columnLock = (8 & b) >> 3, win.priority = 7 & b, b = packetData[++i], win.relativePositioning = (128 & b) >> 7, win.anchorVertical = 127 & b, b = packetData[++i], win.anchorHorizontal = b, b = packetData[++i], win.anchorPoint = (240 & b) >> 4, win.rowCount = 15 & b, b = packetData[++i], win.columnCount = 63 & b, b = packetData[++i], win.windowStyle = (56 & b) >> 3, win.penStyle = 7 & b, win.virtualRowCount = win.rowCount + 1, i; }, Cea708Stream.prototype.setWindowAttributes = function(i, service) { var packetData = this.current708Packet.data, b = packetData[i], winAttr = service.currentWindow.winAttr; return b = packetData[++i], winAttr.fillOpacity = (192 & b) >> 6, winAttr.fillRed = (48 & b) >> 4, winAttr.fillGreen = (12 & b) >> 2, winAttr.fillBlue = 3 & b, b = packetData[++i], winAttr.borderType = (192 & b) >> 6, winAttr.borderRed = (48 & b) >> 4, winAttr.borderGreen = (12 & b) >> 2, winAttr.borderBlue = 3 & b, b = packetData[++i], winAttr.borderType += (128 & b) >> 5, winAttr.wordWrap = (64 & b) >> 6, winAttr.printDirection = (48 & b) >> 4, winAttr.scrollDirection = (12 & b) >> 2, winAttr.justify = 3 & b, b = packetData[++i], winAttr.effectSpeed = (240 & b) >> 4, winAttr.effectDirection = (12 & b) >> 2, winAttr.displayEffect = 3 & b, i; }, Cea708Stream.prototype.flushDisplayed = function(pts, service) { for (var displayedText = [], winId = 0; winId < 8; winId++) service.windows[winId].visible && !service.windows[winId].isEmpty() && displayedText.push(service.windows[winId].getText()); service.endPts = pts, service.text = displayedText.join("\n\n"), this.pushCaption(service), service.startPts = pts; }, Cea708Stream.prototype.pushCaption = function(service) { "" !== service.text && (this.trigger("data", { startPts: service.startPts, endPts: service.endPts, text: service.text, stream: "cc708_" + service.serviceNum }), service.text = "", service.startPts = service.endPts); }, Cea708Stream.prototype.displayWindows = function(i, service) { var b = this.current708Packet.data[++i], pts = this.getPts(i); this.flushDisplayed(pts, service); for (var winId = 0; winId < 8; winId++) b & 1 << winId && (service.windows[winId].visible = 1); return i; }, Cea708Stream.prototype.hideWindows = function(i, service) { var b = this.current708Packet.data[++i], pts = this.getPts(i); this.flushDisplayed(pts, service); for (var winId = 0; winId < 8; winId++) b & 1 << winId && (service.windows[winId].visible = 0); return i; }, Cea708Stream.prototype.toggleWindows = function(i, service) { var b = this.current708Packet.data[++i], pts = this.getPts(i); this.flushDisplayed(pts, service); for (var winId = 0; winId < 8; winId++) b & 1 << winId && (service.windows[winId].visible ^= 1); return i; }, Cea708Stream.prototype.clearWindows = function(i, service) { var b = this.current708Packet.data[++i], pts = this.getPts(i); this.flushDisplayed(pts, service); for (var winId = 0; winId < 8; winId++) b & 1 << winId && service.windows[winId].clearText(); return i; }, Cea708Stream.prototype.deleteWindows = function(i, service) { var b = this.current708Packet.data[++i], pts = this.getPts(i); this.flushDisplayed(pts, service); for (var winId = 0; winId < 8; winId++) b & 1 << winId && service.windows[winId].reset(); return i; }, Cea708Stream.prototype.setPenAttributes = function(i, service) { var packetData = this.current708Packet.data, b = packetData[i], penAttr = service.currentWindow.penAttr; return b = packetData[++i], penAttr.textTag = (240 & b) >> 4, penAttr.offset = (12 & b) >> 2, penAttr.penSize = 3 & b, b = packetData[++i], penAttr.italics = (128 & b) >> 7, penAttr.underline = (64 & b) >> 6, penAttr.edgeType = (56 & b) >> 3, penAttr.fontStyle = 7 & b, i; }, Cea708Stream.prototype.setPenColor = function(i, service) { var packetData = this.current708Packet.data, b = packetData[i], penColor = service.currentWindow.penColor; return b = packetData[++i], penColor.fgOpacity = (192 & b) >> 6, penColor.fgRed = (48 & b) >> 4, penColor.fgGreen = (12 & b) >> 2, penColor.fgBlue = 3 & b, b = packetData[++i], penColor.bgOpacity = (192 & b) >> 6, penColor.bgRed = (48 & b) >> 4, penColor.bgGreen = (12 & b) >> 2, penColor.bgBlue = 3 & b, b = packetData[++i], penColor.edgeRed = (48 & b) >> 4, penColor.edgeGreen = (12 & b) >> 2, penColor.edgeBlue = 3 & b, i; }, Cea708Stream.prototype.setPenLocation = function(i, service) { var packetData = this.current708Packet.data, b = packetData[i], penLoc = service.currentWindow.penLoc; return service.currentWindow.pendingNewLine = !0, b = packetData[++i], penLoc.row = 15 & b, b = packetData[++i], penLoc.column = 63 & b, i; }, Cea708Stream.prototype.reset = function(i, service) { var pts = this.getPts(i); return this.flushDisplayed(pts, service), this.initService(service.serviceNum, i); }; var CHARACTER_TRANSLATION = { 42: 225, 92: 233, 94: 237, 95: 243, 96: 250, 123: 231, 124: 247, 125: 209, 126: 241, 127: 9608, 304: 174, 305: 176, 306: 189, 307: 191, 308: 8482, 309: 162, 310: 163, 311: 9834, 312: 224, 313: 160, 314: 232, 315: 226, 316: 234, 317: 238, 318: 244, 319: 251, 544: 193, 545: 201, 546: 211, 547: 218, 548: 220, 549: 252, 550: 8216, 551: 161, 552: 42, 553: 39, 554: 8212, 555: 169, 556: 8480, 557: 8226, 558: 8220, 559: 8221, 560: 192, 561: 194, 562: 199, 563: 200, 564: 202, 565: 203, 566: 235, 567: 206, 568: 207, 569: 239, 570: 212, 571: 217, 572: 249, 573: 219, 574: 171, 575: 187, 800: 195, 801: 227, 802: 205, 803: 204, 804: 236, 805: 210, 806: 242, 807: 213, 808: 245, 809: 123, 810: 125, 811: 92, 812: 94, 813: 95, 814: 124, 815: 126, 816: 196, 817: 228, 818: 214, 819: 246, 820: 223, 821: 165, 822: 164, 823: 9474, 824: 197, 825: 229, 826: 216, 827: 248, 828: 9484, 829: 9488, 830: 9492, 831: 9496 }, getCharFromCode = function(code) { return null === code ? "" : (code = CHARACTER_TRANSLATION[code] || code, String.fromCharCode(code)); }, ROWS = [ 4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152 ], createDisplayBuffer = function() { for (var result = [], i = 15; i--; ) result.push(""); return result; }, Cea608Stream = function Cea608Stream(field, dataChannel) { Cea608Stream.prototype.init.call(this), this.field_ = field || 0, this.dataChannel_ = dataChannel || 0, this.name_ = "CC" + (1 + (this.field_ << 1 | this.dataChannel_)), this.setConstants(), this.reset(), this.push = function(packet) { var data, swap, char0, char1, text; if ((data = 32639 & packet.ccData) !== this.lastControlCode_) { if (4096 == (61440 & data) ? this.lastControlCode_ = data : data !== this.PADDING_ && (this.lastControlCode_ = null), char0 = data >>> 8, char1 = 255 & data, data !== this.PADDING_) if (data === this.RESUME_CAPTION_LOADING_) this.mode_ = "popOn"; else if (data === this.END_OF_CAPTION_) this.mode_ = "popOn", this.clearFormatting(packet.pts), this.flushDisplayed(packet.pts), swap = this.displayed_, this.displayed_ = this.nonDisplayed_, this.nonDisplayed_ = swap, this.startPts_ = packet.pts; else if (data === this.ROLL_UP_2_ROWS_) this.rollUpRows_ = 2, this.setRollUp(packet.pts); else if (data === this.ROLL_UP_3_ROWS_) this.rollUpRows_ = 3, this.setRollUp(packet.pts); else if (data === this.ROLL_UP_4_ROWS_) this.rollUpRows_ = 4, this.setRollUp(packet.pts); else if (data === this.CARRIAGE_RETURN_) this.clearFormatting(packet.pts), this.flushDisplayed(packet.pts), this.shiftRowsUp_(), this.startPts_ = packet.pts; else if (data === this.BACKSPACE_) "popOn" === this.mode_ ? this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1) : this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1); else if (data === this.ERASE_DISPLAYED_MEMORY_) this.flushDisplayed(packet.pts), this.displayed_ = createDisplayBuffer(); else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) this.nonDisplayed_ = createDisplayBuffer(); else if (data === this.RESUME_DIRECT_CAPTIONING_) "paintOn" !== this.mode_ && (this.flushDisplayed(packet.pts), this.displayed_ = createDisplayBuffer()), this.mode_ = "paintOn", this.startPts_ = packet.pts; else if (this.isSpecialCharacter(char0, char1)) text = getCharFromCode((char0 = (3 & char0) << 8) | char1), this[this.mode_](packet.pts, text), this.column_++; else if (this.isExtCharacter(char0, char1)) "popOn" === this.mode_ ? this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1) : this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1), text = getCharFromCode((char0 = (3 & char0) << 8) | char1), this[this.mode_](packet.pts, text), this.column_++; else if (this.isMidRowCode(char0, char1)) this.clearFormatting(packet.pts), this[this.mode_](packet.pts, " "), this.column_++, 14 == (14 & char1) && this.addFormatting(packet.pts, [ "i" ]), 1 == (1 & char1) && this.addFormatting(packet.pts, [ "u" ]); else if (this.isOffsetControlCode(char0, char1)) this.column_ += 3 & char1; else if (this.isPAC(char0, char1)) { var row = ROWS.indexOf(7968 & data); "rollUp" === this.mode_ && (row - this.rollUpRows_ + 1 < 0 && (row = this.rollUpRows_ - 1), this.setRollUp(packet.pts, row)), row !== this.row_ && (this.clearFormatting(packet.pts), this.row_ = row), 1 & char1 && -1 === this.formatting_.indexOf("u") && this.addFormatting(packet.pts, [ "u" ]), 16 == (16 & data) && (this.column_ = 4 * ((14 & data) >> 1)), this.isColorPAC(char1) && 14 == (14 & char1) && this.addFormatting(packet.pts, [ "i" ]); } else this.isNormalChar(char0) && (0 === char1 && (char1 = null), text = getCharFromCode(char0), text += getCharFromCode(char1), this[this.mode_](packet.pts, text), this.column_ += text.length); } else this.lastControlCode_ = null; }; }; Cea608Stream.prototype = new Stream, Cea608Stream.prototype.flushDisplayed = function(pts) { var content = this.displayed_.map((function(row, index) { try { return row.trim(); } catch (e) { return this.trigger("log", { level: "warn", message: "Skipping a malformed 608 caption at index " + index + "." }), ""; } }), this).join("\n").replace(/^\n+|\n+$/g, ""); content.length && this.trigger("data", { startPts: this.startPts_, endPts: pts, text: content, stream: this.name_ }); }, Cea608Stream.prototype.reset = function() { this.mode_ = "popOn", this.topRow_ = 0, this.startPts_ = 0, this.displayed_ = createDisplayBuffer(), this.nonDisplayed_ = createDisplayBuffer(), this.lastControlCode_ = null, this.column_ = 0, this.row_ = 14, this.rollUpRows_ = 2, this.formatting_ = []; }, Cea608Stream.prototype.setConstants = function() { 0 === this.dataChannel_ ? (this.BASE_ = 16, this.EXT_ = 17, this.CONTROL_ = (20 | this.field_) << 8, this.OFFSET_ = 23) : 1 === this.dataChannel_ && (this.BASE_ = 24, this.EXT_ = 25, this.CONTROL_ = (28 | this.field_) << 8, this.OFFSET_ = 31), this.PADDING_ = 0, this.RESUME_CAPTION_LOADING_ = 32 | this.CONTROL_, this.END_OF_CAPTION_ = 47 | this.CONTROL_, this.ROLL_UP_2_ROWS_ = 37 | this.CONTROL_, this.ROLL_UP_3_ROWS_ = 38 | this.CONTROL_, this.ROLL_UP_4_ROWS_ = 39 | this.CONTROL_, this.CARRIAGE_RETURN_ = 45 | this.CONTROL_, this.RESUME_DIRECT_CAPTIONING_ = 41 | this.CONTROL_, this.BACKSPACE_ = 33 | this.CONTROL_, this.ERASE_DISPLAYED_MEMORY_ = 44 | this.CONTROL_, this.ERASE_NON_DISPLAYED_MEMORY_ = 46 | this.CONTROL_; }, Cea608Stream.prototype.isSpecialCharacter = function(char0, char1) { return char0 === this.EXT_ && char1 >= 48 && char1 <= 63; }, Cea608Stream.prototype.isExtCharacter = function(char0, char1) { return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 32 && char1 <= 63; }, Cea608Stream.prototype.isMidRowCode = function(char0, char1) { return char0 === this.EXT_ && char1 >= 32 && char1 <= 47; }, Cea608Stream.prototype.isOffsetControlCode = function(char0, char1) { return char0 === this.OFFSET_ && char1 >= 33 && char1 <= 35; }, Cea608Stream.prototype.isPAC = function(char0, char1) { return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 64 && char1 <= 127; }, Cea608Stream.prototype.isColorPAC = function(char1) { return char1 >= 64 && char1 <= 79 || char1 >= 96 && char1 <= 127; }, Cea608Stream.prototype.isNormalChar = function(char) { return char >= 32 && char <= 127; }, Cea608Stream.prototype.setRollUp = function(pts, newBaseRow) { if ("rollUp" !== this.mode_ && (this.row_ = 14, this.mode_ = "rollUp", this.flushDisplayed(pts), this.nonDisplayed_ = createDisplayBuffer(), this.displayed_ = createDisplayBuffer()), void 0 !== newBaseRow && newBaseRow !== this.row_) for (var i = 0; i < this.rollUpRows_; i++) this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i], this.displayed_[this.row_ - i] = ""; void 0 === newBaseRow && (newBaseRow = this.row_), this.topRow_ = newBaseRow - this.rollUpRows_ + 1; }, Cea608Stream.prototype.addFormatting = function(pts, format) { this.formatting_ = this.formatting_.concat(format); var text = format.reduce((function(text, format) { return text + "<" + format + ">"; }), ""); this[this.mode_](pts, text); }, Cea608Stream.prototype.clearFormatting = function(pts) { if (this.formatting_.length) { var text = this.formatting_.reverse().reduce((function(text, format) { return text + ""; }), ""); this.formatting_ = [], this[this.mode_](pts, text); } }, Cea608Stream.prototype.popOn = function(pts, text) { var baseRow = this.nonDisplayed_[this.row_]; baseRow += text, this.nonDisplayed_[this.row_] = baseRow; }, Cea608Stream.prototype.rollUp = function(pts, text) { var baseRow = this.displayed_[this.row_]; baseRow += text, this.displayed_[this.row_] = baseRow; }, Cea608Stream.prototype.shiftRowsUp_ = function() { var i; for (i = 0; i < this.topRow_; i++) this.displayed_[i] = ""; for (i = this.row_ + 1; i < 15; i++) this.displayed_[i] = ""; for (i = this.topRow_; i < this.row_; i++) this.displayed_[i] = this.displayed_[i + 1]; this.displayed_[this.row_] = ""; }, Cea608Stream.prototype.paintOn = function(pts, text) { var baseRow = this.displayed_[this.row_]; baseRow += text, this.displayed_[this.row_] = baseRow; }, module.exports = { CaptionStream: CaptionStream, Cea608Stream: Cea608Stream, Cea708Stream: Cea708Stream }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { parseSei: function(bytes) { for (var i = 0, result = { payloadType: -1, payloadSize: 0 }, payloadType = 0, payloadSize = 0; i < bytes.byteLength && 128 !== bytes[i]; ) { for (;255 === bytes[i]; ) payloadType += 255, i++; for (payloadType += bytes[i++]; 255 === bytes[i]; ) payloadSize += 255, i++; if (payloadSize += bytes[i++], !result.payload && 4 === payloadType) { if ("GA94" === String.fromCharCode(bytes[i + 3], bytes[i + 4], bytes[i + 5], bytes[i + 6])) { result.payloadType = payloadType, result.payloadSize = payloadSize, result.payload = bytes.subarray(i, i + payloadSize); break; } result.payload = void 0; } i += payloadSize, payloadType = 0, payloadSize = 0; } return result; }, parseUserData: function(sei) { return 181 !== sei.payload[0] || 49 != (sei.payload[1] << 8 | sei.payload[2]) || "GA94" !== String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) || 3 !== sei.payload[7] ? null : sei.payload.subarray(8, sei.payload.length - 1); }, parseCaptionPackets: function(pts, userData) { var i, count, offset, data, results = []; if (!(64 & userData[0])) return results; for (count = 31 & userData[0], i = 0; i < count; i++) data = { type: 3 & userData[2 + (offset = 3 * i)], pts: pts }, 4 & userData[offset + 2] && (data.ccData = userData[offset + 3] << 8 | userData[offset + 4], results.push(data)); return results; }, discardEmulationPreventionBytes: function(data) { for (var newLength, newData, length = data.byteLength, emulationPreventionBytesPositions = [], i = 1; i < length - 2; ) 0 === data[i] && 0 === data[i + 1] && 3 === data[i + 2] ? (emulationPreventionBytesPositions.push(i + 2), i += 2) : i++; if (0 === emulationPreventionBytesPositions.length) return data; newLength = length - emulationPreventionBytesPositions.length, newData = new Uint8Array(newLength); var sourceIndex = 0; for (i = 0; i < newLength; sourceIndex++, i++) sourceIndex === emulationPreventionBytesPositions[0] && (sourceIndex++, emulationPreventionBytesPositions.shift()), newData[i] = data[sourceIndex]; return newData; }, USER_DATA_REGISTERED_ITU_T_T35: 4 }; }, function(module, exports, __webpack_require__) { "use strict"; var Stream = __webpack_require__(38), handleRollover = function(value, reference) { var direction = 1; for (value > reference && (direction = -1); Math.abs(reference - value) > 4294967296; ) value += 8589934592 * direction; return value; }, TimestampRolloverStream = function TimestampRolloverStream(type) { var lastDTS, referenceDTS; TimestampRolloverStream.prototype.init.call(this), this.type_ = type || "shared", this.push = function(data) { "shared" !== this.type_ && data.type !== this.type_ || (void 0 === referenceDTS && (referenceDTS = data.dts), data.dts = handleRollover(data.dts, referenceDTS), data.pts = handleRollover(data.pts, referenceDTS), lastDTS = data.dts, this.trigger("data", data)); }, this.flush = function() { referenceDTS = lastDTS, this.trigger("done"); }, this.endTimeline = function() { this.flush(), this.trigger("endedtimeline"); }, this.discontinuity = function() { referenceDTS = void 0, lastDTS = void 0; }, this.reset = function() { this.discontinuity(), this.trigger("reset"); }; }; TimestampRolloverStream.prototype = new Stream, module.exports = { TimestampRolloverStream: TimestampRolloverStream, handleRollover: handleRollover }; }, function(module, exports, __webpack_require__) { "use strict"; var _AacStream, Stream = __webpack_require__(38), aacUtils = __webpack_require__(154); (_AacStream = function() { var everything = new Uint8Array, timeStamp = 0; _AacStream.prototype.init.call(this), this.setTimestamp = function(timestamp) { timeStamp = timestamp; }, this.push = function(bytes) { var bytesLeft, chunk, packet, tempLength, frameSize = 0, byteIndex = 0; for (everything.length ? (tempLength = everything.length, (everything = new Uint8Array(bytes.byteLength + tempLength)).set(everything.subarray(0, tempLength)), everything.set(bytes, tempLength)) : everything = bytes; everything.length - byteIndex >= 3; ) if (everything[byteIndex] !== "I".charCodeAt(0) || everything[byteIndex + 1] !== "D".charCodeAt(0) || everything[byteIndex + 2] !== "3".charCodeAt(0)) if (255 != (255 & everything[byteIndex]) || 240 != (240 & everything[byteIndex + 1])) byteIndex++; else { if (everything.length - byteIndex < 7) break; if (byteIndex + (frameSize = aacUtils.parseAdtsSize(everything, byteIndex)) > everything.length) break; packet = { type: "audio", data: everything.subarray(byteIndex, byteIndex + frameSize), pts: timeStamp, dts: timeStamp }, this.trigger("data", packet), byteIndex += frameSize; } else { if (everything.length - byteIndex < 10) break; if (byteIndex + (frameSize = aacUtils.parseId3TagSize(everything, byteIndex)) > everything.length) break; chunk = { type: "timed-metadata", data: everything.subarray(byteIndex, byteIndex + frameSize) }, this.trigger("data", chunk), byteIndex += frameSize; } bytesLeft = everything.length - byteIndex, everything = bytesLeft > 0 ? everything.subarray(byteIndex) : new Uint8Array; }, this.reset = function() { everything = new Uint8Array, this.trigger("reset"); }, this.endTimeline = function() { everything = new Uint8Array, this.trigger("endedtimeline"); }; }).prototype = new Stream, module.exports = _AacStream; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = [ "audioobjecttype", "channelcount", "samplerate", "samplingfrequencyindex", "samplesize" ]; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = [ "width", "height", "profileIdc", "levelIdc", "profileCompatibility", "sarRatio" ]; }, function(module, exports, __webpack_require__) { var stream = __webpack_require__(903), nextEvent = __webpack_require__(909), Box = __webpack_require__(464), EMPTY = Buffer.alloc(0); class Decoder extends stream.Writable { constructor(opts) { super(opts), 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(err) { this.destroyed || (this.destroyed = !0, err && this.emit("error", err), this.emit("close")); } _write(data, enc, next) { if (!this.destroyed) { for (var drained = !this._str || !this._str._writableState.needDrain; data.length && !this.destroyed; ) { if (!this._missing && !this._ignoreEmpty) return this._writeBuffer = data, void (this._writeCb = next); var consumed = data.length < this._missing ? data.length : this._missing; if (this._buf ? data.copy(this._buf, this._buf.length - this._missing) : this._str && (drained = this._str.write(consumed === data.length ? data : data.slice(0, consumed))), this._missing -= consumed, !this._missing) { var buf = this._buf, cb = this._cb, stream = this._str; this._buf = this._cb = this._str = this._ondrain = null, drained = !0, this._ignoreEmpty = !1, stream && stream.end(), cb && cb(buf); } data = consumed === data.length ? EMPTY : data.slice(consumed); } if (this._pending && !this._missing) return this._writeBuffer = data, void (this._writeCb = next); drained ? next() : this._ondrain(next); } } _buffer(size, cb) { this._missing = size, this._buf = Buffer.alloc(size), this._cb = cb; } _stream(size, cb) { return this._missing = size, this._str = new MediaData(this), this._ondrain = nextEvent(this._str, "drain"), this._pending++, this._str.on("end", (() => { this._pending--, this._kick(); })), this._cb = cb, this._str; } _readBox() { const bufferHeaders = (len, buf) => { this._buffer(len, (additionalBuf => { buf = buf ? Buffer.concat([ buf, additionalBuf ]) : additionalBuf; var headers = Box.readHeaders(buf); "number" == typeof headers ? bufferHeaders(headers - buf.length, buf) : (this._pending++, this._headers = headers, this.emit("box", headers)); })); }; bufferHeaders(8); } stream() { if (!this._headers) throw new Error("this function can only be called once after 'box' is emitted"); var headers = this._headers; return this._headers = null, this._stream(headers.contentLen, null); } decode(cb) { if (!this._headers) throw new Error("this function can only be called once after 'box' is emitted"); var headers = this._headers; this._headers = null, this._buffer(headers.contentLen, (buf => { var box = Box.decodeWithoutHeaders(headers, buf); cb(box), this._pending--, this._kick(); })); } ignore() { if (!this._headers) throw new Error("this function can only be called once after 'box' is emitted"); var headers = this._headers; this._headers = null, this._missing = headers.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 next = this._writeCb, buffer = this._writeBuffer; this._writeBuffer = null, this._writeCb = null, this._write(buffer, null, next); } } } class MediaData extends stream.PassThrough { constructor(parent) { super(), this._parent = parent, this.destroyed = !1; } destroy(err) { this.destroyed || (this.destroyed = !0, this._parent.destroy(err), err && this.emit("error", err), this.emit("close")); } } module.exports = Decoder; }, function(module, exports, __webpack_require__) { "use strict"; var Duplex; module.exports = Readable, Readable.ReadableState = ReadableState, __webpack_require__(4).EventEmitter; var debug, EElistenerCount = function(emitter, type) { return emitter.listeners(type).length; }, Stream = __webpack_require__(459), Buffer = __webpack_require__(10).Buffer, OurUint8Array = global.Uint8Array || function() {}, debugUtil = __webpack_require__(0); debug = debugUtil && debugUtil.debuglog ? debugUtil.debuglog("stream") : function() {}; var StringDecoder, createReadableStreamAsyncIterator, from, BufferList = __webpack_require__(904), destroyImpl = __webpack_require__(460), getHighWaterMark = __webpack_require__(461).getHighWaterMark, _require$codes = __webpack_require__(74).codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; __webpack_require__(8)(Readable, Stream); var errorOrDestroy = destroyImpl.errorOrDestroy, kProxyEvents = [ "error", "close", "destroy", "pause", "resume" ]; function ReadableState(options, stream, isDuplex) { Duplex = Duplex || __webpack_require__(87), options = options || {}, "boolean" != typeof isDuplex && (isDuplex = stream instanceof Duplex), this.objectMode = !!options.objectMode, isDuplex && (this.objectMode = this.objectMode || !!options.readableObjectMode), this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex), this.buffer = new BufferList, this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = !1 !== options.emitClose, this.autoDestroy = !!options.autoDestroy, this.destroyed = !1, this.defaultEncoding = options.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, options.encoding && (StringDecoder || (StringDecoder = __webpack_require__(155).StringDecoder), this.decoder = new StringDecoder(options.encoding), this.encoding = options.encoding); } function Readable(options) { if (Duplex = Duplex || __webpack_require__(87), !(this instanceof Readable)) return new Readable(options); var isDuplex = this instanceof Duplex; this._readableState = new ReadableState(options, this, isDuplex), this.readable = !0, options && ("function" == typeof options.read && (this._read = options.read), "function" == typeof options.destroy && (this._destroy = options.destroy)), Stream.call(this); } function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { debug("readableAddChunk", chunk); var er, state = stream._readableState; if (null === chunk) state.reading = !1, (function(stream, state) { if (debug("onEofChunk"), !state.ended) { if (state.decoder) { var chunk = state.decoder.end(); chunk && chunk.length && (state.buffer.push(chunk), state.length += state.objectMode ? 1 : chunk.length); } state.ended = !0, state.sync ? emitReadable(stream) : (state.needReadable = !1, state.emittedReadable || (state.emittedReadable = !0, emitReadable_(stream))); } })(stream, state); else if (skipChunkCheck || (er = (function(state, chunk) { var er, obj; return obj = chunk, Buffer.isBuffer(obj) || obj instanceof OurUint8Array || "string" == typeof chunk || void 0 === chunk || state.objectMode || (er = new ERR_INVALID_ARG_TYPE("chunk", [ "string", "Buffer", "Uint8Array" ], chunk)), er; })(state, chunk)), er) errorOrDestroy(stream, er); else if (state.objectMode || chunk && chunk.length > 0) if ("string" == typeof chunk || state.objectMode || Object.getPrototypeOf(chunk) === Buffer.prototype || (chunk = (function(chunk) { return Buffer.from(chunk); })(chunk)), addToFront) state.endEmitted ? errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT) : addChunk(stream, state, chunk, !0); else if (state.ended) errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF); else { if (state.destroyed) return !1; state.reading = !1, state.decoder && !encoding ? (chunk = state.decoder.write(chunk), state.objectMode || 0 !== chunk.length ? addChunk(stream, state, chunk, !1) : maybeReadMore(stream, state)) : addChunk(stream, state, chunk, !1); } else addToFront || (state.reading = !1, maybeReadMore(stream, state)); return !state.ended && (state.length < state.highWaterMark || 0 === state.length); } function addChunk(stream, state, chunk, addToFront) { state.flowing && 0 === state.length && !state.sync ? (state.awaitDrain = 0, stream.emit("data", chunk)) : (state.length += state.objectMode ? 1 : chunk.length, addToFront ? state.buffer.unshift(chunk) : state.buffer.push(chunk), state.needReadable && emitReadable(stream)), maybeReadMore(stream, state); } function howMuchToRead(n, state) { return n <= 0 || 0 === state.length && state.ended ? 0 : state.objectMode ? 1 : n != n ? state.flowing && state.length ? state.buffer.head.data.length : state.length : (n > state.highWaterMark && (state.highWaterMark = (function(n) { return n >= 1073741824 ? n = 1073741824 : (n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++), n; })(n)), n <= state.length ? n : state.ended ? state.length : (state.needReadable = !0, 0)); } function emitReadable(stream) { var state = stream._readableState; debug("emitReadable", state.needReadable, state.emittedReadable), state.needReadable = !1, state.emittedReadable || (debug("emitReadable", state.flowing), state.emittedReadable = !0, process.nextTick(emitReadable_, stream)); } function emitReadable_(stream) { var state = stream._readableState; debug("emitReadable_", state.destroyed, state.length, state.ended), state.destroyed || !state.length && !state.ended || (stream.emit("readable"), state.emittedReadable = !1), state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark, flow(stream); } function maybeReadMore(stream, state) { state.readingMore || (state.readingMore = !0, process.nextTick(maybeReadMore_, stream, state)); } function maybeReadMore_(stream, state) { for (;!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && 0 === state.length); ) { var len = state.length; if (debug("maybeReadMore read 0"), stream.read(0), len === state.length) break; } state.readingMore = !1; } function updateReadableListening(self) { var state = self._readableState; state.readableListening = self.listenerCount("readable") > 0, state.resumeScheduled && !state.paused ? state.flowing = !0 : self.listenerCount("data") > 0 && self.resume(); } function nReadingNextTick(self) { debug("readable nexttick read 0"), self.read(0); } function resume_(stream, state) { debug("resume", state.reading), state.reading || stream.read(0), state.resumeScheduled = !1, stream.emit("resume"), flow(stream), state.flowing && !state.reading && stream.read(0); } function flow(stream) { var state = stream._readableState; for (debug("flow", state.flowing); state.flowing && null !== stream.read(); ) ; } function fromList(n, state) { return 0 === state.length ? null : (state.objectMode ? ret = state.buffer.shift() : !n || n >= state.length ? (ret = state.decoder ? state.buffer.join("") : 1 === state.buffer.length ? state.buffer.first() : state.buffer.concat(state.length), state.buffer.clear()) : ret = state.buffer.consume(n, state.decoder), ret); var ret; } function endReadable(stream) { var state = stream._readableState; debug("endReadable", state.endEmitted), state.endEmitted || (state.ended = !0, process.nextTick(endReadableNT, state, stream)); } function endReadableNT(state, stream) { if (debug("endReadableNT", state.endEmitted, state.length), !state.endEmitted && 0 === state.length && (state.endEmitted = !0, stream.readable = !1, stream.emit("end"), state.autoDestroy)) { var wState = stream._writableState; (!wState || wState.autoDestroy && wState.finished) && stream.destroy(); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i; return -1; } Object.defineProperty(Readable.prototype, "destroyed", { enumerable: !1, get: function() { return void 0 !== this._readableState && this._readableState.destroyed; }, set: function(value) { this._readableState && (this._readableState.destroyed = value); } }), Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) { cb(err); }, Readable.prototype.push = function(chunk, encoding) { var skipChunkCheck, state = this._readableState; return state.objectMode ? skipChunkCheck = !0 : "string" == typeof chunk && ((encoding = encoding || state.defaultEncoding) !== state.encoding && (chunk = Buffer.from(chunk, encoding), encoding = ""), skipChunkCheck = !0), readableAddChunk(this, chunk, encoding, !1, skipChunkCheck); }, Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, !0, !1); }, Readable.prototype.isPaused = function() { return !1 === this._readableState.flowing; }, Readable.prototype.setEncoding = function(enc) { StringDecoder || (StringDecoder = __webpack_require__(155).StringDecoder); var decoder = new StringDecoder(enc); this._readableState.decoder = decoder, this._readableState.encoding = this._readableState.decoder.encoding; for (var p = this._readableState.buffer.head, content = ""; null !== p; ) content += decoder.write(p.data), p = p.next; return this._readableState.buffer.clear(), "" !== content && this._readableState.buffer.push(content), this._readableState.length = content.length, this; }, Readable.prototype.read = function(n) { debug("read", n), n = parseInt(n, 10); var state = this._readableState, nOrig = n; if (0 !== n && (state.emittedReadable = !1), 0 === n && state.needReadable && ((0 !== state.highWaterMark ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) return debug("read: emitReadable", state.length, state.ended), 0 === state.length && state.ended ? endReadable(this) : emitReadable(this), null; if (0 === (n = howMuchToRead(n, state)) && state.ended) return 0 === state.length && endReadable(this), null; var ret, doRead = state.needReadable; return debug("need readable", doRead), (0 === state.length || state.length - n < state.highWaterMark) && debug("length less than watermark", doRead = !0), state.ended || state.reading ? debug("reading or ended", doRead = !1) : doRead && (debug("do read"), state.reading = !0, state.sync = !0, 0 === state.length && (state.needReadable = !0), this._read(state.highWaterMark), state.sync = !1, state.reading || (n = howMuchToRead(nOrig, state))), null === (ret = n > 0 ? fromList(n, state) : null) ? (state.needReadable = state.length <= state.highWaterMark, n = 0) : (state.length -= n, state.awaitDrain = 0), 0 === state.length && (state.ended || (state.needReadable = !0), nOrig !== n && state.ended && endReadable(this)), null !== ret && this.emit("data", ret), ret; }, Readable.prototype._read = function(n) { errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); }, Readable.prototype.pipe = function(dest, pipeOpts) { var src = this, state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [ state.pipes, dest ]; break; default: state.pipes.push(dest); } state.pipesCount += 1, debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); var endFn = pipeOpts && !1 === pipeOpts.end || dest === process.stdout || dest === process.stderr ? unpipe : onend; function onend() { debug("onend"), dest.end(); } state.endEmitted ? process.nextTick(endFn) : src.once("end", endFn), dest.on("unpipe", (function onunpipe(readable, unpipeInfo) { debug("onunpipe"), readable === src && unpipeInfo && !1 === unpipeInfo.hasUnpiped && (unpipeInfo.hasUnpiped = !0, debug("cleanup"), dest.removeListener("close", onclose), dest.removeListener("finish", onfinish), dest.removeListener("drain", ondrain), dest.removeListener("error", onerror), dest.removeListener("unpipe", onunpipe), src.removeListener("end", onend), src.removeListener("end", unpipe), src.removeListener("data", ondata), cleanedUp = !0, !state.awaitDrain || dest._writableState && !dest._writableState.needDrain || ondrain()); })); var ondrain = (function(src) { return function() { var state = src._readableState; debug("pipeOnDrain", state.awaitDrain), state.awaitDrain && state.awaitDrain--, 0 === state.awaitDrain && EElistenerCount(src, "data") && (state.flowing = !0, flow(src)); }; })(src); dest.on("drain", ondrain); var cleanedUp = !1; function ondata(chunk) { debug("ondata"); var ret = dest.write(chunk); debug("dest.write", ret), !1 === ret && ((1 === state.pipesCount && state.pipes === dest || state.pipesCount > 1 && -1 !== indexOf(state.pipes, dest)) && !cleanedUp && (debug("false write response, pause", state.awaitDrain), state.awaitDrain++), src.pause()); } function onerror(er) { debug("onerror", er), unpipe(), dest.removeListener("error", onerror), 0 === EElistenerCount(dest, "error") && errorOrDestroy(dest, er); } function onclose() { dest.removeListener("finish", onfinish), unpipe(); } function onfinish() { debug("onfinish"), dest.removeListener("close", onclose), unpipe(); } function unpipe() { debug("unpipe"), src.unpipe(dest); } return src.on("data", ondata), (function(emitter, event, fn) { if ("function" == typeof emitter.prependListener) return emitter.prependListener("error", fn); emitter._events && emitter._events.error ? Array.isArray(emitter._events.error) ? emitter._events.error.unshift(fn) : emitter._events.error = [ fn, emitter._events.error ] : emitter.on("error", fn); })(dest, 0, onerror), dest.once("close", onclose), dest.once("finish", onfinish), dest.emit("pipe", src), state.flowing || (debug("pipe resume"), src.resume()), dest; }, Readable.prototype.unpipe = function(dest) { var state = this._readableState, unpipeInfo = { hasUnpiped: !1 }; if (0 === state.pipesCount) return this; if (1 === state.pipesCount) return dest && dest !== state.pipes || (dest || (dest = state.pipes), state.pipes = null, state.pipesCount = 0, state.flowing = !1, dest && dest.emit("unpipe", this, unpipeInfo)), this; if (!dest) { var dests = state.pipes, len = state.pipesCount; state.pipes = null, state.pipesCount = 0, state.flowing = !1; for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, { hasUnpiped: !1 }); return this; } var index = indexOf(state.pipes, dest); return -1 === index || (state.pipes.splice(index, 1), state.pipesCount -= 1, 1 === state.pipesCount && (state.pipes = state.pipes[0]), dest.emit("unpipe", this, unpipeInfo)), this; }, Readable.prototype.on = function(ev, fn) { var res = Stream.prototype.on.call(this, ev, fn), state = this._readableState; return "data" === ev ? (state.readableListening = this.listenerCount("readable") > 0, !1 !== state.flowing && this.resume()) : "readable" === ev && (state.endEmitted || state.readableListening || (state.readableListening = state.needReadable = !0, state.flowing = !1, state.emittedReadable = !1, debug("on readable", state.length, state.reading), state.length ? emitReadable(this) : state.reading || process.nextTick(nReadingNextTick, this))), res; }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.removeListener = function(ev, fn) { var res = Stream.prototype.removeListener.call(this, ev, fn); return "readable" === ev && process.nextTick(updateReadableListening, this), res; }, Readable.prototype.removeAllListeners = function(ev) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); return "readable" !== ev && void 0 !== ev || process.nextTick(updateReadableListening, this), res; }, Readable.prototype.resume = function() { var state = this._readableState; return state.flowing || (debug("resume"), state.flowing = !state.readableListening, (function(stream, state) { state.resumeScheduled || (state.resumeScheduled = !0, process.nextTick(resume_, stream, state)); })(this, state)), state.paused = !1, this; }, Readable.prototype.pause = function() { return debug("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (debug("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this; }, Readable.prototype.wrap = function(stream) { var _this = this, state = this._readableState, paused = !1; for (var i in stream.on("end", (function() { if (debug("wrapped end"), state.decoder && !state.ended) { var chunk = state.decoder.end(); chunk && chunk.length && _this.push(chunk); } _this.push(null); })), stream.on("data", (function(chunk) { debug("wrapped data"), state.decoder && (chunk = state.decoder.write(chunk)), state.objectMode && null == chunk || (state.objectMode || chunk && chunk.length) && (_this.push(chunk) || (paused = !0, stream.pause())); })), stream) void 0 === this[i] && "function" == typeof stream[i] && (this[i] = (function(method) { return function() { return stream[method].apply(stream, arguments); }; })(i)); for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); return this._read = function(n) { debug("wrapped _read", n), paused && (paused = !1, stream.resume()); }, this; }, "function" == typeof Symbol && (Readable.prototype[Symbol.asyncIterator] = function() { return void 0 === createReadableStreamAsyncIterator && (createReadableStreamAsyncIterator = __webpack_require__(905)), createReadableStreamAsyncIterator(this); }), Object.defineProperty(Readable.prototype, "readableHighWaterMark", { enumerable: !1, get: function() { return this._readableState.highWaterMark; } }), Object.defineProperty(Readable.prototype, "readableBuffer", { enumerable: !1, get: function() { return this._readableState && this._readableState.buffer; } }), Object.defineProperty(Readable.prototype, "readableFlowing", { enumerable: !1, get: function() { return this._readableState.flowing; }, set: function(state) { this._readableState && (this._readableState.flowing = state); } }), Readable._fromList = fromList, Object.defineProperty(Readable.prototype, "readableLength", { enumerable: !1, get: function() { return this._readableState.length; } }), "function" == typeof Symbol && (Readable.from = function(iterable, opts) { return void 0 === from && (from = __webpack_require__(906)), from(Readable, iterable, opts); }); }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(3); }, function(module, exports, __webpack_require__) { "use strict"; function emitErrorAndCloseNT(self, err) { emitErrorNT(self, err), emitCloseNT(self); } function emitCloseNT(self) { self._writableState && !self._writableState.emitClose || self._readableState && !self._readableState.emitClose || self.emit("close"); } function emitErrorNT(self, err) { self.emit("error", err); } module.exports = { destroy: function(err, cb) { var _this = this, readableDestroyed = this._readableState && this._readableState.destroyed, writableDestroyed = this._writableState && this._writableState.destroyed; return readableDestroyed || writableDestroyed ? (cb ? cb(err) : err && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(emitErrorNT, this, err)) : process.nextTick(emitErrorNT, this, err)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(err || null, (function(err) { !cb && err ? _this._writableState ? _this._writableState.errorEmitted ? process.nextTick(emitCloseNT, _this) : (_this._writableState.errorEmitted = !0, process.nextTick(emitErrorAndCloseNT, _this, err)) : process.nextTick(emitErrorAndCloseNT, _this, err) : cb ? (process.nextTick(emitCloseNT, _this), cb(err)) : process.nextTick(emitCloseNT, _this); })), this); }, undestroy: function() { this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1); }, errorOrDestroy: function(stream, err) { var rState = stream._readableState, wState = stream._writableState; rState && rState.autoDestroy || wState && wState.autoDestroy ? stream.destroy(err) : stream.emit("error", err); } }; }, function(module, exports, __webpack_require__) { "use strict"; var ERR_INVALID_OPT_VALUE = __webpack_require__(74).codes.ERR_INVALID_OPT_VALUE; module.exports = { getHighWaterMark: function(state, options, duplexKey, isDuplex) { var hwm = (function(options, isDuplex, duplexKey) { return null != options.highWaterMark ? options.highWaterMark : isDuplex ? options[duplexKey] : null; })(options, isDuplex, duplexKey); if (null != hwm) { if (!isFinite(hwm) || Math.floor(hwm) !== hwm || hwm < 0) throw new ERR_INVALID_OPT_VALUE(isDuplex ? duplexKey : "highWaterMark", hwm); return Math.floor(hwm); } return state.objectMode ? 16 : 16384; } }; }, function(module, exports, __webpack_require__) { "use strict"; function CorkedRequest(state) { var _this = this; this.next = null, this.entry = null, this.finish = function() { !(function(corkReq, state, err) { var entry = corkReq.entry; for (corkReq.entry = null; entry; ) { var cb = entry.callback; state.pendingcb--, cb(undefined), entry = entry.next; } state.corkedRequestsFree.next = corkReq; })(_this, state); }; } var Duplex; module.exports = Writable, Writable.WritableState = WritableState; var realHasInstance, internalUtil = { deprecate: __webpack_require__(201) }, Stream = __webpack_require__(459), Buffer = __webpack_require__(10).Buffer, OurUint8Array = global.Uint8Array || function() {}, destroyImpl = __webpack_require__(460), getHighWaterMark = __webpack_require__(461).getHighWaterMark, _require$codes = __webpack_require__(74).codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING, errorOrDestroy = destroyImpl.errorOrDestroy; function nop() {} function WritableState(options, stream, isDuplex) { Duplex = Duplex || __webpack_require__(87), options = options || {}, "boolean" != typeof isDuplex && (isDuplex = stream instanceof Duplex), this.objectMode = !!options.objectMode, isDuplex && (this.objectMode = this.objectMode || !!options.writableObjectMode), this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1; var noDecode = !1 === options.decodeStrings; this.decodeStrings = !noDecode, this.defaultEncoding = options.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(er) { !(function(stream, er) { var state = stream._writableState, sync = state.sync, cb = state.writecb; if ("function" != typeof cb) throw new ERR_MULTIPLE_CALLBACK; if ((function(state) { state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0; })(state), er) !(function(stream, state, sync, er, cb) { --state.pendingcb, sync ? (process.nextTick(cb, er), process.nextTick(finishMaybe, stream, state), stream._writableState.errorEmitted = !0, errorOrDestroy(stream, er)) : (cb(er), stream._writableState.errorEmitted = !0, errorOrDestroy(stream, er), finishMaybe(stream, state)); })(stream, state, sync, er, cb); else { var finished = needFinish(state) || stream.destroyed; finished || state.corked || state.bufferProcessing || !state.bufferedRequest || clearBuffer(stream, state), sync ? process.nextTick(afterWrite, stream, state, finished, cb) : afterWrite(stream, state, finished, cb); } })(stream, er); }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !1 !== options.emitClose, this.autoDestroy = !!options.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new CorkedRequest(this); } function Writable(options) { var isDuplex = this instanceof (Duplex = Duplex || __webpack_require__(87)); if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex), this.writable = !0, options && ("function" == typeof options.write && (this._write = options.write), "function" == typeof options.writev && (this._writev = options.writev), "function" == typeof options.destroy && (this._destroy = options.destroy), "function" == typeof options.final && (this._final = options.final)), Stream.call(this); } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, state.destroyed ? state.onwrite(new ERR_STREAM_DESTROYED("write")) : writev ? stream._writev(chunk, state.onwrite) : stream._write(chunk, encoding, state.onwrite), state.sync = !1; } function afterWrite(stream, state, finished, cb) { finished || (function(stream, state) { 0 === state.length && state.needDrain && (state.needDrain = !1, stream.emit("drain")); })(stream, state), state.pendingcb--, cb(), finishMaybe(stream, state); } function clearBuffer(stream, state) { state.bufferProcessing = !0; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { var l = state.bufferedRequestCount, buffer = new Array(l), holder = state.corkedRequestsFree; holder.entry = entry; for (var count = 0, allBuffers = !0; entry; ) buffer[count] = entry, entry.isBuf || (allBuffers = !1), entry = entry.next, count += 1; buffer.allBuffers = allBuffers, doWrite(stream, state, !0, state.length, buffer, "", holder.finish), state.pendingcb++, state.lastBufferedRequest = null, holder.next ? (state.corkedRequestsFree = holder.next, holder.next = null) : state.corkedRequestsFree = new CorkedRequest(state), state.bufferedRequestCount = 0; } else { for (;entry; ) { var chunk = entry.chunk, encoding = entry.encoding, cb = entry.callback; if (doWrite(stream, state, !1, state.objectMode ? 1 : chunk.length, chunk, encoding, cb), entry = entry.next, state.bufferedRequestCount--, state.writing) break; } null === entry && (state.lastBufferedRequest = null); } state.bufferedRequest = entry, state.bufferProcessing = !1; } function needFinish(state) { return state.ending && 0 === state.length && null === state.bufferedRequest && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final((function(err) { state.pendingcb--, err && errorOrDestroy(stream, err), state.prefinished = !0, stream.emit("prefinish"), finishMaybe(stream, state); })); } function finishMaybe(stream, state) { var need = needFinish(state); if (need && ((function(stream, state) { state.prefinished || state.finalCalled || ("function" != typeof stream._final || state.destroyed ? (state.prefinished = !0, stream.emit("prefinish")) : (state.pendingcb++, state.finalCalled = !0, process.nextTick(callFinal, stream, state))); })(stream, state), 0 === state.pendingcb && (state.finished = !0, stream.emit("finish"), state.autoDestroy))) { var rState = stream._readableState; (!rState || rState.autoDestroy && rState.endEmitted) && stream.destroy(); } return need; } __webpack_require__(8)(Writable, Stream), WritableState.prototype.getBuffer = function() { for (var current = this.bufferedRequest, out = []; current; ) out.push(current), current = current.next; return out; }, (function() { try { Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate((function() { return this.getBuffer(); }), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch (_) {} })(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (realHasInstance = Function.prototype[Symbol.hasInstance], Object.defineProperty(Writable, Symbol.hasInstance, { value: function(object) { return !!realHasInstance.call(this, object) || this === Writable && object && object._writableState instanceof WritableState; } })) : realHasInstance = function(object) { return object instanceof this; }, Writable.prototype.pipe = function() { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE); }, Writable.prototype.write = function(chunk, encoding, cb) { var obj, state = this._writableState, ret = !1, isBuf = !state.objectMode && (obj = chunk, Buffer.isBuffer(obj) || obj instanceof OurUint8Array); return isBuf && !Buffer.isBuffer(chunk) && (chunk = (function(chunk) { return Buffer.from(chunk); })(chunk)), "function" == typeof encoding && (cb = encoding, encoding = null), isBuf ? encoding = "buffer" : encoding || (encoding = state.defaultEncoding), "function" != typeof cb && (cb = nop), state.ending ? (function(stream, cb) { var er = new ERR_STREAM_WRITE_AFTER_END; errorOrDestroy(stream, er), process.nextTick(cb, er); })(this, cb) : (isBuf || (function(stream, state, chunk, cb) { var er; return null === chunk ? er = new ERR_STREAM_NULL_VALUES : "string" == typeof chunk || state.objectMode || (er = new ERR_INVALID_ARG_TYPE("chunk", [ "string", "Buffer" ], chunk)), !er || (errorOrDestroy(stream, er), process.nextTick(cb, er), !1); })(this, state, chunk, cb)) && (state.pendingcb++, ret = (function(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = (function(state, chunk, encoding) { return state.objectMode || !1 === state.decodeStrings || "string" != typeof chunk || (chunk = Buffer.from(chunk, encoding)), chunk; })(state, chunk, encoding); chunk !== newChunk && (isBuf = !0, encoding = "buffer", chunk = newChunk); } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; if (ret || (state.needDrain = !0), state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }, last ? last.next = state.lastBufferedRequest : state.bufferedRequest = state.lastBufferedRequest, state.bufferedRequestCount += 1; } else doWrite(stream, state, !1, len, chunk, encoding, cb); return ret; })(this, state, isBuf, chunk, encoding, cb)), ret; }, Writable.prototype.cork = function() { this._writableState.corked++; }, Writable.prototype.uncork = function() { var state = this._writableState; state.corked && (state.corked--, state.writing || state.corked || state.bufferProcessing || !state.bufferedRequest || clearBuffer(this, state)); }, Writable.prototype.setDefaultEncoding = function(encoding) { if ("string" == typeof encoding && (encoding = encoding.toLowerCase()), !([ "hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw" ].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); return this._writableState.defaultEncoding = encoding, this; }, Object.defineProperty(Writable.prototype, "writableBuffer", { enumerable: !1, get: function() { return this._writableState && this._writableState.getBuffer(); } }), Object.defineProperty(Writable.prototype, "writableHighWaterMark", { enumerable: !1, get: function() { return this._writableState.highWaterMark; } }), Writable.prototype._write = function(chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; return "function" == typeof chunk ? (cb = chunk, chunk = null, encoding = null) : "function" == typeof encoding && (cb = encoding, encoding = null), null != chunk && this.write(chunk, encoding), state.corked && (state.corked = 1, this.uncork()), state.ending || (function(stream, state, cb) { state.ending = !0, finishMaybe(stream, state), cb && (state.finished ? process.nextTick(cb) : stream.once("finish", cb)), state.ended = !0, stream.writable = !1; })(this, state, cb), this; }, Object.defineProperty(Writable.prototype, "writableLength", { enumerable: !1, get: function() { return this._writableState.length; } }), Object.defineProperty(Writable.prototype, "destroyed", { enumerable: !1, get: function() { return void 0 !== this._writableState && this._writableState.destroyed; }, set: function(value) { this._writableState && (this._writableState.destroyed = value); } }), Writable.prototype.destroy = destroyImpl.destroy, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) { cb(err); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = Transform; var _require$codes = __webpack_require__(74).codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0, Duplex = __webpack_require__(87); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = !1; var cb = ts.writecb; if (null === cb) return this.emit("error", new ERR_MULTIPLE_CALLBACK); ts.writechunk = null, ts.writecb = null, null != data && this.push(data), cb(er); var rs = this._readableState; rs.reading = !1, (rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark); } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options), this._transformState = { afterTransform: afterTransform.bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = !0, this._readableState.sync = !1, options && ("function" == typeof options.transform && (this._transform = options.transform), "function" == typeof options.flush && (this._flush = options.flush)), this.on("prefinish", prefinish); } function prefinish() { var _this = this; "function" != typeof this._flush || this._readableState.destroyed ? done(this, null, null) : this._flush((function(er, data) { done(_this, er, data); })); } function done(stream, er, data) { if (er) return stream.emit("error", er); if (null != data && stream.push(data), stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0; if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING; return stream.push(null); } __webpack_require__(8)(Transform, Duplex), Transform.prototype.push = function(chunk, encoding) { return this._transformState.needTransform = !1, Duplex.prototype.push.call(this, chunk, encoding); }, Transform.prototype._transform = function(chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); }, Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; if (ts.writecb = cb, ts.writechunk = chunk, ts.writeencoding = encoding, !ts.transforming) { var rs = this._readableState; (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark); } }, Transform.prototype._read = function(n) { var ts = this._transformState; null === ts.writechunk || ts.transforming ? ts.needTransform = !0 : (ts.transforming = !0, this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform)); }, Transform.prototype._destroy = function(err, cb) { Duplex.prototype._destroy.call(this, err, (function(err2) { cb(err2); })); }; }, function(module, exports, __webpack_require__) { var uint64be = __webpack_require__(465), boxes = __webpack_require__(910), Box = exports, containers = exports.containers = { moov: [ "mvhd", "meta", "traks", "mvex" ], trak: [ "tkhd", "tref", "trgr", "edts", "meta", "mdia", "udta" ], edts: [ "elst" ], mdia: [ "mdhd", "hdlr", "elng", "minf" ], minf: [ "vmhd", "smhd", "hmhd", "sthd", "nmhd", "dinf", "stbl" ], dinf: [ "dref" ], stbl: [ "stsd", "stts", "ctts", "cslg", "stsc", "stsz", "stz2", "stco", "co64", "stss", "stsh", "padb", "stdp", "sdtp", "sbgps", "sgpds", "subss", "saizs", "saios" ], mvex: [ "mehd", "trexs", "leva" ], moof: [ "mfhd", "meta", "trafs" ], traf: [ "tfhd", "tfdt", "trun", "sbgps", "sgpds", "subss", "saizs", "saios", "meta" ] }; Box.encode = function(obj, buffer, offset) { return Box.encodingLength(obj), offset = offset || 0, buffer = buffer || Buffer.alloc(obj.length), Box._encode(obj, buffer, offset); }, Box._encode = function(obj, buffer, offset) { var type = obj.type, len = obj.length; len > 4294967295 && (len = 1), buffer.writeUInt32BE(len, offset), buffer.write(obj.type, offset + 4, 4, "ascii"); var ptr = offset + 8; if (1 === len && (uint64be.encode(obj.length, buffer, ptr), ptr += 8), boxes.fullBoxes[type] && (buffer.writeUInt32BE(obj.flags || 0, ptr), buffer.writeUInt8(obj.version || 0, ptr), ptr += 4), containers[type]) containers[type].forEach((function(childType) { if (5 === childType.length) { var entry = obj[childType] || []; childType = childType.substr(0, 4), entry.forEach((function(child) { Box._encode(child, buffer, ptr), ptr += Box.encode.bytes; })); } else obj[childType] && (Box._encode(obj[childType], buffer, ptr), ptr += Box.encode.bytes); })), obj.otherBoxes && obj.otherBoxes.forEach((function(child) { Box._encode(child, buffer, ptr), ptr += Box.encode.bytes; })); else if (boxes[type]) { var encode = boxes[type].encode; encode(obj, buffer, ptr), ptr += encode.bytes; } else { if (!obj.buffer) throw new Error("Either `type` must be set to a known type (not'" + type + "') or `buffer` must be set"); obj.buffer.copy(buffer, ptr), ptr += obj.buffer.length; } return Box.encode.bytes = ptr - offset, buffer; }, Box.readHeaders = function(buffer, start, end) { if (start = start || 0, (end = end || buffer.length) - start < 8) return 8; var version, flags, len = buffer.readUInt32BE(start), type = buffer.toString("ascii", start + 4, start + 8), ptr = start + 8; if (1 === len) { if (end - start < 16) return 16; len = uint64be.decode(buffer, ptr), ptr += 8; } return boxes.fullBoxes[type] && (version = buffer.readUInt8(ptr), flags = 16777215 & buffer.readUInt32BE(ptr), ptr += 4), { length: len, headersLen: ptr - start, contentLen: len - (ptr - start), type: type, version: version, flags: flags }; }, Box.decode = function(buffer, start, end) { start = start || 0, end = end || buffer.length; var headers = Box.readHeaders(buffer, start, end); if (!headers || headers.length > end - start) throw new Error("Data too short"); return Box.decodeWithoutHeaders(headers, buffer, start + headers.headersLen, start + headers.length); }, Box.decodeWithoutHeaders = function(headers, buffer, start, end) { start = start || 0, end = end || buffer.length; var type = headers.type, obj = {}; if (containers[type]) { obj.otherBoxes = []; for (var contents = containers[type], ptr = start; end - ptr >= 8; ) { var child = Box.decode(buffer, ptr, end); if (ptr += child.length, contents.indexOf(child.type) >= 0) obj[child.type] = child; else if (contents.indexOf(child.type + "s") >= 0) { var childType = child.type + "s"; (obj[childType] = obj[childType] || []).push(child); } else obj.otherBoxes.push(child); } } else boxes[type] ? obj = (0, boxes[type].decode)(buffer, start, end) : obj.buffer = Buffer.from(buffer.slice(start, end)); return obj.length = headers.length, obj.contentLen = headers.contentLen, obj.type = headers.type, obj.version = headers.version, obj.flags = headers.flags, obj; }, Box.encodingLength = function(obj) { var type = obj.type, len = 8; if (boxes.fullBoxes[type] && (len += 4), containers[type]) containers[type].forEach((function(childType) { if (5 === childType.length) { var entry = obj[childType] || []; childType = childType.substr(0, 4), entry.forEach((function(child) { child.type = childType, len += Box.encodingLength(child); })); } else if (obj[childType]) { var child = obj[childType]; child.type = childType, len += Box.encodingLength(child); } })), obj.otherBoxes && obj.otherBoxes.forEach((function(child) { len += Box.encodingLength(child); })); else if (boxes[type]) len += boxes[type].encodingLength(obj); else { if (!obj.buffer) throw new Error("Either `type` must be set to a known type (not'" + type + "') or `buffer` must be set"); len += obj.buffer.length; } return len > 4294967295 && (len += 8), obj.length = len, len; }; }, function(module, exports, __webpack_require__) { var bufferAlloc = __webpack_require__(422), UINT_32_MAX = Math.pow(2, 32); exports.encodingLength = function() { return 8; }, exports.encode = function(num, buf, offset) { buf || (buf = bufferAlloc(8)), offset || (offset = 0); var top = Math.floor(num / UINT_32_MAX), rem = num - top * UINT_32_MAX; return buf.writeUInt32BE(top, offset), buf.writeUInt32BE(rem, offset + 4), buf; }, exports.decode = function(buf, offset) { offset || (offset = 0); var top = buf.readUInt32BE(offset), rem = buf.readUInt32BE(offset + 4); return top * UINT_32_MAX + rem; }, exports.encode.bytes = 8, exports.decode.bytes = 8; }, function(module, exports, __webpack_require__) { const master = __webpack_require__(916), media = __webpack_require__(917); module.exports = { master: master, media: media }; }, function(module, exports) { module.exports = function({stream: stream, format: format, segmentDuration: segmentDuration, timescale: timescale}) { const timescaleCoef = timescale / stream.timescale, startTimeTs = "number" == typeof stream.startTimeTs ? stream.startTimeTs * timescaleCoef : 0, formatDurationTs = Math.ceil(format.duration * timescale), segmentDurationTs = Math.ceil(segmentDuration * timescale), lastSegmentDurationTs = formatDurationTs % segmentDurationTs; return Array(Math.floor(formatDurationTs / segmentDurationTs)).fill(segmentDurationTs).concat(0 !== lastSegmentDurationTs ? [ lastSegmentDurationTs ] : []).reduce(((result, duration, index) => result.set(index + 1, { sequenceNumber: index + 1, seekTime: startTimeTs + index * segmentDurationTs, duration: duration, buffer: null, cues: [], extraSegments: [] })), new Map); }; }, function(module, exports, __webpack_require__) { const {finished: finished} = __webpack_require__(3), DecodeStream = __webpack_require__(457), readChunk = __webpack_require__(231); module.exports = async function(stream, type) { return new Promise(((resolve, reject) => { const chunks = [], decodeStream = new DecodeStream, cleanupDecodeStream = finished(decodeStream, (() => { cleanupDecodeStream(), decodeStream.off("box", onBox); })); async function onBox(box) { decodeStream.ignore(), box.type === type ? (await next(box.contentLen), resolve(Buffer.concat(chunks))) : next(box.contentLen + 8); } async function next(size) { try { const chunk = await readChunk(stream, size); chunks.push(chunk), decodeStream.write(chunk); } catch (error) { decodeStream.destroy(), reject(error); } } decodeStream.on("box", onBox), next(8); })); }; }, function(module) { module.exports = { name: "ytdl-core", description: "YouTube video downloader in pure javascript.", keywords: [ "youtube", "video", "download" ], version: "4.9.0", repository: { type: "git", url: "git://github.com/fent/node-ytdl-core.git" }, author: "fent (https://github.com/fent)", contributors: [ "Tobias Kutscha (https://github.com/TimeForANinja)", "Andrew Kelley (https://github.com/andrewrk)", "Mauricio Allende (https://github.com/mallendeo)", "Rodrigo Altamirano (https://github.com/raltamirano)", "Jim Buck (https://github.com/JimmyBoh)" ], main: "./lib/index.js", types: "./typings/index.d.ts", files: [ "lib", "typings" ], scripts: { test: "nyc --reporter=lcov --reporter=text-summary npm run test:unit", "test:unit": "mocha --ignore test/irl-test.js test/*-test.js --timeout 4000", "test:irl": "mocha --timeout 16000 test/irl-test.js", lint: "eslint ./", "lint:fix": "eslint --fix ./", "lint:typings": "tslint typings/index.d.ts", "lint:typings:fix": "tslint --fix typings/index.d.ts" }, dependencies: { m3u8stream: "^0.8.3", miniget: "^4.0.0", sax: "^1.1.3" }, devDependencies: { "@types/node": "^13.1.0", "assert-diff": "^3.0.1", dtslint: "^3.6.14", eslint: "^6.8.0", mocha: "^7.0.0", "muk-require": "^1.2.0", nock: "^13.0.4", nyc: "^15.0.0", sinon: "^9.0.0", "stream-equal": "~1.1.0", typescript: "^3.9.7" }, engines: { node: ">=10" }, license: "MIT" }; }, function(module, exports, __webpack_require__) { const utils = __webpack_require__(107), FORMATS = __webpack_require__(939), audioEncodingRanks = [ "mp4a", "mp3", "vorbis", "aac", "opus", "flac" ], videoEncodingRanks = [ "mp4v", "avc1", "Sorenson H.283", "MPEG-4 Visual", "VP8", "VP9", "H.264" ], getVideoBitrate = format => format.bitrate || 0, getVideoEncodingRank = format => videoEncodingRanks.findIndex((enc => format.codecs && format.codecs.includes(enc))), getAudioBitrate = format => format.audioBitrate || 0, getAudioEncodingRank = format => audioEncodingRanks.findIndex((enc => format.codecs && format.codecs.includes(enc))), sortFormatsBy = (a, b, sortBy) => { let res = 0; for (let fn of sortBy) if (res = fn(b) - fn(a), 0 !== res) break; return res; }, sortFormatsByVideo = (a, b) => sortFormatsBy(a, b, [ format => parseInt(format.qualityLabel), getVideoBitrate, getVideoEncodingRank ]), sortFormatsByAudio = (a, b) => sortFormatsBy(a, b, [ getAudioBitrate, getAudioEncodingRank ]); exports.sortFormats = (a, b) => sortFormatsBy(a, b, [ format => +!!format.isHLS, format => +!!format.isDashMPD, format => +(format.contentLength > 0), format => +(format.hasVideo && format.hasAudio), format => +format.hasVideo, format => parseInt(format.qualityLabel) || 0, getVideoBitrate, getAudioBitrate, getVideoEncodingRank, getAudioEncodingRank ]), exports.chooseFormat = (formats, options) => { if ("object" == typeof options.format) { if (!options.format.url) throw Error("Invalid format given, did you use `ytdl.getInfo()`?"); return options.format; } let format; options.filter && (formats = exports.filterFormats(formats, options.filter)), formats.some((fmt => fmt.isHLS)) && (formats = formats.filter((fmt => fmt.isHLS || !fmt.isLive))); const quality = options.quality || "highest"; switch (quality) { case "highest": format = formats[0]; break; case "lowest": format = formats[formats.length - 1]; break; case "highestaudio": { (formats = exports.filterFormats(formats, "audio")).sort(sortFormatsByAudio); const bestAudioFormat = formats[0], worstVideoQuality = (formats = formats.filter((f => 0 === sortFormatsByAudio(bestAudioFormat, f)))).map((f => parseInt(f.qualityLabel) || 0)).sort(((a, b) => a - b))[0]; format = formats.find((f => (parseInt(f.qualityLabel) || 0) === worstVideoQuality)); break; } case "lowestaudio": (formats = exports.filterFormats(formats, "audio")).sort(sortFormatsByAudio), format = formats[formats.length - 1]; break; case "highestvideo": { (formats = exports.filterFormats(formats, "video")).sort(sortFormatsByVideo); const bestVideoFormat = formats[0], worstAudioQuality = (formats = formats.filter((f => 0 === sortFormatsByVideo(bestVideoFormat, f)))).map((f => f.audioBitrate || 0)).sort(((a, b) => a - b))[0]; format = formats.find((f => (f.audioBitrate || 0) === worstAudioQuality)); break; } case "lowestvideo": (formats = exports.filterFormats(formats, "video")).sort(sortFormatsByVideo), format = formats[formats.length - 1]; break; default: format = getFormatByQuality(quality, formats); } if (!format) throw Error(`No such format found: ${quality}`); return format; }; const getFormatByQuality = (quality, formats) => { let getFormat = itag => formats.find((format => `${format.itag}` == `${itag}`)); return Array.isArray(quality) ? getFormat(quality.find((q => getFormat(q)))) : getFormat(quality); }; exports.filterFormats = (formats, filter) => { let fn; switch (filter) { case "videoandaudio": case "audioandvideo": fn = format => format.hasVideo && format.hasAudio; break; case "video": fn = format => format.hasVideo; break; case "videoonly": fn = format => format.hasVideo && !format.hasAudio; break; case "audio": fn = format => format.hasAudio; break; case "audioonly": fn = format => !format.hasVideo && format.hasAudio; break; default: if ("function" != typeof filter) throw TypeError(`Given filter (${filter}) is not supported`); fn = filter; } return formats.filter((format => !!format.url && fn(format))); }, exports.addFormatMeta = format => ((format = Object.assign({}, FORMATS[format.itag], format)).hasVideo = !!format.qualityLabel, format.hasAudio = !!format.audioBitrate, format.container = format.mimeType ? format.mimeType.split(";")[0].split("/")[1] : null, format.codecs = format.mimeType ? utils.between(format.mimeType, 'codecs="', '"') : null, format.videoCodec = format.hasVideo && format.codecs ? format.codecs.split(", ")[0] : null, format.audioCodec = format.hasAudio && format.codecs ? format.codecs.split(", ").slice(-1)[0] : null, format.isLive = /\bsource[/=]yt_live_broadcast\b/.test(format.url), format.isHLS = /\/manifest\/hls_(variant|playlist)\//.test(format.url), format.isDashMPD = /\/manifest\/dash\//.test(format.url), format); }, function(module, exports) { const validQueryDomains = new Set([ "youtube.com", "www.youtube.com", "m.youtube.com", "music.youtube.com", "gaming.youtube.com" ]), validPathDomains = /^https?:\/\/(youtu\.be\/|(www\.)?youtube.com\/(embed|v|shorts)\/)/; exports.getURLVideoID = link => { const parsed = new URL(link); let id = parsed.searchParams.get("v"); if (validPathDomains.test(link) && !id) { const paths = parsed.pathname.split("/"); id = paths[paths.length - 1]; } else if (parsed.hostname && !validQueryDomains.has(parsed.hostname)) throw Error("Not a YouTube domain"); if (!id) throw Error(`No video id found: ${link}`); if (id = id.substring(0, 11), !exports.validateID(id)) throw TypeError(`Video id (${id}) does not match expected format (${idRegex.toString()})`); return id; }; const urlRegex = /^https?:\/\//; exports.getVideoID = str => { if (exports.validateID(str)) return str; if (urlRegex.test(str)) return exports.getURLVideoID(str); throw Error(`No video id found: ${str}`); }; const idRegex = /^[a-zA-Z0-9-_]{11}$/; exports.validateID = id => idRegex.test(id), exports.validateURL = string => { try { return exports.getURLVideoID(string), !0; } catch (e) { return !1; } }; }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.durationStr = exports.humanStr = void 0; const numberFormat = /^\d+$/, timeFormat = /^(?:(?:(\d+):)?(\d{1,2}):)?(\d{1,2})(?:\.(\d{3}))?$/, timeUnits = { ms: 1, s: 1e3, m: 6e4, h: 36e5 }; exports.humanStr = time => { if ("number" == typeof time) return time; if (numberFormat.test(time)) return +time; const firstFormat = timeFormat.exec(time); if (firstFormat) return +(firstFormat[1] || 0) * timeUnits.h + +(firstFormat[2] || 0) * timeUnits.m + +firstFormat[3] * timeUnits.s + +(firstFormat[4] || 0); { let total = 0; const r = /(-?\d+)(ms|s|m|h)/g; let rs; for (;null != (rs = r.exec(time)); ) total += +rs[1] * timeUnits[rs[2]]; return total; } }, exports.durationStr = time => { let total = 0; const r = /(\d+(?:\.\d+)?)(S|M|H)/g; let rs; for (;null != (rs = r.exec(time)); ) total += +rs[1] * timeUnits[rs[2].toLowerCase()]; return total; }; }, function(module, exports, __webpack_require__) { const querystring = __webpack_require__(24), Cache = __webpack_require__(474), utils = __webpack_require__(107); exports.cache = new Cache, exports.getTokens = (html5playerfile, options) => exports.cache.getOrSet(html5playerfile, (async () => { const body = await utils.exposedMiniget(html5playerfile, options).text(), tokens = exports.extractActions(body); if (!tokens || !tokens.length) throw Error("Could not extract signature deciphering actions"); return exports.cache.set(html5playerfile, tokens), tokens; })), exports.decipher = (tokens, sig) => { sig = sig.split(""); for (let i = 0, len = tokens.length; i < len; i++) { let pos, token = tokens[i]; switch (token[0]) { case "r": sig = sig.reverse(); break; case "w": pos = ~~token.slice(1), sig = swapHeadAndPosition(sig, pos); break; case "s": pos = ~~token.slice(1), sig = sig.slice(pos); break; case "p": pos = ~~token.slice(1), sig.splice(0, pos); } } return sig.join(""); }; const swapHeadAndPosition = (arr, position) => { const first = arr[0]; return arr[0] = arr[position % arr.length], arr[position] = first, arr; }, jsVarStr = "[a-zA-Z_\\$][a-zA-Z_0-9]*", jsQuoteStr = "(?:'[^'\\\\]*(:?\\\\[\\s\\S][^'\\\\]*)*'|\"[^\"\\\\]*(:?\\\\[\\s\\S][^\"\\\\]*)*\")", jsKeyStr = `(?:${jsVarStr}|${jsQuoteStr})`, jsPropStr = `(?:\\.${jsVarStr}|\\[${jsQuoteStr}\\])`, reverseStr = ":function\\(a\\)\\{(?:return )?a\\.reverse\\(\\)\\}", sliceStr = ":function\\(a,b\\)\\{return a\\.slice\\(b\\)\\}", spliceStr = ":function\\(a,b\\)\\{a\\.splice\\(0,b\\)\\}", swapStr = ":function\\(a,b\\)\\{var c=a\\[0\\];a\\[0\\]=a\\[b(?:%a\\.length)?\\];a\\[b(?:%a\\.length)?\\]=c(?:;return a)?\\}", actionsObjRegexp = new RegExp(`var (${jsVarStr})=\\{((?:(?:${jsKeyStr}${reverseStr}|${jsKeyStr}${sliceStr}|${jsKeyStr}${spliceStr}|${jsKeyStr}${swapStr}),?\\r?\\n?)+)\\};`), actionsFuncRegexp = new RegExp(`function(?: ${jsVarStr})?\\(a\\)\\{a=a\\.split\\((?:''|"")\\);\\s*((?:(?:a=)?${jsVarStr}${jsPropStr}\\(a,\\d+\\);)+)return a\\.join\\((?:''|"")\\)\\}`), reverseRegexp = new RegExp(`(?:^|,)(${jsKeyStr})${reverseStr}`, "m"), sliceRegexp = new RegExp(`(?:^|,)(${jsKeyStr})${sliceStr}`, "m"), spliceRegexp = new RegExp(`(?:^|,)(${jsKeyStr})${spliceStr}`, "m"), swapRegexp = new RegExp(`(?:^|,)(${jsKeyStr})${swapStr}`, "m"); exports.extractActions = body => { const objResult = actionsObjRegexp.exec(body), funcResult = actionsFuncRegexp.exec(body); if (!objResult || !funcResult) return null; const obj = objResult[1].replace(/\$/g, "\\$"), objBody = objResult[2].replace(/\$/g, "\\$"), funcBody = funcResult[1].replace(/\$/g, "\\$"); let result = reverseRegexp.exec(objBody); const reverseKey = result && result[1].replace(/\$/g, "\\$").replace(/\$|^'|^"|'$|"$/g, ""); result = sliceRegexp.exec(objBody); const sliceKey = result && result[1].replace(/\$/g, "\\$").replace(/\$|^'|^"|'$|"$/g, ""); result = spliceRegexp.exec(objBody); const spliceKey = result && result[1].replace(/\$/g, "\\$").replace(/\$|^'|^"|'$|"$/g, ""); result = swapRegexp.exec(objBody); const swapKey = result && result[1].replace(/\$/g, "\\$").replace(/\$|^'|^"|'$|"$/g, ""), keys = `(${[ reverseKey, sliceKey, spliceKey, swapKey ].join("|")})`, tokenizeRegexp = new RegExp(`(?:a=)?${obj}(?:\\.${keys}|\\['${keys}'\\]|\\["${keys}"\\])\\(a,(\\d+)\\)`, "g"), tokens = []; for (;null !== (result = tokenizeRegexp.exec(funcBody)); ) switch (result[1] || result[2] || result[3]) { case swapKey: tokens.push(`w${result[4]}`); break; case reverseKey: tokens.push("r"); break; case sliceKey: tokens.push(`s${result[4]}`); break; case spliceKey: tokens.push(`p${result[4]}`); } return tokens; }, exports.setDownloadURL = (format, sig) => { let decodedUrl; if (!format.url) return; decodedUrl = format.url; try { decodedUrl = decodeURIComponent(decodedUrl); } catch (err) { return; } const parsedUrl = new URL(decodedUrl); parsedUrl.searchParams.set("ratebypass", "yes"), sig && parsedUrl.searchParams.set(format.sp || "signature", sig), format.url = parsedUrl.toString(); }, exports.decipherFormats = async (formats, html5player, options) => { let decipheredFormats = {}, tokens = await exports.getTokens(html5player, options); return formats.forEach((format => { let cipher = format.signatureCipher || format.cipher; cipher && (Object.assign(format, querystring.parse(cipher)), delete format.signatureCipher, delete format.cipher); const sig = tokens && format.s ? exports.decipher(tokens, format.s) : null; exports.setDownloadURL(format, sig), decipheredFormats[format.url] = format; })), decipheredFormats; }; }, function(module, exports, __webpack_require__) { const {setTimeout: setTimeout} = __webpack_require__(103); module.exports = class extends Map { constructor(timeout = 1e3) { super(), this.timeout = timeout; } set(key, value) { this.has(key) && clearTimeout(super.get(key).tid), super.set(key, { tid: setTimeout(this.delete.bind(this, key), this.timeout).unref(), value: value }); } get(key) { let entry = super.get(key); return entry ? entry.value : null; } getOrSet(key, fn) { if (this.has(key)) return this.get(key); { let value = fn(); return this.set(key, value), (async () => { try { await value; } catch (err) { this.delete(key); } })(), value; } } delete(key) { let entry = super.get(key); entry && (clearTimeout(entry.tid), super.delete(key)); } clear() { for (let entry of this.values()) clearTimeout(entry.tid); super.clear(); } }; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2), path = __webpack_require__(5), crypto = __webpack_require__(6), tmpDir = __webpack_require__(945), _c = process.binding("constants"), _TMP = tmpDir(), RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", TEMPLATE_PATTERN = /XXXXXX/, CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR), EBADF = _c.EBADF || _c.os.errno.EBADF, ENOENT = _c.ENOENT || _c.os.errno.ENOENT, _removeObjects = [], _gracefulCleanup = !1, _uncaughtException = !1; function _randomChars(howMany) { var value = [], rnd = null; try { rnd = crypto.randomBytes(howMany); } catch (e) { rnd = crypto.pseudoRandomBytes(howMany); } for (var i = 0; i < howMany; i++) value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); return value.join(""); } function _parseArguments(options, callback) { if ("function" == typeof options) { var tmp = options; options = callback || {}, callback = tmp; } else void 0 === options && (options = {}); return [ options, callback ]; } function _generateTmpName(opts) { if (opts.name) return path.join(opts.dir || _TMP, opts.name); if (opts.template) return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6)); var name = [ opts.prefix || "tmp-", process.pid, _randomChars(12), opts.postfix || "" ].join(""); return path.join(opts.dir || _TMP, name); } function _getTmpName(options, callback) { var args = _parseArguments(options, callback), opts = args[0], cb = args[1], tries = opts.tries || 3; return isNaN(tries) || tries < 0 ? cb(new Error("Invalid tries")) : opts.template && !opts.template.match(TEMPLATE_PATTERN) ? cb(new Error("Invalid template provided")) : void (function _getUniqueName() { var name = _generateTmpName(opts); fs.stat(name, (function(err) { if (!err) return tries-- > 0 ? _getUniqueName() : cb(new Error("Could not get a unique tmp filename, max tries reached " + name)); cb(null, name); })); })(); } function _getTmpNameSync(options) { var opts = _parseArguments(options)[0], tries = opts.tries || 3; if (isNaN(tries) || tries < 0) throw new Error("Invalid tries"); if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) throw new Error("Invalid template provided"); do { var name = _generateTmpName(opts); try { fs.statSync(name); } catch (e) { return name; } } while (tries-- > 0); throw new Error("Could not get a unique tmp filename, max tries reached"); } function _rmdirRecursiveSync(root) { var dirs = [ root ]; do { for (var dir = dirs.pop(), deferred = !1, files = fs.readdirSync(dir), i = 0, length = files.length; i < length; i++) { var file = path.join(dir, files[i]); fs.lstatSync(file).isDirectory() ? (deferred || (deferred = !0, dirs.push(dir)), dirs.push(file)) : fs.unlinkSync(file); } deferred || fs.rmdirSync(dir); } while (0 !== dirs.length); } function _prepareTmpFileRemoveCallback(name, fd, opts) { var removeCallback = _prepareRemoveCallback((function(fdPath) { try { 0 <= fdPath[0] && fs.closeSync(fdPath[0]); } catch (e) { if (e.errno != -EBADF && e.errno != -ENOENT) throw e; } fs.unlinkSync(fdPath[1]); }), [ fd, name ]); return opts.keep || _removeObjects.unshift(removeCallback), removeCallback; } function _prepareTmpDirRemoveCallback(name, opts) { var removeCallback = _prepareRemoveCallback(opts.unsafeCleanup ? _rmdirRecursiveSync : fs.rmdirSync.bind(fs), name); return opts.keep || _removeObjects.unshift(removeCallback), removeCallback; } function _prepareRemoveCallback(removeFunction, arg) { var called = !1; return function _cleanupCallback(next) { if (!called) { var index = _removeObjects.indexOf(_cleanupCallback); index >= 0 && _removeObjects.splice(index, 1), called = !0, removeFunction(arg); } next && next(null); }; } function _garbageCollector() { if (!_uncaughtException || _gracefulCleanup) for (;_removeObjects.length; ) try { _removeObjects[0].call(null); } catch (e) {} } var version = process.versions.node.split(".").map((function(value) { return parseInt(value, 10); })); 0 === version[0] && (version[1] < 9 || 9 === version[1] && version[2] < 5) && process.addListener("uncaughtException", (function(err) { throw _uncaughtException = !0, _garbageCollector(), err; })), process.addListener("exit", (function(code) { code && (_uncaughtException = !0), _garbageCollector(); })), module.exports.tmpdir = _TMP, module.exports.dir = function(options, callback) { var args = _parseArguments(options, callback), opts = args[0], cb = args[1]; _getTmpName(opts, (function(err, name) { if (err) return cb(err); fs.mkdir(name, opts.mode || 448, (function(err) { if (err) return cb(err); cb(null, name, _prepareTmpDirRemoveCallback(name, opts)); })); })); }, module.exports.dirSync = function(options) { var opts = _parseArguments(options)[0], name = _getTmpNameSync(opts); return fs.mkdirSync(name, opts.mode || 448), { name: name, removeCallback: _prepareTmpDirRemoveCallback(name, opts) }; }, module.exports.file = function(options, callback) { var args = _parseArguments(options, callback), opts = args[0], cb = args[1]; opts.postfix = void 0 === opts.postfix ? ".tmp" : opts.postfix, _getTmpName(opts, (function(err, name) { if (err) return cb(err); fs.open(name, CREATE_FLAGS, opts.mode || 384, (function(err, fd) { return err ? cb(err) : opts.discardDescriptor ? fs.close(fd, (function(err) { if (err) { try { fs.unlinkSync(name); } catch (e) { err = e; } return cb(err); } cb(null, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts)); })) : opts.detachDescriptor ? cb(null, name, fd, _prepareTmpFileRemoveCallback(name, -1, opts)) : void cb(null, name, fd, _prepareTmpFileRemoveCallback(name, fd, opts)); })); })); }, module.exports.fileSync = function(options) { var opts = _parseArguments(options)[0]; opts.postfix = opts.postfix || ".tmp"; var name = _getTmpNameSync(opts), fd = fs.openSync(name, CREATE_FLAGS, opts.mode || 384); return { name: name, fd: fd, removeCallback: _prepareTmpFileRemoveCallback(name, fd, opts) }; }, module.exports.tmpName = _getTmpName, module.exports.tmpNameSync = _getTmpNameSync, module.exports.setGracefulCleanup = function() { _gracefulCleanup = !0; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(NEXT_FILTER) { var util = __webpack_require__(16), getKeys = __webpack_require__(75).keys, tryCatch = util.tryCatch, errorObj = util.errorObj; return function(instances, cb, promise) { return function(e) { var boundTo = promise._boundValue(); predicateLoop: for (var i = 0; i < instances.length; ++i) { var item = instances[i]; if (item === Error || null != item && item.prototype instanceof Error) { if (e instanceof item) return tryCatch(cb).call(boundTo, e); } else if ("function" == typeof item) { var matchesPredicate = tryCatch(item).call(boundTo, e); if (matchesPredicate === errorObj) return matchesPredicate; if (matchesPredicate) return tryCatch(cb).call(boundTo, e); } else if (util.isObject(e)) { for (var keys = getKeys(item), j = 0; j < keys.length; ++j) { var key = keys[j]; if (item[key] != e[key]) continue predicateLoop; } return tryCatch(cb).call(boundTo, e); } } return NEXT_FILTER; }; }; }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(16), maybeWrapAsError = util.maybeWrapAsError, OperationalError = __webpack_require__(60).OperationalError, es5 = __webpack_require__(75), rErrorKey = /^(?:name|message|stack|cause)$/; function wrapAsOperationalError(obj) { var ret; if ((function(obj) { return obj instanceof Error && es5.getPrototypeOf(obj) === Error.prototype; })(obj)) { (ret = new OperationalError(obj)).name = obj.name, ret.message = obj.message, ret.stack = obj.stack; for (var keys = es5.keys(obj), i = 0; i < keys.length; ++i) { var key = keys[i]; rErrorKey.test(key) || (ret[key] = obj[key]); } return ret; } return util.markAsOriginatingFromRejection(obj), obj; } module.exports = function(promise, multiArgs) { return function(err, value) { if (null !== promise) { if (err) { var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); promise._attachExtraTrace(wrapped), promise._reject(wrapped); } else if (multiArgs) { for (var $_len = arguments.length, args = new Array(Math.max($_len - 1, 0)), $_i = 1; $_i < $_len; ++$_i) args[$_i - 1] = arguments[$_i]; promise._fulfill(args); } else promise._fulfill(value); promise = null; } }; }; }, function(module) { module.exports = { name: "node-ssdp-js", version: "0.9.6", description: "A node.js SSDP client and server library", main: "index.js", scripts: { test: "standard --fix" }, repository: { type: "git", url: "git+https://github.com/brandonlehmann/node-ssdp-js.git" }, keywords: [ "SSDP", "client", "server" ], author: "Brandon Lehmann ", license: "MIT", bugs: { url: "https://github.com/brandonlehmann/node-ssdp-js/issues" }, homepage: "https://github.com/brandonlehmann/node-ssdp-js#readme", dependencies: { extend: "^3.0.0", uuid: "^3.0.1" }, devDependencies: { standard: "^8.6.0" } }; }, function(module, exports, __webpack_require__) { var os = __webpack_require__(23); function externalIpv4Address(addr) { return "IPv4" === addr.family && !addr.internal; } function ip2int(ip) { return ip.split(".").reduce((function(r, v) { return 256 * parseInt(r, 10) + parseInt(v, 10); })); } function myAddresses() { var ifaces = process.env.NO_NETWORK_INTERFACES ? [] : os.networkInterfaces(), addresses = []; return Object.keys(ifaces).forEach((function(key) { ifaces[key].filter(externalIpv4Address).forEach((function(addr) { var mask = ip2int(addr.netmask); addresses.push({ address: addr.address, netmask: mask, network: ip2int(addr.address) & mask }); })); })), addresses; } module.exports = { ip2int: ip2int, addresses: myAddresses, addressFor: function(addr) { var searchIp = ip2int(addr), retAddr = myAddresses().find((function(net) { return net.network == (searchIp & net.netmask); })); if (retAddr) return retAddr.address; } }; }, function(module, exports, __webpack_require__) { module.exports = (function() { "use strict"; var Buffer = __webpack_require__(10).Buffer, Long = __webpack_require__(1003), memcpy = null; try { memcpy = __webpack_require__(1004); } catch (e) {} var ByteBuffer = function(capacity, littleEndian, noAssert) { if (void 0 === capacity && (capacity = ByteBuffer.DEFAULT_CAPACITY), void 0 === littleEndian && (littleEndian = ByteBuffer.DEFAULT_ENDIAN), void 0 === noAssert && (noAssert = ByteBuffer.DEFAULT_NOASSERT), !noAssert) { if ((capacity |= 0) < 0) throw RangeError("Illegal capacity"); littleEndian = !!littleEndian, noAssert = !!noAssert; } this.buffer = 0 === capacity ? EMPTY_BUFFER : new Buffer(capacity), this.offset = 0, this.markedOffset = -1, this.limit = capacity, this.littleEndian = void 0 !== littleEndian && !!littleEndian, this.noAssert = !!noAssert; }; ByteBuffer.VERSION = "3.5.5", ByteBuffer.LITTLE_ENDIAN = !0, ByteBuffer.BIG_ENDIAN = !1, ByteBuffer.DEFAULT_CAPACITY = 16, ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN, ByteBuffer.DEFAULT_NOASSERT = !1, ByteBuffer.Long = Long; var ByteBufferPrototype = ByteBuffer.prototype, EMPTY_BUFFER = new Buffer(0), stringFromCharCode = String.fromCharCode; ByteBuffer.allocate = function(capacity, littleEndian, noAssert) { return new ByteBuffer(capacity, littleEndian, noAssert); }, ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) { "boolean" != typeof encoding && "string" == typeof encoding || (noAssert = littleEndian, littleEndian = encoding, encoding = void 0); for (var length, capacity = 0, i = 0, k = buffers.length; i < k; ++i) ByteBuffer.isByteBuffer(buffers[i]) || (buffers[i] = ByteBuffer.wrap(buffers[i], encoding)), (length = buffers[i].limit - buffers[i].offset) > 0 && (capacity += length); if (0 === capacity) return new ByteBuffer(0, littleEndian, noAssert); var bi, bb = new ByteBuffer(capacity, littleEndian, noAssert); for (i = 0; i < k; ) (length = (bi = buffers[i++]).limit - bi.offset) <= 0 || (bi.buffer.copy(bb.buffer, bb.offset, bi.offset, bi.limit), bb.offset += length); return bb.limit = bb.offset, bb.offset = 0, bb; }, ByteBuffer.isByteBuffer = function(bb) { return !0 === (bb && bb instanceof ByteBuffer); }, ByteBuffer.type = function() { return Buffer; }, ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) { if ("string" != typeof encoding && (noAssert = littleEndian, littleEndian = encoding, encoding = void 0), "string" == typeof buffer) switch (void 0 === encoding && (encoding = "utf8"), encoding) { case "base64": return ByteBuffer.fromBase64(buffer, littleEndian); case "hex": return ByteBuffer.fromHex(buffer, littleEndian); case "binary": return ByteBuffer.fromBinary(buffer, littleEndian); case "utf8": return ByteBuffer.fromUTF8(buffer, littleEndian); case "debug": return ByteBuffer.fromDebug(buffer, littleEndian); default: throw Error("Unsupported encoding: " + encoding); } if (null === buffer || "object" != typeof buffer) throw TypeError("Illegal buffer"); var bb; if (ByteBuffer.isByteBuffer(buffer)) return (bb = ByteBufferPrototype.clone.call(buffer)).markedOffset = -1, bb; var b, i = 0, k = 0; if (buffer instanceof Uint8Array) { if (b = new Buffer(buffer.length), memcpy) memcpy(b, 0, buffer.buffer, buffer.byteOffset, buffer.byteOffset + buffer.length); else for (i = 0, k = buffer.length; i < k; ++i) b[i] = buffer[i]; buffer = b; } else if (buffer instanceof ArrayBuffer) { if (b = new Buffer(buffer.byteLength), memcpy) memcpy(b, 0, buffer, 0, buffer.byteLength); else for (i = 0, k = (buffer = new Uint8Array(buffer)).length; i < k; ++i) b[i] = buffer[i]; buffer = b; } else if (!(buffer instanceof Buffer)) { if ("[object Array]" !== Object.prototype.toString.call(buffer)) throw TypeError("Illegal buffer"); buffer = new Buffer(buffer); } return bb = new ByteBuffer(0, littleEndian, noAssert), buffer.length > 0 && (bb.buffer = buffer, bb.limit = buffer.length), bb; }, ByteBufferPrototype.writeInt8 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value || value % 1 != 0) throw TypeError("Illegal value: " + value + " (not an integer)"); if (value |= 0, "number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += 1; var capacity0 = this.buffer.length; return offset > capacity0 && this.resize((capacity0 *= 2) > offset ? capacity0 : offset), offset -= 1, this.buffer[offset] = value, relative && (this.offset += 1), this; }, ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8, ByteBufferPrototype.readInt8 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 1 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.length); } var value = this.buffer[offset]; return 128 == (128 & value) && (value = -(255 - value + 1)), relative && (this.offset += 1), value; }, ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8, ByteBufferPrototype.writeUint8 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value || value % 1 != 0) throw TypeError("Illegal value: " + value + " (not an integer)"); if (value >>>= 0, "number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += 1; var capacity1 = this.buffer.length; return offset > capacity1 && this.resize((capacity1 *= 2) > offset ? capacity1 : offset), offset -= 1, this.buffer[offset] = value, relative && (this.offset += 1), this; }, ByteBufferPrototype.readUint8 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 1 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.length); } var value = this.buffer[offset]; return relative && (this.offset += 1), value; }, ByteBufferPrototype.writeInt16 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value || value % 1 != 0) throw TypeError("Illegal value: " + value + " (not an integer)"); if (value |= 0, "number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += 2; var capacity2 = this.buffer.length; return offset > capacity2 && this.resize((capacity2 *= 2) > offset ? capacity2 : offset), offset -= 2, this.littleEndian ? (this.buffer[offset + 1] = (65280 & value) >>> 8, this.buffer[offset] = 255 & value) : (this.buffer[offset] = (65280 & value) >>> 8, this.buffer[offset + 1] = 255 & value), relative && (this.offset += 2), this; }, ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16, ByteBufferPrototype.readInt16 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 2 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+2) <= " + this.buffer.length); } var value = 0; return this.littleEndian ? (value = this.buffer[offset], value |= this.buffer[offset + 1] << 8) : (value = this.buffer[offset] << 8, value |= this.buffer[offset + 1]), 32768 == (32768 & value) && (value = -(65535 - value + 1)), relative && (this.offset += 2), value; }, ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16, ByteBufferPrototype.writeUint16 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value || value % 1 != 0) throw TypeError("Illegal value: " + value + " (not an integer)"); if (value >>>= 0, "number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += 2; var capacity3 = this.buffer.length; return offset > capacity3 && this.resize((capacity3 *= 2) > offset ? capacity3 : offset), offset -= 2, this.littleEndian ? (this.buffer[offset + 1] = (65280 & value) >>> 8, this.buffer[offset] = 255 & value) : (this.buffer[offset] = (65280 & value) >>> 8, this.buffer[offset + 1] = 255 & value), relative && (this.offset += 2), this; }, ByteBufferPrototype.readUint16 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 2 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+2) <= " + this.buffer.length); } var value = 0; return this.littleEndian ? (value = this.buffer[offset], value |= this.buffer[offset + 1] << 8) : (value = this.buffer[offset] << 8, value |= this.buffer[offset + 1]), relative && (this.offset += 2), value; }, ByteBufferPrototype.writeInt32 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value || value % 1 != 0) throw TypeError("Illegal value: " + value + " (not an integer)"); if (value |= 0, "number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += 4; var capacity4 = this.buffer.length; return offset > capacity4 && this.resize((capacity4 *= 2) > offset ? capacity4 : offset), offset -= 4, this.littleEndian ? (this.buffer[offset + 3] = value >>> 24 & 255, this.buffer[offset + 2] = value >>> 16 & 255, this.buffer[offset + 1] = value >>> 8 & 255, this.buffer[offset] = 255 & value) : (this.buffer[offset] = value >>> 24 & 255, this.buffer[offset + 1] = value >>> 16 & 255, this.buffer[offset + 2] = value >>> 8 & 255, this.buffer[offset + 3] = 255 & value), relative && (this.offset += 4), this; }, ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32, ByteBufferPrototype.readInt32 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 4 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+4) <= " + this.buffer.length); } var value = 0; return this.littleEndian ? (value = this.buffer[offset + 2] << 16, value |= this.buffer[offset + 1] << 8, value |= this.buffer[offset], value += this.buffer[offset + 3] << 24 >>> 0) : (value = this.buffer[offset + 1] << 16, value |= this.buffer[offset + 2] << 8, value |= this.buffer[offset + 3], value += this.buffer[offset] << 24 >>> 0), value |= 0, relative && (this.offset += 4), value; }, ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32, ByteBufferPrototype.writeUint32 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value || value % 1 != 0) throw TypeError("Illegal value: " + value + " (not an integer)"); if (value >>>= 0, "number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += 4; var capacity5 = this.buffer.length; return offset > capacity5 && this.resize((capacity5 *= 2) > offset ? capacity5 : offset), offset -= 4, this.littleEndian ? (this.buffer[offset + 3] = value >>> 24 & 255, this.buffer[offset + 2] = value >>> 16 & 255, this.buffer[offset + 1] = value >>> 8 & 255, this.buffer[offset] = 255 & value) : (this.buffer[offset] = value >>> 24 & 255, this.buffer[offset + 1] = value >>> 16 & 255, this.buffer[offset + 2] = value >>> 8 & 255, this.buffer[offset + 3] = 255 & value), relative && (this.offset += 4), this; }, ByteBufferPrototype.readUint32 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 4 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+4) <= " + this.buffer.length); } var value = 0; return this.littleEndian ? (value = this.buffer[offset + 2] << 16, value |= this.buffer[offset + 1] << 8, value |= this.buffer[offset], value += this.buffer[offset + 3] << 24 >>> 0) : (value = this.buffer[offset + 1] << 16, value |= this.buffer[offset + 2] << 8, value |= this.buffer[offset + 3], value += this.buffer[offset] << 24 >>> 0), relative && (this.offset += 4), value; }, Long && (ByteBufferPrototype.writeInt64 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" == typeof value) value = Long.fromNumber(value); else if ("string" == typeof value) value = Long.fromString(value); else if (!(value && value instanceof Long)) throw TypeError("Illegal value: " + value + " (not an integer or Long)"); if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } "number" == typeof value ? value = Long.fromNumber(value) : "string" == typeof value && (value = Long.fromString(value)), offset += 8; var capacity6 = this.buffer.length; offset > capacity6 && this.resize((capacity6 *= 2) > offset ? capacity6 : offset), offset -= 8; var lo = value.low, hi = value.high; return this.littleEndian ? (this.buffer[offset + 3] = lo >>> 24 & 255, this.buffer[offset + 2] = lo >>> 16 & 255, this.buffer[offset + 1] = lo >>> 8 & 255, this.buffer[offset] = 255 & lo, offset += 4, this.buffer[offset + 3] = hi >>> 24 & 255, this.buffer[offset + 2] = hi >>> 16 & 255, this.buffer[offset + 1] = hi >>> 8 & 255, this.buffer[offset] = 255 & hi) : (this.buffer[offset] = hi >>> 24 & 255, this.buffer[offset + 1] = hi >>> 16 & 255, this.buffer[offset + 2] = hi >>> 8 & 255, this.buffer[offset + 3] = 255 & hi, offset += 4, this.buffer[offset] = lo >>> 24 & 255, this.buffer[offset + 1] = lo >>> 16 & 255, this.buffer[offset + 2] = lo >>> 8 & 255, this.buffer[offset + 3] = 255 & lo), relative && (this.offset += 8), this; }, ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64, ByteBufferPrototype.readInt64 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 8 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+8) <= " + this.buffer.length); } var lo = 0, hi = 0; this.littleEndian ? (lo = this.buffer[offset + 2] << 16, lo |= this.buffer[offset + 1] << 8, lo |= this.buffer[offset], lo += this.buffer[offset + 3] << 24 >>> 0, offset += 4, hi = this.buffer[offset + 2] << 16, hi |= this.buffer[offset + 1] << 8, hi |= this.buffer[offset], hi += this.buffer[offset + 3] << 24 >>> 0) : (hi = this.buffer[offset + 1] << 16, hi |= this.buffer[offset + 2] << 8, hi |= this.buffer[offset + 3], hi += this.buffer[offset] << 24 >>> 0, offset += 4, lo = this.buffer[offset + 1] << 16, lo |= this.buffer[offset + 2] << 8, lo |= this.buffer[offset + 3], lo += this.buffer[offset] << 24 >>> 0); var value = new Long(lo, hi, !1); return relative && (this.offset += 8), value; }, ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64, ByteBufferPrototype.writeUint64 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" == typeof value) value = Long.fromNumber(value); else if ("string" == typeof value) value = Long.fromString(value); else if (!(value && value instanceof Long)) throw TypeError("Illegal value: " + value + " (not an integer or Long)"); if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } "number" == typeof value ? value = Long.fromNumber(value) : "string" == typeof value && (value = Long.fromString(value)), offset += 8; var capacity7 = this.buffer.length; offset > capacity7 && this.resize((capacity7 *= 2) > offset ? capacity7 : offset), offset -= 8; var lo = value.low, hi = value.high; return this.littleEndian ? (this.buffer[offset + 3] = lo >>> 24 & 255, this.buffer[offset + 2] = lo >>> 16 & 255, this.buffer[offset + 1] = lo >>> 8 & 255, this.buffer[offset] = 255 & lo, offset += 4, this.buffer[offset + 3] = hi >>> 24 & 255, this.buffer[offset + 2] = hi >>> 16 & 255, this.buffer[offset + 1] = hi >>> 8 & 255, this.buffer[offset] = 255 & hi) : (this.buffer[offset] = hi >>> 24 & 255, this.buffer[offset + 1] = hi >>> 16 & 255, this.buffer[offset + 2] = hi >>> 8 & 255, this.buffer[offset + 3] = 255 & hi, offset += 4, this.buffer[offset] = lo >>> 24 & 255, this.buffer[offset + 1] = lo >>> 16 & 255, this.buffer[offset + 2] = lo >>> 8 & 255, this.buffer[offset + 3] = 255 & lo), relative && (this.offset += 8), this; }, ByteBufferPrototype.readUint64 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 8 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+8) <= " + this.buffer.length); } var lo = 0, hi = 0; this.littleEndian ? (lo = this.buffer[offset + 2] << 16, lo |= this.buffer[offset + 1] << 8, lo |= this.buffer[offset], lo += this.buffer[offset + 3] << 24 >>> 0, offset += 4, hi = this.buffer[offset + 2] << 16, hi |= this.buffer[offset + 1] << 8, hi |= this.buffer[offset], hi += this.buffer[offset + 3] << 24 >>> 0) : (hi = this.buffer[offset + 1] << 16, hi |= this.buffer[offset + 2] << 8, hi |= this.buffer[offset + 3], hi += this.buffer[offset] << 24 >>> 0, offset += 4, lo = this.buffer[offset + 1] << 16, lo |= this.buffer[offset + 2] << 8, lo |= this.buffer[offset + 3], lo += this.buffer[offset] << 24 >>> 0); var value = new Long(lo, hi, !0); return relative && (this.offset += 8), value; }), ByteBufferPrototype.writeFloat32 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value) throw TypeError("Illegal value: " + value + " (not a number)"); if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += 4; var capacity8 = this.buffer.length; return offset > capacity8 && this.resize((capacity8 *= 2) > offset ? capacity8 : offset), offset -= 4, this.littleEndian ? this.buffer.writeFloatLE(value, offset, !0) : this.buffer.writeFloatBE(value, offset, !0), relative && (this.offset += 4), this; }, ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32, ByteBufferPrototype.readFloat32 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 4 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+4) <= " + this.buffer.length); } var value = this.littleEndian ? this.buffer.readFloatLE(offset, !0) : this.buffer.readFloatBE(offset, !0); return relative && (this.offset += 4), value; }, ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32, ByteBufferPrototype.writeFloat64 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value) throw TypeError("Illegal value: " + value + " (not a number)"); if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += 8; var capacity9 = this.buffer.length; return offset > capacity9 && this.resize((capacity9 *= 2) > offset ? capacity9 : offset), offset -= 8, this.littleEndian ? this.buffer.writeDoubleLE(value, offset, !0) : this.buffer.writeDoubleBE(value, offset, !0), relative && (this.offset += 8), this; }, ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64, ByteBufferPrototype.readFloat64 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 8 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+8) <= " + this.buffer.length); } var value = this.littleEndian ? this.buffer.readDoubleLE(offset, !0) : this.buffer.readDoubleBE(offset, !0); return relative && (this.offset += 8), value; }, ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64, ByteBuffer.MAX_VARINT32_BYTES = 5, ByteBuffer.calculateVarint32 = function(value) { return (value >>>= 0) < 128 ? 1 : value < 16384 ? 2 : value < 1 << 21 ? 3 : value < 1 << 28 ? 4 : 5; }, ByteBuffer.zigZagEncode32 = function(n) { return ((n |= 0) << 1 ^ n >> 31) >>> 0; }, ByteBuffer.zigZagDecode32 = function(n) { return n >>> 1 ^ -(1 & n) | 0; }, ByteBufferPrototype.writeVarint32 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof value || value % 1 != 0) throw TypeError("Illegal value: " + value + " (not an integer)"); if (value |= 0, "number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } var b, size = ByteBuffer.calculateVarint32(value); offset += size; var capacity10 = this.buffer.length; return offset > capacity10 && this.resize((capacity10 *= 2) > offset ? capacity10 : offset), offset -= size, this.buffer[offset] = b = 128 | value, (value >>>= 0) >= 128 ? (b = value >> 7 | 128, this.buffer[offset + 1] = b, value >= 16384 ? (b = value >> 14 | 128, this.buffer[offset + 2] = b, value >= 1 << 21 ? (b = value >> 21 | 128, this.buffer[offset + 3] = b, value >= 1 << 28 ? (this.buffer[offset + 4] = value >> 28 & 15, size = 5) : (this.buffer[offset + 3] = 127 & b, size = 4)) : (this.buffer[offset + 2] = 127 & b, size = 3)) : (this.buffer[offset + 1] = 127 & b, size = 2)) : (this.buffer[offset] = 127 & b, size = 1), relative ? (this.offset += size, this) : size; }, ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) { return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset); }, ByteBufferPrototype.readVarint32 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 1 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.length); } var temp, ioffset, size = 0, value = 0; do { if (ioffset = offset + size, !this.noAssert && ioffset > this.limit) { var err = Error("Truncated"); throw err.truncated = !0, err; } temp = this.buffer[ioffset], size < 5 && (value |= (127 & temp) << 7 * size >>> 0), ++size; } while (128 == (128 & temp)); return value |= 0, relative ? (this.offset += size, value) : { value: value, length: size }; }, ByteBufferPrototype.readVarint32ZigZag = function(offset) { var val = this.readVarint32(offset); return "object" == typeof val ? val.value = ByteBuffer.zigZagDecode32(val.value) : val = ByteBuffer.zigZagDecode32(val), val; }, Long && (ByteBuffer.MAX_VARINT64_BYTES = 10, ByteBuffer.calculateVarint64 = function(value) { "number" == typeof value ? value = Long.fromNumber(value) : "string" == typeof value && (value = Long.fromString(value)); var part0 = value.toInt() >>> 0, part1 = value.shiftRightUnsigned(28).toInt() >>> 0, part2 = value.shiftRightUnsigned(56).toInt() >>> 0; return 0 == part2 ? 0 == part1 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 1 << 21 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 1 << 21 ? 7 : 8 : part2 < 128 ? 9 : 10; }, ByteBuffer.zigZagEncode64 = function(value) { return "number" == typeof value ? value = Long.fromNumber(value, !1) : "string" == typeof value ? value = Long.fromString(value, !1) : !1 !== value.unsigned && (value = value.toSigned()), value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned(); }, ByteBuffer.zigZagDecode64 = function(value) { return "number" == typeof value ? value = Long.fromNumber(value, !1) : "string" == typeof value ? value = Long.fromString(value, !1) : !1 !== value.unsigned && (value = value.toSigned()), value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned(); }, ByteBufferPrototype.writeVarint64 = function(value, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" == typeof value) value = Long.fromNumber(value); else if ("string" == typeof value) value = Long.fromString(value); else if (!(value && value instanceof Long)) throw TypeError("Illegal value: " + value + " (not an integer or Long)"); if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } "number" == typeof value ? value = Long.fromNumber(value, !1) : "string" == typeof value ? value = Long.fromString(value, !1) : !1 !== value.unsigned && (value = value.toSigned()); var size = ByteBuffer.calculateVarint64(value), part0 = value.toInt() >>> 0, part1 = value.shiftRightUnsigned(28).toInt() >>> 0, part2 = value.shiftRightUnsigned(56).toInt() >>> 0; offset += size; var capacity11 = this.buffer.length; switch (offset > capacity11 && this.resize((capacity11 *= 2) > offset ? capacity11 : offset), offset -= size, size) { case 10: this.buffer[offset + 9] = part2 >>> 7 & 1; case 9: this.buffer[offset + 8] = 9 !== size ? 128 | part2 : 127 & part2; case 8: this.buffer[offset + 7] = 8 !== size ? part1 >>> 21 | 128 : part1 >>> 21 & 127; case 7: this.buffer[offset + 6] = 7 !== size ? part1 >>> 14 | 128 : part1 >>> 14 & 127; case 6: this.buffer[offset + 5] = 6 !== size ? part1 >>> 7 | 128 : part1 >>> 7 & 127; case 5: this.buffer[offset + 4] = 5 !== size ? 128 | part1 : 127 & part1; case 4: this.buffer[offset + 3] = 4 !== size ? part0 >>> 21 | 128 : part0 >>> 21 & 127; case 3: this.buffer[offset + 2] = 3 !== size ? part0 >>> 14 | 128 : part0 >>> 14 & 127; case 2: this.buffer[offset + 1] = 2 !== size ? part0 >>> 7 | 128 : part0 >>> 7 & 127; case 1: this.buffer[offset] = 1 !== size ? 128 | part0 : 127 & part0; } return relative ? (this.offset += size, this) : size; }, ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) { return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset); }, ByteBufferPrototype.readVarint64 = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 1 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.length); } var start = offset, part0 = 0, part1 = 0, part2 = 0, b = 0; if (part0 = 127 & (b = this.buffer[offset++]), 128 & b && (part0 |= (127 & (b = this.buffer[offset++])) << 7, (128 & b || this.noAssert && void 0 === b) && (part0 |= (127 & (b = this.buffer[offset++])) << 14, (128 & b || this.noAssert && void 0 === b) && (part0 |= (127 & (b = this.buffer[offset++])) << 21, (128 & b || this.noAssert && void 0 === b) && (part1 = 127 & (b = this.buffer[offset++]), (128 & b || this.noAssert && void 0 === b) && (part1 |= (127 & (b = this.buffer[offset++])) << 7, (128 & b || this.noAssert && void 0 === b) && (part1 |= (127 & (b = this.buffer[offset++])) << 14, (128 & b || this.noAssert && void 0 === b) && (part1 |= (127 & (b = this.buffer[offset++])) << 21, (128 & b || this.noAssert && void 0 === b) && (part2 = 127 & (b = this.buffer[offset++]), (128 & b || this.noAssert && void 0 === b) && (part2 |= (127 & (b = this.buffer[offset++])) << 7, 128 & b || this.noAssert && void 0 === b)))))))))) throw Error("Buffer overrun"); var value = Long.fromBits(part0 | part1 << 28, part1 >>> 4 | part2 << 24, !1); return relative ? (this.offset = offset, value) : { value: value, length: offset - start }; }, ByteBufferPrototype.readVarint64ZigZag = function(offset) { var val = this.readVarint64(offset); return val && val.value instanceof Long ? val.value = ByteBuffer.zigZagDecode64(val.value) : val = ByteBuffer.zigZagDecode64(val), val; }), ByteBufferPrototype.writeCString = function(str, offset) { var relative = void 0 === offset; relative && (offset = this.offset); var i, k = str.length; if (!this.noAssert) { if ("string" != typeof str) throw TypeError("Illegal str: Not a string"); for (i = 0; i < k; ++i) if (0 === str.charCodeAt(i)) throw RangeError("Illegal str: Contains NULL-characters"); if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += (k = Buffer.byteLength(str, "utf8")) + 1; var capacity12 = this.buffer.length; return offset > capacity12 && this.resize((capacity12 *= 2) > offset ? capacity12 : offset), offset -= k + 1, offset += this.buffer.write(str, offset, k, "utf8"), this.buffer[offset++] = 0, relative ? (this.offset = offset, this) : k; }, ByteBufferPrototype.readCString = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 1 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.length); } var temp, start = offset; do { if (offset >= this.buffer.length) throw RangeError("Index out of range: " + offset + " <= " + this.buffer.length); temp = this.buffer[offset++]; } while (0 !== temp); var str = this.buffer.toString("utf8", start, offset - 1); return relative ? (this.offset = offset, str) : { string: str, length: offset - start }; }, ByteBufferPrototype.writeIString = function(str, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("string" != typeof str) throw TypeError("Illegal str: Not a string"); if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } var k, start = offset; offset += 4 + (k = Buffer.byteLength(str, "utf8")); var capacity13 = this.buffer.length; return offset > capacity13 && this.resize((capacity13 *= 2) > offset ? capacity13 : offset), offset -= 4 + k, this.littleEndian ? (this.buffer[offset + 3] = k >>> 24 & 255, this.buffer[offset + 2] = k >>> 16 & 255, this.buffer[offset + 1] = k >>> 8 & 255, this.buffer[offset] = 255 & k) : (this.buffer[offset] = k >>> 24 & 255, this.buffer[offset + 1] = k >>> 16 & 255, this.buffer[offset + 2] = k >>> 8 & 255, this.buffer[offset + 3] = 255 & k), offset += 4, offset += this.buffer.write(str, offset, k, "utf8"), relative ? (this.offset = offset, this) : offset - start; }, ByteBufferPrototype.readIString = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 4 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+4) <= " + this.buffer.length); } var str, temp = 0, start = offset; if (this.littleEndian ? (temp = this.buffer[offset + 2] << 16, temp |= this.buffer[offset + 1] << 8, temp |= this.buffer[offset], temp += this.buffer[offset + 3] << 24 >>> 0) : (temp = this.buffer[offset + 1] << 16, temp |= this.buffer[offset + 2] << 8, temp |= this.buffer[offset + 3], temp += this.buffer[offset] << 24 >>> 0), (offset += 4) + temp > this.buffer.length) throw RangeError("Index out of bounds: " + offset + " + " + temp + " <= " + this.buffer.length); return str = this.buffer.toString("utf8", offset, offset + temp), offset += temp, relative ? (this.offset = offset, str) : { string: str, length: offset - start }; }, ByteBuffer.METRICS_CHARS = "c", ByteBuffer.METRICS_BYTES = "b", ByteBufferPrototype.writeUTF8String = function(str, offset) { var k, relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } offset += k = Buffer.byteLength(str, "utf8"); var capacity14 = this.buffer.length; return offset > capacity14 && this.resize((capacity14 *= 2) > offset ? capacity14 : offset), offset -= k, offset += this.buffer.write(str, offset, k, "utf8"), relative ? (this.offset = offset, this) : k; }, ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String, ByteBuffer.calculateUTF8Chars = function(str) { return utfx.calculateUTF16asUTF8((s = str, i = 0, function() { return i < s.length ? s.charCodeAt(i++) : null; }))[0]; var s, i; }, ByteBuffer.calculateUTF8Bytes = function(str) { if ("string" != typeof str) throw TypeError("Illegal argument: " + typeof str); return Buffer.byteLength(str, "utf8"); }, ByteBufferPrototype.readUTF8String = function(length, metrics, offset) { "number" == typeof metrics && (offset = metrics, metrics = void 0); var relative = void 0 === offset; if (relative && (offset = this.offset), void 0 === metrics && (metrics = ByteBuffer.METRICS_CHARS), !this.noAssert) { if ("number" != typeof length || length % 1 != 0) throw TypeError("Illegal length: " + length + " (not an integer)"); if (length |= 0, "number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } var temp, sd, cs, ps, i = 0, start = offset; if (metrics === ByteBuffer.METRICS_CHARS) { if (cs = [], ps = [], sd = function() { if (0 === arguments.length) return ps.join("") + stringFromCharCode.apply(String, cs); cs.length + arguments.length > 1024 && (ps.push(stringFromCharCode.apply(String, cs)), cs.length = 0), Array.prototype.push.apply(cs, arguments); }, utfx.decodeUTF8(function() { return i < length && offset < this.limit ? this.buffer[offset++] : null; }.bind(this), function(cp) { ++i, utfx.UTF8toUTF16(cp, sd); }.bind(this)), i !== length) throw RangeError("Illegal range: Truncated data, " + i + " == " + length); return relative ? (this.offset = offset, sd()) : { string: sd(), length: offset - start }; } if (metrics === ByteBuffer.METRICS_BYTES) { if (!this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + length > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+" + length + ") <= " + this.buffer.length); } return temp = this.buffer.toString("utf8", offset, offset + length), relative ? (this.offset += length, temp) : { string: temp, length: length }; } throw TypeError("Unsupported metrics: " + metrics); }, ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String, ByteBufferPrototype.writeVString = function(str, offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("string" != typeof str) throw TypeError("Illegal str: Not a string"); if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } var k, l, start = offset; k = Buffer.byteLength(str, "utf8"), offset += (l = ByteBuffer.calculateVarint32(k)) + k; var capacity15 = this.buffer.length; return offset > capacity15 && this.resize((capacity15 *= 2) > offset ? capacity15 : offset), offset -= l + k, offset += this.writeVarint32(k, offset), offset += this.buffer.write(str, offset, k, "utf8"), relative ? (this.offset = offset, this) : offset - start; }, ByteBufferPrototype.readVString = function(offset) { var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 1 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.length); } var str, temp = this.readVarint32(offset), start = offset; if ((offset += temp.length) + (temp = temp.value) > this.buffer.length) throw RangeError("Index out of bounds: " + offset + " + " + val.value + " <= " + this.buffer.length); return str = this.buffer.toString("utf8", offset, offset + temp), offset += temp, relative ? (this.offset = offset, str) : { string: str, length: offset - start }; }, ByteBufferPrototype.append = function(source, encoding, offset) { "number" != typeof encoding && "string" == typeof encoding || (offset = encoding, encoding = void 0); var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } source instanceof ByteBuffer || (source = ByteBuffer.wrap(source, encoding)); var length = source.limit - source.offset; if (length <= 0) return this; offset += length; var capacity16 = this.buffer.length; return offset > capacity16 && this.resize((capacity16 *= 2) > offset ? capacity16 : offset), offset -= length, source.buffer.copy(this.buffer, offset, source.offset, source.limit), source.offset += length, relative && (this.offset += length), this; }, ByteBufferPrototype.appendTo = function(target, offset) { return target.append(this, offset), this; }, ByteBufferPrototype.assert = function(assert) { return this.noAssert = !assert, this; }, ByteBufferPrototype.capacity = function() { return this.buffer.length; }, ByteBufferPrototype.clear = function() { return this.offset = 0, this.limit = this.buffer.length, this.markedOffset = -1, this; }, ByteBufferPrototype.clone = function(copy) { var bb = new ByteBuffer(0, this.littleEndian, this.noAssert); if (copy) { var buffer = new Buffer(this.buffer.length); this.buffer.copy(buffer), bb.buffer = buffer; } else bb.buffer = this.buffer; return bb.offset = this.offset, bb.markedOffset = this.markedOffset, bb.limit = this.limit, bb; }, ByteBufferPrototype.compact = function(begin, end) { if (void 0 === begin && (begin = this.offset), void 0 === end && (end = this.limit), !this.noAssert) { if ("number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } if (0 === begin && end === this.buffer.length) return this; var len = end - begin; if (0 === len) return this.buffer = EMPTY_BUFFER, this.markedOffset >= 0 && (this.markedOffset -= begin), this.offset = 0, this.limit = 0, this; var buffer = new Buffer(len); return this.buffer.copy(buffer, 0, begin, end), this.buffer = buffer, this.markedOffset >= 0 && (this.markedOffset -= begin), this.offset = 0, this.limit = len, this; }, ByteBufferPrototype.copy = function(begin, end) { if (void 0 === begin && (begin = this.offset), void 0 === end && (end = this.limit), !this.noAssert) { if ("number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } if (begin === end) return new ByteBuffer(0, this.littleEndian, this.noAssert); var capacity = end - begin, bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert); return bb.offset = 0, bb.limit = capacity, bb.markedOffset >= 0 && (bb.markedOffset -= begin), this.copyTo(bb, 0, begin, end), bb; }, ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) { var relative, targetRelative; if (!this.noAssert && !ByteBuffer.isByteBuffer(target)) throw TypeError("Illegal target: Not a ByteBuffer"); if (targetOffset = (targetRelative = void 0 === targetOffset) ? target.offset : 0 | targetOffset, sourceOffset = (relative = void 0 === sourceOffset) ? this.offset : 0 | sourceOffset, sourceLimit = void 0 === sourceLimit ? this.limit : 0 | sourceLimit, targetOffset < 0 || targetOffset > target.buffer.length) throw RangeError("Illegal target range: 0 <= " + targetOffset + " <= " + target.buffer.length); if (sourceOffset < 0 || sourceLimit > this.buffer.length) throw RangeError("Illegal source range: 0 <= " + sourceOffset + " <= " + this.buffer.length); var len = sourceLimit - sourceOffset; return 0 === len ? target : (target.ensureCapacity(targetOffset + len), this.buffer.copy(target.buffer, targetOffset, sourceOffset, sourceLimit), relative && (this.offset += len), targetRelative && (target.offset += len), this); }, ByteBufferPrototype.ensureCapacity = function(capacity) { var current = this.buffer.length; return current < capacity ? this.resize((current *= 2) > capacity ? current : capacity) : this; }, ByteBufferPrototype.fill = function(value, begin, end) { var relative = void 0 === begin; if (relative && (begin = this.offset), "string" == typeof value && value.length > 0 && (value = value.charCodeAt(0)), void 0 === begin && (begin = this.offset), void 0 === end && (end = this.limit), !this.noAssert) { if ("number" != typeof value || value % 1 != 0) throw TypeError("Illegal value: " + value + " (not an integer)"); if (value |= 0, "number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } return begin >= end || (this.buffer.fill(value, begin, end), begin = end, relative && (this.offset = begin)), this; }, ByteBufferPrototype.flip = function() { return this.limit = this.offset, this.offset = 0, this; }, ByteBufferPrototype.mark = function(offset) { if (offset = void 0 === offset ? this.offset : offset, !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } return this.markedOffset = offset, this; }, ByteBufferPrototype.order = function(littleEndian) { if (!this.noAssert && "boolean" != typeof littleEndian) throw TypeError("Illegal littleEndian: Not a boolean"); return this.littleEndian = !!littleEndian, this; }, ByteBufferPrototype.LE = function(littleEndian) { return this.littleEndian = void 0 === littleEndian || !!littleEndian, this; }, ByteBufferPrototype.BE = function(bigEndian) { return this.littleEndian = void 0 !== bigEndian && !bigEndian, this; }, ByteBufferPrototype.prepend = function(source, encoding, offset) { "number" != typeof encoding && "string" == typeof encoding || (offset = encoding, encoding = void 0); var relative = void 0 === offset; if (relative && (offset = this.offset), !this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: " + offset + " (not an integer)"); if ((offset >>>= 0) < 0 || offset + 0 > this.buffer.length) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.length); } source instanceof ByteBuffer || (source = ByteBuffer.wrap(source, encoding)); var len = source.limit - source.offset; if (len <= 0) return this; var diff = len - offset; if (diff > 0) { var buffer = new Buffer(this.buffer.length + diff); this.buffer.copy(buffer, len, offset, this.buffer.length), this.buffer = buffer, this.offset += diff, this.markedOffset >= 0 && (this.markedOffset += diff), this.limit += diff, offset += diff; } return source.buffer.copy(this.buffer, offset - len, source.offset, source.limit), source.offset = source.limit, relative && (this.offset -= len), this; }, ByteBufferPrototype.prependTo = function(target, offset) { return target.prepend(this, offset), this; }, ByteBufferPrototype.printDebug = function(out) { "function" != typeof out && (out = console.log.bind(console)), out(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0)); }, ByteBufferPrototype.remaining = function() { return this.limit - this.offset; }, ByteBufferPrototype.reset = function() { return this.markedOffset >= 0 ? (this.offset = this.markedOffset, this.markedOffset = -1) : this.offset = 0, this; }, ByteBufferPrototype.resize = function(capacity) { if (!this.noAssert) { if ("number" != typeof capacity || capacity % 1 != 0) throw TypeError("Illegal capacity: " + capacity + " (not an integer)"); if ((capacity |= 0) < 0) throw RangeError("Illegal capacity: 0 <= " + capacity); } if (this.buffer.length < capacity) { var buffer = new Buffer(capacity); this.buffer.copy(buffer), this.buffer = buffer; } return this; }, ByteBufferPrototype.reverse = function(begin, end) { if (void 0 === begin && (begin = this.offset), void 0 === end && (end = this.limit), !this.noAssert) { if ("number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } return begin === end || Array.prototype.reverse.call(this.buffer.slice(begin, end)), this; }, ByteBufferPrototype.skip = function(length) { if (!this.noAssert) { if ("number" != typeof length || length % 1 != 0) throw TypeError("Illegal length: " + length + " (not an integer)"); length |= 0; } var offset = this.offset + length; if (!this.noAssert && (offset < 0 || offset > this.buffer.length)) throw RangeError("Illegal length: 0 <= " + this.offset + " + " + length + " <= " + this.buffer.length); return this.offset = offset, this; }, ByteBufferPrototype.slice = function(begin, end) { if (void 0 === begin && (begin = this.offset), void 0 === end && (end = this.limit), !this.noAssert) { if ("number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } var bb = this.clone(); return bb.offset = begin, bb.limit = end, bb; }, ByteBufferPrototype.toBuffer = function(forceCopy) { var offset = this.offset, limit = this.limit; if (offset > limit) { var t = offset; offset = limit, limit = t; } if (!this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: Not an integer"); if (offset >>>= 0, "number" != typeof limit || limit % 1 != 0) throw TypeError("Illegal limit: Not an integer"); if (limit >>>= 0, offset < 0 || offset > limit || limit > this.buffer.length) throw RangeError("Illegal range: 0 <= " + offset + " <= " + limit + " <= " + this.buffer.length); } if (forceCopy) { var buffer = new Buffer(limit - offset); return this.buffer.copy(buffer, 0, offset, limit), buffer; } return 0 === offset && limit === this.buffer.length ? this.buffer : this.buffer.slice(offset, limit); }, ByteBufferPrototype.toArrayBuffer = function() { var offset = this.offset, limit = this.limit; if (offset > limit) { var t = offset; offset = limit, limit = t; } if (!this.noAssert) { if ("number" != typeof offset || offset % 1 != 0) throw TypeError("Illegal offset: Not an integer"); if (offset >>>= 0, "number" != typeof limit || limit % 1 != 0) throw TypeError("Illegal limit: Not an integer"); if (limit >>>= 0, offset < 0 || offset > limit || limit > this.buffer.length) throw RangeError("Illegal range: 0 <= " + offset + " <= " + limit + " <= " + this.buffer.length); } var ab = new ArrayBuffer(limit - offset); if (memcpy) memcpy(ab, 0, this.buffer, offset, limit); else for (var dst = new Uint8Array(ab), i = offset; i < limit; ++i) dst[i - offset] = this.buffer[i]; return ab; }, ByteBufferPrototype.toString = function(encoding, begin, end) { if (void 0 === encoding) return "ByteBufferNB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")"; switch ("number" == typeof encoding && (end = begin = encoding = "utf8"), encoding) { case "utf8": return this.toUTF8(begin, end); case "base64": return this.toBase64(begin, end); case "hex": return this.toHex(begin, end); case "binary": return this.toBinary(begin, end); case "debug": return this.toDebug(); case "columns": return this.toColumns(); default: throw Error("Unsupported encoding: " + encoding); } }, ByteBufferPrototype.toBase64 = function(begin, end) { if (void 0 === begin && (begin = this.offset), void 0 === end && (end = this.limit), !this.noAssert) { if ("number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } return this.buffer.toString("base64", begin, end); }, ByteBuffer.fromBase64 = function(str, littleEndian, noAssert) { if (!noAssert) { if ("string" != typeof str) throw TypeError("Illegal str: Not a string"); if (str.length % 4 != 0) throw TypeError("Illegal str: Length not a multiple of 4"); } var bb = new ByteBuffer(0, littleEndian, noAssert); return bb.buffer = new Buffer(str, "base64"), bb.limit = bb.buffer.length, bb; }, ByteBuffer.btoa = function(str) { return ByteBuffer.fromBinary(str).toBase64(); }, ByteBuffer.atob = function(b64) { return ByteBuffer.fromBase64(b64).toBinary(); }, ByteBufferPrototype.toBinary = function(begin, end) { if (begin = void 0 === begin ? this.offset : begin, end = void 0 === end ? this.limit : end, !this.noAssert) { if ("number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } return this.buffer.toString("binary", begin, end); }, ByteBuffer.fromBinary = function(str, littleEndian, noAssert) { if (!noAssert && "string" != typeof str) throw TypeError("Illegal str: Not a string"); var bb = new ByteBuffer(0, littleEndian, noAssert); return bb.buffer = new Buffer(str, "binary"), bb.limit = bb.buffer.length, bb; }, ByteBufferPrototype.toDebug = function(columns) { for (var b, i = -1, k = this.buffer.length, hex = "", asc = "", out = ""; i < k; ) { if (-1 !== i && (hex += (b = this.buffer[i]) < 16 ? "0" + b.toString(16).toUpperCase() : b.toString(16).toUpperCase(), columns && (asc += b > 32 && b < 127 ? String.fromCharCode(b) : ".")), ++i, columns && i > 0 && i % 16 == 0 && i !== k) { for (;hex.length < 51; ) hex += " "; out += hex + asc + "\n", hex = asc = ""; } i === this.offset && i === this.limit ? hex += i === this.markedOffset ? "!" : "|" : i === this.offset ? hex += i === this.markedOffset ? "[" : "<" : i === this.limit ? hex += i === this.markedOffset ? "]" : ">" : hex += i === this.markedOffset ? "'" : columns || 0 !== i && i !== k ? " " : ""; } if (columns && " " !== hex) { for (;hex.length < 51; ) hex += " "; out += hex + asc + "\n"; } return columns ? out : hex; }, ByteBuffer.fromDebug = function(str, littleEndian, noAssert) { for (var ch, b, k = str.length, bb = new ByteBuffer((k + 1) / 3 | 0, littleEndian, noAssert), i = 0, j = 0, rs = !1, ho = !1, hm = !1, hl = !1, fail = !1; i < k; ) { switch (ch = str.charAt(i++)) { case "!": if (!noAssert) { if (ho || hm || hl) { fail = !0; break; } ho = hm = hl = !0; } bb.offset = bb.markedOffset = bb.limit = j, rs = !1; break; case "|": if (!noAssert) { if (ho || hl) { fail = !0; break; } ho = hl = !0; } bb.offset = bb.limit = j, rs = !1; break; case "[": if (!noAssert) { if (ho || hm) { fail = !0; break; } ho = hm = !0; } bb.offset = bb.markedOffset = j, rs = !1; break; case "<": if (!noAssert) { if (ho) { fail = !0; break; } ho = !0; } bb.offset = j, rs = !1; break; case "]": if (!noAssert) { if (hl || hm) { fail = !0; break; } hl = hm = !0; } bb.limit = bb.markedOffset = j, rs = !1; break; case ">": if (!noAssert) { if (hl) { fail = !0; break; } hl = !0; } bb.limit = j, rs = !1; break; case "'": if (!noAssert) { if (hm) { fail = !0; break; } hm = !0; } bb.markedOffset = j, rs = !1; break; case " ": rs = !1; break; default: if (!noAssert && rs) { fail = !0; break; } if (b = parseInt(ch + str.charAt(i++), 16), !noAssert && (isNaN(b) || b < 0 || b > 255)) throw TypeError("Illegal str: Not a debug encoded string"); bb.buffer[j++] = b, rs = !0; } if (fail) throw TypeError("Illegal str: Invalid symbol at " + i); } if (!noAssert) { if (!ho || !hl) throw TypeError("Illegal str: Missing offset or limit"); if (j < bb.buffer.length) throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + j + " < " + k); } return bb; }, ByteBufferPrototype.toHex = function(begin, end) { if (begin = void 0 === begin ? this.offset : begin, end = void 0 === end ? this.limit : end, !this.noAssert) { if ("number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } return this.buffer.toString("hex", begin, end); }, ByteBuffer.fromHex = function(str, littleEndian, noAssert) { if (!noAssert) { if ("string" != typeof str) throw TypeError("Illegal str: Not a string"); if (str.length % 2 != 0) throw TypeError("Illegal str: Length not a multiple of 2"); } var bb = new ByteBuffer(0, littleEndian, !0); return bb.buffer = new Buffer(str, "hex"), bb.limit = bb.buffer.length, bb; }; var utfx = (function() { var utfx = { MAX_CODEPOINT: 1114111, encodeUTF8: function(src, dst) { var cp = null; for ("number" == typeof src && (cp = src, src = function() { return null; }); null !== cp || null !== (cp = src()); ) cp < 128 ? dst(127 & cp) : cp < 2048 ? (dst(cp >> 6 & 31 | 192), dst(63 & cp | 128)) : cp < 65536 ? (dst(cp >> 12 & 15 | 224), dst(cp >> 6 & 63 | 128), dst(63 & cp | 128)) : (dst(cp >> 18 & 7 | 240), dst(cp >> 12 & 63 | 128), dst(cp >> 6 & 63 | 128), dst(63 & cp | 128)), cp = null; }, decodeUTF8: function(src, dst) { for (var a, b, c, d, fail = function(b) { b = b.slice(0, b.indexOf(null)); var err = Error(b.toString()); throw err.name = "TruncatedError", err.bytes = b, err; }; null !== (a = src()); ) if (0 == (128 & a)) dst(a); else if (192 == (224 & a)) null === (b = src()) && fail([ a, b ]), dst((31 & a) << 6 | 63 & b); else if (224 == (240 & a)) (null === (b = src()) || null === (c = src())) && fail([ a, b, c ]), dst((15 & a) << 12 | (63 & b) << 6 | 63 & c); else { if (240 != (248 & a)) throw RangeError("Illegal starting byte: " + a); (null === (b = src()) || null === (c = src()) || null === (d = src())) && fail([ a, b, c, d ]), dst((7 & a) << 18 | (63 & b) << 12 | (63 & c) << 6 | 63 & d); } }, UTF16toUTF8: function(src, dst) { for (var c1, c2 = null; null !== (c1 = null !== c2 ? c2 : src()); ) c1 >= 55296 && c1 <= 57343 && null !== (c2 = src()) && c2 >= 56320 && c2 <= 57343 ? (dst(1024 * (c1 - 55296) + c2 - 56320 + 65536), c2 = null) : dst(c1); null !== c2 && dst(c2); }, UTF8toUTF16: function(src, dst) { var cp = null; for ("number" == typeof src && (cp = src, src = function() { return null; }); null !== cp || null !== (cp = src()); ) cp <= 65535 ? dst(cp) : (dst(55296 + ((cp -= 65536) >> 10)), dst(cp % 1024 + 56320)), cp = null; }, encodeUTF16toUTF8: function(src, dst) { utfx.UTF16toUTF8(src, (function(cp) { utfx.encodeUTF8(cp, dst); })); }, decodeUTF8toUTF16: function(src, dst) { utfx.decodeUTF8(src, (function(cp) { utfx.UTF8toUTF16(cp, dst); })); }, calculateCodePoint: function(cp) { return cp < 128 ? 1 : cp < 2048 ? 2 : cp < 65536 ? 3 : 4; }, calculateUTF8: function(src) { for (var cp, l = 0; null !== (cp = src()); ) l += utfx.calculateCodePoint(cp); return l; }, calculateUTF16asUTF8: function(src) { var n = 0, l = 0; return utfx.UTF16toUTF8(src, (function(cp) { ++n, l += utfx.calculateCodePoint(cp); })), [ n, l ]; } }; return utfx; })(); return ByteBufferPrototype.toUTF8 = function(begin, end) { if (void 0 === begin && (begin = this.offset), void 0 === end && (end = this.limit), !this.noAssert) { if ("number" != typeof begin || begin % 1 != 0) throw TypeError("Illegal begin: Not an integer"); if (begin >>>= 0, "number" != typeof end || end % 1 != 0) throw TypeError("Illegal end: Not an integer"); if (end >>>= 0, begin < 0 || begin > end || end > this.buffer.length) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.length); } return this.buffer.toString("utf8", begin, end); }, ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) { if (!noAssert && "string" != typeof str) throw TypeError("Illegal str: Not a string"); var bb = new ByteBuffer(0, littleEndian, noAssert); return bb.buffer = new Buffer(str, "utf8"), bb.limit = bb.buffer.length, bb; }, ByteBuffer.memcpy = memcpy, ByteBuffer; })(); }, function(module, exports, __webpack_require__) { var EventEmitter = __webpack_require__(4).EventEmitter; function PacketStreamWrapper(stream) { EventEmitter.call(this), this.stream = stream; var state = 0, packetLength = 0, self = this; this.stream.on("readable", (function() { for (;;) switch (state) { case 0: var header = stream.read(4); if (null === header) return; packetLength = header.readUInt32BE(0), state = 1; break; case 1: var packet = stream.read(packetLength); if (null === packet) return; self.emit("packet", packet), state = 0; } })); } (0, __webpack_require__(0).inherits)(PacketStreamWrapper, EventEmitter), PacketStreamWrapper.prototype.send = function(buf) { var header = new Buffer(4); header.writeUInt32BE(buf.length, 0), this.stream.write(Buffer.concat([ header, buf ])); }, module.exports = PacketStreamWrapper; }, function(module, exports, __webpack_require__) { "use strict"; var myIp = __webpack_require__(479), url = __webpack_require__(7), querystring = __webpack_require__(24); function Player() { this.mediaStatus = { audio: [], audioTrack: null, volume: 100, time: 0, paused: !1, state: 5, length: 0, source: null, subtitlesSrc: null, subtitlesDelay: 0, subtitlesSize: 2 }, this.states = { NothingSpecial: 0, Opening: 1, Buffering: 2, Playing: 3, Paused: 4, Stopped: 5, Ended: 6, Error: 7 }; } Player._shallowCopyParams = function(params, source, param) { void 0 !== source[param] && (params[param] = source[param]); }, Player.handleError = function(result) { return console.log("Handle Cast Error", result.message ? result.message : result), result.message; }, Player.returnJSON = function(res, obj) { res.setHeader("Content-Type", "application/json; charset=utf8"), res.end(JSON.stringify(obj || {})); }, Player.prototype.setEndpoint = function(req, path) { var protocol = "http", port = ":" + req.socket.localPort; req.socket.encrypted ? (protocol += "s", 443 == req.socket.localPort && (port = "")) : 80 == req.socket.localPort && (port = ""), this.endpoint = protocol + "://" + myIp.addressFor(this.device.host) + port, void 0 !== path && (this.endpoint += req.baseUrl + path); }, Player.prototype.__call = function(method, args) { return args = args.slice(0, 3), this[method].apply(this, args); }, Player.prototype.methodInvoke = function(method, args, res) { return this.init().then(this.__call.bind(this, method, args)).catch(Player.handleError).then(Player.returnJSON.bind(null, res)); }, Player.prototype.middleware = function(req, res, next) { var segments = url.parse(req.url), query = querystring.parse((segments.search || "").slice(1)), params = {}; Object.keys(query).forEach(Player._shallowCopyParams.bind(null, params, query)), Object.keys(req.body).forEach(Player._shallowCopyParams.bind(null, params, req.body)), Object.keys(params).forEach(Player._shallowCopyParams.bind(null, this.mediaStatus, params)); var method = "status", args = {}; function isset(v) { return void 0 !== v; } if (isset(params.formats) && (method = "protocolsGet"), isset(params.audioTrack) && (args[method = "audioTrack"] = params.audioTrack), isset(params.volume) && (args[method = "volume"] = params.volume), isset(params.time) && (args[method = "seek"] = params.time), (isset(params.subtitlesSrc) || isset(params.subtitlesDelay) || isset(params.subtitlesSize)) && (args[method = "subtitles"] = [ this.mediaStatus.subtitlesSrc, this.mediaStatus.subtitlesDelay, { fontSize: parseInt(this.mediaStatus.subtitlesSize, 10) + 1 + "vw" } ]), isset(params.source) && (params.source ? args[method = "play"] = params.source : method = "close"), isset(params.stop) && (method = "stop"), isset(params.paused)) switch (params.paused) { case "": case "0": case "false": case 0: case !1: method = "resume"; break; default: method = "pause"; } method ? this.methodInvoke(method, [].concat(args[method]), res) : next("Unknown Method"); }, module.exports = Player; }, function(module, exports) { exports.items = function(hash, ignored) { ignored = ignored || null; var k, key, rv = []; for (k in hash) !hash.hasOwnProperty(k) || (key = ignored, ignored && 0 !== ignored.length && ignored.indexOf(key)) || rv.push([ k, hash[k] ]); return rv; }, exports.findall = function(re, str) { for (var match, matches = []; match = re.exec(str); ) matches.push(match); return matches; }, exports.merge = function(a, b) { var attrname, c = {}; for (attrname in a) a.hasOwnProperty(attrname) && (c[attrname] = a[attrname]); for (attrname in b) b.hasOwnProperty(attrname) && (c[attrname] = b[attrname]); return c; }; }, function(module, exports, __webpack_require__) { function TreeBuilder(element_factory) { this._data = [], this._elem = [], this._last = null, this._tail = null, element_factory || (element_factory = __webpack_require__(238).Element), this._factory = element_factory; } TreeBuilder.prototype.close = function() { return this._last; }, TreeBuilder.prototype._flush = function() { if (this._data) { if (null !== this._last) { var text = this._data.join(""); this._tail ? this._last.tail = text : this._last.text = text; } this._data = []; } }, TreeBuilder.prototype.data = function(data) { this._data.push(data); }, TreeBuilder.prototype.start = function(tag, attrs) { this._flush(); var elem = this._factory(tag, attrs); this._last = elem, this._elem.length && this._elem[this._elem.length - 1].append(elem), this._elem.push(elem), this._tail = null; }, TreeBuilder.prototype.end = function(tag) { if (this._flush(), this._last = this._elem.pop(), this._last.tag !== tag) throw new Error("end tag mismatch"); return this._tail = 1, this._last; }, exports.TreeBuilder = TreeBuilder; }, function(module, exports, __webpack_require__) { "use strict"; var pna = __webpack_require__(58); module.exports = Readable; var Duplex, isArray = __webpack_require__(426); Readable.ReadableState = ReadableState, __webpack_require__(4).EventEmitter; var EElistenerCount = function(emitter, type) { return emitter.listeners(type).length; }, Stream = __webpack_require__(486), Buffer = __webpack_require__(26).Buffer, OurUint8Array = global.Uint8Array || function() {}, util = __webpack_require__(33); util.inherits = __webpack_require__(8); var debugUtil = __webpack_require__(0), debug = void 0; debug = debugUtil && debugUtil.debuglog ? debugUtil.debuglog("stream") : function() {}; var StringDecoder, BufferList = __webpack_require__(1019), destroyImpl = __webpack_require__(487); util.inherits(Readable, Stream); var kProxyEvents = [ "error", "close", "destroy", "pause", "resume" ]; function ReadableState(options, stream) { options = options || {}; var isDuplex = stream instanceof (Duplex = Duplex || __webpack_require__(89)); this.objectMode = !!options.objectMode, isDuplex && (this.objectMode = this.objectMode || !!options.readableObjectMode); var hwm = options.highWaterMark, readableHwm = options.readableHighWaterMark, defaultHwm = this.objectMode ? 16 : 16384; this.highWaterMark = hwm || 0 === hwm ? hwm : isDuplex && (readableHwm || 0 === readableHwm) ? readableHwm : defaultHwm, this.highWaterMark = Math.floor(this.highWaterMark), this.buffer = new BufferList, this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.destroyed = !1, this.defaultEncoding = options.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, options.encoding && (StringDecoder || (StringDecoder = __webpack_require__(155).StringDecoder), this.decoder = new StringDecoder(options.encoding), this.encoding = options.encoding); } function Readable(options) { if (Duplex = Duplex || __webpack_require__(89), !(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this), this.readable = !0, options && ("function" == typeof options.read && (this._read = options.read), "function" == typeof options.destroy && (this._destroy = options.destroy)), Stream.call(this); } function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { var er, state = stream._readableState; return null === chunk ? (state.reading = !1, (function(stream, state) { if (!state.ended) { if (state.decoder) { var chunk = state.decoder.end(); chunk && chunk.length && (state.buffer.push(chunk), state.length += state.objectMode ? 1 : chunk.length); } state.ended = !0, emitReadable(stream); } })(stream, state)) : (skipChunkCheck || (er = (function(state, chunk) { var er, obj; return obj = chunk, Buffer.isBuffer(obj) || obj instanceof OurUint8Array || "string" == typeof chunk || void 0 === chunk || state.objectMode || (er = new TypeError("Invalid non-string/buffer chunk")), er; })(state, chunk)), er ? stream.emit("error", er) : state.objectMode || chunk && chunk.length > 0 ? ("string" == typeof chunk || state.objectMode || Object.getPrototypeOf(chunk) === Buffer.prototype || (chunk = (function(chunk) { return Buffer.from(chunk); })(chunk)), addToFront ? state.endEmitted ? stream.emit("error", new Error("stream.unshift() after end event")) : addChunk(stream, state, chunk, !0) : state.ended ? stream.emit("error", new Error("stream.push() after EOF")) : (state.reading = !1, state.decoder && !encoding ? (chunk = state.decoder.write(chunk), state.objectMode || 0 !== chunk.length ? addChunk(stream, state, chunk, !1) : maybeReadMore(stream, state)) : addChunk(stream, state, chunk, !1))) : addToFront || (state.reading = !1)), (function(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || 0 === state.length); })(state); } function addChunk(stream, state, chunk, addToFront) { state.flowing && 0 === state.length && !state.sync ? (stream.emit("data", chunk), stream.read(0)) : (state.length += state.objectMode ? 1 : chunk.length, addToFront ? state.buffer.unshift(chunk) : state.buffer.push(chunk), state.needReadable && emitReadable(stream)), maybeReadMore(stream, state); } function howMuchToRead(n, state) { return n <= 0 || 0 === state.length && state.ended ? 0 : state.objectMode ? 1 : n != n ? state.flowing && state.length ? state.buffer.head.data.length : state.length : (n > state.highWaterMark && (state.highWaterMark = (function(n) { return n >= 8388608 ? n = 8388608 : (n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++), n; })(n)), n <= state.length ? n : state.ended ? state.length : (state.needReadable = !0, 0)); } function emitReadable(stream) { var state = stream._readableState; state.needReadable = !1, state.emittedReadable || (debug("emitReadable", state.flowing), state.emittedReadable = !0, state.sync ? pna.nextTick(emitReadable_, stream) : emitReadable_(stream)); } function emitReadable_(stream) { debug("emit readable"), stream.emit("readable"), flow(stream); } function maybeReadMore(stream, state) { state.readingMore || (state.readingMore = !0, pna.nextTick(maybeReadMore_, stream, state)); } function maybeReadMore_(stream, state) { for (var len = state.length; !state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark && (debug("maybeReadMore read 0"), stream.read(0), len !== state.length); ) len = state.length; state.readingMore = !1; } function nReadingNextTick(self) { debug("readable nexttick read 0"), self.read(0); } function resume_(stream, state) { state.reading || (debug("resume read 0"), stream.read(0)), state.resumeScheduled = !1, state.awaitDrain = 0, stream.emit("resume"), flow(stream), state.flowing && !state.reading && stream.read(0); } function flow(stream) { var state = stream._readableState; for (debug("flow", state.flowing); state.flowing && null !== stream.read(); ) ; } function fromList(n, state) { return 0 === state.length ? null : (state.objectMode ? ret = state.buffer.shift() : !n || n >= state.length ? (ret = state.decoder ? state.buffer.join("") : 1 === state.buffer.length ? state.buffer.head.data : state.buffer.concat(state.length), state.buffer.clear()) : ret = (function(n, list, hasStrings) { var ret; return n < list.head.data.length ? (ret = list.head.data.slice(0, n), list.head.data = list.head.data.slice(n)) : ret = n === list.head.data.length ? list.shift() : hasStrings ? (function(n, list) { var p = list.head, c = 1, ret = p.data; for (n -= ret.length; p = p.next; ) { var str = p.data, nb = n > str.length ? str.length : n; if (nb === str.length ? ret += str : ret += str.slice(0, n), 0 == (n -= nb)) { nb === str.length ? (++c, p.next ? list.head = p.next : list.head = list.tail = null) : (list.head = p, p.data = str.slice(nb)); break; } ++c; } return list.length -= c, ret; })(n, list) : (function(n, list) { var ret = Buffer.allocUnsafe(n), p = list.head, c = 1; for (p.data.copy(ret), n -= p.data.length; p = p.next; ) { var buf = p.data, nb = n > buf.length ? buf.length : n; if (buf.copy(ret, ret.length - n, 0, nb), 0 == (n -= nb)) { nb === buf.length ? (++c, p.next ? list.head = p.next : list.head = list.tail = null) : (list.head = p, p.data = buf.slice(nb)); break; } ++c; } return list.length -= c, ret; })(n, list), ret; })(n, state.buffer, state.decoder), ret); var ret; } function endReadable(stream) { var state = stream._readableState; if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); state.endEmitted || (state.ended = !0, pna.nextTick(endReadableNT, state, stream)); } function endReadableNT(state, stream) { state.endEmitted || 0 !== state.length || (state.endEmitted = !0, stream.readable = !1, stream.emit("end")); } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i; return -1; } Object.defineProperty(Readable.prototype, "destroyed", { get: function() { return void 0 !== this._readableState && this._readableState.destroyed; }, set: function(value) { this._readableState && (this._readableState.destroyed = value); } }), Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) { this.push(null), cb(err); }, Readable.prototype.push = function(chunk, encoding) { var skipChunkCheck, state = this._readableState; return state.objectMode ? skipChunkCheck = !0 : "string" == typeof chunk && ((encoding = encoding || state.defaultEncoding) !== state.encoding && (chunk = Buffer.from(chunk, encoding), encoding = ""), skipChunkCheck = !0), readableAddChunk(this, chunk, encoding, !1, skipChunkCheck); }, Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, !0, !1); }, Readable.prototype.isPaused = function() { return !1 === this._readableState.flowing; }, Readable.prototype.setEncoding = function(enc) { return StringDecoder || (StringDecoder = __webpack_require__(155).StringDecoder), this._readableState.decoder = new StringDecoder(enc), this._readableState.encoding = enc, this; }, Readable.prototype.read = function(n) { debug("read", n), n = parseInt(n, 10); var state = this._readableState, nOrig = n; if (0 !== n && (state.emittedReadable = !1), 0 === n && state.needReadable && (state.length >= state.highWaterMark || state.ended)) return debug("read: emitReadable", state.length, state.ended), 0 === state.length && state.ended ? endReadable(this) : emitReadable(this), null; if (0 === (n = howMuchToRead(n, state)) && state.ended) return 0 === state.length && endReadable(this), null; var ret, doRead = state.needReadable; return debug("need readable", doRead), (0 === state.length || state.length - n < state.highWaterMark) && debug("length less than watermark", doRead = !0), state.ended || state.reading ? debug("reading or ended", doRead = !1) : doRead && (debug("do read"), state.reading = !0, state.sync = !0, 0 === state.length && (state.needReadable = !0), this._read(state.highWaterMark), state.sync = !1, state.reading || (n = howMuchToRead(nOrig, state))), null === (ret = n > 0 ? fromList(n, state) : null) ? (state.needReadable = !0, n = 0) : state.length -= n, 0 === state.length && (state.ended || (state.needReadable = !0), nOrig !== n && state.ended && endReadable(this)), null !== ret && this.emit("data", ret), ret; }, Readable.prototype._read = function(n) { this.emit("error", new Error("_read() is not implemented")); }, Readable.prototype.pipe = function(dest, pipeOpts) { var src = this, state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [ state.pipes, dest ]; break; default: state.pipes.push(dest); } state.pipesCount += 1, debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); var endFn = pipeOpts && !1 === pipeOpts.end || dest === process.stdout || dest === process.stderr ? unpipe : onend; function onend() { debug("onend"), dest.end(); } state.endEmitted ? pna.nextTick(endFn) : src.once("end", endFn), dest.on("unpipe", (function onunpipe(readable, unpipeInfo) { debug("onunpipe"), readable === src && unpipeInfo && !1 === unpipeInfo.hasUnpiped && (unpipeInfo.hasUnpiped = !0, debug("cleanup"), dest.removeListener("close", onclose), dest.removeListener("finish", onfinish), dest.removeListener("drain", ondrain), dest.removeListener("error", onerror), dest.removeListener("unpipe", onunpipe), src.removeListener("end", onend), src.removeListener("end", unpipe), src.removeListener("data", ondata), cleanedUp = !0, !state.awaitDrain || dest._writableState && !dest._writableState.needDrain || ondrain()); })); var ondrain = (function(src) { return function() { var state = src._readableState; debug("pipeOnDrain", state.awaitDrain), state.awaitDrain && state.awaitDrain--, 0 === state.awaitDrain && EElistenerCount(src, "data") && (state.flowing = !0, flow(src)); }; })(src); dest.on("drain", ondrain); var cleanedUp = !1, increasedAwaitDrain = !1; function ondata(chunk) { debug("ondata"), increasedAwaitDrain = !1, !1 !== dest.write(chunk) || increasedAwaitDrain || ((1 === state.pipesCount && state.pipes === dest || state.pipesCount > 1 && -1 !== indexOf(state.pipes, dest)) && !cleanedUp && (debug("false write response, pause", src._readableState.awaitDrain), src._readableState.awaitDrain++, increasedAwaitDrain = !0), src.pause()); } function onerror(er) { debug("onerror", er), unpipe(), dest.removeListener("error", onerror), 0 === EElistenerCount(dest, "error") && dest.emit("error", er); } function onclose() { dest.removeListener("finish", onfinish), unpipe(); } function onfinish() { debug("onfinish"), dest.removeListener("close", onclose), unpipe(); } function unpipe() { debug("unpipe"), src.unpipe(dest); } return src.on("data", ondata), (function(emitter, event, fn) { if ("function" == typeof emitter.prependListener) return emitter.prependListener("error", fn); emitter._events && emitter._events.error ? isArray(emitter._events.error) ? emitter._events.error.unshift(fn) : emitter._events.error = [ fn, emitter._events.error ] : emitter.on("error", fn); })(dest, 0, onerror), dest.once("close", onclose), dest.once("finish", onfinish), dest.emit("pipe", src), state.flowing || (debug("pipe resume"), src.resume()), dest; }, Readable.prototype.unpipe = function(dest) { var state = this._readableState, unpipeInfo = { hasUnpiped: !1 }; if (0 === state.pipesCount) return this; if (1 === state.pipesCount) return dest && dest !== state.pipes || (dest || (dest = state.pipes), state.pipes = null, state.pipesCount = 0, state.flowing = !1, dest && dest.emit("unpipe", this, unpipeInfo)), this; if (!dest) { var dests = state.pipes, len = state.pipesCount; state.pipes = null, state.pipesCount = 0, state.flowing = !1; for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, unpipeInfo); return this; } var index = indexOf(state.pipes, dest); return -1 === index || (state.pipes.splice(index, 1), state.pipesCount -= 1, 1 === state.pipesCount && (state.pipes = state.pipes[0]), dest.emit("unpipe", this, unpipeInfo)), this; }, Readable.prototype.on = function(ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if ("data" === ev) !1 !== this._readableState.flowing && this.resume(); else if ("readable" === ev) { var state = this._readableState; state.endEmitted || state.readableListening || (state.readableListening = state.needReadable = !0, state.emittedReadable = !1, state.reading ? state.length && emitReadable(this) : pna.nextTick(nReadingNextTick, this)); } return res; }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.resume = function() { var state = this._readableState; return state.flowing || (debug("resume"), state.flowing = !0, (function(stream, state) { state.resumeScheduled || (state.resumeScheduled = !0, pna.nextTick(resume_, stream, state)); })(this, state)), this; }, Readable.prototype.pause = function() { return debug("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (debug("pause"), this._readableState.flowing = !1, this.emit("pause")), this; }, Readable.prototype.wrap = function(stream) { var _this = this, state = this._readableState, paused = !1; for (var i in stream.on("end", (function() { if (debug("wrapped end"), state.decoder && !state.ended) { var chunk = state.decoder.end(); chunk && chunk.length && _this.push(chunk); } _this.push(null); })), stream.on("data", (function(chunk) { debug("wrapped data"), state.decoder && (chunk = state.decoder.write(chunk)), state.objectMode && null == chunk || (state.objectMode || chunk && chunk.length) && (_this.push(chunk) || (paused = !0, stream.pause())); })), stream) void 0 === this[i] && "function" == typeof stream[i] && (this[i] = (function(method) { return function() { return stream[method].apply(stream, arguments); }; })(i)); for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); return this._read = function(n) { debug("wrapped _read", n), paused && (paused = !1, stream.resume()); }, this; }, Object.defineProperty(Readable.prototype, "readableHighWaterMark", { enumerable: !1, get: function() { return this._readableState.highWaterMark; } }), Readable._fromList = fromList; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(3); }, function(module, exports, __webpack_require__) { "use strict"; var pna = __webpack_require__(58); function emitErrorNT(self, err) { self.emit("error", err); } module.exports = { destroy: function(err, cb) { var _this = this, readableDestroyed = this._readableState && this._readableState.destroyed, writableDestroyed = this._writableState && this._writableState.destroyed; return readableDestroyed || writableDestroyed ? (cb ? cb(err) : !err || this._writableState && this._writableState.errorEmitted || pna.nextTick(emitErrorNT, this, err), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(err || null, (function(err) { !cb && err ? (pna.nextTick(emitErrorNT, _this, err), _this._writableState && (_this._writableState.errorEmitted = !0)) : cb && cb(err); })), this); }, undestroy: function() { this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1); } }; }, function(module, exports, __webpack_require__) { "use strict"; var pna = __webpack_require__(58); function CorkedRequest(state) { var _this = this; this.next = null, this.entry = null, this.finish = function() { !(function(corkReq, state, err) { var entry = corkReq.entry; for (corkReq.entry = null; entry; ) { var cb = entry.callback; state.pendingcb--, cb(undefined), entry = entry.next; } state.corkedRequestsFree ? state.corkedRequestsFree.next = corkReq : state.corkedRequestsFree = corkReq; })(_this, state); }; } module.exports = Writable; var Duplex, asyncWrite = !process.browser && [ "v0.10", "v0.9." ].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; Writable.WritableState = WritableState; var util = __webpack_require__(33); util.inherits = __webpack_require__(8); var realHasInstance, internalUtil = { deprecate: __webpack_require__(201) }, Stream = __webpack_require__(486), Buffer = __webpack_require__(26).Buffer, OurUint8Array = global.Uint8Array || function() {}, destroyImpl = __webpack_require__(487); function nop() {} function WritableState(options, stream) { Duplex = Duplex || __webpack_require__(89), options = options || {}; var isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode, isDuplex && (this.objectMode = this.objectMode || !!options.writableObjectMode); var hwm = options.highWaterMark, writableHwm = options.writableHighWaterMark, defaultHwm = this.objectMode ? 16 : 16384; this.highWaterMark = hwm || 0 === hwm ? hwm : isDuplex && (writableHwm || 0 === writableHwm) ? writableHwm : defaultHwm, this.highWaterMark = Math.floor(this.highWaterMark), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1; var noDecode = !1 === options.decodeStrings; this.decodeStrings = !noDecode, this.defaultEncoding = options.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(er) { !(function(stream, er) { var state = stream._writableState, sync = state.sync, cb = state.writecb; if ((function(state) { state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0; })(state), er) !(function(stream, state, sync, er, cb) { --state.pendingcb, sync ? (pna.nextTick(cb, er), pna.nextTick(finishMaybe, stream, state), stream._writableState.errorEmitted = !0, stream.emit("error", er)) : (cb(er), stream._writableState.errorEmitted = !0, stream.emit("error", er), finishMaybe(stream, state)); })(stream, state, sync, er, cb); else { var finished = needFinish(state); finished || state.corked || state.bufferProcessing || !state.bufferedRequest || clearBuffer(stream, state), sync ? asyncWrite(afterWrite, stream, state, finished, cb) : afterWrite(stream, state, finished, cb); } })(stream, er); }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new CorkedRequest(this); } function Writable(options) { if (Duplex = Duplex || __webpack_require__(89), !(realHasInstance.call(Writable, this) || this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this), this.writable = !0, options && ("function" == typeof options.write && (this._write = options.write), "function" == typeof options.writev && (this._writev = options.writev), "function" == typeof options.destroy && (this._destroy = options.destroy), "function" == typeof options.final && (this._final = options.final)), Stream.call(this); } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, writev ? stream._writev(chunk, state.onwrite) : stream._write(chunk, encoding, state.onwrite), state.sync = !1; } function afterWrite(stream, state, finished, cb) { finished || (function(stream, state) { 0 === state.length && state.needDrain && (state.needDrain = !1, stream.emit("drain")); })(stream, state), state.pendingcb--, cb(), finishMaybe(stream, state); } function clearBuffer(stream, state) { state.bufferProcessing = !0; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { var l = state.bufferedRequestCount, buffer = new Array(l), holder = state.corkedRequestsFree; holder.entry = entry; for (var count = 0, allBuffers = !0; entry; ) buffer[count] = entry, entry.isBuf || (allBuffers = !1), entry = entry.next, count += 1; buffer.allBuffers = allBuffers, doWrite(stream, state, !0, state.length, buffer, "", holder.finish), state.pendingcb++, state.lastBufferedRequest = null, holder.next ? (state.corkedRequestsFree = holder.next, holder.next = null) : state.corkedRequestsFree = new CorkedRequest(state), state.bufferedRequestCount = 0; } else { for (;entry; ) { var chunk = entry.chunk, encoding = entry.encoding, cb = entry.callback; if (doWrite(stream, state, !1, state.objectMode ? 1 : chunk.length, chunk, encoding, cb), entry = entry.next, state.bufferedRequestCount--, state.writing) break; } null === entry && (state.lastBufferedRequest = null); } state.bufferedRequest = entry, state.bufferProcessing = !1; } function needFinish(state) { return state.ending && 0 === state.length && null === state.bufferedRequest && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final((function(err) { state.pendingcb--, err && stream.emit("error", err), state.prefinished = !0, stream.emit("prefinish"), finishMaybe(stream, state); })); } function finishMaybe(stream, state) { var need = needFinish(state); return need && ((function(stream, state) { state.prefinished || state.finalCalled || ("function" == typeof stream._final ? (state.pendingcb++, state.finalCalled = !0, pna.nextTick(callFinal, stream, state)) : (state.prefinished = !0, stream.emit("prefinish"))); })(stream, state), 0 === state.pendingcb && (state.finished = !0, stream.emit("finish"))), need; } util.inherits(Writable, Stream), WritableState.prototype.getBuffer = function() { for (var current = this.bufferedRequest, out = []; current; ) out.push(current), current = current.next; return out; }, (function() { try { Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate((function() { return this.getBuffer(); }), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch (_) {} })(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (realHasInstance = Function.prototype[Symbol.hasInstance], Object.defineProperty(Writable, Symbol.hasInstance, { value: function(object) { return !!realHasInstance.call(this, object) || this === Writable && object && object._writableState instanceof WritableState; } })) : realHasInstance = function(object) { return object instanceof this; }, Writable.prototype.pipe = function() { this.emit("error", new Error("Cannot pipe, not readable")); }, Writable.prototype.write = function(chunk, encoding, cb) { var obj, state = this._writableState, ret = !1, isBuf = !state.objectMode && (obj = chunk, Buffer.isBuffer(obj) || obj instanceof OurUint8Array); return isBuf && !Buffer.isBuffer(chunk) && (chunk = (function(chunk) { return Buffer.from(chunk); })(chunk)), "function" == typeof encoding && (cb = encoding, encoding = null), isBuf ? encoding = "buffer" : encoding || (encoding = state.defaultEncoding), "function" != typeof cb && (cb = nop), state.ended ? (function(stream, cb) { var er = new Error("write after end"); stream.emit("error", er), pna.nextTick(cb, er); })(this, cb) : (isBuf || (function(stream, state, chunk, cb) { var valid = !0, er = !1; return null === chunk ? er = new TypeError("May not write null values to stream") : "string" == typeof chunk || void 0 === chunk || state.objectMode || (er = new TypeError("Invalid non-string/buffer chunk")), er && (stream.emit("error", er), pna.nextTick(cb, er), valid = !1), valid; })(this, state, chunk, cb)) && (state.pendingcb++, ret = (function(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = (function(state, chunk, encoding) { return state.objectMode || !1 === state.decodeStrings || "string" != typeof chunk || (chunk = Buffer.from(chunk, encoding)), chunk; })(state, chunk, encoding); chunk !== newChunk && (isBuf = !0, encoding = "buffer", chunk = newChunk); } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; if (ret || (state.needDrain = !0), state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }, last ? last.next = state.lastBufferedRequest : state.bufferedRequest = state.lastBufferedRequest, state.bufferedRequestCount += 1; } else doWrite(stream, state, !1, len, chunk, encoding, cb); return ret; })(this, state, isBuf, chunk, encoding, cb)), ret; }, Writable.prototype.cork = function() { this._writableState.corked++; }, Writable.prototype.uncork = function() { var state = this._writableState; state.corked && (state.corked--, state.writing || state.corked || state.finished || state.bufferProcessing || !state.bufferedRequest || clearBuffer(this, state)); }, Writable.prototype.setDefaultEncoding = function(encoding) { if ("string" == typeof encoding && (encoding = encoding.toLowerCase()), !([ "hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw" ].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding); return this._writableState.defaultEncoding = encoding, this; }, Object.defineProperty(Writable.prototype, "writableHighWaterMark", { enumerable: !1, get: function() { return this._writableState.highWaterMark; } }), Writable.prototype._write = function(chunk, encoding, cb) { cb(new Error("_write() is not implemented")); }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; "function" == typeof chunk ? (cb = chunk, chunk = null, encoding = null) : "function" == typeof encoding && (cb = encoding, encoding = null), null != chunk && this.write(chunk, encoding), state.corked && (state.corked = 1, this.uncork()), state.ending || state.finished || (function(stream, state, cb) { state.ending = !0, finishMaybe(stream, state), cb && (state.finished ? pna.nextTick(cb) : stream.once("finish", cb)), state.ended = !0, stream.writable = !1; })(this, state, cb); }, Object.defineProperty(Writable.prototype, "destroyed", { get: function() { return void 0 !== this._writableState && this._writableState.destroyed; }, set: function(value) { this._writableState && (this._writableState.destroyed = value); } }), Writable.prototype.destroy = destroyImpl.destroy, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) { this.end(), cb(err); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = Transform; var Duplex = __webpack_require__(89), util = __webpack_require__(33); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = !1; var cb = ts.writecb; if (!cb) return this.emit("error", new Error("write callback called multiple times")); ts.writechunk = null, ts.writecb = null, null != data && this.push(data), cb(er); var rs = this._readableState; rs.reading = !1, (rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark); } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options), this._transformState = { afterTransform: afterTransform.bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = !0, this._readableState.sync = !1, options && ("function" == typeof options.transform && (this._transform = options.transform), "function" == typeof options.flush && (this._flush = options.flush)), this.on("prefinish", prefinish); } function prefinish() { var _this = this; "function" == typeof this._flush ? this._flush((function(er, data) { done(_this, er, data); })) : done(this, null, null); } function done(stream, er, data) { if (er) return stream.emit("error", er); if (null != data && stream.push(data), stream._writableState.length) throw new Error("Calling transform done when ws.length != 0"); if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming"); return stream.push(null); } util.inherits = __webpack_require__(8), util.inherits(Transform, Duplex), Transform.prototype.push = function(chunk, encoding) { return this._transformState.needTransform = !1, Duplex.prototype.push.call(this, chunk, encoding); }, Transform.prototype._transform = function(chunk, encoding, cb) { throw new Error("_transform() is not implemented"); }, Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; if (ts.writecb = cb, ts.writechunk = chunk, ts.writeencoding = encoding, !ts.transforming) { var rs = this._readableState; (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark); } }, Transform.prototype._read = function(n) { var ts = this._transformState; null !== ts.writechunk && ts.writecb && !ts.transforming ? (ts.transforming = !0, this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform)) : ts.needTransform = !0; }, Transform.prototype._destroy = function(err, cb) { var _this2 = this; Duplex.prototype._destroy.call(this, err, (function(err2) { cb(err2), _this2.emit("close"); })); }; }, function(module, exports, __webpack_require__) { "use strict"; var Route = __webpack_require__(491), Layer = __webpack_require__(492), methods = __webpack_require__(68), mixin = __webpack_require__(67), debug = __webpack_require__(9)("express:router"), deprecate = __webpack_require__(51)("express"), flatten = __webpack_require__(159), parseUrl = __webpack_require__(49), setPrototypeOf = __webpack_require__(119), objectRegExp = /^\[object (\S+)\]$/, slice = Array.prototype.slice, toString = Object.prototype.toString, proto = module.exports = function(options) { var opts = options || {}; function router(req, res, next) { router.handle(req, res, next); } return setPrototypeOf(router, proto), router.params = {}, router._params = [], router.caseSensitive = opts.caseSensitive, router.mergeParams = opts.mergeParams, router.strict = opts.strict, router.stack = [], router; }; function appendMethods(list, addition) { for (var i = 0; i < addition.length; i++) { var method = addition[i]; -1 === list.indexOf(method) && list.push(method); } } function gettype(obj) { var type = typeof obj; return "object" !== type ? type : toString.call(obj).replace(objectRegExp, "$1"); } function matchLayer(layer, path) { try { return layer.match(path); } catch (err) { return err; } } proto.param = function(name, fn) { if ("function" == typeof name) return deprecate("router.param(fn): Refactor to use path params"), void this._params.push(name); var ret, params = this._params, len = params.length; ":" === name[0] && (deprecate("router.param(" + JSON.stringify(name) + ", fn): Use router.param(" + JSON.stringify(name.substr(1)) + ", fn) instead"), name = name.substr(1)); for (var i = 0; i < len; ++i) (ret = params[i](name, fn)) && (fn = ret); if ("function" != typeof fn) throw new Error("invalid param() call for " + name + ", got " + fn); return (this.params[name] = this.params[name] || []).push(fn), this; }, proto.handle = function(req, res, out) { var self = this; debug("dispatching %s %s", req.method, req.url); var old, fn, idx = 0, protohost = (function(url) { if ("string" == typeof url && 0 !== url.length && "/" !== url[0]) { var searchIndex = url.indexOf("?"), pathLength = -1 !== searchIndex ? searchIndex : url.length, fqdnIndex = url.substr(0, pathLength).indexOf("://"); return -1 !== fqdnIndex ? url.substr(0, url.indexOf("/", 3 + fqdnIndex)) : void 0; } })(req.url) || "", removed = "", slashAdded = !1, paramcalled = {}, options = [], stack = self.stack, parentParams = req.params, parentUrl = req.baseUrl || "", done = (function(fn, obj) { for (var props = new Array(arguments.length - 2), vals = new Array(arguments.length - 2), i = 0; i < props.length; i++) props[i] = arguments[i + 2], vals[i] = obj[props[i]]; return function() { for (var i = 0; i < props.length; i++) obj[props[i]] = vals[i]; return fn.apply(this, arguments); }; })(out, req, "baseUrl", "next", "params"); function next(err) { var layerError = "route" === err ? null : err; if (slashAdded && (req.url = req.url.substr(1), slashAdded = !1), 0 !== removed.length && (req.baseUrl = parentUrl, req.url = protohost + removed + req.url.substr(protohost.length), removed = ""), "router" !== layerError) if (idx >= stack.length) setImmediate(done, layerError); else { var layer, match, route, path = (function(req) { try { return parseUrl(req).pathname; } catch (err) { return; } })(req); if (null == path) return done(layerError); for (;!0 !== match && idx < stack.length; ) if (match = matchLayer(layer = stack[idx++], path), route = layer.route, "boolean" != typeof match && (layerError = layerError || match), !0 === match && route) if (layerError) match = !1; else { var method = req.method, has_method = route._handles_method(method); has_method || "OPTIONS" !== method || appendMethods(options, route._options()), has_method || "HEAD" === method || (match = !1); } if (!0 !== match) return done(layerError); route && (req.route = route), req.params = self.mergeParams ? (function(params, parent) { if ("object" != typeof parent || !parent) return params; var obj = mixin({}, parent); if (!(0 in params) || !(0 in parent)) return mixin(obj, params); for (var i = 0, o = 0; i in params; ) i++; for (;o in parent; ) o++; for (i--; i >= 0; i--) params[i + o] = params[i], i < o && delete params[i]; return mixin(obj, params); })(layer.params, parentParams) : layer.params; var layerPath = layer.path; self.process_params(layer, paramcalled, req, res, (function(err) { return err ? next(layerError || err) : route ? layer.handle_request(req, res, next) : void (function(layer, layerError, layerPath, path) { if (0 !== layerPath.length) { var c = path[layerPath.length]; if (c && "/" !== c && "." !== c) return next(layerError); debug("trim prefix (%s) from url %s", layerPath, req.url), removed = layerPath, req.url = protohost + req.url.substr(protohost.length + removed.length), protohost || "/" === req.url[0] || (req.url = "/" + req.url, slashAdded = !0), req.baseUrl = parentUrl + ("/" === removed[removed.length - 1] ? removed.substring(0, removed.length - 1) : removed); } debug("%s %s : %s", layer.name, layerPath, req.originalUrl), layerError ? layer.handle_error(layerError, req, res, next) : layer.handle_request(req, res, next); })(layer, layerError, layerPath, path); })); } else setImmediate(done, null); } req.next = next, "OPTIONS" === req.method && (old = done, fn = function(old, err) { if (err || 0 === options.length) return old(err); !(function(res, options, next) { try { var body = options.join(","); res.set("Allow", body), res.send(body); } catch (err) { next(err); } })(res, options, old); }, done = function() { var args = new Array(arguments.length + 1); args[0] = old; for (var i = 0, len = arguments.length; i < len; i++) args[i + 1] = arguments[i]; fn.apply(this, args); }), req.baseUrl = parentUrl, req.originalUrl = req.originalUrl || req.url, next(); }, proto.process_params = function(layer, called, req, res, done) { var params = this.params, keys = layer.keys; if (!keys || 0 === keys.length) return done(); var name, key, paramVal, paramCallbacks, paramCalled, i = 0, paramIndex = 0; function param(err) { return err ? done(err) : i >= keys.length ? done() : (paramIndex = 0, key = keys[i++], name = key.name, paramVal = req.params[name], paramCallbacks = params[name], paramCalled = called[name], void 0 !== paramVal && paramCallbacks ? paramCalled && (paramCalled.match === paramVal || paramCalled.error && "route" !== paramCalled.error) ? (req.params[name] = paramCalled.value, param(paramCalled.error)) : (called[name] = paramCalled = { error: null, match: paramVal, value: paramVal }, void paramCallback()) : param()); } function paramCallback(err) { var fn = paramCallbacks[paramIndex++]; if (paramCalled.value = req.params[key.name], err) return paramCalled.error = err, void param(err); if (!fn) return param(); try { fn(req, res, paramCallback, paramVal, key.name); } catch (e) { paramCallback(e); } } param(); }, proto.use = function(fn) { var offset = 0, path = "/"; if ("function" != typeof fn) { for (var arg = fn; Array.isArray(arg) && 0 !== arg.length; ) arg = arg[0]; "function" != typeof arg && (offset = 1, path = fn); } var callbacks = flatten(slice.call(arguments, offset)); if (0 === callbacks.length) throw new TypeError("Router.use() requires a middleware function"); for (var i = 0; i < callbacks.length; i++) { if ("function" != typeof (fn = callbacks[i])) throw new TypeError("Router.use() requires a middleware function but got a " + gettype(fn)); debug("use %o %s", path, fn.name || ""); var layer = new Layer(path, { sensitive: this.caseSensitive, strict: !1, end: !1 }, fn); layer.route = void 0, this.stack.push(layer); } return this; }, proto.route = function(path) { var route = new Route(path), layer = new Layer(path, { sensitive: this.caseSensitive, strict: this.strict, end: !0 }, route.dispatch.bind(route)); return layer.route = route, this.stack.push(layer), route; }, methods.concat("all").forEach((function(method) { proto[method] = function(path) { var route = this.route(path); return route[method].apply(route, slice.call(arguments, 1)), this; }; })); }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("express:router:route"), flatten = __webpack_require__(159), Layer = __webpack_require__(492), methods = __webpack_require__(68), slice = Array.prototype.slice, toString = Object.prototype.toString; function Route(path) { this.path = path, this.stack = [], debug("new %o", path), this.methods = {}; } module.exports = Route, Route.prototype._handles_method = function(method) { if (this.methods._all) return !0; var name = method.toLowerCase(); return "head" !== name || this.methods.head || (name = "get"), Boolean(this.methods[name]); }, Route.prototype._options = function() { var methods = Object.keys(this.methods); this.methods.get && !this.methods.head && methods.push("head"); for (var i = 0; i < methods.length; i++) methods[i] = methods[i].toUpperCase(); return methods; }, Route.prototype.dispatch = function(req, res, done) { var idx = 0, stack = this.stack; if (0 === stack.length) return done(); var method = req.method.toLowerCase(); "head" !== method || this.methods.head || (method = "get"), req.route = this, (function next(err) { if (err && "route" === err) return done(); if (err && "router" === err) return done(err); var layer = stack[idx++]; return layer ? layer.method && layer.method !== method ? next(err) : void (err ? layer.handle_error(err, req, res, next) : layer.handle_request(req, res, next)) : done(err); })(); }, Route.prototype.all = function() { for (var handles = flatten(slice.call(arguments)), i = 0; i < handles.length; i++) { var handle = handles[i]; if ("function" != typeof handle) { var type = toString.call(handle), msg = "Route.all() requires a callback function but got a " + type; throw new TypeError(msg); } var layer = Layer("/", {}, handle); layer.method = void 0, this.methods._all = !0, this.stack.push(layer); } return this; }, methods.forEach((function(method) { Route.prototype[method] = function() { for (var handles = flatten(slice.call(arguments)), i = 0; i < handles.length; i++) { var handle = handles[i]; if ("function" != typeof handle) { var type = toString.call(handle), msg = "Route." + method + "() requires a callback function but got a " + type; throw new Error(msg); } debug("%s %o", method, this.path); var layer = Layer("/", {}, handle); layer.method = method, this.methods[method] = !0, this.stack.push(layer); } return this; }; })); }, function(module, exports, __webpack_require__) { "use strict"; var pathRegexp = __webpack_require__(178), debug = __webpack_require__(9)("express:router:layer"), hasOwnProperty = Object.prototype.hasOwnProperty; function Layer(path, options, fn) { if (!(this instanceof Layer)) return new Layer(path, options, fn); debug("new %o", path); var opts = options || {}; this.handle = fn, this.name = fn.name || "", this.params = void 0, this.path = void 0, this.regexp = pathRegexp(path, this.keys = [], opts), this.regexp.fast_star = "*" === path, this.regexp.fast_slash = "/" === path && !1 === opts.end; } function decode_param(val) { if ("string" != typeof val || 0 === val.length) return val; try { return decodeURIComponent(val); } catch (err) { throw err instanceof URIError && (err.message = "Failed to decode param '" + val + "'", err.status = err.statusCode = 400), err; } } module.exports = Layer, Layer.prototype.handle_error = function(error, req, res, next) { var fn = this.handle; if (4 !== fn.length) return next(error); try { fn(error, req, res, next); } catch (err) { next(err); } }, Layer.prototype.handle_request = function(req, res, next) { var fn = this.handle; if (fn.length > 3) return next(); try { fn(req, res, next); } catch (err) { next(err); } }, Layer.prototype.match = function(path) { var match; if (null != path) { if (this.regexp.fast_slash) return this.params = {}, this.path = "", !0; if (this.regexp.fast_star) return this.params = { 0: decode_param(path) }, this.path = path, !0; match = this.regexp.exec(path); } if (!match) return this.params = void 0, this.path = void 0, !1; this.params = {}, this.path = match[0]; for (var keys = this.keys, params = this.params, i = 1; i < match.length; i++) { var prop = keys[i - 1].name, val = decode_param(match[i]); void 0 === val && hasOwnProperty.call(params, prop) || (params[prop] = val); } return !0; }; }, function(module, exports, __webpack_require__) { "use strict"; var merge = __webpack_require__(67), parseUrl = __webpack_require__(49), qs = __webpack_require__(177); module.exports = function(options) { var opts = merge({}, options), queryparse = qs.parse; return "function" == typeof options && (queryparse = options, opts = void 0), void 0 !== opts && void 0 === opts.allowPrototypes && (opts.allowPrototypes = !0), function(req, res, next) { if (!req.query) { var val = parseUrl(req).query; req.query = queryparse(val, opts); } next(); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(filename, options) { var opts = options || {}, type = opts.type || "attachment", params = (function(filename, fallback) { if (void 0 !== filename) { var params = {}; if ("string" != typeof filename) throw new TypeError("filename must be a string"); if (void 0 === fallback && (fallback = !0), "string" != typeof fallback && "boolean" != typeof fallback) throw new TypeError("fallback must be a string or boolean"); if ("string" == typeof fallback && NON_LATIN1_REGEXP.test(fallback)) throw new TypeError("fallback must be ISO-8859-1 string"); var name = basename(filename), isQuotedString = TEXT_REGEXP.test(name), fallbackName = "string" != typeof fallback ? fallback && getlatin1(name) : basename(fallback), hasFallback = "string" == typeof fallbackName && fallbackName !== name; return (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) && (params["filename*"] = name), (isQuotedString || hasFallback) && (params.filename = hasFallback ? fallbackName : name), params; } })(filename, opts.fallback); return (function(obj) { var parameters = obj.parameters, type = obj.type; if (!type || "string" != typeof type || !TOKEN_REGEXP.test(type)) throw new TypeError("invalid type"); var string = String(type).toLowerCase(); if (parameters && "object" == typeof parameters) for (var param, params = Object.keys(parameters).sort(), i = 0; i < params.length; i++) { var val = "*" === (param = params[i]).substr(-1) ? ustring(parameters[param]) : qstring(parameters[param]); string += "; " + param + "=" + val; } return string; })(new ContentDisposition(type, params)); }, module.exports.parse = function(string) { if (!string || "string" != typeof string) throw new TypeError("argument string is required"); var match = DISPOSITION_TYPE_REGEXP.exec(string); if (!match) throw new TypeError("invalid type format"); var key, value, index = match[0].length, type = match[1].toLowerCase(), names = [], params = {}; for (index = PARAM_REGEXP.lastIndex = ";" === match[0].substr(-1) ? index - 1 : index; match = PARAM_REGEXP.exec(string); ) { if (match.index !== index) throw new TypeError("invalid parameter format"); if (index += match[0].length, key = match[1].toLowerCase(), value = match[2], -1 !== names.indexOf(key)) throw new TypeError("invalid duplicate parameter"); names.push(key), key.indexOf("*") + 1 !== key.length ? "string" != typeof params[key] && ('"' === value[0] && (value = value.substr(1, value.length - 2).replace(QESC_REGEXP, "$1")), params[key] = value) : (key = key.slice(0, -1), value = decodefield(value), params[key] = value); } if (-1 !== index && index !== string.length) throw new TypeError("invalid parameter format"); return new ContentDisposition(type, params); }; var basename = __webpack_require__(5).basename, Buffer = __webpack_require__(26).Buffer, ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g, HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/, HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g, NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g, QESC_REGEXP = /\\([\u0000-\u007f])/g, QUOTE_REGEXP = /([\\"])/g, PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g, TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/, TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/, EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/, DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/; function decodefield(str) { var match = EXT_VALUE_REGEXP.exec(str); if (!match) throw new TypeError("invalid extended field value"); var value, charset = match[1].toLowerCase(), binary = match[2].replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode); switch (charset) { case "iso-8859-1": value = getlatin1(binary); break; case "utf-8": value = Buffer.from(binary, "binary").toString("utf8"); break; default: throw new TypeError("unsupported charset in extended field"); } return value; } function getlatin1(val) { return String(val).replace(NON_LATIN1_REGEXP, "?"); } function pdecode(str, hex) { return String.fromCharCode(parseInt(hex, 16)); } function pencode(char) { return "%" + String(char).charCodeAt(0).toString(16).toUpperCase(); } function qstring(val) { return '"' + String(val).replace(QUOTE_REGEXP, "\\$1") + '"'; } function ustring(val) { var str = String(val); return "UTF-8''" + encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode); } function ContentDisposition(type, parameters) { this.type = type, this.parameters = parameters; } }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(entity, options) { if (null == entity) throw new TypeError("argument entity is required"); var obj, isStats = (obj = entity, "function" == typeof Stats && obj instanceof Stats || obj && "object" == typeof obj && "ctime" in obj && "[object Date]" === toString.call(obj.ctime) && "mtime" in obj && "[object Date]" === toString.call(obj.mtime) && "ino" in obj && "number" == typeof obj.ino && "size" in obj && "number" == typeof obj.size), weak = options && "boolean" == typeof options.weak ? options.weak : isStats; if (!isStats && "string" != typeof entity && !Buffer.isBuffer(entity)) throw new TypeError("argument entity must be string, Buffer, or fs.Stats"); var stat, mtime, tag = isStats ? (mtime = (stat = entity).mtime.getTime().toString(16), '"' + stat.size.toString(16) + "-" + mtime + '"') : (function(entity) { if (0 === entity.length) return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"'; var hash = crypto.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27); return '"' + ("string" == typeof entity ? Buffer.byteLength(entity, "utf8") : entity.length).toString(16) + "-" + hash + '"'; })(entity); return weak ? "W/" + tag : tag; }; var crypto = __webpack_require__(6), Stats = __webpack_require__(2).Stats, toString = Object.prototype.toString; }, function(module, exports, __webpack_require__) { "use strict"; var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/; function parseHttpDate(date) { var timestamp = date && Date.parse(date); return "number" == typeof timestamp ? timestamp : NaN; } module.exports = function(reqHeaders, resHeaders) { var modifiedSince = reqHeaders["if-modified-since"], noneMatch = reqHeaders["if-none-match"]; if (!modifiedSince && !noneMatch) return !1; var cacheControl = reqHeaders["cache-control"]; if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) return !1; if (noneMatch && "*" !== noneMatch) { var etag = resHeaders.etag; if (!etag) return !1; for (var etagStale = !0, matches = (function(str) { for (var end = 0, list = [], start = 0, i = 0, len = str.length; i < len; i++) switch (str.charCodeAt(i)) { case 32: start === end && (start = end = i + 1); break; case 44: list.push(str.substring(start, end)), start = end = i + 1; break; default: end = i + 1; } return list.push(str.substring(start, end)), list; })(noneMatch), i = 0; i < matches.length; i++) { var match = matches[i]; if (match === etag || match === "W/" + etag || "W/" + match === etag) { etagStale = !1; break; } } if (etagStale) return !1; } if (modifiedSince) { var lastModified = resHeaders["last-modified"]; if (!(lastModified && parseHttpDate(lastModified) <= parseHttpDate(modifiedSince))) return !1; } return !0; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(req, trust) { if (!req) throw new TypeError("req argument is required"); if (!trust) throw new TypeError("trust argument is required"); var addrs = alladdrs(req, trust); return addrs[addrs.length - 1]; }, module.exports.all = alladdrs, module.exports.compile = compile; var forwarded = __webpack_require__(1035), ipaddr = __webpack_require__(183), DIGIT_REGEXP = /^[0-9]+$/, isip = ipaddr.isValid, parseip = ipaddr.parse, IP_RANGES = { linklocal: [ "169.254.0.0/16", "fe80::/10" ], loopback: [ "127.0.0.1/8", "::1/128" ], uniquelocal: [ "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7" ] }; function alladdrs(req, trust) { var addrs = forwarded(req); if (!trust) return addrs; "function" != typeof trust && (trust = compile(trust)); for (var i = 0; i < addrs.length - 1; i++) trust(addrs[i], i) || (addrs.length = i + 1); return addrs; } function compile(val) { if (!val) throw new TypeError("argument is required"); var trust, rangeSubnets, len, subnets, subnet, subnetip, subnetkind, subnetisipv4, subnetrange; if ("string" == typeof val) trust = [ val ]; else { if (!Array.isArray(val)) throw new TypeError("unsupported trust argument"); trust = val.slice(); } for (var i = 0; i < trust.length; i++) val = trust[i], IP_RANGES.hasOwnProperty(val) && (val = IP_RANGES[val], trust.splice.apply(trust, [ i, 1 ].concat(val)), i += val.length - 1); return rangeSubnets = (function(arr) { for (var rangeSubnets = new Array(arr.length), i = 0; i < arr.length; i++) rangeSubnets[i] = parseipNotation(arr[i]); return rangeSubnets; })(trust), 0 === (len = rangeSubnets.length) ? trustNone : 1 === len ? (subnet = rangeSubnets[0], subnetip = subnet[0], subnetkind = subnetip.kind(), subnetisipv4 = "ipv4" === subnetkind, subnetrange = subnet[1], function(addr) { if (!isip(addr)) return !1; var ip = parseip(addr); if (ip.kind() !== subnetkind) { if (subnetisipv4 && !ip.isIPv4MappedAddress()) return !1; ip = subnetisipv4 ? ip.toIPv4Address() : ip.toIPv4MappedAddress(); } return ip.match(subnetip, subnetrange); }) : (subnets = rangeSubnets, function(addr) { if (!isip(addr)) return !1; for (var ipconv, ip = parseip(addr), kind = ip.kind(), i = 0; i < subnets.length; i++) { var subnet = subnets[i], subnetip = subnet[0], subnetkind = subnetip.kind(), subnetrange = subnet[1], trusted = ip; if (kind !== subnetkind) { if ("ipv4" === subnetkind && !ip.isIPv4MappedAddress()) continue; ipconv || (ipconv = "ipv4" === subnetkind ? ip.toIPv4Address() : ip.toIPv4MappedAddress()), trusted = ipconv; } if (trusted.match(subnetip, subnetrange)) return !0; } return !1; }); } function parseipNotation(note) { var pos = note.lastIndexOf("/"), str = -1 !== pos ? note.substring(0, pos) : note; if (!isip(str)) throw new TypeError("invalid IP address: " + str); var ip = parseip(str); -1 === pos && "ipv6" === ip.kind() && ip.isIPv4MappedAddress() && (ip = ip.toIPv4Address()); var max = "ipv6" === ip.kind() ? 128 : 32, range = -1 !== pos ? note.substring(pos + 1, note.length) : null; if ((range = null === range ? max : DIGIT_REGEXP.test(range) ? parseInt(range, 10) : "ipv4" === ip.kind() && isip(range) ? (function(netmask) { var ip = parseip(netmask); return "ipv4" === ip.kind() ? ip.prefixLengthFromSubnetMask() : null; })(range) : null) <= 0 || range > max) throw new TypeError("invalid range on address: " + note); return [ ip, range ]; } function trustNone() { return !1; } }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(res, field) { if (!res || !res.getHeader || !res.setHeader) throw new TypeError("res argument is required"); var val = res.getHeader("Vary") || "", header = Array.isArray(val) ? val.join(", ") : String(val); (val = append(header, field)) && res.setHeader("Vary", val); }, module.exports.append = append; var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; function append(header, field) { if ("string" != typeof header) throw new TypeError("header argument is required"); if (!field) throw new TypeError("field argument is required"); for (var fields = Array.isArray(field) ? field : parse(String(field)), j = 0; j < fields.length; j++) if (!FIELD_NAME_REGEXP.test(fields[j])) throw new TypeError("field argument contains an invalid header name"); if ("*" === header) return header; var val = header, vals = parse(header.toLowerCase()); if (-1 !== fields.indexOf("*") || -1 !== vals.indexOf("*")) return "*"; for (var i = 0; i < fields.length; i++) { var fld = fields[i].toLowerCase(); -1 === vals.indexOf(fld) && (vals.push(fld), val = val ? val + ", " + fields[i] : fields[i]); } return val; } function parse(header) { for (var end = 0, list = [], start = 0, i = 0, len = header.length; i < len; i++) switch (header.charCodeAt(i)) { case 32: start === end && (start = end = i + 1); break; case 44: list.push(header.substring(start, end)), start = end = i + 1; break; default: end = i + 1; } return list.push(header.substring(start, end)), list; } }, function(module, exports, __webpack_require__) { const consts = __webpack_require__(90), pkg = __webpack_require__(500); module.exports = { id: "org.stremio.local", version: pkg.version, description: pkg.description, name: "Local Files", resources: [ "catalog", { name: "meta", types: [ "other" ], idPrefixes: [ consts.PREFIX_LOCAL, consts.PREFIX_BT ] }, { name: "stream", types: [ "movie", "series" ], idPrefixes: [ consts.PREFIX_IMDB ] } ], types: [ "movie", "series", "other" ], catalogs: [ { type: "other", id: "local" } ] }; }, function(module) { module.exports = { name: "stremio-local-addon", version: "1.10.0", description: "Local add-on to find playable files: .torrent, .mp4, .mkv and .avi", main: "index.js", dependencies: { byline: "^5.0.0", "name-to-imdb": "^3.0.4", "node-fetch": "^2.3.0", "parse-torrent": "^6.1.2", "stremio-addon-sdk": "^0.6.4", "video-name-parser": "^1.4.7", which: "^1.3.1" }, devDependencies: { "stremio-addon-client": "^1.12.1", tape: "^4.10.1" }, scripts: { test: "node test/index", start: "node bin/addon" }, repository: { type: "git", url: "git+https://github.com/Stremio/stremio-local-addon.git" }, keywords: [ "stremio", "local", "bittorrent" ], author: "Smart Code OOD", license: "MIT", bugs: { url: "https://github.com/Stremio/stremio-local-addon/issues" }, homepage: "https://github.com/Stremio/stremio-local-addon#readme" }; }, function(module, exports, __webpack_require__) { const parseTorrent = __webpack_require__(1057), fs = __webpack_require__(2), path = __webpack_require__(5), nameToImdb = __webpack_require__(1066), videoNameParser = __webpack_require__(303), promisify = __webpack_require__(0).promisify, consts = __webpack_require__(90); function indexParsedTorrent(torrent, cb) { const ih = ((torrent = torrent || {}).infoHash || "").toLowerCase(), name = torrent.name, files = (torrent.files || []).map((function(f, i) { return f.idx = i, f; })).filter((function(x) { return x.path.match(consts.INTERESTING_FILE); })); if (!files.length) return void cb(null, { files: [] }); const procFile = promisify(processFile); Promise.all(files.map((f => procFile(f)))).then((function(processedFiles) { var t; cb(null, { itemId: "bt:" + ih, ih: ih, name: name, files: processedFiles, sources: torrent.announce ? (t = torrent, [ "dht:" + t.infoHash ].concat(t.announce.map((function(x) { return "tracker:" + x; })))) : null }); })).catch(cb); } function processFile(f, cb) { var parsed = videoNameParser(f.path, { strict: !0, fromInside: !0, fileLength: f.length }); if (!consts.INTERESTING_TYPE.includes(parsed.type)) return cb(null, f); nameToImdb({ name: parsed.name, year: parsed.year, type: parsed.type }, (function(err, imdbId) { imdbId && (f.parsedName = parsed.name, f.type = parsed.type, f.imdb_id = imdbId, parsed.season && (f.season = parsed.season, f.episode = [].concat(parsed.episode).shift())), cb(null, f); })); } module.exports = { indexFile: function(fPath, cb) { fPath.match(".torrent$") ? (function(fPath, cb) { fs.readFile(fPath, (function(err, buf) { if (err) return cb(err); let torrent; try { torrent = parseTorrent(buf); } catch (e) { return cb(e); } indexParsedTorrent(torrent, cb); })); })(fPath, cb) : fPath.match(consts.INTERESTING_FILE) ? fs.stat(fPath, (function(err, stat) { if (err) return cb(err); processFile({ path: fPath, name: path.basename(fPath), length: stat.size }, (function(err, f) { return err ? cb(err) : f.imdb_id ? cb(null, { dateModified: stat.mtime, itemId: consts.PREFIX_LOCAL + f.imdb_id, name: f.name, files: [ f ] }) : cb(null, { files: [] }); })); })) : cb(null, { files: [] }); }, indexParsedTorrent: indexParsedTorrent }; }, function(module, exports, __webpack_require__) { const fetch = __webpack_require__(34), consts = __webpack_require__(90); module.exports = function(entry) { const imdbIdFile = entry.files.find((function(f) { return f.imdb_id; })), biggestFileWithName = entry.files.sort(((a, b) => b.length - a.length)).find((f => f.parsedName)), genericMeta = { id: entry.itemId, type: "other", name: biggestFileWithName && biggestFileWithName.parsedName || entry.name, showAsVideos: !0 }; return imdbIdFile ? (genericMeta.poster = consts.METAHUB_URL + "/poster/medium/" + imdbIdFile.imdb_id + "/img", genericMeta.background = consts.METAHUB_URL + "/background/medium/" + imdbIdFile.imdb_id + "/img", genericMeta.logo = consts.METAHUB_URL + "/logo/medium/" + imdbIdFile.imdb_id + "/img", fetch(consts.CINEMETA_URL + "/meta/" + imdbIdFile.type + "/" + imdbIdFile.imdb_id + ".json").then((function(resp) { return resp.json(); })).then((function(resp) { if (!resp || !resp.meta) throw "no meta found"; const interestingFields = [ "imdb_id", "name", "genre", "director", "cast", "poster", "description", "trailers", "background", "logo", "imdbRating", "runtime", "genres", "releaseInfo" ]; return Object.keys(resp.meta).forEach((key => interestingFields.includes(key) || delete resp.meta[key])), Object.assign(resp.meta, { id: genericMeta.id, type: genericMeta.type }), resp.meta; })).catch((function(err) { return console.log("local-addon", imdbIdFile, err), genericMeta; }))) : Promise.resolve(genericMeta); }; }, function(module, exports, __webpack_require__) { var colors = {}; module.exports = colors, colors.themes = {}; var util = __webpack_require__(0), ansiStyles = colors.styles = __webpack_require__(1092), defineProps = Object.defineProperties, newLineRegex = new RegExp(/[\r\n]+/g); colors.supportsColor = __webpack_require__(1093).supportsColor, void 0 === colors.enabled && (colors.enabled = !1 !== colors.supportsColor()), colors.enable = function() { colors.enabled = !0; }, colors.disable = function() { colors.enabled = !1; }, colors.stripColors = colors.strip = function(str) { return ("" + str).replace(/\x1B\[\d+m/g, ""); }, colors.stylize = function(str, style) { if (!colors.enabled) return str + ""; var styleMap = ansiStyles[style]; return !styleMap && style in colors ? colors[style](str) : styleMap.open + str + styleMap.close; }; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; function build(_styles) { var builder = function builder() { return applyStyle.apply(builder, arguments); }; return builder._styles = _styles, builder.__proto__ = proto, builder; } var styles = (function() { var ret = {}; return ansiStyles.grey = ansiStyles.gray, Object.keys(ansiStyles).forEach((function(key) { ansiStyles[key].closeRe = new RegExp((function(str) { if ("string" != typeof str) throw new TypeError("Expected a string"); return str.replace(matchOperatorsRe, "\\$&"); })(ansiStyles[key].close), "g"), ret[key] = { get: function() { return build(this._styles.concat(key)); } }; })), ret; })(), proto = defineProps((function() {}), styles); function applyStyle() { var args = Array.prototype.slice.call(arguments), str = args.map((function(arg) { return null != arg && arg.constructor === String ? arg : util.inspect(arg); })).join(" "); if (!colors.enabled || !str) return str; for (var newLinesPresent = -1 != str.indexOf("\n"), nestedStyles = this._styles, i = nestedStyles.length; i--; ) { var code = ansiStyles[nestedStyles[i]]; str = code.open + str.replace(code.closeRe, code.open) + code.close, newLinesPresent && (str = str.replace(newLineRegex, (function(match) { return code.close + match + code.open; }))); } return str; } colors.setTheme = function(theme) { if ("string" != typeof theme) for (var style in theme) !(function(style) { colors[style] = function(str) { if ("object" == typeof theme[style]) { var out = str; for (var i in theme[style]) out = colors[theme[style][i]](out); return out; } return colors[theme[style]](str); }; })(style); else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));"); }; var sequencer = function(map, str) { var exploded = str.split(""); return (exploded = exploded.map(map)).join(""); }; for (var map in colors.trap = __webpack_require__(1095), colors.zalgo = __webpack_require__(1096), colors.maps = {}, colors.maps.america = __webpack_require__(1097)(colors), colors.maps.zebra = __webpack_require__(1098)(colors), colors.maps.rainbow = __webpack_require__(1099)(colors), colors.maps.random = __webpack_require__(1100)(colors), colors.maps) !(function(map) { colors[map] = function(str) { return sequencer(colors.maps[map], str); }; })(map); defineProps(colors, (function() { var ret = {}; return Object.keys(styles).forEach((function(name) { ret[name] = { get: function() { return build([ name ]); } }; })), ret; })()); }, function(module, exports, __webpack_require__) { var async, xml; async = __webpack_require__(243), xml = __webpack_require__(1103), __webpack_require__(2), module.exports = function(input, cb) { return async.waterfall([ function(cb) { return xml.parseString(input, cb); }, function(obj, cb) { return async.map(obj.nzb.file, (function(file, cb) { var group, i, len, ref, segment, segments, subject; for (subject = file.$.subject, group = file.groups[0].group[0], segments = [], i = 0, len = (ref = file.segments[0].segment).length; i < len; i++) segment = ref[i], segments[parseInt(segment.$.number) - 1] = { group: group, article: segment._, bytes: parseInt(segment.$.bytes), subject: subject }; return cb(null, segments); }), cb); } ], cb); }; }, function(module, exports) { (function() { module.exports = (function() { function XMLDOMImplementation() {} return XMLDOMImplementation.prototype.hasFeature = function(feature, version) { return !0; }, XMLDOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) { throw new Error("This DOM method is not implemented."); }, XMLDOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) { throw new Error("This DOM method is not implemented."); }, XMLDOMImplementation.prototype.createHTMLDocument = function(title) { throw new Error("This DOM method is not implemented."); }, XMLDOMImplementation.prototype.getFeature = function(feature, version) { throw new Error("This DOM method is not implemented."); }, XMLDOMImplementation; })(); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject, hasProp = {}.hasOwnProperty; isPlainObject = __webpack_require__(52).isPlainObject, XMLDOMImplementation = __webpack_require__(505), XMLDOMConfiguration = __webpack_require__(1106), XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), XMLStringifier = __webpack_require__(509), XMLStringWriter = __webpack_require__(259), module.exports = (function(superClass) { function XMLDocument(options) { XMLDocument.__super__.constructor.call(this, null), this.name = "#document", this.type = NodeType.Document, this.documentURI = null, this.domConfig = new XMLDOMConfiguration, options || (options = {}), options.writer || (options.writer = new XMLStringWriter), this.options = options, this.stringify = new XMLStringifier(options); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDocument, superClass), Object.defineProperty(XMLDocument.prototype, "implementation", { value: new XMLDOMImplementation }), Object.defineProperty(XMLDocument.prototype, "doctype", { get: function() { var child, i, len, ref; for (i = 0, len = (ref = this.children).length; i < len; i++) if ((child = ref[i]).type === NodeType.DocType) return child; return null; } }), Object.defineProperty(XMLDocument.prototype, "documentElement", { get: function() { return this.rootObject || null; } }), Object.defineProperty(XMLDocument.prototype, "inputEncoding", { get: function() { return null; } }), Object.defineProperty(XMLDocument.prototype, "strictErrorChecking", { get: function() { return !1; } }), Object.defineProperty(XMLDocument.prototype, "xmlEncoding", { get: function() { return 0 !== this.children.length && this.children[0].type === NodeType.Declaration ? this.children[0].encoding : null; } }), Object.defineProperty(XMLDocument.prototype, "xmlStandalone", { get: function() { return 0 !== this.children.length && this.children[0].type === NodeType.Declaration && "yes" === this.children[0].standalone; } }), Object.defineProperty(XMLDocument.prototype, "xmlVersion", { get: function() { return 0 !== this.children.length && this.children[0].type === NodeType.Declaration ? this.children[0].version : "1.0"; } }), Object.defineProperty(XMLDocument.prototype, "URL", { get: function() { return this.documentURI; } }), Object.defineProperty(XMLDocument.prototype, "origin", { get: function() { return null; } }), Object.defineProperty(XMLDocument.prototype, "compatMode", { get: function() { return null; } }), Object.defineProperty(XMLDocument.prototype, "characterSet", { get: function() { return null; } }), Object.defineProperty(XMLDocument.prototype, "contentType", { get: function() { return null; } }), XMLDocument.prototype.end = function(writer) { var writerOptions; return writerOptions = {}, writer ? isPlainObject(writer) && (writerOptions = writer, writer = this.options.writer) : writer = this.options.writer, writer.document(this, writer.filterOptions(writerOptions)); }, XMLDocument.prototype.toString = function(options) { return this.options.writer.document(this, this.options.writer.filterOptions(options)); }, XMLDocument.prototype.createElement = function(tagName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createDocumentFragment = function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createTextNode = function(data) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createComment = function(data) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createCDATASection = function(data) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createProcessingInstruction = function(target, data) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createAttribute = function(name) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createEntityReference = function(name) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.getElementsByTagName = function(tagname) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.importNode = function(importedNode, deep) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createElementNS = function(namespaceURI, qualifiedName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createAttributeNS = function(namespaceURI, qualifiedName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.getElementById = function(elementId) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.adoptNode = function(source) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.normalizeDocument = function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.renameNode = function(node, namespaceURI, qualifiedName) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.getElementsByClassName = function(classNames) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createEvent = function(eventInterface) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createRange = function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createNodeIterator = function(root, whatToShow, filter) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument.prototype.createTreeWalker = function(root, whatToShow, filter) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }, XMLDocument; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType; NodeType = __webpack_require__(22), __webpack_require__(42), module.exports = (function() { function XMLAttribute(parent, name, value) { if (this.parent = parent, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), null == name) throw new Error("Missing attribute name. " + this.debugInfo(name)); this.name = this.stringify.name(name), this.value = this.stringify.attValue(value), this.type = NodeType.Attribute, this.isId = !1, this.schemaTypeInfo = null; } return Object.defineProperty(XMLAttribute.prototype, "nodeType", { get: function() { return this.type; } }), Object.defineProperty(XMLAttribute.prototype, "ownerElement", { get: function() { return this.parent; } }), Object.defineProperty(XMLAttribute.prototype, "textContent", { get: function() { return this.value; }, set: function(value) { return this.value = value || ""; } }), Object.defineProperty(XMLAttribute.prototype, "namespaceURI", { get: function() { return ""; } }), Object.defineProperty(XMLAttribute.prototype, "prefix", { get: function() { return ""; } }), Object.defineProperty(XMLAttribute.prototype, "localName", { get: function() { return this.name; } }), Object.defineProperty(XMLAttribute.prototype, "specified", { get: function() { return !0; } }), XMLAttribute.prototype.clone = function() { return Object.create(this); }, XMLAttribute.prototype.toString = function(options) { return this.options.writer.attribute(this, this.options.writer.filterOptions(options)); }, XMLAttribute.prototype.debugInfo = function(name) { return null == (name = name || this.name) ? "parent: <" + this.parent.name + ">" : "attribute: {" + name + "}, parent: <" + this.parent.name + ">"; }, XMLAttribute.prototype.isEqualNode = function(node) { return node.namespaceURI === this.namespaceURI && node.prefix === this.prefix && node.localName === this.localName && node.value === this.value; }, XMLAttribute; })(); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, XMLNode, hasProp = {}.hasOwnProperty; XMLNode = __webpack_require__(42), NodeType = __webpack_require__(22), module.exports = (function(superClass) { function XMLDummy(parent) { XMLDummy.__super__.constructor.call(this, parent), this.type = NodeType.Dummy; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDummy, superClass), XMLDummy.prototype.clone = function() { return Object.create(this); }, XMLDummy.prototype.toString = function(options) { return ""; }, XMLDummy; })(XMLNode); }).call(this); }, function(module, exports) { (function() { var bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; }, hasProp = {}.hasOwnProperty; module.exports = (function() { function XMLStringifier(options) { var key, ref, value; for (key in this.assertLegalName = bind(this.assertLegalName, this), this.assertLegalChar = bind(this.assertLegalChar, this), options || (options = {}), this.options = options, this.options.version || (this.options.version = "1.0"), ref = options.stringify || {}) hasProp.call(ref, key) && (value = ref[key], this[key] = value); } return XMLStringifier.prototype.name = function(val) { return this.options.noValidation ? val : this.assertLegalName("" + val || ""); }, XMLStringifier.prototype.text = function(val) { return this.options.noValidation ? val : this.assertLegalChar(this.textEscape("" + val || "")); }, XMLStringifier.prototype.cdata = function(val) { return this.options.noValidation ? val : (val = (val = "" + val || "").replace("]]>", "]]]]>"), this.assertLegalChar(val)); }, XMLStringifier.prototype.comment = function(val) { if (this.options.noValidation) return val; if ((val = "" + val || "").match(/--/)) throw new Error("Comment text cannot contain double-hypen: " + val); return this.assertLegalChar(val); }, XMLStringifier.prototype.raw = function(val) { return this.options.noValidation ? val : "" + val || ""; }, XMLStringifier.prototype.attValue = function(val) { return this.options.noValidation ? val : this.assertLegalChar(this.attEscape(val = "" + val || "")); }, XMLStringifier.prototype.insTarget = function(val) { return this.options.noValidation ? val : this.assertLegalChar("" + val || ""); }, XMLStringifier.prototype.insValue = function(val) { if (this.options.noValidation) return val; if ((val = "" + val || "").match(/\?>/)) throw new Error("Invalid processing instruction value: " + val); return this.assertLegalChar(val); }, XMLStringifier.prototype.xmlVersion = function(val) { if (this.options.noValidation) return val; if (!(val = "" + val || "").match(/1\.[0-9]+/)) throw new Error("Invalid version number: " + val); return val; }, XMLStringifier.prototype.xmlEncoding = function(val) { if (this.options.noValidation) return val; if (!(val = "" + val || "").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) throw new Error("Invalid encoding: " + val); return this.assertLegalChar(val); }, XMLStringifier.prototype.xmlStandalone = function(val) { return this.options.noValidation ? val : val ? "yes" : "no"; }, XMLStringifier.prototype.dtdPubID = function(val) { return this.options.noValidation ? val : this.assertLegalChar("" + val || ""); }, XMLStringifier.prototype.dtdSysID = function(val) { return this.options.noValidation ? val : this.assertLegalChar("" + val || ""); }, XMLStringifier.prototype.dtdElementValue = function(val) { return this.options.noValidation ? val : this.assertLegalChar("" + val || ""); }, XMLStringifier.prototype.dtdAttType = function(val) { return this.options.noValidation ? val : this.assertLegalChar("" + val || ""); }, XMLStringifier.prototype.dtdAttDefault = function(val) { return this.options.noValidation ? val : this.assertLegalChar("" + val || ""); }, XMLStringifier.prototype.dtdEntityValue = function(val) { return this.options.noValidation ? val : this.assertLegalChar("" + val || ""); }, XMLStringifier.prototype.dtdNData = function(val) { return this.options.noValidation ? val : this.assertLegalChar("" + val || ""); }, XMLStringifier.prototype.convertAttKey = "@", XMLStringifier.prototype.convertPIKey = "?", XMLStringifier.prototype.convertTextKey = "#text", XMLStringifier.prototype.convertCDataKey = "#cdata", XMLStringifier.prototype.convertCommentKey = "#comment", XMLStringifier.prototype.convertRawKey = "#raw", XMLStringifier.prototype.assertLegalChar = function(str) { var regex, res; if (this.options.noValidation) return str; if (regex = "", "1.0" === this.options.version) { if (regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, res = str.match(regex)) throw new Error("Invalid character in string: " + str + " at index " + res.index); } else if ("1.1" === this.options.version && (regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, res = str.match(regex))) throw new Error("Invalid character in string: " + str + " at index " + res.index); return str; }, XMLStringifier.prototype.assertLegalName = function(str) { var regex; if (this.options.noValidation) return str; if (this.assertLegalChar(str), regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/, !str.match(regex)) throw new Error("Invalid character in name"); return str; }, XMLStringifier.prototype.textEscape = function(str) { var ampregex; return this.options.noValidation ? str : (ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, str.replace(ampregex, "&").replace(//g, ">").replace(/\r/g, " ")); }, XMLStringifier.prototype.attEscape = function(str) { var ampregex; return this.options.noValidation ? str : (ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, str.replace(ampregex, "&").replace(/ 0 ? new Array(indentLevel).join(options.indent) : ""; }, XMLWriterBase.prototype.endline = function(node, options, level) { return !options.pretty || options.suppressPrettyCount ? "" : options.newline; }, XMLWriterBase.prototype.attribute = function(att, options, level) { var r; return this.openAttribute(att, options, level), r = " " + att.name + '="' + att.value + '"', this.closeAttribute(att, options, level), r; }, XMLWriterBase.prototype.cdata = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level) + "" + this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.comment = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level) + "\x3c!-- ", options.state = WriterState.InsideTag, r += node.value, options.state = WriterState.CloseTag, r += " --\x3e" + this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.declaration = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level) + "", r += this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.docType = function(node, options, level) { var child, i, len, r, ref; if (level || (level = 0), this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level), r += " 0) { for (r += " [", r += this.endline(node, options, level), options.state = WriterState.InsideTag, i = 0, len = (ref = node.children).length; i < len; i++) child = ref[i], r += this.writeChildNode(child, options, level + 1); options.state = WriterState.CloseTag, r += "]"; } return options.state = WriterState.CloseTag, r += options.spaceBeforeSlash + ">", r += this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.element = function(node, options, level) { var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2; for (name in level || (level = 0), prettySuppressed = !1, r = "", this.openNode(node, options, level), options.state = WriterState.OpenTag, r += this.indent(node, options, level) + "<" + node.name, ref = node.attribs) hasProp.call(ref, name) && (att = ref[name], r += this.attribute(att, options, level)); if (firstChildNode = 0 === (childNodeCount = node.children.length) ? null : node.children[0], 0 === childNodeCount || node.children.every((function(e) { return (e.type === NodeType.Text || e.type === NodeType.Raw) && "" === e.value; }))) options.allowEmpty ? (r += ">", options.state = WriterState.CloseTag, r += "" + this.endline(node, options, level)) : (options.state = WriterState.CloseTag, r += options.spaceBeforeSlash + "/>" + this.endline(node, options, level)); else if (!options.pretty || 1 !== childNodeCount || firstChildNode.type !== NodeType.Text && firstChildNode.type !== NodeType.Raw || null == firstChildNode.value) { if (options.dontPrettyTextNodes) for (i = 0, len = (ref1 = node.children).length; i < len; i++) if (((child = ref1[i]).type === NodeType.Text || child.type === NodeType.Raw) && null != child.value) { options.suppressPrettyCount++, prettySuppressed = !0; break; } for (r += ">" + this.endline(node, options, level), options.state = WriterState.InsideTag, j = 0, len1 = (ref2 = node.children).length; j < len1; j++) child = ref2[j], r += this.writeChildNode(child, options, level + 1); options.state = WriterState.CloseTag, r += this.indent(node, options, level) + "", prettySuppressed && options.suppressPrettyCount--, r += this.endline(node, options, level), options.state = WriterState.None; } else r += ">", options.state = WriterState.InsideTag, options.suppressPrettyCount++, prettySuppressed = !0, r += this.writeChildNode(firstChildNode, options, level + 1), options.suppressPrettyCount--, prettySuppressed = !1, options.state = WriterState.CloseTag, r += "" + this.endline(node, options, level); return this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.writeChildNode = function(node, options, level) { switch (node.type) { case NodeType.CData: return this.cdata(node, options, level); case NodeType.Comment: return this.comment(node, options, level); case NodeType.Element: return this.element(node, options, level); case NodeType.Raw: return this.raw(node, options, level); case NodeType.Text: return this.text(node, options, level); case NodeType.ProcessingInstruction: return this.processingInstruction(node, options, level); case NodeType.Dummy: return ""; case NodeType.Declaration: return this.declaration(node, options, level); case NodeType.DocType: return this.docType(node, options, level); case NodeType.AttributeDeclaration: return this.dtdAttList(node, options, level); case NodeType.ElementDeclaration: return this.dtdElement(node, options, level); case NodeType.EntityDeclaration: return this.dtdEntity(node, options, level); case NodeType.NotationDeclaration: return this.dtdNotation(node, options, level); default: throw new Error("Unknown XML node type: " + node.constructor.name); } }, XMLWriterBase.prototype.processingInstruction = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level) + "", r += this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.raw = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level), options.state = WriterState.InsideTag, r += node.value, options.state = WriterState.CloseTag, r += this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.text = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level), options.state = WriterState.InsideTag, r += node.value, options.state = WriterState.CloseTag, r += this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.dtdAttList = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level) + "" + this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.dtdElement = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level) + "" + this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.dtdEntity = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level) + "" + this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.dtdNotation = function(node, options, level) { var r; return this.openNode(node, options, level), options.state = WriterState.OpenTag, r = this.indent(node, options, level) + "" + this.endline(node, options, level), options.state = WriterState.None, this.closeNode(node, options, level), r; }, XMLWriterBase.prototype.openNode = function(node, options, level) {}, XMLWriterBase.prototype.closeNode = function(node, options, level) {}, XMLWriterBase.prototype.openAttribute = function(att, options, level) {}, XMLWriterBase.prototype.closeAttribute = function(att, options, level) {}, XMLWriterBase; })(); }).call(this); }, function(module, exports) { (function() { "use strict"; var prefixMatch; prefixMatch = new RegExp(/(?!xmlns)^.*:/), exports.normalize = function(str) { return str.toLowerCase(); }, exports.firstCharLowerCase = function(str) { return str.charAt(0).toLowerCase() + str.slice(1); }, exports.stripPrefix = function(str) { return str.replace(prefixMatch, ""); }, exports.parseNumbers = function(str) { return isNaN(str) || (str = str % 1 == 0 ? parseInt(str, 10) : parseFloat(str)), str; }, exports.parseBooleans = function(str) { return /^(?:true|false)$/i.test(str) && (str = "true" === str.toLowerCase()), str; }; }).call(this); }, function(module, exports, __webpack_require__) { "use strict"; function $flatten(array, result) { for (var i = 0; i < array.length; i++) { var value = array[i]; Array.isArray(value) ? $flatten(value, result) : result.push(value); } } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.flatten = function(array) { var result = []; return $flatten(array, result), result; }; }, function(module, exports, __webpack_require__) { "use strict"; var pathRegexp = __webpack_require__(178), debug = __webpack_require__(9)("router:layer"), hasOwnProperty = Object.prototype.hasOwnProperty; function Layer(path, options, fn) { if (!(this instanceof Layer)) return new Layer(path, options, fn); debug("new %o", path); var opts = options || {}; this.handle = fn, this.name = fn.name || "", this.params = void 0, this.path = void 0, this.regexp = pathRegexp(path, this.keys = [], opts), this.regexp.fast_star = "*" === path, this.regexp.fast_slash = "/" === path && !1 === opts.end; } function decode_param(val) { if ("string" != typeof val || 0 === val.length) return val; try { return decodeURIComponent(val); } catch (err) { throw err instanceof URIError && (err.message = "Failed to decode param '" + val + "'", err.status = 400), err; } } module.exports = Layer, Layer.prototype.handle_error = function(error, req, res, next) { var fn = this.handle; if (4 !== fn.length) return next(error); try { fn(error, req, res, next); } catch (err) { next(err); } }, Layer.prototype.handle_request = function(req, res, next) { var fn = this.handle; if (fn.length > 3) return next(); try { fn(req, res, next); } catch (err) { next(err); } }, Layer.prototype.match = function(path) { var match; if (null != path) { if (this.regexp.fast_slash) return this.params = {}, this.path = "", !0; if (this.regexp.fast_star) return this.params = { 0: decode_param(path) }, this.path = path, !0; match = this.regexp.exec(path); } if (!match) return this.params = void 0, this.path = void 0, !1; this.params = {}, this.path = match[0]; for (var keys = this.keys, params = this.params, i = 1; i < match.length; i++) { var prop = keys[i - 1].name, val = decode_param(match[i]); void 0 === val && hasOwnProperty.call(params, prop) || (params[prop] = val); } return !0; }; }, function(module, exports, __webpack_require__) { const {RarFilesPackage: RarFilesPackage} = __webpack_require__(1123), urlToFileMedia = __webpack_require__(1124), store = __webpack_require__(162), parseQuery = __webpack_require__(271), safeStatelessRegex = __webpack_require__(80), q = new (__webpack_require__(71))((async (task, cb) => { const {opts: opts, query: query} = task, rarUrls = (function(query) { let rarUrls = [], key = query.key; return key && store.get(key) ? rarUrls = store.get(key) : (rarUrls = query.r || [], "string" == typeof rarUrls && (rarUrls = [ rarUrls ])), rarUrls; })(query); try { rarStreams[task.url] = rarStreams[task.url] || await streamRar(rarUrls, opts); } catch (e) { return console.error(e), void cb(null); } cb(rarStreams[task.url]); }), 10), rarStreams = {}, streamRar = async (urls, opts = {}) => { const rarFiles = []; for (let url of urls) rarFiles.push(urlToFileMedia(url)); let promisedFiles = null; try { promisedFiles = await Promise.all(rarFiles); } catch (e) { throw Error(e); } const rarStreamPackage = new RarFilesPackage(promisedFiles); (opts.fileMustInclude || []).length || opts.hasOwnProperty("fileIdx") || (opts = { fileMustInclude: [ /.mkv$|.mp4$|.avi$|.ts$/i ] }); const rarStreamOpts = { filter: function(name, idx) { return (opts.fileMustInclude || []).length ? !!opts.fileMustInclude.find((reg => (reg = "string" == typeof reg ? new RegExp(reg) : reg, safeStatelessRegex(name || "", reg, 500)))) : !opts.hasOwnProperty("fileIdx") || opts.fileIdx === idx; }, maxFiles: 1 }; let innerFiles = []; try { innerFiles = await rarStreamPackage.parse(rarStreamOpts); } catch (e) { throw Error(e); } if (!innerFiles[0]) throw Error("no file matching " + JSON.stringify(opts)); return innerFiles[0]; }; module.exports = async function(req) { const task = parseQuery(req); task.url = req.url; let rarStream = null; try { rarStream = await (function(task) { return new Promise(((resolve, reject) => { task.id = task.query.key, q.push(task, (rarStream => { resolve(rarStream); })); })); })(task); } catch (e) { console.error(e); } return rarStream; }; }, function(module, exports, __webpack_require__) { "use strict"; var tough = __webpack_require__(1126), Cookie = tough.Cookie, CookieJar = tough.CookieJar; function RequestJar(store) { this._jar = new CookieJar(store, { looseMode: !0 }); } exports.parse = function(str) { if (str && str.uri && (str = str.uri), "string" != typeof str) throw new Error("The cookie function only accepts STRING as param"); return Cookie.parse(str, { loose: !0 }); }, RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { return this._jar.setCookieSync(cookieOrStr, uri, options || {}); }, RequestJar.prototype.getCookieString = function(uri) { return this._jar.getCookieStringSync(uri); }, RequestJar.prototype.getCookies = function(uri) { return this._jar.getCookiesSync(uri); }, exports.jar = function(store) { return new RequestJar(store); }; }, function(module, exports, __webpack_require__) { "use strict"; var psl = __webpack_require__(1127); exports.getPublicSuffix = function(domain) { return psl.get(domain); }; }, function(module, exports) { module.exports = require("punycode"); }, function(module, exports, __webpack_require__) { "use strict"; function Store() {} exports.Store = Store, Store.prototype.synchronous = !1, Store.prototype.findCookie = function(domain, path, key, cb) { throw new Error("findCookie is not implemented"); }, Store.prototype.findCookies = function(domain, path, cb) { throw new Error("findCookies is not implemented"); }, Store.prototype.putCookie = function(cookie, cb) { throw new Error("putCookie is not implemented"); }, Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { throw new Error("updateCookie is not implemented"); }, Store.prototype.removeCookie = function(domain, path, key, cb) { throw new Error("removeCookie is not implemented"); }, Store.prototype.removeCookies = function(domain, path, cb) { throw new Error("removeCookies is not implemented"); }, Store.prototype.getAllCookies = function(cb) { throw new Error("getAllCookies is not implemented (therefore jar cannot be serialized)"); }; }, function(module, exports, __webpack_require__) { "use strict"; var pubsuffix = __webpack_require__(516); exports.permuteDomain = function(domain) { var pubSuf = pubsuffix.getPublicSuffix(domain); if (!pubSuf) return null; if (pubSuf == domain) return [ domain ]; for (var parts = domain.slice(0, -(pubSuf.length + 1)).split(".").reverse(), cur = pubSuf, permutations = [ cur ]; parts.length; ) cur = parts.shift() + "." + cur, permutations.push(cur); return permutations; }; }, function(module, exports, __webpack_require__) { "use strict"; exports.pathMatch = function(reqPath, cookiePath) { if (cookiePath === reqPath) return !0; if (0 === reqPath.indexOf(cookiePath)) { if ("/" === cookiePath.substr(-1)) return !0; if ("/" === reqPath.substr(cookiePath.length, 1)) return !0; } return !1; }; }, function(module, exports, __webpack_require__) { module.exports = { Verifier: Verifier, Signer: Signer }; var nacl = __webpack_require__(111), stream = __webpack_require__(3), util = __webpack_require__(0), assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, Signature = __webpack_require__(53); function Verifier(key, hashAlgo) { if ("sha512" !== hashAlgo.toLowerCase()) throw new Error("ED25519 only supports the use of SHA-512 hashes"); this.key = key, this.chunks = [], stream.Writable.call(this, {}); } function Signer(key, hashAlgo) { if ("sha512" !== hashAlgo.toLowerCase()) throw new Error("ED25519 only supports the use of SHA-512 hashes"); this.key = key, this.chunks = [], stream.Writable.call(this, {}); } util.inherits(Verifier, stream.Writable), Verifier.prototype._write = function(chunk, enc, cb) { this.chunks.push(chunk), cb(); }, Verifier.prototype.update = function(chunk) { "string" == typeof chunk && (chunk = Buffer.from(chunk, "binary")), this.chunks.push(chunk); }, Verifier.prototype.verify = function(signature, fmt) { var sig; if (Signature.isSignature(signature, [ 2, 0 ])) { if ("ed25519" !== signature.type) return !1; sig = signature.toBuffer("raw"); } else if ("string" == typeof signature) sig = Buffer.from(signature, "base64"); else if (Signature.isSignature(signature, [ 1, 0 ])) throw new Error("signature was created by too old a version of sshpk and cannot be verified"); return assert.buffer(sig), nacl.sign.detached.verify(new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(sig), new Uint8Array(this.key.part.A.data)); }, util.inherits(Signer, stream.Writable), Signer.prototype._write = function(chunk, enc, cb) { this.chunks.push(chunk), cb(); }, Signer.prototype.update = function(chunk) { "string" == typeof chunk && (chunk = Buffer.from(chunk, "binary")), this.chunks.push(chunk); }, Signer.prototype.sign = function() { var sig = nacl.sign.detached(new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(Buffer.concat([ this.key.part.k.data, this.key.part.A.data ]))), sigBuf = Buffer.from(sig), sigObj = Signature.parse(sigBuf, "ed25519", "raw"); return sigObj.hashAlgorithm = "sha512", sigObj; }; }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { if ("string" == typeof buf) { if (buf.trim().match(/^[-]+[ ]*BEGIN/)) return pem.read(buf, options); if (buf.match(/^\s*ssh-[a-z]/)) return ssh.read(buf, options); if (buf.match(/^\s*ecdsa-/)) return ssh.read(buf, options); if (buf.match(/^putty-user-key-file-2:/i)) return putty.read(buf, options); if (findDNSSECHeader(buf)) return dnssec.read(buf, options); buf = Buffer.from(buf, "binary"); } else { if (assert.buffer(buf), (function(buf) { for (var offset = 0; offset < buf.length && (32 === buf[offset] || 10 === buf[offset]); ) ++offset; if (45 !== buf[offset]) return !1; for (;offset < buf.length && 45 === buf[offset]; ) ++offset; for (;offset < buf.length && 32 === buf[offset]; ) ++offset; return !(offset + 5 > buf.length || "BEGIN" !== buf.slice(offset, offset + 5).toString("ascii")); })(buf)) return pem.read(buf, options); if ((function(buf) { for (var offset = 0; offset < buf.length && (32 === buf[offset] || 10 === buf[offset] || 9 === buf[offset]); ) ++offset; return offset + 4 <= buf.length && "ssh-" === buf.slice(offset, offset + 4).toString("ascii") || offset + 6 <= buf.length && "ecdsa-" === buf.slice(offset, offset + 6).toString("ascii"); })(buf)) return ssh.read(buf, options); if ((function(buf) { for (var offset = 0; offset < buf.length && (32 === buf[offset] || 10 === buf[offset] || 9 === buf[offset]); ) ++offset; return offset + 22 <= buf.length && "putty-user-key-file-2:" === buf.slice(offset, offset + 22).toString("ascii").toLowerCase(); })(buf)) return putty.read(buf, options); if (findDNSSECHeader(buf)) return dnssec.read(buf, options); } if (buf.readUInt32BE(0) < buf.length) return rfc4253.read(buf, options); throw new Error("Failed to auto-detect format of key"); }, write: function(key, options) { throw new Error('"auto" format cannot be used for writing'); } }; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, pem = (__webpack_require__(28), __webpack_require__(27), __webpack_require__(29), __webpack_require__(62)), ssh = __webpack_require__(524), rfc4253 = __webpack_require__(63), dnssec = __webpack_require__(266), putty = __webpack_require__(525); function findDNSSECHeader(buf) { if (buf.length <= "Private-key-format: v1".length) return !1; if ("Private-key-format: v1" === buf.slice(0, "Private-key-format: v1".length).toString("ascii")) return !0; "string" != typeof buf && (buf = buf.toString("ascii")); for (var lines = buf.split("\n"), line = 0; lines[line].match(/^\;/); ) line++; return !!lines[line].toString("ascii").match(/\. IN KEY /) || !!lines[line].toString("ascii").match(/\. IN DNSKEY /); } }, function(module, exports, __webpack_require__) { "use strict"; var crypto_hash_sha512 = __webpack_require__(111).lowlevel.crypto_hash, BLF_J = 0, Blowfish = function() { this.S = [ new Uint32Array([ 3509652390, 2564797868, 805139163, 3491422135, 3101798381, 1780907670, 3128725573, 4046225305, 614570311, 3012652279, 134345442, 2240740374, 1667834072, 1901547113, 2757295779, 4103290238, 227898511, 1921955416, 1904987480, 2182433518, 2069144605, 3260701109, 2620446009, 720527379, 3318853667, 677414384, 3393288472, 3101374703, 2390351024, 1614419982, 1822297739, 2954791486, 3608508353, 3174124327, 2024746970, 1432378464, 3864339955, 2857741204, 1464375394, 1676153920, 1439316330, 715854006, 3033291828, 289532110, 2706671279, 2087905683, 3018724369, 1668267050, 732546397, 1947742710, 3462151702, 2609353502, 2950085171, 1814351708, 2050118529, 680887927, 999245976, 1800124847, 3300911131, 1713906067, 1641548236, 4213287313, 1216130144, 1575780402, 4018429277, 3917837745, 3693486850, 3949271944, 596196993, 3549867205, 258830323, 2213823033, 772490370, 2760122372, 1774776394, 2652871518, 566650946, 4142492826, 1728879713, 2882767088, 1783734482, 3629395816, 2517608232, 2874225571, 1861159788, 326777828, 3124490320, 2130389656, 2716951837, 967770486, 1724537150, 2185432712, 2364442137, 1164943284, 2105845187, 998989502, 3765401048, 2244026483, 1075463327, 1455516326, 1322494562, 910128902, 469688178, 1117454909, 936433444, 3490320968, 3675253459, 1240580251, 122909385, 2157517691, 634681816, 4142456567, 3825094682, 3061402683, 2540495037, 79693498, 3249098678, 1084186820, 1583128258, 426386531, 1761308591, 1047286709, 322548459, 995290223, 1845252383, 2603652396, 3431023940, 2942221577, 3202600964, 3727903485, 1712269319, 422464435, 3234572375, 1170764815, 3523960633, 3117677531, 1434042557, 442511882, 3600875718, 1076654713, 1738483198, 4213154764, 2393238008, 3677496056, 1014306527, 4251020053, 793779912, 2902807211, 842905082, 4246964064, 1395751752, 1040244610, 2656851899, 3396308128, 445077038, 3742853595, 3577915638, 679411651, 2892444358, 2354009459, 1767581616, 3150600392, 3791627101, 3102740896, 284835224, 4246832056, 1258075500, 768725851, 2589189241, 3069724005, 3532540348, 1274779536, 3789419226, 2764799539, 1660621633, 3471099624, 4011903706, 913787905, 3497959166, 737222580, 2514213453, 2928710040, 3937242737, 1804850592, 3499020752, 2949064160, 2386320175, 2390070455, 2415321851, 4061277028, 2290661394, 2416832540, 1336762016, 1754252060, 3520065937, 3014181293, 791618072, 3188594551, 3933548030, 2332172193, 3852520463, 3043980520, 413987798, 3465142937, 3030929376, 4245938359, 2093235073, 3534596313, 375366246, 2157278981, 2479649556, 555357303, 3870105701, 2008414854, 3344188149, 4221384143, 3956125452, 2067696032, 3594591187, 2921233993, 2428461, 544322398, 577241275, 1471733935, 610547355, 4027169054, 1432588573, 1507829418, 2025931657, 3646575487, 545086370, 48609733, 2200306550, 1653985193, 298326376, 1316178497, 3007786442, 2064951626, 458293330, 2589141269, 3591329599, 3164325604, 727753846, 2179363840, 146436021, 1461446943, 4069977195, 705550613, 3059967265, 3887724982, 4281599278, 3313849956, 1404054877, 2845806497, 146425753, 1854211946 ]), new Uint32Array([ 1266315497, 3048417604, 3681880366, 3289982499, 290971e4, 1235738493, 2632868024, 2414719590, 3970600049, 1771706367, 1449415276, 3266420449, 422970021, 1963543593, 2690192192, 3826793022, 1062508698, 1531092325, 1804592342, 2583117782, 2714934279, 4024971509, 1294809318, 4028980673, 1289560198, 2221992742, 1669523910, 35572830, 157838143, 1052438473, 1016535060, 1802137761, 1753167236, 1386275462, 3080475397, 2857371447, 1040679964, 2145300060, 2390574316, 1461121720, 2956646967, 4031777805, 4028374788, 33600511, 2920084762, 1018524850, 629373528, 3691585981, 3515945977, 2091462646, 2486323059, 586499841, 988145025, 935516892, 3367335476, 2599673255, 2839830854, 265290510, 3972581182, 2759138881, 3795373465, 1005194799, 847297441, 406762289, 1314163512, 1332590856, 1866599683, 4127851711, 750260880, 613907577, 1450815602, 3165620655, 3734664991, 3650291728, 3012275730, 3704569646, 1427272223, 778793252, 1343938022, 2676280711, 2052605720, 1946737175, 3164576444, 3914038668, 3967478842, 3682934266, 1661551462, 3294938066, 4011595847, 840292616, 3712170807, 616741398, 312560963, 711312465, 1351876610, 322626781, 1910503582, 271666773, 2175563734, 1594956187, 70604529, 3617834859, 1007753275, 1495573769, 4069517037, 2549218298, 2663038764, 504708206, 2263041392, 3941167025, 2249088522, 1514023603, 1998579484, 1312622330, 694541497, 2582060303, 2151582166, 1382467621, 776784248, 2618340202, 3323268794, 2497899128, 2784771155, 503983604, 4076293799, 907881277, 423175695, 432175456, 1378068232, 4145222326, 3954048622, 3938656102, 3820766613, 2793130115, 2977904593, 26017576, 3274890735, 3194772133, 1700274565, 1756076034, 4006520079, 3677328699, 720338349, 1533947780, 354530856, 688349552, 3973924725, 1637815568, 332179504, 3949051286, 53804574, 2852348879, 3044236432, 1282449977, 3583942155, 3416972820, 4006381244, 1617046695, 2628476075, 3002303598, 1686838959, 431878346, 2686675385, 1700445008, 1080580658, 1009431731, 832498133, 3223435511, 2605976345, 2271191193, 2516031870, 1648197032, 4164389018, 2548247927, 300782431, 375919233, 238389289, 3353747414, 2531188641, 2019080857, 1475708069, 455242339, 2609103871, 448939670, 3451063019, 1395535956, 2413381860, 1841049896, 1491858159, 885456874, 4264095073, 4001119347, 1565136089, 3898914787, 1108368660, 540939232, 1173283510, 2745871338, 3681308437, 4207628240, 3343053890, 4016749493, 1699691293, 1103962373, 3625875870, 2256883143, 3830138730, 1031889488, 3479347698, 1535977030, 4236805024, 3251091107, 2132092099, 1774941330, 1199868427, 1452454533, 157007616, 2904115357, 342012276, 595725824, 1480756522, 206960106, 497939518, 591360097, 863170706, 2375253569, 3596610801, 1814182875, 2094937945, 3421402208, 1082520231, 3463918190, 2785509508, 435703966, 3908032597, 1641649973, 2842273706, 3305899714, 1510255612, 2148256476, 2655287854, 3276092548, 4258621189, 236887753, 3681803219, 274041037, 1734335097, 3815195456, 3317970021, 1899903192, 1026095262, 4050517792, 356393447, 2410691914, 3873677099, 3682840055 ]), new Uint32Array([ 3913112168, 2491498743, 4132185628, 2489919796, 1091903735, 1979897079, 3170134830, 3567386728, 3557303409, 857797738, 1136121015, 1342202287, 507115054, 2535736646, 337727348, 3213592640, 1301675037, 2528481711, 1895095763, 1721773893, 3216771564, 62756741, 2142006736, 835421444, 2531993523, 1442658625, 3659876326, 2882144922, 676362277, 1392781812, 170690266, 3921047035, 1759253602, 3611846912, 1745797284, 664899054, 1329594018, 3901205900, 3045908486, 2062866102, 2865634940, 3543621612, 3464012697, 1080764994, 553557557, 3656615353, 3996768171, 991055499, 499776247, 1265440854, 648242737, 3940784050, 980351604, 3713745714, 1749149687, 3396870395, 4211799374, 3640570775, 1161844396, 3125318951, 1431517754, 545492359, 4268468663, 3499529547, 1437099964, 2702547544, 3433638243, 2581715763, 2787789398, 1060185593, 1593081372, 2418618748, 4260947970, 69676912, 2159744348, 86519011, 2512459080, 3838209314, 1220612927, 3339683548, 133810670, 1090789135, 1078426020, 1569222167, 845107691, 3583754449, 4072456591, 1091646820, 628848692, 1613405280, 3757631651, 526609435, 236106946, 48312990, 2942717905, 3402727701, 1797494240, 859738849, 992217954, 4005476642, 2243076622, 3870952857, 3732016268, 765654824, 3490871365, 2511836413, 1685915746, 3888969200, 1414112111, 2273134842, 3281911079, 4080962846, 172450625, 2569994100, 980381355, 4109958455, 2819808352, 2716589560, 2568741196, 3681446669, 3329971472, 1835478071, 660984891, 3704678404, 4045999559, 3422617507, 3040415634, 1762651403, 1719377915, 3470491036, 2693910283, 3642056355, 3138596744, 1364962596, 2073328063, 1983633131, 926494387, 3423689081, 2150032023, 4096667949, 1749200295, 3328846651, 309677260, 2016342300, 1779581495, 3079819751, 111262694, 1274766160, 443224088, 298511866, 1025883608, 3806446537, 1145181785, 168956806, 3641502830, 3584813610, 1689216846, 3666258015, 3200248200, 1692713982, 2646376535, 4042768518, 1618508792, 1610833997, 3523052358, 4130873264, 2001055236, 3610705100, 2202168115, 4028541809, 2961195399, 1006657119, 2006996926, 3186142756, 1430667929, 3210227297, 1314452623, 4074634658, 4101304120, 2273951170, 1399257539, 3367210612, 3027628629, 1190975929, 2062231137, 2333990788, 2221543033, 2438960610, 1181637006, 548689776, 2362791313, 3372408396, 3104550113, 3145860560, 296247880, 1970579870, 3078560182, 3769228297, 1714227617, 3291629107, 3898220290, 166772364, 1251581989, 493813264, 448347421, 195405023, 2709975567, 677966185, 3703036547, 1463355134, 2715995803, 1338867538, 1343315457, 2802222074, 2684532164, 233230375, 2599980071, 2000651841, 3277868038, 1638401717, 4028070440, 3237316320, 6314154, 819756386, 300326615, 590932579, 1405279636, 3267499572, 3150704214, 2428286686, 3959192993, 3461946742, 1862657033, 1266418056, 963775037, 2089974820, 2263052895, 1917689273, 448879540, 3550394620, 3981727096, 150775221, 3627908307, 1303187396, 508620638, 2975983352, 2726630617, 1817252668, 1876281319, 1457606340, 908771278, 3720792119, 3617206836, 2455994898, 1729034894, 1080033504 ]), new Uint32Array([ 976866871, 3556439503, 2881648439, 1522871579, 1555064734, 1336096578, 3548522304, 2579274686, 3574697629, 3205460757, 3593280638, 3338716283, 3079412587, 564236357, 2993598910, 1781952180, 1464380207, 3163844217, 3332601554, 1699332808, 1393555694, 1183702653, 3581086237, 1288719814, 691649499, 2847557200, 2895455976, 3193889540, 2717570544, 1781354906, 1676643554, 2592534050, 3230253752, 1126444790, 2770207658, 2633158820, 2210423226, 2615765581, 2414155088, 3127139286, 673620729, 2805611233, 1269405062, 4015350505, 3341807571, 4149409754, 1057255273, 2012875353, 2162469141, 2276492801, 2601117357, 993977747, 3918593370, 2654263191, 753973209, 36408145, 2530585658, 25011837, 3520020182, 2088578344, 530523599, 2918365339, 1524020338, 1518925132, 3760827505, 3759777254, 1202760957, 3985898139, 3906192525, 674977740, 4174734889, 2031300136, 2019492241, 3983892565, 4153806404, 3822280332, 352677332, 2297720250, 60907813, 90501309, 3286998549, 1016092578, 2535922412, 2839152426, 457141659, 509813237, 4120667899, 652014361, 1966332200, 2975202805, 55981186, 2327461051, 676427537, 3255491064, 2882294119, 3433927263, 1307055953, 942726286, 933058658, 2468411793, 3933900994, 4215176142, 1361170020, 2001714738, 2830558078, 3274259782, 1222529897, 1679025792, 2729314320, 3714953764, 1770335741, 151462246, 3013232138, 1682292957, 1483529935, 471910574, 1539241949, 458788160, 3436315007, 1807016891, 3718408830, 978976581, 1043663428, 3165965781, 1927990952, 4200891579, 2372276910, 3208408903, 3533431907, 1412390302, 2931980059, 4132332400, 1947078029, 3881505623, 4168226417, 2941484381, 1077988104, 1320477388, 886195818, 18198404, 3786409e3, 2509781533, 112762804, 3463356488, 1866414978, 891333506, 18488651, 661792760, 1628790961, 3885187036, 3141171499, 876946877, 2693282273, 1372485963, 791857591, 2686433993, 3759982718, 3167212022, 3472953795, 2716379847, 445679433, 3561995674, 3504004811, 3574258232, 54117162, 3331405415, 2381918588, 3769707343, 4154350007, 1140177722, 4074052095, 668550556, 3214352940, 367459370, 261225585, 2610173221, 4209349473, 3468074219, 3265815641, 314222801, 3066103646, 3808782860, 282218597, 3406013506, 3773591054, 379116347, 1285071038, 846784868, 2669647154, 3771962079, 3550491691, 2305946142, 453669953, 1268987020, 3317592352, 3279303384, 3744833421, 2610507566, 3859509063, 266596637, 3847019092, 517658769, 3462560207, 3443424879, 370717030, 4247526661, 2224018117, 4143653529, 4112773975, 2788324899, 2477274417, 1456262402, 2901442914, 1517677493, 1846949527, 2295493580, 3734397586, 2176403920, 1280348187, 1908823572, 3871786941, 846861322, 1172426758, 3287448474, 3383383037, 1655181056, 3139813346, 901632758, 1897031941, 2986607138, 3066810236, 3447102507, 1393639104, 373351379, 950779232, 625454576, 3124240540, 4148612726, 2007998917, 544563296, 2244738638, 2330496472, 2058025392, 1291430526, 424198748, 50039436, 29584100, 3605783033, 2429876329, 2791104160, 1057563949, 3255363231, 3075367218, 3463963227, 1469046755, 985887462 ]) ], this.P = new Uint32Array([ 608135816, 2242054355, 320440878, 57701188, 2752067618, 698298832, 137296536, 3964562569, 1160258022, 953160567, 3193202383, 887688300, 3232508343, 3380367581, 1065670069, 3041331479, 2450970073, 2306472731 ]); }; function F(S, x8, i) { return (S[0][x8[i + 3]] + S[1][x8[i + 2]] ^ S[2][x8[i + 1]]) + S[3][x8[i]]; } function stream2word(data, databytes) { var i, temp = 0; for (i = 0; i < 4; i++, BLF_J++) BLF_J >= databytes && (BLF_J = 0), temp = temp << 8 | data[BLF_J]; return temp; } function bcrypt_hash(sha2pass, sha2salt, out) { var i, state = new Blowfish, cdata = new Uint32Array(8), ciphertext = new Uint8Array([ 79, 120, 121, 99, 104, 114, 111, 109, 97, 116, 105, 99, 66, 108, 111, 119, 102, 105, 115, 104, 83, 119, 97, 116, 68, 121, 110, 97, 109, 105, 116, 101 ]); for (state.expandstate(sha2salt, 64, sha2pass, 64), i = 0; i < 64; i++) state.expand0state(sha2salt, 64), state.expand0state(sha2pass, 64); for (i = 0; i < 8; i++) cdata[i] = stream2word(ciphertext, ciphertext.byteLength); for (i = 0; i < 64; i++) state.enc(cdata, cdata.byteLength / 8); for (i = 0; i < 8; i++) out[4 * i + 3] = cdata[i] >>> 24, out[4 * i + 2] = cdata[i] >>> 16, out[4 * i + 1] = cdata[i] >>> 8, out[4 * i + 0] = cdata[i]; } Blowfish.prototype.encipher = function(x, x8) { void 0 === x8 && (x8 = new Uint8Array(x.buffer), 0 !== x.byteOffset && (x8 = x8.subarray(x.byteOffset))), x[0] ^= this.P[0]; for (var i = 1; i < 16; i += 2) x[1] ^= F(this.S, x8, 0) ^ this.P[i], x[0] ^= F(this.S, x8, 4) ^ this.P[i + 1]; var t = x[0]; x[0] = x[1] ^ this.P[17], x[1] = t; }, Blowfish.prototype.decipher = function(x) { var x8 = new Uint8Array(x.buffer); 0 !== x.byteOffset && (x8 = x8.subarray(x.byteOffset)), x[0] ^= this.P[17]; for (var i = 16; i > 0; i -= 2) x[1] ^= F(this.S, x8, 0) ^ this.P[i], x[0] ^= F(this.S, x8, 4) ^ this.P[i - 1]; var t = x[0]; x[0] = x[1] ^ this.P[0], x[1] = t; }, Blowfish.prototype.expand0state = function(key, keybytes) { var i, k, d = new Uint32Array(2), d8 = new Uint8Array(d.buffer); for (i = 0, BLF_J = 0; i < 18; i++) this.P[i] ^= stream2word(key, keybytes); for (BLF_J = 0, i = 0; i < 18; i += 2) this.encipher(d, d8), this.P[i] = d[0], this.P[i + 1] = d[1]; for (i = 0; i < 4; i++) for (k = 0; k < 256; k += 2) this.encipher(d, d8), this.S[i][k] = d[0], this.S[i][k + 1] = d[1]; }, Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { var i, k, d = new Uint32Array(2); for (i = 0, BLF_J = 0; i < 18; i++) this.P[i] ^= stream2word(key, keybytes); for (i = 0, BLF_J = 0; i < 18; i += 2) d[0] ^= stream2word(data, databytes), d[1] ^= stream2word(data, databytes), this.encipher(d), this.P[i] = d[0], this.P[i + 1] = d[1]; for (i = 0; i < 4; i++) for (k = 0; k < 256; k += 2) d[0] ^= stream2word(data, databytes), d[1] ^= stream2word(data, databytes), this.encipher(d), this.S[i][k] = d[0], this.S[i][k + 1] = d[1]; BLF_J = 0; }, Blowfish.prototype.enc = function(data, blocks) { for (var i = 0; i < blocks; i++) this.encipher(data.subarray(2 * i)); }, Blowfish.prototype.dec = function(data, blocks) { for (var i = 0; i < blocks; i++) this.decipher(data.subarray(2 * i)); }, module.exports = { BLOCKS: 8, HASHSIZE: 32, hash: bcrypt_hash, pbkdf: function(pass, passlen, salt, saltlen, key, keylen, rounds) { var i, j, amt, stride, dest, count, sha2pass = new Uint8Array(64), sha2salt = new Uint8Array(64), out = new Uint8Array(32), tmpout = new Uint8Array(32), countsalt = new Uint8Array(saltlen + 4), origkeylen = keylen; if (rounds < 1) return -1; if (0 === passlen || 0 === saltlen || 0 === keylen || keylen > out.byteLength * out.byteLength || saltlen > 1 << 20) return -1; for (stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength), amt = Math.floor((keylen + stride - 1) / stride), i = 0; i < saltlen; i++) countsalt[i] = salt[i]; for (crypto_hash_sha512(sha2pass, pass, passlen), count = 1; keylen > 0; count++) { for (countsalt[saltlen + 0] = count >>> 24, countsalt[saltlen + 1] = count >>> 16, countsalt[saltlen + 2] = count >>> 8, countsalt[saltlen + 3] = count, crypto_hash_sha512(sha2salt, countsalt, saltlen + 4), bcrypt_hash(sha2pass, sha2salt, tmpout), i = out.byteLength; i--; ) out[i] = tmpout[i]; for (i = 1; i < rounds; i++) for (crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength), bcrypt_hash(sha2pass, sha2salt, tmpout), j = 0; j < out.byteLength; j++) out[j] ^= tmpout[j]; for (amt = Math.min(amt, keylen), i = 0; i < amt && !((dest = i * stride + (count - 1)) >= origkeylen); i++) key[dest] = out[i]; keylen -= i; } return 0; } }; }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { "string" != typeof buf && (assert.buffer(buf, "buf"), buf = buf.toString("ascii")); var trimmed = buf.trim().replace(/[\\\r]/g, ""), m = trimmed.match(SSHKEY_RE); m || (m = trimmed.match(SSHKEY_RE2)), assert.ok(m, "key must match regex"); var key, type = rfc4253.algToKeyType(m[1]), kbuf = Buffer.from(m[2], "base64"), ret = {}; if (m[4]) try { key = rfc4253.read(kbuf); } catch (e) { m = trimmed.match(SSHKEY_RE2), assert.ok(m, "key must match regex"), kbuf = Buffer.from(m[2], "base64"), key = rfc4253.readInternal(ret, "public", kbuf); } else key = rfc4253.readInternal(ret, "public", kbuf); if (assert.strictEqual(type, key.type), m[4] && m[4].length > 0) key.comment = m[4]; else if (ret.consumed) { var data = m[2] + (m[3] ? m[3] : ""), realOffset = 4 * Math.ceil(ret.consumed / 3); for (data = data.slice(0, realOffset - 2).replace(/[^a-zA-Z0-9+\/=]/g, "") + data.slice(realOffset - 2), ret.consumed % 3 > 0 && "=" !== data.slice(realOffset - 1, realOffset) && realOffset--; "=" === data.slice(realOffset, realOffset + 1); ) realOffset++; var trailer = data.slice(realOffset); (trailer = trailer.replace(/[\r\n]/g, " ").replace(/^\s+/, "")).match(/^[a-zA-Z0-9]/) && (key.comment = trailer); } return key; }, write: function(key, options) { if (assert.object(key), !Key.isKey(key)) throw new Error("Must be a public key"); var parts = [], alg = rfc4253.keyTypeToAlg(key); parts.push(alg); var buf = rfc4253.write(key); return parts.push(buf.toString("base64")), key.comment && parts.push(key.comment), Buffer.from(parts.join(" ")); } }; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, rfc4253 = __webpack_require__(63), Key = (__webpack_require__(28), __webpack_require__(27)), SSHKEY_RE = (__webpack_require__(29), __webpack_require__(165), /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/), SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/; }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { for (var parts, lines = buf.toString("ascii").split(/[\r\n]+/), found = !1, si = 0; si < lines.length; ) if ((parts = splitHeader(lines[si++])) && "putty-user-key-file-2" === parts[0].toLowerCase()) { found = !0; break; } if (!found) throw new Error("No PuTTY format first line found"); var alg = parts[1]; parts = splitHeader(lines[si++]), assert.equal(parts[0].toLowerCase(), "encryption"), parts = splitHeader(lines[si++]), assert.equal(parts[0].toLowerCase(), "comment"); var comment = parts[1]; parts = splitHeader(lines[si++]), assert.equal(parts[0].toLowerCase(), "public-lines"); var publicLines = parseInt(parts[1], 10); if (!isFinite(publicLines) || publicLines < 0 || publicLines > lines.length) throw new Error("Invalid public-lines count"); var publicBuf = Buffer.from(lines.slice(si, si + publicLines).join(""), "base64"), keyType = rfc4253.algToKeyType(alg), key = rfc4253.read(publicBuf); if (key.type !== keyType) throw new Error("Outer key algorithm mismatch"); return key.comment = comment, key; }, write: function(key, options) { if (assert.object(key), !Key.isKey(key)) throw new Error("Must be a public key"); var alg = rfc4253.keyTypeToAlg(key), buf = rfc4253.write(key), comment = key.comment || "", lines = (function(txt, len) { for (var lines = [], pos = 0; pos < txt.length; ) lines.push(txt.slice(pos, pos + 64)), pos += 64; return lines; })(buf.toString("base64")); return lines.unshift("Public-Lines: " + lines.length), lines.unshift("Comment: " + comment), lines.unshift("Encryption: none"), lines.unshift("PuTTY-User-Key-File-2: " + alg), Buffer.from(lines.join("\n") + "\n"); } }; var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, rfc4253 = __webpack_require__(63), Key = __webpack_require__(27); function splitHeader(line) { var idx = line.indexOf(":"); if (-1 === idx) return null; var header = line.slice(0, idx); for (++idx; " " === line[idx]; ) ++idx; return [ header, line.slice(idx) ]; } __webpack_require__(48); }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { "string" == typeof buf && (buf = Buffer.from(buf, "binary")), assert.buffer(buf, "buf"); var der = new asn1.BerReader(buf); if (der.readSequence(), Math.abs(der.length - der.remain) > 1) throw new Error("DER sequence does not contain whole byte stream"); var tbsStart = der.offset; der.readSequence(); var sigOffset = der.offset + der.length, tbsEnd = sigOffset; if (der.peek() === Local(0)) { der.readSequence(Local(0)); var version = der.readInt(); assert.ok(version <= 3, "only x.509 versions up to v3 supported"); } var cert = { signatures: {} }, sig = cert.signatures.x509 = {}; sig.extras = {}, cert.serial = (function(der, nm) { return assert.strictEqual(der.peek(), asn1.Ber.Integer, "serial is not an Integer"), utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)); })(der), der.readSequence(); var after = der.offset + der.length, certAlgOid = der.readOID(); if (void 0 === SIGN_ALGS[certAlgOid]) throw new Error("unknown signature algorithm " + certAlgOid); if (der._offset = after, cert.issuer = Identity.parseAsn1(der), der.readSequence(), cert.validFrom = readDate(der), cert.validUntil = readDate(der), cert.subjects = [ Identity.parseAsn1(der) ], der.readSequence(), after = der.offset + der.length, cert.subjectKey = pkcs8.readPkcs8(void 0, "public", der), der._offset = after, der.peek() === Local(1) && (der.readSequence(Local(1)), sig.extras.issuerUniqueID = buf.slice(der.offset, der.offset + der.length), der._offset += der.length), der.peek() === Local(2) && (der.readSequence(Local(2)), sig.extras.subjectUniqueID = buf.slice(der.offset, der.offset + der.length), der._offset += der.length), der.peek() === Local(3)) { der.readSequence(Local(3)); var extEnd = der.offset + der.length; for (der.readSequence(); der.offset < extEnd; ) readExtension(cert, buf, der); assert.strictEqual(der.offset, extEnd); } assert.strictEqual(der.offset, sigOffset), der.readSequence(), after = der.offset + der.length; var sigAlgOid = der.readOID(), sigAlg = SIGN_ALGS[sigAlgOid]; if (void 0 === sigAlg) throw new Error("unknown signature algorithm " + sigAlgOid); der._offset = after; var sigData = der.readString(asn1.Ber.BitString, !0); 0 === sigData[0] && (sigData = sigData.slice(1)); var algParts = sigAlg.split("-"); return sig.signature = Signature.parse(sigData, algParts[0], "asn1"), sig.signature.hashAlgorithm = algParts[1], sig.algo = sigAlg, sig.cache = buf.slice(tbsStart, tbsEnd), new Certificate(cert); }, verify: function(cert, key) { var sig = cert.signatures.x509; assert.object(sig, "x509 signature"); var algParts = sig.algo.split("-"); if (algParts[0] !== key.type) return !1; var blob = sig.cache; if (void 0 === blob) { var der = new asn1.BerWriter; writeTBSCert(cert, der), blob = der.buffer; } var verifier = key.createVerify(algParts[1]); return verifier.write(blob), verifier.verify(sig.signature); }, sign: function(cert, key) { void 0 === cert.signatures.x509 && (cert.signatures.x509 = {}); var sig = cert.signatures.x509; if (sig.algo = key.type + "-" + key.defaultHashAlgorithm(), void 0 === SIGN_ALGS[sig.algo]) return !1; var der = new asn1.BerWriter; writeTBSCert(cert, der); var blob = der.buffer; sig.cache = blob; var signer = key.createSign(); return signer.write(blob), cert.signatures.x509.signature = signer.sign(), !0; }, signAsync: function(cert, signer, done) { void 0 === cert.signatures.x509 && (cert.signatures.x509 = {}); var sig = cert.signatures.x509, der = new asn1.BerWriter; writeTBSCert(cert, der); var blob = der.buffer; sig.cache = blob, signer(blob, (function(err, signature) { err ? done(err) : (sig.algo = signature.type + "-" + signature.hashAlgorithm, void 0 !== SIGN_ALGS[sig.algo] ? (sig.signature = signature, done()) : done(new Error('Invalid signing algorithm "' + sig.algo + '"'))); })); }, write: function(cert, options) { var sig = cert.signatures.x509; assert.object(sig, "x509 signature"); var der = new asn1.BerWriter; der.startSequence(), sig.cache ? (der._ensure(sig.cache.length), sig.cache.copy(der._buf, der._offset), der._offset += sig.cache.length) : writeTBSCert(cert, der), der.startSequence(), der.writeOID(SIGN_ALGS[sig.algo]), sig.algo.match(/^rsa-/) && der.writeNull(), der.endSequence(); var sigData = sig.signature.toBuffer("asn1"), data = Buffer.alloc(sigData.length + 1); return data[0] = 0, sigData.copy(data, 1), der.writeBuffer(data, asn1.Ber.BitString), der.endSequence(), der.buffer; } }; var assert = __webpack_require__(15), asn1 = __webpack_require__(54), Buffer = __webpack_require__(14).Buffer, utils = (__webpack_require__(31), __webpack_require__(28)), Identity = (__webpack_require__(27), __webpack_require__(29), __webpack_require__(62), __webpack_require__(115)), Signature = __webpack_require__(53), Certificate = __webpack_require__(114), pkcs8 = __webpack_require__(113); function Local(i) { return asn1.Ber.Context | asn1.Ber.Constructor | i; } function Context(i) { return asn1.Ber.Context | i; } var SIGN_ALGS = { "rsa-md5": "1.2.840.113549.1.1.4", "rsa-sha1": "1.2.840.113549.1.1.5", "rsa-sha256": "1.2.840.113549.1.1.11", "rsa-sha384": "1.2.840.113549.1.1.12", "rsa-sha512": "1.2.840.113549.1.1.13", "dsa-sha1": "1.2.840.10040.4.3", "dsa-sha256": "2.16.840.1.101.3.4.3.2", "ecdsa-sha1": "1.2.840.10045.4.1", "ecdsa-sha256": "1.2.840.10045.4.3.2", "ecdsa-sha384": "1.2.840.10045.4.3.3", "ecdsa-sha512": "1.2.840.10045.4.3.4", "ed25519-sha512": "1.3.101.112" }; Object.keys(SIGN_ALGS).forEach((function(k) { SIGN_ALGS[SIGN_ALGS[k]] = k; })), SIGN_ALGS["1.3.14.3.2.3"] = "rsa-md5", SIGN_ALGS["1.3.14.3.2.29"] = "rsa-sha1"; function readDate(der) { if (der.peek() === asn1.Ber.UTCTime) return (function(t) { var m = t.match(UTCTIME_RE); assert.ok(m, "timestamps must be in UTC"); var d = new Date, thisYear = d.getUTCFullYear(), century = 100 * Math.floor(thisYear / 100), year = parseInt(m[1], 10); return year += thisYear % 100 < 50 && year >= 60 ? century - 1 : century, d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)), d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)), m[6] && m[6].length > 0 && d.setUTCSeconds(parseInt(m[6], 10)), d; })(der.readString(asn1.Ber.UTCTime)); if (der.peek() === asn1.Ber.GeneralizedTime) return (function(t) { var m = t.match(GTIME_RE); assert.ok(m); var d = new Date; return d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, parseInt(m[3], 10)), d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)), m[6] && m[6].length > 0 && d.setUTCSeconds(parseInt(m[6], 10)), d; })(der.readString(asn1.Ber.GeneralizedTime)); throw new Error("Unsupported date format"); } function writeDate(der, date) { var d, s; date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950 ? der.writeString((s = "", s += zeroPad((d = date).getUTCFullYear(), 4), s += zeroPad(d.getUTCMonth() + 1), s += zeroPad(d.getUTCDate()), s += zeroPad(d.getUTCHours()), s += zeroPad(d.getUTCMinutes()), s += zeroPad(d.getUTCSeconds()), s += "Z"), asn1.Ber.GeneralizedTime) : der.writeString((function(d) { var s = ""; return s += zeroPad(d.getUTCFullYear() % 100), s += zeroPad(d.getUTCMonth() + 1), s += zeroPad(d.getUTCDate()), s += zeroPad(d.getUTCHours()), s += zeroPad(d.getUTCMinutes()), s += zeroPad(d.getUTCSeconds()), s += "Z"; })(date), asn1.Ber.UTCTime); } var ALTNAME = { OtherName: Local(0), RFC822Name: Context(1), DNSName: Context(2), X400Address: Local(3), DirectoryName: Local(4), EDIPartyName: Local(5), URI: Context(6), IPAddress: Context(7), OID: Context(8) }, EXTPURPOSE = { serverAuth: "1.3.6.1.5.5.7.3.1", clientAuth: "1.3.6.1.5.5.7.3.2", codeSigning: "1.3.6.1.5.5.7.3.3", joyentDocker: "1.3.6.1.4.1.38678.1.4.1", joyentCmon: "1.3.6.1.4.1.38678.1.4.2" }, EXTPURPOSE_REV = {}; Object.keys(EXTPURPOSE).forEach((function(k) { EXTPURPOSE_REV[EXTPURPOSE[k]] = k; })); var KEYUSEBITS = [ "signature", "identity", "keyEncryption", "encryption", "keyAgreement", "ca", "crl" ]; function readExtension(cert, buf, der) { der.readSequence(); var id, critical, after = der.offset + der.length, extId = der.readOID(), sig = cert.signatures.x509; switch (sig.extras.exts || (sig.extras.exts = []), der.peek() === asn1.Ber.Boolean && (critical = der.readBoolean()), extId) { case "2.5.29.19": der.readSequence(asn1.Ber.OctetString), der.readSequence(); var bcEnd = der.offset + der.length, ca = !1; der.peek() === asn1.Ber.Boolean && (ca = der.readBoolean()), void 0 === cert.purposes && (cert.purposes = []), !0 === ca && cert.purposes.push("ca"); var bc = { oid: extId, critical: critical }; der.offset < bcEnd && der.peek() === asn1.Ber.Integer && (bc.pathLen = der.readInt()), sig.extras.exts.push(bc); break; case "2.5.29.37": der.readSequence(asn1.Ber.OctetString), der.readSequence(), void 0 === cert.purposes && (cert.purposes = []); for (var ekEnd = der.offset + der.length; der.offset < ekEnd; ) { var oid = der.readOID(); cert.purposes.push(EXTPURPOSE_REV[oid] || oid); } -1 !== cert.purposes.indexOf("serverAuth") && -1 === cert.purposes.indexOf("clientAuth") ? cert.subjects.forEach((function(ide) { "host" !== ide.type && (ide.type = "host", ide.hostname = ide.uid || ide.email || ide.components[0].value); })) : -1 !== cert.purposes.indexOf("clientAuth") && -1 === cert.purposes.indexOf("serverAuth") && cert.subjects.forEach((function(ide) { "user" !== ide.type && (ide.type = "user", ide.uid = ide.hostname || ide.email || ide.components[0].value); })), sig.extras.exts.push({ oid: extId, critical: critical }); break; case "2.5.29.15": der.readSequence(asn1.Ber.OctetString); var bits = der.readString(asn1.Ber.BitString, !0), setBits = (function(bits, bitIndex) { for (var bitLen = 8 * (bits.length - 1) - bits[0], setBits = {}, i = 0; i < bitLen; ++i) { var mask = 1 << 7 - i % 8, bitVal = 0 != (bits[1 + Math.floor(i / 8)] & mask), name = bitIndex[i]; bitVal && "string" == typeof name && (setBits[name] = !0); } return Object.keys(setBits); })(bits, KEYUSEBITS); setBits.forEach((function(bit) { void 0 === cert.purposes && (cert.purposes = []), -1 === cert.purposes.indexOf(bit) && cert.purposes.push(bit); })), sig.extras.exts.push({ oid: extId, critical: critical, bits: bits }); break; case "2.5.29.17": der.readSequence(asn1.Ber.OctetString), der.readSequence(); for (var aeEnd = der.offset + der.length; der.offset < aeEnd; ) switch (der.peek()) { case ALTNAME.OtherName: case ALTNAME.EDIPartyName: der.readSequence(), der._offset += der.length; break; case ALTNAME.OID: der.readOID(ALTNAME.OID); break; case ALTNAME.RFC822Name: var email = der.readString(ALTNAME.RFC822Name); id = Identity.forEmail(email), cert.subjects[0].equals(id) || cert.subjects.push(id); break; case ALTNAME.DirectoryName: der.readSequence(ALTNAME.DirectoryName), id = Identity.parseAsn1(der), cert.subjects[0].equals(id) || cert.subjects.push(id); break; case ALTNAME.DNSName: var host = der.readString(ALTNAME.DNSName); id = Identity.forHost(host), cert.subjects[0].equals(id) || cert.subjects.push(id); break; default: der.readString(der.peek()); } sig.extras.exts.push({ oid: extId, critical: critical }); break; default: sig.extras.exts.push({ oid: extId, critical: critical, data: der.readString(asn1.Ber.OctetString, !0) }); } der._offset = after; } var UTCTIME_RE = /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/, GTIME_RE = /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; function zeroPad(n, m) { void 0 === m && (m = 2); for (var s = "" + n; s.length < m; ) s = "0" + s; return s; } function writeTBSCert(cert, der) { var sig = cert.signatures.x509; assert.object(sig, "x509 signature"), der.startSequence(), der.startSequence(Local(0)), der.writeInt(2), der.endSequence(), der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer), der.startSequence(), der.writeOID(SIGN_ALGS[sig.algo]), sig.algo.match(/^rsa-/) && der.writeNull(), der.endSequence(), cert.issuer.toAsn1(der), der.startSequence(), writeDate(der, cert.validFrom), writeDate(der, cert.validUntil), der.endSequence(); var subject = cert.subjects[0], altNames = cert.subjects.slice(1); if (subject.toAsn1(der), pkcs8.writePkcs8(der, cert.subjectKey), sig.extras && sig.extras.issuerUniqueID && der.writeBuffer(sig.extras.issuerUniqueID, Local(1)), sig.extras && sig.extras.subjectUniqueID && der.writeBuffer(sig.extras.subjectUniqueID, Local(2)), altNames.length > 0 || "host" === subject.type || void 0 !== cert.purposes && cert.purposes.length > 0 || sig.extras && sig.extras.exts) { der.startSequence(Local(3)), der.startSequence(); var exts = []; void 0 !== cert.purposes && cert.purposes.length > 0 && (exts.push({ oid: "2.5.29.19", critical: !0 }), exts.push({ oid: "2.5.29.15", critical: !0 }), exts.push({ oid: "2.5.29.37", critical: !0 })), exts.push({ oid: "2.5.29.17" }), sig.extras && sig.extras.exts && (exts = sig.extras.exts); for (var i = 0; i < exts.length; ++i) { if (der.startSequence(), der.writeOID(exts[i].oid), void 0 !== exts[i].critical && der.writeBoolean(exts[i].critical), "2.5.29.17" === exts[i].oid) { der.startSequence(asn1.Ber.OctetString), der.startSequence(), "host" === subject.type && der.writeString(subject.hostname, Context(2)); for (var j = 0; j < altNames.length; ++j) "host" === altNames[j].type ? der.writeString(altNames[j].hostname, ALTNAME.DNSName) : "email" === altNames[j].type ? der.writeString(altNames[j].email, ALTNAME.RFC822Name) : (der.startSequence(ALTNAME.DirectoryName), altNames[j].toAsn1(der), der.endSequence()); der.endSequence(), der.endSequence(); } else if ("2.5.29.19" === exts[i].oid) { der.startSequence(asn1.Ber.OctetString), der.startSequence(); var ca = -1 !== cert.purposes.indexOf("ca"), pathLen = exts[i].pathLen; der.writeBoolean(ca), void 0 !== pathLen && der.writeInt(pathLen), der.endSequence(), der.endSequence(); } else if ("2.5.29.37" === exts[i].oid) der.startSequence(asn1.Ber.OctetString), der.startSequence(), cert.purposes.forEach((function(purpose) { if ("ca" !== purpose && -1 === KEYUSEBITS.indexOf(purpose)) { var oid = purpose; void 0 !== EXTPURPOSE[purpose] && (oid = EXTPURPOSE[purpose]), der.writeOID(oid); } })), der.endSequence(), der.endSequence(); else if ("2.5.29.15" === exts[i].oid) { if (der.startSequence(asn1.Ber.OctetString), void 0 !== exts[i].bits) der.writeBuffer(exts[i].bits, asn1.Ber.BitString); else { var bits = writeBitField(cert.purposes, KEYUSEBITS); der.writeBuffer(bits, asn1.Ber.BitString); } der.endSequence(); } else der.writeBuffer(exts[i].data, asn1.Ber.OctetString); der.endSequence(); } der.endSequence(), der.endSequence(); } der.endSequence(); } function writeBitField(setBits, bitIndex) { var bitLen = bitIndex.length, blen = Math.ceil(bitLen / 8), unused = 8 * blen - bitLen, bits = Buffer.alloc(1 + blen); bits[0] = unused; for (var i = 0; i < bitLen; ++i) { var byteN = 1 + Math.floor(i / 8), mask = 1 << 7 - i % 8, name = bitIndex[i]; void 0 !== name && -1 !== setBits.indexOf(name) && (bits[byteN] |= mask); } return bits; } }, function(module, exports, __webpack_require__) { var util = __webpack_require__(0), Stream = __webpack_require__(3).Stream, DelayedStream = __webpack_require__(1155); function CombinedStream() { this.writable = !1, this.readable = !0, this.dataSize = 0, this.maxDataSize = 2097152, this.pauseStreams = !0, this._released = !1, this._streams = [], this._currentStream = null, this._insideLoop = !1, this._pendingNext = !1; } module.exports = CombinedStream, util.inherits(CombinedStream, Stream), CombinedStream.create = function(options) { var combinedStream = new this; for (var option in options = options || {}) combinedStream[option] = options[option]; return combinedStream; }, CombinedStream.isStreamLike = function(stream) { return "function" != typeof stream && "string" != typeof stream && "boolean" != typeof stream && "number" != typeof stream && !Buffer.isBuffer(stream); }, CombinedStream.prototype.append = function(stream) { if (CombinedStream.isStreamLike(stream)) { if (!(stream instanceof DelayedStream)) { var newStream = DelayedStream.create(stream, { maxDataSize: 1 / 0, pauseStream: this.pauseStreams }); stream.on("data", this._checkDataSize.bind(this)), stream = newStream; } this._handleErrors(stream), this.pauseStreams && stream.pause(); } return this._streams.push(stream), this; }, CombinedStream.prototype.pipe = function(dest, options) { return Stream.prototype.pipe.call(this, dest, options), this.resume(), dest; }, CombinedStream.prototype._getNext = function() { if (this._currentStream = null, this._insideLoop) this._pendingNext = !0; else { this._insideLoop = !0; try { do { this._pendingNext = !1, this._realGetNext(); } while (this._pendingNext); } finally { this._insideLoop = !1; } } }, CombinedStream.prototype._realGetNext = function() { var stream = this._streams.shift(); void 0 !== stream ? "function" == typeof stream ? stream(function(stream) { CombinedStream.isStreamLike(stream) && (stream.on("data", this._checkDataSize.bind(this)), this._handleErrors(stream)), this._pipeNext(stream); }.bind(this)) : this._pipeNext(stream) : this.end(); }, CombinedStream.prototype._pipeNext = function(stream) { if (this._currentStream = stream, CombinedStream.isStreamLike(stream)) return stream.on("end", this._getNext.bind(this)), void stream.pipe(this, { end: !1 }); var value = stream; this.write(value), this._getNext(); }, CombinedStream.prototype._handleErrors = function(stream) { var self = this; stream.on("error", (function(err) { self._emitError(err); })); }, CombinedStream.prototype.write = function(data) { this.emit("data", data); }, CombinedStream.prototype.pause = function() { this.pauseStreams && (this.pauseStreams && this._currentStream && "function" == typeof this._currentStream.pause && this._currentStream.pause(), this.emit("pause")); }, CombinedStream.prototype.resume = function() { this._released || (this._released = !0, this.writable = !0, this._getNext()), this.pauseStreams && this._currentStream && "function" == typeof this._currentStream.resume && this._currentStream.resume(), this.emit("resume"); }, CombinedStream.prototype.end = function() { this._reset(), this.emit("end"); }, CombinedStream.prototype.destroy = function() { this._reset(), this.emit("close"); }, CombinedStream.prototype._reset = function() { this.writable = !1, this._streams = [], this._currentStream = null; }, CombinedStream.prototype._checkDataSize = function() { if (this._updateDataSize(), !(this.dataSize <= this.maxDataSize)) { var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; this._emitError(new Error(message)); } }, CombinedStream.prototype._updateDataSize = function() { this.dataSize = 0; var self = this; this._streams.forEach((function(stream) { stream.dataSize && (self.dataSize += stream.dataSize); })), this._currentStream && this._currentStream.dataSize && (this.dataSize += this._currentStream.dataSize); }, CombinedStream.prototype._emitError = function(err) { this._reset(), this.emit("error", err); }; }, function(module, exports, __webpack_require__) { var async = __webpack_require__(529), abort = __webpack_require__(530); module.exports = function(list, iterator, state, callback) { var key = state.keyedList ? state.keyedList[state.index] : state.index; state.jobs[key] = (function(iterator, key, item, callback) { return 2 == iterator.length ? iterator(item, async(callback)) : iterator(item, key, async(callback)); })(iterator, key, list[key], (function(error, output) { key in state.jobs && (delete state.jobs[key], error ? abort(state) : state.results[key] = output, callback(error, state.results)); })); }; }, function(module, exports, __webpack_require__) { var defer = __webpack_require__(1158); module.exports = function(callback) { var isAsync = !1; return defer((function() { isAsync = !0; })), function(err, result) { isAsync ? callback(err, result) : defer((function() { callback(err, result); })); }; }; }, function(module, exports) { function clean(key) { "function" == typeof this.jobs[key] && this.jobs[key](); } module.exports = function(state) { Object.keys(state.jobs).forEach(clean.bind(state)), state.jobs = {}; }; }, function(module, exports) { module.exports = function(list, sortMethod) { var isNamedList = !Array.isArray(list), initState = { index: 0, keyedList: isNamedList || sortMethod ? Object.keys(list) : null, jobs: {}, results: isNamedList ? {} : [], size: isNamedList ? Object.keys(list).length : list.length }; return sortMethod && initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { return sortMethod(list[a], list[b]); }), initState; }; }, function(module, exports, __webpack_require__) { var abort = __webpack_require__(530), async = __webpack_require__(529); module.exports = function(callback) { Object.keys(this.jobs).length && (this.index = this.size, abort(this), async(callback)(null, this.results)); }; }, function(module, exports, __webpack_require__) { var iterate = __webpack_require__(528), initState = __webpack_require__(531), terminator = __webpack_require__(532); function ascending(a, b) { return a < b ? -1 : a > b ? 1 : 0; } module.exports = function(list, iterator, sortMethod, callback) { var state = initState(list, sortMethod); return iterate(list, iterator, state, (function iteratorHandler(error, result) { error ? callback(error, result) : (state.index++, state.index < (state.keyedList || list).length ? iterate(list, iterator, state, iteratorHandler) : callback(null, state.results)); })), terminator.bind(state, callback); }, module.exports.ascending = ascending, module.exports.descending = function(a, b) { return -1 * ascending(a, b); }; }, function(module, exports, __webpack_require__) { var stream = __webpack_require__(3); function isStream(obj) { return obj instanceof stream.Stream; } function isReadable(obj) { return isStream(obj) && "function" == typeof obj._read && "object" == typeof obj._readableState; } function isWritable(obj) { return isStream(obj) && "function" == typeof obj._write && "object" == typeof obj._writableState; } module.exports = isStream, module.exports.isReadable = isReadable, module.exports.isWritable = isWritable, module.exports.isDuplex = function(obj) { return isReadable(obj) && isWritable(obj); }; }, function(module, exports, __webpack_require__) { "use strict"; var stringify = __webpack_require__(1163), parse = __webpack_require__(1164), formats = __webpack_require__(537); module.exports = { formats: formats, parse: parse, stringify: stringify }; }, function(module, exports, __webpack_require__) { "use strict"; var has = Object.prototype.hasOwnProperty, hexTable = (function() { for (var array = [], i = 0; i < 256; ++i) array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); return array; })(), arrayToObject = function(source, options) { for (var obj = options && options.plainObjects ? Object.create(null) : {}, i = 0; i < source.length; ++i) void 0 !== source[i] && (obj[i] = source[i]); return obj; }; module.exports = { arrayToObject: arrayToObject, assign: function(target, source) { return Object.keys(source).reduce((function(acc, key) { return acc[key] = source[key], acc; }), target); }, compact: function(value) { for (var queue = [ { obj: { o: value }, prop: "o" } ], refs = [], i = 0; i < queue.length; ++i) for (var item = queue[i], obj = item.obj[item.prop], keys = Object.keys(obj), j = 0; j < keys.length; ++j) { var key = keys[j], val = obj[key]; "object" == typeof val && null !== val && -1 === refs.indexOf(val) && (queue.push({ obj: obj, prop: key }), refs.push(val)); } return (function(queue) { for (var obj; queue.length; ) { var item = queue.pop(); if (obj = item.obj[item.prop], Array.isArray(obj)) { for (var compacted = [], j = 0; j < obj.length; ++j) void 0 !== obj[j] && compacted.push(obj[j]); item.obj[item.prop] = compacted; } } return obj; })(queue); }, decode: function(str) { try { return decodeURIComponent(str.replace(/\+/g, " ")); } catch (e) { return str; } }, encode: function(str) { if (0 === str.length) return str; for (var string = "string" == typeof str ? str : String(str), out = "", i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); 45 === c || 46 === c || 95 === c || 126 === c || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 ? out += string.charAt(i) : c < 128 ? out += hexTable[c] : c < 2048 ? out += hexTable[192 | c >> 6] + hexTable[128 | 63 & c] : c < 55296 || c >= 57344 ? out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | 63 & c] : (i += 1, c = 65536 + ((1023 & c) << 10 | 1023 & string.charCodeAt(i)), out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | 63 & c]); } return out; }, isBuffer: function(obj) { return null != obj && !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }, isRegExp: function(obj) { return "[object RegExp]" === Object.prototype.toString.call(obj); }, merge: function merge(target, source, options) { if (!source) return target; if ("object" != typeof source) { if (Array.isArray(target)) target.push(source); else { if ("object" != typeof target) return [ target, source ]; (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) && (target[source] = !0); } return target; } if ("object" != typeof target) return [ target ].concat(source); var mergeTarget = target; return Array.isArray(target) && !Array.isArray(source) && (mergeTarget = arrayToObject(target, options)), Array.isArray(target) && Array.isArray(source) ? (source.forEach((function(item, i) { has.call(target, i) ? target[i] && "object" == typeof target[i] ? target[i] = merge(target[i], item, options) : target.push(item) : target[i] = item; })), target) : Object.keys(source).reduce((function(acc, key) { var value = source[key]; return has.call(acc, key) ? acc[key] = merge(acc[key], value, options) : acc[key] = value, acc; }), mergeTarget); } }; }, function(module, exports, __webpack_require__) { "use strict"; var replace = String.prototype.replace, percentTwenties = /%20/g; module.exports = { default: "RFC3986", formatters: { RFC1738: function(value) { return replace.call(value, percentTwenties, "+"); }, RFC3986: function(value) { return value; } }, RFC1738: "RFC1738", RFC3986: "RFC3986" }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(91); module.exports = function(obj) { util.copy(obj, this); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(data, opts) { opts || (opts = {}), "function" == typeof opts && (opts = { cmp: opts }); var f, cycles = "boolean" == typeof opts.cycles && opts.cycles, cmp = opts.cmp && (f = opts.cmp, function(node) { return function(a, b) { var aobj = { key: a, value: node[a] }, bobj = { key: b, value: node[b] }; return f(aobj, bobj); }; }), seen = []; return (function stringify(node) { if (node && node.toJSON && "function" == typeof node.toJSON && (node = node.toJSON()), void 0 !== node) { if ("number" == typeof node) return isFinite(node) ? "" + node : "null"; if ("object" != typeof node) return JSON.stringify(node); var i, out; if (Array.isArray(node)) { for (out = "[", i = 0; i < node.length; i++) i && (out += ","), out += stringify(node[i]) || "null"; return out + "]"; } if (null === node) return "null"; if (-1 !== seen.indexOf(node)) { if (cycles) return JSON.stringify("__cycle__"); throw new TypeError("Converting circular structure to JSON"); } var seenIndex = seen.push(node) - 1, keys = Object.keys(node).sort(cmp && cmp(node)); for (out = "", i = 0; i < keys.length; i++) { var key = keys[i], value = stringify(node[key]); value && (out && (out += ","), out += JSON.stringify(key) + ":" + value); } return seen.splice(seenIndex, 1), "{" + out + "}"; } })(data); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = "", $async = !0 === it.schema.$async, $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, "$ref"), $id = it.self._getId(it.schema); if (it.opts.strictKeywords) { var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); if ($unknownKwd) { var $keywordsMsg = "unknown keyword: " + $unknownKwd; if ("log" !== it.opts.strictKeywords) throw new Error($keywordsMsg); it.logger.warn($keywordsMsg); } } if (it.isTop && (out += " var validate = ", $async && (it.async = !0, out += "async "), out += "function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ", $id && (it.opts.sourceCode || it.opts.processCode) && (out += " /*# sourceURL=" + $id + " */ ")), "boolean" == typeof it.schema || !$refKeywords && !it.schema.$ref) { var $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema["false schema"], $schemaPath = it.schemaPath + it.util.getProperty("false schema"), $errSchemaPath = it.errSchemaPath + "/false schema", $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl; if (!1 === it.schema) { it.isTop ? $breakOnError = !0 : out += " var " + $valid + " = false; ", ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'false schema' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ", !1 !== it.opts.messages && (out += " , message: 'boolean schema is false' "), it.opts.verbose && (out += " , schema: false , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; } else it.isTop ? out += $async ? " return data; " : " validate.errors = null; return true; " : out += " var " + $valid + " = true; "; return it.isTop && (out += " }; return validate; "), out; } if (it.isTop) { var $top = it.isTop; if ($lvl = it.level = 0, $dataLvl = it.dataLevel = 0, $data = "data", it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)), it.baseId = it.baseId || it.rootId, delete it.isTop, it.dataPathArr = [ void 0 ], void 0 !== it.schema.default && it.opts.useDefaults && it.opts.strictDefaults) { var $defaultMsg = "default is ignored in the schema root"; if ("log" !== it.opts.strictDefaults) throw new Error($defaultMsg); it.logger.warn($defaultMsg); } out += " var vErrors = null; ", out += " var errors = 0; ", out += " if (rootData === undefined) rootData = data; "; } else { if ($lvl = it.level, $data = "data" + (($dataLvl = it.dataLevel) || ""), $id && (it.baseId = it.resolve.url(it.baseId, $id)), $async && !it.async) throw new Error("async schema in sync schema"); out += " var errs_" + $lvl + " = errors;"; } $valid = "valid" + $lvl, $breakOnError = !it.opts.allErrors; var $closingBraces1 = "", $closingBraces2 = "", $typeSchema = it.schema.type, $typeIsArray = Array.isArray($typeSchema); if ($typeSchema && it.opts.nullable && !0 === it.schema.nullable && ($typeIsArray ? -1 == $typeSchema.indexOf("null") && ($typeSchema = $typeSchema.concat("null")) : "null" != $typeSchema && ($typeSchema = [ $typeSchema, "null" ], $typeIsArray = !0)), $typeIsArray && 1 == $typeSchema.length && ($typeSchema = $typeSchema[0], $typeIsArray = !1), it.schema.$ref && $refKeywords) { if ("fail" == it.opts.extendRefs) throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); !0 !== it.opts.extendRefs && ($refKeywords = !1, it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"')); } if (it.schema.$comment && it.opts.$comment && (out += " " + it.RULES.all.$comment.code(it, "$comment")), $typeSchema) { if (it.opts.coerceTypes) var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); var $rulesGroup = it.RULES.types[$typeSchema]; if ($coerceToTypes || $typeIsArray || !0 === $rulesGroup || $rulesGroup && !$shouldUseGroup($rulesGroup)) { $schemaPath = it.schemaPath + ".type", $errSchemaPath = it.errSchemaPath + "/type", $schemaPath = it.schemaPath + ".type", $errSchemaPath = it.errSchemaPath + "/type"; var $method = $typeIsArray ? "checkDataTypes" : "checkDataType"; if (out += " if (" + it.util[$method]($typeSchema, $data, !0) + ") { ", $coerceToTypes) { var $dataType = "dataType" + $lvl, $coerced = "coerced" + $lvl; out += " var " + $dataType + " = typeof " + $data + "; ", "array" == it.opts.coerceTypes && (out += " if (" + $dataType + " == 'object' && Array.isArray(" + $data + ")) " + $dataType + " = 'array'; "), out += " var " + $coerced + " = undefined; "; var $bracesCoercion = "", arr1 = $coerceToTypes; if (arr1) for (var $type, $i = -1, l1 = arr1.length - 1; $i < l1; ) $type = arr1[$i += 1], $i && (out += " if (" + $coerced + " === undefined) { ", $bracesCoercion += "}"), "array" == it.opts.coerceTypes && "array" != $type && (out += " if (" + $dataType + " == 'array' && " + $data + ".length == 1) { " + $coerced + " = " + $data + " = " + $data + "[0]; " + $dataType + " = typeof " + $data + "; } "), "string" == $type ? out += " if (" + $dataType + " == 'number' || " + $dataType + " == 'boolean') " + $coerced + " = '' + " + $data + "; else if (" + $data + " === null) " + $coerced + " = ''; " : "number" == $type || "integer" == $type ? (out += " if (" + $dataType + " == 'boolean' || " + $data + " === null || (" + $dataType + " == 'string' && " + $data + " && " + $data + " == +" + $data + " ", "integer" == $type && (out += " && !(" + $data + " % 1)"), out += ")) " + $coerced + " = +" + $data + "; ") : "boolean" == $type ? out += " if (" + $data + " === 'false' || " + $data + " === 0 || " + $data + " === null) " + $coerced + " = false; else if (" + $data + " === 'true' || " + $data + " === 1) " + $coerced + " = true; " : "null" == $type ? out += " if (" + $data + " === '' || " + $data + " === 0 || " + $data + " === false) " + $coerced + " = null; " : "array" == it.opts.coerceTypes && "array" == $type && (out += " if (" + $dataType + " == 'string' || " + $dataType + " == 'number' || " + $dataType + " == 'boolean' || " + $data + " == null) " + $coerced + " = [" + $data + "]; "); out += " " + $bracesCoercion + " if (" + $coerced + " === undefined) { ", ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'type' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { type: '", out += $typeIsArray ? "" + $typeSchema.join(",") : "" + $typeSchema, out += "' } ", !1 !== it.opts.messages && (out += " , message: 'should be ", out += $typeIsArray ? "" + $typeSchema.join(",") : "" + $typeSchema, out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", __err = out, out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } else { "; var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData"; out += " " + $data + " = " + $coerced + "; ", $dataLvl || (out += "if (" + $parentData + " !== undefined)"), out += " " + $parentData + "[" + ($dataLvl ? it.dataPathArr[$dataLvl] : "parentDataProperty") + "] = " + $coerced + "; } "; } else ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'type' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { type: '", out += $typeIsArray ? "" + $typeSchema.join(",") : "" + $typeSchema, out += "' } ", !1 !== it.opts.messages && (out += " , message: 'should be ", out += $typeIsArray ? "" + $typeSchema.join(",") : "" + $typeSchema, out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", __err = out, out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; out += " } "; } } if (it.schema.$ref && !$refKeywords) out += " " + it.RULES.all.$ref.code(it, "$ref") + " ", $breakOnError && (out += " } if (errors === ", out += $top ? "0" : "errs_" + $lvl, out += ") { ", $closingBraces2 += "}"); else { var arr2 = it.RULES; if (arr2) for (var i2 = -1, l2 = arr2.length - 1; i2 < l2; ) if ($shouldUseGroup($rulesGroup = arr2[i2 += 1])) { if ($rulesGroup.type && (out += " if (" + it.util.checkDataType($rulesGroup.type, $data) + ") { "), it.opts.useDefaults) if ("object" == $rulesGroup.type && it.schema.properties) { $schema = it.schema.properties; var arr3 = Object.keys($schema); if (arr3) for (var $propertyKey, i3 = -1, l3 = arr3.length - 1; i3 < l3; ) if (void 0 !== ($sch = $schema[$propertyKey = arr3[i3 += 1]]).default) { var $passData = $data + it.util.getProperty($propertyKey); if (it.compositeRule) { if (it.opts.strictDefaults) { if ($defaultMsg = "default is ignored for: " + $passData, "log" !== it.opts.strictDefaults) throw new Error($defaultMsg); it.logger.warn($defaultMsg); } } else out += " if (" + $passData + " === undefined ", "empty" == it.opts.useDefaults && (out += " || " + $passData + " === null || " + $passData + " === '' "), out += " ) " + $passData + " = ", "shared" == it.opts.useDefaults ? out += " " + it.useDefault($sch.default) + " " : out += " " + JSON.stringify($sch.default) + " ", out += "; "; } } else if ("array" == $rulesGroup.type && Array.isArray(it.schema.items)) { var arr4 = it.schema.items; if (arr4) { $i = -1; for (var $sch, l4 = arr4.length - 1; $i < l4; ) if (void 0 !== ($sch = arr4[$i += 1]).default) if ($passData = $data + "[" + $i + "]", it.compositeRule) { if (it.opts.strictDefaults) { if ($defaultMsg = "default is ignored for: " + $passData, "log" !== it.opts.strictDefaults) throw new Error($defaultMsg); it.logger.warn($defaultMsg); } } else out += " if (" + $passData + " === undefined ", "empty" == it.opts.useDefaults && (out += " || " + $passData + " === null || " + $passData + " === '' "), out += " ) " + $passData + " = ", "shared" == it.opts.useDefaults ? out += " " + it.useDefault($sch.default) + " " : out += " " + JSON.stringify($sch.default) + " ", out += "; "; } } var $$outStack, arr5 = $rulesGroup.rules; if (arr5) for (var $rule, i5 = -1, l5 = arr5.length - 1; i5 < l5; ) if ($shouldUseRule($rule = arr5[i5 += 1])) { var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); $code && (out += " " + $code + " ", $breakOnError && ($closingBraces1 += "}")); } if ($breakOnError && (out += " " + $closingBraces1 + " ", $closingBraces1 = ""), $rulesGroup.type && (out += " } ", $typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes)) out += " else { ", $schemaPath = it.schemaPath + ".type", $errSchemaPath = it.errSchemaPath + "/type", ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'type' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { type: '", out += $typeIsArray ? "" + $typeSchema.join(",") : "" + $typeSchema, out += "' } ", !1 !== it.opts.messages && (out += " , message: 'should be ", out += $typeIsArray ? "" + $typeSchema.join(",") : "" + $typeSchema, out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", __err = out, out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } "; $breakOnError && (out += " if (errors === ", out += $top ? "0" : "errs_" + $lvl, out += ") { ", $closingBraces2 += "}"); } } function $shouldUseGroup($rulesGroup) { for (var rules = $rulesGroup.rules, i = 0; i < rules.length; i++) if ($shouldUseRule(rules[i])) return !0; } function $shouldUseRule($rule) { return void 0 !== it.schema[$rule.keyword] || $rule.implements && (function($rule) { for (var impl = $rule.implements, i = 0; i < impl.length; i++) if (void 0 !== it.schema[impl[i]]) return !0; })($rule); } return $breakOnError && (out += " " + $closingBraces2 + " "), $top ? ($async ? (out += " if (errors === 0) return data; ", out += " else throw new ValidationError(vErrors); ") : (out += " validate.errors = vErrors; ", out += " return errors === 0; "), out += " }; return validate;") : out += " var " + $valid + " = errors === errs_" + $lvl + ";", out = it.util.cleanUpCode(out), $top && (out = it.util.finalCleanUpCode(out, $async)), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $schemaValue, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $isData = it.opts.$data && $schema && $schema.$data; $isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema; var $isMax = "maximum" == $keyword, $exclusiveKeyword = $isMax ? "exclusiveMaximum" : "exclusiveMinimum", $schemaExcl = it.schema[$exclusiveKeyword], $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, $op = $isMax ? "<" : ">", $notOp = $isMax ? ">" : "<", $errorKeyword = void 0; if ($isDataExcl) { var $$outStack, $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), $exclusive = "exclusive" + $lvl, $exclType = "exclType" + $lvl, $exclIsNumber = "exclIsNumber" + $lvl, $opStr = "' + " + ($opExpr = "op" + $lvl) + " + '"; out += " var schemaExcl" + $lvl + " = " + $schemaValueExcl + "; ", out += " var " + $exclusive + "; var " + $exclType + " = typeof " + ($schemaValueExcl = "schemaExcl" + $lvl) + "; if (" + $exclType + " != 'boolean' && " + $exclType + " != 'undefined' && " + $exclType + " != 'number') { ", $errorKeyword = $exclusiveKeyword, ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: '" + ($errorKeyword || "_exclusiveLimit") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ", !1 !== it.opts.messages && (out += " , message: '" + $exclusiveKeyword + " should be boolean' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } else if ( ", $isData && (out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "), out += " " + $exclType + " == 'number' ? ( (" + $exclusive + " = " + $schemaValue + " === undefined || " + $schemaValueExcl + " " + $op + "= " + $schemaValue + ") ? " + $data + " " + $notOp + "= " + $schemaValueExcl + " : " + $data + " " + $notOp + " " + $schemaValue + " ) : ( (" + $exclusive + " = " + $schemaValueExcl + " === true) ? " + $data + " " + $notOp + "= " + $schemaValue + " : " + $data + " " + $notOp + " " + $schemaValue + " ) || " + $data + " !== " + $data + ") { var op" + $lvl + " = " + $exclusive + " ? '" + $op + "' : '" + $op + "='; ", void 0 === $schema && ($errorKeyword = $exclusiveKeyword, $errSchemaPath = it.errSchemaPath + "/" + $exclusiveKeyword, $schemaValue = $schemaValueExcl, $isData = $isDataExcl); } else if ($opStr = $op, ($exclIsNumber = "number" == typeof $schemaExcl) && $isData) { var $opExpr = "'" + $opStr + "'"; out += " if ( ", $isData && (out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "), out += " ( " + $schemaValue + " === undefined || " + $schemaExcl + " " + $op + "= " + $schemaValue + " ? " + $data + " " + $notOp + "= " + $schemaExcl + " : " + $data + " " + $notOp + " " + $schemaValue + " ) || " + $data + " !== " + $data + ") { "; } else $exclIsNumber && void 0 === $schema ? ($exclusive = !0, $errorKeyword = $exclusiveKeyword, $errSchemaPath = it.errSchemaPath + "/" + $exclusiveKeyword, $schemaValue = $schemaExcl, $notOp += "=") : ($exclIsNumber && ($schemaValue = Math[$isMax ? "min" : "max"]($schemaExcl, $schema)), $schemaExcl === (!$exclIsNumber || $schemaValue) ? ($exclusive = !0, $errorKeyword = $exclusiveKeyword, $errSchemaPath = it.errSchemaPath + "/" + $exclusiveKeyword, $notOp += "=") : ($exclusive = !1, $opStr += "=")), $opExpr = "'" + $opStr + "'", out += " if ( ", $isData && (out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "), out += " " + $data + " " + $notOp + " " + $schemaValue + " || " + $data + " !== " + $data + ") { "; return $errorKeyword = $errorKeyword || $keyword, ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: '" + ($errorKeyword || "_limit") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { comparison: " + $opExpr + ", limit: " + $schemaValue + ", exclusive: " + $exclusive + " } ", !1 !== it.opts.messages && (out += " , message: 'should be " + $opStr + " ", out += $isData ? "' + " + $schemaValue : $schemaValue + "'"), it.opts.verbose && (out += " , schema: ", out += $isData ? "validate.schema" + $schemaPath : "" + $schema, out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", __err = out, out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } ", $breakOnError && (out += " else { "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $schemaValue, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $isData = it.opts.$data && $schema && $schema.$data; $isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema, out += "if ( ", $isData && (out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "), out += " " + $data + ".length " + ("maxItems" == $keyword ? ">" : "<") + " " + $schemaValue + ") { "; var $errorKeyword = $keyword, $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: '" + ($errorKeyword || "_limitItems") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } ", !1 !== it.opts.messages && (out += " , message: 'should NOT have ", out += "maxItems" == $keyword ? "more" : "fewer", out += " than ", out += $isData ? "' + " + $schemaValue + " + '" : "" + $schema, out += " items' "), it.opts.verbose && (out += " , schema: ", out += $isData ? "validate.schema" + $schemaPath : "" + $schema, out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += "} ", $breakOnError && (out += " else { "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $schemaValue, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $isData = it.opts.$data && $schema && $schema.$data; $isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema; var $op = "maxLength" == $keyword ? ">" : "<"; out += "if ( ", $isData && (out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "), !1 === it.opts.unicode ? out += " " + $data + ".length " : out += " ucs2length(" + $data + ") ", out += " " + $op + " " + $schemaValue + ") { "; var $errorKeyword = $keyword, $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: '" + ($errorKeyword || "_limitLength") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } ", !1 !== it.opts.messages && (out += " , message: 'should NOT be ", out += "maxLength" == $keyword ? "longer" : "shorter", out += " than ", out += $isData ? "' + " + $schemaValue + " + '" : "" + $schema, out += " characters' "), it.opts.verbose && (out += " , schema: ", out += $isData ? "validate.schema" + $schemaPath : "" + $schema, out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += "} ", $breakOnError && (out += " else { "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $schemaValue, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $isData = it.opts.$data && $schema && $schema.$data; $isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema, out += "if ( ", $isData && (out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "), out += " Object.keys(" + $data + ").length " + ("maxProperties" == $keyword ? ">" : "<") + " " + $schemaValue + ") { "; var $errorKeyword = $keyword, $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: '" + ($errorKeyword || "_limitProperties") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } ", !1 !== it.opts.messages && (out += " , message: 'should NOT have ", out += "maxProperties" == $keyword ? "more" : "fewer", out += " than ", out += $isData ? "' + " + $schemaValue + " + '" : "" + $schema, out += " properties' "), it.opts.verbose && (out += " , schema: ", out += $isData ? "validate.schema" + $schemaPath : "" + $schema, out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += "} ", $breakOnError && (out += " else { "), out; }; }, function(module) { module.exports = { $schema: "http://json-schema.org/draft-07/schema#", $id: "http://json-schema.org/draft-07/schema#", title: "Core schema meta-schema", definitions: { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [ { $ref: "#/definitions/nonNegativeInteger" }, { default: 0 } ] }, simpleTypes: { enum: [ "array", "boolean", "integer", "null", "number", "object", "string" ] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, type: [ "object", "boolean" ], properties: { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: !0, readOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [ { $ref: "#" }, { $ref: "#/definitions/schemaArray" } ], default: !0 }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [ { $ref: "#" }, { $ref: "#/definitions/stringArray" } ] } }, propertyNames: { $ref: "#" }, const: !0, enum: { type: "array", items: !0, minItems: 1, uniqueItems: !0 }, type: { anyOf: [ { $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: !0 } ] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } }, default: !0 }; }, function(module, exports, __webpack_require__) { const unzipper = __webpack_require__(1235), store = (__webpack_require__(61), __webpack_require__(166)), parseQuery = __webpack_require__(275), safeStatelessRegex = __webpack_require__(80), namedQueue = __webpack_require__(71), MergeStreams = __webpack_require__(276).MergeStreams, urlToFileMedia = __webpack_require__(1280), q = new namedQueue((async (task, cb) => { let {opts: opts, query: query} = task; const zipUrls = (function(query) { let zipUrls = [], key = query.key; return key && store.get(key) ? zipUrls = store.get(key) : (zipUrls = query.r || [], "string" == typeof zipUrls && (zipUrls = [ zipUrls ])), zipUrls; })(query); (opts.fileMustInclude || []).length || opts.hasOwnProperty("fileIdx") || (opts = { fileMustInclude: [ /.mkv$|.mp4$|.avi$|.ts$/i ] }); const zipFiles = []; let lengths = []; for (let url of zipUrls) { let zipFile = []; try { zipFile = await urlToFileMedia(url, lengths); } catch (e) { return console.error(e), void cb(null); } lengths.push(zipFile.length), zipFiles.push(zipFile); } lengths = null; const innerFiles = MergeStreams(zipUrls, zipFiles); let directory = null; try { directory = await unzipper.Open.url(innerFiles[0], zipUrls[0], { multiVolume: zipFiles.length > 1, volumeSize: zipFiles[0].length, lastVolumeSize: zipFiles[zipFiles.length - 1].length, volumesCount: zipFiles.length }); } catch (e) { return console.error(e), void cb(null); } if (!((directory || {}).files || []).length) return console.error(Error("Could not parse files from directory with zip parser")), void cb(null); let countFiles = -1; const file = directory.files.find((d => (countFiles++, (opts.fileMustInclude || []).length ? !!opts.fileMustInclude.find((reg => (reg = "string" == typeof reg ? new RegExp(reg) : reg, safeStatelessRegex(d.path || "", reg, 500)))) : !opts.hasOwnProperty("fileIdx") || opts.fileIdx === countFiles))); file && (file.inner = innerFiles[0]), cb(file); }), 10); module.exports = async function(req) { const task = parseQuery(req); let file = null; try { file = await (async function(task) { return new Promise(((resolve, reject) => { task.id = task.query.key, q.push(task, (zipStream => { resolve(zipStream); })); })); })(task); } catch (e) { console.error(e); } return file; }; }, function(module, exports, __webpack_require__) { var Stream = __webpack_require__(3), util = __webpack_require__(0), Buffer = __webpack_require__(167); function PullStream() { if (!(this instanceof PullStream)) return new PullStream; Stream.Duplex.call(this, { decodeStrings: !1, objectMode: !0 }), this.buffer = Buffer.from(""); var self = this; self.on("finish", (function() { self.finished = !0, self.emit("chunk", !1); })); } Stream.Writable && Stream.Writable.prototype.destroy || (Stream = __webpack_require__(88)), util.inherits(PullStream, Stream.Duplex), PullStream.prototype._write = function(chunk, e, cb) { this.buffer = Buffer.concat([ this.buffer, chunk ]), this.cb = cb, this.emit("chunk"); }, PullStream.prototype.stream = function(eof, includeEof) { var done, p = Stream.PassThrough(), self = this; function cb() { if ("function" == typeof self.cb) { var callback = self.cb; return self.cb = void 0, callback(); } } function pull() { var packet; if (self.buffer && self.buffer.length) { if ("number" == typeof eof) packet = self.buffer.slice(0, eof), self.buffer = self.buffer.slice(eof), eof -= packet.length, done = !eof; else { var match = self.buffer.indexOf(eof); if (-1 !== match) self.match = match, includeEof && (match += eof.length), packet = self.buffer.slice(0, match), self.buffer = self.buffer.slice(match), done = !0; else { var len = self.buffer.length - eof.length; len <= 0 ? cb() : (packet = self.buffer.slice(0, len), self.buffer = self.buffer.slice(len)); } } packet && p.write(packet, (function() { (0 === self.buffer.length || eof.length && self.buffer.length <= eof.length) && cb(); })); } if (done) self.removeListener("chunk", pull), p.end(); else if (self.finished) return self.removeListener("chunk", pull), void self.emit("error", new Error("FILE_ENDED")); } return self.on("chunk", pull), pull(), p; }, PullStream.prototype.pull = function(eof, includeEof) { if (0 === eof) return Promise.resolve(""); if (!isNaN(eof) && this.buffer.length > eof) { var data = this.buffer.slice(0, eof); return this.buffer = this.buffer.slice(eof), Promise.resolve(data); } var rejectHandler, pullStreamRejectHandler, buffer = Buffer.from(""), self = this, concatStream = Stream.Transform(); return concatStream._transform = function(d, e, cb) { buffer = Buffer.concat([ buffer, d ]), cb(); }, new Promise((async function(resolve, reject) { if (rejectHandler = reject, pullStreamRejectHandler = function(e) { self.__emittedError = e, reject(e); }, self.finished) return reject(new Error("FILE_ENDED")); self.once("error", pullStreamRejectHandler), self.stream(eof, includeEof).on("error", reject).pipe(concatStream).on("finish", (function() { resolve(buffer); })).on("error", reject); })).finally((function() { self.removeListener("error", rejectHandler), self.removeListener("error", pullStreamRejectHandler); })); }, PullStream.prototype._read = function() {}, module.exports = PullStream; }, function(module, exports, __webpack_require__) { var parseExtraField = __webpack_require__(549), parseDateTime = __webpack_require__(550), parseBuffer = __webpack_require__(272); module.exports = function(file, entry, directoryVars) { return file.pull(30).then((function(data) { var vars = parseBuffer.parse(data, [ [ "signature", 4 ], [ "versionsNeededToExtract", 2 ], [ "flags", 2 ], [ "compressionMethod", 2 ], [ "lastModifiedTime", 2 ], [ "lastModifiedDate", 2 ], [ "crc32", 4 ], [ "compressedSize", 4 ], [ "uncompressedSize", 4 ], [ "fileNameLength", 2 ], [ "extraFieldLength", 2 ] ]); return vars.lastModifiedDateTime = parseDateTime(vars.lastModifiedDate, vars.lastModifiedTime), file.pull(vars.fileNameLength).then((function(fileName) { return vars.fileName = fileName.toString("utf8"), file.pull(vars.extraFieldLength); })).then((function(extraField) { var checkEncryption; return vars.extra = parseExtraField(extraField, vars), directoryVars && directoryVars.compressedSize && (vars = directoryVars), 1 & vars.flags && (checkEncryption = file.pull(12).then((function(header) { if (!_password) throw new Error("MISSING_PASSWORD"); var decrypt = Decrypt(); String(_password).split("").forEach((function(d) { decrypt.update(d); })); for (var i = 0; i < header.length; i++) header[i] = decrypt.decryptByte(header[i]); vars.decrypt = decrypt, vars.compressedSize -= 12; var check = 8 & vars.flags ? vars.lastModifiedTime >> 8 & 255 : vars.crc32 >> 24 & 255; if (header[11] !== check) throw new Error("BAD_PASSWORD"); return vars; }))), Promise.resolve(checkEncryption).then((function() { return entry && entry.emit("vars", vars), vars; })); })); })); }; }, function(module, exports, __webpack_require__) { var parseBuffer = __webpack_require__(272); module.exports = function(extraField, vars) { for (var extra; !extra && extraField && extraField.length; ) { var candidateExtra = parseBuffer.parse(extraField, [ [ "signature", 2 ], [ "partSize", 2 ] ]); if (1 === candidateExtra.signature) { const fieldsToExpect = []; 4294967295 === vars.uncompressedSize && fieldsToExpect.push([ "uncompressedSize", 8 ]), 4294967295 === vars.compressedSize && fieldsToExpect.push([ "compressedSize", 8 ]), 4294967295 === vars.offsetToLocalFileHeader && fieldsToExpect.push([ "offsetToLocalFileHeader", 8 ]), extra = parseBuffer.parse(extraField.slice(4), fieldsToExpect); } else extraField = extraField.slice(candidateExtra.partSize + 4); } return extra = extra || {}, 4294967295 === vars.compressedSize && (vars.compressedSize = extra.compressedSize), 4294967295 === vars.uncompressedSize && (vars.uncompressedSize = extra.uncompressedSize), 4294967295 === vars.offsetToLocalFileHeader && (vars.offsetToLocalFileHeader = extra.offsetToLocalFileHeader), extra; }; }, function(module, exports) { module.exports = function(date, time) { const day = 31 & date, month = date >> 5 & 15, year = 1980 + (date >> 9 & 127), seconds = time ? 2 * (31 & time) : 0, minutes = time ? time >> 5 & 63 : 0, hours = time ? time >> 11 : 0; return new Date(Date.UTC(year, month - 1, day, hours, minutes, seconds)); }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(17), maybeWrapAsError = util.maybeWrapAsError, OperationalError = __webpack_require__(64).OperationalError, es5 = __webpack_require__(92), rErrorKey = /^(?:name|message|stack|cause)$/; function wrapAsOperationalError(obj) { var ret; if ((function(obj) { return obj instanceof Error && es5.getPrototypeOf(obj) === Error.prototype; })(obj)) { (ret = new OperationalError(obj)).name = obj.name, ret.message = obj.message, ret.stack = obj.stack; for (var keys = es5.keys(obj), i = 0; i < keys.length; ++i) { var key = keys[i]; rErrorKey.test(key) || (ret[key] = obj[key]); } return ret; } return util.markAsOriginatingFromRejection(obj), obj; } module.exports = function(promise, multiArgs) { return function(err, value) { if (null !== promise) { if (err) { var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); promise._attachExtraTrace(wrapped), promise._reject(wrapped); } else if (multiArgs) { for (var $_len = arguments.length, args = new Array(Math.max($_len - 1, 0)), $_i = 1; $_i < $_len; ++$_i) args[$_i - 1] = arguments[$_i]; promise._fulfill(args); } else promise._fulfill(value); promise = null; } }; }; }, function(module, exports, __webpack_require__) { module.exports = LinkReader; var fs = __webpack_require__(65), inherits = __webpack_require__(8), Reader = __webpack_require__(93); function LinkReader(props) { if (!(this instanceof LinkReader)) throw new Error("LinkReader must be called as constructor."); if (!("Link" === props.type && props.Link || "SymbolicLink" === props.type && props.SymbolicLink)) throw new Error("Non-link type " + props.type); Reader.call(this, props); } inherits(LinkReader, Reader), LinkReader.prototype._stat = function(currentStat) { var self = this; fs.readlink(self._path, (function(er, linkpath) { if (er) return self.error(er); self.linkpath = self.props.linkpath = linkpath, self.emit("linkpath", linkpath), Reader.prototype._stat.call(self, currentStat); })); }, LinkReader.prototype._read = function() { this._paused || this._ended || (this.emit("end"), this.emit("close"), this._ended = !0); }; }, function(module, exports, __webpack_require__) { module.exports = DirReader; var fs = __webpack_require__(65), inherits = __webpack_require__(8), path = __webpack_require__(5), Reader = __webpack_require__(93), assert = __webpack_require__(25).ok; function DirReader(props) { if (!(this instanceof DirReader)) throw new Error("DirReader must be called as constructor."); if ("Directory" !== props.type || !props.Directory) throw new Error("Non-directory type " + props.type); this.entries = null, this._index = -1, this._paused = !1, this._length = -1, props.sort && (this.sort = props.sort), Reader.call(this, props); } inherits(DirReader, Reader), DirReader.prototype._getEntries = function() { var self = this; self._gotEntries || (self._gotEntries = !0, fs.readdir(self._path, (function(er, entries) { if (er) return self.error(er); function processEntries() { self._length = self.entries.length, "function" == typeof self.sort && (self.entries = self.entries.sort(self.sort.bind(self))), self._read(); } self.entries = entries, self.emit("entries", entries), self._paused ? self.once("resume", processEntries) : processEntries(); }))); }, DirReader.prototype._read = function() { var self = this; if (!self.entries) return self._getEntries(); if (!(self._paused || self._currentEntry || self._aborted)) if (self._index++, self._index >= self.entries.length) self._ended || (self._ended = !0, self.emit("end"), self.emit("close")); else { var p = path.resolve(self._path, self.entries[self._index]); assert(p !== self._path), assert(self.entries[self._index]), self._currentEntry = p, fs[self.props.follow ? "stat" : "lstat"](p, (function(er, stat) { if (er) return self.error(er); var who = self._proxy || self; stat.path = p, stat.basename = path.basename(p), stat.dirname = path.dirname(p); var childProps = self.getChildProps.call(who, stat); childProps.path = p, childProps.basename = path.basename(p), childProps.dirname = path.dirname(p); var entry = Reader(childProps, stat); self._currentEntry = entry, entry.on("pause", (function(who) { self._paused || entry._disowned || self.pause(who); })), entry.on("resume", (function(who) { self._paused && !entry._disowned && self.resume(who); })), entry.on("stat", (function(props) { self.emit("_entryStat", entry, props), entry._aborted || (entry._paused ? entry.once("resume", (function() { self.emit("entryStat", entry, props); })) : self.emit("entryStat", entry, props)); })), entry.on("ready", (function EMITCHILD() { if (self._paused) return entry.pause(self), self.once("resume", EMITCHILD); "Socket" === entry.type ? self.emit("socket", entry) : self.emitEntry(entry); })); var ended = !1; function onend() { ended || (ended = !0, self.emit("childEnd", entry), self.emit("entryEnd", entry), self._currentEntry = null, self._paused || self._read()); } entry.on("close", onend), entry.on("disown", onend), entry.on("error", (function(er) { entry._swallowErrors ? (self.warn(er), entry.emit("end"), entry.emit("close")) : self.emit("error", er); })), [ "child", "childEnd", "warn" ].forEach((function(ev) { entry.on(ev, self.emit.bind(self, ev)); })); })); } }, DirReader.prototype.disown = function(entry) { entry.emit("beforeDisown"), entry._disowned = !0, entry.parent = entry.root = null, entry === this._currentEntry && (this._currentEntry = null), entry.emit("disown"); }, DirReader.prototype.getChildProps = function() { return { depth: this.depth + 1, root: this.root || this, parent: this, follow: this.follow, filter: this.filter, sort: this.props.sort, hardlinks: this.props.hardlinks }; }, DirReader.prototype.pause = function(who) { this._paused || (who = who || this, this._paused = !0, this._currentEntry && this._currentEntry.pause && this._currentEntry.pause(who), this.emit("pause", who)); }, DirReader.prototype.resume = function(who) { this._paused && (who = who || this, this._paused = !1, this.emit("resume", who), this._paused || (this._currentEntry ? this._currentEntry.resume && this._currentEntry.resume(who) : this._read())); }, DirReader.prototype.emitEntry = function(entry) { this.emit("entry", entry), this.emit("child", entry); }; }, function(module, exports, __webpack_require__) { module.exports = FileReader; var fs = __webpack_require__(65), inherits = __webpack_require__(8), Reader = __webpack_require__(93), EOF = { EOF: !0 }, CLOSE = { CLOSE: !0 }; function FileReader(props) { if (!(this instanceof FileReader)) throw new Error("FileReader must be called as constructor."); if (!("Link" === props.type && props.Link || "File" === props.type && props.File)) throw new Error("Non-file type " + props.type); this._buffer = [], this._bytesEmitted = 0, Reader.call(this, props); } inherits(FileReader, Reader), FileReader.prototype._getStream = function() { var self = this, stream = self._stream = fs.createReadStream(self._path, self.props); self.props.blksize && (stream.bufferSize = self.props.blksize), stream.on("open", self.emit.bind(self, "open")), stream.on("data", (function(c) { self._bytesEmitted += c.length, c.length && (self._paused || self._buffer.length ? (self._buffer.push(c), self._read()) : self.emit("data", c)); })), stream.on("end", (function() { self._paused || self._buffer.length ? (self._buffer.push(EOF), self._read()) : self.emit("end"), self._bytesEmitted !== self.props.size && self.error("Didn't get expected byte count\nexpect: " + self.props.size + "\nactual: " + self._bytesEmitted); })), stream.on("close", (function() { self._paused || self._buffer.length ? (self._buffer.push(CLOSE), self._read()) : self.emit("close"); })), stream.on("error", (function(e) { self.emit("error", e); })), self._read(); }, FileReader.prototype._read = function() { if (!this._paused) { if (!this._stream) return this._getStream(); if (this._buffer.length) { for (var buf = this._buffer, i = 0, l = buf.length; i < l; i++) { var c = buf[i]; if (c === EOF ? this.emit("end") : c === CLOSE ? this.emit("close") : this.emit("data", c), this._paused) return void (this._buffer = buf.slice(i)); } this._buffer.length = 0; } } }, FileReader.prototype.pause = function(who) { this._paused || (who = who || this, this._paused = !0, this._stream && this._stream.pause(), this.emit("pause", who)); }, FileReader.prototype.resume = function(who) { this._paused && (who = who || this, this.emit("resume", who), this._paused = !1, this._stream && this._stream.resume(), this._read()); }; }, function(module, exports, __webpack_require__) { module.exports = ProxyReader; var Reader = __webpack_require__(93), getType = __webpack_require__(168), inherits = __webpack_require__(8), fs = __webpack_require__(65); function ProxyReader(props) { if (!(this instanceof ProxyReader)) throw new Error("ProxyReader must be called as constructor."); this.props = props, this._buffer = [], this.ready = !1, Reader.call(this, props); } inherits(ProxyReader, Reader), ProxyReader.prototype._stat = function() { var self = this, props = self.props, stat = props.follow ? "stat" : "lstat"; fs[stat](props.path, (function(er, current) { var type; type = er || !current ? "File" : getType(current), props[type] = !0, props.type = self.type = type, self._old = current, self._addProxy(Reader(props, current)); })); }, ProxyReader.prototype._addProxy = function(proxy) { var self = this; if (self._proxyTarget) return self.error("proxy already set"); self._proxyTarget = proxy, proxy._proxy = self, [ "error", "data", "end", "close", "linkpath", "entry", "entryEnd", "child", "childEnd", "warn", "stat" ].forEach((function(ev) { proxy.on(ev, self.emit.bind(self, ev)); })), self.emit("proxy", proxy), proxy.on("ready", (function() { self.ready = !0, self.emit("ready"); })); var calls = self._buffer; self._buffer.length = 0, calls.forEach((function(c) { proxy[c[0]].apply(proxy, c[1]); })); }, ProxyReader.prototype.pause = function() { return !!this._proxyTarget && this._proxyTarget.pause(); }, ProxyReader.prototype.resume = function() { return !!this._proxyTarget && this._proxyTarget.resume(); }; }, function(module, exports, __webpack_require__) { module.exports = rimraf, rimraf.sync = rimrafSync; var assert = __webpack_require__(25), path = __webpack_require__(5), fs = __webpack_require__(2), glob = __webpack_require__(196), _0666 = parseInt("666", 8), defaultGlobOpts = { nosort: !0, silent: !0 }, timeout = 0, isWindows = "win32" === process.platform; function defaults(options) { [ "unlink", "chmod", "stat", "lstat", "rmdir", "readdir" ].forEach((function(m) { options[m] = options[m] || fs[m], options[m += "Sync"] = options[m] || fs[m]; })), options.maxBusyTries = options.maxBusyTries || 3, options.emfileWait = options.emfileWait || 1e3, !1 === options.glob && (options.disableGlob = !0), options.disableGlob = options.disableGlob || !1, options.glob = options.glob || defaultGlobOpts; } function rimraf(p, options, cb) { "function" == typeof options && (cb = options, options = {}), assert(p, "rimraf: missing path"), assert.equal(typeof p, "string", "rimraf: path should be a string"), assert.equal(typeof cb, "function", "rimraf: callback function required"), assert(options, "rimraf: invalid options argument provided"), assert.equal(typeof options, "object", "rimraf: options should be object"), defaults(options); var busyTries = 0, errState = null, n = 0; if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [ p ]); function afterGlob(er, results) { return er ? cb(er) : 0 === (n = results.length) ? cb() : void results.forEach((function(p) { rimraf_(p, options, (function CB(er) { if (er) { if (("EBUSY" === er.code || "ENOTEMPTY" === er.code || "EPERM" === er.code) && busyTries < options.maxBusyTries) return busyTries++, setTimeout((function() { rimraf_(p, options, CB); }), 100 * busyTries); if ("EMFILE" === er.code && timeout < options.emfileWait) return setTimeout((function() { rimraf_(p, options, CB); }), timeout++); "ENOENT" === er.code && (er = null); } timeout = 0, (function(er) { errState = errState || er, 0 == --n && cb(errState); })(er); })); })); } options.lstat(p, (function(er, stat) { if (!er) return afterGlob(null, [ p ]); glob(p, options.glob, afterGlob); })); } function rimraf_(p, options, cb) { assert(p), assert(options), assert("function" == typeof cb), options.lstat(p, (function(er, st) { return er && "ENOENT" === er.code ? cb(null) : (er && "EPERM" === er.code && isWindows && fixWinEPERM(p, options, er, cb), st && st.isDirectory() ? rmdir(p, options, er, cb) : void options.unlink(p, (function(er) { if (er) { if ("ENOENT" === er.code) return cb(null); if ("EPERM" === er.code) return isWindows ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb); if ("EISDIR" === er.code) return rmdir(p, options, er, cb); } return cb(er); }))); })); } function fixWinEPERM(p, options, er, cb) { assert(p), assert(options), assert("function" == typeof cb), er && assert(er instanceof Error), options.chmod(p, _0666, (function(er2) { er2 ? cb("ENOENT" === er2.code ? null : er) : options.stat(p, (function(er3, stats) { er3 ? cb("ENOENT" === er3.code ? null : er) : stats.isDirectory() ? rmdir(p, options, er, cb) : options.unlink(p, cb); })); })); } function fixWinEPERMSync(p, options, er) { assert(p), assert(options), er && assert(er instanceof Error); try { options.chmodSync(p, _0666); } catch (er2) { if ("ENOENT" === er2.code) return; throw er; } try { var stats = options.statSync(p); } catch (er3) { if ("ENOENT" === er3.code) return; throw er; } stats.isDirectory() ? rmdirSync(p, options, er) : options.unlinkSync(p); } function rmdir(p, options, originalEr, cb) { assert(p), assert(options), originalEr && assert(originalEr instanceof Error), assert("function" == typeof cb), options.rmdir(p, (function(er) { !er || "ENOTEMPTY" !== er.code && "EEXIST" !== er.code && "EPERM" !== er.code ? er && "ENOTDIR" === er.code ? cb(originalEr) : cb(er) : (function(p, options, cb) { assert(p), assert(options), assert("function" == typeof cb), options.readdir(p, (function(er, files) { if (er) return cb(er); var errState, n = files.length; if (0 === n) return options.rmdir(p, cb); files.forEach((function(f) { rimraf(path.join(p, f), options, (function(er) { if (!errState) return er ? cb(errState = er) : void (0 == --n && options.rmdir(p, cb)); })); })); })); })(p, options, cb); })); } function rimrafSync(p, options) { var results; if (defaults(options = options || {}), assert(p, "rimraf: missing path"), assert.equal(typeof p, "string", "rimraf: path should be a string"), assert(options, "rimraf: missing options"), assert.equal(typeof options, "object", "rimraf: options should be object"), options.disableGlob || !glob.hasMagic(p)) results = [ p ]; else try { options.lstatSync(p), results = [ p ]; } catch (er) { results = glob.sync(p, options.glob); } if (results.length) for (var i = 0; i < results.length; i++) { p = results[i]; try { var st = options.lstatSync(p); } catch (er) { if ("ENOENT" === er.code) return; "EPERM" === er.code && isWindows && fixWinEPERMSync(p, options, er); } try { st && st.isDirectory() ? rmdirSync(p, options, null) : options.unlinkSync(p); } catch (er) { if ("ENOENT" === er.code) return; if ("EPERM" === er.code) return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er); if ("EISDIR" !== er.code) throw er; rmdirSync(p, options, er); } } } function rmdirSync(p, options, originalEr) { assert(p), assert(options), originalEr && assert(originalEr instanceof Error); try { options.rmdirSync(p); } catch (er) { if ("ENOENT" === er.code) return; if ("ENOTDIR" === er.code) throw originalEr; "ENOTEMPTY" !== er.code && "EEXIST" !== er.code && "EPERM" !== er.code || (function(p, options) { assert(p), assert(options), options.readdirSync(p).forEach((function(f) { rimrafSync(path.join(p, f), options); })); for (var retries = isWindows ? 100 : 1, i = 0; ;) { var threw = !0; try { var ret = options.rmdirSync(p, options); return threw = !1, ret; } finally { if (++i < retries && threw) continue; } } })(p, options); } } }, function(module, exports, __webpack_require__) { module.exports = DirWriter; var Writer = __webpack_require__(116), inherits = __webpack_require__(8), mkdir = __webpack_require__(186), path = __webpack_require__(5), collect = __webpack_require__(274); function DirWriter(props) { this instanceof DirWriter || this.error("DirWriter must be called as constructor.", null, !0), "Directory" === props.type && props.Directory || this.error("Non-directory type " + props.type + " " + JSON.stringify(props), null, !0), Writer.call(this, props); } inherits(DirWriter, Writer), DirWriter.prototype._create = function() { var self = this; mkdir(self._path, Writer.dirmode, (function(er) { if (er) return self.error(er); self.ready = !0, self.emit("ready"), self._process(); })); }, DirWriter.prototype.write = function() { return !0; }, DirWriter.prototype.end = function() { this._ended = !0, this._process(); }, DirWriter.prototype.add = function(entry) { return collect(entry), !this.ready || this._currentEntry ? (this._buffer.push(entry), !1) : this._ended ? this.error("add after end") : (this._buffer.push(entry), this._process(), 0 === this._buffer.length); }, DirWriter.prototype._process = function() { var self = this; if (!self._processing) { var entry = self._buffer.shift(); if (!entry) return self.emit("drain"), void (self._ended && self._finish()); self._processing = !0, self.emit("entry", entry); var pp, p = entry; do { if ((pp = p._path || p.path) === self.root._path || pp === self._path || pp && 0 === pp.indexOf(self._path)) return self._processing = !1, entry._collected && entry.pipe(), self._process(); p = p.parent; } while (p); var props = { parent: self, root: self.root || self, type: entry.type, depth: self.depth + 1 }; pp = entry._path || entry.path || entry.props.path, entry.parent && (pp = pp.substr(entry.parent._path.length + 1)), props.path = path.join(self.path, path.join("/", pp)), props.filter = self.filter, Object.keys(entry.props).forEach((function(k) { props.hasOwnProperty(k) || (props[k] = entry.props[k]); })); var child = self._currentChild = new Writer(props); child.on("ready", (function() { entry.pipe(child), entry.resume(); })), child.on("error", (function(er) { child._swallowErrors ? (self.warn(er), child.emit("end"), child.emit("close")) : self.emit("error", er); })), child.on("close", (function() { ended || (ended = !0, self._currentChild = null, self._processing = !1, self._process()); })); var ended = !1; } }; }, function(module, exports, __webpack_require__) { module.exports = LinkWriter; var fs = __webpack_require__(65), Writer = __webpack_require__(116), inherits = __webpack_require__(8), path = __webpack_require__(5), rimraf = __webpack_require__(556); function LinkWriter(props) { if (!(this instanceof LinkWriter)) throw new Error("LinkWriter must be called as constructor."); if (!("Link" === props.type && props.Link || "SymbolicLink" === props.type && props.SymbolicLink)) throw new Error("Non-link type " + props.type); "" === props.linkpath && (props.linkpath = "."), props.linkpath || this.error("Need linkpath property to create " + props.type), Writer.call(this, props); } function clobber(self, lp, link) { rimraf(self._path, (function(er) { if (er) return self.error(er); !(function(self, lp, link) { fs[link](lp, self._path, (function(er) { if (er) { if ("ENOENT" !== er.code && "EACCES" !== er.code && "EPERM" !== er.code || "win32" !== process.platform) return self.error(er); self.ready = !0, self.emit("ready"), self.emit("end"), self.emit("close"), self.end = self._finish = function() {}; } finish(self); })); })(self, lp, link); })); } function finish(self) { self.ready = !0, self.emit("ready"), self._ended && !self._finished && self._finish(); } inherits(LinkWriter, Writer), LinkWriter.prototype._create = function() { var self = this, hard = "Link" === self.type || "win32" === process.platform, link = hard ? "link" : "symlink", lp = hard ? path.resolve(self.dirname, self.linkpath) : self.linkpath; if (hard) return clobber(self, lp, link); fs.readlink(self._path, (function(er, p) { if (p && p === lp) return finish(self); clobber(self, lp, link); })); }, LinkWriter.prototype.end = function() { this._ended = !0, this.ready && (this._finished = !0, this._finish()); }; }, function(module, exports, __webpack_require__) { module.exports = FileWriter; var fs = __webpack_require__(65), Writer = __webpack_require__(116), inherits = __webpack_require__(8), EOF = {}; function FileWriter(props) { if (!(this instanceof FileWriter)) throw new Error("FileWriter must be called as constructor."); if ("File" !== props.type || !props.File) throw new Error("Non-file type " + props.type); this._buffer = [], this._bytesWritten = 0, Writer.call(this, props); } inherits(FileWriter, Writer), FileWriter.prototype._create = function() { var self = this; if (!self._stream) { var so = {}; self.props.flags && (so.flags = self.props.flags), so.mode = Writer.filemode, self._old && self._old.blksize && (so.bufferSize = self._old.blksize), self._stream = fs.createWriteStream(self._path, so), self._stream.on("open", (function() { self.ready = !0, self._buffer.forEach((function(c) { c === EOF ? self._stream.end() : self._stream.write(c); })), self.emit("ready"), self.emit("drain"); })), self._stream.on("error", (function(er) { self.emit("error", er); })), self._stream.on("drain", (function() { self.emit("drain"); })), self._stream.on("close", (function() { self._finish(); })); } }, FileWriter.prototype.write = function(c) { if (this._bytesWritten += c.length, !this.ready) { if (!Buffer.isBuffer(c) && "string" != typeof c) throw new Error("invalid write data"); return this._buffer.push(c), !1; } var ret = this._stream.write(c); return !1 === ret && this._stream._queue ? this._stream._queue.length <= 2 : ret; }, FileWriter.prototype.end = function(c) { return c && this.write(c), this.ready ? this._stream.end() : (this._buffer.push(EOF), !1); }, FileWriter.prototype._finish = function() { "number" == typeof this.size && this._bytesWritten !== this.size && this.error("Did not get expected byte count.\nexpect: " + this.size + "\nactual: " + this._bytesWritten), Writer.prototype._finish.call(this); }; }, function(module, exports, __webpack_require__) { module.exports = ProxyWriter; var Writer = __webpack_require__(116), getType = __webpack_require__(168), inherits = __webpack_require__(8), collect = __webpack_require__(274), fs = __webpack_require__(2); function ProxyWriter(props) { if (!(this instanceof ProxyWriter)) throw new Error("ProxyWriter must be called as constructor."); this.props = props, this._needDrain = !1, Writer.call(this, props); } inherits(ProxyWriter, Writer), ProxyWriter.prototype._stat = function() { var self = this, props = self.props, stat = props.follow ? "stat" : "lstat"; fs[stat](props.path, (function(er, current) { var type; type = er || !current ? "File" : getType(current), props[type] = !0, props.type = self.type = type, self._old = current, self._addProxy(Writer(props, current)); })); }, ProxyWriter.prototype._addProxy = function(proxy) { var self = this; if (self._proxy) return self.error("proxy already set"); self._proxy = proxy, [ "ready", "error", "close", "pipe", "drain", "warn" ].forEach((function(ev) { proxy.on(ev, self.emit.bind(self, ev)); })), self.emit("proxy", proxy), self._buffer.forEach((function(c) { proxy[c[0]].apply(proxy, c[1]); })), self._buffer.length = 0, self._needsDrain && self.emit("drain"); }, ProxyWriter.prototype.add = function(entry) { return collect(entry), this._proxy ? this._proxy.add(entry) : (this._buffer.push([ "add", [ entry ] ]), this._needDrain = !0, !1); }, ProxyWriter.prototype.write = function(c) { return this._proxy ? this._proxy.write(c) : (this._buffer.push([ "write", [ c ] ]), this._needDrain = !0, !1); }, ProxyWriter.prototype.end = function(c) { return this._proxy ? this._proxy.end(c) : (this._buffer.push([ "end", [ c ] ]), !1); }; }, function(module, exports, __webpack_require__) { const {RarFilesPackage: RarFilesPackage} = __webpack_require__(1285), urlToFileMedia = __webpack_require__(1287), store = __webpack_require__(169), parseQuery = __webpack_require__(277), safeStatelessRegex = __webpack_require__(80), q = new (__webpack_require__(71))((async (task, cb) => { const {opts: opts, query: query} = task, rarUrls = (function(query) { let rarUrls = [], key = query.key; return key && store.get(key) ? rarUrls = store.get(key) : (rarUrls = query.r || [], "string" == typeof rarUrls && (rarUrls = [ rarUrls ])), rarUrls; })(query); try { rarStreams[task.url] = rarStreams[task.url] || await streamRar(rarUrls, opts); } catch (e) { return console.error(e), void cb(null); } cb(rarStreams[task.url]); }), 10), rarStreams = {}, streamRar = async (urls, opts = {}) => { const rarFiles = []; let lengths = []; for (let i = 0; urls[i]; i++) { const rarFile = await urlToFileMedia(urls[i], lengths, i === urls.length - 1); lengths.push(rarFile.length), rarFiles.push(rarFile); } lengths = null; const rarStreamPackage = new RarFilesPackage(rarFiles); (opts.fileMustInclude || []).length || opts.hasOwnProperty("fileIdx") || (opts = { fileMustInclude: [ /.mkv$|.mp4$|.avi$|.ts$/i ] }); const rarStreamOpts = { filter: function(name, idx) { return (opts.fileMustInclude || []).length ? !!opts.fileMustInclude.find((reg => (reg = "string" == typeof reg ? new RegExp(reg) : reg, safeStatelessRegex(name || "", reg, 500)))) : !opts.hasOwnProperty("fileIdx") || opts.fileIdx === idx; }, maxFiles: 1 }; let innerFiles = []; try { innerFiles = await rarStreamPackage.parse(rarStreamOpts); } catch (e) { throw Error(e); } if (!innerFiles[0]) throw Error("no file matching " + JSON.stringify(opts)); return innerFiles[0]; }; module.exports = async function(req) { const task = parseQuery(req); task.url = req.url; let rarStream = null; try { rarStream = await (function(task) { return new Promise(((resolve, reject) => { task.id = task.query.key, q.push(task, (rarStream => { resolve(rarStream); })); })); })(task); } catch (e) { console.error(e); } return rarStream; }; }, function(module, exports, __webpack_require__) { const TarReader = __webpack_require__(1294), store = (__webpack_require__(61), __webpack_require__(170)), parseQuery = __webpack_require__(278), safeStatelessRegex = __webpack_require__(80), namedQueue = __webpack_require__(71), MergeStreams = __webpack_require__(276).MergeStreams, urlToFileMedia = __webpack_require__(1295), q = new namedQueue((async (task, cb) => { let {opts: opts, query: query} = task; const tarUrls = (function(query) { let tarUrls = [], key = query.key; return key && store.get(key) ? tarUrls = store.get(key) : (tarUrls = query.r || [], "string" == typeof tarUrls && (tarUrls = [ tarUrls ])), tarUrls; })(query); (opts.fileMustInclude || []).length || opts.hasOwnProperty("fileIdx") || (opts = { fileMustInclude: [ /.mkv$|.mp4$|.avi$|.ts$/i ] }); const tarFiles = []; let lengths = []; for (let url of tarUrls) { let tarFile = null; try { tarFile = await urlToFileMedia(url, lengths); } catch (e) { return console.error(e), void cb(null); } lengths.push(tarFile.length), tarFiles.push(tarFile); } lengths = null; const innerFiles = MergeStreams(tarUrls, tarFiles), reader = new TarReader(innerFiles[0]); let countFiles = -1; const files = []; reader.on("entry", (function(header, entry, next) { if ("file" === header.type) { countFiles++; let validFile = !1; validFile = (opts.fileMustInclude || []).length ? !!opts.fileMustInclude.find((reg => (reg = "string" == typeof reg ? new RegExp(reg) : reg, safeStatelessRegex(entry.header.name || "", reg, 500)))) : !opts.hasOwnProperty("fileIdx") || opts.fileIdx === countFiles, validFile ? (cb(entry), files.push(entry)) : next(); } else next(); })), reader.on("finish", (function() { files || cb(); })), reader.on("error", (function(err) { files || cb(), console.error("Error reading tar:", err); })); }), 10); module.exports = async function(req) { const task = parseQuery(req); let file = null; try { file = await (async function(task) { return new Promise(((resolve, reject) => { task.id = task.query.key, q.push(task, (tarStream => { resolve(tarStream); })); })); })(task); } catch (e) { console.error(e); } return file; }; }, function(module, exports, __webpack_require__) { const TarReader = __webpack_require__(1301), store = (__webpack_require__(61), __webpack_require__(171)), parseQuery = __webpack_require__(279), safeStatelessRegex = __webpack_require__(80), namedQueue = __webpack_require__(71), zlib = __webpack_require__(43), MergeStreams = (__webpack_require__(3), __webpack_require__(276).MergeStreams), urlToFileMedia = __webpack_require__(1302), q = new namedQueue((async (task, cb) => { let {opts: opts, query: query} = task; const tarUrls = (function(query) { let tarUrls = [], key = query.key; return key && store.get(key) ? tarUrls = store.get(key) : (tarUrls = query.r || [], "string" == typeof tarUrls && (tarUrls = [ tarUrls ])), tarUrls; })(query); (opts.fileMustInclude || []).length || opts.hasOwnProperty("fileIdx") || (opts = { fileMustInclude: [ /.mkv$|.mp4$|.avi$|.ts$/i ] }); const tarFiles = []; let lengths = []; for (let url of tarUrls) { let tarFile = null; try { tarFile = await urlToFileMedia(url, lengths); } catch (e) { return console.error(e), void cb(null); } lengths.push(tarFile.length), tarFiles.push(tarFile); } let isTar = !1; if (tarUrls[0]) { let tarFl = tarUrls[0].url || tarUrls[0]; tarFl = (tarFl || "").split("?")[0], (tarFl.toLowerCase().includes(".tar.gz") || tarFl.toLowerCase().includes(".tgz")) && (isTar = !0); } lengths = null; const innerFiles = MergeStreams(tarUrls, tarFiles); let fileStream = null; try { fileStream = await innerFiles[0].createReadStream(); } catch (e) { return console.error(e), void cb(null); } const gzipStream = fileStream.pipe(zlib.createGunzip()); if (isTar) { const reader = new TarReader(gzipStream); let countFiles = -1; const files = []; reader.on("entry", (function(header, entry, next) { if ("file" === header.type) { countFiles++; let validFile = !1; validFile = (opts.fileMustInclude || []).length ? !!opts.fileMustInclude.find((reg => (reg = "string" == typeof reg ? new RegExp(reg) : reg, safeStatelessRegex(header.name || "", reg, 500)))) : !opts.hasOwnProperty("fileIdx") || opts.fileIdx === countFiles, validFile ? (entry._filename = header.name, entry._fileSize = header.size, cb(entry), files.push(entry)) : next(); } else next(); })), reader.on("finish", (function() { files || cb(); })), reader.on("error", (function(err) { files || cb(), console.error("Error reading tar:", err); })); } else cb(gzipStream); }), 10); module.exports = async function(req) { const task = parseQuery(req); let file = null; try { file = await (async function(task) { return new Promise(((resolve, reject) => { task.id = task.query.key, q.push(task, (tarStream => { resolve(tarStream); })); })); })(task); } catch (e) { console.error(e); } return file; }; }, function(module, exports, __webpack_require__) { (function(__dirname) { process.env.TV_ENV && (process.env.CASTING_DISABLED = 1, process.env.DISABLE_CACHING = 1, process.env.NO_CORS = 1), process.env.UNITY_ENV && (process.env.NO_NETWORK_INTERFACES = 1, process.env.CASTING_DISABLED = 1, process.env.DISABLE_CACHING = 1, process.env.NO_CORS = 1), __webpack_require__(565); var enginefs = __webpack_require__(172), path = __webpack_require__(5), os = __webpack_require__(23), http = __webpack_require__(11), url = __webpack_require__(7), ip = __webpack_require__(127), mkdirp = __webpack_require__(186), HLS = __webpack_require__(667), moment = __webpack_require__(1), isPositiveInteger = __webpack_require__(399), subtitlesTracks = __webpack_require__(733), subtitlesHash = __webpack_require__(794), https = __webpack_require__(804), proxy = __webpack_require__(805), defaultTrackers = __webpack_require__(806).map((el => `tracker:${el}`)), hwAccelProfiler = __webpack_require__(411).profiler, getTracksData = __webpack_require__(812).default, bridge = __webpack_require__(194), argv = __webpack_require__(815)(process.argv.slice(2)), apiCertifficateEndpoint = argv["https-cert-endpoint"] || process.env.HTTPS_CERT_ENDPOINT || "https://api.strem.io/api/certificateGet", webUILocation = argv["webui-location"] || process.env.WEBUI_LOCATION || "https://app.strem.io/shell-v4.4/", cache = __webpack_require__(414), searchPaths = { ffmpeg: [ argv.ffmpeg, process.env.FFMPEG_BIN, path.dirname(process.execPath) + "/ffmpeg", path.dirname(process.execPath) + "\\ffmpeg.exe", path.dirname(process.execPath) + "\\bin\\ffmpeg.exe", "/usr/lib/jellyfin-ffmpeg/ffmpeg", "/usr/bin/ffmpeg", "/usr/local/bin/ffmpeg", "android" !== process.platform ? __webpack_require__(415).ffmpegPath : null ], ffprobe: [ argv.ffprobe, process.env.FFPROBE_BIN, path.dirname(process.execPath) + "/ffprobe", path.dirname(process.execPath) + "\\ffprobe.exe", path.dirname(process.execPath) + "\\bin\\ffprobe.exe", "/usr/lib/jellyfin-ffmpeg/ffprobe", "/usr/bin/ffprobe", "/usr/local/bin/ffprobe", "android" !== process.platform ? __webpack_require__(415).ffprobePath : null ], ffsplit: [ path.join(__dirname, "./node_modules/stremio-ffsplit-prebuilt/bin/ffsplit.bin"), process.env.HOME + "/hls-segment-splitter/ffsplit.bin", path.dirname(process.execPath) + "\\bin\\ffsplit.exe" ] }, executables = HLS.locateAllExecutables(searchPaths); console.log("hls executables located -> ", executables), enginefs.engine = __webpack_require__(816), enginefs.loggingEnabled = !0; var appPath = __webpack_require__(413); try { mkdirp.sync(appPath, { recursive: !0, mode: 493 }); } catch (err) {} console.log("Using app path -> " + appPath), enginefs.router.use((function(req, res, next) { process.env.NO_CORS || !req.headers.origin || req.headers.origin.match(".strem.io(:80)?$") || req.headers.origin.match(".stremio.net(:80)?$") || req.headers.origin.match(".stremio.com(:80)?$") || req.headers.origin.match("stremio-development.netlify.app(:80)?$") || req.headers.origin.match("stremio.github.io(:80)?$") || req.headers.origin.match("gstatic.com") || "https://stremio.github.io" === req.headers.origin || req.headers.origin.match("(127.0.0.1|localhost):11470$") || req.headers.origin.match("peario.xyz") ? enginefs.sendCORSHeaders(req, res, next) : next(); })); var settings = __webpack_require__(105); if (!process.env.HLS_V2_DISABLED) { const hlsV2Router = new (__webpack_require__(854))(executables); enginefs.router.use("/hlsv2", hlsV2Router); const regexParam = (param, expression) => { enginefs.router.param(param, ((req, res, next, val) => { const captures = val.match(expression); if (!captures) return next("route"); req.params[param] = captures.groups ? { val: val, groups: captures.groups } : val, next(); })); }; regexParam("infoHash", /^([0-9a-fA-F]{40}|file|url)$/), regexParam("playlist", /^(?:hls.m3u8|(?:video|audio|subtitle)\d+(?:.m3u8)?)$/), regexParam("HLSSegment", /^(?:init.mp4|segment\d+.(?:m4s|vtt))$/), enginefs.router.get("/:infoHash/:videoId/:playlist/:HLSSegment?", ((req, res, next) => { req.url = `/${encodeURIComponent(`${req.params.infoHash}-${req.params.videoId}`)}/${req.params.playlist.replace("hls.m3u8", "master.m3u8")}`, req.url += req.params.HLSSegment ? `/${req.params.HLSSegment}` : "", req.query = { mediaURL: [ "file", "url" ].includes(req.params.infoHash) ? `${"url" === req.params.infoHash ? "" : "file://"}${req.params.videoId}` : [ enginefs.baseUrlLocal, req.params.infoHash, req.params.videoId ].join("/"), maxAudioChannels: 2 }, hlsV2Router.handle(req, res, next); })); } var avSamples = __webpack_require__(936); Object.keys(avSamples).forEach((key => { enginefs.router.get(`/samples/${key}.${avSamples[key].container}`, ((req, res, next) => { res.writeHead(200, { "Content-Type": avSamples[key].mime }), res.end(Buffer.from(avSamples[key].data, "base64")); })); })), HLS.setParallelConverts(8); var setHLSFrom = function(req, res, next) { var first = req.params.first, second = req.params.second, from = req.params.from || req.query.from; from ? req.params.from = decodeURIComponent(from) : 40 == first.length ? req.params.from = enginefs.baseUrlLocal + "/" + first + "/" + second : "file" != first && "url" != first || (req.params.from = second), next(); }; enginefs.router.get("/:first/:second/hls.m3u8", setHLSFrom, HLS.masterPlaylistMiddleware), enginefs.router.get("/:first/:second/master.m3u8", setHLSFrom, HLS.masterMultiPlaylistMiddleware), enginefs.router.get("/:first/:second/stream.m3u8", setHLSFrom, HLS.streamPlaylistMiddleware), enginefs.router.get("/:first/:second/stream-q-:quality.m3u8", setHLSFrom, HLS.streamPlaylistMiddleware), enginefs.router.get("/:first/:second/stream-:stream.m3u8", setHLSFrom, HLS.streamPlaylistMiddleware), enginefs.router.get("/:first/:second/stream-q-:quality/:seg.ts", setHLSFrom, HLS.segmentMiddleware), enginefs.router.get("/:first/:second/stream-:stream/:seg.ts", setHLSFrom, HLS.segmentMiddleware), HLS.mp4StreamPlaylistMiddleware && enginefs.router.get("/:first/:second/mp4stream-q-:quality.m3u8", setHLSFrom, HLS.mp4StreamPlaylistMiddleware), HLS.segmentMp4Middleware && enginefs.router.get("/:first/:second/mp4stream-q-:quality/:seg.mp4", setHLSFrom, HLS.segmentMp4Middleware), enginefs.router.get("/:first/:second/dlna", setHLSFrom, HLS.DLNAMpegTtsMiddleware), enginefs.router.get("/:first/:second/subs-:lang.m3u8", setHLSFrom, HLS.subsPlaylistMiddleware), enginefs.router.get("/:first/:second/thumb.jpg", setHLSFrom, HLS.thumbMiddleware), enginefs.router.get("/thumb.jpg", setHLSFrom, HLS.thumbMiddleware), enginefs.router.get("/probe", (function(req, res, next) { var vid = url.parse(req.url, !0).query.url; vid.match("://") || (vid = enginefs.baseUrlLocal + vid), HLS.probeVideo(vid, (function(err, result) { err && console.error(err), res.writeHead(err ? 500 : 200, { "content-type": "application/json" }), res.end(JSON.stringify(result)); })); })), enginefs.router.get("/tracks/:url", (function(req, res, next) { getTracksData(req.params.url, { maxBytesLimit: 26214400 }).then((function(tracks) { res.writeHead(200, { "content-type": "application/json" }), res.end(JSON.stringify(tracks)); })).catch((function(e) { console.error(e), res.writeHead(200, { "content-type": "application/json" }), res.end(JSON.stringify([])); })); })); var ytdl = __webpack_require__(937); function getYt(id, cb) { ytdl.getInfo("http://www.youtube.com/watch?v=" + id, { downloadURL: !0 }).then((function(inf) { if (inf) { var formatPref = ytdl.chooseFormat(inf.formats, { filter: "audioandvideo" }); cb(null, formatPref); } else cb(new Error("empty response from ytdl.getInfo")); })).catch((function(err) { cb(err || new Error("unknown error from ytdl.getInfo")); })); } if (enginefs.router.get("/yt/:id.json", (function(req, res, next) { getYt(req.params.id, (function(err, format) { var status = 200, body = {}; err && (status = 403, body = { err: err.message || err }), format && format.url ? body = format : status = 404, res.writeHead(status, { "content-type": "application/json" }), res.end(JSON.stringify(body)); })); })), enginefs.router.get("/yt/:id", (function(req, res, next) { getYt(req.params.id, (function(err, format) { if (err) return console.error(err), res.writeHead(403), void res.end(); format && format.url ? res.writeHead(301, { Location: format.url }) : res.writeHead(404), res.end(); })); })), !process.env.CASTING_DISABLED && "android" !== process.platform) { console.log("Enabling casting..."); var casting = new (__webpack_require__(944))(executables); enginefs.router.use("/casting/", casting.middleware); } enginefs.router.get("/subtitlesTracks", (function(req, res) { subtitlesTracks({ url: req.query.subsUrl }, (function(error, result) { var code = error ? 500 : 200, body = JSON.stringify({ error: error, result: result }); res.writeHead(code, { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(body, "utf8") }), res.end(body); })); })), enginefs.router.get("/opensubHash", (function(req, res) { subtitlesHash({ url: req.query.videoUrl }, (function(error, result) { var code = error ? 500 : 200; error = error ? error.message : null; var body = JSON.stringify({ error: error, result: result }); res.writeHead(code, { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(body, "utf8") }), res.end(body); })); })), enginefs.router.get("/subtitles.:ext", (function(req, res) { var isVtt = req.url.match("^/subtitles.vtt"), query = url.parse(req.url, !0).query, offset = query.offset ? parseInt(query.offset) : null; subtitlesTracks({ url: query.from }, (function(err, handle) { if (err) return console.error(err), res.writeHead(500), void res.end(); if (0 === handle.tracks.length) return res.writeHead(500), void res.end(); isVtt && res.write("WEBVTT\n\n"); var format = function(d) { return isVtt ? moment(d).utcOffset(0).format("HH:mm:ss.SSS") : moment(d).utcOffset(0).format("HH:mm:ss,SSS"); }, applOffset = offset ? function(d) { return new Date(new Date(d).getTime() + offset); } : function(d) { return new Date(d); }; handle.tracks.forEach((function(track, i) { res.write(i.toString() + "\n"), res.write(format(applOffset(track.startTime)) + " --\x3e " + format(applOffset(track.endTime)) + "\n"), res.write(track.text.replace(/&/g, "&") + "\n\n"); })), res.end(); })); })), enginefs.router.get("/network-info", ((req, res) => { try { const networkInterfaces = process.env.NO_NETWORK_INTERFACES ? [] : os.networkInterfaces(), availableInterfaces = Object.entries(networkInterfaces).flatMap((([, addresses]) => addresses)).filter((({internal: internal, family: family}) => !internal && "IPv4" === family)).map((({address: address}) => address)), networkInfo = JSON.stringify({ availableInterfaces: availableInterfaces }); res.writeHead(200, { "Content-Type": "application/json" }), res.end(networkInfo); } catch (e) { console.error(e), res.writeHead(500, { "Content-Type": "text/plain", "Content-Length": e.message.length }), res.end(e.message); } })), enginefs.router.get("/device-info", ((req, res) => { try { const onHardwareAcceleration = profiles => { const deviceInfo = JSON.stringify({ availableHardwareAccelerations: profiles }); res.writeHead(200, { "Content-Type": "application/json" }), res.end(deviceInfo); }, port = server.address().port; hwAccelProfiler(port, onHardwareAcceleration); } catch (e) { console.error(e), res.writeHead(500, { "Content-Type": "text/plain", "Content-Length": e.message.length }), res.end(e.message); } })), enginefs.router.get("/settings", (function(req, res) { res.writeHead(200, { "content-type": "application/json" }), cache.getOptions((function(err, opts) { res.end(JSON.stringify({ options: opts, values: settings, baseUrl: enginefs.baseUrl || enginefs.baseUrlLocal })); })); })), enginefs.router.post("/settings", (function(req, res) { settings.extend(req.body), cache.setOptionValues(settings), settings.save((function() { res.writeHead(200, { "content-type": "application/json" }), res.end(JSON.stringify({ success: !0 })); })); })), enginefs.router.get("/heartbeat", (function(req, res) { res.writeHead(200, { "content-type": "application/json" }), res.end(JSON.stringify({ success: !0 })); })); var localAddon = __webpack_require__(1024); enginefs.router.use("/local-addon", localAddon.addon({ disableCatalogSupport: !settings.localAddonEnabled }).getRouter()), "android" !== process.platform && settings.localAddonEnabled && localAddon.startIndexing(path.join(appPath, "./localFiles")), enginefs.router.get("/get-https", (function(req, res) { var message; https.newCertificate(req.query.ipAddress, req.query.authKey).then((function(cert) { message = JSON.stringify({ ipAddress: req.query.ipAddress, domain: cert.domain, port: sserver.address().port }), res.writeHead(200, { "content-type": "application/json", "content-length": message.length }), res.end(message); })).catch((function(err) { message = "Cannot get valid certificate", res.writeHead(500, { "content-type": "text/plain", "content-length": message.length }), res.end(message), console.error(message, err); })); })), enginefs.router.get("/hwaccel-profiler", (function(req, res) { hwAccelProfiler(server.address().port, (function(result) { result ? res.end(JSON.stringify(result)) : (message = "No viable hardware acceleration profiles detected", res.writeHead(500, { "content-type": "text/plain", "content-length": message.length }), res.end(message)); })); })), enginefs.router.get("/", (function(req, res, next) { if (!req.headers.host) return next("No host header"); var socketConstructor = req.socket.constructor.name, protocol = ""; if ("Socket" == socketConstructor) protocol = "http://"; else { if ("TLSSocket" != socketConstructor) return next("Unknown protocol"); protocol = "https://"; } var serverUrl = encodeURIComponent(protocol + req.headers.host), sep = webUILocation.includes("?") ? "&" : "?", location = webUILocation + sep + "streamingServer=" + serverUrl; res.writeHead(307, { location: location }), res.end(); })), enginefs.router.use("/proxy", proxy.getRouter()); var app = enginefs.app(), server = (http = __webpack_require__(11), enginefs._server = http.createServer(app)), port = 11470; server.listen(port), server.on("error", (function(err) { port++ < 11474 ? (console.warn(err), server.listen(port)) : console.error(err); })), http.globalAgent.maxSockets = 40; const nzbHttp = __webpack_require__(1088); server.on("listening", (function() { enginefs.baseUrlLocal = "http://127.0.0.1:" + server.address().port, enginefs.baseUrl = "http://" + ip.address() + ":" + server.address().port, localAddon.setEngineUrl(enginefs.baseUrlLocal), console.log("EngineFS server started at " + enginefs.baseUrlLocal), hwAccelProfiler(server.address().port), bridge.dispatch("status", "ready"); })), server.on("error", (function(err) { console.warn(err), bridge.dispatch("status", "error"); })), https.setOptions({ appPath: appPath, apiEndpoint: apiCertifficateEndpoint }); var sserver = https.createServer(app); if (sserver.listen(12470), sserver.on("listening", (function() { console.log("EngineFS HTTPS endpoint at https://local.strem.io:12470"); })), sserver.on("error", (function(err) { console.warn(err); })), argv.open || process.env.OPEN) { var open = __webpack_require__(1118); server.on("listening", (function() { open(enginefs.baseUrlLocal); })); } enginefs.STREAM_TIMEOUT = 2e4, enginefs.ENGINE_TIMEOUT = 12e4, enginefs.on("engine-created", (function(hash) { console.log("Engine created for " + hash), cache.clearCache(enginefs.getCachePath(""), settings.cacheSize, 0); })), enginefs.on("engine-destroyed", (function(hash) { console.log("Engine " + hash + " destroyed"); })), enginefs.on("engine-idle", (function(hash) { console.log("Engine " + hash + " is idle, pausing swarm"), enginefs.settings(hash, { swarm: "PAUSE" }); })), enginefs.on("engine-inactive", (function(hash) { console.log("Engine " + hash + " is inactive, destroying it"), enginefs.remove(hash); })), enginefs.on("engine-error", (function(hash, err) { console.error("Engine error for " + hash), console.error(err); })), enginefs.on("engine-invalid-piece", (function(hash, p) { console.error("Engine invalid piece " + p + " for " + hash); })), enginefs.getCachePath = function(ih) { var err, cacheDir = path.join(settings.cacheRoot, "stremio-cache"); try { mkdirp.sync(cacheDir); } catch (e) { err = e; } return err && mkdirp.sync(cacheDir = os.tmpdir()), path.join(cacheDir, ih); }, enginefs.getDefaults = function(ih) { var MAX_CONNECTIONS = isPositiveInteger(settings.btMaxConnections) ? settings.btMaxConnections : 35, HANDSHAKE_TIMEOUT = isPositiveInteger(settings.btHandshakeTimeout) ? settings.btHandshakeTimeout : 2e4, REQUEST_TIMEOUT = isPositiveInteger(settings.btRequestTimeout) ? settings.btRequestTimeout : 4e3, DOWNLOAD_SPEED_LIMIT = isPositiveInteger(settings.btDownloadSpeedSoftLimit) ? settings.btDownloadSpeedSoftLimit : 1677721.6, DOWNLOAD_SPEED_HARD_LIMIT = isPositiveInteger(settings.btDownloadSpeedHardLimit) ? settings.btDownloadSpeedHardLimit : 2621440, MIN_PEERS_FOR_STABLE = isPositiveInteger(settings.btMinPeersForStable) ? settings.btMinPeersForStable : 5, defaults = { peerSearch: { min: 40, max: 150, sources: defaultTrackers.concat([ `dht:${ih}` ]) }, dht: !1, tracker: !1, connections: MAX_CONNECTIONS, handshakeTimeout: HANDSHAKE_TIMEOUT, timeout: REQUEST_TIMEOUT, virtual: !0, swarmCap: { minPeers: MIN_PEERS_FOR_STABLE, maxSpeed: DOWNLOAD_SPEED_LIMIT }, growler: { flood: 0, pulse: DOWNLOAD_SPEED_HARD_LIMIT } }; return (argv.noCache || 0 == settings.cacheSize) && (defaults.buffer = 15728640, defaults.circularBuffer = { type: "memory", size: 47185920 }, defaults.swarmCap = { minPeers: MIN_PEERS_FOR_STABLE, maxBuffer: .75 }), defaults; }; const rarHttp = __webpack_require__(1119); enginefs.router.use("/rar", rarHttp.router()); const zipHttp = __webpack_require__(1232); enginefs.router.use("/zip", zipHttp.router()); const a7zHttp = __webpack_require__(1283); enginefs.router.use("/7zip", a7zHttp.router()); const tarHttp = __webpack_require__(1291); enginefs.router.use("/tar", tarHttp.router()); const gzipHttp = __webpack_require__(1298); enginefs.router.use("/tgz", gzipHttp.router()); const ftpHttp = __webpack_require__(1305); enginefs.router.use("/ftp", ftpHttp.router()), enginefs.router.use("/nzb", nzbHttp.router()), module.exports = enginefs; }).call(this, "/"); }, function(module, exports) { const reduce = Function.bind.call(Function.call, Array.prototype.reduce), isEnumerable = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable), concat = Function.bind.call(Function.call, Array.prototype.concat), keys = Reflect.ownKeys; Object.values || (Object.values = function(O) { return reduce(keys(O), ((v, k) => concat(v, "string" == typeof k && isEnumerable(O, k) ? [ O[k] ] : [])), []); }), Object.entries || (Object.entries = function(O) { return reduce(keys(O), ((e, k) => concat(e, "string" == typeof k && isEnumerable(O, k) ? [ [ k, O[k] ] ] : [])), []); }), Object.fromEntries || (Object.fromEntries = function(iter) { const obj = {}; for (const pair of iter) { if (Object(pair) !== pair) throw new TypeError("iterable for fromEntries should yield objects"); const {0: key, 1: val} = pair; Object.defineProperty(obj, key, { configurable: !0, enumerable: !0, writable: !0, value: val }); } return obj; }), Array.prototype.flat || Object.defineProperty(Array.prototype, "flat", { value: function(depth) { return depth = depth || 1, this.reduce((function(flat, toFlatten) { return flat.concat(Array.isArray(toFlatten) && depth > 1 ? toFlatten.flat(depth - 1) : toFlatten); }), []); } }), Buffer.prototype.readBigInt64LE || (Buffer.prototype.readBigInt64LE = function(offset = 0) { if (offset < 0 || offset + 8 > this.length) throw new RangeError("Index out of range"); const bytes = new Array(8); for (let i = 0; i < 8; i++) bytes[i] = this[offset + i]; let result = "0"; for (let i = 7; i >= 0; i--) { let binary = Number(result).toString(2); for (;binary.length < 8 * (8 - i); ) binary = "0" + binary; let byteBinary = bytes[i].toString(2); for (;byteBinary.length < 8; ) byteBinary = "0" + byteBinary; result = parseInt(binary + byteBinary, 2).toString(); } if (128 & bytes[7]) { const max = "18446744073709551616"; let difference = "", borrow = 0; for (let i = result.length - 1; i >= 0; i--) { let diff = (i < max.length ? parseInt(max[i]) : 0) - (i < result.length ? parseInt(result[i]) : 0) - borrow; diff < 0 ? (diff += 10, borrow = 1) : borrow = 0, difference = diff.toString() + difference; } result = "-" + difference; } return result; }), Buffer.prototype.readBigUInt64LE || (Buffer.prototype.readBigUInt64LE = function(offset) { return (function(buffer, offset) { if (!(buffer instanceof Buffer)) throw new TypeError("First argument must be a Buffer"); if (8 + (offset >>>= 0) > buffer.length) throw new RangeError("Index out of range"); const lo = buffer.readUInt32LE(offset), hi = buffer.readUInt32LE(offset + 4); if (hi < 2097152) return 4294967296 * hi + lo; { const hiStr = hi.toString(16).padStart(8, "0"), loStr = lo.toString(16).padStart(8, "0"); let result = "0x" + hiStr + loStr; return result = 4294967296 * parseInt(hiStr, 16) + parseInt(loStr, 16), result.toString(); } })(this, offset); }); }, function(module, exports, __webpack_require__) { "use strict"; var iconvLite = __webpack_require__(66), Iconv = __webpack_require__(584); function convertIconvLite(str, to, from) { return "UTF-8" === to ? iconvLite.decode(str, from) : "UTF-8" === from ? iconvLite.encode(str, to) : iconvLite.encode(iconvLite.decode(str, from), to); } function checkEncoding(name) { return (name || "").toString().trim().replace(/^latin[\-_]?(\d+)$/i, "ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i, "WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i, "UTF-$1").replace(/^ks_c_5601\-1987$/i, "CP949").replace(/^us[\-_]?ascii$/i, "ASCII").toUpperCase(); } module.exports.convert = function(str, to, from, useLite) { var result; if (from = checkEncoding(from || "UTF-8"), to = checkEncoding(to || "UTF-8"), str = str || "", "UTF-8" !== from && "string" == typeof str && (str = new Buffer(str, "binary")), from === to) result = "string" == typeof str ? new Buffer(str) : str; else if (Iconv && !useLite) try { result = (function(str, to, from) { var response; return (response = new Iconv(from, to + "//TRANSLIT//IGNORE").convert(str)).slice(0, response.length); })(str, to, from); } catch (E) { console.error(E); try { result = convertIconvLite(str, to, from); } catch (E) { console.error(E), result = str; } } else try { result = convertIconvLite(str, to, from); } catch (E) { console.error(E), result = str; } return "string" == typeof result && (result = new Buffer(result, "utf-8")), result; }; }, function(module, exports, __webpack_require__) { "use strict"; function PrependBOMWrapper(encoder, options) { this.encoder = encoder, this.addBOM = !0; } function StripBOMWrapper(decoder, options) { this.decoder = decoder, this.pass = !1, this.options = options || {}; } exports.PrependBOM = PrependBOMWrapper, PrependBOMWrapper.prototype.write = function(str) { return this.addBOM && (str = "\ufeff" + str, this.addBOM = !1), this.encoder.write(str); }, PrependBOMWrapper.prototype.end = function() { return this.encoder.end(); }, exports.StripBOM = StripBOMWrapper, StripBOMWrapper.prototype.write = function(buf) { var res = this.decoder.write(buf); return this.pass || !res || ("\ufeff" === res[0] && (res = res.slice(1), "function" == typeof this.options.stripBOM && this.options.stripBOM()), this.pass = !0), res; }, StripBOMWrapper.prototype.end = function() { return this.decoder.end(); }; }, function(module, exports, __webpack_require__) { "use strict"; for (var modules = [ __webpack_require__(569), __webpack_require__(570), __webpack_require__(571), __webpack_require__(572), __webpack_require__(573), __webpack_require__(574), __webpack_require__(575), __webpack_require__(576) ], i = 0; i < modules.length; i++) for (var enc in module = modules[i]) Object.prototype.hasOwnProperty.call(module, enc) && (exports[enc] = module[enc]); }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(14).Buffer; function InternalCodec(codecOptions, iconv) { this.enc = codecOptions.encodingName, this.bomAware = codecOptions.bomAware, "base64" === this.enc ? this.encoder = InternalEncoderBase64 : "cesu8" === this.enc && (this.enc = "utf8", this.encoder = InternalEncoderCesu8, "💩" !== Buffer.from("eda0bdedb2a9", "hex").toString() && (this.decoder = InternalDecoderCesu8, this.defaultCharUnicode = iconv.defaultCharUnicode)); } module.exports = { utf8: { type: "_internal", bomAware: !0 }, cesu8: { type: "_internal", bomAware: !0 }, unicode11utf8: "utf8", ucs2: { type: "_internal", bomAware: !0 }, utf16le: "ucs2", binary: { type: "_internal" }, base64: { type: "_internal" }, hex: { type: "_internal" }, _internal: InternalCodec }, InternalCodec.prototype.encoder = InternalEncoder, InternalCodec.prototype.decoder = InternalDecoder; var StringDecoder = __webpack_require__(173).StringDecoder; function InternalDecoder(options, codec) { StringDecoder.call(this, codec.enc); } function InternalEncoder(options, codec) { this.enc = codec.enc; } function InternalEncoderBase64(options, codec) { this.prevStr = ""; } function InternalEncoderCesu8(options, codec) {} function InternalDecoderCesu8(options, codec) { this.acc = 0, this.contBytes = 0, this.accBytes = 0, this.defaultCharUnicode = codec.defaultCharUnicode; } StringDecoder.prototype.end || (StringDecoder.prototype.end = function() {}), InternalDecoder.prototype = StringDecoder.prototype, InternalEncoder.prototype.write = function(str) { return Buffer.from(str, this.enc); }, InternalEncoder.prototype.end = function() {}, InternalEncoderBase64.prototype.write = function(str) { var completeQuads = (str = this.prevStr + str).length - str.length % 4; return this.prevStr = str.slice(completeQuads), str = str.slice(0, completeQuads), Buffer.from(str, "base64"); }, InternalEncoderBase64.prototype.end = function() { return Buffer.from(this.prevStr, "base64"); }, InternalEncoderCesu8.prototype.write = function(str) { for (var buf = Buffer.alloc(3 * str.length), bufIdx = 0, i = 0; i < str.length; i++) { var charCode = str.charCodeAt(i); charCode < 128 ? buf[bufIdx++] = charCode : charCode < 2048 ? (buf[bufIdx++] = 192 + (charCode >>> 6), buf[bufIdx++] = 128 + (63 & charCode)) : (buf[bufIdx++] = 224 + (charCode >>> 12), buf[bufIdx++] = 128 + (charCode >>> 6 & 63), buf[bufIdx++] = 128 + (63 & charCode)); } return buf.slice(0, bufIdx); }, InternalEncoderCesu8.prototype.end = function() {}, InternalDecoderCesu8.prototype.write = function(buf) { for (var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = "", i = 0; i < buf.length; i++) { var curByte = buf[i]; 128 != (192 & curByte) ? (contBytes > 0 && (res += this.defaultCharUnicode, contBytes = 0), curByte < 128 ? res += String.fromCharCode(curByte) : curByte < 224 ? (acc = 31 & curByte, contBytes = 1, accBytes = 1) : curByte < 240 ? (acc = 15 & curByte, contBytes = 2, accBytes = 1) : res += this.defaultCharUnicode) : contBytes > 0 ? (acc = acc << 6 | 63 & curByte, accBytes++, 0 == --contBytes && (res += 2 === accBytes && acc < 128 && acc > 0 || 3 === accBytes && acc < 2048 ? this.defaultCharUnicode : String.fromCharCode(acc))) : res += this.defaultCharUnicode; } return this.acc = acc, this.contBytes = contBytes, this.accBytes = accBytes, res; }, InternalDecoderCesu8.prototype.end = function() { var res = 0; return this.contBytes > 0 && (res += this.defaultCharUnicode), res; }; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(14).Buffer; function Utf16BECodec() {} function Utf16BEEncoder() {} function Utf16BEDecoder() { this.overflowByte = -1; } function Utf16Codec(codecOptions, iconv) { this.iconv = iconv; } function Utf16Encoder(options, codec) { void 0 === (options = options || {}).addBOM && (options.addBOM = !0), this.encoder = codec.iconv.getEncoder("utf-16le", options); } function Utf16Decoder(options, codec) { this.decoder = null, this.initialBytes = [], this.initialBytesLen = 0, this.options = options || {}, this.iconv = codec.iconv; } function detectEncoding(buf, defaultEncoding) { var enc = defaultEncoding || "utf-16le"; if (buf.length >= 2) if (254 == buf[0] && 255 == buf[1]) enc = "utf-16be"; else if (255 == buf[0] && 254 == buf[1]) enc = "utf-16le"; else { for (var asciiCharsLE = 0, asciiCharsBE = 0, _len = Math.min(buf.length - buf.length % 2, 64), i = 0; i < _len; i += 2) 0 === buf[i] && 0 !== buf[i + 1] && asciiCharsBE++, 0 !== buf[i] && 0 === buf[i + 1] && asciiCharsLE++; asciiCharsBE > asciiCharsLE ? enc = "utf-16be" : asciiCharsBE < asciiCharsLE && (enc = "utf-16le"); } return enc; } exports.utf16be = Utf16BECodec, Utf16BECodec.prototype.encoder = Utf16BEEncoder, Utf16BECodec.prototype.decoder = Utf16BEDecoder, Utf16BECodec.prototype.bomAware = !0, Utf16BEEncoder.prototype.write = function(str) { for (var buf = Buffer.from(str, "ucs2"), i = 0; i < buf.length; i += 2) { var tmp = buf[i]; buf[i] = buf[i + 1], buf[i + 1] = tmp; } return buf; }, Utf16BEEncoder.prototype.end = function() {}, Utf16BEDecoder.prototype.write = function(buf) { if (0 == buf.length) return ""; var buf2 = Buffer.alloc(buf.length + 1), i = 0, j = 0; for (-1 !== this.overflowByte && (buf2[0] = buf[0], buf2[1] = this.overflowByte, i = 1, j = 2); i < buf.length - 1; i += 2, j += 2) buf2[j] = buf[i + 1], buf2[j + 1] = buf[i]; return this.overflowByte = i == buf.length - 1 ? buf[buf.length - 1] : -1, buf2.slice(0, j).toString("ucs2"); }, Utf16BEDecoder.prototype.end = function() {}, exports.utf16 = Utf16Codec, Utf16Codec.prototype.encoder = Utf16Encoder, Utf16Codec.prototype.decoder = Utf16Decoder, Utf16Encoder.prototype.write = function(str) { return this.encoder.write(str); }, Utf16Encoder.prototype.end = function() { return this.encoder.end(); }, Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { if (this.initialBytes.push(buf), this.initialBytesLen += buf.length, this.initialBytesLen < 16) return ""; var encoding = detectEncoding(buf = Buffer.concat(this.initialBytes), this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options), this.initialBytes.length = this.initialBytesLen = 0; } return this.decoder.write(buf); }, Utf16Decoder.prototype.end = function() { if (!this.decoder) { var buf = Buffer.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var res = this.decoder.write(buf), trail = this.decoder.end(); return trail ? res + trail : res; } return this.decoder.end(); }; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(14).Buffer; function Utf7Codec(codecOptions, iconv) { this.iconv = iconv; } exports.utf7 = Utf7Codec, exports.unicode11utf7 = "utf7", Utf7Codec.prototype.encoder = Utf7Encoder, Utf7Codec.prototype.decoder = Utf7Decoder, Utf7Codec.prototype.bomAware = !0; var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; function Utf7Encoder(options, codec) { this.iconv = codec.iconv; } function Utf7Decoder(options, codec) { this.iconv = codec.iconv, this.inBase64 = !1, this.base64Accum = ""; } Utf7Encoder.prototype.write = function(str) { return Buffer.from(str.replace(nonDirectChars, function(chunk) { return "+" + ("+" === chunk ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-"; }.bind(this))); }, Utf7Encoder.prototype.end = function() {}; for (var base64Regex = /[A-Za-z0-9\/+]/, base64Chars = [], i = 0; i < 256; i++) base64Chars[i] = base64Regex.test(String.fromCharCode(i)); var plusChar = "+".charCodeAt(0), minusChar = "-".charCodeAt(0), andChar = "&".charCodeAt(0); function Utf7IMAPCodec(codecOptions, iconv) { this.iconv = iconv; } function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv, this.inBase64 = !1, this.base64Accum = Buffer.alloc(6), this.base64AccumIdx = 0; } function Utf7IMAPDecoder(options, codec) { this.iconv = codec.iconv, this.inBase64 = !1, this.base64Accum = ""; } Utf7Decoder.prototype.write = function(buf) { for (var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum, i = 0; i < buf.length; i++) if (inBase64) { if (!base64Chars[buf[i]]) { if (i == lastI && buf[i] == minusChar) res += "+"; else { var b64str = base64Accum + buf.slice(lastI, i).toString(); res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be"); } buf[i] != minusChar && i--, lastI = i + 1, inBase64 = !1, base64Accum = ""; } } else buf[i] == plusChar && (res += this.iconv.decode(buf.slice(lastI, i), "ascii"), lastI = i + 1, inBase64 = !0); if (inBase64) { var canBeDecoded = (b64str = base64Accum + buf.slice(lastI).toString()).length - b64str.length % 8; base64Accum = b64str.slice(canBeDecoded), b64str = b64str.slice(0, canBeDecoded), res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be"); } else res += this.iconv.decode(buf.slice(lastI), "ascii"); return this.inBase64 = inBase64, this.base64Accum = base64Accum, res; }, Utf7Decoder.prototype.end = function() { var res = ""; return this.inBase64 && this.base64Accum.length > 0 && (res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", res; }, exports.utf7imap = Utf7IMAPCodec, Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder, Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder, Utf7IMAPCodec.prototype.bomAware = !0, Utf7IMAPEncoder.prototype.write = function(str) { for (var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer.alloc(5 * str.length + 10), bufIdx = 0, i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); 32 <= uChar && uChar <= 126 ? (inBase64 && (base64AccumIdx > 0 && (bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx), base64AccumIdx = 0), buf[bufIdx++] = minusChar, inBase64 = !1), inBase64 || (buf[bufIdx++] = uChar, uChar === andChar && (buf[bufIdx++] = minusChar))) : (inBase64 || (buf[bufIdx++] = andChar, inBase64 = !0), inBase64 && (base64Accum[base64AccumIdx++] = uChar >> 8, base64Accum[base64AccumIdx++] = 255 & uChar, base64AccumIdx == base64Accum.length && (bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx), base64AccumIdx = 0))); } return this.inBase64 = inBase64, this.base64AccumIdx = base64AccumIdx, buf.slice(0, bufIdx); }, Utf7IMAPEncoder.prototype.end = function() { var buf = Buffer.alloc(10), bufIdx = 0; return this.inBase64 && (this.base64AccumIdx > 0 && (bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx), this.base64AccumIdx = 0), buf[bufIdx++] = minusChar, this.inBase64 = !1), buf.slice(0, bufIdx); }; var base64IMAPChars = base64Chars.slice(); base64IMAPChars[",".charCodeAt(0)] = !0, Utf7IMAPDecoder.prototype.write = function(buf) { for (var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum, i = 0; i < buf.length; i++) if (inBase64) { if (!base64IMAPChars[buf[i]]) { if (i == lastI && buf[i] == minusChar) res += "&"; else { var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, "/"); res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be"); } buf[i] != minusChar && i--, lastI = i + 1, inBase64 = !1, base64Accum = ""; } } else buf[i] == andChar && (res += this.iconv.decode(buf.slice(lastI, i), "ascii"), lastI = i + 1, inBase64 = !0); if (inBase64) { var canBeDecoded = (b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, "/")).length - b64str.length % 8; base64Accum = b64str.slice(canBeDecoded), b64str = b64str.slice(0, canBeDecoded), res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be"); } else res += this.iconv.decode(buf.slice(lastI), "ascii"); return this.inBase64 = inBase64, this.base64Accum = base64Accum, res; }, Utf7IMAPDecoder.prototype.end = function() { var res = ""; return this.inBase64 && this.base64Accum.length > 0 && (res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", res; }; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(14).Buffer; function SBCSCodec(codecOptions, iconv) { if (!codecOptions) throw new Error("SBCS codec is called without the data."); if (!codecOptions.chars || 128 !== codecOptions.chars.length && 256 !== codecOptions.chars.length) throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)"); if (128 === codecOptions.chars.length) { for (var asciiString = "", i = 0; i < 128; i++) asciiString += String.fromCharCode(i); codecOptions.chars = asciiString + codecOptions.chars; } this.decodeBuf = Buffer.from(codecOptions.chars, "ucs2"); var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); for (i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; this.encodeBuf = encodeBuf; } function SBCSEncoder(options, codec) { this.encodeBuf = codec.encodeBuf; } function SBCSDecoder(options, codec) { this.decodeBuf = codec.decodeBuf; } exports._sbcs = SBCSCodec, SBCSCodec.prototype.encoder = SBCSEncoder, SBCSCodec.prototype.decoder = SBCSDecoder, SBCSEncoder.prototype.write = function(str) { for (var buf = Buffer.alloc(str.length), i = 0; i < str.length; i++) buf[i] = this.encodeBuf[str.charCodeAt(i)]; return buf; }, SBCSEncoder.prototype.end = function() {}, SBCSDecoder.prototype.write = function(buf) { for (var decodeBuf = this.decodeBuf, newBuf = Buffer.alloc(2 * buf.length), idx1 = 0, idx2 = 0, i = 0; i < buf.length; i++) idx1 = 2 * buf[i], newBuf[idx2 = 2 * i] = decodeBuf[idx1], newBuf[idx2 + 1] = decodeBuf[idx1 + 1]; return newBuf.toString("ucs2"); }, SBCSDecoder.prototype.end = function() {}; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { 10029: "maccenteuro", maccenteuro: { type: "_sbcs", chars: "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" }, 808: "cp808", ibm808: "cp808", cp808: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, mik: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ascii8bit: "ascii", usascii: "ascii", ansix34: "ascii", ansix341968: "ascii", ansix341986: "ascii", csascii: "ascii", cp367: "ascii", ibm367: "ascii", isoir6: "ascii", iso646us: "ascii", iso646irv: "ascii", us: "ascii", latin1: "iso88591", latin2: "iso88592", latin3: "iso88593", latin4: "iso88594", latin5: "iso88599", latin6: "iso885910", latin7: "iso885913", latin8: "iso885914", latin9: "iso885915", latin10: "iso885916", csisolatin1: "iso88591", csisolatin2: "iso88592", csisolatin3: "iso88593", csisolatin4: "iso88594", csisolatincyrillic: "iso88595", csisolatinarabic: "iso88596", csisolatingreek: "iso88597", csisolatinhebrew: "iso88598", csisolatin5: "iso88599", csisolatin6: "iso885910", l1: "iso88591", l2: "iso88592", l3: "iso88593", l4: "iso88594", l5: "iso88599", l6: "iso885910", l7: "iso885913", l8: "iso885914", l9: "iso885915", l10: "iso885916", isoir14: "iso646jp", isoir57: "iso646cn", isoir100: "iso88591", isoir101: "iso88592", isoir109: "iso88593", isoir110: "iso88594", isoir144: "iso88595", isoir127: "iso88596", isoir126: "iso88597", isoir138: "iso88598", isoir148: "iso88599", isoir157: "iso885910", isoir166: "tis620", isoir179: "iso885913", isoir199: "iso885914", isoir203: "iso885915", isoir226: "iso885916", cp819: "iso88591", ibm819: "iso88591", cyrillic: "iso88595", arabic: "iso88596", arabic8: "iso88596", ecma114: "iso88596", asmo708: "iso88596", greek: "iso88597", greek8: "iso88597", ecma118: "iso88597", elot928: "iso88597", hebrew: "iso88598", hebrew8: "iso88598", turkish: "iso88599", turkish8: "iso88599", thai: "iso885911", thai8: "iso885911", celtic: "iso885914", celtic8: "iso885914", isoceltic: "iso885914", tis6200: "tis620", tis62025291: "tis620", tis62025330: "tis620", 1e4: "macroman", 10006: "macgreek", 10007: "maccyrillic", 10079: "maciceland", 10081: "macturkish", cspc8codepage437: "cp437", cspc775baltic: "cp775", cspc850multilingual: "cp850", cspcp852: "cp852", cspc862latinhebrew: "cp862", cpgr: "cp869", msee: "cp1250", mscyrl: "cp1251", msansi: "cp1252", msgreek: "cp1253", msturk: "cp1254", mshebr: "cp1255", msarab: "cp1256", winbaltrim: "cp1257", cp20866: "koi8r", 20866: "koi8r", ibm878: "koi8r", cskoi8r: "koi8r", cp21866: "koi8u", 21866: "koi8u", ibm1168: "koi8u", strk10482002: "rk1048", tcvn5712: "tcvn", tcvn57121: "tcvn", gb198880: "iso646cn", cn: "iso646cn", csiso14jisc6220ro: "iso646jp", jisc62201969ro: "iso646jp", jp: "iso646jp", cshproman8: "hproman8", r8: "hproman8", roman8: "hproman8", xroman8: "hproman8", ibm1051: "hproman8", mac: "macintosh", csmacintosh: "macintosh" }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { 437: "cp437", 737: "cp737", 775: "cp775", 850: "cp850", 852: "cp852", 855: "cp855", 856: "cp856", 857: "cp857", 858: "cp858", 860: "cp860", 861: "cp861", 862: "cp862", 863: "cp863", 864: "cp864", 865: "cp865", 866: "cp866", 869: "cp869", 874: "windows874", 922: "cp922", 1046: "cp1046", 1124: "cp1124", 1125: "cp1125", 1129: "cp1129", 1133: "cp1133", 1161: "cp1161", 1162: "cp1162", 1163: "cp1163", 1250: "windows1250", 1251: "windows1251", 1252: "windows1252", 1253: "windows1253", 1254: "windows1254", 1255: "windows1255", 1256: "windows1256", 1257: "windows1257", 1258: "windows1258", 28591: "iso88591", 28592: "iso88592", 28593: "iso88593", 28594: "iso88594", 28595: "iso88595", 28596: "iso88596", 28597: "iso88597", 28598: "iso88598", 28599: "iso88599", 28600: "iso885910", 28601: "iso885911", 28603: "iso885913", 28604: "iso885914", 28605: "iso885915", 28606: "iso885916", windows874: { type: "_sbcs", chars: "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, win874: "windows874", cp874: "windows874", windows1250: { type: "_sbcs", chars: "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, win1250: "windows1250", cp1250: "windows1250", windows1251: { type: "_sbcs", chars: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, win1251: "windows1251", cp1251: "windows1251", windows1252: { type: "_sbcs", chars: "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, win1252: "windows1252", cp1252: "windows1252", windows1253: { type: "_sbcs", chars: "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, win1253: "windows1253", cp1253: "windows1253", windows1254: { type: "_sbcs", chars: "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, win1254: "windows1254", cp1254: "windows1254", windows1255: { type: "_sbcs", chars: "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, win1255: "windows1255", cp1255: "windows1255", windows1256: { type: "_sbcs", chars: "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" }, win1256: "windows1256", cp1256: "windows1256", windows1257: { type: "_sbcs", chars: "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" }, win1257: "windows1257", cp1257: "windows1257", windows1258: { type: "_sbcs", chars: "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, win1258: "windows1258", cp1258: "windows1258", iso88591: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, cp28591: "iso88591", iso88592: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, cp28592: "iso88592", iso88593: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" }, cp28593: "iso88593", iso88594: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" }, cp28594: "iso88594", iso88595: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" }, cp28595: "iso88595", iso88596: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" }, cp28596: "iso88596", iso88597: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, cp28597: "iso88597", iso88598: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, cp28598: "iso88598", iso88599: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, cp28599: "iso88599", iso885910: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" }, cp28600: "iso885910", iso885911: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, cp28601: "iso885911", iso885913: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" }, cp28603: "iso885913", iso885914: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" }, cp28604: "iso885914", iso885915: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, cp28605: "iso885915", iso885916: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" }, cp28606: "iso885916", cp437: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm437: "cp437", csibm437: "cp437", cp737: { type: "_sbcs", chars: "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " }, ibm737: "cp737", csibm737: "cp737", cp775: { type: "_sbcs", chars: "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " }, ibm775: "cp775", csibm775: "cp775", cp850: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, ibm850: "cp850", csibm850: "cp850", cp852: { type: "_sbcs", chars: "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " }, ibm852: "cp852", csibm852: "cp852", cp855: { type: "_sbcs", chars: "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " }, ibm855: "cp855", csibm855: "cp855", cp856: { type: "_sbcs", chars: "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " }, ibm856: "cp856", csibm856: "cp856", cp857: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " }, ibm857: "cp857", csibm857: "cp857", cp858: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, ibm858: "cp858", csibm858: "cp858", cp860: { type: "_sbcs", chars: "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm860: "cp860", csibm860: "cp860", cp861: { type: "_sbcs", chars: "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm861: "cp861", csibm861: "cp861", cp862: { type: "_sbcs", chars: "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm862: "cp862", csibm862: "cp862", cp863: { type: "_sbcs", chars: "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm863: "cp863", csibm863: "cp863", cp864: { type: "_sbcs", chars: "\0\b\t\n\v\f\r !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" }, ibm864: "cp864", csibm864: "cp864", cp865: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm865: "cp865", csibm865: "cp865", cp866: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " }, ibm866: "cp866", csibm866: "cp866", cp869: { type: "_sbcs", chars: "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " }, ibm869: "cp869", csibm869: "cp869", cp922: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" }, ibm922: "cp922", csibm922: "cp922", cp1046: { type: "_sbcs", chars: "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" }, ibm1046: "cp1046", csibm1046: "cp1046", cp1124: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" }, ibm1124: "cp1124", csibm1124: "cp1124", cp1125: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " }, ibm1125: "cp1125", csibm1125: "cp1125", cp1129: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, ibm1129: "cp1129", csibm1129: "cp1129", cp1133: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" }, ibm1133: "cp1133", csibm1133: "cp1133", cp1161: { type: "_sbcs", chars: "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " }, ibm1161: "cp1161", csibm1161: "cp1161", cp1162: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, ibm1162: "cp1162", csibm1162: "cp1162", cp1163: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, ibm1163: "cp1163", csibm1163: "cp1163", maccroatian: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" }, maccyrillic: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, macgreek: { type: "_sbcs", chars: "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" }, maciceland: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, macroman: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, macromania: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, macthai: { type: "_sbcs", chars: "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\ufeff​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" }, macturkish: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" }, macukraine: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, koi8r: { type: "_sbcs", chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, koi8u: { type: "_sbcs", chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, koi8ru: { type: "_sbcs", chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, koi8t: { type: "_sbcs", chars: "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, armscii8: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" }, rk1048: { type: "_sbcs", chars: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, tcvn: { type: "_sbcs", chars: "\0ÚỤỪỬỮ\b\t\n\v\f\rỨỰỲỶỸÝỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" }, georgianacademy: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, georgianps: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, pt154: { type: "_sbcs", chars: "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, viscii: { type: "_sbcs", chars: "\0ẲẴẪ\b\t\n\v\f\rỶỸỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" }, iso646cn: { type: "_sbcs", chars: "\0\b\t\n\v\f\r !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, iso646jp: { type: "_sbcs", chars: "\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, hproman8: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" }, macintosh: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, ascii: { type: "_sbcs", chars: "��������������������������������������������������������������������������������������������������������������������������������" }, tis620: { type: "_sbcs", chars: "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } }; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(14).Buffer; exports._dbcs = DBCSCodec; for (var UNASSIGNED_NODE = new Array(256), i = 0; i < 256; i++) UNASSIGNED_NODE[i] = -1; function DBCSCodec(codecOptions, iconv) { if (this.encodingName = codecOptions.encodingName, !codecOptions) throw new Error("DBCS codec is called without the data."); if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data."); var mappingTable = codecOptions.table(); this.decodeTables = [], this.decodeTables[0] = UNASSIGNED_NODE.slice(0), this.decodeTableSeq = []; for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]); this.defaultCharUnicode = iconv.defaultCharUnicode, this.encodeTable = [], this.encodeTableSeq = []; var skipEncodeChars = {}; if (codecOptions.encodeSkipVals) for (i = 0; i < codecOptions.encodeSkipVals.length; i++) { var val = codecOptions.encodeSkipVals[i]; if ("number" == typeof val) skipEncodeChars[val] = !0; else for (var j = val.from; j <= val.to; j++) skipEncodeChars[j] = !0; } if (this._fillEncodeTable(0, 0, skipEncodeChars), codecOptions.encodeAdd) for (var uChar in codecOptions.encodeAdd) Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar) && this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); if (this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)], -1 === this.defCharSB && (this.defCharSB = this.encodeTable[0]["?"]), -1 === this.defCharSB && (this.defCharSB = "?".charCodeAt(0)), "function" == typeof codecOptions.gb18030) { this.gb18030 = codecOptions.gb18030(); var thirdByteNodeIdx = this.decodeTables.length, thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0), fourthByteNodeIdx = this.decodeTables.length, fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); for (i = 129; i <= 254; i++) { var secondByteNodeIdx = -1e3 - this.decodeTables[0][i], secondByteNode = this.decodeTables[secondByteNodeIdx]; for (j = 48; j <= 57; j++) secondByteNode[j] = -1e3 - thirdByteNodeIdx; } for (i = 129; i <= 254; i++) thirdByteNode[i] = -1e3 - fourthByteNodeIdx; for (i = 48; i <= 57; i++) fourthByteNode[i] = -2; } } function DBCSEncoder(options, codec) { this.leadSurrogate = -1, this.seqObj = void 0, this.encodeTable = codec.encodeTable, this.encodeTableSeq = codec.encodeTableSeq, this.defaultCharSingleByte = codec.defCharSB, this.gb18030 = codec.gb18030; } function DBCSDecoder(options, codec) { this.nodeIdx = 0, this.prevBuf = Buffer.alloc(0), this.decodeTables = codec.decodeTables, this.decodeTableSeq = codec.decodeTableSeq, this.defaultCharUnicode = codec.defaultCharUnicode, this.gb18030 = codec.gb18030; } function findIdx(table, val) { if (table[0] > val) return -1; for (var l = 0, r = table.length; l < r - 1; ) { var mid = l + Math.floor((r - l + 1) / 2); table[mid] <= val ? l = mid : r = mid; } return l; } DBCSCodec.prototype.encoder = DBCSEncoder, DBCSCodec.prototype.decoder = DBCSDecoder, DBCSCodec.prototype._getDecodeTrieNode = function(addr) { for (var bytes = []; addr > 0; addr >>= 8) bytes.push(255 & addr); 0 == bytes.length && bytes.push(0); for (var node = this.decodeTables[0], i = bytes.length - 1; i > 0; i--) { var val = node[bytes[i]]; if (-1 == val) node[bytes[i]] = -1e3 - this.decodeTables.length, this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); else { if (!(val <= -1e3)) throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); node = this.decodeTables[-1e3 - val]; } } return node; }, DBCSCodec.prototype._addDecodeChunk = function(chunk) { var curAddr = parseInt(chunk[0], 16), writeTable = this._getDecodeTrieNode(curAddr); curAddr &= 255; for (var k = 1; k < chunk.length; k++) { var part = chunk[k]; if ("string" == typeof part) for (var l = 0; l < part.length; ) { var code = part.charCodeAt(l++); if (55296 <= code && code < 56320) { var codeTrail = part.charCodeAt(l++); if (!(56320 <= codeTrail && codeTrail < 57344)) throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); writeTable[curAddr++] = 65536 + 1024 * (code - 55296) + (codeTrail - 56320); } else if (4080 < code && code <= 4095) { for (var len = 4095 - code + 2, seq = [], m = 0; m < len; m++) seq.push(part.charCodeAt(l++)); writeTable[curAddr++] = -10 - this.decodeTableSeq.length, this.decodeTableSeq.push(seq); } else writeTable[curAddr++] = code; } else { if ("number" != typeof part) throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); var charCode = writeTable[curAddr - 1] + 1; for (l = 0; l < part; l++) writeTable[curAddr++] = charCode++; } } if (curAddr > 255) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); }, DBCSCodec.prototype._getEncodeBucket = function(uCode) { var high = uCode >> 8; return void 0 === this.encodeTable[high] && (this.encodeTable[high] = UNASSIGNED_NODE.slice(0)), this.encodeTable[high]; }, DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { var bucket = this._getEncodeBucket(uCode), low = 255 & uCode; bucket[low] <= -10 ? this.encodeTableSeq[-10 - bucket[low]][-1] = dbcsCode : -1 == bucket[low] && (bucket[low] = dbcsCode); }, DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { var node, uCode = seq[0], bucket = this._getEncodeBucket(uCode), low = 255 & uCode; bucket[low] <= -10 ? node = this.encodeTableSeq[-10 - bucket[low]] : (node = {}, -1 !== bucket[low] && (node[-1] = bucket[low]), bucket[low] = -10 - this.encodeTableSeq.length, this.encodeTableSeq.push(node)); for (var j = 1; j < seq.length - 1; j++) { var oldVal = node[uCode]; "object" == typeof oldVal ? node = oldVal : (node = node[uCode] = {}, void 0 !== oldVal && (node[-1] = oldVal)); } node[uCode = seq[seq.length - 1]] = dbcsCode; }, DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { for (var node = this.decodeTables[nodeIdx], i = 0; i < 256; i++) { var uCode = node[i], mbCode = prefix + i; skipEncodeChars[mbCode] || (uCode >= 0 ? this._setEncodeChar(uCode, mbCode) : uCode <= -1e3 ? this._fillEncodeTable(-1e3 - uCode, mbCode << 8, skipEncodeChars) : uCode <= -10 && this._setEncodeSequence(this.decodeTableSeq[-10 - uCode], mbCode)); } }, DBCSEncoder.prototype.write = function(str) { for (var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0; ;) { if (-1 === nextChar) { if (i == str.length) break; var uCode = str.charCodeAt(i++); } else uCode = nextChar, nextChar = -1; if (55296 <= uCode && uCode < 57344) if (uCode < 56320) { if (-1 === leadSurrogate) { leadSurrogate = uCode; continue; } leadSurrogate = uCode, uCode = -1; } else -1 !== leadSurrogate ? (uCode = 65536 + 1024 * (leadSurrogate - 55296) + (uCode - 56320), leadSurrogate = -1) : uCode = -1; else -1 !== leadSurrogate && (nextChar = uCode, uCode = -1, leadSurrogate = -1); var dbcsCode = -1; if (void 0 !== seqObj && -1 != uCode) { var resCode = seqObj[uCode]; if ("object" == typeof resCode) { seqObj = resCode; continue; } "number" == typeof resCode ? dbcsCode = resCode : null == resCode && void 0 !== (resCode = seqObj[-1]) && (dbcsCode = resCode, nextChar = uCode), seqObj = void 0; } else if (uCode >= 0) { var subtable = this.encodeTable[uCode >> 8]; if (void 0 !== subtable && (dbcsCode = subtable[255 & uCode]), dbcsCode <= -10) { seqObj = this.encodeTableSeq[-10 - dbcsCode]; continue; } if (-1 == dbcsCode && this.gb18030) { var idx = findIdx(this.gb18030.uChars, uCode); if (-1 != idx) { dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]), newBuf[j++] = 129 + Math.floor(dbcsCode / 12600), dbcsCode %= 12600, newBuf[j++] = 48 + Math.floor(dbcsCode / 1260), dbcsCode %= 1260, newBuf[j++] = 129 + Math.floor(dbcsCode / 10), dbcsCode %= 10, newBuf[j++] = 48 + dbcsCode; continue; } } } -1 === dbcsCode && (dbcsCode = this.defaultCharSingleByte), dbcsCode < 256 ? newBuf[j++] = dbcsCode : dbcsCode < 65536 ? (newBuf[j++] = dbcsCode >> 8, newBuf[j++] = 255 & dbcsCode) : (newBuf[j++] = dbcsCode >> 16, newBuf[j++] = dbcsCode >> 8 & 255, newBuf[j++] = 255 & dbcsCode); } return this.seqObj = seqObj, this.leadSurrogate = leadSurrogate, newBuf.slice(0, j); }, DBCSEncoder.prototype.end = function() { if (-1 !== this.leadSurrogate || void 0 !== this.seqObj) { var newBuf = Buffer.alloc(10), j = 0; if (this.seqObj) { var dbcsCode = this.seqObj[-1]; void 0 !== dbcsCode && (dbcsCode < 256 ? newBuf[j++] = dbcsCode : (newBuf[j++] = dbcsCode >> 8, newBuf[j++] = 255 & dbcsCode)), this.seqObj = void 0; } return -1 !== this.leadSurrogate && (newBuf[j++] = this.defaultCharSingleByte, this.leadSurrogate = -1), newBuf.slice(0, j); } }, DBCSEncoder.prototype.findIdx = findIdx, DBCSDecoder.prototype.write = function(buf) { var newBuf = Buffer.alloc(2 * buf.length), nodeIdx = this.nodeIdx, prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, seqStart = -this.prevBuf.length; prevBufOffset > 0 && (prevBuf = Buffer.concat([ prevBuf, buf.slice(0, 10) ])); for (var i = 0, j = 0; i < buf.length; i++) { var uCode, curByte = i >= 0 ? buf[i] : prevBuf[i + prevBufOffset]; if ((uCode = this.decodeTables[nodeIdx][curByte]) >= 0) ; else if (-1 === uCode) i = seqStart, uCode = this.defaultCharUnicode.charCodeAt(0); else if (-2 === uCode) { var curSeq = seqStart >= 0 ? buf.slice(seqStart, i + 1) : prevBuf.slice(seqStart + prevBufOffset, i + 1 + prevBufOffset), ptr = 12600 * (curSeq[0] - 129) + 1260 * (curSeq[1] - 48) + 10 * (curSeq[2] - 129) + (curSeq[3] - 48), idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } else { if (uCode <= -1e3) { nodeIdx = -1e3 - uCode; continue; } if (!(uCode <= -10)) throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); for (var seq = this.decodeTableSeq[-10 - uCode], k = 0; k < seq.length - 1; k++) uCode = seq[k], newBuf[j++] = 255 & uCode, newBuf[j++] = uCode >> 8; uCode = seq[seq.length - 1]; } if (uCode > 65535) { uCode -= 65536; var uCodeLead = 55296 + Math.floor(uCode / 1024); newBuf[j++] = 255 & uCodeLead, newBuf[j++] = uCodeLead >> 8, uCode = 56320 + uCode % 1024; } newBuf[j++] = 255 & uCode, newBuf[j++] = uCode >> 8, nodeIdx = 0, seqStart = i + 1; } return this.nodeIdx = nodeIdx, this.prevBuf = seqStart >= 0 ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset), newBuf.slice(0, j).toString("ucs2"); }, DBCSDecoder.prototype.end = function() { for (var ret = ""; this.prevBuf.length > 0; ) { ret += this.defaultCharUnicode; var buf = this.prevBuf.slice(1); this.prevBuf = Buffer.alloc(0), this.nodeIdx = 0, buf.length > 0 && (ret += this.write(buf)); } return this.nodeIdx = 0, ret; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { shiftjis: { type: "_dbcs", table: function() { return __webpack_require__(577); }, encodeAdd: { "¥": 92, "‾": 126 }, encodeSkipVals: [ { from: 60736, to: 63808 } ] }, csshiftjis: "shiftjis", mskanji: "shiftjis", sjis: "shiftjis", windows31j: "shiftjis", ms31j: "shiftjis", xsjis: "shiftjis", windows932: "shiftjis", ms932: "shiftjis", 932: "shiftjis", cp932: "shiftjis", eucjp: { type: "_dbcs", table: function() { return __webpack_require__(578); }, encodeAdd: { "¥": 92, "‾": 126 } }, gb2312: "cp936", gb231280: "cp936", gb23121980: "cp936", csgb2312: "cp936", csiso58gb231280: "cp936", euccn: "cp936", windows936: "cp936", ms936: "cp936", 936: "cp936", cp936: { type: "_dbcs", table: function() { return __webpack_require__(174); } }, gbk: { type: "_dbcs", table: function() { return __webpack_require__(174).concat(__webpack_require__(280)); } }, xgbk: "gbk", isoir58: "gbk", gb18030: { type: "_dbcs", table: function() { return __webpack_require__(174).concat(__webpack_require__(280)); }, gb18030: function() { return __webpack_require__(579); }, encodeSkipVals: [ 128 ], encodeAdd: { "€": 41699 } }, chinese: "gb18030", windows949: "cp949", ms949: "cp949", 949: "cp949", cp949: { type: "_dbcs", table: function() { return __webpack_require__(580); } }, cseuckr: "cp949", csksc56011987: "cp949", euckr: "cp949", isoir149: "cp949", korean: "cp949", ksc56011987: "cp949", ksc56011989: "cp949", ksc5601: "cp949", windows950: "cp950", ms950: "cp950", 950: "cp950", cp950: { type: "_dbcs", table: function() { return __webpack_require__(281); } }, big5: "big5hkscs", big5hkscs: { type: "_dbcs", table: function() { return __webpack_require__(281).concat(__webpack_require__(581)); }, encodeSkipVals: [ 41676 ] }, cnbig5: "big5hkscs", csbig5: "big5hkscs", xxbig5: "big5hkscs" }; }, function(module) { module.exports = [ [ "0", "\0", 128 ], [ "a1", "。", 62 ], [ "8140", " 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈", 9, "+-±×" ], [ "8180", "÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓" ], [ "81b8", "∈∋⊆⊇⊂⊃∪∩" ], [ "81c8", "∧∨¬⇒⇔∀∃" ], [ "81da", "∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬" ], [ "81f0", "ʼn♯♭♪†‡¶" ], [ "81fc", "◯" ], [ "824f", "0", 9 ], [ "8260", "A", 25 ], [ "8281", "a", 25 ], [ "829f", "ぁ", 82 ], [ "8340", "ァ", 62 ], [ "8380", "ム", 22 ], [ "839f", "Α", 16, "Σ", 6 ], [ "83bf", "α", 16, "σ", 6 ], [ "8440", "А", 5, "ЁЖ", 25 ], [ "8470", "а", 5, "ёж", 7 ], [ "8480", "о", 17 ], [ "849f", "─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂" ], [ "8740", "①", 19, "Ⅰ", 9 ], [ "875f", "㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡" ], [ "877e", "㍻" ], [ "8780", "〝〟№㏍℡㊤", 4, "㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪" ], [ "889f", "亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭" ], [ "8940", "院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円" ], [ "8980", "園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改" ], [ "8a40", "魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫" ], [ "8a80", "橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄" ], [ "8b40", "機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救" ], [ "8b80", "朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈" ], [ "8c40", "掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨" ], [ "8c80", "劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向" ], [ "8d40", "后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降" ], [ "8d80", "項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷" ], [ "8e40", "察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止" ], [ "8e80", "死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周" ], [ "8f40", "宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳" ], [ "8f80", "準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾" ], [ "9040", "拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨" ], [ "9080", "逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線" ], [ "9140", "繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻" ], [ "9180", "操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只" ], [ "9240", "叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄" ], [ "9280", "逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓" ], [ "9340", "邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬" ], [ "9380", "凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入" ], [ "9440", "如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅" ], [ "9480", "楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美" ], [ "9540", "鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷" ], [ "9580", "斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋" ], [ "9640", "法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆" ], [ "9680", "摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒" ], [ "9740", "諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲" ], [ "9780", "沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯" ], [ "9840", "蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕" ], [ "989f", "弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲" ], [ "9940", "僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭" ], [ "9980", "凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨" ], [ "9a40", "咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸" ], [ "9a80", "噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩" ], [ "9b40", "奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀" ], [ "9b80", "它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏" ], [ "9c40", "廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠" ], [ "9c80", "怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛" ], [ "9d40", "戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫" ], [ "9d80", "捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼" ], [ "9e40", "曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎" ], [ "9e80", "梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣" ], [ "9f40", "檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯" ], [ "9f80", "麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌" ], [ "e040", "漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝" ], [ "e080", "烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱" ], [ "e140", "瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿" ], [ "e180", "痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬" ], [ "e240", "磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰" ], [ "e280", "窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆" ], [ "e340", "紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷" ], [ "e380", "縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋" ], [ "e440", "隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤" ], [ "e480", "艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈" ], [ "e540", "蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬" ], [ "e580", "蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞" ], [ "e640", "襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧" ], [ "e680", "諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊" ], [ "e740", "蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜" ], [ "e780", "轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮" ], [ "e840", "錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙" ], [ "e880", "閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰" ], [ "e940", "顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃" ], [ "e980", "騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈" ], [ "ea40", "鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯" ], [ "ea80", "黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙" ], [ "ed40", "纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏" ], [ "ed80", "塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱" ], [ "ee40", "犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙" ], [ "ee80", "蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑" ], [ "eeef", "ⅰ", 9, "¬¦'"" ], [ "f040", "", 62 ], [ "f080", "", 124 ], [ "f140", "", 62 ], [ "f180", "", 124 ], [ "f240", "", 62 ], [ "f280", "", 124 ], [ "f340", "", 62 ], [ "f380", "", 124 ], [ "f440", "", 62 ], [ "f480", "", 124 ], [ "f540", "", 62 ], [ "f580", "", 124 ], [ "f640", "", 62 ], [ "f680", "", 124 ], [ "f740", "", 62 ], [ "f780", "", 124 ], [ "f840", "", 62 ], [ "f880", "", 124 ], [ "f940", "" ], [ "fa40", "ⅰ", 9, "Ⅰ", 9, "¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊" ], [ "fa80", "兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯" ], [ "fb40", "涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神" ], [ "fb80", "祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙" ], [ "fc40", "髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑" ] ]; }, function(module) { module.exports = [ [ "0", "\0", 127 ], [ "8ea1", "。", 62 ], [ "a1a1", " 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈", 9, "+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇" ], [ "a2a1", "◆□■△▲▽▼※〒→←↑↓〓" ], [ "a2ba", "∈∋⊆⊇⊂⊃∪∩" ], [ "a2ca", "∧∨¬⇒⇔∀∃" ], [ "a2dc", "∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬" ], [ "a2f2", "ʼn♯♭♪†‡¶" ], [ "a2fe", "◯" ], [ "a3b0", "0", 9 ], [ "a3c1", "A", 25 ], [ "a3e1", "a", 25 ], [ "a4a1", "ぁ", 82 ], [ "a5a1", "ァ", 85 ], [ "a6a1", "Α", 16, "Σ", 6 ], [ "a6c1", "α", 16, "σ", 6 ], [ "a7a1", "А", 5, "ЁЖ", 25 ], [ "a7d1", "а", 5, "ёж", 25 ], [ "a8a1", "─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂" ], [ "ada1", "①", 19, "Ⅰ", 9 ], [ "adc0", "㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡" ], [ "addf", "㍻〝〟№㏍℡㊤", 4, "㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪" ], [ "b0a1", "亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭" ], [ "b1a1", "院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応" ], [ "b2a1", "押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改" ], [ "b3a1", "魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱" ], [ "b4a1", "粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄" ], [ "b5a1", "機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京" ], [ "b6a1", "供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈" ], [ "b7a1", "掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲" ], [ "b8a1", "検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向" ], [ "b9a1", "后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込" ], [ "baa1", "此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷" ], [ "bba1", "察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時" ], [ "bca1", "次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周" ], [ "bda1", "宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償" ], [ "bea1", "勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾" ], [ "bfa1", "拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾" ], [ "c0a1", "澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線" ], [ "c1a1", "繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎" ], [ "c2a1", "臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只" ], [ "c3a1", "叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵" ], [ "c4a1", "帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓" ], [ "c5a1", "邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到" ], [ "c6a1", "董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入" ], [ "c7a1", "如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦" ], [ "c8a1", "函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美" ], [ "c9a1", "鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服" ], [ "caa1", "福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋" ], [ "cba1", "法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満" ], [ "cca1", "漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒" ], [ "cda1", "諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃" ], [ "cea1", "痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯" ], [ "cfa1", "蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕" ], [ "d0a1", "弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲" ], [ "d1a1", "僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨" ], [ "d2a1", "辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨" ], [ "d3a1", "咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉" ], [ "d4a1", "圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩" ], [ "d5a1", "奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓" ], [ "d6a1", "屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏" ], [ "d7a1", "廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚" ], [ "d8a1", "悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛" ], [ "d9a1", "戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼" ], [ "daa1", "據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼" ], [ "dba1", "曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍" ], [ "dca1", "棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣" ], [ "dda1", "檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾" ], [ "dea1", "沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌" ], [ "dfa1", "漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼" ], [ "e0a1", "燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱" ], [ "e1a1", "瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰" ], [ "e2a1", "癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬" ], [ "e3a1", "磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐" ], [ "e4a1", "筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆" ], [ "e5a1", "紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺" ], [ "e6a1", "罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋" ], [ "e7a1", "隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙" ], [ "e8a1", "茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈" ], [ "e9a1", "蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙" ], [ "eaa1", "蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞" ], [ "eba1", "襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫" ], [ "eca1", "譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊" ], [ "eda1", "蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸" ], [ "eea1", "遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮" ], [ "efa1", "錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞" ], [ "f0a1", "陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰" ], [ "f1a1", "顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷" ], [ "f2a1", "髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈" ], [ "f3a1", "鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠" ], [ "f4a1", "堯槇遙瑤凜熙" ], [ "f9a1", "纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德" ], [ "faa1", "忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱" ], [ "fba1", "犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚" ], [ "fca1", "釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑" ], [ "fcf1", "ⅰ", 9, "¬¦'"" ], [ "8fa2af", "˘ˇ¸˙˝¯˛˚~΄΅" ], [ "8fa2c2", "¡¦¿" ], [ "8fa2eb", "ºª©®™¤№" ], [ "8fa6e1", "ΆΈΉΊΪ" ], [ "8fa6e7", "Ό" ], [ "8fa6e9", "ΎΫ" ], [ "8fa6ec", "Ώ" ], [ "8fa6f1", "άέήίϊΐόςύϋΰώ" ], [ "8fa7c2", "Ђ", 10, "ЎЏ" ], [ "8fa7f2", "ђ", 10, "ўџ" ], [ "8fa9a1", "ÆĐ" ], [ "8fa9a4", "Ħ" ], [ "8fa9a6", "IJ" ], [ "8fa9a8", "ŁĿ" ], [ "8fa9ab", "ŊØŒ" ], [ "8fa9af", "ŦÞ" ], [ "8fa9c1", "æđðħıijĸłŀʼnŋøœßŧþ" ], [ "8faaa1", "ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ" ], [ "8faaba", "ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ" ], [ "8faba1", "áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ" ], [ "8fabbd", "ġĥíìïîǐ" ], [ "8fabc5", "īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż" ], [ "8fb0a1", "丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄" ], [ "8fb1a1", "侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐" ], [ "8fb2a1", "傒傓傔傖傛傜傞", 4, "傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂" ], [ "8fb3a1", "凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋" ], [ "8fb4a1", "匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿" ], [ "8fb5a1", "咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒" ], [ "8fb6a1", "嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍", 5, "嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤", 4, "囱囫园" ], [ "8fb7a1", "囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭", 4, "坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡" ], [ "8fb8a1", "堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭" ], [ "8fb9a1", "奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿" ], [ "8fbaa1", "嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖", 4, "寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩" ], [ "8fbba1", "屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤" ], [ "8fbca1", "巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪", 4, "幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧" ], [ "8fbda1", "彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐", 4, "忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷" ], [ "8fbea1", "悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐", 4, "愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥" ], [ "8fbfa1", "懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵" ], [ "8fc0a1", "捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿" ], [ "8fc1a1", "擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝" ], [ "8fc2a1", "昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝" ], [ "8fc3a1", "杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮", 4, "桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏" ], [ "8fc4a1", "棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲" ], [ "8fc5a1", "樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽" ], [ "8fc6a1", "歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖" ], [ "8fc7a1", "泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞" ], [ "8fc8a1", "湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊" ], [ "8fc9a1", "濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔", 4, "炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃", 4, "焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠" ], [ "8fcaa1", "煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻" ], [ "8fcba1", "狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽" ], [ "8fcca1", "珿琀琁琄琇琊琑琚琛琤琦琨", 9, "琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆" ], [ "8fcda1", "甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹", 5, "疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹" ], [ "8fcea1", "瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢", 6, "皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢" ], [ "8fcfa1", "睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳" ], [ "8fd0a1", "碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞" ], [ "8fd1a1", "秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰" ], [ "8fd2a1", "笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙", 5 ], [ "8fd3a1", "籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝" ], [ "8fd4a1", "綞綦綧綪綳綶綷綹緂", 4, "緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭" ], [ "8fd5a1", "罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮" ], [ "8fd6a1", "胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆" ], [ "8fd7a1", "艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸" ], [ "8fd8a1", "荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓" ], [ "8fd9a1", "蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏", 4, "蕖蕙蕜", 6, "蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼" ], [ "8fdaa1", "藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠", 4, "虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣" ], [ "8fdba1", "蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃", 6, "螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵" ], [ "8fdca1", "蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊", 4, "裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺" ], [ "8fdda1", "襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔", 4, "觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳" ], [ "8fdea1", "誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂", 4, "譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆" ], [ "8fdfa1", "貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢" ], [ "8fe0a1", "踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁" ], [ "8fe1a1", "轃轇轏轑", 4, "轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃" ], [ "8fe2a1", "郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿" ], [ "8fe3a1", "釂釃釅釓釔釗釙釚釞釤釥釩釪釬", 5, "釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵", 4, "鉻鉼鉽鉿銈銉銊銍銎銒銗" ], [ "8fe4a1", "銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿", 4, "鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶" ], [ "8fe5a1", "鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉", 4, "鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹" ], [ "8fe6a1", "镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂" ], [ "8fe7a1", "霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦" ], [ "8fe8a1", "頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱", 4, "餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵" ], [ "8fe9a1", "馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿", 4 ], [ "8feaa1", "鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪", 4, "魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸" ], [ "8feba1", "鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦", 4, "鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻" ], [ "8feca1", "鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵" ], [ "8feda1", "黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃", 4, "齓齕齖齗齘齚齝齞齨齩齭", 4, "齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥" ] ]; }, function(module) { module.exports = { uChars: [ 128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536 ], gbChars: [ 0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3 ] }; }, function(module) { module.exports = [ [ "0", "\0", 127 ], [ "8141", "갂갃갅갆갋", 4, "갘갞갟갡갢갣갥", 6, "갮갲갳갴" ], [ "8161", "갵갶갷갺갻갽갾갿걁", 9, "걌걎", 5, "걕" ], [ "8181", "걖걗걙걚걛걝", 18, "걲걳걵걶걹걻", 4, "겂겇겈겍겎겏겑겒겓겕", 6, "겞겢", 5, "겫겭겮겱", 6, "겺겾겿곀곂곃곅곆곇곉곊곋곍", 7, "곖곘", 7, "곢곣곥곦곩곫곭곮곲곴곷", 4, "곾곿괁괂괃괅괇", 4, "괎괐괒괓" ], [ "8241", "괔괕괖괗괙괚괛괝괞괟괡", 7, "괪괫괮", 5 ], [ "8261", "괶괷괹괺괻괽", 6, "굆굈굊", 5, "굑굒굓굕굖굗" ], [ "8281", "굙", 7, "굢굤", 7, "굮굯굱굲굷굸굹굺굾궀궃", 4, "궊궋궍궎궏궑", 10, "궞", 5, "궥", 17, "궸", 7, "귂귃귅귆귇귉", 6, "귒귔", 7, "귝귞귟귡귢귣귥", 18 ], [ "8341", "귺귻귽귾긂", 5, "긊긌긎", 5, "긕", 7 ], [ "8361", "긝", 18, "긲긳긵긶긹긻긼" ], [ "8381", "긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗", 4, "깞깢깣깤깦깧깪깫깭깮깯깱", 6, "깺깾", 5, "꺆", 5, "꺍", 46, "꺿껁껂껃껅", 6, "껎껒", 5, "껚껛껝", 8 ], [ "8441", "껦껧껩껪껬껮", 5, "껵껶껷껹껺껻껽", 8 ], [ "8461", "꼆꼉꼊꼋꼌꼎꼏꼑", 18 ], [ "8481", "꼤", 7, "꼮꼯꼱꼳꼵", 6, "꼾꽀꽄꽅꽆꽇꽊", 5, "꽑", 10, "꽞", 5, "꽦", 18, "꽺", 5, "꾁꾂꾃꾅꾆꾇꾉", 6, "꾒꾓꾔꾖", 5, "꾝", 26, "꾺꾻꾽꾾" ], [ "8541", "꾿꿁", 5, "꿊꿌꿏", 4, "꿕", 6, "꿝", 4 ], [ "8561", "꿢", 5, "꿪", 5, "꿲꿳꿵꿶꿷꿹", 6, "뀂뀃" ], [ "8581", "뀅", 6, "뀍뀎뀏뀑뀒뀓뀕", 6, "뀞", 9, "뀩", 26, "끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞", 29, "끾끿낁낂낃낅", 6, "낎낐낒", 5, "낛낝낞낣낤" ], [ "8641", "낥낦낧낪낰낲낶낷낹낺낻낽", 6, "냆냊", 5, "냒" ], [ "8661", "냓냕냖냗냙", 6, "냡냢냣냤냦", 10 ], [ "8681", "냱", 22, "넊넍넎넏넑넔넕넖넗넚넞", 4, "넦넧넩넪넫넭", 6, "넶넺", 5, "녂녃녅녆녇녉", 6, "녒녓녖녗녙녚녛녝녞녟녡", 22, "녺녻녽녾녿놁놃", 4, "놊놌놎놏놐놑놕놖놗놙놚놛놝" ], [ "8741", "놞", 9, "놩", 15 ], [ "8761", "놹", 18, "뇍뇎뇏뇑뇒뇓뇕" ], [ "8781", "뇖", 5, "뇞뇠", 7, "뇪뇫뇭뇮뇯뇱", 7, "뇺뇼뇾", 5, "눆눇눉눊눍", 6, "눖눘눚", 5, "눡", 18, "눵", 6, "눽", 26, "뉙뉚뉛뉝뉞뉟뉡", 6, "뉪", 4 ], [ "8841", "뉯", 4, "뉶", 5, "뉽", 6, "늆늇늈늊", 4 ], [ "8861", "늏늒늓늕늖늗늛", 4, "늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷" ], [ "8881", "늸", 15, "닊닋닍닎닏닑닓", 4, "닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉", 6, "댒댖", 5, "댝", 54, "덗덙덚덝덠덡덢덣" ], [ "8941", "덦덨덪덬덭덯덲덳덵덶덷덹", 6, "뎂뎆", 5, "뎍" ], [ "8961", "뎎뎏뎑뎒뎓뎕", 10, "뎢", 5, "뎩뎪뎫뎭" ], [ "8981", "뎮", 21, "돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩", 18, "돽", 18, "됑", 6, "됙됚됛됝됞됟됡", 6, "됪됬", 7, "됵", 15 ], [ "8a41", "둅", 10, "둒둓둕둖둗둙", 6, "둢둤둦" ], [ "8a61", "둧", 4, "둭", 18, "뒁뒂" ], [ "8a81", "뒃", 4, "뒉", 19, "뒞", 5, "뒥뒦뒧뒩뒪뒫뒭", 7, "뒶뒸뒺", 5, "듁듂듃듅듆듇듉", 6, "듑듒듓듔듖", 5, "듞듟듡듢듥듧", 4, "듮듰듲", 5, "듹", 26, "딖딗딙딚딝" ], [ "8b41", "딞", 5, "딦딫", 4, "딲딳딵딶딷딹", 6, "땂땆" ], [ "8b61", "땇땈땉땊땎땏땑땒땓땕", 6, "땞땢", 8 ], [ "8b81", "땫", 52, "떢떣떥떦떧떩떬떭떮떯떲떶", 4, "떾떿뗁뗂뗃뗅", 6, "뗎뗒", 5, "뗙", 18, "뗭", 18 ], [ "8c41", "똀", 15, "똒똓똕똖똗똙", 4 ], [ "8c61", "똞", 6, "똦", 5, "똭", 6, "똵", 5 ], [ "8c81", "똻", 12, "뙉", 26, "뙥뙦뙧뙩", 50, "뚞뚟뚡뚢뚣뚥", 5, "뚭뚮뚯뚰뚲", 16 ], [ "8d41", "뛃", 16, "뛕", 8 ], [ "8d61", "뛞", 17, "뛱뛲뛳뛵뛶뛷뛹뛺" ], [ "8d81", "뛻", 4, "뜂뜃뜄뜆", 33, "뜪뜫뜭뜮뜱", 6, "뜺뜼", 7, "띅띆띇띉띊띋띍", 6, "띖", 9, "띡띢띣띥띦띧띩", 6, "띲띴띶", 5, "띾띿랁랂랃랅", 6, "랎랓랔랕랚랛랝랞" ], [ "8e41", "랟랡", 6, "랪랮", 5, "랶랷랹", 8 ], [ "8e61", "럂", 4, "럈럊", 19 ], [ "8e81", "럞", 13, "럮럯럱럲럳럵", 6, "럾렂", 4, "렊렋렍렎렏렑", 6, "렚렜렞", 5, "렦렧렩렪렫렭", 6, "렶렺", 5, "롁롂롃롅", 11, "롒롔", 7, "롞롟롡롢롣롥", 6, "롮롰롲", 5, "롹롺롻롽", 7 ], [ "8f41", "뢅", 7, "뢎", 17 ], [ "8f61", "뢠", 7, "뢩", 6, "뢱뢲뢳뢵뢶뢷뢹", 4 ], [ "8f81", "뢾뢿룂룄룆", 5, "룍룎룏룑룒룓룕", 7, "룞룠룢", 5, "룪룫룭룮룯룱", 6, "룺룼룾", 5, "뤅", 18, "뤙", 6, "뤡", 26, "뤾뤿륁륂륃륅", 6, "륍륎륐륒", 5 ], [ "9041", "륚륛륝륞륟륡", 6, "륪륬륮", 5, "륶륷륹륺륻륽" ], [ "9061", "륾", 5, "릆릈릋릌릏", 15 ], [ "9081", "릟", 12, "릮릯릱릲릳릵", 6, "릾맀맂", 5, "맊맋맍맓", 4, "맚맜맟맠맢맦맧맩맪맫맭", 6, "맶맻", 4, "먂", 5, "먉", 11, "먖", 33, "먺먻먽먾먿멁멃멄멅멆" ], [ "9141", "멇멊멌멏멐멑멒멖멗멙멚멛멝", 6, "멦멪", 5 ], [ "9161", "멲멳멵멶멷멹", 9, "몆몈몉몊몋몍", 5 ], [ "9181", "몓", 20, "몪몭몮몯몱몳", 4, "몺몼몾", 5, "뫅뫆뫇뫉", 14, "뫚", 33, "뫽뫾뫿묁묂묃묅", 7, "묎묐묒", 5, "묙묚묛묝묞묟묡", 6 ], [ "9241", "묨묪묬", 7, "묷묹묺묿", 4, "뭆뭈뭊뭋뭌뭎뭑뭒" ], [ "9261", "뭓뭕뭖뭗뭙", 7, "뭢뭤", 7, "뭭", 4 ], [ "9281", "뭲", 21, "뮉뮊뮋뮍뮎뮏뮑", 18, "뮥뮦뮧뮩뮪뮫뮭", 6, "뮵뮶뮸", 7, "믁믂믃믅믆믇믉", 6, "믑믒믔", 35, "믺믻믽믾밁" ], [ "9341", "밃", 4, "밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵" ], [ "9361", "밶밷밹", 6, "뱂뱆뱇뱈뱊뱋뱎뱏뱑", 8 ], [ "9381", "뱚뱛뱜뱞", 37, "벆벇벉벊벍벏", 4, "벖벘벛", 4, "벢벣벥벦벩", 6, "벲벶", 5, "벾벿볁볂볃볅", 7, "볎볒볓볔볖볗볙볚볛볝", 22, "볷볹볺볻볽" ], [ "9441", "볾", 5, "봆봈봊", 5, "봑봒봓봕", 8 ], [ "9461", "봞", 5, "봥", 6, "봭", 12 ], [ "9481", "봺", 5, "뵁", 6, "뵊뵋뵍뵎뵏뵑", 6, "뵚", 9, "뵥뵦뵧뵩", 22, "붂붃붅붆붋", 4, "붒붔붖붗붘붛붝", 6, "붥", 10, "붱", 6, "붹", 24 ], [ "9541", "뷒뷓뷖뷗뷙뷚뷛뷝", 11, "뷪", 5, "뷱" ], [ "9561", "뷲뷳뷵뷶뷷뷹", 6, "븁븂븄븆", 5, "븎븏븑븒븓" ], [ "9581", "븕", 6, "븞븠", 35, "빆빇빉빊빋빍빏", 4, "빖빘빜빝빞빟빢빣빥빦빧빩빫", 4, "빲빶", 4, "빾빿뺁뺂뺃뺅", 6, "뺎뺒", 5, "뺚", 13, "뺩", 14 ], [ "9641", "뺸", 23, "뻒뻓" ], [ "9661", "뻕뻖뻙", 6, "뻡뻢뻦", 5, "뻭", 8 ], [ "9681", "뻶", 10, "뼂", 5, "뼊", 13, "뼚뼞", 33, "뽂뽃뽅뽆뽇뽉", 6, "뽒뽓뽔뽖", 44 ], [ "9741", "뾃", 16, "뾕", 8 ], [ "9761", "뾞", 17, "뾱", 7 ], [ "9781", "뾹", 11, "뿆", 5, "뿎뿏뿑뿒뿓뿕", 6, "뿝뿞뿠뿢", 89, "쀽쀾쀿" ], [ "9841", "쁀", 16, "쁒", 5, "쁙쁚쁛" ], [ "9861", "쁝쁞쁟쁡", 6, "쁪", 15 ], [ "9881", "쁺", 21, "삒삓삕삖삗삙", 6, "삢삤삦", 5, "삮삱삲삷", 4, "삾샂샃샄샆샇샊샋샍샎샏샑", 6, "샚샞", 5, "샦샧샩샪샫샭", 6, "샶샸샺", 5, "섁섂섃섅섆섇섉", 6, "섑섒섓섔섖", 5, "섡섢섥섨섩섪섫섮" ], [ "9941", "섲섳섴섵섷섺섻섽섾섿셁", 6, "셊셎", 5, "셖셗" ], [ "9961", "셙셚셛셝", 6, "셦셪", 5, "셱셲셳셵셶셷셹셺셻" ], [ "9981", "셼", 8, "솆", 5, "솏솑솒솓솕솗", 4, "솞솠솢솣솤솦솧솪솫솭솮솯솱", 11, "솾", 5, "쇅쇆쇇쇉쇊쇋쇍", 6, "쇕쇖쇙", 6, "쇡쇢쇣쇥쇦쇧쇩", 6, "쇲쇴", 7, "쇾쇿숁숂숃숅", 6, "숎숐숒", 5, "숚숛숝숞숡숢숣" ], [ "9a41", "숤숥숦숧숪숬숮숰숳숵", 16 ], [ "9a61", "쉆쉇쉉", 6, "쉒쉓쉕쉖쉗쉙", 6, "쉡쉢쉣쉤쉦" ], [ "9a81", "쉧", 4, "쉮쉯쉱쉲쉳쉵", 6, "쉾슀슂", 5, "슊", 5, "슑", 6, "슙슚슜슞", 5, "슦슧슩슪슫슮", 5, "슶슸슺", 33, "싞싟싡싢싥", 5, "싮싰싲싳싴싵싷싺싽싾싿쌁", 6, "쌊쌋쌎쌏" ], [ "9b41", "쌐쌑쌒쌖쌗쌙쌚쌛쌝", 6, "쌦쌧쌪", 8 ], [ "9b61", "쌳", 17, "썆", 7 ], [ "9b81", "썎", 25, "썪썫썭썮썯썱썳", 4, "썺썻썾", 5, "쎅쎆쎇쎉쎊쎋쎍", 50, "쏁", 22, "쏚" ], [ "9c41", "쏛쏝쏞쏡쏣", 4, "쏪쏫쏬쏮", 5, "쏶쏷쏹", 5 ], [ "9c61", "쏿", 8, "쐉", 6, "쐑", 9 ], [ "9c81", "쐛", 8, "쐥", 6, "쐭쐮쐯쐱쐲쐳쐵", 6, "쐾", 9, "쑉", 26, "쑦쑧쑩쑪쑫쑭", 6, "쑶쑷쑸쑺", 5, "쒁", 18, "쒕", 6, "쒝", 12 ], [ "9d41", "쒪", 13, "쒹쒺쒻쒽", 8 ], [ "9d61", "쓆", 25 ], [ "9d81", "쓠", 8, "쓪", 5, "쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂", 9, "씍씎씏씑씒씓씕", 6, "씝", 10, "씪씫씭씮씯씱", 6, "씺씼씾", 5, "앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩", 6, "앲앶", 5, "앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔" ], [ "9e41", "얖얙얚얛얝얞얟얡", 7, "얪", 9, "얶" ], [ "9e61", "얷얺얿", 4, "엋엍엏엒엓엕엖엗엙", 6, "엢엤엦엧" ], [ "9e81", "엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑", 6, "옚옝", 6, "옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉", 6, "왒왖", 5, "왞왟왡", 10, "왭왮왰왲", 5, "왺왻왽왾왿욁", 6, "욊욌욎", 5, "욖욗욙욚욛욝", 6, "욦" ], [ "9f41", "욨욪", 5, "욲욳욵욶욷욻", 4, "웂웄웆", 5, "웎" ], [ "9f61", "웏웑웒웓웕", 6, "웞웟웢", 5, "웪웫웭웮웯웱웲" ], [ "9f81", "웳", 4, "웺웻웼웾", 5, "윆윇윉윊윋윍", 6, "윖윘윚", 5, "윢윣윥윦윧윩", 6, "윲윴윶윸윹윺윻윾윿읁읂읃읅", 4, "읋읎읐읙읚읛읝읞읟읡", 6, "읩읪읬", 7, "읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛", 4, "잢잧", 4, "잮잯잱잲잳잵잶잷" ], [ "a041", "잸잹잺잻잾쟂", 5, "쟊쟋쟍쟏쟑", 6, "쟙쟚쟛쟜" ], [ "a061", "쟞", 5, "쟥쟦쟧쟩쟪쟫쟭", 13 ], [ "a081", "쟻", 4, "젂젃젅젆젇젉젋", 4, "젒젔젗", 4, "젞젟젡젢젣젥", 6, "젮젰젲", 5, "젹젺젻젽젾젿졁", 6, "졊졋졎", 5, "졕", 26, "졲졳졵졶졷졹졻", 4, "좂좄좈좉좊좎", 5, "좕", 7, "좞좠좢좣좤" ], [ "a141", "좥좦좧좩", 18, "좾좿죀죁" ], [ "a161", "죂죃죅죆죇죉죊죋죍", 6, "죖죘죚", 5, "죢죣죥" ], [ "a181", "죦", 14, "죶", 5, "죾죿줁줂줃줇", 4, "줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈", 9, "±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬" ], [ "a241", "줐줒", 5, "줙", 18 ], [ "a261", "줭", 6, "줵", 18 ], [ "a281", "쥈", 7, "쥒쥓쥕쥖쥗쥙", 6, "쥢쥤", 7, "쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®" ], [ "a341", "쥱쥲쥳쥵", 6, "쥽", 10, "즊즋즍즎즏" ], [ "a361", "즑", 6, "즚즜즞", 16 ], [ "a381", "즯", 16, "짂짃짅짆짉짋", 4, "짒짔짗짘짛!", 58, "₩]", 32, " ̄" ], [ "a441", "짞짟짡짣짥짦짨짩짪짫짮짲", 5, "짺짻짽짾짿쨁쨂쨃쨄" ], [ "a461", "쨅쨆쨇쨊쨎", 5, "쨕쨖쨗쨙", 12 ], [ "a481", "쨦쨧쨨쨪", 28, "ㄱ", 93 ], [ "a541", "쩇", 4, "쩎쩏쩑쩒쩓쩕", 6, "쩞쩢", 5, "쩩쩪" ], [ "a561", "쩫", 17, "쩾", 5, "쪅쪆" ], [ "a581", "쪇", 16, "쪙", 14, "ⅰ", 9 ], [ "a5b0", "Ⅰ", 9 ], [ "a5c1", "Α", 16, "Σ", 6 ], [ "a5e1", "α", 16, "σ", 6 ], [ "a641", "쪨", 19, "쪾쪿쫁쫂쫃쫅" ], [ "a661", "쫆", 5, "쫎쫐쫒쫔쫕쫖쫗쫚", 5, "쫡", 6 ], [ "a681", "쫨쫩쫪쫫쫭", 6, "쫵", 18, "쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃", 7 ], [ "a741", "쬋", 4, "쬑쬒쬓쬕쬖쬗쬙", 6, "쬢", 7 ], [ "a761", "쬪", 22, "쭂쭃쭄" ], [ "a781", "쭅쭆쭇쭊쭋쭍쭎쭏쭑", 6, "쭚쭛쭜쭞", 5, "쭥", 7, "㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙", 9, "㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰", 9, "㎀", 4, "㎺", 5, "㎐", 4, "Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆" ], [ "a841", "쭭", 10, "쭺", 14 ], [ "a861", "쮉", 18, "쮝", 6 ], [ "a881", "쮤", 19, "쮹", 11, "ÆÐªĦ" ], [ "a8a6", "IJ" ], [ "a8a8", "ĿŁØŒºÞŦŊ" ], [ "a8b1", "㉠", 27, "ⓐ", 25, "①", 14, "½⅓⅔¼¾⅛⅜⅝⅞" ], [ "a941", "쯅", 14, "쯕", 10 ], [ "a961", "쯠쯡쯢쯣쯥쯦쯨쯪", 18 ], [ "a981", "쯽", 14, "찎찏찑찒찓찕", 6, "찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀", 27, "⒜", 25, "⑴", 14, "¹²³⁴ⁿ₁₂₃₄" ], [ "aa41", "찥찦찪찫찭찯찱", 6, "찺찿", 4, "챆챇챉챊챋챍챎" ], [ "aa61", "챏", 4, "챖챚", 5, "챡챢챣챥챧챩", 6, "챱챲" ], [ "aa81", "챳챴챶", 29, "ぁ", 82 ], [ "ab41", "첔첕첖첗첚첛첝첞첟첡", 6, "첪첮", 5, "첶첷첹" ], [ "ab61", "첺첻첽", 6, "쳆쳈쳊", 5, "쳑쳒쳓쳕", 5 ], [ "ab81", "쳛", 8, "쳥", 6, "쳭쳮쳯쳱", 12, "ァ", 85 ], [ "ac41", "쳾쳿촀촂", 5, "촊촋촍촎촏촑", 6, "촚촜촞촟촠" ], [ "ac61", "촡촢촣촥촦촧촩촪촫촭", 11, "촺", 4 ], [ "ac81", "촿", 28, "쵝쵞쵟А", 5, "ЁЖ", 25 ], [ "acd1", "а", 5, "ёж", 25 ], [ "ad41", "쵡쵢쵣쵥", 6, "쵮쵰쵲", 5, "쵹", 7 ], [ "ad61", "춁", 6, "춉", 10, "춖춗춙춚춛춝춞춟" ], [ "ad81", "춠춡춢춣춦춨춪", 5, "춱", 18, "췅" ], [ "ae41", "췆", 5, "췍췎췏췑", 16 ], [ "ae61", "췢", 5, "췩췪췫췭췮췯췱", 6, "췺췼췾", 4 ], [ "ae81", "츃츅츆츇츉츊츋츍", 6, "츕츖츗츘츚", 5, "츢츣츥츦츧츩츪츫" ], [ "af41", "츬츭츮츯츲츴츶", 19 ], [ "af61", "칊", 13, "칚칛칝칞칢", 5, "칪칬" ], [ "af81", "칮", 5, "칶칷칹칺칻칽", 6, "캆캈캊", 5, "캒캓캕캖캗캙" ], [ "b041", "캚", 5, "캢캦", 5, "캮", 12 ], [ "b061", "캻", 5, "컂", 19 ], [ "b081", "컖", 13, "컦컧컩컪컭", 6, "컶컺", 5, "가각간갇갈갉갊감", 7, "같", 4, "갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆" ], [ "b141", "켂켃켅켆켇켉", 6, "켒켔켖", 5, "켝켞켟켡켢켣" ], [ "b161", "켥", 6, "켮켲", 5, "켹", 11 ], [ "b181", "콅", 14, "콖콗콙콚콛콝", 6, "콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸" ], [ "b241", "콭콮콯콲콳콵콶콷콹", 6, "쾁쾂쾃쾄쾆", 5, "쾍" ], [ "b261", "쾎", 18, "쾢", 5, "쾩" ], [ "b281", "쾪", 5, "쾱", 18, "쿅", 6, "깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙" ], [ "b341", "쿌", 19, "쿢쿣쿥쿦쿧쿩" ], [ "b361", "쿪", 5, "쿲쿴쿶", 5, "쿽쿾쿿퀁퀂퀃퀅", 5 ], [ "b381", "퀋", 5, "퀒", 5, "퀙", 19, "끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫", 4, "낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝" ], [ "b441", "퀮", 5, "퀶퀷퀹퀺퀻퀽", 6, "큆큈큊", 5 ], [ "b461", "큑큒큓큕큖큗큙", 6, "큡", 10, "큮큯" ], [ "b481", "큱큲큳큵", 6, "큾큿킀킂", 18, "뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫", 4, "닳담답닷", 4, "닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥" ], [ "b541", "킕", 14, "킦킧킩킪킫킭", 5 ], [ "b561", "킳킶킸킺", 5, "탂탃탅탆탇탊", 5, "탒탖", 4 ], [ "b581", "탛탞탟탡탢탣탥", 6, "탮탲", 5, "탹", 11, "덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸" ], [ "b641", "턅", 7, "턎", 17 ], [ "b661", "턠", 15, "턲턳턵턶턷턹턻턼턽턾" ], [ "b681", "턿텂텆", 5, "텎텏텑텒텓텕", 6, "텞텠텢", 5, "텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗" ], [ "b741", "텮", 13, "텽", 6, "톅톆톇톉톊" ], [ "b761", "톋", 20, "톢톣톥톦톧" ], [ "b781", "톩", 6, "톲톴톶톷톸톹톻톽톾톿퇁", 14, "래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩" ], [ "b841", "퇐", 7, "퇙", 17 ], [ "b861", "퇫", 8, "퇵퇶퇷퇹", 13 ], [ "b881", "툈툊", 5, "툑", 24, "륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많", 4, "맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼" ], [ "b941", "툪툫툮툯툱툲툳툵", 6, "툾퉀퉂", 5, "퉉퉊퉋퉌" ], [ "b961", "퉍", 14, "퉝", 6, "퉥퉦퉧퉨" ], [ "b981", "퉩", 22, "튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바", 4, "받", 4, "밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗" ], [ "ba41", "튍튎튏튒튓튔튖", 5, "튝튞튟튡튢튣튥", 6, "튭" ], [ "ba61", "튮튯튰튲", 5, "튺튻튽튾틁틃", 4, "틊틌", 5 ], [ "ba81", "틒틓틕틖틗틙틚틛틝", 6, "틦", 9, "틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤" ], [ "bb41", "틻", 4, "팂팄팆", 5, "팏팑팒팓팕팗", 4, "팞팢팣" ], [ "bb61", "팤팦팧팪팫팭팮팯팱", 6, "팺팾", 5, "퍆퍇퍈퍉" ], [ "bb81", "퍊", 31, "빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤" ], [ "bc41", "퍪", 17, "퍾퍿펁펂펃펅펆펇" ], [ "bc61", "펈펉펊펋펎펒", 5, "펚펛펝펞펟펡", 6, "펪펬펮" ], [ "bc81", "펯", 4, "펵펶펷펹펺펻펽", 6, "폆폇폊", 5, "폑", 5, "샥샨샬샴샵샷샹섀섄섈섐섕서", 4, "섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭" ], [ "bd41", "폗폙", 7, "폢폤", 7, "폮폯폱폲폳폵폶폷" ], [ "bd61", "폸폹폺폻폾퐀퐂", 5, "퐉", 13 ], [ "bd81", "퐗", 5, "퐞", 25, "숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰" ], [ "be41", "퐸", 7, "푁푂푃푅", 14 ], [ "be61", "푔", 7, "푝푞푟푡푢푣푥", 7, "푮푰푱푲" ], [ "be81", "푳", 4, "푺푻푽푾풁풃", 4, "풊풌풎", 5, "풕", 8, "쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄", 6, "엌엎" ], [ "bf41", "풞", 10, "풪", 14 ], [ "bf61", "풹", 18, "퓍퓎퓏퓑퓒퓓퓕" ], [ "bf81", "퓖", 5, "퓝퓞퓠", 7, "퓩퓪퓫퓭퓮퓯퓱", 6, "퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염", 5, "옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨" ], [ "c041", "퓾", 5, "픅픆픇픉픊픋픍", 6, "픖픘", 5 ], [ "c061", "픞", 25 ], [ "c081", "픸픹픺픻픾픿핁핂핃핅", 6, "핎핐핒", 5, "핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응", 7, "읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊" ], [ "c141", "핤핦핧핪핬핮", 5, "핶핷핹핺핻핽", 6, "햆햊햋" ], [ "c161", "햌햍햎햏햑", 19, "햦햧" ], [ "c181", "햨", 31, "점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓" ], [ "c241", "헊헋헍헎헏헑헓", 4, "헚헜헞", 5, "헦헧헩헪헫헭헮" ], [ "c261", "헯", 4, "헶헸헺", 5, "혂혃혅혆혇혉", 6, "혒" ], [ "c281", "혖", 5, "혝혞혟혡혢혣혥", 7, "혮", 9, "혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻" ], [ "c341", "혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝", 4 ], [ "c361", "홢", 4, "홨홪", 5, "홲홳홵", 11 ], [ "c381", "횁횂횄횆", 5, "횎횏횑횒횓횕", 7, "횞횠횢", 5, "횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층" ], [ "c441", "횫횭횮횯횱", 7, "횺횼", 7, "훆훇훉훊훋" ], [ "c461", "훍훎훏훐훒훓훕훖훘훚", 5, "훡훢훣훥훦훧훩", 4 ], [ "c481", "훮훯훱훲훳훴훶", 5, "훾훿휁휂휃휅", 11, "휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼" ], [ "c541", "휕휖휗휚휛휝휞휟휡", 6, "휪휬휮", 5, "휶휷휹" ], [ "c561", "휺휻휽", 6, "흅흆흈흊", 5, "흒흓흕흚", 4 ], [ "c581", "흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵", 6, "흾흿힀힂", 5, "힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜" ], [ "c641", "힍힎힏힑", 6, "힚힜힞", 5 ], [ "c6a1", "퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁" ], [ "c7a1", "퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠" ], [ "c8a1", "혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝" ], [ "caa1", "伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕" ], [ "cba1", "匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢" ], [ "cca1", "瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械" ], [ "cda1", "棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜" ], [ "cea1", "科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾" ], [ "cfa1", "區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴" ], [ "d0a1", "鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣" ], [ "d1a1", "朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩", 5, "那樂", 4, "諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉" ], [ "d2a1", "納臘蠟衲囊娘廊", 4, "乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧", 5, "駑魯", 10, "濃籠聾膿農惱牢磊腦賂雷尿壘", 7, "嫩訥杻紐勒", 5, "能菱陵尼泥匿溺多茶" ], [ "d3a1", "丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃" ], [ "d4a1", "棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅" ], [ "d5a1", "蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣" ], [ "d6a1", "煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼" ], [ "d7a1", "遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬" ], [ "d8a1", "立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅" ], [ "d9a1", "蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文" ], [ "daa1", "汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑" ], [ "dba1", "發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖" ], [ "dca1", "碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦" ], [ "dda1", "孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥" ], [ "dea1", "脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索" ], [ "dfa1", "傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署" ], [ "e0a1", "胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬" ], [ "e1a1", "聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁" ], [ "e2a1", "戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧" ], [ "e3a1", "嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁" ], [ "e4a1", "沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額" ], [ "e5a1", "櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬" ], [ "e6a1", "旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒" ], [ "e7a1", "簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳" ], [ "e8a1", "烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療" ], [ "e9a1", "窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓" ], [ "eaa1", "運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜" ], [ "eba1", "濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼" ], [ "eca1", "議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄" ], [ "eda1", "立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長" ], [ "eea1", "障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱" ], [ "efa1", "煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖" ], [ "f0a1", "靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫" ], [ "f1a1", "踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只" ], [ "f2a1", "咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯" ], [ "f3a1", "鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策" ], [ "f4a1", "責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢" ], [ "f5a1", "椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃" ], [ "f6a1", "贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託" ], [ "f7a1", "鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑" ], [ "f8a1", "阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃" ], [ "f9a1", "品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航" ], [ "faa1", "行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型" ], [ "fba1", "形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵" ], [ "fca1", "禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆" ], [ "fda1", "爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰" ] ]; }, function(module) { module.exports = [ [ "8740", "䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻" ], [ "8767", "綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬" ], [ "87a1", "𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋" ], [ "8840", "㇀", 4, "𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ" ], [ "88a1", "ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛" ], [ "8940", "𪎩𡅅" ], [ "8943", "攊" ], [ "8946", "丽滝鵎釟" ], [ "894c", "𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮" ], [ "89a1", "琑糼緍楆竉刧" ], [ "89ab", "醌碸酞肼" ], [ "89b0", "贋胶𠧧" ], [ "89b5", "肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁" ], [ "89c1", "溚舾甙" ], [ "89c5", "䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅" ], [ "8a40", "𧶄唥" ], [ "8a43", "𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓" ], [ "8a64", "𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕" ], [ "8a76", "䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯" ], [ "8aa1", "𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱" ], [ "8aac", "䠋𠆩㿺塳𢶍" ], [ "8ab2", "𤗈𠓼𦂗𠽌𠶖啹䂻䎺" ], [ "8abb", "䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃" ], [ "8ac9", "𪘁𠸉𢫏𢳉" ], [ "8ace", "𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻" ], [ "8adf", "𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌" ], [ "8af6", "𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭" ], [ "8b40", "𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹" ], [ "8b55", "𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑" ], [ "8ba1", "𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁" ], [ "8bde", "𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢" ], [ "8c40", "倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋" ], [ "8ca1", "𣏹椙橃𣱣泿" ], [ "8ca7", "爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚" ], [ "8cc9", "顨杫䉶圽" ], [ "8cce", "藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶" ], [ "8ce6", "峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻" ], [ "8d40", "𠮟" ], [ "8d42", "𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱" ], [ "8da1", "㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘" ], [ "8e40", "𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎" ], [ "8ea1", "繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛" ], [ "8f40", "蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖" ], [ "8fa1", "𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起" ], [ "9040", "趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛" ], [ "90a1", "𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜" ], [ "9140", "𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈" ], [ "91a1", "鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨" ], [ "9240", "𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘" ], [ "92a1", "働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃" ], [ "9340", "媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍" ], [ "93a1", "摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋" ], [ "9440", "銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻" ], [ "94a1", "㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡" ], [ "9540", "𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂" ], [ "95a1", "衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰" ], [ "9640", "桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸" ], [ "96a1", "𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉" ], [ "9740", "愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫" ], [ "97a1", "𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎" ], [ "9840", "𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦" ], [ "98a1", "咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃" ], [ "9940", "䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚" ], [ "99a1", "䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿" ], [ "9a40", "鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺" ], [ "9aa1", "黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪" ], [ "9b40", "𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌" ], [ "9b62", "𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎" ], [ "9ba1", "椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊" ], [ "9c40", "嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶" ], [ "9ca1", "㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏" ], [ "9d40", "𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁" ], [ "9da1", "辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢" ], [ "9e40", "𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺" ], [ "9ea1", "鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭" ], [ "9ead", "𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹" ], [ "9ec5", "㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲" ], [ "9ef5", "噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼" ], [ "9f40", "籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱" ], [ "9f4f", "凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰" ], [ "9fa1", "椬叚鰊鴂䰻陁榀傦畆𡝭駚剳" ], [ "9fae", "酙隁酜" ], [ "9fb2", "酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽" ], [ "9fc1", "𤤙盖鮝个𠳔莾衂" ], [ "9fc9", "届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳" ], [ "9fdb", "歒酼龥鮗頮颴骺麨麄煺笔" ], [ "9fe7", "毺蠘罸" ], [ "9feb", "嘠𪙊蹷齓" ], [ "9ff0", "跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇" ], [ "a040", "𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷" ], [ "a055", "𡠻𦸅" ], [ "a058", "詾𢔛" ], [ "a05b", "惽癧髗鵄鍮鮏蟵" ], [ "a063", "蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽" ], [ "a073", "坟慯抦戹拎㩜懢厪𣏵捤栂㗒" ], [ "a0a1", "嵗𨯂迚𨸹" ], [ "a0a6", "僙𡵆礆匲阸𠼻䁥" ], [ "a0ae", "矾" ], [ "a0b0", "糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦" ], [ "a0d4", "覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷" ], [ "a0e2", "罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫" ], [ "a3c0", "␀", 31, "␡" ], [ "c6a1", "①", 9, "⑴", 9, "ⅰ", 9, "丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ", 23 ], [ "c740", "す", 58, "ァアィイ" ], [ "c7a1", "ゥ", 81, "А", 5, "ЁЖ", 4 ], [ "c840", "Л", 26, "ёж", 25, "⇧↸↹㇏𠃌乚𠂊刂䒑" ], [ "c8a1", "龰冈龱𧘇" ], [ "c8cd", "¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣" ], [ "c8f5", "ʃɐɛɔɵœøŋʊɪ" ], [ "f9fe", "■" ], [ "fa40", "𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸" ], [ "faa1", "鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍" ], [ "fb40", "𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙" ], [ "fba1", "𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂" ], [ "fc40", "廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷" ], [ "fca1", "𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝" ], [ "fd40", "𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀" ], [ "fda1", "𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎" ], [ "fe40", "鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌" ], [ "fea1", "𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔" ] ]; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(10).Buffer, Transform = __webpack_require__(3).Transform; function IconvLiteEncoderStream(conv, options) { this.conv = conv, (options = options || {}).decodeStrings = !1, Transform.call(this, options); } function IconvLiteDecoderStream(conv, options) { this.conv = conv, (options = options || {}).encoding = this.encoding = "utf8", Transform.call(this, options); } module.exports = function(iconv) { iconv.encodeStream = function(encoding, options) { return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); }, iconv.decodeStream = function(encoding, options) { return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); }, iconv.supportsStreams = !0, iconv.IconvLiteEncoderStream = IconvLiteEncoderStream, iconv.IconvLiteDecoderStream = IconvLiteDecoderStream, iconv._collect = IconvLiteDecoderStream.prototype.collect; }, IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } }), IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { if ("string" != typeof chunk) return done(new Error("Iconv encoding stream needs strings as its input.")); try { var res = this.conv.write(chunk); res && res.length && this.push(res), done(); } catch (e) { done(e); } }, IconvLiteEncoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); res && res.length && this.push(res), done(); } catch (e) { done(e); } }, IconvLiteEncoderStream.prototype.collect = function(cb) { var chunks = []; return this.on("error", cb), this.on("data", (function(chunk) { chunks.push(chunk); })), this.on("end", (function() { cb(null, Buffer.concat(chunks)); })), this; }, IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } }), IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { if (!Buffer.isBuffer(chunk)) return done(new Error("Iconv decoding stream needs buffers as its input.")); try { var res = this.conv.write(chunk); res && res.length && this.push(res, this.encoding), done(); } catch (e) { done(e); } }, IconvLiteDecoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); res && res.length && this.push(res, this.encoding), done(); } catch (e) { done(e); } }, IconvLiteDecoderStream.prototype.collect = function(cb) { var res = ""; return this.on("error", cb), this.on("data", (function(chunk) { res += chunk; })), this.on("end", (function() { cb(null, res); })), this; }; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(10).Buffer; module.exports = function(iconv) { var original = void 0; iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array), iconv.extendNodeEncodings = function() { if (!original) { if (original = {}, !iconv.supportsNodeEncodingsExtension) return console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"), void console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); var nodeNativeEncodings = { hex: !0, utf8: !0, "utf-8": !0, ascii: !0, binary: !0, base64: !0, ucs2: !0, "ucs-2": !0, utf16le: !0, "utf-16le": !0 }; Buffer.isNativeEncoding = function(enc) { return enc && nodeNativeEncodings[enc.toLowerCase()]; }; var SlowBuffer = __webpack_require__(10).SlowBuffer; if (original.SlowBufferToString = SlowBuffer.prototype.toString, SlowBuffer.prototype.toString = function(encoding, start, end) { return encoding = String(encoding || "utf8").toLowerCase(), Buffer.isNativeEncoding(encoding) ? original.SlowBufferToString.call(this, encoding, start, end) : (void 0 === start && (start = 0), void 0 === end && (end = this.length), iconv.decode(this.slice(start, end), encoding)); }, original.SlowBufferWrite = SlowBuffer.prototype.write, SlowBuffer.prototype.write = function(string, offset, length, encoding) { if (isFinite(offset)) isFinite(length) || (encoding = length, length = void 0); else { var swap = encoding; encoding = offset, offset = length, length = swap; } offset = +offset || 0; var remaining = this.length - offset; if (length ? (length = +length) > remaining && (length = remaining) : length = remaining, encoding = String(encoding || "utf8").toLowerCase(), Buffer.isNativeEncoding(encoding)) return original.SlowBufferWrite.call(this, string, offset, length, encoding); if (string.length > 0 && (length < 0 || offset < 0)) throw new RangeError("attempt to write beyond buffer bounds"); var buf = iconv.encode(string, encoding); return buf.length < length && (length = buf.length), buf.copy(this, offset, 0, length), length; }, original.BufferIsEncoding = Buffer.isEncoding, Buffer.isEncoding = function(encoding) { return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding); }, original.BufferByteLength = Buffer.byteLength, Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) { return encoding = String(encoding || "utf8").toLowerCase(), Buffer.isNativeEncoding(encoding) ? original.BufferByteLength.call(this, str, encoding) : iconv.encode(str, encoding).length; }, original.BufferToString = Buffer.prototype.toString, Buffer.prototype.toString = function(encoding, start, end) { return encoding = String(encoding || "utf8").toLowerCase(), Buffer.isNativeEncoding(encoding) ? original.BufferToString.call(this, encoding, start, end) : (void 0 === start && (start = 0), void 0 === end && (end = this.length), iconv.decode(this.slice(start, end), encoding)); }, original.BufferWrite = Buffer.prototype.write, Buffer.prototype.write = function(string, offset, length, encoding) { var _offset = offset, _length = length, _encoding = encoding; if (isFinite(offset)) isFinite(length) || (encoding = length, length = void 0); else { var swap = encoding; encoding = offset, offset = length, length = swap; } if (encoding = String(encoding || "utf8").toLowerCase(), Buffer.isNativeEncoding(encoding)) return original.BufferWrite.call(this, string, _offset, _length, _encoding); offset = +offset || 0; var remaining = this.length - offset; if (length ? (length = +length) > remaining && (length = remaining) : length = remaining, string.length > 0 && (length < 0 || offset < 0)) throw new RangeError("attempt to write beyond buffer bounds"); var buf = iconv.encode(string, encoding); return buf.length < length && (length = buf.length), buf.copy(this, offset, 0, length), length; }, iconv.supportsStreams) { var Readable = __webpack_require__(3).Readable; original.ReadableSetEncoding = Readable.prototype.setEncoding, Readable.prototype.setEncoding = function(enc, options) { this._readableState.decoder = iconv.getDecoder(enc, options), this._readableState.encoding = enc; }, Readable.prototype.collect = iconv._collect; } } }, iconv.undoExtendNodeEncodings = function() { if (iconv.supportsNodeEncodingsExtension) { if (!original) throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called."); delete Buffer.isNativeEncoding; var SlowBuffer = __webpack_require__(10).SlowBuffer; if (SlowBuffer.prototype.toString = original.SlowBufferToString, SlowBuffer.prototype.write = original.SlowBufferWrite, Buffer.isEncoding = original.BufferIsEncoding, Buffer.byteLength = original.BufferByteLength, Buffer.prototype.toString = original.BufferToString, Buffer.prototype.write = original.BufferWrite, iconv.supportsStreams) { var Readable = __webpack_require__(3).Readable; Readable.prototype.setEncoding = original.ReadableSetEncoding, delete Readable.prototype.collect; } original = void 0; } }; }; }, function(module, exports, __webpack_require__) { "use strict"; var Iconv; try { Iconv = __webpack_require__(585)("iconv").Iconv; } catch (E) {} module.exports = Iconv; }, function(module, exports) { function webpackEmptyContext(req) { var e = new Error("Cannot find module '" + req + "'"); throw e.code = "MODULE_NOT_FOUND", e; } webpackEmptyContext.keys = function() { return []; }, webpackEmptyContext.resolve = webpackEmptyContext, module.exports = webpackEmptyContext, webpackEmptyContext.id = 585; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("connect:dispatcher"), EventEmitter = __webpack_require__(4).EventEmitter, finalhandler = __webpack_require__(590), http = __webpack_require__(11), merge = __webpack_require__(67), parseUrl = __webpack_require__(49); module.exports = function() { function app(req, res, next) { app.handle(req, res, next); } return merge(app, proto), merge(app, EventEmitter.prototype), app.route = "/", app.stack = [], app; }; var proto = {}, defer = "function" == typeof setImmediate ? setImmediate : function(fn) { process.nextTick(fn.bind.apply(fn, arguments)); }; function logerror(err) { console.error(err.stack || err.toString()); } proto.use = function(route, fn) { var handle = fn, path = route; if ("string" != typeof route && (handle = route, path = "/"), "function" == typeof handle.handle) { var server = handle; server.route = path, handle = function(req, res, next) { server.handle(req, res, next); }; } return handle instanceof http.Server && (handle = handle.listeners("request")[0]), "/" === path[path.length - 1] && (path = path.slice(0, -1)), debug("use %s %s", path || "/", handle.name || "anonymous"), this.stack.push({ route: path, handle: handle }), this; }, proto.handle = function(req, res, out) { var index = 0, protohost = (function(url) { if (0 !== url.length && "/" !== url[0]) { var searchIndex = url.indexOf("?"), pathLength = -1 !== searchIndex ? searchIndex : url.length, fqdnIndex = url.substr(0, pathLength).indexOf("://"); return -1 !== fqdnIndex ? url.substr(0, url.indexOf("/", 3 + fqdnIndex)) : void 0; } })(req.url) || "", removed = "", slashAdded = !1, stack = this.stack, done = out || finalhandler(req, res, { env: "production", onerror: logerror }); req.originalUrl = req.originalUrl || req.url, (function next(err) { slashAdded && (req.url = req.url.substr(1), slashAdded = !1), 0 !== removed.length && (req.url = protohost + removed + req.url.substr(protohost.length), removed = ""); var layer = stack[index++]; if (layer) { var path = parseUrl(req).pathname || "/", route = layer.route; if (path.toLowerCase().substr(0, route.length) !== route.toLowerCase()) return next(err); var c = path.length > route.length && path[route.length]; if (c && "/" !== c && "." !== c) return next(err); 0 !== route.length && "/" !== route && (removed = route, req.url = protohost + req.url.substr(protohost.length + removed.length), protohost || "/" === req.url[0] || (req.url = "/" + req.url, slashAdded = !0)), (function(handle, route, err, req, res, next) { var arity = handle.length, error = err, hasError = Boolean(err); debug("%s %s : %s", handle.name || "", route, req.originalUrl); try { if (hasError && 4 === arity) return void handle(err, req, res, next); if (!hasError && arity < 4) return void handle(req, res, next); } catch (e) { error = e; } next(error); })(layer.handle, route, err, req, res, next); } else defer(done, err); })(); }, proto.listen = function() { var server = http.createServer(this); return server.listen.apply(server, arguments); }; }, function(module, exports, __webpack_require__) { function load() { var r; try { r = exports.storage.debug; } catch (e) {} return !r && "undefined" != typeof process && "env" in process && (r = process.env.DEBUG), r; } (exports = module.exports = __webpack_require__(282)).log = function() { return "object" == typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); }, exports.formatArgs = function(args) { var useColors = this.useColors; if (args[0] = (useColors ? "%c" : "") + this.namespace + (useColors ? " %c" : " ") + args[0] + (useColors ? "%c " : " ") + "+" + exports.humanize(this.diff), useColors) { var c = "color: " + this.color; args.splice(1, 0, c, "color: inherit"); var index = 0, lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (function(match) { "%%" !== match && (index++, "%c" === match && (lastC = index)); })), args.splice(lastC, 0, c); } }, exports.save = function(namespaces) { try { null == namespaces ? exports.storage.removeItem("debug") : exports.storage.debug = namespaces; } catch (e) {} }, exports.load = load, exports.useColors = function() { return !("undefined" == typeof window || !window.process || "renderer" !== window.process.type) || ("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+)/)); }, exports.storage = "undefined" != typeof chrome && void 0 !== chrome.storage ? chrome.storage.local : (function() { try { return window.localStorage; } catch (e) {} })(), exports.colors = [ "lightseagreen", "forestgreen", "goldenrod", "dodgerblue", "darkorchid", "crimson" ], exports.formatters.j = function(v) { try { return JSON.stringify(v); } catch (err) { return "[UnexpectedJSONParseError]: " + err.message; } }, exports.enable(load()); }, function(module, exports) { var s = 1e3, m = 60 * s, h = 60 * m, d = 24 * h; function plural(ms, n, name) { if (!(ms < n)) return ms < 1.5 * n ? Math.floor(ms / n) + " " + name : Math.ceil(ms / n) + " " + name + "s"; } module.exports = function(val, options) { options = options || {}; var ms, type = typeof val; if ("string" === type && val.length > 0) return (function(str) { if (!((str = String(str)).length > 100)) { var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); if (match) { var n = parseFloat(match[1]); switch ((match[2] || "ms").toLowerCase()) { case "years": case "year": case "yrs": case "yr": case "y": return 315576e5 * n; 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; } } } })(val); if ("number" === type && !1 === isNaN(val)) return options.long ? plural(ms = val, d, "day") || plural(ms, h, "hour") || plural(ms, m, "minute") || plural(ms, s, "second") || ms + " ms" : (function(ms) { return ms >= d ? Math.round(ms / d) + "d" : ms >= h ? Math.round(ms / h) + "h" : ms >= m ? Math.round(ms / m) + "m" : ms >= s ? Math.round(ms / s) + "s" : ms + "ms"; })(val); throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val)); }; }, function(module, exports, __webpack_require__) { var tty = __webpack_require__(117), util = __webpack_require__(0); (exports = module.exports = __webpack_require__(282)).init = function(debug) { debug.inspectOpts = {}; for (var keys = Object.keys(exports.inspectOpts), i = 0; i < keys.length; i++) debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; }, exports.log = function() { return stream.write(util.format.apply(util, arguments) + "\n"); }, exports.formatArgs = function(args) { var name = this.namespace; if (this.useColors) { var c = this.color, prefix = " [3" + c + ";1m" + name + " "; args[0] = prefix + args[0].split("\n").join("\n" + prefix), args.push("[3" + c + "m+" + exports.humanize(this.diff) + ""); } else args[0] = (new Date).toUTCString() + " " + name + " " + args[0]; }, exports.save = function(namespaces) { null == namespaces ? delete process.env.DEBUG : process.env.DEBUG = namespaces; }, exports.load = load, exports.useColors = function() { return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd); }, exports.colors = [ 6, 2, 3, 4, 5, 1 ], exports.inspectOpts = Object.keys(process.env).filter((function(key) { return /^debug_/i.test(key); })).reduce((function(obj, key) { var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (function(_, k) { return k.toUpperCase(); })), val = process.env[key]; return val = !!/^(yes|on|true|enabled)$/i.test(val) || !/^(no|off|false|disabled)$/i.test(val) && ("null" === val ? null : Number(val)), obj[prop] = val, obj; }), {}); var fd = parseInt(process.env.DEBUG_FD, 10) || 2; 1 !== fd && 2 !== fd && util.deprecate((function() {}), "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")(); var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : (function(fd) { var stream; switch (process.binding("tty_wrap").guessHandleType(fd)) { case "TTY": (stream = new tty.WriteStream(fd))._type = "tty", stream._handle && stream._handle.unref && stream._handle.unref(); break; case "FILE": (stream = new (__webpack_require__(2).SyncWriteStream)(fd, { autoClose: !1 }))._type = "fs"; break; case "PIPE": case "TCP": (stream = new (__webpack_require__(39).Socket)({ fd: fd, readable: !1, writable: !0 })).readable = !1, stream.read = null, stream._type = "pipe", stream._handle && stream._handle.unref && stream._handle.unref(); break; default: throw new Error("Implement me. Unknown stream file type!"); } return stream.fd = fd, stream._isStdio = !0, stream; })(fd); function load() { return process.env.DEBUG; } exports.formatters.o = function(v) { return this.inspectOpts.colors = this.useColors, util.inspect(v, this.inspectOpts).split("\n").map((function(str) { return str.trim(); })).join(" "); }, exports.formatters.O = function(v) { return this.inspectOpts.colors = this.useColors, util.inspect(v, this.inspectOpts); }, exports.enable(load()); }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("finalhandler"), encodeUrl = __webpack_require__(94), escapeHtml = __webpack_require__(95), onFinished = __webpack_require__(96), parseUrl = __webpack_require__(49), statuses = __webpack_require__(592), unpipe = __webpack_require__(175), DOUBLE_SPACE_REGEXP = /\x20{2}/g, NEWLINE_REGEXP = /\n/g, defer = "function" == typeof setImmediate ? setImmediate : function(fn) { process.nextTick(fn.bind.apply(fn, arguments)); }, isFinished = onFinished.isFinished; function headersSent(res) { return "boolean" != typeof res.headersSent ? Boolean(res._header) : res.headersSent; } module.exports = function(req, res, options) { var opts = options || {}, env = opts.env || "production", onerror = opts.onerror; return function(err) { var headers, msg, status; if (err || !headersSent(res)) { if (err ? (status = (function(err) { return "number" == typeof err.status && err.status >= 400 && err.status < 600 ? err.status : "number" == typeof err.statusCode && err.statusCode >= 400 && err.statusCode < 600 ? err.statusCode : void 0; })(err), void 0 !== status && (headers = (function(err) { if (err.headers && "object" == typeof err.headers) { for (var headers = Object.create(null), keys = Object.keys(err.headers), i = 0; i < keys.length; i++) { var key = keys[i]; headers[key] = err.headers[key]; } return headers; } })(err)), void 0 === status && (status = (function(res) { var status = res.statusCode; return ("number" != typeof status || status < 400 || status > 599) && (status = 500), status; })(res)), msg = (function(err, status, env) { var msg; return "production" !== env && ((msg = err.stack) || "function" != typeof err.toString || (msg = err.toString())), msg || statuses[status]; })(err, status, env)) : (status = 404, msg = "Cannot " + req.method + " " + encodeUrl(parseUrl.original(req).pathname)), debug("default %s", status), err && onerror && defer(onerror, err, req, res), headersSent(res)) return debug("cannot %d after headers sent", status), void req.socket.destroy(); !(function(req, res, status, headers, message) { function write() { var body = (function(message) { return '\n\n\n\nError\n\n\n
' + escapeHtml(message).replace(NEWLINE_REGEXP, "
").replace(DOUBLE_SPACE_REGEXP, "  ") + "
\n\n\n"; })(message); res.statusCode = status, res.statusMessage = statuses[status], (function(res, headers) { if (headers) for (var keys = Object.keys(headers), i = 0; i < keys.length; i++) { var key = keys[i]; res.setHeader(key, headers[key]); } })(res, headers), res.setHeader("Content-Security-Policy", "default-src 'self'"), res.setHeader("X-Content-Type-Options", "nosniff"), res.setHeader("Content-Type", "text/html; charset=utf-8"), res.setHeader("Content-Length", Buffer.byteLength(body, "utf8")), "HEAD" !== req.method ? res.end(body, "utf8") : res.end(); } isFinished(req) ? write() : (unpipe(req), onFinished(req, write), req.resume()); })(req, res, status, headers, msg); } else debug("cannot 404 after headers sent"); }; }; }, function(module, exports, __webpack_require__) { "use strict"; function listener(event, done) { return function(arg1) { for (var args = new Array(arguments.length), ee = this, err = "error" === event ? arg1 : null, i = 0; i < args.length; i++) args[i] = arguments[i]; done(err, ee, event, args); }; } module.exports = function(stuff, done) { if (!Array.isArray(stuff)) throw new TypeError("arg must be an array of [ee, events...] arrays"); for (var cleanups = [], i = 0; i < stuff.length; i++) { var arr = stuff[i]; if (!Array.isArray(arr) || arr.length < 2) throw new TypeError("each array member must be [ee, events...]"); for (var ee = arr[0], j = 1; j < arr.length; j++) { var event = arr[j], fn = listener(event, callback); ee.on(event, fn), cleanups.push({ ee: ee, event: event, fn: fn }); } } function callback() { cleanup(), done.apply(null, arguments); } function cleanup() { for (var x, i = 0; i < cleanups.length; i++) (x = cleanups[i]).ee.removeListener(x.event, x.fn); } function thunk(fn) { done = fn; } return thunk.cancel = cleanup, thunk; }; }, function(module, exports, __webpack_require__) { "use strict"; var codes = __webpack_require__(593); function status(code) { if ("number" == typeof code) { if (!status[code]) throw new Error("invalid status code: " + code); return code; } if ("string" != typeof code) throw new TypeError("code must be a number or string"); var n = parseInt(code, 10); if (!isNaN(n)) { if (!status[n]) throw new Error("invalid status code: " + n); return n; } if (!(n = status[code.toLowerCase()])) throw new Error('invalid status message: "' + code + '"'); return n; } module.exports = status, status.codes = (function(statuses, codes) { var arr = []; return Object.keys(codes).forEach((function(code) { var message = codes[code], status = Number(code); statuses[status] = message, statuses[message] = status, statuses[message.toLowerCase()] = status, arr.push(status); })), arr; })(status, codes), status.redirect = { 300: !0, 301: !0, 302: !0, 303: !0, 305: !0, 307: !0, 308: !0 }, status.empty = { 204: !0, 205: !0, 304: !0 }, status.retry = { 502: !0, 503: !0, 504: !0 }; }, function(module) { module.exports = { 100: "Continue", 101: "Switching Protocols", 102: "Processing", 200: "OK", 201: "Created", 202: "Accepted", 203: "Non-Authoritative Information", 204: "No Content", 205: "Reset Content", 206: "Partial Content", 207: "Multi-Status", 208: "Already Reported", 226: "IM Used", 300: "Multiple Choices", 301: "Moved Permanently", 302: "Found", 303: "See Other", 304: "Not Modified", 305: "Use Proxy", 306: "(Unused)", 307: "Temporary Redirect", 308: "Permanent Redirect", 400: "Bad Request", 401: "Unauthorized", 402: "Payment Required", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 406: "Not Acceptable", 407: "Proxy Authentication Required", 408: "Request Timeout", 409: "Conflict", 410: "Gone", 411: "Length Required", 412: "Precondition Failed", 413: "Payload Too Large", 414: "URI Too Long", 415: "Unsupported Media Type", 416: "Range Not Satisfiable", 417: "Expectation Failed", 418: "I'm a teapot", 421: "Misdirected Request", 422: "Unprocessable Entity", 423: "Locked", 424: "Failed Dependency", 425: "Unordered Collection", 426: "Upgrade Required", 428: "Precondition Required", 429: "Too Many Requests", 431: "Request Header Fields Too Large", 451: "Unavailable For Legal Reasons", 500: "Internal Server Error", 501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout", 505: "HTTP Version Not Supported", 506: "Variant Also Negotiates", 507: "Insufficient Storage", 508: "Loop Detected", 509: "Bandwidth Limit Exceeded", 510: "Not Extended", 511: "Network Authentication Required" }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(callSite) { var receiver, addSuffix = !0, fileLocation = (function(callSite) { var fileName, fileLocation = ""; if (callSite.isNative() ? fileLocation = "native" : callSite.isEval() ? (fileName = callSite.getScriptNameOrSourceURL()) || (fileLocation = callSite.getEvalOrigin()) : fileName = callSite.getFileName(), fileName) { fileLocation += fileName; var lineNumber = callSite.getLineNumber(); if (null != lineNumber) { fileLocation += ":" + lineNumber; var columnNumber = callSite.getColumnNumber(); columnNumber && (fileLocation += ":" + columnNumber); } } return fileLocation || "unknown source"; })(callSite), functionName = callSite.getFunctionName(), isConstructor = callSite.isConstructor(), line = ""; if (!(callSite.isToplevel() || isConstructor)) { var methodName = callSite.getMethodName(), typeName = (receiver = callSite.receiver).constructor && receiver.constructor.name || null; functionName ? (typeName && 0 !== functionName.indexOf(typeName) && (line += typeName + "."), line += functionName, methodName && functionName.lastIndexOf("." + methodName) !== functionName.length - methodName.length - 1 && (line += " [as " + methodName + "]")) : line += typeName + "." + (methodName || ""); } else isConstructor ? line += "new " + (functionName || "") : functionName ? line += functionName : (addSuffix = !1, line += fileLocation); return addSuffix && (line += " (" + fileLocation + ")"), line; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(emitter, type) { return emitter.listeners(type).length; }; }, function(module, exports, __webpack_require__) { "use strict"; var bytes = __webpack_require__(97), contentType = __webpack_require__(118), createError = __webpack_require__(98), debug = __webpack_require__(9)("body-parser:json"), read = __webpack_require__(121), typeis = __webpack_require__(99); module.exports = function(options) { var opts = options || {}, limit = "number" != typeof opts.limit ? bytes.parse(opts.limit || "100kb") : opts.limit, inflate = !1 !== opts.inflate, reviver = opts.reviver, strict = !1 !== opts.strict, type = opts.type || "application/json", verify = opts.verify || !1; if (!1 !== verify && "function" != typeof verify) throw new TypeError("option verify must be function"); var shouldParse = "function" != typeof type ? (function(type) { return function(req) { return Boolean(typeis(req, type)); }; })(type) : type; function parse(body) { if (0 === body.length) return {}; if (strict) { var first = (str = body, FIRST_CHAR_REGEXP.exec(str)[1]); if ("{" !== first && "[" !== first) throw debug("strict violation"), (function(str, char) { var index = str.indexOf(char), partial = str.substring(0, index) + "#"; try { throw JSON.parse(partial), new SyntaxError("strict violation"); } catch (e) { return normalizeJsonSyntaxError(e, { message: e.message.replace("#", char), stack: e.stack }); } })(body, first); } var str; try { return debug("parse json"), JSON.parse(body, reviver); } catch (e) { throw normalizeJsonSyntaxError(e, { message: e.message, stack: e.stack }); } } return function(req, res, next) { if (req._body) return debug("body already parsed"), void next(); if (req.body = req.body || {}, !typeis.hasBody(req)) return debug("skip empty body"), void next(); if (debug("content-type %j", req.headers["content-type"]), !shouldParse(req)) return debug("skip parsing"), void next(); var charset = (function(req) { try { return (contentType.parse(req).parameters.charset || "").toLowerCase(); } catch (e) { return; } })(req) || "utf-8"; if ("utf-" !== charset.substr(0, 4)) return debug("invalid charset"), void next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { charset: charset, type: "charset.unsupported" })); read(req, res, next, parse, debug, { encoding: charset, inflate: inflate, limit: limit, verify: verify }); }; }; var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*(.)/; function normalizeJsonSyntaxError(error, obj) { for (var keys = Object.getOwnPropertyNames(error), i = 0; i < keys.length; i++) { var key = keys[i]; "stack" !== key && "message" !== key && delete error[key]; } return error.stack = obj.stack.replace(error.message, obj.message), error.message = obj.message, error; } }, function(module) { module.exports = { 100: "Continue", 101: "Switching Protocols", 102: "Processing", 103: "Early Hints", 200: "OK", 201: "Created", 202: "Accepted", 203: "Non-Authoritative Information", 204: "No Content", 205: "Reset Content", 206: "Partial Content", 207: "Multi-Status", 208: "Already Reported", 226: "IM Used", 300: "Multiple Choices", 301: "Moved Permanently", 302: "Found", 303: "See Other", 304: "Not Modified", 305: "Use Proxy", 306: "(Unused)", 307: "Temporary Redirect", 308: "Permanent Redirect", 400: "Bad Request", 401: "Unauthorized", 402: "Payment Required", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 406: "Not Acceptable", 407: "Proxy Authentication Required", 408: "Request Timeout", 409: "Conflict", 410: "Gone", 411: "Length Required", 412: "Precondition Failed", 413: "Payload Too Large", 414: "URI Too Long", 415: "Unsupported Media Type", 416: "Range Not Satisfiable", 417: "Expectation Failed", 418: "I'm a teapot", 421: "Misdirected Request", 422: "Unprocessable Entity", 423: "Locked", 424: "Failed Dependency", 425: "Unordered Collection", 426: "Upgrade Required", 428: "Precondition Required", 429: "Too Many Requests", 431: "Request Header Fields Too Large", 451: "Unavailable For Legal Reasons", 500: "Internal Server Error", 501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout", 505: "HTTP Version Not Supported", 506: "Variant Also Negotiates", 507: "Insufficient Storage", 508: "Loop Detected", 509: "Bandwidth Limit Exceeded", 510: "Not Extended", 511: "Network Authentication Required" }; }, function(module, exports) { "function" == typeof Object.create ? module.exports = function(ctor, superCtor) { ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: !1, writable: !0, configurable: !0 } }); } : module.exports = function(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function() {}; TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor; }; }, function(module, exports) { module.exports = function(str) { return str.split(" ").map((function(token) { return token.slice(0, 1).toUpperCase() + token.slice(1); })).join("").replace(/[^ _0-9a-z]/gi, ""); }; }, function(module, exports, __webpack_require__) { "use strict"; var bytes = __webpack_require__(97), createError = __webpack_require__(98), iconv = __webpack_require__(66), unpipe = __webpack_require__(175); module.exports = function(stream, options, callback) { var done = callback, opts = options || {}; if (!0 !== options && "string" != typeof options || (opts = { encoding: options }), "function" == typeof options && (done = options, opts = {}), void 0 !== done && "function" != typeof done) throw new TypeError("argument callback must be a function"); if (!done && !global.Promise) throw new TypeError("argument callback is required"); var encoding = !0 !== opts.encoding ? opts.encoding : "utf-8", limit = bytes.parse(opts.limit), length = null == opts.length || isNaN(opts.length) ? null : parseInt(opts.length, 10); return done ? readStream(stream, encoding, length, limit, done) : new Promise((function(resolve, reject) { readStream(stream, encoding, length, limit, (function(err, buf) { if (err) return reject(err); resolve(buf); })); })); }; var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: /; function halt(stream) { unpipe(stream), "function" == typeof stream.pause && stream.pause(); } function readStream(stream, encoding, length, limit, callback) { var complete = !1; if (null !== limit && null !== length && length > limit) return done(createError(413, "request entity too large", { expected: length, length: length, limit: limit, type: "entity.too.large" })); var state = stream._readableState; if (stream._decoder || state && (state.encoding || state.decoder)) return done(createError(500, "stream encoding should not be set", { type: "stream.encoding.set" })); var decoder, received = 0; try { decoder = (function(encoding) { if (!encoding) return null; try { return iconv.getDecoder(encoding); } catch (e) { if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e; throw createError(415, "specified encoding unsupported", { encoding: encoding, type: "encoding.unsupported" }); } })(encoding); } catch (err) { return done(err); } var buffer = decoder ? "" : []; function done() { for (var args = new Array(arguments.length), i = 0; i < args.length; i++) args[i] = arguments[i]; function invokeCallback() { cleanup(), args[0] && halt(stream), callback.apply(null, args); } complete = !0, invokeCallback(); } function onAborted() { complete || done(createError(400, "request aborted", { code: "ECONNABORTED", expected: length, length: length, received: received, type: "request.aborted" })); } function onData(chunk) { complete || (received += chunk.length, null !== limit && received > limit ? done(createError(413, "request entity too large", { limit: limit, received: received, type: "entity.too.large" })) : decoder ? buffer += decoder.write(chunk) : buffer.push(chunk)); } function onEnd(err) { if (!complete) { if (err) return done(err); null !== length && received !== length ? done(createError(400, "request size did not match content length", { expected: length, length: length, received: received, type: "request.size.invalid" })) : done(null, decoder ? buffer + (decoder.end() || "") : Buffer.concat(buffer)); } } function cleanup() { buffer = null, stream.removeListener("aborted", onAborted), stream.removeListener("data", onData), stream.removeListener("end", onEnd), stream.removeListener("error", onEnd), stream.removeListener("close", cleanup); } stream.on("aborted", onAborted), stream.on("close", cleanup), stream.on("data", onData), stream.on("end", onEnd), stream.on("error", onEnd); } }, function(module, exports) { var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g, textRegExp = /^[\u0020-\u007e\u0080-\u00ff]+$/, tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/, qescRegExp = /\\([\u0000-\u007f])/g, quoteRegExp = /([\\"])/g, subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/, typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/, typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/; function qstring(val) { var str = String(val); if (tokenRegExp.test(str)) return str; if (str.length > 0 && !textRegExp.test(str)) throw new TypeError("invalid parameter value"); return '"' + str.replace(quoteRegExp, "\\$1") + '"'; } exports.format = function(obj) { if (!obj || "object" != typeof obj) throw new TypeError("argument obj is required"); var parameters = obj.parameters, subtype = obj.subtype, suffix = obj.suffix, type = obj.type; if (!type || !typeNameRegExp.test(type)) throw new TypeError("invalid type"); if (!subtype || !subtypeNameRegExp.test(subtype)) throw new TypeError("invalid subtype"); var string = type + "/" + subtype; if (suffix) { if (!typeNameRegExp.test(suffix)) throw new TypeError("invalid suffix"); string += "+" + suffix; } if (parameters && "object" == typeof parameters) for (var param, params = Object.keys(parameters).sort(), i = 0; i < params.length; i++) { if (param = params[i], !tokenRegExp.test(param)) throw new TypeError("invalid parameter name"); string += "; " + param + "=" + qstring(parameters[param]); } return string; }, exports.parse = function(string) { if (!string) throw new TypeError("argument string is required"); if ("object" == typeof string && (string = (function(obj) { return "function" == typeof obj.getHeader ? obj.getHeader("content-type") : "object" == typeof obj.headers ? obj.headers && obj.headers["content-type"] : void 0; })(string)), "string" != typeof string) throw new TypeError("argument string is required to be a string"); var key, match, value, index = string.indexOf(";"), obj = (function(string) { var match = typeRegExp.exec(string.toLowerCase()); if (!match) throw new TypeError("invalid media type"); var suffix, type = match[1], subtype = match[2], index = subtype.lastIndexOf("+"); return -1 !== index && (suffix = subtype.substr(index + 1), subtype = subtype.substr(0, index)), { type: type, subtype: subtype, suffix: suffix }; })(-1 !== index ? string.substr(0, index) : string), params = {}; for (paramRegExp.lastIndex = index; match = paramRegExp.exec(string); ) { if (match.index !== index) throw new TypeError("invalid parameter format"); index += match[0].length, key = match[1].toLowerCase(), '"' === (value = match[2])[0] && (value = value.substr(1, value.length - 2).replace(qescRegExp, "$1")), params[key] = value; } if (-1 !== index && index !== string.length) throw new TypeError("invalid parameter format"); return obj.parameters = params, obj; }; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(603); }, function(module) { module.exports = { "application/1d-interleaved-parityfec": { source: "iana" }, "application/3gpdash-qoe-report+xml": { source: "iana", compressible: !0 }, "application/3gpp-ims+xml": { source: "iana", compressible: !0 }, "application/a2l": { source: "iana" }, "application/activemessage": { source: "iana" }, "application/activity+json": { source: "iana", compressible: !0 }, "application/alto-costmap+json": { source: "iana", compressible: !0 }, "application/alto-costmapfilter+json": { source: "iana", compressible: !0 }, "application/alto-directory+json": { source: "iana", compressible: !0 }, "application/alto-endpointcost+json": { source: "iana", compressible: !0 }, "application/alto-endpointcostparams+json": { source: "iana", compressible: !0 }, "application/alto-endpointprop+json": { source: "iana", compressible: !0 }, "application/alto-endpointpropparams+json": { source: "iana", compressible: !0 }, "application/alto-error+json": { source: "iana", compressible: !0 }, "application/alto-networkmap+json": { source: "iana", compressible: !0 }, "application/alto-networkmapfilter+json": { source: "iana", compressible: !0 }, "application/aml": { source: "iana" }, "application/andrew-inset": { source: "iana", extensions: [ "ez" ] }, "application/applefile": { source: "iana" }, "application/applixware": { source: "apache", extensions: [ "aw" ] }, "application/atf": { source: "iana" }, "application/atfx": { source: "iana" }, "application/atom+xml": { source: "iana", compressible: !0, extensions: [ "atom" ] }, "application/atomcat+xml": { source: "iana", compressible: !0, extensions: [ "atomcat" ] }, "application/atomdeleted+xml": { source: "iana", compressible: !0 }, "application/atomicmail": { source: "iana" }, "application/atomsvc+xml": { source: "iana", compressible: !0, extensions: [ "atomsvc" ] }, "application/atsc-dwd+xml": { source: "iana", compressible: !0 }, "application/atsc-held+xml": { source: "iana", compressible: !0 }, "application/atsc-rsat+xml": { source: "iana", compressible: !0 }, "application/atxml": { source: "iana" }, "application/auth-policy+xml": { source: "iana", compressible: !0 }, "application/bacnet-xdd+zip": { source: "iana", compressible: !1 }, "application/batch-smtp": { source: "iana" }, "application/bdoc": { compressible: !1, extensions: [ "bdoc" ] }, "application/beep+xml": { source: "iana", compressible: !0 }, "application/calendar+json": { source: "iana", compressible: !0 }, "application/calendar+xml": { source: "iana", compressible: !0 }, "application/call-completion": { source: "iana" }, "application/cals-1840": { source: "iana" }, "application/cbor": { source: "iana" }, "application/cccex": { source: "iana" }, "application/ccmp+xml": { source: "iana", compressible: !0 }, "application/ccxml+xml": { source: "iana", compressible: !0, extensions: [ "ccxml" ] }, "application/cdfx+xml": { source: "iana", compressible: !0 }, "application/cdmi-capability": { source: "iana", extensions: [ "cdmia" ] }, "application/cdmi-container": { source: "iana", extensions: [ "cdmic" ] }, "application/cdmi-domain": { source: "iana", extensions: [ "cdmid" ] }, "application/cdmi-object": { source: "iana", extensions: [ "cdmio" ] }, "application/cdmi-queue": { source: "iana", extensions: [ "cdmiq" ] }, "application/cdni": { source: "iana" }, "application/cea": { source: "iana" }, "application/cea-2018+xml": { source: "iana", compressible: !0 }, "application/cellml+xml": { source: "iana", compressible: !0 }, "application/cfw": { source: "iana" }, "application/clue_info+xml": { source: "iana", compressible: !0 }, "application/cms": { source: "iana" }, "application/cnrp+xml": { source: "iana", compressible: !0 }, "application/coap-group+json": { source: "iana", compressible: !0 }, "application/coap-payload": { source: "iana" }, "application/commonground": { source: "iana" }, "application/conference-info+xml": { source: "iana", compressible: !0 }, "application/cose": { source: "iana" }, "application/cose-key": { source: "iana" }, "application/cose-key-set": { source: "iana" }, "application/cpl+xml": { source: "iana", compressible: !0 }, "application/csrattrs": { source: "iana" }, "application/csta+xml": { source: "iana", compressible: !0 }, "application/cstadata+xml": { source: "iana", compressible: !0 }, "application/csvm+json": { source: "iana", compressible: !0 }, "application/cu-seeme": { source: "apache", extensions: [ "cu" ] }, "application/cwt": { source: "iana" }, "application/cybercash": { source: "iana" }, "application/dart": { compressible: !0 }, "application/dash+xml": { source: "iana", compressible: !0, extensions: [ "mpd" ] }, "application/dashdelta": { source: "iana" }, "application/davmount+xml": { source: "iana", compressible: !0, extensions: [ "davmount" ] }, "application/dca-rft": { source: "iana" }, "application/dcd": { source: "iana" }, "application/dec-dx": { source: "iana" }, "application/dialog-info+xml": { source: "iana", compressible: !0 }, "application/dicom": { source: "iana" }, "application/dicom+json": { source: "iana", compressible: !0 }, "application/dicom+xml": { source: "iana", compressible: !0 }, "application/dii": { source: "iana" }, "application/dit": { source: "iana" }, "application/dns": { source: "iana" }, "application/dns+json": { source: "iana", compressible: !0 }, "application/dns-message": { source: "iana" }, "application/docbook+xml": { source: "apache", compressible: !0, extensions: [ "dbk" ] }, "application/dskpp+xml": { source: "iana", compressible: !0 }, "application/dssc+der": { source: "iana", extensions: [ "dssc" ] }, "application/dssc+xml": { source: "iana", compressible: !0, extensions: [ "xdssc" ] }, "application/dvcs": { source: "iana" }, "application/ecmascript": { source: "iana", compressible: !0, extensions: [ "ecma", "es" ] }, "application/edi-consent": { source: "iana" }, "application/edi-x12": { source: "iana", compressible: !1 }, "application/edifact": { source: "iana", compressible: !1 }, "application/efi": { source: "iana" }, "application/emergencycalldata.comment+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.control+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.deviceinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.ecall.msd": { source: "iana" }, "application/emergencycalldata.providerinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.serviceinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.subscriberinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.veds+xml": { source: "iana", compressible: !0 }, "application/emma+xml": { source: "iana", compressible: !0, extensions: [ "emma" ] }, "application/emotionml+xml": { source: "iana", compressible: !0 }, "application/encaprtp": { source: "iana" }, "application/epp+xml": { source: "iana", compressible: !0 }, "application/epub+zip": { source: "iana", compressible: !1, extensions: [ "epub" ] }, "application/eshop": { source: "iana" }, "application/exi": { source: "iana", extensions: [ "exi" ] }, "application/expect-ct-report+json": { source: "iana", compressible: !0 }, "application/fastinfoset": { source: "iana" }, "application/fastsoap": { source: "iana" }, "application/fdt+xml": { source: "iana", compressible: !0 }, "application/fhir+json": { source: "iana", compressible: !0 }, "application/fhir+xml": { source: "iana", compressible: !0 }, "application/fido.trusted-apps+json": { compressible: !0 }, "application/fits": { source: "iana" }, "application/font-sfnt": { source: "iana" }, "application/font-tdpfr": { source: "iana", extensions: [ "pfr" ] }, "application/font-woff": { source: "iana", compressible: !1 }, "application/framework-attributes+xml": { source: "iana", compressible: !0 }, "application/geo+json": { source: "iana", compressible: !0, extensions: [ "geojson" ] }, "application/geo+json-seq": { source: "iana" }, "application/geopackage+sqlite3": { source: "iana" }, "application/geoxacml+xml": { source: "iana", compressible: !0 }, "application/gltf-buffer": { source: "iana" }, "application/gml+xml": { source: "iana", compressible: !0, extensions: [ "gml" ] }, "application/gpx+xml": { source: "apache", compressible: !0, extensions: [ "gpx" ] }, "application/gxf": { source: "apache", extensions: [ "gxf" ] }, "application/gzip": { source: "iana", compressible: !1, extensions: [ "gz" ] }, "application/h224": { source: "iana" }, "application/held+xml": { source: "iana", compressible: !0 }, "application/hjson": { extensions: [ "hjson" ] }, "application/http": { source: "iana" }, "application/hyperstudio": { source: "iana", extensions: [ "stk" ] }, "application/ibe-key-request+xml": { source: "iana", compressible: !0 }, "application/ibe-pkg-reply+xml": { source: "iana", compressible: !0 }, "application/ibe-pp-data": { source: "iana" }, "application/iges": { source: "iana" }, "application/im-iscomposing+xml": { source: "iana", compressible: !0 }, "application/index": { source: "iana" }, "application/index.cmd": { source: "iana" }, "application/index.obj": { source: "iana" }, "application/index.response": { source: "iana" }, "application/index.vnd": { source: "iana" }, "application/inkml+xml": { source: "iana", compressible: !0, extensions: [ "ink", "inkml" ] }, "application/iotp": { source: "iana" }, "application/ipfix": { source: "iana", extensions: [ "ipfix" ] }, "application/ipp": { source: "iana" }, "application/isup": { source: "iana" }, "application/its+xml": { source: "iana", compressible: !0 }, "application/java-archive": { source: "apache", compressible: !1, extensions: [ "jar", "war", "ear" ] }, "application/java-serialized-object": { source: "apache", compressible: !1, extensions: [ "ser" ] }, "application/java-vm": { source: "apache", compressible: !1, extensions: [ "class" ] }, "application/javascript": { source: "iana", charset: "UTF-8", compressible: !0, extensions: [ "js", "mjs" ] }, "application/jf2feed+json": { source: "iana", compressible: !0 }, "application/jose": { source: "iana" }, "application/jose+json": { source: "iana", compressible: !0 }, "application/jrd+json": { source: "iana", compressible: !0 }, "application/json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: [ "json", "map" ] }, "application/json-patch+json": { source: "iana", compressible: !0 }, "application/json-seq": { source: "iana" }, "application/json5": { extensions: [ "json5" ] }, "application/jsonml+json": { source: "apache", compressible: !0, extensions: [ "jsonml" ] }, "application/jwk+json": { source: "iana", compressible: !0 }, "application/jwk-set+json": { source: "iana", compressible: !0 }, "application/jwt": { source: "iana" }, "application/kpml-request+xml": { source: "iana", compressible: !0 }, "application/kpml-response+xml": { source: "iana", compressible: !0 }, "application/ld+json": { source: "iana", compressible: !0, extensions: [ "jsonld" ] }, "application/lgr+xml": { source: "iana", compressible: !0 }, "application/link-format": { source: "iana" }, "application/load-control+xml": { source: "iana", compressible: !0 }, "application/lost+xml": { source: "iana", compressible: !0, extensions: [ "lostxml" ] }, "application/lostsync+xml": { source: "iana", compressible: !0 }, "application/lxf": { source: "iana" }, "application/mac-binhex40": { source: "iana", extensions: [ "hqx" ] }, "application/mac-compactpro": { source: "apache", extensions: [ "cpt" ] }, "application/macwriteii": { source: "iana" }, "application/mads+xml": { source: "iana", compressible: !0, extensions: [ "mads" ] }, "application/manifest+json": { charset: "UTF-8", compressible: !0, extensions: [ "webmanifest" ] }, "application/marc": { source: "iana", extensions: [ "mrc" ] }, "application/marcxml+xml": { source: "iana", compressible: !0, extensions: [ "mrcx" ] }, "application/mathematica": { source: "iana", extensions: [ "ma", "nb", "mb" ] }, "application/mathml+xml": { source: "iana", compressible: !0, extensions: [ "mathml" ] }, "application/mathml-content+xml": { source: "iana", compressible: !0 }, "application/mathml-presentation+xml": { source: "iana", compressible: !0 }, "application/mbms-associated-procedure-description+xml": { source: "iana", compressible: !0 }, "application/mbms-deregister+xml": { source: "iana", compressible: !0 }, "application/mbms-envelope+xml": { source: "iana", compressible: !0 }, "application/mbms-msk+xml": { source: "iana", compressible: !0 }, "application/mbms-msk-response+xml": { source: "iana", compressible: !0 }, "application/mbms-protection-description+xml": { source: "iana", compressible: !0 }, "application/mbms-reception-report+xml": { source: "iana", compressible: !0 }, "application/mbms-register+xml": { source: "iana", compressible: !0 }, "application/mbms-register-response+xml": { source: "iana", compressible: !0 }, "application/mbms-schedule+xml": { source: "iana", compressible: !0 }, "application/mbms-user-service-description+xml": { source: "iana", compressible: !0 }, "application/mbox": { source: "iana", extensions: [ "mbox" ] }, "application/media-policy-dataset+xml": { source: "iana", compressible: !0 }, "application/media_control+xml": { source: "iana", compressible: !0 }, "application/mediaservercontrol+xml": { source: "iana", compressible: !0, extensions: [ "mscml" ] }, "application/merge-patch+json": { source: "iana", compressible: !0 }, "application/metalink+xml": { source: "apache", compressible: !0, extensions: [ "metalink" ] }, "application/metalink4+xml": { source: "iana", compressible: !0, extensions: [ "meta4" ] }, "application/mets+xml": { source: "iana", compressible: !0, extensions: [ "mets" ] }, "application/mf4": { source: "iana" }, "application/mikey": { source: "iana" }, "application/mmt-aei+xml": { source: "iana", compressible: !0 }, "application/mmt-usd+xml": { source: "iana", compressible: !0 }, "application/mods+xml": { source: "iana", compressible: !0, extensions: [ "mods" ] }, "application/moss-keys": { source: "iana" }, "application/moss-signature": { source: "iana" }, "application/mosskey-data": { source: "iana" }, "application/mosskey-request": { source: "iana" }, "application/mp21": { source: "iana", extensions: [ "m21", "mp21" ] }, "application/mp4": { source: "iana", extensions: [ "mp4s", "m4p" ] }, "application/mpeg4-generic": { source: "iana" }, "application/mpeg4-iod": { source: "iana" }, "application/mpeg4-iod-xmt": { source: "iana" }, "application/mrb-consumer+xml": { source: "iana", compressible: !0 }, "application/mrb-publish+xml": { source: "iana", compressible: !0 }, "application/msc-ivr+xml": { source: "iana", compressible: !0 }, "application/msc-mixer+xml": { source: "iana", compressible: !0 }, "application/msword": { source: "iana", compressible: !1, extensions: [ "doc", "dot" ] }, "application/mud+json": { source: "iana", compressible: !0 }, "application/mxf": { source: "iana", extensions: [ "mxf" ] }, "application/n-quads": { source: "iana", extensions: [ "nq" ] }, "application/n-triples": { source: "iana", extensions: [ "nt" ] }, "application/nasdata": { source: "iana" }, "application/news-checkgroups": { source: "iana" }, "application/news-groupinfo": { source: "iana" }, "application/news-transmission": { source: "iana" }, "application/nlsml+xml": { source: "iana", compressible: !0 }, "application/node": { source: "iana" }, "application/nss": { source: "iana" }, "application/ocsp-request": { source: "iana" }, "application/ocsp-response": { source: "iana" }, "application/octet-stream": { source: "iana", compressible: !1, extensions: [ "bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer" ] }, "application/oda": { source: "iana", extensions: [ "oda" ] }, "application/odm+xml": { source: "iana", compressible: !0 }, "application/odx": { source: "iana" }, "application/oebps-package+xml": { source: "iana", compressible: !0, extensions: [ "opf" ] }, "application/ogg": { source: "iana", compressible: !1, extensions: [ "ogx" ] }, "application/omdoc+xml": { source: "apache", compressible: !0, extensions: [ "omdoc" ] }, "application/onenote": { source: "apache", extensions: [ "onetoc", "onetoc2", "onetmp", "onepkg" ] }, "application/oscore": { source: "iana" }, "application/oxps": { source: "iana", extensions: [ "oxps" ] }, "application/p2p-overlay+xml": { source: "iana", compressible: !0 }, "application/parityfec": { source: "iana" }, "application/passport": { source: "iana" }, "application/patch-ops-error+xml": { source: "iana", compressible: !0, extensions: [ "xer" ] }, "application/pdf": { source: "iana", compressible: !1, extensions: [ "pdf" ] }, "application/pdx": { source: "iana" }, "application/pem-certificate-chain": { source: "iana" }, "application/pgp-encrypted": { source: "iana", compressible: !1, extensions: [ "pgp" ] }, "application/pgp-keys": { source: "iana" }, "application/pgp-signature": { source: "iana", extensions: [ "asc", "sig" ] }, "application/pics-rules": { source: "apache", extensions: [ "prf" ] }, "application/pidf+xml": { source: "iana", compressible: !0 }, "application/pidf-diff+xml": { source: "iana", compressible: !0 }, "application/pkcs10": { source: "iana", extensions: [ "p10" ] }, "application/pkcs12": { source: "iana" }, "application/pkcs7-mime": { source: "iana", extensions: [ "p7m", "p7c" ] }, "application/pkcs7-signature": { source: "iana", extensions: [ "p7s" ] }, "application/pkcs8": { source: "iana", extensions: [ "p8" ] }, "application/pkcs8-encrypted": { source: "iana" }, "application/pkix-attr-cert": { source: "iana", extensions: [ "ac" ] }, "application/pkix-cert": { source: "iana", extensions: [ "cer" ] }, "application/pkix-crl": { source: "iana", extensions: [ "crl" ] }, "application/pkix-pkipath": { source: "iana", extensions: [ "pkipath" ] }, "application/pkixcmp": { source: "iana", extensions: [ "pki" ] }, "application/pls+xml": { source: "iana", compressible: !0, extensions: [ "pls" ] }, "application/poc-settings+xml": { source: "iana", compressible: !0 }, "application/postscript": { source: "iana", compressible: !0, extensions: [ "ai", "eps", "ps" ] }, "application/ppsp-tracker+json": { source: "iana", compressible: !0 }, "application/problem+json": { source: "iana", compressible: !0 }, "application/problem+xml": { source: "iana", compressible: !0 }, "application/provenance+xml": { source: "iana", compressible: !0 }, "application/prs.alvestrand.titrax-sheet": { source: "iana" }, "application/prs.cww": { source: "iana", extensions: [ "cww" ] }, "application/prs.hpub+zip": { source: "iana", compressible: !1 }, "application/prs.nprend": { source: "iana" }, "application/prs.plucker": { source: "iana" }, "application/prs.rdf-xml-crypt": { source: "iana" }, "application/prs.xsf+xml": { source: "iana", compressible: !0 }, "application/pskc+xml": { source: "iana", compressible: !0, extensions: [ "pskcxml" ] }, "application/qsig": { source: "iana" }, "application/raml+yaml": { compressible: !0, extensions: [ "raml" ] }, "application/raptorfec": { source: "iana" }, "application/rdap+json": { source: "iana", compressible: !0 }, "application/rdf+xml": { source: "iana", compressible: !0, extensions: [ "rdf", "owl" ] }, "application/reginfo+xml": { source: "iana", compressible: !0, extensions: [ "rif" ] }, "application/relax-ng-compact-syntax": { source: "iana", extensions: [ "rnc" ] }, "application/remote-printing": { source: "iana" }, "application/reputon+json": { source: "iana", compressible: !0 }, "application/resource-lists+xml": { source: "iana", compressible: !0, extensions: [ "rl" ] }, "application/resource-lists-diff+xml": { source: "iana", compressible: !0, extensions: [ "rld" ] }, "application/rfc+xml": { source: "iana", compressible: !0 }, "application/riscos": { source: "iana" }, "application/rlmi+xml": { source: "iana", compressible: !0 }, "application/rls-services+xml": { source: "iana", compressible: !0, extensions: [ "rs" ] }, "application/route-apd+xml": { source: "iana", compressible: !0 }, "application/route-s-tsid+xml": { source: "iana", compressible: !0 }, "application/route-usd+xml": { source: "iana", compressible: !0 }, "application/rpki-ghostbusters": { source: "iana", extensions: [ "gbr" ] }, "application/rpki-manifest": { source: "iana", extensions: [ "mft" ] }, "application/rpki-publication": { source: "iana" }, "application/rpki-roa": { source: "iana", extensions: [ "roa" ] }, "application/rpki-updown": { source: "iana" }, "application/rsd+xml": { source: "apache", compressible: !0, extensions: [ "rsd" ] }, "application/rss+xml": { source: "apache", compressible: !0, extensions: [ "rss" ] }, "application/rtf": { source: "iana", compressible: !0, extensions: [ "rtf" ] }, "application/rtploopback": { source: "iana" }, "application/rtx": { source: "iana" }, "application/samlassertion+xml": { source: "iana", compressible: !0 }, "application/samlmetadata+xml": { source: "iana", compressible: !0 }, "application/sbml+xml": { source: "iana", compressible: !0, extensions: [ "sbml" ] }, "application/scaip+xml": { source: "iana", compressible: !0 }, "application/scim+json": { source: "iana", compressible: !0 }, "application/scvp-cv-request": { source: "iana", extensions: [ "scq" ] }, "application/scvp-cv-response": { source: "iana", extensions: [ "scs" ] }, "application/scvp-vp-request": { source: "iana", extensions: [ "spq" ] }, "application/scvp-vp-response": { source: "iana", extensions: [ "spp" ] }, "application/sdp": { source: "iana", extensions: [ "sdp" ] }, "application/secevent+jwt": { source: "iana" }, "application/senml+cbor": { source: "iana" }, "application/senml+json": { source: "iana", compressible: !0 }, "application/senml+xml": { source: "iana", compressible: !0 }, "application/senml-exi": { source: "iana" }, "application/sensml+cbor": { source: "iana" }, "application/sensml+json": { source: "iana", compressible: !0 }, "application/sensml+xml": { source: "iana", compressible: !0 }, "application/sensml-exi": { source: "iana" }, "application/sep+xml": { source: "iana", compressible: !0 }, "application/sep-exi": { source: "iana" }, "application/session-info": { source: "iana" }, "application/set-payment": { source: "iana" }, "application/set-payment-initiation": { source: "iana", extensions: [ "setpay" ] }, "application/set-registration": { source: "iana" }, "application/set-registration-initiation": { source: "iana", extensions: [ "setreg" ] }, "application/sgml": { source: "iana" }, "application/sgml-open-catalog": { source: "iana" }, "application/shf+xml": { source: "iana", compressible: !0, extensions: [ "shf" ] }, "application/sieve": { source: "iana", extensions: [ "siv", "sieve" ] }, "application/simple-filter+xml": { source: "iana", compressible: !0 }, "application/simple-message-summary": { source: "iana" }, "application/simplesymbolcontainer": { source: "iana" }, "application/slate": { source: "iana" }, "application/smil": { source: "iana" }, "application/smil+xml": { source: "iana", compressible: !0, extensions: [ "smi", "smil" ] }, "application/smpte336m": { source: "iana" }, "application/soap+fastinfoset": { source: "iana" }, "application/soap+xml": { source: "iana", compressible: !0 }, "application/sparql-query": { source: "iana", extensions: [ "rq" ] }, "application/sparql-results+xml": { source: "iana", compressible: !0, extensions: [ "srx" ] }, "application/spirits-event+xml": { source: "iana", compressible: !0 }, "application/sql": { source: "iana" }, "application/srgs": { source: "iana", extensions: [ "gram" ] }, "application/srgs+xml": { source: "iana", compressible: !0, extensions: [ "grxml" ] }, "application/sru+xml": { source: "iana", compressible: !0, extensions: [ "sru" ] }, "application/ssdl+xml": { source: "apache", compressible: !0, extensions: [ "ssdl" ] }, "application/ssml+xml": { source: "iana", compressible: !0, extensions: [ "ssml" ] }, "application/stix+json": { source: "iana", compressible: !0 }, "application/tamp-apex-update": { source: "iana" }, "application/tamp-apex-update-confirm": { source: "iana" }, "application/tamp-community-update": { source: "iana" }, "application/tamp-community-update-confirm": { source: "iana" }, "application/tamp-error": { source: "iana" }, "application/tamp-sequence-adjust": { source: "iana" }, "application/tamp-sequence-adjust-confirm": { source: "iana" }, "application/tamp-status-query": { source: "iana" }, "application/tamp-status-response": { source: "iana" }, "application/tamp-update": { source: "iana" }, "application/tamp-update-confirm": { source: "iana" }, "application/tar": { compressible: !0 }, "application/taxii+json": { source: "iana", compressible: !0 }, "application/tei+xml": { source: "iana", compressible: !0, extensions: [ "tei", "teicorpus" ] }, "application/tetra_isi": { source: "iana" }, "application/thraud+xml": { source: "iana", compressible: !0, extensions: [ "tfi" ] }, "application/timestamp-query": { source: "iana" }, "application/timestamp-reply": { source: "iana" }, "application/timestamped-data": { source: "iana", extensions: [ "tsd" ] }, "application/tlsrpt+gzip": { source: "iana" }, "application/tlsrpt+json": { source: "iana", compressible: !0 }, "application/tnauthlist": { source: "iana" }, "application/trickle-ice-sdpfrag": { source: "iana" }, "application/trig": { source: "iana" }, "application/ttml+xml": { source: "iana", compressible: !0 }, "application/tve-trigger": { source: "iana" }, "application/tzif": { source: "iana" }, "application/tzif-leap": { source: "iana" }, "application/ulpfec": { source: "iana" }, "application/urc-grpsheet+xml": { source: "iana", compressible: !0 }, "application/urc-ressheet+xml": { source: "iana", compressible: !0 }, "application/urc-targetdesc+xml": { source: "iana", compressible: !0 }, "application/urc-uisocketdesc+xml": { source: "iana", compressible: !0 }, "application/vcard+json": { source: "iana", compressible: !0 }, "application/vcard+xml": { source: "iana", compressible: !0 }, "application/vemmi": { source: "iana" }, "application/vividence.scriptfile": { source: "apache" }, "application/vnd.1000minds.decision-model+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-prose+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-prose-pc3ch+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-v2x-local-service-information": { source: "iana" }, "application/vnd.3gpp.access-transfer-events+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.bsf+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.gmop+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mc-signalling-ear": { source: "iana" }, "application/vnd.3gpp.mcdata-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-payload": { source: "iana" }, "application/vnd.3gpp.mcdata-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-signalling": { source: "iana" }, "application/vnd.3gpp.mcdata-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-floor-request+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-location-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-signed+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-ue-init-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-affiliation-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-location-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-transmission-request+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mid-call+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.pic-bw-large": { source: "iana", extensions: [ "plb" ] }, "application/vnd.3gpp.pic-bw-small": { source: "iana", extensions: [ "psb" ] }, "application/vnd.3gpp.pic-bw-var": { source: "iana", extensions: [ "pvb" ] }, "application/vnd.3gpp.sms": { source: "iana" }, "application/vnd.3gpp.sms+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.srvcc-ext+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.srvcc-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.state-and-event-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.ussd+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp2.bcmcsinfo+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp2.sms": { source: "iana" }, "application/vnd.3gpp2.tcap": { source: "iana", extensions: [ "tcap" ] }, "application/vnd.3lightssoftware.imagescal": { source: "iana" }, "application/vnd.3m.post-it-notes": { source: "iana", extensions: [ "pwn" ] }, "application/vnd.accpac.simply.aso": { source: "iana", extensions: [ "aso" ] }, "application/vnd.accpac.simply.imp": { source: "iana", extensions: [ "imp" ] }, "application/vnd.acucobol": { source: "iana", extensions: [ "acu" ] }, "application/vnd.acucorp": { source: "iana", extensions: [ "atc", "acutc" ] }, "application/vnd.adobe.air-application-installer-package+zip": { source: "apache", compressible: !1, extensions: [ "air" ] }, "application/vnd.adobe.flash.movie": { source: "iana" }, "application/vnd.adobe.formscentral.fcdt": { source: "iana", extensions: [ "fcdt" ] }, "application/vnd.adobe.fxp": { source: "iana", extensions: [ "fxp", "fxpl" ] }, "application/vnd.adobe.partial-upload": { source: "iana" }, "application/vnd.adobe.xdp+xml": { source: "iana", compressible: !0, extensions: [ "xdp" ] }, "application/vnd.adobe.xfdf": { source: "iana", extensions: [ "xfdf" ] }, "application/vnd.aether.imp": { source: "iana" }, "application/vnd.afpc.afplinedata": { source: "iana" }, "application/vnd.afpc.modca": { source: "iana" }, "application/vnd.ah-barcode": { source: "iana" }, "application/vnd.ahead.space": { source: "iana", extensions: [ "ahead" ] }, "application/vnd.airzip.filesecure.azf": { source: "iana", extensions: [ "azf" ] }, "application/vnd.airzip.filesecure.azs": { source: "iana", extensions: [ "azs" ] }, "application/vnd.amadeus+json": { source: "iana", compressible: !0 }, "application/vnd.amazon.ebook": { source: "apache", extensions: [ "azw" ] }, "application/vnd.amazon.mobi8-ebook": { source: "iana" }, "application/vnd.americandynamics.acc": { source: "iana", extensions: [ "acc" ] }, "application/vnd.amiga.ami": { source: "iana", extensions: [ "ami" ] }, "application/vnd.amundsen.maze+xml": { source: "iana", compressible: !0 }, "application/vnd.android.package-archive": { source: "apache", compressible: !1, extensions: [ "apk" ] }, "application/vnd.anki": { source: "iana" }, "application/vnd.anser-web-certificate-issue-initiation": { source: "iana", extensions: [ "cii" ] }, "application/vnd.anser-web-funds-transfer-initiation": { source: "apache", extensions: [ "fti" ] }, "application/vnd.antix.game-component": { source: "iana", extensions: [ "atx" ] }, "application/vnd.apache.thrift.binary": { source: "iana" }, "application/vnd.apache.thrift.compact": { source: "iana" }, "application/vnd.apache.thrift.json": { source: "iana" }, "application/vnd.api+json": { source: "iana", compressible: !0 }, "application/vnd.apothekende.reservation+json": { source: "iana", compressible: !0 }, "application/vnd.apple.installer+xml": { source: "iana", compressible: !0, extensions: [ "mpkg" ] }, "application/vnd.apple.keynote": { source: "iana", extensions: [ "keynote" ] }, "application/vnd.apple.mpegurl": { source: "iana", extensions: [ "m3u8" ] }, "application/vnd.apple.numbers": { source: "iana", extensions: [ "numbers" ] }, "application/vnd.apple.pages": { source: "iana", extensions: [ "pages" ] }, "application/vnd.apple.pkpass": { compressible: !1, extensions: [ "pkpass" ] }, "application/vnd.arastra.swi": { source: "iana" }, "application/vnd.aristanetworks.swi": { source: "iana", extensions: [ "swi" ] }, "application/vnd.artisan+json": { source: "iana", compressible: !0 }, "application/vnd.artsquare": { source: "iana" }, "application/vnd.astraea-software.iota": { source: "iana", extensions: [ "iota" ] }, "application/vnd.audiograph": { source: "iana", extensions: [ "aep" ] }, "application/vnd.autopackage": { source: "iana" }, "application/vnd.avalon+json": { source: "iana", compressible: !0 }, "application/vnd.avistar+xml": { source: "iana", compressible: !0 }, "application/vnd.balsamiq.bmml+xml": { source: "iana", compressible: !0 }, "application/vnd.balsamiq.bmpr": { source: "iana" }, "application/vnd.banana-accounting": { source: "iana" }, "application/vnd.bbf.usp.msg": { source: "iana" }, "application/vnd.bbf.usp.msg+json": { source: "iana", compressible: !0 }, "application/vnd.bekitzur-stech+json": { source: "iana", compressible: !0 }, "application/vnd.bint.med-content": { source: "iana" }, "application/vnd.biopax.rdf+xml": { source: "iana", compressible: !0 }, "application/vnd.blink-idb-value-wrapper": { source: "iana" }, "application/vnd.blueice.multipass": { source: "iana", extensions: [ "mpm" ] }, "application/vnd.bluetooth.ep.oob": { source: "iana" }, "application/vnd.bluetooth.le.oob": { source: "iana" }, "application/vnd.bmi": { source: "iana", extensions: [ "bmi" ] }, "application/vnd.businessobjects": { source: "iana", extensions: [ "rep" ] }, "application/vnd.byu.uapi+json": { source: "iana", compressible: !0 }, "application/vnd.cab-jscript": { source: "iana" }, "application/vnd.canon-cpdl": { source: "iana" }, "application/vnd.canon-lips": { source: "iana" }, "application/vnd.capasystems-pg+json": { source: "iana", compressible: !0 }, "application/vnd.cendio.thinlinc.clientconf": { source: "iana" }, "application/vnd.century-systems.tcp_stream": { source: "iana" }, "application/vnd.chemdraw+xml": { source: "iana", compressible: !0, extensions: [ "cdxml" ] }, "application/vnd.chess-pgn": { source: "iana" }, "application/vnd.chipnuts.karaoke-mmd": { source: "iana", extensions: [ "mmd" ] }, "application/vnd.cinderella": { source: "iana", extensions: [ "cdy" ] }, "application/vnd.cirpack.isdn-ext": { source: "iana" }, "application/vnd.citationstyles.style+xml": { source: "iana", compressible: !0, extensions: [ "csl" ] }, "application/vnd.claymore": { source: "iana", extensions: [ "cla" ] }, "application/vnd.cloanto.rp9": { source: "iana", extensions: [ "rp9" ] }, "application/vnd.clonk.c4group": { source: "iana", extensions: [ "c4g", "c4d", "c4f", "c4p", "c4u" ] }, "application/vnd.cluetrust.cartomobile-config": { source: "iana", extensions: [ "c11amc" ] }, "application/vnd.cluetrust.cartomobile-config-pkg": { source: "iana", extensions: [ "c11amz" ] }, "application/vnd.coffeescript": { source: "iana" }, "application/vnd.collabio.xodocuments.document": { source: "iana" }, "application/vnd.collabio.xodocuments.document-template": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation-template": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet-template": { source: "iana" }, "application/vnd.collection+json": { source: "iana", compressible: !0 }, "application/vnd.collection.doc+json": { source: "iana", compressible: !0 }, "application/vnd.collection.next+json": { source: "iana", compressible: !0 }, "application/vnd.comicbook+zip": { source: "iana", compressible: !1 }, "application/vnd.comicbook-rar": { source: "iana" }, "application/vnd.commerce-battelle": { source: "iana" }, "application/vnd.commonspace": { source: "iana", extensions: [ "csp" ] }, "application/vnd.contact.cmsg": { source: "iana", extensions: [ "cdbcmsg" ] }, "application/vnd.coreos.ignition+json": { source: "iana", compressible: !0 }, "application/vnd.cosmocaller": { source: "iana", extensions: [ "cmc" ] }, "application/vnd.crick.clicker": { source: "iana", extensions: [ "clkx" ] }, "application/vnd.crick.clicker.keyboard": { source: "iana", extensions: [ "clkk" ] }, "application/vnd.crick.clicker.palette": { source: "iana", extensions: [ "clkp" ] }, "application/vnd.crick.clicker.template": { source: "iana", extensions: [ "clkt" ] }, "application/vnd.crick.clicker.wordbank": { source: "iana", extensions: [ "clkw" ] }, "application/vnd.criticaltools.wbs+xml": { source: "iana", compressible: !0, extensions: [ "wbs" ] }, "application/vnd.ctc-posml": { source: "iana", extensions: [ "pml" ] }, "application/vnd.ctct.ws+xml": { source: "iana", compressible: !0 }, "application/vnd.cups-pdf": { source: "iana" }, "application/vnd.cups-postscript": { source: "iana" }, "application/vnd.cups-ppd": { source: "iana", extensions: [ "ppd" ] }, "application/vnd.cups-raster": { source: "iana" }, "application/vnd.cups-raw": { source: "iana" }, "application/vnd.curl": { source: "iana" }, "application/vnd.curl.car": { source: "apache", extensions: [ "car" ] }, "application/vnd.curl.pcurl": { source: "apache", extensions: [ "pcurl" ] }, "application/vnd.cyan.dean.root+xml": { source: "iana", compressible: !0 }, "application/vnd.cybank": { source: "iana" }, "application/vnd.d2l.coursepackage1p0+zip": { source: "iana", compressible: !1 }, "application/vnd.dart": { source: "iana", compressible: !0, extensions: [ "dart" ] }, "application/vnd.data-vision.rdz": { source: "iana", extensions: [ "rdz" ] }, "application/vnd.datapackage+json": { source: "iana", compressible: !0 }, "application/vnd.dataresource+json": { source: "iana", compressible: !0 }, "application/vnd.debian.binary-package": { source: "iana" }, "application/vnd.dece.data": { source: "iana", extensions: [ "uvf", "uvvf", "uvd", "uvvd" ] }, "application/vnd.dece.ttml+xml": { source: "iana", compressible: !0, extensions: [ "uvt", "uvvt" ] }, "application/vnd.dece.unspecified": { source: "iana", extensions: [ "uvx", "uvvx" ] }, "application/vnd.dece.zip": { source: "iana", extensions: [ "uvz", "uvvz" ] }, "application/vnd.denovo.fcselayout-link": { source: "iana", extensions: [ "fe_launch" ] }, "application/vnd.desmume.movie": { source: "iana" }, "application/vnd.dir-bi.plate-dl-nosuffix": { source: "iana" }, "application/vnd.dm.delegation+xml": { source: "iana", compressible: !0 }, "application/vnd.dna": { source: "iana", extensions: [ "dna" ] }, "application/vnd.document+json": { source: "iana", compressible: !0 }, "application/vnd.dolby.mlp": { source: "apache", extensions: [ "mlp" ] }, "application/vnd.dolby.mobile.1": { source: "iana" }, "application/vnd.dolby.mobile.2": { source: "iana" }, "application/vnd.doremir.scorecloud-binary-document": { source: "iana" }, "application/vnd.dpgraph": { source: "iana", extensions: [ "dpg" ] }, "application/vnd.dreamfactory": { source: "iana", extensions: [ "dfac" ] }, "application/vnd.drive+json": { source: "iana", compressible: !0 }, "application/vnd.ds-keypoint": { source: "apache", extensions: [ "kpxx" ] }, "application/vnd.dtg.local": { source: "iana" }, "application/vnd.dtg.local.flash": { source: "iana" }, "application/vnd.dtg.local.html": { source: "iana" }, "application/vnd.dvb.ait": { source: "iana", extensions: [ "ait" ] }, "application/vnd.dvb.dvbj": { source: "iana" }, "application/vnd.dvb.esgcontainer": { source: "iana" }, "application/vnd.dvb.ipdcdftnotifaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess2": { source: "iana" }, "application/vnd.dvb.ipdcesgpdd": { source: "iana" }, "application/vnd.dvb.ipdcroaming": { source: "iana" }, "application/vnd.dvb.iptv.alfec-base": { source: "iana" }, "application/vnd.dvb.iptv.alfec-enhancement": { source: "iana" }, "application/vnd.dvb.notif-aggregate-root+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-container+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-generic+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-msglist+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-registration-request+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-registration-response+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-init+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.pfr": { source: "iana" }, "application/vnd.dvb.service": { source: "iana", extensions: [ "svc" ] }, "application/vnd.dxr": { source: "iana" }, "application/vnd.dynageo": { source: "iana", extensions: [ "geo" ] }, "application/vnd.dzr": { source: "iana" }, "application/vnd.easykaraoke.cdgdownload": { source: "iana" }, "application/vnd.ecdis-update": { source: "iana" }, "application/vnd.ecip.rlp": { source: "iana" }, "application/vnd.ecowin.chart": { source: "iana", extensions: [ "mag" ] }, "application/vnd.ecowin.filerequest": { source: "iana" }, "application/vnd.ecowin.fileupdate": { source: "iana" }, "application/vnd.ecowin.series": { source: "iana" }, "application/vnd.ecowin.seriesrequest": { source: "iana" }, "application/vnd.ecowin.seriesupdate": { source: "iana" }, "application/vnd.efi.img": { source: "iana" }, "application/vnd.efi.iso": { source: "iana" }, "application/vnd.emclient.accessrequest+xml": { source: "iana", compressible: !0 }, "application/vnd.enliven": { source: "iana", extensions: [ "nml" ] }, "application/vnd.enphase.envoy": { source: "iana" }, "application/vnd.eprints.data+xml": { source: "iana", compressible: !0 }, "application/vnd.epson.esf": { source: "iana", extensions: [ "esf" ] }, "application/vnd.epson.msf": { source: "iana", extensions: [ "msf" ] }, "application/vnd.epson.quickanime": { source: "iana", extensions: [ "qam" ] }, "application/vnd.epson.salt": { source: "iana", extensions: [ "slt" ] }, "application/vnd.epson.ssf": { source: "iana", extensions: [ "ssf" ] }, "application/vnd.ericsson.quickcall": { source: "iana" }, "application/vnd.espass-espass+zip": { source: "iana", compressible: !1 }, "application/vnd.eszigno3+xml": { source: "iana", compressible: !0, extensions: [ "es3", "et3" ] }, "application/vnd.etsi.aoc+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.asic-e+zip": { source: "iana", compressible: !1 }, "application/vnd.etsi.asic-s+zip": { source: "iana", compressible: !1 }, "application/vnd.etsi.cug+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvcommand+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvdiscovery+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-bc+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-cod+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-npvr+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvservice+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsync+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvueprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.mcid+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.mheg5": { source: "iana" }, "application/vnd.etsi.overload-control-policy-dataset+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.pstn+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.sci+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.simservs+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.timestamp-token": { source: "iana" }, "application/vnd.etsi.tsl+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.tsl.der": { source: "iana" }, "application/vnd.eudora.data": { source: "iana" }, "application/vnd.evolv.ecig.profile": { source: "iana" }, "application/vnd.evolv.ecig.settings": { source: "iana" }, "application/vnd.evolv.ecig.theme": { source: "iana" }, "application/vnd.exstream-empower+zip": { source: "iana", compressible: !1 }, "application/vnd.exstream-package": { source: "iana" }, "application/vnd.ezpix-album": { source: "iana", extensions: [ "ez2" ] }, "application/vnd.ezpix-package": { source: "iana", extensions: [ "ez3" ] }, "application/vnd.f-secure.mobile": { source: "iana" }, "application/vnd.fastcopy-disk-image": { source: "iana" }, "application/vnd.fdf": { source: "iana", extensions: [ "fdf" ] }, "application/vnd.fdsn.mseed": { source: "iana", extensions: [ "mseed" ] }, "application/vnd.fdsn.seed": { source: "iana", extensions: [ "seed", "dataless" ] }, "application/vnd.ffsns": { source: "iana" }, "application/vnd.filmit.zfc": { source: "iana" }, "application/vnd.fints": { source: "iana" }, "application/vnd.firemonkeys.cloudcell": { source: "iana" }, "application/vnd.flographit": { source: "iana", extensions: [ "gph" ] }, "application/vnd.fluxtime.clip": { source: "iana", extensions: [ "ftc" ] }, "application/vnd.font-fontforge-sfd": { source: "iana" }, "application/vnd.framemaker": { source: "iana", extensions: [ "fm", "frame", "maker", "book" ] }, "application/vnd.frogans.fnc": { source: "iana", extensions: [ "fnc" ] }, "application/vnd.frogans.ltf": { source: "iana", extensions: [ "ltf" ] }, "application/vnd.fsc.weblaunch": { source: "iana", extensions: [ "fsc" ] }, "application/vnd.fujitsu.oasys": { source: "iana", extensions: [ "oas" ] }, "application/vnd.fujitsu.oasys2": { source: "iana", extensions: [ "oa2" ] }, "application/vnd.fujitsu.oasys3": { source: "iana", extensions: [ "oa3" ] }, "application/vnd.fujitsu.oasysgp": { source: "iana", extensions: [ "fg5" ] }, "application/vnd.fujitsu.oasysprs": { source: "iana", extensions: [ "bh2" ] }, "application/vnd.fujixerox.art-ex": { source: "iana" }, "application/vnd.fujixerox.art4": { source: "iana" }, "application/vnd.fujixerox.ddd": { source: "iana", extensions: [ "ddd" ] }, "application/vnd.fujixerox.docuworks": { source: "iana", extensions: [ "xdw" ] }, "application/vnd.fujixerox.docuworks.binder": { source: "iana", extensions: [ "xbd" ] }, "application/vnd.fujixerox.docuworks.container": { source: "iana" }, "application/vnd.fujixerox.hbpl": { source: "iana" }, "application/vnd.fut-misnet": { source: "iana" }, "application/vnd.futoin+cbor": { source: "iana" }, "application/vnd.futoin+json": { source: "iana", compressible: !0 }, "application/vnd.fuzzysheet": { source: "iana", extensions: [ "fzs" ] }, "application/vnd.genomatix.tuxedo": { source: "iana", extensions: [ "txd" ] }, "application/vnd.geo+json": { source: "iana", compressible: !0 }, "application/vnd.geocube+xml": { source: "iana", compressible: !0 }, "application/vnd.geogebra.file": { source: "iana", extensions: [ "ggb" ] }, "application/vnd.geogebra.tool": { source: "iana", extensions: [ "ggt" ] }, "application/vnd.geometry-explorer": { source: "iana", extensions: [ "gex", "gre" ] }, "application/vnd.geonext": { source: "iana", extensions: [ "gxt" ] }, "application/vnd.geoplan": { source: "iana", extensions: [ "g2w" ] }, "application/vnd.geospace": { source: "iana", extensions: [ "g3w" ] }, "application/vnd.gerber": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt-response": { source: "iana" }, "application/vnd.gmx": { source: "iana", extensions: [ "gmx" ] }, "application/vnd.google-apps.document": { compressible: !1, extensions: [ "gdoc" ] }, "application/vnd.google-apps.presentation": { compressible: !1, extensions: [ "gslides" ] }, "application/vnd.google-apps.spreadsheet": { compressible: !1, extensions: [ "gsheet" ] }, "application/vnd.google-earth.kml+xml": { source: "iana", compressible: !0, extensions: [ "kml" ] }, "application/vnd.google-earth.kmz": { source: "iana", compressible: !1, extensions: [ "kmz" ] }, "application/vnd.gov.sk.e-form+xml": { source: "iana", compressible: !0 }, "application/vnd.gov.sk.e-form+zip": { source: "iana", compressible: !1 }, "application/vnd.gov.sk.xmldatacontainer+xml": { source: "iana", compressible: !0 }, "application/vnd.grafeq": { source: "iana", extensions: [ "gqf", "gqs" ] }, "application/vnd.gridmp": { source: "iana" }, "application/vnd.groove-account": { source: "iana", extensions: [ "gac" ] }, "application/vnd.groove-help": { source: "iana", extensions: [ "ghf" ] }, "application/vnd.groove-identity-message": { source: "iana", extensions: [ "gim" ] }, "application/vnd.groove-injector": { source: "iana", extensions: [ "grv" ] }, "application/vnd.groove-tool-message": { source: "iana", extensions: [ "gtm" ] }, "application/vnd.groove-tool-template": { source: "iana", extensions: [ "tpl" ] }, "application/vnd.groove-vcard": { source: "iana", extensions: [ "vcg" ] }, "application/vnd.hal+json": { source: "iana", compressible: !0 }, "application/vnd.hal+xml": { source: "iana", compressible: !0, extensions: [ "hal" ] }, "application/vnd.handheld-entertainment+xml": { source: "iana", compressible: !0, extensions: [ "zmm" ] }, "application/vnd.hbci": { source: "iana", extensions: [ "hbci" ] }, "application/vnd.hc+json": { source: "iana", compressible: !0 }, "application/vnd.hcl-bireports": { source: "iana" }, "application/vnd.hdt": { source: "iana" }, "application/vnd.heroku+json": { source: "iana", compressible: !0 }, "application/vnd.hhe.lesson-player": { source: "iana", extensions: [ "les" ] }, "application/vnd.hp-hpgl": { source: "iana", extensions: [ "hpgl" ] }, "application/vnd.hp-hpid": { source: "iana", extensions: [ "hpid" ] }, "application/vnd.hp-hps": { source: "iana", extensions: [ "hps" ] }, "application/vnd.hp-jlyt": { source: "iana", extensions: [ "jlt" ] }, "application/vnd.hp-pcl": { source: "iana", extensions: [ "pcl" ] }, "application/vnd.hp-pclxl": { source: "iana", extensions: [ "pclxl" ] }, "application/vnd.httphone": { source: "iana" }, "application/vnd.hydrostatix.sof-data": { source: "iana", extensions: [ "sfd-hdstx" ] }, "application/vnd.hyper+json": { source: "iana", compressible: !0 }, "application/vnd.hyper-item+json": { source: "iana", compressible: !0 }, "application/vnd.hyperdrive+json": { source: "iana", compressible: !0 }, "application/vnd.hzn-3d-crossword": { source: "iana" }, "application/vnd.ibm.afplinedata": { source: "iana" }, "application/vnd.ibm.electronic-media": { source: "iana" }, "application/vnd.ibm.minipay": { source: "iana", extensions: [ "mpy" ] }, "application/vnd.ibm.modcap": { source: "iana", extensions: [ "afp", "listafp", "list3820" ] }, "application/vnd.ibm.rights-management": { source: "iana", extensions: [ "irm" ] }, "application/vnd.ibm.secure-container": { source: "iana", extensions: [ "sc" ] }, "application/vnd.iccprofile": { source: "iana", extensions: [ "icc", "icm" ] }, "application/vnd.ieee.1905": { source: "iana" }, "application/vnd.igloader": { source: "iana", extensions: [ "igl" ] }, "application/vnd.imagemeter.folder+zip": { source: "iana", compressible: !1 }, "application/vnd.imagemeter.image+zip": { source: "iana", compressible: !1 }, "application/vnd.immervision-ivp": { source: "iana", extensions: [ "ivp" ] }, "application/vnd.immervision-ivu": { source: "iana", extensions: [ "ivu" ] }, "application/vnd.ims.imsccv1p1": { source: "iana" }, "application/vnd.ims.imsccv1p2": { source: "iana" }, "application/vnd.ims.imsccv1p3": { source: "iana" }, "application/vnd.ims.lis.v2.result+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolconsumerprofile+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolproxy+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolproxy.id+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolsettings+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolsettings.simple+json": { source: "iana", compressible: !0 }, "application/vnd.informedcontrol.rms+xml": { source: "iana", compressible: !0 }, "application/vnd.informix-visionary": { source: "iana" }, "application/vnd.infotech.project": { source: "iana" }, "application/vnd.infotech.project+xml": { source: "iana", compressible: !0 }, "application/vnd.innopath.wamp.notification": { source: "iana" }, "application/vnd.insors.igm": { source: "iana", extensions: [ "igm" ] }, "application/vnd.intercon.formnet": { source: "iana", extensions: [ "xpw", "xpx" ] }, "application/vnd.intergeo": { source: "iana", extensions: [ "i2g" ] }, "application/vnd.intertrust.digibox": { source: "iana" }, "application/vnd.intertrust.nncp": { source: "iana" }, "application/vnd.intu.qbo": { source: "iana", extensions: [ "qbo" ] }, "application/vnd.intu.qfx": { source: "iana", extensions: [ "qfx" ] }, "application/vnd.iptc.g2.catalogitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.conceptitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.knowledgeitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.newsitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.newsmessage+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.packageitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.planningitem+xml": { source: "iana", compressible: !0 }, "application/vnd.ipunplugged.rcprofile": { source: "iana", extensions: [ "rcprofile" ] }, "application/vnd.irepository.package+xml": { source: "iana", compressible: !0, extensions: [ "irp" ] }, "application/vnd.is-xpr": { source: "iana", extensions: [ "xpr" ] }, "application/vnd.isac.fcs": { source: "iana", extensions: [ "fcs" ] }, "application/vnd.jam": { source: "iana", extensions: [ "jam" ] }, "application/vnd.japannet-directory-service": { source: "iana" }, "application/vnd.japannet-jpnstore-wakeup": { source: "iana" }, "application/vnd.japannet-payment-wakeup": { source: "iana" }, "application/vnd.japannet-registration": { source: "iana" }, "application/vnd.japannet-registration-wakeup": { source: "iana" }, "application/vnd.japannet-setstore-wakeup": { source: "iana" }, "application/vnd.japannet-verification": { source: "iana" }, "application/vnd.japannet-verification-wakeup": { source: "iana" }, "application/vnd.jcp.javame.midlet-rms": { source: "iana", extensions: [ "rms" ] }, "application/vnd.jisp": { source: "iana", extensions: [ "jisp" ] }, "application/vnd.joost.joda-archive": { source: "iana", extensions: [ "joda" ] }, "application/vnd.jsk.isdn-ngn": { source: "iana" }, "application/vnd.kahootz": { source: "iana", extensions: [ "ktz", "ktr" ] }, "application/vnd.kde.karbon": { source: "iana", extensions: [ "karbon" ] }, "application/vnd.kde.kchart": { source: "iana", extensions: [ "chrt" ] }, "application/vnd.kde.kformula": { source: "iana", extensions: [ "kfo" ] }, "application/vnd.kde.kivio": { source: "iana", extensions: [ "flw" ] }, "application/vnd.kde.kontour": { source: "iana", extensions: [ "kon" ] }, "application/vnd.kde.kpresenter": { source: "iana", extensions: [ "kpr", "kpt" ] }, "application/vnd.kde.kspread": { source: "iana", extensions: [ "ksp" ] }, "application/vnd.kde.kword": { source: "iana", extensions: [ "kwd", "kwt" ] }, "application/vnd.kenameaapp": { source: "iana", extensions: [ "htke" ] }, "application/vnd.kidspiration": { source: "iana", extensions: [ "kia" ] }, "application/vnd.kinar": { source: "iana", extensions: [ "kne", "knp" ] }, "application/vnd.koan": { source: "iana", extensions: [ "skp", "skd", "skt", "skm" ] }, "application/vnd.kodak-descriptor": { source: "iana", extensions: [ "sse" ] }, "application/vnd.las.las+json": { source: "iana", compressible: !0 }, "application/vnd.las.las+xml": { source: "iana", compressible: !0, extensions: [ "lasxml" ] }, "application/vnd.leap+json": { source: "iana", compressible: !0 }, "application/vnd.liberty-request+xml": { source: "iana", compressible: !0 }, "application/vnd.llamagraphics.life-balance.desktop": { source: "iana", extensions: [ "lbd" ] }, "application/vnd.llamagraphics.life-balance.exchange+xml": { source: "iana", compressible: !0, extensions: [ "lbe" ] }, "application/vnd.lotus-1-2-3": { source: "iana", extensions: [ "123" ] }, "application/vnd.lotus-approach": { source: "iana", extensions: [ "apr" ] }, "application/vnd.lotus-freelance": { source: "iana", extensions: [ "pre" ] }, "application/vnd.lotus-notes": { source: "iana", extensions: [ "nsf" ] }, "application/vnd.lotus-organizer": { source: "iana", extensions: [ "org" ] }, "application/vnd.lotus-screencam": { source: "iana", extensions: [ "scm" ] }, "application/vnd.lotus-wordpro": { source: "iana", extensions: [ "lwp" ] }, "application/vnd.macports.portpkg": { source: "iana", extensions: [ "portpkg" ] }, "application/vnd.mapbox-vector-tile": { source: "iana" }, "application/vnd.marlin.drm.actiontoken+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.conftoken+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.license+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.mdcf": { source: "iana" }, "application/vnd.mason+json": { source: "iana", compressible: !0 }, "application/vnd.maxmind.maxmind-db": { source: "iana" }, "application/vnd.mcd": { source: "iana", extensions: [ "mcd" ] }, "application/vnd.medcalcdata": { source: "iana", extensions: [ "mc1" ] }, "application/vnd.mediastation.cdkey": { source: "iana", extensions: [ "cdkey" ] }, "application/vnd.meridian-slingshot": { source: "iana" }, "application/vnd.mfer": { source: "iana", extensions: [ "mwf" ] }, "application/vnd.mfmp": { source: "iana", extensions: [ "mfm" ] }, "application/vnd.micro+json": { source: "iana", compressible: !0 }, "application/vnd.micrografx.flo": { source: "iana", extensions: [ "flo" ] }, "application/vnd.micrografx.igx": { source: "iana", extensions: [ "igx" ] }, "application/vnd.microsoft.portable-executable": { source: "iana" }, "application/vnd.microsoft.windows.thumbnail-cache": { source: "iana" }, "application/vnd.miele+json": { source: "iana", compressible: !0 }, "application/vnd.mif": { source: "iana", extensions: [ "mif" ] }, "application/vnd.minisoft-hp3000-save": { source: "iana" }, "application/vnd.mitsubishi.misty-guard.trustweb": { source: "iana" }, "application/vnd.mobius.daf": { source: "iana", extensions: [ "daf" ] }, "application/vnd.mobius.dis": { source: "iana", extensions: [ "dis" ] }, "application/vnd.mobius.mbk": { source: "iana", extensions: [ "mbk" ] }, "application/vnd.mobius.mqy": { source: "iana", extensions: [ "mqy" ] }, "application/vnd.mobius.msl": { source: "iana", extensions: [ "msl" ] }, "application/vnd.mobius.plc": { source: "iana", extensions: [ "plc" ] }, "application/vnd.mobius.txf": { source: "iana", extensions: [ "txf" ] }, "application/vnd.mophun.application": { source: "iana", extensions: [ "mpn" ] }, "application/vnd.mophun.certificate": { source: "iana", extensions: [ "mpc" ] }, "application/vnd.motorola.flexsuite": { source: "iana" }, "application/vnd.motorola.flexsuite.adsi": { source: "iana" }, "application/vnd.motorola.flexsuite.fis": { source: "iana" }, "application/vnd.motorola.flexsuite.gotap": { source: "iana" }, "application/vnd.motorola.flexsuite.kmr": { source: "iana" }, "application/vnd.motorola.flexsuite.ttc": { source: "iana" }, "application/vnd.motorola.flexsuite.wem": { source: "iana" }, "application/vnd.motorola.iprm": { source: "iana" }, "application/vnd.mozilla.xul+xml": { source: "iana", compressible: !0, extensions: [ "xul" ] }, "application/vnd.ms-3mfdocument": { source: "iana" }, "application/vnd.ms-artgalry": { source: "iana", extensions: [ "cil" ] }, "application/vnd.ms-asf": { source: "iana" }, "application/vnd.ms-cab-compressed": { source: "iana", extensions: [ "cab" ] }, "application/vnd.ms-color.iccprofile": { source: "apache" }, "application/vnd.ms-excel": { source: "iana", compressible: !1, extensions: [ "xls", "xlm", "xla", "xlc", "xlt", "xlw" ] }, "application/vnd.ms-excel.addin.macroenabled.12": { source: "iana", extensions: [ "xlam" ] }, "application/vnd.ms-excel.sheet.binary.macroenabled.12": { source: "iana", extensions: [ "xlsb" ] }, "application/vnd.ms-excel.sheet.macroenabled.12": { source: "iana", extensions: [ "xlsm" ] }, "application/vnd.ms-excel.template.macroenabled.12": { source: "iana", extensions: [ "xltm" ] }, "application/vnd.ms-fontobject": { source: "iana", compressible: !0, extensions: [ "eot" ] }, "application/vnd.ms-htmlhelp": { source: "iana", extensions: [ "chm" ] }, "application/vnd.ms-ims": { source: "iana", extensions: [ "ims" ] }, "application/vnd.ms-lrm": { source: "iana", extensions: [ "lrm" ] }, "application/vnd.ms-office.activex+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-officetheme": { source: "iana", extensions: [ "thmx" ] }, "application/vnd.ms-opentype": { source: "apache", compressible: !0 }, "application/vnd.ms-outlook": { compressible: !1, extensions: [ "msg" ] }, "application/vnd.ms-package.obfuscated-opentype": { source: "apache" }, "application/vnd.ms-pki.seccat": { source: "apache", extensions: [ "cat" ] }, "application/vnd.ms-pki.stl": { source: "apache", extensions: [ "stl" ] }, "application/vnd.ms-playready.initiator+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-powerpoint": { source: "iana", compressible: !1, extensions: [ "ppt", "pps", "pot" ] }, "application/vnd.ms-powerpoint.addin.macroenabled.12": { source: "iana", extensions: [ "ppam" ] }, "application/vnd.ms-powerpoint.presentation.macroenabled.12": { source: "iana", extensions: [ "pptm" ] }, "application/vnd.ms-powerpoint.slide.macroenabled.12": { source: "iana", extensions: [ "sldm" ] }, "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { source: "iana", extensions: [ "ppsm" ] }, "application/vnd.ms-powerpoint.template.macroenabled.12": { source: "iana", extensions: [ "potm" ] }, "application/vnd.ms-printdevicecapabilities+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-printing.printticket+xml": { source: "apache", compressible: !0 }, "application/vnd.ms-printschematicket+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-project": { source: "iana", extensions: [ "mpp", "mpt" ] }, "application/vnd.ms-tnef": { source: "iana" }, "application/vnd.ms-windows.devicepairing": { source: "iana" }, "application/vnd.ms-windows.nwprinting.oob": { source: "iana" }, "application/vnd.ms-windows.printerpairing": { source: "iana" }, "application/vnd.ms-windows.wsd.oob": { source: "iana" }, "application/vnd.ms-wmdrm.lic-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.lic-resp": { source: "iana" }, "application/vnd.ms-wmdrm.meter-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.meter-resp": { source: "iana" }, "application/vnd.ms-word.document.macroenabled.12": { source: "iana", extensions: [ "docm" ] }, "application/vnd.ms-word.template.macroenabled.12": { source: "iana", extensions: [ "dotm" ] }, "application/vnd.ms-works": { source: "iana", extensions: [ "wps", "wks", "wcm", "wdb" ] }, "application/vnd.ms-wpl": { source: "iana", extensions: [ "wpl" ] }, "application/vnd.ms-xpsdocument": { source: "iana", compressible: !1, extensions: [ "xps" ] }, "application/vnd.msa-disk-image": { source: "iana" }, "application/vnd.mseq": { source: "iana", extensions: [ "mseq" ] }, "application/vnd.msign": { source: "iana" }, "application/vnd.multiad.creator": { source: "iana" }, "application/vnd.multiad.creator.cif": { source: "iana" }, "application/vnd.music-niff": { source: "iana" }, "application/vnd.musician": { source: "iana", extensions: [ "mus" ] }, "application/vnd.muvee.style": { source: "iana", extensions: [ "msty" ] }, "application/vnd.mynfc": { source: "iana", extensions: [ "taglet" ] }, "application/vnd.ncd.control": { source: "iana" }, "application/vnd.ncd.reference": { source: "iana" }, "application/vnd.nearst.inv+json": { source: "iana", compressible: !0 }, "application/vnd.nervana": { source: "iana" }, "application/vnd.netfpx": { source: "iana" }, "application/vnd.neurolanguage.nlu": { source: "iana", extensions: [ "nlu" ] }, "application/vnd.nimn": { source: "iana" }, "application/vnd.nintendo.nitro.rom": { source: "iana" }, "application/vnd.nintendo.snes.rom": { source: "iana" }, "application/vnd.nitf": { source: "iana", extensions: [ "ntf", "nitf" ] }, "application/vnd.noblenet-directory": { source: "iana", extensions: [ "nnd" ] }, "application/vnd.noblenet-sealer": { source: "iana", extensions: [ "nns" ] }, "application/vnd.noblenet-web": { source: "iana", extensions: [ "nnw" ] }, "application/vnd.nokia.catalogs": { source: "iana" }, "application/vnd.nokia.conml+wbxml": { source: "iana" }, "application/vnd.nokia.conml+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.iptv.config+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.isds-radio-presets": { source: "iana" }, "application/vnd.nokia.landmark+wbxml": { source: "iana" }, "application/vnd.nokia.landmark+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.landmarkcollection+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.n-gage.ac+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.n-gage.data": { source: "iana", extensions: [ "ngdat" ] }, "application/vnd.nokia.n-gage.symbian.install": { source: "iana", extensions: [ "n-gage" ] }, "application/vnd.nokia.ncd": { source: "iana" }, "application/vnd.nokia.pcd+wbxml": { source: "iana" }, "application/vnd.nokia.pcd+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.radio-preset": { source: "iana", extensions: [ "rpst" ] }, "application/vnd.nokia.radio-presets": { source: "iana", extensions: [ "rpss" ] }, "application/vnd.novadigm.edm": { source: "iana", extensions: [ "edm" ] }, "application/vnd.novadigm.edx": { source: "iana", extensions: [ "edx" ] }, "application/vnd.novadigm.ext": { source: "iana", extensions: [ "ext" ] }, "application/vnd.ntt-local.content-share": { source: "iana" }, "application/vnd.ntt-local.file-transfer": { source: "iana" }, "application/vnd.ntt-local.ogw_remote-access": { source: "iana" }, "application/vnd.ntt-local.sip-ta_remote": { source: "iana" }, "application/vnd.ntt-local.sip-ta_tcp_stream": { source: "iana" }, "application/vnd.oasis.opendocument.chart": { source: "iana", extensions: [ "odc" ] }, "application/vnd.oasis.opendocument.chart-template": { source: "iana", extensions: [ "otc" ] }, "application/vnd.oasis.opendocument.database": { source: "iana", extensions: [ "odb" ] }, "application/vnd.oasis.opendocument.formula": { source: "iana", extensions: [ "odf" ] }, "application/vnd.oasis.opendocument.formula-template": { source: "iana", extensions: [ "odft" ] }, "application/vnd.oasis.opendocument.graphics": { source: "iana", compressible: !1, extensions: [ "odg" ] }, "application/vnd.oasis.opendocument.graphics-template": { source: "iana", extensions: [ "otg" ] }, "application/vnd.oasis.opendocument.image": { source: "iana", extensions: [ "odi" ] }, "application/vnd.oasis.opendocument.image-template": { source: "iana", extensions: [ "oti" ] }, "application/vnd.oasis.opendocument.presentation": { source: "iana", compressible: !1, extensions: [ "odp" ] }, "application/vnd.oasis.opendocument.presentation-template": { source: "iana", extensions: [ "otp" ] }, "application/vnd.oasis.opendocument.spreadsheet": { source: "iana", compressible: !1, extensions: [ "ods" ] }, "application/vnd.oasis.opendocument.spreadsheet-template": { source: "iana", extensions: [ "ots" ] }, "application/vnd.oasis.opendocument.text": { source: "iana", compressible: !1, extensions: [ "odt" ] }, "application/vnd.oasis.opendocument.text-master": { source: "iana", extensions: [ "odm" ] }, "application/vnd.oasis.opendocument.text-template": { source: "iana", extensions: [ "ott" ] }, "application/vnd.oasis.opendocument.text-web": { source: "iana", extensions: [ "oth" ] }, "application/vnd.obn": { source: "iana" }, "application/vnd.ocf+cbor": { source: "iana" }, "application/vnd.oftn.l10n+json": { source: "iana", compressible: !0 }, "application/vnd.oipf.contentaccessdownload+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.contentaccessstreaming+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.cspg-hexbinary": { source: "iana" }, "application/vnd.oipf.dae.svg+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.dae.xhtml+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.mippvcontrolmessage+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.pae.gem": { source: "iana" }, "application/vnd.oipf.spdiscovery+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.spdlist+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.ueprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.userprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.olpc-sugar": { source: "iana", extensions: [ "xo" ] }, "application/vnd.oma-scws-config": { source: "iana" }, "application/vnd.oma-scws-http-request": { source: "iana" }, "application/vnd.oma-scws-http-response": { source: "iana" }, "application/vnd.oma.bcast.associated-procedure-parameter+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.drm-trigger+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.imd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.ltkm": { source: "iana" }, "application/vnd.oma.bcast.notification+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.provisioningtrigger": { source: "iana" }, "application/vnd.oma.bcast.sgboot": { source: "iana" }, "application/vnd.oma.bcast.sgdd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.sgdu": { source: "iana" }, "application/vnd.oma.bcast.simple-symbol-container": { source: "iana" }, "application/vnd.oma.bcast.smartcard-trigger+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.sprov+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.stkm": { source: "iana" }, "application/vnd.oma.cab-address-book+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-feature-handler+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-pcc+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-subs-invite+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-user-prefs+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.dcd": { source: "iana" }, "application/vnd.oma.dcdc": { source: "iana" }, "application/vnd.oma.dd2+xml": { source: "iana", compressible: !0, extensions: [ "dd2" ] }, "application/vnd.oma.drm.risd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.group-usage-list+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.lwm2m+json": { source: "iana", compressible: !0 }, "application/vnd.oma.lwm2m+tlv": { source: "iana" }, "application/vnd.oma.pal+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.detailed-progress-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.final-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.groups+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.invocation-descriptor+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.optimized-progress-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.push": { source: "iana" }, "application/vnd.oma.scidm.messages+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.xcap-directory+xml": { source: "iana", compressible: !0 }, "application/vnd.omads-email+xml": { source: "iana", compressible: !0 }, "application/vnd.omads-file+xml": { source: "iana", compressible: !0 }, "application/vnd.omads-folder+xml": { source: "iana", compressible: !0 }, "application/vnd.omaloc-supl-init": { source: "iana" }, "application/vnd.onepager": { source: "iana" }, "application/vnd.onepagertamp": { source: "iana" }, "application/vnd.onepagertamx": { source: "iana" }, "application/vnd.onepagertat": { source: "iana" }, "application/vnd.onepagertatp": { source: "iana" }, "application/vnd.onepagertatx": { source: "iana" }, "application/vnd.openblox.game+xml": { source: "iana", compressible: !0 }, "application/vnd.openblox.game-binary": { source: "iana" }, "application/vnd.openeye.oeb": { source: "iana" }, "application/vnd.openofficeorg.extension": { source: "apache", extensions: [ "oxt" ] }, "application/vnd.openstreetmap.data+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawing+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.extended-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.presentation": { source: "iana", compressible: !1, extensions: [ "pptx" ] }, "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slide": { source: "iana", extensions: [ "sldx" ] }, "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { source: "iana", extensions: [ "ppsx" ] }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.template": { source: "iana", extensions: [ "potx" ] }, "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { source: "iana", compressible: !1, extensions: [ "xlsx" ] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { source: "iana", extensions: [ "xltx" ] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.theme+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.themeoverride+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.vmldrawing": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { source: "iana", compressible: !1, extensions: [ "docx" ] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { source: "iana", extensions: [ "dotx" ] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.core-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.relationships+xml": { source: "iana", compressible: !0 }, "application/vnd.oracle.resource+json": { source: "iana", compressible: !0 }, "application/vnd.orange.indata": { source: "iana" }, "application/vnd.osa.netdeploy": { source: "iana" }, "application/vnd.osgeo.mapguide.package": { source: "iana", extensions: [ "mgp" ] }, "application/vnd.osgi.bundle": { source: "iana" }, "application/vnd.osgi.dp": { source: "iana", extensions: [ "dp" ] }, "application/vnd.osgi.subsystem": { source: "iana", extensions: [ "esa" ] }, "application/vnd.otps.ct-kip+xml": { source: "iana", compressible: !0 }, "application/vnd.oxli.countgraph": { source: "iana" }, "application/vnd.pagerduty+json": { source: "iana", compressible: !0 }, "application/vnd.palm": { source: "iana", extensions: [ "pdb", "pqa", "oprc" ] }, "application/vnd.panoply": { source: "iana" }, "application/vnd.paos.xml": { source: "iana" }, "application/vnd.patentdive": { source: "iana" }, "application/vnd.patientecommsdoc": { source: "iana" }, "application/vnd.pawaafile": { source: "iana", extensions: [ "paw" ] }, "application/vnd.pcos": { source: "iana" }, "application/vnd.pg.format": { source: "iana", extensions: [ "str" ] }, "application/vnd.pg.osasli": { source: "iana", extensions: [ "ei6" ] }, "application/vnd.piaccess.application-licence": { source: "iana" }, "application/vnd.picsel": { source: "iana", extensions: [ "efif" ] }, "application/vnd.pmi.widget": { source: "iana", extensions: [ "wg" ] }, "application/vnd.poc.group-advertisement+xml": { source: "iana", compressible: !0 }, "application/vnd.pocketlearn": { source: "iana", extensions: [ "plf" ] }, "application/vnd.powerbuilder6": { source: "iana", extensions: [ "pbd" ] }, "application/vnd.powerbuilder6-s": { source: "iana" }, "application/vnd.powerbuilder7": { source: "iana" }, "application/vnd.powerbuilder7-s": { source: "iana" }, "application/vnd.powerbuilder75": { source: "iana" }, "application/vnd.powerbuilder75-s": { source: "iana" }, "application/vnd.preminet": { source: "iana" }, "application/vnd.previewsystems.box": { source: "iana", extensions: [ "box" ] }, "application/vnd.proteus.magazine": { source: "iana", extensions: [ "mgz" ] }, "application/vnd.psfs": { source: "iana" }, "application/vnd.publishare-delta-tree": { source: "iana", extensions: [ "qps" ] }, "application/vnd.pvi.ptid1": { source: "iana", extensions: [ "ptid" ] }, "application/vnd.pwg-multiplexed": { source: "iana" }, "application/vnd.pwg-xhtml-print+xml": { source: "iana", compressible: !0 }, "application/vnd.qualcomm.brew-app-res": { source: "iana" }, "application/vnd.quarantainenet": { source: "iana" }, "application/vnd.quark.quarkxpress": { source: "iana", extensions: [ "qxd", "qxt", "qwd", "qwt", "qxl", "qxb" ] }, "application/vnd.quobject-quoxdocument": { source: "iana" }, "application/vnd.radisys.moml+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-conf+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-conn+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-dialog+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-stream+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-conf+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-base+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-fax-detect+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-group+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-speech+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-transform+xml": { source: "iana", compressible: !0 }, "application/vnd.rainstor.data": { source: "iana" }, "application/vnd.rapid": { source: "iana" }, "application/vnd.rar": { source: "iana" }, "application/vnd.realvnc.bed": { source: "iana", extensions: [ "bed" ] }, "application/vnd.recordare.musicxml": { source: "iana", extensions: [ "mxl" ] }, "application/vnd.recordare.musicxml+xml": { source: "iana", compressible: !0, extensions: [ "musicxml" ] }, "application/vnd.renlearn.rlprint": { source: "iana" }, "application/vnd.restful+json": { source: "iana", compressible: !0 }, "application/vnd.rig.cryptonote": { source: "iana", extensions: [ "cryptonote" ] }, "application/vnd.rim.cod": { source: "apache", extensions: [ "cod" ] }, "application/vnd.rn-realmedia": { source: "apache", extensions: [ "rm" ] }, "application/vnd.rn-realmedia-vbr": { source: "apache", extensions: [ "rmvb" ] }, "application/vnd.route66.link66+xml": { source: "iana", compressible: !0, extensions: [ "link66" ] }, "application/vnd.rs-274x": { source: "iana" }, "application/vnd.ruckus.download": { source: "iana" }, "application/vnd.s3sms": { source: "iana" }, "application/vnd.sailingtracker.track": { source: "iana", extensions: [ "st" ] }, "application/vnd.sbm.cid": { source: "iana" }, "application/vnd.sbm.mid2": { source: "iana" }, "application/vnd.scribus": { source: "iana" }, "application/vnd.sealed.3df": { source: "iana" }, "application/vnd.sealed.csf": { source: "iana" }, "application/vnd.sealed.doc": { source: "iana" }, "application/vnd.sealed.eml": { source: "iana" }, "application/vnd.sealed.mht": { source: "iana" }, "application/vnd.sealed.net": { source: "iana" }, "application/vnd.sealed.ppt": { source: "iana" }, "application/vnd.sealed.tiff": { source: "iana" }, "application/vnd.sealed.xls": { source: "iana" }, "application/vnd.sealedmedia.softseal.html": { source: "iana" }, "application/vnd.sealedmedia.softseal.pdf": { source: "iana" }, "application/vnd.seemail": { source: "iana", extensions: [ "see" ] }, "application/vnd.sema": { source: "iana", extensions: [ "sema" ] }, "application/vnd.semd": { source: "iana", extensions: [ "semd" ] }, "application/vnd.semf": { source: "iana", extensions: [ "semf" ] }, "application/vnd.shana.informed.formdata": { source: "iana", extensions: [ "ifm" ] }, "application/vnd.shana.informed.formtemplate": { source: "iana", extensions: [ "itp" ] }, "application/vnd.shana.informed.interchange": { source: "iana", extensions: [ "iif" ] }, "application/vnd.shana.informed.package": { source: "iana", extensions: [ "ipk" ] }, "application/vnd.shootproof+json": { source: "iana", compressible: !0 }, "application/vnd.sigrok.session": { source: "iana" }, "application/vnd.simtech-mindmapper": { source: "iana", extensions: [ "twd", "twds" ] }, "application/vnd.siren+json": { source: "iana", compressible: !0 }, "application/vnd.smaf": { source: "iana", extensions: [ "mmf" ] }, "application/vnd.smart.notebook": { source: "iana" }, "application/vnd.smart.teacher": { source: "iana", extensions: [ "teacher" ] }, "application/vnd.software602.filler.form+xml": { source: "iana", compressible: !0 }, "application/vnd.software602.filler.form-xml-zip": { source: "iana" }, "application/vnd.solent.sdkm+xml": { source: "iana", compressible: !0, extensions: [ "sdkm", "sdkd" ] }, "application/vnd.spotfire.dxp": { source: "iana", extensions: [ "dxp" ] }, "application/vnd.spotfire.sfs": { source: "iana", extensions: [ "sfs" ] }, "application/vnd.sqlite3": { source: "iana" }, "application/vnd.sss-cod": { source: "iana" }, "application/vnd.sss-dtf": { source: "iana" }, "application/vnd.sss-ntf": { source: "iana" }, "application/vnd.stardivision.calc": { source: "apache", extensions: [ "sdc" ] }, "application/vnd.stardivision.draw": { source: "apache", extensions: [ "sda" ] }, "application/vnd.stardivision.impress": { source: "apache", extensions: [ "sdd" ] }, "application/vnd.stardivision.math": { source: "apache", extensions: [ "smf" ] }, "application/vnd.stardivision.writer": { source: "apache", extensions: [ "sdw", "vor" ] }, "application/vnd.stardivision.writer-global": { source: "apache", extensions: [ "sgl" ] }, "application/vnd.stepmania.package": { source: "iana", extensions: [ "smzip" ] }, "application/vnd.stepmania.stepchart": { source: "iana", extensions: [ "sm" ] }, "application/vnd.street-stream": { source: "iana" }, "application/vnd.sun.wadl+xml": { source: "iana", compressible: !0, extensions: [ "wadl" ] }, "application/vnd.sun.xml.calc": { source: "apache", extensions: [ "sxc" ] }, "application/vnd.sun.xml.calc.template": { source: "apache", extensions: [ "stc" ] }, "application/vnd.sun.xml.draw": { source: "apache", extensions: [ "sxd" ] }, "application/vnd.sun.xml.draw.template": { source: "apache", extensions: [ "std" ] }, "application/vnd.sun.xml.impress": { source: "apache", extensions: [ "sxi" ] }, "application/vnd.sun.xml.impress.template": { source: "apache", extensions: [ "sti" ] }, "application/vnd.sun.xml.math": { source: "apache", extensions: [ "sxm" ] }, "application/vnd.sun.xml.writer": { source: "apache", extensions: [ "sxw" ] }, "application/vnd.sun.xml.writer.global": { source: "apache", extensions: [ "sxg" ] }, "application/vnd.sun.xml.writer.template": { source: "apache", extensions: [ "stw" ] }, "application/vnd.sus-calendar": { source: "iana", extensions: [ "sus", "susp" ] }, "application/vnd.svd": { source: "iana", extensions: [ "svd" ] }, "application/vnd.swiftview-ics": { source: "iana" }, "application/vnd.symbian.install": { source: "apache", extensions: [ "sis", "sisx" ] }, "application/vnd.syncml+xml": { source: "iana", compressible: !0, extensions: [ "xsm" ] }, "application/vnd.syncml.dm+wbxml": { source: "iana", extensions: [ "bdm" ] }, "application/vnd.syncml.dm+xml": { source: "iana", compressible: !0, extensions: [ "xdm" ] }, "application/vnd.syncml.dm.notification": { source: "iana" }, "application/vnd.syncml.dmddf+wbxml": { source: "iana" }, "application/vnd.syncml.dmddf+xml": { source: "iana", compressible: !0 }, "application/vnd.syncml.dmtnds+wbxml": { source: "iana" }, "application/vnd.syncml.dmtnds+xml": { source: "iana", compressible: !0 }, "application/vnd.syncml.ds.notification": { source: "iana" }, "application/vnd.tableschema+json": { source: "iana", compressible: !0 }, "application/vnd.tao.intent-module-archive": { source: "iana", extensions: [ "tao" ] }, "application/vnd.tcpdump.pcap": { source: "iana", extensions: [ "pcap", "cap", "dmp" ] }, "application/vnd.think-cell.ppttc+json": { source: "iana", compressible: !0 }, "application/vnd.tmd.mediaflex.api+xml": { source: "iana", compressible: !0 }, "application/vnd.tml": { source: "iana" }, "application/vnd.tmobile-livetv": { source: "iana", extensions: [ "tmo" ] }, "application/vnd.tri.onesource": { source: "iana" }, "application/vnd.trid.tpt": { source: "iana", extensions: [ "tpt" ] }, "application/vnd.triscape.mxs": { source: "iana", extensions: [ "mxs" ] }, "application/vnd.trueapp": { source: "iana", extensions: [ "tra" ] }, "application/vnd.truedoc": { source: "iana" }, "application/vnd.ubisoft.webplayer": { source: "iana" }, "application/vnd.ufdl": { source: "iana", extensions: [ "ufd", "ufdl" ] }, "application/vnd.uiq.theme": { source: "iana", extensions: [ "utz" ] }, "application/vnd.umajin": { source: "iana", extensions: [ "umj" ] }, "application/vnd.unity": { source: "iana", extensions: [ "unityweb" ] }, "application/vnd.uoml+xml": { source: "iana", compressible: !0, extensions: [ "uoml" ] }, "application/vnd.uplanet.alert": { source: "iana" }, "application/vnd.uplanet.alert-wbxml": { source: "iana" }, "application/vnd.uplanet.bearer-choice": { source: "iana" }, "application/vnd.uplanet.bearer-choice-wbxml": { source: "iana" }, "application/vnd.uplanet.cacheop": { source: "iana" }, "application/vnd.uplanet.cacheop-wbxml": { source: "iana" }, "application/vnd.uplanet.channel": { source: "iana" }, "application/vnd.uplanet.channel-wbxml": { source: "iana" }, "application/vnd.uplanet.list": { source: "iana" }, "application/vnd.uplanet.list-wbxml": { source: "iana" }, "application/vnd.uplanet.listcmd": { source: "iana" }, "application/vnd.uplanet.listcmd-wbxml": { source: "iana" }, "application/vnd.uplanet.signal": { source: "iana" }, "application/vnd.uri-map": { source: "iana" }, "application/vnd.valve.source.material": { source: "iana" }, "application/vnd.vcx": { source: "iana", extensions: [ "vcx" ] }, "application/vnd.vd-study": { source: "iana" }, "application/vnd.vectorworks": { source: "iana" }, "application/vnd.vel+json": { source: "iana", compressible: !0 }, "application/vnd.verimatrix.vcas": { source: "iana" }, "application/vnd.veryant.thin": { source: "iana" }, "application/vnd.vidsoft.vidconference": { source: "iana" }, "application/vnd.visio": { source: "iana", extensions: [ "vsd", "vst", "vss", "vsw" ] }, "application/vnd.visionary": { source: "iana", extensions: [ "vis" ] }, "application/vnd.vividence.scriptfile": { source: "iana" }, "application/vnd.vsf": { source: "iana", extensions: [ "vsf" ] }, "application/vnd.wap.sic": { source: "iana" }, "application/vnd.wap.slc": { source: "iana" }, "application/vnd.wap.wbxml": { source: "iana", extensions: [ "wbxml" ] }, "application/vnd.wap.wmlc": { source: "iana", extensions: [ "wmlc" ] }, "application/vnd.wap.wmlscriptc": { source: "iana", extensions: [ "wmlsc" ] }, "application/vnd.webturbo": { source: "iana", extensions: [ "wtb" ] }, "application/vnd.wfa.p2p": { source: "iana" }, "application/vnd.wfa.wsc": { source: "iana" }, "application/vnd.windows.devicepairing": { source: "iana" }, "application/vnd.wmc": { source: "iana" }, "application/vnd.wmf.bootstrap": { source: "iana" }, "application/vnd.wolfram.mathematica": { source: "iana" }, "application/vnd.wolfram.mathematica.package": { source: "iana" }, "application/vnd.wolfram.player": { source: "iana", extensions: [ "nbp" ] }, "application/vnd.wordperfect": { source: "iana", extensions: [ "wpd" ] }, "application/vnd.wqd": { source: "iana", extensions: [ "wqd" ] }, "application/vnd.wrq-hp3000-labelled": { source: "iana" }, "application/vnd.wt.stf": { source: "iana", extensions: [ "stf" ] }, "application/vnd.wv.csp+wbxml": { source: "iana" }, "application/vnd.wv.csp+xml": { source: "iana", compressible: !0 }, "application/vnd.wv.ssp+xml": { source: "iana", compressible: !0 }, "application/vnd.xacml+json": { source: "iana", compressible: !0 }, "application/vnd.xara": { source: "iana", extensions: [ "xar" ] }, "application/vnd.xfdl": { source: "iana", extensions: [ "xfdl" ] }, "application/vnd.xfdl.webform": { source: "iana" }, "application/vnd.xmi+xml": { source: "iana", compressible: !0 }, "application/vnd.xmpie.cpkg": { source: "iana" }, "application/vnd.xmpie.dpkg": { source: "iana" }, "application/vnd.xmpie.plan": { source: "iana" }, "application/vnd.xmpie.ppkg": { source: "iana" }, "application/vnd.xmpie.xlim": { source: "iana" }, "application/vnd.yamaha.hv-dic": { source: "iana", extensions: [ "hvd" ] }, "application/vnd.yamaha.hv-script": { source: "iana", extensions: [ "hvs" ] }, "application/vnd.yamaha.hv-voice": { source: "iana", extensions: [ "hvp" ] }, "application/vnd.yamaha.openscoreformat": { source: "iana", extensions: [ "osf" ] }, "application/vnd.yamaha.openscoreformat.osfpvg+xml": { source: "iana", compressible: !0, extensions: [ "osfpvg" ] }, "application/vnd.yamaha.remote-setup": { source: "iana" }, "application/vnd.yamaha.smaf-audio": { source: "iana", extensions: [ "saf" ] }, "application/vnd.yamaha.smaf-phrase": { source: "iana", extensions: [ "spf" ] }, "application/vnd.yamaha.through-ngn": { source: "iana" }, "application/vnd.yamaha.tunnel-udpencap": { source: "iana" }, "application/vnd.yaoweme": { source: "iana" }, "application/vnd.yellowriver-custom-menu": { source: "iana", extensions: [ "cmp" ] }, "application/vnd.youtube.yt": { source: "iana" }, "application/vnd.zul": { source: "iana", extensions: [ "zir", "zirz" ] }, "application/vnd.zzazz.deck+xml": { source: "iana", compressible: !0, extensions: [ "zaz" ] }, "application/voicexml+xml": { source: "iana", compressible: !0, extensions: [ "vxml" ] }, "application/voucher-cms+json": { source: "iana", compressible: !0 }, "application/vq-rtcpxr": { source: "iana" }, "application/wasm": { compressible: !0, extensions: [ "wasm" ] }, "application/watcherinfo+xml": { source: "iana", compressible: !0 }, "application/webpush-options+json": { source: "iana", compressible: !0 }, "application/whoispp-query": { source: "iana" }, "application/whoispp-response": { source: "iana" }, "application/widget": { source: "iana", extensions: [ "wgt" ] }, "application/winhlp": { source: "apache", extensions: [ "hlp" ] }, "application/wita": { source: "iana" }, "application/wordperfect5.1": { source: "iana" }, "application/wsdl+xml": { source: "iana", compressible: !0, extensions: [ "wsdl" ] }, "application/wspolicy+xml": { source: "iana", compressible: !0, extensions: [ "wspolicy" ] }, "application/x-7z-compressed": { source: "apache", compressible: !1, extensions: [ "7z" ] }, "application/x-abiword": { source: "apache", extensions: [ "abw" ] }, "application/x-ace-compressed": { source: "apache", extensions: [ "ace" ] }, "application/x-amf": { source: "apache" }, "application/x-apple-diskimage": { source: "apache", extensions: [ "dmg" ] }, "application/x-arj": { compressible: !1, extensions: [ "arj" ] }, "application/x-authorware-bin": { source: "apache", extensions: [ "aab", "x32", "u32", "vox" ] }, "application/x-authorware-map": { source: "apache", extensions: [ "aam" ] }, "application/x-authorware-seg": { source: "apache", extensions: [ "aas" ] }, "application/x-bcpio": { source: "apache", extensions: [ "bcpio" ] }, "application/x-bdoc": { compressible: !1, extensions: [ "bdoc" ] }, "application/x-bittorrent": { source: "apache", extensions: [ "torrent" ] }, "application/x-blorb": { source: "apache", extensions: [ "blb", "blorb" ] }, "application/x-bzip": { source: "apache", compressible: !1, extensions: [ "bz" ] }, "application/x-bzip2": { source: "apache", compressible: !1, extensions: [ "bz2", "boz" ] }, "application/x-cbr": { source: "apache", extensions: [ "cbr", "cba", "cbt", "cbz", "cb7" ] }, "application/x-cdlink": { source: "apache", extensions: [ "vcd" ] }, "application/x-cfs-compressed": { source: "apache", extensions: [ "cfs" ] }, "application/x-chat": { source: "apache", extensions: [ "chat" ] }, "application/x-chess-pgn": { source: "apache", extensions: [ "pgn" ] }, "application/x-chrome-extension": { extensions: [ "crx" ] }, "application/x-cocoa": { source: "nginx", extensions: [ "cco" ] }, "application/x-compress": { source: "apache" }, "application/x-conference": { source: "apache", extensions: [ "nsc" ] }, "application/x-cpio": { source: "apache", extensions: [ "cpio" ] }, "application/x-csh": { source: "apache", extensions: [ "csh" ] }, "application/x-deb": { compressible: !1 }, "application/x-debian-package": { source: "apache", extensions: [ "deb", "udeb" ] }, "application/x-dgc-compressed": { source: "apache", extensions: [ "dgc" ] }, "application/x-director": { source: "apache", extensions: [ "dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa" ] }, "application/x-doom": { source: "apache", extensions: [ "wad" ] }, "application/x-dtbncx+xml": { source: "apache", compressible: !0, extensions: [ "ncx" ] }, "application/x-dtbook+xml": { source: "apache", compressible: !0, extensions: [ "dtb" ] }, "application/x-dtbresource+xml": { source: "apache", compressible: !0, extensions: [ "res" ] }, "application/x-dvi": { source: "apache", compressible: !1, extensions: [ "dvi" ] }, "application/x-envoy": { source: "apache", extensions: [ "evy" ] }, "application/x-eva": { source: "apache", extensions: [ "eva" ] }, "application/x-font-bdf": { source: "apache", extensions: [ "bdf" ] }, "application/x-font-dos": { source: "apache" }, "application/x-font-framemaker": { source: "apache" }, "application/x-font-ghostscript": { source: "apache", extensions: [ "gsf" ] }, "application/x-font-libgrx": { source: "apache" }, "application/x-font-linux-psf": { source: "apache", extensions: [ "psf" ] }, "application/x-font-pcf": { source: "apache", extensions: [ "pcf" ] }, "application/x-font-snf": { source: "apache", extensions: [ "snf" ] }, "application/x-font-speedo": { source: "apache" }, "application/x-font-sunos-news": { source: "apache" }, "application/x-font-type1": { source: "apache", extensions: [ "pfa", "pfb", "pfm", "afm" ] }, "application/x-font-vfont": { source: "apache" }, "application/x-freearc": { source: "apache", extensions: [ "arc" ] }, "application/x-futuresplash": { source: "apache", extensions: [ "spl" ] }, "application/x-gca-compressed": { source: "apache", extensions: [ "gca" ] }, "application/x-glulx": { source: "apache", extensions: [ "ulx" ] }, "application/x-gnumeric": { source: "apache", extensions: [ "gnumeric" ] }, "application/x-gramps-xml": { source: "apache", extensions: [ "gramps" ] }, "application/x-gtar": { source: "apache", extensions: [ "gtar" ] }, "application/x-gzip": { source: "apache" }, "application/x-hdf": { source: "apache", extensions: [ "hdf" ] }, "application/x-httpd-php": { compressible: !0, extensions: [ "php" ] }, "application/x-install-instructions": { source: "apache", extensions: [ "install" ] }, "application/x-iso9660-image": { source: "apache", extensions: [ "iso" ] }, "application/x-java-archive-diff": { source: "nginx", extensions: [ "jardiff" ] }, "application/x-java-jnlp-file": { source: "apache", compressible: !1, extensions: [ "jnlp" ] }, "application/x-javascript": { compressible: !0 }, "application/x-latex": { source: "apache", compressible: !1, extensions: [ "latex" ] }, "application/x-lua-bytecode": { extensions: [ "luac" ] }, "application/x-lzh-compressed": { source: "apache", extensions: [ "lzh", "lha" ] }, "application/x-makeself": { source: "nginx", extensions: [ "run" ] }, "application/x-mie": { source: "apache", extensions: [ "mie" ] }, "application/x-mobipocket-ebook": { source: "apache", extensions: [ "prc", "mobi" ] }, "application/x-mpegurl": { compressible: !1 }, "application/x-ms-application": { source: "apache", extensions: [ "application" ] }, "application/x-ms-shortcut": { source: "apache", extensions: [ "lnk" ] }, "application/x-ms-wmd": { source: "apache", extensions: [ "wmd" ] }, "application/x-ms-wmz": { source: "apache", extensions: [ "wmz" ] }, "application/x-ms-xbap": { source: "apache", extensions: [ "xbap" ] }, "application/x-msaccess": { source: "apache", extensions: [ "mdb" ] }, "application/x-msbinder": { source: "apache", extensions: [ "obd" ] }, "application/x-mscardfile": { source: "apache", extensions: [ "crd" ] }, "application/x-msclip": { source: "apache", extensions: [ "clp" ] }, "application/x-msdos-program": { extensions: [ "exe" ] }, "application/x-msdownload": { source: "apache", extensions: [ "exe", "dll", "com", "bat", "msi" ] }, "application/x-msmediaview": { source: "apache", extensions: [ "mvb", "m13", "m14" ] }, "application/x-msmetafile": { source: "apache", extensions: [ "wmf", "wmz", "emf", "emz" ] }, "application/x-msmoney": { source: "apache", extensions: [ "mny" ] }, "application/x-mspublisher": { source: "apache", extensions: [ "pub" ] }, "application/x-msschedule": { source: "apache", extensions: [ "scd" ] }, "application/x-msterminal": { source: "apache", extensions: [ "trm" ] }, "application/x-mswrite": { source: "apache", extensions: [ "wri" ] }, "application/x-netcdf": { source: "apache", extensions: [ "nc", "cdf" ] }, "application/x-ns-proxy-autoconfig": { compressible: !0, extensions: [ "pac" ] }, "application/x-nzb": { source: "apache", extensions: [ "nzb" ] }, "application/x-perl": { source: "nginx", extensions: [ "pl", "pm" ] }, "application/x-pilot": { source: "nginx", extensions: [ "prc", "pdb" ] }, "application/x-pkcs12": { source: "apache", compressible: !1, extensions: [ "p12", "pfx" ] }, "application/x-pkcs7-certificates": { source: "apache", extensions: [ "p7b", "spc" ] }, "application/x-pkcs7-certreqresp": { source: "apache", extensions: [ "p7r" ] }, "application/x-rar-compressed": { source: "apache", compressible: !1, extensions: [ "rar" ] }, "application/x-redhat-package-manager": { source: "nginx", extensions: [ "rpm" ] }, "application/x-research-info-systems": { source: "apache", extensions: [ "ris" ] }, "application/x-sea": { source: "nginx", extensions: [ "sea" ] }, "application/x-sh": { source: "apache", compressible: !0, extensions: [ "sh" ] }, "application/x-shar": { source: "apache", extensions: [ "shar" ] }, "application/x-shockwave-flash": { source: "apache", compressible: !1, extensions: [ "swf" ] }, "application/x-silverlight-app": { source: "apache", extensions: [ "xap" ] }, "application/x-sql": { source: "apache", extensions: [ "sql" ] }, "application/x-stuffit": { source: "apache", compressible: !1, extensions: [ "sit" ] }, "application/x-stuffitx": { source: "apache", extensions: [ "sitx" ] }, "application/x-subrip": { source: "apache", extensions: [ "srt" ] }, "application/x-sv4cpio": { source: "apache", extensions: [ "sv4cpio" ] }, "application/x-sv4crc": { source: "apache", extensions: [ "sv4crc" ] }, "application/x-t3vm-image": { source: "apache", extensions: [ "t3" ] }, "application/x-tads": { source: "apache", extensions: [ "gam" ] }, "application/x-tar": { source: "apache", compressible: !0, extensions: [ "tar" ] }, "application/x-tcl": { source: "apache", extensions: [ "tcl", "tk" ] }, "application/x-tex": { source: "apache", extensions: [ "tex" ] }, "application/x-tex-tfm": { source: "apache", extensions: [ "tfm" ] }, "application/x-texinfo": { source: "apache", extensions: [ "texinfo", "texi" ] }, "application/x-tgif": { source: "apache", extensions: [ "obj" ] }, "application/x-ustar": { source: "apache", extensions: [ "ustar" ] }, "application/x-virtualbox-hdd": { compressible: !0, extensions: [ "hdd" ] }, "application/x-virtualbox-ova": { compressible: !0, extensions: [ "ova" ] }, "application/x-virtualbox-ovf": { compressible: !0, extensions: [ "ovf" ] }, "application/x-virtualbox-vbox": { compressible: !0, extensions: [ "vbox" ] }, "application/x-virtualbox-vbox-extpack": { compressible: !1, extensions: [ "vbox-extpack" ] }, "application/x-virtualbox-vdi": { compressible: !0, extensions: [ "vdi" ] }, "application/x-virtualbox-vhd": { compressible: !0, extensions: [ "vhd" ] }, "application/x-virtualbox-vmdk": { compressible: !0, extensions: [ "vmdk" ] }, "application/x-wais-source": { source: "apache", extensions: [ "src" ] }, "application/x-web-app-manifest+json": { compressible: !0, extensions: [ "webapp" ] }, "application/x-www-form-urlencoded": { source: "iana", compressible: !0 }, "application/x-x509-ca-cert": { source: "apache", extensions: [ "der", "crt", "pem" ] }, "application/x-xfig": { source: "apache", extensions: [ "fig" ] }, "application/x-xliff+xml": { source: "apache", compressible: !0, extensions: [ "xlf" ] }, "application/x-xpinstall": { source: "apache", compressible: !1, extensions: [ "xpi" ] }, "application/x-xz": { source: "apache", extensions: [ "xz" ] }, "application/x-zmachine": { source: "apache", extensions: [ "z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8" ] }, "application/x400-bp": { source: "iana" }, "application/xacml+xml": { source: "iana", compressible: !0 }, "application/xaml+xml": { source: "apache", compressible: !0, extensions: [ "xaml" ] }, "application/xcap-att+xml": { source: "iana", compressible: !0 }, "application/xcap-caps+xml": { source: "iana", compressible: !0 }, "application/xcap-diff+xml": { source: "iana", compressible: !0, extensions: [ "xdf" ] }, "application/xcap-el+xml": { source: "iana", compressible: !0 }, "application/xcap-error+xml": { source: "iana", compressible: !0 }, "application/xcap-ns+xml": { source: "iana", compressible: !0 }, "application/xcon-conference-info+xml": { source: "iana", compressible: !0 }, "application/xcon-conference-info-diff+xml": { source: "iana", compressible: !0 }, "application/xenc+xml": { source: "iana", compressible: !0, extensions: [ "xenc" ] }, "application/xhtml+xml": { source: "iana", compressible: !0, extensions: [ "xhtml", "xht" ] }, "application/xhtml-voice+xml": { source: "apache", compressible: !0 }, "application/xliff+xml": { source: "iana", compressible: !0 }, "application/xml": { source: "iana", compressible: !0, extensions: [ "xml", "xsl", "xsd", "rng" ] }, "application/xml-dtd": { source: "iana", compressible: !0, extensions: [ "dtd" ] }, "application/xml-external-parsed-entity": { source: "iana" }, "application/xml-patch+xml": { source: "iana", compressible: !0 }, "application/xmpp+xml": { source: "iana", compressible: !0 }, "application/xop+xml": { source: "iana", compressible: !0, extensions: [ "xop" ] }, "application/xproc+xml": { source: "apache", compressible: !0, extensions: [ "xpl" ] }, "application/xslt+xml": { source: "iana", compressible: !0, extensions: [ "xslt" ] }, "application/xspf+xml": { source: "apache", compressible: !0, extensions: [ "xspf" ] }, "application/xv+xml": { source: "iana", compressible: !0, extensions: [ "mxml", "xhvml", "xvml", "xvm" ] }, "application/yang": { source: "iana", extensions: [ "yang" ] }, "application/yang-data+json": { source: "iana", compressible: !0 }, "application/yang-data+xml": { source: "iana", compressible: !0 }, "application/yang-patch+json": { source: "iana", compressible: !0 }, "application/yang-patch+xml": { source: "iana", compressible: !0 }, "application/yin+xml": { source: "iana", compressible: !0, extensions: [ "yin" ] }, "application/zip": { source: "iana", compressible: !1, extensions: [ "zip" ] }, "application/zlib": { source: "iana" }, "application/zstd": { source: "iana" }, "audio/1d-interleaved-parityfec": { source: "iana" }, "audio/32kadpcm": { source: "iana" }, "audio/3gpp": { source: "iana", compressible: !1, extensions: [ "3gpp" ] }, "audio/3gpp2": { source: "iana" }, "audio/aac": { source: "iana" }, "audio/ac3": { source: "iana" }, "audio/adpcm": { source: "apache", extensions: [ "adp" ] }, "audio/amr": { source: "iana" }, "audio/amr-wb": { source: "iana" }, "audio/amr-wb+": { source: "iana" }, "audio/aptx": { source: "iana" }, "audio/asc": { source: "iana" }, "audio/atrac-advanced-lossless": { source: "iana" }, "audio/atrac-x": { source: "iana" }, "audio/atrac3": { source: "iana" }, "audio/basic": { source: "iana", compressible: !1, extensions: [ "au", "snd" ] }, "audio/bv16": { source: "iana" }, "audio/bv32": { source: "iana" }, "audio/clearmode": { source: "iana" }, "audio/cn": { source: "iana" }, "audio/dat12": { source: "iana" }, "audio/dls": { source: "iana" }, "audio/dsr-es201108": { source: "iana" }, "audio/dsr-es202050": { source: "iana" }, "audio/dsr-es202211": { source: "iana" }, "audio/dsr-es202212": { source: "iana" }, "audio/dv": { source: "iana" }, "audio/dvi4": { source: "iana" }, "audio/eac3": { source: "iana" }, "audio/encaprtp": { source: "iana" }, "audio/evrc": { source: "iana" }, "audio/evrc-qcp": { source: "iana" }, "audio/evrc0": { source: "iana" }, "audio/evrc1": { source: "iana" }, "audio/evrcb": { source: "iana" }, "audio/evrcb0": { source: "iana" }, "audio/evrcb1": { source: "iana" }, "audio/evrcnw": { source: "iana" }, "audio/evrcnw0": { source: "iana" }, "audio/evrcnw1": { source: "iana" }, "audio/evrcwb": { source: "iana" }, "audio/evrcwb0": { source: "iana" }, "audio/evrcwb1": { source: "iana" }, "audio/evs": { source: "iana" }, "audio/fwdred": { source: "iana" }, "audio/g711-0": { source: "iana" }, "audio/g719": { source: "iana" }, "audio/g722": { source: "iana" }, "audio/g7221": { source: "iana" }, "audio/g723": { source: "iana" }, "audio/g726-16": { source: "iana" }, "audio/g726-24": { source: "iana" }, "audio/g726-32": { source: "iana" }, "audio/g726-40": { source: "iana" }, "audio/g728": { source: "iana" }, "audio/g729": { source: "iana" }, "audio/g7291": { source: "iana" }, "audio/g729d": { source: "iana" }, "audio/g729e": { source: "iana" }, "audio/gsm": { source: "iana" }, "audio/gsm-efr": { source: "iana" }, "audio/gsm-hr-08": { source: "iana" }, "audio/ilbc": { source: "iana" }, "audio/ip-mr_v2.5": { source: "iana" }, "audio/isac": { source: "apache" }, "audio/l16": { source: "iana" }, "audio/l20": { source: "iana" }, "audio/l24": { source: "iana", compressible: !1 }, "audio/l8": { source: "iana" }, "audio/lpc": { source: "iana" }, "audio/melp": { source: "iana" }, "audio/melp1200": { source: "iana" }, "audio/melp2400": { source: "iana" }, "audio/melp600": { source: "iana" }, "audio/midi": { source: "apache", extensions: [ "mid", "midi", "kar", "rmi" ] }, "audio/mobile-xmf": { source: "iana" }, "audio/mp3": { compressible: !1, extensions: [ "mp3" ] }, "audio/mp4": { source: "iana", compressible: !1, extensions: [ "m4a", "mp4a" ] }, "audio/mp4a-latm": { source: "iana" }, "audio/mpa": { source: "iana" }, "audio/mpa-robust": { source: "iana" }, "audio/mpeg": { source: "iana", compressible: !1, extensions: [ "mpga", "mp2", "mp2a", "mp3", "m2a", "m3a" ] }, "audio/mpeg4-generic": { source: "iana" }, "audio/musepack": { source: "apache" }, "audio/ogg": { source: "iana", compressible: !1, extensions: [ "oga", "ogg", "spx" ] }, "audio/opus": { source: "iana" }, "audio/parityfec": { source: "iana" }, "audio/pcma": { source: "iana" }, "audio/pcma-wb": { source: "iana" }, "audio/pcmu": { source: "iana" }, "audio/pcmu-wb": { source: "iana" }, "audio/prs.sid": { source: "iana" }, "audio/qcelp": { source: "iana" }, "audio/raptorfec": { source: "iana" }, "audio/red": { source: "iana" }, "audio/rtp-enc-aescm128": { source: "iana" }, "audio/rtp-midi": { source: "iana" }, "audio/rtploopback": { source: "iana" }, "audio/rtx": { source: "iana" }, "audio/s3m": { source: "apache", extensions: [ "s3m" ] }, "audio/silk": { source: "apache", extensions: [ "sil" ] }, "audio/smv": { source: "iana" }, "audio/smv-qcp": { source: "iana" }, "audio/smv0": { source: "iana" }, "audio/sp-midi": { source: "iana" }, "audio/speex": { source: "iana" }, "audio/t140c": { source: "iana" }, "audio/t38": { source: "iana" }, "audio/telephone-event": { source: "iana" }, "audio/tetra_acelp": { source: "iana" }, "audio/tone": { source: "iana" }, "audio/uemclip": { source: "iana" }, "audio/ulpfec": { source: "iana" }, "audio/usac": { source: "iana" }, "audio/vdvi": { source: "iana" }, "audio/vmr-wb": { source: "iana" }, "audio/vnd.3gpp.iufp": { source: "iana" }, "audio/vnd.4sb": { source: "iana" }, "audio/vnd.audiokoz": { source: "iana" }, "audio/vnd.celp": { source: "iana" }, "audio/vnd.cisco.nse": { source: "iana" }, "audio/vnd.cmles.radio-events": { source: "iana" }, "audio/vnd.cns.anp1": { source: "iana" }, "audio/vnd.cns.inf1": { source: "iana" }, "audio/vnd.dece.audio": { source: "iana", extensions: [ "uva", "uvva" ] }, "audio/vnd.digital-winds": { source: "iana", extensions: [ "eol" ] }, "audio/vnd.dlna.adts": { source: "iana" }, "audio/vnd.dolby.heaac.1": { source: "iana" }, "audio/vnd.dolby.heaac.2": { source: "iana" }, "audio/vnd.dolby.mlp": { source: "iana" }, "audio/vnd.dolby.mps": { source: "iana" }, "audio/vnd.dolby.pl2": { source: "iana" }, "audio/vnd.dolby.pl2x": { source: "iana" }, "audio/vnd.dolby.pl2z": { source: "iana" }, "audio/vnd.dolby.pulse.1": { source: "iana" }, "audio/vnd.dra": { source: "iana", extensions: [ "dra" ] }, "audio/vnd.dts": { source: "iana", extensions: [ "dts" ] }, "audio/vnd.dts.hd": { source: "iana", extensions: [ "dtshd" ] }, "audio/vnd.dts.uhd": { source: "iana" }, "audio/vnd.dvb.file": { source: "iana" }, "audio/vnd.everad.plj": { source: "iana" }, "audio/vnd.hns.audio": { source: "iana" }, "audio/vnd.lucent.voice": { source: "iana", extensions: [ "lvp" ] }, "audio/vnd.ms-playready.media.pya": { source: "iana", extensions: [ "pya" ] }, "audio/vnd.nokia.mobile-xmf": { source: "iana" }, "audio/vnd.nortel.vbk": { source: "iana" }, "audio/vnd.nuera.ecelp4800": { source: "iana", extensions: [ "ecelp4800" ] }, "audio/vnd.nuera.ecelp7470": { source: "iana", extensions: [ "ecelp7470" ] }, "audio/vnd.nuera.ecelp9600": { source: "iana", extensions: [ "ecelp9600" ] }, "audio/vnd.octel.sbc": { source: "iana" }, "audio/vnd.presonus.multitrack": { source: "iana" }, "audio/vnd.qcelp": { source: "iana" }, "audio/vnd.rhetorex.32kadpcm": { source: "iana" }, "audio/vnd.rip": { source: "iana", extensions: [ "rip" ] }, "audio/vnd.rn-realaudio": { compressible: !1 }, "audio/vnd.sealedmedia.softseal.mpeg": { source: "iana" }, "audio/vnd.vmx.cvsd": { source: "iana" }, "audio/vnd.wave": { compressible: !1 }, "audio/vorbis": { source: "iana", compressible: !1 }, "audio/vorbis-config": { source: "iana" }, "audio/wav": { compressible: !1, extensions: [ "wav" ] }, "audio/wave": { compressible: !1, extensions: [ "wav" ] }, "audio/webm": { source: "apache", compressible: !1, extensions: [ "weba" ] }, "audio/x-aac": { source: "apache", compressible: !1, extensions: [ "aac" ] }, "audio/x-aiff": { source: "apache", extensions: [ "aif", "aiff", "aifc" ] }, "audio/x-caf": { source: "apache", compressible: !1, extensions: [ "caf" ] }, "audio/x-flac": { source: "apache", extensions: [ "flac" ] }, "audio/x-m4a": { source: "nginx", extensions: [ "m4a" ] }, "audio/x-matroska": { source: "apache", extensions: [ "mka" ] }, "audio/x-mpegurl": { source: "apache", extensions: [ "m3u" ] }, "audio/x-ms-wax": { source: "apache", extensions: [ "wax" ] }, "audio/x-ms-wma": { source: "apache", extensions: [ "wma" ] }, "audio/x-pn-realaudio": { source: "apache", extensions: [ "ram", "ra" ] }, "audio/x-pn-realaudio-plugin": { source: "apache", extensions: [ "rmp" ] }, "audio/x-realaudio": { source: "nginx", extensions: [ "ra" ] }, "audio/x-tta": { source: "apache" }, "audio/x-wav": { source: "apache", extensions: [ "wav" ] }, "audio/xm": { source: "apache", extensions: [ "xm" ] }, "chemical/x-cdx": { source: "apache", extensions: [ "cdx" ] }, "chemical/x-cif": { source: "apache", extensions: [ "cif" ] }, "chemical/x-cmdf": { source: "apache", extensions: [ "cmdf" ] }, "chemical/x-cml": { source: "apache", extensions: [ "cml" ] }, "chemical/x-csml": { source: "apache", extensions: [ "csml" ] }, "chemical/x-pdb": { source: "apache" }, "chemical/x-xyz": { source: "apache", extensions: [ "xyz" ] }, "font/collection": { source: "iana", extensions: [ "ttc" ] }, "font/otf": { source: "iana", compressible: !0, extensions: [ "otf" ] }, "font/sfnt": { source: "iana" }, "font/ttf": { source: "iana", extensions: [ "ttf" ] }, "font/woff": { source: "iana", extensions: [ "woff" ] }, "font/woff2": { source: "iana", extensions: [ "woff2" ] }, "image/aces": { source: "iana", extensions: [ "exr" ] }, "image/apng": { compressible: !1, extensions: [ "apng" ] }, "image/avci": { source: "iana" }, "image/avcs": { source: "iana" }, "image/bmp": { source: "iana", compressible: !0, extensions: [ "bmp" ] }, "image/cgm": { source: "iana", extensions: [ "cgm" ] }, "image/dicom-rle": { source: "iana", extensions: [ "drle" ] }, "image/emf": { source: "iana", extensions: [ "emf" ] }, "image/fits": { source: "iana", extensions: [ "fits" ] }, "image/g3fax": { source: "iana", extensions: [ "g3" ] }, "image/gif": { source: "iana", compressible: !1, extensions: [ "gif" ] }, "image/heic": { source: "iana", extensions: [ "heic" ] }, "image/heic-sequence": { source: "iana", extensions: [ "heics" ] }, "image/heif": { source: "iana", extensions: [ "heif" ] }, "image/heif-sequence": { source: "iana", extensions: [ "heifs" ] }, "image/ief": { source: "iana", extensions: [ "ief" ] }, "image/jls": { source: "iana", extensions: [ "jls" ] }, "image/jp2": { source: "iana", compressible: !1, extensions: [ "jp2", "jpg2" ] }, "image/jpeg": { source: "iana", compressible: !1, extensions: [ "jpeg", "jpg", "jpe" ] }, "image/jpm": { source: "iana", compressible: !1, extensions: [ "jpm" ] }, "image/jpx": { source: "iana", compressible: !1, extensions: [ "jpx", "jpf" ] }, "image/jxr": { source: "iana", extensions: [ "jxr" ] }, "image/ktx": { source: "iana", extensions: [ "ktx" ] }, "image/naplps": { source: "iana" }, "image/pjpeg": { compressible: !1 }, "image/png": { source: "iana", compressible: !1, extensions: [ "png" ] }, "image/prs.btif": { source: "iana", extensions: [ "btif" ] }, "image/prs.pti": { source: "iana", extensions: [ "pti" ] }, "image/pwg-raster": { source: "iana" }, "image/sgi": { source: "apache", extensions: [ "sgi" ] }, "image/svg+xml": { source: "iana", compressible: !0, extensions: [ "svg", "svgz" ] }, "image/t38": { source: "iana", extensions: [ "t38" ] }, "image/tiff": { source: "iana", compressible: !1, extensions: [ "tif", "tiff" ] }, "image/tiff-fx": { source: "iana", extensions: [ "tfx" ] }, "image/vnd.adobe.photoshop": { source: "iana", compressible: !0, extensions: [ "psd" ] }, "image/vnd.airzip.accelerator.azv": { source: "iana", extensions: [ "azv" ] }, "image/vnd.cns.inf2": { source: "iana" }, "image/vnd.dece.graphic": { source: "iana", extensions: [ "uvi", "uvvi", "uvg", "uvvg" ] }, "image/vnd.djvu": { source: "iana", extensions: [ "djvu", "djv" ] }, "image/vnd.dvb.subtitle": { source: "iana", extensions: [ "sub" ] }, "image/vnd.dwg": { source: "iana", extensions: [ "dwg" ] }, "image/vnd.dxf": { source: "iana", extensions: [ "dxf" ] }, "image/vnd.fastbidsheet": { source: "iana", extensions: [ "fbs" ] }, "image/vnd.fpx": { source: "iana", extensions: [ "fpx" ] }, "image/vnd.fst": { source: "iana", extensions: [ "fst" ] }, "image/vnd.fujixerox.edmics-mmr": { source: "iana", extensions: [ "mmr" ] }, "image/vnd.fujixerox.edmics-rlc": { source: "iana", extensions: [ "rlc" ] }, "image/vnd.globalgraphics.pgb": { source: "iana" }, "image/vnd.microsoft.icon": { source: "iana", extensions: [ "ico" ] }, "image/vnd.mix": { source: "iana" }, "image/vnd.mozilla.apng": { source: "iana" }, "image/vnd.ms-modi": { source: "iana", extensions: [ "mdi" ] }, "image/vnd.ms-photo": { source: "apache", extensions: [ "wdp" ] }, "image/vnd.net-fpx": { source: "iana", extensions: [ "npx" ] }, "image/vnd.radiance": { source: "iana" }, "image/vnd.sealed.png": { source: "iana" }, "image/vnd.sealedmedia.softseal.gif": { source: "iana" }, "image/vnd.sealedmedia.softseal.jpg": { source: "iana" }, "image/vnd.svf": { source: "iana" }, "image/vnd.tencent.tap": { source: "iana", extensions: [ "tap" ] }, "image/vnd.valve.source.texture": { source: "iana", extensions: [ "vtf" ] }, "image/vnd.wap.wbmp": { source: "iana", extensions: [ "wbmp" ] }, "image/vnd.xiff": { source: "iana", extensions: [ "xif" ] }, "image/vnd.zbrush.pcx": { source: "iana", extensions: [ "pcx" ] }, "image/webp": { source: "apache", extensions: [ "webp" ] }, "image/wmf": { source: "iana", extensions: [ "wmf" ] }, "image/x-3ds": { source: "apache", extensions: [ "3ds" ] }, "image/x-cmu-raster": { source: "apache", extensions: [ "ras" ] }, "image/x-cmx": { source: "apache", extensions: [ "cmx" ] }, "image/x-freehand": { source: "apache", extensions: [ "fh", "fhc", "fh4", "fh5", "fh7" ] }, "image/x-icon": { source: "apache", compressible: !0, extensions: [ "ico" ] }, "image/x-jng": { source: "nginx", extensions: [ "jng" ] }, "image/x-mrsid-image": { source: "apache", extensions: [ "sid" ] }, "image/x-ms-bmp": { source: "nginx", compressible: !0, extensions: [ "bmp" ] }, "image/x-pcx": { source: "apache", extensions: [ "pcx" ] }, "image/x-pict": { source: "apache", extensions: [ "pic", "pct" ] }, "image/x-portable-anymap": { source: "apache", extensions: [ "pnm" ] }, "image/x-portable-bitmap": { source: "apache", extensions: [ "pbm" ] }, "image/x-portable-graymap": { source: "apache", extensions: [ "pgm" ] }, "image/x-portable-pixmap": { source: "apache", extensions: [ "ppm" ] }, "image/x-rgb": { source: "apache", extensions: [ "rgb" ] }, "image/x-tga": { source: "apache", extensions: [ "tga" ] }, "image/x-xbitmap": { source: "apache", extensions: [ "xbm" ] }, "image/x-xcf": { compressible: !1 }, "image/x-xpixmap": { source: "apache", extensions: [ "xpm" ] }, "image/x-xwindowdump": { source: "apache", extensions: [ "xwd" ] }, "message/cpim": { source: "iana" }, "message/delivery-status": { source: "iana" }, "message/disposition-notification": { source: "iana", extensions: [ "disposition-notification" ] }, "message/external-body": { source: "iana" }, "message/feedback-report": { source: "iana" }, "message/global": { source: "iana", extensions: [ "u8msg" ] }, "message/global-delivery-status": { source: "iana", extensions: [ "u8dsn" ] }, "message/global-disposition-notification": { source: "iana", extensions: [ "u8mdn" ] }, "message/global-headers": { source: "iana", extensions: [ "u8hdr" ] }, "message/http": { source: "iana", compressible: !1 }, "message/imdn+xml": { source: "iana", compressible: !0 }, "message/news": { source: "iana" }, "message/partial": { source: "iana", compressible: !1 }, "message/rfc822": { source: "iana", compressible: !0, extensions: [ "eml", "mime" ] }, "message/s-http": { source: "iana" }, "message/sip": { source: "iana" }, "message/sipfrag": { source: "iana" }, "message/tracking-status": { source: "iana" }, "message/vnd.si.simp": { source: "iana" }, "message/vnd.wfa.wsc": { source: "iana", extensions: [ "wsc" ] }, "model/3mf": { source: "iana", extensions: [ "3mf" ] }, "model/gltf+json": { source: "iana", compressible: !0, extensions: [ "gltf" ] }, "model/gltf-binary": { source: "iana", compressible: !0, extensions: [ "glb" ] }, "model/iges": { source: "iana", compressible: !1, extensions: [ "igs", "iges" ] }, "model/mesh": { source: "iana", compressible: !1, extensions: [ "msh", "mesh", "silo" ] }, "model/stl": { source: "iana", extensions: [ "stl" ] }, "model/vnd.collada+xml": { source: "iana", compressible: !0, extensions: [ "dae" ] }, "model/vnd.dwf": { source: "iana", extensions: [ "dwf" ] }, "model/vnd.flatland.3dml": { source: "iana" }, "model/vnd.gdl": { source: "iana", extensions: [ "gdl" ] }, "model/vnd.gs-gdl": { source: "apache" }, "model/vnd.gs.gdl": { source: "iana" }, "model/vnd.gtw": { source: "iana", extensions: [ "gtw" ] }, "model/vnd.moml+xml": { source: "iana", compressible: !0 }, "model/vnd.mts": { source: "iana", extensions: [ "mts" ] }, "model/vnd.opengex": { source: "iana", extensions: [ "ogex" ] }, "model/vnd.parasolid.transmit.binary": { source: "iana", extensions: [ "x_b" ] }, "model/vnd.parasolid.transmit.text": { source: "iana", extensions: [ "x_t" ] }, "model/vnd.rosette.annotated-data-model": { source: "iana" }, "model/vnd.usdz+zip": { source: "iana", compressible: !1, extensions: [ "usdz" ] }, "model/vnd.valve.source.compiled-map": { source: "iana", extensions: [ "bsp" ] }, "model/vnd.vtu": { source: "iana", extensions: [ "vtu" ] }, "model/vrml": { source: "iana", compressible: !1, extensions: [ "wrl", "vrml" ] }, "model/x3d+binary": { source: "apache", compressible: !1, extensions: [ "x3db", "x3dbz" ] }, "model/x3d+fastinfoset": { source: "iana", extensions: [ "x3db" ] }, "model/x3d+vrml": { source: "apache", compressible: !1, extensions: [ "x3dv", "x3dvz" ] }, "model/x3d+xml": { source: "iana", compressible: !0, extensions: [ "x3d", "x3dz" ] }, "model/x3d-vrml": { source: "iana", extensions: [ "x3dv" ] }, "multipart/alternative": { source: "iana", compressible: !1 }, "multipart/appledouble": { source: "iana" }, "multipart/byteranges": { source: "iana" }, "multipart/digest": { source: "iana" }, "multipart/encrypted": { source: "iana", compressible: !1 }, "multipart/form-data": { source: "iana", compressible: !1 }, "multipart/header-set": { source: "iana" }, "multipart/mixed": { source: "iana", compressible: !1 }, "multipart/multilingual": { source: "iana" }, "multipart/parallel": { source: "iana" }, "multipart/related": { source: "iana", compressible: !1 }, "multipart/report": { source: "iana" }, "multipart/signed": { source: "iana", compressible: !1 }, "multipart/vnd.bint.med-plus": { source: "iana" }, "multipart/voice-message": { source: "iana" }, "multipart/x-mixed-replace": { source: "iana" }, "text/1d-interleaved-parityfec": { source: "iana" }, "text/cache-manifest": { source: "iana", compressible: !0, extensions: [ "appcache", "manifest" ] }, "text/calendar": { source: "iana", extensions: [ "ics", "ifb" ] }, "text/calender": { compressible: !0 }, "text/cmd": { compressible: !0 }, "text/coffeescript": { extensions: [ "coffee", "litcoffee" ] }, "text/css": { source: "iana", charset: "UTF-8", compressible: !0, extensions: [ "css" ] }, "text/csv": { source: "iana", compressible: !0, extensions: [ "csv" ] }, "text/csv-schema": { source: "iana" }, "text/directory": { source: "iana" }, "text/dns": { source: "iana" }, "text/ecmascript": { source: "iana" }, "text/encaprtp": { source: "iana" }, "text/enriched": { source: "iana" }, "text/fwdred": { source: "iana" }, "text/grammar-ref-list": { source: "iana" }, "text/html": { source: "iana", compressible: !0, extensions: [ "html", "htm", "shtml" ] }, "text/jade": { extensions: [ "jade" ] }, "text/javascript": { source: "iana", compressible: !0 }, "text/jcr-cnd": { source: "iana" }, "text/jsx": { compressible: !0, extensions: [ "jsx" ] }, "text/less": { compressible: !0, extensions: [ "less" ] }, "text/markdown": { source: "iana", compressible: !0, extensions: [ "markdown", "md" ] }, "text/mathml": { source: "nginx", extensions: [ "mml" ] }, "text/mdx": { compressible: !0, extensions: [ "mdx" ] }, "text/mizar": { source: "iana" }, "text/n3": { source: "iana", compressible: !0, extensions: [ "n3" ] }, "text/parameters": { source: "iana" }, "text/parityfec": { source: "iana" }, "text/plain": { source: "iana", compressible: !0, extensions: [ "txt", "text", "conf", "def", "list", "log", "in", "ini" ] }, "text/provenance-notation": { source: "iana" }, "text/prs.fallenstein.rst": { source: "iana" }, "text/prs.lines.tag": { source: "iana", extensions: [ "dsc" ] }, "text/prs.prop.logic": { source: "iana" }, "text/raptorfec": { source: "iana" }, "text/red": { source: "iana" }, "text/rfc822-headers": { source: "iana" }, "text/richtext": { source: "iana", compressible: !0, extensions: [ "rtx" ] }, "text/rtf": { source: "iana", compressible: !0, extensions: [ "rtf" ] }, "text/rtp-enc-aescm128": { source: "iana" }, "text/rtploopback": { source: "iana" }, "text/rtx": { source: "iana" }, "text/sgml": { source: "iana", extensions: [ "sgml", "sgm" ] }, "text/shex": { extensions: [ "shex" ] }, "text/slim": { extensions: [ "slim", "slm" ] }, "text/strings": { source: "iana" }, "text/stylus": { extensions: [ "stylus", "styl" ] }, "text/t140": { source: "iana" }, "text/tab-separated-values": { source: "iana", compressible: !0, extensions: [ "tsv" ] }, "text/troff": { source: "iana", extensions: [ "t", "tr", "roff", "man", "me", "ms" ] }, "text/turtle": { source: "iana", charset: "UTF-8", extensions: [ "ttl" ] }, "text/ulpfec": { source: "iana" }, "text/uri-list": { source: "iana", compressible: !0, extensions: [ "uri", "uris", "urls" ] }, "text/vcard": { source: "iana", compressible: !0, extensions: [ "vcard" ] }, "text/vnd.a": { source: "iana" }, "text/vnd.abc": { source: "iana" }, "text/vnd.ascii-art": { source: "iana" }, "text/vnd.curl": { source: "iana", extensions: [ "curl" ] }, "text/vnd.curl.dcurl": { source: "apache", extensions: [ "dcurl" ] }, "text/vnd.curl.mcurl": { source: "apache", extensions: [ "mcurl" ] }, "text/vnd.curl.scurl": { source: "apache", extensions: [ "scurl" ] }, "text/vnd.debian.copyright": { source: "iana" }, "text/vnd.dmclientscript": { source: "iana" }, "text/vnd.dvb.subtitle": { source: "iana", extensions: [ "sub" ] }, "text/vnd.esmertec.theme-descriptor": { source: "iana" }, "text/vnd.fly": { source: "iana", extensions: [ "fly" ] }, "text/vnd.fmi.flexstor": { source: "iana", extensions: [ "flx" ] }, "text/vnd.gml": { source: "iana" }, "text/vnd.graphviz": { source: "iana", extensions: [ "gv" ] }, "text/vnd.hgl": { source: "iana" }, "text/vnd.in3d.3dml": { source: "iana", extensions: [ "3dml" ] }, "text/vnd.in3d.spot": { source: "iana", extensions: [ "spot" ] }, "text/vnd.iptc.newsml": { source: "iana" }, "text/vnd.iptc.nitf": { source: "iana" }, "text/vnd.latex-z": { source: "iana" }, "text/vnd.motorola.reflex": { source: "iana" }, "text/vnd.ms-mediapackage": { source: "iana" }, "text/vnd.net2phone.commcenter.command": { source: "iana" }, "text/vnd.radisys.msml-basic-layout": { source: "iana" }, "text/vnd.senx.warpscript": { source: "iana" }, "text/vnd.si.uricatalogue": { source: "iana" }, "text/vnd.sun.j2me.app-descriptor": { source: "iana", extensions: [ "jad" ] }, "text/vnd.trolltech.linguist": { source: "iana" }, "text/vnd.wap.si": { source: "iana" }, "text/vnd.wap.sl": { source: "iana" }, "text/vnd.wap.wml": { source: "iana", extensions: [ "wml" ] }, "text/vnd.wap.wmlscript": { source: "iana", extensions: [ "wmls" ] }, "text/vtt": { charset: "UTF-8", compressible: !0, extensions: [ "vtt" ] }, "text/x-asm": { source: "apache", extensions: [ "s", "asm" ] }, "text/x-c": { source: "apache", extensions: [ "c", "cc", "cxx", "cpp", "h", "hh", "dic" ] }, "text/x-component": { source: "nginx", extensions: [ "htc" ] }, "text/x-fortran": { source: "apache", extensions: [ "f", "for", "f77", "f90" ] }, "text/x-gwt-rpc": { compressible: !0 }, "text/x-handlebars-template": { extensions: [ "hbs" ] }, "text/x-java-source": { source: "apache", extensions: [ "java" ] }, "text/x-jquery-tmpl": { compressible: !0 }, "text/x-lua": { extensions: [ "lua" ] }, "text/x-markdown": { compressible: !0, extensions: [ "mkd" ] }, "text/x-nfo": { source: "apache", extensions: [ "nfo" ] }, "text/x-opml": { source: "apache", extensions: [ "opml" ] }, "text/x-org": { compressible: !0, extensions: [ "org" ] }, "text/x-pascal": { source: "apache", extensions: [ "p", "pas" ] }, "text/x-processing": { compressible: !0, extensions: [ "pde" ] }, "text/x-sass": { extensions: [ "sass" ] }, "text/x-scss": { extensions: [ "scss" ] }, "text/x-setext": { source: "apache", extensions: [ "etx" ] }, "text/x-sfv": { source: "apache", extensions: [ "sfv" ] }, "text/x-suse-ymp": { compressible: !0, extensions: [ "ymp" ] }, "text/x-uuencode": { source: "apache", extensions: [ "uu" ] }, "text/x-vcalendar": { source: "apache", extensions: [ "vcs" ] }, "text/x-vcard": { source: "apache", extensions: [ "vcf" ] }, "text/xml": { source: "iana", compressible: !0, extensions: [ "xml" ] }, "text/xml-external-parsed-entity": { source: "iana" }, "text/yaml": { extensions: [ "yaml", "yml" ] }, "video/1d-interleaved-parityfec": { source: "iana" }, "video/3gpp": { source: "iana", extensions: [ "3gp", "3gpp" ] }, "video/3gpp-tt": { source: "iana" }, "video/3gpp2": { source: "iana", extensions: [ "3g2" ] }, "video/bmpeg": { source: "iana" }, "video/bt656": { source: "iana" }, "video/celb": { source: "iana" }, "video/dv": { source: "iana" }, "video/encaprtp": { source: "iana" }, "video/h261": { source: "iana", extensions: [ "h261" ] }, "video/h263": { source: "iana", extensions: [ "h263" ] }, "video/h263-1998": { source: "iana" }, "video/h263-2000": { source: "iana" }, "video/h264": { source: "iana", extensions: [ "h264" ] }, "video/h264-rcdo": { source: "iana" }, "video/h264-svc": { source: "iana" }, "video/h265": { source: "iana" }, "video/iso.segment": { source: "iana" }, "video/jpeg": { source: "iana", extensions: [ "jpgv" ] }, "video/jpeg2000": { source: "iana" }, "video/jpm": { source: "apache", extensions: [ "jpm", "jpgm" ] }, "video/mj2": { source: "iana", extensions: [ "mj2", "mjp2" ] }, "video/mp1s": { source: "iana" }, "video/mp2p": { source: "iana" }, "video/mp2t": { source: "iana", extensions: [ "ts" ] }, "video/mp4": { source: "iana", compressible: !1, extensions: [ "mp4", "mp4v", "mpg4" ] }, "video/mp4v-es": { source: "iana" }, "video/mpeg": { source: "iana", compressible: !1, extensions: [ "mpeg", "mpg", "mpe", "m1v", "m2v" ] }, "video/mpeg4-generic": { source: "iana" }, "video/mpv": { source: "iana" }, "video/nv": { source: "iana" }, "video/ogg": { source: "iana", compressible: !1, extensions: [ "ogv" ] }, "video/parityfec": { source: "iana" }, "video/pointer": { source: "iana" }, "video/quicktime": { source: "iana", compressible: !1, extensions: [ "qt", "mov" ] }, "video/raptorfec": { source: "iana" }, "video/raw": { source: "iana" }, "video/rtp-enc-aescm128": { source: "iana" }, "video/rtploopback": { source: "iana" }, "video/rtx": { source: "iana" }, "video/smpte291": { source: "iana" }, "video/smpte292m": { source: "iana" }, "video/ulpfec": { source: "iana" }, "video/vc1": { source: "iana" }, "video/vc2": { source: "iana" }, "video/vnd.cctv": { source: "iana" }, "video/vnd.dece.hd": { source: "iana", extensions: [ "uvh", "uvvh" ] }, "video/vnd.dece.mobile": { source: "iana", extensions: [ "uvm", "uvvm" ] }, "video/vnd.dece.mp4": { source: "iana" }, "video/vnd.dece.pd": { source: "iana", extensions: [ "uvp", "uvvp" ] }, "video/vnd.dece.sd": { source: "iana", extensions: [ "uvs", "uvvs" ] }, "video/vnd.dece.video": { source: "iana", extensions: [ "uvv", "uvvv" ] }, "video/vnd.directv.mpeg": { source: "iana" }, "video/vnd.directv.mpeg-tts": { source: "iana" }, "video/vnd.dlna.mpeg-tts": { source: "iana" }, "video/vnd.dvb.file": { source: "iana", extensions: [ "dvb" ] }, "video/vnd.fvt": { source: "iana", extensions: [ "fvt" ] }, "video/vnd.hns.video": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.ttsavc": { source: "iana" }, "video/vnd.iptvforum.ttsmpeg2": { source: "iana" }, "video/vnd.motorola.video": { source: "iana" }, "video/vnd.motorola.videop": { source: "iana" }, "video/vnd.mpegurl": { source: "iana", extensions: [ "mxu", "m4u" ] }, "video/vnd.ms-playready.media.pyv": { source: "iana", extensions: [ "pyv" ] }, "video/vnd.nokia.interleaved-multimedia": { source: "iana" }, "video/vnd.nokia.mp4vr": { source: "iana" }, "video/vnd.nokia.videovoip": { source: "iana" }, "video/vnd.objectvideo": { source: "iana" }, "video/vnd.radgamettools.bink": { source: "iana" }, "video/vnd.radgamettools.smacker": { source: "iana" }, "video/vnd.sealed.mpeg1": { source: "iana" }, "video/vnd.sealed.mpeg4": { source: "iana" }, "video/vnd.sealed.swf": { source: "iana" }, "video/vnd.sealedmedia.softseal.mov": { source: "iana" }, "video/vnd.uvvu.mp4": { source: "iana", extensions: [ "uvu", "uvvu" ] }, "video/vnd.vivo": { source: "iana", extensions: [ "viv" ] }, "video/vp8": { source: "iana" }, "video/webm": { source: "apache", compressible: !1, extensions: [ "webm" ] }, "video/x-f4v": { source: "apache", extensions: [ "f4v" ] }, "video/x-fli": { source: "apache", extensions: [ "fli" ] }, "video/x-flv": { source: "apache", compressible: !1, extensions: [ "flv" ] }, "video/x-m4v": { source: "apache", extensions: [ "m4v" ] }, "video/x-matroska": { source: "apache", compressible: !1, extensions: [ "mkv", "mk3d", "mks" ] }, "video/x-mng": { source: "apache", extensions: [ "mng" ] }, "video/x-ms-asf": { source: "apache", extensions: [ "asf", "asx" ] }, "video/x-ms-vob": { source: "apache", extensions: [ "vob" ] }, "video/x-ms-wm": { source: "apache", extensions: [ "wm" ] }, "video/x-ms-wmv": { source: "apache", compressible: !1, extensions: [ "wmv" ] }, "video/x-ms-wmx": { source: "apache", extensions: [ "wmx" ] }, "video/x-ms-wvx": { source: "apache", extensions: [ "wvx" ] }, "video/x-msvideo": { source: "apache", extensions: [ "avi" ] }, "video/x-sgi-movie": { source: "apache", extensions: [ "movie" ] }, "video/x-smv": { source: "apache", extensions: [ "smv" ] }, "x-conference/x-cooltalk": { source: "apache", extensions: [ "ice" ] }, "x-shader/x-fragment": { compressible: !0 }, "x-shader/x-vertex": { compressible: !0 } }; }, function(module, exports, __webpack_require__) { "use strict"; var bytes = __webpack_require__(97), debug = __webpack_require__(9)("body-parser:raw"), read = __webpack_require__(121), typeis = __webpack_require__(99); module.exports = function(options) { var opts = options || {}, inflate = !1 !== opts.inflate, limit = "number" != typeof opts.limit ? bytes.parse(opts.limit || "100kb") : opts.limit, type = opts.type || "application/octet-stream", verify = opts.verify || !1; if (!1 !== verify && "function" != typeof verify) throw new TypeError("option verify must be function"); var shouldParse = "function" != typeof type ? (function(type) { return function(req) { return Boolean(typeis(req, type)); }; })(type) : type; function parse(buf) { return buf; } return function(req, res, next) { return req._body ? (debug("body already parsed"), void next()) : (req.body = req.body || {}, typeis.hasBody(req) ? (debug("content-type %j", req.headers["content-type"]), shouldParse(req) ? void read(req, res, next, parse, debug, { encoding: null, inflate: inflate, limit: limit, verify: verify }) : (debug("skip parsing"), void next())) : (debug("skip empty body"), void next())); }; }; }, function(module, exports, __webpack_require__) { "use strict"; var bytes = __webpack_require__(97), contentType = __webpack_require__(118), debug = __webpack_require__(9)("body-parser:text"), read = __webpack_require__(121), typeis = __webpack_require__(99); module.exports = function(options) { var opts = options || {}, defaultCharset = opts.defaultCharset || "utf-8", inflate = !1 !== opts.inflate, limit = "number" != typeof opts.limit ? bytes.parse(opts.limit || "100kb") : opts.limit, type = opts.type || "text/plain", verify = opts.verify || !1; if (!1 !== verify && "function" != typeof verify) throw new TypeError("option verify must be function"); var shouldParse = "function" != typeof type ? (function(type) { return function(req) { return Boolean(typeis(req, type)); }; })(type) : type; function parse(buf) { return buf; } return function(req, res, next) { if (req._body) return debug("body already parsed"), void next(); if (req.body = req.body || {}, !typeis.hasBody(req)) return debug("skip empty body"), void next(); if (debug("content-type %j", req.headers["content-type"]), !shouldParse(req)) return debug("skip parsing"), void next(); var charset = (function(req) { try { return (contentType.parse(req).parameters.charset || "").toLowerCase(); } catch (e) { return; } })(req) || defaultCharset; read(req, res, next, parse, debug, { encoding: charset, inflate: inflate, limit: limit, verify: verify }); }; }; }, function(module, exports, __webpack_require__) { "use strict"; var bytes = __webpack_require__(97), contentType = __webpack_require__(118), createError = __webpack_require__(98), debug = __webpack_require__(9)("body-parser:urlencoded"), deprecate = __webpack_require__(51)("body-parser"), read = __webpack_require__(121), typeis = __webpack_require__(99); module.exports = function(options) { var opts = options || {}; void 0 === opts.extended && deprecate("undefined extended: provide extended option"); var extended = !1 !== opts.extended, inflate = !1 !== opts.inflate, limit = "number" != typeof opts.limit ? bytes.parse(opts.limit || "100kb") : opts.limit, type = opts.type || "application/x-www-form-urlencoded", verify = opts.verify || !1; if (!1 !== verify && "function" != typeof verify) throw new TypeError("option verify must be function"); var queryparse = extended ? (function(options) { var parameterLimit = void 0 !== options.parameterLimit ? options.parameterLimit : 1e3, parse = parser("qs"); if (isNaN(parameterLimit) || parameterLimit < 1) throw new TypeError("option parameterLimit must be a positive number"); return isFinite(parameterLimit) && (parameterLimit |= 0), function(body) { var paramCount = parameterCount(body, parameterLimit); if (void 0 === paramCount) throw debug("too many parameters"), createError(413, "too many parameters", { type: "parameters.too.many" }); var arrayLimit = Math.max(100, paramCount); return debug("parse extended urlencoding"), parse(body, { allowPrototypes: !0, arrayLimit: arrayLimit, depth: 1 / 0, parameterLimit: parameterLimit }); }; })(opts) : (function(options) { var parameterLimit = void 0 !== options.parameterLimit ? options.parameterLimit : 1e3, parse = parser("querystring"); if (isNaN(parameterLimit) || parameterLimit < 1) throw new TypeError("option parameterLimit must be a positive number"); return isFinite(parameterLimit) && (parameterLimit |= 0), function(body) { if (void 0 === parameterCount(body, parameterLimit)) throw debug("too many parameters"), createError(413, "too many parameters", { type: "parameters.too.many" }); return debug("parse urlencoding"), parse(body, void 0, void 0, { maxKeys: parameterLimit }); }; })(opts), shouldParse = "function" != typeof type ? (function(type) { return function(req) { return Boolean(typeis(req, type)); }; })(type) : type; function parse(body) { return body.length ? queryparse(body) : {}; } return function(req, res, next) { if (req._body) return debug("body already parsed"), void next(); if (req.body = req.body || {}, !typeis.hasBody(req)) return debug("skip empty body"), void next(); if (debug("content-type %j", req.headers["content-type"]), !shouldParse(req)) return debug("skip parsing"), void next(); var charset = (function(req) { try { return (contentType.parse(req).parameters.charset || "").toLowerCase(); } catch (e) { return; } })(req) || "utf-8"; if ("utf-8" !== charset) return debug("invalid charset"), void next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { charset: charset, type: "charset.unsupported" })); read(req, res, next, parse, debug, { debug: debug, encoding: charset, inflate: inflate, limit: limit, verify: verify }); }; }; var parsers = Object.create(null); function parameterCount(body, limit) { for (var count = 0, index = 0; -1 !== (index = body.indexOf("&", index)); ) if (index++, ++count === limit) return; return count; } function parser(name) { var mod = parsers[name]; if (void 0 !== mod) return mod.parse; switch (name) { case "qs": mod = __webpack_require__(177); break; case "querystring": mod = __webpack_require__(24); } return parsers[name] = mod, mod.parse; } }, function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(284), formats = __webpack_require__(285), has = Object.prototype.hasOwnProperty, arrayPrefixGenerators = { brackets: function(prefix) { return prefix + "[]"; }, comma: "comma", indices: function(prefix, key) { return prefix + "[" + key + "]"; }, repeat: function(prefix) { return prefix; } }, isArray = Array.isArray, push = Array.prototype.push, pushToArray = function(arr, valueOrArray) { push.apply(arr, isArray(valueOrArray) ? valueOrArray : [ valueOrArray ]); }, toISO = Date.prototype.toISOString, defaults = { addQueryPrefix: !1, allowDots: !1, charset: "utf-8", charsetSentinel: !1, delimiter: "&", encode: !0, encoder: utils.encode, encodeValuesOnly: !1, formatter: formats.formatters[formats.default], indices: !1, serializeDate: function(date) { return toISO.call(date); }, skipNulls: !1, strictNullHandling: !1 }, stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly, charset) { var obj = object; if ("function" == typeof filter ? obj = filter(prefix, obj) : obj instanceof Date ? obj = serializeDate(obj) : "comma" === generateArrayPrefix && isArray(obj) && (obj = obj.join(",")), null === obj) { if (strictNullHandling) return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset) : prefix; obj = ""; } if ("string" == typeof obj || "number" == typeof obj || "boolean" == typeof obj || utils.isBuffer(obj)) return encoder ? [ formatter(encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset)) + "=" + formatter(encoder(obj, defaults.encoder, charset)) ] : [ formatter(prefix) + "=" + formatter(String(obj)) ]; var objKeys, values = []; if (void 0 === obj) return values; if (isArray(filter)) objKeys = filter; else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; skipNulls && null === obj[key] || (isArray(obj) ? pushToArray(values, stringify(obj[key], "function" == typeof generateArrayPrefix ? generateArrayPrefix(prefix, key) : prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly, charset)) : pushToArray(values, stringify(obj[key], prefix + (allowDots ? "." + key : "[" + key + "]"), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly, charset))); } return values; }; module.exports = function(object, opts) { var objKeys, obj = object, options = (function(opts) { if (!opts) return defaults; if (null !== opts.encoder && void 0 !== opts.encoder && "function" != typeof opts.encoder) throw new TypeError("Encoder has to be a function."); var charset = opts.charset || defaults.charset; if (void 0 !== opts.charset && "utf-8" !== opts.charset && "iso-8859-1" !== opts.charset) throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); var format = formats.default; if (void 0 !== opts.format) { if (!has.call(formats.formatters, opts.format)) throw new TypeError("Unknown format option provided."); format = opts.format; } var formatter = formats.formatters[format], filter = defaults.filter; return ("function" == typeof opts.filter || isArray(opts.filter)) && (filter = opts.filter), { addQueryPrefix: "boolean" == typeof opts.addQueryPrefix ? opts.addQueryPrefix : defaults.addQueryPrefix, allowDots: void 0 === opts.allowDots ? defaults.allowDots : !!opts.allowDots, charset: charset, charsetSentinel: "boolean" == typeof opts.charsetSentinel ? opts.charsetSentinel : defaults.charsetSentinel, delimiter: void 0 === opts.delimiter ? defaults.delimiter : opts.delimiter, encode: "boolean" == typeof opts.encode ? opts.encode : defaults.encode, encoder: "function" == typeof opts.encoder ? opts.encoder : defaults.encoder, encodeValuesOnly: "boolean" == typeof opts.encodeValuesOnly ? opts.encodeValuesOnly : defaults.encodeValuesOnly, filter: filter, formatter: formatter, serializeDate: "function" == typeof opts.serializeDate ? opts.serializeDate : defaults.serializeDate, skipNulls: "boolean" == typeof opts.skipNulls ? opts.skipNulls : defaults.skipNulls, sort: "function" == typeof opts.sort ? opts.sort : null, strictNullHandling: "boolean" == typeof opts.strictNullHandling ? opts.strictNullHandling : defaults.strictNullHandling }; })(opts); "function" == typeof options.filter ? obj = (0, options.filter)("", obj) : isArray(options.filter) && (objKeys = options.filter); var arrayFormat, keys = []; if ("object" != typeof obj || null === obj) return ""; arrayFormat = opts && opts.arrayFormat in arrayPrefixGenerators ? opts.arrayFormat : opts && "indices" in opts ? opts.indices ? "indices" : "repeat" : "indices"; var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; objKeys || (objKeys = Object.keys(obj)), options.sort && objKeys.sort(options.sort); for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; options.skipNulls && null === obj[key] || pushToArray(keys, stringify(obj[key], key, generateArrayPrefix, options.strictNullHandling, options.skipNulls, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.formatter, options.encodeValuesOnly, options.charset)); } var joined = keys.join(options.delimiter), prefix = !0 === options.addQueryPrefix ? "?" : ""; return options.charsetSentinel && ("iso-8859-1" === options.charset ? prefix += "utf8=%26%2310003%3B&" : prefix += "utf8=%E2%9C%93&"), joined.length > 0 ? prefix + joined : ""; }; }, function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(284), has = Object.prototype.hasOwnProperty, defaults = { allowDots: !1, allowPrototypes: !1, arrayLimit: 20, charset: "utf-8", charsetSentinel: !1, comma: !1, decoder: utils.decode, delimiter: "&", depth: 5, ignoreQueryPrefix: !1, interpretNumericEntities: !1, parameterLimit: 1e3, parseArrays: !0, plainObjects: !1, strictNullHandling: !1 }, interpretNumericEntities = function(str) { return str.replace(/&#(\d+);/g, (function($0, numberStr) { return String.fromCharCode(parseInt(numberStr, 10)); })); }, parseKeys = function(givenKey, val, options) { if (givenKey) { var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey, child = /(\[[^[\]]*])/g, segment = /(\[[^[\]]*])/.exec(key), parent = segment ? key.slice(0, segment.index) : key, keys = []; if (parent) { if (!options.plainObjects && has.call(Object.prototype, parent) && !options.allowPrototypes) return; keys.push(parent); } for (var i = 0; null !== (segment = child.exec(key)) && i < options.depth; ) { if (i += 1, !options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1)) && !options.allowPrototypes) return; keys.push(segment[1]); } return segment && keys.push("[" + key.slice(segment.index) + "]"), (function(chain, val, options) { for (var leaf = val, i = chain.length - 1; i >= 0; --i) { var obj, root = chain[i]; if ("[]" === root && options.parseArrays) obj = [].concat(leaf); else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = "[" === root.charAt(0) && "]" === root.charAt(root.length - 1) ? root.slice(1, -1) : root, index = parseInt(cleanRoot, 10); options.parseArrays || "" !== cleanRoot ? !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit ? (obj = [])[index] = leaf : obj[cleanRoot] = leaf : obj = { 0: leaf }; } leaf = obj; } return leaf; })(keys, val, options); } }; module.exports = function(str, opts) { var options = (function(opts) { if (!opts) return defaults; if (null !== opts.decoder && void 0 !== opts.decoder && "function" != typeof opts.decoder) throw new TypeError("Decoder has to be a function."); if (void 0 !== opts.charset && "utf-8" !== opts.charset && "iso-8859-1" !== opts.charset) throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined"); var charset = void 0 === opts.charset ? defaults.charset : opts.charset; return { allowDots: void 0 === opts.allowDots ? defaults.allowDots : !!opts.allowDots, allowPrototypes: "boolean" == typeof opts.allowPrototypes ? opts.allowPrototypes : defaults.allowPrototypes, arrayLimit: "number" == typeof opts.arrayLimit ? opts.arrayLimit : defaults.arrayLimit, charset: charset, charsetSentinel: "boolean" == typeof opts.charsetSentinel ? opts.charsetSentinel : defaults.charsetSentinel, comma: "boolean" == typeof opts.comma ? opts.comma : defaults.comma, decoder: "function" == typeof opts.decoder ? opts.decoder : defaults.decoder, delimiter: "string" == typeof opts.delimiter || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, depth: "number" == typeof opts.depth ? opts.depth : defaults.depth, ignoreQueryPrefix: !0 === opts.ignoreQueryPrefix, interpretNumericEntities: "boolean" == typeof opts.interpretNumericEntities ? opts.interpretNumericEntities : defaults.interpretNumericEntities, parameterLimit: "number" == typeof opts.parameterLimit ? opts.parameterLimit : defaults.parameterLimit, parseArrays: !1 !== opts.parseArrays, plainObjects: "boolean" == typeof opts.plainObjects ? opts.plainObjects : defaults.plainObjects, strictNullHandling: "boolean" == typeof opts.strictNullHandling ? opts.strictNullHandling : defaults.strictNullHandling }; })(opts); if ("" === str || null == str) return options.plainObjects ? Object.create(null) : {}; for (var tempObj = "string" == typeof str ? (function(str, options) { var i, obj = {}, cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str, limit = options.parameterLimit === 1 / 0 ? void 0 : options.parameterLimit, parts = cleanStr.split(options.delimiter, limit), skipIndex = -1, charset = options.charset; if (options.charsetSentinel) for (i = 0; i < parts.length; ++i) 0 === parts[i].indexOf("utf8=") && ("utf8=%E2%9C%93" === parts[i] ? charset = "utf-8" : "utf8=%26%2310003%3B" === parts[i] && (charset = "iso-8859-1"), skipIndex = i, i = parts.length); for (i = 0; i < parts.length; ++i) if (i !== skipIndex) { var key, val, part = parts[i], bracketEqualsPos = part.indexOf("]="), pos = -1 === bracketEqualsPos ? part.indexOf("=") : bracketEqualsPos + 1; -1 === pos ? (key = options.decoder(part, defaults.decoder, charset), val = options.strictNullHandling ? null : "") : (key = options.decoder(part.slice(0, pos), defaults.decoder, charset), val = options.decoder(part.slice(pos + 1), defaults.decoder, charset)), val && options.interpretNumericEntities && "iso-8859-1" === charset && (val = interpretNumericEntities(val)), val && options.comma && val.indexOf(",") > -1 && (val = val.split(",")), has.call(obj, key) ? obj[key] = utils.combine(obj[key], val) : obj[key] = val; } return obj; })(str, options) : str, obj = options.plainObjects ? Object.create(null) : {}, keys = Object.keys(tempObj), i = 0; i < keys.length; ++i) { var key = keys[i], newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("router:route"), flatten = __webpack_require__(286), Layer = __webpack_require__(287), methods = __webpack_require__(68), slice = Array.prototype.slice; function Route(path) { debug("new %o", path), this.path = path, this.stack = [], this.methods = {}; } module.exports = Route, Route.prototype._handles_method = function(method) { if (this.methods._all) return !0; var name = method.toLowerCase(); return "head" !== name || this.methods.head || (name = "get"), Boolean(this.methods[name]); }, Route.prototype._methods = function() { var methods = Object.keys(this.methods); this.methods.get && !this.methods.head && methods.push("head"); for (var i = 0; i < methods.length; i++) methods[i] = methods[i].toUpperCase(); return methods; }, Route.prototype.dispatch = function(req, res, done) { var idx = 0, stack = this.stack; if (0 === stack.length) return done(); var method = req.method.toLowerCase(); "head" !== method || this.methods.head || (method = "get"), req.route = this, (function next(err) { if (err && "route" === err) return done(); if (err && "router" === err) return done(err); if (idx >= stack.length) return done(err); for (var layer, match; !0 !== match && idx < stack.length; ) match = !(layer = stack[idx++]).method || layer.method === method; if (!0 !== match) return done(err); err ? layer.handle_error(err, req, res, next) : layer.handle_request(req, res, next); })(); }, Route.prototype.all = function(handler) { var callbacks = flatten(slice.call(arguments)); if (0 === callbacks.length) throw new TypeError("argument handler is required"); for (var i = 0; i < callbacks.length; i++) { var fn = callbacks[i]; if ("function" != typeof fn) throw new TypeError("argument handler must be a function"); var layer = Layer("/", {}, fn); layer.method = void 0, this.methods._all = !0, this.stack.push(layer); } return this; }, methods.forEach((function(method) { Route.prototype[method] = function(handler) { var callbacks = flatten(slice.call(arguments)); if (0 === callbacks.length) throw new TypeError("argument handler is required"); for (var i = 0; i < callbacks.length; i++) { var fn = callbacks[i]; if ("function" != typeof fn) throw new TypeError("argument handler must be a function"); debug("%s %s", method, this.path); var layer = Layer("/", {}, fn); layer.method = method, this.methods[method] = !0, this.stack.push(layer); } return this; }; })); }, function(module, exports) { module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(obj, proto) { return obj.__proto__ = proto, obj; } : function(obj, proto) { for (var prop in proto) obj.hasOwnProperty(prop) || (obj[prop] = proto[prop]); return obj; }); }, function(module, exports, __webpack_require__) { __webpack_require__(5); var fs = __webpack_require__(2); function Mime() { this.types = Object.create(null), this.extensions = Object.create(null); } Mime.prototype.define = function(map) { for (var type in map) { for (var exts = map[type], i = 0; i < exts.length; i++) process.env.DEBUG_MIME && this.types[exts[i]] && console.warn((this._loading || "define()").replace(/.*\//, ""), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + " to " + type), this.types[exts[i]] = type; this.extensions[type] || (this.extensions[type] = exts[0]); } }, Mime.prototype.load = function(file) { this._loading = file; var map = {}; fs.readFileSync(file, "ascii").split(/[\r\n]+/).forEach((function(line) { var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/); map[fields.shift()] = fields; })), this.define(map), this._loading = null; }, Mime.prototype.lookup = function(path, fallback) { var ext = path.replace(/^.*[\.\/\\]/, "").toLowerCase(); return this.types[ext] || fallback || this.default_type; }, Mime.prototype.extension = function(mimeType) { var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); return this.extensions[type]; }; var mime = new Mime; mime.define(__webpack_require__(612)), mime.default_type = mime.lookup("bin"), mime.Mime = Mime, mime.charsets = { lookup: function(mimeType, fallback) { return /^text\/|^application\/(javascript|json)/.test(mimeType) ? "UTF-8" : fallback; } }, module.exports = mime; }, function(module) { module.exports = { "application/andrew-inset": [ "ez" ], "application/applixware": [ "aw" ], "application/atom+xml": [ "atom" ], "application/atomcat+xml": [ "atomcat" ], "application/atomsvc+xml": [ "atomsvc" ], "application/bdoc": [ "bdoc" ], "application/ccxml+xml": [ "ccxml" ], "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" ], "application/emma+xml": [ "emma" ], "application/epub+zip": [ "epub" ], "application/exi": [ "exi" ], "application/font-tdpfr": [ "pfr" ], "application/font-woff": [], "application/font-woff2": [], "application/geo+json": [ "geojson" ], "application/gml+xml": [ "gml" ], "application/gpx+xml": [ "gpx" ], "application/gxf": [ "gxf" ], "application/gzip": [ "gz" ], "application/hyperstudio": [ "stk" ], "application/inkml+xml": [ "ink", "inkml" ], "application/ipfix": [ "ipfix" ], "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/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/mods+xml": [ "mods" ], "application/mp21": [ "m21", "mp21" ], "application/mp4": [ "mp4s", "m4p" ], "application/msword": [ "doc", "dot" ], "application/mxf": [ "mxf" ], "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/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/prs.cww": [ "cww" ], "application/pskc+xml": [ "pskcxml" ], "application/raml+yaml": [ "raml" ], "application/rdf+xml": [ "rdf" ], "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/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/set-payment-initiation": [ "setpay" ], "application/set-registration-initiation": [ "setreg" ], "application/shf+xml": [ "shf" ], "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/tei+xml": [ "tei", "teicorpus" ], "application/thraud+xml": [ "tfi" ], "application/timestamped-data": [ "tsd" ], "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.mpegurl": [ "m3u8" ], "application/vnd.apple.pkpass": [ "pkpass" ], "application/vnd.aristanetworks.swi": [ "swi" ], "application/vnd.astraea-software.iota": [ "iota" ], "application/vnd.audiograph": [ "aep" ], "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.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.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.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.openofficeorg.extension": [ "oxt" ], "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.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.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.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/voicexml+xml": [ "vxml" ], "application/wasm": [ "wasm" ], "application/widget": [ "wgt" ], "application/winhlp": [ "hlp" ], "application/wsdl+xml": [ "wsdl" ], "application/wspolicy+xml": [ "wspolicy" ], "application/x-7z-compressed": [ "7z" ], "application/x-abiword": [ "abw" ], "application/x-ace-compressed": [ "ace" ], "application/x-apple-diskimage": [], "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": [], "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": [ "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": [], "application/x-java-archive-diff": [ "jardiff" ], "application/x-java-jnlp-file": [ "jnlp" ], "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": [], "application/x-msdownload": [ "com", "bat" ], "application/x-msmediaview": [ "mvb", "m13", "m14" ], "application/x-msmetafile": [ "wmf", "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": [], "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" ], "application/xaml+xml": [ "xaml" ], "application/xcap-diff+xml": [ "xdf" ], "application/xenc+xml": [ "xenc" ], "application/xhtml+xml": [ "xhtml", "xht" ], "application/xml": [ "xml", "xsl", "xsd", "rng" ], "application/xml-dtd": [ "dtd" ], "application/xop+xml": [ "xop" ], "application/xproc+xml": [ "xpl" ], "application/xslt+xml": [ "xslt" ], "application/xspf+xml": [ "xspf" ], "application/xv+xml": [ "mxml", "xhvml", "xvml", "xvm" ], "application/yang": [ "yang" ], "application/yin+xml": [ "yin" ], "application/zip": [ "zip" ], "audio/3gpp": [], "audio/adpcm": [ "adp" ], "audio/basic": [ "au", "snd" ], "audio/midi": [ "mid", "midi", "kar", "rmi" ], "audio/mp3": [], "audio/mp4": [ "m4a", "mp4a" ], "audio/mpeg": [ "mpga", "mp2", "mp2a", "mp3", "m2a", "m3a" ], "audio/ogg": [ "oga", "ogg", "spx" ], "audio/s3m": [ "s3m" ], "audio/silk": [ "sil" ], "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/wav": [ "wav" ], "audio/wave": [], "audio/webm": [ "weba" ], "audio/x-aac": [ "aac" ], "audio/x-aiff": [ "aif", "aiff", "aifc" ], "audio/x-caf": [ "caf" ], "audio/x-flac": [ "flac" ], "audio/x-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": [], "audio/x-wav": [], "audio/xm": [ "xm" ], "chemical/x-cdx": [ "cdx" ], "chemical/x-cif": [ "cif" ], "chemical/x-cmdf": [ "cmdf" ], "chemical/x-cml": [ "cml" ], "chemical/x-csml": [ "csml" ], "chemical/x-xyz": [ "xyz" ], "font/collection": [ "ttc" ], "font/otf": [ "otf" ], "font/ttf": [ "ttf" ], "font/woff": [ "woff" ], "font/woff2": [ "woff2" ], "image/apng": [ "apng" ], "image/bmp": [ "bmp" ], "image/cgm": [ "cgm" ], "image/g3fax": [ "g3" ], "image/gif": [ "gif" ], "image/ief": [ "ief" ], "image/jp2": [ "jp2", "jpg2" ], "image/jpeg": [ "jpeg", "jpg", "jpe" ], "image/jpm": [ "jpm" ], "image/jpx": [ "jpx", "jpf" ], "image/ktx": [ "ktx" ], "image/png": [ "png" ], "image/prs.btif": [ "btif" ], "image/sgi": [ "sgi" ], "image/svg+xml": [ "svg", "svgz" ], "image/tiff": [ "tiff", "tif" ], "image/vnd.adobe.photoshop": [ "psd" ], "image/vnd.dece.graphic": [ "uvi", "uvvi", "uvg", "uvvg" ], "image/vnd.djvu": [ "djvu", "djv" ], "image/vnd.dvb.subtitle": [], "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.ms-modi": [ "mdi" ], "image/vnd.ms-photo": [ "wdp" ], "image/vnd.net-fpx": [ "npx" ], "image/vnd.wap.wbmp": [ "wbmp" ], "image/vnd.xiff": [ "xif" ], "image/webp": [ "webp" ], "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": [], "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/rfc822": [ "eml", "mime" ], "model/gltf+json": [ "gltf" ], "model/gltf-binary": [ "glb" ], "model/iges": [ "igs", "iges" ], "model/mesh": [ "msh", "mesh", "silo" ], "model/vnd.collada+xml": [ "dae" ], "model/vnd.dwf": [ "dwf" ], "model/vnd.gdl": [ "gdl" ], "model/vnd.gtw": [ "gtw" ], "model/vnd.mts": [ "mts" ], "model/vnd.vtu": [ "vtu" ], "model/vrml": [ "wrl", "vrml" ], "model/x3d+binary": [ "x3db", "x3dbz" ], "model/x3d+vrml": [ "x3dv", "x3dvz" ], "model/x3d+xml": [ "x3d", "x3dz" ], "text/cache-manifest": [ "appcache", "manifest" ], "text/calendar": [ "ics", "ifb" ], "text/coffeescript": [ "coffee", "litcoffee" ], "text/css": [ "css" ], "text/csv": [ "csv" ], "text/hjson": [ "hjson" ], "text/html": [ "html", "htm", "shtml" ], "text/jade": [ "jade" ], "text/jsx": [ "jsx" ], "text/less": [ "less" ], "text/markdown": [ "markdown", "md" ], "text/mathml": [ "mml" ], "text/n3": [ "n3" ], "text/plain": [ "txt", "text", "conf", "def", "list", "log", "in", "ini" ], "text/prs.lines.tag": [ "dsc" ], "text/richtext": [ "rtx" ], "text/rtf": [], "text/sgml": [ "sgml", "sgm" ], "text/slim": [ "slim", "slm" ], "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/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/vtt": [ "vtt" ], "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": [], "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" ], "text/xml": [], "text/yaml": [ "yaml", "yml" ], "video/3gpp": [ "3gp", "3gpp" ], "video/3gpp2": [ "3g2" ], "video/h261": [ "h261" ], "video/h263": [ "h263" ], "video/h264": [ "h264" ], "video/jpeg": [ "jpgv" ], "video/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/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/webm": [ "webm" ], "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" ] }; }, function(module, exports, __webpack_require__) { var DHT = __webpack_require__(614), Tracker = __webpack_require__(625); __webpack_require__(4), module.exports = function(sources, swarm, options) { var self = this, uniq = {}; self.options = options, (sources = sources.map((function(src) { if ("string" == typeof src) return src.match("^dht:") ? new DHT(src.split(":")[1], options) : src.match("^tracker:") ? new Tracker(src.slice("tracker:".length), {}, swarm.infoHash) : void 0; })).map((function(x, i) { return x && (x.url = sources[i]), x; })).filter((function(x) { return x; }))).forEach((function(x) { x.numFound = 0, x.numFoundUniq = 0, x.numRequests = 0, x.on("peer", (function(addr) { uniq[addr] || (x.numFoundUniq++, uniq[addr] = !0), x.numFound++, swarm.add(addr); })); })); var running = !1; this.run = function() { running = !0, sources.forEach((function(x) { x.run(), x.lastStarted = new Date; })); }, this.pause = function() { running = !1, sources.forEach((function(x) { x.pause(); })); }, this.close = function() { sources.forEach((function(x) { x.removeAllListeners && x.removeAllListeners(), x.close && x.close(); })); }, this.stats = function() { return sources.map((function(x) { return { numFound: x.numFound, numFoundUniq: x.numFoundUniq, numRequests: x.numRequests, url: x.url, lastStarted: x.lastStarted }; })); }, this.isRunning = function() { return running; }, this.run(); var update = function() { var len = swarm.queued; return swarm.paused && running ? self.pause() : options.hasOwnProperty("min") && len < options.min && !running ? self.run() : options.hasOwnProperty("max") && len > options.max && running ? self.pause() : void 0; }; swarm.on("wire", update), swarm.on("wire-disconnect", update), swarm.on("resume", update), swarm.on("pause", update); var runIntvl = setInterval((function() { running && self.run(); }), 3e4); swarm.on("close", (function() { swarm.removeAllListeners(), self.pause(), self.close(), sources = [], runIntvl && clearInterval(runIntvl); })), swarm.peerSearch = self; }; }, function(module, exports, __webpack_require__) { var bittorrentDHT = __webpack_require__(615), EventEmitter = __webpack_require__(4).EventEmitter; function DHT(infoHash) { var self = this; EventEmitter.call(this); var abort, wait, dht = new bittorrentDHT({ concurrency: 10 }); this.run = function() { abort || wait || (wait = setTimeout((function() { self.numRequests++, abort = dht.lookup(infoHash), wait = null; }), 1500)); }, this.pause = function() { wait && (clearTimeout(wait), wait = null), abort && (setTimeout(abort, 1500), abort = null); }, dht.on("peer", (function(p) { self.emit("peer", p.host + ":" + p.port); })); } DHT.prototype.__proto__ = EventEmitter.prototype, module.exports = DHT; }, function(module, exports, __webpack_require__) { var Client = __webpack_require__(289), Server = __webpack_require__(624); module.exports = Client, module.exports.Client = Client, module.exports.Server = Server; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(100).Buffer; function encode(data, buffer, offset) { var buffers = [], result = null; return encode._encode(buffers, data), result = Buffer.concat(buffers), encode.bytes = result.length, Buffer.isBuffer(buffer) ? (result.copy(buffer, offset), buffer) : result; } encode.bytes = -1, encode._floatConversionDetected = !1, encode._encode = function(buffers, data) { if (Buffer.isBuffer(data)) return buffers.push(Buffer.from(data.length + ":")), void buffers.push(data); if (null != data) switch (typeof data) { case "string": encode.buffer(buffers, data); break; case "number": encode.number(buffers, data); break; case "object": data.constructor === Array ? encode.list(buffers, data) : encode.dict(buffers, data); break; case "boolean": encode.number(buffers, data ? 1 : 0); } }; var buffE = Buffer.from("e"), buffD = Buffer.from("d"), buffL = Buffer.from("l"); encode.buffer = function(buffers, data) { buffers.push(Buffer.from(Buffer.byteLength(data) + ":" + data)); }, encode.number = function(buffers, data) { var val = 2147483648 * (data / 2147483648 << 0) + (data % 2147483648 << 0); buffers.push(Buffer.from("i" + val + "e")), val === data || encode._floatConversionDetected || (encode._floatConversionDetected = !0, console.warn('WARNING: Possible data corruption detected with value "' + data + '":', 'Bencoding only defines support for integers, value was converted to "' + val + '"'), console.trace()); }, encode.dict = function(buffers, data) { buffers.push(buffD); for (var k, j = 0, keys = Object.keys(data).sort(), kl = keys.length; j < kl; j++) null != data[k = keys[j]] && (encode.buffer(buffers, k), encode._encode(buffers, data[k])); buffers.push(buffE); }, encode.list = function(buffers, data) { var i = 0, c = data.length; for (buffers.push(buffL); i < c; i++) null != data[i] && encode._encode(buffers, data[i]); buffers.push(buffE); }, module.exports = encode; }, function(module, exports) { function getIntFromBuffer(buffer, start, end) { for (var sum = 0, sign = 1, i = start; i < end; i++) { var num = buffer[i]; if (num < 58 && num >= 48) sum = 10 * sum + (num - 48); else if (i !== start || 43 !== num) { if (i !== start || 45 !== num) { if (46 === num) break; throw new Error("not a number: buffer[" + i + "] = " + num); } sign = -1; } } return sum * sign; } function decode(data, start, end, encoding) { return null == data || 0 === data.length ? null : ("number" != typeof start && null == encoding && (encoding = start, start = void 0), "number" != typeof end && null == encoding && (encoding = end, end = void 0), decode.position = 0, decode.encoding = encoding || null, decode.data = Buffer.isBuffer(data) ? data.slice(start, end) : new Buffer(data), decode.bytes = decode.data.length, decode.next()); } decode.bytes = 0, decode.position = 0, decode.data = null, decode.encoding = null, decode.next = function() { switch (decode.data[decode.position]) { case 100: return decode.dictionary(); case 108: return decode.list(); case 105: return decode.integer(); default: return decode.buffer(); } }, decode.find = function(chr) { for (var i = decode.position, c = decode.data.length, d = decode.data; i < c; ) { if (d[i] === chr) return i; i++; } throw new Error('Invalid data: Missing delimiter "' + String.fromCharCode(chr) + '" [0x' + chr.toString(16) + "]"); }, decode.dictionary = function() { decode.position++; for (var dict = {}; 101 !== decode.data[decode.position]; ) dict[decode.buffer()] = decode.next(); return decode.position++, dict; }, decode.list = function() { decode.position++; for (var lst = []; 101 !== decode.data[decode.position]; ) lst.push(decode.next()); return decode.position++, lst; }, decode.integer = function() { var end = decode.find(101), number = getIntFromBuffer(decode.data, decode.position + 1, end); return decode.position += end + 1 - decode.position, number; }, decode.buffer = function() { var sep = decode.find(58), length = getIntFromBuffer(decode.data, decode.position, sep), end = ++sep + length; return decode.position = end, decode.encoding ? decode.data.toString(decode.encoding, sep, end) : decode.data.slice(sep, end); }, module.exports = decode; }, function(module, exports, __webpack_require__) { "use strict"; var bufferEquals = __webpack_require__(123), randomBytes = __webpack_require__(124), EventEmitter = __webpack_require__(4).EventEmitter, inherits = __webpack_require__(8); function KBucket(options) { if (EventEmitter.call(this), options = options || {}, this.localNodeId = options.localNodeId || randomBytes(20), !Buffer.isBuffer(this.localNodeId)) throw new TypeError("localNodeId is not a Buffer"); this.numberOfNodesPerKBucket = options.numberOfNodesPerKBucket || 20, this.numberOfNodesToPing = options.numberOfNodesToPing || 3, this.distance = options.distance || KBucket.distance, this.arbiter = options.arbiter || KBucket.arbiter, this.root = { contacts: [], dontSplit: !1, left: null, right: null }, this.metadata = Object.assign({}, options.metadata); } module.exports = KBucket, inherits(KBucket, EventEmitter), KBucket.arbiter = function(incumbent, candidate) { return incumbent.vectorClock > candidate.vectorClock ? incumbent : candidate; }, KBucket.distance = function(firstId, secondId) { for (var distance = 0, min = Math.min(firstId.length, secondId.length), max = Math.max(firstId.length, secondId.length), i = 0; i < min; ++i) distance = 256 * distance + (firstId[i] ^ secondId[i]); for (;i < max; ++i) distance = 256 * distance + 255; return distance; }, KBucket.prototype.add = function(contact) { if (!contact || !Buffer.isBuffer(contact.id)) throw new TypeError("contact.id is not a Buffer"); for (var bitIndex = 0, node = this.root; null === node.contacts; ) node = this._determineNode(node, contact.id, bitIndex++); var index = this._indexOf(node, contact.id); return index >= 0 ? (this._update(node, index, contact), this) : node.contacts.length < this.numberOfNodesPerKBucket ? (node.contacts.push(contact), this.emit("added", contact), this) : node.dontSplit ? (this.emit("ping", node.contacts.slice(0, this.numberOfNodesToPing), contact), this) : (this._split(node, bitIndex), this.add(contact)); }, KBucket.prototype.closest = function(id, n) { if (!Buffer.isBuffer(id)) throw new TypeError("id is not a Buffer"); if (void 0 === n && (n = 1 / 0), "number" != typeof n || isNaN(n) || n <= 0) throw new TypeError("n is not positive number"); for (var contacts = [], nodes = [ this.root ], bitIndex = 0; nodes.length > 0 && contacts.length < n; ) { var node = nodes.pop(); if (null === node.contacts) { var detNode = this._determineNode(node, id, bitIndex++); nodes.push(node.left === detNode ? node.right : node.left), nodes.push(detNode); } else contacts = contacts.concat(node.contacts); } var self = this; return contacts.sort((function(a, b) { return self.distance(a.id, id) - self.distance(b.id, id); })).slice(0, n); }, KBucket.prototype.count = function() { for (var count = 0, nodes = [ this.root ]; nodes.length > 0; ) { var node = nodes.pop(); null === node.contacts ? nodes.push(node.right, node.left) : count += node.contacts.length; } return count; }, KBucket.prototype._determineNode = function(node, id, bitIndex) { var bytesDescribedByBitIndex = ~~(bitIndex / 8), bitIndexWithinByte = bitIndex % 8; return id.length <= bytesDescribedByBitIndex && 0 !== bitIndexWithinByte ? node.left : id[bytesDescribedByBitIndex] & Math.pow(2, 7 - bitIndexWithinByte) ? node.right : node.left; }, KBucket.prototype.get = function(id) { if (!Buffer.isBuffer(id)) throw new TypeError("id is not a Buffer"); for (var bitIndex = 0, node = this.root; null === node.contacts; ) node = this._determineNode(node, id, bitIndex++); var index = this._indexOf(node, id); return index >= 0 ? node.contacts[index] : null; }, KBucket.prototype._indexOf = function(node, id) { for (var i = 0; i < node.contacts.length; ++i) if (bufferEquals(node.contacts[i].id, id)) return i; return -1; }, KBucket.prototype.remove = function(id) { if (!Buffer.isBuffer(id)) throw new TypeError("id is not a Buffer"); for (var bitIndex = 0, node = this.root; null === node.contacts; ) node = this._determineNode(node, id, bitIndex++); var index = this._indexOf(node, id); if (index >= 0) { var contact = node.contacts.splice(index, 1)[0]; this.emit("removed", contact); } return this; }, KBucket.prototype._split = function(node, bitIndex) { node.left = { contacts: [], dontSplit: !1, left: null, right: null }, node.right = { contacts: [], dontSplit: !1, left: null, right: null }; for (var i = 0; i < node.contacts.length; ++i) { var contact = node.contacts[i]; this._determineNode(node, contact.id, bitIndex).contacts.push(contact); } node.contacts = null; var detNode = this._determineNode(node, this.localNodeId, bitIndex); (node.left === detNode ? node.right : node.left).dontSplit = !0; }, KBucket.prototype.toArray = function() { for (var result = [], nodes = [ this.root ]; nodes.length > 0; ) { var node = nodes.pop(); null === node.contacts ? nodes.push(node.right, node.left) : result = result.concat(node.contacts); } return result; }, KBucket.prototype._update = function(node, index, contact) { if (!bufferEquals(node.contacts[index].id, contact.id)) throw new Error("wrong index for _update"); var incumbent = node.contacts[index], selection = this.arbiter(incumbent, contact); selection === incumbent && incumbent !== contact || (node.contacts.splice(index, 1), node.contacts.push(selection), this.emit("updated", incumbent, selection)); }; }, function(module, exports, __webpack_require__) { var socket = __webpack_require__(620), KBucket = __webpack_require__(622), equals = __webpack_require__(123), events = __webpack_require__(4), randombytes = __webpack_require__(124), util = __webpack_require__(0), Buffer = __webpack_require__(100).Buffer, BOOTSTRAP_NODES = [ { host: "router.bittorrent.com", port: 6881 }, { host: "router.utorrent.com", port: 6881 }, { host: "dht.transmissionbt.com", port: 6881 } ]; function RPC(opts) { if (!(this instanceof RPC)) return new RPC(opts); opts || (opts = {}); var self = this; function addNode(data, peer) { data && isNodeId(data.id, self._idLength) && !self.nodes.get(data.id) && !equals(data.id, self.id) && self._addNode({ id: data.id, host: peer.address || peer.host, port: peer.port, distance: 0 }); } this._idLength = opts.idLength || 20, this.id = (function(str) { if (Buffer.isBuffer(str)) return str; if (ArrayBuffer.isView(str)) return Buffer.from(str.buffer, str.byteOffset, str.byteLength); if ("string" == typeof str) return Buffer.from(str, "hex"); throw new Error("Pass a buffer or a string"); })(opts.id || opts.nodeId || randombytes(this._idLength)), this.socket = opts.krpcSocket || socket(opts), this.bootstrap = (function(val) { return !1 === val ? [] : !0 === val ? BOOTSTRAP_NODES : [].concat(val || BOOTSTRAP_NODES).map(parsePeer); })(opts.nodes || opts.bootstrap), this.concurrency = opts.concurrency || 16, this.backgroundConcurrency = opts.backgroundConcurrency || this.concurrency / 4 | 0, this.k = opts.k || 20, this.destroyed = !1, this.pending = [], this.nodes = null, this.socket.setMaxListeners(0), this.socket.on("query", (function(query, peer) { addNode(query.a, peer), self.emit("query", query, peer); })), this.socket.on("response", (function(reply, peer) { addNode(reply.r, peer); })), this.socket.on("warning", (function(err) { self.emit("warning", err); })), this.socket.on("error", (function(err) { self.emit("error", err); })), this.socket.on("update", (function() { for (;self.pending.length && self.socket.inflight < self.concurrency; ) { var next = self.pending.shift(); self.query(next[0], next[1], next[2]); } })), this.socket.on("listening", (function() { self.emit("listening"); })), events.EventEmitter.call(this), this.clear(); } function isNodeId(id, idLength) { return id && Buffer.isBuffer(id) && id.length === idLength; } function parseIp(buf, offset) { return buf[offset++] + "." + buf[offset++] + "." + buf[offset++] + "." + buf[offset++]; } function parsePeer(peer) { return "string" == typeof peer ? { host: peer.split(":")[0], port: Number(peer.split(":")[1]) } : peer; } function noop() {} module.exports = RPC, util.inherits(RPC, events.EventEmitter), RPC.prototype.response = function(node, query, response, nodes, cb) { "function" == typeof nodes && (cb = nodes, nodes = null), response.id || (response.id = this.id), nodes && (response.nodes = (function(nodes, idLength) { for (var buf = Buffer.allocUnsafe(nodes.length * (idLength + 6)), ptr = 0, i = 0; i < nodes.length; i++) { var node = nodes[i]; if (isNodeId(node.id, idLength)) { node.id.copy(buf, ptr), ptr += idLength; for (var ip = (node.host || node.address).split("."), j = 0; j < 4; j++) buf[ptr++] = parseInt(ip[j] || 0, 10); buf.writeUInt16BE(node.port, ptr), ptr += 2; } } return ptr === buf.length ? buf : buf.slice(0, ptr); })(nodes, this._idLength)), this.socket.response(node, query, response, cb); }, RPC.prototype.error = function(node, query, error, cb) { this.socket.error(node, query, error, cb); }, RPC.prototype.bind = function() { this.socket.bind.apply(this.socket, arguments); }, RPC.prototype.address = function() { return this.socket.address(); }, RPC.prototype.queryAll = function(nodes, message, visit, cb) { message.a || (message.a = {}), message.a.id || (message.a.id = this.id); var stop = !1, missing = nodes.length, hits = 0, error = null; if (!missing) return cb(new Error("No nodes to query"), 0); for (var i = 0; i < nodes.length; i++) this.query(nodes[i], message, done); function done(err, res, peer) { err ? err.code >= 300 && err.code < 400 && (error = err) : hits++, err || stop || visit && !1 === visit(res, peer) && (stop = !0), --missing || cb(hits ? null : error || new Error("All queries failed"), hits); } }, RPC.prototype.query = function(node, message, cb) { this.socket.inflight >= this.concurrency ? this.pending.push([ node, message, cb ]) : (message.a || (message.a = {}), message.a.id || (message.a.id = this.id), node.token && (message.a.token = node.token), this.socket.query(node, message, cb)); }, RPC.prototype.destroy = function(cb) { this.destroyed = !0, this.socket.destroy(cb); }, RPC.prototype.clear = function() { var self = this; this.nodes = new KBucket({ localNodeId: this.id, numberOfNodesPerKBucket: this.k, numberOfNodesToPing: this.concurrency }), this.nodes.on("ping", (function(older, newer) { self.emit("ping", older, newer); })); }, RPC.prototype.populate = function(target, message, cb) { this._closest(target, message, !0, null, cb); }, RPC.prototype.closest = function(target, message, visit, cb) { this._closest(target, message, !1, visit, cb); }, RPC.prototype._addNode = function(node) { var old = this.nodes.get(node.id); this.nodes.add(node), old || this.emit("node", node); }, RPC.prototype._closest = function(target, message, background, visit, cb) { cb || (cb = noop); var self = this, count = 0, queried = {}, pending = 0, once = !0, stop = !1; message.a || (message.a = {}), message.a.id || (message.a.id = this.id); var table = new KBucket({ localNodeId: target, numberOfNodesPerKBucket: this.k, numberOfNodesToPing: this.concurrency }), evt = background ? "postupdate" : "update"; function kick() { if (!(self.destroyed || self.socket.inflight >= self.concurrency)) { var otherInflight = self.pending.length + self.socket.inflight - pending; if (!(background && self.socket.inflight >= self.backgroundConcurrency && otherInflight)) { var closest = table.closest(target, self.k); (!closest.length || closest.length < self.bootstrap.length) && (!(closest = self.nodes.closest(target, self.k)).length || closest.length < self.bootstrap.length) && once && (once = !1, self.bootstrap.forEach((function(peer) { pending++, self.socket.query(peer, message, afterQuery); }))); for (var i = 0; i < closest.length && !stop; i++) { if (self.socket.inflight >= self.concurrency) return; var peer = closest[i], id = peer.host + ":" + peer.port; queried[id] || (queried[id] = !0, pending++, self.socket.query(peer, message, afterQuery)); } pending || (self.socket.removeListener(evt, kick), process.nextTick(done)); } } } function done() { cb(null, count); } function afterQuery(err, res, peer) { pending--, peer && (queried[(peer.address || peer.host) + ":" + peer.port] = !0), peer && peer.id && self.nodes.get(peer.id) && (!err || "EUNEXPECTEDNODE" !== err.code && "ETIMEDOUT" !== err.code || self.nodes.remove(peer.id)); var r = res && res.r; if (!r) return kick(); !err && isNodeId(r.id, self._idLength) && (count++, add({ id: r.id, port: peer.port, host: peer.host || peer.address, distance: 0 })); for (var nodes = r.nodes ? (function(buf, idLength) { var contacts = []; try { for (var i = 0; i < buf.length; i += idLength + 6) { var port = buf.readUInt16BE(i + (idLength + 4)); port && contacts.push({ id: buf.slice(i, i + idLength), host: parseIp(buf, i + idLength), port: port, distance: 0, token: null }); } } catch (err) {} return contacts; })(r.nodes, self._idLength) : [], i = 0; i < nodes.length; i++) add(nodes[i]); visit && !1 === visit(res, peer) && (stop = !0), kick(); } function add(node) { equals(node.id, self.id) || table.add(node); } this.socket.on(evt, kick), kick(); }; }, function(module, exports, __webpack_require__) { var dgram = __webpack_require__(79), bencode = __webpack_require__(181), isIP = __webpack_require__(39).isIP, dns = __webpack_require__(621), util = __webpack_require__(0), events = __webpack_require__(4), Buffer = __webpack_require__(100).Buffer, equals = __webpack_require__(123), ETIMEDOUT = new Error("Query timed out"); ETIMEDOUT.code = "ETIMEDOUT"; var EUNEXPECTEDNODE = new Error("Unexpected node id"); function RPC(opts) { if (!(this instanceof RPC)) return new RPC(opts); opts || (opts = {}); var self = this; this.timeout = opts.timeout || 2e3, this.inflight = 0, this.destroyed = !1, this.isIP = opts.isIP || isIP, this.socket = opts.socket || dgram.createSocket("udp4"), this.socket.on("message", (function(buf, rinfo) { if (!self.destroyed && rinfo.port) { try { var message = bencode.decode(buf); } catch (e) { return self.emit("warning", e); } var type = message && message.y && message.y.toString(); if ("r" === type || "e" === type) { if (!Buffer.isBuffer(message.t)) return; try { var tid = message.t.readUInt16BE(0); } catch (err) { return self.emit("warning", err); } var index = self._ids.indexOf(tid); if (-1 === index || 0 === tid) return self.emit("response", message, rinfo), void self.emit("warning", new Error("Unexpected transaction id: " + tid)); var req = self._reqs[index]; if (req.peer.host !== rinfo.address) return self.emit("response", message, rinfo), void self.emit("warning", new Error("Out of order response")); if (self._ids[index] = 0, self._reqs[index] = null, self.inflight--, "e" === type) { var isArray = Array.isArray(message.e), err = new Error(isArray ? message.e.join(" ") : "Unknown error"); return err.code = isArray && message.e.length && "number" == typeof message.e[0] ? message.e[0] : 0, req.callback(err, message, rinfo, req.message), self.emit("update"), void self.emit("postupdate"); } var rid = message.r && message.r.id; if (req.peer && req.peer.id && rid && !equals(req.peer.id, rid)) return req.callback(EUNEXPECTEDNODE, null, rinfo), self.emit("update"), void self.emit("postupdate"); req.callback(null, message, rinfo, req.message), self.emit("update"), self.emit("postupdate"), self.emit("response", message, rinfo); } else "q" === type ? self.emit("query", message, rinfo) : self.emit("warning", new Error("Unknown type: " + type)); } })), this.socket.on("error", (function(err) { "EACCES" === err.code || "EADDRINUSE" === err.code ? self.emit("error", err) : self.emit("warning", err); })), this.socket.on("listening", (function() { self.emit("listening"); })), this._tick = 0, this._ids = [], this._reqs = [], this._timer = setInterval((function() { var missing = self.inflight; if (missing) for (var i = 0; i < self._reqs.length; i++) { var req = self._reqs[i]; if (req && (req.ttl ? req.ttl-- : self._cancel(i, ETIMEDOUT), !--missing)) return; } }), this.timeout / 4 | 0), events.EventEmitter.call(this); } function noop() {} EUNEXPECTEDNODE.code = "EUNEXPECTEDNODE", module.exports = RPC, util.inherits(RPC, events.EventEmitter), RPC.prototype.address = function() { return this.socket.address(); }, RPC.prototype.response = function(peer, req, res, cb) { this.send(peer, { t: req.t, y: "r", r: res }, cb); }, RPC.prototype.error = function(peer, req, error, cb) { this.send(peer, { t: req.t, y: "e", e: [].concat(error.message || error) }, cb); }, RPC.prototype.send = function(peer, message, cb) { var buf = bencode.encode(message); this.socket.send(buf, 0, buf.length, peer.port, peer.address || peer.host, cb || noop); }, RPC.prototype.bind = function() { this.socket.bind.apply(this.socket, arguments); }, RPC.prototype.destroy = function(cb) { this.destroyed = !0, clearInterval(this._timer), cb && this.socket.on("close", cb); for (var i = 0; i < this._ids.length; i++) this._cancel(i); this.socket.close(); }, RPC.prototype.query = function(peer, query, cb) { if (cb || (cb = noop), !this.isIP(peer.host)) return this._resolveAndQuery(peer, query, cb); var message = { t: Buffer.allocUnsafe(2), y: "q", q: query.q, a: query.a }, req = { ttl: 4, peer: peer, message: message, callback: cb }; 65535 === this._tick && (this._tick = 0); var tid = ++this._tick, free = this._ids.indexOf(0); for (-1 === free && (free = this._ids.push(0) - 1), this._ids[free] = tid; this._reqs.length < free; ) this._reqs.push(null); return this._reqs[free] = req, this.inflight++, message.t.writeUInt16BE(tid, 0), this.send(peer, message), tid; }, RPC.prototype.cancel = function(tid, err) { var index = this._ids.indexOf(tid); index > -1 && this._cancel(index, err); }, RPC.prototype._cancel = function(index, err) { var req = this._reqs[index]; this._ids[index] = 0, this._reqs[index] = null, req && (this.inflight--, req.callback(err || new Error("Query was cancelled"), null, req.peer), this.emit("update"), this.emit("postupdate")); }, RPC.prototype._resolveAndQuery = function(peer, query, cb) { var self = this; dns.lookup(peer.host, (function(err, ip) { return err ? cb(err) : self.destroyed ? cb(new Error("k-rpc-socket is destroyed")) : void self.query({ host: ip, port: peer.port }, query, cb); })); }; }, function(module, exports) { module.exports = require("dns"); }, function(module, exports, __webpack_require__) { "use strict"; var randomBytes = __webpack_require__(124), EventEmitter = __webpack_require__(4).EventEmitter, inherits = __webpack_require__(8); function arrayEquals(array1, array2) { if (array1 === array2) return !0; if (array1.length !== array2.length) return !1; for (var i = 0, length = array1.length; i < length; ++i) if (array1[i] !== array2[i]) return !1; return !0; } function KBucket(options) { if (EventEmitter.call(this), options = options || {}, this.localNodeId = options.localNodeId || randomBytes(20), !(this.localNodeId instanceof Uint8Array)) throw new TypeError("localNodeId is not a Uint8Array"); this.numberOfNodesPerKBucket = options.numberOfNodesPerKBucket || 20, this.numberOfNodesToPing = options.numberOfNodesToPing || 3, this.distance = options.distance || KBucket.distance, this.arbiter = options.arbiter || KBucket.arbiter, this.root = { contacts: [], dontSplit: !1, left: null, right: null }, this.metadata = Object.assign({}, options.metadata); } module.exports = KBucket, inherits(KBucket, EventEmitter), KBucket.arbiter = function(incumbent, candidate) { return incumbent.vectorClock > candidate.vectorClock ? incumbent : candidate; }, KBucket.distance = function(firstId, secondId) { for (var distance = 0, min = Math.min(firstId.length, secondId.length), max = Math.max(firstId.length, secondId.length), i = 0; i < min; ++i) distance = 256 * distance + (firstId[i] ^ secondId[i]); for (;i < max; ++i) distance = 256 * distance + 255; return distance; }, KBucket.prototype.add = function(contact) { if (!(contact && contact.id instanceof Uint8Array)) throw new TypeError("contact.id is not a Uint8Array"); for (var bitIndex = 0, node = this.root; null === node.contacts; ) node = this._determineNode(node, contact.id, bitIndex++); var index = this._indexOf(node, contact.id); return index >= 0 ? (this._update(node, index, contact), this) : node.contacts.length < this.numberOfNodesPerKBucket ? (node.contacts.push(contact), this.emit("added", contact), this) : node.dontSplit ? (this.emit("ping", node.contacts.slice(0, this.numberOfNodesToPing), contact), this) : (this._split(node, bitIndex), this.add(contact)); }, KBucket.prototype.closest = function(id, n) { if (!(id instanceof Uint8Array)) throw new TypeError("id is not a Uint8Array"); if (void 0 === n && (n = 1 / 0), "number" != typeof n || isNaN(n) || n <= 0) throw new TypeError("n is not positive number"); for (var contacts = [], nodes = [ this.root ], bitIndex = 0; nodes.length > 0 && contacts.length < n; ) { var node = nodes.pop(); if (null === node.contacts) { var detNode = this._determineNode(node, id, bitIndex++); nodes.push(node.left === detNode ? node.right : node.left), nodes.push(detNode); } else contacts = contacts.concat(node.contacts); } var self = this; return contacts.map((function(a) { return [ self.distance(a.id, id), a ]; })).sort((function(a, b) { return a[0] - b[0]; })).slice(0, n).map((function(a) { return a[1]; })); }, KBucket.prototype.count = function() { for (var count = 0, nodes = [ this.root ]; nodes.length > 0; ) { var node = nodes.pop(); null === node.contacts ? nodes.push(node.right, node.left) : count += node.contacts.length; } return count; }, KBucket.prototype._determineNode = function(node, id, bitIndex) { var bytesDescribedByBitIndex = ~~(bitIndex / 8), bitIndexWithinByte = bitIndex % 8; return id.length <= bytesDescribedByBitIndex && 0 !== bitIndexWithinByte ? node.left : id[bytesDescribedByBitIndex] & Math.pow(2, 7 - bitIndexWithinByte) ? node.right : node.left; }, KBucket.prototype.get = function(id) { if (!(id instanceof Uint8Array)) throw new TypeError("id is not a Uint8Array"); for (var bitIndex = 0, node = this.root; null === node.contacts; ) node = this._determineNode(node, id, bitIndex++); var index = this._indexOf(node, id); return index >= 0 ? node.contacts[index] : null; }, KBucket.prototype._indexOf = function(node, id) { for (var i = 0; i < node.contacts.length; ++i) if (arrayEquals(node.contacts[i].id, id)) return i; return -1; }, KBucket.prototype.remove = function(id) { if (!(id instanceof Uint8Array)) throw new TypeError("id is not a Uint8Array"); for (var bitIndex = 0, node = this.root; null === node.contacts; ) node = this._determineNode(node, id, bitIndex++); var index = this._indexOf(node, id); if (index >= 0) { var contact = node.contacts.splice(index, 1)[0]; this.emit("removed", contact); } return this; }, KBucket.prototype._split = function(node, bitIndex) { node.left = { contacts: [], dontSplit: !1, left: null, right: null }, node.right = { contacts: [], dontSplit: !1, left: null, right: null }; for (var i = 0; i < node.contacts.length; ++i) { var contact = node.contacts[i]; this._determineNode(node, contact.id, bitIndex).contacts.push(contact); } node.contacts = null; var detNode = this._determineNode(node, this.localNodeId, bitIndex); (node.left === detNode ? node.right : node.left).dontSplit = !0; }, KBucket.prototype.toArray = function() { for (var result = [], nodes = [ this.root ]; nodes.length > 0; ) { var node = nodes.pop(); null === node.contacts ? nodes.push(node.right, node.left) : result = result.concat(node.contacts); } return result; }, KBucket.prototype._update = function(node, index, contact) { if (!arrayEquals(node.contacts[index].id, contact.id)) throw new Error("wrong index for _update"); var incumbent = node.contacts[index], selection = this.arbiter(incumbent, contact); selection === incumbent && incumbent !== contact || (node.contacts.splice(index, 1), node.contacts.push(selection), this.emit("updated", incumbent, selection)); }; }, function(module, exports, __webpack_require__) { var events = __webpack_require__(4), inherits = __webpack_require__(8); function LRU(opts) { if (!(this instanceof LRU)) return new LRU(opts); "number" == typeof opts && (opts = { max: opts }), opts || (opts = {}), events.EventEmitter.call(this), this.cache = {}, this.head = this.tail = null, this.length = 0, this.max = opts.max || 1e3, this.maxAge = opts.maxAge || 0; } module.exports = LRU, inherits(LRU, events.EventEmitter), Object.defineProperty(LRU.prototype, "keys", { get: function() { return Object.keys(this.cache); } }), LRU.prototype.clear = function() { this.cache = {}, this.head = this.tail = null, this.length = 0; }, LRU.prototype.remove = function(key) { if ("string" != typeof key && (key = "" + key), this.cache.hasOwnProperty(key)) { var element = this.cache[key]; return delete this.cache[key], this._unlink(key, element.prev, element.next), element.value; } }, LRU.prototype._unlink = function(key, prev, next) { this.length--, 0 === this.length ? this.head = this.tail = null : this.head === key ? (this.head = prev, this.cache[this.head].next = null) : this.tail === key ? (this.tail = next, this.cache[this.tail].prev = null) : (this.cache[prev].next = next, this.cache[next].prev = prev); }, LRU.prototype.peek = function(key) { if (this.cache.hasOwnProperty(key)) { var element = this.cache[key]; if (this._checkAge(key, element)) return element.value; } }, LRU.prototype.set = function(key, value) { var element; if ("string" != typeof key && (key = "" + key), this.cache.hasOwnProperty(key)) { if ((element = this.cache[key]).value = value, this.maxAge && (element.modified = Date.now()), key === this.head) return value; this._unlink(key, element.prev, element.next); } else element = { value: value, modified: 0, next: null, prev: null }, this.maxAge && (element.modified = Date.now()), this.cache[key] = element, this.length === this.max && this.evict(); return this.length++, element.next = null, element.prev = this.head, this.head && (this.cache[this.head].next = key), this.head = key, this.tail || (this.tail = key), value; }, LRU.prototype._checkAge = function(key, element) { return !(this.maxAge && Date.now() - element.modified > this.maxAge && (this.remove(key), this.emit("evict", { key: key, value: element.value }), 1)); }, LRU.prototype.get = function(key) { if ("string" != typeof key && (key = "" + key), this.cache.hasOwnProperty(key)) { var element = this.cache[key]; if (this._checkAge(key, element)) return this.head !== key && (key === this.tail ? (this.tail = element.next, this.cache[this.tail].prev = null) : this.cache[element.prev].next = element.next, this.cache[element.next].prev = element.prev, this.cache[this.head].next = key, element.prev = this.head, element.next = null, this.head = key), element.value; } }, LRU.prototype.evict = function() { if (this.tail) { var key = this.tail, value = this.remove(this.tail); this.emit("evict", { key: key, value: value }); } }; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(289); }, function(module, exports, __webpack_require__) { var trackerCli = __webpack_require__(626), EventEmitter = __webpack_require__(4).EventEmitter; function Tracker(url, opts, infoHash) { var self = this; EventEmitter.call(this); var peerId = new Buffer("01234567890123456789"); this.run = function() { self.numRequests++; var client = new trackerCli(peerId, 6881, { infoHash: infoHash, announce: [ url ] }); client.start(), client.on("peer", (function(addr) { self.emit("peer", addr); })); }, this.pause = function() {}; } Tracker.prototype.__proto__ = EventEmitter.prototype, module.exports = Tracker; }, function(module, exports, __webpack_require__) { var Client = __webpack_require__(627), Server = __webpack_require__(653); module.exports = Client, module.exports.Client = Client, module.exports.Server = Server; }, function(module, exports, __webpack_require__) { module.exports = Client; var EventEmitter = __webpack_require__(4).EventEmitter, debug = __webpack_require__(9)("bittorrent-tracker"), inherits = __webpack_require__(8), once = __webpack_require__(35), parallel = __webpack_require__(628), uniq = __webpack_require__(125), url = __webpack_require__(7), common = __webpack_require__(55), HTTPTracker = __webpack_require__(631), UDPTracker = __webpack_require__(637), WebSocketTracker = __webpack_require__(639); function Client(peerId, port, torrent, opts) { var self = this; if (!(self instanceof Client)) return new Client(peerId, port, torrent, opts); EventEmitter.call(self), opts || (opts = {}), self.peerId = "string" == typeof peerId ? peerId : peerId.toString("hex"), self.peerIdBuffer = new Buffer(self.peerId, "hex"), self._peerIdBinary = self.peerIdBuffer.toString("binary"), self.infoHash = "string" == typeof torrent.infoHash ? torrent.infoHash : torrent.infoHash.toString("hex"), self.infoHashBuffer = new Buffer(self.infoHash, "hex"), self._infoHashBinary = self.infoHashBuffer.toString("binary"), self.torrentLength = torrent.length, self.destroyed = !1, self._port = port, self._rtcConfig = opts.rtcConfig, self._wrtc = opts.wrtc, debug("new client %s", self.infoHash); var webrtcSupport = !!self._wrtc || "undefined" != typeof window, announce = "string" == typeof torrent.announce ? [ torrent.announce ] : null == torrent.announce ? [] : torrent.announce; announce = announce.map((function(announceUrl) { return "/" === (announceUrl = announceUrl.toString())[announceUrl.length - 1] && (announceUrl = announceUrl.substring(0, announceUrl.length - 1)), announceUrl; })), announce = uniq(announce), self._trackers = announce.map((function(announceUrl) { var protocol = url.parse(announceUrl).protocol; return "http:" !== protocol && "https:" !== protocol || "function" != typeof HTTPTracker ? "udp:" === protocol && "function" == typeof UDPTracker ? new UDPTracker(self, announceUrl) : "ws:" !== protocol && "wss:" !== protocol || !webrtcSupport ? (process.nextTick((function() { var err = new Error("unsupported tracker protocol for " + announceUrl); self.emit("warning", err); })), null) : new WebSocketTracker(self, announceUrl) : new HTTPTracker(self, announceUrl); })).filter(Boolean); } inherits(Client, EventEmitter), Client.scrape = function(announceUrl, infoHash, cb) { cb = once(cb); var client = new Client(new Buffer("01234567890123456789"), 6881, { infoHash: Array.isArray(infoHash) ? infoHash[0] : infoHash, announce: [ announceUrl ] }); client.once("error", cb); var len = Array.isArray(infoHash) ? infoHash.length : 1, results = {}; client.on("scrape", (function(data) { if (len -= 1, results[data.infoHash] = data, 0 === len) { client.destroy(); var keys = Object.keys(results); 1 === keys.length ? cb(null, results[keys[0]]) : cb(null, results); } })), infoHash = Array.isArray(infoHash) ? infoHash.map((function(infoHash) { return new Buffer(infoHash, "hex"); })) : new Buffer(infoHash, "hex"), client.scrape({ infoHash: infoHash }); }, Client.prototype.start = function(opts) { debug("send `start`"), (opts = this._defaultAnnounceOpts(opts)).event = "started", this._announce(opts), this._trackers.forEach((function(tracker) { tracker.setInterval(); })); }, Client.prototype.stop = function(opts) { debug("send `stop`"), (opts = this._defaultAnnounceOpts(opts)).event = "stopped", this._announce(opts); }, Client.prototype.complete = function(opts) { debug("send `complete`"), opts || (opts = {}), null == opts.downloaded && null != this.torrentLength && (opts.downloaded = this.torrentLength), (opts = this._defaultAnnounceOpts(opts)).event = "completed", this._announce(opts); }, Client.prototype.update = function(opts) { debug("send `update`"), (opts = this._defaultAnnounceOpts(opts)).event && delete opts.event, this._announce(opts); }, Client.prototype._announce = function(opts) { this._trackers.forEach((function(tracker) { tracker.announce(opts); })); }, Client.prototype.scrape = function(opts) { debug("send `scrape`"), opts || (opts = {}), this._trackers.forEach((function(tracker) { tracker.scrape(opts); })); }, Client.prototype.setInterval = function(intervalMs) { debug("setInterval %d", intervalMs), this._trackers.forEach((function(tracker) { tracker.setInterval(intervalMs); })); }, Client.prototype.destroy = function(cb) { if (!this.destroyed) { this.destroyed = !0, debug("destroy"); var tasks = this._trackers.map((function(tracker) { return function(cb) { tracker.destroy(cb); }; })); parallel(tasks, cb), this._trackers = []; } }, Client.prototype._defaultAnnounceOpts = function(opts) { return opts || (opts = {}), null == opts.numwant && (opts.numwant = common.DEFAULT_ANNOUNCE_PEERS), null == opts.uploaded && (opts.uploaded = 0), null == opts.downloaded && (opts.downloaded = 0), null == opts.left && null != this.torrentLength && (opts.left = this.torrentLength - opts.downloaded), opts; }; }, function(module, exports) { module.exports = function(tasks, cb) { var results, pending, keys, isSync = !0; function done(err) { function end() { cb && cb(err, results), cb = null; } isSync ? process.nextTick(end) : end(); } function each(i, err, result) { results[i] = result, (0 == --pending || err) && done(err); } Array.isArray(tasks) ? (results = [], pending = tasks.length) : (keys = Object.keys(tasks), results = {}, pending = keys.length), pending ? keys ? keys.forEach((function(key) { tasks[key]((function(err, result) { each(key, err, result); })); })) : tasks.forEach((function(task, i) { task((function(err, result) { each(i, err, result); })); })) : done(null), isSync = !1; }; }, function(module, exports) { module.exports = function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }; var hasOwnProperty = Object.prototype.hasOwnProperty; }, function(module, exports, __webpack_require__) { var querystring = __webpack_require__(24); function toUInt32(n) { var buf = new Buffer(4); return buf.writeUInt32BE(n, 0), buf; } exports.IPV4_RE = /^[\d\.]+$/, exports.IPV6_RE = /^[\da-fA-F:]+$/, exports.CONNECTION_ID = Buffer.concat([ toUInt32(1047), toUInt32(655366528) ]), exports.ACTIONS = { CONNECT: 0, ANNOUNCE: 1, SCRAPE: 2, ERROR: 3 }, exports.EVENTS = { update: 0, completed: 1, started: 2, stopped: 3 }, exports.EVENT_IDS = { 0: "update", 1: "completed", 2: "started", 3: "stopped" }, exports.EVENT_NAMES = { update: "update", completed: "complete", started: "start", stopped: "stop" }, exports.toUInt32 = toUInt32, exports.querystringParse = function(q) { var saved = querystring.unescape; querystring.unescape = unescape; var ret = querystring.parse(q); return querystring.unescape = saved, ret; }, exports.querystringStringify = function(obj) { var saved = querystring.escape; querystring.escape = escape; var ret = querystring.stringify(obj); return ret = ret.replace(/[\@\*\/\+]/g, (function(char) { return "%" + char.charCodeAt(0).toString(16).toUpperCase(); })), querystring.escape = saved, ret; }; }, function(module, exports, __webpack_require__) { module.exports = HTTPTracker; var bencode = __webpack_require__(290), compact2string = __webpack_require__(291), debug = __webpack_require__(9)("bittorrent-tracker:http-tracker"), get = __webpack_require__(635), inherits = __webpack_require__(8), common = __webpack_require__(55), Tracker = __webpack_require__(184), HTTP_SCRAPE_SUPPORT = /\/(announce)[^\/]*$/; function HTTPTracker(client, announceUrl, opts) { var m; Tracker.call(this, client, announceUrl), debug("new http tracker %s", announceUrl), this.scrapeUrl = null, (m = this.announceUrl.match(HTTP_SCRAPE_SUPPORT)) && (this.scrapeUrl = this.announceUrl.slice(0, m.index) + "/scrape" + this.announceUrl.slice(m.index + 9)); } inherits(HTTPTracker, Tracker), HTTPTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 18e5, HTTPTracker.prototype.announce = function(opts) { if (!this.destroyed) { var params = { numwant: opts.numwant, uploaded: opts.uploaded, downloaded: opts.downloaded, event: opts.event, compact: null == opts.compact ? 1 : opts.compact, info_hash: this.client._infoHashBinary, peer_id: this.client._peerIdBinary, port: this.client._port }; this._trackerId && (params.trackerid = this._trackerId), this._request(this.announceUrl, params, this._onAnnounceResponse.bind(this)); } }, HTTPTracker.prototype.scrape = function(opts) { if (!this.destroyed) if (this.scrapeUrl) { var params = { info_hash: Array.isArray(opts.infoHash) && opts.infoHash.length > 0 ? opts.infoHash.map((function(infoHash) { return infoHash.toString("binary"); })) : opts.infoHash && opts.infoHash.toString("binary") || this.client._infoHashBinary }; this._request(this.scrapeUrl, params, this._onScrapeResponse.bind(this)); } else this.client.emit("error", new Error("scrape not supported " + this.announceUrl)); }, HTTPTracker.prototype.destroy = function(cb) { this.destroyed || (this.destroyed = !0, clearInterval(this.interval), cb(null)); }, HTTPTracker.prototype._request = function(requestUrl, params, cb) { var self = this, u = requestUrl + (-1 === requestUrl.indexOf("?") ? "?" : "&") + common.querystringStringify(params); get.concat(u, (function(err, res, data) { if (!self.destroyed) { if (err) return self.client.emit("warning", err); if (200 !== res.statusCode) return self.client.emit("warning", new Error("Non-200 response code " + res.statusCode + " from " + self.announceUrl)); if (!data || 0 === data.length) return self.client.emit("warning", new Error("Invalid tracker response from" + self.announceUrl)); try { data = bencode.decode(data); } catch (err) { return self.client.emit("warning", new Error("Error decoding tracker response: " + err.message)); } var failure = data["failure reason"]; if (failure) return debug("failure from " + requestUrl + " (" + failure + ")"), self.client.emit("warning", new Error(failure)); var warning = data["warning message"]; warning && (debug("warning from " + requestUrl + " (" + warning + ")"), self.client.emit("warning", new Error(warning))), debug("response from " + requestUrl), cb(data); } })); }, HTTPTracker.prototype._onAnnounceResponse = function(data) { var self = this, interval = data.interval || data["min interval"]; interval && self.setInterval(1e3 * interval); var addrs, trackerId = data["tracker id"]; if (trackerId && (self._trackerId = trackerId), self.client.emit("update", { announce: self.announceUrl, complete: data.complete, incomplete: data.incomplete }), Buffer.isBuffer(data.peers)) { try { addrs = compact2string.multi(data.peers); } catch (err) { return self.client.emit("warning", err); } addrs.forEach((function(addr) { self.client.emit("peer", addr); })); } else Array.isArray(data.peers) && data.peers.forEach((function(peer) { self.client.emit("peer", peer.ip + ":" + peer.port); })); if (Buffer.isBuffer(data.peers6)) { try { addrs = compact2string.multi6(data.peers6); } catch (err) { return self.client.emit("warning", err); } addrs.forEach((function(addr) { self.client.emit("peer", addr); })); } else Array.isArray(data.peers6) && data.peers6.forEach((function(peer) { var ip = /^\[/.test(peer.ip) || !/:/.test(peer.ip) ? peer.ip : "[" + peer.ip + "]"; self.client.emit("peer", ip + ":" + peer.port); })); }, HTTPTracker.prototype._onScrapeResponse = function(data) { var self = this; data = data.files || data.host || {}; var keys = Object.keys(data); 0 !== keys.length ? keys.forEach((function(infoHash) { var response = data[infoHash]; self.client.emit("scrape", { announce: self.announceUrl, infoHash: common.binaryToHex(infoHash), complete: response.complete, incomplete: response.incomplete, downloaded: response.downloaded }); })) : self.client.emit("warning", new Error("invalid scrape response")); }; }, function(module, exports) { function encode(data) { var buffers = []; return encode._encode(buffers, data), Buffer.concat(buffers); } encode._floatConversionDetected = !1, encode._encode = function(buffers, data) { if (Buffer.isBuffer(data)) return buffers.push(new Buffer(data.length + ":")), void buffers.push(data); switch (typeof data) { case "string": encode.bytes(buffers, data); break; case "number": encode.number(buffers, data); break; case "object": data.constructor === Array ? encode.list(buffers, data) : encode.dict(buffers, data); } }; var buff_e = new Buffer("e"), buff_d = new Buffer("d"), buff_l = new Buffer("l"); encode.bytes = function(buffers, data) { buffers.push(new Buffer(Buffer.byteLength(data) + ":" + data)); }, encode.number = function(buffers, data) { var val = 2147483648 * (data / 2147483648 << 0) + (data % 2147483648 << 0); buffers.push(new Buffer("i" + val + "e")), val === data || encode._floatConversionDetected || (encode._floatConversionDetected = !0, console.warn('WARNING: Possible data corruption detected with value "' + data + '":', 'Bencoding only defines support for integers, value was converted to "' + val + '"'), console.trace()); }, encode.dict = function(buffers, data) { buffers.push(buff_d); for (var k, j = 0, keys = Object.keys(data).sort(), kl = keys.length; j < kl; j++) k = keys[j], encode.bytes(buffers, k), encode._encode(buffers, data[k]); buffers.push(buff_e); }, encode.list = function(buffers, data) { var i = 0, c = data.length; for (buffers.push(buff_l); i < c; i++) encode._encode(buffers, data[i]); buffers.push(buff_e); }, module.exports = encode; }, function(module, exports, __webpack_require__) { var Dict = __webpack_require__(634); function decode(data, encoding) { return decode.position = 0, decode.encoding = encoding || null, decode.data = Buffer.isBuffer(data) ? data : new Buffer(data), decode.next(); } decode.position = 0, decode.data = null, decode.encoding = null, decode.next = function() { switch (decode.data[decode.position]) { case 100: return decode.dictionary(); case 108: return decode.list(); case 105: return decode.integer(); default: return decode.bytes(); } }, decode.find = function(chr) { for (var i = decode.position, c = decode.data.length, d = decode.data; i < c; ) { if (d[i] === chr) return i; i++; } throw new Error('Invalid data: Missing delimiter "' + String.fromCharCode(chr) + '" [0x' + chr.toString(16) + "]"); }, decode.dictionary = function() { decode.position++; for (var dict = new Dict; 101 !== decode.data[decode.position]; ) dict.binarySet(decode.bytes(), decode.next()); return decode.position++, dict; }, decode.list = function() { decode.position++; for (var lst = []; 101 !== decode.data[decode.position]; ) lst.push(decode.next()); return decode.position++, lst; }, decode.integer = function() { var end = decode.find(101), number = decode.data.toString("ascii", decode.position + 1, end); return decode.position += end + 1 - decode.position, parseInt(number, 10); }, decode.bytes = function() { var sep = decode.find(58), length = parseInt(decode.data.toString("ascii", decode.position, sep), 10), end = ++sep + length; return decode.position = end, decode.encoding ? decode.data.toString(decode.encoding, sep, end) : decode.data.slice(sep, end); }, module.exports = decode; }, function(module, exports) { var Dict = module.exports = function() { Object.defineProperty(this, "_keys", { enumerable: !1, value: [] }); }; Dict.prototype.binaryKeys = function() { return this._keys.slice(); }, Dict.prototype.binarySet = function(key, value) { this._keys.push(key), this[key] = value; }; }, function(module, exports, __webpack_require__) { module.exports = simpleGet; var concat = __webpack_require__(292), http = __webpack_require__(11), https = __webpack_require__(21), once = __webpack_require__(35), querystring = __webpack_require__(24), decompressResponse = __webpack_require__(293), url = __webpack_require__(7); function simpleGet(opts, cb) { if (opts = "string" == typeof opts ? { url: opts } : Object.assign({}, opts), cb = once(cb), opts.headers = Object.assign({}, opts.headers), Object.keys(opts.headers).forEach((function(h) { h.toLowerCase() !== h && (opts.headers[h.toLowerCase()] = opts.headers[h], delete opts.headers[h]); })), opts.url) { var loc = url.parse(opts.url); loc.hostname && (opts.hostname = loc.hostname), loc.port && (opts.port = loc.port), loc.protocol && (opts.protocol = loc.protocol), loc.auth && (opts.auth = loc.auth), opts.path = loc.path, delete opts.url; } var body; null == opts.maxRedirects && (opts.maxRedirects = 10), opts.method && (opts.method = opts.method.toUpperCase()), opts.body ? body = opts.json && !isStream(opts.body) ? JSON.stringify(opts.body) : opts.body : opts.form && (body = "string" == typeof opts.form ? opts.form : querystring.stringify(opts.form), opts.headers["content-type"] = "application/x-www-form-urlencoded"), delete opts.body, delete opts.form, body && (opts.method || (opts.method = "POST"), isStream(body) || (opts.headers["content-length"] = Buffer.byteLength(body)), opts.json && (opts.headers["content-type"] = "application/json")), opts.json && (opts.headers.accept = "application/json"), opts.headers["accept-encoding"] || (opts.headers["accept-encoding"] = "gzip, deflate"); var req = ("https:" === opts.protocol ? https : http).request(opts, (function(res) { if (res.statusCode >= 300 && res.statusCode < 400 && "location" in res.headers) return opts.url = res.headers.location, delete opts.headers.host, res.resume(), 301 !== res.statusCode && 302 !== res.statusCode || "POST" !== opts.method || (opts.method = "GET", delete opts.headers["content-length"], delete opts.headers["content-type"]), 0 === opts.maxRedirects ? cb(new Error("too many redirects")) : (opts.maxRedirects -= 1, simpleGet(opts, cb)); var tryUnzip = "function" == typeof decompressResponse && "HEAD" !== opts.method; cb(null, tryUnzip ? decompressResponse(res) : res); })); return req.on("timeout", (function() { req.abort(), cb(new Error("Request timed out")); })), req.on("error", cb), body && isStream(body) ? body.on("error", cb).pipe(req) : req.end(body), req; } function isStream(obj) { return "function" == typeof obj.pipe; } simpleGet.concat = function(opts, cb) { return simpleGet(opts, (function(err, res) { if (err) return cb(err); concat(res, (function(err, data) { if (err) return cb(err); if (opts.json) try { data = JSON.parse(data.toString()); } catch (err) { return cb(err, res, data); } cb(null, res, data); })); })); }, [ "get", "post", "put", "patch", "head", "delete" ].forEach((function(method) { simpleGet[method] = function(opts, cb) { return "string" == typeof opts && (opts = { url: opts }), opts.method = method.toUpperCase(), simpleGet(opts, cb); }; })); }, function(module, exports, __webpack_require__) { "use strict"; const knownProps = [ "destroy", "setTimeout", "socket", "headers", "trailers", "rawHeaders", "statusCode", "httpVersion", "httpVersionMinor", "httpVersionMajor", "rawTrailers", "statusMessage" ]; module.exports = (fromStream, toStream) => { const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); for (const prop of fromProps) prop in toStream || (toStream[prop] = "function" == typeof fromStream[prop] ? fromStream[prop].bind(fromStream) : fromStream[prop]); }; }, function(module, exports, __webpack_require__) { module.exports = UDPTracker; var BN = __webpack_require__(638), compact2string = __webpack_require__(291), debug = __webpack_require__(9)("bittorrent-tracker:udp-tracker"), dgram = __webpack_require__(79), hat = __webpack_require__(101), inherits = __webpack_require__(8), url = __webpack_require__(7), common = __webpack_require__(55), Tracker = __webpack_require__(184); function UDPTracker(client, announceUrl, opts) { Tracker.call(this, client, announceUrl), debug("new udp tracker %s", announceUrl), this.cleanupFns = []; } function genTransactionId() { return new Buffer(hat(32), "hex"); } function toUInt64(n) { if (n > 4294967295 || "string" == typeof n) { for (var bytes = new BN(n).toArray(); bytes.length < 8; ) bytes.unshift(0); return new Buffer(bytes); } return Buffer.concat([ common.toUInt32(0), common.toUInt32(n) ]); } function noop() {} inherits(UDPTracker, Tracker), UDPTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 18e5, UDPTracker.prototype.announce = function(opts) { this.destroyed || this._request(opts); }, UDPTracker.prototype.scrape = function(opts) { this.destroyed || (opts._scrape = !0, this._request(opts)); }, UDPTracker.prototype.destroy = function(cb) { this.destroyed || (this.destroyed = !0, clearInterval(this.interval), this.cleanupFns.slice(0).forEach((function(cleanup) { cleanup(); })), this.cleanupFns = [], cb(null)); }, UDPTracker.prototype._request = function(opts) { var self = this; opts || (opts = {}); var parsedUrl = url.parse(self.announceUrl), transactionId = genTransactionId(), socket = dgram.createSocket("udp4"), cleanup = function() { if (socket) { self.cleanupFns.splice(self.cleanupFns.indexOf(cleanup), 1), timeout && (clearTimeout(timeout), timeout = null), socket.removeListener("error", onError), socket.removeListener("message", onSocketMessage), socket.on("error", noop); try { socket.close(); } catch (err) {} socket = null; } }; self.cleanupFns.push(cleanup); var ms = "stopped" === opts.event ? 1500 : 15e3, timeout = setTimeout((function() { timeout = null, "stopped" === opts.event ? cleanup() : onError(new Error("tracker request timed out (" + opts.event + ")")); }), ms); function onSocketMessage(msg) { if (!self.destroyed) { if (msg.length < 8 || msg.readUInt32BE(4) !== transactionId.readUInt32BE(0)) return onError(new Error("tracker sent invalid transaction id")); var action = msg.readUInt32BE(0); switch (debug("UDP response %s, action %s", self.announceUrl, action), action) { case 0: return msg.length < 16 ? onError(new Error("invalid udp handshake")) : void (opts._scrape ? (function(connectionId) { transactionId = genTransactionId(); var infoHash = Array.isArray(opts.infoHash) && opts.infoHash.length > 0 ? Buffer.concat(opts.infoHash) : opts.infoHash || self.client.infoHashBuffer; send(Buffer.concat([ connectionId, common.toUInt32(common.ACTIONS.SCRAPE), transactionId, infoHash ])); })(msg.slice(8, 16)) : (function(connectionId, opts) { var n, buf; transactionId = genTransactionId(), send(Buffer.concat([ connectionId, common.toUInt32(common.ACTIONS.ANNOUNCE), transactionId, self.client.infoHashBuffer, self.client.peerIdBuffer, toUInt64(opts.downloaded), null != opts.left ? toUInt64(opts.left) : new Buffer("FFFFFFFFFFFFFFFF", "hex"), toUInt64(opts.uploaded), common.toUInt32(common.EVENTS[opts.event] || 0), common.toUInt32(0), common.toUInt32(0), common.toUInt32(opts.numwant), (n = self.client._port, buf = new Buffer(2), buf.writeUInt16BE(n, 0), buf) ])); })(msg.slice(8, 16), opts)); case 1: if (cleanup(), msg.length < 20) return onError(new Error("invalid announce message")); var addrs, interval = msg.readUInt32BE(8); interval && self.setInterval(1e3 * interval), self.client.emit("update", { announce: self.announceUrl, complete: msg.readUInt32BE(16), incomplete: msg.readUInt32BE(12) }); try { addrs = compact2string.multi(msg.slice(20)); } catch (err) { return self.client.emit("warning", err); } addrs.forEach((function(addr) { self.client.emit("peer", addr); })); break; case 2: if (cleanup(), msg.length < 20 || (msg.length - 8) % 12 != 0) return onError(new Error("invalid scrape message")); for (var infoHashes = Array.isArray(opts.infoHash) && opts.infoHash.length > 0 ? opts.infoHash.map((function(infoHash) { return infoHash.toString("hex"); })) : [ opts.infoHash && opts.infoHash.toString("hex") || self.client.infoHash ], i = 0, len = (msg.length - 8) / 12; i < len; i += 1) self.client.emit("scrape", { announce: self.announceUrl, infoHash: infoHashes[i], complete: msg.readUInt32BE(8 + 12 * i), downloaded: msg.readUInt32BE(12 + 12 * i), incomplete: msg.readUInt32BE(16 + 12 * i) }); break; case 3: if (cleanup(), msg.length < 8) return onError(new Error("invalid error message")); self.client.emit("warning", new Error(msg.slice(8).toString())); break; default: onError(new Error("tracker sent invalid action")); } } } function onError(err) { self.destroyed || (cleanup(), err.message && (err.message += " (" + self.announceUrl + ")"), self.client.emit("warning", err)); } function send(message) { parsedUrl.port || (parsedUrl.port = 80), socket.send(message, 0, message.length, parsedUrl.port, parsedUrl.hostname); } timeout.unref && timeout.unref(), send(Buffer.concat([ common.CONNECTION_ID, common.toUInt32(common.ACTIONS.CONNECT), transactionId ])), socket.on("error", onError), socket.on("message", onSocketMessage); }; }, function(module, exports, __webpack_require__) { (function(module) { !(function(module, exports) { "use strict"; function assert(val, msg) { if (!val) throw new Error(msg || "Assertion failed"); } function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function() {}; TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor; } function BN(number, base, endian) { if (BN.isBN(number)) return number; this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== number && ("le" !== base && "be" !== base || (endian = base, base = 10), this._init(number || 0, base || 10, endian || "be")); } var Buffer; "object" == typeof module ? module.exports = BN : exports.BN = BN, BN.BN = BN, BN.wordSize = 26; try { Buffer = __webpack_require__(10).Buffer; } catch (e) {} function parseHex(str, start, end) { for (var r = 0, len = Math.min(str.length, end), i = start; i < len; i++) { var c = str.charCodeAt(i) - 48; r <<= 4, r |= c >= 49 && c <= 54 ? c - 49 + 10 : c >= 17 && c <= 22 ? c - 17 + 10 : 15 & c; } return r; } function parseBase(str, start, end, mul) { for (var r = 0, len = Math.min(str.length, end), i = start; i < len; i++) { var c = str.charCodeAt(i) - 48; r *= mul, r += c >= 49 ? c - 49 + 10 : c >= 17 ? c - 17 + 10 : c; } return r; } BN.isBN = function(num) { return num instanceof BN || null !== num && "object" == typeof num && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); }, BN.max = function(left, right) { return left.cmp(right) > 0 ? left : right; }, BN.min = function(left, right) { return left.cmp(right) < 0 ? left : right; }, BN.prototype._init = function(number, base, endian) { if ("number" == typeof number) return this._initNumber(number, base, endian); if ("object" == typeof number) return this._initArray(number, base, endian); "hex" === base && (base = 16), assert(base === (0 | base) && base >= 2 && base <= 36); var start = 0; "-" === (number = number.toString().replace(/\s+/g, ""))[0] && start++, 16 === base ? this._parseHex(number, start) : this._parseBase(number, base, start), "-" === number[0] && (this.negative = 1), this.strip(), "le" === endian && this._initArray(this.toArray(), base, endian); }, BN.prototype._initNumber = function(number, base, endian) { number < 0 && (this.negative = 1, number = -number), number < 67108864 ? (this.words = [ 67108863 & number ], this.length = 1) : number < 4503599627370496 ? (this.words = [ 67108863 & number, number / 67108864 & 67108863 ], this.length = 2) : (assert(number < 9007199254740992), this.words = [ 67108863 & number, number / 67108864 & 67108863, 1 ], this.length = 3), "le" === endian && this._initArray(this.toArray(), base, endian); }, BN.prototype._initArray = function(number, base, endian) { if (assert("number" == typeof number.length), number.length <= 0) return this.words = [ 0 ], this.length = 1, this; this.length = Math.ceil(number.length / 3), this.words = new Array(this.length); for (var i = 0; i < this.length; i++) this.words[i] = 0; var j, w, off = 0; if ("be" === endian) for (i = number.length - 1, j = 0; i >= 0; i -= 3) w = number[i] | number[i - 1] << 8 | number[i - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, (off += 24) >= 26 && (off -= 26, j++); else if ("le" === endian) for (i = 0, j = 0; i < number.length; i += 3) w = number[i] | number[i + 1] << 8 | number[i + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, (off += 24) >= 26 && (off -= 26, j++); return this.strip(); }, BN.prototype._parseHex = function(number, start) { this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length); for (var i = 0; i < this.length; i++) this.words[i] = 0; var j, w, off = 0; for (i = number.length - 6, j = 0; i >= start; i -= 6) w = parseHex(number, i, i + 6), this.words[j] |= w << off & 67108863, this.words[j + 1] |= w >>> 26 - off & 4194303, (off += 24) >= 26 && (off -= 26, j++); i + 6 !== start && (w = parseHex(number, start, i + 6), this.words[j] |= w << off & 67108863, this.words[j + 1] |= w >>> 26 - off & 4194303), this.strip(); }, BN.prototype._parseBase = function(number, base, start) { this.words = [ 0 ], this.length = 1; for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) limbLen++; limbLen--, limbPow = limbPow / base | 0; for (var total = number.length - start, mod = total % limbLen, end = Math.min(total, total - mod) + start, word = 0, i = start; i < end; i += limbLen) word = parseBase(number, i, i + limbLen, base), this.imuln(limbPow), this.words[0] + word < 67108864 ? this.words[0] += word : this._iaddn(word); if (0 !== mod) { var pow = 1; for (word = parseBase(number, i, number.length, base), i = 0; i < mod; i++) pow *= base; this.imuln(pow), this.words[0] + word < 67108864 ? this.words[0] += word : this._iaddn(word); } }, BN.prototype.copy = function(dest) { dest.words = new Array(this.length); for (var i = 0; i < this.length; i++) dest.words[i] = this.words[i]; dest.length = this.length, dest.negative = this.negative, dest.red = this.red; }, BN.prototype.clone = function() { var r = new BN(null); return this.copy(r), r; }, BN.prototype._expand = function(size) { for (;this.length < size; ) this.words[this.length++] = 0; return this; }, BN.prototype.strip = function() { for (;this.length > 1 && 0 === this.words[this.length - 1]; ) this.length--; return this._normSign(); }, BN.prototype._normSign = function() { return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this; }, BN.prototype.inspect = function() { return (this.red ? ""; }; var zeros = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000" ], groupSizes = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ], groupBases = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ]; function smallMulTo(self, num, out) { out.negative = num.negative ^ self.negative; var len = self.length + num.length | 0; out.length = len, len = len - 1 | 0; var a = 0 | self.words[0], b = 0 | num.words[0], r = a * b, lo = 67108863 & r, carry = r / 67108864 | 0; out.words[0] = lo; for (var k = 1; k < len; k++) { for (var ncarry = carry >>> 26, rword = 67108863 & carry, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { var i = k - j | 0; ncarry += (r = (a = 0 | self.words[i]) * (b = 0 | num.words[j]) + rword) / 67108864 | 0, rword = 67108863 & r; } out.words[k] = 0 | rword, carry = 0 | ncarry; } return 0 !== carry ? out.words[k] = 0 | carry : out.length--, out.strip(); } BN.prototype.toString = function(base, padding) { var out; if (padding = 0 | padding || 1, 16 === (base = base || 10) || "hex" === base) { out = ""; for (var off = 0, carry = 0, i = 0; i < this.length; i++) { var w = this.words[i], word = (16777215 & (w << off | carry)).toString(16); out = 0 != (carry = w >>> 24 - off & 16777215) || i !== this.length - 1 ? zeros[6 - word.length] + word + out : word + out, (off += 2) >= 26 && (off -= 26, i--); } for (0 !== carry && (out = carry.toString(16) + out); out.length % padding != 0; ) out = "0" + out; return 0 !== this.negative && (out = "-" + out), out; } if (base === (0 | base) && base >= 2 && base <= 36) { var groupSize = groupSizes[base], groupBase = groupBases[base]; out = ""; var c = this.clone(); for (c.negative = 0; !c.isZero(); ) { var r = c.modn(groupBase).toString(base); out = (c = c.idivn(groupBase)).isZero() ? r + out : zeros[groupSize - r.length] + r + out; } for (this.isZero() && (out = "0" + out); out.length % padding != 0; ) out = "0" + out; return 0 !== this.negative && (out = "-" + out), out; } assert(!1, "Base should be between 2 and 36"); }, BN.prototype.toNumber = function() { var ret = this.words[0]; return 2 === this.length ? ret += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? ret += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && assert(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -ret : ret; }, BN.prototype.toJSON = function() { return this.toString(16); }, BN.prototype.toBuffer = function(endian, length) { return assert(void 0 !== Buffer), this.toArrayLike(Buffer, endian, length); }, BN.prototype.toArray = function(endian, length) { return this.toArrayLike(Array, endian, length); }, BN.prototype.toArrayLike = function(ArrayType, endian, length) { var byteLength = this.byteLength(), reqLength = length || Math.max(1, byteLength); assert(byteLength <= reqLength, "byte array longer than desired length"), assert(reqLength > 0, "Requested array length <= 0"), this.strip(); var b, i, littleEndian = "le" === endian, res = new ArrayType(reqLength), q = this.clone(); if (littleEndian) { for (i = 0; !q.isZero(); i++) b = q.andln(255), q.iushrn(8), res[i] = b; for (;i < reqLength; i++) res[i] = 0; } else { for (i = 0; i < reqLength - byteLength; i++) res[i] = 0; for (i = 0; !q.isZero(); i++) b = q.andln(255), q.iushrn(8), res[reqLength - i - 1] = b; } return res; }, Math.clz32 ? BN.prototype._countBits = function(w) { return 32 - Math.clz32(w); } : BN.prototype._countBits = function(w) { var t = w, r = 0; return t >= 4096 && (r += 13, t >>>= 13), t >= 64 && (r += 7, t >>>= 7), t >= 8 && (r += 4, t >>>= 4), t >= 2 && (r += 2, t >>>= 2), r + t; }, BN.prototype._zeroBits = function(w) { if (0 === w) return 26; var t = w, r = 0; return 0 == (8191 & t) && (r += 13, t >>>= 13), 0 == (127 & t) && (r += 7, t >>>= 7), 0 == (15 & t) && (r += 4, t >>>= 4), 0 == (3 & t) && (r += 2, t >>>= 2), 0 == (1 & t) && r++, r; }, BN.prototype.bitLength = function() { var w = this.words[this.length - 1], hi = this._countBits(w); return 26 * (this.length - 1) + hi; }, BN.prototype.zeroBits = function() { if (this.isZero()) return 0; for (var r = 0, i = 0; i < this.length; i++) { var b = this._zeroBits(this.words[i]); if (r += b, 26 !== b) break; } return r; }, BN.prototype.byteLength = function() { return Math.ceil(this.bitLength() / 8); }, BN.prototype.toTwos = function(width) { return 0 !== this.negative ? this.abs().inotn(width).iaddn(1) : this.clone(); }, BN.prototype.fromTwos = function(width) { return this.testn(width - 1) ? this.notn(width).iaddn(1).ineg() : this.clone(); }, BN.prototype.isNeg = function() { return 0 !== this.negative; }, BN.prototype.neg = function() { return this.clone().ineg(); }, BN.prototype.ineg = function() { return this.isZero() || (this.negative ^= 1), this; }, BN.prototype.iuor = function(num) { for (;this.length < num.length; ) this.words[this.length++] = 0; for (var i = 0; i < num.length; i++) this.words[i] = this.words[i] | num.words[i]; return this.strip(); }, BN.prototype.ior = function(num) { return assert(0 == (this.negative | num.negative)), this.iuor(num); }, BN.prototype.or = function(num) { return this.length > num.length ? this.clone().ior(num) : num.clone().ior(this); }, BN.prototype.uor = function(num) { return this.length > num.length ? this.clone().iuor(num) : num.clone().iuor(this); }, BN.prototype.iuand = function(num) { var b; b = this.length > num.length ? num : this; for (var i = 0; i < b.length; i++) this.words[i] = this.words[i] & num.words[i]; return this.length = b.length, this.strip(); }, BN.prototype.iand = function(num) { return assert(0 == (this.negative | num.negative)), this.iuand(num); }, BN.prototype.and = function(num) { return this.length > num.length ? this.clone().iand(num) : num.clone().iand(this); }, BN.prototype.uand = function(num) { return this.length > num.length ? this.clone().iuand(num) : num.clone().iuand(this); }, BN.prototype.iuxor = function(num) { var a, b; this.length > num.length ? (a = this, b = num) : (a = num, b = this); for (var i = 0; i < b.length; i++) this.words[i] = a.words[i] ^ b.words[i]; if (this !== a) for (;i < a.length; i++) this.words[i] = a.words[i]; return this.length = a.length, this.strip(); }, BN.prototype.ixor = function(num) { return assert(0 == (this.negative | num.negative)), this.iuxor(num); }, BN.prototype.xor = function(num) { return this.length > num.length ? this.clone().ixor(num) : num.clone().ixor(this); }, BN.prototype.uxor = function(num) { return this.length > num.length ? this.clone().iuxor(num) : num.clone().iuxor(this); }, BN.prototype.inotn = function(width) { assert("number" == typeof width && width >= 0); var bytesNeeded = 0 | Math.ceil(width / 26), bitsLeft = width % 26; this._expand(bytesNeeded), bitsLeft > 0 && bytesNeeded--; for (var i = 0; i < bytesNeeded; i++) this.words[i] = 67108863 & ~this.words[i]; return bitsLeft > 0 && (this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft), this.strip(); }, BN.prototype.notn = function(width) { return this.clone().inotn(width); }, BN.prototype.setn = function(bit, val) { assert("number" == typeof bit && bit >= 0); var off = bit / 26 | 0, wbit = bit % 26; return this._expand(off + 1), this.words[off] = val ? this.words[off] | 1 << wbit : this.words[off] & ~(1 << wbit), this.strip(); }, BN.prototype.iadd = function(num) { var r, a, b; if (0 !== this.negative && 0 === num.negative) return this.negative = 0, r = this.isub(num), this.negative ^= 1, this._normSign(); if (0 === this.negative && 0 !== num.negative) return num.negative = 0, r = this.isub(num), num.negative = 1, r._normSign(); this.length > num.length ? (a = this, b = num) : (a = num, b = this); for (var carry = 0, i = 0; i < b.length; i++) r = (0 | a.words[i]) + (0 | b.words[i]) + carry, this.words[i] = 67108863 & r, carry = r >>> 26; for (;0 !== carry && i < a.length; i++) r = (0 | a.words[i]) + carry, this.words[i] = 67108863 & r, carry = r >>> 26; if (this.length = a.length, 0 !== carry) this.words[this.length] = carry, this.length++; else if (a !== this) for (;i < a.length; i++) this.words[i] = a.words[i]; return this; }, BN.prototype.add = function(num) { var res; return 0 !== num.negative && 0 === this.negative ? (num.negative = 0, res = this.sub(num), num.negative ^= 1, res) : 0 === num.negative && 0 !== this.negative ? (this.negative = 0, res = num.sub(this), this.negative = 1, res) : this.length > num.length ? this.clone().iadd(num) : num.clone().iadd(this); }, BN.prototype.isub = function(num) { if (0 !== num.negative) { num.negative = 0; var r = this.iadd(num); return num.negative = 1, r._normSign(); } if (0 !== this.negative) return this.negative = 0, this.iadd(num), this.negative = 1, this._normSign(); var a, b, cmp = this.cmp(num); if (0 === cmp) return this.negative = 0, this.length = 1, this.words[0] = 0, this; cmp > 0 ? (a = this, b = num) : (a = num, b = this); for (var carry = 0, i = 0; i < b.length; i++) carry = (r = (0 | a.words[i]) - (0 | b.words[i]) + carry) >> 26, this.words[i] = 67108863 & r; for (;0 !== carry && i < a.length; i++) carry = (r = (0 | a.words[i]) + carry) >> 26, this.words[i] = 67108863 & r; if (0 === carry && i < a.length && a !== this) for (;i < a.length; i++) this.words[i] = a.words[i]; return this.length = Math.max(this.length, i), a !== this && (this.negative = 1), this.strip(); }, BN.prototype.sub = function(num) { return this.clone().isub(num); }; var comb10MulTo = function(self, num, out) { var lo, mid, hi, a = self.words, b = num.words, o = out.words, c = 0, a0 = 0 | a[0], al0 = 8191 & a0, ah0 = a0 >>> 13, a1 = 0 | a[1], al1 = 8191 & a1, ah1 = a1 >>> 13, a2 = 0 | a[2], al2 = 8191 & a2, ah2 = a2 >>> 13, a3 = 0 | a[3], al3 = 8191 & a3, ah3 = a3 >>> 13, a4 = 0 | a[4], al4 = 8191 & a4, ah4 = a4 >>> 13, a5 = 0 | a[5], al5 = 8191 & a5, ah5 = a5 >>> 13, a6 = 0 | a[6], al6 = 8191 & a6, ah6 = a6 >>> 13, a7 = 0 | a[7], al7 = 8191 & a7, ah7 = a7 >>> 13, a8 = 0 | a[8], al8 = 8191 & a8, ah8 = a8 >>> 13, a9 = 0 | a[9], al9 = 8191 & a9, ah9 = a9 >>> 13, b0 = 0 | b[0], bl0 = 8191 & b0, bh0 = b0 >>> 13, b1 = 0 | b[1], bl1 = 8191 & b1, bh1 = b1 >>> 13, b2 = 0 | b[2], bl2 = 8191 & b2, bh2 = b2 >>> 13, b3 = 0 | b[3], bl3 = 8191 & b3, bh3 = b3 >>> 13, b4 = 0 | b[4], bl4 = 8191 & b4, bh4 = b4 >>> 13, b5 = 0 | b[5], bl5 = 8191 & b5, bh5 = b5 >>> 13, b6 = 0 | b[6], bl6 = 8191 & b6, bh6 = b6 >>> 13, b7 = 0 | b[7], bl7 = 8191 & b7, bh7 = b7 >>> 13, b8 = 0 | b[8], bl8 = 8191 & b8, bh8 = b8 >>> 13, b9 = 0 | b[9], bl9 = 8191 & b9, bh9 = b9 >>> 13; out.negative = self.negative ^ num.negative, out.length = 19; var w0 = (c + (lo = Math.imul(al0, bl0)) | 0) + ((8191 & (mid = (mid = Math.imul(al0, bh0)) + Math.imul(ah0, bl0) | 0)) << 13) | 0; c = ((hi = Math.imul(ah0, bh0)) + (mid >>> 13) | 0) + (w0 >>> 26) | 0, w0 &= 67108863, lo = Math.imul(al1, bl0), mid = (mid = Math.imul(al1, bh0)) + Math.imul(ah1, bl0) | 0, hi = Math.imul(ah1, bh0); var w1 = (c + (lo = lo + Math.imul(al0, bl1) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh1) | 0) + Math.imul(ah0, bl1) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh1) | 0) + (mid >>> 13) | 0) + (w1 >>> 26) | 0, w1 &= 67108863, lo = Math.imul(al2, bl0), mid = (mid = Math.imul(al2, bh0)) + Math.imul(ah2, bl0) | 0, hi = Math.imul(ah2, bh0), lo = lo + Math.imul(al1, bl1) | 0, mid = (mid = mid + Math.imul(al1, bh1) | 0) + Math.imul(ah1, bl1) | 0, hi = hi + Math.imul(ah1, bh1) | 0; var w2 = (c + (lo = lo + Math.imul(al0, bl2) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh2) | 0) + Math.imul(ah0, bl2) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh2) | 0) + (mid >>> 13) | 0) + (w2 >>> 26) | 0, w2 &= 67108863, lo = Math.imul(al3, bl0), mid = (mid = Math.imul(al3, bh0)) + Math.imul(ah3, bl0) | 0, hi = Math.imul(ah3, bh0), lo = lo + Math.imul(al2, bl1) | 0, mid = (mid = mid + Math.imul(al2, bh1) | 0) + Math.imul(ah2, bl1) | 0, hi = hi + Math.imul(ah2, bh1) | 0, lo = lo + Math.imul(al1, bl2) | 0, mid = (mid = mid + Math.imul(al1, bh2) | 0) + Math.imul(ah1, bl2) | 0, hi = hi + Math.imul(ah1, bh2) | 0; var w3 = (c + (lo = lo + Math.imul(al0, bl3) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh3) | 0) + Math.imul(ah0, bl3) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh3) | 0) + (mid >>> 13) | 0) + (w3 >>> 26) | 0, w3 &= 67108863, lo = Math.imul(al4, bl0), mid = (mid = Math.imul(al4, bh0)) + Math.imul(ah4, bl0) | 0, hi = Math.imul(ah4, bh0), lo = lo + Math.imul(al3, bl1) | 0, mid = (mid = mid + Math.imul(al3, bh1) | 0) + Math.imul(ah3, bl1) | 0, hi = hi + Math.imul(ah3, bh1) | 0, lo = lo + Math.imul(al2, bl2) | 0, mid = (mid = mid + Math.imul(al2, bh2) | 0) + Math.imul(ah2, bl2) | 0, hi = hi + Math.imul(ah2, bh2) | 0, lo = lo + Math.imul(al1, bl3) | 0, mid = (mid = mid + Math.imul(al1, bh3) | 0) + Math.imul(ah1, bl3) | 0, hi = hi + Math.imul(ah1, bh3) | 0; var w4 = (c + (lo = lo + Math.imul(al0, bl4) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh4) | 0) + Math.imul(ah0, bl4) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh4) | 0) + (mid >>> 13) | 0) + (w4 >>> 26) | 0, w4 &= 67108863, lo = Math.imul(al5, bl0), mid = (mid = Math.imul(al5, bh0)) + Math.imul(ah5, bl0) | 0, hi = Math.imul(ah5, bh0), lo = lo + Math.imul(al4, bl1) | 0, mid = (mid = mid + Math.imul(al4, bh1) | 0) + Math.imul(ah4, bl1) | 0, hi = hi + Math.imul(ah4, bh1) | 0, lo = lo + Math.imul(al3, bl2) | 0, mid = (mid = mid + Math.imul(al3, bh2) | 0) + Math.imul(ah3, bl2) | 0, hi = hi + Math.imul(ah3, bh2) | 0, lo = lo + Math.imul(al2, bl3) | 0, mid = (mid = mid + Math.imul(al2, bh3) | 0) + Math.imul(ah2, bl3) | 0, hi = hi + Math.imul(ah2, bh3) | 0, lo = lo + Math.imul(al1, bl4) | 0, mid = (mid = mid + Math.imul(al1, bh4) | 0) + Math.imul(ah1, bl4) | 0, hi = hi + Math.imul(ah1, bh4) | 0; var w5 = (c + (lo = lo + Math.imul(al0, bl5) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh5) | 0) + Math.imul(ah0, bl5) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh5) | 0) + (mid >>> 13) | 0) + (w5 >>> 26) | 0, w5 &= 67108863, lo = Math.imul(al6, bl0), mid = (mid = Math.imul(al6, bh0)) + Math.imul(ah6, bl0) | 0, hi = Math.imul(ah6, bh0), lo = lo + Math.imul(al5, bl1) | 0, mid = (mid = mid + Math.imul(al5, bh1) | 0) + Math.imul(ah5, bl1) | 0, hi = hi + Math.imul(ah5, bh1) | 0, lo = lo + Math.imul(al4, bl2) | 0, mid = (mid = mid + Math.imul(al4, bh2) | 0) + Math.imul(ah4, bl2) | 0, hi = hi + Math.imul(ah4, bh2) | 0, lo = lo + Math.imul(al3, bl3) | 0, mid = (mid = mid + Math.imul(al3, bh3) | 0) + Math.imul(ah3, bl3) | 0, hi = hi + Math.imul(ah3, bh3) | 0, lo = lo + Math.imul(al2, bl4) | 0, mid = (mid = mid + Math.imul(al2, bh4) | 0) + Math.imul(ah2, bl4) | 0, hi = hi + Math.imul(ah2, bh4) | 0, lo = lo + Math.imul(al1, bl5) | 0, mid = (mid = mid + Math.imul(al1, bh5) | 0) + Math.imul(ah1, bl5) | 0, hi = hi + Math.imul(ah1, bh5) | 0; var w6 = (c + (lo = lo + Math.imul(al0, bl6) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh6) | 0) + Math.imul(ah0, bl6) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh6) | 0) + (mid >>> 13) | 0) + (w6 >>> 26) | 0, w6 &= 67108863, lo = Math.imul(al7, bl0), mid = (mid = Math.imul(al7, bh0)) + Math.imul(ah7, bl0) | 0, hi = Math.imul(ah7, bh0), lo = lo + Math.imul(al6, bl1) | 0, mid = (mid = mid + Math.imul(al6, bh1) | 0) + Math.imul(ah6, bl1) | 0, hi = hi + Math.imul(ah6, bh1) | 0, lo = lo + Math.imul(al5, bl2) | 0, mid = (mid = mid + Math.imul(al5, bh2) | 0) + Math.imul(ah5, bl2) | 0, hi = hi + Math.imul(ah5, bh2) | 0, lo = lo + Math.imul(al4, bl3) | 0, mid = (mid = mid + Math.imul(al4, bh3) | 0) + Math.imul(ah4, bl3) | 0, hi = hi + Math.imul(ah4, bh3) | 0, lo = lo + Math.imul(al3, bl4) | 0, mid = (mid = mid + Math.imul(al3, bh4) | 0) + Math.imul(ah3, bl4) | 0, hi = hi + Math.imul(ah3, bh4) | 0, lo = lo + Math.imul(al2, bl5) | 0, mid = (mid = mid + Math.imul(al2, bh5) | 0) + Math.imul(ah2, bl5) | 0, hi = hi + Math.imul(ah2, bh5) | 0, lo = lo + Math.imul(al1, bl6) | 0, mid = (mid = mid + Math.imul(al1, bh6) | 0) + Math.imul(ah1, bl6) | 0, hi = hi + Math.imul(ah1, bh6) | 0; var w7 = (c + (lo = lo + Math.imul(al0, bl7) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh7) | 0) + Math.imul(ah0, bl7) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh7) | 0) + (mid >>> 13) | 0) + (w7 >>> 26) | 0, w7 &= 67108863, lo = Math.imul(al8, bl0), mid = (mid = Math.imul(al8, bh0)) + Math.imul(ah8, bl0) | 0, hi = Math.imul(ah8, bh0), lo = lo + Math.imul(al7, bl1) | 0, mid = (mid = mid + Math.imul(al7, bh1) | 0) + Math.imul(ah7, bl1) | 0, hi = hi + Math.imul(ah7, bh1) | 0, lo = lo + Math.imul(al6, bl2) | 0, mid = (mid = mid + Math.imul(al6, bh2) | 0) + Math.imul(ah6, bl2) | 0, hi = hi + Math.imul(ah6, bh2) | 0, lo = lo + Math.imul(al5, bl3) | 0, mid = (mid = mid + Math.imul(al5, bh3) | 0) + Math.imul(ah5, bl3) | 0, hi = hi + Math.imul(ah5, bh3) | 0, lo = lo + Math.imul(al4, bl4) | 0, mid = (mid = mid + Math.imul(al4, bh4) | 0) + Math.imul(ah4, bl4) | 0, hi = hi + Math.imul(ah4, bh4) | 0, lo = lo + Math.imul(al3, bl5) | 0, mid = (mid = mid + Math.imul(al3, bh5) | 0) + Math.imul(ah3, bl5) | 0, hi = hi + Math.imul(ah3, bh5) | 0, lo = lo + Math.imul(al2, bl6) | 0, mid = (mid = mid + Math.imul(al2, bh6) | 0) + Math.imul(ah2, bl6) | 0, hi = hi + Math.imul(ah2, bh6) | 0, lo = lo + Math.imul(al1, bl7) | 0, mid = (mid = mid + Math.imul(al1, bh7) | 0) + Math.imul(ah1, bl7) | 0, hi = hi + Math.imul(ah1, bh7) | 0; var w8 = (c + (lo = lo + Math.imul(al0, bl8) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh8) | 0) + Math.imul(ah0, bl8) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh8) | 0) + (mid >>> 13) | 0) + (w8 >>> 26) | 0, w8 &= 67108863, lo = Math.imul(al9, bl0), mid = (mid = Math.imul(al9, bh0)) + Math.imul(ah9, bl0) | 0, hi = Math.imul(ah9, bh0), lo = lo + Math.imul(al8, bl1) | 0, mid = (mid = mid + Math.imul(al8, bh1) | 0) + Math.imul(ah8, bl1) | 0, hi = hi + Math.imul(ah8, bh1) | 0, lo = lo + Math.imul(al7, bl2) | 0, mid = (mid = mid + Math.imul(al7, bh2) | 0) + Math.imul(ah7, bl2) | 0, hi = hi + Math.imul(ah7, bh2) | 0, lo = lo + Math.imul(al6, bl3) | 0, mid = (mid = mid + Math.imul(al6, bh3) | 0) + Math.imul(ah6, bl3) | 0, hi = hi + Math.imul(ah6, bh3) | 0, lo = lo + Math.imul(al5, bl4) | 0, mid = (mid = mid + Math.imul(al5, bh4) | 0) + Math.imul(ah5, bl4) | 0, hi = hi + Math.imul(ah5, bh4) | 0, lo = lo + Math.imul(al4, bl5) | 0, mid = (mid = mid + Math.imul(al4, bh5) | 0) + Math.imul(ah4, bl5) | 0, hi = hi + Math.imul(ah4, bh5) | 0, lo = lo + Math.imul(al3, bl6) | 0, mid = (mid = mid + Math.imul(al3, bh6) | 0) + Math.imul(ah3, bl6) | 0, hi = hi + Math.imul(ah3, bh6) | 0, lo = lo + Math.imul(al2, bl7) | 0, mid = (mid = mid + Math.imul(al2, bh7) | 0) + Math.imul(ah2, bl7) | 0, hi = hi + Math.imul(ah2, bh7) | 0, lo = lo + Math.imul(al1, bl8) | 0, mid = (mid = mid + Math.imul(al1, bh8) | 0) + Math.imul(ah1, bl8) | 0, hi = hi + Math.imul(ah1, bh8) | 0; var w9 = (c + (lo = lo + Math.imul(al0, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al0, bh9) | 0) + Math.imul(ah0, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah0, bh9) | 0) + (mid >>> 13) | 0) + (w9 >>> 26) | 0, w9 &= 67108863, lo = Math.imul(al9, bl1), mid = (mid = Math.imul(al9, bh1)) + Math.imul(ah9, bl1) | 0, hi = Math.imul(ah9, bh1), lo = lo + Math.imul(al8, bl2) | 0, mid = (mid = mid + Math.imul(al8, bh2) | 0) + Math.imul(ah8, bl2) | 0, hi = hi + Math.imul(ah8, bh2) | 0, lo = lo + Math.imul(al7, bl3) | 0, mid = (mid = mid + Math.imul(al7, bh3) | 0) + Math.imul(ah7, bl3) | 0, hi = hi + Math.imul(ah7, bh3) | 0, lo = lo + Math.imul(al6, bl4) | 0, mid = (mid = mid + Math.imul(al6, bh4) | 0) + Math.imul(ah6, bl4) | 0, hi = hi + Math.imul(ah6, bh4) | 0, lo = lo + Math.imul(al5, bl5) | 0, mid = (mid = mid + Math.imul(al5, bh5) | 0) + Math.imul(ah5, bl5) | 0, hi = hi + Math.imul(ah5, bh5) | 0, lo = lo + Math.imul(al4, bl6) | 0, mid = (mid = mid + Math.imul(al4, bh6) | 0) + Math.imul(ah4, bl6) | 0, hi = hi + Math.imul(ah4, bh6) | 0, lo = lo + Math.imul(al3, bl7) | 0, mid = (mid = mid + Math.imul(al3, bh7) | 0) + Math.imul(ah3, bl7) | 0, hi = hi + Math.imul(ah3, bh7) | 0, lo = lo + Math.imul(al2, bl8) | 0, mid = (mid = mid + Math.imul(al2, bh8) | 0) + Math.imul(ah2, bl8) | 0, hi = hi + Math.imul(ah2, bh8) | 0; var w10 = (c + (lo = lo + Math.imul(al1, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al1, bh9) | 0) + Math.imul(ah1, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah1, bh9) | 0) + (mid >>> 13) | 0) + (w10 >>> 26) | 0, w10 &= 67108863, lo = Math.imul(al9, bl2), mid = (mid = Math.imul(al9, bh2)) + Math.imul(ah9, bl2) | 0, hi = Math.imul(ah9, bh2), lo = lo + Math.imul(al8, bl3) | 0, mid = (mid = mid + Math.imul(al8, bh3) | 0) + Math.imul(ah8, bl3) | 0, hi = hi + Math.imul(ah8, bh3) | 0, lo = lo + Math.imul(al7, bl4) | 0, mid = (mid = mid + Math.imul(al7, bh4) | 0) + Math.imul(ah7, bl4) | 0, hi = hi + Math.imul(ah7, bh4) | 0, lo = lo + Math.imul(al6, bl5) | 0, mid = (mid = mid + Math.imul(al6, bh5) | 0) + Math.imul(ah6, bl5) | 0, hi = hi + Math.imul(ah6, bh5) | 0, lo = lo + Math.imul(al5, bl6) | 0, mid = (mid = mid + Math.imul(al5, bh6) | 0) + Math.imul(ah5, bl6) | 0, hi = hi + Math.imul(ah5, bh6) | 0, lo = lo + Math.imul(al4, bl7) | 0, mid = (mid = mid + Math.imul(al4, bh7) | 0) + Math.imul(ah4, bl7) | 0, hi = hi + Math.imul(ah4, bh7) | 0, lo = lo + Math.imul(al3, bl8) | 0, mid = (mid = mid + Math.imul(al3, bh8) | 0) + Math.imul(ah3, bl8) | 0, hi = hi + Math.imul(ah3, bh8) | 0; var w11 = (c + (lo = lo + Math.imul(al2, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al2, bh9) | 0) + Math.imul(ah2, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah2, bh9) | 0) + (mid >>> 13) | 0) + (w11 >>> 26) | 0, w11 &= 67108863, lo = Math.imul(al9, bl3), mid = (mid = Math.imul(al9, bh3)) + Math.imul(ah9, bl3) | 0, hi = Math.imul(ah9, bh3), lo = lo + Math.imul(al8, bl4) | 0, mid = (mid = mid + Math.imul(al8, bh4) | 0) + Math.imul(ah8, bl4) | 0, hi = hi + Math.imul(ah8, bh4) | 0, lo = lo + Math.imul(al7, bl5) | 0, mid = (mid = mid + Math.imul(al7, bh5) | 0) + Math.imul(ah7, bl5) | 0, hi = hi + Math.imul(ah7, bh5) | 0, lo = lo + Math.imul(al6, bl6) | 0, mid = (mid = mid + Math.imul(al6, bh6) | 0) + Math.imul(ah6, bl6) | 0, hi = hi + Math.imul(ah6, bh6) | 0, lo = lo + Math.imul(al5, bl7) | 0, mid = (mid = mid + Math.imul(al5, bh7) | 0) + Math.imul(ah5, bl7) | 0, hi = hi + Math.imul(ah5, bh7) | 0, lo = lo + Math.imul(al4, bl8) | 0, mid = (mid = mid + Math.imul(al4, bh8) | 0) + Math.imul(ah4, bl8) | 0, hi = hi + Math.imul(ah4, bh8) | 0; var w12 = (c + (lo = lo + Math.imul(al3, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al3, bh9) | 0) + Math.imul(ah3, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah3, bh9) | 0) + (mid >>> 13) | 0) + (w12 >>> 26) | 0, w12 &= 67108863, lo = Math.imul(al9, bl4), mid = (mid = Math.imul(al9, bh4)) + Math.imul(ah9, bl4) | 0, hi = Math.imul(ah9, bh4), lo = lo + Math.imul(al8, bl5) | 0, mid = (mid = mid + Math.imul(al8, bh5) | 0) + Math.imul(ah8, bl5) | 0, hi = hi + Math.imul(ah8, bh5) | 0, lo = lo + Math.imul(al7, bl6) | 0, mid = (mid = mid + Math.imul(al7, bh6) | 0) + Math.imul(ah7, bl6) | 0, hi = hi + Math.imul(ah7, bh6) | 0, lo = lo + Math.imul(al6, bl7) | 0, mid = (mid = mid + Math.imul(al6, bh7) | 0) + Math.imul(ah6, bl7) | 0, hi = hi + Math.imul(ah6, bh7) | 0, lo = lo + Math.imul(al5, bl8) | 0, mid = (mid = mid + Math.imul(al5, bh8) | 0) + Math.imul(ah5, bl8) | 0, hi = hi + Math.imul(ah5, bh8) | 0; var w13 = (c + (lo = lo + Math.imul(al4, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al4, bh9) | 0) + Math.imul(ah4, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah4, bh9) | 0) + (mid >>> 13) | 0) + (w13 >>> 26) | 0, w13 &= 67108863, lo = Math.imul(al9, bl5), mid = (mid = Math.imul(al9, bh5)) + Math.imul(ah9, bl5) | 0, hi = Math.imul(ah9, bh5), lo = lo + Math.imul(al8, bl6) | 0, mid = (mid = mid + Math.imul(al8, bh6) | 0) + Math.imul(ah8, bl6) | 0, hi = hi + Math.imul(ah8, bh6) | 0, lo = lo + Math.imul(al7, bl7) | 0, mid = (mid = mid + Math.imul(al7, bh7) | 0) + Math.imul(ah7, bl7) | 0, hi = hi + Math.imul(ah7, bh7) | 0, lo = lo + Math.imul(al6, bl8) | 0, mid = (mid = mid + Math.imul(al6, bh8) | 0) + Math.imul(ah6, bl8) | 0, hi = hi + Math.imul(ah6, bh8) | 0; var w14 = (c + (lo = lo + Math.imul(al5, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al5, bh9) | 0) + Math.imul(ah5, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah5, bh9) | 0) + (mid >>> 13) | 0) + (w14 >>> 26) | 0, w14 &= 67108863, lo = Math.imul(al9, bl6), mid = (mid = Math.imul(al9, bh6)) + Math.imul(ah9, bl6) | 0, hi = Math.imul(ah9, bh6), lo = lo + Math.imul(al8, bl7) | 0, mid = (mid = mid + Math.imul(al8, bh7) | 0) + Math.imul(ah8, bl7) | 0, hi = hi + Math.imul(ah8, bh7) | 0, lo = lo + Math.imul(al7, bl8) | 0, mid = (mid = mid + Math.imul(al7, bh8) | 0) + Math.imul(ah7, bl8) | 0, hi = hi + Math.imul(ah7, bh8) | 0; var w15 = (c + (lo = lo + Math.imul(al6, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al6, bh9) | 0) + Math.imul(ah6, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah6, bh9) | 0) + (mid >>> 13) | 0) + (w15 >>> 26) | 0, w15 &= 67108863, lo = Math.imul(al9, bl7), mid = (mid = Math.imul(al9, bh7)) + Math.imul(ah9, bl7) | 0, hi = Math.imul(ah9, bh7), lo = lo + Math.imul(al8, bl8) | 0, mid = (mid = mid + Math.imul(al8, bh8) | 0) + Math.imul(ah8, bl8) | 0, hi = hi + Math.imul(ah8, bh8) | 0; var w16 = (c + (lo = lo + Math.imul(al7, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al7, bh9) | 0) + Math.imul(ah7, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah7, bh9) | 0) + (mid >>> 13) | 0) + (w16 >>> 26) | 0, w16 &= 67108863, lo = Math.imul(al9, bl8), mid = (mid = Math.imul(al9, bh8)) + Math.imul(ah9, bl8) | 0, hi = Math.imul(ah9, bh8); var w17 = (c + (lo = lo + Math.imul(al8, bl9) | 0) | 0) + ((8191 & (mid = (mid = mid + Math.imul(al8, bh9) | 0) + Math.imul(ah8, bl9) | 0)) << 13) | 0; c = ((hi = hi + Math.imul(ah8, bh9) | 0) + (mid >>> 13) | 0) + (w17 >>> 26) | 0, w17 &= 67108863; var w18 = (c + (lo = Math.imul(al9, bl9)) | 0) + ((8191 & (mid = (mid = Math.imul(al9, bh9)) + Math.imul(ah9, bl9) | 0)) << 13) | 0; return c = ((hi = Math.imul(ah9, bh9)) + (mid >>> 13) | 0) + (w18 >>> 26) | 0, w18 &= 67108863, o[0] = w0, o[1] = w1, o[2] = w2, o[3] = w3, o[4] = w4, o[5] = w5, o[6] = w6, o[7] = w7, o[8] = w8, o[9] = w9, o[10] = w10, o[11] = w11, o[12] = w12, o[13] = w13, o[14] = w14, o[15] = w15, o[16] = w16, o[17] = w17, o[18] = w18, 0 !== c && (o[19] = c, out.length++), out; }; function jumboMulTo(self, num, out) { return (new FFTM).mulp(self, num, out); } function FFTM(x, y) { this.x = x, this.y = y; } Math.imul || (comb10MulTo = smallMulTo), BN.prototype.mulTo = function(num, out) { var res, len = this.length + num.length; return res = 10 === this.length && 10 === num.length ? comb10MulTo(this, num, out) : len < 63 ? smallMulTo(this, num, out) : len < 1024 ? (function(self, num, out) { out.negative = num.negative ^ self.negative, out.length = self.length + num.length; for (var carry = 0, hncarry = 0, k = 0; k < out.length - 1; k++) { var ncarry = hncarry; hncarry = 0; for (var rword = 67108863 & carry, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { var i = k - j, r = (0 | self.words[i]) * (0 | num.words[j]), lo = 67108863 & r; rword = 67108863 & (lo = lo + rword | 0), hncarry += (ncarry = (ncarry = ncarry + (r / 67108864 | 0) | 0) + (lo >>> 26) | 0) >>> 26, ncarry &= 67108863; } out.words[k] = rword, carry = ncarry, ncarry = hncarry; } return 0 !== carry ? out.words[k] = carry : out.length--, out.strip(); })(this, num, out) : jumboMulTo(this, num, out), res; }, FFTM.prototype.makeRBT = function(N) { for (var t = new Array(N), l = BN.prototype._countBits(N) - 1, i = 0; i < N; i++) t[i] = this.revBin(i, l, N); return t; }, FFTM.prototype.revBin = function(x, l, N) { if (0 === x || x === N - 1) return x; for (var rb = 0, i = 0; i < l; i++) rb |= (1 & x) << l - i - 1, x >>= 1; return rb; }, FFTM.prototype.permute = function(rbt, rws, iws, rtws, itws, N) { for (var i = 0; i < N; i++) rtws[i] = rws[rbt[i]], itws[i] = iws[rbt[i]]; }, FFTM.prototype.transform = function(rws, iws, rtws, itws, N, rbt) { this.permute(rbt, rws, iws, rtws, itws, N); for (var s = 1; s < N; s <<= 1) for (var l = s << 1, rtwdf = Math.cos(2 * Math.PI / l), itwdf = Math.sin(2 * Math.PI / l), p = 0; p < N; p += l) for (var rtwdf_ = rtwdf, itwdf_ = itwdf, j = 0; j < s; j++) { var re = rtws[p + j], ie = itws[p + j], ro = rtws[p + j + s], io = itws[p + j + s], rx = rtwdf_ * ro - itwdf_ * io; io = rtwdf_ * io + itwdf_ * ro, ro = rx, rtws[p + j] = re + ro, itws[p + j] = ie + io, rtws[p + j + s] = re - ro, itws[p + j + s] = ie - io, j !== l && (rx = rtwdf * rtwdf_ - itwdf * itwdf_, itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_, rtwdf_ = rx); } }, FFTM.prototype.guessLen13b = function(n, m) { var N = 1 | Math.max(m, n), odd = 1 & N, i = 0; for (N = N / 2 | 0; N; N >>>= 1) i++; return 1 << i + 1 + odd; }, FFTM.prototype.conjugate = function(rws, iws, N) { if (!(N <= 1)) for (var i = 0; i < N / 2; i++) { var t = rws[i]; rws[i] = rws[N - i - 1], rws[N - i - 1] = t, t = iws[i], iws[i] = -iws[N - i - 1], iws[N - i - 1] = -t; } }, FFTM.prototype.normalize13b = function(ws, N) { for (var carry = 0, i = 0; i < N / 2; i++) { var w = 8192 * Math.round(ws[2 * i + 1] / N) + Math.round(ws[2 * i] / N) + carry; ws[i] = 67108863 & w, carry = w < 67108864 ? 0 : w / 67108864 | 0; } return ws; }, FFTM.prototype.convert13b = function(ws, len, rws, N) { for (var carry = 0, i = 0; i < len; i++) carry += 0 | ws[i], rws[2 * i] = 8191 & carry, carry >>>= 13, rws[2 * i + 1] = 8191 & carry, carry >>>= 13; for (i = 2 * len; i < N; ++i) rws[i] = 0; assert(0 === carry), assert(0 == (-8192 & carry)); }, FFTM.prototype.stub = function(N) { for (var ph = new Array(N), i = 0; i < N; i++) ph[i] = 0; return ph; }, FFTM.prototype.mulp = function(x, y, out) { var N = 2 * this.guessLen13b(x.length, y.length), rbt = this.makeRBT(N), _ = this.stub(N), rws = new Array(N), rwst = new Array(N), iwst = new Array(N), nrws = new Array(N), nrwst = new Array(N), niwst = new Array(N), rmws = out.words; rmws.length = N, this.convert13b(x.words, x.length, rws, N), this.convert13b(y.words, y.length, nrws, N), this.transform(rws, _, rwst, iwst, N, rbt), this.transform(nrws, _, nrwst, niwst, N, rbt); for (var i = 0; i < N; i++) { var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i], rwst[i] = rx; } return this.conjugate(rwst, iwst, N), this.transform(rwst, iwst, rmws, _, N, rbt), this.conjugate(rmws, _, N), this.normalize13b(rmws, N), out.negative = x.negative ^ y.negative, out.length = x.length + y.length, out.strip(); }, BN.prototype.mul = function(num) { var out = new BN(null); return out.words = new Array(this.length + num.length), this.mulTo(num, out); }, BN.prototype.mulf = function(num) { var out = new BN(null); return out.words = new Array(this.length + num.length), jumboMulTo(this, num, out); }, BN.prototype.imul = function(num) { return this.clone().mulTo(num, this); }, BN.prototype.imuln = function(num) { assert("number" == typeof num), assert(num < 67108864); for (var carry = 0, i = 0; i < this.length; i++) { var w = (0 | this.words[i]) * num, lo = (67108863 & w) + (67108863 & carry); carry >>= 26, carry += w / 67108864 | 0, carry += lo >>> 26, this.words[i] = 67108863 & lo; } return 0 !== carry && (this.words[i] = carry, this.length++), this; }, BN.prototype.muln = function(num) { return this.clone().imuln(num); }, BN.prototype.sqr = function() { return this.mul(this); }, BN.prototype.isqr = function() { return this.imul(this.clone()); }, BN.prototype.pow = function(num) { var w = (function(num) { for (var w = new Array(num.bitLength()), bit = 0; bit < w.length; bit++) { var off = bit / 26 | 0, wbit = bit % 26; w[bit] = (num.words[off] & 1 << wbit) >>> wbit; } return w; })(num); if (0 === w.length) return new BN(1); for (var res = this, i = 0; i < w.length && 0 === w[i]; i++, res = res.sqr()) ; if (++i < w.length) for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) 0 !== w[i] && (res = res.mul(q)); return res; }, BN.prototype.iushln = function(bits) { assert("number" == typeof bits && bits >= 0); var i, r = bits % 26, s = (bits - r) / 26, carryMask = 67108863 >>> 26 - r << 26 - r; if (0 !== r) { var carry = 0; for (i = 0; i < this.length; i++) { var newCarry = this.words[i] & carryMask, c = (0 | this.words[i]) - newCarry << r; this.words[i] = c | carry, carry = newCarry >>> 26 - r; } carry && (this.words[i] = carry, this.length++); } if (0 !== s) { for (i = this.length - 1; i >= 0; i--) this.words[i + s] = this.words[i]; for (i = 0; i < s; i++) this.words[i] = 0; this.length += s; } return this.strip(); }, BN.prototype.ishln = function(bits) { return assert(0 === this.negative), this.iushln(bits); }, BN.prototype.iushrn = function(bits, hint, extended) { var h; assert("number" == typeof bits && bits >= 0), h = hint ? (hint - hint % 26) / 26 : 0; var r = bits % 26, s = Math.min((bits - r) / 26, this.length), mask = 67108863 ^ 67108863 >>> r << r, maskedWords = extended; if (h -= s, h = Math.max(0, h), maskedWords) { for (var i = 0; i < s; i++) maskedWords.words[i] = this.words[i]; maskedWords.length = s; } if (0 === s) ; else if (this.length > s) for (this.length -= s, i = 0; i < this.length; i++) this.words[i] = this.words[i + s]; else this.words[0] = 0, this.length = 1; var carry = 0; for (i = this.length - 1; i >= 0 && (0 !== carry || i >= h); i--) { var word = 0 | this.words[i]; this.words[i] = carry << 26 - r | word >>> r, carry = word & mask; } return maskedWords && 0 !== carry && (maskedWords.words[maskedWords.length++] = carry), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip(); }, BN.prototype.ishrn = function(bits, hint, extended) { return assert(0 === this.negative), this.iushrn(bits, hint, extended); }, BN.prototype.shln = function(bits) { return this.clone().ishln(bits); }, BN.prototype.ushln = function(bits) { return this.clone().iushln(bits); }, BN.prototype.shrn = function(bits) { return this.clone().ishrn(bits); }, BN.prototype.ushrn = function(bits) { return this.clone().iushrn(bits); }, BN.prototype.testn = function(bit) { assert("number" == typeof bit && bit >= 0); var r = bit % 26, s = (bit - r) / 26, q = 1 << r; return !(this.length <= s || !(this.words[s] & q)); }, BN.prototype.imaskn = function(bits) { assert("number" == typeof bits && bits >= 0); var r = bits % 26, s = (bits - r) / 26; if (assert(0 === this.negative, "imaskn works only with positive numbers"), this.length <= s) return this; if (0 !== r && s++, this.length = Math.min(s, this.length), 0 !== r) { var mask = 67108863 ^ 67108863 >>> r << r; this.words[this.length - 1] &= mask; } return this.strip(); }, BN.prototype.maskn = function(bits) { return this.clone().imaskn(bits); }, BN.prototype.iaddn = function(num) { return assert("number" == typeof num), assert(num < 67108864), num < 0 ? this.isubn(-num) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < num ? (this.words[0] = num - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(num), this.negative = 1, this) : this._iaddn(num); }, BN.prototype._iaddn = function(num) { this.words[0] += num; for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) this.words[i] -= 67108864, i === this.length - 1 ? this.words[i + 1] = 1 : this.words[i + 1]++; return this.length = Math.max(this.length, i + 1), this; }, BN.prototype.isubn = function(num) { if (assert("number" == typeof num), assert(num < 67108864), num < 0) return this.iaddn(-num); if (0 !== this.negative) return this.negative = 0, this.iaddn(num), this.negative = 1, this; if (this.words[0] -= num, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1; else for (var i = 0; i < this.length && this.words[i] < 0; i++) this.words[i] += 67108864, this.words[i + 1] -= 1; return this.strip(); }, BN.prototype.addn = function(num) { return this.clone().iaddn(num); }, BN.prototype.subn = function(num) { return this.clone().isubn(num); }, BN.prototype.iabs = function() { return this.negative = 0, this; }, BN.prototype.abs = function() { return this.clone().iabs(); }, BN.prototype._ishlnsubmul = function(num, mul, shift) { var i, w, len = num.length + shift; this._expand(len); var carry = 0; for (i = 0; i < num.length; i++) { w = (0 | this.words[i + shift]) + carry; var right = (0 | num.words[i]) * mul; carry = ((w -= 67108863 & right) >> 26) - (right / 67108864 | 0), this.words[i + shift] = 67108863 & w; } for (;i < this.length - shift; i++) carry = (w = (0 | this.words[i + shift]) + carry) >> 26, this.words[i + shift] = 67108863 & w; if (0 === carry) return this.strip(); for (assert(-1 === carry), carry = 0, i = 0; i < this.length; i++) carry = (w = -(0 | this.words[i]) + carry) >> 26, this.words[i] = 67108863 & w; return this.negative = 1, this.strip(); }, BN.prototype._wordDiv = function(num, mode) { var shift = (this.length, num.length), a = this.clone(), b = num, bhi = 0 | b.words[b.length - 1]; 0 != (shift = 26 - this._countBits(bhi)) && (b = b.ushln(shift), a.iushln(shift), bhi = 0 | b.words[b.length - 1]); var q, m = a.length - b.length; if ("mod" !== mode) { (q = new BN(null)).length = m + 1, q.words = new Array(q.length); for (var i = 0; i < q.length; i++) q.words[i] = 0; } var diff = a.clone()._ishlnsubmul(b, 1, m); 0 === diff.negative && (a = diff, q && (q.words[m] = 1)); for (var j = m - 1; j >= 0; j--) { var qj = 67108864 * (0 | a.words[b.length + j]) + (0 | a.words[b.length + j - 1]); for (qj = Math.min(qj / bhi | 0, 67108863), a._ishlnsubmul(b, qj, j); 0 !== a.negative; ) qj--, a.negative = 0, a._ishlnsubmul(b, 1, j), a.isZero() || (a.negative ^= 1); q && (q.words[j] = qj); } return q && q.strip(), a.strip(), "div" !== mode && 0 !== shift && a.iushrn(shift), { div: q || null, mod: a }; }, BN.prototype.divmod = function(num, mode, positive) { return assert(!num.isZero()), this.isZero() ? { div: new BN(0), mod: new BN(0) } : 0 !== this.negative && 0 === num.negative ? (res = this.neg().divmod(num, mode), "mod" !== mode && (div = res.div.neg()), "div" !== mode && (mod = res.mod.neg(), positive && 0 !== mod.negative && mod.iadd(num)), { div: div, mod: mod }) : 0 === this.negative && 0 !== num.negative ? (res = this.divmod(num.neg(), mode), "mod" !== mode && (div = res.div.neg()), { div: div, mod: res.mod }) : 0 != (this.negative & num.negative) ? (res = this.neg().divmod(num.neg(), mode), "div" !== mode && (mod = res.mod.neg(), positive && 0 !== mod.negative && mod.isub(num)), { div: res.div, mod: mod }) : num.length > this.length || this.cmp(num) < 0 ? { div: new BN(0), mod: this } : 1 === num.length ? "div" === mode ? { div: this.divn(num.words[0]), mod: null } : "mod" === mode ? { div: null, mod: new BN(this.modn(num.words[0])) } : { div: this.divn(num.words[0]), mod: new BN(this.modn(num.words[0])) } : this._wordDiv(num, mode); var div, mod, res; }, BN.prototype.div = function(num) { return this.divmod(num, "div", !1).div; }, BN.prototype.mod = function(num) { return this.divmod(num, "mod", !1).mod; }, BN.prototype.umod = function(num) { return this.divmod(num, "mod", !0).mod; }, BN.prototype.divRound = function(num) { var dm = this.divmod(num); if (dm.mod.isZero()) return dm.div; var mod = 0 !== dm.div.negative ? dm.mod.isub(num) : dm.mod, half = num.ushrn(1), r2 = num.andln(1), cmp = mod.cmp(half); return cmp < 0 || 1 === r2 && 0 === cmp ? dm.div : 0 !== dm.div.negative ? dm.div.isubn(1) : dm.div.iaddn(1); }, BN.prototype.modn = function(num) { assert(num <= 67108863); for (var p = (1 << 26) % num, acc = 0, i = this.length - 1; i >= 0; i--) acc = (p * acc + (0 | this.words[i])) % num; return acc; }, BN.prototype.idivn = function(num) { assert(num <= 67108863); for (var carry = 0, i = this.length - 1; i >= 0; i--) { var w = (0 | this.words[i]) + 67108864 * carry; this.words[i] = w / num | 0, carry = w % num; } return this.strip(); }, BN.prototype.divn = function(num) { return this.clone().idivn(num); }, BN.prototype.egcd = function(p) { assert(0 === p.negative), assert(!p.isZero()); var x = this, y = p.clone(); x = 0 !== x.negative ? x.umod(p) : x.clone(); for (var A = new BN(1), B = new BN(0), C = new BN(0), D = new BN(1), g = 0; x.isEven() && y.isEven(); ) x.iushrn(1), y.iushrn(1), ++g; for (var yp = y.clone(), xp = x.clone(); !x.isZero(); ) { for (var i = 0, im = 1; 0 == (x.words[0] & im) && i < 26; ++i, im <<= 1) ; if (i > 0) for (x.iushrn(i); i-- > 0; ) (A.isOdd() || B.isOdd()) && (A.iadd(yp), B.isub(xp)), A.iushrn(1), B.iushrn(1); for (var j = 0, jm = 1; 0 == (y.words[0] & jm) && j < 26; ++j, jm <<= 1) ; if (j > 0) for (y.iushrn(j); j-- > 0; ) (C.isOdd() || D.isOdd()) && (C.iadd(yp), D.isub(xp)), C.iushrn(1), D.iushrn(1); x.cmp(y) >= 0 ? (x.isub(y), A.isub(C), B.isub(D)) : (y.isub(x), C.isub(A), D.isub(B)); } return { a: C, b: D, gcd: y.iushln(g) }; }, BN.prototype._invmp = function(p) { assert(0 === p.negative), assert(!p.isZero()); var a = this, b = p.clone(); a = 0 !== a.negative ? a.umod(p) : a.clone(); for (var res, x1 = new BN(1), x2 = new BN(0), delta = b.clone(); a.cmpn(1) > 0 && b.cmpn(1) > 0; ) { for (var i = 0, im = 1; 0 == (a.words[0] & im) && i < 26; ++i, im <<= 1) ; if (i > 0) for (a.iushrn(i); i-- > 0; ) x1.isOdd() && x1.iadd(delta), x1.iushrn(1); for (var j = 0, jm = 1; 0 == (b.words[0] & jm) && j < 26; ++j, jm <<= 1) ; if (j > 0) for (b.iushrn(j); j-- > 0; ) x2.isOdd() && x2.iadd(delta), x2.iushrn(1); a.cmp(b) >= 0 ? (a.isub(b), x1.isub(x2)) : (b.isub(a), x2.isub(x1)); } return (res = 0 === a.cmpn(1) ? x1 : x2).cmpn(0) < 0 && res.iadd(p), res; }, BN.prototype.gcd = function(num) { if (this.isZero()) return num.abs(); if (num.isZero()) return this.abs(); var a = this.clone(), b = num.clone(); a.negative = 0, b.negative = 0; for (var shift = 0; a.isEven() && b.isEven(); shift++) a.iushrn(1), b.iushrn(1); for (;;) { for (;a.isEven(); ) a.iushrn(1); for (;b.isEven(); ) b.iushrn(1); var r = a.cmp(b); if (r < 0) { var t = a; a = b, b = t; } else if (0 === r || 0 === b.cmpn(1)) break; a.isub(b); } return b.iushln(shift); }, BN.prototype.invm = function(num) { return this.egcd(num).a.umod(num); }, BN.prototype.isEven = function() { return 0 == (1 & this.words[0]); }, BN.prototype.isOdd = function() { return 1 == (1 & this.words[0]); }, BN.prototype.andln = function(num) { return this.words[0] & num; }, BN.prototype.bincn = function(bit) { assert("number" == typeof bit); var r = bit % 26, s = (bit - r) / 26, q = 1 << r; if (this.length <= s) return this._expand(s + 1), this.words[s] |= q, this; for (var carry = q, i = s; 0 !== carry && i < this.length; i++) { var w = 0 | this.words[i]; carry = (w += carry) >>> 26, w &= 67108863, this.words[i] = w; } return 0 !== carry && (this.words[i] = carry, this.length++), this; }, BN.prototype.isZero = function() { return 1 === this.length && 0 === this.words[0]; }, BN.prototype.cmpn = function(num) { var res, negative = num < 0; if (0 !== this.negative && !negative) return -1; if (0 === this.negative && negative) return 1; if (this.strip(), this.length > 1) res = 1; else { negative && (num = -num), assert(num <= 67108863, "Number is too big"); var w = 0 | this.words[0]; res = w === num ? 0 : w < num ? -1 : 1; } return 0 !== this.negative ? 0 | -res : res; }, BN.prototype.cmp = function(num) { if (0 !== this.negative && 0 === num.negative) return -1; if (0 === this.negative && 0 !== num.negative) return 1; var res = this.ucmp(num); return 0 !== this.negative ? 0 | -res : res; }, BN.prototype.ucmp = function(num) { if (this.length > num.length) return 1; if (this.length < num.length) return -1; for (var res = 0, i = this.length - 1; i >= 0; i--) { var a = 0 | this.words[i], b = 0 | num.words[i]; if (a !== b) { a < b ? res = -1 : a > b && (res = 1); break; } } return res; }, BN.prototype.gtn = function(num) { return 1 === this.cmpn(num); }, BN.prototype.gt = function(num) { return 1 === this.cmp(num); }, BN.prototype.gten = function(num) { return this.cmpn(num) >= 0; }, BN.prototype.gte = function(num) { return this.cmp(num) >= 0; }, BN.prototype.ltn = function(num) { return -1 === this.cmpn(num); }, BN.prototype.lt = function(num) { return -1 === this.cmp(num); }, BN.prototype.lten = function(num) { return this.cmpn(num) <= 0; }, BN.prototype.lte = function(num) { return this.cmp(num) <= 0; }, BN.prototype.eqn = function(num) { return 0 === this.cmpn(num); }, BN.prototype.eq = function(num) { return 0 === this.cmp(num); }, BN.red = function(num) { return new Red(num); }, BN.prototype.toRed = function(ctx) { return assert(!this.red, "Already a number in reduction context"), assert(0 === this.negative, "red works only with positives"), ctx.convertTo(this)._forceRed(ctx); }, BN.prototype.fromRed = function() { return assert(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); }, BN.prototype._forceRed = function(ctx) { return this.red = ctx, this; }, BN.prototype.forceRed = function(ctx) { return assert(!this.red, "Already a number in reduction context"), this._forceRed(ctx); }, BN.prototype.redAdd = function(num) { return assert(this.red, "redAdd works only with red numbers"), this.red.add(this, num); }, BN.prototype.redIAdd = function(num) { return assert(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, num); }, BN.prototype.redSub = function(num) { return assert(this.red, "redSub works only with red numbers"), this.red.sub(this, num); }, BN.prototype.redISub = function(num) { return assert(this.red, "redISub works only with red numbers"), this.red.isub(this, num); }, BN.prototype.redShl = function(num) { return assert(this.red, "redShl works only with red numbers"), this.red.shl(this, num); }, BN.prototype.redMul = function(num) { return assert(this.red, "redMul works only with red numbers"), this.red._verify2(this, num), this.red.mul(this, num); }, BN.prototype.redIMul = function(num) { return assert(this.red, "redMul works only with red numbers"), this.red._verify2(this, num), this.red.imul(this, num); }, BN.prototype.redSqr = function() { return assert(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); }, BN.prototype.redISqr = function() { return assert(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); }, BN.prototype.redSqrt = function() { return assert(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); }, BN.prototype.redInvm = function() { return assert(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); }, BN.prototype.redNeg = function() { return assert(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); }, BN.prototype.redPow = function(num) { return assert(this.red && !num.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, num); }; var primes = { k256: null, p224: null, p192: null, p25519: null }; function MPrime(name, p) { this.name = name, this.p = new BN(p, 16), this.n = this.p.bitLength(), this.k = new BN(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); } function K256() { MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); } function P224() { MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); } function P192() { MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); } function P25519() { MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); } function Red(m) { if ("string" == typeof m) { var prime = BN._prime(m); this.m = prime.p, this.prime = prime; } else assert(m.gtn(1), "modulus must be greater than 1"), this.m = m, this.prime = null; } function Mont(m) { Red.call(this, m), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new BN(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv); } MPrime.prototype._tmp = function() { var tmp = new BN(null); return tmp.words = new Array(Math.ceil(this.n / 13)), tmp; }, MPrime.prototype.ireduce = function(num) { var rlen, r = num; do { this.split(r, this.tmp), rlen = (r = (r = this.imulK(r)).iadd(this.tmp)).bitLength(); } while (rlen > this.n); var cmp = rlen < this.n ? -1 : r.ucmp(this.p); return 0 === cmp ? (r.words[0] = 0, r.length = 1) : cmp > 0 ? r.isub(this.p) : r.strip(), r; }, MPrime.prototype.split = function(input, out) { input.iushrn(this.n, 0, out); }, MPrime.prototype.imulK = function(num) { return num.imul(this.k); }, inherits(K256, MPrime), K256.prototype.split = function(input, output) { for (var outLen = Math.min(input.length, 9), i = 0; i < outLen; i++) output.words[i] = input.words[i]; if (output.length = outLen, input.length <= 9) return input.words[0] = 0, void (input.length = 1); var prev = input.words[9]; for (output.words[output.length++] = 4194303 & prev, i = 10; i < input.length; i++) { var next = 0 | input.words[i]; input.words[i - 10] = (4194303 & next) << 4 | prev >>> 22, prev = next; } prev >>>= 22, input.words[i - 10] = prev, 0 === prev && input.length > 10 ? input.length -= 10 : input.length -= 9; }, K256.prototype.imulK = function(num) { num.words[num.length] = 0, num.words[num.length + 1] = 0, num.length += 2; for (var lo = 0, i = 0; i < num.length; i++) { var w = 0 | num.words[i]; lo += 977 * w, num.words[i] = 67108863 & lo, lo = 64 * w + (lo / 67108864 | 0); } return 0 === num.words[num.length - 1] && (num.length--, 0 === num.words[num.length - 1] && num.length--), num; }, inherits(P224, MPrime), inherits(P192, MPrime), inherits(P25519, MPrime), P25519.prototype.imulK = function(num) { for (var carry = 0, i = 0; i < num.length; i++) { var hi = 19 * (0 | num.words[i]) + carry, lo = 67108863 & hi; hi >>>= 26, num.words[i] = lo, carry = hi; } return 0 !== carry && (num.words[num.length++] = carry), num; }, BN._prime = function(name) { if (primes[name]) return primes[name]; var prime; if ("k256" === name) prime = new K256; else if ("p224" === name) prime = new P224; else if ("p192" === name) prime = new P192; else { if ("p25519" !== name) throw new Error("Unknown prime " + name); prime = new P25519; } return primes[name] = prime, prime; }, Red.prototype._verify1 = function(a) { assert(0 === a.negative, "red works only with positives"), assert(a.red, "red works only with red numbers"); }, Red.prototype._verify2 = function(a, b) { assert(0 == (a.negative | b.negative), "red works only with positives"), assert(a.red && a.red === b.red, "red works only with red numbers"); }, Red.prototype.imod = function(a) { return this.prime ? this.prime.ireduce(a)._forceRed(this) : a.umod(this.m)._forceRed(this); }, Red.prototype.neg = function(a) { return a.isZero() ? a.clone() : this.m.sub(a)._forceRed(this); }, Red.prototype.add = function(a, b) { this._verify2(a, b); var res = a.add(b); return res.cmp(this.m) >= 0 && res.isub(this.m), res._forceRed(this); }, Red.prototype.iadd = function(a, b) { this._verify2(a, b); var res = a.iadd(b); return res.cmp(this.m) >= 0 && res.isub(this.m), res; }, Red.prototype.sub = function(a, b) { this._verify2(a, b); var res = a.sub(b); return res.cmpn(0) < 0 && res.iadd(this.m), res._forceRed(this); }, Red.prototype.isub = function(a, b) { this._verify2(a, b); var res = a.isub(b); return res.cmpn(0) < 0 && res.iadd(this.m), res; }, Red.prototype.shl = function(a, num) { return this._verify1(a), this.imod(a.ushln(num)); }, Red.prototype.imul = function(a, b) { return this._verify2(a, b), this.imod(a.imul(b)); }, Red.prototype.mul = function(a, b) { return this._verify2(a, b), this.imod(a.mul(b)); }, Red.prototype.isqr = function(a) { return this.imul(a, a.clone()); }, Red.prototype.sqr = function(a) { return this.mul(a, a); }, Red.prototype.sqrt = function(a) { if (a.isZero()) return a.clone(); var mod3 = this.m.andln(3); if (assert(mod3 % 2 == 1), 3 === mod3) { var pow = this.m.add(new BN(1)).iushrn(2); return this.pow(a, pow); } for (var q = this.m.subn(1), s = 0; !q.isZero() && 0 === q.andln(1); ) s++, q.iushrn(1); assert(!q.isZero()); var one = new BN(1).toRed(this), nOne = one.redNeg(), lpow = this.m.subn(1).iushrn(1), z = this.m.bitLength(); for (z = new BN(2 * z * z).toRed(this); 0 !== this.pow(z, lpow).cmp(nOne); ) z.redIAdd(nOne); for (var c = this.pow(z, q), r = this.pow(a, q.addn(1).iushrn(1)), t = this.pow(a, q), m = s; 0 !== t.cmp(one); ) { for (var tmp = t, i = 0; 0 !== tmp.cmp(one); i++) tmp = tmp.redSqr(); assert(i < m); var b = this.pow(c, new BN(1).iushln(m - i - 1)); r = r.redMul(b), c = b.redSqr(), t = t.redMul(c), m = i; } return r; }, Red.prototype.invm = function(a) { var inv = a._invmp(this.m); return 0 !== inv.negative ? (inv.negative = 0, this.imod(inv).redNeg()) : this.imod(inv); }, Red.prototype.pow = function(a, num) { if (num.isZero()) return new BN(1).toRed(this); if (0 === num.cmpn(1)) return a.clone(); var wnd = new Array(16); wnd[0] = new BN(1).toRed(this), wnd[1] = a; for (var i = 2; i < wnd.length; i++) wnd[i] = this.mul(wnd[i - 1], a); var res = wnd[0], current = 0, currentLen = 0, start = num.bitLength() % 26; for (0 === start && (start = 26), i = num.length - 1; i >= 0; i--) { for (var word = num.words[i], j = start - 1; j >= 0; j--) { var bit = word >> j & 1; res !== wnd[0] && (res = this.sqr(res)), 0 !== bit || 0 !== current ? (current <<= 1, current |= bit, (4 == ++currentLen || 0 === i && 0 === j) && (res = this.mul(res, wnd[current]), currentLen = 0, current = 0)) : currentLen = 0; } start = 26; } return res; }, Red.prototype.convertTo = function(num) { var r = num.umod(this.m); return r === num ? r.clone() : r; }, Red.prototype.convertFrom = function(num) { var res = num.clone(); return res.red = null, res; }, BN.mont = function(num) { return new Mont(num); }, inherits(Mont, Red), Mont.prototype.convertTo = function(num) { return this.imod(num.ushln(this.shift)); }, Mont.prototype.convertFrom = function(num) { var r = this.imod(num.mul(this.rinv)); return r.red = null, r; }, Mont.prototype.imul = function(a, b) { if (a.isZero() || b.isZero()) return a.words[0] = 0, a.length = 1, a; var t = a.imul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u; return u.cmp(this.m) >= 0 ? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this); }, Mont.prototype.mul = function(a, b) { if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); var t = a.mul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u; return u.cmp(this.m) >= 0 ? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this); }, Mont.prototype.invm = function(a) { return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this); }; })(module, this); }).call(this, __webpack_require__(69)(module)); }, function(module, exports, __webpack_require__) { module.exports = WebSocketTracker; var debug = __webpack_require__(9)("bittorrent-tracker:websocket-tracker"), hat = __webpack_require__(101), inherits = __webpack_require__(8), Peer = __webpack_require__(640), Socket = __webpack_require__(642), common = __webpack_require__(55), Tracker = __webpack_require__(184), socketPool = {}; function WebSocketTracker(client, announceUrl, opts) { Tracker.call(this, client, announceUrl), debug("new websocket tracker %s", announceUrl), this.peers = {}, this.socket = null, this.reconnecting = !1, this._openSocket(); } function noop() {} inherits(WebSocketTracker, Tracker), WebSocketTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 3e4, WebSocketTracker.prototype.announce = function(opts) { var self = this; if (!self.destroyed && !self.reconnecting) { if (!self.socket.connected) return self.socket.once("connect", self.announce.bind(self, opts)); var numwant = Math.min(opts.numwant, 10); self._generateOffers(numwant, (function(offers) { var params = { numwant: numwant, uploaded: opts.uploaded || 0, downloaded: opts.downloaded, event: opts.event, info_hash: self.client._infoHashBinary, peer_id: self.client._peerIdBinary, offers: offers }; self._trackerId && (params.trackerid = self._trackerId), self._send(params); })); } }, WebSocketTracker.prototype.scrape = function(opts) { this.destroyed || this.reconnecting || this._onSocketError(new Error("scrape not supported " + this.announceUrl)); }, WebSocketTracker.prototype.destroy = function(onclose) { if (!this.destroyed) { this.destroyed = !0, clearInterval(this.interval), socketPool[this.announceUrl] = null, 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._onSocketConnectBound = null, this._onSocketErrorBound = null, this._onSocketDataBound = null, this._onSocketCloseBound = null, this.socket.on("error", noop); try { this.socket.destroy(onclose); } catch (err) { onclose && onclose(); } this.socket = null; } }, WebSocketTracker.prototype._openSocket = function() { this.destroyed = !1, this._onSocketConnectBound = this._onSocketConnect.bind(this), this._onSocketErrorBound = this._onSocketError.bind(this), this._onSocketDataBound = this._onSocketData.bind(this), this._onSocketCloseBound = this._onSocketClose.bind(this), this.socket = socketPool[this.announceUrl], this.socket || (this.socket = socketPool[this.announceUrl] = new Socket(this.announceUrl), this.socket.on("connect", this._onSocketConnectBound)), this.socket.on("data", this._onSocketDataBound), this.socket.on("close", this._onSocketCloseBound), this.socket.on("error", this._onSocketErrorBound); }, WebSocketTracker.prototype._onSocketConnect = function() { this.destroyed || this.reconnecting && (this.reconnecting = !1, this.announce(this.client._defaultAnnounceOpts())); }, WebSocketTracker.prototype._onSocketData = function(data) { var self = this; if (!self.destroyed) { if ("object" != typeof data || null === data) return self.client.emit("warning", new Error("Invalid tracker response")); if (data.info_hash === self.client._infoHashBinary) { if (!data.peer_id || data.peer_id !== self.client._peerIdBinary) { debug("received %s from %s for %s", JSON.stringify(data), self.announceUrl, self.client.infoHash); var failure = data["failure reason"]; if (failure) return self.client.emit("warning", new Error(failure)); var warning = data["warning message"]; warning && self.client.emit("warning", new Error(warning)); var interval = data.interval || data["min interval"]; interval && self.setInterval(1e3 * interval); var peer, trackerId = data["tracker id"]; if (trackerId && (self._trackerId = trackerId), data.complete && self.client.emit("update", { announce: self.announceUrl, complete: data.complete, incomplete: data.incomplete }), data.offer && data.peer_id && (debug("creating peer (from remote offer)"), (peer = new Peer({ trickle: !1, config: self.client._rtcConfig, wrtc: self.client._wrtc })).id = common.binaryToHex(data.peer_id), peer.once("signal", (function(answer) { var params = { info_hash: self.client._infoHashBinary, peer_id: self.client._peerIdBinary, to_peer_id: data.peer_id, answer: answer, offer_id: data.offer_id }; self._trackerId && (params.trackerid = self._trackerId), self._send(params); })), peer.signal(data.offer), self.client.emit("peer", peer)), data.answer && data.peer_id) { var offerId = common.binaryToHex(data.offer_id); (peer = self.peers[offerId]) ? (peer.id = common.binaryToHex(data.peer_id), peer.signal(data.answer), self.client.emit("peer", peer), clearTimeout(peer.trackerTimeout), peer.trackerTimeout = null, self.peers[offerId] = null) : debug("got unexpected answer: " + JSON.stringify(data.answer)); } } } else debug("ignoring websocket data from %s for %s (looking for %s: reused socket)", self.announceUrl, common.binaryToHex(data.info_hash), self.client.infoHash); } }, WebSocketTracker.prototype._onSocketClose = function() { this.destroyed || (this.destroy(), this._startReconnectTimer()); }, WebSocketTracker.prototype._onSocketError = function(err) { this.destroyed || (this.destroy(), this.client.emit("warning", err), this._startReconnectTimer()); }, WebSocketTracker.prototype._startReconnectTimer = function() { var self = this, ms = Math.floor(3e4 * Math.random()) + 5e3; self.reconnecting = !0; var reconnectTimer = setTimeout((function() { self._openSocket(); }), ms); reconnectTimer.unref && reconnectTimer.unref(), debug("reconnecting socket in %s ms", ms); }, WebSocketTracker.prototype._send = function(params) { if (!this.destroyed) { var message = JSON.stringify(params); debug("send %s", message), this.socket.send(message); } }, WebSocketTracker.prototype._generateOffers = function(numwant, cb) { var self = this, offers = []; debug("generating %s offers", numwant); for (var i = 0; i < numwant; ++i) generateOffer(); function generateOffer() { var offerId = hat(160); debug("creating peer (from _generateOffers)"); var peer = self.peers[offerId] = new Peer({ initiator: !0, trickle: !1, config: self.client._rtcConfig, wrtc: self.client._wrtc }); peer.once("signal", (function(offer) { offers.push({ offer: offer, offer_id: common.hexToBinary(offerId) }), offers.length === numwant && (debug("generated %s offers", numwant), cb(offers)); })), peer.trackerTimeout = setTimeout((function() { debug("tracker timeout: destroying peer"), peer.trackerTimeout = null, self.peers[offerId] = null, peer.destroy(); }), 5e4); } }; }, function(module, exports, __webpack_require__) { module.exports = Peer; var debug = __webpack_require__(9)("simple-peer"), getBrowserRTC = __webpack_require__(641), hat = __webpack_require__(101), inherits = __webpack_require__(8), isTypedArray = __webpack_require__(185), once = __webpack_require__(35), stream = __webpack_require__(3); function Peer(opts) { var self = this; if (!(self instanceof Peer)) return new Peer(opts); if (self._debug("new peer %o", opts), opts || (opts = {}), opts.allowHalfOpen = !1, null == opts.highWaterMark && (opts.highWaterMark = 1048576), stream.Duplex.call(self, opts), self.initiator = opts.initiator || !1, self.channelConfig = opts.channelConfig || Peer.channelConfig, self.channelName = opts.initiator ? opts.channelName || hat(160) : null, self.config = opts.config || Peer.config, self.constraints = opts.constraints || Peer.constraints, self.offerConstraints = opts.offerConstraints, self.answerConstraints = opts.answerConstraints, self.reconnectTimer = opts.reconnectTimer || !1, self.sdpTransform = opts.sdpTransform || function(sdp) { return sdp; }, self.stream = opts.stream || !1, self.trickle = void 0 === opts.trickle || opts.trickle, self.destroyed = !1, self.connected = !1, self.remoteAddress = void 0, self.remoteFamily = void 0, self.remotePort = void 0, self.localAddress = void 0, self.localPort = void 0, self._isWrtc = !!opts.wrtc, self._wrtc = opts.wrtc || getBrowserRTC(), !self._wrtc) throw "undefined" == typeof window ? new Error("No WebRTC support: Specify `opts.wrtc` option in this environment") : new Error("No WebRTC support: Not a supported browser"); self._maxBufferedAmount = opts.highWaterMark, self._pcReady = !1, self._channelReady = !1, self._iceComplete = !1, self._channel = null, self._pendingCandidates = [], self._chunk = null, self._cb = null, self._interval = null, self._reconnectTimeout = null, self._pc = new self._wrtc.RTCPeerConnection(self.config, self.constraints), self._pc.oniceconnectionstatechange = self._onIceConnectionStateChange.bind(self), self._pc.onsignalingstatechange = self._onSignalingStateChange.bind(self), self._pc.onicecandidate = self._onIceCandidate.bind(self), self.stream && self._pc.addStream(self.stream), self._pc.onaddstream = self._onAddStream.bind(self), self.initiator ? (self._setupData({ channel: self._pc.createDataChannel(self.channelName, self.channelConfig) }), self._pc.onnegotiationneeded = once(self._createOffer.bind(self)), "undefined" != typeof window && window.webkitRTCPeerConnection || self._pc.onnegotiationneeded()) : self._pc.ondatachannel = self._setupData.bind(self), self.on("finish", (function() { self.connected ? setTimeout((function() { self._destroy(); }), 100) : self.once("connect", (function() { setTimeout((function() { self._destroy(); }), 100); })); })); } function noop() {} inherits(Peer, stream.Duplex), Peer.WEBRTC_SUPPORT = !!getBrowserRTC(), Peer.config = { iceServers: [ { url: "stun:23.21.150.121", urls: "stun:23.21.150.121" } ] }, Peer.constraints = {}, Peer.channelConfig = {}, Object.defineProperty(Peer.prototype, "bufferSize", { get: function() { return this._channel && this._channel.bufferedAmount || 0; } }), Peer.prototype.address = function() { return { port: this.localPort, family: "IPv4", address: this.localAddress }; }, Peer.prototype.signal = function(data) { var self = this; if (self.destroyed) throw new Error("cannot signal after peer is destroyed"); if ("string" == typeof data) try { data = JSON.parse(data); } catch (err) { data = {}; } function addIceCandidate(candidate) { try { self._pc.addIceCandidate(new self._wrtc.RTCIceCandidate(candidate), noop, self._onError.bind(self)); } catch (err) { self._destroy(new Error("error adding candidate: " + err.message)); } } self._debug("signal()"), data.sdp && self._pc.setRemoteDescription(new self._wrtc.RTCSessionDescription(data), (function() { self.destroyed || ("offer" === self._pc.remoteDescription.type && self._createAnswer(), self._pendingCandidates.forEach(addIceCandidate), self._pendingCandidates = []); }), self._onError.bind(self)), data.candidate && (self._pc.remoteDescription ? addIceCandidate(data.candidate) : self._pendingCandidates.push(data.candidate)), data.sdp || data.candidate || self._destroy(new Error("signal() called with invalid signal data")); }, Peer.prototype.send = function(chunk) { isTypedArray.strict(chunk) || chunk instanceof ArrayBuffer || Buffer.isBuffer(chunk) || "string" == typeof chunk || "undefined" != typeof Blob && chunk instanceof Blob || (chunk = JSON.stringify(chunk)), Buffer.isBuffer(chunk) && this._isWrtc && (chunk = new Uint8Array(chunk)); var len = chunk.length || chunk.byteLength || chunk.size; this._channel.send(chunk), this._debug("write: %d bytes", len); }, Peer.prototype.destroy = function(onclose) { this._destroy(null, onclose); }, Peer.prototype._destroy = function(err, onclose) { if (!this.destroyed) { if (onclose && this.once("close", onclose), this._debug("destroy (error: %s)", err && err.message), this.readable = this.writable = !1, this._readableState.ended || this.push(null), this._writableState.finished || this.end(), this.destroyed = !0, this.connected = !1, this._pcReady = !1, this._channelReady = !1, this._chunk = null, this._cb = null, clearInterval(this._interval), clearTimeout(this._reconnectTimeout), this._pc) { try { this._pc.close(); } catch (err) {} this._pc.oniceconnectionstatechange = null, this._pc.onsignalingstatechange = null, this._pc.onicecandidate = null; } if (this._channel) { try { this._channel.close(); } catch (err) {} this._channel.onmessage = null, this._channel.onopen = null, this._channel.onclose = null; } this._pc = null, this._channel = null, err && this.emit("error", err), this.emit("close"); } }, Peer.prototype._setupData = function(event) { this._channel = event.channel, this.channelName = this._channel.label, this._channel.binaryType = "arraybuffer", this._channel.onmessage = this._onChannelMessage.bind(this), this._channel.onopen = this._onChannelOpen.bind(this), this._channel.onclose = this._onChannelClose.bind(this); }, Peer.prototype._read = function() {}, Peer.prototype._write = function(chunk, encoding, cb) { if (this.destroyed) return cb(new Error("cannot write after peer is destroyed")); if (this.connected) { try { this.send(chunk); } catch (err) { return this._onError(err); } this._channel.bufferedAmount > this._maxBufferedAmount ? (this._debug("start backpressure: bufferedAmount %d", this._channel.bufferedAmount), this._cb = cb) : cb(null); } else this._debug("write before connect"), this._chunk = chunk, this._cb = cb; }, Peer.prototype._createOffer = function() { var self = this; self.destroyed || self._pc.createOffer((function(offer) { if (!self.destroyed) { offer.sdp = self.sdpTransform(offer.sdp), self._pc.setLocalDescription(offer, noop, self._onError.bind(self)); var sendOffer = function() { var signal = self._pc.localDescription || offer; self._debug("signal"), self.emit("signal", { type: signal.type, sdp: signal.sdp }); }; self.trickle || self._iceComplete ? sendOffer() : self.once("_iceComplete", sendOffer); } }), self._onError.bind(self), self.offerConstraints); }, Peer.prototype._createAnswer = function() { var self = this; self.destroyed || self._pc.createAnswer((function(answer) { if (!self.destroyed) { answer.sdp = self.sdpTransform(answer.sdp), self._pc.setLocalDescription(answer, noop, self._onError.bind(self)); var sendAnswer = function() { var signal = self._pc.localDescription || answer; self._debug("signal"), self.emit("signal", { type: signal.type, sdp: signal.sdp }); }; self.trickle || self._iceComplete ? sendAnswer() : self.once("_iceComplete", sendAnswer); } }), self._onError.bind(self), self.answerConstraints); }, Peer.prototype._onIceConnectionStateChange = function() { var self = this; if (!self.destroyed) { var iceGatheringState = self._pc.iceGatheringState, iceConnectionState = self._pc.iceConnectionState; self._debug("iceConnectionStateChange %s %s", iceGatheringState, iceConnectionState), self.emit("iceConnectionStateChange", iceGatheringState, iceConnectionState), "connected" !== iceConnectionState && "completed" !== iceConnectionState || (clearTimeout(self._reconnectTimeout), self._pcReady = !0, self._maybeReady()), "disconnected" === iceConnectionState && (self.reconnectTimer ? (clearTimeout(self._reconnectTimeout), self._reconnectTimeout = setTimeout((function() { self._destroy(); }), self.reconnectTimer)) : self._destroy()), "failed" === iceConnectionState && self._destroy(), "closed" === iceConnectionState && self._destroy(); } }, Peer.prototype.getStats = function(cb) { this._pc.getStats ? "undefined" != typeof window && window.mozRTCPeerConnection ? this._pc.getStats(null, (function(res) { var items = []; res.forEach((function(item) { items.push(item); })), cb(items); }), this._onError.bind(this)) : this._pc.getStats((function(res) { var items = []; res.result().forEach((function(result) { var item = {}; result.names().forEach((function(name) { item[name] = result.stat(name); })), item.id = result.id, item.type = result.type, item.timestamp = result.timestamp, items.push(item); })), cb(items); })) : cb([]); }, Peer.prototype._maybeReady = function() { var self = this; self._debug("maybeReady pc %s channel %s", self._pcReady, self._channelReady), !self.connected && !self._connecting && self._pcReady && self._channelReady && (self._connecting = !0, self.getStats((function(items) { self._connecting = !1, self.connected = !0; var remoteCandidates = {}, localCandidates = {}; if (items.forEach((function(item) { "remotecandidate" === item.type && (remoteCandidates[item.id] = item), "localcandidate" === item.type && (localCandidates[item.id] = item); })), items.forEach((function(item) { ("googCandidatePair" === item.type && "true" === item.googActiveConnection || "candidatepair" === item.type && item.selected) && (function(item) { var local = localCandidates[item.localCandidateId], remote = remoteCandidates[item.remoteCandidateId]; self.remoteAddress = remote.ipAddress, self.remotePort = Number(remote.portNumber), self.remoteFamily = "IPv4", self._debug("connect remote: %s:%s", self.remoteAddress, self.remotePort), self.localAddress = local.ipAddress, self.localPort = Number(local.portNumber), self._debug("connect local: %s:%s", self.localAddress, self.localPort); })(item); })), self._chunk) { try { self.send(self._chunk); } catch (err) { return self._onError(err); } self._chunk = null, self._debug('sent chunk from "write before connect"'); var cb = self._cb; self._cb = null, cb(null); } self._interval = setInterval((function() { if (self._cb && self._channel && !(self._channel.bufferedAmount > self._maxBufferedAmount)) { self._debug("ending backpressure: bufferedAmount %d", self._channel.bufferedAmount); var cb = self._cb; self._cb = null, cb(null); } }), 150), self._interval.unref && self._interval.unref(), self._debug("connect"), self.emit("connect"); }))); }, Peer.prototype._onSignalingStateChange = function() { this.destroyed || (this._debug("signalingStateChange %s", this._pc.signalingState), this.emit("signalingStateChange", this._pc.signalingState)); }, Peer.prototype._onIceCandidate = function(event) { this.destroyed || (event.candidate && this.trickle ? this.emit("signal", { candidate: { candidate: event.candidate.candidate, sdpMLineIndex: event.candidate.sdpMLineIndex, sdpMid: event.candidate.sdpMid } }) : event.candidate || (this._iceComplete = !0, this.emit("_iceComplete"))); }, Peer.prototype._onChannelMessage = function(event) { if (!this.destroyed) { var data = event.data; if (this._debug("read: %d bytes", data.byteLength || data.length), data instanceof ArrayBuffer) data = new Buffer(data), this.push(data); else { try { data = JSON.parse(data); } catch (err) {} this.emit("data", data); } } }, Peer.prototype._onChannelOpen = function() { this.connected || this.destroyed || (this._debug("on channel open"), this._channelReady = !0, this._maybeReady()); }, Peer.prototype._onChannelClose = function() { this.destroyed || (this._debug("on channel close"), this._destroy()); }, Peer.prototype._onAddStream = function(event) { this.destroyed || (this._debug("on add stream"), this.emit("stream", event.stream)); }, Peer.prototype._onError = function(err) { this.destroyed || (this._debug("error %s", err.message || err), this._destroy(err)); }, Peer.prototype._debug = function() { var self = this, args = [].slice.call(arguments), id = self.channelName && self.channelName.substring(0, 7); args[0] = "[" + id + "] " + args[0], debug.apply(null, args); }; }, function(module, exports) { module.exports = function() { if ("undefined" == typeof window) return null; var wrtc = { RTCPeerConnection: window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection, RTCSessionDescription: window.RTCSessionDescription || window.mozRTCSessionDescription || window.webkitRTCSessionDescription, RTCIceCandidate: window.RTCIceCandidate || window.mozRTCIceCandidate || window.webkitRTCIceCandidate }; return wrtc.RTCPeerConnection ? wrtc : null; }; }, function(module, exports, __webpack_require__) { module.exports = Socket; var debug = __webpack_require__(9)("simple-websocket"), inherits = __webpack_require__(8), isTypedArray = __webpack_require__(185), stream = __webpack_require__(3), ws = __webpack_require__(294), WebSocket = "undefined" != typeof window ? window.WebSocket : ws; function Socket(url, opts) { var self = this; if (!(self instanceof Socket)) return new Socket(url, opts); opts || (opts = {}), debug("new websocket: %s %o", url, opts), opts.allowHalfOpen = !1, null == opts.highWaterMark && (opts.highWaterMark = 1048576), stream.Duplex.call(self, opts), self.url = url, self.connected = !1, self.destroyed = !1, self._maxBufferedAmount = opts.highWaterMark, self._chunk = null, self._cb = null, self._interval = null, self._ws = new WebSocket(self.url), self._ws.binaryType = "arraybuffer", self._ws.onopen = self._onOpen.bind(self), self._ws.onmessage = self._onMessage.bind(self), self._ws.onclose = self._onClose.bind(self), self._ws.onerror = function() { self._onError(new Error("connection error to " + self.url)); }, self.on("finish", (function() { self.connected ? setTimeout((function() { self._destroy(); }), 100) : self.once("connect", (function() { setTimeout((function() { self._destroy(); }), 100); })); })); } inherits(Socket, stream.Duplex), Socket.WEBSOCKET_SUPPORT = !!WebSocket, Socket.prototype.send = function(chunk) { isTypedArray.strict(chunk) || chunk instanceof ArrayBuffer || Buffer.isBuffer(chunk) || "string" == typeof chunk || "undefined" != typeof Blob && chunk instanceof Blob || (chunk = JSON.stringify(chunk)); var len = chunk.length || chunk.byteLength || chunk.size; this._ws.send(chunk), debug("write: %d bytes", len); }, Socket.prototype.destroy = function(onclose) { this._destroy(null, onclose); }, Socket.prototype._destroy = function(err, onclose) { var self = this; if (!self.destroyed) { if (onclose && self.once("close", onclose), debug("destroy (error: %s)", err && err.message), this.readable = this.writable = !1, self._readableState.ended || self.push(null), self._writableState.finished || self.end(), self.connected = !1, self.destroyed = !0, clearInterval(self._interval), self._interval = null, self._chunk = null, self._cb = null, self._ws) { var ws = self._ws, onClose = function() { ws.onclose = null, self.emit("close"); }; if (ws.readyState === WebSocket.CLOSED) onClose(); else try { ws.onclose = onClose, ws.close(); } catch (err) { onClose(); } ws.onopen = null, ws.onmessage = null, ws.onerror = null; } self._ws = null, err && self.emit("error", err); } }, Socket.prototype._read = function() {}, Socket.prototype._write = function(chunk, encoding, cb) { if (this.destroyed) return cb(new Error("cannot write after socket is destroyed")); if (this.connected) { try { this.send(chunk); } catch (err) { return this._onError(err); } "function" != typeof ws && this._ws.bufferedAmount > this._maxBufferedAmount ? (debug("start backpressure: bufferedAmount %d", this._ws.bufferedAmount), this._cb = cb) : cb(null); } else debug("write before connect"), this._chunk = chunk, this._cb = cb; }, Socket.prototype._onMessage = function(event) { if (!this.destroyed) { var data = event.data; if (debug("read: %d bytes", data.byteLength || data.length), data instanceof ArrayBuffer) data = new Buffer(data), this.push(data); else if (Buffer.isBuffer(data)) this.push(data); else { try { data = JSON.parse(data); } catch (err) {} this.emit("data", data); } } }, Socket.prototype._onOpen = function() { var self = this; if (!self.connected && !self.destroyed) { if (self.connected = !0, self._chunk) { try { self.send(self._chunk); } catch (err) { return self._onError(err); } self._chunk = null, debug('sent chunk from "write before connect"'); var cb = self._cb; self._cb = null, cb(null); } "function" != typeof ws && (self._interval = setInterval((function() { if (self._cb && self._ws && !(self._ws.bufferedAmount > self._maxBufferedAmount)) { debug("ending backpressure: bufferedAmount %d", self._ws.bufferedAmount); var cb = self._cb; self._cb = null, cb(null); } }), 150), self._interval.unref && self._interval.unref()), debug("connect"), self.emit("connect"); } }, Socket.prototype._onClose = function() { this.destroyed || (debug("on close"), this._destroy()); }, Socket.prototype._onError = function(err) { this.destroyed || (debug("error: %s", err.message || err), this._destroy(err)); }; }, function(module, exports, __webpack_require__) { "use strict"; var has = Object.prototype.hasOwnProperty, id = 0; function Ultron(ee) { if (!(this instanceof Ultron)) return new Ultron(ee); this.id = id++, this.ee = ee; } Ultron.prototype.on = function(event, fn, context) { return fn.__ultron = this.id, this.ee.on(event, fn, context), this; }, Ultron.prototype.once = function(event, fn, context) { return fn.__ultron = this.id, this.ee.once(event, fn, context), this; }, Ultron.prototype.remove = function() { var event, args = arguments; if (1 === args.length && "string" == typeof args[0]) args = args[0].split(/[, ]+/); else if (!args.length) for (event in args = [], this.ee._events) has.call(this.ee._events, event) && args.push(event); for (var i = 0; i < args.length; i++) for (var listeners = this.ee.listeners(args[i]), j = 0; j < listeners.length; j++) { if ((event = listeners[j]).listener) { if (event.listener.__ultron !== this.id) continue; delete event.listener.__ultron; } else { if (event.__ultron !== this.id) continue; delete event.__ultron; } this.ee.removeListener(args[i], event); } return this; }, Ultron.prototype.destroy = function() { return !!this.ee && (this.remove(), this.ee = null, !0); }, module.exports = Ultron; }, function(module, exports) { module.exports = require("bufferutil"); }, function(module, exports) { exports.BufferUtil = { merge: function(mergedBuffer, buffers) { for (var offset = 0, i = 0, l = buffers.length; i < l; ++i) { var buf = buffers[i]; buf.copy(mergedBuffer, offset), offset += buf.length; } }, mask: function(source, mask, output, offset, length) { for (var maskNum = mask.readUInt32LE(0, !0), i = 0; i < length - 3; i += 4) { var num = maskNum ^ source.readUInt32LE(i, !0); num < 0 && (num = 4294967296 + num), output.writeUInt32LE(num, offset + i, !0); } switch (length % 4) { case 3: output[offset + i + 2] = source[i + 2] ^ mask[2]; case 2: output[offset + i + 1] = source[i + 1] ^ mask[1]; case 1: output[offset + i] = source[i] ^ mask[0]; } }, unmask: function(data, mask) { for (var maskNum = mask.readUInt32LE(0, !0), length = data.length, i = 0; i < length - 3; i += 4) { var num = maskNum ^ data.readUInt32LE(i, !0); num < 0 && (num = 4294967296 + num), data.writeUInt32LE(num, i, !0); } switch (length % 4) { case 3: data[i + 2] = data[i + 2] ^ mask[2]; case 2: data[i + 1] = data[i + 1] ^ mask[1]; case 1: data[i] = data[i] ^ mask[0]; } } }; }, function(module, exports, __webpack_require__) { "use strict"; var isValidUTF8; try { isValidUTF8 = __webpack_require__(647); } catch (e) { isValidUTF8 = __webpack_require__(648); } module.exports = "object" == typeof isValidUTF8 ? isValidUTF8.Validation.isValidUTF8 : isValidUTF8; }, function(module, exports) { module.exports = require("utf-8-validate"); }, function(module, exports) { exports.Validation = { isValidUTF8: function(buffer) { return !0; } }; }, function(module, exports, __webpack_require__) { function BufferPool(initialSize, growStrategy, shrinkStrategy) { if (this instanceof BufferPool == 0) throw new TypeError("Classes can't be function-called"); "function" == typeof initialSize ? (shrinkStrategy = growStrategy, growStrategy = initialSize, initialSize = 0) : void 0 === initialSize && (initialSize = 0), this._growStrategy = (growStrategy || function(db, size) { return db.used + size; }).bind(null, this), this._shrinkStrategy = (shrinkStrategy || function(db) { return initialSize; }).bind(null, this), this._buffer = initialSize ? new Buffer(initialSize) : null, this._offset = 0, this._used = 0, this._changeFactor = 0, this.__defineGetter__("size", (function() { return null == this._buffer ? 0 : this._buffer.length; })), this.__defineGetter__("used", (function() { return this._used; })); } __webpack_require__(0), BufferPool.prototype.get = function(length) { if (null == this._buffer || this._offset + length > this._buffer.length) { var newBuf = new Buffer(this._growStrategy(length)); this._buffer = newBuf, this._offset = 0; } this._used += length; var buf = this._buffer.slice(this._offset, this._offset + length); return this._offset += length, buf; }, BufferPool.prototype.reset = function(forceNewBuffer) { var len = this._shrinkStrategy(); len < this.size && (this._changeFactor -= 1), (forceNewBuffer || this._changeFactor < -2) && (this._changeFactor = 0, this._buffer = len ? new Buffer(len) : null), this._offset = 0, this._used = 0; }, module.exports = BufferPool; }, function(module, exports, __webpack_require__) { var events = __webpack_require__(4), util = __webpack_require__(0); function Sender(socket) { if (this instanceof Sender == 0) throw new TypeError("Classes can't be function-called"); events.EventEmitter.call(this), this.socket = socket, this.continuationFrame = !1, this.isClosed = !1; } events.EventEmitter, module.exports = Sender, util.inherits(Sender, events.EventEmitter), Sender.prototype.send = function(data, options, cb) { if (!this.isClosed) { var isString = "string" == typeof data, length = isString ? Buffer.byteLength(data) : data.length, lengthbytes = length > 127 ? 2 : 1, writeStartMarker = 0 == this.continuationFrame, writeEndMarker = !options || !(void 0 !== options.fin && !options.fin), buffer = new Buffer((writeStartMarker ? options && options.binary ? 1 + lengthbytes : 1 : 0) + length + (!writeEndMarker || options && options.binary ? 0 : 1)), offset = writeStartMarker ? 1 : 0; writeStartMarker && (options && options.binary ? (buffer.write("€", "binary"), lengthbytes > 1 && buffer.write(String.fromCharCode(128 + length / 128), offset++, "binary"), buffer.write(String.fromCharCode(127 & length), offset++, "binary")) : buffer.write("\0", "binary")), isString ? buffer.write(data, offset, "utf8") : data.copy(buffer, offset, 0), writeEndMarker ? (options && options.binary || buffer.write("ÿ", offset + length, "binary"), this.continuationFrame = !1) : this.continuationFrame = !0; try { this.socket.write(buffer, "binary", cb); } catch (e) { this.error(e.toString()); } } }, Sender.prototype.close = function(code, data, mask, cb) { if (!this.isClosed) { this.isClosed = !0; try { this.continuationFrame && this.socket.write(new Buffer([ 255 ], "binary")), this.socket.write(new Buffer([ 255, 0 ]), "binary", cb); } catch (e) { this.error(e.toString()); } } }, Sender.prototype.ping = function(data, options) {}, Sender.prototype.pong = function(data, options) {}, Sender.prototype.error = function(reason) { return this.emit("error", reason), this; }; }, function(module, exports, __webpack_require__) { function Receiver() { if (this instanceof Receiver == 0) throw new TypeError("Classes can't be function-called"); this.state = 0, this.buffers = [], this.messageEnd = -1, this.spanLength = 0, this.dead = !1, this.onerror = function() {}, this.ontext = function() {}, this.onbinary = function() {}, this.onclose = function() {}, this.onping = function() {}, this.onpong = function() {}; } __webpack_require__(0), module.exports = Receiver, Receiver.prototype.add = function(data) { if (!this.dead) for (var self = this; data; ) data = doAdd(); function doAdd() { if (0 === self.state) { if (2 == data.length && 255 == data[0] && 0 == data[1]) return self.reset(), void self.onclose(); if (128 === data[0]) self.messageEnd = 0, self.state = 2, data = data.slice(1); else { if (0 !== data[0]) return void self.error("payload must start with 0x00 byte", !0); data = data.slice(1), self.state = 1; } } if (2 === self.state) { for (var i = 0; i < data.length && 128 & data[i]; ) self.messageEnd = 128 * self.messageEnd + (127 & data[i]), ++i; i < data.length && (self.messageEnd = 128 * self.messageEnd + (127 & data[i]), self.state = 3, ++i), i > 0 && (data = data.slice(i)); } if (3 === self.state) { var dataleft = self.messageEnd - self.spanLength; return data.length >= dataleft ? (self.buffers.push(data), self.spanLength += dataleft, self.messageEnd = dataleft, self.parse()) : (self.buffers.push(data), void (self.spanLength += data.length)); } if (self.buffers.push(data), -1 != (self.messageEnd = (function(buffer, byte) { for (var i = 0, l = buffer.length; i < l; ++i) if (255 === buffer[i]) return i; return -1; })(data))) return self.spanLength += self.messageEnd, self.parse(); self.spanLength += data.length; } }, Receiver.prototype.cleanup = function() { this.dead = !0, this.state = 0, this.buffers = []; }, Receiver.prototype.parse = function() { for (var output = new Buffer(this.spanLength), outputIndex = 0, bi = 0, bl = this.buffers.length; bi < bl - 1; ++bi) { var buffer = this.buffers[bi]; buffer.copy(output, outputIndex), outputIndex += buffer.length; } var lastBuffer = this.buffers[this.buffers.length - 1]; this.messageEnd > 0 && lastBuffer.copy(output, outputIndex, 0, this.messageEnd), 1 !== this.state && --this.messageEnd; var tail = null; return this.messageEnd < lastBuffer.length - 1 && (tail = lastBuffer.slice(this.messageEnd + 1)), this.reset(), this.ontext(output.toString("utf8")), tail; }, Receiver.prototype.error = function(reason, terminate) { if (!this.dead) return this.reset(), "string" == typeof reason ? this.onerror(new Error(reason), terminate) : reason.constructor == Error ? this.onerror(reason, terminate) : this.onerror(new Error("An error occured"), terminate), this; }, Receiver.prototype.reset = function(reason) { this.dead || (this.state = 0, this.buffers = [], this.messageEnd = -1, this.spanLength = 0); }; }, function(module, exports, __webpack_require__) { var util = __webpack_require__(0), events = __webpack_require__(4), http = __webpack_require__(11), crypto = __webpack_require__(6), Options = __webpack_require__(296), WebSocket = __webpack_require__(295), Extensions = __webpack_require__(301), PerMessageDeflate = __webpack_require__(126), url = (__webpack_require__(70), __webpack_require__(7)); function WebSocketServer(options, callback) { if (this instanceof WebSocketServer == 0) return new WebSocketServer(options, callback); if (events.EventEmitter.call(this), !(options = new Options({ host: "0.0.0.0", port: null, server: null, verifyClient: null, handleProtocols: null, path: null, noServer: !1, disableHixie: !1, clientTracking: !0, perMessageDeflate: !0, maxPayload: 104857600 }).merge(options)).isDefinedAndNonNull("port") && !options.isDefinedAndNonNull("server") && !options.value.noServer) throw new TypeError("`port` or a `server` must be provided"); var self = this; if (options.isDefinedAndNonNull("port")) this._server = http.createServer((function(req, res) { var body = http.STATUS_CODES[426]; res.writeHead(426, { "Content-Length": body.length, "Content-Type": "text/plain" }), res.end(body); })), this._server.allowHalfOpen = !1, this._server.listen(options.value.port, options.value.host, callback), this._closeServer = function() { self._server && self._server.close(); }; else if (options.value.server && (this._server = options.value.server, options.value.path)) { if (this._server._webSocketPaths && options.value.server._webSocketPaths[options.value.path]) throw new Error("two instances of WebSocketServer cannot listen on the same http server path"); "object" != typeof this._server._webSocketPaths && (this._server._webSocketPaths = {}), this._server._webSocketPaths[options.value.path] = 1; } this._server && (this._onceServerListening = function() { self.emit("listening"); }, this._server.once("listening", this._onceServerListening)), void 0 !== this._server && (this._onServerError = function(error) { self.emit("error", error); }, this._server.on("error", this._onServerError), this._onServerUpgrade = function(req, socket, upgradeHead) { var head = new Buffer(upgradeHead.length); upgradeHead.copy(head), self.handleUpgrade(req, socket, head, (function(client) { self.emit("connection" + req.url, client), self.emit("connection", client); })); }, this._server.on("upgrade", this._onServerUpgrade)), this.options = options.value, this.path = options.value.path, this.clients = []; } function handleHybiUpgrade(req, socket, upgradeHead, cb) { var errorHandler = function() { try { socket.destroy(); } catch (e) {} }; if (socket.on("error", errorHandler), req.headers["sec-websocket-key"]) { var version = parseInt(req.headers["sec-websocket-version"]); if (-1 !== [ 8, 13 ].indexOf(version)) { var protocols = req.headers["sec-websocket-protocol"], origin = version < 13 ? req.headers["sec-websocket-origin"] : req.headers.origin, extensionsOffer = Extensions.parse(req.headers["sec-websocket-extensions"]), self = this, completeHybiUpgrade2 = function(protocol) { var key = req.headers["sec-websocket-key"], shasum = crypto.createHash("sha1"); shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); var headers = [ "HTTP/1.1 101 Switching Protocols", "Upgrade: websocket", "Connection: Upgrade", "Sec-WebSocket-Accept: " + (key = shasum.digest("base64")) ]; void 0 !== protocol && headers.push("Sec-WebSocket-Protocol: " + protocol); var extensions = {}; try { extensions = acceptExtensions.call(self, extensionsOffer); } catch (err) { return void abortConnection(socket, 400, "Bad Request"); } if (Object.keys(extensions).length) { var serverExtensions = {}; Object.keys(extensions).forEach((function(token) { serverExtensions[token] = [ extensions[token].params ]; })), headers.push("Sec-WebSocket-Extensions: " + Extensions.format(serverExtensions)); } self.emit("headers", headers), socket.setTimeout(0), socket.setNoDelay(!0); try { socket.write(headers.concat("", "").join("\r\n")); } catch (e) { try { socket.destroy(); } catch (e) {} return; } var client = new WebSocket([ req, socket, upgradeHead ], { protocolVersion: version, protocol: protocol, extensions: extensions, maxPayload: self.options.maxPayload }); self.options.clientTracking && (self.clients.push(client), client.on("close", (function() { var index = self.clients.indexOf(client); -1 != index && self.clients.splice(index, 1); }))), socket.removeListener("error", errorHandler), cb(client); }, completeHybiUpgrade1 = function() { if ("function" != typeof self.options.handleProtocols) void 0 !== protocols ? completeHybiUpgrade2(protocols.split(/, */)[0]) : completeHybiUpgrade2(); else { var protList = (protocols || "").split(/, */), callbackCalled = !1; self.options.handleProtocols(protList, (function(result, protocol) { callbackCalled = !0, result ? completeHybiUpgrade2(protocol) : abortConnection(socket, 401, "Unauthorized"); })), callbackCalled || abortConnection(socket, 501, "Could not process protocols"); } }; if ("function" == typeof this.options.verifyClient) { var info = { origin: origin, secure: void 0 !== req.connection.authorized || void 0 !== req.connection.encrypted, req: req }; if (2 == this.options.verifyClient.length) return void this.options.verifyClient(info, (function(result, code, name) { void 0 === code && (code = 401), void 0 === name && (name = http.STATUS_CODES[code]), result ? completeHybiUpgrade1() : abortConnection(socket, code, name); })); if (!this.options.verifyClient(info)) return void abortConnection(socket, 401, "Unauthorized"); } completeHybiUpgrade1(); } else abortConnection(socket, 400, "Bad Request"); } else abortConnection(socket, 400, "Bad Request"); } function handleHixieUpgrade(req, socket, upgradeHead, cb) { var errorHandler = function() { try { socket.destroy(); } catch (e) {} }; if (socket.on("error", errorHandler), this.options.disableHixie) abortConnection(socket, 401, "Hixie support disabled"); else if (req.headers["sec-websocket-key2"]) { var origin = req.headers.origin, self = this, onClientVerified = function() { var wshost; wshost = req.headers["x-forwarded-host"] ? req.headers["x-forwarded-host"] : req.headers.host; var location = ("https" === req.headers["x-forwarded-proto"] || socket.encrypted ? "wss" : "ws") + "://" + wshost + req.url, protocol = req.headers["sec-websocket-protocol"], buildResponseHeader = function() { var headers = [ "HTTP/1.1 101 Switching Protocols", "Upgrade: WebSocket", "Connection: Upgrade", "Sec-WebSocket-Location: " + location ]; return void 0 !== protocol && headers.push("Sec-WebSocket-Protocol: " + protocol), void 0 !== origin && headers.push("Sec-WebSocket-Origin: " + origin), new Buffer(headers.concat("", "").join("\r\n")); }, completeHandshake = function(nonce, rest, headerBuffer) { var k1 = req.headers["sec-websocket-key1"], k2 = req.headers["sec-websocket-key2"], md5 = crypto.createHash("md5"); [ k1, k2 ].forEach((function(k) { var n = parseInt(k.replace(/[^\d]/g, "")), spaces = k.replace(/[^ ]/g, "").length; 0 !== spaces && n % spaces == 0 ? (n /= spaces, md5.update(String.fromCharCode(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, 255 & n))) : abortConnection(socket, 400, "Bad Request"); })), md5.update(nonce.toString("binary")), socket.setTimeout(0), socket.setNoDelay(!0); try { var hashBuffer = new Buffer(md5.digest("binary"), "binary"), handshakeBuffer = new Buffer(headerBuffer.length + hashBuffer.length); headerBuffer.copy(handshakeBuffer, 0), hashBuffer.copy(handshakeBuffer, headerBuffer.length), socket.write(handshakeBuffer, "binary", (function(err) { if (!err) { var client = new WebSocket([ req, socket, rest ], { protocolVersion: "hixie-76", protocol: protocol }); self.options.clientTracking && (self.clients.push(client), client.on("close", (function() { var index = self.clients.indexOf(client); -1 != index && self.clients.splice(index, 1); }))), socket.removeListener("error", errorHandler), cb(client); } })); } catch (e) { try { socket.destroy(); } catch (e) {} return; } }; if (upgradeHead && upgradeHead.length >= 8) { var nonce = upgradeHead.slice(0, 8), rest = upgradeHead.length > 8 ? upgradeHead.slice(8) : null; completeHandshake.call(self, nonce, rest, buildResponseHeader()); } else { nonce = new Buffer(8), upgradeHead.copy(nonce, 0); var received = upgradeHead.length, handler = (rest = null, function(data) { var toRead = Math.min(data.length, 8 - received); 0 !== toRead && (data.copy(nonce, received, 0, toRead), 8 == (received += toRead) && (socket.removeListener("data", handler), toRead < data.length && (rest = data.slice(toRead)), completeHandshake.call(self, nonce, rest, new Buffer(0)))); }); socket.on("data", handler), (function() { socket.setTimeout(0), socket.setNoDelay(!0); var headerBuffer = buildResponseHeader(); try { socket.write(headerBuffer, "binary", (function(err) { err && socket.removeListener("data", handler); })); } catch (e) { try { socket.destroy(); } catch (e) {} return; } })(); } }; if ("function" == typeof this.options.verifyClient) { var info = { origin: origin, secure: void 0 !== req.connection.authorized || void 0 !== req.connection.encrypted, req: req }; if (2 == this.options.verifyClient.length) return self = this, void this.options.verifyClient(info, (function(result, code, name) { void 0 === code && (code = 401), void 0 === name && (name = http.STATUS_CODES[code]), result ? onClientVerified.apply(self) : abortConnection(socket, code, name); })); if (!this.options.verifyClient(info)) return void abortConnection(socket, 401, "Unauthorized"); } onClientVerified(); } else abortConnection(socket, 400, "Bad Request"); } function acceptExtensions(offer) { var extensions = {}, options = this.options.perMessageDeflate, maxPayload = this.options.maxPayload; if (options && offer[PerMessageDeflate.extensionName]) { var perMessageDeflate = new PerMessageDeflate(!0 !== options ? options : {}, !0, maxPayload); perMessageDeflate.accept(offer[PerMessageDeflate.extensionName]), extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } return extensions; } function abortConnection(socket, code, name) { try { var response = [ "HTTP/1.1 " + code + " " + name, "Content-type: text/html" ]; socket.write(response.concat("", "").join("\r\n")); } catch (e) {} finally { try { socket.destroy(); } catch (e) {} } } util.inherits(WebSocketServer, events.EventEmitter), WebSocketServer.prototype.close = function(callback) { var error = null; try { for (var i = 0, l = this.clients.length; i < l; ++i) this.clients[i].terminate(); } catch (e) { error = e; } this.path && this._server._webSocketPaths && (delete this._server._webSocketPaths[this.path], 0 == Object.keys(this._server._webSocketPaths).length && delete this._server._webSocketPaths); try { void 0 !== this._closeServer && this._closeServer(); } finally { this._server && (this._server.removeListener("listening", this._onceServerListening), this._server.removeListener("error", this._onServerError), this._server.removeListener("upgrade", this._onServerUpgrade)), delete this._server; } if (callback) callback(error); else if (error) throw error; }, WebSocketServer.prototype.handleUpgrade = function(req, socket, upgradeHead, cb) { if (this.options.path) { var u = url.parse(req.url); if (u && u.pathname !== this.options.path) return; } void 0 !== req.headers.upgrade && "websocket" === req.headers.upgrade.toLowerCase() ? req.headers["sec-websocket-key1"] ? handleHixieUpgrade.apply(this, arguments) : handleHybiUpgrade.apply(this, arguments) : abortConnection(socket, 400, "Bad Request"); }, module.exports = WebSocketServer; }, function(module, exports, __webpack_require__) { module.exports = Server; var bencode = __webpack_require__(290), debug = __webpack_require__(9)("bittorrent-tracker"), dgram = __webpack_require__(79), EventEmitter = __webpack_require__(4).EventEmitter, http = __webpack_require__(11), inherits = __webpack_require__(8), series = __webpack_require__(654), string2compact = __webpack_require__(655), WebSocketServer = __webpack_require__(294).Server, common = __webpack_require__(55), Swarm = __webpack_require__(657), parseHttpRequest = __webpack_require__(659), parseUdpRequest = __webpack_require__(660), parseWebSocketRequest = __webpack_require__(662); function Server(opts) { var self = this; if (!(self instanceof Server)) return new Server(opts); if (EventEmitter.call(self), opts || (opts = {}), debug("new server %s", JSON.stringify(opts)), self.intervalMs = opts.interval ? opts.interval : 6e5, self._trustProxy = !!opts.trustProxy, "function" == typeof opts.filter && (self._filter = opts.filter), self._listenCalled = !1, self.listening = !1, self.destroyed = !1, self.torrents = {}, self.http = null, self.udp4 = null, self.udp6 = null, self.ws = null, !1 !== opts.http && (self.http = http.createServer(), self.http.on("error", (function(err) { self._onError(err); })), self.http.on("listening", onListening), process.nextTick((function() { self.http.on("request", (function(req, res) { res.headersSent || self.onHttpRequest(req, res); })); }))), !1 !== opts.udp) { var isNode10 = /^v0.10./.test(process.version); self.udp4 = self.udp = dgram.createSocket(isNode10 ? "udp4" : { type: "udp4", reuseAddr: !0 }), self.udp4.on("message", (function(msg, rinfo) { self.onUdpRequest(msg, rinfo); })), self.udp4.on("error", (function(err) { self._onError(err); })), self.udp4.on("listening", onListening), self.udp6 = dgram.createSocket(isNode10 ? "udp6" : { type: "udp6", reuseAddr: !0 }), self.udp6.on("message", (function(msg, rinfo) { self.onUdpRequest(msg, rinfo); })), self.udp6.on("error", (function(err) { self._onError(err); })), self.udp6.on("listening", onListening); } !1 !== opts.ws && (self.http || (self.http = http.createServer(), self.http.on("error", (function(err) { self._onError(err); })), self.http.on("listening", onListening), process.nextTick((function() { self.http.on("request", (function(req, res) { res.headersSent || (res.statusCode = 404, res.end("404 Not Found")); })); }))), self.ws = new WebSocketServer({ server: self.http }), self.ws.address = self.http.address.bind(self.http), self.ws.on("error", (function(err) { self._onError(err); })), self.ws.on("connection", (function(socket) { self.onWebSocketConnection(socket); }))); var num = !!self.http + !!self.udp4 + !!self.udp6; function onListening() { 0 == (num -= 1) && (self.listening = !0, debug("listening"), self.emit("listening")); } } function toNumber(x) { return (x = Number(x)) >= 0 && x; } inherits(Server, EventEmitter), Server.prototype._onError = function(err) { this.emit("error", err); }, Server.prototype.listen = function() { var self = this; if (self._listenCalled || self.listening) throw new Error("server already listening"); self._listenCalled = !0; var lastArg = arguments[arguments.length - 1]; "function" == typeof lastArg && self.once("listening", lastArg); var port = toNumber(arguments[0]) || arguments[0] || 0, hostname = "function" != typeof arguments[1] ? arguments[1] : void 0; function isObject(obj) { return "object" == typeof obj && null !== obj; } debug("listen (port: %o hostname: %o)", port, hostname); var httpPort = isObject(port) ? port.http || 0 : port, udpPort = isObject(port) ? port.udp || 0 : port, httpHostname = isObject(hostname) ? hostname.http : hostname || "::", udp4Hostname = isObject(hostname) ? hostname.udp : hostname, udp6Hostname = isObject(hostname) ? hostname.udp6 : hostname; self.http && self.http.listen(httpPort, httpHostname), self.udp4 && self.udp4.bind(udpPort, udp4Hostname), self.udp6 && self.udp6.bind(udpPort, udp6Hostname); }, Server.prototype.close = function(cb) { if (cb || (cb = function() {}), debug("close"), this.listening = !1, this.destroyed = !0, this.udp4) try { this.udp4.close(); } catch (err) {} if (this.udp6) try { this.udp6.close(); } catch (err) {} if (this.ws) try { this.ws.close(); } catch (err) {} this.http ? this.http.close(cb) : cb(null); }, Server.prototype.createSwarm = function(infoHash, cb) { var self = this; Buffer.isBuffer(infoHash) && (infoHash = infoHash.toString("hex")), process.nextTick((function() { var swarm = self.torrents[infoHash] = new Swarm(infoHash, self); cb(null, swarm); })); }, Server.prototype.getSwarm = function(infoHash, cb) { var self = this; Buffer.isBuffer(infoHash) && (infoHash = infoHash.toString("hex")), process.nextTick((function() { cb(null, self.torrents[infoHash]); })); }, Server.prototype.onHttpRequest = function(req, res, opts) { var params, self = this; opts || (opts = {}), opts.trustProxy = opts.trustProxy || self._trustProxy; try { (params = parseHttpRequest(req, opts)).httpReq = req, params.httpRes = res; } catch (err) { return res.end(bencode.encode({ "failure reason": err.message })), void self.emit("warning", err); } self._onRequest(params, (function(err, response) { if (err && (self.emit("warning", err), response = { "failure reason": err.message }), self.destroyed) return res.end(); delete response.action, res.end(bencode.encode(response)), params.action === common.ACTIONS.ANNOUNCE && self.emit(common.EVENT_NAMES[params.event], params.addr, params); })); }, Server.prototype.onUdpRequest = function(msg, rinfo) { var params, self = this; try { params = parseUdpRequest(msg, rinfo); } catch (err) { return void self.emit("warning", err); } self._onRequest(params, (function(err, response) { if (err && (self.emit("warning", err), response = { action: common.ACTIONS.ERROR, "failure reason": err.message }), !self.destroyed) { response.transactionId = params.transactionId, response.connectionId = params.connectionId; var buf = (function(params) { var packet; switch (params.action) { case common.ACTIONS.CONNECT: packet = Buffer.concat([ common.toUInt32(common.ACTIONS.CONNECT), common.toUInt32(params.transactionId), params.connectionId ]); break; case common.ACTIONS.ANNOUNCE: packet = Buffer.concat([ common.toUInt32(common.ACTIONS.ANNOUNCE), common.toUInt32(params.transactionId), common.toUInt32(params.interval), common.toUInt32(params.incomplete), common.toUInt32(params.complete), params.peers ]); break; case common.ACTIONS.SCRAPE: var scrapeResponse = [ common.toUInt32(common.ACTIONS.SCRAPE), common.toUInt32(params.transactionId) ]; for (var infoHash in params.files) { var file = params.files[infoHash]; scrapeResponse.push(common.toUInt32(file.complete), common.toUInt32(file.downloaded), common.toUInt32(file.incomplete)); } packet = Buffer.concat(scrapeResponse); break; case common.ACTIONS.ERROR: packet = Buffer.concat([ common.toUInt32(common.ACTIONS.ERROR), common.toUInt32(params.transactionId || 0), new Buffer(params["failure reason"], "utf8") ]); break; default: throw new Error("Action not implemented: " + params.action); } return packet; })(response); try { ("IPv4" === rinfo.family ? self.udp4 : self.udp6).send(buf, 0, buf.length, rinfo.port, rinfo.address); } catch (err) { self.emit("warning", err); } params.action === common.ACTIONS.ANNOUNCE && self.emit(common.EVENT_NAMES[params.event], params.addr, params); } })); }, Server.prototype.onWebSocketConnection = function(socket) { socket.peerId = null, socket.infoHashes = [], socket.onSend = this._onWebSocketSend.bind(this, socket), socket.on("message", this._onWebSocketRequest.bind(this, socket)), socket.on("error", this._onWebSocketError.bind(this, socket)), socket.on("close", this._onWebSocketClose.bind(this, socket)); }, Server.prototype._onWebSocketRequest = function(socket, params) { var self = this; try { params = parseWebSocketRequest(socket, params); } catch (err) { return socket.send(JSON.stringify({ "failure reason": err.message, info_hash: common.hexToBinary(params.info_hash) }), socket.onSend), void self.emit("warning", err); } socket.peerId || (socket.peerId = params.peer_id), self._onRequest(params, (function(err, response) { if (err && (self.emit("warning", err), response = { "failure reason": err.message }), !self.destroyed) { -1 === socket.infoHashes.indexOf(params.info_hash) && socket.infoHashes.push(params.info_hash); var peers = response.peers; delete response.peers, response.interval = Math.ceil(self.intervalMs / 1e3 / 5), response.info_hash = common.hexToBinary(params.info_hash), socket.send(JSON.stringify(response), socket.onSend), debug("sent response %s to %s", JSON.stringify(response), params.peer_id), params.numwant && (debug("got offers %s from %s", JSON.stringify(params.offers), params.peer_id), debug("got %s peers from swarm %s", peers.length, params.info_hash), peers.forEach((function(peer, i) { peer.socket.send(JSON.stringify({ offer: params.offers[i].offer, offer_id: params.offers[i].offer_id, peer_id: common.hexToBinary(params.peer_id), info_hash: common.hexToBinary(params.info_hash) }), peer.socket.onSend), debug("sent offer to %s from %s", peer.peerId, params.peer_id); }))), params.answer ? (debug("got answer %s from %s", JSON.stringify(params.answer), params.peer_id), self.getSwarm(params.info_hash, (function(err, swarm) { if (err) return self.emit("warning", err); if (!swarm) return self.emit("warning", new Error("no swarm with that `info_hash`")); var toPeer = swarm.peers[params.to_peer_id]; if (!toPeer) return self.emit("warning", new Error("no peer with that `to_peer_id`")); toPeer.socket.send(JSON.stringify({ answer: params.answer, offer_id: params.offer_id, peer_id: common.hexToBinary(params.peer_id), info_hash: common.hexToBinary(params.info_hash) }), toPeer.socket.onSend), debug("sent answer to %s from %s", toPeer.peerId, params.peer_id), done(); }))) : done(); } function done() { params.action === common.ACTIONS.ANNOUNCE && self.emit(common.EVENT_NAMES[params.event], params.peer_id, params); } })); }, Server.prototype._onRequest = function(params, cb) { params && params.action === common.ACTIONS.CONNECT ? cb(null, { action: common.ACTIONS.CONNECT }) : params && params.action === common.ACTIONS.ANNOUNCE ? this._onAnnounce(params, cb) : params && params.action === common.ACTIONS.SCRAPE ? this._onScrape(params, cb) : cb(new Error("Invalid action")); }, Server.prototype._onAnnounce = function(params, cb) { var self = this; function announce(swarm) { params.event && "empty" !== params.event || (params.event = "update"), swarm.announce(params, (function(err, response) { if (err) return cb(err); if (response.action || (response.action = common.ACTIONS.ANNOUNCE), response.interval || (response.interval = Math.ceil(self.intervalMs / 1e3)), 1 === params.compact) { var peers = response.peers; response.peers = string2compact(peers.filter((function(peer) { return common.IPV4_RE.test(peer.ip); })).map((function(peer) { return peer.ip + ":" + peer.port; }))), response.peers6 = string2compact(peers.filter((function(peer) { return common.IPV6_RE.test(peer.ip); })).map((function(peer) { return "[" + peer.ip + "]:" + peer.port; }))); } else 0 === params.compact && (response.peers = response.peers.map((function(peer) { return { "peer id": common.hexToBinary(peer.peerId), ip: peer.ip, port: peer.port }; }))); cb(null, response); })); } self.getSwarm(params.info_hash, (function(err, swarm) { if (err) return cb(err); swarm ? announce(swarm) : self._filter ? self._filter(params.info_hash, params, (function(allowed) { allowed instanceof Error ? cb(allowed) : allowed ? self.createSwarm(params.info_hash, (function(err, swarm) { if (err) return cb(err); announce(swarm); })) : cb(new Error("disallowed info_hash")); })) : self.createSwarm(params.info_hash, (function(err, swarm) { if (err) return cb(err); announce(swarm); })); })); }, Server.prototype._onScrape = function(params, cb) { var self = this; null == params.info_hash && (params.info_hash = Object.keys(self.torrents)), series(params.info_hash.map((function(infoHash) { return function(cb) { self.getSwarm(infoHash, (function(err, swarm) { if (err) return cb(err); swarm ? swarm.scrape(params, (function(err, scrapeInfo) { if (err) return cb(err); cb(null, { infoHash: infoHash, complete: scrapeInfo && scrapeInfo.complete || 0, incomplete: scrapeInfo && scrapeInfo.incomplete || 0 }); })) : cb(null, { infoHash: infoHash, complete: 0, incomplete: 0 }); })); }; })), (function(err, results) { if (err) return cb(err); var response = { action: common.ACTIONS.SCRAPE, files: {}, flags: { min_request_interval: Math.ceil(self.intervalMs / 1e3) } }; results.forEach((function(result) { response.files[common.hexToBinary(result.infoHash)] = { complete: result.complete || 0, incomplete: result.incomplete || 0, downloaded: result.complete || 0 }; })), cb(null, response); })); }, Server.prototype._onWebSocketSend = function(socket, err) { err && this._onWebSocketError(socket, err); }, Server.prototype._onWebSocketClose = function(socket) { var self = this; socket.peerId && socket.infoHashes && (debug("websocket close"), socket.infoHashes.forEach((function(infoHash) { var swarm = self.torrents[infoHash]; swarm && swarm.announce({ event: "stopped", numwant: 0, peer_id: socket.peerId }, (function() {})); }))); }, Server.prototype._onWebSocketError = function(socket, err) { debug("websocket error %s", err.message || err), this.emit("warning", err), this._onWebSocketClose(socket); }; }, function(module, exports) { module.exports = function(tasks, cb) { var current = 0, results = [], isSync = !0; function done(err) { function end() { cb && cb(err, results); } isSync ? process.nextTick(end) : end(); } tasks.length > 0 ? tasks[0]((function each(err, result) { results.push(result), ++current >= tasks.length || err ? done(err) : tasks[current](each); })) : done(null), isSync = !1; }; }, function(module, exports, __webpack_require__) { const addrToIPPort = __webpack_require__(656), ipaddr = __webpack_require__(183); module.exports = addrs => ("string" == typeof addrs && (addrs = [ addrs ]), Buffer.concat(addrs.map((addr => { const s = addrToIPPort(addr); if (2 !== s.length) throw new Error("invalid address format, expecting: 10.10.10.5:128"); const ip = ipaddr.parse(s[0]), ipBuf = Buffer.from(ip.toByteArray()), port = s[1], portBuf = Buffer.allocUnsafe(2); return portBuf.writeUInt16BE(port, 0), Buffer.concat([ ipBuf, portBuf ]); })))), module.exports.multi = module.exports, module.exports.multi6 = module.exports; }, function(module, exports) { const ADDR_RE = /^\[?([^\]]+)\]?:(\d+)$/; let cache = {}, size = 0; module.exports = function(addr) { if (1e5 === size && module.exports.reset(), !cache[addr]) { const m = ADDR_RE.exec(addr); if (!m) throw new Error(`invalid addr: ${addr}`); cache[addr] = [ m[1], Number(m[2]) ], size += 1; } return cache[addr]; }, module.exports.reset = function() { cache = {}, size = 0; }; }, function(module, exports, __webpack_require__) { module.exports = Swarm; var debug = __webpack_require__(9)("bittorrent-tracker"), randomIterate = __webpack_require__(658); function Swarm(infoHash, server) { this.peers = {}, this.complete = 0, this.incomplete = 0; } Swarm.prototype.announce = function(params, cb) { var peer = this.peers[params.addr || params.peer_id]; if ("started" === params.event) this._onAnnounceStarted(params, peer); else if ("stopped" === params.event) this._onAnnounceStopped(params, peer); else if ("completed" === params.event) this._onAnnounceCompleted(params, peer); else { if ("update" !== params.event) return void cb(new Error("invalid event")); this._onAnnounceUpdate(params, peer); } cb(null, { complete: this.complete, incomplete: this.incomplete, peers: this._getPeers(params.numwant, params.peer_id, !!params.socket) }); }, Swarm.prototype.scrape = function(params, cb) { cb(null, { complete: this.complete, incomplete: this.incomplete }); }, Swarm.prototype._onAnnounceStarted = function(params, peer) { if (peer) return debug("unexpected `started` event from peer that is already in swarm"), this._onAnnounceUpdate(params, peer); 0 === params.left ? this.complete += 1 : this.incomplete += 1, peer = this.peers[params.addr || params.peer_id] = { complete: 0 === params.left, peerId: params.peer_id, ip: params.ip, port: params.port, socket: params.socket }; }, Swarm.prototype._onAnnounceStopped = function(params, peer) { peer ? (peer.complete ? this.complete -= 1 : this.incomplete -= 1, this.peers[params.addr || params.peer_id] = null) : debug("unexpected `stopped` event from peer that is not in swarm"); }, Swarm.prototype._onAnnounceCompleted = function(params, peer) { if (!peer) return debug("unexpected `completed` event from peer that is not in swarm"), this._onAnnounceStarted(params, peer); peer.complete ? debug("unexpected `completed` event from peer that is already marked as completed") : (this.complete += 1, this.incomplete -= 1, peer.complete = !0); }, Swarm.prototype._onAnnounceUpdate = function(params, peer) { if (!peer) return debug("unexpected `update` event from peer that is not in swarm"), this._onAnnounceStarted(params, peer); peer.complete || 0 !== params.left || (this.complete += 1, this.incomplete -= 1, peer.complete = !0); }, Swarm.prototype._getPeers = function(numwant, ownPeerId, isWebRTC) { for (var peerId, peers = [], ite = randomIterate(Object.keys(this.peers)); (peerId = ite()) && peers.length < numwant; ) { var peer = this.peers[peerId]; peer && (isWebRTC && peer.peerId === ownPeerId || isWebRTC && peer.ip || !isWebRTC && peer.socket || peers.push(peer)); } return peers; }; }, function(module, exports) { module.exports = function(list) { var offset = 0; return function() { if (offset === list.length) return null; var len = list.length - offset, i = Math.random() * len | 0, el = list[offset + i], tmp = list[offset]; return list[offset] = el, list[offset + i] = tmp, offset++, el; }; }; }, function(module, exports, __webpack_require__) { module.exports = function(req, opts) { opts || (opts = {}); var s = req.url.split("?"), params = common.querystringParse(s[1]); if ("announce" === opts.action || "/announce" === s[0]) { if (params.action = common.ACTIONS.ANNOUNCE, "string" != typeof params.info_hash || 20 !== params.info_hash.length) throw new Error("invalid info_hash"); if (params.info_hash = common.binaryToHex(params.info_hash), "string" != typeof params.peer_id || 20 !== params.peer_id.length) throw new Error("invalid peer_id"); if (params.peer_id = common.binaryToHex(params.peer_id), params.port = Number(params.port), !params.port) throw new Error("invalid port"); params.left = Number(params.left) || 1 / 0, params.compact = Number(params.compact) || 0, params.numwant = Math.min(Number(params.numwant) || common.DEFAULT_ANNOUNCE_PEERS, common.MAX_ANNOUNCE_PEERS), params.ip = opts.trustProxy ? req.headers["x-forwarded-for"] || req.connection.remoteAddress : req.connection.remoteAddress.replace(REMOVE_IPV4_MAPPED_IPV6_RE, ""), params.addr = (common.IPV6_RE.test(params.ip) ? "[" + params.ip + "]" : params.ip) + ":" + params.port; } else { if ("scrape" !== opts.action && "/scrape" !== s[0]) throw new Error("invalid action in HTTP request: " + req.url); params.action = common.ACTIONS.SCRAPE, "string" == typeof params.info_hash && (params.info_hash = [ params.info_hash ]), Array.isArray(params.info_hash) && (params.info_hash = params.info_hash.map((function(binaryInfoHash) { if ("string" != typeof binaryInfoHash || 20 !== binaryInfoHash.length) throw new Error("invalid info_hash"); return common.binaryToHex(binaryInfoHash); }))); } return params; }; var common = __webpack_require__(55), REMOVE_IPV4_MAPPED_IPV6_RE = /^::ffff:/; }, function(module, exports, __webpack_require__) { module.exports = function(msg, rinfo) { if (msg.length < 16) throw new Error("received packet is too short"); var params = { connectionId: msg.slice(0, 8), action: msg.readUInt32BE(8), transactionId: msg.readUInt32BE(12) }; if (!bufferEqual(params.connectionId, common.CONNECTION_ID)) throw new Error("received packet with invalid connection id"); if (params.action === common.ACTIONS.CONNECT) ; else if (params.action === common.ACTIONS.ANNOUNCE) { if (params.info_hash = msg.slice(16, 36).toString("hex"), params.peer_id = msg.slice(36, 56).toString("hex"), params.downloaded = fromUInt64(msg.slice(56, 64)), params.left = fromUInt64(msg.slice(64, 72)), params.uploaded = fromUInt64(msg.slice(72, 80)), params.event = common.EVENT_IDS[msg.readUInt32BE(80)], !params.event) throw new Error("invalid event"); var ip = msg.readUInt32BE(84); params.ip = ip ? ipLib.toString(ip) : rinfo.address, params.key = msg.readUInt32BE(88), params.numwant = Math.min(msg.readUInt32BE(92) || common.DEFAULT_ANNOUNCE_PEERS, common.MAX_ANNOUNCE_PEERS), params.port = msg.readUInt16BE(96) || rinfo.port, params.addr = params.ip + ":" + params.port, params.compact = 1; } else { if (params.action !== common.ACTIONS.SCRAPE) throw new Error("Invalid action in UDP packet: " + params.action); if ((msg.length - 16) % 20 != 0) throw new Error("invalid scrape message"); params.info_hash = []; for (var i = 0, len = (msg.length - 16) / 20; i < len; i += 1) { var infoHash = msg.slice(16 + 20 * i, 36 + 20 * i).toString("hex"); params.info_hash.push(infoHash); } } return params; }; var bufferEqual = __webpack_require__(661), ipLib = __webpack_require__(127), common = __webpack_require__(55); function fromUInt64(buf) { var high = 0 | buf.readUInt32BE(0), low = 0 | buf.readUInt32BE(4); return 131072 * high + (low >= 0 ? low : 131072 + low); } }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(10).Buffer; module.exports = function(a, b) { if (Buffer.isBuffer(a) && Buffer.isBuffer(b)) { if ("function" == typeof a.equals) return a.equals(b); if (a.length !== b.length) return !1; for (var i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1; return !0; } }; }, function(module, exports, __webpack_require__) { module.exports = function(socket, params) { if ((params = JSON.parse(params)).action = common.ACTIONS.ANNOUNCE, params.socket = socket, "string" != typeof params.info_hash || 20 !== params.info_hash.length) throw new Error("invalid info_hash"); if (params.info_hash = common.binaryToHex(params.info_hash), "string" != typeof params.peer_id || 20 !== params.peer_id.length) throw new Error("invalid peer_id"); if (params.peer_id = common.binaryToHex(params.peer_id), params.answer) { if ("string" != typeof params.to_peer_id || 20 !== params.to_peer_id.length) throw new Error("invalid `to_peer_id` (required with `answer`)"); params.to_peer_id = common.binaryToHex(params.to_peer_id); } return params.left = Number(params.left) || 1 / 0, params.numwant = Math.min(Number(params.offers && params.offers.length) || 0, common.MAX_ANNOUNCE_PEERS), params.compact = -1, params; }; var common = __webpack_require__(55); }, function(module, exports) { module.exports = function(evs, incEv, decEv, idFn, onPositive, onZero, timeout) { var counter = {}, timeouts = {}; evs.on(incEv, (function(hash, idx) { var id = idFn(hash, idx); counter.hasOwnProperty(id) || (counter[id] = 0, onPositive(hash, idx)), counter[id]++, timeouts[id] && (clearTimeout(timeouts[id]), delete timeouts[id]); })), evs.on(decEv, (function(hash, idx) { var id = idFn(hash, idx); counter[id]--, 0 == counter[id] && (timeouts[id] && clearTimeout(timeouts[id]), timeouts[id] = setTimeout((function() { onZero(hash, idx), delete counter[id], delete timeouts[id]; }), timeout())); })); }; }, function(module, exports, __webpack_require__) { var parseVideoName = __webpack_require__(303), MEDIA_FILE_EXTENTIONS = /.mkv$|.avi$|.mp4$|.wmv$|.vp8$|.mov$|.mpg$|.ts$|.m3u8$|.webm$|.flac$|.mp3$|.wav$|.wma$|.aac$|.ogg$/i; module.exports = function(files, seriesInfo) { if (!files || !Array.isArray(files) || !seriesInfo) return -1; var mediaFiles = files.filter((function(file) { return file.path.match(MEDIA_FILE_EXTENTIONS); })); if (0 === mediaFiles.length) return -1; seriesInfo.season && seriesInfo.episode || (seriesInfo = !1); var mediaFilesForEpisode = seriesInfo ? mediaFiles.filter((function(file) { try { var info = parseVideoName(file.path); return null !== info.season && isFinite(info.season) && info.season === seriesInfo.season && Array.isArray(info.episode) && -1 !== info.episode.indexOf(seriesInfo.episode); } catch (e) { return -1; } })) : [], selectedFile = (mediaFilesForEpisode.length > 0 ? mediaFilesForEpisode : mediaFiles).reduce((function(result, file) { return !result || file.length > result.length ? file : result; }), null); return files.indexOf(selectedFile); }; }, function(module, exports, __webpack_require__) { var hat = __webpack_require__(101), peerIds = [ "qB4600", "DE2110", "AZ5770", "TR4040" ]; module.exports = function() { for (var peerId = peerIds[Math.floor(Math.random() * peerIds.length)], newPeerId = "", i = 0; i < peerId.length; i++) if (isNaN(peerId[i])) newPeerId += peerId[i]; else { var nr = parseInt(peerId[i]); if (0 === nr) newPeerId += peerId[i]; else { var min = Math.floor(nr / 2); newPeerId += Math.floor(Math.random() * (nr - min + 1) + min); } } return `-${newPeerId}-${hat(48)}`; }; }, function(module, exports) { module.exports = require("vm"); }, function(module, exports, __webpack_require__) { var events = __webpack_require__(4), namedQueue = __webpack_require__(71), async = __webpack_require__(40), locatorapi = __webpack_require__(668), masterplaylistsapi = __webpack_require__(669), streamplaylistsapi = __webpack_require__(674), subtitlesapi = __webpack_require__(675), segmentsapi = __webpack_require__(676), videoapi = __webpack_require__(304), thumbapi = __webpack_require__(731), HLS = module.exports, allSubs = {}, evs = new events.EventEmitter, prepareQueue = new namedQueue((function(task, cb) { (HLS.prepare || videoapi.prepare)(task, cb); }), 1 / 0), convertQueue = async.queue((function(task, cb) { task(cb); }), 200); convertQueue.saturated = function() { console.log("WARNING: convertQueue saturated with concurrency: " + convertQueue.concurrency + " and tasks: " + convertQueue.length()); }; var paths = { ffmpeg: null, ffsplit: null }; locatorapi.init(paths), videoapi.init(paths, prepareQueue), masterplaylistsapi.init(prepareQueue, allSubs), streamplaylistsapi.init(prepareQueue), segmentsapi.init(paths, prepareQueue, convertQueue), thumbapi.init(paths, convertQueue), subtitlesapi.init(prepareQueue, allSubs, evs), HLS.setParallelConverts = function(converts) { convertQueue.concurrency = converts; }, HLS.locateExecutable = locatorapi.locateExecutable, HLS.locateAllExecutables = locatorapi.locateAllExecutables, HLS.masterPlaylistMiddleware = masterplaylistsapi.masterPlaylistMiddleware, HLS.masterMultiPlaylistMiddleware = masterplaylistsapi.masterMultiPlaylistMiddleware, HLS.streamPlaylistMiddleware = streamplaylistsapi.streamPlaylistMiddleware, HLS.streamPlaylistMiddleware = streamplaylistsapi.streamPlaylistMiddleware, HLS.segmentTranscodeMiddleware = segmentsapi.segmentTranscodeMiddleware, HLS.segmentMiddleware = segmentsapi.segmentMiddleware, HLS.probeVideo = videoapi.probeVideo, HLS.DLNAMpegTtsMiddleware = segmentsapi.DLNAMpegTtsMiddleware, HLS.subsPlaylistMiddleware = subtitlesapi.subsPlaylistMiddleware, HLS.subsReceiveMiddleware = subtitlesapi.subsReceiveMiddleware, HLS.thumbMiddleware = thumbapi.thumbMiddleware; }, function(module, exports, __webpack_require__) { var paths, path = __webpack_require__(5), fs = __webpack_require__(2), locatorapi = module.exports; locatorapi.locateExecutable = function(name, searchIn) { var sysPaths = process.env.PATH.split(path.delimiter).map((function(dir) { return path.join(dir, name); })); return (searchIn || []).concat(sysPaths).find((function(p) { try { return fs.accessSync(p, fs.X_OK), !0; } catch (e) { return !1; } })); }, locatorapi.locateAllExecutables = function(commandsSearchIn) { return Object.keys(commandsSearchIn).forEach((function(name) { paths[name] = locatorapi.locateExecutable(name, commandsSearchIn[name]) || paths[name]; })), paths; }, locatorapi.init = function(pathsParam) { paths = pathsParam; }; }, function(module, exports, __webpack_require__) { var prepareQueue, allSubs, common = __webpack_require__(81), languageNames = __webpack_require__(670).languageNames, url = __webpack_require__(7), masterPlaylistApi = module.exports; masterPlaylistApi.masterPlaylistMiddleware = function(req, res, next) { var query = url.parse(req.url).query; query = query ? "?" + query : "", prepareQueue.push({ id: req.params.from, from: req.params.from, opts: req.query }, (function(err, instance) { if (err) return common.handleErr(err, res); var body = [], base = req.url.split("/").slice(0, -1).join("/") + "/"; body.push("#EXTM3U"), body.push("#EXT-X-VERSION:4"); var subs = allSubs[req.query.waitForSubs]; if (subs && subs.forEach((function(s) { s && s.lang && body.push('#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="' + (s.langName || languageNames[s.langName]) + '",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="' + s.lang + '",URI="' + base + "/subs-" + s.lang + ".m3u8" + query + '"'); })), req.params.hlsMultiStream) instance.streams.forEach((function(stream, i) { if ("audio" === stream.codec_type) { var audioMeta = '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",'; stream.lang && (audioMeta += 'LANGUAGE="' + stream.lang + '",AUTOSELECT=YES,'), stream.default && (audioMeta += "DEFAULT=YES,"), audioMeta += 'NAME="' + (languageNames[stream.lang] || stream.lang || "Audio " + stream.stream) + '",URI="stream-' + stream.stream + ".m3u8" + query + '"', body.push(audioMeta); } "video" === stream.codec_type && (body.push("#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" + instance.bitrate + ',AUDIO="audio"' + (subs ? ',SUBTITLES="subs"' : "")), body.push(base + "stream-" + stream.stream + ".m3u8" + query)); })); else { var streams = [], i = 0; common.hasFFsplit() && instance.segmentsByFrame && instance.streams.some((function(x) { return "h264" == x.codec_name; })) && streams.push("#EXT-X-STREAM-INF:PROGRAM-ID=" + i++ + ",BANDWIDTH=" + instance.bitrate + (subs ? ',SUBTITLES="subs"' : "") + "\n" + base + "stream-q-o.m3u8" + query); var vs = instance.videoStream; instance.qualities.forEach((function(h) { var bitrate = common.estimateBitrate(h * vs.size[0] / vs.size[1], h, vs.fps || 24); streams.push("#EXT-X-STREAM-INF:PROGRAM-ID=" + i++ + ",BANDWIDTH=" + Math.round(1e3 * bitrate) + (subs ? ',SUBTITLES="subs"' : "") + "\n" + base + "stream-q-" + h + ".m3u8" + query); })), body = body.concat(req.params.adaptiveBitrate ? streams : streams.slice(0, 1)); } common.servePlaylist(body, res); })); }, masterPlaylistApi.masterMultiPlaylistMiddleware = function(req, res, next) { return req.params.hlsMultiStream = !0, masterPlaylistApi.masterPlaylistMiddleware(req, res, next); }, masterPlaylistApi.init = function(prepareQueueParam, allSubsParam) { prepareQueue = prepareQueueParam, allSubs = allSubsParam; }; }, function(module, exports, __webpack_require__) { module.exports = { languageNames: __webpack_require__(671), languageMap: __webpack_require__(672), languageForCountry: __webpack_require__(673) }; }, function(module) { module.exports = { abk: "аҧсуа бызшәа", aar: "Afaraf", afr: "Afrikaans", aka: "Akan", sqi: "gjuha shqipe", amh: "አማርኛ", ara: "العربية", arg: "aragonés", hye: "Հայերեն", asm: "অসমীয়া", ava: "авар мацӀ", ave: "avesta", aym: "aymar aru", aze: "azərbaycan dili", bam: "bamanankan", bak: "башҡорт теле", eus: "euskara", bel: "беларуская мова", ben: "বাংলা", bih: "भोजपुरी", bis: "Bislama", bos: "bosanski jezik", bre: "brezhoneg", bul: "български език", mya: "ဗမာစာ", cat: "català", cha: "Chamoru", che: "нохчийн мотт", nya: "chiCheŵa", zho: "中文 (Zhōngwén)", chv: "чӑваш чӗлхи", cor: "Kernewek", cos: "corsu", cre: "ᓀᐦᐃᔭᐍᐏᐣ", hrv: "hrvatski jezik", ces: "čeština", dan: "dansk", div: "ދިވެހި", nld: "Nederlands", dzo: "རྫོང་ཁ", eng: "English", epo: "Esperanto", est: "eesti", ewe: "Eʋegbe", fao: "føroyskt", fij: "vosa Vakaviti", fin: "suomi", fre: "français", ful: "Fulfulde", glg: "galego", kat: "ქართული", ger: "Deutsch", ell: "ελληνικά", grn: "Avañe'ẽ", guj: "ગુજરાતી", hat: "Kreyòl ayisyen", hau: "Hausa", heb: "עברית", her: "Otjiherero", hin: "हिन्दी", hmo: "Hiri Motu", hun: "magyar", ina: "Interlingua", ind: "Bahasa Indonesia", ile: "Interlingue", gle: "Gaeilge", ibo: "Asụsụ Igbo", ipk: "Iñupiaq", ido: "Ido", isl: "Íslenska", ita: "italiano", iku: "ᐃᓄᒃᑎᑐᑦ", jpn: "日本語 (にほんご)", jav: "basa Jawa", kal: "kalaallisut", kan: "ಕನ್ನಡ", kau: "Kanuri", kas: "कश्मीरी", kaz: "қазақ тілі", khm: "ខ្មែរ", kik: "Gĩkũyũ", kin: "Ikinyarwanda", kir: "Кыргызча", kom: "коми кыв", kon: "KiKongo", kor: "한국어 (韓國語)", kur: "Kurdî", kua: "Kuanyama", lat: "latine", ltz: "Lëtzebuergesch", lug: "Luganda", lim: "Limburgs", lin: "Lingála", lao: "ພາສາລາວ", lit: "lietuvių kalba", lub: "Tshiluba", lav: "latviešu valoda", glv: "Gaelg", mkd: "македонски јазик", mlg: "fiteny malagasy", msa: "bahasa Melayu", mal: "മലയാളം", mlt: "Malti", mri: "te reo Māori", mar: "मराठी", mah: "Kajin M̧ajeļ", mon: "монгол", nau: "Ekakairũ Naoero", nav: "Diné bizaad", nob: "Norsk bokmål", nde: "isiNdebele", nep: "नेपाली", ndo: "Owambo", nno: "Norsk nynorsk", nor: "Norsk", iii: "ꆈꌠ꒿ Nuosuhxop", nbl: "isiNdebele", oci: "occitan", oji: "ᐊᓂᔑᓈᐯᒧᐎᓐ", chu: "ѩзыкъ словѣньскъ", orm: "Afaan Oromoo", ori: "ଓଡ଼ିଆ", oss: "ирон æвзаг", pan: "ਪੰਜਾਬੀ", pli: "पाऴि", fas: "فارسی", pol: "język polski", pus: "پښتو", por: "português", pob: "português Brazil", que: "Runa Simi", roh: "rumantsch grischun", run: "Ikirundi", ron: "limba română", rus: "русский язык", san: "संस्कृतम्", srd: "sardu", snd: "सिन्धी", sme: "Davvisámegiella", smo: "gagana fa'a Samoa", sag: "yângâ tî sängö", srp: "српски језик", gla: "Gàidhlig", sna: "chiShona", sin: "සිංහල", slk: "slovenčina", slv: "slovenski jezik", som: "Soomaaliga", sot: "Sesotho", spa: "español", sun: "Basa Sunda", swa: "Kiswahili", ssw: "SiSwati", swe: "Svenska", tam: "தமிழ்", tel: "తెలుగు", tgk: "тоҷикӣ", tha: "ไทย", tir: "ትግርኛ", bod: "བོད་ཡིག", tuk: "Türkmen", tgl: "Wikang Tagalog", tsn: "Setswana", ton: "faka Tonga", tur: "Türkçe", tso: "Xitsonga", tat: "татар теле", twi: "Twi", tah: "Reo Tahiti", uig: "Uyƣurqə", ukr: "українська мова", urd: "اردو", uzb: "O'zbek", ven: "Tshivenḓa", vie: "Tiếng Việt", vol: "Volapük", wln: "walon", cym: "Cymraeg", wol: "Wollof", fry: "Frysk", xho: "isiXhosa", yid: "ייִדיש", yor: "Yorùbá", zha: "Saɯ cueŋƅ", zul: "isiZulu" }; }, function(module) { module.exports = { aa: "aar", ab: "abk", af: "afr", ak: "aka", sq: "sqi", am: "amh", ar: "ara", an: "arg", hy: "hye", as: "asm", av: "ava", ae: "ave", ay: "aym", az: "aze", ba: "bak", bm: "bam", eu: "eus", be: "bel", bn: "ben", bh: "bih", bi: "bis", bo: "bod", bs: "bos", br: "bre", bg: "bul", my: "mya", ca: "cat", cs: "ces", ch: "cha", ce: "che", zh: "zho", cu: "chu", cv: "chv", kw: "cor", co: "cos", cr: "cre", cy: "cym", da: "dan", de: "ger", dv: "div", nl: "nld", dz: "dzo", el: "ell", en: "eng", eo: "epo", et: "est", ee: "ewe", fo: "fao", fa: "fas", fj: "fij", fi: "fin", fr: "fre", fy: "fry", ff: "ful", ka: "kat", gd: "gla", ga: "gle", gl: "glg", gv: "glv", gn: "grn", gu: "guj", ht: "hat", ha: "hau", he: "heb", hz: "her", hi: "hin", ho: "hmo", hr: "hrv", hu: "hun", ig: "ibo", is: "isl", io: "ido", ii: "iii", iu: "iku", ie: "ile", ia: "ina", id: "ind", ik: "ipk", it: "ita", jv: "jav", ja: "jpn", kl: "kal", kn: "kan", ks: "kas", kr: "kau", kk: "kaz", km: "khm", ki: "kik", rw: "kin", ky: "kir", kv: "kom", kg: "kon", ko: "kor", kj: "kua", ku: "kur", lo: "lao", la: "lat", lv: "lav", li: "lim", ln: "lin", lt: "lit", lb: "ltz", lu: "lub", lg: "lug", mk: "mkd", mh: "mah", ml: "mal", mi: "mri", mr: "mar", ms: "msa", mg: "mlg", mt: "mlt", mn: "mon", na: "nau", nv: "nav", nr: "nbl", nd: "nde", ng: "ndo", ne: "nep", nn: "nno", nb: "nob", no: "nor", ny: "nya", oc: "oci", oj: "oji", or: "ori", om: "orm", os: "oss", pa: "pan", pi: "pli", pl: "pol", pt: "por", ps: "pus", qu: "que", rm: "roh", ro: "ron", rn: "run", ru: "rus", sg: "sag", sa: "san", si: "sin", sk: "slk", sl: "slv", se: "sme", sm: "smo", sn: "sna", sd: "snd", so: "som", st: "sot", es: "spa", sc: "srd", sr: "srp", ss: "ssw", su: "sun", sw: "swa", sv: "swe", ty: "tah", ta: "tam", tt: "tat", te: "tel", tg: "tgk", tl: "tgl", th: "tha", ti: "tir", to: "ton", tn: "tsn", ts: "tso", tk: "tuk", tr: "tur", tw: "twi", ug: "uig", uk: "ukr", ur: "urd", uz: "uzb", ve: "ven", vi: "vie", vo: "vol", wa: "wln", wo: "wol", xh: "xho", yi: "yid", yo: "yor", za: "zha", zu: "zul" }; }, function(module) { module.exports = { AD: [ "cat" ], AE: [ "ara", "fas", "eng", "hin", "urd" ], AF: [ "fas", "pus", "uzb", "tuk" ], AG: [ "eng" ], AI: [ "eng" ], AL: [ "sqi", "ell" ], AM: [ "hye" ], AO: [ "por" ], AQ: [], AR: [ "spa", "eng", "ita", "ger", "fre", "grn" ], AS: [ "eng", "smo", "ton" ], AT: [ "ger", "hrv", "hun", "slv" ], AU: [ "eng" ], AW: [ "nld", "spa", "eng" ], AX: [ "swe" ], AZ: [ "aze", "rus", "hye" ], BA: [ "bos", "hrv", "srp" ], BB: [ "eng" ], BD: [ "ben", "eng" ], BE: [ "nld", "fre", "ger" ], BF: [ "fre" ], BG: [ "bul", "tur" ], BH: [ "ara", "eng", "fas", "urd" ], BI: [ "fre", "run" ], BJ: [ "fre" ], BL: [ "fre" ], BM: [ "eng", "por" ], BN: [ "msa", "eng" ], BO: [ "spa", "que", "aym" ], BQ: [ "nld", "eng" ], BR: [ "por", "spa", "eng", "fre" ], BS: [ "eng" ], BT: [ "dzo" ], BV: [], BW: [ "eng", "tsn" ], BY: [ "bel", "rus" ], BZ: [ "eng", "spa" ], CA: [ "eng", "fre", "iku" ], CC: [ "msa", "eng" ], CD: [ "fre", "lin", "kon" ], CF: [ "fre", "sag", "lin", "kon" ], CG: [ "fre", "kon", "lin" ], CH: [ "ger", "fre", "ita", "roh" ], CI: [ "fre" ], CK: [ "eng", "mri" ], CL: [ "spa" ], CM: [ "eng", "fre" ], CN: [ "zho", "uig", "zha" ], CO: [ "spa" ], CR: [ "spa", "eng" ], CU: [ "spa" ], CV: [ "por" ], CW: [ "nld" ], CX: [ "eng", "zho", "msa" ], CY: [ "ell", "tur", "eng" ], CZ: [ "ces", "slk" ], DE: [ "ger" ], DJ: [ "fre", "ara", "som", "aar" ], DK: [ "dan", "eng", "fao", "ger" ], DM: [ "eng" ], DO: [ "spa" ], DZ: [ "ara" ], EC: [ "spa" ], EE: [ "est", "rus" ], EG: [ "ara", "eng", "fre" ], EH: [ "ara" ], ER: [ "aar", "ara", "tir" ], ES: [ "spa", "cat", "glg", "eus", "oci" ], ET: [ "amh", "eng", "orm", "tir", "som" ], FI: [ "fin", "swe" ], FJ: [ "eng", "fij" ], FK: [ "eng" ], FM: [ "eng" ], FO: [ "fao", "dan" ], FR: [ "fre", "bre", "cos", "cat", "eus", "oci" ], GA: [ "fre" ], GB: [ "eng", "cym", "gla" ], GD: [ "eng" ], GE: [ "kat", "rus", "hye", "aze" ], GF: [ "fre" ], GG: [ "eng", "fre" ], GH: [ "eng", "aka", "ewe", "twi" ], GI: [ "eng", "spa", "ita", "por" ], GL: [ "kal", "dan", "eng" ], GM: [ "eng", "wol", "ful" ], GN: [ "fre" ], GP: [ "fre" ], GQ: [ "spa", "fre" ], GR: [ "ell", "eng", "fre" ], GS: [ "eng" ], GT: [ "spa" ], GU: [ "eng", "cha" ], GW: [ "por" ], GY: [ "eng" ], HK: [ "zho", "zho", "eng" ], HM: [], HN: [ "spa" ], HR: [ "hrv", "srp" ], HT: [ "hat", "fre" ], HU: [ "hun" ], ID: [ "ind", "eng", "nld", "jav" ], IE: [ "eng", "gle" ], IL: [ "heb", "ara", "eng" ], IM: [ "eng", "glv" ], IN: [ "eng", "hin", "ben", "tel", "mar", "tam", "urd", "guj", "kan", "mal", "ori", "pan", "asm", "bih", "kas", "nep", "snd", "san", "fre" ], IO: [ "eng" ], IQ: [ "ara", "kur", "hye" ], IR: [ "fas", "kur" ], IS: [ "isl", "eng", "ger", "dan", "swe", "nor" ], IT: [ "ita", "ger", "fre", "srd", "cat", "cos", "slv" ], JE: [ "eng", "por" ], JM: [ "eng" ], JO: [ "ara", "eng" ], JP: [ "jpn" ], KE: [ "eng", "swa" ], KG: [ "kir", "uzb", "rus" ], KH: [ "khm", "fre", "eng" ], KI: [ "eng" ], KM: [ "ara", "fre" ], KN: [ "eng" ], KP: [ "kor" ], KR: [ "kor", "eng" ], XK: [ "sqi", "srp" ], KW: [ "ara", "eng" ], KY: [ "eng" ], KZ: [ "kaz", "rus" ], LA: [ "lao", "fre", "eng" ], LB: [ "ara", "fre", "eng", "hye" ], LC: [ "eng" ], LI: [ "ger" ], LK: [ "sin", "tam", "eng" ], LR: [ "eng" ], LS: [ "eng", "sot", "zul", "xho" ], LT: [ "lit", "rus", "pol" ], LU: [ "ltz", "ger", "fre" ], LV: [ "lav", "rus", "lit" ], LY: [ "ara", "ita", "eng" ], MA: [ "ara", "fre" ], MC: [ "fre", "eng", "ita" ], MD: [ "ron", "rus", "tur" ], ME: [ "srp", "hun", "bos", "sqi", "hrv" ], MF: [ "fre" ], MG: [ "fre", "mlg" ], MH: [ "mah", "eng" ], MK: [ "mkd", "sqi", "tur", "srp" ], ML: [ "fre", "bam" ], MM: [ "mya" ], MN: [ "mon", "rus" ], MO: [ "zho", "zho", "por" ], MP: [ "tgl", "zho", "cha", "eng" ], MQ: [ "fre" ], MR: [ "ara", "fre", "wol" ], MS: [ "eng" ], MT: [ "mlt", "eng" ], MU: [ "eng", "fre" ], MV: [ "div", "eng" ], MW: [ "nya" ], MX: [ "spa" ], MY: [ "msa", "eng", "zho", "tam", "tel", "mal", "pan", "tha" ], MZ: [ "por" ], NA: [ "eng", "afr", "ger", "her" ], NC: [ "fre" ], NE: [ "fre", "hau", "kau" ], NF: [ "eng" ], NG: [ "eng", "hau", "yor", "ibo", "ful" ], NI: [ "spa", "eng" ], NL: [ "nld", "fry" ], NO: [ "nor", "nob", "nno", "sme", "fin" ], NP: [ "nep", "eng" ], NR: [ "nau", "eng" ], NU: [ "eng" ], NZ: [ "eng", "mri" ], OM: [ "ara", "eng", "urd" ], PA: [ "spa", "eng" ], PE: [ "spa", "que", "aym" ], PF: [ "fre", "tah" ], PG: [ "eng", "hmo" ], PH: [ "tgl", "eng" ], PK: [ "urd", "eng", "pan", "snd", "pus" ], PL: [ "pol" ], PM: [ "fre" ], PN: [ "eng" ], PR: [ "eng", "spa" ], PS: [ "ara" ], PT: [ "por" ], PW: [ "eng", "jpn", "zho" ], PY: [ "spa", "grn" ], QA: [ "ara", "spa" ], RE: [ "fre" ], RO: [ "ron", "hun" ], RS: [ "srp", "hun", "bos" ], RU: [ "rus", "tat", "kom", "che", "chv", "bak" ], RW: [ "kin", "eng", "fre", "swa" ], SA: [ "ara" ], SB: [ "eng" ], SC: [ "eng", "fre" ], SD: [ "ara", "eng" ], SS: [ "eng" ], SE: [ "swe", "sme", "fin" ], SG: [ "eng", "msa", "tam", "zho" ], SH: [ "eng" ], SI: [ "slv" ], SJ: [ "nor", "rus" ], SK: [ "slk", "hun" ], SL: [ "eng" ], SM: [ "ita" ], SN: [ "fre", "wol" ], SO: [ "som", "ara", "ita", "eng" ], SR: [ "nld", "eng", "jav" ], ST: [ "por" ], SV: [ "spa" ], SX: [ "nld", "eng" ], SY: [ "ara", "kur", "hye", "fre", "eng" ], SZ: [ "eng", "ssw" ], TC: [ "eng" ], TD: [ "fre", "ara" ], TF: [ "fre" ], TG: [ "fre", "ewe", "hau" ], TH: [ "tha", "eng" ], TJ: [ "tgk", "rus" ], TK: [ "eng" ], TL: [ "por", "ind", "eng" ], TM: [ "tuk", "rus", "uzb" ], TN: [ "ara", "fre" ], TO: [ "ton", "eng" ], TR: [ "tur", "kur", "aze", "ava" ], TT: [ "eng", "fre", "spa", "zho" ], TV: [ "eng", "smo" ], TW: [ "zho", "zho" ], TZ: [ "swa", "eng", "ara" ], UA: [ "ukr", "rus", "pol", "hun" ], UG: [ "eng", "lug", "swa", "ara" ], UM: [ "eng" ], US: [ "eng", "spa", "fre" ], UY: [ "spa" ], UZ: [ "uzb", "rus", "tgk" ], VA: [ "lat", "ita", "fre" ], VC: [ "eng", "fre" ], VE: [ "spa" ], VG: [ "eng" ], VI: [ "eng" ], VN: [ "vie", "eng", "fre", "zho", "khm" ], VU: [ "bis", "eng", "fre" ], WF: [ "fre" ], WS: [ "smo", "eng" ], YE: [ "ara" ], YT: [ "fre" ], ZA: [ "zul", "xho", "afr", "eng", "tsn", "sot", "tso", "ssw", "ven", "nbl" ], ZM: [ "eng", "nya" ], ZW: [ "eng", "sna", "nbl", "nde" ], CS: [ "chu", "hun", "sqi", "srp" ], AN: [ "nld", "eng", "spa" ] }; }, function(module, exports, __webpack_require__) { var prepareQueue, common = __webpack_require__(81), streamPlaylistApi = module.exports; streamPlaylistApi.streamPlaylistMiddleware = function(req, res, next) { var prefix = req.params.hasOwnProperty("stream") || req.params.hasOwnProperty("quality") ? req.url.split("/").pop().split(".")[0] + "/" : ""; prepareQueue.push({ id: req.params.from, from: req.params.from, opts: req.query }, (function(err, instance) { if (err) return common.handleErr(err, res); req.params.quality || console.error("WARNING: streamPlaylistMiddleware should no longer be used without quality"); var q = parseInt(req.params.quality, 10); if (instance.qualities && -1 === instance.qualities.indexOf(q) && "o" !== req.params.quality) return common.handleErr({ message: "no such quality", httpCode: 404 }, res); var segments = isNaN(req.params.quality) ? instance.segmentsByFrame : instance.segmentsUniform, body = []; body.push("#EXTM3U"), body.push("#EXT-X-VERSION:4"); var maxDuration = segments.reduce((function(r, s) { return Math.max(r, s.duration); }), 0); body.push("#EXT-X-TARGETDURATION:" + Math.ceil(maxDuration / 1e3)), body.push("#EXT-X-MEDIA-SEQUENCE:0"), body.push("#EXT-X-PLAYLIST-TYPE:VOD"), segments.forEach((function(seg, i) { req.query.xdiscontinuity && body.push("#EXT-X-DISCONTINUITY"), body.push("#EXTINF:" + common.toSecs(seg.duration) + ","), body.push(prefix + i + ".ts" + (req.search || "")); })), body.push("#EXT-X-ENDLIST"), common.servePlaylist(body, res); })); }, streamPlaylistApi.init = function(prepareQueueParam) { prepareQueue = prepareQueueParam; }; }, function(module, exports, __webpack_require__) { var prepareQueue, allSubs, evs, common = __webpack_require__(81), subtitlesApi = module.exports; subtitlesApi.subsPlaylistMiddleware = function(req, res, next) { prepareQueue.push({ id: req.params.from, from: req.params.from, opts: req.query }, (function(err, instance) { if (err) return common.handleErr(err, res); var body = []; body.push("#EXTM3U"), body.push("#EXT-X-VERSION:4"); var sub = (allSubs[req.query.waitForSubs] || []).filter((function(s) { return req.params.lang === s.lang; }))[0]; if (!sub) return res.end(); body.push("#EXT-X-TARGETDURATION:" + Math.ceil(instance.duration / 1e3)), body.push("#EXT-X-MEDIA-SEQUENCE:1"), body.push("#EXT-X-PLAYLIST-TYPE:VOD"), body.push("#EXTINF:" + common.toSecs(instance.duration) + ","), body.push("http://" + req.headers.host + "/subtitles.vtt?from=" + encodeURIComponent(sub.url)), body.push("#EXT-X-ENDLIST"), common.servePlaylist(body, res); })); }, subtitlesApi.subsReceiveMiddleware = function(req, res, next) { var id = req.params.item, subs = req.body; allSubs[id] = subs, evs.emit("subtitles:" + id, subs), res.end(); }, subtitlesApi.init = function(prepareQueueParam, allSubsParam, evsParams) { prepareQueue = prepareQueueParam, allSubs = allSubsParam, evs = evsParams; }; }, function(module, exports, __webpack_require__) { var prepareQueue, paths, convertQueue, common = __webpack_require__(81), once = __webpack_require__(35), child = __webpack_require__(32), ffmpegArgs = __webpack_require__(677), segmentApi = module.exports, headerMap = { audio: 'audio/mp2t; codecs="mp4a.40.5"', video: 'video/mp2t; codecs="avc1.42E01F"', other: "video/mp2t" }; segmentApi.segmentMiddleware = function(req, res, next) { prepareQueue.push({ id: req.params.from, from: req.params.from, opts: req.query }, (function(err, instance) { if (err) common.handleErr(err, res); else { if (req.params.quality = req.params.quality || (instance.segmentsByFrame ? "o" : 720), !isNaN(req.params.quality)) return setTimeout((function() { segmentApi.segmentTranscodeMiddleware(req, res, next); }), 0); var segment = instance.segmentsByFrame[parseInt(req.params.seg, 10)]; if (segment) { var transcode = { video: !1, audio: !1 }, selectedStream = instance.streams[req.params.stream], splitArgs = [ req.params.from, segment.at, segment.duration ]; if (selectedStream ? (splitArgs.push(selectedStream.stream), transcode[selectedStream.codec_type] = transcode[selectedStream.codec_type] || !common.streamShouldTransmux(selectedStream)) : (splitArgs.push(-1), transcode = instance.streams.reduce((function(ret, s) { return ret[s.codec_type] = ret[s.codec_type] || !common.streamShouldTransmux(s), ret; }), transcode)), transcode.video) return setTimeout((function() { segmentApi.segmentTranscodeMiddleware(req, res, next); }), 0); !(function(res, splitArgs) { convertQueue.push((function(cb) { var next = once(cb); !(function(res, selectedParam) { var selected = "other"; res.setHeader("Content-Type", headerMap[selected]); })(res), res.setHeader("X-HLS-Flow", "splitter"), process.env.FFMPEG_DEBUG && console.log("\n --\x3e RUN " + paths.ffsplit + " " + splitArgs.join(" ")); var p = child.spawn(paths.ffsplit, splitArgs, { detached: !0, stdio: [ "ignore", null, process.env.FFSPLIT_DEBUG ? null : "inherit" ] }); common.pipeProcToResp(p, res, next), process.env.FFSPLIT_DEBUG && p.stderr && p.stderr.pipe(process.stderr); })); })(res, splitArgs); } else common.handleErr({ message: "segment does not exist in segmentsByFrame", httpCode: 404 }, res); } })); }, segmentApi.segmentTranscodeMiddleware = function(req, res, next) { prepareQueue.push({ id: req.params.from, from: req.params.from, opts: req.query }, (function(err, instance) { if (err) common.handleErr(err, res); else { var segment = instance.segmentsUniform[parseInt(req.params.seg, 10)]; if (segment) { var selectedStream = instance.streams[req.params.stream], transcodeArgs = [ "-ss", common.toSecs(segment.at), "-t", common.toSecs(segment.duration), "-i", req.params.from, "-af", "aselect=gt(n\\,1)" ], q = parseInt(req.params.quality, 10); q && -1 === instance.qualities.indexOf(q) ? common.handleErr({ message: "no such quality", httpCode: 404 }, res) : (q && instance.videoStream.size[1] - q > 100 && (transcodeArgs = transcodeArgs.concat([ "-vf", "scale=-2:" + req.params.quality ])), transcodeArgs = (transcodeArgs = selectedStream ? transcodeArgs.concat([ "-map", "0:" + selectedStream.stream ], ffmpegArgs[selectedStream.codec_type].notTransmuxing) : transcodeArgs.concat(ffmpegArgs.video.notTransmuxing, ffmpegArgs.audio.notTransmuxing)).concat(ffmpegArgs.end.any), res.setHeader("X-HLS-Flow", "transcoder"), common.serveFfmpeg(transcodeArgs, "video/mp2t", res)); } else common.handleErr({ message: "segment does not exist in segmentsUniform", httpCode: 404 }, res); } })); }, segmentApi.DLNAMpegTtsMiddleware = function(req, res, next) { prepareQueue.push({ id: req.params.from, from: req.params.from, opts: req.query }, (function(err, instance) { if (err) common.handleErr(err, res); else { var vidTransmux = instance.streams.every((function(stream) { return "video" !== stream.codec_type || common.streamShouldTransmux(stream); })), audTransmux = instance.streams.every((function(stream) { return "audio" !== stream.codec_type || common.streamShouldTransmux(stream); })); process.env.FFMPEG_DEBUG && console.log(instance.streams, vidTransmux, audTransmux); var args = [ "-ss", common.toSecs(parseInt(req.params.at) || 0), "-i", req.params.from, "-c:v", vidTransmux ? "copy" : "libx264", "-c:a", audTransmux ? "copy" : "aac" ]; vidTransmux && (args = args.concat(ffmpegArgs.video.getFilter(instance))), args = args.concat([ "-strict", "-2", "-loglevel", process.env.FFMPEG_DEBUG ? "warning" : "error", "-tune", "zerolatency", "-f", "mpegts", "pipe:1" ]), res.setHeader("transferMode.dlna.org", "Streaming"), res.setHeader("contentFeatures.dlna.org", "DLNA.ORG_PN=AVC_TS_BL_CIF15_AAC_540;DLNA.ORG_FLAGS=ED100000000000000000000000000000"), common.serveFfmpeg(args, "video/vnd.dlna.mpeg-tts", res); } })); }, segmentApi.init = function(pathsParam, prepareQueueParam, convertQueueParam) { paths = pathsParam, prepareQueue = prepareQueueParam, convertQueue = convertQueueParam, common.init(paths, convertQueue); }; }, function(module, exports) { module.exports = segmentMiddlewareArgs = { start: { any: [ "-i", "pipe:0", "-map_metadata", -1 ] }, video: { transmuxing: [ "-c:v", "copy" ], notTransmuxing: [ "-c:v", "libx264", "-pix_fmt", "yuv420p", "-preset", "veryfast", "-tune", "zerolatency" ], getFilter: function(instance) { var video_stream = instance.streams.find((function(stream) { return "video" == stream.codec_type; })); if (video_stream) { if ("h264" === video_stream.codec_name) return [ "-vbsf", "h264_mp4toannexb" ]; if ("hevc" === video_stream.codec_name) return [ "-vbsf", "hevc_mp4toannexb" ]; } return []; } }, audio: { transmuxing: [ "-c:a", "copy", "-strict", "experimental", "-ac", "2" ], notTransmuxing: [ "-c:a", "aac", "-strict", "experimental", "-ac", "2" ] }, end: { any: [ "-copyts", "-mpegts_copyts", "1", "-f", "mpegts", "-threads", "0", "pipe:1" ], fmp4: [ "-f", "mp4", "-movflags", "frag_keyframe+dash", "-threads", "0", "pipe:1" ] } }; }, function(module, exports, __webpack_require__) { var getForMkv = __webpack_require__(679), getForMp4 = __webpack_require__(718); module.exports = { get: function(url, container, cb) { void 0 === container && (container = url.match(/\.mkv/) ? "mkv" : "mp4"), "matroska" === container && (container = "mkv"), ("mkv" === container ? getForMkv : getForMp4)(url, cb); }, getForMkv: getForMkv, getForMp4: getForMp4 }; }, function(module, exports, __webpack_require__) { var mkv = __webpack_require__(680); function atPath() { var arg, args = Array.prototype.slice.call(arguments), data = args.shift(); if (data) { for (;arg = args.shift(); ) { if (!arg) return data; if (!data.children) return; if (!(data = data.children.filter((function(x) { return x._name === arg; }))[0])) return; } return data; } } function findById(all, name) { return all.filter((function(x) { return x._name === name; }))[0]; } module.exports = function(url, cb) { new mkv.Decoder({ skipTags: { SimpleBlock: !0, Void: !0, Block: !0, FileData: !0, Cluster: !0 } }).parseEbmlIDs(url, [ mkv.Schema.byName.Cues, mkv.Schema.byName.Tracks ], (function(err, doc) { if (err) return cb(err); var videoTrackIdx = -1; if (atPath(doc, "Segment", "Tracks").children.forEach((function(track) { if (track.children) { var trackNum = findById(track.children, "TrackNumber").getUInt(); 1 === findById(track.children, "TrackType").getUInt() && (videoTrackIdx = trackNum); } })), -1 === videoTrackIdx) return cb(new Error("no video tracks found")); var cues = atPath(doc, "Segment", "Cues"); if (!(cues && cues.children && cues.children.length)) return cb(new Error("no cues found in doc -> Segment -> Cues")); if (!(cues = cues.children.filter((function(x) { return "CuePoint" === x._name; }))).length) return cb(new Error("no CuePoints")); var frames = cues.filter((function(cue) { return cue.children[1].children[0].getUInt() === videoTrackIdx; })).map((function(cue) { var t = cue.children[0].getUInt(); return { timestamp: t, pts: t, dts: t }; })); cb(null, frames); })); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { Decoder: __webpack_require__(681), Document: __webpack_require__(305), Schema: __webpack_require__(12), FileSource: __webpack_require__(309), HttpSource: __webpack_require__(310), StreamFactorySource: __webpack_require__(717) }; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(44)("matroska:decoder"), debugTag = __webpack_require__(44)("matroska:decoder:tag"), util = (__webpack_require__(2), __webpack_require__(10).SlowBuffer, __webpack_require__(0)), Writable = __webpack_require__(3).Writable, Document2 = __webpack_require__(682), Source = __webpack_require__(308), FileSource = __webpack_require__(309), HttpSource = __webpack_require__(310), tools = __webpack_require__(83), schema = __webpack_require__(12); function Decoder(options) { Writable.call(this, options), options = options || {}, this.options = options, this.skipTags = options.skipTags, void 0 === this.skipTags && (this.skipTags = { SimpleBlock: !0, Void: !0, Block: !0, FileData: !0, TagBinary: !0 }), this._streamSession = {}, this.ignoreData = options.ignoreData, this._buffer = null, this._tag_stack = [], this._state = 1, this._bufferOffset = 0, this._fileOffset = 0, this._tagVint = {}, this._workingBuffer = new Buffer(64), this.document = new Document2, this._skipTagData = !0 === this.ignoreData; var self = this; this.on("finish", (function() { self.document._buildLinks(), self.emit("$document", self.document); })); } module.exports = Decoder, util.inherits(Decoder, Writable), Decoder.OnlyMetaDatas = function() { return { skipTags: { SimpleBlock: !0, Void: !0, Block: !0, FileData: !0, Cluster: !0, Cues: !0, Tracks: !0 } }; }, Decoder.AllDatas = function() { return { skipTags: {} }; }, Decoder.prototype._getStream = function(source, callback) { var self = this, enabled = !0; debug("Request stream ", self._readOffset), source.getStream(this._streamSession, { start: self._readOffset }, (function(error, stream) { if (error) return callback(error); self._fileOffset = self._readOffset, self._buffer = null, self._bufferOffset = 0, self._skipBytes = 0, stream.on("end", (function() { enabled && (enabled = !1, callback(null, self.document)); })), stream.on("error", (function(error) { enabled && callback(error); })), stream.on("readable", (function() { if (enabled) { for (var bs = []; ;) { var b = stream.read(); if (!b) break; bs.push(b); } if (bs.length) { var buffer = bs.length > 1 ? Buffer.concat(bs) : bs[0], bytesRead = buffer.length; if (self._skipBytes) { if (debug.enabled && debug("SkipBytes catch " + bytesRead + "/" + self._skipBytes), bytesRead <= self._skipBytes) return self._skipBytes -= bytesRead, void (self._fileOffset += bytesRead); bytesRead = (buffer = buffer.slice(self._skipBytes)).length, self._fileOffset += self._skipBytes, self._skipBytes = 0; } self._readOffset += bytesRead; var currentPosition = self._readOffset; debug.enabled && debug("Buffer Read length=", bytesRead, " readOffset=" + self._readOffset + " fileOffset=" + self._fileOffset), self._write(buffer, null, (function() { if (self._stop) return enabled = !1, void callback(self._parsingError, self.document); if (self._skipBytes) { if (debug.enabled && debug("skipBytes " + self._skipBytes), self._buffer) { var left = self._buffer.length - self._bufferOffset; if (debug("skipBytes left=" + left), self._skipBytes <= left) return self._bufferOffset += self._skipBytes, self._fileOffset += self._skipBytes, void (self._skipBytes = 0); self._skipBytes -= left, self._fileOffset += left, self._buffer = null, self._bufferOffset = 0; } if (self._skipBytes < 32e3) return; self._readOffset += self._skipBytes; } return currentPosition !== self._readOffset ? (debug.enabled && debug("Read offset changed to " + self._readOffset), enabled = !1, stream.destroy(), void setImmediate(self._getStream.bind(self, source, callback))) : void 0; })); } else debug("No buffer"); } })); })); }, Decoder.prototype.parse = function(source, callback) { if (this.document.children) return callback(new Error("Document has already children")); if ("string" == typeof source && (source = /^http:\/\//.test(source) ? new HttpSource(source) : new FileSource(source)), source instanceof Source == 0) throw new Error("Invalid source parameter (" + source + ")"); this.document.source = source, this._skipTagData = !0 === this.ignoreData, this._readOffset = 0; var self = this; this._getStream(source, (function(error, document) { source.end(self._streamSession, (function() { document && document._buildLinks(), callback(error, document); })); })); }, Decoder.prototype._write = function(chunk, enc, done) { if (debug.enabled && debug("State=" + this._state + " skip=" + this._skipBytes + " bufferOffset=" + this._bufferOffset + " chunk=" + chunk.length), 4 === this._state) { if (this._skipBytes >= chunk.length ? (this._skipBytes -= chunk.length, this._fileOffset += chunk.length, this._bufferOffset = 0, chunk = null) : (this._fileOffset += this._skipBytes, this._bufferOffset = this._skipBytes, this._skipBytes = 0), this._skipBytes || (this._skipEndFunc && (this._skipEndFunc(), this._skipEndFunc = null), this._state = 1), !chunk || !chunk.length) return void done(); this._buffer = null; } if (this._buffer) { var buf = this._buffer; this._bufferOffset && (buf = buf.slice(this._bufferOffset)), this._buffer = Buffer.concat([ buf, chunk ]); } else this._buffer = chunk; this._bufferOffset = 0; try { for (;!this._stop && this._buffer && this._bufferOffset < this._buffer.length; ) if (1 !== this._state) { if (2 !== this._state) { if (3 !== this._state) { if (4 === this._state) break; debug("Invalid state ", this._state); } else if (!this.readContent()) break; } else if (!this.readSize()) break; } else if (!this.readTag()) break; } catch (x) { return console.error(x), this._parsingError = x, this._stop = !0, void done(); } this._buffer && this._bufferOffset === this._buffer.length && (this._buffer = null, this._bufferOffset = 0), done(); }, Decoder.prototype.readTag = function() { debugTag.enabled && debugTag("parsing tag"); var tag, start = this._fileOffset; try { tag = tools.readHInt(this._buffer, this._bufferOffset, this._tagVint); } catch (x) { throw x; } if (null === tag) return !this._EBMLFormatVerified && this._buffer.length > 7 ? (debug("Invalid format !"), this._parsingError = new Error("Invalid format for " + this.document), this._stop = !0, !1) : (debug("waiting for more data"), !1); if (!this._EBMLFormatVerified) { if (tag.value !== schema.byName.EBML) return debug("Invalid format !"), this._parsingError = new Error("Invalid format for " + this.document), this._stop = !0, !1; this._EBMLFormatVerified = !0; } this._bufferOffset += tag.length, this._fileOffset += tag.length, this._state = 2; var parent, stack = this._tag_stack; stack.length && (parent = stack[stack.length - 1]); var tagObj = this.document.createElement(tag.value, start, tag.length); return (parent || this.document).appendChild(tagObj, !1), stack.push(tagObj), debugTag.enabled && debugTag("push tag: " + util.inspect(tagObj, { depth: 1 })), !0; }, Decoder.prototype.readSize = function() { var tagObj = this._tag_stack[this._tag_stack.length - 1]; debugTag.enabled && debugTag("parsing size for tag: 0x" + tagObj.ebmlID.toString(16)); var size = tools.readVInt(this._buffer, this._bufferOffset, this._tagVint); if (null === size) return debugTag.enabled && debugTag("waiting for more data (size is null) " + this._bufferOffset + "/" + this._buffer.length), !1; if (size.value < 0) throw new Error("Invalid size " + size.value + " cursor=" + this._bufferOffset + " buffer=" + this._buffer.length); return this._bufferOffset += size.length, this._fileOffset += size.length, this._state = 3, tagObj._setDataSize(size.value, size.length), debugTag.enabled && debugTag("read size: " + size.value), 0 !== size.value || this.endContent(tagObj); }, Decoder.prototype.readContent = function() { var stack = this._tag_stack, tag = stack[stack.length - 1]; if (debugTag.enabled && debugTag("parsing content for tag: " + tag.ebmlID.toString(16)), tag.masterType) { if (debugTag.enabled && debugTag("content should be tags"), this.emit(tag._name, tag), this._state = 1, this.skipTags && this.skipTags[tag._name]) { stack.pop(); var leftBytes = this._buffer.length - this._bufferOffset, contentBytes = tag.end - this._fileOffset; return contentBytes >= leftBytes ? (this._skipBytes = contentBytes - leftBytes, this._fileOffset += leftBytes, this._buffer = null, this._bufferOffset = 0, this._state = 4, !1) : (this._bufferOffset += contentBytes, this._fileOffset += contentBytes, !0); } return !0; } if ((leftBytes = this._buffer.length - this._bufferOffset) < tag.dataSize) return debugTag.enabled && debugTag("waiting for more data: got=" + leftBytes, "need=" + (tag.dataSize - leftBytes)), (this._skipTagData || this.skipTags && this.skipTags[tag._name]) && (this._skipBytes = tag.dataSize - leftBytes, this._fileOffset += leftBytes, this._buffer = null, this._bufferOffset = 0, this._state = 4, this._skipEndFunc = this.endContent.bind(this, tag)), !1; if (debugTag.enabled && debugTag("Get content data: got=" + leftBytes, "need=" + (tag.dataSize - leftBytes)), !(this.ignoreData || this.skipTags && this.skipTags[tag._name])) { var data = this._buffer.slice(this._bufferOffset, this._bufferOffset + tag.dataSize); tag._setData(data); } return this._fileOffset += tag.dataSize, this._buffer = this._buffer.slice(this._bufferOffset + tag.dataSize), this._bufferOffset = 0, this.endContent(tag); }, Decoder.prototype.endContent = function(tagObj) { var stack = this._tag_stack; for (stack.pop(); stack.length; ) { var topElement = stack[stack.length - 1]; if (this._fileOffset < topElement.end) break; debugTag.enabled && debugTag("Pop " + topElement._name), this.emit(topElement._name + ":end", topElement), stack.pop(); } return this.emit(tagObj._name, tagObj), debugTag.enabled && (tagObj.data ? tagObj.data.length <= 128 ? debugTag('read data: len="+tagData.length+" value=0x' + tagObj.data.toString("hex")) : debugTag("read data:", tagObj.data) : debugTag("read data: NULL")), debugTag.enabled && debugTag("Push " + util.inspect(tagObj, { depth: 0 })), this._state = 1, !0; }, Decoder.parseInfoTagsAndAttachments = function(source, callback) { new Decoder(Decoder.OnlyMetaDatas()).parseEbmlIDs(source, [ schema.byName.Info, schema.byName.Tags, schema.byName.Attachments ], callback); }, Decoder.prototype.parseEbmlIDs = function(source, ebmlIDs, callback) { util.isArray(ebmlIDs) || (ebmlIDs = [ ebmlIDs ]), this.document._partial = !0; var segmentContentPosition, self = this, toParse = {}, targets = {}, positions = []; function nextPosition() { if (positions.length) { var position = positions.shift(), newOffset = segmentContentPosition + position; if (debug.enabled && debug("New offset=" + newOffset, "fileOffset=", self._fileOffset, "bufferOffset=", self._bufferOffset, "buffer.length=", self._buffer.length), self._buffer) { var start = self._fileOffset - self._bufferOffset; if (newOffset >= start && newOffset < start + self._buffer.length) return self._fileOffset = newOffset, self._bufferOffset = newOffset - start, self._skipBytes = 0, void (self._state = 1); } if (newOffset > self._readOffset) return self._skipBytes = newOffset - self._readOffset, self._fileOffset = self._readOffset, self._buffer = null, self._bufferOffset = 0, void (self._state = 1); self._readOffset = newOffset, self._fileOffset = newOffset, self._buffer = null, self._bufferOffset = 0, self._skipBytes = 0, self._state = 1; } else self._stop = !0; } ebmlIDs.forEach((function(name) { var ebmlID = tools.convertEbmlID(name); if (!toParse[ebmlID]) { toParse[ebmlID] = !0; var ebmlName = schema.byEbmlID[ebmlID].name; self.on(ebmlName, (function(tag) { targets[tag.ebmlID] = tag; })), self.on(ebmlName + ":end", (function(tag) { nextPosition(); })); } })), this.on("Seek:end", (function(tag) { var sid = tag.seekID; toParse[sid] && positions.push(tag.seekPosition); })), this.on("SeekHead:end", (function(seekHead) { segmentContentPosition = seekHead.getLevel1().getContentPosition(), positions.sort((function(v1, v2) { return v1 - v2; })), nextPosition(); })), this.parse(source, (function(error, document) { if (error) return callback(error); callback(null, self.document, targets); })); }; }, function(module, exports, __webpack_require__) { "use strict"; var async = __webpack_require__(40), util = __webpack_require__(0), Document1 = __webpack_require__(683); function Document2() { Document1.call(this); } __webpack_require__(12), util.inherits(Document2, Document1), module.exports = Document2, Document2.prototype.optimizeData = function(options, callback) { if (1 === arguments.length && "function" == typeof options && (callback = options, options = null), !this.children) return callback(); options = options || {}; var cnt = 0; return this.deepWalk((function(child) { var c = child._optimizeData(options); cnt += c; })), console.log("Optimize " + cnt + " values"), callback(); }, Document2.prototype.normalizeSegments = function(options, callback) { var segments = this.segments; options = options || {}, async.eachSeries(segments, (function(segment, callback) { segment.normalize(options, callback); }), callback); }, Document2.prototype._prepareDocument = function(options, callback) { var fcts = [], self = this; !1 !== options.normalizeSegments && fcts.push((function(callback) { self.normalizeSegments(options, callback); })), !1 !== options.optimizeData && fcts.push((function(callback) { self.optimizeData(options, callback); })), void 0 !== options.forceStereoMode && this.segments.forEach((function(segment) { segment.tracks.trackEntries.forEach((function(trackEntry) { try { var video = trackEntry.video; if (!video) return; video.stereoMode = options.forceStereoMode; } catch (x) { console.error(x); } })); })), self = this, async.series(fcts, (function(error) { if (error) return callback(error); Document1.prototype._prepareDocument.call(self, options, callback); })); }; }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(40); var util = __webpack_require__(0), Document = __webpack_require__(305), schema = __webpack_require__(12); function Document1() { Document.call(this); } util.inherits(Document1, Document), module.exports = Document1, Document1.prototype.getEBML = function() { return this.getFirstChildByName(schema.byName.EBML); }, Document1.prototype.getFirstSegment = function() { return this.getFirstChildByName(schema.byName.Segment); }, Object.defineProperty(Document1.prototype, "firstSegment", { iterable: !1, get: function() { return this.getFirstSegment(); } }), Object.defineProperty(Document1.prototype, "head", { iterable: !1, get: function() { return this.getEBML(); } }), Object.defineProperty(Document1.prototype, "segments", { iterable: !1, get: function() { return this.listChildrenByName(schema.byName.Segment); } }); }, function(module, exports, __webpack_require__) { var Buffer, create; Buffer = __webpack_require__(10).Buffer, create = __webpack_require__(56), module.exports = create("crc1", (function(buf, previous) { var accum, crc, _i, _len; for (Buffer.isBuffer(buf) || (buf = Buffer(buf)), crc = ~~previous, accum = 0, _i = 0, _len = buf.length; _i < _len; _i++) accum += buf[_i]; return (crc += accum % 256) % 256; })); }, function(module, exports, __webpack_require__) { var Buffer, TABLE, create; Buffer = __webpack_require__(10).Buffer, create = __webpack_require__(56), TABLE = [ 0, 7, 14, 9, 28, 27, 18, 21, 56, 63, 54, 49, 36, 35, 42, 45, 112, 119, 126, 121, 108, 107, 98, 101, 72, 79, 70, 65, 84, 83, 90, 93, 224, 231, 238, 233, 252, 251, 242, 245, 216, 223, 214, 209, 196, 195, 202, 205, 144, 151, 158, 153, 140, 139, 130, 133, 168, 175, 166, 161, 180, 179, 186, 189, 199, 192, 201, 206, 219, 220, 213, 210, 255, 248, 241, 246, 227, 228, 237, 234, 183, 176, 185, 190, 171, 172, 165, 162, 143, 136, 129, 134, 147, 148, 157, 154, 39, 32, 41, 46, 59, 60, 53, 50, 31, 24, 17, 22, 3, 4, 13, 10, 87, 80, 89, 94, 75, 76, 69, 66, 111, 104, 97, 102, 115, 116, 125, 122, 137, 142, 135, 128, 149, 146, 155, 156, 177, 182, 191, 184, 173, 170, 163, 164, 249, 254, 247, 240, 229, 226, 235, 236, 193, 198, 207, 200, 221, 218, 211, 212, 105, 110, 103, 96, 117, 114, 123, 124, 81, 86, 95, 88, 77, 74, 67, 68, 25, 30, 23, 16, 5, 2, 11, 12, 33, 38, 47, 40, 61, 58, 51, 52, 78, 73, 64, 71, 82, 85, 92, 91, 118, 113, 120, 127, 106, 109, 100, 99, 62, 57, 48, 55, 34, 37, 44, 43, 6, 1, 8, 15, 26, 29, 20, 19, 174, 169, 160, 167, 178, 181, 188, 187, 150, 145, 152, 159, 138, 141, 132, 131, 222, 217, 208, 215, 194, 197, 204, 203, 230, 225, 232, 239, 250, 253, 244, 243 ], "undefined" != typeof Int32Array && (TABLE = new Int32Array(TABLE)), module.exports = create("crc-8", (function(buf, previous) { var byte, crc, _i, _len; for (Buffer.isBuffer(buf) || (buf = Buffer(buf)), crc = ~~previous, _i = 0, _len = buf.length; _i < _len; _i++) byte = buf[_i], crc = 255 & TABLE[255 & (crc ^ byte)]; return crc; })); }, function(module, exports, __webpack_require__) { var Buffer, TABLE, create; Buffer = __webpack_require__(10).Buffer, create = __webpack_require__(56), TABLE = [ 0, 94, 188, 226, 97, 63, 221, 131, 194, 156, 126, 32, 163, 253, 31, 65, 157, 195, 33, 127, 252, 162, 64, 30, 95, 1, 227, 189, 62, 96, 130, 220, 35, 125, 159, 193, 66, 28, 254, 160, 225, 191, 93, 3, 128, 222, 60, 98, 190, 224, 2, 92, 223, 129, 99, 61, 124, 34, 192, 158, 29, 67, 161, 255, 70, 24, 250, 164, 39, 121, 155, 197, 132, 218, 56, 102, 229, 187, 89, 7, 219, 133, 103, 57, 186, 228, 6, 88, 25, 71, 165, 251, 120, 38, 196, 154, 101, 59, 217, 135, 4, 90, 184, 230, 167, 249, 27, 69, 198, 152, 122, 36, 248, 166, 68, 26, 153, 199, 37, 123, 58, 100, 134, 216, 91, 5, 231, 185, 140, 210, 48, 110, 237, 179, 81, 15, 78, 16, 242, 172, 47, 113, 147, 205, 17, 79, 173, 243, 112, 46, 204, 146, 211, 141, 111, 49, 178, 236, 14, 80, 175, 241, 19, 77, 206, 144, 114, 44, 109, 51, 209, 143, 12, 82, 176, 238, 50, 108, 142, 208, 83, 13, 239, 177, 240, 174, 76, 18, 145, 207, 45, 115, 202, 148, 118, 40, 171, 245, 23, 73, 8, 86, 180, 234, 105, 55, 213, 139, 87, 9, 235, 181, 54, 104, 138, 212, 149, 203, 41, 119, 244, 170, 72, 22, 233, 183, 85, 11, 136, 214, 52, 106, 43, 117, 151, 201, 74, 20, 246, 168, 116, 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53 ], "undefined" != typeof Int32Array && (TABLE = new Int32Array(TABLE)), module.exports = create("dallas-1-wire", (function(buf, previous) { var byte, crc, _i, _len; for (Buffer.isBuffer(buf) || (buf = Buffer(buf)), crc = ~~previous, _i = 0, _len = buf.length; _i < _len; _i++) byte = buf[_i], crc = 255 & TABLE[255 & (crc ^ byte)]; return crc; })); }, function(module, exports, __webpack_require__) { var Buffer, TABLE, create; Buffer = __webpack_require__(10).Buffer, create = __webpack_require__(56), TABLE = [ 0, 49345, 49537, 320, 49921, 960, 640, 49729, 50689, 1728, 1920, 51009, 1280, 50625, 50305, 1088, 52225, 3264, 3456, 52545, 3840, 53185, 52865, 3648, 2560, 51905, 52097, 2880, 51457, 2496, 2176, 51265, 55297, 6336, 6528, 55617, 6912, 56257, 55937, 6720, 7680, 57025, 57217, 8e3, 56577, 7616, 7296, 56385, 5120, 54465, 54657, 5440, 55041, 6080, 5760, 54849, 53761, 4800, 4992, 54081, 4352, 53697, 53377, 4160, 61441, 12480, 12672, 61761, 13056, 62401, 62081, 12864, 13824, 63169, 63361, 14144, 62721, 13760, 13440, 62529, 15360, 64705, 64897, 15680, 65281, 16320, 16e3, 65089, 64001, 15040, 15232, 64321, 14592, 63937, 63617, 14400, 10240, 59585, 59777, 10560, 60161, 11200, 10880, 59969, 60929, 11968, 12160, 61249, 11520, 60865, 60545, 11328, 58369, 9408, 9600, 58689, 9984, 59329, 59009, 9792, 8704, 58049, 58241, 9024, 57601, 8640, 8320, 57409, 40961, 24768, 24960, 41281, 25344, 41921, 41601, 25152, 26112, 42689, 42881, 26432, 42241, 26048, 25728, 42049, 27648, 44225, 44417, 27968, 44801, 28608, 28288, 44609, 43521, 27328, 27520, 43841, 26880, 43457, 43137, 26688, 30720, 47297, 47489, 31040, 47873, 31680, 31360, 47681, 48641, 32448, 32640, 48961, 32e3, 48577, 48257, 31808, 46081, 29888, 30080, 46401, 30464, 47041, 46721, 30272, 29184, 45761, 45953, 29504, 45313, 29120, 28800, 45121, 20480, 37057, 37249, 20800, 37633, 21440, 21120, 37441, 38401, 22208, 22400, 38721, 21760, 38337, 38017, 21568, 39937, 23744, 23936, 40257, 24320, 40897, 40577, 24128, 23040, 39617, 39809, 23360, 39169, 22976, 22656, 38977, 34817, 18624, 18816, 35137, 19200, 35777, 35457, 19008, 19968, 36545, 36737, 20288, 36097, 19904, 19584, 35905, 17408, 33985, 34177, 17728, 34561, 18368, 18048, 34369, 33281, 17088, 17280, 33601, 16640, 33217, 32897, 16448 ], "undefined" != typeof Int32Array && (TABLE = new Int32Array(TABLE)), module.exports = create("crc-16", (function(buf, previous) { var byte, crc, _i, _len; for (Buffer.isBuffer(buf) || (buf = Buffer(buf)), crc = ~~previous, _i = 0, _len = buf.length; _i < _len; _i++) byte = buf[_i], crc = 65535 & (TABLE[255 & (crc ^ byte)] ^ crc >> 8); return crc; })); }, function(module, exports, __webpack_require__) { var Buffer, TABLE, create; Buffer = __webpack_require__(10).Buffer, create = __webpack_require__(56), TABLE = [ 0, 4129, 8258, 12387, 16516, 20645, 24774, 28903, 33032, 37161, 41290, 45419, 49548, 53677, 57806, 61935, 4657, 528, 12915, 8786, 21173, 17044, 29431, 25302, 37689, 33560, 45947, 41818, 54205, 50076, 62463, 58334, 9314, 13379, 1056, 5121, 25830, 29895, 17572, 21637, 42346, 46411, 34088, 38153, 58862, 62927, 50604, 54669, 13907, 9842, 5649, 1584, 30423, 26358, 22165, 18100, 46939, 42874, 38681, 34616, 63455, 59390, 55197, 51132, 18628, 22757, 26758, 30887, 2112, 6241, 10242, 14371, 51660, 55789, 59790, 63919, 35144, 39273, 43274, 47403, 23285, 19156, 31415, 27286, 6769, 2640, 14899, 10770, 56317, 52188, 64447, 60318, 39801, 35672, 47931, 43802, 27814, 31879, 19684, 23749, 11298, 15363, 3168, 7233, 60846, 64911, 52716, 56781, 44330, 48395, 36200, 40265, 32407, 28342, 24277, 20212, 15891, 11826, 7761, 3696, 65439, 61374, 57309, 53244, 48923, 44858, 40793, 36728, 37256, 33193, 45514, 41451, 53516, 49453, 61774, 57711, 4224, 161, 12482, 8419, 20484, 16421, 28742, 24679, 33721, 37784, 41979, 46042, 49981, 54044, 58239, 62302, 689, 4752, 8947, 13010, 16949, 21012, 25207, 29270, 46570, 42443, 38312, 34185, 62830, 58703, 54572, 50445, 13538, 9411, 5280, 1153, 29798, 25671, 21540, 17413, 42971, 47098, 34713, 38840, 59231, 63358, 50973, 55100, 9939, 14066, 1681, 5808, 26199, 30326, 17941, 22068, 55628, 51565, 63758, 59695, 39368, 35305, 47498, 43435, 22596, 18533, 30726, 26663, 6336, 2273, 14466, 10403, 52093, 56156, 60223, 64286, 35833, 39896, 43963, 48026, 19061, 23124, 27191, 31254, 2801, 6864, 10931, 14994, 64814, 60687, 56684, 52557, 48554, 44427, 40424, 36297, 31782, 27655, 23652, 19525, 15522, 11395, 7392, 3265, 61215, 65342, 53085, 57212, 44955, 49082, 36825, 40952, 28183, 32310, 20053, 24180, 11923, 16050, 3793, 7920 ], "undefined" != typeof Int32Array && (TABLE = new Int32Array(TABLE)), module.exports = create("ccitt", (function(buf, previous) { var byte, crc, _i, _len; for (Buffer.isBuffer(buf) || (buf = Buffer(buf)), crc = null != previous ? ~~previous : 65535, _i = 0, _len = buf.length; _i < _len; _i++) byte = buf[_i], crc = 65535 & (TABLE[255 & (crc >> 8 ^ byte)] ^ crc << 8); return crc; })); }, function(module, exports, __webpack_require__) { var Buffer, TABLE, create; Buffer = __webpack_require__(10).Buffer, create = __webpack_require__(56), TABLE = [ 0, 49345, 49537, 320, 49921, 960, 640, 49729, 50689, 1728, 1920, 51009, 1280, 50625, 50305, 1088, 52225, 3264, 3456, 52545, 3840, 53185, 52865, 3648, 2560, 51905, 52097, 2880, 51457, 2496, 2176, 51265, 55297, 6336, 6528, 55617, 6912, 56257, 55937, 6720, 7680, 57025, 57217, 8e3, 56577, 7616, 7296, 56385, 5120, 54465, 54657, 5440, 55041, 6080, 5760, 54849, 53761, 4800, 4992, 54081, 4352, 53697, 53377, 4160, 61441, 12480, 12672, 61761, 13056, 62401, 62081, 12864, 13824, 63169, 63361, 14144, 62721, 13760, 13440, 62529, 15360, 64705, 64897, 15680, 65281, 16320, 16e3, 65089, 64001, 15040, 15232, 64321, 14592, 63937, 63617, 14400, 10240, 59585, 59777, 10560, 60161, 11200, 10880, 59969, 60929, 11968, 12160, 61249, 11520, 60865, 60545, 11328, 58369, 9408, 9600, 58689, 9984, 59329, 59009, 9792, 8704, 58049, 58241, 9024, 57601, 8640, 8320, 57409, 40961, 24768, 24960, 41281, 25344, 41921, 41601, 25152, 26112, 42689, 42881, 26432, 42241, 26048, 25728, 42049, 27648, 44225, 44417, 27968, 44801, 28608, 28288, 44609, 43521, 27328, 27520, 43841, 26880, 43457, 43137, 26688, 30720, 47297, 47489, 31040, 47873, 31680, 31360, 47681, 48641, 32448, 32640, 48961, 32e3, 48577, 48257, 31808, 46081, 29888, 30080, 46401, 30464, 47041, 46721, 30272, 29184, 45761, 45953, 29504, 45313, 29120, 28800, 45121, 20480, 37057, 37249, 20800, 37633, 21440, 21120, 37441, 38401, 22208, 22400, 38721, 21760, 38337, 38017, 21568, 39937, 23744, 23936, 40257, 24320, 40897, 40577, 24128, 23040, 39617, 39809, 23360, 39169, 22976, 22656, 38977, 34817, 18624, 18816, 35137, 19200, 35777, 35457, 19008, 19968, 36545, 36737, 20288, 36097, 19904, 19584, 35905, 17408, 33985, 34177, 17728, 34561, 18368, 18048, 34369, 33281, 17088, 17280, 33601, 16640, 33217, 32897, 16448 ], "undefined" != typeof Int32Array && (TABLE = new Int32Array(TABLE)), module.exports = create("crc-16-modbus", (function(buf, previous) { var byte, crc, _i, _len; for (Buffer.isBuffer(buf) || (buf = Buffer(buf)), crc = null != previous ? ~~previous : 65535, _i = 0, _len = buf.length; _i < _len; _i++) byte = buf[_i], crc = 65535 & (TABLE[255 & (crc ^ byte)] ^ crc >> 8); return crc; })); }, function(module, exports, __webpack_require__) { var Buffer, TABLE, create; Buffer = __webpack_require__(10).Buffer, create = __webpack_require__(56), TABLE = [ 0, 8801531, 9098509, 825846, 9692897, 1419802, 1651692, 10452759, 10584377, 2608578, 2839604, 11344079, 3303384, 11807523, 12104405, 4128302, 12930697, 4391538, 5217156, 13227903, 5679208, 13690003, 14450021, 5910942, 6606768, 14844747, 15604413, 6837830, 16197969, 7431594, 8256604, 16494759, 840169, 9084178, 8783076, 18463, 10434312, 1670131, 1434117, 9678590, 11358416, 2825259, 2590173, 10602790, 4109873, 12122826, 11821884, 3289031, 13213536, 5231515, 4409965, 12912278, 5929345, 14431610, 13675660, 5693559, 6823513, 15618722, 14863188, 6588335, 16513208, 8238147, 7417269, 16212302, 1680338, 10481449, 9664223, 1391140, 9061683, 788936, 36926, 8838341, 12067563, 4091408, 3340262, 11844381, 2868234, 11372785, 10555655, 2579964, 14478683, 5939616, 5650518, 13661357, 5180346, 13190977, 12967607, 4428364, 8219746, 16457881, 16234863, 7468436, 15633027, 6866552, 6578062, 14816117, 1405499, 9649856, 10463030, 1698765, 8819930, 55329, 803287, 9047340, 11858690, 3325945, 4072975, 12086004, 2561507, 10574104, 11387118, 2853909, 13647026, 5664841, 5958079, 14460228, 4446803, 12949160, 13176670, 5194661, 7454091, 16249200, 16476294, 8201341, 14834538, 6559633, 6852199, 15647388, 3360676, 11864927, 12161705, 4185682, 10527045, 2551230, 2782280, 11286707, 9619101, 1346150, 1577872, 10379115, 73852, 8875143, 9172337, 899466, 16124205, 7357910, 8182816, 16421083, 6680524, 14918455, 15678145, 6911546, 5736468, 13747439, 14507289, 5968354, 12873461, 4334094, 5159928, 13170435, 4167245, 12180150, 11879232, 3346363, 11301036, 2767959, 2532769, 10545498, 10360692, 1596303, 1360505, 9604738, 913813, 9157998, 8856728, 92259, 16439492, 8164415, 7343561, 16138546, 6897189, 15692510, 14936872, 6662099, 5986813, 14488838, 13733104, 5750795, 13156124, 5174247, 4352529, 12855018, 2810998, 11315341, 10498427, 2522496, 12124823, 4148844, 3397530, 11901793, 9135439, 862644, 110658, 8912057, 1606574, 10407765, 9590435, 1317464, 15706879, 6940164, 6651890, 14889737, 8145950, 16384229, 16161043, 7394792, 5123014, 13133629, 12910283, 4370992, 14535975, 5997020, 5707818, 13718737, 2504095, 10516836, 11329682, 2796649, 11916158, 3383173, 4130419, 12143240, 8893606, 129117, 876971, 9121104, 1331783, 9576124, 10389322, 1625009, 14908182, 6633453, 6925851, 15721184, 7380471, 16175372, 16402682, 8127489, 4389423, 12891860, 13119266, 5137369, 13704398, 5722165, 6015427, 14517560 ], "undefined" != typeof Int32Array && (TABLE = new Int32Array(TABLE)), module.exports = create("crc-24", (function(buf, previous) { var byte, crc, _i, _len; for (Buffer.isBuffer(buf) || (buf = Buffer(buf)), crc = null != previous ? ~~previous : 11994318, _i = 0, _len = buf.length; _i < _len; _i++) byte = buf[_i], crc = 16777215 & (TABLE[255 & (crc >> 16 ^ byte)] ^ crc << 8); return crc; })); }, function(module, exports, __webpack_require__) { var Buffer, TABLE, create; Buffer = __webpack_require__(10).Buffer, create = __webpack_require__(56), TABLE = [ 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ], "undefined" != typeof Int32Array && (TABLE = new Int32Array(TABLE)), module.exports = create("crc-32", (function(buf, previous) { var byte, crc, _i, _len; for (Buffer.isBuffer(buf) || (buf = Buffer(buf)), crc = 0 === previous ? 0 : -1 ^ ~~previous, _i = 0, _len = buf.length; _i < _len; _i++) byte = buf[_i], crc = TABLE[255 & (crc ^ byte)] ^ crc >>> 8; return -1 ^ crc; })); }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(40), __webpack_require__(2), __webpack_require__(45), __webpack_require__(5); var util = __webpack_require__(0), Segment2 = __webpack_require__(694); function Segment3(doc, tagId, start, length) { Segment2.call(this, doc, tagId, start, length); } __webpack_require__(12), util.inherits(Segment3, Segment2), module.exports = Segment3, Segment3.prototype.findTagByName = function(tagName) {}; }, function(module) { module.exports = { "application/andrew-inset": [ "ez" ], "application/applixware": [ "aw" ], "application/atom+xml": [ "atom" ], "application/atomcat+xml": [ "atomcat" ], "application/atomsvc+xml": [ "atomsvc" ], "application/bdoc": [ "bdoc" ], "application/ccxml+xml": [ "ccxml" ], "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" ], "application/emma+xml": [ "emma" ], "application/epub+zip": [ "epub" ], "application/exi": [ "exi" ], "application/font-tdpfr": [ "pfr" ], "application/font-woff": [ "woff" ], "application/font-woff2": [ "woff2" ], "application/geo+json": [ "geojson" ], "application/gml+xml": [ "gml" ], "application/gpx+xml": [ "gpx" ], "application/gxf": [ "gxf" ], "application/hyperstudio": [ "stk" ], "application/inkml+xml": [ "ink", "inkml" ], "application/ipfix": [ "ipfix" ], "application/java-archive": [ "jar", "war", "ear" ], "application/java-serialized-object": [ "ser" ], "application/java-vm": [ "class" ], "application/javascript": [ "js" ], "application/json": [ "json", "map" ], "application/json5": [ "json5" ], "application/jsonml+json": [ "jsonml" ], "application/ld+json": [ "jsonld" ], "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/mods+xml": [ "mods" ], "application/mp21": [ "m21", "mp21" ], "application/mp4": [ "mp4s", "m4p" ], "application/msword": [ "doc", "dot" ], "application/mxf": [ "mxf" ], "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/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/prs.cww": [ "cww" ], "application/pskc+xml": [ "pskcxml" ], "application/rdf+xml": [ "rdf" ], "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/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/set-payment-initiation": [ "setpay" ], "application/set-registration-initiation": [ "setreg" ], "application/shf+xml": [ "shf" ], "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/tei+xml": [ "tei", "teicorpus" ], "application/thraud+xml": [ "tfi" ], "application/timestamped-data": [ "tsd" ], "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.mpegurl": [ "m3u8" ], "application/vnd.apple.pkpass": [ "pkpass" ], "application/vnd.aristanetworks.swi": [ "swi" ], "application/vnd.astraea-software.iota": [ "iota" ], "application/vnd.audiograph": [ "aep" ], "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.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.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-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.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.openofficeorg.extension": [ "oxt" ], "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.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.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.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.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/voicexml+xml": [ "vxml" ], "application/widget": [ "wgt" ], "application/winhlp": [ "hlp" ], "application/wsdl+xml": [ "wsdl" ], "application/wspolicy+xml": [ "wspolicy" ], "application/x-7z-compressed": [ "7z" ], "application/x-abiword": [ "abw" ], "application/x-ace-compressed": [ "ace" ], "application/x-apple-diskimage": [ "dmg" ], "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-otf": [ "otf" ], "application/x-font-pcf": [ "pcf" ], "application/x-font-snf": [ "snf" ], "application/x-font-ttf": [ "ttf", "ttc" ], "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-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-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" ], "application/xaml+xml": [ "xaml" ], "application/xcap-diff+xml": [ "xdf" ], "application/xenc+xml": [ "xenc" ], "application/xhtml+xml": [ "xhtml", "xht" ], "application/xml": [ "xml", "xsl", "xsd", "rng" ], "application/xml-dtd": [ "dtd" ], "application/xop+xml": [ "xop" ], "application/xproc+xml": [ "xpl" ], "application/xslt+xml": [ "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/basic": [ "au", "snd" ], "audio/midi": [ "mid", "midi", "kar", "rmi" ], "audio/mp3": [ "mp3" ], "audio/mp4": [ "m4a", "mp4a" ], "audio/mpeg": [ "mpga", "mp2", "mp2a", "mp3", "m2a", "m3a" ], "audio/ogg": [ "oga", "ogg", "spx" ], "audio/s3m": [ "s3m" ], "audio/silk": [ "sil" ], "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/wav": [ "wav" ], "audio/wave": [ "wav" ], "audio/webm": [ "weba" ], "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" ], "audio/xm": [ "xm" ], "chemical/x-cdx": [ "cdx" ], "chemical/x-cif": [ "cif" ], "chemical/x-cmdf": [ "cmdf" ], "chemical/x-cml": [ "cml" ], "chemical/x-csml": [ "csml" ], "chemical/x-xyz": [ "xyz" ], "font/opentype": [ "otf" ], "image/apng": [ "apng" ], "image/bmp": [ "bmp" ], "image/cgm": [ "cgm" ], "image/g3fax": [ "g3" ], "image/gif": [ "gif" ], "image/ief": [ "ief" ], "image/jpeg": [ "jpeg", "jpg", "jpe" ], "image/ktx": [ "ktx" ], "image/png": [ "png" ], "image/prs.btif": [ "btif" ], "image/sgi": [ "sgi" ], "image/svg+xml": [ "svg", "svgz" ], "image/tiff": [ "tiff", "tif" ], "image/vnd.adobe.photoshop": [ "psd" ], "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.ms-modi": [ "mdi" ], "image/vnd.ms-photo": [ "wdp" ], "image/vnd.net-fpx": [ "npx" ], "image/vnd.wap.wbmp": [ "wbmp" ], "image/vnd.xiff": [ "xif" ], "image/webp": [ "webp" ], "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/rfc822": [ "eml", "mime" ], "model/iges": [ "igs", "iges" ], "model/mesh": [ "msh", "mesh", "silo" ], "model/vnd.collada+xml": [ "dae" ], "model/vnd.dwf": [ "dwf" ], "model/vnd.gdl": [ "gdl" ], "model/vnd.gtw": [ "gtw" ], "model/vnd.mts": [ "mts" ], "model/vnd.vtu": [ "vtu" ], "model/vrml": [ "wrl", "vrml" ], "model/x3d+binary": [ "x3db", "x3dbz" ], "model/x3d+vrml": [ "x3dv", "x3dvz" ], "model/x3d+xml": [ "x3d", "x3dz" ], "text/cache-manifest": [ "appcache", "manifest" ], "text/calendar": [ "ics", "ifb" ], "text/coffeescript": [ "coffee", "litcoffee" ], "text/css": [ "css" ], "text/csv": [ "csv" ], "text/hjson": [ "hjson" ], "text/html": [ "html", "htm", "shtml" ], "text/jade": [ "jade" ], "text/jsx": [ "jsx" ], "text/less": [ "less" ], "text/mathml": [ "mml" ], "text/n3": [ "n3" ], "text/plain": [ "txt", "text", "conf", "def", "list", "log", "in", "ini" ], "text/prs.lines.tag": [ "dsc" ], "text/richtext": [ "rtx" ], "text/rtf": [ "rtf" ], "text/sgml": [ "sgml", "sgm" ], "text/slim": [ "slim", "slm" ], "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/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/vtt": [ "vtt" ], "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": [ "markdown", "md", "mkd" ], "text/x-nfo": [ "nfo" ], "text/x-opml": [ "opml" ], "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" ], "text/xml": [ "xml" ], "text/yaml": [ "yaml", "yml" ], "video/3gpp": [ "3gp", "3gpp" ], "video/3gpp2": [ "3g2" ], "video/h261": [ "h261" ], "video/h263": [ "h263" ], "video/h264": [ "h264" ], "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/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/webm": [ "webm" ], "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" ] }; }, function(module, exports, __webpack_require__) { "use strict"; var crc32 = __webpack_require__(82).crc32, fs = __webpack_require__(2), Mime = __webpack_require__(45), Path = __webpack_require__(5), util = __webpack_require__(0), Segment1 = __webpack_require__(695), schema = __webpack_require__(12), tools = __webpack_require__(83); function Segment2(doc, tagId, start, length) { Segment1.call(this, doc, tagId, start, length); } function targetIn(id, elements) { if (!elements || !elements.length) return !1; for (var i = 0; i < elements.length; i++) if (elements[i].getValue() === id) return !0; return !1; } util.inherits(Segment2, Segment1), module.exports = Segment2, Segment2.prototype.addFileAttachment = function(path, description, mimeType, fileName, callback) { if ("function" == typeof description && 2 == arguments.length ? (callback = description, description = void 0) : "function" == typeof mimeType && 3 == arguments.length ? (callback = mimeType, mimeType = void 0) : "function" == typeof fileName && 4 == arguments.length && (callback = fileName, fileName = void 0), "function" != typeof callback) return this.addFileAttachmentSync(path, description, mimeType, fileName); if ("string" != typeof path || !path) return callback("Invalid path '" + path + "'"); var self = this; fs.stat(path, (function(error, stats) { if (error) return callback(error); fileName || (fileName = Path.basename(path)), mimeType || (mimeType = Mime.lookup(path)); var attachedFileTag = self._addAttachment({ path: path, description: description, size: stats.size, fileName: fileName, mimeType: mimeType, date: stats.mtime }); callback(null, attachedFileTag); })); }, Segment2.prototype.getAttachmentByFileName = function(filename) { return this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { var fn = attachedFile.getFirstChildByName(schema.byName.FileName); if (fn && fn.getValue() === filename) return attachedFile; })); }, Segment2.prototype.getAttachmentByFileUID = function(fileUID) { return this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { var fn = attachedFile.getFirstChildByName(schema.byName.FileUID); if (fn && fn.getValue() === fileUID) return attachedFile; })); }, Segment2.prototype.addFileAttachmentSync = function(path, description, mimeType, fileName) { if ("string" != typeof path || !path) throw new Error("Invalid path '" + path + "'"); var stats = fs.statSync(path); return fileName || (fileName = Path.basename(path)), mimeType || (mimeType = Mime.lookup(path)), this._addAttachment({ path: path, description: description, size: stats.size, fileName: fileName, mimeType: mimeType, date: stats.mtime }); }, Segment2.prototype.addStreamAttachment = function(stream, fileName, mimeType, size, description, callback) { return "number" != typeof size ? callback("Invalid size for attachment '" + size + "'") : "string" == typeof mimeType && mimeType.length ? "string" == typeof fileName && fileName.length ? ("function" == typeof description && (callback = description, description = void 0), void callback(null, this._addAttachment({ stream: stream, description: description, size: size, fileName: fileName, mimeType: mimeType }))) : callback("Invalid fileName for attachment '" + fileName + "'") : callback("Invalid mimeType for attachment '" + mimeType + "'"); }, Segment2.prototype._addAttachment = function(desc) { this.ownerDocument; var attachedFile = this.$attachments.$attachedFile; attachedFile.$crc_32 = 0, attachedFile.fileName = desc.fileName, attachedFile.fileMimeType = desc.mimeType, desc.description && (attachedFile.fileDescription = desc.description); var uid = crc32(desc.fileName + "$" + desc.mimeType + "$" + desc.description + "$" + desc.size); attachedFile.fileUID = uid; var getStream, info, fileData = attachedFile.getFileData(); return fileData.dataSize = desc.size, "function" == typeof desc.stream ? (getStream = desc.stream, info = "*function*") : desc.path && (getStream = function(options, callback) { callback(null, fs.createReadStream(desc.path, options)); }, info = desc.path), fileData._dataSource = { getStream: getStream, info: info }, attachedFile; }, Segment2.prototype.getTagByTargetType = function(targetInfos) { for (var tags = this.listChildrenByName(schema.byName.Tag), i = 0; i < tags.length; i++) { var tag = tags[i], targets = tag.targets; if (targets && !targets.empty) { if (!(void 0 !== targetInfos.targetTypeValue && targetInfos.targetTypeValue !== targets.targetTypeValue || void 0 !== targetInfos.targetType && targetInfos.targetType !== targets.targetType)) { var tus = targets.tagTrackUIDs; if (void 0 !== targetInfos.tagTrackUID) { if (!targetIn(targetInfos.tagTrackUID, tus)) continue; } else if (tus && tus.length) continue; var tes = targets.tagEditionUIDs; if (void 0 !== targetInfos.tagEditionUID) { if (!targetIn(targetInfos.tagEditionUID, tes)) continue; } else if (tes && tes.length) continue; var tcs = targets.tagChapterUIDs; if (void 0 !== targetInfos.tagChapterUID) { if (!targetIn(targetInfos.tagChapterUID, tcs)) continue; } else if (tcs && tcs.length) continue; var tas = targets.tagAttachmentUIDs; if (void 0 !== targetInfos.tagAttachmentUID) { if (!targetIn(targetInfos.tagAttachmentUID, tas)) continue; } else if (tas && tas.length) continue; return tag; } } else if (!targetInfos) return tag; } }, Segment2.prototype.addSimpleTagSync = function(targetInfos, name, language, defaultLanguage, value) { var tag; if (targetInfos.ebmlID === schema.byName.SimpleTag) tag = targetInfos; else if (!(tag = this.getTagByTargetType(targetInfos))) { var targets = (tag = this.$tags.newTag()).$targets; targetInfos && (targetInfos.tagAttachmentUID && targets.addTagAttachmentUID(targetInfos.tagAttachmentUID), targetInfos.targetTypeValue && (targets.targetTypeValue = targetInfos.targetTypeValue), targetInfos.targetType && (targets.targetType = targetInfos.targetType)); } var simpleTag = tag.newSimpleTag(); return simpleTag.tagName = name, simpleTag.tagLanguage = language || "und", simpleTag.tagDefault = defaultLanguage ? 1 : 0, null == value ? simpleTag : Buffer.isBuffer(value) ? (simpleTag.tagBinary = value, simpleTag) : (value instanceof Date && (value = tools.formatDate(value)), value = String(value), simpleTag.tagString = value, simpleTag); }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Segment = __webpack_require__(696), schema = __webpack_require__(12); function Segment1(doc, elementId, start, length) { Segment.call(this, doc, elementId, start, length); } function verifyCRC(element) { if (element.children) { var children = element.children || [], found = !1; children.forEach((function(c) { c.ebmlID === schema.byName.CRC_32 && (children[0] !== c ? c.remove() : found = !0); })), found || (element.$crc_32 = 0); } } function verifySeek(seekHeadElements, targetElement) { seekHeadElements.forEach((function(seekHead) { var found = !1; if (seekHead.seeks.forEach((function(seek) { if (seek.seekID === targetElement.ebmlID) return found = !0, !1; })), !found) { var newSeek = seekHead.newSeek(); newSeek.seekID = targetElement.ebmlID, newSeek.seekPosition = targetElement; } })); } util.inherits(Segment1, Segment), module.exports = Segment1, Segment1.prototype.normalize = function(options, callback) { "function" == typeof options && (callback = options, options = null), options = options || {}; var self = this, cluster = this.getFirstChildByName(schema.byName.Cluster), seekHeadElements = this.listChildrenByName(schema.byName.SeekHead); return seekHeadElements.forEach((function(seekHeadElement) { self.moveChildBefore(seekHeadElement, cluster), verifyCRC(seekHeadElement); })), this.eachChildByName(schema.byName.Info, (function(infoElement) { self.moveChildBefore(infoElement, cluster), verifyCRC(infoElement), verifySeek(seekHeadElements, infoElement); })), this.eachChildByName(schema.byName.Tracks, (function(tracksElement) { self.moveChildBefore(tracksElement, cluster), verifyCRC(tracksElement), verifySeek(seekHeadElements, tracksElement); })), this.eachChildByName(schema.byName.Cues, (function(cuesElement) { self.moveChildBefore(cuesElement, cluster), verifyCRC(cuesElement), verifySeek(seekHeadElements, cuesElement); })), this.eachChildByName(schema.byName.Void, (function(voidElement) { voidElement.remove(); })), this.eachChildByName(schema.byName.Tags, (function(tagsElement) { self.moveChildBefore(tagsElement, null), verifyCRC(tagsElement), verifySeek(seekHeadElements, tagsElement); })), this.eachChildByName(schema.byName.Attachments, (function(attachementsElement) { self.moveChildBefore(attachementsElement, null), verifyCRC(attachementsElement), verifySeek(seekHeadElements, attachementsElement); })), this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { verifyCRC(attachedFile); })), callback(); }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Segment(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Segment, start, length); } util.inherits(Segment, MasterElement), module.exports = Segment, Segment.prototype.toString = function() { return "[Segment #" + this.tagId + "]"; }, _proto.oneChild(Segment.prototype, "Info"), _proto.oneChild(Segment.prototype, "SeekHead"), _proto.oneChild(Segment.prototype, "Attachments"), _proto.oneChild(Segment.prototype, "Tracks"), _proto.oneChild(Segment.prototype, "Tags"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Attachments(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Attachments, start, length); } util.inherits(Attachments, MasterElement), module.exports = Attachments, Attachments.prototype.toString = function() { return "[Attachments #" + this.tagId + "]"; }, _proto.addChild(Attachments.prototype, "AttachedFile"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(72), schema = __webpack_require__(12), _proto = __webpack_require__(20); function AttachedFile(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.AttachedFile, start, length); } util.inherits(AttachedFile, Element1), module.exports = AttachedFile, AttachedFile.prototype.toString = function() { return "[AttachedFile #" + this.tagId + "]"; }, _proto.addAttribute(AttachedFile.prototype, "FileName"), _proto.addAttribute(AttachedFile.prototype, "FileMimeType"), _proto.addAttribute(AttachedFile.prototype, "FileDescription"), _proto.addAttribute(AttachedFile.prototype, "FileData"), _proto.addAttribute(AttachedFile.prototype, "FileUID"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Tags(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Tags, start, length); } util.inherits(Tags, MasterElement), module.exports = Tags, Tags.prototype.toString = function() { return "[Tags #" + this.tagId + "]"; }, _proto.addChild(Tags.prototype, "Tag"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Tag(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Tag, start, length); } util.inherits(Tag, MasterElement), module.exports = Tag, Tag.prototype.toString = function() { return "[Tag #" + this.tagId + "]"; }, _proto.oneChild(Tag.prototype, "Targets", !0), _proto.addChild(Tag.prototype, "SimpleTag"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Targets(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Targets, start, length); } util.inherits(Targets, MasterElement), module.exports = Targets, Targets.prototype.toString = function() { return "[Targets #" + this.tagId + "]"; }, _proto.addAttribute(Targets.prototype, "TargetTypeValue"), _proto.addAttribute(Targets.prototype, "TargetType"), _proto.addChild(Targets.prototype, "TagTrackUID"), _proto.addChild(Targets.prototype, "TagEditionUID"), _proto.addChild(Targets.prototype, "TagChapterUID"), _proto.addChild(Targets.prototype, "TagAttachmentUID"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function SimpleTag(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.SimpleTag, start, length); } util.inherits(SimpleTag, MasterElement), module.exports = SimpleTag, SimpleTag.prototype.toString = function() { return "[SimpleTag #" + this.tagId + "]"; }, _proto.addChild(SimpleTag.prototype, "SimpleTag"), _proto.addAttribute(SimpleTag.prototype, "TagName"), _proto.addAttribute(SimpleTag.prototype, "TagLanguage"), _proto.addAttribute(SimpleTag.prototype, "TagDefault"), _proto.addAttribute(SimpleTag.prototype, "TagString"), _proto.addAttribute(SimpleTag.prototype, "TagBinary"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function SeekHead(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.SeekHead, start, length); } util.inherits(SeekHead, MasterElement), module.exports = SeekHead, SeekHead.prototype.toString = function() { return "[SeekHead #" + this.tagId + "]"; }, _proto.addChild(SeekHead.prototype, "Seek"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(72), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Seek(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.Seek, start, length); } util.inherits(Seek, Element1), module.exports = Seek, Seek.prototype.toString = function() { return "[Seek #" + this.tagId + "]"; }, _proto.addAttribute(Seek.prototype, "SeekID"), _proto.addAttribute(Seek.prototype, "SeekPosition"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Info(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Info, start, length); } util.inherits(Info, MasterElement), module.exports = Info, Info.prototype.toString = function() { return "[Info #" + this.tagId + "]"; }, _proto.addAttribute(Info.prototype, "SegmentUID"), _proto.addAttribute(Info.prototype, "SegmentFilename"), _proto.addAttribute(Info.prototype, "PrevUID"), _proto.addAttribute(Info.prototype, "PrevFilename"), _proto.addAttribute(Info.prototype, "NextUID"), _proto.addAttribute(Info.prototype, "NextFilename"), _proto.addAttribute(Info.prototype, "SegmentFamily"), _proto.addChild(Info.prototype, "ChapterTranslate"), _proto.addAttribute(Info.prototype, "TimecodeScale"), _proto.addAttribute(Info.prototype, "Duration"), _proto.addAttribute(Info.prototype, "DateUTC"), _proto.addAttribute(Info.prototype, "Title"), _proto.addAttribute(Info.prototype, "MuxingApp"), _proto.addAttribute(Info.prototype, "WritingApp"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Tracks(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Tracks, start, length); } util.inherits(Tracks, MasterElement), module.exports = Tracks, Tracks.prototype.toString = function() { return "[Tracks #" + this.tagId + "]"; }, _proto.addChild(Tracks.prototype, "TrackEntry"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function TrackEntry(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.TrackEntry, start, length); } util.inherits(TrackEntry, MasterElement), module.exports = TrackEntry, TrackEntry.prototype.toString = function() { return "[TrackEntry #" + this.tagId + "]"; }, _proto.addAttribute(TrackEntry.prototype, "TrackNumber"), _proto.addAttribute(TrackEntry.prototype, "TrackUID"), _proto.addAttribute(TrackEntry.prototype, "TrackType"), _proto.addAttribute(TrackEntry.prototype, "FlagEnabled"), _proto.addAttribute(TrackEntry.prototype, "FlagDefault"), _proto.addAttribute(TrackEntry.prototype, "FlagForced"), _proto.addAttribute(TrackEntry.prototype, "FlagLacing"), _proto.addAttribute(TrackEntry.prototype, "MinCache"), _proto.addAttribute(TrackEntry.prototype, "MaxCache"), _proto.addAttribute(TrackEntry.prototype, "DefaultDuration"), _proto.addAttribute(TrackEntry.prototype, "DefaultDecodedFieldDuration"), _proto.addAttribute(TrackEntry.prototype, "MaxBlockAdditionID"), _proto.addAttribute(TrackEntry.prototype, "Name"), _proto.addAttribute(TrackEntry.prototype, "CodecID"), _proto.addAttribute(TrackEntry.prototype, "CodecPrivate"), _proto.addAttribute(TrackEntry.prototype, "CodecName"), _proto.addAttribute(TrackEntry.prototype, "AttachmentLink"), _proto.addAttribute(TrackEntry.prototype, "CodecDecodeAll"), _proto.addAttribute(TrackEntry.prototype, "TrackOverlay"), _proto.addAttribute(TrackEntry.prototype, "CodecDelay"), _proto.addAttribute(TrackEntry.prototype, "SeekPreRoll"), _proto.addChild(TrackEntry.prototype, "TrackTranslate"), _proto.oneChild(TrackEntry.prototype, "Video"), _proto.oneChild(TrackEntry.prototype, "Audio"), _proto.addChild(TrackEntry.prototype, "TrackOperation"), _proto.addChild(TrackEntry.prototype, "ContentEncodings"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(72), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Video(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.Video, start, length); } util.inherits(Video, Element1), module.exports = Video, Video.prototype.toString = function() { return "[Video #" + this.tagId + "]"; }, _proto.addAttribute(Video.prototype, "FlagInterlaced"), _proto.addAttribute(Video.prototype, "StereoMode"), _proto.addAttribute(Video.prototype, "AlphaMode"), _proto.addAttribute(Video.prototype, "PixelWidth"), _proto.addAttribute(Video.prototype, "PixelHeight"), _proto.addAttribute(Video.prototype, "PixelCropBottom"), _proto.addAttribute(Video.prototype, "PixelCropTop"), _proto.addAttribute(Video.prototype, "PixelCropLeft"), _proto.addAttribute(Video.prototype, "PixelCropRight"), _proto.addAttribute(Video.prototype, "DisplayWidth"), _proto.addAttribute(Video.prototype, "DisplayHeight"), _proto.addAttribute(Video.prototype, "DisplayUnit"), _proto.addAttribute(Video.prototype, "AspectRatioType"), _proto.addAttribute(Video.prototype, "ColourSpace"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(72), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Audio(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.Audio, start, length); } util.inherits(Audio, Element1), module.exports = Audio, Audio.prototype.toString = function() { return "[Audio #" + this.tagId + "]"; }, _proto.addAttribute(Audio.prototype, "SamplingFrequency"), _proto.addAttribute(Audio.prototype, "OutputSamplingFrequency"), _proto.addAttribute(Audio.prototype, "Channels"), _proto.addAttribute(Audio.prototype, "BitDepth"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(72), schema = __webpack_require__(12), EMPTY_BUFFER = (__webpack_require__(20), new Buffer([])); function CRC_32(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.CRC_32, start, length), this.data = EMPTY_BUFFER, this.type = "b"; } util.inherits(CRC_32, Element1), module.exports = CRC_32, CRC_32.prototype.toString = function() { return "[CRC-32 #" + this.tagId + "]"; }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function Cues(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.Cues, start, length); } util.inherits(Cues, MasterElement), module.exports = Cues, Cues.prototype.toString = function() { return "[Cues #" + this.tagId + "]"; }, _proto.addChild(Cues.prototype, "CuePoint"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function CuePoint(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.CuePoint, start, length); } util.inherits(CuePoint, MasterElement), module.exports = CuePoint, CuePoint.prototype.toString = function() { return "[CuePoint #" + this.tagId + "]"; }, _proto.addAttribute(CuePoint.prototype, "CueTime"), _proto.addChild(CuePoint.prototype, "CueTrackPositions"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), Element1 = __webpack_require__(72), schema = __webpack_require__(12), _proto = __webpack_require__(20); function CueReference(doc, tagId, start, length) { Element1.call(this, doc, tagId, schema.byName.CueReference, start, length); } util.inherits(CueReference, Element1), module.exports = CueReference, CueReference.prototype.toString = function() { return "[CueReference #" + this.tagId + "]"; }, _proto.addAttribute(CueReference.prototype, "CueRefTime"); }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), MasterElement = __webpack_require__(36), schema = __webpack_require__(12), _proto = __webpack_require__(20); function CueTrackPositions(doc, tagId, start, length) { MasterElement.call(this, doc, tagId, schema.byName.CueTrackPositions, start, length); } util.inherits(CueTrackPositions, MasterElement), module.exports = CueTrackPositions, CueTrackPositions.prototype.toString = function() { return "[CueTrackPositions #" + this.tagId + "]"; }, _proto.addAttribute(CueTrackPositions.prototype, "CueTrack"), _proto.addAttribute(CueTrackPositions.prototype, "CueClusterPosition"), _proto.addAttribute(CueTrackPositions.prototype, "CueRelativePosition"), _proto.addAttribute(CueTrackPositions.prototype, "CueDuration"), _proto.addAttribute(CueTrackPositions.prototype, "CueBlockNumber"), _proto.addAttribute(CueTrackPositions.prototype, "CueCodecState"), _proto.addChild(CueTrackPositions.prototype, "CueReference"); }, function(module, exports, __webpack_require__) { var nativeHttps = __webpack_require__(21), nativeHttp = __webpack_require__(11), url = __webpack_require__(7), _ = __webpack_require__(716), protocols = (module.exports.maxRedirects = 5, { https: nativeHttps, http: nativeHttp }); for (var protocol in protocols) { var h = function() {}; h.prototype = protocols[protocol], h = new h, module.exports[protocol] = h, h.request = (function(h) { return function(options, callback, redirectOptions) { redirectOptions = redirectOptions || {}; var reqUrl, max = "object" == typeof options && "maxRedirects" in options ? options.maxRedirects : exports.maxRedirects, redirect = _.extend({ count: 0, max: max, clientRequest: null, userCallback: callback }, redirectOptions); if (redirect.count > redirect.max) { var err = new Error("Max redirects exceeded. To allow more redirects, pass options.maxRedirects property."); return redirect.clientRequest.emit("error", err), redirect.clientRequest; } redirect.count++, reqUrl = "string" == typeof options ? options : url.format(_.extend({ protocol: protocol }, options)); var clientRequest = h.__proto__.request(options, (function redirectCallback(reqUrl, redirect) { return function(res) { if (res.statusCode < 300 || res.statusCode > 399) return redirect.userCallback(res); if (!("location" in res.headers)) return redirect.userCallback(res); var redirectUrl = url.resolve(reqUrl, res.headers.location), proto = url.parse(redirectUrl).protocol; return proto = proto.substr(0, proto.length - 1), module.exports[proto].get(redirectUrl, redirectCallback(reqUrl, redirect), redirect); }; })(reqUrl, redirect)); return redirect.clientRequest || (redirect.clientRequest = clientRequest), clientRequest; }; })(h), h.get = (function(h) { return function(options, cb, redirectOptions) { var req = h.request(options, cb, redirectOptions); return req.end(), req; }; })(h); } }, function(module, exports, __webpack_require__) { (function(module) { var __WEBPACK_AMD_DEFINE_RESULT__; !(function() { var root = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || this || {}, previousUnderscore = root._, ArrayProto = Array.prototype, ObjProto = Object.prototype, SymbolProto = "undefined" != typeof Symbol ? Symbol.prototype : null, push = ArrayProto.push, slice = ArrayProto.slice, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty, nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeCreate = Object.create, Ctor = function() {}, _ = function(obj) { return obj instanceof _ ? obj : this instanceof _ ? void (this._wrapped = obj) : new _(obj); }; exports.nodeType ? root._ = _ : (!module.nodeType && module.exports && (exports = module.exports = _), exports._ = _), _.VERSION = "1.9.1"; var builtinIteratee, optimizeCb = function(func, context, argCount) { if (void 0 === context) return func; switch (null == argCount ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; }, cb = function(value, context, argCount) { return _.iteratee !== builtinIteratee ? _.iteratee(value, context) : null == value ? _.identity : _.isFunction(value) ? optimizeCb(value, context, argCount) : _.isObject(value) && !_.isArray(value) ? _.matcher(value) : _.property(value); }; _.iteratee = builtinIteratee = function(value, context) { return cb(value, context, 1 / 0); }; var restArguments = function(func, startIndex) { return startIndex = null == startIndex ? func.length - 1 : +startIndex, function() { for (var length = Math.max(arguments.length - startIndex, 0), rest = Array(length), index = 0; index < length; index++) rest[index] = arguments[index + startIndex]; switch (startIndex) { case 0: return func.call(this, rest); case 1: return func.call(this, arguments[0], rest); case 2: return func.call(this, arguments[0], arguments[1], rest); } var args = Array(startIndex + 1); for (index = 0; index < startIndex; index++) args[index] = arguments[index]; return args[startIndex] = rest, func.apply(this, args); }; }, baseCreate = function(prototype) { if (!_.isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); Ctor.prototype = prototype; var result = new Ctor; return Ctor.prototype = null, result; }, shallowProperty = function(key) { return function(obj) { return null == obj ? void 0 : obj[key]; }; }, has = function(obj, path) { return null != obj && hasOwnProperty.call(obj, path); }, deepGet = function(obj, path) { for (var length = path.length, i = 0; i < length; i++) { if (null == obj) return; obj = obj[path[i]]; } return length ? obj : void 0; }, MAX_ARRAY_INDEX = Math.pow(2, 53) - 1, getLength = shallowProperty("length"), isArrayLike = function(collection) { var length = getLength(collection); return "number" == typeof length && length >= 0 && length <= MAX_ARRAY_INDEX; }; _.each = _.forEach = function(obj, iteratee, context) { var i, length; if (iteratee = optimizeCb(iteratee, context), isArrayLike(obj)) for (i = 0, length = obj.length; i < length; i++) iteratee(obj[i], i, obj); else { var keys = _.keys(obj); for (i = 0, length = keys.length; i < length; i++) iteratee(obj[keys[i]], keys[i], obj); } return obj; }, _.map = _.collect = function(obj, iteratee, context) { iteratee = cb(iteratee, context); for (var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, results = Array(length), index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; }; var createReduce = function(dir) { var reducer = function(obj, iteratee, memo, initial) { var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = dir > 0 ? 0 : length - 1; for (initial || (memo = obj[keys ? keys[index] : index], index += dir); index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }; return function(obj, iteratee, memo, context) { var initial = arguments.length >= 3; return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); }; }; _.reduce = _.foldl = _.inject = createReduce(1), _.reduceRight = _.foldr = createReduce(-1), _.find = _.detect = function(obj, predicate, context) { var key = (isArrayLike(obj) ? _.findIndex : _.findKey)(obj, predicate, context); if (void 0 !== key && -1 !== key) return obj[key]; }, _.filter = _.select = function(obj, predicate, context) { var results = []; return predicate = cb(predicate, context), _.each(obj, (function(value, index, list) { predicate(value, index, list) && results.push(value); })), results; }, _.reject = function(obj, predicate, context) { return _.filter(obj, _.negate(cb(predicate)), context); }, _.every = _.all = function(obj, predicate, context) { predicate = cb(predicate, context); for (var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return !1; } return !0; }, _.some = _.any = function(obj, predicate, context) { predicate = cb(predicate, context); for (var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return !0; } return !1; }, _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { return isArrayLike(obj) || (obj = _.values(obj)), ("number" != typeof fromIndex || guard) && (fromIndex = 0), _.indexOf(obj, item, fromIndex) >= 0; }, _.invoke = restArguments((function(obj, path, args) { var contextPath, func; return _.isFunction(path) ? func = path : _.isArray(path) && (contextPath = path.slice(0, -1), path = path[path.length - 1]), _.map(obj, (function(context) { var method = func; if (!method) { if (contextPath && contextPath.length && (context = deepGet(context, contextPath)), null == context) return; method = context[path]; } return null == method ? method : method.apply(context, args); })); })), _.pluck = function(obj, key) { return _.map(obj, _.property(key)); }, _.where = function(obj, attrs) { return _.filter(obj, _.matcher(attrs)); }, _.findWhere = function(obj, attrs) { return _.find(obj, _.matcher(attrs)); }, _.max = function(obj, iteratee, context) { var value, computed, result = -1 / 0, lastComputed = -1 / 0; if (null == iteratee || "number" == typeof iteratee && "object" != typeof obj[0] && null != obj) for (var i = 0, length = (obj = isArrayLike(obj) ? obj : _.values(obj)).length; i < length; i++) null != (value = obj[i]) && value > result && (result = value); else iteratee = cb(iteratee, context), _.each(obj, (function(v, index, list) { ((computed = iteratee(v, index, list)) > lastComputed || computed === -1 / 0 && result === -1 / 0) && (result = v, lastComputed = computed); })); return result; }, _.min = function(obj, iteratee, context) { var value, computed, result = 1 / 0, lastComputed = 1 / 0; if (null == iteratee || "number" == typeof iteratee && "object" != typeof obj[0] && null != obj) for (var i = 0, length = (obj = isArrayLike(obj) ? obj : _.values(obj)).length; i < length; i++) null != (value = obj[i]) && value < result && (result = value); else iteratee = cb(iteratee, context), _.each(obj, (function(v, index, list) { ((computed = iteratee(v, index, list)) < lastComputed || computed === 1 / 0 && result === 1 / 0) && (result = v, lastComputed = computed); })); return result; }, _.shuffle = function(obj) { return _.sample(obj, 1 / 0); }, _.sample = function(obj, n, guard) { if (null == n || guard) return isArrayLike(obj) || (obj = _.values(obj)), obj[_.random(obj.length - 1)]; var sample = isArrayLike(obj) ? _.clone(obj) : _.values(obj), length = getLength(sample); n = Math.max(Math.min(n, length), 0); for (var last = length - 1, index = 0; index < n; index++) { var rand = _.random(index, last), temp = sample[index]; sample[index] = sample[rand], sample[rand] = temp; } return sample.slice(0, n); }, _.sortBy = function(obj, iteratee, context) { var index = 0; return iteratee = cb(iteratee, context), _.pluck(_.map(obj, (function(value, key, list) { return { value: value, index: index++, criteria: iteratee(value, key, list) }; })).sort((function(left, right) { var a = left.criteria, b = right.criteria; if (a !== b) { if (a > b || void 0 === a) return 1; if (a < b || void 0 === b) return -1; } return left.index - right.index; })), "value"); }; var group = function(behavior, partition) { return function(obj, iteratee, context) { var result = partition ? [ [], [] ] : {}; return iteratee = cb(iteratee, context), _.each(obj, (function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); })), result; }; }; _.groupBy = group((function(result, value, key) { has(result, key) ? result[key].push(value) : result[key] = [ value ]; })), _.indexBy = group((function(result, value, key) { result[key] = value; })), _.countBy = group((function(result, value, key) { has(result, key) ? result[key]++ : result[key] = 1; })); var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; _.toArray = function(obj) { return obj ? _.isArray(obj) ? slice.call(obj) : _.isString(obj) ? obj.match(reStrSymbol) : isArrayLike(obj) ? _.map(obj, _.identity) : _.values(obj) : []; }, _.size = function(obj) { return null == obj ? 0 : isArrayLike(obj) ? obj.length : _.keys(obj).length; }, _.partition = group((function(result, value, pass) { result[pass ? 0 : 1].push(value); }), !0), _.first = _.head = _.take = function(array, n, guard) { return null == array || array.length < 1 ? null == n ? void 0 : [] : null == n || guard ? array[0] : _.initial(array, array.length - n); }, _.initial = function(array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (null == n || guard ? 1 : n))); }, _.last = function(array, n, guard) { return null == array || array.length < 1 ? null == n ? void 0 : [] : null == n || guard ? array[array.length - 1] : _.rest(array, Math.max(0, array.length - n)); }, _.rest = _.tail = _.drop = function(array, n, guard) { return slice.call(array, null == n || guard ? 1 : n); }, _.compact = function(array) { return _.filter(array, Boolean); }; var flatten = function(input, shallow, strict, output) { for (var idx = (output = output || []).length, i = 0, length = getLength(input); i < length; i++) { var value = input[i]; if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) if (shallow) for (var j = 0, len = value.length; j < len; ) output[idx++] = value[j++]; else flatten(value, shallow, strict, output), idx = output.length; else strict || (output[idx++] = value); } return output; }; _.flatten = function(array, shallow) { return flatten(array, shallow, !1); }, _.without = restArguments((function(array, otherArrays) { return _.difference(array, otherArrays); })), _.uniq = _.unique = function(array, isSorted, iteratee, context) { _.isBoolean(isSorted) || (context = iteratee, iteratee = isSorted, isSorted = !1), null != iteratee && (iteratee = cb(iteratee, context)); for (var result = [], seen = [], i = 0, length = getLength(array); i < length; i++) { var value = array[i], computed = iteratee ? iteratee(value, i, array) : value; isSorted && !iteratee ? (i && seen === computed || result.push(value), seen = computed) : iteratee ? _.contains(seen, computed) || (seen.push(computed), result.push(value)) : _.contains(result, value) || result.push(value); } return result; }, _.union = restArguments((function(arrays) { return _.uniq(flatten(arrays, !0, !0)); })), _.intersection = function(array) { for (var result = [], argsLength = arguments.length, i = 0, length = getLength(array); i < length; i++) { var item = array[i]; if (!_.contains(result, item)) { var j; for (j = 1; j < argsLength && _.contains(arguments[j], item); j++) ; j === argsLength && result.push(item); } } return result; }, _.difference = restArguments((function(array, rest) { return rest = flatten(rest, !0, !0), _.filter(array, (function(value) { return !_.contains(rest, value); })); })), _.unzip = function(array) { for (var length = array && _.max(array, getLength).length || 0, result = Array(length), index = 0; index < length; index++) result[index] = _.pluck(array, index); return result; }, _.zip = restArguments(_.unzip), _.object = function(list, values) { for (var result = {}, i = 0, length = getLength(list); i < length; i++) values ? result[list[i]] = values[i] : result[list[i][0]] = list[i][1]; return result; }; var createPredicateIndexFinder = function(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); for (var length = getLength(array), index = dir > 0 ? 0 : length - 1; index >= 0 && index < length; index += dir) if (predicate(array[index], index, array)) return index; return -1; }; }; _.findIndex = createPredicateIndexFinder(1), _.findLastIndex = createPredicateIndexFinder(-1), _.sortedIndex = function(array, obj, iteratee, context) { for (var value = (iteratee = cb(iteratee, context, 1))(obj), low = 0, high = getLength(array); low < high; ) { var mid = Math.floor((low + high) / 2); iteratee(array[mid]) < value ? low = mid + 1 : high = mid; } return low; }; var createIndexFinder = function(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if ("number" == typeof idx) dir > 0 ? i = idx >= 0 ? idx : Math.max(idx + length, i) : length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; else if (sortedIndex && idx && length) return array[idx = sortedIndex(array, item)] === item ? idx : -1; if (item != item) return (idx = predicateFind(slice.call(array, i, length), _.isNaN)) >= 0 ? idx + i : -1; for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) if (array[idx] === item) return idx; return -1; }; }; _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex), _.lastIndexOf = createIndexFinder(-1, _.findLastIndex), _.range = function(start, stop, step) { null == stop && (stop = start || 0, start = 0), step || (step = stop < start ? -1 : 1); for (var length = Math.max(Math.ceil((stop - start) / step), 0), range = Array(length), idx = 0; idx < length; idx++, start += step) range[idx] = start; return range; }, _.chunk = function(array, count) { if (null == count || count < 1) return []; for (var result = [], i = 0, length = array.length; i < length; ) result.push(slice.call(array, i, i += count)); return result; }; var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prototype), result = sourceFunc.apply(self, args); return _.isObject(result) ? result : self; }; _.bind = restArguments((function(func, context, args) { if (!_.isFunction(func)) throw new TypeError("Bind must be called on a function"); var bound = restArguments((function(callArgs) { return executeBound(func, bound, context, this, args.concat(callArgs)); })); return bound; })), _.partial = restArguments((function(func, boundArgs) { var placeholder = _.partial.placeholder, bound = function() { for (var position = 0, length = boundArgs.length, args = Array(length), i = 0; i < length; i++) args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; for (;position < arguments.length; ) args.push(arguments[position++]); return executeBound(func, bound, this, this, args); }; return bound; })), _.partial.placeholder = _, _.bindAll = restArguments((function(obj, keys) { var index = (keys = flatten(keys, !1, !1)).length; if (index < 1) throw new Error("bindAll must be passed function names"); for (;index--; ) { var key = keys[index]; obj[key] = _.bind(obj[key], obj); } })), _.memoize = function(func, hasher) { var memoize = function(key) { var cache = memoize.cache, address = "" + (hasher ? hasher.apply(this, arguments) : key); return has(cache, address) || (cache[address] = func.apply(this, arguments)), cache[address]; }; return memoize.cache = {}, memoize; }, _.delay = restArguments((function(func, wait, args) { return setTimeout((function() { return func.apply(null, args); }), wait); })), _.defer = _.partial(_.delay, _, 1), _.throttle = function(func, wait, options) { var timeout, context, args, result, previous = 0; options || (options = {}); var later = function() { previous = !1 === options.leading ? 0 : _.now(), timeout = null, result = func.apply(context, args), timeout || (context = args = null); }, throttled = function() { var now = _.now(); previous || !1 !== options.leading || (previous = now); var remaining = wait - (now - previous); return context = this, args = arguments, remaining <= 0 || remaining > wait ? (timeout && (clearTimeout(timeout), timeout = null), previous = now, result = func.apply(context, args), timeout || (context = args = null)) : timeout || !1 === options.trailing || (timeout = setTimeout(later, remaining)), result; }; return throttled.cancel = function() { clearTimeout(timeout), previous = 0, timeout = context = args = null; }, throttled; }, _.debounce = function(func, wait, immediate) { var timeout, result, later = function(context, args) { timeout = null, args && (result = func.apply(context, args)); }, debounced = restArguments((function(args) { if (timeout && clearTimeout(timeout), immediate) { var callNow = !timeout; timeout = setTimeout(later, wait), callNow && (result = func.apply(this, args)); } else timeout = _.delay(later, wait, this, args); return result; })); return debounced.cancel = function() { clearTimeout(timeout), timeout = null; }, debounced; }, _.wrap = function(func, wrapper) { return _.partial(wrapper, func); }, _.negate = function(predicate) { return function() { return !predicate.apply(this, arguments); }; }, _.compose = function() { var args = arguments, start = args.length - 1; return function() { for (var i = start, result = args[start].apply(this, arguments); i--; ) result = args[i].call(this, result); return result; }; }, _.after = function(times, func) { return function() { if (--times < 1) return func.apply(this, arguments); }; }, _.before = function(times, func) { var memo; return function() { return --times > 0 && (memo = func.apply(this, arguments)), times <= 1 && (func = null), memo; }; }, _.once = _.partial(_.before, 2), _.restArguments = restArguments; var hasEnumBug = !{ toString: null }.propertyIsEnumerable("toString"), nonEnumerableProps = [ "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString" ], collectNonEnumProps = function(obj, keys) { var nonEnumIdx = nonEnumerableProps.length, constructor = obj.constructor, proto = _.isFunction(constructor) && constructor.prototype || ObjProto, prop = "constructor"; for (has(obj, prop) && !_.contains(keys, prop) && keys.push(prop); nonEnumIdx--; ) (prop = nonEnumerableProps[nonEnumIdx]) in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop) && keys.push(prop); }; _.keys = function(obj) { if (!_.isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) has(obj, key) && keys.push(key); return hasEnumBug && collectNonEnumProps(obj, keys), keys; }, _.allKeys = function(obj) { if (!_.isObject(obj)) return []; var keys = []; for (var key in obj) keys.push(key); return hasEnumBug && collectNonEnumProps(obj, keys), keys; }, _.values = function(obj) { for (var keys = _.keys(obj), length = keys.length, values = Array(length), i = 0; i < length; i++) values[i] = obj[keys[i]]; return values; }, _.mapObject = function(obj, iteratee, context) { iteratee = cb(iteratee, context); for (var keys = _.keys(obj), length = keys.length, results = {}, index = 0; index < length; index++) { var currentKey = keys[index]; results[currentKey] = iteratee(obj[currentKey], currentKey, obj); } return results; }, _.pairs = function(obj) { for (var keys = _.keys(obj), length = keys.length, pairs = Array(length), i = 0; i < length; i++) pairs[i] = [ keys[i], obj[keys[i]] ]; return pairs; }, _.invert = function(obj) { for (var result = {}, keys = _.keys(obj), i = 0, length = keys.length; i < length; i++) result[obj[keys[i]]] = keys[i]; return result; }, _.functions = _.methods = function(obj) { var names = []; for (var key in obj) _.isFunction(obj[key]) && names.push(key); return names.sort(); }; var createAssigner = function(keysFunc, defaults) { return function(obj) { var length = arguments.length; if (defaults && (obj = Object(obj)), length < 2 || null == obj) return obj; for (var index = 1; index < length; index++) for (var source = arguments[index], keys = keysFunc(source), l = keys.length, i = 0; i < l; i++) { var key = keys[i]; defaults && void 0 !== obj[key] || (obj[key] = source[key]); } return obj; }; }; _.extend = createAssigner(_.allKeys), _.extendOwn = _.assign = createAssigner(_.keys), _.findKey = function(obj, predicate, context) { predicate = cb(predicate, context); for (var key, keys = _.keys(obj), i = 0, length = keys.length; i < length; i++) if (predicate(obj[key = keys[i]], key, obj)) return key; }; var eq, deepEq, keyInObj = function(value, key, obj) { return key in obj; }; _.pick = restArguments((function(obj, keys) { var result = {}, iteratee = keys[0]; if (null == obj) return result; _.isFunction(iteratee) ? (keys.length > 1 && (iteratee = optimizeCb(iteratee, keys[1])), keys = _.allKeys(obj)) : (iteratee = keyInObj, keys = flatten(keys, !1, !1), obj = Object(obj)); for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i], value = obj[key]; iteratee(value, key, obj) && (result[key] = value); } return result; })), _.omit = restArguments((function(obj, keys) { var context, iteratee = keys[0]; return _.isFunction(iteratee) ? (iteratee = _.negate(iteratee), keys.length > 1 && (context = keys[1])) : (keys = _.map(flatten(keys, !1, !1), String), iteratee = function(value, key) { return !_.contains(keys, key); }), _.pick(obj, iteratee, context); })), _.defaults = createAssigner(_.allKeys, !0), _.create = function(prototype, props) { var result = baseCreate(prototype); return props && _.extendOwn(result, props), result; }, _.clone = function(obj) { return _.isObject(obj) ? _.isArray(obj) ? obj.slice() : _.extend({}, obj) : obj; }, _.tap = function(obj, interceptor) { return interceptor(obj), obj; }, _.isMatch = function(object, attrs) { var keys = _.keys(attrs), length = keys.length; if (null == object) return !length; for (var obj = Object(object), i = 0; i < length; i++) { var key = keys[i]; if (attrs[key] !== obj[key] || !(key in obj)) return !1; } return !0; }, eq = function(a, b, aStack, bStack) { if (a === b) return 0 !== a || 1 / a == 1 / b; if (null == a || null == b) return !1; if (a != a) return b != b; var type = typeof a; return ("function" === type || "object" === type || "object" == typeof b) && deepEq(a, b, aStack, bStack); }, deepEq = function(a, b, aStack, bStack) { a instanceof _ && (a = a._wrapped), b instanceof _ && (b = b._wrapped); var className = toString.call(a); if (className !== toString.call(b)) return !1; switch (className) { case "[object RegExp]": case "[object String]": return "" + a == "" + b; case "[object Number]": return +a != +a ? +b != +b : 0 == +a ? 1 / +a == 1 / b : +a == +b; case "[object Date]": case "[object Boolean]": return +a == +b; case "[object Symbol]": return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); } var areArrays = "[object Array]" === className; if (!areArrays) { if ("object" != typeof a || "object" != typeof b) return !1; var aCtor = a.constructor, bCtor = b.constructor; if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && _.isFunction(bCtor) && bCtor instanceof bCtor) && "constructor" in a && "constructor" in b) return !1; } bStack = bStack || []; for (var length = (aStack = aStack || []).length; length--; ) if (aStack[length] === a) return bStack[length] === b; if (aStack.push(a), bStack.push(b), areArrays) { if ((length = a.length) !== b.length) return !1; for (;length--; ) if (!eq(a[length], b[length], aStack, bStack)) return !1; } else { var key, keys = _.keys(a); if (length = keys.length, _.keys(b).length !== length) return !1; for (;length--; ) if (key = keys[length], !has(b, key) || !eq(a[key], b[key], aStack, bStack)) return !1; } return aStack.pop(), bStack.pop(), !0; }, _.isEqual = function(a, b) { return eq(a, b); }, _.isEmpty = function(obj) { return null == obj || (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) ? 0 === obj.length : 0 === _.keys(obj).length); }, _.isElement = function(obj) { return !(!obj || 1 !== obj.nodeType); }, _.isArray = nativeIsArray || function(obj) { return "[object Array]" === toString.call(obj); }, _.isObject = function(obj) { var type = typeof obj; return "function" === type || "object" === type && !!obj; }, _.each([ "Arguments", "Function", "String", "Number", "Date", "RegExp", "Error", "Symbol", "Map", "WeakMap", "Set", "WeakSet" ], (function(name) { _["is" + name] = function(obj) { return toString.call(obj) === "[object " + name + "]"; }; })), _.isArguments(arguments) || (_.isArguments = function(obj) { return has(obj, "callee"); }); var nodelist = root.document && root.document.childNodes; "object" != typeof Int8Array && "function" != typeof nodelist && (_.isFunction = function(obj) { return "function" == typeof obj || !1; }), _.isFinite = function(obj) { return !_.isSymbol(obj) && isFinite(obj) && !isNaN(parseFloat(obj)); }, _.isNaN = function(obj) { return _.isNumber(obj) && isNaN(obj); }, _.isBoolean = function(obj) { return !0 === obj || !1 === obj || "[object Boolean]" === toString.call(obj); }, _.isNull = function(obj) { return null === obj; }, _.isUndefined = function(obj) { return void 0 === obj; }, _.has = function(obj, path) { if (!_.isArray(path)) return has(obj, path); for (var length = path.length, i = 0; i < length; i++) { var key = path[i]; if (null == obj || !hasOwnProperty.call(obj, key)) return !1; obj = obj[key]; } return !!length; }, _.noConflict = function() { return root._ = previousUnderscore, this; }, _.identity = function(value) { return value; }, _.constant = function(value) { return function() { return value; }; }, _.noop = function() {}, _.property = function(path) { return _.isArray(path) ? function(obj) { return deepGet(obj, path); } : shallowProperty(path); }, _.propertyOf = function(obj) { return null == obj ? function() {} : function(path) { return _.isArray(path) ? deepGet(obj, path) : obj[path]; }; }, _.matcher = _.matches = function(attrs) { return attrs = _.extendOwn({}, attrs), function(obj) { return _.isMatch(obj, attrs); }; }, _.times = function(n, iteratee, context) { var accum = Array(Math.max(0, n)); iteratee = optimizeCb(iteratee, context, 1); for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }, _.random = function(min, max) { return null == max && (max = min, min = 0), min + Math.floor(Math.random() * (max - min + 1)); }, _.now = Date.now || function() { return (new Date).getTime(); }; var escapeMap = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }, unescapeMap = _.invert(escapeMap), createEscaper = function(map) { var escaper = function(match) { return map[match]; }, source = "(?:" + _.keys(map).join("|") + ")", testRegexp = RegExp(source), replaceRegexp = RegExp(source, "g"); return function(string) { return string = null == string ? "" : "" + string, testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; }; _.escape = createEscaper(escapeMap), _.unescape = createEscaper(unescapeMap), _.result = function(obj, path, fallback) { _.isArray(path) || (path = [ path ]); var length = path.length; if (!length) return _.isFunction(fallback) ? fallback.call(obj) : fallback; for (var i = 0; i < length; i++) { var prop = null == obj ? void 0 : obj[path[i]]; void 0 === prop && (prop = fallback, i = length), obj = _.isFunction(prop) ? prop.call(obj) : prop; } return obj; }; var idCounter = 0; _.uniqueId = function(prefix) { var id = ++idCounter + ""; return prefix ? prefix + id : id; }, _.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; var noMatch = /(.)^/, escapes = { "'": "'", "\\": "\\", "\r": "r", "\n": "n", "\u2028": "u2028", "\u2029": "u2029" }, escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g, escapeChar = function(match) { return "\\" + escapes[match]; }; _.template = function(text, settings, oldSettings) { !settings && oldSettings && (settings = oldSettings), settings = _.defaults({}, settings, _.templateSettings); var render, matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join("|") + "|$", "g"), index = 0, source = "__p+='"; text.replace(matcher, (function(match, escape, interpolate, evaluate, offset) { return source += text.slice(index, offset).replace(escapeRegExp, escapeChar), index = offset + match.length, escape ? source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'" : interpolate ? source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'" : evaluate && (source += "';\n" + evaluate + "\n__p+='"), match; })), source += "';\n", settings.variable || (source = "with(obj||{}){\n" + source + "}\n"), source = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + source + "return __p;\n"; try { render = new Function(settings.variable || "obj", "_", source); } catch (e) { throw e.source = source, e; } var template = function(data) { return render.call(this, data, _); }, argument = settings.variable || "obj"; return template.source = "function(" + argument + "){\n" + source + "}", template; }, _.chain = function(obj) { var instance = _(obj); return instance._chain = !0, instance; }; var chainResult = function(instance, obj) { return instance._chain ? _(obj).chain() : obj; }; _.mixin = function(obj) { return _.each(_.functions(obj), (function(name) { var func = _[name] = obj[name]; _.prototype[name] = function() { var args = [ this._wrapped ]; return push.apply(args, arguments), chainResult(this, func.apply(_, args)); }; })), _; }, _.mixin(_), _.each([ "pop", "push", "reverse", "shift", "sort", "splice", "unshift" ], (function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; return method.apply(obj, arguments), "shift" !== name && "splice" !== name || 0 !== obj.length || delete obj[0], chainResult(this, obj); }; })), _.each([ "concat", "join", "slice" ], (function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { return chainResult(this, method.apply(this._wrapped, arguments)); }; })), _.prototype.value = function() { return this._wrapped; }, _.prototype.valueOf = _.prototype.toJSON = _.prototype.value, _.prototype.toString = function() { return String(this._wrapped); }, void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return _; }.apply(exports, [])) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); })(); }).call(this, __webpack_require__(69)(module)); }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(2); var util = __webpack_require__(0), AbstractSource = (__webpack_require__(44)("matroska:streamFactorySource"), __webpack_require__(187)); function StreamFactorySource(streamFactory) { if (AbstractSource.call(this), "function" != typeof streamFactory.getStream) throw new Error("Invalid streamFactory object (getStream function)"); if (streamFactory.end && "function" != typeof streamFactory.end) throw new Error("Invalid streamFactory object (end function)"); this.streamFactory = streamFactory; } util.inherits(StreamFactorySource, AbstractSource), module.exports = StreamFactorySource, StreamFactorySource.prototype.getStream = function(session, options, callback) { switch (arguments.length) { case 1: callback = session, session = null; break; case 2: callback = options, options = null; } this.streamFactory.getStream(session, options, callback); }, StreamFactorySource.prototype._end = function(session, callback) { if (!this.streamFactory.end) return callback(); this.streamFactory.end(session, callback); }, StreamFactorySource.prototype.toString = function() { return "[StreamFactorySource factory=" + this.streamFactory + "]"; }; }, function(module, exports, __webpack_require__) { var mp4box = __webpack_require__(719), needle = __webpack_require__(73), fs = __webpack_require__(2); function iterateCounts(counts, values, fn) { var idx = 0; counts.forEach((function(count, i) { for (var j = 0; j != count; j++) fn(values[i], idx++); })); } module.exports = function(url, cb) { var box = mp4box.createFile(), pos = 0, maxSeeks = 0; function onData(buf) { var b = (function(buffer) { for (var ab = new ArrayBuffer(buffer.length), view = new Uint8Array(ab), i = 0; i < buffer.length; ++i) view[i] = buffer[i]; return ab; })(buf); if (b.fileStart = pos, pos += b.byteLength, box.appendBuffer(b), box.mdats.length && !box.moovStartFound) { var offset = box.boxes.map((function(x) { return x.size; })).reduce((function(a, b) { return a + b; }), 0); if (offset > lastOffset) { if (maxSeeks > 3) return stream.close ? stream.close() : stream.end(), cb(new Error("maxSeeks exceeded")); maxSeeks++, startStream(url, offset); } } } var stream, lastOffset = 0; function closeStream() { if (stream) return stream instanceof fs.ReadStream && "function" == typeof stream.close ? stream.close() : stream.request && "function" == typeof stream.request.abort ? stream.request.abort() : "function" == typeof stream.destroy ? stream.destroy() : void 0; } function startStream(url, offset) { closeStream(), lastOffset = offset, pos = offset, stream = /^http(s?):\/\//.test(url) ? needle.get(url, { headers: { range: "bytes=" + offset + "-" } }).on("error", box.onError).on("end", (function(e) { box.flush(); })).on("data", onData) : fs.createReadStream(url, { start: offset }).on("error", box.onError).on("end", (function() { box.flush(); })).on("data", onData); } box.onError = function(err) { closeStream(), cb(err); }, startStream(url, 0), box.onReady = function(info) { if (box.flush(), closeStream(), !info) return cb(new Error("no info returned")); if (!info.videoTracks[0]) return cb(new Error("no videoTracks[0]")); try { var frames = (function(box) { var track = box.moov.traks.filter((function(t) { return t.mdia.minf.stbl.stss; }))[0], stts = track.mdia.minf.stbl.stts, ctts = track.mdia.minf.stbl.ctts, mdhd = track.mdia.mdhd, allDts = []; iterateCounts(stts.sample_counts, stts.sample_deltas, (function(delta, idx) { allDts.push(idx * delta); })); var allPts = []; ctts && iterateCounts(ctts.sample_counts, ctts.sample_offsets, (function(offset, idx) { allPts.push(allDts[idx] + offset); })); var frames = track.mdia.minf.stbl.stss.sample_numbers.map((function(x) { var dts = allDts[x - 1] / mdhd.timescale * 1e3, pts = ctts ? allPts[x - 1] / mdhd.timescale * 1e3 : dts; return { dts: dts, pts: pts, timestamp: pts, index: x }; })); return frames[0] && 1 !== frames[0].index && frames.unshift({ timestamp: 0, dts: 0, index: 1 }), frames; })(box); cb(null, frames); } catch (e) { cb(e); } }; }; }, function(module, exports, __webpack_require__) { var start, log_level, logObject, Log = (start = new Date, log_level = 4, logObject = { setLogLevel: function(level) { log_level = level == this.debug ? 1 : level == this.info ? 2 : level == this.warn ? 3 : (this.error, 4); }, debug: function(module, msg) { void 0 === console.debug && (console.debug = console.log), 1 >= log_level && console.debug("[" + Log.getDurationString(new Date - start, 1e3) + "]", "[" + module + "]", msg); }, log: function(module, msg) { this.debug(module.msg); }, info: function(module, msg) { 2 >= log_level && console.info("[" + Log.getDurationString(new Date - start, 1e3) + "]", "[" + module + "]", msg); }, warn: function(module, msg) { 3 >= log_level && console.warn("[" + Log.getDurationString(new Date - start, 1e3) + "]", "[" + module + "]", msg); }, error: function(module, msg) { 4 >= log_level && console.error("[" + Log.getDurationString(new Date - start, 1e3) + "]", "[" + module + "]", msg); } }, logObject); Log.getDurationString = function(duration, _timescale) { var neg; function pad(number, length) { for (var a = ("" + number).split("."); a[0].length < length; ) a[0] = "0" + a[0]; return a.join("."); } duration < 0 ? (neg = !0, duration = -duration) : neg = !1; var duration_sec = duration / (_timescale || 1), hours = Math.floor(duration_sec / 3600); duration_sec -= 3600 * hours; var minutes = Math.floor(duration_sec / 60), msec = 1e3 * (duration_sec -= 60 * minutes); return msec -= 1e3 * (duration_sec = Math.floor(duration_sec)), msec = Math.floor(msec), (neg ? "-" : "") + hours + ":" + pad(minutes, 2) + ":" + pad(duration_sec, 2) + "." + pad(msec, 3); }, Log.printRanges = function(ranges) { var length = ranges.length; if (length > 0) { for (var str = "", i = 0; i < length; i++) i > 0 && (str += ","), str += "[" + Log.getDurationString(ranges.start(i)) + "," + Log.getDurationString(ranges.end(i)) + "]"; return str; } return "(empty)"; }, exports.Log = Log; var MP4BoxStream = function(arrayBuffer) { if (!(arrayBuffer instanceof ArrayBuffer)) throw "Needs an array buffer"; this.buffer = arrayBuffer, this.dataview = new DataView(arrayBuffer), this.position = 0; }; MP4BoxStream.prototype.getPosition = function() { return this.position; }, MP4BoxStream.prototype.getEndPosition = function() { return this.buffer.byteLength; }, MP4BoxStream.prototype.getLength = function() { return this.buffer.byteLength; }, MP4BoxStream.prototype.seek = function(pos) { var npos = Math.max(0, Math.min(this.buffer.byteLength, pos)); return this.position = isNaN(npos) || !isFinite(npos) ? 0 : npos, !0; }, MP4BoxStream.prototype.isEos = function() { return this.getPosition() >= this.getEndPosition(); }, MP4BoxStream.prototype.readAnyInt = function(size, signed) { var res = 0; if (this.position + size <= this.buffer.byteLength) { switch (size) { case 1: res = signed ? this.dataview.getInt8(this.position) : this.dataview.getUint8(this.position); break; case 2: res = signed ? this.dataview.getInt16(this.position) : this.dataview.getUint16(this.position); break; case 3: if (signed) throw "No method for reading signed 24 bits values"; res = this.dataview.getUint8(this.position) << 16, res |= this.dataview.getUint8(this.position) << 8, res |= this.dataview.getUint8(this.position); break; case 4: res = signed ? this.dataview.getInt32(this.position) : this.dataview.getUint32(this.position); break; case 8: if (signed) throw "No method for reading signed 64 bits values"; res = this.dataview.getUint32(this.position) << 32, res |= this.dataview.getUint32(this.position); break; default: throw "readInt method not implemented for size: " + size; } return this.position += size, res; } throw "Not enough bytes in buffer"; }, MP4BoxStream.prototype.readUint8 = function() { return this.readAnyInt(1, !1); }, MP4BoxStream.prototype.readUint16 = function() { return this.readAnyInt(2, !1); }, MP4BoxStream.prototype.readUint24 = function() { return this.readAnyInt(3, !1); }, MP4BoxStream.prototype.readUint32 = function() { return this.readAnyInt(4, !1); }, MP4BoxStream.prototype.readUint64 = function() { return this.readAnyInt(8, !1); }, MP4BoxStream.prototype.readString = function(length) { if (this.position + length <= this.buffer.byteLength) { for (var s = "", i = 0; i < length; i++) s += String.fromCharCode(this.readUint8()); return s; } throw "Not enough bytes in buffer"; }, MP4BoxStream.prototype.readCString = function() { for (var arr = []; ;) { var b = this.readUint8(); if (0 === b) break; arr.push(b); } return String.fromCharCode.apply(null, arr); }, MP4BoxStream.prototype.readInt8 = function() { return this.readAnyInt(1, !0); }, MP4BoxStream.prototype.readInt16 = function() { return this.readAnyInt(2, !0); }, MP4BoxStream.prototype.readInt32 = function() { return this.readAnyInt(4, !0); }, MP4BoxStream.prototype.readInt64 = function() { return this.readAnyInt(8, !1); }, MP4BoxStream.prototype.readUint8Array = function(length) { for (var arr = new Uint8Array(length), i = 0; i < length; i++) arr[i] = this.readUint8(); return arr; }, MP4BoxStream.prototype.readInt16Array = function(length) { for (var arr = new Int16Array(length), i = 0; i < length; i++) arr[i] = this.readInt16(); return arr; }, MP4BoxStream.prototype.readUint16Array = function(length) { for (var arr = new Int16Array(length), i = 0; i < length; i++) arr[i] = this.readUint16(); return arr; }, MP4BoxStream.prototype.readUint32Array = function(length) { for (var arr = new Uint32Array(length), i = 0; i < length; i++) arr[i] = this.readUint32(); return arr; }, MP4BoxStream.prototype.readInt32Array = function(length) { for (var arr = new Int32Array(length), i = 0; i < length; i++) arr[i] = this.readInt32(); return arr; }, exports.MP4BoxStream = MP4BoxStream; var DataStream = function(arrayBuffer, byteOffset, endianness) { this._byteOffset = byteOffset || 0, arrayBuffer instanceof ArrayBuffer ? this.buffer = arrayBuffer : "object" == typeof arrayBuffer ? (this.dataView = arrayBuffer, byteOffset && (this._byteOffset += byteOffset)) : this.buffer = new ArrayBuffer(arrayBuffer || 0), this.position = 0, this.endianness = null == endianness ? DataStream.LITTLE_ENDIAN : endianness; }; DataStream.prototype = {}, DataStream.prototype.getPosition = function() { return this.position; }, DataStream.prototype._realloc = function(extra) { if (this._dynamicSize) { var req = this._byteOffset + this.position + extra, blen = this._buffer.byteLength; if (req <= blen) req > this._byteLength && (this._byteLength = req); else { for (blen < 1 && (blen = 1); req > blen; ) blen *= 2; var buf = new ArrayBuffer(blen), src = new Uint8Array(this._buffer); new Uint8Array(buf, 0, src.length).set(src), this.buffer = buf, this._byteLength = req; } } }, DataStream.prototype._trimAlloc = function() { if (this._byteLength != this._buffer.byteLength) { var buf = new ArrayBuffer(this._byteLength), dst = new Uint8Array(buf), src = new Uint8Array(this._buffer, 0, dst.length); dst.set(src), this.buffer = buf; } }, DataStream.BIG_ENDIAN = !1, DataStream.LITTLE_ENDIAN = !0, DataStream.prototype._byteLength = 0, Object.defineProperty(DataStream.prototype, "byteLength", { get: function() { return this._byteLength - this._byteOffset; } }), Object.defineProperty(DataStream.prototype, "buffer", { get: function() { return this._trimAlloc(), this._buffer; }, set: function(v) { this._buffer = v, this._dataView = new DataView(this._buffer, this._byteOffset), this._byteLength = this._buffer.byteLength; } }), Object.defineProperty(DataStream.prototype, "byteOffset", { get: function() { return this._byteOffset; }, set: function(v) { this._byteOffset = v, this._dataView = new DataView(this._buffer, this._byteOffset), this._byteLength = this._buffer.byteLength; } }), Object.defineProperty(DataStream.prototype, "dataView", { get: function() { return this._dataView; }, set: function(v) { this._byteOffset = v.byteOffset, this._buffer = v.buffer, this._dataView = new DataView(this._buffer, this._byteOffset), this._byteLength = this._byteOffset + v.byteLength; } }), DataStream.prototype.seek = function(pos) { var npos = Math.max(0, Math.min(this.byteLength, pos)); this.position = isNaN(npos) || !isFinite(npos) ? 0 : npos; }, DataStream.prototype.isEof = function() { return this.position >= this._byteLength; }, DataStream.prototype.mapUint8Array = function(length) { this._realloc(1 * length); var arr = new Uint8Array(this._buffer, this.byteOffset + this.position, length); return this.position += 1 * length, arr; }, DataStream.prototype.readInt32Array = function(length, e) { length = null == length ? this.byteLength - this.position / 4 : length; var arr = new Int32Array(length); return DataStream.memcpy(arr.buffer, 0, this.buffer, this.byteOffset + this.position, length * arr.BYTES_PER_ELEMENT), DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += arr.byteLength, arr; }, DataStream.prototype.readInt16Array = function(length, e) { length = null == length ? this.byteLength - this.position / 2 : length; var arr = new Int16Array(length); return DataStream.memcpy(arr.buffer, 0, this.buffer, this.byteOffset + this.position, length * arr.BYTES_PER_ELEMENT), DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += arr.byteLength, arr; }, DataStream.prototype.readInt8Array = function(length) { length = null == length ? this.byteLength - this.position : length; var arr = new Int8Array(length); return DataStream.memcpy(arr.buffer, 0, this.buffer, this.byteOffset + this.position, length * arr.BYTES_PER_ELEMENT), this.position += arr.byteLength, arr; }, DataStream.prototype.readUint32Array = function(length, e) { length = null == length ? this.byteLength - this.position / 4 : length; var arr = new Uint32Array(length); return DataStream.memcpy(arr.buffer, 0, this.buffer, this.byteOffset + this.position, length * arr.BYTES_PER_ELEMENT), DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += arr.byteLength, arr; }, DataStream.prototype.readUint16Array = function(length, e) { length = null == length ? this.byteLength - this.position / 2 : length; var arr = new Uint16Array(length); return DataStream.memcpy(arr.buffer, 0, this.buffer, this.byteOffset + this.position, length * arr.BYTES_PER_ELEMENT), DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += arr.byteLength, arr; }, DataStream.prototype.readUint8Array = function(length) { length = null == length ? this.byteLength - this.position : length; var arr = new Uint8Array(length); return DataStream.memcpy(arr.buffer, 0, this.buffer, this.byteOffset + this.position, length * arr.BYTES_PER_ELEMENT), this.position += arr.byteLength, arr; }, DataStream.prototype.readFloat64Array = function(length, e) { length = null == length ? this.byteLength - this.position / 8 : length; var arr = new Float64Array(length); return DataStream.memcpy(arr.buffer, 0, this.buffer, this.byteOffset + this.position, length * arr.BYTES_PER_ELEMENT), DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += arr.byteLength, arr; }, DataStream.prototype.readFloat32Array = function(length, e) { length = null == length ? this.byteLength - this.position / 4 : length; var arr = new Float32Array(length); return DataStream.memcpy(arr.buffer, 0, this.buffer, this.byteOffset + this.position, length * arr.BYTES_PER_ELEMENT), DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += arr.byteLength, arr; }, DataStream.prototype.readInt32 = function(e) { var v = this._dataView.getInt32(this.position, null == e ? this.endianness : e); return this.position += 4, v; }, DataStream.prototype.readInt16 = function(e) { var v = this._dataView.getInt16(this.position, null == e ? this.endianness : e); return this.position += 2, v; }, DataStream.prototype.readInt8 = function() { var v = this._dataView.getInt8(this.position); return this.position += 1, v; }, DataStream.prototype.readUint32 = function(e) { var v = this._dataView.getUint32(this.position, null == e ? this.endianness : e); return this.position += 4, v; }, DataStream.prototype.readUint16 = function(e) { var v = this._dataView.getUint16(this.position, null == e ? this.endianness : e); return this.position += 2, v; }, DataStream.prototype.readUint8 = function() { var v = this._dataView.getUint8(this.position); return this.position += 1, v; }, DataStream.prototype.readFloat32 = function(e) { var v = this._dataView.getFloat32(this.position, null == e ? this.endianness : e); return this.position += 4, v; }, DataStream.prototype.readFloat64 = function(e) { var v = this._dataView.getFloat64(this.position, null == e ? this.endianness : e); return this.position += 8, v; }, DataStream.endianness = new Int8Array(new Int16Array([ 1 ]).buffer)[0] > 0, DataStream.memcpy = function(dst, dstOffset, src, srcOffset, byteLength) { var dstU8 = new Uint8Array(dst, dstOffset, byteLength), srcU8 = new Uint8Array(src, srcOffset, byteLength); dstU8.set(srcU8); }, DataStream.arrayToNative = function(array, arrayIsLittleEndian) { return arrayIsLittleEndian == this.endianness ? array : this.flipArrayEndianness(array); }, DataStream.nativeToEndian = function(array, littleEndian) { return this.endianness == littleEndian ? array : this.flipArrayEndianness(array); }, DataStream.flipArrayEndianness = function(array) { for (var u8 = new Uint8Array(array.buffer, array.byteOffset, array.byteLength), i = 0; i < array.byteLength; i += array.BYTES_PER_ELEMENT) for (var j = i + array.BYTES_PER_ELEMENT - 1, k = i; j > k; j--, k++) { var tmp = u8[k]; u8[k] = u8[j], u8[j] = tmp; } return array; }, DataStream.prototype.failurePosition = 0, String.fromCharCodeUint8 = function(uint8arr) { for (var arr = [], i = 0; i < uint8arr.length; i++) arr[i] = uint8arr[i]; return String.fromCharCode.apply(null, arr); }, DataStream.prototype.readString = function(length, encoding) { return null == encoding || "ASCII" == encoding ? String.fromCharCodeUint8.apply(null, [ this.mapUint8Array(null == length ? this.byteLength - this.position : length) ]) : new TextDecoder(encoding).decode(this.mapUint8Array(length)); }, DataStream.prototype.readCString = function(length) { var blen = this.byteLength - this.position, u8 = new Uint8Array(this._buffer, this._byteOffset + this.position), len = blen; null != length && (len = Math.min(length, blen)); for (var i = 0; i < len && 0 !== u8[i]; i++) ; var s = String.fromCharCodeUint8.apply(null, [ this.mapUint8Array(i) ]); return null != length ? this.position += len - i : i != blen && (this.position += 1), s; }; var MAX_SIZE = Math.pow(2, 32); DataStream.prototype.readInt64 = function() { return this.readInt32() * MAX_SIZE + this.readUint32(); }, DataStream.prototype.readUint64 = function() { return this.readUint32() * MAX_SIZE + this.readUint32(); }, DataStream.prototype.readInt64 = function() { return this.readUint32() * MAX_SIZE + this.readUint32(); }, DataStream.prototype.readUint24 = function() { return (this.readUint8() << 16) + (this.readUint8() << 8) + this.readUint8(); }, exports.DataStream = DataStream, DataStream.prototype.save = function(filename) { var blob = new Blob([ this.buffer ]); if (!window.URL || !URL.createObjectURL) throw "DataStream.save: Can't create object URL."; var url = window.URL.createObjectURL(blob), a = document.createElement("a"); document.body.appendChild(a), a.setAttribute("href", url), a.setAttribute("download", filename), a.setAttribute("target", "_self"), a.click(), window.URL.revokeObjectURL(url); }, DataStream.prototype._dynamicSize = !0, Object.defineProperty(DataStream.prototype, "dynamicSize", { get: function() { return this._dynamicSize; }, set: function(v) { v || this._trimAlloc(), this._dynamicSize = v; } }), DataStream.prototype.shift = function(offset) { var buf = new ArrayBuffer(this._byteLength - offset), dst = new Uint8Array(buf), src = new Uint8Array(this._buffer, offset, dst.length); dst.set(src), this.buffer = buf, this.position -= offset; }, DataStream.prototype.writeInt32Array = function(arr, e) { if (this._realloc(4 * arr.length), arr instanceof Int32Array && this.byteOffset + this.position % arr.BYTES_PER_ELEMENT === 0) DataStream.memcpy(this._buffer, this.byteOffset + this.position, arr.buffer, 0, arr.byteLength), this.mapInt32Array(arr.length, e); else for (var i = 0; i < arr.length; i++) this.writeInt32(arr[i], e); }, DataStream.prototype.writeInt16Array = function(arr, e) { if (this._realloc(2 * arr.length), arr instanceof Int16Array && this.byteOffset + this.position % arr.BYTES_PER_ELEMENT === 0) DataStream.memcpy(this._buffer, this.byteOffset + this.position, arr.buffer, 0, arr.byteLength), this.mapInt16Array(arr.length, e); else for (var i = 0; i < arr.length; i++) this.writeInt16(arr[i], e); }, DataStream.prototype.writeInt8Array = function(arr) { if (this._realloc(1 * arr.length), arr instanceof Int8Array && this.byteOffset + this.position % arr.BYTES_PER_ELEMENT === 0) DataStream.memcpy(this._buffer, this.byteOffset + this.position, arr.buffer, 0, arr.byteLength), this.mapInt8Array(arr.length); else for (var i = 0; i < arr.length; i++) this.writeInt8(arr[i]); }, DataStream.prototype.writeUint32Array = function(arr, e) { if (this._realloc(4 * arr.length), arr instanceof Uint32Array && this.byteOffset + this.position % arr.BYTES_PER_ELEMENT === 0) DataStream.memcpy(this._buffer, this.byteOffset + this.position, arr.buffer, 0, arr.byteLength), this.mapUint32Array(arr.length, e); else for (var i = 0; i < arr.length; i++) this.writeUint32(arr[i], e); }, DataStream.prototype.writeUint16Array = function(arr, e) { if (this._realloc(2 * arr.length), arr instanceof Uint16Array && this.byteOffset + this.position % arr.BYTES_PER_ELEMENT === 0) DataStream.memcpy(this._buffer, this.byteOffset + this.position, arr.buffer, 0, arr.byteLength), this.mapUint16Array(arr.length, e); else for (var i = 0; i < arr.length; i++) this.writeUint16(arr[i], e); }, DataStream.prototype.writeUint8Array = function(arr) { if (this._realloc(1 * arr.length), arr instanceof Uint8Array && this.byteOffset + this.position % arr.BYTES_PER_ELEMENT === 0) DataStream.memcpy(this._buffer, this.byteOffset + this.position, arr.buffer, 0, arr.byteLength), this.mapUint8Array(arr.length); else for (var i = 0; i < arr.length; i++) this.writeUint8(arr[i]); }, DataStream.prototype.writeFloat64Array = function(arr, e) { if (this._realloc(8 * arr.length), arr instanceof Float64Array && this.byteOffset + this.position % arr.BYTES_PER_ELEMENT === 0) DataStream.memcpy(this._buffer, this.byteOffset + this.position, arr.buffer, 0, arr.byteLength), this.mapFloat64Array(arr.length, e); else for (var i = 0; i < arr.length; i++) this.writeFloat64(arr[i], e); }, DataStream.prototype.writeFloat32Array = function(arr, e) { if (this._realloc(4 * arr.length), arr instanceof Float32Array && this.byteOffset + this.position % arr.BYTES_PER_ELEMENT === 0) DataStream.memcpy(this._buffer, this.byteOffset + this.position, arr.buffer, 0, arr.byteLength), this.mapFloat32Array(arr.length, e); else for (var i = 0; i < arr.length; i++) this.writeFloat32(arr[i], e); }, DataStream.prototype.writeInt32 = function(v, e) { this._realloc(4), this._dataView.setInt32(this.position, v, null == e ? this.endianness : e), this.position += 4; }, DataStream.prototype.writeInt16 = function(v, e) { this._realloc(2), this._dataView.setInt16(this.position, v, null == e ? this.endianness : e), this.position += 2; }, DataStream.prototype.writeInt8 = function(v) { this._realloc(1), this._dataView.setInt8(this.position, v), this.position += 1; }, DataStream.prototype.writeUint32 = function(v, e) { this._realloc(4), this._dataView.setUint32(this.position, v, null == e ? this.endianness : e), this.position += 4; }, DataStream.prototype.writeUint16 = function(v, e) { this._realloc(2), this._dataView.setUint16(this.position, v, null == e ? this.endianness : e), this.position += 2; }, DataStream.prototype.writeUint8 = function(v) { this._realloc(1), this._dataView.setUint8(this.position, v), this.position += 1; }, DataStream.prototype.writeFloat32 = function(v, e) { this._realloc(4), this._dataView.setFloat32(this.position, v, null == e ? this.endianness : e), this.position += 4; }, DataStream.prototype.writeFloat64 = function(v, e) { this._realloc(8), this._dataView.setFloat64(this.position, v, null == e ? this.endianness : e), this.position += 8; }, DataStream.prototype.writeUCS2String = function(str, endianness, lengthOverride) { null == lengthOverride && (lengthOverride = str.length); for (var i = 0; i < str.length && i < lengthOverride; i++) this.writeUint16(str.charCodeAt(i), endianness); for (;i < lengthOverride; i++) this.writeUint16(0); }, DataStream.prototype.writeString = function(s, encoding, length) { var i = 0; if (null == encoding || "ASCII" == encoding) if (null != length) { var len = Math.min(s.length, length); for (i = 0; i < len; i++) this.writeUint8(s.charCodeAt(i)); for (;i < length; i++) this.writeUint8(0); } else for (i = 0; i < s.length; i++) this.writeUint8(s.charCodeAt(i)); else this.writeUint8Array(new TextEncoder(encoding).encode(s.substring(0, length))); }, DataStream.prototype.writeCString = function(s, length) { var i = 0; if (null != length) { var len = Math.min(s.length, length); for (i = 0; i < len; i++) this.writeUint8(s.charCodeAt(i)); for (;i < length; i++) this.writeUint8(0); } else { for (i = 0; i < s.length; i++) this.writeUint8(s.charCodeAt(i)); this.writeUint8(0); } }, DataStream.prototype.writeStruct = function(structDefinition, struct) { for (var i = 0; i < structDefinition.length; i += 2) { var t = structDefinition[i + 1]; this.writeType(t, struct[structDefinition[i]], struct); } }, DataStream.prototype.writeType = function(t, v, struct) { var tp; if ("function" == typeof t) return t(this, v); if ("object" == typeof t && !(t instanceof Array)) return t.set(this, v, struct); var lengthOverride = null, charset = "ASCII", pos = this.position; switch ("string" == typeof t && /:/.test(t) && (tp = t.split(":"), t = tp[0], lengthOverride = parseInt(tp[1])), "string" == typeof t && /,/.test(t) && (tp = t.split(","), t = tp[0], charset = parseInt(tp[1])), t) { case "uint8": this.writeUint8(v); break; case "int8": this.writeInt8(v); break; case "uint16": this.writeUint16(v, this.endianness); break; case "int16": this.writeInt16(v, this.endianness); break; case "uint32": this.writeUint32(v, this.endianness); break; case "int32": this.writeInt32(v, this.endianness); break; case "float32": this.writeFloat32(v, this.endianness); break; case "float64": this.writeFloat64(v, this.endianness); break; case "uint16be": this.writeUint16(v, DataStream.BIG_ENDIAN); break; case "int16be": this.writeInt16(v, DataStream.BIG_ENDIAN); break; case "uint32be": this.writeUint32(v, DataStream.BIG_ENDIAN); break; case "int32be": this.writeInt32(v, DataStream.BIG_ENDIAN); break; case "float32be": this.writeFloat32(v, DataStream.BIG_ENDIAN); break; case "float64be": this.writeFloat64(v, DataStream.BIG_ENDIAN); break; case "uint16le": this.writeUint16(v, DataStream.LITTLE_ENDIAN); break; case "int16le": this.writeInt16(v, DataStream.LITTLE_ENDIAN); break; case "uint32le": this.writeUint32(v, DataStream.LITTLE_ENDIAN); break; case "int32le": this.writeInt32(v, DataStream.LITTLE_ENDIAN); break; case "float32le": this.writeFloat32(v, DataStream.LITTLE_ENDIAN); break; case "float64le": this.writeFloat64(v, DataStream.LITTLE_ENDIAN); break; case "cstring": this.writeCString(v, lengthOverride); break; case "string": this.writeString(v, charset, lengthOverride); break; case "u16string": this.writeUCS2String(v, this.endianness, lengthOverride); break; case "u16stringle": this.writeUCS2String(v, DataStream.LITTLE_ENDIAN, lengthOverride); break; case "u16stringbe": this.writeUCS2String(v, DataStream.BIG_ENDIAN, lengthOverride); break; default: if (3 == t.length) { for (var ta = t[1], i = 0; i < v.length; i++) this.writeType(ta, v[i]); break; } this.writeStruct(t, v); } null != lengthOverride && (this.position = pos, this._realloc(lengthOverride), this.position = pos + lengthOverride); }, DataStream.prototype.writeUint64 = function(v) { var h = Math.floor(v / MAX_SIZE); this.writeUint32(h), this.writeUint32(4294967295 & v); }, DataStream.prototype.writeUint24 = function(v) { this.writeUint8((16711680 & v) >> 16), this.writeUint8((65280 & v) >> 8), this.writeUint8(255 & v); }, DataStream.prototype.adjustUint32 = function(position, value) { var pos = this.position; this.seek(position), this.writeUint32(value), this.seek(pos); }, DataStream.prototype.mapInt32Array = function(length, e) { this._realloc(4 * length); var arr = new Int32Array(this._buffer, this.byteOffset + this.position, length); return DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += 4 * length, arr; }, DataStream.prototype.mapInt16Array = function(length, e) { this._realloc(2 * length); var arr = new Int16Array(this._buffer, this.byteOffset + this.position, length); return DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += 2 * length, arr; }, DataStream.prototype.mapInt8Array = function(length) { this._realloc(1 * length); var arr = new Int8Array(this._buffer, this.byteOffset + this.position, length); return this.position += 1 * length, arr; }, DataStream.prototype.mapUint32Array = function(length, e) { this._realloc(4 * length); var arr = new Uint32Array(this._buffer, this.byteOffset + this.position, length); return DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += 4 * length, arr; }, DataStream.prototype.mapUint16Array = function(length, e) { this._realloc(2 * length); var arr = new Uint16Array(this._buffer, this.byteOffset + this.position, length); return DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += 2 * length, arr; }, DataStream.prototype.mapFloat64Array = function(length, e) { this._realloc(8 * length); var arr = new Float64Array(this._buffer, this.byteOffset + this.position, length); return DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += 8 * length, arr; }, DataStream.prototype.mapFloat32Array = function(length, e) { this._realloc(4 * length); var arr = new Float32Array(this._buffer, this.byteOffset + this.position, length); return DataStream.arrayToNative(arr, null == e ? this.endianness : e), this.position += 4 * length, arr; }; var MultiBufferStream = function(buffer) { this.buffers = [], this.bufferIndex = -1, buffer && (this.insertBuffer(buffer), this.bufferIndex = 0); }; (MultiBufferStream.prototype = new DataStream(new ArrayBuffer, 0, DataStream.BIG_ENDIAN)).initialized = function() { var firstBuffer; return this.bufferIndex > -1 || (this.buffers.length > 0 ? 0 === (firstBuffer = this.buffers[0]).fileStart ? (this.buffer = firstBuffer, this.bufferIndex = 0, Log.debug("MultiBufferStream", "Stream ready for parsing"), !0) : (Log.warn("MultiBufferStream", "The first buffer should have a fileStart of 0"), this.logBufferLevel(), !1) : (Log.warn("MultiBufferStream", "No buffer to start parsing from"), this.logBufferLevel(), !1)); }, ArrayBuffer.concat = function(buffer1, buffer2) { Log.debug("ArrayBuffer", "Trying to create a new buffer of size: " + (buffer1.byteLength + buffer2.byteLength)); var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength); return tmp.set(new Uint8Array(buffer1), 0), tmp.set(new Uint8Array(buffer2), buffer1.byteLength), tmp.buffer; }, MultiBufferStream.prototype.reduceBuffer = function(buffer, offset, newLength) { var smallB; return (smallB = new Uint8Array(newLength)).set(new Uint8Array(buffer, offset, newLength)), smallB.buffer.fileStart = buffer.fileStart + offset, smallB.buffer.usedBytes = 0, smallB.buffer; }, MultiBufferStream.prototype.insertBuffer = function(ab) { for (var to_add = !0, i = 0; i < this.buffers.length; i++) { var b = this.buffers[i]; if (ab.fileStart <= b.fileStart) { if (ab.fileStart === b.fileStart) { if (ab.byteLength > b.byteLength) { this.buffers.splice(i, 1), i--; continue; } Log.warn("MultiBufferStream", "Buffer (fileStart: " + ab.fileStart + " - Length: " + ab.byteLength + ") already appended, ignoring"); } else ab.fileStart + ab.byteLength <= b.fileStart || (ab = this.reduceBuffer(ab, 0, b.fileStart - ab.fileStart)), Log.debug("MultiBufferStream", "Appending new buffer (fileStart: " + ab.fileStart + " - Length: " + ab.byteLength + ")"), this.buffers.splice(i, 0, ab), 0 === i && (this.buffer = ab); to_add = !1; break; } if (ab.fileStart < b.fileStart + b.byteLength) { var offset = b.fileStart + b.byteLength - ab.fileStart, newLength = ab.byteLength - offset; if (!(newLength > 0)) { to_add = !1; break; } ab = this.reduceBuffer(ab, offset, newLength); } } to_add && (Log.debug("MultiBufferStream", "Appending new buffer (fileStart: " + ab.fileStart + " - Length: " + ab.byteLength + ")"), this.buffers.push(ab), 0 === i && (this.buffer = ab)); }, MultiBufferStream.prototype.logBufferLevel = function(info) { var i, buffer, used, total, range, ranges = [], bufferedString = ""; for (used = 0, total = 0, i = 0; i < this.buffers.length; i++) buffer = this.buffers[i], 0 === i ? (range = {}, ranges.push(range), range.start = buffer.fileStart, range.end = buffer.fileStart + buffer.byteLength, bufferedString += "[" + range.start + "-") : range.end === buffer.fileStart ? range.end = buffer.fileStart + buffer.byteLength : ((range = {}).start = buffer.fileStart, bufferedString += ranges[ranges.length - 1].end - 1 + "], [" + range.start + "-", range.end = buffer.fileStart + buffer.byteLength, ranges.push(range)), used += buffer.usedBytes, total += buffer.byteLength; ranges.length > 0 && (bufferedString += range.end - 1 + "]"); var log = info ? Log.info : Log.debug; 0 === this.buffers.length ? log("MultiBufferStream", "No more buffer in memory") : log("MultiBufferStream", this.buffers.length + " stored buffer(s) (" + used + "/" + total + " bytes): " + bufferedString); }, MultiBufferStream.prototype.cleanBuffers = function() { var i, buffer; for (i = 0; i < this.buffers.length; i++) (buffer = this.buffers[i]).usedBytes === buffer.byteLength && (Log.debug("MultiBufferStream", "Removing buffer #" + i), this.buffers.splice(i, 1), i--); }, MultiBufferStream.prototype.mergeNextBuffer = function() { var next_buffer; if (this.bufferIndex + 1 < this.buffers.length) { if ((next_buffer = this.buffers[this.bufferIndex + 1]).fileStart === this.buffer.fileStart + this.buffer.byteLength) { var oldLength = this.buffer.byteLength, oldUsedBytes = this.buffer.usedBytes, oldFileStart = this.buffer.fileStart; return this.buffers[this.bufferIndex] = ArrayBuffer.concat(this.buffer, next_buffer), this.buffer = this.buffers[this.bufferIndex], this.buffers.splice(this.bufferIndex + 1, 1), this.buffer.usedBytes = oldUsedBytes, this.buffer.fileStart = oldFileStart, Log.debug("ISOFile", "Concatenating buffer for box parsing (length: " + oldLength + "->" + this.buffer.byteLength + ")"), !0; } return !1; } return !1; }, MultiBufferStream.prototype.findPosition = function(fromStart, filePosition, markAsUsed) { var i, abuffer = null, index = -1; for (i = !0 === fromStart ? 0 : this.bufferIndex; i < this.buffers.length && (abuffer = this.buffers[i]).fileStart <= filePosition; ) index = i, markAsUsed && (abuffer.fileStart + abuffer.byteLength <= filePosition ? abuffer.usedBytes = abuffer.byteLength : abuffer.usedBytes = filePosition - abuffer.fileStart, this.logBufferLevel()), i++; return -1 !== index && (abuffer = this.buffers[index]).fileStart + abuffer.byteLength >= filePosition ? (Log.debug("MultiBufferStream", "Found position in existing buffer #" + index), index) : -1; }, MultiBufferStream.prototype.findEndContiguousBuf = function(inputindex) { var i, currentBuf, nextBuf, index = void 0 !== inputindex ? inputindex : this.bufferIndex; if (currentBuf = this.buffers[index], this.buffers.length > index + 1) for (i = index + 1; i < this.buffers.length && (nextBuf = this.buffers[i]).fileStart === currentBuf.fileStart + currentBuf.byteLength; i++) currentBuf = nextBuf; return currentBuf.fileStart + currentBuf.byteLength; }, MultiBufferStream.prototype.getEndFilePositionAfter = function(pos) { var index = this.findPosition(!0, pos, !1); return -1 !== index ? this.findEndContiguousBuf(index) : pos; }, MultiBufferStream.prototype.addUsedBytes = function(nbBytes) { this.buffer.usedBytes += nbBytes, this.logBufferLevel(); }, MultiBufferStream.prototype.setAllUsedBytes = function() { this.buffer.usedBytes = this.buffer.byteLength, this.logBufferLevel(); }, MultiBufferStream.prototype.seek = function(filePosition, fromStart, markAsUsed) { var index; return -1 !== (index = this.findPosition(fromStart, filePosition, markAsUsed)) ? (this.buffer = this.buffers[index], this.bufferIndex = index, this.position = filePosition - this.buffer.fileStart, Log.debug("MultiBufferStream", "Repositioning parser at buffer position: " + this.position), !0) : (Log.debug("MultiBufferStream", "Position " + filePosition + " not found in buffered data"), !1); }, MultiBufferStream.prototype.getPosition = function() { if (-1 === this.bufferIndex || null === this.buffers[this.bufferIndex]) throw "Error accessing position in the MultiBufferStream"; return this.buffers[this.bufferIndex].fileStart + this.position; }, MultiBufferStream.prototype.getLength = function() { return this.byteLength; }, MultiBufferStream.prototype.getEndPosition = function() { if (-1 === this.bufferIndex || null === this.buffers[this.bufferIndex]) throw "Error accessing position in the MultiBufferStream"; return this.buffers[this.bufferIndex].fileStart + this.byteLength; }, exports.MultiBufferStream = MultiBufferStream; var MPEG4DescriptorParser = function() { var descTagToName = []; descTagToName[3] = "ES_Descriptor", descTagToName[4] = "DecoderConfigDescriptor", descTagToName[5] = "DecoderSpecificInfo", descTagToName[6] = "SLConfigDescriptor", this.getDescriptorName = function(tag) { return descTagToName[tag]; }; var that = this, classes = {}; return this.parseOneDescriptor = function(stream) { var tag, desc, byteRead, size = 0; for (tag = stream.readUint8(), byteRead = stream.readUint8(); 128 & byteRead; ) size = (127 & byteRead) << 7, byteRead = stream.readUint8(); return size += 127 & byteRead, Log.debug("MPEG4DescriptorParser", "Found " + (descTagToName[tag] || "Descriptor " + tag) + ", size " + size + " at position " + stream.getPosition()), (desc = descTagToName[tag] ? new classes[descTagToName[tag]](size) : new classes.Descriptor(size)).parse(stream), desc; }, classes.Descriptor = function(_tag, _size) { this.tag = _tag, this.size = _size, this.descs = []; }, classes.Descriptor.prototype.parse = function(stream) { this.data = stream.readUint8Array(this.size); }, classes.Descriptor.prototype.findDescriptor = function(tag) { for (var i = 0; i < this.descs.length; i++) if (this.descs[i].tag == tag) return this.descs[i]; return null; }, classes.Descriptor.prototype.parseRemainingDescriptors = function(stream) { for (var start = stream.position; stream.position < start + this.size; ) { var desc = that.parseOneDescriptor(stream); this.descs.push(desc); } }, classes.ES_Descriptor = function(size) { classes.Descriptor.call(this, 3, size); }, classes.ES_Descriptor.prototype = new classes.Descriptor, classes.ES_Descriptor.prototype.parse = function(stream) { if (this.ES_ID = stream.readUint16(), this.flags = stream.readUint8(), this.size -= 3, 128 & this.flags ? (this.dependsOn_ES_ID = stream.readUint16(), this.size -= 2) : this.dependsOn_ES_ID = 0, 64 & this.flags) { var l = stream.readUint8(); this.URL = stream.readString(l), this.size -= l + 1; } else this.URL = ""; 32 & this.flags ? (this.OCR_ES_ID = stream.readUint16(), this.size -= 2) : this.OCR_ES_ID = 0, this.parseRemainingDescriptors(stream); }, classes.ES_Descriptor.prototype.getOTI = function(stream) { var dcd = this.findDescriptor(4); return dcd ? dcd.oti : 0; }, classes.ES_Descriptor.prototype.getAudioConfig = function(stream) { var dcd = this.findDescriptor(4); if (!dcd) return null; var dsi = dcd.findDescriptor(5); if (dsi && dsi.data) { var audioObjectType = (248 & dsi.data[0]) >> 3; return 31 === audioObjectType && dsi.data.length >= 2 && (audioObjectType = 32 + ((7 & dsi.data[0]) << 3) + ((224 & dsi.data[1]) >> 5)), audioObjectType; } return null; }, classes.DecoderConfigDescriptor = function(size) { classes.Descriptor.call(this, 4, size); }, classes.DecoderConfigDescriptor.prototype = new classes.Descriptor, classes.DecoderConfigDescriptor.prototype.parse = function(stream) { this.oti = stream.readUint8(), this.streamType = stream.readUint8(), this.bufferSize = stream.readUint24(), this.maxBitrate = stream.readUint32(), this.avgBitrate = stream.readUint32(), this.size -= 13, this.parseRemainingDescriptors(stream); }, classes.DecoderSpecificInfo = function(size) { classes.Descriptor.call(this, 5, size); }, classes.DecoderSpecificInfo.prototype = new classes.Descriptor, classes.SLConfigDescriptor = function(size) { classes.Descriptor.call(this, 6, size); }, classes.SLConfigDescriptor.prototype = new classes.Descriptor, this; }; exports.MPEG4DescriptorParser = MPEG4DescriptorParser; var BoxParser = { ERR_INVALID_DATA: -1, ERR_NOT_ENOUGH_DATA: 0, OK: 1, BASIC_BOXES: [ "mdat", "idat", "free", "skip", "meco", "strk" ], FULL_BOXES: [ "hmhd", "nmhd", "iods", "xml ", "bxml", "ipro", "mere" ], CONTAINER_BOXES: [ [ "moov", [ "trak", "pssh" ] ], [ "trak" ], [ "edts" ], [ "mdia" ], [ "minf" ], [ "dinf" ], [ "stbl", [ "sgpd", "sbgp" ] ], [ "mvex", [ "trex" ] ], [ "moof", [ "traf" ] ], [ "traf", [ "trun", "sgpd", "sbgp" ] ], [ "vttc" ], [ "tref" ], [ "iref" ], [ "mfra", [ "tfra" ] ], [ "meco" ], [ "hnti" ], [ "hinf" ], [ "strk" ], [ "strd" ], [ "sinf" ], [ "rinf" ], [ "schi" ], [ "trgr" ], [ "udta", [ "kind" ] ], [ "iprp", [ "ipma" ] ], [ "ipco" ] ], boxCodes: [], fullBoxCodes: [], containerBoxCodes: [], sampleEntryCodes: {}, sampleGroupEntryCodes: [], trackGroupTypes: [], UUIDBoxes: {}, UUIDs: [], initialize: function() { BoxParser.FullBox.prototype = new BoxParser.Box, BoxParser.ContainerBox.prototype = new BoxParser.Box, BoxParser.SampleEntry.prototype = new BoxParser.Box, BoxParser.TrackGroupTypeBox.prototype = new BoxParser.FullBox, BoxParser.BASIC_BOXES.forEach((function(type) { BoxParser.createBoxCtor(type); })), BoxParser.FULL_BOXES.forEach((function(type) { BoxParser.createFullBoxCtor(type); })), BoxParser.CONTAINER_BOXES.forEach((function(types) { BoxParser.createContainerBoxCtor(types[0], null, types[1]); })); }, Box: function(_type, _size, _uuid) { this.type = _type, this.size = _size, this.uuid = _uuid; }, FullBox: function(type, size, uuid) { BoxParser.Box.call(this, type, size, uuid), this.flags = 0, this.version = 0; }, ContainerBox: function(type, size, uuid) { BoxParser.Box.call(this, type, size, uuid), this.boxes = []; }, SampleEntry: function(type, size, hdr_size, start) { BoxParser.ContainerBox.call(this, type, size), this.hdr_size = hdr_size, this.start = start; }, SampleGroupEntry: function(type) { this.grouping_type = type; }, TrackGroupTypeBox: function(type, size) { BoxParser.FullBox.call(this, type, size); }, createBoxCtor: function(type, parseMethod) { BoxParser.boxCodes.push(type), BoxParser[type + "Box"] = function(size) { BoxParser.Box.call(this, type, size); }, BoxParser[type + "Box"].prototype = new BoxParser.Box, parseMethod && (BoxParser[type + "Box"].prototype.parse = parseMethod); }, createFullBoxCtor: function(type, parseMethod) { BoxParser[type + "Box"] = function(size) { BoxParser.FullBox.call(this, type, size); }, BoxParser[type + "Box"].prototype = new BoxParser.FullBox, BoxParser[type + "Box"].prototype.parse = function(stream) { this.parseFullHeader(stream), parseMethod && parseMethod.call(this, stream); }; }, addSubBoxArrays: function(subBoxNames) { if (subBoxNames) { this.subBoxNames = subBoxNames; for (var nbSubBoxes = subBoxNames.length, k = 0; k < nbSubBoxes; k++) this[subBoxNames[k] + "s"] = []; } }, createContainerBoxCtor: function(type, parseMethod, subBoxNames) { BoxParser[type + "Box"] = function(size) { BoxParser.ContainerBox.call(this, type, size), BoxParser.addSubBoxArrays.call(this, subBoxNames); }, BoxParser[type + "Box"].prototype = new BoxParser.ContainerBox, parseMethod && (BoxParser[type + "Box"].prototype.parse = parseMethod); }, createMediaSampleEntryCtor: function(mediaType, parseMethod, subBoxNames) { BoxParser.sampleEntryCodes[mediaType] = [], BoxParser[mediaType + "SampleEntry"] = function(type, size) { BoxParser.SampleEntry.call(this, type, size), BoxParser.addSubBoxArrays.call(this, subBoxNames); }, BoxParser[mediaType + "SampleEntry"].prototype = new BoxParser.SampleEntry, parseMethod && (BoxParser[mediaType + "SampleEntry"].prototype.parse = parseMethod); }, createSampleEntryCtor: function(mediaType, type, parseMethod, subBoxNames) { BoxParser.sampleEntryCodes[mediaType].push(type), BoxParser[type + "SampleEntry"] = function(size) { BoxParser[mediaType + "SampleEntry"].call(this, type, size), BoxParser.addSubBoxArrays.call(this, subBoxNames); }, BoxParser[type + "SampleEntry"].prototype = new BoxParser[mediaType + "SampleEntry"], parseMethod && (BoxParser[type + "SampleEntry"].prototype.parse = parseMethod); }, createEncryptedSampleEntryCtor: function(mediaType, type, parseMethod) { BoxParser.createSampleEntryCtor.call(this, mediaType, type, parseMethod, [ "sinf" ]); }, createSampleGroupCtor: function(type, parseMethod) { BoxParser[type + "SampleGroupEntry"] = function(size) { BoxParser.SampleGroupEntry.call(this, type, size); }, BoxParser[type + "SampleGroupEntry"].prototype = new BoxParser.SampleGroupEntry, parseMethod && (BoxParser[type + "SampleGroupEntry"].prototype.parse = parseMethod); }, createTrackGroupCtor: function(type, parseMethod) { BoxParser[type + "TrackGroupTypeBox"] = function(size) { BoxParser.TrackGroupTypeBox.call(this, type, size); }, BoxParser[type + "TrackGroupTypeBox"].prototype = new BoxParser.TrackGroupTypeBox, parseMethod && (BoxParser[type + "TrackGroupTypeBox"].prototype.parse = parseMethod); }, createUUIDBox: function(uuid, isFullBox, isContainerBox, parseMethod) { BoxParser.UUIDs.push(uuid), BoxParser.UUIDBoxes[uuid] = function(size) { isFullBox ? BoxParser.FullBox.call(this, "uuid", size, uuid) : isContainerBox ? BoxParser.ContainerBox.call(this, "uuid", size, uuid) : BoxParser.Box.call(this, "uuid", size, uuid); }, BoxParser.UUIDBoxes[uuid].prototype = isFullBox ? new BoxParser.FullBox : isContainerBox ? new BoxParser.ContainerBox : new BoxParser.Box, parseMethod && (BoxParser.UUIDBoxes[uuid].prototype.parse = isFullBox ? function(stream) { this.parseFullHeader(stream), parseMethod && parseMethod.call(this, stream); } : parseMethod); } }; BoxParser.initialize(), BoxParser.TKHD_FLAG_ENABLED = 1, BoxParser.TKHD_FLAG_IN_MOVIE = 2, BoxParser.TKHD_FLAG_IN_PREVIEW = 4, BoxParser.TFHD_FLAG_BASE_DATA_OFFSET = 1, BoxParser.TFHD_FLAG_SAMPLE_DESC = 2, BoxParser.TFHD_FLAG_SAMPLE_DUR = 8, BoxParser.TFHD_FLAG_SAMPLE_SIZE = 16, BoxParser.TFHD_FLAG_SAMPLE_FLAGS = 32, BoxParser.TFHD_FLAG_DUR_EMPTY = 65536, BoxParser.TFHD_FLAG_DEFAULT_BASE_IS_MOOF = 131072, BoxParser.TRUN_FLAGS_DATA_OFFSET = 1, BoxParser.TRUN_FLAGS_FIRST_FLAG = 4, BoxParser.TRUN_FLAGS_DURATION = 256, BoxParser.TRUN_FLAGS_SIZE = 512, BoxParser.TRUN_FLAGS_FLAGS = 1024, BoxParser.TRUN_FLAGS_CTS_OFFSET = 2048, BoxParser.Box.prototype.add = function(name) { return this.addBox(new BoxParser[name + "Box"]); }, BoxParser.Box.prototype.addBox = function(box) { return this.boxes.push(box), this[box.type + "s"] ? this[box.type + "s"].push(box) : this[box.type] = box, box; }, BoxParser.Box.prototype.set = function(prop, value) { return this[prop] = value, this; }, BoxParser.Box.prototype.addEntry = function(value, _prop) { var prop = _prop || "entries"; return this[prop] || (this[prop] = []), this[prop].push(value), this; }, exports.BoxParser = BoxParser, BoxParser.parseUUID = function(stream) { return BoxParser.parseHex16(stream); }, BoxParser.parseHex16 = function(stream) { for (var hex16 = "", i = 0; i < 16; i++) { var hex = stream.readUint8().toString(16); hex16 += 1 === hex.length ? "0" + hex : hex; } return hex16; }, BoxParser.parseOneBox = function(stream, headerOnly, parentSize) { var box, diff, uuid, start = stream.getPosition(), hdr_size = 0; if (stream.getEndPosition() - start < 8) return Log.debug("BoxParser", "Not enough data in stream to parse the type and size of the box"), { code: BoxParser.ERR_NOT_ENOUGH_DATA }; if (parentSize && parentSize < 8) return Log.debug("BoxParser", "Not enough bytes left in the parent box to parse a new box"), { code: BoxParser.ERR_NOT_ENOUGH_DATA }; var size = stream.readUint32(), type = stream.readString(4), box_type = type; if (Log.debug("BoxParser", "Found box of type '" + type + "' and size " + size + " at position " + start), hdr_size = 8, "uuid" == type) { if (stream.getEndPosition() - stream.getPosition() < 16 || parentSize - hdr_size < 16) return stream.seek(start), Log.debug("BoxParser", "Not enough bytes left in the parent box to parse a UUID box"), { code: BoxParser.ERR_NOT_ENOUGH_DATA }; hdr_size += 16, box_type = uuid = BoxParser.parseUUID(stream); } if (1 == size) { if (stream.getEndPosition() - stream.getPosition() < 8 || parentSize && parentSize - hdr_size < 8) return stream.seek(start), Log.warn("BoxParser", 'Not enough data in stream to parse the extended size of the "' + type + '" box'), { code: BoxParser.ERR_NOT_ENOUGH_DATA }; size = stream.readUint64(), hdr_size += 8; } else if (0 === size) if (parentSize) size = parentSize; else if ("mdat" !== type) return Log.error("BoxParser", "Unlimited box size not supported for type: '" + type + "'"), box = new BoxParser.Box(type, size), { code: BoxParser.OK, box: box, size: box.size }; return size < hdr_size ? (Log.error("BoxParser", "Box of type " + type + " has an invalid size " + size + " (too small to be a box)"), { code: BoxParser.ERR_NOT_ENOUGH_DATA, type: type, size: size, hdr_size: hdr_size, start: start }) : parentSize && size > parentSize ? (Log.error("BoxParser", "Box of type '" + type + "' has a size " + size + " greater than its container size " + parentSize), { code: BoxParser.ERR_NOT_ENOUGH_DATA, type: type, size: size, hdr_size: hdr_size, start: start }) : start + size > stream.getEndPosition() ? (stream.seek(start), Log.info("BoxParser", "Not enough data in stream to parse the entire '" + type + "' box"), { code: BoxParser.ERR_NOT_ENOUGH_DATA, type: type, size: size, hdr_size: hdr_size, start: start }) : headerOnly ? { code: BoxParser.OK, type: type, size: size, hdr_size: hdr_size, start: start } : (BoxParser[type + "Box"] ? box = new BoxParser[type + "Box"](size) : "uuid" !== type ? (Log.warn("BoxParser", "Unknown box type: '" + type + "'"), (box = new BoxParser.Box(type, size)).has_unparsed_data = !0) : BoxParser.UUIDBoxes[uuid] ? box = new BoxParser.UUIDBoxes[uuid](size) : (Log.warn("BoxParser", "Unknown uuid type: '" + uuid + "'"), (box = new BoxParser.Box(type, size)).uuid = uuid, box.has_unparsed_data = !0), box.hdr_size = hdr_size, box.start = start, box.write === BoxParser.Box.prototype.write && "mdat" !== box.type && (Log.info("BoxParser", "'" + box_type + "' box writing not yet implemented, keeping unparsed data in memory for later write"), box.parseDataAndRewind(stream)), box.parse(stream), (diff = stream.getPosition() - (box.start + box.size)) < 0 ? (Log.warn("BoxParser", "Parsing of box '" + box_type + "' did not read the entire indicated box data size (missing " + -diff + " bytes), seeking forward"), stream.seek(box.start + box.size)) : diff > 0 && (Log.error("BoxParser", "Parsing of box '" + box_type + "' read " + diff + " more bytes than the indicated box data size, seeking backwards"), stream.seek(box.start + box.size)), { code: BoxParser.OK, box: box, size: box.size }); }, BoxParser.Box.prototype.parse = function(stream) { "mdat" != this.type ? this.data = stream.readUint8Array(this.size - this.hdr_size) : 0 === this.size ? stream.seek(stream.getEndPosition()) : stream.seek(this.start + this.size); }, BoxParser.Box.prototype.parseDataAndRewind = function(stream) { this.data = stream.readUint8Array(this.size - this.hdr_size), stream.position -= this.size - this.hdr_size; }, BoxParser.FullBox.prototype.parseDataAndRewind = function(stream) { this.parseFullHeader(stream), this.data = stream.readUint8Array(this.size - this.hdr_size), this.hdr_size -= 4, stream.position -= this.size - this.hdr_size; }, BoxParser.FullBox.prototype.parseFullHeader = function(stream) { this.version = stream.readUint8(), this.flags = stream.readUint24(), this.hdr_size += 4; }, BoxParser.FullBox.prototype.parse = function(stream) { this.parseFullHeader(stream), this.data = stream.readUint8Array(this.size - this.hdr_size); }, BoxParser.ContainerBox.prototype.parse = function(stream) { for (var ret, box; stream.getPosition() < this.start + this.size; ) { if ((ret = BoxParser.parseOneBox(stream, !1, this.size - (stream.getPosition() - this.start))).code !== BoxParser.OK) return; if (box = ret.box, this.boxes.push(box), this.subBoxNames && -1 != this.subBoxNames.indexOf(box.type)) this[this.subBoxNames[this.subBoxNames.indexOf(box.type)] + "s"].push(box); else { var box_type = "uuid" !== box.type ? box.type : box.uuid; this[box_type] ? Log.warn("Box of type " + box_type + " already stored in field of this type") : this[box_type] = box; } } }, BoxParser.Box.prototype.parseLanguage = function(stream) { this.language = stream.readUint16(); var chars = []; chars[0] = this.language >> 10 & 31, chars[1] = this.language >> 5 & 31, chars[2] = 31 & this.language, this.languageString = String.fromCharCode(chars[0] + 96, chars[1] + 96, chars[2] + 96); }, BoxParser.SAMPLE_ENTRY_TYPE_VISUAL = "Visual", BoxParser.SAMPLE_ENTRY_TYPE_AUDIO = "Audio", BoxParser.SAMPLE_ENTRY_TYPE_HINT = "Hint", BoxParser.SAMPLE_ENTRY_TYPE_METADATA = "Metadata", BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE = "Subtitle", BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM = "System", BoxParser.SAMPLE_ENTRY_TYPE_TEXT = "Text", BoxParser.SampleEntry.prototype.parseHeader = function(stream) { stream.readUint8Array(6), this.data_reference_index = stream.readUint16(), this.hdr_size += 8; }, BoxParser.SampleEntry.prototype.parse = function(stream) { this.parseHeader(stream), this.data = stream.readUint8Array(this.size - this.hdr_size); }, BoxParser.SampleEntry.prototype.parseDataAndRewind = function(stream) { this.parseHeader(stream), this.data = stream.readUint8Array(this.size - this.hdr_size), this.hdr_size -= 8, stream.position -= this.size - this.hdr_size; }, BoxParser.SampleEntry.prototype.parseFooter = function(stream) { BoxParser.ContainerBox.prototype.parse.call(this, stream); }, BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_HINT), BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA), BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE), BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM), BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_TEXT), BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, (function(stream) { this.parseHeader(stream), stream.readUint16(), stream.readUint16(), stream.readUint32Array(3), this.width = stream.readUint16(), this.height = stream.readUint16(), this.horizresolution = stream.readUint32(), this.vertresolution = stream.readUint32(), stream.readUint32(), this.frame_count = stream.readUint16(), compressorname_length = Math.min(31, stream.readUint8()), this.compressorname = stream.readString(compressorname_length), compressorname_length < 31 && stream.readString(31 - compressorname_length), this.depth = stream.readUint16(), stream.readUint16(), this.parseFooter(stream); })), BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, (function(stream) { this.parseHeader(stream), stream.readUint32Array(2), this.channel_count = stream.readUint16(), this.samplesize = stream.readUint16(), stream.readUint16(), stream.readUint16(), this.samplerate = stream.readUint32() / 65536, this.parseFooter(stream); })), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc1"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc2"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc3"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc4"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "av01"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "hvc1"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "hev1"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "mp4a"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "ac-3"), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "ec-3"), BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "encv"), BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "enca"), BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "encu"), BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM, "encs"), BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_TEXT, "enct"), BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA, "encm"), BoxParser.createBoxCtor("av1C", (function(stream) { var tmp = stream.readUint8(); if (tmp >> 7 & !1) Log.error("av1C marker problem"); else if (this.version = 127 & tmp, 1 === this.version) if (tmp = stream.readUint8(), this.seq_profile = tmp >> 5 & 7, this.seq_level_idx_0 = 31 & tmp, tmp = stream.readUint8(), this.seq_tier_0 = tmp >> 7 & 1, this.high_bitdepth = tmp >> 6 & 1, this.twelve_bit = tmp >> 5 & 1, this.monochrome = tmp >> 4 & 1, this.chroma_subsampling_x = tmp >> 3 & 1, this.chroma_subsampling_y = tmp >> 2 & 1, this.chroma_sample_position = 3 & tmp, tmp = stream.readUint8(), this.reserved_1 = tmp >> 5 & 7, 0 === this.reserved_1) { if (this.initial_presentation_delay_present = tmp >> 4 & 1, 1 === this.initial_presentation_delay_present) this.initial_presentation_delay_minus_one = 15 & tmp; else if (this.reserved_2 = 15 & tmp, 0 !== this.reserved_2) return void Log.error("av1C reserved_2 parsing problem"); var configOBUs_length = this.size - this.hdr_size - 4; this.configOBUs = stream.readUint8Array(configOBUs_length); } else Log.error("av1C reserved_1 parsing problem"); else Log.error("av1C version " + this.version + " not supported"); })), BoxParser.createBoxCtor("avcC", (function(stream) { var i, toparse; for (this.configurationVersion = stream.readUint8(), this.AVCProfileIndication = stream.readUint8(), this.profile_compatibility = stream.readUint8(), this.AVCLevelIndication = stream.readUint8(), this.lengthSizeMinusOne = 3 & stream.readUint8(), this.nb_SPS_nalus = 31 & stream.readUint8(), toparse = this.size - this.hdr_size - 6, this.SPS = [], i = 0; i < this.nb_SPS_nalus; i++) this.SPS[i] = {}, this.SPS[i].length = stream.readUint16(), this.SPS[i].nalu = stream.readUint8Array(this.SPS[i].length), toparse -= 2 + this.SPS[i].length; for (this.nb_PPS_nalus = stream.readUint8(), toparse--, this.PPS = [], i = 0; i < this.nb_PPS_nalus; i++) this.PPS[i] = {}, this.PPS[i].length = stream.readUint16(), this.PPS[i].nalu = stream.readUint8Array(this.PPS[i].length), toparse -= 2 + this.PPS[i].length; toparse > 0 && (this.ext = stream.readUint8Array(toparse)); })), BoxParser.createBoxCtor("btrt", (function(stream) { this.bufferSizeDB = stream.readUint32(), this.maxBitrate = stream.readUint32(), this.avgBitrate = stream.readUint32(); })), BoxParser.createBoxCtor("clap", (function(stream) { this.cleanApertureWidthN = stream.readUint32(), this.cleanApertureWidthD = stream.readUint32(), this.cleanApertureHeightN = stream.readUint32(), this.cleanApertureHeightD = stream.readUint32(), this.horizOffN = stream.readUint32(), this.horizOffD = stream.readUint32(), this.vertOffN = stream.readUint32(), this.vertOffD = stream.readUint32(); })), BoxParser.createBoxCtor("clli", (function(stream) { this.max_content_light_level = stream.readUint16(), this.max_pic_average_light_level = stream.readUint16(); })), BoxParser.createFullBoxCtor("co64", (function(stream) { var entry_count, i; if (entry_count = stream.readUint32(), this.chunk_offsets = [], 0 === this.version) for (i = 0; i < entry_count; i++) this.chunk_offsets.push(stream.readUint64()); })), BoxParser.createFullBoxCtor("CoLL", (function(stream) { this.maxCLL = stream.readUint16(), this.maxFALL = stream.readUint16(); })), BoxParser.createBoxCtor("colr", (function(stream) { if (this.colour_type = stream.readString(4), "nclx" === this.colour_type) { this.colour_primaries = stream.readUint16(), this.transfer_characteristics = stream.readUint16(), this.matrix_coefficients = stream.readUint16(); var tmp = stream.readUint8(); this.full_range_flag = tmp >> 7; } else ("rICC" === this.colour_type || "prof" === this.colour_type) && (this.ICC_profile = stream.readUint8Array(this.size - 4)); })), BoxParser.createFullBoxCtor("cprt", (function(stream) { this.parseLanguage(stream), this.notice = stream.readCString(); })), BoxParser.createFullBoxCtor("cslg", (function(stream) { 0 === this.version && (this.compositionToDTSShift = stream.readInt32(), this.leastDecodeToDisplayDelta = stream.readInt32(), this.greatestDecodeToDisplayDelta = stream.readInt32(), this.compositionStartTime = stream.readInt32(), this.compositionEndTime = stream.readInt32()); })), BoxParser.createFullBoxCtor("ctts", (function(stream) { var entry_count, i; if (entry_count = stream.readUint32(), this.sample_counts = [], this.sample_offsets = [], 0 === this.version) for (i = 0; i < entry_count; i++) { this.sample_counts.push(stream.readUint32()); var value = stream.readInt32(); value < 0 && Log.warn("BoxParser", "ctts box uses negative values without using version 1"), this.sample_offsets.push(value); } else if (1 == this.version) for (i = 0; i < entry_count; i++) this.sample_counts.push(stream.readUint32()), this.sample_offsets.push(stream.readInt32()); })), BoxParser.createBoxCtor("dac3", (function(stream) { var tmp_byte1 = stream.readUint8(), tmp_byte2 = stream.readUint8(), tmp_byte3 = stream.readUint8(); this.fscod = tmp_byte1 >> 6, this.bsid = tmp_byte1 >> 1 & 31, this.bsmod = (1 & tmp_byte1) << 2 | tmp_byte2 >> 6 & 3, this.acmod = tmp_byte2 >> 3 & 7, this.lfeon = tmp_byte2 >> 2 & 1, this.bit_rate_code = 3 & tmp_byte2 | tmp_byte3 >> 5 & 7; })), BoxParser.createBoxCtor("dec3", (function(stream) { var tmp_16 = stream.readUint16(); this.data_rate = tmp_16 >> 3, this.num_ind_sub = 7 & tmp_16, this.ind_subs = []; for (var i = 0; i < this.num_ind_sub + 1; i++) { var ind_sub = {}; this.ind_subs.push(ind_sub); var tmp_byte1 = stream.readUint8(), tmp_byte2 = stream.readUint8(), tmp_byte3 = stream.readUint8(); ind_sub.fscod = tmp_byte1 >> 6, ind_sub.bsid = tmp_byte1 >> 1 & 31, ind_sub.bsmod = (1 & tmp_byte1) << 4 | tmp_byte2 >> 4 & 15, ind_sub.acmod = tmp_byte2 >> 1 & 7, ind_sub.lfeon = 1 & tmp_byte2, ind_sub.num_dep_sub = tmp_byte3 >> 1 & 15, ind_sub.num_dep_sub > 0 && (ind_sub.chan_loc = (1 & tmp_byte3) << 8 | stream.readUint8()); } })), BoxParser.createFullBoxCtor("dfLa", (function(stream) { var boxesFound = [], knownBlockTypes = [ "STREAMINFO", "PADDING", "APPLICATION", "SEEKTABLE", "VORBIS_COMMENT", "CUESHEET", "PICTURE", "RESERVED" ]; for (this.parseFullHeader(stream); ;) { var flagAndType = stream.readUint8(), type = Math.min(127 & flagAndType, knownBlockTypes.length - 1); if (type ? stream.readUint8Array(stream.readUint24()) : (stream.readUint8Array(13), this.samplerate = stream.readUint32() >> 12, stream.readUint8Array(20)), boxesFound.push(knownBlockTypes[type]), 128 & flagAndType) break; } this.numMetadataBlocks = boxesFound.length + " (" + boxesFound.join(", ") + ")"; })), BoxParser.createBoxCtor("dimm", (function(stream) { this.bytessent = stream.readUint64(); })), BoxParser.createBoxCtor("dmax", (function(stream) { this.time = stream.readUint32(); })), BoxParser.createBoxCtor("dmed", (function(stream) { this.bytessent = stream.readUint64(); })), BoxParser.createFullBoxCtor("dref", (function(stream) { var ret, box; this.entries = []; for (var entry_count = stream.readUint32(), i = 0; i < entry_count; i++) { if ((ret = BoxParser.parseOneBox(stream, !1, this.size - (stream.getPosition() - this.start))).code !== BoxParser.OK) return; box = ret.box, this.entries.push(box); } })), BoxParser.createBoxCtor("drep", (function(stream) { this.bytessent = stream.readUint64(); })), BoxParser.createFullBoxCtor("elng", (function(stream) { this.extended_language = stream.readString(this.size - this.hdr_size); })), BoxParser.createFullBoxCtor("elst", (function(stream) { this.entries = []; for (var entry_count = stream.readUint32(), i = 0; i < entry_count; i++) { var entry = {}; this.entries.push(entry), 1 === this.version ? (entry.segment_duration = stream.readUint64(), entry.media_time = stream.readInt64()) : (entry.segment_duration = stream.readUint32(), entry.media_time = stream.readInt32()), entry.media_rate_integer = stream.readInt16(), entry.media_rate_fraction = stream.readInt16(); } })), BoxParser.createFullBoxCtor("emsg", (function(stream) { this.scheme_id_uri = stream.readCString(), this.value = stream.readCString(), this.timescale = stream.readUint32(), this.presentation_time_delta = stream.readUint32(), this.event_duration = stream.readUint32(), this.id = stream.readUint32(); var message_size = this.size - this.hdr_size - (16 + (this.scheme_id_uri.length + 1) + (this.value.length + 1)); this.message_data = stream.readUint8Array(message_size); })), BoxParser.createFullBoxCtor("esds", (function(stream) { var esd_data = stream.readUint8Array(this.size - this.hdr_size), esd_parser = new MPEG4DescriptorParser; this.esd = esd_parser.parseOneDescriptor(new DataStream(esd_data.buffer, 0, DataStream.BIG_ENDIAN)); })), BoxParser.createBoxCtor("fiel", (function(stream) { this.fieldCount = stream.readUint8(), this.fieldOrdering = stream.readUint8(); })), BoxParser.createBoxCtor("frma", (function(stream) { this.data_format = stream.readString(4); })), BoxParser.createBoxCtor("ftyp", (function(stream) { var toparse = this.size - this.hdr_size; this.major_brand = stream.readString(4), this.minor_version = stream.readUint32(), toparse -= 8, this.compatible_brands = []; for (var i = 0; toparse >= 4; ) this.compatible_brands[i] = stream.readString(4), toparse -= 4, i++; })), BoxParser.createFullBoxCtor("hdlr", (function(stream) { 0 === this.version && (stream.readUint32(), this.handler = stream.readString(4), stream.readUint32Array(3), this.name = stream.readString(this.size - this.hdr_size - 20), "\0" === this.name[this.name.length - 1] && (this.name = this.name.slice(0, -1))); })), BoxParser.createBoxCtor("hvcC", (function(stream) { var i, j, length, tmp_byte; this.configurationVersion = stream.readUint8(), tmp_byte = stream.readUint8(), this.general_profile_space = tmp_byte >> 6, this.general_tier_flag = (32 & tmp_byte) >> 5, this.general_profile_idc = 31 & tmp_byte, this.general_profile_compatibility = stream.readUint32(), this.general_constraint_indicator = stream.readUint8Array(6), this.general_level_idc = stream.readUint8(), this.min_spatial_segmentation_idc = 4095 & stream.readUint16(), this.parallelismType = 3 & stream.readUint8(), this.chroma_format_idc = 3 & stream.readUint8(), this.bit_depth_luma_minus8 = 7 & stream.readUint8(), this.bit_depth_chroma_minus8 = 7 & stream.readUint8(), this.avgFrameRate = stream.readUint16(), tmp_byte = stream.readUint8(), this.constantFrameRate = tmp_byte >> 6, this.numTemporalLayers = (13 & tmp_byte) >> 3, this.temporalIdNested = (4 & tmp_byte) >> 2, this.lengthSizeMinusOne = 3 & tmp_byte, this.nalu_arrays = []; var numOfArrays = stream.readUint8(); for (i = 0; i < numOfArrays; i++) { var nalu_array = []; this.nalu_arrays.push(nalu_array), tmp_byte = stream.readUint8(), nalu_array.completeness = (128 & tmp_byte) >> 7, nalu_array.nalu_type = 63 & tmp_byte; var numNalus = stream.readUint16(); for (j = 0; j < numNalus; j++) { var nalu = {}; nalu_array.push(nalu), length = stream.readUint16(), nalu.data = stream.readUint8Array(length); } } })), BoxParser.createFullBoxCtor("iinf", (function(stream) { var ret; 0 === this.version ? this.entry_count = stream.readUint16() : this.entry_count = stream.readUint32(), this.item_infos = []; for (var i = 0; i < this.entry_count; i++) { if ((ret = BoxParser.parseOneBox(stream, !1, this.size - (stream.getPosition() - this.start))).code !== BoxParser.OK) return; "infe" !== ret.box.type && Log.error("BoxParser", "Expected 'infe' box, got " + ret.box.type), this.item_infos[i] = ret.box; } })), BoxParser.createFullBoxCtor("iloc", (function(stream) { var byte; byte = stream.readUint8(), this.offset_size = byte >> 4 & 15, this.length_size = 15 & byte, byte = stream.readUint8(), this.base_offset_size = byte >> 4 & 15, 1 === this.version || 2 === this.version ? this.index_size = 15 & byte : this.index_size = 0, this.items = []; var item_count = 0; if (this.version < 2) item_count = stream.readUint16(); else { if (2 !== this.version) throw "version of iloc box not supported"; item_count = stream.readUint32(); } for (var i = 0; i < item_count; i++) { var item = {}; if (this.items.push(item), this.version < 2) item.item_ID = stream.readUint16(); else { if (2 !== this.version) throw "version of iloc box not supported"; item.item_ID = stream.readUint16(); } switch (1 === this.version || 2 === this.version ? item.construction_method = 15 & stream.readUint16() : item.construction_method = 0, item.data_reference_index = stream.readUint16(), this.base_offset_size) { case 0: item.base_offset = 0; break; case 4: item.base_offset = stream.readUint32(); break; case 8: item.base_offset = stream.readUint64(); break; default: throw "Error reading base offset size"; } var extent_count = stream.readUint16(); item.extents = []; for (var j = 0; j < extent_count; j++) { var extent = {}; if (item.extents.push(extent), 1 === this.version || 2 === this.version) switch (this.index_size) { case 0: extent.extent_index = 0; break; case 4: extent.extent_index = stream.readUint32(); break; case 8: extent.extent_index = stream.readUint64(); break; default: throw "Error reading extent index"; } switch (this.offset_size) { case 0: extent.extent_offset = 0; break; case 4: extent.extent_offset = stream.readUint32(); break; case 8: extent.extent_offset = stream.readUint64(); break; default: throw "Error reading extent index"; } switch (this.length_size) { case 0: extent.extent_length = 0; break; case 4: extent.extent_length = stream.readUint32(); break; case 8: extent.extent_length = stream.readUint64(); break; default: throw "Error reading extent index"; } } } })), BoxParser.createFullBoxCtor("infe", (function(stream) { if (0 !== this.version && 1 !== this.version || (this.item_ID = stream.readUint16(), this.item_protection_index = stream.readUint16(), this.item_name = stream.readCString(), this.content_type = stream.readCString(), this.content_encoding = stream.readCString()), 1 === this.version) return this.extension_type = stream.readString(4), Log.warn("BoxParser", "Cannot parse extension type"), void stream.seek(this.start + this.size); this.version >= 2 && (2 === this.version ? this.item_ID = stream.readUint16() : 3 === this.version && (this.item_ID = stream.readUint32()), this.item_protection_index = stream.readUint16(), this.item_type = stream.readString(4), this.item_name = stream.readCString(), "mime" === this.item_type ? (this.content_type = stream.readCString(), this.content_encoding = stream.readCString()) : "uri " === this.item_type && (this.item_uri_type = stream.readCString())); })), BoxParser.createFullBoxCtor("ipma", (function(stream) { var i, j; for (entry_count = stream.readUint32(), this.associations = [], i = 0; i < entry_count; i++) { var item_assoc = {}; this.associations.push(item_assoc), this.version < 1 ? item_assoc.id = stream.readUint16() : item_assoc.id = stream.readUint32(); var association_count = stream.readUint8(); for (item_assoc.props = [], j = 0; j < association_count; j++) { var tmp = stream.readUint8(), p = {}; item_assoc.props.push(p), p.essential = (128 & tmp) >> 7 == 1, 1 & this.flags ? p.property_index = (127 & tmp) << 8 | stream.readUint8() : p.property_index = 127 & tmp; } } })), BoxParser.createFullBoxCtor("iref", (function(stream) { var ret, box; for (this.references = []; stream.getPosition() < this.start + this.size; ) { if ((ret = BoxParser.parseOneBox(stream, !0, this.size - (stream.getPosition() - this.start))).code !== BoxParser.OK) return; (box = 0 === this.version ? new BoxParser.SingleItemTypeReferenceBox(ret.type, ret.size, ret.hdr_size, ret.start) : new BoxParser.SingleItemTypeReferenceBoxLarge(ret.type, ret.size, ret.hdr_size, ret.start)).write === BoxParser.Box.prototype.write && "mdat" !== box.type && (Log.warn("BoxParser", box.type + " box writing not yet implemented, keeping unparsed data in memory for later write"), box.parseDataAndRewind(stream)), box.parse(stream), this.references.push(box); } })), BoxParser.createBoxCtor("irot", (function(stream) { this.angle = 3 & stream.readUint8(); })), BoxParser.createFullBoxCtor("ispe", (function(stream) { this.image_width = stream.readUint32(), this.image_height = stream.readUint32(); })), BoxParser.createFullBoxCtor("kind", (function(stream) { this.schemeURI = stream.readCString(), this.value = stream.readCString(); })), BoxParser.createFullBoxCtor("leva", (function(stream) { var count = stream.readUint8(); this.levels = []; for (var i = 0; i < count; i++) { var level = {}; this.levels[i] = level, level.track_ID = stream.readUint32(); var tmp_byte = stream.readUint8(); switch (level.padding_flag = tmp_byte >> 7, level.assignment_type = 127 & tmp_byte, level.assignment_type) { case 0: level.grouping_type = stream.readString(4); break; case 1: level.grouping_type = stream.readString(4), level.grouping_type_parameter = stream.readUint32(); break; case 2: case 3: break; case 4: level.sub_track_id = stream.readUint32(); break; default: Log.warn("BoxParser", "Unknown leva assignement type"); } } })), BoxParser.createBoxCtor("maxr", (function(stream) { this.period = stream.readUint32(), this.bytes = stream.readUint32(); })), BoxParser.createBoxCtor("mdcv", (function(stream) { this.display_primaries = [], this.display_primaries[0] = {}, this.display_primaries[0].x = stream.readUint16(), this.display_primaries[0].y = stream.readUint16(), this.display_primaries[1] = {}, this.display_primaries[1].x = stream.readUint16(), this.display_primaries[1].y = stream.readUint16(), this.display_primaries[2] = {}, this.display_primaries[2].x = stream.readUint16(), this.display_primaries[2].y = stream.readUint16(), this.white_point = {}, this.white_point.x = stream.readUint16(), this.white_point.y = stream.readUint16(), this.max_display_mastering_luminance = stream.readUint32(), this.min_display_mastering_luminance = stream.readUint32(); })), BoxParser.createFullBoxCtor("mdhd", (function(stream) { 1 == this.version ? (this.creation_time = stream.readUint64(), this.modification_time = stream.readUint64(), this.timescale = stream.readUint32(), this.duration = stream.readUint64()) : (this.creation_time = stream.readUint32(), this.modification_time = stream.readUint32(), this.timescale = stream.readUint32(), this.duration = stream.readUint32()), this.parseLanguage(stream), stream.readUint16(); })), BoxParser.createFullBoxCtor("mehd", (function(stream) { 1 & this.flags && (Log.warn("BoxParser", "mehd box incorrectly uses flags set to 1, converting version to 1"), this.version = 1), 1 == this.version ? this.fragment_duration = stream.readUint64() : this.fragment_duration = stream.readUint32(); })), BoxParser.createFullBoxCtor("meta", (function(stream) { this.boxes = [], BoxParser.ContainerBox.prototype.parse.call(this, stream); })), BoxParser.createFullBoxCtor("mfhd", (function(stream) { this.sequence_number = stream.readUint32(); })), BoxParser.createFullBoxCtor("mfro", (function(stream) { this._size = stream.readUint32(); })), BoxParser.createFullBoxCtor("mvhd", (function(stream) { 1 == this.version ? (this.creation_time = stream.readUint64(), this.modification_time = stream.readUint64(), this.timescale = stream.readUint32(), this.duration = stream.readUint64()) : (this.creation_time = stream.readUint32(), this.modification_time = stream.readUint32(), this.timescale = stream.readUint32(), this.duration = stream.readUint32()), this.rate = stream.readUint32(), this.volume = stream.readUint16() >> 8, stream.readUint16(), stream.readUint32Array(2), this.matrix = stream.readUint32Array(9), stream.readUint32Array(6), this.next_track_id = stream.readUint32(); })), BoxParser.createBoxCtor("npck", (function(stream) { this.packetssent = stream.readUint32(); })), BoxParser.createBoxCtor("nump", (function(stream) { this.packetssent = stream.readUint64(); })), BoxParser.createFullBoxCtor("padb", (function(stream) { var sample_count = stream.readUint32(); this.padbits = []; for (var i = 0; i < Math.floor((sample_count + 1) / 2); i++) this.padbits = stream.readUint8(); })), BoxParser.createBoxCtor("pasp", (function(stream) { this.hSpacing = stream.readUint32(), this.vSpacing = stream.readUint32(); })), BoxParser.createBoxCtor("payl", (function(stream) { this.text = stream.readString(this.size - this.hdr_size); })), BoxParser.createBoxCtor("payt", (function(stream) { this.payloadID = stream.readUint32(); var count = stream.readUint8(); this.rtpmap_string = stream.readString(count); })), BoxParser.createFullBoxCtor("pdin", (function(stream) { var count = (this.size - this.hdr_size) / 8; this.rate = [], this.initial_delay = []; for (var i = 0; i < count; i++) this.rate[i] = stream.readUint32(), this.initial_delay[i] = stream.readUint32(); })), BoxParser.createFullBoxCtor("pitm", (function(stream) { 0 === this.version ? this.item_id = stream.readUint16() : this.item_id = stream.readUint32(); })), BoxParser.createFullBoxCtor("pixi", (function(stream) { var i; for (this.num_channels = stream.readUint8(), this.bits_per_channels = [], i = 0; i < this.num_channels; i++) this.bits_per_channels[i] = stream.readUint8(); })), BoxParser.createBoxCtor("pmax", (function(stream) { this.bytes = stream.readUint32(); })), BoxParser.createFullBoxCtor("prft", (function(stream) { this.ref_track_id = stream.readUint32(), this.ntp_timestamp = stream.readUint64(), 0 === this.version ? this.media_time = stream.readUint32() : this.media_time = stream.readUint64(); })), BoxParser.createFullBoxCtor("pssh", (function(stream) { if (this.system_id = BoxParser.parseHex16(stream), this.version > 0) { var count = stream.readUint32(); this.kid = []; for (var i = 0; i < count; i++) this.kid[i] = BoxParser.parseHex16(stream); } var datasize = stream.readUint32(); datasize > 0 && (this.data = stream.readUint8Array(datasize)); })), BoxParser.createFullBoxCtor("clef", (function(stream) { this.width = stream.readUint32(), this.height = stream.readUint32(); })), BoxParser.createFullBoxCtor("enof", (function(stream) { this.width = stream.readUint32(), this.height = stream.readUint32(); })), BoxParser.createFullBoxCtor("prof", (function(stream) { this.width = stream.readUint32(), this.height = stream.readUint32(); })), BoxParser.createContainerBoxCtor("tapt", null, [ "clef", "prof", "enof" ]), BoxParser.createBoxCtor("rtp ", (function(stream) { this.descriptionformat = stream.readString(4), this.sdptext = stream.readString(this.size - this.hdr_size - 4); })), BoxParser.createFullBoxCtor("saio", (function(stream) { 1 & this.flags && (this.aux_info_type = stream.readUint32(), this.aux_info_type_parameter = stream.readUint32()); var count = stream.readUint32(); this.offset = []; for (var i = 0; i < count; i++) 0 === this.version ? this.offset[i] = stream.readUint32() : this.offset[i] = stream.readUint64(); })), BoxParser.createFullBoxCtor("saiz", (function(stream) { 1 & this.flags && (this.aux_info_type = stream.readUint32(), this.aux_info_type_parameter = stream.readUint32()), this.default_sample_info_size = stream.readUint8(); var count = stream.readUint32(); if (this.sample_info_size = [], 0 === this.default_sample_info_size) for (var i = 0; i < count; i++) this.sample_info_size[i] = stream.readUint8(); })), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA, "mett", (function(stream) { this.parseHeader(stream), this.content_encoding = stream.readCString(), this.mime_format = stream.readCString(), this.parseFooter(stream); })), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA, "metx", (function(stream) { this.parseHeader(stream), this.content_encoding = stream.readCString(), this.namespace = stream.readCString(), this.schema_location = stream.readCString(), this.parseFooter(stream); })), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "sbtt", (function(stream) { this.parseHeader(stream), this.content_encoding = stream.readCString(), this.mime_format = stream.readCString(), this.parseFooter(stream); })), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "stpp", (function(stream) { this.parseHeader(stream), this.namespace = stream.readCString(), this.schema_location = stream.readCString(), this.auxiliary_mime_types = stream.readCString(), this.parseFooter(stream); })), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "stxt", (function(stream) { this.parseHeader(stream), this.content_encoding = stream.readCString(), this.mime_format = stream.readCString(), this.parseFooter(stream); })), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "tx3g", (function(stream) { this.parseHeader(stream), this.displayFlags = stream.readUint32(), this.horizontal_justification = stream.readInt8(), this.vertical_justification = stream.readInt8(), this.bg_color_rgba = stream.readUint8Array(4), this.box_record = stream.readInt16Array(4), this.style_record = stream.readUint8Array(12), this.parseFooter(stream); })), BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA, "wvtt", (function(stream) { this.parseHeader(stream), this.parseFooter(stream); })), BoxParser.createSampleGroupCtor("alst", (function(stream) { var i, roll_count = stream.readUint16(); for (this.first_output_sample = stream.readUint16(), this.sample_offset = [], i = 0; i < roll_count; i++) this.sample_offset[i] = stream.readUint32(); var remaining = this.description_length - 4 - 4 * roll_count; for (this.num_output_samples = [], this.num_total_samples = [], i = 0; i < remaining / 4; i++) this.num_output_samples[i] = stream.readUint16(), this.num_total_samples[i] = stream.readUint16(); })), BoxParser.createSampleGroupCtor("avll", (function(stream) { this.layerNumber = stream.readUint8(), this.accurateStatisticsFlag = stream.readUint8(), this.avgBitRate = stream.readUint16(), this.avgFrameRate = stream.readUint16(); })), BoxParser.createSampleGroupCtor("avss", (function(stream) { this.subSequenceIdentifier = stream.readUint16(), this.layerNumber = stream.readUint8(); var tmp_byte = stream.readUint8(); this.durationFlag = tmp_byte >> 7, this.avgRateFlag = tmp_byte >> 6 & 1, this.durationFlag && (this.duration = stream.readUint32()), this.avgRateFlag && (this.accurateStatisticsFlag = stream.readUint8(), this.avgBitRate = stream.readUint16(), this.avgFrameRate = stream.readUint16()), this.dependency = []; for (var numReferences = stream.readUint8(), i = 0; i < numReferences; i++) { var dependencyInfo = {}; this.dependency.push(dependencyInfo), dependencyInfo.subSeqDirectionFlag = stream.readUint8(), dependencyInfo.layerNumber = stream.readUint8(), dependencyInfo.subSequenceIdentifier = stream.readUint16(); } })), BoxParser.createSampleGroupCtor("dtrt", (function(stream) { Log.warn("BoxParser", "Sample Group type: " + this.grouping_type + " not fully parsed"); })), BoxParser.createSampleGroupCtor("mvif", (function(stream) { Log.warn("BoxParser", "Sample Group type: " + this.grouping_type + " not fully parsed"); })), BoxParser.createSampleGroupCtor("prol", (function(stream) { this.roll_distance = stream.readInt16(); })), BoxParser.createSampleGroupCtor("rap ", (function(stream) { var tmp_byte = stream.readUint8(); this.num_leading_samples_known = tmp_byte >> 7, this.num_leading_samples = 127 & tmp_byte; })), BoxParser.createSampleGroupCtor("rash", (function(stream) { if (this.operation_point_count = stream.readUint16(), this.description_length !== 2 + (1 === this.operation_point_count ? 2 : 6 * this.operation_point_count) + 9) Log.warn("BoxParser", "Mismatch in " + this.grouping_type + " sample group length"), this.data = stream.readUint8Array(this.description_length - 2); else { if (1 === this.operation_point_count) this.target_rate_share = stream.readUint16(); else { this.target_rate_share = [], this.available_bitrate = []; for (var i = 0; i < this.operation_point_count; i++) this.available_bitrate[i] = stream.readUint32(), this.target_rate_share[i] = stream.readUint16(); } this.maximum_bitrate = stream.readUint32(), this.minimum_bitrate = stream.readUint32(), this.discard_priority = stream.readUint8(); } })), BoxParser.createSampleGroupCtor("roll", (function(stream) { this.roll_distance = stream.readInt16(); })), BoxParser.SampleGroupEntry.prototype.parse = function(stream) { Log.warn("BoxParser", "Unknown Sample Group type: " + this.grouping_type), this.data = stream.readUint8Array(this.description_length); }, BoxParser.createSampleGroupCtor("scif", (function(stream) { Log.warn("BoxParser", "Sample Group type: " + this.grouping_type + " not fully parsed"); })), BoxParser.createSampleGroupCtor("scnm", (function(stream) { Log.warn("BoxParser", "Sample Group type: " + this.grouping_type + " not fully parsed"); })), BoxParser.createSampleGroupCtor("seig", (function(stream) { this.reserved = stream.readUint8(); var tmp = stream.readUint8(); this.crypt_byte_block = tmp >> 4, this.skip_byte_block = 15 & tmp, this.isProtected = stream.readUint8(), this.Per_Sample_IV_Size = stream.readUint8(), this.KID = BoxParser.parseHex16(stream), this.constant_IV_size = 0, this.constant_IV = 0, 1 === this.isProtected && 0 === this.Per_Sample_IV_Size && (this.constant_IV_size = stream.readUint8(), this.constant_IV = stream.readUint8Array(this.constant_IV_size)); })), BoxParser.createSampleGroupCtor("stsa", (function(stream) { Log.warn("BoxParser", "Sample Group type: " + this.grouping_type + " not fully parsed"); })), BoxParser.createSampleGroupCtor("sync", (function(stream) { var tmp_byte = stream.readUint8(); this.NAL_unit_type = 63 & tmp_byte; })), BoxParser.createSampleGroupCtor("tele", (function(stream) { var tmp_byte = stream.readUint8(); this.level_independently_decodable = tmp_byte >> 7; })), BoxParser.createSampleGroupCtor("tsas", (function(stream) { Log.warn("BoxParser", "Sample Group type: " + this.grouping_type + " not fully parsed"); })), BoxParser.createSampleGroupCtor("tscl", (function(stream) { Log.warn("BoxParser", "Sample Group type: " + this.grouping_type + " not fully parsed"); })), BoxParser.createSampleGroupCtor("vipr", (function(stream) { Log.warn("BoxParser", "Sample Group type: " + this.grouping_type + " not fully parsed"); })), BoxParser.createFullBoxCtor("sbgp", (function(stream) { this.grouping_type = stream.readString(4), 1 === this.version ? this.grouping_type_parameter = stream.readUint32() : this.grouping_type_parameter = 0, this.entries = []; for (var entry_count = stream.readUint32(), i = 0; i < entry_count; i++) { var entry = {}; this.entries.push(entry), entry.sample_count = stream.readInt32(), entry.group_description_index = stream.readInt32(); } })), BoxParser.createFullBoxCtor("schm", (function(stream) { this.scheme_type = stream.readString(4), this.scheme_version = stream.readUint32(), 1 & this.flags && (this.scheme_uri = stream.readString(this.size - this.hdr_size - 8)); })), BoxParser.createBoxCtor("sdp ", (function(stream) { this.sdptext = stream.readString(this.size - this.hdr_size); })), BoxParser.createFullBoxCtor("sdtp", (function(stream) { var tmp_byte, count = this.size - this.hdr_size; this.is_leading = [], this.sample_depends_on = [], this.sample_is_depended_on = [], this.sample_has_redundancy = []; for (var i = 0; i < count; i++) tmp_byte = stream.readUint8(), this.is_leading[i] = tmp_byte >> 6, this.sample_depends_on[i] = tmp_byte >> 4 & 3, this.sample_is_depended_on[i] = tmp_byte >> 2 & 3, this.sample_has_redundancy[i] = 3 & tmp_byte; })), BoxParser.createFullBoxCtor("senc"), BoxParser.createFullBoxCtor("sgpd", (function(stream) { this.grouping_type = stream.readString(4), Log.debug("BoxParser", "Found Sample Groups of type " + this.grouping_type), 1 === this.version ? this.default_length = stream.readUint32() : this.default_length = 0, this.version >= 2 && (this.default_group_description_index = stream.readUint32()), this.entries = []; for (var entry_count = stream.readUint32(), i = 0; i < entry_count; i++) { var entry; entry = BoxParser[this.grouping_type + "SampleGroupEntry"] ? new BoxParser[this.grouping_type + "SampleGroupEntry"](this.grouping_type) : new BoxParser.SampleGroupEntry(this.grouping_type), this.entries.push(entry), 1 === this.version && 0 === this.default_length ? entry.description_length = stream.readUint32() : entry.description_length = this.default_length, entry.write === BoxParser.SampleGroupEntry.prototype.write && (Log.info("BoxParser", "SampleGroup for type " + this.grouping_type + " writing not yet implemented, keeping unparsed data in memory for later write"), entry.data = stream.readUint8Array(entry.description_length), stream.position -= entry.description_length), entry.parse(stream); } })), BoxParser.createFullBoxCtor("sidx", (function(stream) { this.reference_ID = stream.readUint32(), this.timescale = stream.readUint32(), 0 === this.version ? (this.earliest_presentation_time = stream.readUint32(), this.first_offset = stream.readUint32()) : (this.earliest_presentation_time = stream.readUint64(), this.first_offset = stream.readUint64()), stream.readUint16(), this.references = []; for (var count = stream.readUint16(), i = 0; i < count; i++) { var ref = {}; this.references.push(ref); var tmp_32 = stream.readUint32(); ref.reference_type = tmp_32 >> 31 & 1, ref.referenced_size = 2147483647 & tmp_32, ref.subsegment_duration = stream.readUint32(), tmp_32 = stream.readUint32(), ref.starts_with_SAP = tmp_32 >> 31 & 1, ref.SAP_type = tmp_32 >> 28 & 7, ref.SAP_delta_time = 268435455 & tmp_32; } })), BoxParser.SingleItemTypeReferenceBox = function(type, size, hdr_size, start) { BoxParser.Box.call(this, type, size), this.hdr_size = hdr_size, this.start = start; }, BoxParser.SingleItemTypeReferenceBox.prototype = new BoxParser.Box, BoxParser.SingleItemTypeReferenceBox.prototype.parse = function(stream) { this.from_item_ID = stream.readUint16(); var count = stream.readUint16(); this.references = []; for (var i = 0; i < count; i++) this.references[i] = stream.readUint16(); }, BoxParser.SingleItemTypeReferenceBoxLarge = function(type, size, hdr_size, start) { BoxParser.Box.call(this, type, size), this.hdr_size = hdr_size, this.start = start; }, BoxParser.SingleItemTypeReferenceBoxLarge.prototype = new BoxParser.Box, BoxParser.SingleItemTypeReferenceBoxLarge.prototype.parse = function(stream) { this.from_item_ID = stream.readUint32(); var count = stream.readUint16(); this.references = []; for (var i = 0; i < count; i++) this.references[i] = stream.readUint32(); }, BoxParser.createFullBoxCtor("SmDm", (function(stream) { this.primaryRChromaticity_x = stream.readUint16(), this.primaryRChromaticity_y = stream.readUint16(), this.primaryGChromaticity_x = stream.readUint16(), this.primaryGChromaticity_y = stream.readUint16(), this.primaryBChromaticity_x = stream.readUint16(), this.primaryBChromaticity_y = stream.readUint16(), this.whitePointChromaticity_x = stream.readUint16(), this.whitePointChromaticity_y = stream.readUint16(), this.luminanceMax = stream.readUint32(), this.luminanceMin = stream.readUint32(); })), BoxParser.createFullBoxCtor("smhd", (function(stream) { this.balance = stream.readUint16(), stream.readUint16(); })), BoxParser.createFullBoxCtor("ssix", (function(stream) { this.subsegments = []; for (var subsegment_count = stream.readUint32(), i = 0; i < subsegment_count; i++) { var subsegment = {}; this.subsegments.push(subsegment), subsegment.ranges = []; for (var range_count = stream.readUint32(), j = 0; j < range_count; j++) { var range = {}; subsegment.ranges.push(range), range.level = stream.readUint8(), range.range_size = stream.readUint24(); } } })), BoxParser.createFullBoxCtor("stco", (function(stream) { var entry_count; if (entry_count = stream.readUint32(), this.chunk_offsets = [], 0 === this.version) for (var i = 0; i < entry_count; i++) this.chunk_offsets.push(stream.readUint32()); })), BoxParser.createFullBoxCtor("stdp", (function(stream) { var count = (this.size - this.hdr_size) / 2; this.priority = []; for (var i = 0; i < count; i++) this.priority[i] = stream.readUint16(); })), BoxParser.createFullBoxCtor("sthd"), BoxParser.createFullBoxCtor("stri", (function(stream) { this.switch_group = stream.readUint16(), this.alternate_group = stream.readUint16(), this.sub_track_id = stream.readUint32(); var count = (this.size - this.hdr_size - 8) / 4; this.attribute_list = []; for (var i = 0; i < count; i++) this.attribute_list[i] = stream.readUint32(); })), BoxParser.createFullBoxCtor("stsc", (function(stream) { var entry_count, i; if (entry_count = stream.readUint32(), this.first_chunk = [], this.samples_per_chunk = [], this.sample_description_index = [], 0 === this.version) for (i = 0; i < entry_count; i++) this.first_chunk.push(stream.readUint32()), this.samples_per_chunk.push(stream.readUint32()), this.sample_description_index.push(stream.readUint32()); })), BoxParser.createFullBoxCtor("stsd", (function(stream) { var i, ret, entryCount, box; for (this.entries = [], entryCount = stream.readUint32(), i = 1; i <= entryCount; i++) { if ((ret = BoxParser.parseOneBox(stream, !0, this.size - (stream.getPosition() - this.start))).code !== BoxParser.OK) return; BoxParser[ret.type + "SampleEntry"] ? ((box = new BoxParser[ret.type + "SampleEntry"](ret.size)).hdr_size = ret.hdr_size, box.start = ret.start) : (Log.warn("BoxParser", "Unknown sample entry type: " + ret.type), box = new BoxParser.SampleEntry(ret.type, ret.size, ret.hdr_size, ret.start)), box.write === BoxParser.SampleEntry.prototype.write && (Log.info("BoxParser", "SampleEntry " + box.type + " box writing not yet implemented, keeping unparsed data in memory for later write"), box.parseDataAndRewind(stream)), box.parse(stream), this.entries.push(box); } })), BoxParser.createFullBoxCtor("stsg", (function(stream) { this.grouping_type = stream.readUint32(); var count = stream.readUint16(); this.group_description_index = []; for (var i = 0; i < count; i++) this.group_description_index[i] = stream.readUint32(); })), BoxParser.createFullBoxCtor("stsh", (function(stream) { var entry_count, i; if (entry_count = stream.readUint32(), this.shadowed_sample_numbers = [], this.sync_sample_numbers = [], 0 === this.version) for (i = 0; i < entry_count; i++) this.shadowed_sample_numbers.push(stream.readUint32()), this.sync_sample_numbers.push(stream.readUint32()); })), BoxParser.createFullBoxCtor("stss", (function(stream) { var i, entry_count; if (entry_count = stream.readUint32(), 0 === this.version) for (this.sample_numbers = [], i = 0; i < entry_count; i++) this.sample_numbers.push(stream.readUint32()); })), BoxParser.createFullBoxCtor("stsz", (function(stream) { var i; if (this.sample_sizes = [], 0 === this.version) for (this.sample_size = stream.readUint32(), this.sample_count = stream.readUint32(), i = 0; i < this.sample_count; i++) 0 === this.sample_size ? this.sample_sizes.push(stream.readUint32()) : this.sample_sizes[i] = this.sample_size; })), BoxParser.createFullBoxCtor("stts", (function(stream) { var entry_count, i, delta; if (entry_count = stream.readUint32(), this.sample_counts = [], this.sample_deltas = [], 0 === this.version) for (i = 0; i < entry_count; i++) this.sample_counts.push(stream.readUint32()), (delta = stream.readInt32()) < 0 && (Log.warn("BoxParser", "File uses negative stts sample delta, using value 1 instead, sync may be lost!"), delta = 1), this.sample_deltas.push(delta); })), BoxParser.createFullBoxCtor("stvi", (function(stream) { var tmp32 = stream.readUint32(); this.single_view_allowed = 3 & tmp32, this.stereo_scheme = stream.readUint32(); var ret, box, length = stream.readUint32(); for (this.stereo_indication_type = stream.readString(length), this.boxes = []; stream.getPosition() < this.start + this.size; ) { if ((ret = BoxParser.parseOneBox(stream, !1, this.size - (stream.getPosition() - this.start))).code !== BoxParser.OK) return; box = ret.box, this.boxes.push(box), this[box.type] = box; } })), BoxParser.createBoxCtor("styp", (function(stream) { BoxParser.ftypBox.prototype.parse.call(this, stream); })), BoxParser.createFullBoxCtor("stz2", (function(stream) { var i, sample_count; if (this.sample_sizes = [], 0 === this.version) if (this.reserved = stream.readUint24(), this.field_size = stream.readUint8(), sample_count = stream.readUint32(), 4 === this.field_size) for (i = 0; i < sample_count; i += 2) { var tmp = stream.readUint8(); this.sample_sizes[i] = tmp >> 4 & 15, this.sample_sizes[i + 1] = 15 & tmp; } else if (8 === this.field_size) for (i = 0; i < sample_count; i++) this.sample_sizes[i] = stream.readUint8(); else if (16 === this.field_size) for (i = 0; i < sample_count; i++) this.sample_sizes[i] = stream.readUint16(); else Log.error("BoxParser", "Error in length field in stz2 box"); })), BoxParser.createFullBoxCtor("subs", (function(stream) { var i, j, entry_count, subsample_count; for (entry_count = stream.readUint32(), this.entries = [], i = 0; i < entry_count; i++) { var sampleInfo = {}; if (this.entries[i] = sampleInfo, sampleInfo.sample_delta = stream.readUint32(), sampleInfo.subsamples = [], (subsample_count = stream.readUint16()) > 0) for (j = 0; j < subsample_count; j++) { var subsample = {}; sampleInfo.subsamples.push(subsample), 1 == this.version ? subsample.size = stream.readUint32() : subsample.size = stream.readUint16(), subsample.priority = stream.readUint8(), subsample.discardable = stream.readUint8(), subsample.codec_specific_parameters = stream.readUint32(); } } })), BoxParser.createFullBoxCtor("tenc", (function(stream) { if (stream.readUint8(), 0 === this.version) stream.readUint8(); else { var tmp = stream.readUint8(); this.default_crypt_byte_block = tmp >> 4 & 15, this.default_skip_byte_block = 15 & tmp; } this.default_isProtected = stream.readUint8(), this.default_Per_Sample_IV_Size = stream.readUint8(), this.default_KID = BoxParser.parseHex16(stream), 1 === this.default_isProtected && 0 === this.default_Per_Sample_IV_Size && (this.default_constant_IV_size = stream.readUint8(), this.default_constant_IV = stream.readUint8Array(this.default_constant_IV_size)); })), BoxParser.createFullBoxCtor("tfdt", (function(stream) { 1 == this.version ? this.baseMediaDecodeTime = stream.readUint64() : this.baseMediaDecodeTime = stream.readUint32(); })), BoxParser.createFullBoxCtor("tfhd", (function(stream) { var readBytes = 0; this.track_id = stream.readUint32(), this.size - this.hdr_size > readBytes && this.flags & BoxParser.TFHD_FLAG_BASE_DATA_OFFSET ? (this.base_data_offset = stream.readUint64(), readBytes += 8) : this.base_data_offset = 0, this.size - this.hdr_size > readBytes && this.flags & BoxParser.TFHD_FLAG_SAMPLE_DESC ? (this.default_sample_description_index = stream.readUint32(), readBytes += 4) : this.default_sample_description_index = 0, this.size - this.hdr_size > readBytes && this.flags & BoxParser.TFHD_FLAG_SAMPLE_DUR ? (this.default_sample_duration = stream.readUint32(), readBytes += 4) : this.default_sample_duration = 0, this.size - this.hdr_size > readBytes && this.flags & BoxParser.TFHD_FLAG_SAMPLE_SIZE ? (this.default_sample_size = stream.readUint32(), readBytes += 4) : this.default_sample_size = 0, this.size - this.hdr_size > readBytes && this.flags & BoxParser.TFHD_FLAG_SAMPLE_FLAGS ? (this.default_sample_flags = stream.readUint32(), readBytes += 4) : this.default_sample_flags = 0; })), BoxParser.createFullBoxCtor("tfra", (function(stream) { this.track_ID = stream.readUint32(), stream.readUint24(); var tmp_byte = stream.readUint8(); this.length_size_of_traf_num = tmp_byte >> 4 & 3, this.length_size_of_trun_num = tmp_byte >> 2 & 3, this.length_size_of_sample_num = 3 & tmp_byte, this.entries = []; for (var number_of_entries = stream.readUint32(), i = 0; i < number_of_entries; i++) 1 === this.version ? (this.time = stream.readUint64(), this.moof_offset = stream.readUint64()) : (this.time = stream.readUint32(), this.moof_offset = stream.readUint32()), this.traf_number = stream["readUint" + 8 * (this.length_size_of_traf_num + 1)](), this.trun_number = stream["readUint" + 8 * (this.length_size_of_trun_num + 1)](), this.sample_number = stream["readUint" + 8 * (this.length_size_of_sample_num + 1)](); })), BoxParser.createFullBoxCtor("tkhd", (function(stream) { 1 == this.version ? (this.creation_time = stream.readUint64(), this.modification_time = stream.readUint64(), this.track_id = stream.readUint32(), stream.readUint32(), this.duration = stream.readUint64()) : (this.creation_time = stream.readUint32(), this.modification_time = stream.readUint32(), this.track_id = stream.readUint32(), stream.readUint32(), this.duration = stream.readUint32()), stream.readUint32Array(2), this.layer = stream.readInt16(), this.alternate_group = stream.readInt16(), this.volume = stream.readInt16() >> 8, stream.readUint16(), this.matrix = stream.readInt32Array(9), this.width = stream.readUint32(), this.height = stream.readUint32(); })), BoxParser.createBoxCtor("tmax", (function(stream) { this.time = stream.readUint32(); })), BoxParser.createBoxCtor("tmin", (function(stream) { this.time = stream.readUint32(); })), BoxParser.createBoxCtor("totl", (function(stream) { this.bytessent = stream.readUint32(); })), BoxParser.createBoxCtor("tpay", (function(stream) { this.bytessent = stream.readUint32(); })), BoxParser.createBoxCtor("tpyl", (function(stream) { this.bytessent = stream.readUint64(); })), BoxParser.TrackGroupTypeBox.prototype.parse = function(stream) { this.parseFullHeader(stream), this.track_group_id = stream.readUint32(); }, BoxParser.createTrackGroupCtor("msrc"), BoxParser.TrackReferenceTypeBox = function(type, size, hdr_size, start) { BoxParser.Box.call(this, type, size), this.hdr_size = hdr_size, this.start = start; }, BoxParser.TrackReferenceTypeBox.prototype = new BoxParser.Box, BoxParser.TrackReferenceTypeBox.prototype.parse = function(stream) { this.track_ids = stream.readUint32Array((this.size - this.hdr_size) / 4); }, BoxParser.trefBox.prototype.parse = function(stream) { for (var ret, box; stream.getPosition() < this.start + this.size; ) { if ((ret = BoxParser.parseOneBox(stream, !0, this.size - (stream.getPosition() - this.start))).code !== BoxParser.OK) return; (box = new BoxParser.TrackReferenceTypeBox(ret.type, ret.size, ret.hdr_size, ret.start)).write === BoxParser.Box.prototype.write && "mdat" !== box.type && (Log.info("BoxParser", "TrackReference " + box.type + " box writing not yet implemented, keeping unparsed data in memory for later write"), box.parseDataAndRewind(stream)), box.parse(stream), this.boxes.push(box); } }, BoxParser.createFullBoxCtor("trep", (function(stream) { for (this.track_ID = stream.readUint32(), this.boxes = []; stream.getPosition() < this.start + this.size; ) { if (ret = BoxParser.parseOneBox(stream, !1, this.size - (stream.getPosition() - this.start)), ret.code !== BoxParser.OK) return; box = ret.box, this.boxes.push(box); } })), BoxParser.createFullBoxCtor("trex", (function(stream) { this.track_id = stream.readUint32(), this.default_sample_description_index = stream.readUint32(), this.default_sample_duration = stream.readUint32(), this.default_sample_size = stream.readUint32(), this.default_sample_flags = stream.readUint32(); })), BoxParser.createBoxCtor("trpy", (function(stream) { this.bytessent = stream.readUint64(); })), BoxParser.createFullBoxCtor("trun", (function(stream) { var readBytes = 0; if (this.sample_count = stream.readUint32(), readBytes += 4, this.size - this.hdr_size > readBytes && this.flags & BoxParser.TRUN_FLAGS_DATA_OFFSET ? (this.data_offset = stream.readInt32(), readBytes += 4) : this.data_offset = 0, this.size - this.hdr_size > readBytes && this.flags & BoxParser.TRUN_FLAGS_FIRST_FLAG ? (this.first_sample_flags = stream.readUint32(), readBytes += 4) : this.first_sample_flags = 0, this.sample_duration = [], this.sample_size = [], this.sample_flags = [], this.sample_composition_time_offset = [], this.size - this.hdr_size > readBytes) for (var i = 0; i < this.sample_count; i++) this.flags & BoxParser.TRUN_FLAGS_DURATION && (this.sample_duration[i] = stream.readUint32()), this.flags & BoxParser.TRUN_FLAGS_SIZE && (this.sample_size[i] = stream.readUint32()), this.flags & BoxParser.TRUN_FLAGS_FLAGS && (this.sample_flags[i] = stream.readUint32()), this.flags & BoxParser.TRUN_FLAGS_CTS_OFFSET && (0 === this.version ? this.sample_composition_time_offset[i] = stream.readUint32() : this.sample_composition_time_offset[i] = stream.readInt32()); })), BoxParser.createFullBoxCtor("tsel", (function(stream) { this.switch_group = stream.readUint32(); var count = (this.size - this.hdr_size - 4) / 4; this.attribute_list = []; for (var i = 0; i < count; i++) this.attribute_list[i] = stream.readUint32(); })), BoxParser.createFullBoxCtor("txtC", (function(stream) { this.config = stream.readCString(); })), BoxParser.createFullBoxCtor("url ", (function(stream) { 1 !== this.flags && (this.location = stream.readCString()); })), BoxParser.createFullBoxCtor("urn ", (function(stream) { this.name = stream.readCString(), this.size - this.hdr_size - this.name.length - 1 > 0 && (this.location = stream.readCString()); })), BoxParser.createUUIDBox("a5d40b30e81411ddba2f0800200c9a66", !0, !1, (function(stream) { this.LiveServerManifest = stream.readString(this.size - this.hdr_size).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); })), BoxParser.createUUIDBox("d08a4f1810f34a82b6c832d8aba183d3", !0, !1, (function(stream) { this.system_id = BoxParser.parseHex16(stream); var datasize = stream.readUint32(); datasize > 0 && (this.data = stream.readUint8Array(datasize)); })), BoxParser.createUUIDBox("a2394f525a9b4f14a2446c427c648df4", !0, !1), BoxParser.createUUIDBox("8974dbce7be74c5184f97148f9882554", !0, !1, (function(stream) { this.default_AlgorithmID = stream.readUint24(), this.default_IV_size = stream.readUint8(), this.default_KID = BoxParser.parseHex16(stream); })), BoxParser.createUUIDBox("d4807ef2ca3946958e5426cb9e46a79f", !0, !1, (function(stream) { this.fragment_count = stream.readUint8(), this.entries = []; for (var i = 0; i < this.fragment_count; i++) { var entry = {}, absolute_time = 0, absolute_duration = 0; 1 === this.version ? (absolute_time = stream.readUint64(), absolute_duration = stream.readUint64()) : (absolute_time = stream.readUint32(), absolute_duration = stream.readUint32()), entry.absolute_time = absolute_time, entry.absolute_duration = absolute_duration, this.entries.push(entry); } })), BoxParser.createUUIDBox("6d1d9b0542d544e680e2141daff757b2", !0, !1, (function(stream) { 1 === this.version ? (this.absolute_time = stream.readUint64(), this.duration = stream.readUint64()) : (this.absolute_time = stream.readUint32(), this.duration = stream.readUint32()); })), BoxParser.createFullBoxCtor("vmhd", (function(stream) { this.graphicsmode = stream.readUint16(), this.opcolor = stream.readUint16Array(3); })), BoxParser.createFullBoxCtor("vpcC", (function(stream) { var tmp; 1 === this.version ? (this.profile = stream.readUint8(), this.level = stream.readUint8(), tmp = stream.readUint8(), this.bitDepth = tmp >> 4, this.chromaSubsampling = tmp >> 1 & 7, this.videoFullRangeFlag = 1 & tmp, this.colourPrimaries = stream.readUint8(), this.transferCharacteristics = stream.readUint8(), this.matrixCoefficients = stream.readUint8(), this.codecIntializationDataSize = stream.readUint16(), this.codecIntializationData = stream.readUint8Array(this.codecIntializationDataSize)) : (this.profile = stream.readUint8(), this.level = stream.readUint8(), tmp = stream.readUint8(), this.bitDepth = tmp >> 4 & 15, this.colorSpace = 15 & tmp, tmp = stream.readUint8(), this.chromaSubsampling = tmp >> 4 & 15, this.transferFunction = tmp >> 1 & 7, this.videoFullRangeFlag = 1 & tmp, this.codecIntializationDataSize = stream.readUint16(), this.codecIntializationData = stream.readUint8Array(this.codecIntializationDataSize)); })), BoxParser.createBoxCtor("vttC", (function(stream) { this.text = stream.readString(this.size - this.hdr_size); })), BoxParser.SampleEntry.prototype.isVideo = function() { return !1; }, BoxParser.SampleEntry.prototype.isAudio = function() { return !1; }, BoxParser.SampleEntry.prototype.isSubtitle = function() { return !1; }, BoxParser.SampleEntry.prototype.isMetadata = function() { return !1; }, BoxParser.SampleEntry.prototype.isHint = function() { return !1; }, BoxParser.SampleEntry.prototype.getCodec = function() { return this.type.replace(".", ""); }, BoxParser.SampleEntry.prototype.getWidth = function() { return ""; }, BoxParser.SampleEntry.prototype.getHeight = function() { return ""; }, BoxParser.SampleEntry.prototype.getChannelCount = function() { return ""; }, BoxParser.SampleEntry.prototype.getSampleRate = function() { return ""; }, BoxParser.SampleEntry.prototype.getSampleSize = function() { return ""; }, BoxParser.VisualSampleEntry.prototype.isVideo = function() { return !0; }, BoxParser.VisualSampleEntry.prototype.getWidth = function() { return this.width; }, BoxParser.VisualSampleEntry.prototype.getHeight = function() { return this.height; }, BoxParser.AudioSampleEntry.prototype.isAudio = function() { return !0; }, BoxParser.AudioSampleEntry.prototype.getChannelCount = function() { return this.channel_count; }, BoxParser.AudioSampleEntry.prototype.getSampleRate = function() { return this.samplerate; }, BoxParser.AudioSampleEntry.prototype.getSampleSize = function() { return this.samplesize; }, BoxParser.SubtitleSampleEntry.prototype.isSubtitle = function() { return !0; }, BoxParser.MetadataSampleEntry.prototype.isMetadata = function() { return !0; }, BoxParser.decimalToHex = function(d, padding) { var hex = Number(d).toString(16); for (padding = null == padding ? padding = 2 : padding; hex.length < padding; ) hex = "0" + hex; return hex; }, BoxParser.avc1SampleEntry.prototype.getCodec = BoxParser.avc2SampleEntry.prototype.getCodec = BoxParser.avc3SampleEntry.prototype.getCodec = BoxParser.avc4SampleEntry.prototype.getCodec = function() { var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); return this.avcC ? baseCodec + "." + BoxParser.decimalToHex(this.avcC.AVCProfileIndication) + BoxParser.decimalToHex(this.avcC.profile_compatibility) + BoxParser.decimalToHex(this.avcC.AVCLevelIndication) : baseCodec; }, BoxParser.hev1SampleEntry.prototype.getCodec = BoxParser.hvc1SampleEntry.prototype.getCodec = function() { var i, baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); if (this.hvcC) { switch (baseCodec += ".", this.hvcC.general_profile_space) { case 0: baseCodec += ""; break; case 1: baseCodec += "A"; break; case 2: baseCodec += "B"; break; case 3: baseCodec += "C"; } baseCodec += this.hvcC.general_profile_idc, baseCodec += "."; var val = this.hvcC.general_profile_compatibility, reversed = 0; for (i = 0; i < 32 && (reversed |= 1 & val, 31 != i); i++) reversed <<= 1, val >>= 1; baseCodec += BoxParser.decimalToHex(reversed, 0), baseCodec += ".", 0 === this.hvcC.general_tier_flag ? baseCodec += "L" : baseCodec += "H", baseCodec += this.hvcC.general_level_idc; var hasByte = !1, constraint_string = ""; for (i = 5; i >= 0; i--) (this.hvcC.general_constraint_indicator[i] || hasByte) && (constraint_string = "." + BoxParser.decimalToHex(this.hvcC.general_constraint_indicator[i], 0) + constraint_string, hasByte = !0); baseCodec += constraint_string; } return baseCodec; }, BoxParser.mp4aSampleEntry.prototype.getCodec = function() { var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); if (this.esds && this.esds.esd) { var oti = this.esds.esd.getOTI(), dsi = this.esds.esd.getAudioConfig(); return baseCodec + "." + BoxParser.decimalToHex(oti) + (dsi ? "." + dsi : ""); } return baseCodec; }, BoxParser.stxtSampleEntry.prototype.getCodec = function() { var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); return this.mime_format ? baseCodec + "." + this.mime_format : baseCodec; }, BoxParser.av01SampleEntry.prototype.getCodec = function() { var bitdepth, baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); return 2 === this.av1C.seq_profile && 1 === this.av1C.high_bitdepth ? bitdepth = 1 === this.av1C.twelve_bit ? 12 : 10 : this.av1C.seq_profile <= 2 && (bitdepth = 1 === this.av1C.high_bitdepth ? 10 : 8), baseCodec + "." + this.av1C.seq_profile + "." + this.av1C.seq_level_idx_0 + (this.av1C.seq_tier_0 ? "H" : "M") + "." + bitdepth + "." + this.av1C.monochrome + "." + this.av1C.chroma_subsampling_x + this.av1C.chroma_subsampling_y + this.av1C.chroma_sample_position; }, BoxParser.Box.prototype.writeHeader = function(stream, msg) { this.size += 8, this.size > MAX_SIZE && (this.size += 8), "uuid" === this.type && (this.size += 16), Log.debug("BoxWriter", "Writing box " + this.type + " of size: " + this.size + " at position " + stream.getPosition() + (msg || "")), this.size > MAX_SIZE ? stream.writeUint32(1) : (this.sizePosition = stream.getPosition(), stream.writeUint32(this.size)), stream.writeString(this.type, null, 4), "uuid" === this.type && stream.writeUint8Array(this.uuid), this.size > MAX_SIZE && stream.writeUint64(this.size); }, BoxParser.FullBox.prototype.writeHeader = function(stream) { this.size += 4, BoxParser.Box.prototype.writeHeader.call(this, stream, " v=" + this.version + " f=" + this.flags), stream.writeUint8(this.version), stream.writeUint24(this.flags); }, BoxParser.Box.prototype.write = function(stream) { "mdat" === this.type ? this.data && (this.size = this.data.length, this.writeHeader(stream), stream.writeUint8Array(this.data)) : (this.size = this.data ? this.data.length : 0, this.writeHeader(stream), this.data && stream.writeUint8Array(this.data)); }, BoxParser.ContainerBox.prototype.write = function(stream) { this.size = 0, this.writeHeader(stream); for (var i = 0; i < this.boxes.length; i++) this.boxes[i] && (this.boxes[i].write(stream), this.size += this.boxes[i].size); Log.debug("BoxWriter", "Adjusting box " + this.type + " with new size " + this.size), stream.adjustUint32(this.sizePosition, this.size); }, BoxParser.TrackReferenceTypeBox.prototype.write = function(stream) { this.size = 4 * this.track_ids.length, this.writeHeader(stream), stream.writeUint32Array(this.track_ids); }, BoxParser.avcCBox.prototype.write = function(stream) { var i; for (this.size = 7, i = 0; i < this.SPS.length; i++) this.size += 2 + this.SPS[i].length; for (i = 0; i < this.PPS.length; i++) this.size += 2 + this.PPS[i].length; for (this.ext && (this.size += this.ext.length), this.writeHeader(stream), stream.writeUint8(this.configurationVersion), stream.writeUint8(this.AVCProfileIndication), stream.writeUint8(this.profile_compatibility), stream.writeUint8(this.AVCLevelIndication), stream.writeUint8(this.lengthSizeMinusOne + 252), stream.writeUint8(this.SPS.length + 224), i = 0; i < this.SPS.length; i++) stream.writeUint16(this.SPS[i].length), stream.writeUint8Array(this.SPS[i].nalu); for (stream.writeUint8(this.PPS.length), i = 0; i < this.PPS.length; i++) stream.writeUint16(this.PPS[i].length), stream.writeUint8Array(this.PPS[i].nalu); this.ext && stream.writeUint8Array(this.ext); }, BoxParser.co64Box.prototype.write = function(stream) { var i; for (this.version = 0, this.flags = 0, this.size = 4 + 8 * this.chunk_offsets.length, this.writeHeader(stream), stream.writeUint32(this.chunk_offsets.length), i = 0; i < this.chunk_offsets.length; i++) stream.writeUint64(this.chunk_offsets[i]); }, BoxParser.cslgBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 20, this.writeHeader(stream), stream.writeInt32(this.compositionToDTSShift), stream.writeInt32(this.leastDecodeToDisplayDelta), stream.writeInt32(this.greatestDecodeToDisplayDelta), stream.writeInt32(this.compositionStartTime), stream.writeInt32(this.compositionEndTime); }, BoxParser.cttsBox.prototype.write = function(stream) { var i; for (this.version = 0, this.flags = 0, this.size = 4 + 8 * this.sample_counts.length, this.writeHeader(stream), stream.writeUint32(this.sample_counts.length), i = 0; i < this.sample_counts.length; i++) stream.writeUint32(this.sample_counts[i]), 1 === this.version ? stream.writeInt32(this.sample_offsets[i]) : stream.writeUint32(this.sample_offsets[i]); }, BoxParser.drefBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 4, this.writeHeader(stream), stream.writeUint32(this.entries.length); for (var i = 0; i < this.entries.length; i++) this.entries[i].write(stream), this.size += this.entries[i].size; Log.debug("BoxWriter", "Adjusting box " + this.type + " with new size " + this.size), stream.adjustUint32(this.sizePosition, this.size); }, BoxParser.elngBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = this.extended_language.length, this.writeHeader(stream), stream.writeString(this.extended_language); }, BoxParser.elstBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 4 + 12 * this.entries.length, this.writeHeader(stream), stream.writeUint32(this.entries.length); for (var i = 0; i < this.entries.length; i++) { var entry = this.entries[i]; stream.writeUint32(entry.segment_duration), stream.writeInt32(entry.media_time), stream.writeInt16(entry.media_rate_integer), stream.writeInt16(entry.media_rate_fraction); } }, BoxParser.emsgBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 16 + this.message_data.length + (this.scheme_id_uri.length + 1) + (this.value.length + 1), this.writeHeader(stream), stream.writeCString(this.scheme_id_uri), stream.writeCString(this.value), stream.writeUint32(this.timescale), stream.writeUint32(this.presentation_time_delta), stream.writeUint32(this.event_duration), stream.writeUint32(this.id), stream.writeUint8Array(this.message_data); }, BoxParser.ftypBox.prototype.write = function(stream) { this.size = 8 + 4 * this.compatible_brands.length, this.writeHeader(stream), stream.writeString(this.major_brand, null, 4), stream.writeUint32(this.minor_version); for (var i = 0; i < this.compatible_brands.length; i++) stream.writeString(this.compatible_brands[i], null, 4); }, BoxParser.hdlrBox.prototype.write = function(stream) { this.size = 20 + this.name.length + 1, this.version = 0, this.flags = 0, this.writeHeader(stream), stream.writeUint32(0), stream.writeString(this.handler, null, 4), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint32(0), stream.writeCString(this.name); }, BoxParser.kindBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = this.schemeURI.length + 1 + (this.value.length + 1), this.writeHeader(stream), stream.writeCString(this.schemeURI), stream.writeCString(this.value); }, BoxParser.mdhdBox.prototype.write = function(stream) { this.size = 20, this.flags = 0, this.version = 0, this.writeHeader(stream), stream.writeUint32(this.creation_time), stream.writeUint32(this.modification_time), stream.writeUint32(this.timescale), stream.writeUint32(this.duration), stream.writeUint16(this.language), stream.writeUint16(0); }, BoxParser.mehdBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 4, this.writeHeader(stream), stream.writeUint32(this.fragment_duration); }, BoxParser.mfhdBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 4, this.writeHeader(stream), stream.writeUint32(this.sequence_number); }, BoxParser.mvhdBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 96, this.writeHeader(stream), stream.writeUint32(this.creation_time), stream.writeUint32(this.modification_time), stream.writeUint32(this.timescale), stream.writeUint32(this.duration), stream.writeUint32(this.rate), stream.writeUint16(this.volume << 8), stream.writeUint16(0), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint32Array(this.matrix), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint32(this.next_track_id); }, BoxParser.SampleEntry.prototype.writeHeader = function(stream) { this.size = 8, BoxParser.Box.prototype.writeHeader.call(this, stream), stream.writeUint8(0), stream.writeUint8(0), stream.writeUint8(0), stream.writeUint8(0), stream.writeUint8(0), stream.writeUint8(0), stream.writeUint16(this.data_reference_index); }, BoxParser.SampleEntry.prototype.writeFooter = function(stream) { for (var i = 0; i < this.boxes.length; i++) this.boxes[i].write(stream), this.size += this.boxes[i].size; Log.debug("BoxWriter", "Adjusting box " + this.type + " with new size " + this.size), stream.adjustUint32(this.sizePosition, this.size); }, BoxParser.SampleEntry.prototype.write = function(stream) { this.writeHeader(stream), stream.writeUint8Array(this.data), this.size += this.data.length, Log.debug("BoxWriter", "Adjusting box " + this.type + " with new size " + this.size), stream.adjustUint32(this.sizePosition, this.size); }, BoxParser.VisualSampleEntry.prototype.write = function(stream) { this.writeHeader(stream), this.size += 70, stream.writeUint16(0), stream.writeUint16(0), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint32(0), stream.writeUint16(this.width), stream.writeUint16(this.height), stream.writeUint32(this.horizresolution), stream.writeUint32(this.vertresolution), stream.writeUint32(0), stream.writeUint16(this.frame_count), stream.writeUint8(Math.min(31, this.compressorname.length)), stream.writeString(this.compressorname, null, 31), stream.writeUint16(this.depth), stream.writeInt16(-1), this.writeFooter(stream); }, BoxParser.AudioSampleEntry.prototype.write = function(stream) { this.writeHeader(stream), this.size += 20, stream.writeUint32(0), stream.writeUint32(0), stream.writeUint16(this.channel_count), stream.writeUint16(this.samplesize), stream.writeUint16(0), stream.writeUint16(0), stream.writeUint32(this.samplerate << 16), this.writeFooter(stream); }, BoxParser.stppSampleEntry.prototype.write = function(stream) { this.writeHeader(stream), this.size += this.namespace.length + 1 + this.schema_location.length + 1 + this.auxiliary_mime_types.length + 1, stream.writeCString(this.namespace), stream.writeCString(this.schema_location), stream.writeCString(this.auxiliary_mime_types), this.writeFooter(stream); }, BoxParser.SampleGroupEntry.prototype.write = function(stream) { stream.writeUint8Array(this.data); }, BoxParser.sbgpBox.prototype.write = function(stream) { this.version = 1, this.flags = 0, this.size = 12 + 8 * this.entries.length, this.writeHeader(stream), stream.writeString(this.grouping_type, null, 4), stream.writeUint32(this.grouping_type_parameter), stream.writeUint32(this.entries.length); for (var i = 0; i < this.entries.length; i++) { var entry = this.entries[i]; stream.writeInt32(entry.sample_count), stream.writeInt32(entry.group_description_index); } }, BoxParser.sgpdBox.prototype.write = function(stream) { var i, entry; for (this.flags = 0, this.size = 12, i = 0; i < this.entries.length; i++) entry = this.entries[i], 1 === this.version && (0 === this.default_length && (this.size += 4), this.size += entry.data.length); for (this.writeHeader(stream), stream.writeString(this.grouping_type, null, 4), 1 === this.version && stream.writeUint32(this.default_length), this.version >= 2 && stream.writeUint32(this.default_sample_description_index), stream.writeUint32(this.entries.length), i = 0; i < this.entries.length; i++) entry = this.entries[i], 1 === this.version && 0 === this.default_length && stream.writeUint32(entry.description_length), entry.write(stream); }, BoxParser.sidxBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 20 + 12 * this.references.length, this.writeHeader(stream), stream.writeUint32(this.reference_ID), stream.writeUint32(this.timescale), stream.writeUint32(this.earliest_presentation_time), stream.writeUint32(this.first_offset), stream.writeUint16(0), stream.writeUint16(this.references.length); for (var i = 0; i < this.references.length; i++) { var ref = this.references[i]; stream.writeUint32(ref.reference_type << 31 | ref.referenced_size), stream.writeUint32(ref.subsegment_duration), stream.writeUint32(ref.starts_with_SAP << 31 | ref.SAP_type << 28 | ref.SAP_delta_time); } }, BoxParser.stcoBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 4 + 4 * this.chunk_offsets.length, this.writeHeader(stream), stream.writeUint32(this.chunk_offsets.length), stream.writeUint32Array(this.chunk_offsets); }, BoxParser.stscBox.prototype.write = function(stream) { var i; for (this.version = 0, this.flags = 0, this.size = 4 + 12 * this.first_chunk.length, this.writeHeader(stream), stream.writeUint32(this.first_chunk.length), i = 0; i < this.first_chunk.length; i++) stream.writeUint32(this.first_chunk[i]), stream.writeUint32(this.samples_per_chunk[i]), stream.writeUint32(this.sample_description_index[i]); }, BoxParser.stsdBox.prototype.write = function(stream) { var i; for (this.version = 0, this.flags = 0, this.size = 0, this.writeHeader(stream), stream.writeUint32(this.entries.length), this.size += 4, i = 0; i < this.entries.length; i++) this.entries[i].write(stream), this.size += this.entries[i].size; Log.debug("BoxWriter", "Adjusting box " + this.type + " with new size " + this.size), stream.adjustUint32(this.sizePosition, this.size); }, BoxParser.stshBox.prototype.write = function(stream) { var i; for (this.version = 0, this.flags = 0, this.size = 4 + 8 * this.shadowed_sample_numbers.length, this.writeHeader(stream), stream.writeUint32(this.shadowed_sample_numbers.length), i = 0; i < this.shadowed_sample_numbers.length; i++) stream.writeUint32(this.shadowed_sample_numbers[i]), stream.writeUint32(this.sync_sample_numbers[i]); }, BoxParser.stssBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 4 + 4 * this.sample_numbers.length, this.writeHeader(stream), stream.writeUint32(this.sample_numbers.length), stream.writeUint32Array(this.sample_numbers); }, BoxParser.stszBox.prototype.write = function(stream) { var i, constant = !0; if (this.version = 0, this.flags = 0, this.sample_sizes.length > 0) for (i = 0; i + 1 < this.sample_sizes.length; ) { if (this.sample_sizes[i + 1] !== this.sample_sizes[0]) { constant = !1; break; } i++; } else constant = !1; this.size = 8, constant || (this.size += 4 * this.sample_sizes.length), this.writeHeader(stream), constant ? stream.writeUint32(this.sample_sizes[0]) : stream.writeUint32(0), stream.writeUint32(this.sample_sizes.length), constant || stream.writeUint32Array(this.sample_sizes); }, BoxParser.sttsBox.prototype.write = function(stream) { var i; for (this.version = 0, this.flags = 0, this.size = 4 + 8 * this.sample_counts.length, this.writeHeader(stream), stream.writeUint32(this.sample_counts.length), i = 0; i < this.sample_counts.length; i++) stream.writeUint32(this.sample_counts[i]), stream.writeUint32(this.sample_deltas[i]); }, BoxParser.tfdtBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 4, 1 === this.version && (this.size += 4), this.writeHeader(stream), 1 === this.version ? stream.writeUint64(this.baseMediaDecodeTime) : stream.writeUint32(this.baseMediaDecodeTime); }, BoxParser.tfhdBox.prototype.write = function(stream) { this.version = 0, this.size = 4, this.flags & BoxParser.TFHD_FLAG_BASE_DATA_OFFSET && (this.size += 8), this.flags & BoxParser.TFHD_FLAG_SAMPLE_DESC && (this.size += 4), this.flags & BoxParser.TFHD_FLAG_SAMPLE_DUR && (this.size += 4), this.flags & BoxParser.TFHD_FLAG_SAMPLE_SIZE && (this.size += 4), this.flags & BoxParser.TFHD_FLAG_SAMPLE_FLAGS && (this.size += 4), this.writeHeader(stream), stream.writeUint32(this.track_id), this.flags & BoxParser.TFHD_FLAG_BASE_DATA_OFFSET && stream.writeUint64(this.base_data_offset), this.flags & BoxParser.TFHD_FLAG_SAMPLE_DESC && stream.writeUint32(this.default_sample_description_index), this.flags & BoxParser.TFHD_FLAG_SAMPLE_DUR && stream.writeUint32(this.default_sample_duration), this.flags & BoxParser.TFHD_FLAG_SAMPLE_SIZE && stream.writeUint32(this.default_sample_size), this.flags & BoxParser.TFHD_FLAG_SAMPLE_FLAGS && stream.writeUint32(this.default_sample_flags); }, BoxParser.tkhdBox.prototype.write = function(stream) { this.version = 0, this.size = 80, this.writeHeader(stream), stream.writeUint32(this.creation_time), stream.writeUint32(this.modification_time), stream.writeUint32(this.track_id), stream.writeUint32(0), stream.writeUint32(this.duration), stream.writeUint32(0), stream.writeUint32(0), stream.writeInt16(this.layer), stream.writeInt16(this.alternate_group), stream.writeInt16(this.volume << 8), stream.writeUint16(0), stream.writeInt32Array(this.matrix), stream.writeUint32(this.width), stream.writeUint32(this.height); }, BoxParser.trexBox.prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = 20, this.writeHeader(stream), stream.writeUint32(this.track_id), stream.writeUint32(this.default_sample_description_index), stream.writeUint32(this.default_sample_duration), stream.writeUint32(this.default_sample_size), stream.writeUint32(this.default_sample_flags); }, BoxParser.trunBox.prototype.write = function(stream) { this.version = 0, this.size = 4, this.flags & BoxParser.TRUN_FLAGS_DATA_OFFSET && (this.size += 4), this.flags & BoxParser.TRUN_FLAGS_FIRST_FLAG && (this.size += 4), this.flags & BoxParser.TRUN_FLAGS_DURATION && (this.size += 4 * this.sample_duration.length), this.flags & BoxParser.TRUN_FLAGS_SIZE && (this.size += 4 * this.sample_size.length), this.flags & BoxParser.TRUN_FLAGS_FLAGS && (this.size += 4 * this.sample_flags.length), this.flags & BoxParser.TRUN_FLAGS_CTS_OFFSET && (this.size += 4 * this.sample_composition_time_offset.length), this.writeHeader(stream), stream.writeUint32(this.sample_count), this.flags & BoxParser.TRUN_FLAGS_DATA_OFFSET && (this.data_offset_position = stream.getPosition(), stream.writeInt32(this.data_offset)), this.flags & BoxParser.TRUN_FLAGS_FIRST_FLAG && stream.writeUint32(this.first_sample_flags); for (var i = 0; i < this.sample_count; i++) this.flags & BoxParser.TRUN_FLAGS_DURATION && stream.writeUint32(this.sample_duration[i]), this.flags & BoxParser.TRUN_FLAGS_SIZE && stream.writeUint32(this.sample_size[i]), this.flags & BoxParser.TRUN_FLAGS_FLAGS && stream.writeUint32(this.sample_flags[i]), this.flags & BoxParser.TRUN_FLAGS_CTS_OFFSET && (0 === this.version ? stream.writeUint32(this.sample_composition_time_offset[i]) : stream.writeInt32(this.sample_composition_time_offset[i])); }, BoxParser["url Box"].prototype.write = function(stream) { this.version = 0, this.location ? (this.flags = 0, this.size = this.location.length + 1) : (this.flags = 1, this.size = 0), this.writeHeader(stream), this.location && stream.writeCString(this.location); }, BoxParser["urn Box"].prototype.write = function(stream) { this.version = 0, this.flags = 0, this.size = this.name.length + 1 + (this.location ? this.location.length + 1 : 0), this.writeHeader(stream), stream.writeCString(this.name), this.location && stream.writeCString(this.location); }, BoxParser.vmhdBox.prototype.write = function(stream) { this.version = 0, this.flags = 1, this.size = 8, this.writeHeader(stream), stream.writeUint16(this.graphicsmode), stream.writeUint16Array(this.opcolor); }, BoxParser.cttsBox.prototype.unpack = function(samples) { var i, j, k; for (k = 0, i = 0; i < this.sample_counts.length; i++) for (j = 0; j < this.sample_counts[i]; j++) samples[k].pts = samples[k].dts + this.sample_offsets[i], k++; }, BoxParser.sttsBox.prototype.unpack = function(samples) { var i, j, k; for (k = 0, i = 0; i < this.sample_counts.length; i++) for (j = 0; j < this.sample_counts[i]; j++) samples[k].dts = 0 === k ? 0 : samples[k - 1].dts + this.sample_deltas[i], k++; }, BoxParser.stcoBox.prototype.unpack = function(samples) { var i; for (i = 0; i < this.chunk_offsets.length; i++) samples[i].offset = this.chunk_offsets[i]; }, BoxParser.stscBox.prototype.unpack = function(samples) { var i, j, k, l, m; for (l = 0, m = 0, i = 0; i < this.first_chunk.length; i++) for (j = 0; j < (i + 1 < this.first_chunk.length ? this.first_chunk[i + 1] : 1 / 0); j++) for (m++, k = 0; k < this.samples_per_chunk[i]; k++) { if (!samples[l]) return; samples[l].description_index = this.sample_description_index[i], samples[l].chunk_index = m, l++; } }, BoxParser.stszBox.prototype.unpack = function(samples) { var i; for (i = 0; i < this.sample_sizes.length; i++) samples[i].size = this.sample_sizes[i]; }, BoxParser.DIFF_BOXES_PROP_NAMES = [ "boxes", "entries", "references", "subsamples", "items", "item_infos", "extents", "associations", "subsegments", "ranges", "seekLists", "seekPoints", "esd", "levels" ], BoxParser.DIFF_PRIMITIVE_ARRAY_PROP_NAMES = [ "compatible_brands", "matrix", "opcolor", "sample_counts", "sample_counts", "sample_deltas", "first_chunk", "samples_per_chunk", "sample_sizes", "chunk_offsets", "sample_offsets", "sample_description_index", "sample_duration" ], BoxParser.boxEqualFields = function(box_a, box_b) { if (box_a && !box_b) return !1; var prop; for (prop in box_a) if (!(BoxParser.DIFF_BOXES_PROP_NAMES.indexOf(prop) > -1 || box_a[prop] instanceof BoxParser.Box || box_b[prop] instanceof BoxParser.Box || void 0 === box_a[prop] || void 0 === box_b[prop] || "function" == typeof box_a[prop] || "function" == typeof box_b[prop] || box_a.subBoxNames && box_a.subBoxNames.indexOf(prop.slice(0, 4)) > -1 || box_b.subBoxNames && box_b.subBoxNames.indexOf(prop.slice(0, 4)) > -1 || "data" === prop || "start" === prop || "size" === prop || "creation_time" === prop || "modification_time" === prop || BoxParser.DIFF_PRIMITIVE_ARRAY_PROP_NAMES.indexOf(prop) > -1 || box_a[prop] === box_b[prop])) return !1; return !0; }, BoxParser.boxEqual = function(box_a, box_b) { if (!BoxParser.boxEqualFields(box_a, box_b)) return !1; for (var j = 0; j < BoxParser.DIFF_BOXES_PROP_NAMES.length; j++) { var name = BoxParser.DIFF_BOXES_PROP_NAMES[j]; if (box_a[name] && box_b[name] && !BoxParser.boxEqual(box_a[name], box_b[name])) return !1; } return !0; }; var VTTin4Parser = function() {}; VTTin4Parser.prototype.parseSample = function(data) { var cues, cue, stream = new MP4BoxStream(data.buffer); for (cues = []; !stream.isEos(); ) (cue = BoxParser.parseOneBox(stream, !1)).code === BoxParser.OK && "vttc" === cue.box.type && cues.push(cue.box); return cues; }, VTTin4Parser.prototype.getText = function(startTime, endTime, data) { function pad(n, width, z) { return z = z || "0", (n += "").length >= width ? n : new Array(width - n.length + 1).join(z) + n; } function secToTimestamp(insec) { var h = Math.floor(insec / 3600), m = Math.floor((insec - 3600 * h) / 60), s = Math.floor(insec - 3600 * h - 60 * m), ms = Math.floor(1e3 * (insec - 3600 * h - 60 * m - s)); return pad(h, 2) + ":" + pad(m, 2) + ":" + pad(s, 2) + "." + pad(ms, 3); } for (var cues = this.parseSample(data), string = "", i = 0; i < cues.length; i++) { var cueIn4 = cues[i]; string += secToTimestamp(startTime) + " --\x3e " + secToTimestamp(endTime) + "\r\n", string += cueIn4.payl.text; } return string; }; var XMLSubtitlein4Parser = function() {}; XMLSubtitlein4Parser.prototype.parseSample = function(sample) { var i, res = { resources: [] }, stream = new MP4BoxStream(sample.data.buffer); if (sample.subsamples && 0 !== sample.subsamples.length) { if (res.documentString = stream.readString(sample.subsamples[0].size), sample.subsamples.length > 1) for (i = 1; i < sample.subsamples.length; i++) res.resources[i] = stream.readUint8Array(sample.subsamples[i].size); } else res.documentString = stream.readString(sample.data.length); return "undefined" != typeof DOMParser && (res.document = (new DOMParser).parseFromString(res.documentString, "application/xml")), res; }; var Textin4Parser = function() {}; Textin4Parser.prototype.parseSample = function(sample) { return new MP4BoxStream(sample.data.buffer).readString(sample.data.length); }, Textin4Parser.prototype.parseConfig = function(data) { var stream = new MP4BoxStream(data.buffer); return stream.readUint32(), stream.readCString(); }, exports.XMLSubtitlein4Parser = XMLSubtitlein4Parser, exports.Textin4Parser = Textin4Parser; var ISOFile = function(stream) { this.stream = stream || new MultiBufferStream, this.boxes = [], this.mdats = [], this.moofs = [], this.isProgressive = !1, this.moovStartFound = !1, this.onMoovStart = null, this.moovStartSent = !1, this.onReady = null, this.readySent = !1, this.onSegment = null, this.onSamples = null, this.onError = null, this.sampleListBuilt = !1, this.fragmentedTracks = [], this.extractedTracks = [], this.isFragmentationInitialized = !1, this.sampleProcessingStarted = !1, this.nextMoofNumber = 0, this.itemListBuilt = !1, this.onSidx = null, this.sidxSent = !1; }; ISOFile.prototype.setSegmentOptions = function(id, user, options) { var trak = this.getTrackById(id); if (trak) { var fragTrack = {}; this.fragmentedTracks.push(fragTrack), fragTrack.id = id, fragTrack.user = user, fragTrack.trak = trak, trak.nextSample = 0, fragTrack.segmentStream = null, fragTrack.nb_samples = 1e3, fragTrack.rapAlignement = !0, options && (options.nbSamples && (fragTrack.nb_samples = options.nbSamples), options.rapAlignement && (fragTrack.rapAlignement = options.rapAlignement)); } }, ISOFile.prototype.unsetSegmentOptions = function(id) { for (var index = -1, i = 0; i < this.fragmentedTracks.length; i++) this.fragmentedTracks[i].id == id && (index = i); index > -1 && this.fragmentedTracks.splice(index, 1); }, ISOFile.prototype.setExtractionOptions = function(id, user, options) { var trak = this.getTrackById(id); if (trak) { var extractTrack = {}; this.extractedTracks.push(extractTrack), extractTrack.id = id, extractTrack.user = user, extractTrack.trak = trak, trak.nextSample = 0, extractTrack.nb_samples = 1e3, extractTrack.samples = [], options && options.nbSamples && (extractTrack.nb_samples = options.nbSamples); } }, ISOFile.prototype.unsetExtractionOptions = function(id) { for (var index = -1, i = 0; i < this.extractedTracks.length; i++) this.extractedTracks[i].id == id && (index = i); index > -1 && this.extractedTracks.splice(index, 1); }, ISOFile.prototype.parse = function() { var ret, box; if (!this.restoreParsePosition || this.restoreParsePosition()) for (;;) { if (this.hasIncompleteMdat && this.hasIncompleteMdat()) { if (this.processIncompleteMdat()) continue; return; } if (this.saveParsePosition && this.saveParsePosition(), (ret = BoxParser.parseOneBox(this.stream, !1)).code === BoxParser.ERR_NOT_ENOUGH_DATA) { if (this.processIncompleteBox) { if (this.processIncompleteBox(ret)) continue; return; } return; } var box_type; switch (box_type = "uuid" !== (box = ret.box).type ? box.type : box.uuid, this.boxes.push(box), box_type) { case "mdat": this.mdats.push(box); break; case "moof": this.moofs.push(box); break; case "moov": this.moovStartFound = !0, 0 === this.mdats.length && (this.isProgressive = !0); default: void 0 !== this[box_type] && Log.warn("ISOFile", "Duplicate Box of type: " + box_type + ", overriding previous occurrence"), this[box_type] = box; } this.updateUsedBytes && this.updateUsedBytes(box, ret); } }, ISOFile.prototype.checkBuffer = function(ab) { if (null == ab) throw "Buffer must be defined and non empty"; if (void 0 === ab.fileStart) throw "Buffer must have a fileStart property"; return 0 === ab.byteLength ? (Log.warn("ISOFile", "Ignoring empty buffer (fileStart: " + ab.fileStart + ")"), this.stream.logBufferLevel(), !1) : (Log.info("ISOFile", "Processing buffer (fileStart: " + ab.fileStart + ")"), ab.usedBytes = 0, this.stream.insertBuffer(ab), this.stream.logBufferLevel(), !!this.stream.initialized() || (Log.warn("ISOFile", "Not ready to start parsing"), !1)); }, ISOFile.prototype.appendBuffer = function(ab, last) { var nextFileStart; if (this.checkBuffer(ab)) return this.parse(), this.moovStartFound && !this.moovStartSent && (this.moovStartSent = !0, this.onMoovStart && this.onMoovStart()), this.moov ? (this.sampleListBuilt || (this.buildSampleLists(), this.sampleListBuilt = !0), this.updateSampleLists(), this.onReady && !this.readySent && (this.readySent = !0, this.onReady(this.getInfo())), this.processSamples(last), this.nextSeekPosition ? (nextFileStart = this.nextSeekPosition, this.nextSeekPosition = void 0) : nextFileStart = this.nextParsePosition, this.stream.getEndFilePositionAfter && (nextFileStart = this.stream.getEndFilePositionAfter(nextFileStart))) : nextFileStart = this.nextParsePosition ? this.nextParsePosition : 0, this.sidx && this.onSidx && !this.sidxSent && (this.onSidx(this.sidx), this.sidxSent = !0), this.meta && (this.flattenItemInfo && !this.itemListBuilt && (this.flattenItemInfo(), this.itemListBuilt = !0), this.processItems && this.processItems(this.onItem)), this.stream.cleanBuffers && (Log.info("ISOFile", "Done processing buffer (fileStart: " + ab.fileStart + ") - next buffer to fetch should have a fileStart position of " + nextFileStart), this.stream.logBufferLevel(), this.stream.cleanBuffers(), this.stream.logBufferLevel(!0), Log.info("ISOFile", "Sample data size in memory: " + this.getAllocatedSampleDataSize())), nextFileStart; }, ISOFile.prototype.getInfo = function() { var i, j, trak, track, sample_desc, movie = {}, _1904 = new Date("1904-01-01T00:00:00Z").getTime(); if (this.moov) for (movie.hasMoov = !0, movie.duration = this.moov.mvhd.duration, movie.timescale = this.moov.mvhd.timescale, movie.isFragmented = null != this.moov.mvex, movie.isFragmented && this.moov.mvex.mehd && (movie.fragment_duration = this.moov.mvex.mehd.fragment_duration), movie.isProgressive = this.isProgressive, movie.hasIOD = null != this.moov.iods, movie.brands = [], movie.brands.push(this.ftyp.major_brand), movie.brands = movie.brands.concat(this.ftyp.compatible_brands), movie.created = new Date(_1904 + 1e3 * this.moov.mvhd.creation_time), movie.modified = new Date(_1904 + 1e3 * this.moov.mvhd.modification_time), movie.tracks = [], movie.audioTracks = [], movie.videoTracks = [], movie.subtitleTracks = [], movie.metadataTracks = [], movie.hintTracks = [], movie.otherTracks = [], i = 0; i < this.moov.traks.length; i++) { if (sample_desc = (trak = this.moov.traks[i]).mdia.minf.stbl.stsd.entries[0], track = {}, movie.tracks.push(track), track.id = trak.tkhd.track_id, track.name = trak.mdia.hdlr.name, track.references = [], trak.tref) for (j = 0; j < trak.tref.boxes.length; j++) ref = {}, track.references.push(ref), ref.type = trak.tref.boxes[j].type, ref.track_ids = trak.tref.boxes[j].track_ids; trak.edts && (track.edits = trak.edts.elst.entries), track.created = new Date(_1904 + 1e3 * trak.tkhd.creation_time), track.modified = new Date(_1904 + 1e3 * trak.tkhd.modification_time), track.movie_duration = trak.tkhd.duration, track.movie_timescale = movie.timescale, track.layer = trak.tkhd.layer, track.alternate_group = trak.tkhd.alternate_group, track.volume = trak.tkhd.volume, track.matrix = trak.tkhd.matrix, track.track_width = trak.tkhd.width / 65536, track.track_height = trak.tkhd.height / 65536, track.timescale = trak.mdia.mdhd.timescale, track.cts_shift = trak.mdia.minf.stbl.cslg, track.duration = trak.mdia.mdhd.duration, track.samples_duration = trak.samples_duration, track.codec = sample_desc.getCodec(), track.kind = trak.udta && trak.udta.kinds.length ? trak.udta.kinds[0] : { schemeURI: "", value: "" }, track.language = trak.mdia.elng ? trak.mdia.elng.extended_language : trak.mdia.mdhd.languageString, track.nb_samples = trak.samples.length, track.size = trak.samples_size, track.bitrate = 8 * track.size * track.timescale / track.samples_duration, sample_desc.isAudio() ? (track.type = "audio", movie.audioTracks.push(track), track.audio = {}, track.audio.sample_rate = sample_desc.getSampleRate(), track.audio.channel_count = sample_desc.getChannelCount(), track.audio.sample_size = sample_desc.getSampleSize()) : sample_desc.isVideo() ? (track.type = "video", movie.videoTracks.push(track), track.video = {}, track.video.width = sample_desc.getWidth(), track.video.height = sample_desc.getHeight()) : sample_desc.isSubtitle() ? (track.type = "subtitles", movie.subtitleTracks.push(track)) : sample_desc.isHint() ? (track.type = "metadata", movie.hintTracks.push(track)) : sample_desc.isMetadata() ? (track.type = "metadata", movie.metadataTracks.push(track)) : (track.type = "metadata", movie.otherTracks.push(track)); } else movie.hasMoov = !1; if (movie.mime = "", movie.hasMoov && movie.tracks) { for (movie.videoTracks && movie.videoTracks.length > 0 ? movie.mime += 'video/mp4; codecs="' : movie.audioTracks && movie.audioTracks.length > 0 ? movie.mime += 'audio/mp4; codecs="' : movie.mime += 'application/mp4; codecs="', i = 0; i < movie.tracks.length; i++) 0 !== i && (movie.mime += ","), movie.mime += movie.tracks[i].codec; movie.mime += '"; profiles="', movie.mime += this.ftyp.compatible_brands.join(), movie.mime += '"'; } return movie; }, ISOFile.prototype.processSamples = function(last) { var i, trak; if (this.sampleProcessingStarted) { if (this.isFragmentationInitialized && null !== this.onSegment) for (i = 0; i < this.fragmentedTracks.length; i++) { var fragTrak = this.fragmentedTracks[i]; for (trak = fragTrak.trak; trak.nextSample < trak.samples.length && this.sampleProcessingStarted; ) { Log.debug("ISOFile", "Creating media fragment on track #" + fragTrak.id + " for sample " + trak.nextSample); var result = this.createFragment(fragTrak.id, trak.nextSample, fragTrak.segmentStream); if (!result) break; if (fragTrak.segmentStream = result, trak.nextSample++, (trak.nextSample % fragTrak.nb_samples == 0 || last && trak.nextSample >= trak.samples.length) && (Log.info("ISOFile", "Sending fragmented data on track #" + fragTrak.id + " for samples [" + Math.max(0, trak.nextSample - fragTrak.nb_samples) + "," + (trak.nextSample - 1) + "]"), Log.info("ISOFile", "Sample data size in memory: " + this.getAllocatedSampleDataSize()), this.onSegment && this.onSegment(fragTrak.id, fragTrak.user, fragTrak.segmentStream.buffer, trak.nextSample, last && trak.nextSample >= trak.samples.length), fragTrak.segmentStream = null, fragTrak !== this.fragmentedTracks[i])) break; } } if (null !== this.onSamples) for (i = 0; i < this.extractedTracks.length; i++) { var extractTrak = this.extractedTracks[i]; for (trak = extractTrak.trak; trak.nextSample < trak.samples.length && this.sampleProcessingStarted; ) { Log.debug("ISOFile", "Exporting on track #" + extractTrak.id + " sample #" + trak.nextSample); var sample = this.getSample(trak, trak.nextSample); if (!sample) break; if (trak.nextSample++, extractTrak.samples.push(sample), (trak.nextSample % extractTrak.nb_samples == 0 || trak.nextSample >= trak.samples.length) && (Log.debug("ISOFile", "Sending samples on track #" + extractTrak.id + " for sample " + trak.nextSample), this.onSamples && this.onSamples(extractTrak.id, extractTrak.user, extractTrak.samples), extractTrak.samples = [], extractTrak !== this.extractedTracks[i])) break; } } } }, ISOFile.prototype.getBox = function(type) { var result = this.getBoxes(type, !0); return result.length ? result[0] : null; }, ISOFile.prototype.getBoxes = function(type, returnEarly) { var result = []; return ISOFile._sweep.call(this, type, result, returnEarly), result; }, ISOFile._sweep = function(type, result, returnEarly) { for (var box in this.type && this.type == type && result.push(this), this.boxes) { if (result.length && returnEarly) return; ISOFile._sweep.call(this.boxes[box], type, result, returnEarly); } }, ISOFile.prototype.getTrackSamplesInfo = function(track_id) { var track = this.getTrackById(track_id); return track ? track.samples : void 0; }, ISOFile.prototype.getTrackSample = function(track_id, number) { var track = this.getTrackById(track_id); return this.getSample(track, number); }, ISOFile.prototype.releaseUsedSamples = function(id, sampleNum) { var size = 0, trak = this.getTrackById(id); trak.lastValidSample || (trak.lastValidSample = 0); for (var i = trak.lastValidSample; i < sampleNum; i++) size += this.releaseSample(trak, i); Log.info("ISOFile", "Track #" + id + " released samples up to " + sampleNum + " (released size: " + size + ", remaining: " + this.samplesDataSize + ")"), trak.lastValidSample = sampleNum; }, ISOFile.prototype.start = function() { this.sampleProcessingStarted = !0, this.processSamples(!1); }, ISOFile.prototype.stop = function() { this.sampleProcessingStarted = !1; }, ISOFile.prototype.flush = function() { Log.info("ISOFile", "Flushing remaining samples"), this.updateSampleLists(), this.processSamples(!0), this.stream.cleanBuffers(), this.stream.logBufferLevel(!0); }, ISOFile.prototype.seekTrack = function(time, useRap, trak) { var j, sample, seek_offset, timescale, rap_seek_sample_num = 0, seek_sample_num = 0; if (0 === trak.samples.length) return Log.info("ISOFile", "No sample in track, cannot seek! Using time " + Log.getDurationString(0, 1) + " and offset: 0"), { offset: 0, time: 0 }; for (j = 0; j < trak.samples.length; j++) { if (sample = trak.samples[j], 0 === j) seek_sample_num = 0, timescale = sample.timescale; else if (sample.cts > time * sample.timescale) { seek_sample_num = j - 1; break; } useRap && sample.is_sync && (rap_seek_sample_num = j); } for (useRap && (seek_sample_num = rap_seek_sample_num), time = trak.samples[seek_sample_num].cts, trak.nextSample = seek_sample_num; trak.samples[seek_sample_num].alreadyRead === trak.samples[seek_sample_num].size && trak.samples[seek_sample_num + 1]; ) seek_sample_num++; return seek_offset = trak.samples[seek_sample_num].offset + trak.samples[seek_sample_num].alreadyRead, Log.info("ISOFile", "Seeking to " + (useRap ? "RAP" : "") + " sample #" + trak.nextSample + " on track " + trak.tkhd.track_id + ", time " + Log.getDurationString(time, timescale) + " and offset: " + seek_offset), { offset: seek_offset, time: time / timescale }; }, ISOFile.prototype.seek = function(time, useRap) { var trak, trak_seek_info, i, moov = this.moov, seek_info = { offset: 1 / 0, time: 1 / 0 }; if (this.moov) { for (i = 0; i < moov.traks.length; i++) trak = moov.traks[i], (trak_seek_info = this.seekTrack(time, useRap, trak)).offset < seek_info.offset && (seek_info.offset = trak_seek_info.offset), trak_seek_info.time < seek_info.time && (seek_info.time = trak_seek_info.time); return Log.info("ISOFile", "Seeking at time " + Log.getDurationString(seek_info.time, 1) + " needs a buffer with a fileStart position of " + seek_info.offset), seek_info.offset === 1 / 0 ? seek_info = { offset: this.nextParsePosition, time: 0 } : seek_info.offset = this.stream.getEndFilePositionAfter(seek_info.offset), Log.info("ISOFile", "Adjusted seek position (after checking data already in buffer): " + seek_info.offset), seek_info; } throw "Cannot seek: moov not received!"; }, ISOFile.prototype.equal = function(b) { for (var box_index = 0; box_index < this.boxes.length && box_index < b.boxes.length; ) { var a_box = this.boxes[box_index], b_box = b.boxes[box_index]; if (!BoxParser.boxEqual(a_box, b_box)) return !1; box_index++; } return !0; }, exports.ISOFile = ISOFile, ISOFile.prototype.lastBoxStartPosition = 0, ISOFile.prototype.parsingMdat = null, ISOFile.prototype.nextParsePosition = 0, ISOFile.prototype.discardMdatData = !1, ISOFile.prototype.processIncompleteBox = function(ret) { var box; return "mdat" === ret.type ? (box = new BoxParser[ret.type + "Box"](ret.size), this.parsingMdat = box, this.boxes.push(box), this.mdats.push(box), box.start = ret.start, box.hdr_size = ret.hdr_size, this.stream.addUsedBytes(box.hdr_size), this.lastBoxStartPosition = box.start + box.size, this.stream.seek(box.start + box.size, !1, this.discardMdatData) ? (this.parsingMdat = null, !0) : (this.moovStartFound ? this.nextParsePosition = this.stream.findEndContiguousBuf() : this.nextParsePosition = box.start + box.size, !1)) : ("moov" === ret.type && (this.moovStartFound = !0, 0 === this.mdats.length && (this.isProgressive = !0)), this.stream.mergeNextBuffer && this.stream.mergeNextBuffer() ? (this.nextParsePosition = this.stream.getEndPosition(), !0) : (ret.type ? this.moovStartFound ? this.nextParsePosition = this.stream.getEndPosition() : this.nextParsePosition = this.stream.getPosition() + ret.size : this.nextParsePosition = this.stream.getEndPosition(), !1)); }, ISOFile.prototype.hasIncompleteMdat = function() { return null !== this.parsingMdat; }, ISOFile.prototype.processIncompleteMdat = function() { var box; return box = this.parsingMdat, this.stream.seek(box.start + box.size, !1, this.discardMdatData) ? (Log.debug("ISOFile", "Found 'mdat' end in buffered data"), this.parsingMdat = null, !0) : (this.nextParsePosition = this.stream.findEndContiguousBuf(), !1); }, ISOFile.prototype.restoreParsePosition = function() { return this.stream.seek(this.lastBoxStartPosition, !0, this.discardMdatData); }, ISOFile.prototype.saveParsePosition = function() { this.lastBoxStartPosition = this.stream.getPosition(); }, ISOFile.prototype.updateUsedBytes = function(box, ret) { this.stream.addUsedBytes && ("mdat" === box.type ? (this.stream.addUsedBytes(box.hdr_size), this.discardMdatData && this.stream.addUsedBytes(box.size - box.hdr_size)) : this.stream.addUsedBytes(box.size)); }, ISOFile.prototype.add = BoxParser.Box.prototype.add, ISOFile.prototype.addBox = BoxParser.Box.prototype.addBox, ISOFile.prototype.init = function(_options) { var options = _options || {}, moov = (this.add("ftyp").set("major_brand", options.brands && options.brands[0] || "iso4").set("minor_version", 0).set("compatible_brands", options.brands || [ "iso4" ]), this.add("moov")); return moov.add("mvhd").set("timescale", options.timescale || 600).set("rate", options.rate || 1).set("creation_time", 0).set("modification_time", 0).set("duration", options.duration || 0).set("volume", 1).set("matrix", [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]).set("next_track_id", 1), moov.add("mvex"), this; }, ISOFile.prototype.addTrack = function(_options) { this.moov || this.init(_options); var options = _options || {}; options.width = options.width || 320, options.height = options.height || 320, options.id = options.id || this.moov.mvhd.next_track_id, options.type = options.type || "avc1"; var trak = this.moov.add("trak"); this.moov.mvhd.next_track_id = options.id + 1, trak.add("tkhd").set("flags", BoxParser.TKHD_FLAG_ENABLED | BoxParser.TKHD_FLAG_IN_MOVIE | BoxParser.TKHD_FLAG_IN_PREVIEW).set("creation_time", 0).set("modification_time", 0).set("track_id", options.id).set("duration", options.duration || 0).set("layer", options.layer || 0).set("alternate_group", 0).set("volume", 1).set("matrix", [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]).set("width", options.width).set("height", options.height); var mdia = trak.add("mdia"); mdia.add("mdhd").set("creation_time", 0).set("modification_time", 0).set("timescale", options.timescale || 1).set("duration", options.media_duration || 0).set("language", options.language || 0), mdia.add("hdlr").set("handler", options.hdlr || "vide").set("name", options.name || "Track created with MP4Box.js"), mdia.add("elng").set("extended_language", options.language || "fr-FR"); var minf = mdia.add("minf"); if (void 0 !== BoxParser[options.type + "SampleEntry"]) { var sample_description_entry = new BoxParser[options.type + "SampleEntry"]; sample_description_entry.data_reference_index = 1; var media_type = ""; for (var mediaType in BoxParser.sampleEntryCodes) for (var codes = BoxParser.sampleEntryCodes[mediaType], i = 0; i < codes.length; i++) if (codes.indexOf(options.type) > -1) { media_type = mediaType; break; } switch (media_type) { case "Visual": minf.add("vmhd").set("graphicsmode", 0).set("opcolor", [ 0, 0, 0 ]), sample_description_entry.set("width", options.width).set("height", options.height).set("horizresolution", 72 << 16).set("vertresolution", 72 << 16).set("frame_count", 1).set("compressorname", options.type + " Compressor").set("depth", 24); break; case "Audio": minf.add("smhd").set("balance", options.balance || 0), sample_description_entry.set("channel_count", options.channel_count || 2).set("samplesize", options.samplesize || 16).set("samplerate", options.samplerate || 65536); break; case "Hint": minf.add("hmhd"); break; case "Subtitle": minf.add("sthd"), "stpp" === options.type && sample_description_entry.set("namespace", options.namespace || "nonamespace").set("schema_location", options.schema_location || "").set("auxiliary_mime_types", options.auxiliary_mime_types || ""); break; default: minf.add("nmhd"); } options.description && sample_description_entry.addBox(options.description), minf.add("dinf").add("dref").addEntry((new BoxParser["url Box"]).set("flags", 1)); var stbl = minf.add("stbl"); return stbl.add("stsd").addEntry(sample_description_entry), stbl.add("stts").set("sample_counts", []).set("sample_deltas", []), stbl.add("stsc").set("first_chunk", []).set("samples_per_chunk", []).set("sample_description_index", []), stbl.add("stco").set("chunk_offsets", []), stbl.add("stsz").set("sample_sizes", []), this.moov.mvex.add("trex").set("track_id", options.id).set("default_sample_description_index", options.default_sample_description_index || 1).set("default_sample_duration", options.default_sample_duration || 0).set("default_sample_size", options.default_sample_size || 0).set("default_sample_flags", options.default_sample_flags || 0), this.buildTrakSampleLists(trak), options.id; } }, BoxParser.Box.prototype.computeSize = function(stream_) { var stream = stream_ || new DataStream; stream.endianness = DataStream.BIG_ENDIAN, this.write(stream); }, ISOFile.prototype.addSample = function(track_id, data, _options) { var options = _options || {}, sample = {}, trak = this.getTrackById(track_id); if (null !== trak) { sample.number = trak.samples.length, sample.track_id = trak.tkhd.track_id, sample.timescale = trak.mdia.mdhd.timescale, sample.description_index = options.sample_description_index ? options.sample_description_index - 1 : 0, sample.description = trak.mdia.minf.stbl.stsd.entries[sample.description_index], sample.data = data, sample.size = data.length, sample.alreadyRead = sample.size, sample.duration = options.duration || 1, sample.cts = options.cts || 0, sample.dts = options.dts || 0, sample.is_sync = options.is_sync || !1, sample.is_leading = options.is_leading || 0, sample.depends_on = options.depends_on || 0, sample.is_depended_on = options.is_depended_on || 0, sample.has_redundancy = options.has_redundancy || 0, sample.degradation_priority = options.degradation_priority || 0, sample.offset = 0, sample.subsamples = options.subsamples, trak.samples.push(sample), trak.samples_size += sample.size, trak.samples_duration += sample.duration, this.processSamples(); var moof = ISOFile.createSingleSampleMoof(sample); return this.addBox(moof), moof.computeSize(), moof.trafs[0].truns[0].data_offset = moof.size + 8, this.add("mdat").data = data, sample; } }, ISOFile.createSingleSampleMoof = function(sample) { var moof = new BoxParser.moofBox; moof.add("mfhd").set("sequence_number", this.nextMoofNumber), this.nextMoofNumber++; var traf = moof.add("traf"); return traf.add("tfhd").set("track_id", sample.track_id).set("flags", BoxParser.TFHD_FLAG_DEFAULT_BASE_IS_MOOF), traf.add("tfdt").set("baseMediaDecodeTime", sample.dts), traf.add("trun").set("flags", BoxParser.TRUN_FLAGS_DATA_OFFSET | BoxParser.TRUN_FLAGS_DURATION | BoxParser.TRUN_FLAGS_SIZE | BoxParser.TRUN_FLAGS_FLAGS | BoxParser.TRUN_FLAGS_CTS_OFFSET).set("data_offset", 0).set("first_sample_flags", 0).set("sample_count", 1).set("sample_duration", [ sample.duration ]).set("sample_size", [ sample.size ]).set("sample_flags", [ 0 ]).set("sample_composition_time_offset", [ sample.cts - sample.dts ]), moof; }, ISOFile.prototype.lastMoofIndex = 0, ISOFile.prototype.samplesDataSize = 0, ISOFile.prototype.resetTables = function() { var i, trak, stsc, stts, ctts, stss; for (this.initial_duration = this.moov.mvhd.duration, this.moov.mvhd.duration = 0, i = 0; i < this.moov.traks.length; i++) { (trak = this.moov.traks[i]).tkhd.duration = 0, trak.mdia.mdhd.duration = 0, (trak.mdia.minf.stbl.stco || trak.mdia.minf.stbl.co64).chunk_offsets = [], (stsc = trak.mdia.minf.stbl.stsc).first_chunk = [], stsc.samples_per_chunk = [], stsc.sample_description_index = [], (trak.mdia.minf.stbl.stsz || trak.mdia.minf.stbl.stz2).sample_sizes = [], (stts = trak.mdia.minf.stbl.stts).sample_counts = [], stts.sample_deltas = [], (ctts = trak.mdia.minf.stbl.ctts) && (ctts.sample_counts = [], ctts.sample_offsets = []), stss = trak.mdia.minf.stbl.stss; var k = trak.mdia.minf.stbl.boxes.indexOf(stss); -1 != k && (trak.mdia.minf.stbl.boxes[k] = null); } }, ISOFile.initSampleGroups = function(trak, traf, sbgps, trak_sgpds, traf_sgpds) { var l, k, sample_group_info, sample_group_key; function SampleGroupInfo(_type, _parameter, _sbgp) { this.grouping_type = _type, this.grouping_type_parameter = _parameter, this.sbgp = _sbgp, this.last_sample_in_run = -1, this.entry_index = -1; } for (traf && (traf.sample_groups_info = []), trak.sample_groups_info || (trak.sample_groups_info = []), k = 0; k < sbgps.length; k++) { for (sample_group_key = sbgps[k].grouping_type + "/" + sbgps[k].grouping_type_parameter, sample_group_info = new SampleGroupInfo(sbgps[k].grouping_type, sbgps[k].grouping_type_parameter, sbgps[k]), traf && (traf.sample_groups_info[sample_group_key] = sample_group_info), trak.sample_groups_info[sample_group_key] || (trak.sample_groups_info[sample_group_key] = sample_group_info), l = 0; l < trak_sgpds.length; l++) trak_sgpds[l].grouping_type === sbgps[k].grouping_type && (sample_group_info.description = trak_sgpds[l], sample_group_info.description.used = !0); if (traf_sgpds) for (l = 0; l < traf_sgpds.length; l++) traf_sgpds[l].grouping_type === sbgps[k].grouping_type && (sample_group_info.fragment_description = traf_sgpds[l], sample_group_info.fragment_description.used = !0, sample_group_info.is_fragment = !0); } if (traf) { if (traf_sgpds) for (k = 0; k < traf_sgpds.length; k++) !traf_sgpds[k].used && traf_sgpds[k].version >= 2 && (sample_group_key = traf_sgpds[k].grouping_type + "/0", (sample_group_info = new SampleGroupInfo(traf_sgpds[k].grouping_type, 0)).is_fragment = !0, traf.sample_groups_info[sample_group_key] || (traf.sample_groups_info[sample_group_key] = sample_group_info)); } else for (k = 0; k < trak_sgpds.length; k++) !trak_sgpds[k].used && trak_sgpds[k].version >= 2 && (sample_group_key = trak_sgpds[k].grouping_type + "/0", sample_group_info = new SampleGroupInfo(trak_sgpds[k].grouping_type, 0), trak.sample_groups_info[sample_group_key] || (trak.sample_groups_info[sample_group_key] = sample_group_info)); }, ISOFile.setSampleGroupProperties = function(trak, sample, sample_number, sample_groups_info) { var k, index; for (k in sample.sample_groups = [], sample_groups_info) { var description; sample.sample_groups[k] = {}, sample.sample_groups[k].grouping_type = sample_groups_info[k].grouping_type, sample.sample_groups[k].grouping_type_parameter = sample_groups_info[k].grouping_type_parameter, sample_number >= sample_groups_info[k].last_sample_in_run && (sample_groups_info[k].last_sample_in_run < 0 && (sample_groups_info[k].last_sample_in_run = 0), sample_groups_info[k].entry_index++, sample_groups_info[k].entry_index <= sample_groups_info[k].sbgp.entries.length - 1 && (sample_groups_info[k].last_sample_in_run += sample_groups_info[k].sbgp.entries[sample_groups_info[k].entry_index].sample_count)), sample_groups_info[k].entry_index <= sample_groups_info[k].sbgp.entries.length - 1 ? sample.sample_groups[k].group_description_index = sample_groups_info[k].sbgp.entries[sample_groups_info[k].entry_index].group_description_index : sample.sample_groups[k].group_description_index = -1, 0 !== sample.sample_groups[k].group_description_index && (description = sample_groups_info[k].fragment_description ? sample_groups_info[k].fragment_description : sample_groups_info[k].description, sample.sample_groups[k].group_description_index > 0 ? (index = sample.sample_groups[k].group_description_index > 65535 ? (sample.sample_groups[k].group_description_index >> 16) - 1 : sample.sample_groups[k].group_description_index - 1, description && index >= 0 && (sample.sample_groups[k].description = description.entries[index])) : description && description.version >= 2 && description.default_group_description_index > 0 && (sample.sample_groups[k].description = description.entries[description.default_group_description_index - 1])); } }, ISOFile.process_sdtp = function(sdtp, sample, number) { sample && (sdtp ? (sample.is_leading = sdtp.is_leading[number], sample.depends_on = sdtp.sample_depends_on[number], sample.is_depended_on = sdtp.sample_is_depended_on[number], sample.has_redundancy = sdtp.sample_has_redundancy[number]) : (sample.is_leading = 0, sample.depends_on = 0, sample.is_depended_on = 0, sample.has_redundancy = 0)); }, ISOFile.prototype.buildSampleLists = function() { var i; for (i = 0; i < this.moov.traks.length; i++) trak = this.moov.traks[i], this.buildTrakSampleLists(trak); }, ISOFile.prototype.buildTrakSampleLists = function(trak) { var j, stco, stsc, stsz, stts, ctts, stss, stsd, subs, sbgps, sgpds, stdp, chunk_run_index, chunk_index, last_chunk_in_run, offset_in_chunk, last_sample_in_chunk, last_sample_in_stts_run, stts_run_index, last_sample_in_ctts_run, ctts_run_index, last_stss_index, subs_entry_index, last_subs_sample_index; if (trak.samples = [], trak.samples_duration = 0, trak.samples_size = 0, stco = trak.mdia.minf.stbl.stco || trak.mdia.minf.stbl.co64, stsc = trak.mdia.minf.stbl.stsc, stsz = trak.mdia.minf.stbl.stsz || trak.mdia.minf.stbl.stz2, stts = trak.mdia.minf.stbl.stts, ctts = trak.mdia.minf.stbl.ctts, stss = trak.mdia.minf.stbl.stss, stsd = trak.mdia.minf.stbl.stsd, subs = trak.mdia.minf.stbl.subs, stdp = trak.mdia.minf.stbl.stdp, sbgps = trak.mdia.minf.stbl.sbgps, sgpds = trak.mdia.minf.stbl.sgpds, last_sample_in_stts_run = -1, stts_run_index = -1, last_sample_in_ctts_run = -1, ctts_run_index = -1, last_stss_index = 0, subs_entry_index = 0, last_subs_sample_index = 0, ISOFile.initSampleGroups(trak, null, sbgps, sgpds), void 0 !== stsz) { for (j = 0; j < stsz.sample_sizes.length; j++) { var sample = {}; sample.number = j, sample.track_id = trak.tkhd.track_id, sample.timescale = trak.mdia.mdhd.timescale, sample.alreadyRead = 0, trak.samples[j] = sample, sample.size = stsz.sample_sizes[j], trak.samples_size += sample.size, 0 === j ? (chunk_index = 1, chunk_run_index = 0, sample.chunk_index = chunk_index, sample.chunk_run_index = chunk_run_index, last_sample_in_chunk = stsc.samples_per_chunk[chunk_run_index], offset_in_chunk = 0, last_chunk_in_run = chunk_run_index + 1 < stsc.first_chunk.length ? stsc.first_chunk[chunk_run_index + 1] - 1 : 1 / 0) : j < last_sample_in_chunk ? (sample.chunk_index = chunk_index, sample.chunk_run_index = chunk_run_index) : (chunk_index++, sample.chunk_index = chunk_index, offset_in_chunk = 0, chunk_index <= last_chunk_in_run || (last_chunk_in_run = 1 + ++chunk_run_index < stsc.first_chunk.length ? stsc.first_chunk[chunk_run_index + 1] - 1 : 1 / 0), sample.chunk_run_index = chunk_run_index, last_sample_in_chunk += stsc.samples_per_chunk[chunk_run_index]), sample.description_index = stsc.sample_description_index[sample.chunk_run_index] - 1, sample.description = stsd.entries[sample.description_index], sample.offset = stco.chunk_offsets[sample.chunk_index - 1] + offset_in_chunk, offset_in_chunk += sample.size, j > last_sample_in_stts_run && (stts_run_index++, last_sample_in_stts_run < 0 && (last_sample_in_stts_run = 0), last_sample_in_stts_run += stts.sample_counts[stts_run_index]), j > 0 ? (trak.samples[j - 1].duration = stts.sample_deltas[stts_run_index], trak.samples_duration += trak.samples[j - 1].duration, sample.dts = trak.samples[j - 1].dts + trak.samples[j - 1].duration) : sample.dts = 0, ctts ? (j >= last_sample_in_ctts_run && (ctts_run_index++, last_sample_in_ctts_run < 0 && (last_sample_in_ctts_run = 0), last_sample_in_ctts_run += ctts.sample_counts[ctts_run_index]), sample.cts = trak.samples[j].dts + ctts.sample_offsets[ctts_run_index]) : sample.cts = sample.dts, stss ? (j == stss.sample_numbers[last_stss_index] - 1 ? (sample.is_sync = !0, last_stss_index++) : (sample.is_sync = !1, sample.degradation_priority = 0), subs && subs.entries[subs_entry_index].sample_delta + last_subs_sample_index == j + 1 && (sample.subsamples = subs.entries[subs_entry_index].subsamples, last_subs_sample_index += subs.entries[subs_entry_index].sample_delta, subs_entry_index++)) : sample.is_sync = !0, ISOFile.process_sdtp(trak.mdia.minf.stbl.sdtp, sample, sample.number), sample.degradation_priority = stdp ? stdp.priority[j] : 0, subs && subs.entries[subs_entry_index].sample_delta + last_subs_sample_index == j && (sample.subsamples = subs.entries[subs_entry_index].subsamples, last_subs_sample_index += subs.entries[subs_entry_index].sample_delta), (sbgps.length > 0 || sgpds.length > 0) && ISOFile.setSampleGroupProperties(trak, sample, j, trak.sample_groups_info); } j > 0 && (trak.samples[j - 1].duration = Math.max(trak.mdia.mdhd.duration - trak.samples[j - 1].dts, 0), trak.samples_duration += trak.samples[j - 1].duration); } }, ISOFile.prototype.updateSampleLists = function() { var i, j, k, default_sample_description_index, default_sample_duration, default_sample_size, default_sample_flags, last_run_position, box, moof, traf, trak, trex, sample, sample_flags; if (void 0 !== this.moov) for (;this.lastMoofIndex < this.moofs.length; ) if (box = this.moofs[this.lastMoofIndex], this.lastMoofIndex++, "moof" == box.type) for (moof = box, i = 0; i < moof.trafs.length; i++) { for (traf = moof.trafs[i], trak = this.getTrackById(traf.tfhd.track_id), trex = this.getTrexById(traf.tfhd.track_id), default_sample_description_index = traf.tfhd.flags & BoxParser.TFHD_FLAG_SAMPLE_DESC ? traf.tfhd.default_sample_description_index : trex ? trex.default_sample_description_index : 1, default_sample_duration = traf.tfhd.flags & BoxParser.TFHD_FLAG_SAMPLE_DUR ? traf.tfhd.default_sample_duration : trex ? trex.default_sample_duration : 0, default_sample_size = traf.tfhd.flags & BoxParser.TFHD_FLAG_SAMPLE_SIZE ? traf.tfhd.default_sample_size : trex ? trex.default_sample_size : 0, default_sample_flags = traf.tfhd.flags & BoxParser.TFHD_FLAG_SAMPLE_FLAGS ? traf.tfhd.default_sample_flags : trex ? trex.default_sample_flags : 0, traf.sample_number = 0, traf.sbgps.length > 0 && ISOFile.initSampleGroups(trak, traf, traf.sbgps, trak.mdia.minf.stbl.sgpds, traf.sgpds), j = 0; j < traf.truns.length; j++) { var trun = traf.truns[j]; for (k = 0; k < trun.sample_count; k++) { (sample = {}).number_in_traf = traf.sample_number, traf.sample_number++, sample.number = trak.samples.length, traf.first_sample_index = trak.samples.length, trak.samples.push(sample), sample.track_id = trak.tkhd.track_id, sample.timescale = trak.mdia.mdhd.timescale, sample.description_index = default_sample_description_index - 1, sample.description = trak.mdia.minf.stbl.stsd.entries[sample.description_index], sample.size = default_sample_size, trun.flags & BoxParser.TRUN_FLAGS_SIZE && (sample.size = trun.sample_size[k]), trak.samples_size += sample.size, sample.duration = default_sample_duration, trun.flags & BoxParser.TRUN_FLAGS_DURATION && (sample.duration = trun.sample_duration[k]), trak.samples_duration += sample.duration, trak.first_traf_merged || k > 0 ? sample.dts = trak.samples[trak.samples.length - 2].dts + trak.samples[trak.samples.length - 2].duration : (traf.tfdt ? sample.dts = traf.tfdt.baseMediaDecodeTime : sample.dts = 0, trak.first_traf_merged = !0), sample.cts = sample.dts, trun.flags & BoxParser.TRUN_FLAGS_CTS_OFFSET && (sample.cts = sample.dts + trun.sample_composition_time_offset[k]), sample_flags = default_sample_flags, trun.flags & BoxParser.TRUN_FLAGS_FLAGS ? sample_flags = trun.sample_flags[k] : 0 === k && trun.flags & BoxParser.TRUN_FLAGS_FIRST_FLAG && (sample_flags = trun.first_sample_flags), sample.is_sync = !(sample_flags >> 16 & 1), sample.is_leading = sample_flags >> 26 & 3, sample.depends_on = sample_flags >> 24 & 3, sample.is_depended_on = sample_flags >> 22 & 3, sample.has_redundancy = sample_flags >> 20 & 3, sample.degradation_priority = 65535 & sample_flags; var bdo, bdop = !!(traf.tfhd.flags & BoxParser.TFHD_FLAG_BASE_DATA_OFFSET), dbim = !!(traf.tfhd.flags & BoxParser.TFHD_FLAG_DEFAULT_BASE_IS_MOOF), dop = !!(trun.flags & BoxParser.TRUN_FLAGS_DATA_OFFSET); bdo = bdop ? traf.tfhd.base_data_offset : dbim || 0 === j ? moof.start : last_run_position, sample.offset = 0 === j && 0 === k ? dop ? bdo + trun.data_offset : bdo : last_run_position, last_run_position = sample.offset + sample.size, (traf.sbgps.length > 0 || traf.sgpds.length > 0 || trak.mdia.minf.stbl.sbgps.length > 0 || trak.mdia.minf.stbl.sgpds.length > 0) && ISOFile.setSampleGroupProperties(trak, sample, sample.number_in_traf, traf.sample_groups_info); } } if (traf.subs) { trak.has_fragment_subsamples = !0; var sample_index = traf.first_sample_index; for (j = 0; j < traf.subs.entries.length; j++) sample_index += traf.subs.entries[j].sample_delta, (sample = trak.samples[sample_index - 1]).subsamples = traf.subs.entries[j].subsamples; } } }, ISOFile.prototype.getSample = function(trak, sampleNum) { var buffer, sample = trak.samples[sampleNum]; if (!this.moov) return null; if (sample.data) { if (sample.alreadyRead == sample.size) return sample; } else sample.data = new Uint8Array(sample.size), sample.alreadyRead = 0, this.samplesDataSize += sample.size, Log.debug("ISOFile", "Allocating sample #" + sampleNum + " on track #" + trak.tkhd.track_id + " of size " + sample.size + " (total: " + this.samplesDataSize + ")"); var index = this.stream.findPosition(!0, sample.offset + sample.alreadyRead, !1); if (index > -1) { var lengthAfterStart = (buffer = this.stream.buffers[index]).byteLength - (sample.offset + sample.alreadyRead - buffer.fileStart); return sample.size - sample.alreadyRead <= lengthAfterStart ? (Log.debug("ISOFile", "Getting sample #" + sampleNum + " data (alreadyRead: " + sample.alreadyRead + " offset: " + (sample.offset + sample.alreadyRead - buffer.fileStart) + " read size: " + (sample.size - sample.alreadyRead) + " full size: " + sample.size + ")"), DataStream.memcpy(sample.data.buffer, sample.alreadyRead, buffer, sample.offset + sample.alreadyRead - buffer.fileStart, sample.size - sample.alreadyRead), buffer.usedBytes += sample.size - sample.alreadyRead, this.stream.logBufferLevel(), sample.alreadyRead = sample.size, sample) : (Log.debug("ISOFile", "Getting sample #" + sampleNum + " partial data (alreadyRead: " + sample.alreadyRead + " offset: " + (sample.offset + sample.alreadyRead - buffer.fileStart) + " read size: " + lengthAfterStart + " full size: " + sample.size + ")"), DataStream.memcpy(sample.data.buffer, sample.alreadyRead, buffer, sample.offset + sample.alreadyRead - buffer.fileStart, lengthAfterStart), sample.alreadyRead += lengthAfterStart, buffer.usedBytes += lengthAfterStart, this.stream.logBufferLevel(), null); } return null; }, ISOFile.prototype.releaseSample = function(trak, sampleNum) { var sample = trak.samples[sampleNum]; return sample.data ? (this.samplesDataSize -= sample.size, sample.data = null, sample.alreadyRead = 0, sample.size) : 0; }, ISOFile.prototype.getAllocatedSampleDataSize = function() { return this.samplesDataSize; }, ISOFile.prototype.getCodecs = function() { var i, codecs = ""; for (i = 0; i < this.moov.traks.length; i++) i > 0 && (codecs += ","), codecs += this.moov.traks[i].mdia.minf.stbl.stsd.entries[0].getCodec(); return codecs; }, ISOFile.prototype.getTrexById = function(id) { var i; if (!this.moov || !this.moov.mvex) return null; for (i = 0; i < this.moov.mvex.trexs.length; i++) { var trex = this.moov.mvex.trexs[i]; if (trex.track_id == id) return trex; } return null; }, ISOFile.prototype.getTrackById = function(id) { if (void 0 === this.moov) return null; for (var j = 0; j < this.moov.traks.length; j++) { var trak = this.moov.traks[j]; if (trak.tkhd.track_id == id) return trak; } return null; }, ISOFile.prototype.items = [], ISOFile.prototype.itemsDataSize = 0, ISOFile.prototype.flattenItemInfo = function() { var i, j, item, items = this.items, meta = this.meta; if (null != meta && void 0 !== meta.hdlr && void 0 !== meta.iinf) { for (i = 0; i < meta.iinf.item_infos.length; i++) (item = {}).id = meta.iinf.item_infos[i].item_ID, items[item.id] = item, item.ref_to = [], item.name = meta.iinf.item_infos[i].item_name, meta.iinf.item_infos[i].protection_index > 0 && (item.protection = meta.ipro.protections[meta.iinf.item_infos[i].protection_index - 1]), meta.iinf.item_infos[i].item_type ? item.type = meta.iinf.item_infos[i].item_type : item.type = "mime", item.content_type = meta.iinf.item_infos[i].content_type, item.content_encoding = meta.iinf.item_infos[i].content_encoding; if (meta.iloc) for (i = 0; i < meta.iloc.items.length; i++) { var itemloc = meta.iloc.items[i]; switch (item = items[itemloc.item_ID], 0 !== itemloc.data_reference_index && (Log.warn("Item storage with reference to other files: not supported"), item.source = meta.dinf.boxes[itemloc.data_reference_index - 1]), itemloc.construction_method) { case 0: break; case 1: case 2: Log.warn("Item storage with construction_method : not supported"); } for (item.extents = [], item.size = 0, j = 0; j < itemloc.extents.length; j++) item.extents[j] = {}, item.extents[j].offset = itemloc.extents[j].extent_offset + itemloc.base_offset, item.extents[j].length = itemloc.extents[j].extent_length, item.extents[j].alreadyRead = 0, item.size += item.extents[j].length; } if (meta.pitm && (items[meta.pitm.item_id].primary = !0), meta.iref) for (i = 0; i < meta.iref.references.length; i++) { var ref = meta.iref.references[i]; for (j = 0; j < ref.references.length; j++) items[ref.from_item_ID].ref_to.push({ type: ref.type, id: ref.references[j] }); } if (meta.iprp) for (var k = 0; k < meta.iprp.ipmas.length; k++) { var ipma = meta.iprp.ipmas[k]; for (i = 0; i < ipma.associations.length; i++) { var association = ipma.associations[i]; for (void 0 === (item = items[association.id]).properties && (item.properties = {}, item.properties.boxes = []), j = 0; j < association.props.length; j++) { var propEntry = association.props[j]; if (propEntry.property_index > 0) { var propbox = meta.iprp.ipco.boxes[propEntry.property_index - 1]; item.properties[propbox.type] = propbox, item.properties.boxes.push(propbox); } } } } } }, ISOFile.prototype.getItem = function(item_id) { var buffer, item; if (!this.meta) return null; if (!(item = this.items[item_id]).data && item.size) item.data = new Uint8Array(item.size), item.alreadyRead = 0, this.itemsDataSize += item.size, Log.debug("ISOFile", "Allocating item #" + item_id + " of size " + item.size + " (total: " + this.itemsDataSize + ")"); else if (item.alreadyRead === item.size) return item; for (var i = 0; i < item.extents.length; i++) { var extent = item.extents[i]; if (extent.alreadyRead !== extent.length) { var index = this.stream.findPosition(!0, extent.offset + extent.alreadyRead, !1); if (!(index > -1)) return null; var lengthAfterStart = (buffer = this.stream.buffers[index]).byteLength - (extent.offset + extent.alreadyRead - buffer.fileStart); if (!(extent.length - extent.alreadyRead <= lengthAfterStart)) return Log.debug("ISOFile", "Getting item #" + item_id + " extent #" + i + " partial data (alreadyRead: " + extent.alreadyRead + " offset: " + (extent.offset + extent.alreadyRead - buffer.fileStart) + " read size: " + lengthAfterStart + " full extent size: " + extent.length + " full item size: " + item.size + ")"), DataStream.memcpy(item.data.buffer, item.alreadyRead, buffer, extent.offset + extent.alreadyRead - buffer.fileStart, lengthAfterStart), extent.alreadyRead += lengthAfterStart, item.alreadyRead += lengthAfterStart, buffer.usedBytes += lengthAfterStart, this.stream.logBufferLevel(), null; Log.debug("ISOFile", "Getting item #" + item_id + " extent #" + i + " data (alreadyRead: " + extent.alreadyRead + " offset: " + (extent.offset + extent.alreadyRead - buffer.fileStart) + " read size: " + (extent.length - extent.alreadyRead) + " full extent size: " + extent.length + " full item size: " + item.size + ")"), DataStream.memcpy(item.data.buffer, item.alreadyRead, buffer, extent.offset + extent.alreadyRead - buffer.fileStart, extent.length - extent.alreadyRead), buffer.usedBytes += extent.length - extent.alreadyRead, this.stream.logBufferLevel(), extent.alreadyRead = extent.length, item.alreadyRead += extent.length; } } return item.alreadyRead === item.size ? item : null; }, ISOFile.prototype.releaseItem = function(item_id) { var item = this.items[item_id]; if (item.data) { this.itemsDataSize -= item.size, item.data = null, item.alreadyRead = 0; for (var i = 0; i < item.extents.length; i++) item.extents[i].alreadyRead = 0; return item.size; } return 0; }, ISOFile.prototype.processItems = function(callback) { for (var i in this.items) { var item = this.items[i]; this.getItem(item.id), callback && !item.sent && (callback(item), item.sent = !0, item.data = null); } }, ISOFile.prototype.hasItem = function(name) { for (var i in this.items) { var item = this.items[i]; if (item.name === name) return item.id; } return -1; }, ISOFile.prototype.getMetaHandler = function() { return this.meta ? this.meta.hdlr.handler : null; }, ISOFile.prototype.getPrimaryItem = function() { return this.meta && this.meta.pitm ? this.getItem(this.meta.pitm.item_id) : null; }, ISOFile.prototype.write = function(outstream) { for (var i = 0; i < this.boxes.length; i++) this.boxes[i].write(outstream); }, ISOFile.prototype.createFragment = function(track_id, sampleNumber, stream_) { var trak = this.getTrackById(track_id), sample = this.getSample(trak, sampleNumber); if (null == sample) return sample = trak.samples[sampleNumber], this.nextSeekPosition ? this.nextSeekPosition = Math.min(sample.offset + sample.alreadyRead, this.nextSeekPosition) : this.nextSeekPosition = trak.samples[sampleNumber].offset + sample.alreadyRead, null; var stream = stream_ || new DataStream; stream.endianness = DataStream.BIG_ENDIAN; var moof = ISOFile.createSingleSampleMoof(sample); moof.write(stream), moof.trafs[0].truns[0].data_offset = moof.size + 8, Log.debug("MP4Box", "Adjusting data_offset with new value " + moof.trafs[0].truns[0].data_offset), stream.adjustUint32(moof.trafs[0].truns[0].data_offset_position, moof.trafs[0].truns[0].data_offset); var mdat = new BoxParser.mdatBox; return mdat.data = sample.data, mdat.write(stream), stream; }, ISOFile.writeInitializationSegment = function(ftyp, moov, total_duration, sample_duration) { var i; Log.debug("ISOFile", "Generating initialization segment"); var stream = new DataStream; stream.endianness = DataStream.BIG_ENDIAN, ftyp.write(stream); var mvex = moov.add("mvex"); for (total_duration && mvex.add("mehd").set("fragment_duration", total_duration), i = 0; i < moov.traks.length; i++) mvex.add("trex").set("track_id", moov.traks[i].tkhd.track_id).set("default_sample_description_index", 1).set("default_sample_duration", sample_duration).set("default_sample_size", 0).set("default_sample_flags", 65536); return moov.write(stream), stream.buffer; }, ISOFile.prototype.save = function(name) { var stream = new DataStream; stream.endianness = DataStream.BIG_ENDIAN, this.write(stream), stream.save(name); }, ISOFile.prototype.getBuffer = function() { var stream = new DataStream; return stream.endianness = DataStream.BIG_ENDIAN, this.write(stream), stream.buffer; }, ISOFile.prototype.initializeSegmentation = function() { var i, initSegs, trak, seg; for (null === this.onSegment && Log.warn("MP4Box", "No segmentation callback set!"), this.isFragmentationInitialized || (this.isFragmentationInitialized = !0, this.nextMoofNumber = 0, this.resetTables()), initSegs = [], i = 0; i < this.fragmentedTracks.length; i++) { var moov = new BoxParser.moovBox; moov.mvhd = this.moov.mvhd, moov.boxes.push(moov.mvhd), trak = this.getTrackById(this.fragmentedTracks[i].id), moov.boxes.push(trak), moov.traks.push(trak), (seg = {}).id = trak.tkhd.track_id, seg.user = this.fragmentedTracks[i].user, seg.buffer = ISOFile.writeInitializationSegment(this.ftyp, moov, this.moov.mvex && this.moov.mvex.mehd ? this.moov.mvex.mehd.fragment_duration : void 0, this.moov.traks[i].samples.length > 0 ? this.moov.traks[i].samples[0].duration : 0), initSegs.push(seg); } return initSegs; }, BoxParser.Box.prototype.printHeader = function(output) { this.size += 8, this.size > MAX_SIZE && (this.size += 8), "uuid" === this.type && (this.size += 16), output.log(output.indent + "size:" + this.size), output.log(output.indent + "type:" + this.type); }, BoxParser.FullBox.prototype.printHeader = function(output) { this.size += 4, BoxParser.Box.prototype.printHeader.call(this, output), output.log(output.indent + "version:" + this.version), output.log(output.indent + "flags:" + this.flags); }, BoxParser.Box.prototype.print = function(output) { this.printHeader(output); }, BoxParser.ContainerBox.prototype.print = function(output) { this.printHeader(output); for (var i = 0; i < this.boxes.length; i++) if (this.boxes[i]) { var prev_indent = output.indent; output.indent += " ", this.boxes[i].print(output), output.indent = prev_indent; } }, ISOFile.prototype.print = function(output) { output.indent = ""; for (var i = 0; i < this.boxes.length; i++) this.boxes[i] && this.boxes[i].print(output); }, BoxParser.mvhdBox.prototype.print = function(output) { BoxParser.FullBox.prototype.printHeader.call(this, output), output.log(output.indent + "creation_time: " + this.creation_time), output.log(output.indent + "modification_time: " + this.modification_time), output.log(output.indent + "timescale: " + this.timescale), output.log(output.indent + "duration: " + this.duration), output.log(output.indent + "rate: " + this.rate), output.log(output.indent + "volume: " + (this.volume >> 8)), output.log(output.indent + "matrix: " + this.matrix.join(", ")), output.log(output.indent + "next_track_id: " + this.next_track_id); }, BoxParser.tkhdBox.prototype.print = function(output) { BoxParser.FullBox.prototype.printHeader.call(this, output), output.log(output.indent + "creation_time: " + this.creation_time), output.log(output.indent + "modification_time: " + this.modification_time), output.log(output.indent + "track_id: " + this.track_id), output.log(output.indent + "duration: " + this.duration), output.log(output.indent + "volume: " + (this.volume >> 8)), output.log(output.indent + "matrix: " + this.matrix.join(", ")), output.log(output.indent + "layer: " + this.layer), output.log(output.indent + "alternate_group: " + this.alternate_group), output.log(output.indent + "width: " + this.width), output.log(output.indent + "height: " + this.height); }; var MP4Box_createFile = function(_keepMdatData, _stream) { var keepMdatData = void 0 === _keepMdatData || _keepMdatData, file = new ISOFile(_stream); return file.discardMdatData = !keepMdatData, file; }; exports.createFile = MP4Box_createFile; }, function(module, exports, __webpack_require__) { "use strict"; "undefined" == typeof process || "renderer" === process.type || !0 === process.browser || process.__nwjs ? module.exports = __webpack_require__(721) : module.exports = __webpack_require__(722); }, function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } exports.log = function() { var _console; return "object" === ("undefined" == typeof console ? "undefined" : _typeof(console)) && console.log && (_console = console).log.apply(_console, arguments); }, exports.formatArgs = function(args) { if (args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff), this.useColors) { var c = "color: " + this.color; args.splice(1, 0, c, "color: inherit"); var index = 0, lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (function(match) { "%%" !== match && (index++, "%c" === match && (lastC = index)); })), args.splice(lastC, 0, c); } }, exports.save = function(namespaces) { try { namespaces ? exports.storage.setItem("debug", namespaces) : exports.storage.removeItem("debug"); } catch (error) {} }, exports.load = function() { var r; try { r = exports.storage.getItem("debug"); } catch (error) {} return !r && "undefined" != typeof process && "env" in process && (r = process.env.DEBUG), r; }, exports.useColors = function() { return !("undefined" == typeof window || !window.process || "renderer" !== window.process.type && !window.process.__nwjs) || ("undefined" == typeof navigator || !navigator.userAgent || !navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) && ("undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); }, exports.storage = (function() { try { return localStorage; } catch (error) {} })(), 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" ], module.exports = __webpack_require__(311)(exports), module.exports.formatters.j = function(v) { try { return JSON.stringify(v); } catch (error) { return "[UnexpectedJSONParseError]: " + error.message; } }; }, function(module, exports, __webpack_require__) { "use strict"; var tty = __webpack_require__(117), util = __webpack_require__(0); exports.init = function(debug) { debug.inspectOpts = {}; for (var keys = Object.keys(exports.inspectOpts), i = 0; i < keys.length; i++) debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; }, exports.log = function() { return process.stderr.write(util.format.apply(util, arguments) + "\n"); }, exports.formatArgs = function(args) { var name = this.namespace; if (this.useColors) { var c = this.color, colorCode = "[3" + (c < 8 ? c : "8;5;" + c), prefix = " ".concat(colorCode, ";1m").concat(name, " "); args[0] = prefix + args[0].split("\n").join("\n" + prefix), args.push(colorCode + "m+" + module.exports.humanize(this.diff) + ""); } else args[0] = (exports.inspectOpts.hideDate ? "" : (new Date).toISOString() + " ") + name + " " + args[0]; }, exports.save = function(namespaces) { namespaces ? process.env.DEBUG = namespaces : delete process.env.DEBUG; }, exports.load = function() { return process.env.DEBUG; }, exports.useColors = function() { return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); }, exports.colors = [ 6, 2, 3, 4, 5, 1 ]; try { var supportsColor = __webpack_require__(313); supportsColor && (supportsColor.stderr || supportsColor).level >= 2 && (exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]); } catch (error) {} exports.inspectOpts = Object.keys(process.env).filter((function(key) { return /^debug_/i.test(key); })).reduce((function(obj, key) { var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (function(_, k) { return k.toUpperCase(); })), val = process.env[key]; return val = !!/^(yes|on|true|enabled)$/i.test(val) || !/^(no|off|false|disabled)$/i.test(val) && ("null" === val ? null : Number(val)), obj[prop] = val, obj; }), {}), module.exports = __webpack_require__(311)(exports); var formatters = module.exports.formatters; formatters.o = function(v) { return this.inspectOpts.colors = this.useColors, util.inspect(v, this.inspectOpts).replace(/\s*\n\s*/g, " "); }, formatters.O = function(v) { return this.inspectOpts.colors = this.useColors, util.inspect(v, this.inspectOpts); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = (flag, argv) => { argv = argv || process.argv; const prefix = flag.startsWith("-") ? "" : 1 === flag.length ? "-" : "--", pos = argv.indexOf(prefix + flag), terminatorPos = argv.indexOf("--"); return -1 !== pos && (-1 === terminatorPos || pos < terminatorPos); }; }, function(module, exports) { var toString = Object.prototype.toString; exports.build = function stringify(obj, prefix) { if (prefix && null == obj) return prefix + "="; if ("[object Array]" == toString.call(obj)) return (function(arr, prefix) { for (var ret = [], i = 0, len = arr.length; i < len; i++) prefix ? ret.push(stringify(arr[i], prefix + "[]")) : ret.push(stringify(arr[i])); return ret.join("&"); })(obj, prefix); if ("[object Object]" == toString.call(obj)) return (function(obj, prefix) { var ret = []; return Object.keys(obj).forEach((function(key) { ret.push(stringify(obj[key], prefix ? prefix + "[" + encodeURIComponent(key) + "]" : encodeURIComponent(key))); })), ret.join("&"); })(obj, prefix); if ("[object Date]" == toString.call(obj)) return obj.toISOString(); if (prefix) return prefix + "=" + encodeURIComponent(String(obj)); if (-1 !== String(obj).indexOf("=")) return String(obj); throw new TypeError("Cannot build a querystring out of: " + obj); }; }, function(module, exports, __webpack_require__) { var readFile = __webpack_require__(2).readFile, basename = __webpack_require__(5).basename; function generate_part(name, part, boundary, callback) { var return_part = "--" + boundary + "\r\n"; function append(data, filename) { if (data) { var binary = -1 == part.content_type.indexOf("text"); return_part += '; filename="' + encodeURIComponent(filename) + '"\r\n', binary && (return_part += "Content-Transfer-Encoding: binary\r\n"), return_part += "Content-Type: " + part.content_type + "\r\n\r\n", return_part += binary ? data.toString("binary") : data.toString("utf8"); } callback(null, return_part + "\r\n"); } if (return_part += 'Content-Disposition: form-data; name="' + name + '"', (part.file || part.buffer) && part.content_type) { var filename = part.filename ? part.filename : part.file ? basename(part.file) : name; if (part.buffer) return append(part.buffer, filename); readFile(part.file, (function(err, data) { if (err) return callback(err); append(data, filename); })); } else { if ("object" == typeof part.value) return callback(new Error("Object received for " + name + ", expected string.")); part.content_type && (return_part += "\r\n", return_part += "Content-Type: " + part.content_type), return_part += "\r\n\r\n", return_part += Buffer.from(String(part.value), "utf8").toString("binary"), append(); } } function flatten(object, into, prefix) { for (var key in into = into || {}, object) { var prefix_key = prefix ? prefix + "[" + key + "]" : key, prop = object[key]; prop && "object" == typeof prop && !(prop.buffer || prop.file || prop.content_type) ? flatten(prop, into, prefix_key) : into[prefix_key] = prop; } return into; } exports.build = function(data, boundary, callback) { if ("object" != typeof data || "function" == typeof data.pipe) return callback(new Error("Multipart builder expects data as key/val object.")); var body = "", object = flatten(data), count = Object.keys(object).length; if (0 === count) return callback(new Error("Empty multipart body. Invalid data.")); function done(err, section) { if (err) return callback(err); section && (body += section), --count || callback(null, body + "--" + boundary + "--"); } for (var key in object) { var value = object[key]; null == value ? done() : Buffer.isBuffer(value) ? generate_part(key, { buffer: value, content_type: "application/octet-stream" }, boundary, done) : generate_part(key, value.buffer || value.file || value.content_type ? value : { value: value }, boundary, done); } }; }, function(module, exports, __webpack_require__) { var createHash = __webpack_require__(6).createHash; function md5(string) { return createHash("md5").update(string).digest("hex"); } function basic(user, pass) { var str = void 0 === pass ? user : [ user, pass ].join(":"); return "Basic " + Buffer.from(str).toString("base64"); } var digest = { parse_header: function(header) { for (var challenge = {}, matches = header.match(/([a-z0-9_-]+)="?([a-z0-9=\/\.@\s-]+)"?/gi), i = 0, l = matches.length; i < l; i++) { var parts = matches[i].split("="), key = parts.shift(), val = parts.join("=").replace(/^"/, "").replace(/"$/, ""); challenge[key] = val; } return challenge; }, update_nc: function(nc) { return ++nc > 99999999 && (nc = 1), nc += "", (new Array(8).join("0") + "").substr(0, 8 - nc.length) + nc; }, generate: function(header, user, pass, method, path) { var nc = 1, cnonce = null, challenge = digest.parse_header(header), ha1 = md5(user + ":" + challenge.realm + ":" + pass), ha2 = md5(method.toUpperCase() + ":" + path), resp = [ ha1, challenge.nonce ]; "string" == typeof challenge.qop && (cnonce = md5(Math.random().toString(36)).substr(0, 8), nc = digest.update_nc(nc), resp = resp.concat(nc, cnonce)), resp = resp.concat(challenge.qop, ha2); var params = { uri: path, realm: challenge.realm, nonce: challenge.nonce, username: user, response: md5(resp.join(":")) }; for (var k in challenge.qop && (params.qop = challenge.qop), challenge.opaque && (params.opaque = challenge.opaque), cnonce && (params.nc = nc, params.cnonce = cnonce), header = [], params) header.push(k + '="' + params[k] + '"'); return "Digest " + header.join(", "); } }; module.exports = { header: function(header, credentials, opts) { var type = header.split(" ")[0], user = credentials[0], pass = credentials[1]; return "Digest" == type ? digest.generate(header, user, pass, opts.method, opts.path) : "Basic" == type ? basic(user, pass) : void 0; }, basic: basic, digest: digest.generate }; }, function(module, exports, __webpack_require__) { var unescape = __webpack_require__(24).unescape, COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/, EXCLUDED_CHARS = /[\x00-\x1F\x7F\x3B\x3B\s\"\,\\"%]/g; function encodeCookieComponent(str) { return str.toString().replace(EXCLUDED_CHARS, encodeURIComponent); } exports.read = function(header) { return header ? (header = Array.isArray(header) ? header : [ header ]).reduce((function(res, str) { var cookie = (function(str) { str = (function(str) { var index = str.indexOf(";"); return -1 === index ? str : str.substr(0, index); })(str = (function(str) { return str.trim().replace(/\x3B+$/, ""); })(str)); var res = COOKIE_PAIR.exec(str); return res && res[3] ? { name: unescape(res[1]), value: unescape(res[3]) } : null; })(str); return cookie && (res[cookie.name] = cookie.value), res; }), {}) : {}; }, exports.write = function(obj) { return Object.keys(obj).reduce((function(str, name) { return str + (str ? "; " : "") + encodeCookieComponent(name) + "=" + encodeCookieComponent(obj[name]); }), ""); }; }, function(module, exports, __webpack_require__) { var Transform = __webpack_require__(3).Transform, sax = __webpack_require__(104), parsers = {}; function buildParser(name, types, fn) { var parser = (function(name, fn) { return { fn: function() { var chunks = [], stream = new Transform({ objectMode: !0 }); return stream._transform = function(chunk, encoding, done) { chunks.push(chunk), done(); }, stream._flush = function(done) { var self = this, data = Buffer.concat(chunks); try { fn(data, (function(err, result) { if (err) throw err; self.push(result); })); } catch (err) { self.push(data); } finally { done(); } }, stream; }, name: name }; })(name, fn); types.forEach((function(type) { parsers[type] = parser; })); } buildParser("json", [ "application/json", "text/javascript" ], (function(buffer, cb) { var err, data; try { data = JSON.parse(buffer); } catch (e) { err = e; } cb(err, data); })), buildParser("xml", [ "text/xml", "application/xml", "application/rdf+xml", "application/rss+xml", "application/atom+xml" ], (function(buffer, cb) { !(function(str, cb) { var obj, current, parser = sax.parser(!0, { trim: !0, lowercase: !0 }); parser.onerror = parser.onend = function(err) { parser.onerror = parser.onend = function() {}, cb(err, obj); }, parser.ontext = function(t) { current && (current.value += t); }, parser.onopentag = function(node) { var element = { name: node.name || "", value: "", attributes: node.attributes || {}, children: [] }; current ? (element.parent = current, current.children.push(element)) : obj = element, current = element; }, parser.onclosetag = function() { if (void 0 !== current.parent) { var just_closed = current; current = current.parent, delete just_closed.parent; } }, parser.write(str).close(); })(buffer.toString(), (function(err, obj) { cb(err, obj); })); })), module.exports = parsers, module.exports.use = buildParser; }, function(module, exports, __webpack_require__) { var iconv, inherits = __webpack_require__(0).inherits, stream = __webpack_require__(3), regex = /(?:charset|encoding)\s*=\s*['"]? *([\w\-]+)/i; function StreamDecoder(charset) { if (!(this instanceof StreamDecoder)) return new StreamDecoder(charset); stream.Transform.call(this, charset), this.charset = charset, this.parsed_chunk = !1; } inherits(StreamDecoder, stream.Transform), StreamDecoder.prototype._transform = function(chunk, encoding, done) { var res, found; if ("iso-8859-1" == this.charset && !this.parsed_chunk) { this.parsed_chunk = !0; var matches = regex.exec(chunk.toString()); matches && (found = matches[1].toLowerCase(), this.charset = "utf-8" == found ? "utf8" : found); } try { res = iconv.decode(chunk, this.charset); } catch (e) { res = chunk; } this.push(res), done(); }, module.exports = function(charset) { try { iconv || (iconv = __webpack_require__(66)); } catch (e) {} return iconv ? new StreamDecoder(charset) : new stream.PassThrough; }; }, function(module) { module.exports = { name: "needle", version: "2.4.0", description: "The leanest and most handsome HTTP client in the Nodelands.", keywords: [ "http", "https", "simple", "request", "client", "multipart", "upload", "proxy", "deflate", "timeout", "charset", "iconv", "cookie", "redirect" ], tags: [ "http", "https", "simple", "request", "client", "multipart", "upload", "proxy", "deflate", "timeout", "charset", "iconv", "cookie", "redirect" ], author: "Tomás Pollak ", repository: { type: "git", url: "https://github.com/tomas/needle.git" }, dependencies: { debug: "^3.2.6", "iconv-lite": "^0.4.4", sax: "^1.2.4" }, devDependencies: { JSONStream: "^1.3.5", jschardet: "^1.6.0", mocha: "^5.2.0", q: "^1.5.1", should: "^13.2.3", sinon: "^2.3.0", xml2js: "^0.4.19" }, scripts: { test: "mocha test" }, directories: { lib: "./lib" }, main: "./lib/needle", bin: { needle: "./bin/needle" }, license: "MIT", engines: { node: ">= 4.4.x" } }; }, function(module, exports, __webpack_require__) { var paths, convertQueue, common = __webpack_require__(81), videoapi = __webpack_require__(304), thumbApi = module.exports; thumbApi.thumbMiddleware = function(req, res) { videoapi.probeVideo(req.params.from, (function(err, instance) { if (err) return common.handleErr(err, res); var args = [ "-ss", isNaN(req.query.at) ? Math.round(instance.duration / 1e3 / 2) : req.query.at, "-i", req.params.from, "-r", "1", "-vframes", "1", "-f", "image2", "-vcodec", "mjpeg", "pipe:1" ]; common.serveFfmpeg(args, "image/jpg", res); })); }, thumbApi.init = function(pathsParam, convertQueueParam) { paths = pathsParam, convertQueue = convertQueueParam, common.init(paths, convertQueue); }; }, function(module, exports, __webpack_require__) { var map = { "./af": 314, "./af.js": 314, "./ar": 315, "./ar-ma": 316, "./ar-ma.js": 316, "./ar-sa": 317, "./ar-sa.js": 317, "./ar-tn": 318, "./ar-tn.js": 318, "./ar.js": 315, "./az": 319, "./az.js": 319, "./be": 320, "./be.js": 320, "./bg": 321, "./bg.js": 321, "./bn": 322, "./bn.js": 322, "./bo": 323, "./bo.js": 323, "./br": 324, "./br.js": 324, "./bs": 325, "./bs.js": 325, "./ca": 326, "./ca.js": 326, "./cs": 327, "./cs.js": 327, "./cv": 328, "./cv.js": 328, "./cy": 329, "./cy.js": 329, "./da": 330, "./da.js": 330, "./de": 331, "./de-at": 332, "./de-at.js": 332, "./de.js": 331, "./el": 333, "./el.js": 333, "./en-au": 334, "./en-au.js": 334, "./en-ca": 335, "./en-ca.js": 335, "./en-gb": 336, "./en-gb.js": 336, "./eo": 337, "./eo.js": 337, "./es": 338, "./es.js": 338, "./et": 339, "./et.js": 339, "./eu": 340, "./eu.js": 340, "./fa": 341, "./fa.js": 341, "./fi": 342, "./fi.js": 342, "./fo": 343, "./fo.js": 343, "./fr": 344, "./fr-ca": 345, "./fr-ca.js": 345, "./fr.js": 344, "./fy": 346, "./fy.js": 346, "./gl": 347, "./gl.js": 347, "./he": 348, "./he.js": 348, "./hi": 349, "./hi.js": 349, "./hr": 350, "./hr.js": 350, "./hu": 351, "./hu.js": 351, "./hy-am": 352, "./hy-am.js": 352, "./id": 353, "./id.js": 353, "./is": 354, "./is.js": 354, "./it": 355, "./it.js": 355, "./ja": 356, "./ja.js": 356, "./jv": 357, "./jv.js": 357, "./ka": 358, "./ka.js": 358, "./km": 359, "./km.js": 359, "./ko": 360, "./ko.js": 360, "./lb": 361, "./lb.js": 361, "./lt": 362, "./lt.js": 362, "./lv": 363, "./lv.js": 363, "./me": 364, "./me.js": 364, "./mk": 365, "./mk.js": 365, "./ml": 366, "./ml.js": 366, "./mr": 367, "./mr.js": 367, "./ms": 368, "./ms-my": 369, "./ms-my.js": 369, "./ms.js": 368, "./my": 370, "./my.js": 370, "./nb": 371, "./nb.js": 371, "./ne": 372, "./ne.js": 372, "./nl": 373, "./nl.js": 373, "./nn": 374, "./nn.js": 374, "./pl": 375, "./pl.js": 375, "./pt": 376, "./pt-br": 377, "./pt-br.js": 377, "./pt.js": 376, "./ro": 378, "./ro.js": 378, "./ru": 379, "./ru.js": 379, "./si": 380, "./si.js": 380, "./sk": 381, "./sk.js": 381, "./sl": 382, "./sl.js": 382, "./sq": 383, "./sq.js": 383, "./sr": 384, "./sr-cyrl": 385, "./sr-cyrl.js": 385, "./sr.js": 384, "./sv": 386, "./sv.js": 386, "./ta": 387, "./ta.js": 387, "./th": 388, "./th.js": 388, "./tl-ph": 389, "./tl-ph.js": 389, "./tr": 390, "./tr.js": 390, "./tzl": 391, "./tzl.js": 391, "./tzm": 392, "./tzm-latn": 393, "./tzm-latn.js": 393, "./tzm.js": 392, "./uk": 394, "./uk.js": 394, "./uz": 395, "./uz.js": 395, "./vi": 396, "./vi.js": 396, "./zh-cn": 397, "./zh-cn.js": 397, "./zh-tw": 398, "./zh-tw.js": 398 }; function webpackContext(req) { var id = webpackContextResolve(req); return __webpack_require__(id); } function webpackContextResolve(req) { if (!__webpack_require__.o(map, req)) { var e = new Error("Cannot find module '" + req + "'"); throw e.code = "MODULE_NOT_FOUND", e; } return map[req]; } webpackContext.keys = function() { return Object.keys(map); }, webpackContext.resolve = webpackContextResolve, module.exports = webpackContext, webpackContext.id = 732; }, function(module, exports, __webpack_require__) { var subRetriever = __webpack_require__(734), subParser = __webpack_require__(793).parseString; module.exports = function(args, callback) { if (!args.url) return callback(new Error("pass .url")); subRetriever.retrieveSrt(args.url, (function(err, buf) { if (err) return callback(err); try { var tracks = subParser(buf.toString()); } catch (e) { callback(e); } callback(null, { url: args.url, tracks: Object.keys(tracks).map((function(key) { return tracks[key]; })) }); })); }; }, function(module, exports, __webpack_require__) { var stream = __webpack_require__(3), needle = __webpack_require__(735), fs = __webpack_require__(2), iconv = __webpack_require__(66), charsetDetector = __webpack_require__(750), zlib = __webpack_require__(43), zip = __webpack_require__(781), _ = __webpack_require__(407); function streamFromPath(path, agent) { return path instanceof stream.Readable ? path : path.match("^http") ? needle.get(path, { agent: agent, follow_max: 12 }) : fs.createReadStream(path); } module.exports = { streamFromPath: streamFromPath, retrieveSrt: function retrieveSrt(path, cb, options) { var callback = _.once((function(err, res) { if (err && options && options.agent) return retrieveSrt(path, cb); cb(err, res); })); if ((stream = streamFromPath(path, options && options.agent)).on("error", (function(err) { callback(err); })), path.match("zip$")) { var foundSrt = !1, bufs = [], zipbufs = []; stream.on("data", (function(b) { zipbufs.push(b); })), stream.on("end", (function() { try { zip.Reader(Buffer.concat(zipbufs)).forEach((function(entry) { entry.getName().match("srt$") && !foundSrt && (foundSrt = !0, bufs.push(entry.getData())); })); } catch (e) { return callback(e); } if (!foundSrt) return callback(new Error("no srt found in zip file " + path)); onDownloaded(); })); } else { if (path.match("gz$")) var stream = stream.pipe(zlib.createUnzip()); bufs = [], stream.on("data", (function(dat) { bufs.push(dat); })), stream.on("end", onDownloaded), stream.on("error", (function(e) { callback(e); })); } function onDownloaded() { var charset, buf = Buffer.concat(bufs); try { charset = "ISO-8859-8-I" == (charset = options && options.charset && "auto" != options.charset ? options.charset : charsetDetector(buf)[0].charsetName) ? "ISO-8859-8" : charset, buf = iconv.decode(buf, charset); } catch (e) { return void callback(e); } callback(null, buf); } } }; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2), http = __webpack_require__(11), https = __webpack_require__(21), url = __webpack_require__(7), stream = __webpack_require__(3), debug = __webpack_require__(9)("needle"), stringify = __webpack_require__(736).build, multipart = __webpack_require__(737), auth = __webpack_require__(738), cookies = __webpack_require__(739), parsers = __webpack_require__(740), decoder = __webpack_require__(748), version = __webpack_require__(749).version, user_agent = "Needle/" + version; user_agent += " (Node.js " + process.version + "; " + process.platform + " " + process.arch + ")"; var close_by_default = !http.Agent || http.Agent.defaultMaxSockets != 1 / 0, decompressors = {}; try { var zlib = __webpack_require__(43); decompressors["x-deflate"] = zlib.Inflate, decompressors.deflate = zlib.Inflate, decompressors["x-gzip"] = zlib.Gunzip, decompressors.gzip = zlib.Gunzip; } catch (e) {} var defaults = { boundary: "--------------------NODENEEDLEHTTPCLIENT", encoding: "utf8", parse_response: "all", accept: "*/*", user_agent: user_agent, open_timeout: 1e4, read_timeout: 0, follow_max: 0, decode_response: !0, parse_cookies: !0, follow_set_cookies: !1, follow_set_referer: !1, follow_keep_method: !1, follow_if_same_host: !1, follow_if_same_protocol: !1 }, aliased = { options: { decode: "decode_response", parse: "parse_response", timeout: "open_timeout", follow: "follow_max" }, inverted: {} }; function keys_by_type(type) { return Object.keys(defaults).map((function(el) { if (defaults[el].constructor == type) return el; })).filter((function(el) { return el; })); } function is_stream(obj) { return "function" == typeof obj.pipe; } function Needle(method, uri, data, options, callback) { if ("string" != typeof uri) throw new TypeError("URL must be a string, not " + uri); this.method = method, this.uri = uri, this.data = data, "function" == typeof options ? (this.callback = options, this.options = {}) : (this.callback = callback, this.options = options); } Object.keys(aliased.options).map((function(k) { var value = aliased.options[k]; aliased.inverted[value] = k; })), Needle.prototype.setup = function(uri, options) { function get_option(key, fallback) { return void 0 !== options[key] ? options[key] : void 0 !== options[aliased.inverted[key]] ? options[aliased.inverted[key]] : fallback; } function check_value(expected, key) { var value = get_option(key), type = typeof value; if ("undefined" != type && type != expected) throw new TypeError(type + " received for " + key + ", but expected a " + expected); return type == expected ? value : defaults[key]; } var config = { http_opts: {}, proxy: options.proxy, output: options.output, parser: get_option("parse_response", defaults.parse_response), encoding: options.encoding || (options.multipart ? "binary" : defaults.encoding) }; if (keys_by_type(Boolean).forEach((function(key) { config[key] = check_value("boolean", key); })), keys_by_type(Number).forEach((function(key) { config[key] = check_value("number", key); })), "agent pfx key passphrase cert ca ciphers rejectUnauthorized secureProtocol checkServerIdentity".split(" ").forEach((function(key) { void 0 !== options[key] && (config.http_opts[key] = options[key], void 0 === options.agent && (config.http_opts.agent = !1)); })), config.headers = { accept: options.accept || defaults.accept, "user-agent": options.user_agent || defaults.user_agent }, (options.connection || close_by_default) && (config.headers.connection = options.connection || "close"), (options.compressed || defaults.compressed) && void 0 !== zlib && (config.headers["accept-encoding"] = "gzip,deflate"), options.cookies && (config.headers.cookie = cookies.write(options.cookies)), -1 !== uri.indexOf("@")) { var parts = (url.parse(uri).auth || "").split(":"); options.username = parts[0], options.password = parts[1]; } if (options.username && (!options.auth || "auto" != options.auth && "digest" != options.auth ? config.headers.authorization = auth.basic(options.username, options.password) : config.credentials = [ options.username, options.password ]), config.proxy) { if (-1 === config.proxy.indexOf("http") && (config.proxy = "http://" + config.proxy), -1 !== config.proxy.indexOf("@")) { var proxy = (url.parse(config.proxy).auth || "").split(":"); options.proxy_user = proxy[0], options.proxy_pass = proxy[1]; } options.proxy_user && (config.headers["proxy-authorization"] = auth.basic(options.proxy_user, options.proxy_pass)); } for (var h in options.headers) config.headers[h.toLowerCase()] = options.headers[h]; return config; }, Needle.prototype.start = function() { var out = new stream.PassThrough({ objectMode: !1 }), uri = this.uri, data = this.data, method = this.method, callback = "function" == typeof this.options ? this.options : this.callback, options = this.options || {}; -1 === uri.indexOf("http") && (uri = uri.replace(/^(\/\/)?/, "http://")); var body, config = this.setup(uri, options); if (data) { if (options.multipart) { var self = this, boundary = options.boundary || defaults.boundary; return multipart.build(data, boundary, (function(err, parts) { if (err) throw err; config.headers["content-type"] = "multipart/form-data; boundary=" + boundary, config.headers["content-length"] = parts.length, self.send_request(1, method, uri, config, parts, out, callback); })), out; } if (is_stream(data) || Buffer.isBuffer(data)) { if (is_stream(data) && "GET" == method.toUpperCase()) throw new Error("Refusing to pipe() a stream via GET. Did you mean .post?"); body = data; } else "GET" != method.toUpperCase() || options.json ? (body = "string" == typeof data ? data : options.json ? JSON.stringify(data) : stringify(data), body = new Buffer(body, config.encoding)) : uri = uri.replace(/\?.*|$/, "?" + stringify(data)); } return body && (body.length && (config.headers["content-length"] = body.length), config.headers["content-type"] || (config.headers["content-type"] = options.json ? "application/json; charset=utf-8" : "application/x-www-form-urlencoded"), options.json && config.headers.accept === defaults.accept && (config.headers.accept = "application/json")), this.send_request(1, method, uri, config, body, out, callback); }, Needle.prototype.get_request_opts = function(method, uri, config) { var opts = config.http_opts, proxy = config.proxy, remote = proxy ? url.parse(proxy) : url.parse(uri); if (opts.protocol = remote.protocol, opts.host = remote.hostname, opts.port = remote.port || ("https:" == remote.protocol ? 443 : 80), opts.path = proxy ? uri : remote.pathname + (remote.search || ""), opts.method = method, opts.headers = config.headers, !opts.headers.host) { var target = proxy ? url.parse(uri) : remote; opts.headers.host = target.hostname, target.port && -1 === [ 80, 443 ].indexOf(target.port) && (opts.headers.host += ":" + target.port); } return opts; }, Needle.prototype.should_follow = function(location, config, original) { if (!location) return !1; function matches(property) { return property = original[property], -1 !== location.indexOf(property); } return !(location === original || config.follow_if_same_host && !matches("host") || config.follow_if_same_protocol && !matches("protocol")); }, Needle.prototype.send_request = function(count, method, uri, config, post_data, out, callback) { var timer, returned = 0, self = this, request_opts = this.get_request_opts(method, uri, config), protocol = "https:" == request_opts.protocol ? https : http; function done(err, resp, body) { return returned++ > 0 ? debug("Already finished, stopping here.") : (timer && clearTimeout(timer), request.removeListener("error", had_error), callback ? callback(err, resp, body) : void out.emit("end", err, resp, body)); } function had_error(err) { debug("Request error", err), done(err || new Error("Unknown error when making request.")); } function set_timeout(milisecs) { milisecs <= 0 || (timer = setTimeout((function() { request.abort(); }), milisecs)); } function on_socket_end() { this.writable || !1 !== this.destroyed || (this.destroy(), had_error(new Error("Remote end closed socket abruptly."))); } debug("Making request #" + count, request_opts); var request = protocol.request(request_opts, (function(resp) { var headers = resp.headers; if (debug("Got response", resp.statusCode, headers), timer && clearTimeout(timer), set_timeout(config.read_timeout), headers["set-cookie"] && config.parse_cookies && (resp.cookies = cookies.read(headers["set-cookie"]), debug("Got cookies", resp.cookies)), -1 !== [ 301, 302, 303 ].indexOf(resp.statusCode) && self.should_follow(headers.location, config, uri)) { if (count <= config.follow_max) return out.emit("redirect", headers.location), config.follow_keep_method || (method = "GET", post_data = null, delete config.headers["content-length"]), config.follow_set_cookies && resp.cookies && (config.headers.cookie = cookies.write(resp.cookies)), config.follow_set_referer && (config.headers.referer = uri), config.headers.host = null, debug("Redirecting to " + url.resolve(uri, headers.location)), self.send_request(++count, method, url.resolve(uri, headers.location), config, post_data, out, callback); if (config.follow_max > 0) return done(new Error("Max redirects reached. Possible loop in: " + headers.location)); } if (401 == resp.statusCode && headers["www-authenticate"] && config.credentials && !config.headers.authorization) { var auth_header = auth.header(headers["www-authenticate"], config.credentials, request_opts); if (auth_header) return config.headers.authorization = auth_header, self.send_request(count, method, uri, config, post_data, out, callback); } out.emit("header", resp.statusCode, headers), out.emit("headers", headers); var pipeline = [], mime = (function(header) { if (!header || "" === header) return {}; var charset = "iso-8859-1", arr = header.split(";"); try { charset = arr[1].match(/charset=(.+)/)[1]; } catch (e) {} return { type: arr[0], charset: charset }; })(headers["content-type"]), text_response = mime.type && -1 != mime.type.indexOf("text/"); if (headers["content-encoding"] && decompressors[headers["content-encoding"]]) { var decompressor = decompressors[headers["content-encoding"]](); decompressor.on("error", had_error), pipeline.push(decompressor); } if (config.parser && parsers[mime.type]) { var parser_name = config.parser.toString().toLowerCase(); -1 != [ "xml", "json" ].indexOf(parser_name) && parsers[mime.type].name != parser_name || (out.parser = parsers[mime.type].name, pipeline.push(parsers[mime.type].fn()), out._writableState.objectMode = !0, out._readableState.objectMode = !0); } else text_response && config.decode_response && mime.charset && !mime.charset.match(/utf-?8$/i) && pipeline.push(decoder(mime.charset)); pipeline.push(out); for (var tmp = resp; pipeline.length; ) tmp = tmp.pipe(pipeline.shift()); if (config.output && 200 == resp.statusCode) { var file = fs.createWriteStream(config.output); file.on("error", had_error), out.on("end", (function() { file.writable && file.end(); })), out.on("readable", (function() { for (var chunk; chunk = this.read(); ) file.writable && file.write(chunk); })); } if (callback) { resp.raw = [], resp.body = [], resp.bytes = 0; var clean_pipe = new stream.PassThrough; resp.pipe(clean_pipe), clean_pipe.on("readable", (function() { for (var chunk; chunk = this.read(); ) resp.bytes += chunk.length, resp.raw.push(chunk); })), out.on("readable", (function() { for (var chunk; null !== (chunk = this.read()); ) "string" == typeof chunk && (chunk = new Buffer(chunk)), resp.body.push(chunk); })), out.on("end", (function() { resp.raw = Buffer.concat(resp.raw), void 0 === resp.body[0] || Buffer.isBuffer(resp.body[0]) ? (resp.body = Buffer.concat(resp.body), (text_response || out.parser) && (resp.body = resp.body.toString())) : (resp.body = resp.body[0], out.parser && (resp.parser = out.parser)), done(null, resp, resp.body); })); } })); return set_timeout(config.open_timeout), request.on("error", had_error), request.once("socket", (function(socket) { socket.on_socket_end || (socket.on_socket_end = on_socket_end, socket.on("end", socket.on_socket_end)); })), post_data ? is_stream(post_data) ? post_data.pipe(request) : (request.write(post_data, config.encoding), request.end()) : request.end(), out.request = request, out; }, exports.version = version, exports.defaults = function(obj) { for (var key in obj) { var target_key = aliased.options[key] || key; if (defaults.hasOwnProperty(target_key) && void 0 !== obj[key]) { var valid_type = defaults[target_key].constructor.name; if ("parse_response" != target_key && obj[key].constructor.name != valid_type) throw new TypeError("Invalid type for " + key + ", should be " + valid_type); defaults[target_key] = obj[key]; } } return defaults; }, "head get".split(" ").forEach((function(method) { exports[method] = function(uri, options, callback) { return new Needle(method, uri, null, options, callback).start(); }; })), "post put patch delete".split(" ").forEach((function(method) { exports[method] = function(uri, data, options, callback) { return new Needle(method, uri, data, options, callback).start(); }; })), exports.request = function(method, uri, data, opts, callback) { return new Needle(method, uri, data, opts, callback).start(); }; }, function(module, exports) { exports.build = function stringify(obj, prefix) { if (prefix && null == obj) return prefix + "="; if (obj.constructor == Array) return (function(arr, prefix) { for (var ret = [], i = 0, len = arr.length; i < len; i++) prefix ? ret.push(stringify(arr[i], prefix + "[" + i + "]")) : ret.push(stringify(arr[i])); return ret.join("&"); })(obj, prefix); if (null !== obj && "object" == typeof obj) return (function(obj, prefix) { var ret = []; return Object.keys(obj).forEach((function(key) { ret.push(stringify(obj[key], prefix ? prefix + "[" + encodeURIComponent(key) + "]" : encodeURIComponent(key))); })), ret.join("&"); })(obj, prefix); if (prefix) return prefix + "=" + encodeURIComponent(String(obj)); if (-1 !== String(obj).indexOf("=")) return String(obj); throw new TypeError("Cannot build a querystring out of: " + obj); }; }, function(module, exports, __webpack_require__) { var readFile = __webpack_require__(2).readFile, basename = __webpack_require__(5).basename; function generate_part(name, part, boundary, callback) { var return_part = "--" + boundary + "\r\n"; function append(data, filename) { if (data) { var binary = -1 == part.content_type.indexOf("text"); return_part += '; filename="' + encodeURIComponent(filename) + '"\r\n', binary && (return_part += "Content-Transfer-Encoding: binary\r\n"), return_part += "Content-Type: " + part.content_type + "\r\n\r\n", return_part += binary ? data.toString("binary") : data.toString("utf8"); } callback(null, return_part + "\r\n"); } if (return_part += 'Content-Disposition: form-data; name="' + name + '"', (part.file || part.buffer) && part.content_type) { var filename = part.filename ? part.filename : part.file ? basename(part.file) : name; if (part.buffer) return append(part.buffer, filename); readFile(part.file, (function(err, data) { if (err) return callback(err); append(data, filename); })); } else { if ("object" == typeof part.value) return callback(new Error("Object received for " + name + ", expected string.")); part.content_type && (return_part += "\r\n", return_part += "Content-Type: " + part.content_type), return_part += "\r\n\r\n", return_part += new Buffer(String(part.value), "utf8").toString("binary"), append(); } } function flatten(object, into, prefix) { for (var key in into = into || {}, object) { var prefix_key = prefix ? prefix + "[" + key + "]" : key, prop = object[key]; prop && "object" == typeof prop && !(prop.buffer || prop.file || prop.content_type) ? flatten(prop, into, prefix_key) : into[prefix_key] = prop; } return into; } exports.build = function(data, boundary, callback) { if ("object" != typeof data || "function" == typeof data.pipe) return callback(new Error("Multipart builder expects data as key/val object.")); var body = "", object = flatten(data), count = Object.keys(object).length; if (0 === count) return callback(new Error("Empty multipart body. Invalid data.")); function done(err, section) { if (err) return callback(err); section && (body += section), --count || callback(null, body + "--" + boundary + "--"); } for (var key in object) { var value = object[key]; null == value ? done() : generate_part(key, value.buffer || value.file || value.content_type ? value : { value: value }, boundary, done); } }; }, function(module, exports, __webpack_require__) { var createHash = __webpack_require__(6).createHash; function md5(string) { return createHash("md5").update(string).digest("hex"); } function basic(user, pass) { var str = void 0 === pass ? user : [ user, pass ].join(":"); return "Basic " + new Buffer(str).toString("base64"); } var digest = { parse_header: function(header) { for (var challenge = {}, matches = header.match(/([a-z0-9_-]+)="?([a-z0-9=\/\.@\s-]+)"?/gi), i = 0, l = matches.length; i < l; i++) { var parts = matches[i].split("="), key = parts.shift(), val = parts.join("=").replace(/^"/, "").replace(/"$/, ""); challenge[key] = val; } return challenge; }, update_nc: function(nc) { return ++nc > 99999999 && (nc = 1), nc += "", (new Array(8).join("0") + "").substr(0, 8 - nc.length) + nc; }, generate: function(header, user, pass, method, path) { var nc = 1, cnonce = null, challenge = digest.parse_header(header), ha1 = md5(user + ":" + challenge.realm + ":" + pass), ha2 = md5(method.toUpperCase() + ":" + path), resp = [ ha1, challenge.nonce ]; "string" == typeof challenge.qop && (cnonce = md5(Math.random().toString(36)).substr(0, 8), nc = digest.update_nc(nc), resp = resp.concat(nc, cnonce)), resp = resp.concat(challenge.qop, ha2); var params = { uri: path, realm: challenge.realm, nonce: challenge.nonce, username: user, response: md5(resp.join(":")) }; for (var k in challenge.qop && (params.qop = challenge.qop), challenge.opaque && (params.opaque = challenge.opaque), cnonce && (params.nc = nc, params.cnonce = cnonce), header = [], params) header.push(k + '="' + params[k] + '"'); return "Digest " + header.join(", "); } }; module.exports = { header: function(header, credentials, opts) { var type = header.split(" ")[0], user = credentials[0], pass = credentials[1]; return "Digest" == type ? digest.generate(header, user, pass, opts.method, opts.path) : "Basic" == type ? basic(user, pass) : void 0; }, basic: basic, digest: digest.generate }; }, function(module, exports) { const COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/, EXCLUDED_CHARS = /[\x00-\x1F\x7F\x3B\x3B\s\"\,\\"%]/g; function encodeCookieComponent(str) { return str.toString().replace(EXCLUDED_CHARS, encodeURIComponent); } exports.read = function(header) { return (header = header instanceof Array ? header : [ header ]).reduce((function(res, str) { var cookie = (function(str) { str = (function(str) { var index = str.indexOf(";"); return -1 === index ? str : str.substr(0, index); })(str = (function(str) { return str.trim().replace(/\x3B+$/, ""); })(str)); var res = COOKIE_PAIR.exec(str); return res && res[3] ? { name: decodeURIComponent(res[1]), value: decodeURIComponent(res[3]) } : null; })(str); return cookie && (res[cookie.name] = cookie.value), res; }), {}); }, exports.write = function(obj) { return Object.keys(obj).reduce((function(str, name) { return str + (str ? "; " : "") + encodeCookieComponent(name) + "=" + encodeCookieComponent(obj[name]); }), ""); }; }, function(module, exports, __webpack_require__) { var Transform = __webpack_require__(3).Transform; function parserFactory(name, fn) { return { fn: function() { var chunks = [], stream = new Transform({ objectMode: !0 }); return stream._transform = function(chunk, encoding, done) { chunks.push(chunk), done(); }, stream._flush = function(done) { var self = this, data = Buffer.concat(chunks); try { fn(data, (function(err, result) { if (err) throw err; self.push(result); })); } catch (err) { self.push(data); } finally { done(); } }, stream; }, name: name }; } var json = parserFactory("json", (function(buffer, cb) { var err, data; try { data = JSON.parse(buffer); } catch (e) { err = e; } cb(err, data); })); module.exports["application/json"] = json, module.exports["text/javascript"] = json; try { var xml = parserFactory("xml", new (__webpack_require__(188).Parser)({ explicitRoot: !0, explicitArray: !1 }).parseString); module.exports["text/xml"] = xml, module.exports["application/xml"] = xml, module.exports["application/rdf+xml"] = xml, module.exports["application/rss+xml"] = xml, module.exports["application/atom+xml"] = xml; } catch (e) {} }, function(module, exports, __webpack_require__) { (function() { "use strict"; var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty; builder = __webpack_require__(742), defaults = __webpack_require__(189).defaults, requiresCDATA = function(entry) { return "string" == typeof entry && (entry.indexOf("&") >= 0 || entry.indexOf(">") >= 0 || entry.indexOf("<") >= 0); }, wrapCDATA = function(entry) { return ""; }, escapeCDATA = function(entry) { return entry.replace("]]>", "]]]]>"); }, exports.Builder = (function() { function Builder(opts) { var key, ref, value; for (key in this.options = {}, ref = defaults[.2]) hasProp.call(ref, key) && (value = ref[key], this.options[key] = value); for (key in opts) hasProp.call(opts, key) && (value = opts[key], this.options[key] = value); } return Builder.prototype.buildObject = function(rootObj) { var attrkey, charkey, render, rootElement, rootName, _this; return attrkey = this.options.attrkey, charkey = this.options.charkey, 1 === Object.keys(rootObj).length && this.options.rootName === defaults[.2].rootName ? rootObj = rootObj[rootName = Object.keys(rootObj)[0]] : rootName = this.options.rootName, _this = this, render = function(element, obj) { var attr, child, entry, index, key, value; if ("object" != typeof obj) _this.options.cdata && requiresCDATA(obj) ? element.raw(wrapCDATA(obj)) : element.txt(obj); else if (Array.isArray(obj)) { for (index in obj) if (hasProp.call(obj, index)) for (key in child = obj[index]) entry = child[key], element = render(element.ele(key), entry).up(); } else for (key in obj) if (hasProp.call(obj, key)) if (child = obj[key], key === attrkey) { if ("object" == typeof child) for (attr in child) value = child[attr], element = element.att(attr, value); } else if (key === charkey) element = _this.options.cdata && requiresCDATA(child) ? element.raw(wrapCDATA(child)) : element.txt(child); else if (Array.isArray(child)) for (index in child) hasProp.call(child, index) && (element = "string" == typeof (entry = child[index]) ? _this.options.cdata && requiresCDATA(entry) ? element.ele(key).raw(wrapCDATA(entry)).up() : element.ele(key, entry).up() : render(element.ele(key), entry).up()); else "object" == typeof child ? element = render(element.ele(key), child).up() : "string" == typeof child && _this.options.cdata && requiresCDATA(child) ? element = element.ele(key).raw(wrapCDATA(child)).up() : (null == child && (child = ""), element = element.ele(key, child.toString()).up()); return element; }, rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, { headless: this.options.headless, allowSurrogateChars: this.options.allowSurrogateChars }), render(rootElement, rootObj).end(this.options.renderOpts); }, Builder; })(); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref; ref = __webpack_require__(57), assign = ref.assign, isFunction = ref.isFunction, XMLDocument = __webpack_require__(743), XMLDocumentCB = __webpack_require__(744), XMLStringWriter = __webpack_require__(190), XMLStreamWriter = __webpack_require__(745), module.exports.create = function(name, xmldec, doctype, options) { var doc, root; if (null == name) throw new Error("Root element needs a name"); return options = assign({}, xmldec, doctype, options), root = (doc = new XMLDocument(options)).element(name), options.headless || (doc.declaration(options), null == options.pubID && null == options.sysID || doc.doctype(options)), root; }, module.exports.begin = function(options, onData, onEnd) { var ref1; return isFunction(options) && (onData = (ref1 = [ options, onData ])[0], onEnd = ref1[1], options = {}), onData ? new XMLDocumentCB(options, onData, onEnd) : new XMLDocument(options); }, module.exports.stringWriter = function(options) { return new XMLStringWriter(options); }, module.exports.streamWriter = function(stream, options) { return new XMLStreamWriter(stream, options); }; }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLNode, XMLStringWriter, XMLStringifier, isPlainObject, hasProp = {}.hasOwnProperty; isPlainObject = __webpack_require__(57).isPlainObject, XMLNode = __webpack_require__(37), XMLStringifier = __webpack_require__(401), XMLStringWriter = __webpack_require__(190), module.exports = (function(superClass) { function XMLDocument(options) { XMLDocument.__super__.constructor.call(this, null), options || (options = {}), options.writer || (options.writer = new XMLStringWriter), this.options = options, this.stringify = new XMLStringifier(options), this.isDocument = !0; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLDocument, superClass), XMLDocument.prototype.end = function(writer) { var writerOptions; return writer ? isPlainObject(writer) && (writerOptions = writer, writer = this.options.writer.set(writerOptions)) : writer = this.options.writer, writer.document(this); }, XMLDocument.prototype.toString = function(options) { return this.options.writer.set(options).document(this); }, XMLDocument; })(XMLNode); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, isFunction, isObject, isPlainObject, ref, hasProp = {}.hasOwnProperty; ref = __webpack_require__(57), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, XMLElement = __webpack_require__(128), XMLCData = __webpack_require__(129), XMLComment = __webpack_require__(130), XMLRaw = __webpack_require__(137), XMLText = __webpack_require__(138), XMLProcessingInstruction = __webpack_require__(139), XMLDeclaration = __webpack_require__(131), XMLDocType = __webpack_require__(132), XMLDTDAttList = __webpack_require__(133), XMLDTDEntity = __webpack_require__(134), XMLDTDElement = __webpack_require__(135), XMLDTDNotation = __webpack_require__(136), XMLAttribute = __webpack_require__(400), XMLStringifier = __webpack_require__(401), XMLStringWriter = __webpack_require__(190), module.exports = (function() { function XMLDocumentCB(options, onData, onEnd) { var writerOptions; options || (options = {}), options.writer ? isPlainObject(options.writer) && (writerOptions = options.writer, options.writer = new XMLStringWriter(writerOptions)) : options.writer = new XMLStringWriter(options), this.options = options, this.writer = options.writer, this.stringify = new XMLStringifier(options), this.onDataCallback = onData || function() {}, this.onEndCallback = onEnd || function() {}, this.currentNode = null, this.currentLevel = -1, this.openTags = {}, this.documentStarted = !1, this.documentCompleted = !1, this.root = null; } return XMLDocumentCB.prototype.node = function(name, attributes, text) { var ref1; if (null == name) throw new Error("Missing node name"); if (this.root && -1 === this.currentLevel) throw new Error("Document can only have one root node"); return this.openCurrent(), name = name.valueOf(), null == attributes && (attributes = {}), attributes = attributes.valueOf(), isObject(attributes) || (text = (ref1 = [ attributes, text ])[0], attributes = ref1[1]), this.currentNode = new XMLElement(this, name, attributes), this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, null != text && this.text(text), this; }, XMLDocumentCB.prototype.element = function(name, attributes, text) { return this.currentNode && this.currentNode instanceof XMLDocType ? this.dtdElement.apply(this, arguments) : this.node(name, attributes, text); }, XMLDocumentCB.prototype.attribute = function(name, value) { var attName, attValue; if (!this.currentNode || this.currentNode.children) throw new Error("att() can only be used immediately after an ele() call in callback mode"); if (null != name && (name = name.valueOf()), isObject(name)) for (attName in name) hasProp.call(name, attName) && (attValue = name[attName], this.attribute(attName, attValue)); else isFunction(value) && (value = value.apply()), this.options.skipNullAttributes && null == value || (this.currentNode.attributes[name] = new XMLAttribute(this, name, value)); return this; }, XMLDocumentCB.prototype.text = function(value) { var node; return this.openCurrent(), node = new XMLText(this, value), this.onData(this.writer.text(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.cdata = function(value) { var node; return this.openCurrent(), node = new XMLCData(this, value), this.onData(this.writer.cdata(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.comment = function(value) { var node; return this.openCurrent(), node = new XMLComment(this, value), this.onData(this.writer.comment(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.raw = function(value) { var node; return this.openCurrent(), node = new XMLRaw(this, value), this.onData(this.writer.raw(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.instruction = function(target, value) { var i, insTarget, insValue, len, node; if (this.openCurrent(), null != target && (target = target.valueOf()), null != value && (value = value.valueOf()), Array.isArray(target)) for (i = 0, len = target.length; i < len; i++) insTarget = target[i], this.instruction(insTarget); else if (isObject(target)) for (insTarget in target) hasProp.call(target, insTarget) && (insValue = target[insTarget], this.instruction(insTarget, insValue)); else isFunction(value) && (value = value.apply()), node = new XMLProcessingInstruction(this, target, value), this.onData(this.writer.processingInstruction(node, this.currentLevel + 1)); return this; }, XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) { var node; if (this.openCurrent(), this.documentStarted) throw new Error("declaration() must be the first node"); return node = new XMLDeclaration(this, version, encoding, standalone), this.onData(this.writer.declaration(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) { if (this.openCurrent(), null == root) throw new Error("Missing root node name"); if (this.root) throw new Error("dtd() must come before the root node"); return this.currentNode = new XMLDocType(this, pubID, sysID), this.currentNode.rootNodeName = root, this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, this; }, XMLDocumentCB.prototype.dtdElement = function(name, value) { var node; return this.openCurrent(), node = new XMLDTDElement(this, name, value), this.onData(this.writer.dtdElement(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { var node; return this.openCurrent(), node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue), this.onData(this.writer.dtdAttList(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.entity = function(name, value) { var node; return this.openCurrent(), node = new XMLDTDEntity(this, !1, name, value), this.onData(this.writer.dtdEntity(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.pEntity = function(name, value) { var node; return this.openCurrent(), node = new XMLDTDEntity(this, !0, name, value), this.onData(this.writer.dtdEntity(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.notation = function(name, value) { var node; return this.openCurrent(), node = new XMLDTDNotation(this, name, value), this.onData(this.writer.dtdNotation(node, this.currentLevel + 1)), this; }, XMLDocumentCB.prototype.up = function() { if (this.currentLevel < 0) throw new Error("The document node has no parent"); return this.currentNode ? (this.currentNode.children ? this.closeNode(this.currentNode) : this.openNode(this.currentNode), this.currentNode = null) : this.closeNode(this.openTags[this.currentLevel]), delete this.openTags[this.currentLevel], this.currentLevel--, this; }, XMLDocumentCB.prototype.end = function() { for (;this.currentLevel >= 0; ) this.up(); return this.onEnd(); }, XMLDocumentCB.prototype.openCurrent = function() { if (this.currentNode) return this.currentNode.children = !0, this.openNode(this.currentNode); }, XMLDocumentCB.prototype.openNode = function(node) { if (!node.isOpen) return !this.root && 0 === this.currentLevel && node instanceof XMLElement && (this.root = node), this.onData(this.writer.openNode(node, this.currentLevel)), node.isOpen = !0; }, XMLDocumentCB.prototype.closeNode = function(node) { if (!node.isClosed) return this.onData(this.writer.closeNode(node, this.currentLevel)), node.isClosed = !0; }, XMLDocumentCB.prototype.onData = function(chunk) { return this.documentStarted = !0, this.onDataCallback(chunk); }, XMLDocumentCB.prototype.onEnd = function() { return this.documentCompleted = !0, this.onEndCallback(); }, XMLDocumentCB.prototype.ele = function() { return this.element.apply(this, arguments); }, XMLDocumentCB.prototype.nod = function(name, attributes, text) { return this.node(name, attributes, text); }, XMLDocumentCB.prototype.txt = function(value) { return this.text(value); }, XMLDocumentCB.prototype.dat = function(value) { return this.cdata(value); }, XMLDocumentCB.prototype.com = function(value) { return this.comment(value); }, XMLDocumentCB.prototype.ins = function(target, value) { return this.instruction(target, value); }, XMLDocumentCB.prototype.dec = function(version, encoding, standalone) { return this.declaration(version, encoding, standalone); }, XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) { return this.doctype(root, pubID, sysID); }, XMLDocumentCB.prototype.e = function(name, attributes, text) { return this.element(name, attributes, text); }, XMLDocumentCB.prototype.n = function(name, attributes, text) { return this.node(name, attributes, text); }, XMLDocumentCB.prototype.t = function(value) { return this.text(value); }, XMLDocumentCB.prototype.d = function(value) { return this.cdata(value); }, XMLDocumentCB.prototype.c = function(value) { return this.comment(value); }, XMLDocumentCB.prototype.r = function(value) { return this.raw(value); }, XMLDocumentCB.prototype.i = function(target, value) { return this.instruction(target, value); }, XMLDocumentCB.prototype.att = function() { return this.currentNode && this.currentNode instanceof XMLDocType ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments); }, XMLDocumentCB.prototype.a = function() { return this.currentNode && this.currentNode instanceof XMLDocType ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments); }, XMLDocumentCB.prototype.ent = function(name, value) { return this.entity(name, value); }, XMLDocumentCB.prototype.pent = function(name, value) { return this.pEntity(name, value); }, XMLDocumentCB.prototype.not = function(name, value) { return this.notation(name, value); }, XMLDocumentCB; })(); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, hasProp = {}.hasOwnProperty; XMLDeclaration = __webpack_require__(131), XMLDocType = __webpack_require__(132), XMLCData = __webpack_require__(129), XMLComment = __webpack_require__(130), XMLElement = __webpack_require__(128), XMLRaw = __webpack_require__(137), XMLText = __webpack_require__(138), XMLProcessingInstruction = __webpack_require__(139), XMLDTDAttList = __webpack_require__(133), XMLDTDElement = __webpack_require__(135), XMLDTDEntity = __webpack_require__(134), XMLDTDNotation = __webpack_require__(136), XMLWriterBase = __webpack_require__(402), module.exports = (function(superClass) { function XMLStreamWriter(stream, options) { XMLStreamWriter.__super__.constructor.call(this, options), this.stream = stream; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLStreamWriter, superClass), XMLStreamWriter.prototype.document = function(doc) { var child, i, j, len, len1, ref, ref1, results; for (i = 0, len = (ref = doc.children).length; i < len; i++) (child = ref[i]).isLastRootNode = !1; for (doc.children[doc.children.length - 1].isLastRootNode = !0, results = [], j = 0, len1 = (ref1 = doc.children).length; j < len1; j++) switch (child = ref1[j], !1) { case !(child instanceof XMLDeclaration): results.push(this.declaration(child)); break; case !(child instanceof XMLDocType): results.push(this.docType(child)); break; case !(child instanceof XMLComment): results.push(this.comment(child)); break; case !(child instanceof XMLProcessingInstruction): results.push(this.processingInstruction(child)); break; default: results.push(this.element(child)); } return results; }, XMLStreamWriter.prototype.attribute = function(att) { return this.stream.write(" " + att.name + '="' + att.value + '"'); }, XMLStreamWriter.prototype.cdata = function(node, level) { return this.stream.write(this.space(level) + "" + this.endline(node)); }, XMLStreamWriter.prototype.comment = function(node, level) { return this.stream.write(this.space(level) + "\x3c!-- " + node.text + " --\x3e" + this.endline(node)); }, XMLStreamWriter.prototype.declaration = function(node, level) { return this.stream.write(this.space(level)), this.stream.write('"), this.stream.write(this.endline(node)); }, XMLStreamWriter.prototype.docType = function(node, level) { var child, i, len, ref; if (level || (level = 0), this.stream.write(this.space(level)), this.stream.write(" 0) { for (this.stream.write(" ["), this.stream.write(this.endline(node)), i = 0, len = (ref = node.children).length; i < len; i++) switch (child = ref[i], !1) { case !(child instanceof XMLDTDAttList): this.dtdAttList(child, level + 1); break; case !(child instanceof XMLDTDElement): this.dtdElement(child, level + 1); break; case !(child instanceof XMLDTDEntity): this.dtdEntity(child, level + 1); break; case !(child instanceof XMLDTDNotation): this.dtdNotation(child, level + 1); break; case !(child instanceof XMLCData): this.cdata(child, level + 1); break; case !(child instanceof XMLComment): this.comment(child, level + 1); break; case !(child instanceof XMLProcessingInstruction): this.processingInstruction(child, level + 1); break; default: throw new Error("Unknown DTD node type: " + child.constructor.name); } this.stream.write("]"); } return this.stream.write(this.spacebeforeslash + ">"), this.stream.write(this.endline(node)); }, XMLStreamWriter.prototype.element = function(node, level) { var att, child, i, len, name, ref, ref1, space; for (name in level || (level = 0), space = this.space(level), this.stream.write(space + "<" + node.name), ref = node.attributes) hasProp.call(ref, name) && (att = ref[name], this.attribute(att)); if (0 === node.children.length || node.children.every((function(e) { return "" === e.value; }))) this.allowEmpty ? this.stream.write(">") : this.stream.write(this.spacebeforeslash + "/>"); else if (this.pretty && 1 === node.children.length && null != node.children[0].value) this.stream.write(">"), this.stream.write(node.children[0].value), this.stream.write(""); else { for (this.stream.write(">" + this.newline), i = 0, len = (ref1 = node.children).length; i < len; i++) switch (child = ref1[i], !1) { case !(child instanceof XMLCData): this.cdata(child, level + 1); break; case !(child instanceof XMLComment): this.comment(child, level + 1); break; case !(child instanceof XMLElement): this.element(child, level + 1); break; case !(child instanceof XMLRaw): this.raw(child, level + 1); break; case !(child instanceof XMLText): this.text(child, level + 1); break; case !(child instanceof XMLProcessingInstruction): this.processingInstruction(child, level + 1); break; default: throw new Error("Unknown XML node type: " + child.constructor.name); } this.stream.write(space + ""); } return this.stream.write(this.endline(node)); }, XMLStreamWriter.prototype.processingInstruction = function(node, level) { return this.stream.write(this.space(level) + "" + this.endline(node)); }, XMLStreamWriter.prototype.raw = function(node, level) { return this.stream.write(this.space(level) + node.value + this.endline(node)); }, XMLStreamWriter.prototype.text = function(node, level) { return this.stream.write(this.space(level) + node.value + this.endline(node)); }, XMLStreamWriter.prototype.dtdAttList = function(node, level) { return this.stream.write(this.space(level) + "" + this.endline(node)); }, XMLStreamWriter.prototype.dtdElement = function(node, level) { return this.stream.write(this.space(level) + "" + this.endline(node)); }, XMLStreamWriter.prototype.dtdEntity = function(node, level) { return this.stream.write(this.space(level) + "" + this.endline(node)); }, XMLStreamWriter.prototype.dtdNotation = function(node, level) { return this.stream.write(this.space(level) + "" + this.endline(node)); }, XMLStreamWriter.prototype.endline = function(node) { return node.isLastRootNode ? "" : this.newline; }, XMLStreamWriter; })(XMLWriterBase); }).call(this); }, function(module, exports, __webpack_require__) { (function() { "use strict"; var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate, bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; }, hasProp = {}.hasOwnProperty; sax = __webpack_require__(104), events = __webpack_require__(4), bom = __webpack_require__(747), processors = __webpack_require__(403), setImmediate = __webpack_require__(103).setImmediate, defaults = __webpack_require__(189).defaults, isEmpty = function(thing) { return "object" == typeof thing && null != thing && 0 === Object.keys(thing).length; }, processItem = function(processors, item, key) { var i, len; for (i = 0, len = processors.length; i < len; i++) item = (0, processors[i])(item, key); return item; }, exports.Parser = (function(superClass) { function Parser(opts) { var key, ref, value; if (this.parseString = bind(this.parseString, this), this.reset = bind(this.reset, this), this.assignOrPush = bind(this.assignOrPush, this), this.processAsync = bind(this.processAsync, this), !(this instanceof exports.Parser)) return new exports.Parser(opts); for (key in this.options = {}, ref = defaults[.2]) hasProp.call(ref, key) && (value = ref[key], this.options[key] = value); for (key in opts) hasProp.call(opts, key) && (value = opts[key], this.options[key] = value); this.options.xmlns && (this.options.xmlnskey = this.options.attrkey + "ns"), this.options.normalizeTags && (this.options.tagNameProcessors || (this.options.tagNameProcessors = []), this.options.tagNameProcessors.unshift(processors.normalize)), this.reset(); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(Parser, superClass), Parser.prototype.processAsync = function() { var chunk, err; try { return this.remaining.length <= this.options.chunkSize ? (chunk = this.remaining, this.remaining = "", this.saxParser = this.saxParser.write(chunk), this.saxParser.close()) : (chunk = this.remaining.substr(0, this.options.chunkSize), this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length), this.saxParser = this.saxParser.write(chunk), setImmediate(this.processAsync)); } catch (error1) { if (err = error1, !this.saxParser.errThrown) return this.saxParser.errThrown = !0, this.emit(err); } }, Parser.prototype.assignOrPush = function(obj, key, newValue) { return key in obj ? (obj[key] instanceof Array || (obj[key] = [ obj[key] ]), obj[key].push(newValue)) : this.options.explicitArray ? obj[key] = [ newValue ] : obj[key] = newValue; }, Parser.prototype.reset = function() { var attrkey, charkey, ontext, stack, _this; return this.removeAllListeners(), this.saxParser = sax.parser(this.options.strict, { trim: !1, normalize: !1, xmlns: this.options.xmlns }), this.saxParser.errThrown = !1, this.saxParser.onerror = (_this = this, function(error) { if (_this.saxParser.resume(), !_this.saxParser.errThrown) return _this.saxParser.errThrown = !0, _this.emit("error", error); }), this.saxParser.onend = (function(_this) { return function() { if (!_this.saxParser.ended) return _this.saxParser.ended = !0, _this.emit("end", _this.resultObject); }; })(this), this.saxParser.ended = !1, this.EXPLICIT_CHARKEY = this.options.explicitCharkey, this.resultObject = null, stack = [], attrkey = this.options.attrkey, charkey = this.options.charkey, this.saxParser.onopentag = (function(_this) { return function(node) { var key, newValue, obj, processedKey, ref; if ((obj = {})[charkey] = "", !_this.options.ignoreAttrs) for (key in ref = node.attributes) hasProp.call(ref, key) && (attrkey in obj || _this.options.mergeAttrs || (obj[attrkey] = {}), newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key], processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key, _this.options.mergeAttrs ? _this.assignOrPush(obj, processedKey, newValue) : obj[attrkey][processedKey] = newValue); return obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name, _this.options.xmlns && (obj[_this.options.xmlnskey] = { uri: node.uri, local: node.local }), stack.push(obj); }; })(this), this.saxParser.onclosetag = (function(_this) { return function() { var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath; if (obj = stack.pop(), nodeName = obj["#name"], _this.options.explicitChildren && _this.options.preserveChildrenOrder || delete obj["#name"], !0 === obj.cdata && (cdata = obj.cdata, delete obj.cdata), s = stack[stack.length - 1], obj[charkey].match(/^\s*$/) && !cdata ? (emptyStr = obj[charkey], delete obj[charkey]) : (_this.options.trim && (obj[charkey] = obj[charkey].trim()), _this.options.normalize && (obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim()), obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey], 1 === Object.keys(obj).length && charkey in obj && !_this.EXPLICIT_CHARKEY && (obj = obj[charkey])), isEmpty(obj) && (obj = "" !== _this.options.emptyTag ? _this.options.emptyTag : emptyStr), null != _this.options.validator && (xpath = "/" + (function() { var i, len, results; for (results = [], i = 0, len = stack.length; i < len; i++) node = stack[i], results.push(node["#name"]); return results; })().concat(nodeName).join("/"), (function() { var err; try { obj = _this.options.validator(xpath, s && s[nodeName], obj); } catch (error1) { return err = error1, _this.emit("error", err); } })()), _this.options.explicitChildren && !_this.options.mergeAttrs && "object" == typeof obj) if (_this.options.preserveChildrenOrder) { if (s) { for (key in s[_this.options.childkey] = s[_this.options.childkey] || [], objClone = {}, obj) hasProp.call(obj, key) && (objClone[key] = obj[key]); s[_this.options.childkey].push(objClone), delete obj["#name"], 1 === Object.keys(obj).length && charkey in obj && !_this.EXPLICIT_CHARKEY && (obj = obj[charkey]); } } else node = {}, _this.options.attrkey in obj && (node[_this.options.attrkey] = obj[_this.options.attrkey], delete obj[_this.options.attrkey]), !_this.options.charsAsChildren && _this.options.charkey in obj && (node[_this.options.charkey] = obj[_this.options.charkey], delete obj[_this.options.charkey]), Object.getOwnPropertyNames(obj).length > 0 && (node[_this.options.childkey] = obj), obj = node; return stack.length > 0 ? _this.assignOrPush(s, nodeName, obj) : (_this.options.explicitRoot && (old = obj, (obj = {})[nodeName] = old), _this.resultObject = obj, _this.saxParser.ended = !0, _this.emit("end", _this.resultObject)); }; })(this), ontext = (function(_this) { return function(text) { var charChild, s; if (s = stack[stack.length - 1]) return s[charkey] += text, _this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || "" !== text.replace(/\\n/g, "").trim()) && (s[_this.options.childkey] = s[_this.options.childkey] || [], (charChild = { "#name": "__text__" })[charkey] = text, _this.options.normalize && (charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim()), s[_this.options.childkey].push(charChild)), s; }; })(this), this.saxParser.ontext = ontext, this.saxParser.oncdata = function(text) { var s; if (s = ontext(text)) return s.cdata = !0; }; }, Parser.prototype.parseString = function(str, cb) { var err; null != cb && "function" == typeof cb && (this.on("end", (function(result) { return this.reset(), cb(null, result); })), this.on("error", (function(err) { return this.reset(), cb(err); }))); try { return "" === (str = str.toString()).trim() ? (this.emit("end", null), !0) : (str = bom.stripBOM(str), this.options.async ? (this.remaining = str, setImmediate(this.processAsync), this.saxParser) : this.saxParser.write(str).close()); } catch (error1) { if (err = error1, !this.saxParser.errThrown && !this.saxParser.ended) return this.emit("error", err), this.saxParser.errThrown = !0; if (this.saxParser.ended) throw err; } }, Parser; })(events.EventEmitter), exports.parseString = function(str, a, b) { var cb, options; return null != b ? ("function" == typeof b && (cb = b), "object" == typeof a && (options = a)) : ("function" == typeof a && (cb = a), options = {}), new exports.Parser(options).parseString(str, cb); }; }).call(this); }, function(module, exports) { (function() { "use strict"; exports.stripBOM = function(str) { return "\ufeff" === str[0] ? str.substring(1) : str; }; }).call(this); }, function(module, exports, __webpack_require__) { var iconv, inherits = __webpack_require__(0).inherits, stream = __webpack_require__(3), regex = /(?:charset|encoding)\s*=\s*['"]? *([\w\-]+)/i; function StreamDecoder(charset) { if (!(this instanceof StreamDecoder)) return new StreamDecoder(charset); stream.Transform.call(this, charset), this.charset = charset, this.parsed_chunk = !1; } inherits(StreamDecoder, stream.Transform), StreamDecoder.prototype._transform = function(chunk, encoding, done) { var res, found; if ("iso-8859-1" == this.charset && !this.parsed_chunk) { this.parsed_chunk = !0; var matches = regex.exec(chunk.toString()); matches && (found = matches[1].toLowerCase(), this.charset = "utf-8" == found ? "utf8" : found); } try { res = iconv.decode(chunk, this.charset); } catch (e) { res = chunk; } this.push(res), done(); }, module.exports = function(charset) { try { iconv || (iconv = __webpack_require__(66)); } catch (e) {} return iconv ? new StreamDecoder(charset) : new stream.PassThrough; }; }, function(module) { module.exports = { name: "needle", version: "1.1.2", description: "The leanest and most handsome HTTP client in the Nodelands.", keywords: [ "http", "https", "simple", "request", "client", "multipart", "upload", "proxy", "deflate", "timeout", "charset", "iconv", "cookie", "redirect" ], tags: [ "http", "https", "simple", "request", "client", "multipart", "upload", "proxy", "deflate", "timeout", "charset", "iconv", "cookie", "redirect" ], author: "Tomás Pollak ", repository: { type: "git", url: "https://github.com/tomas/needle.git" }, dependencies: { debug: "^2.1.2", "iconv-lite": "^0.4.4" }, devDependencies: { mocha: "", sinon: "", should: "", xml2js: "", JSONStream: "", q: "", jschardet: "" }, scripts: { test: "mocha test" }, directories: { lib: "./lib" }, main: "./lib/needle", bin: { needle: "./bin/needle" }, license: "MIT", engines: { node: ">= 0.10.x" } }; }, function(module, exports, __webpack_require__) { var unicodeMatchers = __webpack_require__(751), multiByteCharsetMatchers = __webpack_require__(756), iso2022 = __webpack_require__(762), singleByteCharsetMatchers = __webpack_require__(766), DEFAULT_CS_RECOGNIZERS = [ __webpack_require__(780), unicodeMatchers["UTF-16BE"], unicodeMatchers["UTF-16LE"], unicodeMatchers["UTF-32BE"], unicodeMatchers["UTF-32LE"], multiByteCharsetMatchers.Shift_JIS, iso2022["ISO-2022-JP"], iso2022["ISO-2022-CN"], iso2022["ISO-2022-KR"], multiByteCharsetMatchers.GB18030, multiByteCharsetMatchers["EUC-JP"], multiByteCharsetMatchers["EUC-KR"], multiByteCharsetMatchers.Big5, singleByteCharsetMatchers["ISO-8859-1"], singleByteCharsetMatchers["ISO-8859-2"], singleByteCharsetMatchers["ISO-8859-5"], singleByteCharsetMatchers["ISO-8859-6"], singleByteCharsetMatchers["ISO-8859-7"], singleByteCharsetMatchers["ISO-8859-8-I"], singleByteCharsetMatchers["ISO-8859-8"], singleByteCharsetMatchers["windows-1251"], singleByteCharsetMatchers["windows-1256"], singleByteCharsetMatchers["KOIR8-R"], singleByteCharsetMatchers["ISO-8859-9"] ], ALL_CS_RECOGNIZERS = DEFAULT_CS_RECOGNIZERS.concat([ singleByteCharsetMatchers.IBM420_ltr, singleByteCharsetMatchers.IBM420_rtl, singleByteCharsetMatchers.IBM424_ltr, singleByteCharsetMatchers.IBM424_rtl ]); module.exports = function(input, matchers) { for (var matchersLength = (matchers = matchers || DEFAULT_CS_RECOGNIZERS).length, stat = (function(input) { for (var inputLength = input.length, byteStats = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], srci = 0; srci < inputLength; srci++) byteStats[255 & input[srci]]++; for (var c1Bytes = !1, i = 128; i <= 159; i += 1) if (0 != byteStats[i]) { c1Bytes = !0; break; } return { c1Bytes: c1Bytes, byteStats: byteStats }; })(input), matches = [], i = 0; i < matchersLength; i++) { var m = (0, matchers[i])(input, stat); null != m && matches.push(m); } return matches.sort((function(a, b) { return b.confidence - a.confidence; })), matches; }, module.exports.ALL_CS_RECOGNIZERS = ALL_CS_RECOGNIZERS, module.exports.DEFAULT_CS_RECOGNIZERS = DEFAULT_CS_RECOGNIZERS; }, function(module, exports, __webpack_require__) { exports["UTF-16BE"] = __webpack_require__(752), exports["UTF-16LE"] = __webpack_require__(753), exports["UTF-32BE"] = __webpack_require__(754), exports["UTF-32LE"] = __webpack_require__(755); }, function(module, exports, __webpack_require__) { var CharsetMatch = __webpack_require__(18), codeUnit16FromBytes = __webpack_require__(140).codeUnit16FromBytes, adjustConfidence = __webpack_require__(140).adjustConfidence; module.exports = function(input) { for (var confidence = 10, bytesToCheck = Math.min(input.length, 30), charIndex = 0; charIndex < bytesToCheck - 1; charIndex += 2) { var codeUnit = codeUnit16FromBytes(input[charIndex], input[charIndex + 1]); if (0 == charIndex && 65279 == codeUnit) { confidence = 100; break; } if (0 == (confidence = adjustConfidence(codeUnit, confidence)) || 100 == confidence) break; } return bytesToCheck < 4 && confidence < 100 && (confidence = 0), confidence > 0 ? new CharsetMatch(confidence, "UTF-16BE") : null; }; }, function(module, exports, __webpack_require__) { var CharsetMatch = __webpack_require__(18), codeUnit16FromBytes = __webpack_require__(140).codeUnit16FromBytes, adjustConfidence = __webpack_require__(140).adjustConfidence; module.exports = function(input) { for (var confidence = 10, bytesToCheck = Math.min(input.length, 30), charIndex = 0; charIndex < bytesToCheck - 1; charIndex += 2) { var codeUnit = codeUnit16FromBytes(input[charIndex + 1], input[charIndex]); if (0 == charIndex && 65279 == codeUnit) { confidence = 100; break; } if (0 == (confidence = adjustConfidence(codeUnit, confidence)) || 100 == confidence) break; } return bytesToCheck < 4 && confidence < 100 && (confidence = 0), confidence > 0 ? new CharsetMatch(confidence, "UTF-16LE") : null; }; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(404)((function(input, index) { return (255 & input[index + 0]) << 24 | (255 & input[index + 1]) << 16 | (255 & input[index + 2]) << 8 | 255 & input[index + 3]; }), "UTF-32BE"); }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(404)((function(input, index) { return (255 & input[index + 3]) << 24 | (255 & input[index + 2]) << 16 | (255 & input[index + 1]) << 8 | 255 & input[index + 0]; }), "UTF-32LE"); }, function(module, exports, __webpack_require__) { exports.Big5 = __webpack_require__(757), exports["EUC-JP"] = __webpack_require__(758), exports["EUC-KR"] = __webpack_require__(759), exports.GB18030 = __webpack_require__(760), exports.Shift_JIS = __webpack_require__(761); }, function(module, exports, __webpack_require__) { var CharsetMatch = __webpack_require__(18), match = __webpack_require__(141)([ 41280, 41281, 41282, 41283, 41287, 41289, 41333, 41334, 42048, 42054, 42055, 42056, 42065, 42068, 42071, 42084, 42090, 42092, 42103, 42147, 42148, 42151, 42177, 42190, 42193, 42207, 42216, 42237, 42304, 42312, 42328, 42345, 42445, 42471, 42583, 42593, 42594, 42600, 42608, 42664, 42675, 42681, 42707, 42715, 42726, 42738, 42816, 42833, 42841, 42970, 43171, 43173, 43181, 43217, 43219, 43236, 43260, 43456, 43474, 43507, 43627, 43706, 43710, 43724, 43772, 44103, 44111, 44208, 44242, 44377, 44745, 45024, 45290, 45423, 45747, 45764, 45935, 46156, 46158, 46412, 46501, 46525, 46544, 46552, 46705, 47085, 47207, 47428, 47832, 47940, 48033, 48593, 49860, 50105, 50240, 50271 ], (function(it) { it.index = it.nextIndex, it.error = !1; var firstByte = it.charValue = it.nextByte(); if (firstByte < 0) return !1; if (firstByte <= 127 || 255 == firstByte) return !0; var secondByte = it.nextByte(); return !(secondByte < 0 || (it.charValue = it.charValue << 8 | secondByte, (secondByte < 64 || 127 == secondByte || 255 == secondByte) && (it.error = !0), 0)); })); module.exports = function(input) { var confidence = match(input); return 0 == confidence ? null : new CharsetMatch(confidence, "Big5", "zh"); }; }, function(module, exports, __webpack_require__) { var CharsetMatch = __webpack_require__(18), match = __webpack_require__(405)([ 41377, 41378, 41379, 41382, 41404, 41418, 41419, 41430, 41431, 42146, 42148, 42150, 42152, 42154, 42155, 42156, 42157, 42159, 42161, 42163, 42165, 42167, 42169, 42171, 42173, 42175, 42176, 42177, 42179, 42180, 42182, 42183, 42184, 42185, 42186, 42187, 42190, 42191, 42192, 42206, 42207, 42209, 42210, 42212, 42216, 42217, 42218, 42219, 42220, 42223, 42226, 42227, 42402, 42403, 42404, 42406, 42407, 42410, 42413, 42415, 42416, 42419, 42421, 42423, 42424, 42425, 42431, 42435, 42438, 42439, 42440, 42441, 42443, 42448, 42453, 42454, 42455, 42462, 42464, 42465, 42469, 42473, 42474, 42475, 42476, 42477, 42483, 47273, 47572, 47854, 48072, 48880, 49079, 50410, 50940, 51133, 51896, 51955, 52188, 52689 ]); module.exports = function(input) { var confidence = match(input); return 0 == confidence ? null : new CharsetMatch(confidence, "EUC-JP", "ja"); }; }, function(module, exports, __webpack_require__) { var match = __webpack_require__(405)([ 45217, 45235, 45253, 45261, 45268, 45286, 45293, 45304, 45306, 45308, 45496, 45497, 45511, 45527, 45538, 45994, 46011, 46274, 46287, 46297, 46315, 46501, 46517, 46527, 46535, 46569, 46835, 47023, 47042, 47054, 47270, 47278, 47286, 47288, 47291, 47337, 47531, 47534, 47564, 47566, 47613, 47800, 47822, 47824, 47857, 48103, 48115, 48125, 48301, 48314, 48338, 48374, 48570, 48576, 48579, 48581, 48838, 48840, 48863, 48878, 48888, 48890, 49057, 49065, 49088, 49124, 49131, 49132, 49144, 49319, 49327, 49336, 49338, 49339, 49341, 49351, 49356, 49358, 49359, 49366, 49370, 49381, 49403, 49404, 49572, 49574, 49590, 49622, 49631, 49654, 49656, 50337, 50637, 50862, 51151, 51153, 51154, 51160, 51173, 51373 ]), CharsetMatch = __webpack_require__(18); module.exports = function(input) { var confidence = match(input); return 0 == confidence ? null : new CharsetMatch(confidence, "EUC-KR", "ko"); }; }, function(module, exports, __webpack_require__) { var CharsetMatch = __webpack_require__(18), match = __webpack_require__(141)([ 41377, 41378, 41379, 41380, 41392, 41393, 41457, 41459, 41889, 41900, 41914, 45480, 45496, 45502, 45755, 46025, 46070, 46323, 46525, 46532, 46563, 46767, 46804, 46816, 47010, 47016, 47037, 47062, 47069, 47284, 47327, 47350, 47531, 47561, 47576, 47610, 47613, 47821, 48039, 48086, 48097, 48122, 48316, 48347, 48382, 48588, 48845, 48861, 49076, 49094, 49097, 49332, 49389, 49611, 49883, 50119, 50396, 50410, 50636, 50935, 51192, 51371, 51403, 51413, 51431, 51663, 51706, 51889, 51893, 51911, 51920, 51926, 51957, 51965, 52460, 52728, 52906, 52932, 52946, 52965, 53173, 53186, 53206, 53442, 53445, 53456, 53460, 53671, 53930, 53938, 53941, 53947, 53972, 54211, 54224, 54269, 54466, 54490, 54754, 54992 ], (function(it) { it.index = it.nextIndex, it.error = !1; var firstByte = 0, secondByte = 0, thirdByte = 0, fourthByte = 0; buildChar: if ((firstByte = it.charValue = it.nextByte()) < 0) it.done = !0; else if (!(firstByte <= 128) && (secondByte = it.nextByte(), it.charValue = it.charValue << 8 | secondByte, firstByte >= 129 && firstByte <= 254)) { if (secondByte >= 64 && secondByte <= 126 || secondByte >= 80 && secondByte <= 254) break buildChar; if (secondByte >= 48 && secondByte <= 57 && (thirdByte = it.nextByte()) >= 129 && thirdByte <= 254 && (fourthByte = it.nextByte()) >= 48 && fourthByte <= 57) { it.charValue = it.charValue << 16 | thirdByte << 8 | fourthByte; break buildChar; } it.error = !0; } return 0 == it.done; })); module.exports = function(input) { var confidence = match(input); return 0 == confidence ? null : new CharsetMatch(confidence, "GB18030", "zh"); }; }, function(module, exports, __webpack_require__) { var CharsetMatch = __webpack_require__(18), match = __webpack_require__(141)([ 33088, 33089, 33090, 33093, 33115, 33129, 33130, 33141, 33142, 33440, 33442, 33444, 33449, 33450, 33451, 33453, 33455, 33457, 33459, 33461, 33463, 33469, 33470, 33473, 33476, 33477, 33478, 33480, 33481, 33484, 33485, 33500, 33504, 33511, 33512, 33513, 33514, 33520, 33521, 33601, 33603, 33614, 33615, 33624, 33630, 33634, 33639, 33653, 33654, 33673, 33674, 33675, 33677, 33683, 36502, 37882, 38314 ], (function(it) { it.index = it.nextIndex, it.error = !1; var firstByte = it.charValue = it.nextByte(); if (firstByte < 0) return !1; if (firstByte <= 127 || firstByte > 160 && firstByte <= 223) return !0; var secondByte = it.nextByte(); return !(secondByte < 0 || (it.charValue = firstByte << 8 | secondByte, secondByte >= 64 && secondByte <= 127 || secondByte >= 128 && secondByte <= 255 || (it.error = !0), 0)); })); module.exports = function(input) { var confidence = match(input); return 0 == confidence ? null : new CharsetMatch(confidence, "Shift_JIS", "ja"); }; }, function(module, exports, __webpack_require__) { exports["ISO-2022-JP"] = __webpack_require__(763), exports["ISO-2022-KR"] = __webpack_require__(764), exports["ISO-2022-CN"] = __webpack_require__(765); }, function(module, exports, __webpack_require__) { var escapeSequences = [ [ 27, 36, 40, 67 ], [ 27, 36, 40, 68 ], [ 27, 36, 64 ], [ 27, 36, 65 ], [ 27, 36, 66 ], [ 27, 38, 64 ], [ 27, 40, 66 ], [ 27, 40, 72 ], [ 27, 40, 73 ], [ 27, 40, 74 ], [ 27, 46, 65 ], [ 27, 46, 70 ] ], baseMatch = __webpack_require__(191), CharsetMatch = __webpack_require__(18); module.exports = function(input) { var confidence = baseMatch(input, input.length, escapeSequences); return 0 == confidence ? null : new CharsetMatch(confidence, "ISO-2022-JP"); }; }, function(module, exports, __webpack_require__) { var escapeSequences = [ [ 27, 36, 41, 67 ] ], baseMatch = __webpack_require__(191), CharsetMatch = __webpack_require__(18); module.exports = function(input) { var confidence = baseMatch(input, input.length, escapeSequences); return 0 == confidence ? null : new CharsetMatch(confidence, "ISO-2022-KR"); }; }, function(module, exports, __webpack_require__) { var escapeSequences = [ [ 27, 36, 41, 65 ], [ 27, 36, 41, 71 ], [ 27, 36, 42, 72 ], [ 27, 36, 41, 69 ], [ 27, 36, 43, 73 ], [ 27, 36, 43, 74 ], [ 27, 36, 43, 75 ], [ 27, 36, 43, 76 ], [ 27, 36, 43, 77 ], [ 27, 78 ], [ 27, 79 ] ], baseMatch = __webpack_require__(191), CharsetMatch = __webpack_require__(18); module.exports = function(input) { var confidence = baseMatch(input, input.length, escapeSequences); return 0 == confidence ? null : new CharsetMatch(confidence, "ISO-2022-CN"); }; }, function(module, exports, __webpack_require__) { exports["ISO-8859-1"] = __webpack_require__(767), exports["ISO-8859-2"] = __webpack_require__(769), exports["ISO-8859-5"] = __webpack_require__(770)["8859_5_ru"], exports["ISO-8859-6"] = __webpack_require__(771)["8859_6_ar"], exports["ISO-8859-7"] = __webpack_require__(772)["8859_7_el"]; var iso_8859_8 = __webpack_require__(773); exports["ISO-8859-8"] = iso_8859_8["8859_8_he"], exports["ISO-8859-8-I"] = iso_8859_8["8859_8_I_he"], exports["ISO-8859-9"] = __webpack_require__(774)["8859_9_tr"]; var ibm420 = __webpack_require__(775); exports.IBM420_rtl = ibm420.IBM420_rtl, exports.IBM420_ltr = ibm420.IBM420_ltr; var ibm424 = __webpack_require__(776); exports.IBM424_rtl = ibm424.IBM424_rtl, exports.IBM424_ltr = ibm424.IBM424_ltr, exports["windows-1251"] = __webpack_require__(777), exports["windows-1256"] = __webpack_require__(778), exports["KOIR8-R"] = __webpack_require__(779); }, function(module, exports, __webpack_require__) { var byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 170, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 181, 32, 32, 32, 32, 186, 32, 32, 32, 32, 32, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 32, 248, 249, 250, 251, 252, 253, 254, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 32, 248, 249, 250, 251, 252, 253, 254, 255 ], base = __webpack_require__(41), NGramsPlusLang = base.NGramsPlusLang, ngrams_8859_1 = [ new NGramsPlusLang("da", [ 2122086, 2122100, 2122853, 2123118, 2123122, 2123375, 2123873, 2124064, 2125157, 2125671, 2126053, 2126697, 2126708, 2126953, 2127465, 6383136, 6385184, 6385252, 6386208, 6386720, 6579488, 6579566, 6579570, 6579572, 6627443, 6644768, 6644837, 6647328, 6647396, 6648352, 6648421, 6648608, 6648864, 6713202, 6776096, 6776174, 6776178, 6907749, 6908960, 6909543, 7038240, 7039845, 7103858, 7104871, 7105637, 7169380, 7234661, 7234848, 7235360, 7235429, 7300896, 7302432, 7303712, 7398688, 7479396, 7479397, 7479411, 7496992, 7566437, 7610483, 7628064, 7628146, 7629164, 7759218 ]), new NGramsPlusLang("de", [ 2122094, 2122101, 2122341, 2122849, 2122853, 2122857, 2123113, 2123621, 2123873, 2124142, 2125161, 2126691, 2126693, 2127214, 2127461, 2127471, 2127717, 2128501, 6448498, 6514720, 6514789, 6514804, 6578547, 6579566, 6579570, 6580581, 6627428, 6627443, 6646126, 6646132, 6647328, 6648352, 6648608, 6776174, 6841710, 6845472, 6906728, 6907168, 6909472, 6909541, 6911008, 7104867, 7105637, 7217249, 7217252, 7217267, 7234592, 7234661, 7234848, 7235360, 7235429, 7238757, 7479396, 7496805, 7497065, 7562088, 7566437, 7610468, 7628064, 7628142, 7628146, 7695972, 7695975, 7759218 ]), new NGramsPlusLang("en", [ 2122016, 2122094, 2122341, 2122607, 2123375, 2123873, 2123877, 2124142, 2125153, 2125670, 2125938, 2126437, 2126689, 2126708, 2126952, 2126959, 2127720, 6383972, 6384672, 6385184, 6385252, 6386464, 6386720, 6386789, 6386793, 6561889, 6561908, 6627425, 6627443, 6627444, 6644768, 6647412, 6648352, 6648608, 6713202, 6840692, 6841632, 6841714, 6906912, 6909472, 6909543, 6909806, 6910752, 7217249, 7217268, 7234592, 7235360, 7238688, 7300640, 7302688, 7303712, 7496992, 7500576, 7544929, 7544948, 7561577, 7566368, 7610484, 7628146, 7628897, 7628901, 7629167, 7630624, 7631648 ]), new NGramsPlusLang("es", [ 2122016, 2122593, 2122607, 2122853, 2123116, 2123118, 2123123, 2124142, 2124897, 2124911, 2125921, 2125935, 2125938, 2126197, 2126437, 2126693, 2127214, 2128160, 6365283, 6365284, 6365285, 6365292, 6365296, 6382441, 6382703, 6384672, 6386208, 6386464, 6515187, 6516590, 6579488, 6579564, 6582048, 6627428, 6627429, 6627436, 6646816, 6647328, 6647412, 6648608, 6648692, 6907246, 6943598, 7102752, 7106419, 7217253, 7238757, 7282788, 7282789, 7302688, 7303712, 7303968, 7364978, 7435621, 7495968, 7497075, 7544932, 7544933, 7544944, 7562528, 7628064, 7630624, 7693600, 15953440 ]), new NGramsPlusLang("fr", [ 2122101, 2122607, 2122849, 2122853, 2122869, 2123118, 2123124, 2124897, 2124901, 2125921, 2125935, 2125938, 2126197, 2126693, 2126703, 2127214, 2154528, 6385268, 6386793, 6513952, 6516590, 6579488, 6579571, 6583584, 6627425, 6627427, 6627428, 6627429, 6627436, 6627440, 6627443, 6647328, 6647412, 6648352, 6648608, 6648864, 6649202, 6909806, 6910752, 6911008, 7102752, 7103776, 7103859, 7169390, 7217252, 7234848, 7238432, 7238688, 7302688, 7302772, 7304562, 7435621, 7479404, 7496992, 7544929, 7544932, 7544933, 7544940, 7544944, 7610468, 7628064, 7629167, 7693600, 7696928 ]), new NGramsPlusLang("it", [ 2122092, 2122600, 2122607, 2122853, 2122857, 2123040, 2124140, 2124142, 2124897, 2125925, 2125938, 2127214, 6365283, 6365284, 6365296, 6365299, 6386799, 6514789, 6516590, 6579564, 6580512, 6627425, 6627427, 6627428, 6627433, 6627436, 6627440, 6627443, 6646816, 6646892, 6647412, 6648352, 6841632, 6889569, 6889571, 6889572, 6889587, 6906144, 6908960, 6909472, 6909806, 7102752, 7103776, 7104800, 7105633, 7234848, 7235872, 7237408, 7238757, 7282785, 7282788, 7282793, 7282803, 7302688, 7302757, 7366002, 7495968, 7496992, 7563552, 7627040, 7628064, 7629088, 7630624, 8022383 ]), new NGramsPlusLang("nl", [ 2122092, 2122341, 2122849, 2122853, 2122857, 2123109, 2123118, 2123621, 2123877, 2124142, 2125153, 2125157, 2125680, 2126949, 2127457, 2127461, 2127471, 2127717, 2128489, 6381934, 6381938, 6385184, 6385252, 6386208, 6386720, 6514804, 6579488, 6579566, 6579570, 6627426, 6627446, 6645102, 6645106, 6647328, 6648352, 6648435, 6648864, 6776174, 6841716, 6907168, 6909472, 6909543, 6910752, 7217250, 7217252, 7217253, 7217256, 7217263, 7217270, 7234661, 7235360, 7302756, 7303026, 7303200, 7303712, 7562088, 7566437, 7610468, 7628064, 7628142, 7628146, 7758190, 7759218, 7761775 ]), new NGramsPlusLang("no", [ 2122100, 2122102, 2122853, 2123118, 2123122, 2123375, 2123873, 2124064, 2125157, 2125671, 2126053, 2126693, 2126699, 2126703, 2126708, 2126953, 2127465, 2155808, 6385252, 6386208, 6386720, 6579488, 6579566, 6579572, 6627443, 6644768, 6647328, 6647397, 6648352, 6648421, 6648864, 6648948, 6713202, 6776174, 6908779, 6908960, 6909543, 7038240, 7039845, 7103776, 7105637, 7169380, 7169390, 7217267, 7234848, 7235360, 7235429, 7237221, 7300896, 7302432, 7303712, 7398688, 7479411, 7496992, 7565165, 7566437, 7610483, 7628064, 7628142, 7628146, 7629164, 7631904, 7631973, 7759218 ]), new NGramsPlusLang("pt", [ 2122016, 2122607, 2122849, 2122853, 2122863, 2123040, 2123123, 2125153, 2125423, 2125600, 2125921, 2125935, 2125938, 2126197, 2126437, 2126693, 2127213, 6365281, 6365283, 6365284, 6365296, 6382693, 6382703, 6384672, 6386208, 6386273, 6386464, 6516589, 6516590, 6578464, 6579488, 6582048, 6582131, 6627425, 6627428, 6647072, 6647412, 6648608, 6648692, 6906144, 6906721, 7169390, 7238757, 7238767, 7282785, 7282787, 7282788, 7282789, 7282800, 7303968, 7364978, 7435621, 7495968, 7497075, 7544929, 7544932, 7544933, 7544944, 7566433, 7628064, 7630624, 7693600, 14905120, 15197039 ]), new NGramsPlusLang("sv", [ 2122100, 2122102, 2122853, 2123118, 2123510, 2123873, 2124064, 2124142, 2124655, 2125157, 2125667, 2126053, 2126699, 2126703, 2126708, 2126953, 2127457, 2127465, 2155634, 6382693, 6385184, 6385252, 6386208, 6386804, 6514720, 6579488, 6579566, 6579570, 6579572, 6644768, 6647328, 6648352, 6648864, 6747762, 6776174, 6909036, 6909543, 7037216, 7105568, 7169380, 7217267, 7233824, 7234661, 7235360, 7235429, 7235950, 7299944, 7302432, 7302688, 7398688, 7479393, 7479411, 7495968, 7564129, 7565165, 7610483, 7627040, 7628064, 7628146, 7629164, 7631904, 7758194, 14971424, 16151072 ]) ], ngrams_8859_1_length = ngrams_8859_1.length, CharsetMatch = __webpack_require__(18); module.exports = function(input, stats) { for (var name = stats.c1Bytes ? "windows-1252" : "ISO-8859-1", bestConfidenceSoFar = -1, lang = null, i = 0, l = ngrams_8859_1_length; i < l; i++) { var ngl = ngrams_8859_1[i], confidence = base.match(input, ngl.ngrams, byteMap); confidence > bestConfidenceSoFar && (bestConfidenceSoFar = confidence, lang = ngl.lang); } return bestConfidenceSoFar <= 0 ? null : new CharsetMatch(bestConfidenceSoFar, name, lang); }; }, function(module, exports, __webpack_require__) { var NGramParser = __webpack_require__(406), unshapeMap = [ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 66, 66, 68, 69, 70, 71, 71, 73, 74, 75, 76, 77, 78, 79, 80, 73, 82, 83, 84, 85, 86, 86, 88, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 99, 101, 101, 103, 103, 105, 106, 107, 108, 109, 110, 111, 105, 113, 113, 115, 116, 117, 118, 119, 119, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 128, 139, 139, 141, 141, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 154, 154, 154, 158, 158, 158, 161, 162, 163, 164, 165, 166, 167, 168, 169, 158, 171, 171, 173, 173, 175, 175, 177, 178, 179, 180, 181, 182, 183, 184, 185, 177, 187, 187, 189, 189, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 191, 204, 191, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 218, 220, 220, 220, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 ]; function NGramParser_IBM420(theNgramList, theByteMap) { this.alef = 0, NGramParser.call(this, theNgramList, theByteMap); } NGramParser_IBM420.prototype = Object.create(NGramParser.prototype), NGramParser_IBM420.prototype.nextByte = function(input) { return this.byteIndex >= input.length || 0 == input[this.byteIndex] ? -1 : (this.alef = 178 == (b = input[this.byteIndex]) || 179 == b ? 71 : 180 == b || 181 == b ? 73 : 184 == b || 185 == b ? 86 : 0, next = 0 != this.alef ? 177 : 255 & unshapeMap[255 & input[this.byteIndex]], this.byteIndex++, next); var next, b; }, NGramParser_IBM420.prototype.parseCharacters = function(input) { for (var b, ignoreSpace = !1; (b = this.nextByte(input)) >= 0; ) { var mb = this.byteMap[b]; 0 != mb && (mb == this.spaceChar && ignoreSpace || this.addByte(mb), ignoreSpace = mb == this.spaceChar), 0 != this.alef && 0 != (mb = this.byteMap[255 & this.alef]) && (mb == this.spaceChar && ignoreSpace || this.addByte(mb), ignoreSpace = mb == this.spaceChar); } }, module.exports = NGramParser_IBM420; }, function(module, exports, __webpack_require__) { var byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 177, 32, 179, 32, 181, 182, 32, 32, 185, 186, 187, 188, 32, 190, 191, 32, 177, 32, 179, 32, 181, 182, 183, 32, 185, 186, 187, 188, 32, 190, 191, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 32, 248, 249, 250, 251, 252, 253, 254, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 32, 248, 249, 250, 251, 252, 253, 254, 32 ], base = __webpack_require__(41), NGramsPlusLang = base.NGramsPlusLang, ngrams_8859_2 = [ new NGramsPlusLang("cs", [ 2122016, 2122361, 2122863, 2124389, 2125409, 2125413, 2125600, 2125668, 2125935, 2125938, 2126072, 2126447, 2126693, 2126703, 2126708, 2126959, 2127392, 2127481, 2128481, 6365296, 6513952, 6514720, 6627440, 6627443, 6627446, 6647072, 6647533, 6844192, 6844260, 6910836, 6972704, 7042149, 7103776, 7104800, 7233824, 7268640, 7269408, 7269664, 7282800, 7300206, 7301737, 7304052, 7304480, 7304801, 7368548, 7368554, 7369327, 7403621, 7562528, 7565173, 7566433, 7566441, 7566446, 7628146, 7630573, 7630624, 7676016, 12477728, 14773997, 15296623, 15540336, 15540339, 15559968, 16278884 ]), new NGramsPlusLang("hu", [ 2122016, 2122106, 2122341, 2123111, 2123116, 2123365, 2123873, 2123887, 2124147, 2124645, 2124649, 2124790, 2124901, 2125153, 2125157, 2125161, 2125413, 2126714, 2126949, 2156915, 6365281, 6365291, 6365293, 6365299, 6384416, 6385184, 6388256, 6447470, 6448494, 6645625, 6646560, 6646816, 6646885, 6647072, 6647328, 6648421, 6648864, 6648933, 6648948, 6781216, 6844263, 6909556, 6910752, 7020641, 7075450, 7169383, 7170414, 7217249, 7233899, 7234923, 7234925, 7238688, 7300985, 7544929, 7567973, 7567988, 7568097, 7596391, 7610465, 7631904, 7659891, 8021362, 14773792, 15299360 ]), new NGramsPlusLang("pl", [ 2122618, 2122863, 2124064, 2124389, 2124655, 2125153, 2125161, 2125409, 2125417, 2125668, 2125935, 2125938, 2126697, 2127648, 2127721, 2127737, 2128416, 2128481, 6365296, 6365303, 6385257, 6514720, 6519397, 6519417, 6582048, 6584937, 6627440, 6627443, 6627447, 6627450, 6645615, 6646304, 6647072, 6647401, 6778656, 6906144, 6907168, 6907242, 7037216, 7039264, 7039333, 7170405, 7233824, 7235937, 7235941, 7282800, 7305057, 7305065, 7368556, 7369313, 7369327, 7369338, 7502437, 7502457, 7563754, 7564137, 7566433, 7825765, 7955304, 7957792, 8021280, 8022373, 8026400, 15955744 ]), new NGramsPlusLang("ro", [ 2122016, 2122083, 2122593, 2122597, 2122607, 2122613, 2122853, 2122857, 2124897, 2125153, 2125925, 2125938, 2126693, 2126819, 2127214, 2144873, 2158190, 6365283, 6365284, 6386277, 6386720, 6386789, 6386976, 6513010, 6516590, 6518048, 6546208, 6579488, 6627425, 6627427, 6627428, 6627440, 6627443, 6644e3, 6646048, 6646885, 6647412, 6648692, 6889569, 6889571, 6889572, 6889584, 6907168, 6908192, 6909472, 7102752, 7103776, 7106418, 7107945, 7234848, 7238770, 7303712, 7365998, 7496992, 7497057, 7501088, 7594784, 7628064, 7631477, 7660320, 7694624, 7695392, 12216608, 15625760 ]) ], ngrams_8859_2_length = ngrams_8859_2.length, CharsetMatch = __webpack_require__(18); module.exports = function(input, stats) { for (var name = stats.c1Bytes ? "windows-1250" : "ISO-8859-2", bestConfidenceSoFar = -1, lang = null, i = 0, l = ngrams_8859_2_length; i < l; i++) { var ngl = ngrams_8859_2[i], confidence = base.match(input, ngl.ngrams, byteMap); confidence > bestConfidenceSoFar && (bestConfidenceSoFar = confidence, lang = ngl.lang); } return bestConfidenceSoFar <= 0 ? null : new CharsetMatch(bestConfidenceSoFar, name, lang); }; }, function(module, exports, __webpack_require__) { var byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 32, 254, 255, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 32, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 32, 254, 255 ], CharsetMatch = __webpack_require__(18), base = __webpack_require__(41), ngrams_ru = [ 2150944, 2151134, 2151646, 2152400, 2152480, 2153168, 2153182, 2153936, 2153941, 2154193, 2154462, 2154464, 2154704, 2154974, 2154978, 2155230, 2156514, 2158050, 13688280, 13689580, 13884960, 14015468, 14015960, 14016994, 14017056, 14164191, 14210336, 14211104, 14216992, 14407133, 14407712, 14413021, 14536736, 14538016, 14538965, 14538991, 14540320, 14540498, 14557394, 14557407, 14557409, 14602784, 14602960, 14603230, 14604576, 14605292, 14605344, 14606818, 14671579, 14672085, 14672088, 14672094, 14733522, 14734804, 14803664, 14803666, 14803672, 14806816, 14865883, 14868e3, 14868192, 14871584, 15196894, 15459616 ]; exports["8859_5_ru"] = function(input) { var confidence = base.match(input, ngrams_ru, byteMap); return 0 == confidence ? null : new CharsetMatch(confidence, "ISO-8859-5", "ru"); }; }, function(module, exports, __webpack_require__) { var byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 32, 32, 32, 32, 32, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 ], CharsetMatch = __webpack_require__(18), base = __webpack_require__(41), ngrams = [ 2148324, 2148326, 2148551, 2152932, 2154986, 2155748, 2156006, 2156743, 13050055, 13091104, 13093408, 13095200, 13100064, 13100227, 13100231, 13100232, 13100234, 13100236, 13100237, 13100239, 13100243, 13100249, 13100258, 13100261, 13100264, 13100266, 13100320, 13100576, 13100746, 13115591, 13181127, 13181153, 13181156, 13181157, 13181160, 13246663, 13574343, 13617440, 13705415, 13748512, 13836487, 14229703, 14279913, 14805536, 14950599, 14993696, 15001888, 15002144, 15016135, 15058720, 15059232, 15066656, 15081671, 15147207, 15189792, 15255524, 15263264, 15278279, 15343815, 15343845, 15343848, 15386912, 15388960, 15394336 ]; module.exports["8859_6_ar"] = function(input) { var confidence = base.match(input, ngrams, byteMap); return 0 == confidence ? null : new CharsetMatch(confidence, "ISO-8859-6", "ar"); }; }, function(module, exports, __webpack_require__) { var byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 161, 162, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 220, 32, 221, 222, 223, 32, 252, 32, 253, 254, 192, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 32, 243, 244, 245, 246, 247, 248, 249, 250, 251, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 32 ], CharsetMatch = __webpack_require__(18), base = __webpack_require__(41), ngrams = [ 2154989, 2154992, 2155497, 2155753, 2156016, 2156320, 2157281, 2157797, 2158049, 2158368, 2158817, 2158831, 2158833, 2159604, 2159605, 2159847, 2159855, 14672160, 14754017, 14754036, 14805280, 14806304, 14807292, 14807584, 14936545, 15067424, 15069728, 15147252, 15199520, 15200800, 15278324, 15327520, 15330014, 15331872, 15393257, 15393268, 15525152, 15540449, 15540453, 15540464, 15589664, 15725088, 15725856, 15790069, 15790575, 15793184, 15868129, 15868133, 15868138, 15868144, 15868148, 15983904, 15984416, 15987951, 16048416, 16048617, 16050157, 16050162, 16050666, 16052e3, 16052213, 16054765, 16379168, 16706848 ]; module.exports["8859_7_el"] = function(input, stats) { var name = stats.c1Bytes ? "windows-1253" : "ISO-8859-7", confidence = base.match(input, ngrams, byteMap); return 0 == confidence ? null : new CharsetMatch(confidence, name, "el"); }; }, function(module, exports, __webpack_require__) { var byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 181, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 32, 32, 32, 32, 32 ], CharsetMatch = __webpack_require__(18), base = __webpack_require__(41), ngrams = { "ISO-8859-8-I": [ 2154725, 2154727, 2154729, 2154746, 2154985, 2154990, 2155744, 2155749, 2155753, 2155758, 2155762, 2155769, 2155770, 2157792, 2157796, 2158304, 2159340, 2161132, 14744096, 14950624, 14950625, 14950628, 14950636, 14950638, 14950649, 15001056, 15065120, 15068448, 15068960, 15071264, 15071776, 15278308, 15328288, 15328762, 15329773, 15330592, 15331104, 15333408, 15333920, 15474912, 15474916, 15523872, 15524896, 15540448, 15540449, 15540452, 15540460, 15540462, 15540473, 15655968, 15671524, 15787040, 15788320, 15788525, 15920160, 16261348, 16312813, 16378912, 16392416, 16392417, 16392420, 16392428, 16392430, 16392441 ], "ISO-8859-8": [ 2154725, 2154732, 2155753, 2155756, 2155758, 2155760, 2157040, 2157810, 2157817, 2158053, 2158057, 2158565, 2158569, 2160869, 2160873, 2161376, 2161381, 2161385, 14688484, 14688492, 14688493, 14688506, 14738464, 14738916, 14740512, 14741024, 14754020, 14754029, 14754042, 14950628, 14950633, 14950636, 14950637, 14950639, 14950648, 14950650, 15002656, 15065120, 15066144, 15196192, 15327264, 15327520, 15328288, 15474916, 15474925, 15474938, 15528480, 15530272, 15591913, 15591920, 15591928, 15605988, 15605997, 15606010, 15655200, 15655968, 15918112, 16326884, 16326893, 16326906, 16376864, 16441376, 16442400, 16442857 ] }; function genMatcher(csName) { return function(input, stats) { var name = stats.c1Bytes ? "windows-1255" : csName, confidence = base.match(input, ngrams[csName], byteMap); return 0 == confidence ? null : new CharsetMatch(confidence, name, "he"); }; } exports["8859_8_I_he"] = genMatcher("ISO-8859-8-I"), exports["8859_8_he"] = genMatcher("ISO-8859-8"); }, function(module, exports, __webpack_require__) { var byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 170, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 181, 32, 32, 32, 32, 186, 32, 32, 32, 32, 32, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 32, 248, 249, 250, 251, 252, 105, 254, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 32, 248, 249, 250, 251, 252, 253, 254, 255 ], CharsetMatch = __webpack_require__(18), base = __webpack_require__(41), ngrams = [ 2122337, 2122345, 2122357, 2122849, 2122853, 2123621, 2123873, 2124140, 2124641, 2124655, 2125153, 2125676, 2126689, 2126945, 2127461, 2128225, 6365282, 6384416, 6384737, 6384993, 6385184, 6385405, 6386208, 6386273, 6386429, 6386685, 6388065, 6449522, 6578464, 6579488, 6580512, 6627426, 6627435, 6644841, 6647328, 6648352, 6648425, 6648681, 6909029, 6909472, 6909545, 6910496, 7102830, 7102834, 7103776, 7103858, 7217249, 7217250, 7217259, 7234657, 7234661, 7234848, 7235872, 7235950, 7273760, 7498094, 7535982, 7759136, 7954720, 7958386, 16608800, 16608868, 16609021, 16642301 ]; exports["8859_9_tr"] = function(input, stats) { var name = stats.c1Bytes ? "windows-1254" : "ISO-8859-9", confidence = base.match(input, ngrams, byteMap); return 0 == confidence ? null : new CharsetMatch(confidence, name, "tr"); }; }, function(module, exports, __webpack_require__) { var byteMap = [ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 66, 67, 68, 69, 70, 71, 72, 73, 64, 64, 64, 64, 64, 64, 64, 81, 82, 64, 64, 85, 86, 87, 88, 89, 64, 64, 64, 64, 64, 64, 64, 64, 98, 99, 100, 101, 102, 103, 104, 105, 64, 64, 64, 64, 64, 64, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 64, 64, 64, 64, 64, 64, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 64, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 64, 64, 184, 185, 186, 187, 188, 189, 190, 191, 64, 129, 130, 131, 132, 133, 134, 135, 136, 137, 64, 203, 64, 205, 64, 207, 64, 145, 146, 147, 148, 149, 150, 151, 152, 153, 218, 219, 220, 221, 222, 223, 64, 64, 162, 163, 164, 165, 166, 167, 168, 169, 234, 235, 64, 237, 238, 239, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 251, 252, 253, 254, 64 ], ngrams = { IBM420_rtl: [ 4216497, 4216509, 4216918, 4233905, 4238300, 4239793, 4242365, 4247382, 5652566, 5654080, 5661504, 5666112, 5681472, 5681481, 5681494, 5681496, 5681507, 5681511, 5681513, 5681523, 5681528, 5681562, 5681581, 5681595, 5681615, 5681628, 5684032, 5684544, 5684579, 5783638, 6438998, 6439083, 6439089, 6439099, 6439119, 6504534, 7553110, 7561792, 7684182, 7692864, 7880790, 10109014, 10138074, 11263040, 11616342, 11625024, 11655744, 11656256, 12271702, 12277312, 12280384, 12303680, 12402774, 12533846, 12539456, 13588145, 13614400, 14303318, 14434390, 14434491, 14434511, 14443072, 14447936, 14466368 ], IBM420_ltr: [ 4212310, 4216507, 4216511, 4219507, 4219509, 4219569, 4219579, 4219612, 4219734, 4224342, 4224476, 4239702, 4242262, 4242774, 4242875, 4242895, 4242908, 4250289, 4250795, 4250801, 4829526, 5652566, 5652568, 5652578, 5652579, 5652595, 5652597, 5652600, 5652634, 5652657, 5652667, 5652669, 5652671, 5652698, 5652700, 5658688, 5681494, 5689152, 5812566, 6533462, 6536534, 6795606, 6926678, 7582038, 7909718, 10137942, 11223138, 11383126, 11616354, 11621952, 11622095, 11639360, 11645248, 12271714, 12271836, 12300630, 12408384, 12434240, 13582434, 13582556, 13611350, 14332314, 14461760, 14463318 ] }, CharsetMatch = __webpack_require__(18), base = __webpack_require__(41); function genMatcher(name) { var ng = ngrams[name]; return function(input) { var confidence = base.matchIBM420(input, ng, byteMap, 64); return 0 == confidence ? null : new CharsetMatch(confidence, name, "ar"); }; } exports.IBM420_rtl = genMatcher("IBM420_rtl"), exports.IBM420_ltr = genMatcher("IBM420_ltr"); }, function(module, exports, __webpack_require__) { var byteMap = [ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 64, 64, 64, 64, 64, 64, 64, 81, 82, 83, 84, 85, 86, 87, 88, 89, 64, 64, 64, 64, 64, 64, 64, 64, 98, 99, 100, 101, 102, 103, 104, 105, 64, 64, 64, 64, 64, 64, 64, 113, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 64, 64, 64, 129, 130, 131, 132, 133, 134, 135, 136, 137, 64, 64, 64, 64, 64, 64, 64, 145, 146, 147, 148, 149, 150, 151, 152, 153, 64, 64, 64, 64, 64, 64, 160, 64, 162, 163, 164, 165, 166, 167, 168, 169, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 129, 130, 131, 132, 133, 134, 135, 136, 137, 64, 64, 64, 64, 64, 64, 64, 145, 146, 147, 148, 149, 150, 151, 152, 153, 64, 64, 64, 64, 64, 64, 64, 64, 162, 163, 164, 165, 166, 167, 168, 169, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 ], ngrams = { IBM424_rtl: [ 4211014, 4211016, 4211025, 4211057, 4211281, 4211286, 4212033, 4212038, 4212049, 4212054, 4212066, 4212073, 4212081, 4215873, 4215877, 4216385, 4219476, 4221268, 4288832, 4538433, 4538434, 4538437, 4538452, 4538454, 4538473, 4539969, 4604224, 4609344, 4609856, 4614208, 4616512, 5324869, 5326144, 5326449, 5329237, 5330240, 5330752, 5335104, 5337408, 5521473, 5521477, 5521728, 5522752, 5587009, 5587010, 5587013, 5587028, 5587030, 5587049, 5653824, 5718085, 5784896, 5787968, 5787989, 6444096, 6832197, 6836565, 6902848, 7422017, 7422018, 7422021, 7422036, 7422038, 7422057 ], IBM424_ltr: [ 4211014, 4211028, 4212049, 4212052, 4212054, 4212056, 4215128, 4215906, 4215913, 4216134, 4216145, 4216646, 4216657, 4220998, 4221009, 4223297, 4223302, 4223313, 4276293, 4276308, 4276309, 4276337, 4277568, 4277829, 4281408, 4281920, 4341829, 4341845, 4341873, 4538437, 4538449, 4538452, 4538453, 4538455, 4538472, 4538481, 4543552, 4604224, 4605248, 4735296, 5325120, 5325376, 5326144, 5521477, 5521493, 5521521, 5530176, 5531968, 5591377, 5591384, 5591400, 5652549, 5652565, 5652593, 5653056, 5653824, 6440256, 6897733, 6897749, 6897777, 6899008, 7422272, 7423296, 7423569 ] }, CharsetMatch = __webpack_require__(18), base = __webpack_require__(41); function genMatcher(name) { var ng = ngrams[name]; return function(input) { var confidence = base.match(input, ng, byteMap, 64); return 0 == confidence ? null : new CharsetMatch(confidence, name, "he"); }; } exports.IBM424_rtl = genMatcher("IBM424_rtl"), exports.IBM424_ltr = genMatcher("IBM424_ltr"); }, function(module, exports, __webpack_require__) { var ngrams = [ 2155040, 2155246, 2155758, 2156512, 2156576, 2157280, 2157294, 2158048, 2158053, 2158305, 2158574, 2158576, 2158816, 2159086, 2159090, 2159342, 2160626, 2162162, 14740968, 14742268, 14937632, 15068156, 15068648, 15069682, 15069728, 15212783, 15263008, 15263776, 15269664, 15459821, 15460384, 15465709, 15589408, 15590688, 15591653, 15591679, 15592992, 15593186, 15605986, 15605999, 15606001, 15655456, 15655648, 15655918, 15657248, 15657980, 15658016, 15659506, 15724267, 15724773, 15724776, 15724782, 15786210, 15787492, 15856352, 15856354, 15856360, 15859488, 15918571, 15920672, 15920880, 15924256, 16249582, 16512288 ], byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 144, 131, 32, 131, 32, 32, 32, 32, 32, 32, 154, 32, 156, 157, 158, 159, 144, 32, 32, 32, 32, 32, 32, 32, 32, 32, 154, 32, 156, 157, 158, 159, 32, 162, 162, 188, 32, 180, 32, 32, 184, 32, 186, 32, 32, 32, 32, 191, 32, 32, 179, 179, 180, 181, 32, 32, 184, 32, 186, 32, 188, 190, 190, 191, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 ], CharsetMatch = __webpack_require__(18), base = __webpack_require__(41); module.exports = function(input) { var confidence = base.match(input, ngrams, byteMap); return 0 == confidence ? null : new CharsetMatch(confidence, "windows-1251", "ru"); }; }, function(module, exports, __webpack_require__) { var ngrams = [ 2148321, 2148324, 2148551, 2153185, 2153965, 2154977, 2155492, 2156231, 13050055, 13091104, 13093408, 13095200, 13099296, 13099459, 13099463, 13099464, 13099466, 13099468, 13099469, 13099471, 13099475, 13099482, 13099486, 13099491, 13099494, 13099501, 13099808, 13100064, 13100234, 13115591, 13181127, 13181149, 13181153, 13181155, 13181158, 13246663, 13574343, 13617440, 13705415, 13748512, 13836487, 14295239, 14344684, 14544160, 14753991, 14797088, 14806048, 14806304, 14885063, 14927648, 14928160, 14935072, 14950599, 15016135, 15058720, 15124449, 15131680, 15474887, 15540423, 15540451, 15540454, 15583520, 15585568, 15590432 ], byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 129, 32, 131, 32, 32, 32, 32, 136, 32, 138, 32, 156, 141, 142, 143, 144, 32, 32, 32, 32, 32, 32, 32, 152, 32, 154, 32, 156, 32, 32, 159, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 170, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 181, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 32, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 32, 32, 32, 32, 244, 32, 32, 32, 32, 249, 32, 251, 252, 32, 32, 255 ], CharsetMatch = __webpack_require__(18), base = __webpack_require__(41); module.exports = function(input) { var confidence = base.match(input, ngrams, byteMap); return 0 == confidence ? null : new CharsetMatch(confidence, "windows-1256", "ar"); }; }, function(module, exports, __webpack_require__) { var ngrams = [ 2147535, 2148640, 2149313, 2149327, 2150081, 2150085, 2150338, 2150607, 2150610, 2151105, 2151375, 2151380, 2151631, 2152224, 2152399, 2153153, 2153684, 2154196, 12701385, 12702936, 12963032, 12963529, 12964820, 12964896, 13094688, 13181136, 13223200, 13224224, 13226272, 13419982, 13420832, 13424846, 13549856, 13550880, 13552069, 13552081, 13553440, 13553623, 13574352, 13574355, 13574359, 13617103, 13617696, 13618392, 13618464, 13620180, 13621024, 13621185, 13684684, 13685445, 13685449, 13685455, 13812183, 13813188, 13881632, 13882561, 13882569, 13882583, 13944268, 13946656, 13946834, 13948960, 14272544, 14603471 ], byteMap = [ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 163, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 163, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223 ], CharsetMatch = __webpack_require__(18), base = __webpack_require__(41); module.exports = function(input) { var confidence = base.match(input, ngrams, byteMap); return 0 == confidence ? null : new CharsetMatch(confidence, "KOI8-R", "ru"); }; }, function(module, exports, __webpack_require__) { var CharsetMatch = __webpack_require__(18); module.exports = function(input) { var i, confidence, hasBOM = !1, numValid = 0, numInvalid = 0, trailBytes = 0, inputLength = input.length; for (inputLength >= 3 && 239 == (255 & input[0]) && 187 == (255 & input[1]) && 191 == (255 & input[2]) && (hasBOM = !0), i = 0; i < inputLength; i++) { var b = input[i]; if (0 != (128 & b)) { if (192 == (224 & b)) trailBytes = 1; else if (224 == (240 & b)) trailBytes = 2; else { if (240 != (248 & b)) { numInvalid++; continue; } trailBytes = 3; } for (;!(++i >= inputLength); ) { if (128 != (192 & (b = input[i]))) { numInvalid++; break; } if (0 == --trailBytes) { numValid++; break; } } } } return confidence = 0, hasBOM && 0 == numInvalid ? confidence = 100 : hasBOM && numValid > 10 * numInvalid ? confidence = 80 : numValid > 3 && 0 == numInvalid ? confidence = 100 : numValid > 0 && 0 == numInvalid ? confidence = 80 : 0 == numValid && 0 == numInvalid ? confidence = 15 : numValid > 10 * numInvalid && (confidence = 25), 0 == confidence ? null : new CharsetMatch(confidence, "UTF-8"); }; }, function(module, exports, __webpack_require__) { var INFLATE = __webpack_require__(782), bops = __webpack_require__(192), Reader = exports.Reader = function(data) { if (!(this instanceof Reader)) return new Reader(data); this._source = new BufferSource(data), this._offset = 0; }; function BufferSource(buffer) { this._buffer = buffer, this.length = function() { return buffer.length; }, this.read = function(start, length) { return bops.subarray(this._buffer, start, start + length); }; } Reader.prototype.length = function() { return this._source.length(); }, Reader.prototype.position = function() { return this._offset; }, Reader.prototype.seek = function(offset) { this._offset = offset; }, Reader.prototype.read = function(length) { var bytes = this._source.read(this._offset, length); return this._offset += length, bytes; }, Reader.prototype.readInteger = function(length, bigEndian) { return bigEndian ? bytesToNumberBE(this.read(length)) : bytesToNumberLE(this.read(length)); }, Reader.prototype.readString = function(length, charset) { return bops.to(this.read(length), charset || "utf8"); }, Reader.prototype.readUncompressed = function(length, method) { var compressed = this.read(length), uncompressed = null; if (0 === method) uncompressed = compressed; else { if (8 !== method) throw new Error("Unknown compression method: " + structure.compression_method); uncompressed = INFLATE.inflate(compressed); } return uncompressed; }, Reader.prototype.readStructure = function() { var structure = {}; switch (structure.signature = this.readInteger(4), structure.signature) { case 67324752: this.readLocalFileHeader(structure); break; case 33639248: this.readCentralDirectoryFileHeader(structure); break; case 101010256: this.readEndOfCentralDirectoryRecord(structure); break; default: throw new Error("Unknown ZIP structure signature: 0x" + structure.signature.toString(16)); } return structure; }, Reader.prototype.readLocalFileHeader = function(structure) { if ((structure = structure || {}).signature || (structure.signature = this.readInteger(4)), 67324752 !== structure.signature) throw new Error("ZIP local file header signature invalid (expects 0x04034b50, actually 0x" + structure.signature.toString(16) + ")"); structure.version_needed = this.readInteger(2), structure.flags = this.readInteger(2), structure.compression_method = this.readInteger(2), structure.last_mod_file_time = this.readInteger(2), structure.last_mod_file_date = this.readInteger(2), structure.crc_32 = this.readInteger(4), structure.compressed_size = this.readInteger(4), structure.uncompressed_size = this.readInteger(4), structure.file_name_length = this.readInteger(2), structure.extra_field_length = this.readInteger(2); var n = structure.file_name_length, m = structure.extra_field_length; return structure.file_name = this.readString(n), structure.extra_field = this.read(m), structure; }, Reader.prototype.readCentralDirectoryFileHeader = function(structure) { if ((structure = structure || {}).signature || (structure.signature = this.readInteger(4)), 33639248 !== structure.signature) throw new Error("ZIP central directory file header signature invalid (expects 0x02014b50, actually 0x" + structure.signature.toString(16) + ")"); structure.version = this.readInteger(2), structure.version_needed = this.readInteger(2), structure.flags = this.readInteger(2), structure.compression_method = this.readInteger(2), structure.last_mod_file_time = this.readInteger(2), structure.last_mod_file_date = this.readInteger(2), structure.crc_32 = this.readInteger(4), structure.compressed_size = this.readInteger(4), structure.uncompressed_size = this.readInteger(4), structure.file_name_length = this.readInteger(2), structure.extra_field_length = this.readInteger(2), structure.file_comment_length = this.readInteger(2), structure.disk_number = this.readInteger(2), structure.internal_file_attributes = this.readInteger(2), structure.external_file_attributes = this.readInteger(4), structure.local_file_header_offset = this.readInteger(4); var n = structure.file_name_length, m = structure.extra_field_length, k = structure.file_comment_length; return structure.file_name = this.readString(n), structure.extra_field = this.read(m), structure.file_comment = this.readString(k), structure.mode = this.detectChmod(structure.version, structure.external_file_attributes), structure; }, Reader.prototype.detectChmod = function(versionMadeBy, externalFileAttributes) { var mode = externalFileAttributes >>> 16, chmod = !1; return mode &= 511, 3 != versionMadeBy >> 8 || "darwin" !== process.platform && "linux" !== process.platform || (chmod = mode.toString(8)), chmod; }, Reader.prototype.locateEndOfCentralDirectoryRecord = function() { for (var length = this.length(), minPosition = length - Math.pow(2, 16) - 22, position = length - 22 + 1; --position; ) { if (position < minPosition) throw new Error("Unable to find end of central directory record"); if (this.seek(position), 101010256 === this.readInteger(4) && (this.seek(position + 20), position + 22 + this.readInteger(2) === length)) break; } return this.seek(position), position; }, Reader.prototype.readEndOfCentralDirectoryRecord = function(structure) { if ((structure = structure || {}).signature || (structure.signature = this.readInteger(4)), 101010256 !== structure.signature) throw new Error("ZIP end of central directory record signature invalid (expects 0x06054b50, actually 0x" + structure.signature.toString(16) + ")"); structure.disk_number = this.readInteger(2), structure.central_dir_disk_number = this.readInteger(2), structure.central_dir_disk_records = this.readInteger(2), structure.central_dir_total_records = this.readInteger(2), structure.central_dir_size = this.readInteger(4), structure.central_dir_offset = this.readInteger(4), structure.file_comment_length = this.readInteger(2); var n = structure.file_comment_length; return structure.file_comment = this.readString(n), structure; }, Reader.prototype.readDataDescriptor = function() { var descriptor = {}; return descriptor.crc_32 = this.readInteger(4), 134695760 === descriptor.crc_32 && (descriptor.crc_32 = this.readInteger(4)), descriptor.compressed_size = this.readInteger(4), descriptor.uncompressed_size = this.readInteger(4), descriptor; }, Reader.prototype.iterator = function() { var stream = this; stream.locateEndOfCentralDirectoryRecord(); var endRecord = stream.readEndOfCentralDirectoryRecord(); stream.seek(endRecord.central_dir_offset); var count = endRecord.central_dir_disk_records; return { next: function() { if (0 == count--) throw "stop-iteration"; var centralHeader = stream.readCentralDirectoryFileHeader(), saved = stream.position(); stream.seek(centralHeader.local_file_header_offset); var localHeader = stream.readLocalFileHeader(), start = stream.position(); return stream.seek(saved), new Entry(localHeader, stream, start, centralHeader.compressed_size, centralHeader.compression_method, centralHeader.mode); } }; }, Reader.prototype.forEach = function(block, context) { for (var next, iterator = this.iterator(); ;) { try { next = iterator.next(); } catch (exception) { if ("stop-iteration" === exception) break; if ("skip-iteration" === exception) continue; throw exception; } block.call(context, next); } }, Reader.prototype.toObject = function(charset) { var object = {}; return this.forEach((function(entry) { if (entry.isFile()) { var data = entry.getData(); charset && (data = data.toString(charset)), object[entry.getName()] = data; } })), object; }, Reader.prototype.close = function(mode, options) {}; var Entry = exports.Entry = function(header, realStream, start, compressedSize, compressionMethod, mode) { this._mode = mode, this._header = header, this._realStream = realStream, this._stream = null, this._start = start, this._compressedSize = compressedSize, this._compressionMethod = compressionMethod; }; Entry.prototype.getName = function() { return this._header.file_name; }, Entry.prototype.isFile = function() { return !this.isDirectory(); }, Entry.prototype.isDirectory = function() { return "/" === this.getName().slice(-1); }, Entry.prototype.lastModified = function() { return decodeDateTime(this._header.last_mod_file_date, this._header.last_mod_file_time); }, Entry.prototype.getData = function() { if (null == this._stream) { var bookmark = this._realStream.position(); this._realStream.seek(this._start), this._stream = this._realStream.readUncompressed(this._compressedSize, this._compressionMethod), this._realStream.seek(bookmark); } return this._stream; }, Entry.prototype.getMode = function() { return this._mode; }; var bytesToNumberLE = function(bytes) { for (var acc = 0, i = 0; i < bytes.length; i++) acc += bops.readUInt8(bytes, i) << 8 * i; return acc; }, bytesToNumberBE = function(bytes) { for (var acc = 0, i = 0; i < bytes.length; i++) acc = (acc << 8) + bops.readUInt8(bytes, i); return acc; }, decodeDateTime = function(date, time) { return new Date(1980 + (date >>> 9), (date >>> 5 & 15) - 1, 31 & date, time >>> 11 & 31, time >>> 5 & 63, 2 * (63 & time)); }; }, function(module, exports, __webpack_require__) { var BufferIO = __webpack_require__(783).BufferIO, bops = __webpack_require__(192); exports.inflate = function(input) { var slide, wp, fixed_td, fixed_bl, bit_buf, bit_len, method, eof, copy_leng, copy_dist, tl, td, bl, bd, inflate_data, inflate_pos, fixed_tl = null, MASK_BITS = [ 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535 ], cplens = [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 ], cplext = [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99 ], cpdist = [ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 ], cpdext = [ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 ], border = [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; function HuftList() { this.next = null, this.list = null; } function HuftNode() { this.e = 0, this.b = 0, this.n = 0, this.t = null; } function HuftBuild(b, n, s, d, e, mm) { this.BMAX = 16, this.N_MAX = 288, this.status = 0, this.root = null, this.m = 0; var a, el, f, g, h, i, j, k, p, pidx, q, w, xp, y, z, o, tail, c = new Array(this.BMAX + 1), lx = new Array(this.BMAX + 1), r = new HuftNode, u = new Array(this.BMAX), v = new Array(this.N_MAX), x = new Array(this.BMAX + 1); for (tail = this.root = null, i = 0; i < c.length; i++) c[i] = 0; for (i = 0; i < lx.length; i++) lx[i] = 0; for (i = 0; i < u.length; i++) u[i] = null; for (i = 0; i < v.length; i++) v[i] = 0; for (i = 0; i < x.length; i++) x[i] = 0; el = n > 256 ? b[256] : this.BMAX, p = b, pidx = 0, i = n; do { c[p[pidx]]++, pidx++; } while (--i > 0); if (c[0] == n) return this.root = null, this.m = 0, void (this.status = 0); for (j = 1; j <= this.BMAX && 0 == c[j]; j++) ; for (k = j, mm < j && (mm = j), i = this.BMAX; 0 != i && 0 == c[i]; i--) ; for (g = i, mm > i && (mm = i), y = 1 << j; j < i; j++, y <<= 1) if ((y -= c[j]) < 0) return this.status = 2, void (this.m = mm); if ((y -= c[i]) < 0) return this.status = 2, void (this.m = mm); for (c[i] += y, x[1] = j = 0, p = c, pidx = 1, xp = 2; --i > 0; ) x[xp++] = j += p[pidx++]; p = b, pidx = 0, i = 0; do { 0 != (j = p[pidx++]) && (v[x[j]++] = i); } while (++i < n); for (n = x[g], x[0] = i = 0, p = v, pidx = 0, h = -1, w = lx[0] = 0, q = null, z = 0; k <= g; k++) for (a = c[k]; a-- > 0; ) { for (;k > w + lx[1 + h]; ) { if (w += lx[1 + h], h++, z = (z = g - w) > mm ? mm : z, (f = 1 << (j = k - w)) > a + 1) for (f -= a + 1, xp = k; ++j < z && !((f <<= 1) <= c[++xp]); ) f -= c[xp]; for (w + j > el && w < el && (j = el - w), z = 1 << j, lx[1 + h] = j, q = new Array(z), o = 0; o < z; o++) q[o] = new HuftNode; (tail = null == tail ? this.root = new HuftList : tail.next = new HuftList).next = null, tail.list = q, u[h] = q, h > 0 && (x[h] = i, r.b = lx[h], r.e = 16 + j, r.t = q, j = (i & (1 << w) - 1) >> w - lx[h], u[h - 1][j].e = r.e, u[h - 1][j].b = r.b, u[h - 1][j].n = r.n, u[h - 1][j].t = r.t); } for (r.b = k - w, pidx >= n ? r.e = 99 : p[pidx] < s ? (r.e = p[pidx] < 256 ? 16 : 15, r.n = p[pidx++]) : (r.e = e[p[pidx] - s], r.n = d[p[pidx++] - s]), f = 1 << k - w, j = i >> w; j < z; j += f) q[j].e = r.e, q[j].b = r.b, q[j].n = r.n, q[j].t = r.t; for (j = 1 << k - 1; 0 != (i & j); j >>= 1) i ^= j; for (i ^= j; (i & (1 << w) - 1) != x[h]; ) w -= lx[h], h--; } this.m = lx[1], this.status = 0 != y && 1 != g ? 1 : 0; } function NEEDBITS(n) { for (;bit_len < n; ) bit_buf |= (inflate_data.length == inflate_pos ? -1 : bops.readUInt8(inflate_data, inflate_pos++)) << bit_len, bit_len += 8; } function GETBITS(n) { return bit_buf & MASK_BITS[n]; } function DUMPBITS(n) { bit_buf >>= n, bit_len -= n; } function inflate_codes(buff, off, size) { var e, t, n; if (0 == size) return 0; for (n = 0; ;) { for (NEEDBITS(bl), e = (t = tl.list[GETBITS(bl)]).e; e > 16; ) { if (99 == e) return -1; DUMPBITS(t.b), NEEDBITS(e -= 16), e = (t = t.t[GETBITS(e)]).e; } if (DUMPBITS(t.b), 16 != e) { if (15 == e) break; for (NEEDBITS(e), copy_leng = t.n + GETBITS(e), DUMPBITS(e), NEEDBITS(bd), e = (t = td.list[GETBITS(bd)]).e; e > 16; ) { if (99 == e) return -1; DUMPBITS(t.b), NEEDBITS(e -= 16), e = (t = t.t[GETBITS(e)]).e; } for (DUMPBITS(t.b), NEEDBITS(e), copy_dist = wp - t.n - GETBITS(e), DUMPBITS(e); copy_leng > 0 && n < size; ) copy_leng--, copy_dist &= 32767, wp &= 32767, buff[off + n++] = slide[wp++] = slide[copy_dist++]; if (n == size) return size; } else if (wp &= 32767, buff[off + n++] = slide[wp++] = t.n, n == size) return size; } return method = -1, n; } function inflate_stored(buff, off, size) { var n; if (DUMPBITS(n = 7 & bit_len), NEEDBITS(16), n = GETBITS(16), DUMPBITS(16), NEEDBITS(16), n != (65535 & ~bit_buf)) return -1; for (DUMPBITS(16), copy_leng = n, n = 0; copy_leng > 0 && n < size; ) copy_leng--, wp &= 32767, NEEDBITS(8), buff[off + n++] = slide[wp++] = GETBITS(8), DUMPBITS(8); return 0 == copy_leng && (method = -1), n; } function inflate_fixed(buff, off, size) { if (null == fixed_tl) { var i, h, l = new Array(288); for (i = 0; i < 144; i++) l[i] = 8; for (;i < 256; i++) l[i] = 9; for (;i < 280; i++) l[i] = 7; for (;i < 288; i++) l[i] = 8; if (0 != (h = new HuftBuild(l, 288, 257, cplens, cplext, fixed_bl = 7)).status) return alert("HufBuild error: " + h.status), -1; for (fixed_tl = h.root, fixed_bl = h.m, i = 0; i < 30; i++) l[i] = 5; var fixed_bd = 5; if ((h = new HuftBuild(l, 30, 0, cpdist, cpdext, fixed_bd)).status > 1) return fixed_tl = null, alert("HufBuild error: " + h.status), -1; fixed_td = h.root, fixed_bd = h.m; } return tl = fixed_tl, td = fixed_td, bl = fixed_bl, bd = fixed_bd, inflate_codes(buff, off, size); } function inflate_dynamic(buff, off, size) { var i, j, l, n, t, nb, nl, nd, h, ll = new Array(316); for (i = 0; i < ll.length; i++) ll[i] = 0; if (NEEDBITS(5), nl = 257 + GETBITS(5), DUMPBITS(5), NEEDBITS(5), nd = 1 + GETBITS(5), DUMPBITS(5), NEEDBITS(4), nb = 4 + GETBITS(4), DUMPBITS(4), nl > 286 || nd > 30) return -1; for (j = 0; j < nb; j++) NEEDBITS(3), ll[border[j]] = GETBITS(3), DUMPBITS(3); for (;j < 19; j++) ll[border[j]] = 0; if (0 != (h = new HuftBuild(ll, 19, 19, null, null, bl = 7)).status) return -1; for (tl = h.root, bl = h.m, n = nl + nd, i = l = 0; i < n; ) if (NEEDBITS(bl), DUMPBITS(j = (t = tl.list[GETBITS(bl)]).b), (j = t.n) < 16) ll[i++] = l = j; else if (16 == j) { if (NEEDBITS(2), j = 3 + GETBITS(2), DUMPBITS(2), i + j > n) return -1; for (;j-- > 0; ) ll[i++] = l; } else if (17 == j) { if (NEEDBITS(3), j = 3 + GETBITS(3), DUMPBITS(3), i + j > n) return -1; for (;j-- > 0; ) ll[i++] = 0; l = 0; } else { if (NEEDBITS(7), j = 11 + GETBITS(7), DUMPBITS(7), i + j > n) return -1; for (;j-- > 0; ) ll[i++] = 0; l = 0; } if (h = new HuftBuild(ll, nl, 257, cplens, cplext, bl = 9), 0 == bl && (h.status = 1), 0 != h.status) return h.status, -1; for (tl = h.root, bl = h.m, i = 0; i < nd; i++) ll[i] = ll[i + nl]; return h = new HuftBuild(ll, nd, 0, cpdist, cpdext, bd = 6), td = h.root, 0 == (bd = h.m) && nl > 257 ? -1 : (h.status, 0 != h.status ? -1 : inflate_codes(buff, off, size)); } function inflate_internal(buff, off, size) { var n, i; for (n = 0; n < size; ) { if (eof && -1 == method) return n; if (copy_leng > 0) { if (0 != method) for (;copy_leng > 0 && n < size; ) copy_leng--, copy_dist &= 32767, wp &= 32767, buff[off + n++] = slide[wp++] = slide[copy_dist++]; else { for (;copy_leng > 0 && n < size; ) copy_leng--, wp &= 32767, NEEDBITS(8), buff[off + n++] = slide[wp++] = GETBITS(8), DUMPBITS(8); 0 == copy_leng && (method = -1); } if (n == size) return n; } if (-1 == method) { if (eof) break; NEEDBITS(1), 0 != GETBITS(1) && (eof = !0), DUMPBITS(1), NEEDBITS(2), method = GETBITS(2), DUMPBITS(2), tl = null, copy_leng = 0; } switch (method) { case 0: i = inflate_stored(buff, off + n, size - n); break; case 1: i = null != tl ? inflate_codes(buff, off + n, size - n) : inflate_fixed(buff, off + n, size - n); break; case 2: i = null != tl ? inflate_codes(buff, off + n, size - n) : inflate_dynamic(buff, off + n, size - n); break; default: i = -1; } if (-1 == i) return eof ? 0 : -1; n += i; } return n; } return (function(bytes) { var out, buff, i; for (null == slide && (slide = new Array(65536)), wp = 0, bit_buf = 0, bit_len = 0, method = -1, eof = !1, copy_leng = copy_dist = 0, tl = null, inflate_data = bytes, inflate_pos = 0, buff = new Array(1024), out = new BufferIO; (i = inflate_internal(buff, 0, buff.length)) > 0; ) out.write(buff.slice(0, i)); return inflate_data = void 0, out.toBuffer(); })(input); }; }, function(module, exports, __webpack_require__) { var bops = __webpack_require__(192); function consolidate(buffers) { var at, i, buffer, result, length = 0, ii = buffers.length; for (i = 0; i < ii; i++) length += (buffer = buffers[i]).length; for (result = bops.create(length), at = 0, i = 0; i < ii; i++) buffer = buffers[i], bops.copy(buffer, result, at, 0, buffer.length), at += buffer.length; buffers.splice(0, ii, result); } exports.BufferIO = function() { var self = {}, buffers = []; return self.read = function() { return consolidate(buffers), buffers.shift(); }, self.write = function(buffer) { buffers.push(bops.from(buffer)); }, self.close = function() {}, self.destroy = function() {}, self.toBuffer = function() { consolidate(buffers); var buffer = bops.create(buffers[0].length); return bops.copy(buffers[0], buffer, 0, 0, buffers[0].length), buffer; }, self; }, exports.consolidate = consolidate; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(10).Buffer; module.exports = function(source, encoding) { return new Buffer(source, encoding); }; }, function(module, exports) { module.exports = function(source, encoding) { return source.toString(encoding); }; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(10).Buffer; module.exports = function(buffer) { return Buffer.isBuffer(buffer); }; }, function(module, exports) { module.exports = function(source, from, to) { return 2 === arguments.length ? source.slice(from) : source.slice(from, to); }; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(10).Buffer; module.exports = function(targets, hint) { return void 0 !== hint ? Buffer.concat(targets, hint) : Buffer.concat(targets); }; }, function(module, exports) { module.exports = function(source, target, target_start, source_start, source_end) { return source.copy(target, target_start, source_start, source_end); }; }, function(module, exports, __webpack_require__) { module.exports = function(size) { return new Buffer(size); }; var Buffer = __webpack_require__(10).Buffer; }, function(module, exports) { var buildFn, proto = {}, rex = /read.+/; for (var key in buildFn = function(key) { var code = "return buf." + key + "(" + [ "a", "b", "c" ].join(",") + ")"; return new Function([ "buf", "a", "b", "c" ], code); }, module.exports = proto, Buffer.prototype) rex.test(key) && (proto[key] = buildFn(key)); }, function(module, exports, __webpack_require__) { var buildFn, Buffer = __webpack_require__(10).Buffer, proto = {}, rex = /write.+/; for (var key in buildFn = function(key) { var code = "return buf." + key + "(" + [ "a", "b", "c" ].join(",") + ")"; return new Function([ "buf", "a", "b", "c" ], code); }, module.exports = proto, Buffer.prototype) rex.test(key) && (proto[key] = buildFn(key)); }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2); function parseString(stringData) { return (stringData || "").replace(/\r+/g, "").split("\n\n").reduce(createSrtData, []); } function createSrtData(memo, string) { for (var lines = string.split("\n"); lines.length > 2 && !lines[0].match(" --\x3e "); ) lines.shift(); if (lines.length < 2) return memo; var times = lines[0].split(" "), startTime = parseTime(times[0]), endTime = parseTime(times[2]), text = lines.slice(1).join("\n"); return startTime === 1 / 0 || endTime === 1 / 0 || 0 === text.length || memo.push({ number: memo.length, startTime: startTime, endTime: endTime, text: text }), memo; } function parseTime(timeString) { if (!timeString) return 1 / 0; var chunks = timeString.split(":"); if (3 != chunks.length) return 1 / 0; var secondChunks = chunks[2].split(/,|\./); return 36e5 * parseInt(chunks[0], 10) + 6e4 * parseInt(chunks[1], 10) + 1e3 * parseInt(secondChunks[0], 10) + parseInt(secondChunks[1], 10); } module.exports = { parseString: parseString, parseFile: function(path, cb) { fs.readFile(path, (function(err, buf) { if (err) return cb(err); try { cb(null, parseString(buf.toString())); } catch (e) { cb(e); } })); } }; }, function(module, exports, __webpack_require__) { var _ = __webpack_require__(407), fs = __webpack_require__(2), path = __webpack_require__(5), opensub = new (__webpack_require__(795)), fetch = __webpack_require__(34), URL = __webpack_require__(7).URL; module.exports = function(args, cb) { if ("string" != typeof args.url) return cb(new Error("url required")); cb = _.once(cb); var fd, res = {}, buf_start = Buffer.alloc(131072), buf_end = Buffer.alloc(131072), buf_pad = Buffer.alloc(65536), file_size = 0, t_chksum = [], ready = function(chksum_part) { if (fd && fs.close(fd, (function() {})), fd = null, t_chksum.push(chksum_part), 3 == t_chksum.length) { var chksum = opensub.sumHex64bits(t_chksum[0], t_chksum[1]); chksum = (chksum = opensub.sumHex64bits(chksum, t_chksum[2])).substr(-16), res.hash = opensub.padLeft(chksum, "0", 16), cb(null, res); } }; if (args.url.startsWith("file:")) { var p = decodeURI(new URL(args.url).pathname).replace(/^\/([a-z]+:\/)/i, "$1").replace("/", path.sep); fs.stat(p, (function(err, stat) { if (err) return cb(err); file_size = res.size = stat.size, ready(file_size.toString(16)), fs.open(p, "r", (function(err, f) { if (err) return cb(err); fd = f, [ { buf: buf_start, offset: 0 }, { buf: buf_end, offset: file_size - 65536 } ].forEach((function(b) { fs.read(fd, b.buf, 0, 131072, b.offset, (function(err, _, buffer) { if (err) return cb(err); ready(opensub.checksumBuffer(buffer, 16)); })); })); })); })); } else { if (!args.url.match(/^http(s?):/)) return cb(new Error("args.url must begin with http or file")); fetch(args.url, { method: "HEAD" }).then((function(resp) { if (!resp.ok) throw new Error("Failed to fetch Media URL: " + resp.statusText); var mediaUrl = resp.url || args.url; if (file_size = res.size = parseInt(resp.headers.get("content-length"), 10), isNaN(file_size)) throw new Error("Failed to get content length from response headers"); ready(file_size.toString(16)); var ranges = [ { start: 0, end: 65535 }, { start: file_size - 65536, end: file_size - 1 } ]; function tryRange(range, next) { fetch(mediaUrl, { headers: { range: "bytes=" + range.start + "-" + range.end, "enginefs-prio": 10 } }).then((function(resp) { if (!resp.ok) throw new Error("Failed to fetch chunk data for range: " + range.start + "-" + range.end + " - " + resp.statusText); return resp.arrayBuffer(); })).then((function(data) { if (65536 !== data.byteLength) throw new Error("Response for calculating movie hash has wrong length"); ready(opensub.checksumBuffer(Buffer.concat([ Buffer.from(data), buf_pad ]), 16)), next && next(); })).catch((function(err) { cb(err); })); } tryRange(ranges[0], (function() { tryRange(ranges[1]); })); })).catch((function(err) { cb(err); })); } }; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2), ee = __webpack_require__(4).EventEmitter, Api = __webpack_require__(796), os = module.exports = function(user, password, lang, ua) { this.api = new Api, this.user = user, this.password = password, this.lang = lang || "en", this.ua = ua || "NodeOpensubtitles v0.0.1"; }; os.prototype.__proto__ = ee.prototype, os.prototype.checkMovieHash = function(t_hash, cb) { var self = this; this.api.LogIn((function(err, res) { if (err) return cb(err); var token = res.token; self.api.CheckMovieHash((function(err, res) { if (err) return cb(err); cb(null, res); }), token, t_hash); }), this.user, this.password, this.lang, this.ua); }, os.prototype.computeHash = function(path, cb) { var buf_start = new Buffer(131072), buf_end = new Buffer(131072), file_size = 0, self = this, t_chksum = []; function checksumReady(chksum_part, name) { if (self.emit("checksum-ready", chksum_part, name), t_chksum.push(chksum_part), 3 == t_chksum.length) { var chksum = self.sumHex64bits(t_chksum[0], t_chksum[1]); chksum = (chksum = self.sumHex64bits(chksum, t_chksum[2])).substr(-16), cb(null, self.padLeft(chksum, "0", 16)); } } fs.stat(path, (function(err, stat) { if (err) return cb(err); checksumReady((file_size = stat.size).toString(16), "filesize"), fs.open(path, "r", (function(err, fd) { if (err) return cb(err); var t_buffers = [ { buf: buf_start, offset: 0 }, { buf: buf_end, offset: file_size - 65536 } ]; for (var i in t_buffers) fs.read(fd, t_buffers[i].buf, 0, 131072, t_buffers[i].offset, (function(err, bytesRead, buffer) { if (err) return cb(err); checksumReady(self.checksumBuffer(buffer, 16), "buf?"); })); })); })); }, os.prototype.read64LE = function(buffer, offset) { for (var ret_64_be = buffer.toString("hex", 8 * offset, 8 * (offset + 1)), t = [], i = 0; i < 8; i++) t.push(ret_64_be.substr(2 * i, 2)); return t.reverse(), t.join(""); }, os.prototype.checksumBuffer = function(buf, length) { for (var checksum = 0, checksum_hex = 0, i = 0; i < buf.length / length; i++) checksum_hex = this.read64LE(buf, i), checksum = this.sumHex64bits(checksum.toString(), checksum_hex).substr(-16); return checksum; }, os.prototype.sumHex64bits = function(n1, n2) { n1.length < 16 && (n1 = this.padLeft(n1, "0", 16)), n2.length < 16 && (n2 = this.padLeft(n2, "0", 16)); var n1_0 = n1.substr(0, 8), n2_0 = n2.substr(0, 8), i_0 = parseInt(n1_0, 16) + parseInt(n2_0, 16), n1_1 = n1.substr(8, 8), n2_1 = n2.substr(8, 8), h_1 = (parseInt(n1_1, 16) + parseInt(n2_1, 16)).toString(16), i_1_over = 0; return h_1.length > 8 ? i_1_over = parseInt(h_1.substr(0, h_1.length - 8), 16) : h_1 = this.padLeft(h_1, "0", 8), (i_1_over + i_0).toString(16) + h_1.substr(-8); }, os.prototype.padLeft = function(str, c, length) { for (;str.length < length; ) str = c.toString() + str; return str; }; }, function(module, exports, __webpack_require__) { var xmlrpc = __webpack_require__(797), ep = module.exports = function() { this.clientOptions = "http://api.opensubtitles.org/xml-rpc", this.client = xmlrpc.createClient(this.clientOptions); }; ep.prototype.call = function(method, args) { var cb = args[0], t = []; for (var i in delete args[0], args) t.push(args[i]); this.client.methodCall(method, t, cb); }, ep.prototype.LogIn = function(cb, username, password, language, useragent) { this.call("LogIn", arguments); }, ep.prototype.LogOut = function(cb, token) { this.call("LogOut", arguments); }, ep.prototype.SearchSubtitles = function(cb, token, t_queries) { this.call("SearchSubtitles", arguments); }, ep.prototype.SearchToMail = function(cb, token, t_langs, t_movies) { this.call("SearchToMail", arguments); }, ep.prototype.CheckSubHash = function(cb, token, t_subs_hash) { this.call("CheckSubHash", arguments); }, ep.prototype.CheckMovieHash = function(cb, token, t_movies_hash) { this.call("CheckMovieHash", arguments); }, ep.prototype.CheckMovieHash2 = function(cb, token, t_movies_hash) { this.call("CheckMovieHash2", arguments); }, ep.prototype.InsertMovieHash = function(cb, token, t_movies_info) { this.call("InsertMovieHash", arguments); }, ep.prototype.TryUploadSubtitles = function(cb, token, t_sub) { this.call("TryUploadSubtitles", arguments); }, ep.prototype.UploadSubtitles = function(cb, token, t_sub) { this.call("UploadSubtitles", arguments); }, ep.prototype.DetectLanguage = function(cb, token, t_texts) { this.call("DetectLanguage", arguments); }, ep.prototype.DownloadSubtitles = function(cb, token, t_subid) { this.call("DownloadSubtitles", arguments); }, ep.prototype.ReportWrongMovieHash = function(cb, token, IDSubMovieFile) { this.call("ReportWrongMovieHash", arguments); }, ep.prototype.ReportWrongImdbMovie = function(cb, token, t_movie) { this.call("ReportWrongImdbMovie", arguments); }, ep.prototype.GetSubLanguages = function(cb, language) { this.call("GetSubLanguages", arguments); }, ep.prototype.GetAvailableTranslations = function(cb, token, program) { this.call("GetAvailableTranslations", arguments); }, ep.prototype.GetTranslation = function(cb, token, iso639, format, program) { this.call("GetTranslation", arguments); }, ep.prototype.SearchMoviesOnIMDB = function(cb, token, query) { this.call("SearchMoviesOnIMDB", arguments); }, ep.prototype.GetIMDBMovieDetails = function(cb, token, imdbid) { this.call("GetIMDBMovieDetails", arguments); }, ep.prototype.InsertMovie = function(cb, token, t_movie) { this.call("InsertMovie", arguments); }, ep.prototype.SubtitlesVote = function(cb, token, t_vote) { this.call("SubtitlesVote", arguments); }, ep.prototype.GetComments = function(cb, token, t_subids) { this.call("GetComments", arguments); }, ep.prototype.AddComment = function(cb, token, t_comments) { this.call("AddComment", arguments); }, ep.prototype.AddRequest = function(cb, token, t_request) { this.call("AddRequest", arguments); }, ep.prototype.AutoUpdate = function(cb, program_name) { this.call("AutoUpdate", arguments); }, ep.prototype.NoOperation = function(cb, token) { this.call("NoOperation", arguments); }; }, function(module, exports, __webpack_require__) { var Client = __webpack_require__(798), Server = __webpack_require__(803), xmlrpc = exports; xmlrpc.createClient = function(options) { return new Client(options, !1); }, xmlrpc.createSecureClient = function(options) { return new Client(options, !0); }, xmlrpc.createServer = function(options) { return new Server(options, !1); }, xmlrpc.createSecureServer = function(options) { return new Server(options, !0); }; }, function(module, exports, __webpack_require__) { var http = __webpack_require__(11), https = __webpack_require__(21), url = __webpack_require__(7), Serializer = __webpack_require__(408), Deserializer = __webpack_require__(410); function Client(options, isSecure) { if (0 == this instanceof Client) return new Client(options, isSecure); "string" == typeof options && ((options = url.parse(options)).host = options.hostname, options.path = options.pathname); var headers = { "User-Agent": "NodeJS XML-RPC Client", "Content-Type": "text/xml", Accept: "text/xml", "Accept-Charset": "UTF8", Connection: "Keep-Alive" }; if (options.headers = options.headers || {}, null == options.headers.Authorization && null != options.basic_auth && null != options.basic_auth.user && null != options.basic_auth.pass) { var auth = options.basic_auth.user + ":" + options.basic_auth.pass; options.headers.Authorization = "Basic " + new Buffer(auth).toString("base64"); } for (var attribute in headers) void 0 === options.headers[attribute] && (options.headers[attribute] = headers[attribute]); options.method = "POST", this.options = options, this.isSecure = isSecure; } Client.prototype.methodCall = function(method, params, callback) { var xml = Serializer.serializeMethodCall(method, params), transport = this.isSecure ? https : http, options = this.options; options.headers["Content-Length"] = Buffer.byteLength(xml, "utf8"); var request = transport.request(options, (function(response) { 404 == response.statusCode ? callback(new Error("Not Found")) : new Deserializer(options.responseEncoding).deserializeMethodResponse(response, callback); })); request.on("error", callback), request.write(xml, "utf8"), request.end(); }, module.exports = Client; }, function(module, exports, __webpack_require__) { (function() { var XMLBuilder; XMLBuilder = __webpack_require__(800), module.exports.create = function() { return new XMLBuilder; }; }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLBuilder, XMLFragment, __hasProp = Object.prototype.hasOwnProperty; XMLFragment = __webpack_require__(801), XMLBuilder = (function() { function XMLBuilder() { XMLBuilder.__super__.constructor.call(this, null, "", {}, ""), this.isDoc = !0; } return (function(child, parent) { for (var key in parent) __hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLBuilder, XMLFragment), XMLBuilder.prototype.begin = function(name, xmldec, doctype, options) { var att, child, root; if (null == name) throw new Error("Root element needs a name"); if (this.children = [], name = "" + name || "", null != xmldec && null == xmldec.version) throw new Error("Version number is required"); if (null != xmldec) { if (xmldec.version = "" + xmldec.version || "", !xmldec.version.match(/1\.[0-9]+/)) throw new Error("Invalid version number: " + xmldec.version); if (att = { version: xmldec.version }, null != xmldec.encoding) { if (xmldec.encoding = "" + xmldec.encoding || "", !xmldec.encoding.match(/[A-Za-z](?:[A-Za-z0-9._-]|-)*/)) throw new Error("Invalid encoding: " + xmldec.encoding); att.encoding = xmldec.encoding; } null != xmldec.standalone && (att.standalone = xmldec.standalone ? "yes" : "no"), child = new XMLFragment(this, "?xml", att), this.children.push(child); } return null != doctype && (att = { name: name }, null != doctype.ext && (doctype.ext = "" + doctype.ext || "", att.ext = doctype.ext), child = new XMLFragment(this, "!DOCTYPE", att), this.children.push(child)), (root = new XMLFragment(this, name, {})).isRoot = !0, this.children.push(root), root; }, XMLBuilder.prototype.toString = function(options) { var r, _i, _len, _ref; for (r = "", _i = 0, _len = (_ref = this.children).length; _i < _len; _i++) r += _ref[_i].toString(options); return r; }, XMLBuilder; })(), module.exports = XMLBuilder; }).call(this); }, function(module, exports) { (function() { var XMLFragment, __hasProp = Object.prototype.hasOwnProperty; XMLFragment = (function() { function XMLFragment(parent, name, attributes, text) { this.isDoc = !1, this.isRoot = !1, this.parent = parent, this.name = name, this.attributes = attributes, this.value = text, this.children = []; } return XMLFragment.prototype.element = function(name, attributes, text) { var child, key, val, _ref, _ref2; if (null == name) throw new Error("Missing element name"); for (key in name = "" + name || "", this.assertLegalChar(name), null != attributes || (attributes = {}), this.is(attributes, "String") && this.is(text, "Object") ? (attributes = (_ref = [ text, attributes ])[0], text = _ref[1]) : this.is(attributes, "String") && (attributes = (_ref2 = [ {}, attributes ])[0], text = _ref2[1]), attributes) __hasProp.call(attributes, key) && (val = "" + (val = attributes[key]) || "", attributes[key] = this.escape(val)); return child = new XMLFragment(this, name, attributes), null != text && (text = "" + text || "", text = this.escape(text), this.assertLegalChar(text), child.text(text)), this.children.push(child), child; }, XMLFragment.prototype.insertBefore = function(name, attributes, text) { var child, i, key, val, _ref, _ref2; if (this.isRoot || this.isDoc) throw new Error("Cannot insert elements at root level"); if (null == name) throw new Error("Missing element name"); for (key in name = "" + name || "", this.assertLegalChar(name), null != attributes || (attributes = {}), this.is(attributes, "String") && this.is(text, "Object") ? (attributes = (_ref = [ text, attributes ])[0], text = _ref[1]) : this.is(attributes, "String") && (attributes = (_ref2 = [ {}, attributes ])[0], text = _ref2[1]), attributes) __hasProp.call(attributes, key) && (val = "" + (val = attributes[key]) || "", attributes[key] = this.escape(val)); return child = new XMLFragment(this.parent, name, attributes), null != text && (text = "" + text || "", text = this.escape(text), this.assertLegalChar(text), child.text(text)), i = this.parent.children.indexOf(this), this.parent.children.splice(i, 0, child), child; }, XMLFragment.prototype.insertAfter = function(name, attributes, text) { var child, i, key, val, _ref, _ref2; if (this.isRoot || this.isDoc) throw new Error("Cannot insert elements at root level"); if (null == name) throw new Error("Missing element name"); for (key in name = "" + name || "", this.assertLegalChar(name), null != attributes || (attributes = {}), this.is(attributes, "String") && this.is(text, "Object") ? (attributes = (_ref = [ text, attributes ])[0], text = _ref[1]) : this.is(attributes, "String") && (attributes = (_ref2 = [ {}, attributes ])[0], text = _ref2[1]), attributes) __hasProp.call(attributes, key) && (val = "" + (val = attributes[key]) || "", attributes[key] = this.escape(val)); return child = new XMLFragment(this.parent, name, attributes), null != text && (text = "" + text || "", text = this.escape(text), this.assertLegalChar(text), child.text(text)), i = this.parent.children.indexOf(this), this.parent.children.splice(i + 1, 0, child), child; }, XMLFragment.prototype.remove = function() { var i; if (this.isRoot || this.isDoc) throw new Error("Cannot remove the root element"); return i = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [ i, i - i + 1 ].concat([])), this.parent; }, XMLFragment.prototype.text = function(value) { var child; if (null == value) throw new Error("Missing element text"); return value = "" + value || "", value = this.escape(value), this.assertLegalChar(value), child = new XMLFragment(this, "", {}, value), this.children.push(child), this; }, XMLFragment.prototype.cdata = function(value) { var child; if (null == value) throw new Error("Missing CDATA text"); if (value = "" + value || "", this.assertLegalChar(value), value.match(/]]>/)) throw new Error("Invalid CDATA text: " + value); return child = new XMLFragment(this, "", {}, ""), this.children.push(child), this; }, XMLFragment.prototype.comment = function(value) { var child; if (null == value) throw new Error("Missing comment text"); if (value = "" + value || "", value = this.escape(value), this.assertLegalChar(value), value.match(/--/)) throw new Error("Comment text cannot contain double-hypen: " + value); return child = new XMLFragment(this, "", {}, "\x3c!-- " + value + " --\x3e"), this.children.push(child), this; }, XMLFragment.prototype.raw = function(value) { var child; if (null == value) throw new Error("Missing raw text"); return child = new XMLFragment(this, "", {}, value = "" + value || ""), this.children.push(child), this; }, XMLFragment.prototype.up = function() { if (this.isRoot) throw new Error("This node has no parent. Use doc() if you need to get the document object."); return this.parent; }, XMLFragment.prototype.root = function() { var child; if (this.isRoot) return this; for (child = this.parent; !child.isRoot; ) child = child.parent; return child; }, XMLFragment.prototype.document = function() { var child; if (this.isDoc) return this; for (child = this.parent; !child.isDoc; ) child = child.parent; return child; }, XMLFragment.prototype.prev = function() { var i; if (this.isRoot || this.isDoc) throw new Error("Root node has no siblings"); if ((i = this.parent.children.indexOf(this)) < 1) throw new Error("Already at the first node"); return this.parent.children[i - 1]; }, XMLFragment.prototype.next = function() { var i; if (this.isRoot || this.isDoc) throw new Error("Root node has no siblings"); if (-1 === (i = this.parent.children.indexOf(this)) || i === this.parent.children.length - 1) throw new Error("Already at the last node"); return this.parent.children[i + 1]; }, XMLFragment.prototype.attribute = function(name, value) { if (null == name) throw new Error("Missing attribute name"); if (null == value) throw new Error("Missing attribute value"); return name = "" + name || "", value = "" + value || "", null != this.attributes || (this.attributes = {}), this.attributes[name] = this.escape(value), this; }, XMLFragment.prototype.removeAttribute = function(name) { if (null == name) throw new Error("Missing attribute name"); return name = "" + name || "", delete this.attributes[name], this; }, XMLFragment.prototype.toString = function(options, level) { var attName, attValue, indent, newline, pretty, r, space, _i, _len, _ref, _ref2; for (attName in pretty = null != options && options.pretty || !1, indent = null != options && options.indent || " ", newline = null != options && options.newline || "\n", level || (level = 0), space = new Array(level + 1).join(indent), r = "", pretty && (r += space), this.value ? r += "" + this.value : r += "<" + this.name, _ref = this.attributes) attValue = _ref[attName], "!DOCTYPE" === this.name ? r += " " + attValue : r += " " + attName + '="' + attValue + '"'; if (0 === this.children.length) this.value || (r += "?xml" === this.name ? "?>" : "!DOCTYPE" === this.name ? ">" : "/>"), pretty && (r += newline); else if (pretty && 1 === this.children.length && this.children[0].value) r += ">", r += this.children[0].value, r += "", r += newline; else { for (r += ">", pretty && (r += newline), _i = 0, _len = (_ref2 = this.children).length; _i < _len; _i++) r += _ref2[_i].toString(options, level + 1); pretty && (r += space), r += "", pretty && (r += newline); } return r; }, XMLFragment.prototype.escape = function(str) { return str.replace(/&/g, "&").replace(//g, ">").replace(/'/g, "'").replace(/"/g, """); }, XMLFragment.prototype.assertLegalChar = function(str) { var chars, chr; if (chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/, chr = str.match(chars)) throw new Error("Invalid character (" + chr + ") in string: " + str); }, XMLFragment.prototype.is = function(obj, type) { var clas; return clas = Object.prototype.toString.call(obj).slice(8, -1), null != obj && clas === type; }, XMLFragment.prototype.ele = function(name, attributes, text) { return this.element(name, attributes, text); }, XMLFragment.prototype.txt = function(value) { return this.text(value); }, XMLFragment.prototype.dat = function(value) { return this.cdata(value); }, XMLFragment.prototype.att = function(name, value) { return this.attribute(name, value); }, XMLFragment.prototype.com = function(value) { return this.comment(value); }, XMLFragment.prototype.doc = function() { return this.document(); }, XMLFragment.prototype.e = function(name, attributes, text) { return this.element(name, attributes, text); }, XMLFragment.prototype.t = function(value) { return this.text(value); }, XMLFragment.prototype.d = function(value) { return this.cdata(value); }, XMLFragment.prototype.a = function(name, value) { return this.attribute(name, value); }, XMLFragment.prototype.c = function(value) { return this.comment(value); }, XMLFragment.prototype.r = function(value) { return this.raw(value); }, XMLFragment.prototype.u = function() { return this.up(); }, XMLFragment; })(), module.exports = XMLFragment; }).call(this); }, function(module, exports, __webpack_require__) { !(function(sax) { sax.parser = function(strict, opt) { return new SAXParser(strict, opt); }, sax.SAXParser = SAXParser, sax.SAXStream = SAXStream, sax.createStream = function(strict, opt) { return new SAXStream(strict, opt); }, sax.MAX_BUFFER_LENGTH = 65536; var buffers = [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ]; function SAXParser(strict, opt) { if (!(this instanceof SAXParser)) return new SAXParser(strict, opt); !(function(parser) { for (var i = 0, l = buffers.length; i < l; i++) parser[buffers[i]] = ""; })(this), this.q = this.c = "", this.bufferCheckPosition = sax.MAX_BUFFER_LENGTH, this.opt = opt || {}, this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags, this.looseCase = this.opt.lowercase ? "toLowerCase" : "toUpperCase", this.tags = [], this.closed = this.closedRoot = this.sawRoot = !1, this.tag = this.error = null, this.strict = !!strict, this.noscript = !(!strict && !this.opt.noscript), this.state = S.BEGIN, this.ENTITIES = Object.create(sax.ENTITIES), this.attribList = [], this.opt.xmlns && (this.ns = Object.create(rootNS)), this.trackPosition = !1 !== this.opt.position, this.trackPosition && (this.position = this.line = this.column = 0), emit(this, "onready"); } sax.EVENTS = [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace" ], Object.create || (Object.create = function(o) { function f() { this.__proto__ = o; } return f.prototype = o, new f; }), Object.getPrototypeOf || (Object.getPrototypeOf = function(o) { return o.__proto__; }), Object.keys || (Object.keys = function(o) { var a = []; for (var i in o) o.hasOwnProperty(i) && a.push(i); return a; }), SAXParser.prototype = { end: function() { end(this); }, write: function(chunk) { if (this.error) throw this.error; if (this.closed) return error(this, "Cannot write after close. Assign an onready handler."); if (null === chunk) return end(this); for (var i = 0, c = ""; this.c = c = chunk.charAt(i++); ) switch (this.trackPosition && (this.position++, "\n" === c ? (this.line++, this.column = 0) : this.column++), this.state) { case S.BEGIN: "<" === c ? this.state = S.OPEN_WAKA : not(whitespace, c) && (strictFail(this, "Non-whitespace before first tag."), this.textNode = c, this.state = S.TEXT); continue; case S.TEXT: if (this.sawRoot && !this.closedRoot) { for (var starti = i - 1; c && "<" !== c && "&" !== c; ) (c = chunk.charAt(i++)) && this.trackPosition && (this.position++, "\n" === c ? (this.line++, this.column = 0) : this.column++); this.textNode += chunk.substring(starti, i - 1); } "<" === c ? this.state = S.OPEN_WAKA : (!not(whitespace, c) || this.sawRoot && !this.closedRoot || strictFail("Text data outside of root node."), "&" === c ? this.state = S.TEXT_ENTITY : this.textNode += c); continue; case S.SCRIPT: "<" === c ? this.state = S.SCRIPT_ENDING : this.script += c; continue; case S.SCRIPT_ENDING: "/" === c ? (emitNode(this, "onscript", this.script), this.state = S.CLOSE_TAG, this.script = "", this.tagName = "") : (this.script += "<" + c, this.state = S.SCRIPT); continue; case S.OPEN_WAKA: "!" === c ? (this.state = S.SGML_DECL, this.sgmlDecl = "") : is(whitespace, c) || (is(nameStart, c) ? (this.startTagPosition = this.position - 1, this.state = S.OPEN_TAG, this.tagName = c) : "/" === c ? (this.startTagPosition = this.position - 1, this.state = S.CLOSE_TAG, this.tagName = "") : "?" === c ? (this.state = S.PROC_INST, this.procInstName = this.procInstBody = "") : (strictFail(this, "Unencoded <"), this.textNode += "<" + c, this.state = S.TEXT)); continue; case S.SGML_DECL: "[CDATA[" === (this.sgmlDecl + c).toUpperCase() ? (emitNode(this, "onopencdata"), this.state = S.CDATA, this.sgmlDecl = "", this.cdata = "") : this.sgmlDecl + c === "--" ? (this.state = S.COMMENT, this.comment = "", this.sgmlDecl = "") : "DOCTYPE" === (this.sgmlDecl + c).toUpperCase() ? (this.state = S.DOCTYPE, (this.doctype || this.sawRoot) && strictFail(this, "Inappropriately located doctype declaration"), this.doctype = "", this.sgmlDecl = "") : ">" === c ? (emitNode(this, "onsgmldeclaration", this.sgmlDecl), this.sgmlDecl = "", this.state = S.TEXT) : is(quote, c) ? (this.state = S.SGML_DECL_QUOTED, this.sgmlDecl += c) : this.sgmlDecl += c; continue; case S.SGML_DECL_QUOTED: c === this.q && (this.state = S.SGML_DECL, this.q = ""), this.sgmlDecl += c; continue; case S.DOCTYPE: ">" === c ? (this.state = S.TEXT, emitNode(this, "ondoctype", this.doctype), this.doctype = !0) : (this.doctype += c, "[" === c ? this.state = S.DOCTYPE_DTD : is(quote, c) && (this.state = S.DOCTYPE_QUOTED, this.q = c)); continue; case S.DOCTYPE_QUOTED: this.doctype += c, c === this.q && (this.q = "", this.state = S.DOCTYPE); continue; case S.DOCTYPE_DTD: this.doctype += c, "]" === c ? this.state = S.DOCTYPE : is(quote, c) && (this.state = S.DOCTYPE_DTD_QUOTED, this.q = c); continue; case S.DOCTYPE_DTD_QUOTED: this.doctype += c, c === this.q && (this.state = S.DOCTYPE_DTD, this.q = ""); continue; case S.COMMENT: "-" === c ? this.state = S.COMMENT_ENDING : this.comment += c; continue; case S.COMMENT_ENDING: "-" === c ? (this.state = S.COMMENT_ENDED, this.comment = textopts(this.opt, this.comment), this.comment && emitNode(this, "oncomment", this.comment), this.comment = "") : (this.comment += "-" + c, this.state = S.COMMENT); continue; case S.COMMENT_ENDED: ">" !== c ? (strictFail(this, "Malformed comment"), this.comment += "--" + c, this.state = S.COMMENT) : this.state = S.TEXT; continue; case S.CDATA: "]" === c ? this.state = S.CDATA_ENDING : this.cdata += c; continue; case S.CDATA_ENDING: "]" === c ? this.state = S.CDATA_ENDING_2 : (this.cdata += "]" + c, this.state = S.CDATA); continue; case S.CDATA_ENDING_2: ">" === c ? (this.cdata && emitNode(this, "oncdata", this.cdata), emitNode(this, "onclosecdata"), this.cdata = "", this.state = S.TEXT) : "]" === c ? this.cdata += "]" : (this.cdata += "]]" + c, this.state = S.CDATA); continue; case S.PROC_INST: "?" === c ? this.state = S.PROC_INST_ENDING : is(whitespace, c) ? this.state = S.PROC_INST_BODY : this.procInstName += c; continue; case S.PROC_INST_BODY: if (!this.procInstBody && is(whitespace, c)) continue; "?" === c ? this.state = S.PROC_INST_ENDING : is(quote, c) ? (this.state = S.PROC_INST_QUOTED, this.q = c, this.procInstBody += c) : this.procInstBody += c; continue; case S.PROC_INST_ENDING: ">" === c ? (emitNode(this, "onprocessinginstruction", { name: this.procInstName, body: this.procInstBody }), this.procInstName = this.procInstBody = "", this.state = S.TEXT) : (this.procInstBody += "?" + c, this.state = S.PROC_INST_BODY); continue; case S.PROC_INST_QUOTED: this.procInstBody += c, c === this.q && (this.state = S.PROC_INST_BODY, this.q = ""); continue; case S.OPEN_TAG: is(nameBody, c) ? this.tagName += c : (newTag(this), ">" === c ? openTag(this) : "/" === c ? this.state = S.OPEN_TAG_SLASH : (not(whitespace, c) && strictFail(this, "Invalid character in tag name"), this.state = S.ATTRIB)); continue; case S.OPEN_TAG_SLASH: ">" === c ? (openTag(this, !0), closeTag(this)) : (strictFail(this, "Forward-slash in opening tag not followed by >"), this.state = S.ATTRIB); continue; case S.ATTRIB: if (is(whitespace, c)) continue; ">" === c ? openTag(this) : "/" === c ? this.state = S.OPEN_TAG_SLASH : is(nameStart, c) ? (this.attribName = c, this.attribValue = "", this.state = S.ATTRIB_NAME) : strictFail(this, "Invalid attribute name"); continue; case S.ATTRIB_NAME: "=" === c ? this.state = S.ATTRIB_VALUE : is(whitespace, c) ? this.state = S.ATTRIB_NAME_SAW_WHITE : is(nameBody, c) ? this.attribName += c : strictFail(this, "Invalid attribute name"); continue; case S.ATTRIB_NAME_SAW_WHITE: if ("=" === c) this.state = S.ATTRIB_VALUE; else { if (is(whitespace, c)) continue; strictFail(this, "Attribute without value"), this.tag.attributes[this.attribName] = "", this.attribValue = "", emitNode(this, "onattribute", { name: this.attribName, value: "" }), this.attribName = "", ">" === c ? openTag(this) : is(nameStart, c) ? (this.attribName = c, this.state = S.ATTRIB_NAME) : (strictFail(this, "Invalid attribute name"), this.state = S.ATTRIB); } continue; case S.ATTRIB_VALUE: if (is(whitespace, c)) continue; is(quote, c) ? (this.q = c, this.state = S.ATTRIB_VALUE_QUOTED) : (strictFail(this, "Unquoted attribute value"), this.state = S.ATTRIB_VALUE_UNQUOTED, this.attribValue = c); continue; case S.ATTRIB_VALUE_QUOTED: if (c !== this.q) { "&" === c ? this.state = S.ATTRIB_VALUE_ENTITY_Q : this.attribValue += c; continue; } attrib(this), this.q = "", this.state = S.ATTRIB; continue; case S.ATTRIB_VALUE_UNQUOTED: if (not(attribEnd, c)) { "&" === c ? this.state = S.ATTRIB_VALUE_ENTITY_U : this.attribValue += c; continue; } attrib(this), ">" === c ? openTag(this) : this.state = S.ATTRIB; continue; case S.CLOSE_TAG: if (this.tagName) ">" === c ? closeTag(this) : is(nameBody, c) ? this.tagName += c : (not(whitespace, c) && strictFail(this, "Invalid tagname in closing tag"), this.state = S.CLOSE_TAG_SAW_WHITE); else { if (is(whitespace, c)) continue; not(nameStart, c) ? strictFail(this, "Invalid tagname in closing tag.") : this.tagName = c; } continue; case S.CLOSE_TAG_SAW_WHITE: if (is(whitespace, c)) continue; ">" === c ? closeTag(this) : strictFail("Invalid characters in closing tag"); continue; case S.TEXT_ENTITY: case S.ATTRIB_VALUE_ENTITY_Q: case S.ATTRIB_VALUE_ENTITY_U: switch (this.state) { case S.TEXT_ENTITY: var returnState = S.TEXT, buffer = "textNode"; break; case S.ATTRIB_VALUE_ENTITY_Q: returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"; break; case S.ATTRIB_VALUE_ENTITY_U: returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"; } ";" === c ? (this[buffer] += parseEntity(this), this.entity = "", this.state = returnState) : is(entity, c) ? this.entity += c : (strictFail("Invalid character entity"), this[buffer] += "&" + this.entity + c, this.entity = "", this.state = returnState); continue; default: throw new Error(this, "Unknown state: " + this.state); } return this.position >= this.bufferCheckPosition && (function(parser) { for (var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10), maxActual = 0, i = 0, l = buffers.length; i < l; i++) { var len = parser[buffers[i]].length; if (len > maxAllowed) switch (buffers[i]) { case "textNode": closeText(parser); break; case "cdata": emitNode(parser, "oncdata", parser.cdata), parser.cdata = ""; break; case "script": emitNode(parser, "onscript", parser.script), parser.script = ""; break; default: error(parser, "Max buffer length exceeded: " + buffers[i]); } maxActual = Math.max(maxActual, len); } parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - maxActual + parser.position; })(this), this; }, resume: function() { return this.error = null, this; }, close: function() { return this.write(null); } }; try { var Stream = __webpack_require__(3).Stream; } catch (ex) { Stream = function() {}; } var streamWraps = sax.EVENTS.filter((function(ev) { return "error" !== ev && "end" !== ev; })); function SAXStream(strict, opt) { if (!(this instanceof SAXStream)) return new SAXStream(strict, opt); Stream.apply(this), this._parser = new SAXParser(strict, opt), this.writable = !0, this.readable = !0; var me = this; this._parser.onend = function() { me.emit("end"); }, this._parser.onerror = function(er) { me.emit("error", er), me._parser.error = null; }, streamWraps.forEach((function(ev) { Object.defineProperty(me, "on" + ev, { get: function() { return me._parser["on" + ev]; }, set: function(h) { if (!h) return me.removeAllListeners(ev), me._parser["on" + ev] = h; me.on(ev, h); }, enumerable: !0, configurable: !1 }); })); } SAXStream.prototype = Object.create(Stream.prototype, { constructor: { value: SAXStream } }), SAXStream.prototype.write = function(data) { return this._parser.write(data.toString()), this.emit("data", data), !0; }, SAXStream.prototype.end = function(chunk) { return chunk && chunk.length && this._parser.write(chunk.toString()), this._parser.end(), !0; }, SAXStream.prototype.on = function(ev, handler) { var me = this; return me._parser["on" + ev] || -1 === streamWraps.indexOf(ev) || (me._parser["on" + ev] = function() { var args = 1 === arguments.length ? [ arguments[0] ] : Array.apply(null, arguments); args.splice(0, 0, ev), me.emit.apply(me, args); }), Stream.prototype.on.call(me, ev, handler); }; var whitespace = "\r\n\t ", number = "0124356789", letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", nameStart = letter + "_:", nameBody = nameStart + number + "-.", quote = "'\"", entity = number + letter + "#", attribEnd = whitespace + ">", XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace", rootNS = { xml: XML_NAMESPACE, xmlns: "http://www.w3.org/2000/xmlns/" }; function charClass(str) { return str.split("").reduce((function(s, c) { return s[c] = !0, s; }), {}); } function is(charclass, c) { return charclass[c]; } function not(charclass, c) { return !charclass[c]; } whitespace = charClass(whitespace), number = charClass(number), letter = charClass(letter), nameStart = charClass(nameStart), nameBody = charClass(nameBody), quote = charClass(quote), entity = charClass(entity), attribEnd = charClass(attribEnd); var S = 0; for (var S in sax.STATE = { BEGIN: S++, TEXT: S++, TEXT_ENTITY: S++, OPEN_WAKA: S++, SGML_DECL: S++, SGML_DECL_QUOTED: S++, DOCTYPE: S++, DOCTYPE_QUOTED: S++, DOCTYPE_DTD: S++, DOCTYPE_DTD_QUOTED: S++, COMMENT_STARTING: S++, COMMENT: S++, COMMENT_ENDING: S++, COMMENT_ENDED: S++, CDATA: S++, CDATA_ENDING: S++, CDATA_ENDING_2: S++, PROC_INST: S++, PROC_INST_BODY: S++, PROC_INST_QUOTED: S++, PROC_INST_ENDING: S++, OPEN_TAG: S++, OPEN_TAG_SLASH: S++, ATTRIB: S++, ATTRIB_NAME: S++, ATTRIB_NAME_SAW_WHITE: S++, ATTRIB_VALUE: S++, ATTRIB_VALUE_QUOTED: S++, ATTRIB_VALUE_UNQUOTED: S++, ATTRIB_VALUE_ENTITY_Q: S++, ATTRIB_VALUE_ENTITY_U: S++, CLOSE_TAG: S++, CLOSE_TAG_SAW_WHITE: S++, SCRIPT: S++, SCRIPT_ENDING: S++ }, sax.ENTITIES = { apos: "'", quot: '"', amp: "&", gt: ">", lt: "<" }, sax.STATE) sax.STATE[sax.STATE[S]] = S; function emit(parser, event, data) { parser[event] && parser[event](data); } function emitNode(parser, nodeType, data) { parser.textNode && closeText(parser), emit(parser, nodeType, data); } function closeText(parser) { parser.textNode = textopts(parser.opt, parser.textNode), parser.textNode && emit(parser, "ontext", parser.textNode), parser.textNode = ""; } function textopts(opt, text) { return opt.trim && (text = text.trim()), opt.normalize && (text = text.replace(/\s+/g, " ")), text; } function error(parser, er) { return closeText(parser), parser.trackPosition && (er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c), er = new Error(er), parser.error = er, emit(parser, "onerror", er), parser; } function end(parser) { return parser.state !== S.TEXT && error(parser, "Unexpected end"), closeText(parser), parser.c = "", parser.closed = !0, emit(parser, "onend"), SAXParser.call(parser, parser.strict, parser.opt), parser; } function strictFail(parser, message) { parser.strict && error(parser, message); } function newTag(parser) { parser.strict || (parser.tagName = parser.tagName[parser.looseCase]()); var parent = parser.tags[parser.tags.length - 1] || parser, tag = parser.tag = { name: parser.tagName, attributes: {} }; parser.opt.xmlns && (tag.ns = parent.ns), parser.attribList.length = 0; } function qname(name) { var qualName = name.indexOf(":") < 0 ? [ "", name ] : name.split(":"), prefix = qualName[0], local = qualName[1]; return "xmlns" === name && (prefix = "xmlns", local = ""), { prefix: prefix, local: local }; } function attrib(parser) { if (parser.strict || (parser.attribName = parser.attribName[parser.looseCase]()), parser.opt.xmlns) { var qn = qname(parser.attribName), prefix = qn.prefix, local = qn.local; if ("xmlns" === prefix) if ("xml" === local && parser.attribValue !== XML_NAMESPACE) strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser.attribValue); else if ("xmlns" === local && "http://www.w3.org/2000/xmlns/" !== parser.attribValue) strictFail(parser, "xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: " + parser.attribValue); else { var tag = parser.tag, parent = parser.tags[parser.tags.length - 1] || parser; tag.ns === parent.ns && (tag.ns = Object.create(parent.ns)), tag.ns[local] = parser.attribValue; } parser.attribList.push([ parser.attribName, parser.attribValue ]); } else parser.tag.attributes[parser.attribName] = parser.attribValue, emitNode(parser, "onattribute", { name: parser.attribName, value: parser.attribValue }); parser.attribName = parser.attribValue = ""; } function openTag(parser, selfClosing) { if (parser.opt.xmlns) { var tag = parser.tag, qn = qname(parser.tagName); tag.prefix = qn.prefix, tag.local = qn.local, tag.uri = tag.ns[qn.prefix] || qn.prefix, tag.prefix && !tag.uri && strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName)); var parent = parser.tags[parser.tags.length - 1] || parser; tag.ns && parent.ns !== tag.ns && Object.keys(tag.ns).forEach((function(p) { emitNode(parser, "onopennamespace", { prefix: p, uri: tag.ns[p] }); })); for (var i = 0, l = parser.attribList.length; i < l; i++) { var nv = parser.attribList[i], name = nv[0], value = nv[1], qualName = qname(name), prefix = qualName.prefix, local = qualName.local, uri = "" == prefix ? "" : tag.ns[prefix] || "", a = { name: name, value: value, prefix: prefix, local: local, uri: uri }; prefix && "xmlns" != prefix && !uri && (strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix)), a.uri = prefix), parser.tag.attributes[name] = a, emitNode(parser, "onattribute", a); } parser.attribList.length = 0; } parser.sawRoot = !0, parser.tags.push(parser.tag), emitNode(parser, "onopentag", parser.tag), selfClosing || (parser.noscript || "script" !== parser.tagName.toLowerCase() ? parser.state = S.TEXT : parser.state = S.SCRIPT, parser.tag = null, parser.tagName = ""), parser.attribName = parser.attribValue = "", parser.attribList.length = 0; } function closeTag(parser) { if (!parser.tagName) return strictFail(parser, "Weird empty close tag."), parser.textNode += "", void (parser.state = S.TEXT); var t = parser.tags.length, tagName = parser.tagName; parser.strict || (tagName = tagName[parser.looseCase]()); for (var closeTo = tagName; t-- && parser.tags[t].name !== closeTo; ) strictFail(parser, "Unexpected close tag"); if (t < 0) return strictFail(parser, "Unmatched closing tag: " + parser.tagName), parser.textNode += "", void (parser.state = S.TEXT); parser.tagName = tagName; for (var s = parser.tags.length; s-- > t; ) { var tag = parser.tag = parser.tags.pop(); parser.tagName = parser.tag.name, emitNode(parser, "onclosetag", parser.tagName); var x = {}; for (var i in tag.ns) x[i] = tag.ns[i]; var parent = parser.tags[parser.tags.length - 1] || parser; parser.opt.xmlns && tag.ns !== parent.ns && Object.keys(tag.ns).forEach((function(p) { var n = tag.ns[p]; emitNode(parser, "onclosenamespace", { prefix: p, uri: n }); })); } 0 === t && (parser.closedRoot = !0), parser.tagName = parser.attribValue = parser.attribName = "", parser.attribList.length = 0, parser.state = S.TEXT; } function parseEntity(parser) { var num, entity = parser.entity.toLowerCase(), numStr = ""; return parser.ENTITIES[entity] ? parser.ENTITIES[entity] : ("#" === entity.charAt(0) && ("x" === entity.charAt(1) ? (entity = entity.slice(2), numStr = (num = parseInt(entity, 16)).toString(16)) : (entity = entity.slice(1), numStr = (num = parseInt(entity, 10)).toString(10))), entity = entity.replace(/^0+/, ""), numStr.toLowerCase() !== entity ? (strictFail(parser, "Invalid character entity"), "&" + parser.entity + ";") : String.fromCharCode(num)); } S = sax.STATE; })(exports); }, function(module, exports, __webpack_require__) { var http = __webpack_require__(11), https = __webpack_require__(21), url = __webpack_require__(7), EventEmitter = __webpack_require__(4).EventEmitter, Serializer = __webpack_require__(408), Deserializer = __webpack_require__(410); function Server(options, isSecure) { if (0 == this instanceof Server) return new Server(options, isSecure); var that = this; function handleMethodCall(request, response) { (new Deserializer).deserializeMethodCall(request, (function(error, methodName, params) { that._events.hasOwnProperty(methodName) ? that.emit(methodName, null, params, (function(error, value) { var xml; xml = null !== error ? Serializer.serializeFault(error) : Serializer.serializeMethodResponse(value), response.writeHead(200, { "Content-Type": "text/xml" }), response.end(xml); })) : (that.emit("NotFound", methodName, params), response.writeHead(404), response.end()); })); } "string" == typeof options && ((options = url.parse(options)).host = options.hostname, options.path = options.pathname), (isSecure ? https.createServer(options, handleMethodCall) : http.createServer(handleMethodCall)).listen(options.port, options.host); } Server.prototype.__proto__ = EventEmitter.prototype, module.exports = Server; }, function(module, exports, __webpack_require__) { var https = __webpack_require__(21), fetch = __webpack_require__(34), net = __webpack_require__(39), fs = __webpack_require__(2), path = __webpack_require__(5), options = defaultOptions = { apiEndpoint: "http://api.strem.io/api/certificateGet", appPath: ".", authKey: null }, cert = null, httpsServer = null; function base64Decode(base64) { return Buffer.from(base64, "base64").toString("ascii"); } function createHttpsServer(requestListener, cert) { return Promise.resolve(https.createServer({ key: cert.key, cert: cert.cert }, requestListener)); } function getCertFileName() { return path.join(options.appPath, "httpsCert.json"); } function validateCertificate(newCert) { var notBefore = new Date(newCert.notBefore), notAfter = new Date(newCert.notAfter), now = new Date; return now < notBefore || now > notAfter ? Promise.reject("Could not get a valid HTTPS certificate") : Promise.resolve(newCert); } function newCertificate(ipAddress, authKey) { return fetch(options.apiEndpoint, { method: "POST", mode: "cors", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ authKey: authKey, ipAddress: ipAddress }) }).then((function(response) { return response.json(); })).then((function(json) { var certResp = JSON.parse(json.result.certificate); return { domain: ipAddress.replace(/\./g, "-") + certResp.commonName.replace("*", ""), key: base64Decode(certResp.contents.PrivateKey), cert: base64Decode(certResp.contents.Certificate), notBefore: certResp.contents.NotBefore, notAfter: certResp.contents.NotAfter }; })).then(validateCertificate).then((function(newCert) { return new Promise((function(resolve, reject) { fs.writeFile(getCertFileName(), JSON.stringify(newCert), (function(err) { err ? reject(err) : (cert = newCert, resolve(newCert)); })); })); })); } module.exports = { getOptions: function() { return JSON.parse(JSON.stringify(options)); }, setOptions: function(clientOptions) { var defaultKeys = Object.keys(defaultOptions), unknownKeys = Object.keys(clientOptions).filter((function(key) { return !defaultKeys.includes(key); })); if (unknownKeys.length) throw new Error('HTTPS: Unrecognised options - "' + unknownKeys.join('", "') + '"'); options = Object.assign({}, defaultOptions, clientOptions); }, newCertificate: newCertificate, createServer: function(app) { var netServer = net.createServer({ pauseOnConnect: !0 }); return netServer.on("connection", (function(socket) { httpsServer || (httpsServer = Promise.reject("Not initialized yet")), httpsServer.catch((function() { return httpsServer = cert ? createHttpsServer(app, cert) : new Promise((function(resolve, reject) { cert ? resolve(cert) : fs.readFile(getCertFileName(), (function(err, jsonCert) { err ? reject(err) : (cert = JSON.parse(jsonCert), resolve(cert)); })); })).catch((function() { return Promise.reject("Could not get a valid HTTPS certificate"); })).then(validateCertificate).catch((function(certError) { return options.authKey && socket.localAddress.startsWith("::ffff:") ? newCertificate(socket.localAddress.substr(7), options.authKey) : Promise.reject(certError); })).then((function(newCert) { return createHttpsServer(app, newCert); })); })).then((function(server) { server.emit("connection", socket); })).catch((function(error) { socket.end(), console.error("HTTPS: Request error", error); })); })), netServer; } }; }, function(module, exports, __webpack_require__) { var path = __webpack_require__(5), url = __webpack_require__(7), querystring = __webpack_require__(24), Router = __webpack_require__(122), stream = __webpack_require__(3), https = __webpack_require__(21), fetch = __webpack_require__(34), Headers = fetch.Headers, cfgOpts = { Destination: "d", DestinationHeader: "h", ResponseHeader: "r" }, proxyReqHeaders = [ "accept", "accept-encoding", "accept-language", "connection", "transfer-encoding", "range", "if-range", "user-agent" ], proxyResHeaders = [ "accept-ranges", "content-type", "content-length", "content-range", "connection", "transfer-encoding", "last-modified", "etag", "server", "date" ], supportedPlaylists = [ ".m3u", ".m3u8" ]; function ensureArray(value) { return Array.isArray(value) ? value : value ? [ value ] : []; } function makeHeaders(sourceHeaders, allowedHeaders, defaultHeaders) { return allowedHeaders.reduce((function(headers, header) { return sourceHeaders.has(header) && (headers[header] = sourceHeaders.get(header)), headers; }), defaultHeaders || {}); } function parseHeaderString(headerString) { var headerArray = headerString.split(":"); return [ headerArray.shift(), headerArray.join(":") ]; } function urlJoin(segments) { return segments.join("/").replace(/\/+/g, "/"); } function handleFetchWithRedirects(dest, req, headers, httpsAgent, opts, cfgOpts) { var redirectCount = 0; function fetchWithRedirects() { return fetch(url.format(dest), { method: req.method, headers: headers, agent: httpsAgent, redirect: "manual" }); } return fetchWithRedirects().then((function handleFetchResult(result) { if ((function(result) { if (result.status >= 300 && result.status < 400 && result.headers.has("location")) { var newLocation = result.headers.get("location"); return dest = url.parse(url.resolve(dest.href.slice(0, -(dest.path || "").length - (dest.hash || "").length), newLocation)), headers = new Headers(makeHeaders(headers, proxyReqHeaders, { host: dest.host })), opts[cfgOpts.DestinationHeader].forEach((function(headerString) { headers.set.apply(headers, parseHeaderString(headerString)); })), redirectCount += 1, !0; } return !1; })(result) && redirectCount < 5) return fetchWithRedirects().then(handleFetchResult); if (redirectCount >= 5) throw new Error("Too many redirects"); return result; })); } module.exports = { getRouter: function() { var router = Router(), httpsAgent = new https.Agent({ rejectUnauthorized: !1 }); return router.all("/:opts/:pathname(*)?", (function(req, res, next) { var opts = querystring.parse(req.params.opts); opts[cfgOpts.DestinationHeader] = ensureArray(opts[cfgOpts.DestinationHeader]), opts[cfgOpts.ResponseHeader] = ensureArray(opts[cfgOpts.ResponseHeader]); var dest = url.parse(opts[cfgOpts.Destination]), headers = new Headers(makeHeaders(new Headers(req.headers), proxyReqHeaders, { host: dest.host })); dest.pathname = req.params.pathname || "", dest.search = req.search || "", opts[cfgOpts.DestinationHeader].forEach((function(headerString) { headers.set.apply(headers, parseHeaderString(headerString)); })), handleFetchWithRedirects(dest, req, headers, httpsAgent, opts, cfgOpts).then((function(result) { var responseHeaders = makeHeaders(result.headers, proxyResHeaders); opts[cfgOpts.ResponseHeader].forEach((function(headerString) { var parsedHeader = parseHeaderString(headerString); responseHeaders[parsedHeader[0]] = parsedHeader[1]; })); var isPlaylist = supportedPlaylists.includes(path.extname(dest.pathname)) || (responseHeaders["content-type"] || "").toLowerCase().includes("mpegurl"); if (isPlaylist && (delete responseHeaders["content-length"], responseHeaders["accept-ranges"] = "none", responseHeaders["transfer-encoding"] ? responseHeaders["transfer-encoding"].toLowerCase().includes("chunked") || (responseHeaders["transfer-encoding"] += ", chunked") : responseHeaders["transfer-encoding"] = "chunked"), res.writeHead(result.status, responseHeaders), isPlaylist) { var virtualRoot = req.originalUrl.slice(0, -req.url.length) + "/" + querystring.stringify(opts); result.body.pipe((function(virtualRoot, dest) { var partialLine = "", eol = null; function parseUrl(line) { if (line.startsWith("http://") || line.startsWith("https://")) { var lineUrl = url.parse(line); return lineUrl.protocol !== dest.protocol || lineUrl.host !== dest.host || lineUrl.port !== dest.port ? (function(lineUrl, virtualRoot, cfgOpts) { var virtualRootArray = virtualRoot.split("/"), currentHeaders = ensureArray(querystring.parse(virtualRootArray[virtualRootArray.length - 1])[cfgOpts.DestinationHeader]), newOpts = { [cfgOpts.Destination]: lineUrl.protocol + "//" + lineUrl.host + (lineUrl.port ? ":" + lineUrl.port : ""), [cfgOpts.DestinationHeader]: [] }; return currentHeaders.forEach((function(header) { newOpts[cfgOpts.DestinationHeader].push(header); })), "/proxy/" + querystring.stringify(newOpts) + lineUrl.pathname + lineUrl.search; })(lineUrl, virtualRoot, cfgOpts) : urlJoin([ virtualRoot, lineUrl.pathname ]) + lineUrl.search; } return line.startsWith("/") ? urlJoin([ virtualRoot, line ]) : line; } function parseLine(line) { if (!line.startsWith("#") && line.length > 0) return parseUrl(line); var uri = line.match(/URI="([^"]+)"/); return uri ? line.replace(uri[1], parseUrl(uri[1])) : line; } return new stream.Transform({ transform: function(chunk, _, done) { var data = partialLine + chunk.toString(); eol || (eol = (function(data) { var lf = data.indexOf("\n"), cr = data.indexOf("\r"); return lf < 0 && cr < 0 ? null : lf >= 0 && cr >= 0 ? cr < lf ? "\r\n" : "\n\r" : cr < 0 ? "\n" : "\r"; })(data)); var lines = data.split(eol); partialLine = lines.splice(lines.length - 1, 1)[0]; var push = this.push.bind(this); lines.forEach((function(line) { push(parseLine(line) + eol); })), done(); }, flush: function(done) { done(null, parseLine(partialLine)), partialLine = "", eol = null; } }); })(virtualRoot, dest)).pipe(res); } else result.body.pipe(res); })).catch((function(error) { next(error); })); })), router; } }; }, function(module, exports) { module.exports = [ "udp://tracker.opentrackr.org:1337/announce", "udp://open.demonoid.ch:6969/announce", "udp://open.demonii.com:1337/announce", "udp://open.tracker.cl:1337/announce", "udp://open.stealth.si:80/announce", "udp://tracker.torrent.eu.org:451/announce", "udp://tracker1.myporn.club:9337/announce", "udp://tracker.therarbg.to:6969/announce", "udp://tracker.qu.ax:6969/announce", "udp://tracker.dler.org:6969/announce", "udp://tracker.bittor.pw:1337/announce", "udp://tracker.0x7c0.com:6969/announce", "udp://tracker-udp.gbitt.info:80/announce", "udp://run.publictracker.xyz:6969/announce", "udp://retracker01-msk-virt.corbina.net:80/announce", "udp://opentracker.io:6969/announce", "udp://open.dstud.io:6969/announce", "udp://leet-tracker.moe:1337/announce", "udp://explodie.org:6969/announce", "udp://bt.rer.lol:6969/announce" ]; }, function(module, exports, __webpack_require__) { const profiles = __webpack_require__(193), userSettings = __webpack_require__(105), cache = __webpack_require__(414), fetch = __webpack_require__(34), saveSettings = settings => { userSettings.extend(settings), cache.setOptionValues(userSettings), userSettings.save((function() {})); }, perPlatforms = { android: [], darwin: [ "videotoolbox" ], win32: [ "qsv-win", "nvenc-win", "amf" ], linux: [ "qsv-linux", "nvenc-linux", "vaapi-renderD128" ], ios: [ "videotoolbox", "mediacodec" ], rpi: [ "v4l2m2m" ] }; module.exports = (serverPort, cb) => { const platform = process.env.IS_IOS ? "ios" : process.platform, hasProfiles = !!(perPlatforms[platform] || []).length, initialDetection = process.env.HLS_DEBUG || userSettings.transcodeHardwareAccel && !(userSettings.allTranscodeProfiles || []).length, expectResult = !!cb; if (!hasProfiles) return cb && cb(!1), void (userSettings.transcodeHardwareAccel && saveSettings({ transcodeHardwareAccel: !1 })); if (initialDetection || expectResult) { serverPort = serverPort || 11470; const supportedHwAccel = [], possibleProfiles = [ ...perPlatforms[platform] ]; console.log(`hls-converter - Initiating tests for hardware accelerated transcoding support, possible options: ${possibleProfiles}`); const testProfile = async () => { const profile = possibleProfiles.shift(), attemptTranscode = (profile, type) => new Promise(((resolve, reject) => { const sampleFile = "video" === type ? "hevc.mkv" : "ac3-2chan.wav", convertId = `${serverPort}-${profile}-${type}-${sampleFile}`, url = `http://127.0.0.1:${serverPort}/hlsv2/${convertId}/${type}0.m3u8?mediaURL=http%3A%2F%2F127.0.0.1%3A${serverPort}%2Fsamples%2F${encodeURIComponent(sampleFile)}&profile=${profile}&maxWidth=1200`; console.log(`hls-converter - Testing ${type} hw accel for profile: ${profile}`), fetch(url).then((async res => { await fetch(`http://127.0.0.1:${serverPort}/hlsv2/${convertId}/destroy`).then((() => {})).catch((() => {})), res.ok ? (resolve(!0), console.log(`hls-converter - Tests passed for [${type}] hw accel profile: ${profile}`)) : (resolve(!1), console.log(`hls-converter - Tests failed for [${type}] hw accel profile: ${profile}`)); })).catch((() => resolve(!1))); })), supported = {}; profiles[profile].audio.encoders.aac || profiles[profile].audio.decoders.ac3 ? supported.audio = await attemptTranscode(profile, "audio") : supported.audio = !0, profiles[profile].video.encoders.libx264 || profiles[profile].video.decoders.hevc ? supported.video = await attemptTranscode(profile, "video") : supported.video = !0, supported.audio && supported.video ? (supportedHwAccel.length || saveSettings({ transcodeHardwareAccel: !0 }), supportedHwAccel.push(profile), console.log(`hls-converter - All tests passed for hw accel profile: ${profile}`)) : console.log(`hls-converter - Some tests failed for hw accel profile: ${profile}`), possibleProfiles.length ? testProfile() : supportedHwAccel.length ? (cb && cb(supportedHwAccel), saveSettings({ allTranscodeProfiles: supportedHwAccel }), console.log(`hls-converter - Tests for hardware accelerated transcoding finished, supported acceleration profiles: ${supportedHwAccel.join(", ")}`)) : (cb && cb(!1), saveSettings({ transcodeHardwareAccel: !1 }), console.log("hls-converter - Tests for hardware accelerated transcoding finished, no viable acceleration profiles detected")); }; testProfile(); } }; }, function(module, exports, __webpack_require__) { !(function() { "use strict"; function noop() {} var fs = __webpack_require__(2), forEachAsync = __webpack_require__(809).forEachAsync, EventEmitter = __webpack_require__(4).EventEmitter, TypeEmitter = __webpack_require__(810), util = __webpack_require__(0), path = __webpack_require__(5); function appendToDirs(stat) { stat.flag && stat.flag === NO_DESCEND || this.push(stat.name); } function wFilesHandlerWrapper(items) { this._wFilesHandler(noop, items); } function Walker(pathname, options, sync) { EventEmitter.call(this); var me = this; options = options || {}, me._wStat = options.followLinks ? "stat" : "lstat", me._wStatSync = me._wStat + "Sync", me._wsync = sync, me._wq = [], me._wqueue = [ me._wq ], me._wcurpath = void 0, me._wfilters = options.filters || [], me._wfirstrun = !0, me._wcurpath = pathname, me._wsync ? me._wWalk = me._wWalkSync : me._wWalk = me._wWalkAsync, options.listeners = options.listeners || {}, Object.keys(options.listeners).forEach((function(event) { var callbacks = options.listeners[event]; "function" == typeof callbacks && (callbacks = [ callbacks ]), callbacks.forEach((function(callback) { me.on(event, callback); })); })), me._wWalk(); } util.inherits(Walker, EventEmitter), Walker.prototype._wLstatHandler = function(err, stat) { var me = this; (stat = stat || {}).name = me._wcurfile, err ? (stat.error = err, me.emit("nodeError", me._wcurpath, stat, noop), me._wfnodegroups.errors.push(stat), me._wCurFileCallback()) : (TypeEmitter.sortFnodesByType(stat, me._wfnodegroups), TypeEmitter.emitNodeType(me, me._wcurpath, stat, me._wCurFileCallback, me)); }, Walker.prototype._wFilesHandler = function(cont, file) { var statPath, me = this; if (me._wcurfile = file, me._wCurFileCallback = cont, me.emit("name", me._wcurpath, file, noop), statPath = me._wcurpath + path.sep + file, me._wsync) try { me._wLstatHandler(null, fs[me._wStatSync](statPath)); } catch (e) { me._wLstatHandler(e); } else fs[me._wStat](statPath, (function(err, stat) { me._wLstatHandler(err, stat); })); }, Walker.prototype._wOnEmitDone = function() { var me = this, dirs = []; me._wfnodegroups.directories.forEach(appendToDirs, dirs), dirs.forEach(me._wJoinPath, me), me._wqueue.push(me._wq = dirs), me._wNext(); }, Walker.prototype._wPostFilesHandler = function() { var me = this; me._wfnodegroups.errors.length && me.emit("errors", me._wcurpath, me._wfnodegroups.errors, noop), TypeEmitter.emitNodeTypeGroups(me, me._wcurpath, me._wfnodegroups, me._wOnEmitDone, me); }, Walker.prototype._wReadFiles = function() { var me = this; if (!me._wcurfiles || 0 === me._wcurfiles.length) return me._wNext(); me.emit("names", me._wcurpath, me._wcurfiles, noop), me._wsync ? (me._wcurfiles.forEach(wFilesHandlerWrapper, me), me._wPostFilesHandler()) : forEachAsync(me._wcurfiles, me._wFilesHandler, me).then(me._wPostFilesHandler); }, Walker.prototype._wReaddirHandler = function(err, files) { var parent, child, fnodeGroups = TypeEmitter.createNodeGroups(), me = this; if (me._wfnodegroups = fnodeGroups, me._wcurfiles = files, err) { if (me._wcurpath = me._wcurpath.replace(/\/$/, ""), !me._wfirstrun) return me.emit("directoryError", me._wcurpath, { error: err }, noop), void me._wReadFiles(); me._wfirstrun = !1, parent = me._wcurpath.replace(/^(.*)\/.*$/, "$1"), fs[me._wStat](parent, (function(e, stat) { stat ? (child = me._wcurpath.replace(/^.*\/(.*)$/, "$1"), me._wcurfiles = [ child ], me._wcurpath = parent) : me.emit("nodeError", me._wcurpath, { error: err }, noop), me._wReadFiles(); })); } else me._wReadFiles(); }, Walker.prototype._wFilter = function() { var me = this; return me._wfilters.some((function(filter) { if (me._wcurpath.match(filter)) return !0; })); }, Walker.prototype._wWalkSync = function() { var err, files; try { files = fs.readdirSync(this._wcurpath); } catch (e) { err = e; } this._wReaddirHandler(err, files); }, Walker.prototype._wWalkAsync = function() { var me = this; fs.readdir(me._wcurpath, (function(err, files) { me._wReaddirHandler(err, files); })); }, Walker.prototype._wNext = function() { var me = this; if (!me._paused) if (me._wq.length) { for (me._wcurpath = me._wq.pop(); me._wq.length && me._wFilter(); ) me._wcurpath = me._wq.pop(); me._wcurpath && !me._wFilter() ? me._wWalk() : me._wNext(); } else { if (me._wqueue.length -= 1, me._wqueue.length) return me._wq = me._wqueue[me._wqueue.length - 1], me._wNext(); me.emit("end"); } }, Walker.prototype._wJoinPath = function(v, i, o) { o[i] = [ this._wcurpath, path.sep, v ].join(""); }, Walker.prototype.pause = function() { this._paused = !0; }, Walker.prototype.resume = function() { this._paused = !1, this._wNext(); }, exports.walk = function(path, opts) { return new Walker(path, opts, !1); }, exports.walkSync = function(path, opts) { return new Walker(path, opts, !0); }; })(); }, function(module, exports, __webpack_require__) { !(function(exports) { "use strict"; function forEachAsync(arr, fn, thisArg) { var dones = [], index = -1; return setTimeout((function next(BREAK, result) { (index += 1) !== arr.length && BREAK !== forEachAsync.__BREAK ? fn.call(thisArg, next, arr[index], index, arr) : dones.forEach((function(done) { done.call(thisArg, result); })); }), 4), { then: function(_done) { return dones.push(_done), this; } }; } forEachAsync.__BREAK = {}, exports.forEachAsync = forEachAsync; })(exports || new Function("return this")()); }, function(module, exports) { !(function() { "use strict"; var isFnodeTypes = [ "isFile", "isDirectory", "isSymbolicLink", "isBlockDevice", "isCharacterDevice", "isFIFO", "isSocket" ], fnodeTypes = [ "file", "directory", "symbolicLink", "blockDevice", "characterDevice", "FIFO", "socket" ], fnodeTypesPlural = [ "files", "directories", "symbolicLinks", "blockDevices", "characterDevices", "FIFOs", "sockets" ]; module.exports = { emitNodeType: function(emitter, path, stats, next, self) { var num = 1 + emitter.listeners(stats.type).length + emitter.listeners("node").length; function nextWhenReady(flag) { flag && (stats.flag = flag), 0 == (num -= 1) && next.call(self); } emitter.emit(stats.type, path, stats, nextWhenReady), emitter.emit("node", path, stats, nextWhenReady), nextWhenReady(); }, emitNodeTypeGroups: function(emitter, path, nodes, next, self) { var num = 1; function nextWhenReady() { 0 == (num -= 1) && next.call(self); } fnodeTypesPlural.concat([ "nodes", "errors" ]).forEach((function(fnodeType) { 0 !== nodes[fnodeType].length && (num += emitter.listeners(fnodeType).length, emitter.emit(fnodeType, path, nodes[fnodeType], nextWhenReady)); })), nextWhenReady(); }, isFnodeTypes: isFnodeTypes, fnodeTypes: fnodeTypes, fnodeTypesPlural: fnodeTypesPlural, sortFnodesByType: function(stat, fnodes) { var i; for (i = 0; i < isFnodeTypes.length; i += 1) if (stat[isFnodeTypes[i]]()) return stat.type = fnodeTypes[i], void fnodes[fnodeTypesPlural[i]].push(stat); }, createNodeGroups: function() { var nodeGroups = {}; return fnodeTypesPlural.concat("nodes", "errors").forEach((function(fnodeTypePlural) { nodeGroups[fnodeTypePlural] = []; })), nodeGroups; } }; })(); }, function(module, exports, __webpack_require__) { const profiles = __webpack_require__(193); module.exports = (profileName, accelConfig, options) => { const profile = profiles[profileName]; return profile && (options.video && (accelConfig.inputArgs = accelConfig.inputArgs.concat(profile.video.inputArgs || []), accelConfig.encoderH264 = profile.video.encoders[accelConfig.encoderH264] || accelConfig.encoderH264, accelConfig.videoPreset = profile.video.preset || accelConfig.videoPreset, accelConfig.pixelFormat = profile.video.hasOwnProperty("pixelFormat") ? profile.video.pixelFormat : accelConfig.pixelFormat, accelConfig.videoTune = profile.video.tune || accelConfig.videoTune, accelConfig.scale = profile.video.scale || accelConfig.scale, accelConfig.resizeHeightAuto = profile.video.resizeHeightAuto || accelConfig.resizeHeightAuto, accelConfig.wrapSwFilters = profile.video.wrapSwFilters || accelConfig.wrapSwFilters, accelConfig.extraSwFilters = profile.video.extraSwFilters || accelConfig.extraSwFilters, accelConfig.scalePrefix = profile.video.scalePrefix || accelConfig.scalePrefix, accelConfig.scaleExtra = profile.video.hasOwnProperty("scaleExtra") ? profile.video.scaleExtra : accelConfig.scaleExtra, accelConfig.extraVideoOutputArgs = profile.video.extraOutputArgs || accelConfig.extraVideoOutputArgs, accelConfig.hwFilters = profile.video.hwFilters || accelConfig.hwFilters, accelConfig.colorSpace = profile.video.colorSpace || accelConfig.colorSpace, accelConfig.levelH264 = profile.video.levelH264 || accelConfig.levelH264, accelConfig.encodeThreads = profile.video.hasOwnProperty("encodeThreads") ? profile.video.encodeThreads : accelConfig.encodeThreads, accelConfig.noH264Level = profile.video.noH264Level || accelConfig.noH264Level, options.video.transcode && profile.video.decoders[options.video.codec] && accelConfig.inputArgs.push("-c:v", profile.video.decoders[options.video.codec])), options.audio && (accelConfig.inputArgs = accelConfig.inputArgs.concat(profile.audio.inputArgs || []), accelConfig.encoderAAC = profile.audio.encoders[accelConfig.encoderAAC] || accelConfig.encoderAAC, options.audio.transcode && profile.audio.decoders[options.audio.codec] && accelConfig.inputArgs.push("-c:a", profile.audio.decoders[options.audio.codec]))), accelConfig; }; }, function(module, exports, __webpack_require__) { "use strict"; function e(e, n) { (null == n || n > e.length) && (n = e.length); for (var t = 0, r = new Array(n); t < n; t++) r[t] = e[t]; return r; } function t(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function r(e, n, t, r, a, u, i) { try { var o = e[u](i), f = o.value; } catch (e) { return void t(e); } o.done ? n(f) : Promise.resolve(f).then(r, a); } function a(e) { return function() { var n = this, t = arguments; return new Promise((function(a, u) { var i = e.apply(n, t); function o(e) { r(i, a, u, o, f, "next", e); } function f(e) { r(i, a, u, o, f, "throw", e); } o(void 0); })); }; } function u(e, n) { if (!(e instanceof n)) throw new TypeError("Cannot call a class as a function"); } function i(e, n) { for (var t = 0; t < n.length; t++) { var r = n[t]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); } } function o(e, n, t) { return n && i(e.prototype, n), t && i(e, t), e; } function f(e) { return f = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) { return e.__proto__ || Object.getPrototypeOf(e); }, f(e); } function c(e, n) { if ("function" != typeof n && null !== n) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(n && n.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), n && v(e, n); } function d(e, n) { return !n || "object" !== y(n) && "function" != typeof n ? t(e) : n; } function v(e, n) { return v = Object.setPrototypeOf || function(e, n) { return e.__proto__ = n, e; }, v(e, n); } function h(e, t) { return (function(e) { if (Array.isArray(e)) return e; })(e) || (function(e, n) { var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"]; if (null != t) { var i, o, r = [], a = !0, u = !1; try { for (t = t.call(e); !(a = (i = t.next()).done) && (r.push(i.value), !n || r.length !== n); a = !0) ; } catch (e) { u = !0, o = e; } finally { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } return r; } })(e, t) || p(e, t) || (function() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); })(); } function y(e) { return e && "undefined" != typeof Symbol && e.constructor === Symbol ? "symbol" : typeof e; } function p(n, t) { if (n) { if ("string" == typeof n) return e(n, t); var r = Object.prototype.toString.call(n).slice(8, -1); return "Object" === r && n.constructor && (r = n.constructor.name), "Map" === r || "Set" === r ? Array.from(r) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? e(n, t) : void 0; } } function b(e) { var n = (function() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}))), !0; } catch (e) { return !1; } })(); return function() { var r, t = f(e); if (n) { var a = f(this).constructor; r = Reflect.construct(t, arguments, a); } else r = t.apply(this, arguments); return d(this, r); }; } function g(e, n) { var t, r, a, u, i = { label: 0, sent: function() { if (1 & a[0]) throw a[1]; return a[1]; }, trys: [], ops: [] }; return u = { next: o(0), throw: o(1), return: o(2) }, "function" == typeof Symbol && (u[Symbol.iterator] = function() { return this; }), u; function o(e) { return function(n) { return f([ e, n ]); }; } function f(u) { if (t) throw new TypeError("Generator is already executing."); for (;i; ) try { if (t = 1, r && (a = 2 & u[0] ? r.return : u[0] ? r.throw || ((a = r.return) && a.call(r), 0) : r.next) && !(a = a.call(r, u[1])).done) return a; switch (r = 0, a && (u = [ 2 & u[0], a.value ]), u[0]) { case 0: case 1: a = u; break; case 4: return i.label++, { value: u[1], done: !1 }; case 5: i.label++, r = u[1], u = [ 0 ]; continue; case 7: u = i.ops.pop(), i.trys.pop(); continue; default: if (!((a = (a = i.trys).length > 0 && a[a.length - 1]) || 6 !== u[0] && 2 !== u[0])) { i = 0; continue; } if (3 === u[0] && (!a || u[1] > a[0] && u[1] < a[3])) { i.label = u[1]; break; } if (6 === u[0] && i.label < a[1]) { i.label = a[1], a = u; break; } if (a && i.label < a[2]) { i.label = a[2], i.ops.push(u); break; } a[2] && i.ops.pop(), i.trys.pop(); continue; } u = n.call(e, i); } catch (e) { u = [ 6, e ], r = 0; } finally { t = a = 0; } if (5 & u[0]) throw u[1]; return { value: u[0] ? u[1] : void 0, done: !0 }; } } var w = Object.create, S = Object.defineProperty, k = Object.getOwnPropertyDescriptor, O = Object.getOwnPropertyNames, P = Object.getPrototypeOf, _ = Object.prototype.hasOwnProperty, x = function(e, n, t, r) { var a = !0, u = !1, i = void 0; if (n && "object" == (void 0 === n ? "undefined" : y(n)) || "function" == typeof n) try { for (var c, o = function() { var a = c.value; !_.call(e, a) && a !== t && S(e, a, { get: function() { return n[a]; }, enumerable: !(r = k(n, a)) || r.enumerable }); }, f = O(n)[Symbol.iterator](); !(a = (c = f.next()).done); a = !0) o(); } catch (e) { u = !0, i = e; } finally { try { a || null == f.return || f.return(); } finally { if (u) throw i; } } return e; }, z = function(e, n, t) { return t = null != e ? w(P(e)) : {}, x(!n && e && e.__esModule ? t : S(t, "default", { value: e, enumerable: !0 }), e); }, j = function(e, n, t) { return (function(e, n, t) { return n in e ? S(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t; })(e, "symbol" != (void 0 === n ? "undefined" : y(n)) ? n + "" : n, t); }, E = {}; !(function(e, n) { for (var t in n) S(e, t, { get: n[t], enumerable: !0 }); })(E, { default: function() { return ex; } }), module.exports = (function(e) { return x(S({}, "__esModule", { value: !0 }), e); })(E); var I = z(__webpack_require__(2), 1), C = __webpack_require__(3), L = z(__webpack_require__(813), 1), A = L.default.http, U = L.default.https, q = /bytes (\d+)-(\d+)\/(\d+)/, D = function(e) { return e.startsWith("http://") || e.startsWith("https://"); }, M = (function(e) { c(r, e); var n = b(r); function r(e) { var i; u(this, r), i = n.call(this), j(t(i), "url"), j(t(i), "contentLength"), j(t(i), "bytesRead"), j(t(i), "bytesOffset"), j(t(i), "chunkSize"), j(t(i), "_request", (function(e) { return new Promise((function(n, t) { var a = h(i.url.split("//"), 1)[0], u = { range: "bytes=".concat(e[0], "-").concat(e[1]) }; ("http:" === a ? A : U).get(i.url, { headers: u }, n).on("error", t); })); })); var o = t(i); return j(t(i), "_requestRange", (function() { var e = a((function(e) { var n, t, r, a, u, i, f; return g(this, (function(c) { switch (c.label) { case 0: return [ 4, o._request(e) ]; case 1: return t = c.sent(), o.url = t.responseUrl, r = function(e) { return t.destroy(), Promise.reject(e); }, (a = null === (n = t.headers) || void 0 === n ? void 0 : n["content-range"]) ? (u = q.exec(a)) ? (i = h(u, 4), [ 2, (f = i[3]) ? new Promise((function(e, n) { var r = []; t.on("data", (function(e) { r.push(e); })), t.on("end", (function() { e([ Buffer.concat(r), parseInt(f) ]); })), t.on("error", n); })) : r("Failed to parse length from Content-Range header") ]) : [ 2, r("Failed to parse range from Content-Range header") ] : [ 2, r("Failed to retrieve Content-Range from headers") ]; } })); })); return function(n) { return e.apply(this, arguments); }; })()), i.url = e, i.contentLength = i.readableHighWaterMark, i.bytesRead = 0, i.bytesOffset = 0, i.chunkSize = i.readableHighWaterMark, i; } return o(r, [ { key: "_read", value: function() { var e = this; return a((function() { var n, t, r, a, u, i, o; return g(this, (function(f) { switch (f.label) { case 0: return f.trys.push([ 0, 2, , 3 ]), n = e.bytesOffset, t = Math.min(e.contentLength, e.bytesOffset + e.chunkSize) - 1, r = [ n, t ], [ 4, e._requestRange(r) ]; case 1: return a = h.apply(void 0, [ f.sent(), 2 ]), u = a[0], i = a[1], e.contentLength = i, e.bytesRead += u.length, e.bytesOffset = u.length, e.push(u), [ 3, 3 ]; case 2: return o = f.sent(), e.emit("error", o), e.push(null), [ 3, 3 ]; case 3: return [ 2 ]; } })); }))(); } } ]), r; })(C.Readable), N = (function(e) { c(r, e); var n = b(r); function r(e) { var i; u(this, r), i = n.call(this), j(t(i), "path"), j(t(i), "fileSize"), j(t(i), "bytesRead"), j(t(i), "bytesOffset"), j(t(i), "chunkSize"); var o = t(i); j(t(i), "_requestRange", (function() { var e = a((function(e) { return g(this, (function(n) { return [ 2, new Promise((function(n, t) { var r = [], a = I.default.createReadStream(o.path, { start: e[0], end: e[1] }); a.on("data", (function(e) { r.push(e); })), a.on("end", (function() { n(Buffer.concat(r)); })), a.on("error", t); })) ]; })); })); return function(n) { return e.apply(this, arguments); }; })()); var f = I.default.statSync(e); return i.path = e, i.fileSize = f.size, i.bytesRead = 0, i.bytesOffset = 0, i.chunkSize = i.readableHighWaterMark, i; } return o(r, [ { key: "_read", value: function() { var e = this; return a((function() { var n, t, r, a, u; return g(this, (function(i) { switch (i.label) { case 0: return i.trys.push([ 0, 2, , 3 ]), n = e.bytesOffset, t = Math.min(e.fileSize, e.bytesOffset + e.chunkSize) - 1, r = [ n, t ], [ 4, e._requestRange(r) ]; case 1: return a = i.sent(), e.bytesRead += a.length, e.bytesOffset = a.length, e.push(a), [ 3, 3 ]; case 2: return u = i.sent(), e.emit("error", u), e.push(null), [ 3, 3 ]; case 3: return [ 2 ]; } })); }))(); } } ]), r; })(C.Readable), F = (function() { var e = a((function(e) { return g(this, (function(n) { return [ 2, D(e) ? new M(e) : new N(e) ]; })); })); return function(n) { return e.apply(this, arguments); }; })(), H = (function() { function e(n, t) { u(this, e), j(this, "signature"), j(this, "signatureOffset"), this.signature = n, this.signatureOffset = t; } return o(e, [ { key: "compare", value: function(e) { var n = Buffer.from(this.signature, "hex"), t = e.subarray(this.signatureOffset, n.length + this.signatureOffset); return 0 === Buffer.compare(n, t); } }, { key: "decode", value: function(e, n) { var t = this; return a((function() { var r, a; return g(this, (function(u) { switch (u.label) { case 0: return u.trys.push([ 0, 2, , 3 ]), [ 4, t._decode(e, n) ]; case 1: return r = u.sent(), [ 2, Promise.resolve(r) ]; case 2: return a = u.sent(), [ 2, (console.error(a), Promise.reject("Failed to decode buffer")) ]; case 3: return [ 2 ]; } })); }))(); } }, { key: "format", value: function(e) { var n = this; return a((function() { var t, r; return g(this, (function(a) { switch (a.label) { case 0: return a.trys.push([ 0, 2, , 3 ]), [ 4, n._format(e) ]; case 1: return t = a.sent(), [ 2, Promise.resolve(t) ]; case 2: return r = a.sent(), [ 2, (console.error(r), Promise.reject("Failed to decode buffer")) ]; case 3: return [ 2 ]; } })); }))(); } } ]), e; })(), W = function(e) { return e.toString(2).padStart(8, "0"); }, V = function(e) { return parseInt(e, 2); }, G = function(e) { return parseInt(e.toString("hex"), 16); }, $ = function(e, n, t) { return e.subarray(n, n + t).toString("hex").toUpperCase(); }, J = { 18538067: "Segment", "1654AE6B": "Tracks", AE: "TrackEntry", D7: "TrackNumber", 83: "TrackType", "22B59C": "Language", "22B59D": "LanguageBCP47", "536E": "Name", 86: "CodecID" }, K = function(e) { for (var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, t = e[n], r = W(t), a = r.indexOf("1") + 1, u = e.subarray(n, n + a), i = r.substring(a, r.length), o = 1; o < u.length; o++) i += W(u[o]); return { value: V(i), length: a }; }, Q = function(e) { var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r = K(e, n), a = K(e, n + r.length), u = n + r.length + a.length, i = e.subarray(u, u + a.value), o = $(e, n, r.length), f = null !== (t = J[o]) && void 0 !== t ? t : o, c = r.length + a.length + a.value; return { name: f, size: c, data: i, dataSize: a.value, offset: n }; }, X = function(e) { for (var n = [], t = 0; t < e.length; ) { var r = Q(e, t); n.push(r), t += r.size; } return n; }, ee = function(e) { if (!e) return null; var n = e.data.toString(); return "und" === n ? null : n; }, er = { 1: "video", 2: "audio", 17: "text" }, ei = (function(e) { c(t, e); var n = b(t); function t() { return u(this, t), n.call(this, "1A45DFA3", 0); } return o(t, [ { key: "_decode", value: function(e) { return new Promise((function(n, t) { var r = X(e).find((function(e) { return "Segment" === e.name; })); if (!r) return t(); var a = X(r.data).find((function(e) { return "Tracks" === e.name; })); if (!a) return t(); n(a); })); } }, { key: "_format", value: function(e) { return new Promise((function(n, t) { var r = X(e.data).filter((function(e) { return "TrackEntry" === e.name; })); if (!r) return t(); var a = r.map((function(e) { return X(e.data); })).map((function(e) { return { trackNumber: e.find((function(e) { return "TrackNumber" === e.name; })), trackType: e.find((function(e) { return "TrackType" === e.name; })), language: e.find((function(e) { return "Language" === e.name; })), languageBCP47: e.find((function(e) { return "LanguageBCP47" === e.name; })), name: e.find((function(e) { return "Name" === e.name; })), codecID: e.find((function(e) { return "CodecID" === e.name; })) }; })).map((function(e) { var o, n = e.trackNumber, t = e.trackType, r = e.language, a = e.languageBCP47, u = e.name, i = e.codecID, f = (function(e) { if (!e) return null; var n = e.data; return G(n); })(n), c = (function(e) { if (!e) return null; var n = e.data; return er[G(n)]; })(t), l = null !== (o = ee(r)) && void 0 !== o ? o : ee(a), s = (function(e) { return e ? e.data.toString() : null; })(u), d = (function(e) { return e ? e.data.toString().replace("V_", "").replace("A_", "").replace("S_", "") : null; })(i); return { id: f, type: c, lang: l, label: s, codec: d }; })); n(a); })); } } ]), t; })(H), eo = ei, ed = function(e) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, t = e.readUInt32BE(n), r = e.subarray(n + 4, n + 8).toString(), a = n + 8, u = 1 === t ? G(e.subarray(a, a + 8)) : null, i = n + 8 + (u ? 8 : 0), o = null != u ? u : t, f = e.subarray(i, 1 === t ? e.length : n + t), c = o - 8; return { name: r, size: o, data: f, dataSize: c, offset: n }; }, ev = function(e) { for (var n = [], t = 0; t < e.length; ) { var r = ed(e, t); n.push(r), t += r.size; } return n; }, ep = { vide: "video", soun: "audio", text: "text", sbtl: "text" }, em = [ "VideoHandler", "SoundHandler", "SubtitleHandler" ], eb = [ "und", "```" ], eO = (function(e) { c(r, e); var n = b(r); function r() { var e; return u(this, r), e = n.call(this, "66747970", 4), j(t(e), "offset", 0), e; } return o(r, [ { key: "_decode", value: function(e, n) { var t = this; return new Promise((function(r) { var a = ev(e), u = a.find((function(e) { return "moov" === e.name; })), i = a.slice().reverse().find((function(e) { return "moov" !== e.name; })); return console.log(a), !u && i ? (t.offset += i.offset + i.size, n(t.offset)) : u && u.data.length !== u.dataSize ? (t.offset += u.offset, n(t.offset, u.size)) : u && u.data.length === u.dataSize ? r(u) : void 0; })); } }, { key: "_format", value: function(e) { return new Promise((function(n) { var t = ev(e.data).filter((function(e) { return "trak" === e.name; })).map((function(e) { var n = ev(e.data), t = n.find((function(e) { return "tkhd" === e.name; })), r = n.find((function(e) { return "mdia" === e.name; })); if (!t || !r) return null; var a = (function(e) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, t = e[n], r = e.readUInt32BE(n + 4), a = e.readUInt32BE(n + 8), u = e.readUInt32BE(n + 12); return { version: t, creationTime: r, modificationTime: a, id: u, offset: n }; })(t.data), u = ev(r.data), i = u.find((function(e) { return "mdhd" === e.name; })), o = u.find((function(e) { return "hdlr" === e.name; })), f = u.find((function(e) { return "minf" === e.name; })); if (!i || !o || !f) return null; var c = (function(e) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, t = e[n], r = n + (1 === t ? 32 : 20), a = e.readUInt16BE(r), u = []; u[0] = a >> 10 & 31, u[1] = a >> 5 & 31, u[2] = 31 & a; var i = String.fromCharCode(u[0] + 96, u[1] + 96, u[2] + 96); return { version: t, language: i, offset: n }; })(i.data), l = (function(e) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, t = e[n], r = n + 4 + 4, a = e.subarray(r, r + 4).toString(), u = r + 4 + 12, i = e.subarray(u, e.length - 1).toString(); return { version: t, handlerType: a, name: i, offset: n }; })(o.data), s = ev(f.data).find((function(e) { return "stbl" === e.name; })); if (!s) return null; var v, d = ev(s.data).find((function(e) { return "stsd" === e.name; })); if (!d) return null; var h = (function(e) { for (var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, t = e[n], r = e.readUInt32BE(n + 4), a = [], u = 1; u < r + 1; u++) { var i = e.readUInt32BE(n + 8 * u), o = e.subarray(n + 12 * u, n + 16 * u).toString(), f = e.subarray(n + 16 * u, n + 16 * u + i); a.push({ size: i, name: o, data: f }); } return { version: t, samples: r, entries: a, offset: n }; })(d.data), y = null !== (v = a.id) && void 0 !== v ? v : null, p = (function(e) { var n; return null !== (n = ep[e.handlerType]) && void 0 !== n ? n : null; })(l), m = (function(e) { return eb.includes(e.language) ? null : e.language; })(c), b = (function(e) { return em.includes(e.name) ? null : e.name.length ? e.name : null; })(l), g = (function(e) { var n, t, r; return (null !== (r = null == e || null === (t = e.entries) || void 0 === t || null === (n = t[0]) || void 0 === n ? void 0 : n.name) && void 0 !== r ? r : null).replace("-", "").toUpperCase(); })(h); return { id: y, type: p, lang: m, label: b, codec: g }; })).filter((function(e) { return null !== e; })); n(t); })); } } ]), r; })(H), eP = eO, eR = (function() { var e = a((function(e, n) { var t, r, u; return g(this, (function(i) { switch (i.label) { case 0: return [ 4, F(e) ]; case 1: return t = i.sent(), r = [ new eo, new eP ], [ 2, new Promise((function(e, i) { var o = function(e, n) { t.pause(), t.bytesOffset = e, t.chunkSize = null != n ? n : 15728640, t.resume(); }, f = function(n) { t.destroy(), u && u.format(n).then(e).catch(c); }, c = function(e) { t.destroy(), i(e); }, l = (function() { var e = a((function(e) { return g(this, (function(a) { return (null == n ? void 0 : n.maxBytesLimit) && t.bytesRead >= n.maxBytesLimit ? [ 2, c("Reached maxBytesLimit of ".concat(n.maxBytesLimit)) ] : (u = null != u ? u : (function(e, n) { return e.find((function(e) { return e.compare(n); })); })(r, e), u ? (u.decode(e, o).then(f).catch(c), [ 2 ]) : [ 2, c("This file type is not supported") ]); })); })); return function(n) { return e.apply(this, arguments); }; })(); t.on("error", c).on("data", l); })) ]; } })); })); return function(n, t) { return e.apply(this, arguments); }; })(), ex = eR; }, function(module, exports, __webpack_require__) { var url = __webpack_require__(7), URL = url.URL, http = __webpack_require__(11), https = __webpack_require__(21), Writable = __webpack_require__(3).Writable, assert = __webpack_require__(25), debug = __webpack_require__(814), useNativeURL = !1; try { assert(new URL); } catch (error) { useNativeURL = "ERR_INVALID_URL" === error.code; } var preservedUrlFields = [ "auth", "host", "hostname", "href", "path", "pathname", "port", "protocol", "query", "search", "hash" ], events = [ "abort", "aborted", "connect", "error", "socket", "timeout" ], eventHandlers = Object.create(null); events.forEach((function(event) { eventHandlers[event] = function(arg1, arg2, arg3) { this._redirectable.emit(event, arg1, arg2, arg3); }; })); var InvalidUrlError = createErrorType("ERR_INVALID_URL", "Invalid URL", TypeError), RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE", "Redirected request failed"), TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded", RedirectionError), MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit"), WriteAfterEndError = createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"), destroy = Writable.prototype.destroy || noop; function RedirectableRequest(options, responseCallback) { Writable.call(this), this._sanitizeOptions(options), this._options = options, this._ended = !1, this._ending = !1, this._redirectCount = 0, this._redirects = [], this._requestBodyLength = 0, this._requestBodyBuffers = [], responseCallback && this.on("response", responseCallback); var self = this; this._onNativeResponse = function(response) { try { self._processResponse(response); } catch (cause) { self.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause: cause })); } }, this._performRequest(); } function wrap(protocols) { var exports = { maxRedirects: 21, maxBodyLength: 10485760 }, nativeProtocols = {}; return Object.keys(protocols).forEach((function(scheme) { var protocol = scheme + ":", nativeProtocol = nativeProtocols[protocol] = protocols[scheme], wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); Object.defineProperties(wrappedProtocol, { request: { value: function(input, options, callback) { return (function(value) { return URL && value instanceof URL; })(input) ? input = spreadUrlObject(input) : isString(input) ? input = spreadUrlObject(parseUrl(input)) : (callback = options, options = validateUrl(input), input = { protocol: protocol }), isFunction(options) && (callback = options, options = null), (options = Object.assign({ maxRedirects: exports.maxRedirects, maxBodyLength: exports.maxBodyLength }, input, options)).nativeProtocols = nativeProtocols, isString(options.host) || isString(options.hostname) || (options.hostname = "::1"), assert.equal(options.protocol, protocol, "protocol mismatch"), debug("options", options), new RedirectableRequest(options, callback); }, configurable: !0, enumerable: !0, writable: !0 }, get: { value: function(input, options, callback) { var wrappedRequest = wrappedProtocol.request(input, options, callback); return wrappedRequest.end(), wrappedRequest; }, configurable: !0, enumerable: !0, writable: !0 } }); })), exports; } function noop() {} function parseUrl(input) { var parsed; if (useNativeURL) parsed = new URL(input); else if (!isString((parsed = validateUrl(url.parse(input))).protocol)) throw new InvalidUrlError({ input: input }); return parsed; } function validateUrl(input) { if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) throw new InvalidUrlError({ input: input.href || input }); if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) throw new InvalidUrlError({ input: input.href || input }); return input; } function spreadUrlObject(urlObject, target) { var spread = target || {}; for (var key of preservedUrlFields) spread[key] = urlObject[key]; return spread.hostname.startsWith("[") && (spread.hostname = spread.hostname.slice(1, -1)), "" !== spread.port && (spread.port = Number(spread.port)), spread.path = spread.search ? spread.pathname + spread.search : spread.pathname, spread; } function removeMatchingHeaders(regex, headers) { var lastValue; for (var header in headers) regex.test(header) && (lastValue = headers[header], delete headers[header]); return null == lastValue ? void 0 : String(lastValue).trim(); } function createErrorType(code, message, baseClass) { function CustomError(properties) { Error.captureStackTrace(this, this.constructor), Object.assign(this, properties || {}), this.code = code, this.message = this.cause ? message + ": " + this.cause.message : message; } return CustomError.prototype = new (baseClass || Error), Object.defineProperties(CustomError.prototype, { constructor: { value: CustomError, enumerable: !1 }, name: { value: "Error [" + code + "]", enumerable: !1 } }), CustomError; } function destroyRequest(request, error) { for (var event of events) request.removeListener(event, eventHandlers[event]); request.on("error", noop), request.destroy(error); } function isString(value) { return "string" == typeof value || value instanceof String; } function isFunction(value) { return "function" == typeof value; } RedirectableRequest.prototype = Object.create(Writable.prototype), RedirectableRequest.prototype.abort = function() { destroyRequest(this._currentRequest), this._currentRequest.abort(), this.emit("abort"); }, RedirectableRequest.prototype.destroy = function(error) { return destroyRequest(this._currentRequest, error), destroy.call(this, error), this; }, RedirectableRequest.prototype.write = function(data, encoding, callback) { if (this._ending) throw new WriteAfterEndError; if (!isString(data) && !(function(value) { return "object" == typeof value && "length" in value; })(data)) throw new TypeError("data should be a string, Buffer or Uint8Array"); isFunction(encoding) && (callback = encoding, encoding = null), 0 !== data.length ? this._requestBodyLength + data.length <= this._options.maxBodyLength ? (this._requestBodyLength += data.length, this._requestBodyBuffers.push({ data: data, encoding: encoding }), this._currentRequest.write(data, encoding, callback)) : (this.emit("error", new MaxBodyLengthExceededError), this.abort()) : callback && callback(); }, RedirectableRequest.prototype.end = function(data, encoding, callback) { if (isFunction(data) ? (callback = data, data = encoding = null) : isFunction(encoding) && (callback = encoding, encoding = null), data) { var self = this, currentRequest = this._currentRequest; this.write(data, encoding, (function() { self._ended = !0, currentRequest.end(null, null, callback); })), this._ending = !0; } else this._ended = this._ending = !0, this._currentRequest.end(null, null, callback); }, RedirectableRequest.prototype.setHeader = function(name, value) { this._options.headers[name] = value, this._currentRequest.setHeader(name, value); }, RedirectableRequest.prototype.removeHeader = function(name) { delete this._options.headers[name], this._currentRequest.removeHeader(name); }, RedirectableRequest.prototype.setTimeout = function(msecs, callback) { var self = this; function destroyOnTimeout(socket) { socket.setTimeout(msecs), socket.removeListener("timeout", socket.destroy), socket.addListener("timeout", socket.destroy); } function startTimer(socket) { self._timeout && clearTimeout(self._timeout), self._timeout = setTimeout((function() { self.emit("timeout"), clearTimer(); }), msecs), destroyOnTimeout(socket); } function clearTimer() { self._timeout && (clearTimeout(self._timeout), self._timeout = null), self.removeListener("abort", clearTimer), self.removeListener("error", clearTimer), self.removeListener("response", clearTimer), self.removeListener("close", clearTimer), callback && self.removeListener("timeout", callback), self.socket || self._currentRequest.removeListener("socket", startTimer); } return callback && this.on("timeout", callback), this.socket ? startTimer(this.socket) : this._currentRequest.once("socket", startTimer), this.on("socket", destroyOnTimeout), this.on("abort", clearTimer), this.on("error", clearTimer), this.on("response", clearTimer), this.on("close", clearTimer), this; }, [ "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive" ].forEach((function(method) { RedirectableRequest.prototype[method] = function(a, b) { return this._currentRequest[method](a, b); }; })), [ "aborted", "connection", "socket" ].forEach((function(property) { Object.defineProperty(RedirectableRequest.prototype, property, { get: function() { return this._currentRequest[property]; } }); })), RedirectableRequest.prototype._sanitizeOptions = function(options) { if (options.headers || (options.headers = {}), options.host && (options.hostname || (options.hostname = options.host), delete options.host), !options.pathname && options.path) { var searchPos = options.path.indexOf("?"); searchPos < 0 ? options.pathname = options.path : (options.pathname = options.path.substring(0, searchPos), options.search = options.path.substring(searchPos)); } }, RedirectableRequest.prototype._performRequest = function() { var protocol = this._options.protocol, nativeProtocol = this._options.nativeProtocols[protocol]; if (!nativeProtocol) throw new TypeError("Unsupported protocol " + protocol); if (this._options.agents) { var scheme = protocol.slice(0, -1); this._options.agent = this._options.agents[scheme]; } var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); for (var event of (request._redirectable = this, events)) request.on(event, eventHandlers[event]); if (this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : this._options.path, this._isRedirect) { var i = 0, self = this, buffers = this._requestBodyBuffers; !(function writeNext(error) { if (request === self._currentRequest) if (error) self.emit("error", error); else if (i < buffers.length) { var buffer = buffers[i++]; request.finished || request.write(buffer.data, buffer.encoding, writeNext); } else self._ended && request.end(); })(); } }, RedirectableRequest.prototype._processResponse = function(response) { var statusCode = response.statusCode; this._options.trackRedirects && this._redirects.push({ url: this._currentUrl, headers: response.headers, statusCode: statusCode }); var requestHeaders, location = response.headers.location; if (!location || !1 === this._options.followRedirects || statusCode < 300 || statusCode >= 400) return response.responseUrl = this._currentUrl, response.redirects = this._redirects, this.emit("response", response), void (this._requestBodyBuffers = []); if (destroyRequest(this._currentRequest), response.destroy(), ++this._redirectCount > this._options.maxRedirects) throw new TooManyRedirectsError; var beforeRedirect = this._options.beforeRedirect; beforeRedirect && (requestHeaders = Object.assign({ Host: response.req.getHeader("host") }, this._options.headers)); var method = this._options.method; ((301 === statusCode || 302 === statusCode) && "POST" === this._options.method || 303 === statusCode && !/^(?:GET|HEAD)$/.test(this._options.method)) && (this._options.method = "GET", this._requestBodyBuffers = [], removeMatchingHeaders(/^content-/i, this._options.headers)); var relative, base, currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers), currentUrlParts = parseUrl(this._currentUrl), currentHost = currentHostHeader || currentUrlParts.host, currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })), redirectUrl = (relative = location, base = currentUrl, useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative))); if (debug("redirecting to", redirectUrl.href), this._isRedirect = !0, spreadUrlObject(redirectUrl, this._options), (redirectUrl.protocol !== currentUrlParts.protocol && "https:" !== redirectUrl.protocol || redirectUrl.host !== currentHost && !(function(subdomain, domain) { assert(isString(subdomain) && isString(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && "." === subdomain[dot] && subdomain.endsWith(domain); })(redirectUrl.host, currentHost)) && removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers), isFunction(beforeRedirect)) { var responseDetails = { headers: response.headers, statusCode: statusCode }, requestDetails = { url: currentUrl, method: method, headers: requestHeaders }; beforeRedirect(this._options, responseDetails, requestDetails), this._sanitizeOptions(this._options); } this._performRequest(); }, module.exports = wrap({ http: http, https: https }), module.exports.wrap = wrap; }, function(module, exports, __webpack_require__) { var debug; module.exports = function() { if (!debug) { try { debug = __webpack_require__(9)("follow-redirects"); } catch (error) {} "function" != typeof debug && (debug = function() {}); } debug.apply(null, arguments); }; }, function(module, exports) { function isNumber(x) { return "number" == typeof x || !!/^0x[0-9a-f]+$/i.test(x) || /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); } module.exports = function(args, opts) { opts || (opts = {}); var flags = { bools: {}, strings: {}, unknownFn: null }; "function" == typeof opts.unknown && (flags.unknownFn = opts.unknown), "boolean" == typeof opts.boolean && opts.boolean ? flags.allBools = !0 : [].concat(opts.boolean).filter(Boolean).forEach((function(key) { flags.bools[key] = !0; })); var aliases = {}; Object.keys(opts.alias || {}).forEach((function(key) { aliases[key] = [].concat(opts.alias[key]), aliases[key].forEach((function(x) { aliases[x] = [ key ].concat(aliases[key].filter((function(y) { return x !== y; }))); })); })), [].concat(opts.string).filter(Boolean).forEach((function(key) { flags.strings[key] = !0, aliases[key] && (flags.strings[aliases[key]] = !0); })); var defaults = opts.default || {}, argv = { _: [] }; Object.keys(flags.bools).forEach((function(key) { setArg(key, void 0 !== defaults[key] && defaults[key]); })); var notFlags = []; function setArg(key, val, arg) { if (!arg || !flags.unknownFn || (function(key, arg) { return flags.allBools && /^--[^=]+$/.test(arg) || flags.strings[key] || flags.bools[key] || aliases[key]; })(key, arg) || !1 !== flags.unknownFn(arg)) { var value = !flags.strings[key] && isNumber(val) ? Number(val) : val; setKey(argv, key.split("."), value), (aliases[key] || []).forEach((function(x) { setKey(argv, x.split("."), value); })); } } function setKey(obj, keys, value) { var o = obj; keys.slice(0, -1).forEach((function(key) { void 0 === o[key] && (o[key] = {}), o = o[key]; })); var key = keys[keys.length - 1]; void 0 === o[key] || flags.bools[key] || "boolean" == typeof o[key] ? o[key] = value : Array.isArray(o[key]) ? o[key].push(value) : o[key] = [ o[key], value ]; } function aliasIsBoolean(key) { return aliases[key].some((function(x) { return flags.bools[x]; })); } -1 !== args.indexOf("--") && (notFlags = args.slice(args.indexOf("--") + 1), args = args.slice(0, args.indexOf("--"))); for (var i = 0; i < args.length; i++) { var arg = args[i]; if (/^--.+=/.test(arg)) { var m = arg.match(/^--([^=]+)=([\s\S]*)$/), key = m[1], value = m[2]; flags.bools[key] && (value = "false" !== value), setArg(key, value, arg); } else if (/^--no-.+/.test(arg)) setArg(key = arg.match(/^--no-(.+)/)[1], !1, arg); else if (/^--.+/.test(arg)) key = arg.match(/^--(.+)/)[1], void 0 === (next = args[i + 1]) || /^-/.test(next) || flags.bools[key] || flags.allBools || aliases[key] && aliasIsBoolean(key) ? /^(true|false)$/.test(next) ? (setArg(key, "true" === next, arg), i++) : setArg(key, !flags.strings[key] || "", arg) : (setArg(key, next, arg), i++); else if (/^-[^-]+/.test(arg)) { for (var letters = arg.slice(1, -1).split(""), broken = !1, j = 0; j < letters.length; j++) { var next; if ("-" !== (next = arg.slice(j + 2))) { if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { setArg(letters[j], next.split("=")[1], arg), broken = !0; break; } if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next, arg), broken = !0; break; } if (letters[j + 1] && letters[j + 1].match(/\W/)) { setArg(letters[j], arg.slice(j + 2), arg), broken = !0; break; } setArg(letters[j], !flags.strings[letters[j]] || "", arg); } else setArg(letters[j], next, arg); } key = arg.slice(-1)[0], broken || "-" === key || (!args[i + 1] || /^(-|--)[^-]/.test(args[i + 1]) || flags.bools[key] || aliases[key] && aliasIsBoolean(key) ? args[i + 1] && /true|false/.test(args[i + 1]) ? (setArg(key, "true" === args[i + 1], arg), i++) : setArg(key, !flags.strings[key] || "", arg) : (setArg(key, args[i + 1], arg), i++)); } else if (flags.unknownFn && !1 === flags.unknownFn(arg) || argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg)), opts.stopEarly) { argv._.push.apply(argv._, args.slice(i + 1)); break; } } return Object.keys(defaults).forEach((function(key) { var obj, keys, o; obj = argv, keys = key.split("."), o = obj, keys.slice(0, -1).forEach((function(key) { o = o[key] || {}; })), keys[keys.length - 1] in o || (setKey(argv, key.split("."), defaults[key]), (aliases[key] || []).forEach((function(x) { setKey(argv, x.split("."), defaults[key]); }))); })), opts["--"] ? (argv["--"] = new Array, notFlags.forEach((function(key) { argv["--"].push(key); }))) : notFlags.forEach((function(key) { argv._.push(key); })), argv; }; }, function(module, exports, __webpack_require__) { var magnet = __webpack_require__(817), hat = __webpack_require__(101), pws = __webpack_require__(820), bncode = __webpack_require__(195), bitfield = __webpack_require__(832), parseTorrent = __webpack_require__(302), mkdirp = __webpack_require__(142), rimraf = __webpack_require__(833), events = __webpack_require__(4), path = __webpack_require__(5), fs = __webpack_require__(2), os = __webpack_require__(23), eos = __webpack_require__(180), _ = (__webpack_require__(840), __webpack_require__(199)), bagpipe = __webpack_require__(200), blocklist = __webpack_require__(843), encode = __webpack_require__(844), exchangeMetadata = __webpack_require__(845), storage = __webpack_require__(846), storageCircular = __webpack_require__(847), fileStream = __webpack_require__(848), piece = __webpack_require__(853), SPEED_THRESHOLD = 3 * piece.BLOCK_SIZE, TMP = fs.existsSync("/tmp") ? "/tmp" : os.tmpdir(), noop = function() {}, thruthy = function() { return !0; }, falsy = function() { return !1; }, toNumber = function(val) { return !0 === val ? 1 : val || 0; }; module.exports = function(link, opts) { if (!(link = "string" == typeof link ? magnet(link) : Buffer.isBuffer(link) ? parseTorrent(link) : link) || !link.infoHash) throw new Error("You must pass a valid torrent or magnet link"); var infoHash = link.infoHash; opts || (opts = {}), opts.id || (opts.id = "-TS0008-" + hat(48)), opts.path || (opts.path = path.join(opts.tmp || TMP, opts.name || "torrent-stream", infoHash)), opts.flood || (opts.flood = 0), opts.pulse || (opts.pulse = Number.MAX_SAFE_INTEGER); var verificationLen, verificationsCount, engine = new events.EventEmitter, swarm = pws(infoHash, opts.id, { size: opts.connections || opts.size, handshakeTimeout: opts.handshakeTimeout, utp: !1 }), torrentPath = (blocklist(opts.blocklist), path.join(opts.path, "cache")), wires = swarm.wires, critical = [], refresh = noop, verifications = null; engine.infoHash = infoHash; var rechokeIntervalId, rechokeSlots = !1 === opts.uploads || 0 === opts.uploads ? 0 : +opts.uploads || 5, rechokeOptimistic = null, rechokeOptimisticTime = 0; engine.path = opts.path, engine.files = [], engine.selection = [], engine.lockedPieces = [], engine.torrent = null, engine.bitfield = null, engine.amInterested = !1, engine.store = null, engine.swarm = swarm, engine._flood = opts.flood, engine.pulse = opts.pulse, engine.buffer = opts.buffer, engine.ready = function(cb) { engine.torrent ? process.nextTick(cb) : engine.once("ready", cb); }; var ontorrent = function(torrent) { var lastFile = torrent.files[torrent.files.length - 1]; if (verifications = torrent.pieces, verificationLen = torrent.pieceLength, verificationsCount = Math.ceil((lastFile.offset + lastFile.length) / verificationLen), engine.verified = bitfield(verificationsCount, opts.circularBuffer ? null : path.join(opts.path, "bitfield")), opts.virtual) { var pieceLength = torrent.pieceLength > 524288 && torrent.pieceLength % 524288 == 0 ? 524288 : torrent.pieceLength, pieceCount = Math.ceil((lastFile.offset + lastFile.length) / pieceLength); torrent.pieceLength = pieceLength, torrent.verificationLen = verificationLen, torrent.pieces = []; for (var i = 0; i != pieceCount; i++) torrent.pieces.push(0); } var mapPiece = function(index) { return opts.virtual ? Math.floor(index * torrent.pieceLength / verificationLen) : index; }; if (opts.circularBuffer && !opts.buffer) throw "circularBuffer can only be used with buffer"; engine.store = opts.circularBuffer ? storageCircular(opts.path, torrent, opts.circularBuffer, engine) : storage(opts.path, torrent, opts, engine), engine.torrent = torrent, engine.bitfield = bitfield(torrent.pieces.length), pieceLength = torrent.pieceLength; var pieceRemainder = torrent.length % pieceLength || pieceLength, getPieceLen = function(i) { return i === torrent.pieces.length - 1 ? pieceRemainder : pieceLength; }, pieces = engine.pieces = torrent.pieces.map((function(hash, i) { return piece(getPieceLen(i)); })), reservations = engine.reservations = torrent.pieces.map((function() { return []; })); if (!opts.circularBuffer) { for (i = 0; i != torrent.files.length; i++) if (!fs.existsSync(path.join(opts.path, i + ""))) for (var file = torrent.files[i], startPiece = file.offset / verificationLen | 0, endPiece = (file.offset + file.length - 1) / verificationLen | 0, j = startPiece; j <= endPiece; j++) engine.verified.set(j, !1); for (i = 0; i != verificationsCount; i++) if (engine.verified.get(i)) { var start = Math.floor(i * verificationLen / torrent.pieceLength), end = Math.floor((i + 1) * verificationLen / torrent.pieceLength); for (j = start; j != end; j++) pieces[j] = null, engine.bitfield.set(j, !0), engine.emit("verify", j); } } torrent.files.forEach((function(f) { var sel, file = _.extend({}, f), offsetPiece = Math.floor(file.offset / verificationLen) * (verificationLen / torrent.pieceLength), endPiece = Math.ceil((file.offset + file.length - 1) / verificationLen) * (verificationLen / torrent.pieceLength); file.deselect = function() { engine.deselect(sel); }, file.select = function() { sel = engine.select(offsetPiece, endPiece, !1); }, file.createReadStream = function(opts) { var stream = fileStream(engine, file, opts); return eos(stream, (function() { engine.deselect(stream.selection); })), stream; }, engine.files.push(file); })); var oninterestchange = function() { var prev = engine.amInterested; engine.amInterested = !!engine.selection.length, wires.forEach((function(wire) { engine.amInterested ? wire.interested() : wire.uninterested(); })), prev !== engine.amInterested && (engine.amInterested ? engine.emit("interested") : engine.emit("uninterested")); }, gc = function() { for (var i = 0; i < engine.selection.length; i++) { for (var s = engine.selection[i], oldOffset = s.offset; !pieces[s.from + s.offset] && s.from + s.offset < s.to; ) s.offset++; oldOffset !== s.offset && s.notify(), s.to === s.from + s.offset && (pieces[s.from + s.offset] || (engine.selection.splice(i, 1), i--, s.notify(), oninterestchange())); } engine.selection.length || engine.emit("idle"); }, resetpiece = engine.resetPiece = function(idx) { engine.bitfield.set(idx, !1), critical[idx] = null, reservations[idx] = [], pieces[idx] = piece(getPieceLen(idx)); }, onhotswap = !1 === opts.hotswap ? falsy : function(wire, index) { var speed = wire.downloadSpeed(); if (!(speed < piece.BLOCK_SIZE) && reservations[index] && pieces[index]) { for (var min, r = reservations[index], minSpeed = 1 / 0, i = 0; i < r.length; i++) { var other = r[i]; if (other && other !== wire) { var otherSpeed = other.downloadSpeed(); otherSpeed >= SPEED_THRESHOLD || 2 * otherSpeed > speed || otherSpeed > minSpeed || (min = other, minSpeed = otherSpeed); } } if (!min) return !1; for (i = 0; i < r.length; i++) r[i] === min && (r[i] = null); var requests, reqs = (requests = min.requests, opts.virtual ? requests.map((function(r) { var pos = r.piece * verificationLen + r.offset; return { piece: Math.floor(pos / torrent.pieceLength), offset: pos % torrent.pieceLength, callback: r.callback, timeout: r.timeout, length: r.length }; })) : requests); for (i = 0; i < reqs.length; i++) { var req = reqs[i]; req.piece === index && pieces[index].cancel(req.offset / piece.BLOCK_SIZE | 0); } return engine.emit("hotswap", min, wire, index), !0; } }, onupdatetick = function() { if (engine.emit("update"), swarm.downloaded >= engine._flood && swarm.downloadSpeed() > engine.pulse) return delayupdatetick(); process.nextTick(onupdate); }, delayupdatetick = _.debounce(onupdatetick, 500), onrequest = function(wire, index, hotswap) { if (!pieces[index]) return !1; var p = pieces[index], reservation = p.reserve(); if (-1 === reservation && hotswap && onhotswap(wire, index) && (reservation = p.reserve()), -1 === reservation) return !1; var r = reservations[index] || [], offset = p.offset(reservation), size = p.size(reservation), i = r.indexOf(null); return -1 === i && (i = r.length), r[i] = wire, (function(peer, index, offset, size, cb) { if (!opts.virtual) return peer.request(index, offset, size, cb); var pos = index * torrent.pieceLength + offset; index = Math.floor(pos / verificationLen), offset = pos % verificationLen, peer.request(index, offset, size, cb); })(wire, index, offset, size, (function(err, block) { if (r[i] === wire && (r[i] = null), p !== pieces[index]) return onupdatetick(); if (err) return p.cancel(reservation), onupdatetick(); var ready = !p.set(reservation, block); if (engine.emit("piece-progress", index, p.buffered / p.parts), ready) return onupdatetick(); var buffer = p.flush(); !(function(index, buffer) { if (pieces[index]) { try { engine.store.write(index, buffer); } catch (e) { return void engine.emit("error", e); } engine.bitfield.set(index, !0); var ver = engine.store.verify(index, verifications); if (ver && ver.success && engine.store.commit(ver.start, ver.end - 1, (function(err, noNotifyHave) { if (err) return engine.emit("error", err); for (var j = ver.start; j != ver.end; j++) engine.emit("verify", j); if (!noNotifyHave) { var idx = mapPiece(index); engine.verified.set(idx, !0); for (var i = 0; i < wires.length; i++) wires[i].have(idx); } })), !ver || ver.success) pieces[index] = null, reservations[index] = null, engine.emit("download", index, buffer), gc(); else for (var j = ver.start; j != ver.end; j++) engine.emit("invalid-piece", j), resetpiece(j); } })(index, buffer), onupdatetick(); })), !0; }, getRequestsNumber = function() { var unchoked = wires.filter((function(peer) { return !peer.peerChoking; })).length, normalRange = 1 - Math.max(0, Math.min(1, (unchoked - 1) / 29)); return Math.round(45 * Math.pow(normalRange, 4) + 5); }, shufflePriority = function(i) { for (var last = i, j = i; j < engine.selection.length && engine.selection[j].priority; j++) last = j; engine.selection.splice(last, 0, engine.selection.splice(i, 1)[0]); }, select = function(wire, hotswap) { var maxRequests = getRequestsNumber(); if (wire.requests.length >= maxRequests) return !0; for (var rank = (function(wire) { var speed = wire.downloadSpeed() || 1; if (speed > SPEED_THRESHOLD) return thruthy; var secs = getRequestsNumber() * piece.BLOCK_SIZE / speed, tries = 10, ptr = 0; return function(index) { if (!tries || !pieces[index]) return !0; for (var missing = pieces[index].missing; ptr < wires.length; ptr++) { var other = wires[ptr], otherSpeed = other.downloadSpeed(); if (!(otherSpeed < SPEED_THRESHOLD) && !(otherSpeed <= speed) && other.peerPieces[mapPiece(index)] && !((missing -= otherSpeed * secs) > 0)) return tries--, !1; } return !0; }; })(wire), i = 0; i < engine.selection.length; i++) for (var next = engine.selection[i], j = next.from + next.offset; j <= (next.selectTo || next.to); j++) if (wire.peerPieces[mapPiece(j)] && rank(j)) { for (;wire.requests.length < maxRequests && onrequest(wire, j, critical[j] || hotswap); ) ; if (!(wire.requests.length < maxRequests)) return next.priority && shufflePriority(i), !0; } return !1; }, onupdatewire = function(wire) { if (!wire.peerChoking) return wire.downloaded ? void (select(wire, !1) || select(wire, !0)) : (function(wire) { if (!wire.requests.length) for (var i = engine.selection.length - 1; i >= 0; i--) for (var next = engine.selection[i], j = next.selectTo || next.to; j >= next.from + next.offset; j--) if (wire.peerPieces[mapPiece(j)] && onrequest(wire, j, !1)) return; })(wire); }, onupdate = function() { wires.forEach(onupdatewire); }, onwire = function(wire) { wire.setTimeout(opts.timeout || 3e4, (function() { engine.emit("timeout", wire), wire.destroy(); })), engine.selection.length && wire.interested(); var id, onchoketimeout = function() { if (swarm.queued > 2 * (swarm.size - swarm.wires.length) && wire.amInterested) return wire.destroy(); id = setTimeout(onchoketimeout, 5e3); }; wire.on("close", (function() { clearTimeout(id); })), wire.on("choke", (function() { clearTimeout(id), id = setTimeout(onchoketimeout, 5e3); })), wire.on("unchoke", (function() { clearTimeout(id); })); var uploadPipe = new bagpipe(4); wire.on("request", (function(index, offset, length, cb) { var pos = index * verificationLen + offset; if (index = Math.floor(pos / torrent.pieceLength), offset = pos % torrent.pieceLength, !engine.bitfield.get(index)) return engine.emit("invalid-request", index); uploadPipe.push(engine.store.read, index, (function(err, buffer) { return err ? cb(err) : buffer ? (engine.emit("upload", index, offset, length), void cb(null, buffer.slice(offset, offset + length))) : cb(new Error("Empty buffer returned")); })); })), wire.on("unchoke", onupdatetick), wire.on("bitfield", onupdatetick), wire.on("have", onupdatetick), wire.isSeeder = !1; var i = 0, checkseeder = function() { if (wire.peerPieces.length === torrent.pieces.length) { for (;i < torrent.pieces.length; ++i) if (!wire.peerPieces[i]) return; wire.isSeeder = !0; } }; wire.on("bitfield", checkseeder), wire.on("have", checkseeder), checkseeder(), id = setTimeout(onchoketimeout, 5e3); }, rechokeSort = function(a, b) { return a.downSpeed != b.downSpeed ? a.downSpeed > b.downSpeed ? -1 : 1 : a.upSpeed != b.upSpeed ? a.upSpeed > b.upSpeed ? -1 : 1 : a.wasChoked != b.wasChoked ? a.wasChoked ? 1 : -1 : a.salt - b.salt; }; swarm.on("wire", onwire), swarm.wires.forEach(onwire), refresh = function() { process.nextTick(gc), oninterestchange(), onupdatetick(); }, rechokeIntervalId = setInterval((function() { rechokeOptimisticTime > 0 ? --rechokeOptimisticTime : rechokeOptimistic = null; var peers = []; wires.forEach((function(wire) { wire.isSeeder ? wire.amChoking || wire.choke() : wire !== rechokeOptimistic && peers.push({ wire: wire, downSpeed: wire.downloadSpeed(), upSpeed: wire.uploadSpeed(), salt: Math.random(), interested: wire.peerInterested, wasChoked: wire.amChoking, isChoked: !0 }); })), peers.sort(rechokeSort); for (var i = 0, unchokeInterested = 0; i < peers.length && unchokeInterested < rechokeSlots; ++i) peers[i].isChoked = !1, peers[i].interested && ++unchokeInterested; if (!rechokeOptimistic && i < peers.length && rechokeSlots) { var candidates = peers.slice(i).filter((function(peer) { return peer.interested; })), optimistic = candidates[Math.random() * candidates.length | 0]; optimistic && (optimistic.isChoked = !1, rechokeOptimistic = optimistic.wire, rechokeOptimisticTime = 2); } peers.forEach((function(peer) { peer.wasChoked != peer.isChoked && (peer.isChoked ? peer.wire.choke() : peer.wire.unchoke()); })); }), 1e4), engine.emit("ready"), refresh(); }, exchange = exchangeMetadata(engine, (function(metadata) { var result = {}; try { result.info = bncode.decode(metadata); } catch (e) { return; } result["announce-list"] = []; var buf = bncode.encode(result), tor = parseTorrent(buf); verifications || (verifications = tor.pieces), engine.torrent || ontorrent(tor), fs.writeFile(torrentPath, buf, (function(err) { err && console.error(err); })); })); return swarm.on("wire", (function(wire) { engine.emit("wire", wire), exchange(wire), engine.verified ? wire.bitfield(engine.verified) : engine.bitfield && wire.bitfield(engine.bitfield); })), swarm.pause(), (function(next) { if (opts.circularBuffer) return next(); mkdirp(opts.path, (function(err) { if (err) return next(err); fs.readFile(torrentPath, (function(_, buf) { try { buf && (link = parseTorrent(buf)); } catch (e) {} next(); })); })); })((function(err) { return err ? engine.emit("error", err) : link.files && link.pieces ? (metadata = encode(link), swarm.resume(), void (metadata && ontorrent(link))) : void 0; })), engine.critical = function(piece, width) { for (var i = 0; i < (width || 1); i++) critical[piece + i] = !0; }, engine.isCritical = function(piece) { return critical[piece]; }, engine.select = function(from, to, priority, notify) { var sel; return engine.selection.push(sel = { from: from, to: to, offset: 0, priority: toNumber(priority), notify: notify || noop }), engine.selection.sort((function(a, b) { return b.priority - a.priority; })), refresh(), sel; }, engine.deselect = function(sel) { var idx = engine.selection.indexOf(sel); idx > -1 && (engine.selection.splice(idx, 1), refresh()); }, engine.refresh = function() { refresh(); }, engine.setPulse = function(bps) { engine.pulse = bps, "undefined" != typeof onupdatetick && onupdatetick(); }, engine.setFlood = function(b) { engine._flood = b + swarm.downloaded; }, engine.setFloodedPulse = function(b, bps) { engine.setFlood(b), engine.setPulse(bps); }, engine.flood = function() { engine._flood = 0, engine.pulse = Number.MAX_SAFE_INTEGER; }, engine.connect = function(addr) { swarm.add(addr); }, engine.disconnect = function(addr) { swarm.remove(addr); }, engine.remove = function(cb) { rimraf(engine.path, cb || noop); }, engine.destroy = function(cb) { engine.removeAllListeners(), swarm.destroy(), clearInterval(rechokeIntervalId), engine.store ? engine.store.close(cb) : cb && process.nextTick(cb); }, engine.listen = function(port, cb) { if ("function" == typeof port) return that.listen(0, port); engine.port = port || 6881, swarm.listen(engine.port, cb); }, engine; }; }, function(module, exports, __webpack_require__) { var base32 = __webpack_require__(818); module.exports = function(uri) { var m, result = {}, data = uri.split("magnet:?")[1]; if (!data || 0 === data.length) return result; if (data.split("&").forEach((function(param) { var keyval = param.split("="); if (2 === keyval.length) { var key = keyval[0], val = keyval[1]; if ("tr" === key && (val = decodeURIComponent(val)), result[key]) if (Array.isArray(result[key])) result[key].push(val); else { var old = result[key]; result[key] = [ old, val ]; } else result[key] = val; } })), result.xt && (m = result.xt.match(/^urn:btih:(.{40})/))) result.infoHash = new Buffer(m[1], "hex").toString("hex"); else if (result.xt && (m = result.xt.match(/^urn:btih:(.{32})/))) { var decodedStr = base32.decode(m[1]); result.infoHash = new Buffer(decodedStr, "binary").toString("hex"); } return result; }; }, function(module, exports, __webpack_require__) { var base32 = __webpack_require__(819); exports.encode = base32.encode, exports.decode = base32.decode; }, function(module, exports) { var byteTable = [ 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 ]; exports.encode = function(plain) { var buff, quintets, i = 0, j = 0, shiftIndex = 0, digit = 0, encoded = new Buffer(8 * (buff = plain, quintets = Math.floor(buff.length / 5), buff.length % 5 == 0 ? quintets : quintets + 1)); for (Buffer.isBuffer(plain) || (plain = new Buffer(plain)); i < plain.length; ) { var current = plain[i]; shiftIndex > 3 ? (digit = (digit = current & 255 >> shiftIndex) << (shiftIndex = (shiftIndex + 5) % 8) | (i + 1 < plain.length ? plain[i + 1] : 0) >> 8 - shiftIndex, i++) : (digit = current >> 8 - (shiftIndex + 5) & 31, 0 == (shiftIndex = (shiftIndex + 5) % 8) && i++), encoded[j] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(digit), j++; } for (i = j; i < encoded.length; i++) encoded[i] = 61; return encoded; }, exports.decode = function(encoded) { var plainChar, shiftIndex = 0, plainDigit = 0, plainPos = 0; Buffer.isBuffer(encoded) || (encoded = new Buffer(encoded)); for (var decoded = new Buffer(Math.ceil(5 * encoded.length / 8)), i = 0; i < encoded.length && 61 != encoded[i]; i++) { var encodedByte = encoded[i] - 48; if (!(encodedByte < byteTable.length)) throw new Error("Invalid input - it is not base32 encoded string"); plainDigit = byteTable[encodedByte], shiftIndex <= 3 ? 0 == (shiftIndex = (shiftIndex + 5) % 8) ? (plainChar |= plainDigit, decoded[plainPos] = plainChar, plainPos++, plainChar = 0) : plainChar |= 255 & plainDigit << 8 - shiftIndex : (plainChar |= 255 & plainDigit >>> (shiftIndex = (shiftIndex + 5) % 8), decoded[plainPos] = plainChar, plainPos++, plainChar = 255 & plainDigit << 8 - shiftIndex); } return decoded.slice(0, plainPos); }; }, function(module, exports, __webpack_require__) { var utp = __webpack_require__(821), net = __webpack_require__(39), fifo = __webpack_require__(823), once = __webpack_require__(35), speedometer = __webpack_require__(416), peerWireProtocol = __webpack_require__(824), EventEmitter = __webpack_require__(4).EventEmitter, util = __webpack_require__(0), RECONNECT_WAIT = [ 4e3, 8e3, 12e3 ], toBuffer = function(str, encoding) { return Buffer.isBuffer(str) ? str : new Buffer(str, encoding); }, toAddress = function(wire) { return "string" == typeof wire ? wire : wire.peerAddress; }, onwire = function(swarm, connection, onhandshake, isServer) { var wire = peerWireProtocol(swarm._pwp), destroy = function() { connection.destroy(), connection.emit("timeout"); }, connectTimeout = !isServer && setTimeout(destroy, swarm.connectTimeout), handshakeTimeout = setTimeout(destroy, swarm.handshakeTimeout); return handshakeTimeout.unref && handshakeTimeout.unref(), connectTimeout.unref && connectTimeout.unref(), connection.on("connect", (function() { clearTimeout(connectTimeout); })), wire.once("handshake", (function(infoHash, peerId) { clearTimeout(handshakeTimeout), onhandshake(infoHash, peerId); })), connection.on("end", (function() { connection.destroy(); })), connection.on("error", (function() { connection.destroy(); })), connection.on("close", (function() { clearTimeout(connectTimeout), clearTimeout(handshakeTimeout), wire.destroy(); })), connection.pipe(wire).pipe(connection), wire; }, pools = {}, Swarm = function(infoHash, peerId, options) { if (!(this instanceof Swarm)) return new Swarm(infoHash, peerId, options); EventEmitter.call(this), options = options || {}, this.handshake = options.handshake, this.port = 0, this.size = options.size || 100, this.utp = options.utp || !1, this.handshakeTimeout = options.handshakeTimeout || 25e3, this.connectTimeout = options.connectTimeout || 3e3, this.infoHash = toBuffer(infoHash, "hex"), this.peerId = toBuffer(peerId, "utf-8"), this.downloaded = 0, this.uploaded = 0, this.connections = [], this.wires = [], this.paused = !1, this.tries = 0, this.uploaded = 0, this.downloaded = 0, this.downloadSpeed = speedometer(), this.uploadSpeed = speedometer(), this._destroyed = !1, this._queues = [ fifo() ], this._peers = {}, this._pwp = { speed: options.speed }; }; util.inherits(Swarm, EventEmitter), Swarm.prototype.__defineGetter__("queued", (function() { return this._queues.reduce((function(prev, queue) { return prev + queue.length; }), 0); })), Swarm.prototype.pause = function() { this.paused = !0, this.emit("pause"); }, Swarm.prototype.resume = function() { this.paused = !1, this.emit("resume"), this._drain(); }, Swarm.prototype.priority = function(addr, level) { addr = toAddress(addr); var peer = this._peers[addr]; return peer ? "number" != typeof level || peer.priority === level ? level : (this._queues[level] || (this._queues[level] = fifo()), peer.node && (this._queues[peer.priority].remove(peer.node), peer.node = this._queues[level].push(addr)), peer.priority = level) : 0; }, Swarm.prototype.add = function(addr) { if (!this._destroyed && !this._peers[addr]) { var port = Number(addr.split(":")[1]); port > 0 && port < 65535 && (this._peers[addr] = { node: this._queues[0].push(addr), wire: null, timeout: null, reconnect: !1, priority: 0, retries: 0, noUtp: !1 }, this._drain()); } }, Swarm.prototype.remove = function(addr) { this._remove(toAddress(addr)), this._drain(); }, Swarm.prototype.listen = function(port, onlistening) { onlistening && this.once("listening", onlistening), this.port = port, (function(port, swarm) { var pool = pools[port]; if (!pool) { var swarms = {}, servers = [], onconnection = function(connection) { var wire = onwire(swarm, connection, (function(infoHash, peerId) { var swarm = swarms[infoHash.toString("hex")]; if (!swarm) return connection.destroy(); swarm._onincoming(connection, wire); }), !0); }; servers.push(net.createServer(onconnection)), swarm.utp && servers.push(utp.createServer(onconnection)); var loop = function(i) { if (i < servers.length) return servers[i].listen(port, loop.bind(null, i + 1)); pool.listening = !0, Object.keys(swarms).forEach((function(infoHash) { swarms[infoHash].emit("listening"); })); }; loop(0), pool = pools[port] = { servers: servers, swarms: swarms, listening: !1 }; } var infoHash = swarm.infoHash.toString("hex"); pool.listening && process.nextTick((function() { swarm.emit("listening"); })), pool.swarms[infoHash] ? process.nextTick((function() { swarm.emit("error", new Error("port and info hash already in use")); })) : pool.swarms[infoHash] = swarm; })(this.port, this); }, Swarm.prototype.destroy = function() { this._destroyed = !0; var port, self = this; Object.keys(this._peers).forEach((function(addr) { self._remove(addr); })), this.wires.forEach((function(wire) { wire.destroy(), wire.removeAllListeners(); })), port = this.port, pools[port] && (delete pools[port].swarms[this.infoHash.toString("hex")], Object.keys(pools[port].swarms).length || (pools[port].servers.forEach((function(server) { server.close(); })), delete pools[port])), process.nextTick((function() { self.emit("close"), self.removeAllListeners(); })); }, Swarm.prototype._remove = function(addr) { var peer = this._peers[addr]; peer && (delete this._peers[addr], peer.node && this._queues[peer.priority].remove(peer.node), peer.timeout && clearTimeout(peer.timeout), peer.wire && peer.wire.destroy()); }, Swarm.prototype._drain = function() { if (!(this.connections.length >= this.size || this.paused)) { var self = this, addr = this._shift(); if (addr) { var peer = this._peers[addr]; if (peer) { self.tries++; var connection, repush = function() { peer.node = self._queues[peer.priority].push(addr), self._drain(); }, parts = addr.split(":"); this.utp && !peer.noUtp ? (connection = utp.connect(parts[1], parts[0])).on("timeout", (function() { peer.noUtp = !0, repush(); })) : connection = net.connect(parts[1], parts[0]), peer.timeout && clearTimeout(peer.timeout), peer.node = null, peer.timeout = null; var wire = onwire(this, connection, (function(infoHash) { if (infoHash.toString("hex") !== self.infoHash.toString("hex")) return connection.destroy(); peer.reconnect = !0, peer.retries = 0, self._onwire(connection, wire); })); wire.on("close", (function() { if (peer.wire = null, !peer.reconnect || self._destroyed || peer.retries >= RECONNECT_WAIT.length) return self._remove(addr); peer.timeout = setTimeout(repush, RECONNECT_WAIT[peer.retries++]); })), peer.wire = wire, self._onconnection(connection), wire.peerAddress = addr, wire.handshake(this.infoHash, this.peerId, this.handshake); } } } }, Swarm.prototype._shift = function() { for (var i = this._queues.length - 1; i >= 0; i--) if (this._queues[i] && this._queues[i].length) return this._queues[i].shift(); return null; }, Swarm.prototype._onincoming = function(connection, wire) { wire.peerAddress = connection.address().address + ":" + connection.address().port, wire.handshake(this.infoHash, this.peerId, this.handshake), this._onconnection(connection), this._onwire(connection, wire); }, Swarm.prototype._onconnection = function(connection) { var self = this; connection.once("close", (function() { self.connections.splice(self.connections.indexOf(connection), 1), self._drain(); })), this.connections.push(connection); }, Swarm.prototype._onwire = function(connection, wire) { var self = this; wire.on("download", (function(downloaded) { self.downloaded += downloaded, self.downloadSpeed(downloaded), self.emit("download", downloaded); })), wire.on("upload", (function(uploaded) { self.uploaded += uploaded, self.uploadSpeed(uploaded), self.emit("upload", uploaded); })); var cleanup = once((function() { self.emit("wire-disconnect", wire, connection), self.wires.splice(self.wires.indexOf(wire), 1), connection.destroy(); })); connection.on("close", cleanup), connection.on("error", cleanup), connection.on("end", cleanup), wire.on("end", cleanup), wire.on("close", cleanup), wire.on("finish", cleanup), this.wires.push(wire), this.emit("wire", wire, connection); }, module.exports = Swarm; }, function(module, exports, __webpack_require__) { var offset, then, dgram = __webpack_require__(79), cyclist = __webpack_require__(822), util = __webpack_require__(0), EventEmitter = __webpack_require__(4).EventEmitter, Duplex = __webpack_require__(3).Duplex, uint32 = function(n) { return n >>> 0; }, uint16 = function(n) { return 65535 & n; }, timestamp = (offset = process.hrtime(), then = 1e3 * Date.now(), function() { var diff = process.hrtime(offset); return uint32(then + 1e6 * diff[0] + (diff[1] / 1e3 | 0)); }), bufferToPacket = function(buffer) { var packet = {}; return packet.id = 240 & buffer[0], packet.connection = buffer.readUInt16BE(2), packet.timestamp = buffer.readUInt32BE(4), packet.timediff = buffer.readUInt32BE(8), packet.window = buffer.readUInt32BE(12), packet.seq = buffer.readUInt16BE(16), packet.ack = buffer.readUInt16BE(18), packet.data = buffer.length > 20 ? buffer.slice(20) : null, packet; }, createPacket = function(connection, id, data) { return { id: id, connection: 64 === id ? connection._recvId : connection._sendId, seq: connection._seq, ack: connection._ack, timestamp: timestamp(), timediff: 0, window: 262144, data: data, sent: 0 }; }, Connection = function(port, host, socket, syn) { Duplex.call(this); var self = this; this.port = port, this.host = host, this.socket = socket, this._outgoing = cyclist(512), this._incoming = cyclist(512), this._inflightPackets = 0, this._closed = !1, this._alive = !1, syn ? (this._connecting = !1, this._recvId = uint16(syn.connection + 1), this._sendId = syn.connection, this._seq = 65535 * Math.random() | 0, this._ack = syn.seq, this._synack = createPacket(this, 32, null), this._transmit(this._synack)) : (this._connecting = !0, this._recvId = 0, this._sendId = 0, this._seq = 65535 * Math.random() | 0, this._ack = 0, this._synack = null, socket.on("listening", (function() { self._recvId = socket.address().port, self._sendId = uint16(self._recvId + 1), self._sendOutgoing(createPacket(self, 64, null)); })), socket.on("error", (function(err) { self.emit("error", err); })), socket.bind()); var resend = setInterval(this._resend.bind(this), 500), keepAlive = setInterval(this._keepAlive.bind(this), 1e4), tick = 0, closed = function() { 2 == ++tick && self._closing(); }, sendFin = function() { if (self._connecting) return self.once("connect", sendFin); self._sendOutgoing(createPacket(self, 16, null)), self.once("flush", closed); }; this.once("finish", sendFin), this.once("close", (function() { syn || setTimeout(socket.close.bind(socket), 5e3), clearInterval(resend), clearInterval(keepAlive); })), this.once("end", (function() { process.nextTick(closed); })); }; util.inherits(Connection, Duplex), Connection.prototype.setTimeout = function() {}, Connection.prototype.destroy = function() { this.end(); }, Connection.prototype.address = function() { return { port: this.port, address: this.host }; }, Connection.prototype._read = function() {}, Connection.prototype._write = function(data, enc, callback) { if (this._connecting) return this._writeOnce("connect", data, enc, callback); for (;this._writable(); ) { var payload = this._payload(data); if (this._sendOutgoing(createPacket(this, 0, payload)), payload.length === data.length) return callback(); data = data.slice(payload.length); } this._writeOnce("flush", data, enc, callback); }, Connection.prototype._writeOnce = function(event, data, enc, callback) { this.once(event, (function() { this._write(data, enc, callback); })); }, Connection.prototype._writable = function() { return this._inflightPackets < 511; }, Connection.prototype._payload = function(data) { return data.length > 1400 ? data.slice(0, 1400) : data; }, Connection.prototype._resend = function() { var offset = this._seq - this._inflightPackets, first = this._outgoing.get(offset); if (first) { var now = timestamp(); if (!(uint32(first.sent - now) < 5e5)) for (var i = 0; i < this._inflightPackets; i++) { var packet = this._outgoing.get(offset + i); uint32(packet.sent - now) >= 5e5 && this._transmit(packet); } } }, Connection.prototype._keepAlive = function() { if (this._alive) return this._alive = !1; this._sendAck(); }, Connection.prototype._closing = function() { this._closed || (this._closed = !0, process.nextTick(this.emit.bind(this, "close"))); }, Connection.prototype._recvAck = function(ack) { var offset = this._seq - this._inflightPackets, acked = uint16(ack - offset) + 1; if (!(acked >= 512)) { for (var i = 0; i < acked; i++) this._outgoing.del(offset + i), this._inflightPackets--; this._inflightPackets || this.emit("flush"); } }, Connection.prototype._recvIncoming = function(packet) { if (!this._closed) if (64 === packet.id && this._connecting) this._transmit(this._synack); else { if (48 === packet.id) return this.push(null), this.end(), void this._closing(); if (this._connecting) { if (32 !== packet.id) return this._incoming.put(packet.seq, packet); if (this._ack = uint16(packet.seq - 1), this._recvAck(packet.ack), this._connecting = !1, this.emit("connect"), !(packet = this._incoming.del(packet.seq))) return; } if (uint16(packet.seq - this._ack) >= 512) return this._sendAck(); if (this._recvAck(packet.ack), 32 !== packet.id) { for (this._incoming.put(packet.seq, packet); packet = this._incoming.del(this._ack + 1); ) this._ack = uint16(this._ack + 1), 0 === packet.id && this.push(packet.data), 16 === packet.id && this.push(null); this._sendAck(); } } }, Connection.prototype._sendAck = function() { this._transmit(createPacket(this, 32, null)); }, Connection.prototype._sendOutgoing = function(packet) { this._outgoing.put(packet.seq, packet), this._seq = uint16(this._seq + 1), this._inflightPackets++, this._transmit(packet); }, Connection.prototype._transmit = function(packet) { packet.sent = 0 === packet.sent ? packet.timestamp : timestamp(); var message = (function(packet) { var buffer = new Buffer(20 + (packet.data ? packet.data.length : 0)); return buffer[0] = 1 | packet.id, buffer[1] = 0, buffer.writeUInt16BE(packet.connection, 2), buffer.writeUInt32BE(packet.timestamp, 4), buffer.writeUInt32BE(packet.timediff, 8), buffer.writeUInt32BE(packet.window, 12), buffer.writeUInt16BE(packet.seq, 16), buffer.writeUInt16BE(packet.ack, 18), packet.data && packet.data.copy(buffer, 20), buffer; })(packet); this._alive = !0, this.socket.send(message, 0, message.length, this.port, this.host); }; var Server = function() { EventEmitter.call(this), this._socket = null, this._connections = {}; }; util.inherits(Server, EventEmitter), Server.prototype.address = function() { return this._socket.address(); }, Server.prototype.listen = function(port, onlistening) { var socket = this._socket = dgram.createSocket("udp4"), connections = this._connections, self = this; socket.on("message", (function(message, rinfo) { if (!(message.length < 20)) { var packet = bufferToPacket(message), id = rinfo.address + ":" + (64 === packet.id ? uint16(packet.connection + 1) : packet.connection); if (connections[id]) return connections[id]._recvIncoming(packet); 64 === packet.id && (connections[id] = new Connection(rinfo.port, rinfo.address, socket, packet), connections[id].on("close", (function() { delete connections[id]; })), self.emit("connection", connections[id])); } })), socket.once("listening", (function() { self.emit("listening"); })), onlistening && self.once("listening", onlistening), socket.bind(port); }, exports.createServer = function(onconnection) { var server = new Server; return onconnection && server.on("connection", onconnection), server; }, exports.connect = function(port, host) { var socket = dgram.createSocket("udp4"), connection = new Connection(port, host || "127.0.0.1", socket, null); return socket.on("message", (function(message) { if (!(message.length < 20)) { var packet = bufferToPacket(message); 64 !== packet.id && packet.connection === connection._recvId && connection._recvIncoming(packet); } })), connection; }; }, function(module, exports) { var Cyclist = function(size) { if (!(this instanceof Cyclist)) return new Cyclist(size); this.mask = 0, this.values = [], this.indexes = [], size && this.fit(size); }; Cyclist.prototype.__defineGetter__("size", (function() { return this.mask + 1; })), Cyclist.prototype.put = function(index, val) { var pos = index & this.mask; this.indexes[pos] = index, this.values[pos] = val; }, Cyclist.prototype.get = function(index) { return this.values[index & this.mask]; }, Cyclist.prototype.del = function(index) { var pos = index & this.mask, val = this.values[pos]; return this.indexes[pos] = this.values[pos] = void 0, val; }, Cyclist.prototype.fit = function(size) { if (!(size <= this.size)) { for (;this.size < size; ) this.mask = 2 * (this.mask + 1) - 1; var values = this.values, indexes = this.indexes; this.values = new Array(this.size), this.indexes = new Array(this.size); for (var i = 0; i < indexes.length; i++) void 0 !== indexes[i] && this.put(indexes[i], values[i]); } }, module.exports = Cyclist; }, function(module, exports) { var Node = function(list, val) { this.prev = this.next = this, this.value = val, this.list = list; }; Node.prototype.link = function(next) { return this.next = next, next.prev = this, next; }; var FIFO = function() { if (!(this instanceof FIFO)) return new FIFO; this.node = null, this.length = 0; }; FIFO.prototype.set = function(node, value) { return node && node.list === this ? (node.value = value, node) : null; }, FIFO.prototype.get = function(node) { return node && node.list === this ? node.value : null; }, FIFO.prototype.remove = function(node) { return node && node.list === this ? (this.length--, node.list = null, node.prev.link(node.next), node === this.node && (this.node = node.next === node ? null : node.next), node.value) : null; }, FIFO.prototype.unshift = function(value) { return this.node = this.push(value); }, FIFO.prototype.push = function(value) { var node = new Node(this, value); return this.length++, this.node ? (this.node.prev.link(node), node.link(this.node), node) : this.node = node; }, FIFO.prototype.first = function() { return this.node && this.node.value; }, FIFO.prototype.last = function() { return this.node && this.node.prev.value; }, FIFO.prototype.shift = function() { return this.node && this.remove(this.node); }, FIFO.prototype.pop = function() { return this.node && this.remove(this.node.prev); }, module.exports = FIFO; }, function(module, exports, __webpack_require__) { var Duplex = __webpack_require__(3).Duplex || __webpack_require__(825).Duplex, bitfield = (__webpack_require__(4).EventEmitter, __webpack_require__(828)), util = __webpack_require__(0), bncode = __webpack_require__(829), speedometer = __webpack_require__(416), bufferFrom = __webpack_require__(421), bufferAlloc = __webpack_require__(422), MESSAGE_PROTOCOL = bufferFrom([ 19, 66, 105, 116, 84, 111, 114, 114, 101, 110, 116, 32, 112, 114, 111, 116, 111, 99, 111, 108 ]), MESSAGE_KEEP_ALIVE = bufferFrom([ 0, 0, 0, 0 ]), MESSAGE_CHOKE = bufferFrom([ 0, 0, 0, 1, 0 ]), MESSAGE_UNCHOKE = bufferFrom([ 0, 0, 0, 1, 1 ]), MESSAGE_INTERESTED = bufferFrom([ 0, 0, 0, 1, 2 ]), MESSAGE_UNINTERESTED = bufferFrom([ 0, 0, 0, 1, 3 ]), MESSAGE_RESERVED = [ 0, 0, 0, 0, 0, 0, 0, 0 ], MESSAGE_PORT = [ 0, 0, 0, 3, 9, 0, 0 ], noop = function() {}, pull = function(requests, piece, offset, length) { for (var i = 0; i < requests.length; i++) { var req = requests[i]; if (req.piece === piece && req.offset === offset && req.length === length) return 0 === i ? requests.shift() : requests.splice(i, 1), req; } return null; }, Request = function(piece, offset, length, callback) { this.piece = piece, this.offset = offset, this.length = length, this.callback = callback, this.timeout = null; }, Wire = function(opts) { if (!(this instanceof Wire)) return new Wire(opts); opts || (opts = {}), Duplex.call(this); var self = this; this.amChoking = !0, this.amInterested = !1, this.peerChoking = !0, this.peerInterested = !1, this.peerPieces = [], this.peerExtensions = {}, this.peerAddress = null, this.uploaded = 0, this.downloaded = 0, this.uploadSpeed = speedometer(opts.speed), this.downloadSpeed = speedometer(opts.speed), this.requests = [], this.peerRequests = [], this._keepAlive = null, this._finished = !1, this.on("finish", (function() { for (self._finished = !0, self.push(null), clearInterval(self._keepAlive), self._parse(Number.MAX_VALUE, noop); self.peerRequests.length; ) self.peerRequests.pop(); for (;self.requests.length; ) self._callback(self.requests.shift(), new Error("wire is closed"), null); })), this._timeout = 0, this._ontimeout = function() { self._callback(self.requests.shift(), new Error("request has timed out"), null), self.emit("timeout"); }; var onmessagelength = function(buffer) { var length = buffer.readUInt32BE(0); if (length) return self._parse(length, onmessage); self._parse(4, onmessagelength), self.emit("keep-alive"); }, onmessage = function(buffer) { switch (self._parse(4, onmessagelength), buffer[0]) { case 0: return self._onchoke(); case 1: return self._onunchoke(); case 2: return self._oninterested(); case 3: return self._onuninterested(); case 4: return self._onhave(buffer.readUInt32BE(1)); case 5: return self._onbitfield(buffer.slice(1)); case 6: return self._onrequest(buffer.readUInt32BE(1), buffer.readUInt32BE(5), buffer.readUInt32BE(9)); case 7: return self._onpiece(buffer.readUInt32BE(1), buffer.readUInt32BE(5), buffer.slice(9)); case 8: return self._oncancel(buffer.readUInt32BE(1), buffer.readUInt32BE(5), buffer.readUInt32BE(9)); case 9: return self._onport(buffer.readUInt16BE(1)); case 20: return self._onextended(buffer.readUInt8(1), buffer.slice(2)); } self.emit("unknownmessage", buffer); }; this._buffer = [], this._bufferSize = 0, this._parser = null, this._parserSize = 0, this._parse(1, (function(buffer) { var pstrlen = buffer.readUInt8(0); self._parse(pstrlen + 48, (function(handshake) { handshake = handshake.slice(pstrlen), self._onhandshake(handshake.slice(8, 28), handshake.slice(28, 48), { dht: !!(1 & handshake[7]), extended: !!(16 & handshake[5]) }), self._parse(4, onmessagelength); })); })); }; util.inherits(Wire, Duplex), Wire.prototype.handshake = function(infoHash, peerId, extensions) { if ("string" == typeof infoHash && (infoHash = bufferFrom(infoHash, "hex")), "string" == typeof peerId && (peerId = bufferFrom(peerId)), 20 !== infoHash.length || 20 !== peerId.length) throw new Error("infoHash and peerId MUST have length 20"); var reserved = bufferFrom(MESSAGE_RESERVED); extensions && extensions.dht && (reserved[7] |= 1), reserved[5] |= 16, this._push(Buffer.concat([ MESSAGE_PROTOCOL, reserved, infoHash, peerId ], MESSAGE_PROTOCOL.length + 48)); }, Wire.prototype.choke = function() { if (!this.amChoking) { for (this.amChoking = !0; this.peerRequests.length; ) this.peerRequests.pop(); this._push(MESSAGE_CHOKE); } }, Wire.prototype.unchoke = function() { this.amChoking && (this.amChoking = !1, this._push(MESSAGE_UNCHOKE)); }, Wire.prototype.interested = function() { this.amInterested || (this.amInterested = !0, this._push(MESSAGE_INTERESTED)); }, Wire.prototype.uninterested = function() { this.amInterested && (this.amInterested = !1, this._push(MESSAGE_UNINTERESTED)); }, Wire.prototype.have = function(i) { this._message(4, [ i ], null); }, Wire.prototype.bitfield = function(bitfield) { bitfield.buffer && (bitfield = bitfield.buffer), this._message(5, [], bitfield); }, Wire.prototype.request = function(i, offset, length, callback) { return callback || (callback = noop), this._finished ? callback(new Error("wire is closed")) : this.peerChoking ? callback(new Error("peer is choking")) : (this.requests.push(new Request(i, offset, length, callback)), this._updateTimeout(), void this._message(6, [ i, offset, length ], null)); }, Wire.prototype.piece = function(i, offset, buffer) { this.uploaded += buffer.length, this.uploadSpeed(buffer.length), this.emit("upload", buffer.length), this._message(7, [ i, offset ], buffer); }, Wire.prototype.cancel = function(i, offset, length) { this._callback(pull(this.requests, i, offset, length), new Error("request was cancelled"), null), this._message(8, [ i, offset, length ], null); }, Wire.prototype.extended = function(id, msg) { this._message(20, [], Buffer.concat([ bufferFrom([ id ]), Buffer.isBuffer(msg) ? msg : bncode.encode(msg) ])); }, Wire.prototype.port = function(port) { var message = bufferFrom(MESSAGE_PORT); message.writeUInt16BE(port, 5), this._push(message); }, Wire.prototype.setKeepAlive = function(bool) { clearInterval(this._keepAlive), !1 !== bool && (this._keepAlive = setInterval(this._push.bind(this, MESSAGE_KEEP_ALIVE), 6e4)); }, Wire.prototype.setTimeout = function(ms, fn) { this.requests.length && clearTimeout(this.requests[0].timeout), this._timeout = ms, this._updateTimeout(), fn && this.on("timeout", fn); }, Wire.prototype.destroy = function() { this.emit("close"), this.end(); }, Wire.prototype._onhandshake = function(infoHash, peerId, extensions) { this.peerExtensions = extensions, this.emit("handshake", infoHash, peerId, extensions); }, Wire.prototype._oninterested = function() { this.peerInterested = !0, this.emit("interested"); }, Wire.prototype._onuninterested = function() { this.peerInterested = !1, this.emit("uninterested"); }, Wire.prototype._onchoke = function() { for (this.peerChoking = !0, this.emit("choke"); this.requests.length; ) this._callback(this.requests.shift(), new Error("peer is choking"), null); }, Wire.prototype._onunchoke = function() { this.peerChoking = !1, this.emit("unchoke"); }, Wire.prototype._onbitfield = function(buffer) { for (var pieces = bitfield(buffer), i = 0; i < 8 * buffer.length; i++) this.peerPieces[i] = pieces.get(i); this.emit("bitfield", buffer); }, Wire.prototype._onhave = function(i) { this.peerPieces[i] = !0, this.emit("have", i); }, Wire.prototype._onrequest = function(i, offset, length) { if (!this.amChoking) { var self = this, respond = function(err, buffer) { request === pull(self.peerRequests, i, offset, length) && (err || self.piece(i, offset, buffer)); }, request = new Request(i, offset, length, respond); this.peerRequests.push(request), this.emit("request", i, offset, length, respond); } }, Wire.prototype._oncancel = function(i, offset, length) { pull(this.peerRequests, i, offset, length), this.emit("cancel", i, offset, length); }, Wire.prototype._onpiece = function(i, offset, buffer) { this._callback(pull(this.requests, i, offset, buffer.length), null, buffer), this.downloaded += buffer.length, this.downloadSpeed(buffer.length), this.emit("download", buffer.length), this.emit("piece", i, offset, buffer); }, Wire.prototype._onport = function(port) { this.emit("port", port); }, Wire.prototype._onextended = function(id, ext) { this.emit("extended", id, ext); }, Wire.prototype._callback = function(request, err, buffer) { request && (request.timeout && clearTimeout(request.timeout), this.peerChoking || this._finished || this._updateTimeout(), request.callback(err, buffer)); }, Wire.prototype._updateTimeout = function() { this._timeout && this.requests.length && !this.requests[0].timeout && (this.requests[0].timeout = setTimeout(this._ontimeout, this._timeout)); }, Wire.prototype._message = function(id, numbers, data) { var dataLength = data ? data.length : 0, buffer = bufferAlloc(5 + 4 * numbers.length); buffer.writeUInt32BE(buffer.length + dataLength - 4, 0), buffer[4] = id; for (var i = 0; i < numbers.length; i++) buffer.writeUInt32BE(numbers[i], 5 + 4 * i); this._push(buffer), data && this._push(data); }, Wire.prototype._push = function(data) { this._finished || this.push(data); }, Wire.prototype._parse = function(size, parser) { this._parserSize = size, this._parser = parser; }, Wire.prototype._write = function(data, encoding, callback) { for (this._bufferSize += data.length, this._buffer.push(data); this._bufferSize >= this._parserSize; ) { var buffer = 1 === this._buffer.length ? this._buffer[0] : Buffer.concat(this._buffer, this._bufferSize); this._bufferSize -= this._parserSize, this._buffer = this._bufferSize ? [ buffer.slice(this._parserSize) ] : [], this._parser(buffer.slice(0, this._parserSize)); } callback(); }, Wire.prototype._read = noop, module.exports = Wire; }, function(module, exports, __webpack_require__) { (exports = module.exports = __webpack_require__(417)).Stream = __webpack_require__(3), exports.Readable = exports, exports.Writable = __webpack_require__(418), exports.Duplex = __webpack_require__(84), exports.Transform = __webpack_require__(420), exports.PassThrough = __webpack_require__(827), process.browser || "disable" !== process.env.READABLE_STREAM || (module.exports = __webpack_require__(3)); }, function(module, exports) { module.exports = Array.isArray || function(arr) { return "[object Array]" == Object.prototype.toString.call(arr); }; }, function(module, exports, __webpack_require__) { module.exports = PassThrough; var Transform = __webpack_require__(420), util = __webpack_require__(33); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } util.inherits = __webpack_require__(8), util.inherits(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; }, function(module, exports, __webpack_require__) { var Container = "undefined" != typeof Buffer ? Buffer : "undefined" != typeof Int8Array ? Int8Array : function(l) { for (var a = new Array(l), i = 0; i < l; i++) a[i] = 0; }; function BitField(data) { if (!(this instanceof BitField)) return new BitField(data); "number" == typeof data && (data % 8 != 0 && (data += 8), (data = new Container(data >> 3)).fill && data.fill(0)), this.buffer = data; } BitField.prototype.get = function(i) { return !!(this.buffer[i >> 3] & 128 >> i % 8); }, BitField.prototype.set = function(i, b) { b || 1 === arguments.length ? this.buffer[i >> 3] |= 128 >> i % 8 : this.buffer[i >> 3] &= ~(128 >> i % 8); }, module.exports = BitField; }, function(module, exports) { var I = "i".charCodeAt(0), L = "l".charCodeAt(0), E = "e".charCodeAt(0), D = "d".charCodeAt(0); ":".charCodeAt(0); var BdecodeSMachine = function(cb, cb_list, cb_dict, cb_end) { var depth = 0, state = 0; this.consistent = function() { return 0 === state && 0 === depth; }; var strLen = 0, str = "", _int = 0, neg = !1; strLen = 0, this.parse = function(buffer, encoding) { encoding = encoding || "UTF-8", "string" == typeof buffer && (buffer = new Buffer(buffer, encoding)); for (var pos = 0; pos != buffer.length; ++pos) switch (state) { case 0: switch (buffer[pos]) { case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: state = 1, strLen = 0, strLen += buffer[pos] - 48; break; case I: state = 4, _int = 0, neg = !1; break; case L: state = 0, depth += 1, cb_list(); break; case D: state = 0, depth += 1, cb_dict(); break; case E: if (state = 0, (depth -= 1) < 0) throw new Error("end with no beginning: " + pos); cb_end(); } break; case 1: integer(buffer[pos]) ? (strLen *= 10, strLen += buffer[pos] - 48) : (str = new Buffer(strLen), pos -= 1, state = 3); break; case 3: if (buffer[pos] != ":".charCodeAt(0)) throw new Error("not a colon at:" + pos.toString(16)); state = 2, 0 === strLen && (cb(new Buffer(0)), state = 0); break; case 2: 0 === strLen ? (cb(str), state = 0) : (str[str.length - strLen] = buffer[pos], 0 == (strLen -= 1) && (cb(str), state = 0)); break; case 4: if (state = 5, buffer[pos] == "-".charCodeAt(0)) { neg = !0; break; } case 5: if (integer(buffer[pos])) _int *= 10, _int += buffer[pos] - 48; else { if (buffer[pos] != "e".charCodeAt(0)) throw new Error("not part of int at:" + pos.toString(16)); cb(neg ? 0 - _int : _int), state = 0; } } }; var integer = function(value) { return "number" == typeof value && between(value, 48, 57); }, between = function(val, min, max) { return min <= val && val <= max; }; }, Bdecode = function() { var DICTIONARY_START = {}, LIST_START = {}, ctx = new (function() { var self = this, stack = []; this.cb = function(o) { stack.push(o); }, this.cb_list = function() { self.cb(LIST_START); }, this.cb_dict = function() { self.cb(DICTIONARY_START); }, this.cb_end = function() { for (var obj = null, tmp_stack = []; void 0 !== (obj = stack.pop()); ) { if (LIST_START === obj) { for (var obj2 = null, list = []; void 0 !== (obj2 = tmp_stack.pop()); ) list.push(obj2); self.cb(list); break; } if (DICTIONARY_START === obj) { for (var key = null, val = null, dic = {}; void 0 !== (key = tmp_stack.pop()) && void 0 !== (val = tmp_stack.pop()); ) dic[key.toString()] = val; if (void 0 !== key && void 0 === dic[key]) throw new Error("uneven number of keys and values A"); self.cb(dic); break; } tmp_stack.push(obj); } if (tmp_stack.length > 0) throw new Error("uneven number of keys and values B"); }, this.result = function() { return stack; }; }), smachine = new BdecodeSMachine(ctx.cb, ctx.cb_list, ctx.cb_dict, ctx.cb_end); this.result = function() { if (!smachine.consistent()) throw new Error("not in consistent state. More bytes coming?"); return ctx.result(); }, this.decode = function(buf, encoding) { smachine.parse(buf, encoding); }; }, Bencode = function(obj) { var n, buf; switch (typeof obj) { case "string": return (function(obj) { var blen = Buffer.byteLength(obj), len = blen.toString(10), buf = new Buffer(len.length + 1 + blen); return buf.write(len, 0, "ascii"), buf.write(":", len.length, "ascii"), buf.write(obj, len.length + 1, "utf8"), buf; })(obj); case "number": return n = obj.toString(10), (buf = new Buffer(n.length + 2)).write("i", 0), buf.write(n, 1), buf.write("e", n.length + 1), buf; case "object": return obj instanceof Array ? (function(obj) { return assemble(obj, "l", (function(obj, pos) { return obj.forEach((function(o) { var elem = Bencode(o); ensure(elem.length, pos), elem.copy(buffer, pos, 0), pos += elem.length; })), pos; })); })(obj) : obj instanceof Buffer ? (function(obj) { var len = obj.length.toString(10), buf = new Buffer(len.length + 1 + obj.length); return buf.write(len, 0, "ascii"), buf.write(":", len.length, "ascii"), obj.copy(buf, len.length + 1, 0), buf; })(obj) : (function(obj) { return assemble(obj, "d", (function(obj, pos) { for (var p in obj) { var key = Bencode(p), val = Bencode(obj[p]); ensure(key.length + val.length, pos), key.copy(buffer, pos, 0), pos += key.length, val.copy(buffer, pos, 0), pos += val.length; } return pos; })); })(obj); } var buffer = null; function assemble(obj, prefix, func) { var pos = 0; return ensure(1024, 0), buffer.write(prefix, pos++), ensure(1, pos = func(obj, pos)), buffer.write("e", pos++), buffer.slice(0, pos); } function ensure(num, pos) { if (buffer) { if (buffer.length > num + pos + 1) return; var buf2 = new Buffer(buffer.length + num); buffer.copy(buf2, 0, 0), buffer = buf2; } else buffer = new Buffer(num); } }; exports.encode = Bencode, exports.decoder = Bdecode, exports.decode = function(buffer, encoding) { var decoder = new Bdecode; return decoder.decode(buffer, encoding), decoder.result()[0]; }; }, function(module, exports) { var hasFullSupport = (function() { try { if (!Buffer.isEncoding("latin1")) return !1; var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4); return buf.fill("ab", "ucs2"), "61006200" === buf.toString("hex"); } catch (_) { return !1; } })(); function fillWithNumber(buffer, val, start, end) { if (start < 0 || end > buffer.length) throw new RangeError("Out of range index"); return start >>>= 0, (end = void 0 === end ? buffer.length : end >>> 0) > start && buffer.fill(val, start, end), buffer; } module.exports = function(buffer, val, start, end, encoding) { if (hasFullSupport) return buffer.fill(val, start, end, encoding); if ("number" == typeof val) return fillWithNumber(buffer, val, start, end); if ("string" == typeof val) { if ("string" == typeof start ? (encoding = start, start = 0, end = buffer.length) : "string" == typeof end && (encoding = end, end = buffer.length), void 0 !== encoding && "string" != typeof encoding) throw new TypeError("encoding must be a string"); if ("latin1" === encoding && (encoding = "binary"), "string" == typeof encoding && !Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding); if ("" === val) return fillWithNumber(buffer, 0, start, end); if ((function(val) { return 1 === val.length && val.charCodeAt(0) < 256; })(val)) return fillWithNumber(buffer, val.charCodeAt(0), start, end); val = new Buffer(val, encoding); } return Buffer.isBuffer(val) ? (function(buffer, val, start, end) { if (start < 0 || end > buffer.length) throw new RangeError("Out of range index"); if (end <= start) return buffer; start >>>= 0, end = void 0 === end ? buffer.length : end >>> 0; for (var pos = start, len = val.length; pos <= end - len; ) val.copy(buffer, pos), pos += len; return pos !== end && val.copy(buffer, pos, 0, end - pos), buffer; })(buffer, val, start, end) : fillWithNumber(buffer, 0, start, end); }; }, function(module, exports) { module.exports = function(size) { if ("number" != typeof size) throw new TypeError('"size" argument must be a number'); if (size < 0) throw new RangeError('"size" argument must not be negative'); return Buffer.allocUnsafe ? Buffer.allocUnsafe(size) : new Buffer(size); }; }, function(module, exports, __webpack_require__) { var persistTimeout, fs = __webpack_require__(2), Container = "undefined" != typeof Buffer ? Buffer : "undefined" != typeof Int8Array ? Int8Array : function(l) { for (var a = new Array(l), i = 0; i < l; i++) a[i] = 0; }; function BitField(data, persist) { if (!(this instanceof BitField)) return new BitField(data, persist); if (this.persist = persist, persist) try { return void (this.buffer = fs.readFileSync(persist)); } catch (e) {} "number" == typeof data && (data % 8 != 0 && (data += 8), (data = new Container(data >> 3)).fill && data.fill(0)), this.buffer = data; } BitField.prototype.get = function(i) { return !!(this.buffer[i >> 3] & 128 >> i % 8); }, BitField.prototype.set = function(i, b) { b || 1 === arguments.length ? this.buffer[i >> 3] |= 128 >> i % 8 : this.buffer[i >> 3] &= ~(128 >> i % 8); var self = this; this.persist && (persistTimeout && clearTimeout(persistTimeout), persistTimeout = setTimeout((function() { self.persistState(); }), 100)); }, BitField.prototype.persistState = function() { fs.writeFile(this.persist, this.buffer, (function(err) { err && console.error(err); })); }, module.exports = BitField; }, function(module, exports, __webpack_require__) { module.exports = rimraf, rimraf.sync = rimrafSync; var assert = __webpack_require__(25), path = __webpack_require__(5), fs = __webpack_require__(2), glob = void 0; try { glob = __webpack_require__(196); } catch (_err) {} var _0666 = parseInt("666", 8), defaultGlobOpts = { nosort: !0, silent: !0 }, timeout = 0, isWindows = "win32" === process.platform; function defaults(options) { if ([ "unlink", "chmod", "stat", "lstat", "rmdir", "readdir" ].forEach((function(m) { options[m] = options[m] || fs[m], options[m += "Sync"] = options[m] || fs[m]; })), options.maxBusyTries = options.maxBusyTries || 3, options.emfileWait = options.emfileWait || 1e3, !1 === options.glob && (options.disableGlob = !0), !0 !== options.disableGlob && void 0 === glob) throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); options.disableGlob = options.disableGlob || !1, options.glob = options.glob || defaultGlobOpts; } function rimraf(p, options, cb) { "function" == typeof options && (cb = options, options = {}), assert(p, "rimraf: missing path"), assert.equal(typeof p, "string", "rimraf: path should be a string"), assert.equal(typeof cb, "function", "rimraf: callback function required"), assert(options, "rimraf: invalid options argument provided"), assert.equal(typeof options, "object", "rimraf: options should be object"), defaults(options); var busyTries = 0, errState = null, n = 0; if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [ p ]); function afterGlob(er, results) { return er ? cb(er) : 0 === (n = results.length) ? cb() : void results.forEach((function(p) { rimraf_(p, options, (function CB(er) { if (er) { if (("EBUSY" === er.code || "ENOTEMPTY" === er.code || "EPERM" === er.code) && busyTries < options.maxBusyTries) return busyTries++, setTimeout((function() { rimraf_(p, options, CB); }), 100 * busyTries); if ("EMFILE" === er.code && timeout < options.emfileWait) return setTimeout((function() { rimraf_(p, options, CB); }), timeout++); "ENOENT" === er.code && (er = null); } timeout = 0, (function(er) { errState = errState || er, 0 == --n && cb(errState); })(er); })); })); } options.lstat(p, (function(er, stat) { if (!er) return afterGlob(null, [ p ]); glob(p, options.glob, afterGlob); })); } function rimraf_(p, options, cb) { assert(p), assert(options), assert("function" == typeof cb), options.lstat(p, (function(er, st) { return er && "ENOENT" === er.code ? cb(null) : (er && "EPERM" === er.code && isWindows && fixWinEPERM(p, options, er, cb), st && st.isDirectory() ? rmdir(p, options, er, cb) : void options.unlink(p, (function(er) { if (er) { if ("ENOENT" === er.code) return cb(null); if ("EPERM" === er.code) return isWindows ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb); if ("EISDIR" === er.code) return rmdir(p, options, er, cb); } return cb(er); }))); })); } function fixWinEPERM(p, options, er, cb) { assert(p), assert(options), assert("function" == typeof cb), er && assert(er instanceof Error), options.chmod(p, _0666, (function(er2) { er2 ? cb("ENOENT" === er2.code ? null : er) : options.stat(p, (function(er3, stats) { er3 ? cb("ENOENT" === er3.code ? null : er) : stats.isDirectory() ? rmdir(p, options, er, cb) : options.unlink(p, cb); })); })); } function fixWinEPERMSync(p, options, er) { assert(p), assert(options), er && assert(er instanceof Error); try { options.chmodSync(p, _0666); } catch (er2) { if ("ENOENT" === er2.code) return; throw er; } try { var stats = options.statSync(p); } catch (er3) { if ("ENOENT" === er3.code) return; throw er; } stats.isDirectory() ? rmdirSync(p, options, er) : options.unlinkSync(p); } function rmdir(p, options, originalEr, cb) { assert(p), assert(options), originalEr && assert(originalEr instanceof Error), assert("function" == typeof cb), options.rmdir(p, (function(er) { !er || "ENOTEMPTY" !== er.code && "EEXIST" !== er.code && "EPERM" !== er.code ? er && "ENOTDIR" === er.code ? cb(originalEr) : cb(er) : (function(p, options, cb) { assert(p), assert(options), assert("function" == typeof cb), options.readdir(p, (function(er, files) { if (er) return cb(er); var errState, n = files.length; if (0 === n) return options.rmdir(p, cb); files.forEach((function(f) { rimraf(path.join(p, f), options, (function(er) { if (!errState) return er ? cb(errState = er) : void (0 == --n && options.rmdir(p, cb)); })); })); })); })(p, options, cb); })); } function rimrafSync(p, options) { var results; if (defaults(options = options || {}), assert(p, "rimraf: missing path"), assert.equal(typeof p, "string", "rimraf: path should be a string"), assert(options, "rimraf: missing options"), assert.equal(typeof options, "object", "rimraf: options should be object"), options.disableGlob || !glob.hasMagic(p)) results = [ p ]; else try { options.lstatSync(p), results = [ p ]; } catch (er) { results = glob.sync(p, options.glob); } if (results.length) for (var i = 0; i < results.length; i++) { p = results[i]; try { var st = options.lstatSync(p); } catch (er) { if ("ENOENT" === er.code) return; "EPERM" === er.code && isWindows && fixWinEPERMSync(p, options, er); } try { st && st.isDirectory() ? rmdirSync(p, options, null) : options.unlinkSync(p); } catch (er) { if ("ENOENT" === er.code) return; if ("EPERM" === er.code) return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er); if ("EISDIR" !== er.code) throw er; rmdirSync(p, options, er); } } } function rmdirSync(p, options, originalEr) { assert(p), assert(options), originalEr && assert(originalEr instanceof Error); try { options.rmdirSync(p); } catch (er) { if ("ENOENT" === er.code) return; if ("ENOTDIR" === er.code) throw originalEr; "ENOTEMPTY" !== er.code && "EEXIST" !== er.code && "EPERM" !== er.code || (function(p, options) { assert(p), assert(options), options.readdirSync(p).forEach((function(f) { rimrafSync(path.join(p, f), options); })); for (var retries = isWindows ? 100 : 1, i = 0; ;) { var threw = !0; try { var ret = options.rmdirSync(p, options); return threw = !1, ret; } finally { if (++i < retries && threw) continue; } } })(p, options); } } }, function(module, exports, __webpack_require__) { var pathModule = __webpack_require__(5), isWindows = "win32" === process.platform, fs = __webpack_require__(2), DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); if (pathModule.normalize, isWindows) var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; else nextPartRe = /(.*?)(?:[\/]+|$)/g; if (isWindows) var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; else splitRootRe = /^[\/]*/; exports.realpathSync = function(p, cache) { if (p = pathModule.resolve(p), cache && Object.prototype.hasOwnProperty.call(cache, p)) return cache[p]; var pos, current, base, previous, original = p, seenLinks = {}, knownHard = {}; function start() { var m = splitRootRe.exec(p); pos = m[0].length, current = m[0], base = m[0], previous = "", isWindows && !knownHard[base] && (fs.lstatSync(base), knownHard[base] = !0); } for (start(); pos < p.length; ) { nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); if (previous = current, current += result[0], base = previous + result[1], pos = nextPartRe.lastIndex, !(knownHard[base] || cache && cache[base] === base)) { var resolvedLink; if (cache && Object.prototype.hasOwnProperty.call(cache, base)) resolvedLink = cache[base]; else { var stat = fs.lstatSync(base); if (!stat.isSymbolicLink()) { knownHard[base] = !0, cache && (cache[base] = base); continue; } var linkTarget = null; if (!isWindows) { var id = stat.dev.toString(32) + ":" + stat.ino.toString(32); seenLinks.hasOwnProperty(id) && (linkTarget = seenLinks[id]); } null === linkTarget && (fs.statSync(base), linkTarget = fs.readlinkSync(base)), resolvedLink = pathModule.resolve(previous, linkTarget), cache && (cache[base] = resolvedLink), isWindows || (seenLinks[id] = linkTarget); } p = pathModule.resolve(resolvedLink, p.slice(pos)), start(); } } return cache && (cache[original] = p), p; }, exports.realpath = function(p, cache, cb) { if ("function" != typeof cb && (cb = (function(cb) { return "function" == typeof cb ? cb : (function() { var callback; if (DEBUG) { var backtrace = new Error; callback = function(err) { err && (backtrace.message = err.message, missingCallback(err = backtrace)); }; } else callback = missingCallback; return callback; function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; if (!process.noDeprecation) { var msg = "fs: missing callback " + (err.stack || err.message); process.traceDeprecation ? console.trace(msg) : console.error(msg); } } } })(); })(cache), cache = null), p = pathModule.resolve(p), cache && Object.prototype.hasOwnProperty.call(cache, p)) return process.nextTick(cb.bind(null, null, cache[p])); var pos, current, base, previous, original = p, seenLinks = {}, knownHard = {}; function start() { var m = splitRootRe.exec(p); pos = m[0].length, current = m[0], base = m[0], previous = "", isWindows && !knownHard[base] ? fs.lstat(base, (function(err) { if (err) return cb(err); knownHard[base] = !0, LOOP(); })) : process.nextTick(LOOP); } function LOOP() { if (pos >= p.length) return cache && (cache[original] = p), cb(null, p); nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); return previous = current, current += result[0], base = previous + result[1], pos = nextPartRe.lastIndex, knownHard[base] || cache && cache[base] === base ? process.nextTick(LOOP) : cache && Object.prototype.hasOwnProperty.call(cache, base) ? gotResolvedLink(cache[base]) : fs.lstat(base, gotStat); } function gotStat(err, stat) { if (err) return cb(err); if (!stat.isSymbolicLink()) return knownHard[base] = !0, cache && (cache[base] = base), process.nextTick(LOOP); if (!isWindows) { var id = stat.dev.toString(32) + ":" + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) return gotTarget(null, seenLinks[id], base); } fs.stat(base, (function(err) { if (err) return cb(err); fs.readlink(base, (function(err, target) { isWindows || (seenLinks[id] = target), gotTarget(err, target); })); })); } function gotTarget(err, target, base) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); cache && (cache[base] = resolvedLink), gotResolvedLink(resolvedLink); } function gotResolvedLink(resolvedLink) { p = pathModule.resolve(resolvedLink, p.slice(pos)), start(); } start(); }; }, function(module, exports, __webpack_require__) { var concatMap = __webpack_require__(836), balanced = __webpack_require__(837); module.exports = function(str) { return str ? ("{}" === str.substr(0, 2) && (str = "\\{\\}" + str.substr(2)), expand((function(str) { return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); })(str), !0).map(unescapeBraces)) : []; }; var escSlash = "\0SLASH" + Math.random() + "\0", escOpen = "\0OPEN" + Math.random() + "\0", escClose = "\0CLOSE" + Math.random() + "\0", escComma = "\0COMMA" + Math.random() + "\0", escPeriod = "\0PERIOD" + Math.random() + "\0"; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function unescapeBraces(str) { return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } function parseCommaParts(str) { if (!str) return [ "" ]; var parts = [], m = balanced("{", "}", str); if (!m) return str.split(","); var pre = m.pre, body = m.body, post = m.post, p = pre.split(","); p[p.length - 1] += "{" + body + "}"; var postParts = parseCommaParts(post); return post.length && (p[p.length - 1] += postParts.shift(), p.push.apply(p, postParts)), parts.push.apply(parts, p), parts; } function embrace(str) { return "{" + str + "}"; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand(str, isTop) { var expansions = [], m = balanced("{", "}", str); if (!m || /\$$/.test(m.pre)) return [ str ]; var n, isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), isSequence = isNumericSequence || isAlphaSequence, isOptions = m.body.indexOf(",") >= 0; if (!isSequence && !isOptions) return m.post.match(/,.*\}/) ? expand(str = m.pre + "{" + m.body + escClose + m.post) : [ str ]; if (isSequence) n = m.body.split(/\.\./); else if (1 === (n = parseCommaParts(m.body)).length && 1 === (n = expand(n[0], !1).map(embrace)).length) return (post = m.post.length ? expand(m.post, !1) : [ "" ]).map((function(p) { return m.pre + n[0] + p; })); var N, pre = m.pre, post = m.post.length ? expand(m.post, !1) : [ "" ]; if (isSequence) { var x = numeric(n[0]), y = numeric(n[1]), width = Math.max(n[0].length, n[1].length), incr = 3 == n.length ? Math.abs(numeric(n[2])) : 1, test = lte; y < x && (incr *= -1, test = gte); var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) "\\" === (c = String.fromCharCode(i)) && (c = ""); else if (c = String(i), pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join("0"); c = i < 0 ? "-" + z + c.slice(1) : z + c; } } N.push(c); } } else N = concatMap(n, (function(el) { return expand(el, !1); })); for (var j = 0; j < N.length; j++) for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; (!isTop || isSequence || expansion) && expansions.push(expansion); } return expansions; } }, function(module, exports) { module.exports = function(xs, fn) { for (var res = [], i = 0; i < xs.length; i++) { var x = fn(xs[i], i); isArray(x) ? res.push.apply(res, x) : res.push(x); } return res; }; var isArray = Array.isArray || function(xs) { return "[object Array]" === Object.prototype.toString.call(xs); }; }, function(module, exports, __webpack_require__) { "use strict"; function balanced(a, b, str) { a instanceof RegExp && (a = maybeMatch(a, str)), b instanceof RegExp && (b = maybeMatch(b, str)); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } function range(a, b, str) { var begs, beg, left, right, result, ai = str.indexOf(a), bi = str.indexOf(b, ai + 1), i = ai; if (ai >= 0 && bi > 0) { if (a === b) return [ ai, bi ]; for (begs = [], left = str.length; i >= 0 && !result; ) i == ai ? (begs.push(i), ai = str.indexOf(a, i + 1)) : 1 == begs.length ? result = [ begs.pop(), bi ] : ((beg = begs.pop()) < left && (left = beg, right = bi), bi = str.indexOf(b, i + 1)), i = ai < bi && ai >= 0 ? ai : bi; begs.length && (result = [ left, right ]); } return result; } module.exports = balanced, balanced.range = range; }, function(module, exports, __webpack_require__) { module.exports = globSync, globSync.GlobSync = GlobSync; var rp = __webpack_require__(423), minimatch = __webpack_require__(197), path = (minimatch.Minimatch, __webpack_require__(196).Glob, __webpack_require__(0), __webpack_require__(5)), assert = __webpack_require__(25), isAbsolute = __webpack_require__(198), common = __webpack_require__(424), setopts = common.setopts, ownProp = common.ownProp, childrenIgnored = common.childrenIgnored, isIgnored = common.isIgnored; function globSync(pattern, options) { if ("function" == typeof options || 3 === arguments.length) throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); return new GlobSync(pattern, options).found; } function GlobSync(pattern, options) { if (!pattern) throw new Error("must provide pattern"); if ("function" == typeof options || 3 === arguments.length) throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); if (!(this instanceof GlobSync)) return new GlobSync(pattern, options); if (setopts(this, pattern, options), this.noprocess) return this; var n = this.minimatch.set.length; this.matches = new Array(n); for (var i = 0; i < n; i++) this._process(this.minimatch.set[i], i, !1); this._finish(); } GlobSync.prototype._finish = function() { if (assert(this instanceof GlobSync), this.realpath) { var self = this; this.matches.forEach((function(matchset, index) { var set = self.matches[index] = Object.create(null); for (var p in matchset) try { p = self._makeAbs(p), set[rp.realpathSync(p, self.realpathCache)] = !0; } catch (er) { if ("stat" !== er.syscall) throw er; set[self._makeAbs(p)] = !0; } })); } common.finish(this); }, GlobSync.prototype._process = function(pattern, index, inGlobStar) { assert(this instanceof GlobSync); for (var prefix, n = 0; "string" == typeof pattern[n]; ) n++; switch (n) { case pattern.length: return void this._processSimple(pattern.join("/"), index); case 0: prefix = null; break; default: prefix = pattern.slice(0, n).join("/"); } var read, remain = pattern.slice(n); null === prefix ? read = "." : isAbsolute(prefix) || isAbsolute(pattern.join("/")) ? (prefix && isAbsolute(prefix) || (prefix = "/" + prefix), read = prefix) : read = prefix; var abs = this._makeAbs(read); childrenIgnored(this, read) || (remain[0] === minimatch.GLOBSTAR ? this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) : this._processReaddir(prefix, read, abs, remain, index, inGlobStar)); }, GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar); if (entries) { for (var pn = remain[0], negate = !!this.minimatch.negate, rawGlob = pn._glob, dotOk = this.dot || "." === rawGlob.charAt(0), matchedEntries = [], i = 0; i < entries.length; i++) ("." !== (e = entries[i]).charAt(0) || dotOk) && (negate && !prefix ? !e.match(pn) : e.match(pn)) && matchedEntries.push(e); var len = matchedEntries.length; if (0 !== len) if (1 !== remain.length || this.mark || this.stat) for (remain.shift(), i = 0; i < len; i++) { var newPattern; e = matchedEntries[i], newPattern = prefix ? [ prefix, e ] : [ e ], this._process(newPattern.concat(remain), index, inGlobStar); } else { this.matches[index] || (this.matches[index] = Object.create(null)); for (i = 0; i < len; i++) { var e = matchedEntries[i]; prefix && (e = "/" !== prefix.slice(-1) ? prefix + "/" + e : prefix + e), "/" !== e.charAt(0) || this.nomount || (e = path.join(this.root, e)), this._emitMatch(index, e); } } } }, GlobSync.prototype._emitMatch = function(index, e) { if (!isIgnored(this, e)) { var abs = this._makeAbs(e); if (this.mark && (e = this._mark(e)), this.absolute && (e = abs), !this.matches[index][e]) { if (this.nodir) { var c = this.cache[abs]; if ("DIR" === c || Array.isArray(c)) return; } this.matches[index][e] = !0, this.stat && this._stat(e); } } }, GlobSync.prototype._readdirInGlobStar = function(abs) { if (this.follow) return this._readdir(abs, !1); var entries, lstat; try { lstat = this.fs.lstatSync(abs); } catch (er) { if ("ENOENT" === er.code) return null; } var isSym = lstat && lstat.isSymbolicLink(); return this.symlinks[abs] = isSym, isSym || !lstat || lstat.isDirectory() ? entries = this._readdir(abs, !1) : this.cache[abs] = "FILE", entries; }, GlobSync.prototype._readdir = function(abs, inGlobStar) { if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs); if (ownProp(this.cache, abs)) { var c = this.cache[abs]; if (!c || "FILE" === c) return null; if (Array.isArray(c)) return c; } try { return this._readdirEntries(abs, this.fs.readdirSync(abs)); } catch (er) { return this._readdirError(abs, er), null; } }, GlobSync.prototype._readdirEntries = function(abs, entries) { if (!this.mark && !this.stat) for (var i = 0; i < entries.length; i++) { var e = entries[i]; e = "/" === abs ? abs + e : abs + "/" + e, this.cache[e] = !0; } return this.cache[abs] = entries, entries; }, GlobSync.prototype._readdirError = function(f, er) { switch (er.code) { case "ENOTSUP": case "ENOTDIR": var abs = this._makeAbs(f); if (this.cache[abs] = "FILE", abs === this.cwdAbs) { var error = new Error(er.code + " invalid cwd " + this.cwd); throw error.path = this.cwd, error.code = er.code, error; } break; case "ENOENT": case "ELOOP": case "ENAMETOOLONG": case "UNKNOWN": this.cache[this._makeAbs(f)] = !1; break; default: if (this.cache[this._makeAbs(f)] = !1, this.strict) throw er; this.silent || console.error("glob error", er); } }, GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar); if (entries) { var remainWithoutGlobStar = remain.slice(1), gspref = prefix ? [ prefix ] : [], noGlobStar = gspref.concat(remainWithoutGlobStar); this._process(noGlobStar, index, !1); var len = entries.length; if (!this.symlinks[abs] || !inGlobStar) for (var i = 0; i < len; i++) if ("." !== entries[i].charAt(0) || this.dot) { var instead = gspref.concat(entries[i], remainWithoutGlobStar); this._process(instead, index, !0); var below = gspref.concat(entries[i], remain); this._process(below, index, !0); } } }, GlobSync.prototype._processSimple = function(prefix, index) { var exists = this._stat(prefix); if (this.matches[index] || (this.matches[index] = Object.create(null)), exists) { if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix); "/" === prefix.charAt(0) ? prefix = path.join(this.root, prefix) : (prefix = path.resolve(this.root, prefix), trail && (prefix += "/")); } "win32" === process.platform && (prefix = prefix.replace(/\\/g, "/")), this._emitMatch(index, prefix); } }, GlobSync.prototype._stat = function(f) { var abs = this._makeAbs(f), needDir = "/" === f.slice(-1); if (f.length > this.maxLength) return !1; if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs]; if (Array.isArray(c) && (c = "DIR"), !needDir || "DIR" === c) return c; if (needDir && "FILE" === c) return !1; } var stat = this.statCache[abs]; if (!stat) { var lstat; try { lstat = this.fs.lstatSync(abs); } catch (er) { if (er && ("ENOENT" === er.code || "ENOTDIR" === er.code)) return this.statCache[abs] = !1, !1; } if (lstat && lstat.isSymbolicLink()) try { stat = this.fs.statSync(abs); } catch (er) { stat = lstat; } else stat = lstat; } return this.statCache[abs] = stat, c = !0, stat && (c = stat.isDirectory() ? "DIR" : "FILE"), this.cache[abs] = this.cache[abs] || c, (!needDir || "FILE" !== c) && c; }, GlobSync.prototype._mark = function(p) { return common.mark(this, p); }, GlobSync.prototype._makeAbs = function(f) { return common.makeAbs(this, f); }; }, function(module, exports, __webpack_require__) { var wrappy = __webpack_require__(288), reqs = Object.create(null), once = __webpack_require__(35); function slice(args) { for (var length = args.length, array = [], i = 0; i < length; i++) array[i] = args[i]; return array; } module.exports = wrappy((function(key, cb) { return reqs[key] ? (reqs[key].push(cb), null) : (reqs[key] = [ cb ], (function(key) { return once((function RES() { var cbs = reqs[key], len = cbs.length, args = slice(arguments); try { for (var i = 0; i < len; i++) cbs[i].apply(null, args); } finally { cbs.length > len ? (cbs.splice(0, len), process.nextTick((function() { RES.apply(null, args); }))) : delete reqs[key]; } })); })(key)); })); }, function(module, exports, __webpack_require__) { var ip = exports, Buffer = __webpack_require__(10).Buffer, os = __webpack_require__(23); function _normalizeFamily(family) { return family ? family.toLowerCase() : "ipv4"; } ip.toBuffer = function(ip, buff, offset) { var result; if (offset = ~~offset, /^(\d{1,3}\.){3,3}\d{1,3}$/.test(ip)) result = buff || new Buffer(offset + 4), ip.split(/\./g).map((function(byte) { result[offset++] = 255 & parseInt(byte, 10); })); else { if (!/^[a-f0-9:]+$/.test(ip)) throw Error("Invalid ip address: " + ip); var s = ip.split(/::/g, 2), head = (s[0] || "").split(/:/g, 8), tail = (s[1] || "").split(/:/g, 8); if (0 === tail.length) for (;head.length < 8; ) head.push("0000"); else if (0 === head.length) for (;tail.length < 8; ) tail.unshift("0000"); else for (;head.length + tail.length < 8; ) head.push("0000"); result = buff || new Buffer(offset + 16), head.concat(tail).map((function(word) { word = parseInt(word, 16), result[offset++] = word >> 8 & 255, result[offset++] = 255 & word; })); } return result; }, ip.toString = function(buff, offset, length) { offset = ~~offset; var result = []; if (4 === (length = length || buff.length - offset)) { for (var i = 0; i < length; i++) result.push(buff[offset + i]); result = result.join("."); } else if (16 === length) { for (i = 0; i < length; i += 2) result.push(buff.readUInt16BE(offset + i).toString(16)); result = (result = (result = result.join(":")).replace(/(^|:)0(:0)*:0(:|$)/, "$1::$3")).replace(/:{3,4}/, "::"); } return result; }, ip.fromPrefixLen = function(prefixlen, family) { var len = 4; "ipv6" === (family = prefixlen > 32 ? "ipv6" : _normalizeFamily(family)) && (len = 16); for (var buff = new Buffer(len), i = 0, n = buff.length; i < n; ++i) { var bits = 8; prefixlen < 8 && (bits = prefixlen), prefixlen -= bits, buff[i] = ~(255 >> bits); } return ip.toString(buff); }, ip.mask = function(addr, mask) { addr = ip.toBuffer(addr), mask = ip.toBuffer(mask); var result = new Buffer(Math.max(addr.length, mask.length)); if (addr.length === mask.length) for (var i = 0; i < addr.length; i++) result[i] = addr[i] & mask[i]; else if (4 === mask.length) for (i = 0; i < mask.length; i++) result[i] = addr[addr.length - 4 + i] & mask[i]; else { for (i = 0; i < result.length - 6; i++) result[i] = 0; for (result[10] = 255, result[11] = 255, i = 0; i < addr.length; i++) result[i + 12] = addr[i] & mask[i + 12]; } return ip.toString(result); }, ip.cidr = function(cidrString) { var cidrParts = cidrString.split("/"); if (2 != cidrParts.length) throw new Error("invalid CIDR subnet: " + addr); var addr = cidrParts[0], mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.mask(addr, mask); }, ip.subnet = function(addr, mask) { for (var networkAddress = ip.toLong(ip.mask(addr, mask)), maskBuffer = ip.toBuffer(mask), maskLength = 0, i = 0; i < maskBuffer.length; i++) if (255 == maskBuffer[i]) maskLength += 8; else for (var octet = 255 & maskBuffer[i]; octet; ) octet = octet << 1 & 255, maskLength++; var numberOfAddresses = Math.pow(2, 32 - maskLength); return { networkAddress: ip.fromLong(networkAddress), firstAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress) : ip.fromLong(networkAddress + 1), lastAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress + numberOfAddresses - 1) : ip.fromLong(networkAddress + numberOfAddresses - 2), broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), subnetMask: mask, subnetMaskLength: maskLength, numHosts: numberOfAddresses <= 2 ? numberOfAddresses : numberOfAddresses - 2, length: numberOfAddresses }; }, ip.cidrSubnet = function(cidrString) { var cidrParts = cidrString.split("/"); if (2 !== cidrParts.length) throw new Error("invalid CIDR subnet: " + addr); var addr = cidrParts[0], mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.subnet(addr, mask); }, ip.not = function(addr) { for (var buff = ip.toBuffer(addr), i = 0; i < buff.length; i++) buff[i] = 255 ^ buff[i]; return ip.toString(buff); }, ip.or = function(a, b) { if (a = ip.toBuffer(a), b = ip.toBuffer(b), a.length == b.length) { for (var i = 0; i < a.length; ++i) a[i] |= b[i]; return ip.toString(a); } var buff = a, other = b; b.length > a.length && (buff = b, other = a); var offset = buff.length - other.length; for (i = offset; i < buff.length; ++i) buff[i] |= other[i - offset]; return ip.toString(buff); }, ip.isEqual = function(a, b) { if (a = ip.toBuffer(a), b = ip.toBuffer(b), a.length === b.length) { for (var i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1; return !0; } if (4 === b.length) { var t = b; b = a, a = t; } for (i = 0; i < 10; i++) if (0 !== b[i]) return !1; var word = b.readUInt16BE(10); if (0 !== word && 65535 !== word) return !1; for (i = 0; i < 4; i++) if (a[i] !== b[i + 12]) return !1; return !0; }, ip.isPrivate = function(addr) { return null != addr.match(/^10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/) || null != addr.match(/^192\.168\.([0-9]{1,3})\.([0-9]{1,3})/) || null != addr.match(/^172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})/) || null != addr.match(/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/) || null != addr.match(/^169\.254\.([0-9]{1,3})\.([0-9]{1,3})/) || null != addr.match(/^fc00:/) || null != addr.match(/^fe80:/) || null != addr.match(/^::1$/) || null != addr.match(/^::$/); }, ip.isPublic = function(addr) { return !ip.isPrivate(addr); }, ip.isLoopback = function(addr) { return /^127\.0\.0\.1$/.test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }, ip.loopback = function(family) { if ("ipv4" !== (family = _normalizeFamily(family)) && "ipv6" !== family) throw new Error("family must be ipv4 or ipv6"); return "ipv4" === family ? "127.0.0.1" : "fe80::1"; }, ip.address = function(name, family) { var all, interfaces = os.networkInterfaces(); return family = _normalizeFamily(family), name && !~[ "public", "private" ].indexOf(name) ? interfaces[name].filter((function(details) { return details.family = details.family.toLowerCase(), details.family === family; }))[0].address : (all = Object.keys(interfaces).map((function(nic) { var addresses = interfaces[nic].filter((function(details) { return details.family = details.family.toLowerCase(), details.family === family && !ip.isLoopback(details.address) && (!name || ("public" === name ? !ip.isPrivate(details.address) : ip.isPrivate(details.address))); })); return addresses.length ? addresses[0].address : void 0; })).filter(Boolean)).length ? all[0] : ip.loopback(family); }, ip.toLong = function(ip) { var ipl = 0; return ip.split(".").forEach((function(octet) { ipl <<= 8, ipl += parseInt(octet); })), ipl >>> 0; }, ip.fromLong = function(ipl) { return (ipl >>> 24) + "." + (ipl >> 16 & 255) + "." + (ipl >> 8 & 255) + "." + (255 & ipl); }; }, function(module, exports, __webpack_require__) { var events = __webpack_require__(4), Bagpipe = function(limit, options) { for (var key in events.EventEmitter.call(this), this.limit = limit, this.active = 0, this.paused = !1, this.queue = [], this.options = { disabled: !1, refuse: !1, ratio: 1, timeout: null }, "boolean" == typeof options && (options = { disabled: options }), options = options || {}, this.options) options.hasOwnProperty(key) && (this.options[key] = options[key]); this.queueLength = Math.round(this.limit * (this.options.ratio || 1)); }; __webpack_require__(842)(Bagpipe, events.EventEmitter); var addToQueue = function(unshift) { return function(method) { var args = [].slice.call(arguments, 1), callback = args[args.length - 1]; if ("function" != typeof callback && args.push((function() {})), this.options.disabled || this.limit < 1) return method.apply(null, args), this; if (this.queue.length < this.queueLength || !this.options.refuse) this.queue[unshift ? "unshift" : "push"]({ method: method, args: args }); else { var err = new Error("Too much async call in queue"); err.name = "TooMuchAsyncCallError", callback(err); } return this.queue.length > 1 && this.emit("full", this.queue.length), this.next(), this; }; }; Bagpipe.prototype.push = addToQueue(0), Bagpipe.prototype.unshift = addToQueue(1), Bagpipe.prototype.pause = function() { this.paused = !0; }, Bagpipe.prototype.resume = function() { this.paused = !1, this.next(); }, Bagpipe.prototype.next = function() { if (!this.paused && this.active < this.limit && this.queue.length) { var req = this.queue.shift(); this.run(req.method, req.args); } }, Bagpipe.prototype._next = function() { this.active--, this.next(); }, Bagpipe.prototype.run = function(method, args) { var that = this; that.active++; var callback = args[args.length - 1], timer = null, called = !1; args[args.length - 1] = function(err) { timer && (clearTimeout(timer), timer = null), called ? err && that.emit("outdated", err) : (that._next(), callback.apply(null, arguments)); }; var timeout = that.options.timeout; timeout && (timer = setTimeout((function() { called = !0, that._next(); var err = new Error(timeout + "ms timeout"); err.name = "BagpipeTimeoutError", err.data = { name: method.name, method: method.toString(), args: args.slice(0, -1) }, callback(err); }), timeout)), setTimeout((function() { method.apply(null, args); }), 0); }, module.exports = Bagpipe; }, function(module, exports) { "function" == typeof Object.create ? module.exports = function(ctor, superCtor) { ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: !1, writable: !0, configurable: !0 } }); } : module.exports = function(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function() {}; TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor; }; }, function(module, exports, __webpack_require__) { var ip = __webpack_require__(127); function IPSet(start, end) { this.start = start, this.end = end, this.max = end, this.depth = 1, this.left = null, this.right = null; } IPSet.prototype.add = function(start, end) { var d = start - this.start, update = !1; return 0 === d && this.end < end ? (this.end = end, update = !0) : d < 0 ? this.left ? (update = this.left.add(start, end)) && this._balance() : (this.left = new IPSet(start, end), update = !0) : d > 0 && (this.right ? (update = this.right.add(start, end)) && this._balance() : (this.right = new IPSet(start, end), update = !0)), update && this._update(), update; }, IPSet.prototype.contains = function(addr) { for (var node = this; node && !(addr >= node.start && addr <= node.end); ) node = node.left && node.left.max >= addr ? node.left : node.right; return !!node; }, IPSet.prototype._balance = function() { var ldepth = this.left ? this.left.depth : 0, rdepth = this.right ? this.right.depth : 0; if (ldepth > rdepth + 1) (this.left.left ? this.left.left.depth : 0) < (this.left.right ? this.left.right.depth : 0) && this.left._rotateRR(), this._rotateLL(); else if (ldepth + 1 < rdepth) { var rrdepth = this.right.right ? this.right.right.depth : 0; (this.right.left ? this.right.left.depth : 0) > rrdepth && this.right._rotateLL(), this._rotateRR(); } }, IPSet.prototype._rotateLL = function() { var _start = this.start, _end = this.end, _right = this.right; this.start = this.left.start, this.end = this.left.end, this.right = this.left, this.left = this.left.left, this.right.left = this.right.right, this.right.right = _right, this.right.start = _start, this.right.end = _end, this.right._update(), this._update(); }, IPSet.prototype._rotateRR = function() { var _start = this.start, _end = this.end, _left = this.left; this.start = this.right.start, this.end = this.right.end, this.end = this.right.end, this.left = this.right, this.right = this.right.right, this.left.right = this.left.left, this.left.left = _left, this.left.start = _start, this.left.end = _end, this.left._update(), this._update(); }, IPSet.prototype._update = function() { this.depth = 1, this.left && (this.depth = this.left.depth + 1), this.right && this.depth <= this.right.depth && (this.depth = this.right.depth + 1), this.max = Math.max(this.end, this.left ? this.left.max : 0, this.right ? this.right.max : 0); }, module.exports = function(blocklist) { var tree = null, self = { add: function(start, end) { if (start) { if ("object" == typeof start && (end = start.end, start = start.start), "string" == typeof start && /\/\d{1,2}/.test(start)) { var ipSubnet = ip.cidrSubnet(start); start = ipSubnet.networkAddress, end = ipSubnet.broadcastAddress; } if ("number" != typeof start && (start = ip.toLong(start)), end || (end = start), "number" != typeof end && (end = ip.toLong(end)), start < 0 || end > 4294967295 || end < start) throw new Error("Invalid block range"); tree ? tree.add(start, end) : tree = new IPSet(start, end); } }, contains: function(addr) { return !!tree && ("number" != typeof addr && (addr = ip.toLong(addr)), tree.contains(addr)); } }; return Array.isArray(blocklist) && blocklist.forEach((function(block) { self.add(block); })), self; }; }, function(module, exports, __webpack_require__) { var bncode = __webpack_require__(195), crypto = __webpack_require__(6), sha1 = function(buf) { return crypto.createHash("sha1").update(buf).digest("hex"); }; module.exports = function(torrent) { var encoded = !1; if (torrent.info && (encoded = bncode.encode(torrent.info), sha1(encoded) === torrent.infoHash)) return encoded; var info = {}; return info.name = torrent.name || "", torrent.private && (info.private = 1), info.files = torrent.files.map((function(file) { return { length: file.length, path: (0 === file.path.indexOf(info.name) ? file.path.slice(info.name.length) : file.path).slice(1).split(/\\|\//) }; })), info["piece length"] = torrent.pieceLength, info.pieces = Buffer.concat(torrent.pieces.map((function(buf) { return Buffer.from(buf, "hex"); }))), encoded = bncode.encode(info), sha1(encoded) === torrent.infoHash ? encoded : torrent.files.length ? (delete info.files, info.length = torrent.files[0].length, encoded = bncode.encode(info), sha1(encoded) === torrent.infoHash ? encoded : null) : null; }; }, function(module, exports, __webpack_require__) { var bncode = __webpack_require__(195), crypto = __webpack_require__(6), EXTENSIONS_m_ut_metadata = 1; module.exports = function(engine, callback) { var metadataPieces = []; return function(wire) { var metadata = engine.metadata; wire.once("extended", (function(id, handshake) { if (handshake = bncode.decode(handshake), !id && handshake.m && void 0 !== handshake.m.ut_metadata) { var channel = handshake.m.ut_metadata, size = handshake.metadata_size; if (wire.on("extended", (function(id, ext) { if (id === EXTENSIONS_m_ut_metadata) { var delimiter, message, piece, metadata = engine.metadata; try { delimiter = ext.toString("ascii").indexOf("ee"), piece = (message = bncode.decode(ext.slice(0, -1 === delimiter ? ext.length : delimiter + 2))).piece; } catch (err) { return; } if (!(piece < 0) && 2 !== message.msg_type) if (0 !== message.msg_type) { if (1 === message.msg_type && !metadata) { metadataPieces[piece] = ext.slice(delimiter + 2); for (var i = 0; 16384 * i < size; i++) if (!metadataPieces[i]) return; if (metadata = Buffer.concat(metadataPieces), engine.infoHash !== (data = metadata, crypto.createHash("sha1").update(data).digest("hex"))) return metadataPieces = [], void (metadata = null); callback(engine.metadata = metadata); } var data; } else { if (!metadata) return wire.extended(channel, { msg_type: 2, piece: piece }); var offset = 16384 * piece, buf = metadata.slice(offset, offset + 16384); wire.extended(channel, Buffer.concat([ bncode.encode({ msg_type: 1, piece: piece }), buf ])); } } })), !(size > 4194304) && size && !metadata) for (var i = 0; 16384 * i < size; i++) metadataPieces[i] || wire.extended(channel, { msg_type: 0, piece: i }); } })), wire.peerExtensions.extended && wire.extended(0, metadata ? { m: { ut_metadata: 1 }, metadata_size: metadata.length } : { m: { ut_metadata: 1 } }); }; }; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2), path = __webpack_require__(5), async = __webpack_require__(40), bagpipe = (path = __webpack_require__(5), __webpack_require__(200)), crypto = __webpack_require__(6), _ = __webpack_require__(199), debug = __webpack_require__(9)("p2p-stream-storage"), noop = function() {}; module.exports = function(dir, torrent, opts, engine) { var that = {}; opts = _.extend({ storageMemoryCache: !1 }, opts); var files = torrent.files.map((function(file, index) { var fd, destPath = path.join(dir, index + ""), openFile = function() { dests[index] && destPath != dests[index] && (fd && fs.close(fd), fd = null, destPath = dests[index]), fd = fd || fs.openSync(destPath, fs.existsSync(destPath) ? "r+" : "w+"); }; return { byteStart: file.offset, byteEnd: file.offset + file.length, read: function(offset, len, cb) { if (!fd && !fs.existsSync(destPath)) return cb(new Error("File does not exist: " + destPath)); openFile(), fs.read(fd, Buffer.alloc(len), 0, len, offset, (function(err, _, buf) { cb(err, buf); })); }, write: function(buf, bufOffset, bufLen, offset, cb) { if (openFile(), bufOffset + bufLen > buf.length) return cb(new Error("bufOffset+bufLen > buf.length: " + bufOffset + " " + bufLen + " / " + buf.length)); fs.write(fd, buf, bufOffset, bufLen, offset, cb); }, close: function(cb) { if (void 0 === fd) return process.nextTick(cb); fs.close(fd, cb), fd = null; } }; })), writequeue = that.writequeue = new bagpipe(1), pieceLength = torrent.pieceLength, lastFile = torrent.files[torrent.files.length - 1]; that.read = function(index, cb) { if (debug("read %s", index), memHas(index)) return cb(null, memGet(index)); var len = pieceLength; index == torrent.pieces.length - 1 && (len = Math.min(len, (lastFile.length + lastFile.offset) % pieceLength)); var byteStart = index * pieceLength, byteEnd = byteStart + len, result = null; async.each(files, (function(dest, innerCb) { var start = Math.max(byteStart, dest.byteStart), end = Math.min(byteEnd, dest.byteEnd); if (start >= end) return innerCb(); var readStart = Math.max(0, byteStart - dest.byteStart), readLen = end - start; if (0 == readLen) return innerCb(); dest.read(readStart, readLen, (function(err, buf) { if (buf) { if (buf.length === len && 1 === files.length) return result = buf, innerCb(); result || (result = Buffer.alloc(len)), buf.copy(result, Math.max(0, dest.byteStart - byteStart)); } innerCb(err); })); }), (function(err) { cb(err, result); })); }, that.write = function(index, buffer) { var i, buf; debug("write %s", index), buf = buffer, debug("memSet %s", i = index), memBumpLru(i) || lru.push(i), mem[i] = buf, lru.forEach((function(idx, i) { opts.storageMemoryCache && lru.length > opts.storageMemoryCache / pieceLength && !isNaN(idx) && mem[idx] && mem[idx].free && (mem[idx] = null, lru.splice(i, 1), debug("lru clean %s", idx)); })); }, that.commit = function(start, end, cb) { debug("commit %s %s", start, end), cb || (cb = noop); for (var pieces = [], i = start; i <= end; i++) pieces.push(i); async.each(pieces, (function(i) { var byteStart = i * pieceLength, byteEnd = byteStart + pieceLength; async.each(files, (function(dest, innerCb) { var start = Math.max(byteStart, dest.byteStart), end = Math.min(byteEnd, dest.byteEnd); if (start >= end) return innerCb(); writequeue.push(dest.write, memGet(i), Math.max(start - byteStart, 0), Math.min(end - start, pieceLength), Math.max(0, byteStart - dest.byteStart), innerCb); }), (function(err) { if (err) return cb(err); !(function(i) { debug("free memory %s", i), opts.storageMemoryCache ? mem[i] && (mem[i].free = !0) : mem[i] = null; })(i), cb(); })); }), cb); }, that.verify = function(index, map) { debug("verify %s", index); for (var ratio = torrent.verificationLen ? torrent.verificationLen / torrent.pieceLength : 1, real = Math.floor(index / ratio), start = real * ratio, end = Math.min(torrent.pieces.length, (real + 1) * ratio), i = start; i != end; i++) if (!memHas(i) || !engine.bitfield.get(i)) return null; var hash = crypto.createHash("sha1"); for (i = start; i != end; i++) hash.update(memGet(i)); return { success: hash.digest("hex") === map[real], start: start, end: end }; }, that.close = function(cb) { cb || (cb = noop), writequeue.push((function(cb) { async.eachSeries(files, (function(file, next) { file.close(next); }), cb); }), cb); }; var dests = []; that.setDest = function(i, path) { dests[i] = path; }, that.getDest = function(i) { return dests[i] || path.join(dir, i + ""); }, that.memoryBufSize = function() { var len = 0; return mem.forEach((function(x) { x && (len += torrent.pieceLength); })), len; }; var mem = [], lru = []; function memBumpLru(i) { var idx = lru.indexOf(i); if (idx > -1) return lru.splice(idx, 1), lru.push(i), !0; } function memHas(i) { return !!mem[i]; } function memGet(i) { return debug("memGet %s", i), memBumpLru(i), mem[i]; } return that; }; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2), path = __webpack_require__(5), mkdirp = __webpack_require__(142), crypto = __webpack_require__(6), _ = __webpack_require__(199), debug = __webpack_require__(9)("p2p-stream-storage-circular"), noop = function() {}, SANTINEL_BUFFER_FS = new Buffer("fs"); module.exports = function(dir, torrent, opts, engine) { var that = {}, piecesFolder = path.join(dir, "pieces"); function piecePath(idx) { return path.join(piecesFolder, idx + ""); } if ("memory" != (opts = _.extend({ type: "memory", size: 31457280 }, opts)).type && "fs" != opts.type) throw "storage-circular: only memory and fs type supported"; function writePieceToFS(p) { fs.writeFile(piecePath(p.idx), p.buf, (function(err) { err ? debug(err) : (debug("wrote %s piece to fs", p.idx), p.buf = SANTINEL_BUFFER_FS); })); } "fs" == opts.type && (fs.existsSync(piecesFolder) || mkdirp.sync(piecesFolder)), torrent.pieceLength, that.read = function(index, cb) { debug("read %s", index); var p = find(index); p ? (p.atime = new Date, p.buf === SANTINEL_BUFFER_FS ? fs.readFile(piecePath(p.idx), cb) : cb(null, p.buf)) : cb(new Error("piece not found in circular buf")); }, that.write = function(index, buffer) { if (pieces.length) { debug("write %s", index); var idx, oldest, p = find(index) || pieces.find((function(p) { return !p.buf; })); if (!p) { if (oldest = null, pieces.forEach((function(p) { p.buf && p.committed && (isPieceSelected(p.idx) || (function(p) { return engine.lockedPieces.indexOf(p) > -1; })(p.idx) || (!oldest || oldest.atime.getTime() > p.atime.getTime()) && (oldest = p)); })), !(p = oldest)) throw "circular buf is full, unable to free; unfreeable pieces: " + pieces.filter((function(p) { return !p.committed || isPieceSelected(p.idx); })).map((function(p) { return p.idx + (p.committed ? "" : "uc"); })).join(", "); debug("free %s", p.idx), p.buf === SANTINEL_BUFFER_FS && (idx = p.idx, fs.unlink(piecePath(idx), (function(err) { if (err) return debug("could not remove %s piece from fs", idx), void debug(err); debug("remove %s piece from fs", idx); }))), engine.resetPiece(p.idx); } p.buf = buffer, p.idx = index, p.atime = new Date; } }, that.commit = function(start, end, cb) { debug("commit %s %s", start, end), cb || (cb = noop); for (var i = start; i <= end; i++) { var p = find(i); p && (p.committed = !0, "fs" == opts.type && writePieceToFS(p)); } cb(null, !0); }, that.verify = function(index, map) { debug("verify %s", index); for (var ratio = torrent.verificationLen ? torrent.verificationLen / torrent.pieceLength : 1, real = Math.floor(index / ratio), start = real * ratio, end = Math.min(torrent.pieces.length, (real + 1) * ratio), hash = crypto.createHash("sha1"), i = start; i != end; i++) { if (!engine.bitfield.get(i)) return null; var p = find(i); if (!p) return null; hash.update(p.buf); } return { success: hash.digest("hex") === map[real], start: start, end: end }; }, that.close = function(cb) { cb || (cb = noop), pieces = [], cb(); }; for (var pieces = [], i = 0; i != Math.floor(opts.size / torrent.pieceLength); i++) pieces.push(new Piece); function Piece() { this.idx = void 0, this.buf = void 0, this.committed = new Date(0), this.atime = void 0; } function find(idx) { return pieces.find((function(p) { return p.idx === idx; })); } function isPieceSelected(p) { for (var i = 0; i < engine.selection.length; i++) { var sel = engine.selection[i]; if (sel.hasOwnProperty("selectTo") && p >= sel.readFrom && p <= sel.selectTo) return !0; } return !1; } return debug("%s pieces created", pieces.length), that; }; }, function(module, exports, __webpack_require__) { var stream = __webpack_require__(849), util = __webpack_require__(0), bagpipe = __webpack_require__(200), debug = __webpack_require__(9)("p2p-file-stream"), FileStream = function(engine, file, opts) { if (!(this instanceof FileStream)) return new FileStream(engine, file, opts); stream.Readable.call(this), opts || (opts = {}), opts.start || (opts.start = 0), opts.end || "number" == typeof opts.end || (opts.end = file.length - 1); var offset = opts.start + file.offset, pieceLength = engine.torrent.pieceLength; this.length = opts.end - opts.start + 1, this.startPiece = offset / pieceLength | 0, this.endPiece = (opts.end + file.offset) / pieceLength | 0, this.bufferPieces = engine.buffer ? engine.buffer / pieceLength | 0 : null, this._destroyed = !1, this._engine = engine, this._piece = this.startPiece, this._missing = this.length, this._critical = 0 | Math.min(1048576 / pieceLength, 4), this._readpipe = new bagpipe(2), this._offset = offset - this.startPiece * pieceLength, this.selection = engine.select(this.startPiece, this.endPiece, !opts.hasOwnProperty("priority") || opts.priority, this.notify.bind(this)), this.bufferPieces && (this.selection.selectTo = Math.min(this.endPiece, this._piece + this.bufferPieces), this.selection.readFrom = this._piece), debug("open file stream with selection %s:%s ", +this.startPiece, this.endPiece); }; util.inherits(FileStream, stream.Readable), FileStream.prototype.notify = function() { this.emit("notify"); }, FileStream.prototype._read = function() { var self = this; if (debug("read piece " + this._piece), this._missing) { if (!this._engine.bitfield.get(this._piece)) return debug("WAIT for piece " + this._piece), !this._engine.selection.some((function(sel) { return self._piece <= sel.to && sel.from + sel.offset <= self._piece; })) && (debug("Piece %s has no selection", this._piece), this._engine.select(this._piece, this.selection.to, !0, this.notify.bind(this))), this.once("notify", self._read), this._engine.critical(this._piece, this._critical), void this._engine.refresh(); var pieceToGet = this._piece; this._engine.lockedPieces.push(pieceToGet), this._readpipe.push(this._engine.store.read, this._piece++, (function(err, buffer) { var idx = self._engine.lockedPieces.indexOf(pieceToGet); if (self._engine.lockedPieces.splice(idx, 1), err && self._engine.emit("error", err), !self._destroyed && buffer) { if (err) return self.destroy(err); if (self._offset && (buffer = buffer.slice(self._offset), self._offset = 0), self._missing < buffer.length && (buffer = buffer.slice(0, self._missing)), self._missing -= buffer.length, !self._missing) return self.push(buffer), void self.push(null); self.push(buffer); } })), this.bufferPieces && (this.selection.selectTo = Math.min(this.endPiece, this._piece + this.bufferPieces), this.selection.readFrom = this._piece, this._engine.refresh(), debug("bufferPieces select from %s to %s", this._piece, this.selection.selectTo)); } }, FileStream.prototype.destroy = function() { debug("destroy filestream readFrom:%s selectTo:%s", this.selection.readFrom, this.selection.selectTo), this._destroyed || (this._destroyed = !0, this.emit("close")); }, module.exports = FileStream; }, function(module, exports, __webpack_require__) { var Stream = __webpack_require__(3); "disable" === process.env.READABLE_STREAM && Stream ? (module.exports = Stream, (exports = module.exports = Stream.Readable).Readable = Stream.Readable, exports.Writable = Stream.Writable, exports.Duplex = Stream.Duplex, exports.Transform = Stream.Transform, exports.PassThrough = Stream.PassThrough, exports.Stream = Stream) : ((exports = module.exports = __webpack_require__(425)).Stream = Stream || exports, exports.Readable = exports, exports.Writable = __webpack_require__(429), exports.Duplex = __webpack_require__(85), exports.Transform = __webpack_require__(431), exports.PassThrough = __webpack_require__(852)); }, function(module, exports) { "function" == typeof Object.create ? module.exports = function(ctor, superCtor) { superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: !1, writable: !0, configurable: !0 } })); } : module.exports = function(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; var TempCtor = function() {}; TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor; } }; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(26).Buffer, util = __webpack_require__(0); module.exports = (function() { function BufferList() { !(function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); })(this, BufferList), this.head = null, this.tail = null, this.length = 0; } return BufferList.prototype.push = function(v) { var entry = { data: v, next: null }; this.length > 0 ? this.tail.next = entry : this.head = entry, this.tail = entry, ++this.length; }, BufferList.prototype.unshift = function(v) { var entry = { data: v, next: this.head }; 0 === this.length && (this.tail = entry), this.head = entry, ++this.length; }, BufferList.prototype.shift = function() { if (0 !== this.length) { var ret = this.head.data; return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, ret; } }, BufferList.prototype.clear = function() { this.head = this.tail = null, this.length = 0; }, BufferList.prototype.join = function(s) { if (0 === this.length) return ""; for (var p = this.head, ret = "" + p.data; p = p.next; ) ret += s + p.data; return ret; }, BufferList.prototype.concat = function(n) { if (0 === this.length) return Buffer.alloc(0); if (1 === this.length) return this.head.data; for (var target, offset, ret = Buffer.allocUnsafe(n >>> 0), p = this.head, i = 0; p; ) target = ret, offset = i, p.data.copy(target, offset), i += p.data.length, p = p.next; return ret; }, BufferList; })(), util && util.inspect && util.inspect.custom && (module.exports.prototype[util.inspect.custom] = function() { var obj = util.inspect({ length: this.length }); return this.constructor.name + " " + obj; }); }, function(module, exports, __webpack_require__) { "use strict"; module.exports = PassThrough; var Transform = __webpack_require__(431), util = Object.create(__webpack_require__(33)); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } util.inherits = __webpack_require__(106), util.inherits(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; }, function(module, exports) { var PieceBuffer = function(length) { if (!(this instanceof PieceBuffer)) return new PieceBuffer(length); this.parts = Math.ceil(length / 16384), this.remainder = length % 16384 || 16384, this.length = length, this.missing = length, this.buffered = 0, this.buffer = null, this.cancellations = null, this.reservations = 0, this.flushed = !1; }; PieceBuffer.BLOCK_SIZE = 16384, PieceBuffer.prototype.size = function(i) { return i === this.parts - 1 ? this.remainder : 16384; }, PieceBuffer.prototype.offset = function(i) { return 16384 * i; }, PieceBuffer.prototype.reserve = function() { return this.init() ? this.cancellations.length ? this.cancellations.pop() : this.reservations < this.parts ? this.reservations++ : -1 : -1; }, PieceBuffer.prototype.cancel = function(i) { this.init() && this.cancellations.push(i); }, PieceBuffer.prototype.get = function(i) { return this.init() ? this.buffer[i] : null; }, PieceBuffer.prototype.set = function(i, data) { return !!this.init() && (this.buffer[i] || (this.buffered++, this.buffer[i] = data, this.missing -= data.length), this.buffered === this.parts); }, PieceBuffer.prototype.flush = function() { if (!this.buffer || this.parts !== this.buffered) return null; var buffer = Buffer.concat(this.buffer, this.length); return this.buffer = null, this.cancellations = null, this.flushed = !0, buffer; }, PieceBuffer.prototype.init = function() { return !this.flushed && (this.buffer || (this.buffer = new Array(this.parts), this.cancellations = []), !0); }, module.exports = PieceBuffer; }, function(module, exports, __webpack_require__) { const HLSRouter = __webpack_require__(855); module.exports = HLSRouter; }, function(module, exports, __webpack_require__) { const Router = __webpack_require__(122), userSettings = __webpack_require__(105), {probeMedia: probeMedia, Converter: Converter} = __webpack_require__(856), retrieveMediaSamples = __webpack_require__(440), ERROR_CODE = { CREATE_CONVERTER_FAILED: 1, READ_PLAYLIST_FAILED: 10, READ_INIT_SEGMENT_FAILED: 20, READ_MEDIA_SEGMENT_FAILED: 30, BURN_SUBTITLES_FAILED: 40, PROBE_MEDIA_FAILED: 100, GET_STATUS_FAILED: 200 }; module.exports = function(options = {}) { const router = new Router, converters = new Map; return setInterval((() => { for (const [id, {converter: converter, touched: touched}] of converters.entries()) touched.getTime() < Date.now() - 12e4 && (console.log(`hls-converter ${id} is inactive, destroying it`), converter.destroy(), converters.delete(id), console.log(`hls-converter ${id} destoyed`)); }), 12e4), router.param("id", (async (req, res, next) => { if (!converters.has(req.params.id)) try { const maxAudioChannels = parseInt(req.query.maxAudioChannels, 10), converter = new Converter({ ffmpeg: options.ffmpeg, ffprobe: options.ffprobe, id: req.params.id, mediaURL: req.query.mediaURL, maxAudioChannels: !isNaN(maxAudioChannels) && isFinite(maxAudioChannels) ? maxAudioChannels : null, forceTranscoding: !!req.query.forceTranscoding, profile: req.query.profile || null, maxWidth: req.query.maxWidth || null, videoCodecs: Array.isArray(req.query.videoCodecs) ? req.query.videoCodecs : "string" == typeof req.query.videoCodecs ? [ req.query.videoCodecs ] : null, audioCodecs: Array.isArray(req.query.audioCodecs) ? req.query.audioCodecs : "string" == typeof req.query.audioCodecs ? [ req.query.audioCodecs ] : null }); Array.from(converters.entries()).sort((([_, {touched: touchedA}], [__, {touched: touchedB}]) => touchedB - touchedA)).slice(userSettings.transcodeConcurrency - 1).forEach((([id, {converter: converter}]) => { console.log(`hls-converter ${id} will be destroyed due to passing concurrency of ${userSettings.transcodeConcurrency}`), converter.destroy(), converters.delete(id); })), converters.set(req.params.id, { converter: converter, touched: new Date }); } catch (error) { return console.error(error), res.statusCode = 500, res.setHeader("content-type", "application/json"), void res.end(JSON.stringify({ error: { code: ERROR_CODE.CREATE_CONVERTER_FAILED, message: `Failed to create hls converter: ${error.message}` } })); } const {converter: converter, touched: touched} = converters.get(req.params.id); touched.setTime(Date.now()), req.converter = converter, next(); })), router.get("/:id/:track.m3u8", (async (req, res) => { let playlist; try { playlist = await req.converter.playlist(req.params.track); } catch (error) { return console.error(error), res.statusCode = 500, res.setHeader("content-type", "application/json"), void res.end(JSON.stringify({ error: { code: ERROR_CODE.READ_PLAYLIST_FAILED, message: `Failed to read hls playlist: ${error.message}` } })); } res.setHeader("content-type", "application/vnd.apple.mpegurl"), res.setHeader("content-length", Buffer.byteLength(playlist)), res.end(playlist); })), router.get("/:id/:track/init.mp4", (async (req, res, next) => { if (!req.params.track.match(/^(?:video|audio).+$/)) return void next(); let initSegment; try { initSegment = await req.converter.initSegment(req.params.track); } catch (error) { return console.error(error), res.statusCode = 500, res.setHeader("content-type", "application/json"), void res.end(JSON.stringify({ error: { code: ERROR_CODE.READ_INIT_SEGMENT_FAILED, message: `Failed to read init segment: ${error.message}` } })); } res.setHeader("content-type", "video/mp4"), res.setHeader("content-length", initSegment.length), res.end(initSegment); })), router.get("/:id/:track/segment:sequenceNumber.:ext", (async (req, res, next) => { if (req.params.track.match(/^(?:video|audio).+$/) && "m4s" !== req.params.ext || req.params.track.match(/^subtitle.+$/) && "vtt" !== req.params.ext) return void next(); const sequenceNumber = parseInt(req.params.sequenceNumber, 10); let mediaSegment; try { mediaSegment = await req.converter.mediaSegment(req.params.track, sequenceNumber); } catch (error) { return console.error(error), res.statusCode = 500, res.setHeader("content-type", "application/json"), void res.end(JSON.stringify({ error: { code: ERROR_CODE.READ_MEDIA_SEGMENT_FAILED, message: `Failed to read media segment: ${error.message}` } })); } res.setHeader("content-type", "m4s" === req.params.ext ? "video/mp4" : "text/vtt"), res.setHeader("content-length", mediaSegment.length), res.end(mediaSegment); })), router.get("/:id/burn", (async (req, res) => { try { await req.converter.burnSubtitles({ url: req.query.url, id: req.query.id }); } catch (error) { console.error(error), res.statusCode = 500, res.setHeader("content-type", "application/json"), res.end(JSON.stringify({ error: { code: ERROR_CODE.BURN_SUBTITLES_FAILED, message: `Failed to burn subtitles: ${error.message}` } })); } res.end(); })), router.get("/probe", (async (req, res) => { let result; try { const {format: format, streams: streams} = await probeMedia({ ffprobe: options.ffprobe, mediaURL: req.query.mediaURL }); let samples = {}; req.query.samples && (format.name.includes("mp4") ? samples = await retrieveMediaSamples.mp4(req.query.mediaURL) : format.name.includes("matroska") && (samples = await retrieveMediaSamples.matroska(req.query.mediaURL))), result = { format: format, streams: streams, samples: samples }; } catch (error) { return console.error(error), res.statusCode = 500, res.setHeader("content-type", "application/json"), void res.end(JSON.stringify({ error: { code: ERROR_CODE.PROBE_FAILED, message: `Failed to probe media: ${error.message}` } })); } res.setHeader("content-type", "application/json"), res.end(JSON.stringify(result)); })), router.get("/status", (async (_, res) => { const result = {}; try { for (const [id, {converter: converter, touched: touched}] of converters.entries()) result[id] = { status: await converter.status(), touched: touched }; } catch (error) { return console.error(error), res.statusCode = 500, res.setHeader("content-type", "application/json"), void res.end(JSON.stringify({ error: { code: ERROR_CODE.GET_STATUS_FAILED, message: `Failed to get status: ${error.message}` } })); } res.setHeader("content-type", "application/json"), res.end(JSON.stringify(result)); })), router.get("/:id/destroy", (async (req, res) => { console.log(`hls-converter ${req.params.id} has been requested to be destroyed`); const {converter: converter} = converters.get(req.params.id); converter.destroy(), console.log(`hls-converter ${req.params.id} destoyed`), res.end(); })), router; }; }, function(module, exports, __webpack_require__) { const probeMedia = __webpack_require__(432), Converter = __webpack_require__(867); module.exports = { probeMedia: probeMedia, Converter: Converter }; }, function(module, exports, __webpack_require__) { const {spawn: spawn} = __webpack_require__(32), fs = __webpack_require__(2), path = __webpack_require__(5), kill = __webpack_require__(434), http = __webpack_require__(11), EventEmitter = __webpack_require__(4), portfinder = __webpack_require__(858), bridge = __webpack_require__(194), mode = __webpack_require__(436); let port = 11910; module.exports = class { constructor(options, forcedMode) { this.events = new EventEmitter, this.id = Math.random().toString(), this.convertProcess = null, this.request = null, this.stream = null, this.polling = null, this.exitCode = null, this.signalCode = null, port += 10, this.port = port, this.mode = mode || forcedMode; const ffmpeg = options.ffmpeg; this.create = async () => { const args = options.args; if (process.env.HLS_DEBUG && console.log(`HLSV2:convert:${options.track}:args`, args.join(" ")), "remote" === this.mode) { try { this.port = await portfinder.getPortPromise({ port: this.port }); } catch (e) { process.env.HLS_DEBUG && console.log("HLSV2:warning", `Could not find open port, using ${this.port}`); } process.env.HLS_DEBUG && console.log(`HLSV2:remote:create ffmpeg process with port ${this.port}`); const url = `http://127.0.0.1:${this.port}/${Date.now()}.mp4`; return args.push("-listen", "1", url), new Promise(((resolve, reject) => { const self = this; bridge.on("ffmpeg:result", (function onResult(result) { result.id === self.id && (bridge.off("ffmpeg:result", onResult), self.exitCode = result.error ? 1 : 0, self.events.emit("exit"), result.error && (reject(new Error(result.error)), self.destroy())); })), bridge.dispatch("ffmpeg", { id: self.id, debug: !!process.env.HLS_DEBUG, args: args }); const poll = () => { const req = http.request(url, (res => { this.polling = !1, this.request = req, process.env.HLS_DEBUG && res.on("error", (err => { console.log(`HLSV2:convert:${options.track}:stderr`, err.message); })), this.stream = res, this.stream.pause(), options.flowingMode || this.stream.on("resume", this.stream.pause), resolve(this); })); req.on("error", (err => { this.request ? process.env.HLS_DEBUG && console.error(err) : (process.env.HLS_DEBUG && console.log("HLSV2:polling-http:500ms", err.message), this.polling = setTimeout(poll, 500)); })), req.end(); }; this.polling = setTimeout(poll, 500); })); } if ("local" === this.mode) { const debugDir = process.env.HLS_DEBUG_DIR || path.resolve("./"), stderr = process.env.HLS_DEBUG && "android" !== process.platform ? fs.openSync(path.join(debugDir, `ffmpeg_${options.track}_${encodeURIComponent(new URL(options.mediaURL).pathname)}.log`), "a") : "ignore"; return args.push("pipe:1"), this.convertProcess = spawn(ffmpeg, args, { detached: !0, stdio: [ "ignore", "pipe", stderr ] }), this.stream = this.convertProcess.stdout, this.stream.pause(), options.flowingMode || this.stream.on("resume", this.stream.pause), this.convertProcess.on("exit", (() => { this.exitCode = this.convertProcess.exitCode, this.signalCode = this.convertProcess.signalCode, this.events.emit("exit"); })), this; } }, this.destroy = () => { "remote" === this.mode ? (process.env.HLS_DEBUG && console.log(`HLSV2:remote:destroy ffmpeg process with port ${this.port}`), this.polling && clearTimeout(this.polling), this.request && this.request.destroy(), this.stream && this.stream.destroy(), bridge.dispatch("ffmpeg:cancel", { id: this.id, debug: !!process.env.HLS_DEBUG })) : "local" === this.mode && kill(this.convertProcess.pid, "SIGKILL"); }; } }; }, function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(2), os = __webpack_require__(23), net = __webpack_require__(39), path = __webpack_require__(5), _async = __webpack_require__(859), debug = __webpack_require__(860), mkdirp = __webpack_require__(142).mkdirp, debugTestPort = debug("portfinder:testPort"), debugGetPort = debug("portfinder:getPort"), debugDefaultHosts = debug("portfinder:defaultHosts"), internals = { testPort: function(options, callback) { function onListen() { debugTestPort("done w/ testPort(): OK", options.host, "port", options.port), options.server.removeListener("error", onError), options.server.close(), callback(null, options.port); } function onError(err) { if (debugTestPort("done w/ testPort(): failed", options.host, "w/ port", options.port, "with error", err.code), options.server.removeListener("listening", onListen), "EADDRINUSE" != err.code && "EACCES" != err.code) return callback(err); var nextPort = exports.nextPort(options.port); if (nextPort > exports.highestPort) return callback(new Error("No open ports available")); internals.testPort({ port: nextPort, host: options.host, server: options.server }, callback); } callback || (callback = options, options = {}), options.server = options.server || net.createServer((function() {})), debugTestPort("entered testPort(): trying", options.host, "port", options.port), options.server.once("error", onError), options.server.once("listening", onListen), options.host ? options.server.listen(options.port, options.host) : options.server.listen(options.port); } }; exports.basePort = 8e3, exports.setBasePort = function(port) { exports.basePort = port; }, exports.highestPort = 65535, exports.setHighestPort = function(port) { exports.highestPort = port; }, exports.basePath = "/tmp/portfinder", exports.getPort = function(options, callback) { if (callback || (callback = options, options = {}), options.port = Number(options.port) || Number(exports.basePort), options.host = options.host || null, options.stopPort = Number(options.stopPort) || Number(exports.highestPort), !options.startPort) { if (options.startPort = Number(options.port), options.startPort < 0) throw Error("Provided options.startPort(" + options.startPort + ") is less than 0, which are cannot be bound."); if (options.stopPort < options.startPort) throw Error("Provided options.stopPort(" + options.stopPort + "is less than options.startPort (" + options.startPort + ")"); } options.host && -1 !== exports._defaultHosts.indexOf(options.host) && exports._defaultHosts.push(options.host); var currentHost, openPorts = []; return _async.eachSeries(exports._defaultHosts, (function(host, next) { return debugGetPort("in eachSeries() iteration callback: host is", host), internals.testPort({ host: host, port: options.port }, (function(err, port) { return err ? (debugGetPort("in eachSeries() iteration callback testPort() callback", "with an err:", err.code), currentHost = host, next(err)) : (debugGetPort("in eachSeries() iteration callback testPort() callback", "with a success for port", port), openPorts.push(port), next()); })); }), (function(err) { if (err) { if (debugGetPort("in eachSeries() result callback: err is", err), "EADDRNOTAVAIL" === err.code || "EINVAL" === err.code) { if (options.host === currentHost) { var msg = "Provided host " + options.host + " could NOT be bound. Please provide a different host address or hostname"; return callback(Error(msg)); } var idx = exports._defaultHosts.indexOf(currentHost); return exports._defaultHosts.splice(idx, 1), exports.getPort(options, callback); } return callback(err); } return openPorts.sort((function(a, b) { return a - b; })), debugGetPort("in eachSeries() result callback: openPorts is", openPorts), openPorts[0] === openPorts[openPorts.length - 1] ? openPorts[0] <= options.stopPort ? callback(null, openPorts[0]) : (msg = "No open ports found in between " + options.startPort + " and " + options.stopPort, callback(Error(msg))) : exports.getPort({ port: openPorts.pop(), host: options.host, startPort: options.startPort, stopPort: options.stopPort }, callback); })); }, exports.getPortPromise = function(options) { if ("function" != typeof Promise) throw Error("Native promise support is not available in this version of node.Please install a polyfill and assign Promise to global.Promise before calling this method"); return options || (options = {}), new Promise((function(resolve, reject) { exports.getPort(options, (function(err, port) { if (err) return reject(err); resolve(port); })); })); }, exports.getPorts = function(count, options, callback) { callback || (callback = options, options = {}); var lastPort = null; _async.timesSeries(count, (function(index, asyncCallback) { lastPort && (options.port = exports.nextPort(lastPort)), exports.getPort(options, (function(err, port) { err ? asyncCallback(err) : (lastPort = port, asyncCallback(null, port)); })); }), callback); }, exports.getSocket = function(options, callback) { function testSocket() { fs.stat(options.path, (function(err) { err ? "ENOENT" == err.code ? callback(null, options.path) : callback(err) : (options.path = exports.nextSocket(options.path), exports.getSocket(options, callback)); })); } return callback || (callback = options, options = {}), options.mod = options.mod || parseInt(755, 8), options.path = options.path || exports.basePath + ".sock", options.exists ? testSocket() : (dir = path.dirname(options.path), void fs.stat(dir, (function(err, stats) { if (err || !stats.isDirectory()) return (function(dir) { mkdirp(dir, options.mod, (function(err) { if (err) return callback(err); options.exists = !0, testSocket(); })); })(dir); options.exists = !0, testSocket(); }))); var dir; }, exports.nextPort = function(port) { return port + 1; }, exports.nextSocket = function(socketPath) { var dir = path.dirname(socketPath), match = path.basename(socketPath, ".sock").match(/^([a-zA-z]+)(\d*)$/i), index = parseInt(match[2]), base = match[1]; return isNaN(index) && (index = 0), index += 1, path.join(dir, base + index + ".sock"); }, exports._defaultHosts = (function() { var interfaces = {}; try { interfaces = os.networkInterfaces(); } catch (e) { if ("uv_interface_addresses" !== e.syscall) throw e; } for (var interfaceNames = Object.keys(interfaces), results = [ "0.0.0.0" ], i = 0; i < interfaceNames.length; i++) for (var _interface = interfaces[interfaceNames[i]], j = 0; j < _interface.length; j++) { var curr = _interface[j]; results.push(curr.address); } return results.push(null), debugDefaultHosts("exports._defaultHosts is: %o", results), results; })(); }, function(module, exports, __webpack_require__) { (function(module) { var factory; factory = function(exports) { "use strict"; function slice(arrayLike, start) { start |= 0; for (var newLen = Math.max(arrayLike.length - start, 0), newArr = Array(newLen), idx = 0; idx < newLen; idx++) newArr[idx] = arrayLike[start + idx]; return newArr; } var apply = function(fn) { var args = slice(arguments, 1); return function() { var callArgs = slice(arguments); return fn.apply(null, args.concat(callArgs)); }; }, initialParams = function(fn) { return function() { var args = slice(arguments), callback = args.pop(); fn.call(this, args, callback); }; }; function isObject(value) { var type = typeof value; return null != value && ("object" == type || "function" == type); } var hasSetImmediate = "function" == typeof setImmediate && setImmediate, hasNextTick = "object" == typeof process && "function" == typeof process.nextTick; function fallback(fn) { setTimeout(fn, 0); } function wrap(defer) { return function(fn) { var args = slice(arguments, 1); defer((function() { fn.apply(null, args); })); }; } var setImmediate$1 = wrap(hasSetImmediate ? setImmediate : hasNextTick ? process.nextTick : fallback); function asyncify(func) { return initialParams((function(args, callback) { var result; try { result = func.apply(this, args); } catch (e) { return callback(e); } isObject(result) && "function" == typeof result.then ? result.then((function(value) { invokeCallback(callback, null, value); }), (function(err) { invokeCallback(callback, err.message ? err : new Error(err)); })) : callback(null, result); })); } function invokeCallback(callback, error, value) { try { callback(error, value); } catch (e) { setImmediate$1(rethrow, e); } } function rethrow(error) { throw error; } var supportsSymbol = "function" == typeof Symbol; function isAsync(fn) { return supportsSymbol && "AsyncFunction" === fn[Symbol.toStringTag]; } function wrapAsync(asyncFn) { return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; } function applyEach$1(eachfn) { return function(fns) { var args = slice(arguments, 1), go = initialParams((function(args, callback) { var that = this; return eachfn(fns, (function(fn, cb) { wrapAsync(fn).apply(that, args.concat(cb)); }), callback); })); return args.length ? go.apply(this, args) : go; }; } var freeGlobal = "object" == typeof global && global && global.Object === Object && global, freeSelf = "object" == typeof self && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")(), Symbol$1 = root.Symbol, objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, nativeObjectToString = objectProto.toString, symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0, nativeObjectToString$1 = Object.prototype.toString, symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0; function baseGetTag(value) { return null == value ? void 0 === value ? "[object Undefined]" : "[object Null]" : symToStringTag && symToStringTag in Object(value) ? (function(value) { var isOwn = hasOwnProperty.call(value, symToStringTag$1), tag = value[symToStringTag$1]; try { value[symToStringTag$1] = void 0; var unmasked = !0; } catch (e) {} var result = nativeObjectToString.call(value); return unmasked && (isOwn ? value[symToStringTag$1] = tag : delete value[symToStringTag$1]), result; })(value) : (function(value) { return nativeObjectToString$1.call(value); })(value); } function isLength(value) { return "number" == typeof value && value > -1 && value % 1 == 0 && value <= 9007199254740991; } function isArrayLike(value) { return null != value && isLength(value.length) && !(function(value) { if (!isObject(value)) return !1; var tag = baseGetTag(value); return "[object Function]" == tag || "[object GeneratorFunction]" == tag || "[object AsyncFunction]" == tag || "[object Proxy]" == tag; })(value); } var breakLoop = {}; function noop() {} function once(fn) { return function() { if (null !== fn) { var callFn = fn; fn = null, callFn.apply(this, arguments); } }; } var iteratorSymbol = "function" == typeof Symbol && Symbol.iterator; function isObjectLike(value) { return null != value && "object" == typeof value; } function baseIsArguments(value) { return isObjectLike(value) && "[object Arguments]" == baseGetTag(value); } var objectProto$3 = Object.prototype, hasOwnProperty$2 = objectProto$3.hasOwnProperty, propertyIsEnumerable = objectProto$3.propertyIsEnumerable, isArguments = baseIsArguments((function() { return arguments; })()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty$2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }, isArray = Array.isArray, freeExports = "object" == typeof exports && exports && !exports.nodeType && exports, freeModule = freeExports && "object" == typeof module && module && !module.nodeType && module, Buffer = freeModule && freeModule.exports === freeExports ? root.Buffer : void 0, isBuffer = (Buffer ? Buffer.isBuffer : void 0) || function() { return !1; }, reIsUint = /^(?:0|[1-9]\d*)$/; function isIndex(value, length) { var type = typeof value; return !!(length = null == length ? 9007199254740991 : length) && ("number" == type || "symbol" != type && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; } var typedArrayTags = {}; typedArrayTags["[object Float32Array]"] = typedArrayTags["[object Float64Array]"] = typedArrayTags["[object Int8Array]"] = typedArrayTags["[object Int16Array]"] = typedArrayTags["[object Int32Array]"] = typedArrayTags["[object Uint8Array]"] = typedArrayTags["[object Uint8ClampedArray]"] = typedArrayTags["[object Uint16Array]"] = typedArrayTags["[object Uint32Array]"] = !0, typedArrayTags["[object Arguments]"] = typedArrayTags["[object Array]"] = typedArrayTags["[object ArrayBuffer]"] = typedArrayTags["[object Boolean]"] = typedArrayTags["[object DataView]"] = typedArrayTags["[object Date]"] = typedArrayTags["[object Error]"] = typedArrayTags["[object Function]"] = typedArrayTags["[object Map]"] = typedArrayTags["[object Number]"] = typedArrayTags["[object Object]"] = typedArrayTags["[object RegExp]"] = typedArrayTags["[object Set]"] = typedArrayTags["[object String]"] = typedArrayTags["[object WeakMap]"] = !1; var func, freeExports$1 = "object" == typeof exports && exports && !exports.nodeType && exports, freeModule$1 = freeExports$1 && "object" == typeof module && module && !module.nodeType && module, freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && freeGlobal.process, nodeUtil = (function() { try { return freeModule$1 && freeModule$1.require && freeModule$1.require("util").types || freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e) {} })(), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray, isTypedArray = nodeIsTypedArray ? (func = nodeIsTypedArray, function(value) { return func(value); }) : function(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; }, hasOwnProperty$1 = Object.prototype.hasOwnProperty; var objectProto$5 = Object.prototype, nativeKeys = (function(func, transform) { return function(arg) { return func(transform(arg)); }; })(Object.keys, Object), hasOwnProperty$3 = Object.prototype.hasOwnProperty; function keys(object) { return isArrayLike(object) ? (function(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? (function(n, iteratee) { for (var index = -1, result = Array(n); ++index < n; ) result[index] = iteratee(index); return result; })(value.length, String) : [], length = result.length; for (var key in value) !inherited && !hasOwnProperty$1.call(value, key) || skipIndexes && ("length" == key || isBuff && ("offset" == key || "parent" == key) || isType && ("buffer" == key || "byteLength" == key || "byteOffset" == key) || isIndex(key, length)) || result.push(key); return result; })(object) : (function(object) { if (!(function(value) { var Ctor = value && value.constructor; return value === ("function" == typeof Ctor && Ctor.prototype || objectProto$5); })(object)) return nativeKeys(object); var result = []; for (var key in Object(object)) hasOwnProperty$3.call(object, key) && "constructor" != key && result.push(key); return result; })(object); } function onlyOnce(fn) { return function() { if (null === fn) throw new Error("Callback was already called."); var callFn = fn; fn = null, callFn.apply(this, arguments); }; } function _eachOfLimit(limit) { return function(obj, iteratee, callback) { if (callback = once(callback || noop), limit <= 0 || !obj) return callback(null); var nextElem = (function(coll) { if (isArrayLike(coll)) return (function(coll) { var i = -1, len = coll.length; return function() { return ++i < len ? { value: coll[i], key: i } : null; }; })(coll); var obj, okeys, i, len, iterator = (function(coll) { return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol](); })(coll); return iterator ? (function(iterator) { var i = -1; return function() { var item = iterator.next(); return item.done ? null : (i++, { value: item.value, key: i }); }; })(iterator) : (okeys = keys(obj = coll), i = -1, len = okeys.length, function next() { var key = okeys[++i]; return "__proto__" === key ? next() : i < len ? { value: obj[key], key: key } : null; }); })(obj), done = !1, running = 0, looping = !1; function iterateeCallback(err, value) { if (running -= 1, err) done = !0, callback(err); else { if (value === breakLoop || done && running <= 0) return done = !0, callback(null); looping || replenish(); } } function replenish() { for (looping = !0; running < limit && !done; ) { var elem = nextElem(); if (null === elem) return done = !0, void (running <= 0 && callback(null)); running += 1, iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); } looping = !1; } replenish(); }; } function eachOfLimit(coll, limit, iteratee, callback) { _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); } function doLimit(fn, limit) { return function(iterable, iteratee, callback) { return fn(iterable, limit, iteratee, callback); }; } function eachOfArrayLike(coll, iteratee, callback) { callback = once(callback || noop); var index = 0, completed = 0, length = coll.length; function iteratorCallback(err, value) { err ? callback(err) : ++completed !== length && value !== breakLoop || callback(null); } for (0 === length && callback(null); index < length; index++) iteratee(coll[index], index, onlyOnce(iteratorCallback)); } var eachOfGeneric = doLimit(eachOfLimit, 1 / 0), eachOf = function(coll, iteratee, callback) { (isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric)(coll, wrapAsync(iteratee), callback); }; function doParallel(fn) { return function(obj, iteratee, callback) { return fn(eachOf, obj, wrapAsync(iteratee), callback); }; } function _asyncMap(eachfn, arr, iteratee, callback) { callback = callback || noop, arr = arr || []; var results = [], counter = 0, _iteratee = wrapAsync(iteratee); eachfn(arr, (function(value, _, callback) { var index = counter++; _iteratee(value, (function(err, v) { results[index] = v, callback(err); })); }), (function(err) { callback(err, results); })); } var map = doParallel(_asyncMap), applyEach = applyEach$1(map); function doParallelLimit(fn) { return function(obj, limit, iteratee, callback) { return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback); }; } var mapLimit = doParallelLimit(_asyncMap), mapSeries = doLimit(mapLimit, 1), applyEachSeries = applyEach$1(mapSeries); function arrayEach(array, iteratee) { for (var index = -1, length = null == array ? 0 : array.length; ++index < length && !1 !== iteratee(array[index], index, array); ) ; return array; } function baseForOwn(object, iteratee) { return object && (function(object, iteratee, keysFunc) { for (var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; length--; ) { var key = props[++index]; if (!1 === iteratee(iterable[key], key, iterable)) break; } return object; })(object, iteratee, keys); } function baseIsNaN(value) { return value != value; } function baseIndexOf(array, value, fromIndex) { return value == value ? (function(array, value, fromIndex) { for (var index = fromIndex - 1, length = array.length; ++index < length; ) if (array[index] === value) return index; return -1; })(array, value, fromIndex) : (function(array, predicate, fromIndex, fromRight) { for (var length = array.length, index = fromIndex + -1; ++index < length; ) if (predicate(array[index], index, array)) return index; return -1; })(array, baseIsNaN, fromIndex); } var auto = function(tasks, concurrency, callback) { "function" == typeof concurrency && (callback = concurrency, concurrency = null), callback = once(callback || noop); var numTasks = keys(tasks).length; if (!numTasks) return callback(null); concurrency || (concurrency = numTasks); var results = {}, runningTasks = 0, hasError = !1, listeners = Object.create(null), readyTasks = [], readyToCheck = [], uncheckedDependencies = {}; function enqueueTask(key, task) { readyTasks.push((function() { !(function(key, task) { if (!hasError) { var taskCallback = onlyOnce((function(err, result) { if (runningTasks--, arguments.length > 2 && (result = slice(arguments, 1)), err) { var safeResults = {}; baseForOwn(results, (function(val, rkey) { safeResults[rkey] = val; })), safeResults[key] = result, hasError = !0, listeners = Object.create(null), callback(err, safeResults); } else results[key] = result, taskComplete(key); })); runningTasks++; var taskFn = wrapAsync(task[task.length - 1]); task.length > 1 ? taskFn(results, taskCallback) : taskFn(taskCallback); } })(key, task); })); } function processQueue() { if (0 === readyTasks.length && 0 === runningTasks) return callback(null, results); for (;readyTasks.length && runningTasks < concurrency; ) readyTasks.shift()(); } function taskComplete(taskName) { arrayEach(listeners[taskName] || [], (function(fn) { fn(); })), processQueue(); } function getDependents(taskName) { var result = []; return baseForOwn(tasks, (function(task, key) { isArray(task) && baseIndexOf(task, taskName, 0) >= 0 && result.push(key); })), result; } baseForOwn(tasks, (function(task, key) { if (!isArray(task)) return enqueueTask(key, [ task ]), void readyToCheck.push(key); var dependencies = task.slice(0, task.length - 1), remainingDependencies = dependencies.length; if (0 === remainingDependencies) return enqueueTask(key, task), void readyToCheck.push(key); uncheckedDependencies[key] = remainingDependencies, arrayEach(dependencies, (function(dependencyName) { if (!tasks[dependencyName]) throw new Error("async.auto task `" + key + "` has a non-existent dependency `" + dependencyName + "` in " + dependencies.join(", ")); var taskName, fn, taskListeners; fn = function() { 0 == --remainingDependencies && enqueueTask(key, task); }, (taskListeners = listeners[taskName = dependencyName]) || (taskListeners = listeners[taskName] = []), taskListeners.push(fn); })); })), (function() { for (var counter = 0; readyToCheck.length; ) counter++, arrayEach(getDependents(readyToCheck.pop()), (function(dependent) { 0 == --uncheckedDependencies[dependent] && readyToCheck.push(dependent); })); if (counter !== numTasks) throw new Error("async.auto cannot execute tasks due to a recursive dependency"); })(), processQueue(); }; function arrayMap(array, iteratee) { for (var index = -1, length = null == array ? 0 : array.length, result = Array(length); ++index < length; ) result[index] = iteratee(array[index], index, array); return result; } var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0; function baseToString(value) { if ("string" == typeof value) return value; if (isArray(value)) return arrayMap(value, baseToString) + ""; if ((function(value) { return "symbol" == typeof value || isObjectLike(value) && "[object Symbol]" == baseGetTag(value); })(value)) return symbolToString ? symbolToString.call(value) : ""; var result = value + ""; return "0" == result && 1 / value == -1 / 0 ? "-0" : result; } var reHasUnicode = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"), rsCombo = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsNonAstral = "[^\\ud800-\\udfff]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", reOptMod = "(?:" + rsCombo + "|" + rsFitz + ")?", rsSeq = "[\\ufe0e\\ufe0f]?" + reOptMod + "(?:\\u200d(?:" + [ rsNonAstral, rsRegional, rsSurrPair ].join("|") + ")[\\ufe0e\\ufe0f]?" + reOptMod + ")*", rsSymbol = "(?:" + [ rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, "[\\ud800-\\udfff]" ].join("|") + ")", reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); function stringToArray(string) { return (function(string) { return reHasUnicode.test(string); })(string) ? (function(string) { return string.match(reUnicode) || []; })(string) : (function(string) { return string.split(""); })(string); } var reTrim = /^\s+|\s+$/g; function trim(string, chars, guard) { if ((string = (function(value) { return null == value ? "" : baseToString(value); })(string)) && (guard || void 0 === chars)) return string.replace(reTrim, ""); if (!string || !(chars = baseToString(chars))) return string; var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = (function(strSymbols, chrSymbols) { for (var index = -1, length = strSymbols.length; ++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1; ) ; return index; })(strSymbols, chrSymbols), end = (function(strSymbols, chrSymbols) { for (var index = strSymbols.length; index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1; ) ; return index; })(strSymbols, chrSymbols) + 1; return (function(array, start, end) { var length = array.length; return end = void 0 === end ? length : end, !start && end >= length ? array : (function(array, start, end) { var index = -1, length = array.length; start < 0 && (start = -start > length ? 0 : length + start), (end = end > length ? length : end) < 0 && (end += length), length = start > end ? 0 : end - start >>> 0, start >>>= 0; for (var result = Array(length); ++index < length; ) result[index] = array[index + start]; return result; })(array, start, end); })(strSymbols, start, end).join(""); } var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m, FN_ARG_SPLIT = /,/, FN_ARG = /(=.+)?(\s*)$/, STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm; function autoInject(tasks, callback) { var newTasks = {}; baseForOwn(tasks, (function(taskFn, key) { var params, fnIsAsync = isAsync(taskFn), hasNoDeps = !fnIsAsync && 1 === taskFn.length || fnIsAsync && 0 === taskFn.length; if (isArray(taskFn)) params = taskFn.slice(0, -1), taskFn = taskFn[taskFn.length - 1], newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); else if (hasNoDeps) newTasks[key] = taskFn; else { if (params = (function(func) { return (func = (func = (func = func.toString().replace(STRIP_COMMENTS, "")).match(FN_ARGS)[2].replace(" ", "")) ? func.split(FN_ARG_SPLIT) : []).map((function(arg) { return trim(arg.replace(FN_ARG, "")); })); })(taskFn), 0 === taskFn.length && !fnIsAsync && 0 === params.length) throw new Error("autoInject task functions require explicit parameters."); fnIsAsync || params.pop(), newTasks[key] = params.concat(newTask); } function newTask(results, taskCb) { var newArgs = arrayMap(params, (function(name) { return results[name]; })); newArgs.push(taskCb), wrapAsync(taskFn).apply(null, newArgs); } })), auto(newTasks, callback); } function DLL() { this.head = this.tail = null, this.length = 0; } function setInitial(dll, node) { dll.length = 1, dll.head = dll.tail = node; } function queue(worker, concurrency, payload) { if (null == concurrency) concurrency = 1; else if (0 === concurrency) throw new Error("Concurrency must not be zero"); var _worker = wrapAsync(worker), numRunning = 0, workersList = [], processingScheduled = !1; function _insert(data, insertAtFront, callback) { if (null != callback && "function" != typeof callback) throw new Error("task callback must be a function"); if (q.started = !0, isArray(data) || (data = [ data ]), 0 === data.length && q.idle()) return setImmediate$1((function() { q.drain(); })); for (var i = 0, l = data.length; i < l; i++) { var item = { data: data[i], callback: callback || noop }; insertAtFront ? q._tasks.unshift(item) : q._tasks.push(item); } processingScheduled || (processingScheduled = !0, setImmediate$1((function() { processingScheduled = !1, q.process(); }))); } function _next(tasks) { return function(err) { numRunning -= 1; for (var i = 0, l = tasks.length; i < l; i++) { var task = tasks[i], index = baseIndexOf(workersList, task, 0); 0 === index ? workersList.shift() : index > 0 && workersList.splice(index, 1), task.callback.apply(task, arguments), null != err && q.error(err, task.data); } numRunning <= q.concurrency - q.buffer && q.unsaturated(), q.idle() && q.drain(), q.process(); }; } var isProcessing = !1, q = { _tasks: new DLL, concurrency: concurrency, payload: payload, saturated: noop, unsaturated: noop, buffer: concurrency / 4, empty: noop, drain: noop, error: noop, started: !1, paused: !1, push: function(data, callback) { _insert(data, !1, callback); }, kill: function() { q.drain = noop, q._tasks.empty(); }, unshift: function(data, callback) { _insert(data, !0, callback); }, remove: function(testFn) { q._tasks.remove(testFn); }, process: function() { if (!isProcessing) { for (isProcessing = !0; !q.paused && numRunning < q.concurrency && q._tasks.length; ) { var tasks = [], data = [], l = q._tasks.length; q.payload && (l = Math.min(l, q.payload)); for (var i = 0; i < l; i++) { var node = q._tasks.shift(); tasks.push(node), workersList.push(node), data.push(node.data); } numRunning += 1, 0 === q._tasks.length && q.empty(), numRunning === q.concurrency && q.saturated(); var cb = onlyOnce(_next(tasks)); _worker(data, cb); } isProcessing = !1; } }, length: function() { return q._tasks.length; }, running: function() { return numRunning; }, workersList: function() { return workersList; }, idle: function() { return q._tasks.length + numRunning === 0; }, pause: function() { q.paused = !0; }, resume: function() { !1 !== q.paused && (q.paused = !1, setImmediate$1(q.process)); } }; return q; } function cargo(worker, payload) { return queue(worker, 1, payload); } DLL.prototype.removeLink = function(node) { return node.prev ? node.prev.next = node.next : this.head = node.next, node.next ? node.next.prev = node.prev : this.tail = node.prev, node.prev = node.next = null, this.length -= 1, node; }, DLL.prototype.empty = function() { for (;this.head; ) this.shift(); return this; }, DLL.prototype.insertAfter = function(node, newNode) { newNode.prev = node, newNode.next = node.next, node.next ? node.next.prev = newNode : this.tail = newNode, node.next = newNode, this.length += 1; }, DLL.prototype.insertBefore = function(node, newNode) { newNode.prev = node.prev, newNode.next = node, node.prev ? node.prev.next = newNode : this.head = newNode, node.prev = newNode, this.length += 1; }, DLL.prototype.unshift = function(node) { this.head ? this.insertBefore(this.head, node) : setInitial(this, node); }, DLL.prototype.push = function(node) { this.tail ? this.insertAfter(this.tail, node) : setInitial(this, node); }, DLL.prototype.shift = function() { return this.head && this.removeLink(this.head); }, DLL.prototype.pop = function() { return this.tail && this.removeLink(this.tail); }, DLL.prototype.toArray = function() { for (var arr = Array(this.length), curr = this.head, idx = 0; idx < this.length; idx++) arr[idx] = curr.data, curr = curr.next; return arr; }, DLL.prototype.remove = function(testFn) { for (var curr = this.head; curr; ) { var next = curr.next; testFn(curr) && this.removeLink(curr), curr = next; } return this; }; var eachOfSeries = doLimit(eachOfLimit, 1); function reduce(coll, memo, iteratee, callback) { callback = once(callback || noop); var _iteratee = wrapAsync(iteratee); eachOfSeries(coll, (function(x, i, callback) { _iteratee(memo, x, (function(err, v) { memo = v, callback(err); })); }), (function(err) { callback(err, memo); })); } function seq() { var _functions = arrayMap(arguments, wrapAsync); return function() { var args = slice(arguments), that = this, cb = args[args.length - 1]; "function" == typeof cb ? args.pop() : cb = noop, reduce(_functions, args, (function(newargs, fn, cb) { fn.apply(that, newargs.concat((function(err) { var nextargs = slice(arguments, 1); cb(err, nextargs); }))); }), (function(err, results) { cb.apply(that, [ err ].concat(results)); })); }; } var compose = function() { return seq.apply(null, slice(arguments).reverse()); }, _concat = Array.prototype.concat, concatLimit = function(coll, limit, iteratee, callback) { callback = callback || noop; var _iteratee = wrapAsync(iteratee); mapLimit(coll, limit, (function(val, callback) { _iteratee(val, (function(err) { return err ? callback(err) : callback(null, slice(arguments, 1)); })); }), (function(err, mapResults) { for (var result = [], i = 0; i < mapResults.length; i++) mapResults[i] && (result = _concat.apply(result, mapResults[i])); return callback(err, result); })); }, concat = doLimit(concatLimit, 1 / 0), concatSeries = doLimit(concatLimit, 1), constant = function() { var values = slice(arguments), args = [ null ].concat(values); return function() { var callback = arguments[arguments.length - 1]; return callback.apply(this, args); }; }; function identity(value) { return value; } function _createTester(check, getResult) { return function(eachfn, arr, iteratee, cb) { cb = cb || noop; var testResult, testPassed = !1; eachfn(arr, (function(value, _, callback) { iteratee(value, (function(err, result) { err ? callback(err) : check(result) && !testResult ? (testPassed = !0, testResult = getResult(!0, value), callback(null, breakLoop)) : callback(); })); }), (function(err) { err ? cb(err) : cb(null, testPassed ? testResult : getResult(!1)); })); }; } function _findGetResult(v, x) { return x; } var detect = doParallel(_createTester(identity, _findGetResult)), detectLimit = doParallelLimit(_createTester(identity, _findGetResult)), detectSeries = doLimit(detectLimit, 1); function consoleFunc(name) { return function(fn) { var args = slice(arguments, 1); args.push((function(err) { var args = slice(arguments, 1); "object" == typeof console && (err ? console.error && console.error(err) : console[name] && arrayEach(args, (function(x) { console[name](x); }))); })), wrapAsync(fn).apply(null, args); }; } var dir = consoleFunc("dir"); function doDuring(fn, test, callback) { callback = onlyOnce(callback || noop); var _fn = wrapAsync(fn), _test = wrapAsync(test); function next(err) { if (err) return callback(err); var args = slice(arguments, 1); args.push(check), _test.apply(this, args); } function check(err, truth) { return err ? callback(err) : truth ? void _fn(next) : callback(null); } check(null, !0); } function doWhilst(iteratee, test, callback) { callback = onlyOnce(callback || noop); var _iteratee = wrapAsync(iteratee), next = function(err) { if (err) return callback(err); var args = slice(arguments, 1); if (test.apply(this, args)) return _iteratee(next); callback.apply(null, [ null ].concat(args)); }; _iteratee(next); } function doUntil(iteratee, test, callback) { doWhilst(iteratee, (function() { return !test.apply(this, arguments); }), callback); } function during(test, fn, callback) { callback = onlyOnce(callback || noop); var _fn = wrapAsync(fn), _test = wrapAsync(test); function next(err) { if (err) return callback(err); _test(check); } function check(err, truth) { return err ? callback(err) : truth ? void _fn(next) : callback(null); } _test(check); } function _withoutIndex(iteratee) { return function(value, index, callback) { return iteratee(value, callback); }; } function eachLimit(coll, iteratee, callback) { eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback); } function eachLimit$1(coll, limit, iteratee, callback) { _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); } var eachSeries = doLimit(eachLimit$1, 1); function ensureAsync(fn) { return isAsync(fn) ? fn : initialParams((function(args, callback) { var sync = !0; args.push((function() { var innerArgs = arguments; sync ? setImmediate$1((function() { callback.apply(null, innerArgs); })) : callback.apply(null, innerArgs); })), fn.apply(this, args), sync = !1; })); } function notId(v) { return !v; } var every = doParallel(_createTester(notId, notId)), everyLimit = doParallelLimit(_createTester(notId, notId)), everySeries = doLimit(everyLimit, 1); function baseProperty(key) { return function(object) { return null == object ? void 0 : object[key]; }; } function filterArray(eachfn, arr, iteratee, callback) { var truthValues = new Array(arr.length); eachfn(arr, (function(x, index, callback) { iteratee(x, (function(err, v) { truthValues[index] = !!v, callback(err); })); }), (function(err) { if (err) return callback(err); for (var results = [], i = 0; i < arr.length; i++) truthValues[i] && results.push(arr[i]); callback(null, results); })); } function filterGeneric(eachfn, coll, iteratee, callback) { var results = []; eachfn(coll, (function(x, index, callback) { iteratee(x, (function(err, v) { err ? callback(err) : (v && results.push({ index: index, value: x }), callback()); })); }), (function(err) { err ? callback(err) : callback(null, arrayMap(results.sort((function(a, b) { return a.index - b.index; })), baseProperty("value"))); })); } function _filter(eachfn, coll, iteratee, callback) { (isArrayLike(coll) ? filterArray : filterGeneric)(eachfn, coll, wrapAsync(iteratee), callback || noop); } var filter = doParallel(_filter), filterLimit = doParallelLimit(_filter), filterSeries = doLimit(filterLimit, 1); function forever(fn, errback) { var done = onlyOnce(errback || noop), task = wrapAsync(ensureAsync(fn)); !(function next(err) { if (err) return done(err); task(next); })(); } var groupByLimit = function(coll, limit, iteratee, callback) { callback = callback || noop; var _iteratee = wrapAsync(iteratee); mapLimit(coll, limit, (function(val, callback) { _iteratee(val, (function(err, key) { return err ? callback(err) : callback(null, { key: key, val: val }); })); }), (function(err, mapResults) { for (var result = {}, hasOwnProperty = Object.prototype.hasOwnProperty, i = 0; i < mapResults.length; i++) if (mapResults[i]) { var key = mapResults[i].key, val = mapResults[i].val; hasOwnProperty.call(result, key) ? result[key].push(val) : result[key] = [ val ]; } return callback(err, result); })); }, groupBy = doLimit(groupByLimit, 1 / 0), groupBySeries = doLimit(groupByLimit, 1), log = consoleFunc("log"); function mapValuesLimit(obj, limit, iteratee, callback) { callback = once(callback || noop); var newObj = {}, _iteratee = wrapAsync(iteratee); eachOfLimit(obj, limit, (function(val, key, next) { _iteratee(val, key, (function(err, result) { if (err) return next(err); newObj[key] = result, next(); })); }), (function(err) { callback(err, newObj); })); } var mapValues = doLimit(mapValuesLimit, 1 / 0), mapValuesSeries = doLimit(mapValuesLimit, 1); function has(obj, key) { return key in obj; } function memoize(fn, hasher) { var memo = Object.create(null), queues = Object.create(null); hasher = hasher || identity; var _fn = wrapAsync(fn), memoized = initialParams((function(args, callback) { var key = hasher.apply(null, args); has(memo, key) ? setImmediate$1((function() { callback.apply(null, memo[key]); })) : has(queues, key) ? queues[key].push(callback) : (queues[key] = [ callback ], _fn.apply(null, args.concat((function() { var args = slice(arguments); memo[key] = args; var q = queues[key]; delete queues[key]; for (var i = 0, l = q.length; i < l; i++) q[i].apply(null, args); })))); })); return memoized.memo = memo, memoized.unmemoized = fn, memoized; } var nextTick = wrap(hasNextTick ? process.nextTick : hasSetImmediate ? setImmediate : fallback); function _parallel(eachfn, tasks, callback) { callback = callback || noop; var results = isArrayLike(tasks) ? [] : {}; eachfn(tasks, (function(task, key, callback) { wrapAsync(task)((function(err, result) { arguments.length > 2 && (result = slice(arguments, 1)), results[key] = result, callback(err); })); }), (function(err) { callback(err, results); })); } function parallelLimit(tasks, callback) { _parallel(eachOf, tasks, callback); } function parallelLimit$1(tasks, limit, callback) { _parallel(_eachOfLimit(limit), tasks, callback); } var queue$1 = function(worker, concurrency) { var _worker = wrapAsync(worker); return queue((function(items, cb) { _worker(items[0], cb); }), concurrency, 1); }, priorityQueue = function(worker, concurrency) { var q = queue$1(worker, concurrency); return q.push = function(data, priority, callback) { if (null == callback && (callback = noop), "function" != typeof callback) throw new Error("task callback must be a function"); if (q.started = !0, isArray(data) || (data = [ data ]), 0 === data.length) return setImmediate$1((function() { q.drain(); })); priority = priority || 0; for (var nextNode = q._tasks.head; nextNode && priority >= nextNode.priority; ) nextNode = nextNode.next; for (var i = 0, l = data.length; i < l; i++) { var item = { data: data[i], priority: priority, callback: callback }; nextNode ? q._tasks.insertBefore(nextNode, item) : q._tasks.push(item); } setImmediate$1(q.process); }, delete q.unshift, q; }; function race(tasks, callback) { if (callback = once(callback || noop), !isArray(tasks)) return callback(new TypeError("First argument to race must be an array of functions")); if (!tasks.length) return callback(); for (var i = 0, l = tasks.length; i < l; i++) wrapAsync(tasks[i])(callback); } function reduceRight(array, memo, iteratee, callback) { reduce(slice(array).reverse(), memo, iteratee, callback); } function reflect(fn) { var _fn = wrapAsync(fn); return initialParams((function(args, reflectCallback) { return args.push((function(error, cbArg) { var value; error ? reflectCallback(null, { error: error }) : (value = arguments.length <= 2 ? cbArg : slice(arguments, 1), reflectCallback(null, { value: value })); })), _fn.apply(this, args); })); } function reflectAll(tasks) { var results; return isArray(tasks) ? results = arrayMap(tasks, reflect) : (results = {}, baseForOwn(tasks, (function(task, key) { results[key] = reflect.call(this, task); }))), results; } function reject$1(eachfn, arr, iteratee, callback) { _filter(eachfn, arr, (function(value, cb) { iteratee(value, (function(err, v) { cb(err, !v); })); }), callback); } var reject = doParallel(reject$1), rejectLimit = doParallelLimit(reject$1), rejectSeries = doLimit(rejectLimit, 1); function constant$1(value) { return function() { return value; }; } function retry(opts, task, callback) { var DEFAULT_TIMES = 5, DEFAULT_INTERVAL = 0, options = { times: DEFAULT_TIMES, intervalFunc: constant$1(DEFAULT_INTERVAL) }; function parseTimes(acc, t) { if ("object" == typeof t) acc.times = +t.times || DEFAULT_TIMES, acc.intervalFunc = "function" == typeof t.interval ? t.interval : constant$1(+t.interval || DEFAULT_INTERVAL), acc.errorFilter = t.errorFilter; else { if ("number" != typeof t && "string" != typeof t) throw new Error("Invalid arguments for async.retry"); acc.times = +t || DEFAULT_TIMES; } } if (arguments.length < 3 && "function" == typeof opts ? (callback = task || noop, task = opts) : (parseTimes(options, opts), callback = callback || noop), "function" != typeof task) throw new Error("Invalid arguments for async.retry"); var _task = wrapAsync(task), attempt = 1; function retryAttempt() { _task((function(err) { err && attempt++ < options.times && ("function" != typeof options.errorFilter || options.errorFilter(err)) ? setTimeout(retryAttempt, options.intervalFunc(attempt)) : callback.apply(null, arguments); })); } retryAttempt(); } var retryable = function(opts, task) { task || (task = opts, opts = null); var _task = wrapAsync(task); return initialParams((function(args, callback) { function taskFn(cb) { _task.apply(null, args.concat(cb)); } opts ? retry(opts, taskFn, callback) : retry(taskFn, callback); })); }; function series(tasks, callback) { _parallel(eachOfSeries, tasks, callback); } var some = doParallel(_createTester(Boolean, identity)), someLimit = doParallelLimit(_createTester(Boolean, identity)), someSeries = doLimit(someLimit, 1); function sortBy(coll, iteratee, callback) { var _iteratee = wrapAsync(iteratee); function comparator(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; } map(coll, (function(x, callback) { _iteratee(x, (function(err, criteria) { if (err) return callback(err); callback(null, { value: x, criteria: criteria }); })); }), (function(err, results) { if (err) return callback(err); callback(null, arrayMap(results.sort(comparator), baseProperty("value"))); })); } function timeout(asyncFn, milliseconds, info) { var fn = wrapAsync(asyncFn); return initialParams((function(args, callback) { var timer, timedOut = !1; args.push((function() { timedOut || (callback.apply(null, arguments), clearTimeout(timer)); })), timer = setTimeout((function() { var name = asyncFn.name || "anonymous", error = new Error('Callback function "' + name + '" timed out.'); error.code = "ETIMEDOUT", info && (error.info = info), timedOut = !0, callback(error); }), milliseconds), fn.apply(null, args); })); } var nativeCeil = Math.ceil, nativeMax = Math.max; function timeLimit(count, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); mapLimit((function(start, end, step, fromRight) { for (var index = -1, length = nativeMax(nativeCeil((end - start) / 1), 0), result = Array(length); length--; ) result[++index] = start, start += 1; return result; })(0, count), limit, _iteratee, callback); } var times = doLimit(timeLimit, 1 / 0), timesSeries = doLimit(timeLimit, 1); function transform(coll, accumulator, iteratee, callback) { arguments.length <= 3 && (callback = iteratee, iteratee = accumulator, accumulator = isArray(coll) ? [] : {}), callback = once(callback || noop); var _iteratee = wrapAsync(iteratee); eachOf(coll, (function(v, k, cb) { _iteratee(accumulator, v, k, cb); }), (function(err) { callback(err, accumulator); })); } function tryEach(tasks, callback) { var result, error = null; callback = callback || noop, eachSeries(tasks, (function(task, callback) { wrapAsync(task)((function(err, res) { result = arguments.length > 2 ? slice(arguments, 1) : res, error = err, callback(!err); })); }), (function() { callback(error, result); })); } function unmemoize(fn) { return function() { return (fn.unmemoized || fn).apply(null, arguments); }; } function whilst(test, iteratee, callback) { callback = onlyOnce(callback || noop); var _iteratee = wrapAsync(iteratee); if (!test()) return callback(null); var next = function(err) { if (err) return callback(err); if (test()) return _iteratee(next); var args = slice(arguments, 1); callback.apply(null, [ null ].concat(args)); }; _iteratee(next); } function until(test, iteratee, callback) { whilst((function() { return !test.apply(this, arguments); }), iteratee, callback); } var waterfall = function(tasks, callback) { if (callback = once(callback || noop), !isArray(tasks)) return callback(new Error("First argument to waterfall must be an array of functions")); if (!tasks.length) return callback(); var taskIndex = 0; function nextTask(args) { var task = wrapAsync(tasks[taskIndex++]); args.push(onlyOnce(next)), task.apply(null, args); } function next(err) { if (err || taskIndex === tasks.length) return callback.apply(null, arguments); nextTask(slice(arguments, 1)); } nextTask([]); }, index = { apply: apply, applyEach: applyEach, applyEachSeries: applyEachSeries, asyncify: asyncify, auto: auto, autoInject: autoInject, cargo: cargo, compose: compose, concat: concat, concatLimit: concatLimit, concatSeries: concatSeries, constant: constant, detect: detect, detectLimit: detectLimit, detectSeries: detectSeries, dir: dir, doDuring: doDuring, doUntil: doUntil, doWhilst: doWhilst, during: during, each: eachLimit, eachLimit: eachLimit$1, eachOf: eachOf, eachOfLimit: eachOfLimit, eachOfSeries: eachOfSeries, eachSeries: eachSeries, ensureAsync: ensureAsync, every: every, everyLimit: everyLimit, everySeries: everySeries, filter: filter, filterLimit: filterLimit, filterSeries: filterSeries, forever: forever, groupBy: groupBy, groupByLimit: groupByLimit, groupBySeries: groupBySeries, log: log, map: map, mapLimit: mapLimit, mapSeries: mapSeries, mapValues: mapValues, mapValuesLimit: mapValuesLimit, mapValuesSeries: mapValuesSeries, memoize: memoize, nextTick: nextTick, parallel: parallelLimit, parallelLimit: parallelLimit$1, priorityQueue: priorityQueue, queue: queue$1, race: race, reduce: reduce, reduceRight: reduceRight, reflect: reflect, reflectAll: reflectAll, reject: reject, rejectLimit: rejectLimit, rejectSeries: rejectSeries, retry: retry, retryable: retryable, seq: seq, series: series, setImmediate: setImmediate$1, some: some, someLimit: someLimit, someSeries: someSeries, sortBy: sortBy, timeout: timeout, times: times, timesLimit: timeLimit, timesSeries: timesSeries, transform: transform, tryEach: tryEach, unmemoize: unmemoize, until: until, waterfall: waterfall, whilst: whilst, all: every, allLimit: everyLimit, allSeries: everySeries, any: some, anyLimit: someLimit, anySeries: someSeries, find: detect, findLimit: detectLimit, findSeries: detectSeries, forEach: eachLimit, forEachSeries: eachSeries, forEachLimit: eachLimit$1, forEachOf: eachOf, forEachOfSeries: eachOfSeries, forEachOfLimit: eachOfLimit, inject: reduce, foldl: reduce, foldr: reduceRight, select: filter, selectLimit: filterLimit, selectSeries: filterSeries, wrapSync: asyncify }; exports.default = index, exports.apply = apply, exports.applyEach = applyEach, exports.applyEachSeries = applyEachSeries, exports.asyncify = asyncify, exports.auto = auto, exports.autoInject = autoInject, exports.cargo = cargo, exports.compose = compose, exports.concat = concat, exports.concatLimit = concatLimit, exports.concatSeries = concatSeries, exports.constant = constant, exports.detect = detect, exports.detectLimit = detectLimit, exports.detectSeries = detectSeries, exports.dir = dir, exports.doDuring = doDuring, exports.doUntil = doUntil, exports.doWhilst = doWhilst, exports.during = during, exports.each = eachLimit, exports.eachLimit = eachLimit$1, exports.eachOf = eachOf, exports.eachOfLimit = eachOfLimit, exports.eachOfSeries = eachOfSeries, exports.eachSeries = eachSeries, exports.ensureAsync = ensureAsync, exports.every = every, exports.everyLimit = everyLimit, exports.everySeries = everySeries, exports.filter = filter, exports.filterLimit = filterLimit, exports.filterSeries = filterSeries, exports.forever = forever, exports.groupBy = groupBy, exports.groupByLimit = groupByLimit, exports.groupBySeries = groupBySeries, exports.log = log, exports.map = map, exports.mapLimit = mapLimit, exports.mapSeries = mapSeries, exports.mapValues = mapValues, exports.mapValuesLimit = mapValuesLimit, exports.mapValuesSeries = mapValuesSeries, exports.memoize = memoize, exports.nextTick = nextTick, exports.parallel = parallelLimit, exports.parallelLimit = parallelLimit$1, exports.priorityQueue = priorityQueue, exports.queue = queue$1, exports.race = race, exports.reduce = reduce, exports.reduceRight = reduceRight, exports.reflect = reflect, exports.reflectAll = reflectAll, exports.reject = reject, exports.rejectLimit = rejectLimit, exports.rejectSeries = rejectSeries, exports.retry = retry, exports.retryable = retryable, exports.seq = seq, exports.series = series, exports.setImmediate = setImmediate$1, exports.some = some, exports.someLimit = someLimit, exports.someSeries = someSeries, exports.sortBy = sortBy, exports.timeout = timeout, exports.times = times, exports.timesLimit = timeLimit, exports.timesSeries = timesSeries, exports.transform = transform, exports.tryEach = tryEach, exports.unmemoize = unmemoize, exports.until = until, exports.waterfall = waterfall, exports.whilst = whilst, exports.all = every, exports.allLimit = everyLimit, exports.allSeries = everySeries, exports.any = some, exports.anyLimit = someLimit, exports.anySeries = someSeries, exports.find = detect, exports.findLimit = detectLimit, exports.findSeries = detectSeries, exports.forEach = eachLimit, exports.forEachSeries = eachSeries, exports.forEachLimit = eachLimit$1, exports.forEachOf = eachOf, exports.forEachOfSeries = eachOfSeries, exports.forEachOfLimit = eachOfLimit, exports.inject = reduce, exports.foldl = reduce, exports.foldr = reduceRight, exports.select = filter, exports.selectLimit = filterLimit, exports.selectSeries = filterSeries, exports.wrapSync = asyncify, Object.defineProperty(exports, "__esModule", { value: !0 }); }, factory(exports); }).call(this, __webpack_require__(69)(module)); }, function(module, exports, __webpack_require__) { "use strict"; "undefined" == typeof process || "renderer" === process.type || !0 === process.browser || process.__nwjs ? module.exports = __webpack_require__(861) : module.exports = __webpack_require__(862); }, function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } exports.log = function() { var _console; return "object" === ("undefined" == typeof console ? "undefined" : _typeof(console)) && console.log && (_console = console).log.apply(_console, arguments); }, exports.formatArgs = function(args) { if (args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff), this.useColors) { var c = "color: " + this.color; args.splice(1, 0, c, "color: inherit"); var index = 0, lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (function(match) { "%%" !== match && (index++, "%c" === match && (lastC = index)); })), args.splice(lastC, 0, c); } }, exports.save = function(namespaces) { try { namespaces ? exports.storage.setItem("debug", namespaces) : exports.storage.removeItem("debug"); } catch (error) {} }, exports.load = function() { var r; try { r = exports.storage.getItem("debug"); } catch (error) {} return !r && "undefined" != typeof process && "env" in process && (r = process.env.DEBUG), r; }, exports.useColors = function() { return !("undefined" == typeof window || !window.process || "renderer" !== window.process.type && !window.process.__nwjs) || ("undefined" == typeof navigator || !navigator.userAgent || !navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) && ("undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); }, exports.storage = (function() { try { return localStorage; } catch (error) {} })(), 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" ], module.exports = __webpack_require__(435)(exports), module.exports.formatters.j = function(v) { try { return JSON.stringify(v); } catch (error) { return "[UnexpectedJSONParseError]: " + error.message; } }; }, function(module, exports, __webpack_require__) { "use strict"; var tty = __webpack_require__(117), util = __webpack_require__(0); exports.init = function(debug) { debug.inspectOpts = {}; for (var keys = Object.keys(exports.inspectOpts), i = 0; i < keys.length; i++) debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; }, exports.log = function() { return process.stderr.write(util.format.apply(util, arguments) + "\n"); }, exports.formatArgs = function(args) { var name = this.namespace; if (this.useColors) { var c = this.color, colorCode = "[3" + (c < 8 ? c : "8;5;" + c), prefix = " ".concat(colorCode, ";1m").concat(name, " "); args[0] = prefix + args[0].split("\n").join("\n" + prefix), args.push(colorCode + "m+" + module.exports.humanize(this.diff) + ""); } else args[0] = (exports.inspectOpts.hideDate ? "" : (new Date).toISOString() + " ") + name + " " + args[0]; }, exports.save = function(namespaces) { namespaces ? process.env.DEBUG = namespaces : delete process.env.DEBUG; }, exports.load = function() { return process.env.DEBUG; }, exports.useColors = function() { return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); }, exports.colors = [ 6, 2, 3, 4, 5, 1 ]; try { var supportsColor = __webpack_require__(313); supportsColor && (supportsColor.stderr || supportsColor).level >= 2 && (exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]); } catch (error) {} exports.inspectOpts = Object.keys(process.env).filter((function(key) { return /^debug_/i.test(key); })).reduce((function(obj, key) { var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (function(_, k) { return k.toUpperCase(); })), val = process.env[key]; return val = !!/^(yes|on|true|enabled)$/i.test(val) || !/^(no|off|false|disabled)$/i.test(val) && ("null" === val ? null : Number(val)), obj[prop] = val, obj; }), {}), module.exports = __webpack_require__(435)(exports); var formatters = module.exports.formatters; formatters.o = function(v) { return this.inspectOpts.colors = this.useColors, util.inspect(v, this.inspectOpts).split("\n").map((function(str) { return str.trim(); })).join(" "); }, formatters.O = function(v) { return this.inspectOpts.colors = this.useColors, util.inspect(v, this.inspectOpts); }; }, function(module, exports, __webpack_require__) { const {spawn: spawn} = __webpack_require__(32), fs = __webpack_require__(2), path = __webpack_require__(5), kill = __webpack_require__(434), EventEmitter = __webpack_require__(4), {Readable: Readable} = __webpack_require__(3), bridge = __webpack_require__(194), mode = (__webpack_require__(11), __webpack_require__(436)); module.exports = class { constructor(options, forcedMode) { this.events = new EventEmitter, this.probeProcess = null, this.stream = null, this.mode = forcedMode || mode; const ffprobe = options.ffprobe; this.create = () => { const args = [ "-show_entries", "stream=index,bit_rate,max_bit_rate,codec_type,codec_name,start_time,start_pts,r_frame_rate,sample_rate,channels,channel_layout,time_base,has_b_frames,nb_frames,width,height,color_space,color_transfer,color_primaries,codec_tag_string : stream_tags=title,language,duration,bps,number_of_bytes : format=format_name,duration,bit_rate,max_bit_rate", "-print_format", "json", options.mediaURL ]; if ("remote" === this.mode) return new Promise(((resolve, reject) => { const self = this, id = Math.random().toString(); bridge.on("ffprobe:result", (function onResult(result) { result.id === id && (bridge.off("ffprobe:result", onResult), result.error ? reject(new Error(result.error)) : (self.stream = Readable.from([ result.data ]), setTimeout((() => { self.events.emit("close", 0, null); }), 500), resolve(self))); })), bridge.dispatch("ffprobe", { id: id, debug: !!process.env.HLS_DEBUG, args: args }); })); if ("local" === this.mode) { const debugDir = process.env.HLS_DEBUG_DIR || path.resolve("./"), stderr = process.env.HLS_DEBUG && "android" !== process.platform ? fs.openSync(path.join(debugDir, `ffprobe_${encodeURIComponent(new URL(options.mediaURL).pathname)}.log`), "a") : "ignore"; return this.probeProcess = spawn(ffprobe, args, { detached: !0, stdio: [ "ignore", "pipe", stderr ] }), this.stream = this.probeProcess.stdout, this.probeProcess.on("close", ((code, signal) => { this.events.emit("close", code, signal); })), this; } }, this.destroy = () => { "remote" === this.mode || "local" === this.mode && kill(this.probeProcess.pid, "SIGKILL"); }; } }; }, function(module, exports, __webpack_require__) { "use strict"; var Parser = __webpack_require__(865), through = __webpack_require__(866), bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from; function check(x, y) { return "string" == typeof x ? y == x : x && "function" == typeof x.exec ? x.exec(y) : "boolean" == typeof x || "object" == typeof x ? x : "function" == typeof x && x(y); } exports.parse = function(path, map) { var header, footer, parser = new Parser, stream = through((function(chunk) { "string" == typeof chunk && (chunk = bufferFrom ? Buffer.from(chunk) : new Buffer(chunk)), parser.write(chunk); }), (function(data) { data && stream.write(data), header && stream.emit("header", header), footer && stream.emit("footer", footer), stream.queue(null); })); return "string" == typeof path && (path = path.split(".").map((function(e) { return "$*" === e ? { emitKey: !0 } : "*" === e || ("" === e ? { recurse: !0 } : e); }))), path && path.length || (path = null), parser.onValue = function(value) { if (this.root || (stream.root = value), path) { for (var i = 0, j = 0, emitKey = !1, emitPath = !1; i < path.length; ) { var c, key = path[i]; if (j++, key && !key.recurse) { if (!(c = j === this.stack.length ? this : this.stack[j])) return; if (!check(key, c.key)) return void setHeaderFooter(c.key, value); emitKey = !!key.emitKey, emitPath = !!key.emitPath, i++; } else { i++; var nextKey = path[i]; if (!nextKey) return; for (;;) { if (!(c = j === this.stack.length ? this : this.stack[j])) return; if (check(nextKey, c.key)) { i++, Object.isFrozen(this.stack[j]) || (this.stack[j].value = null); break; } setHeaderFooter(c.key, value), j++; } } } if (header && (stream.emit("header", header), header = !1), j === this.stack.length) { var actualPath = this.stack.slice(1).map((function(element) { return element.key; })).concat([ this.key ]), data = value; for (var k in null != data && null != (data = map ? map(data, actualPath) : data) && ((emitKey || emitPath) && (data = { value: data }, emitKey && (data.key = this.key), emitPath && (data.path = actualPath)), stream.queue(data)), this.value && delete this.value[this.key], this.stack) Object.isFrozen(this.stack[k]) || (this.stack[k].value = null); } } }, parser._onToken = parser.onToken, parser.onToken = function(token, value) { parser._onToken(token, value), 0 === this.stack.length && stream.root && (path || stream.queue(stream.root), stream.root = null); }, parser.onError = function(err) { err.message.indexOf("at position") > -1 && (err.message = "Invalid JSON (" + err.message + ")"), stream.emit("error", err); }, stream; function setHeaderFooter(key, value) { !1 !== header && ((header = header || {})[key] = value), !1 !== footer && !1 === header && ((footer = footer || {})[key] = value); } }, exports.stringify = function(op, sep, cl, indent) { indent = indent || 0, !1 === op ? (op = "", sep = "\n", cl = "") : null == op && (op = "[\n", sep = "\n,\n", cl = "\n]\n"); var stream, first = !0, anyData = !1; return stream = through((function(data) { anyData = !0; try { var json = JSON.stringify(data, null, indent); } catch (err) { return stream.emit("error", err); } first ? (first = !1, stream.queue(op + json)) : stream.queue(sep + json); }), (function(data) { anyData || stream.queue(op), stream.queue(cl), stream.queue(null); })); }, exports.stringifyObject = function(op, sep, cl, indent) { indent = indent || 0, !1 === op ? (op = "", sep = "\n", cl = "") : null == op && (op = "{\n", sep = "\n,\n", cl = "\n}\n"); var first = !0, anyData = !1; return through((function(data) { anyData = !0; var json = JSON.stringify(data[0]) + ":" + JSON.stringify(data[1], null, indent); first ? (first = !1, this.queue(op + json)) : this.queue(sep + json); }), (function(data) { anyData || this.queue(op), this.queue(cl), this.queue(null); })); }; }, function(module, exports) { var C = {}, LEFT_BRACE = C.LEFT_BRACE = 1, RIGHT_BRACE = C.RIGHT_BRACE = 2, LEFT_BRACKET = C.LEFT_BRACKET = 3, RIGHT_BRACKET = C.RIGHT_BRACKET = 4, COLON = C.COLON = 5, COMMA = C.COMMA = 6, TRUE = C.TRUE = 7, FALSE = C.FALSE = 8, NULL = C.NULL = 9, STRING = C.STRING = 10, NUMBER = C.NUMBER = 11, START = C.START = 17, STOP = C.STOP = 18, TRUE1 = C.TRUE1 = 33, TRUE2 = C.TRUE2 = 34, TRUE3 = C.TRUE3 = 35, FALSE1 = C.FALSE1 = 49, FALSE2 = C.FALSE2 = 50, FALSE3 = C.FALSE3 = 51, FALSE4 = C.FALSE4 = 52, NULL1 = C.NULL1 = 65, NULL2 = C.NULL2 = 66, NULL3 = C.NULL3 = 67, NUMBER1 = C.NUMBER1 = 81, NUMBER3 = C.NUMBER3 = 83, STRING1 = C.STRING1 = 97, STRING2 = C.STRING2 = 98, STRING3 = C.STRING3 = 99, STRING4 = C.STRING4 = 100, STRING5 = C.STRING5 = 101, STRING6 = C.STRING6 = 102, VALUE = C.VALUE = 113, KEY = C.KEY = 114, OBJECT = C.OBJECT = 129, ARRAY = C.ARRAY = 130, BACK_SLASH = "\\".charCodeAt(0), FORWARD_SLASH = "/".charCodeAt(0), BACKSPACE = "\b".charCodeAt(0), FORM_FEED = "\f".charCodeAt(0), NEWLINE = "\n".charCodeAt(0), CARRIAGE_RETURN = "\r".charCodeAt(0), TAB = "\t".charCodeAt(0); function Parser() { this.tState = START, this.value = void 0, this.string = void 0, this.stringBuffer = Buffer.alloc ? Buffer.alloc(65536) : new Buffer(65536), this.stringBufferOffset = 0, this.unicode = void 0, this.highSurrogate = void 0, this.key = void 0, this.mode = void 0, this.stack = [], this.state = VALUE, this.bytes_remaining = 0, this.bytes_in_sequence = 0, this.temp_buffs = { 2: new Buffer(2), 3: new Buffer(3), 4: new Buffer(4) }, this.offset = -1; } Parser.toknam = function(code) { for (var keys = Object.keys(C), i = 0, l = keys.length; i < l; i++) { var key = keys[i]; if (C[key] === code) return key; } return code && "0x" + code.toString(16); }; var proto = Parser.prototype; proto.onError = function(err) { throw err; }, proto.charError = function(buffer, i) { this.tState = STOP, this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState))); }, proto.appendStringChar = function(char) { this.stringBufferOffset >= 65536 && (this.string += this.stringBuffer.toString("utf8"), this.stringBufferOffset = 0), this.stringBuffer[this.stringBufferOffset++] = char; }, proto.appendStringBuf = function(buf, start, end) { var size = buf.length; "number" == typeof start && (size = "number" == typeof end ? end < 0 ? buf.length - start + end : end - start : buf.length - start), size < 0 && (size = 0), this.stringBufferOffset + size > 65536 && (this.string += this.stringBuffer.toString("utf8", 0, this.stringBufferOffset), this.stringBufferOffset = 0), buf.copy(this.stringBuffer, this.stringBufferOffset, start, end), this.stringBufferOffset += size; }, proto.write = function(buffer) { var n; "string" == typeof buffer && (buffer = new Buffer(buffer)); for (var i = 0, l = buffer.length; i < l; i++) if (this.tState === START) { if (n = buffer[i], this.offset++, 123 === n) this.onToken(LEFT_BRACE, "{"); else if (125 === n) this.onToken(RIGHT_BRACE, "}"); else if (91 === n) this.onToken(LEFT_BRACKET, "["); else if (93 === n) this.onToken(RIGHT_BRACKET, "]"); else if (58 === n) this.onToken(COLON, ":"); else if (44 === n) this.onToken(COMMA, ","); else if (116 === n) this.tState = TRUE1; else if (102 === n) this.tState = FALSE1; else if (110 === n) this.tState = NULL1; else if (34 === n) this.string = "", this.stringBufferOffset = 0, this.tState = STRING1; else if (45 === n) this.string = "-", this.tState = NUMBER1; else if (n >= 48 && n < 64) this.string = String.fromCharCode(n), this.tState = NUMBER3; else if (32 !== n && 9 !== n && 10 !== n && 13 !== n) return this.charError(buffer, i); } else if (this.tState === STRING1) if (n = buffer[i], this.bytes_remaining > 0) { for (var j = 0; j < this.bytes_remaining; j++) this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j]; this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]), this.bytes_in_sequence = this.bytes_remaining = 0, i = i + j - 1; } else if (0 === this.bytes_remaining && n >= 128) { if (n <= 193 || n > 244) return this.onError(new Error("Invalid UTF-8 character at position " + i + " in state " + Parser.toknam(this.tState))); if (n >= 194 && n <= 223 && (this.bytes_in_sequence = 2), n >= 224 && n <= 239 && (this.bytes_in_sequence = 3), n >= 240 && n <= 244 && (this.bytes_in_sequence = 4), this.bytes_in_sequence + i > buffer.length) { for (var k = 0; k <= buffer.length - 1 - i; k++) this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; this.bytes_remaining = i + this.bytes_in_sequence - buffer.length, i = buffer.length - 1; } else this.appendStringBuf(buffer, i, i + this.bytes_in_sequence), i = i + this.bytes_in_sequence - 1; } else if (34 === n) this.tState = START, this.string += this.stringBuffer.toString("utf8", 0, this.stringBufferOffset), this.stringBufferOffset = 0, this.onToken(STRING, this.string), this.offset += Buffer.byteLength(this.string, "utf8") + 1, this.string = void 0; else if (92 === n) this.tState = STRING2; else { if (!(n >= 32)) return this.charError(buffer, i); this.appendStringChar(n); } else if (this.tState === STRING2) if (34 === (n = buffer[i])) this.appendStringChar(n), this.tState = STRING1; else if (92 === n) this.appendStringChar(BACK_SLASH), this.tState = STRING1; else if (47 === n) this.appendStringChar(FORWARD_SLASH), this.tState = STRING1; else if (98 === n) this.appendStringChar(BACKSPACE), this.tState = STRING1; else if (102 === n) this.appendStringChar(FORM_FEED), this.tState = STRING1; else if (110 === n) this.appendStringChar(NEWLINE), this.tState = STRING1; else if (114 === n) this.appendStringChar(CARRIAGE_RETURN), this.tState = STRING1; else if (116 === n) this.appendStringChar(TAB), this.tState = STRING1; else { if (117 !== n) return this.charError(buffer, i); this.unicode = "", this.tState = STRING3; } else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6) { if (!((n = buffer[i]) >= 48 && n < 64 || n > 64 && n <= 70 || n > 96 && n <= 102)) return this.charError(buffer, i); if (this.unicode += String.fromCharCode(n), this.tState++ === STRING6) { var intVal = parseInt(this.unicode, 16); this.unicode = void 0, void 0 !== this.highSurrogate && intVal >= 56320 && intVal < 57344 ? (this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal))), this.highSurrogate = void 0) : void 0 === this.highSurrogate && intVal >= 55296 && intVal < 56320 ? this.highSurrogate = intVal : (void 0 !== this.highSurrogate && (this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))), this.highSurrogate = void 0), this.appendStringBuf(new Buffer(String.fromCharCode(intVal)))), this.tState = STRING1; } } else if (this.tState === NUMBER1 || this.tState === NUMBER3) switch (n = buffer[i]) { case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: case 46: case 101: case 69: case 43: case 45: this.string += String.fromCharCode(n), this.tState = NUMBER3; break; default: this.tState = START; var result = Number(this.string); if (isNaN(result)) return this.charError(buffer, i); this.string.match(/[0-9]+/) == this.string && result.toString() != this.string ? this.onToken(STRING, this.string) : this.onToken(NUMBER, result), this.offset += this.string.length - 1, this.string = void 0, i--; } else if (this.tState === TRUE1) { if (114 !== buffer[i]) return this.charError(buffer, i); this.tState = TRUE2; } else if (this.tState === TRUE2) { if (117 !== buffer[i]) return this.charError(buffer, i); this.tState = TRUE3; } else if (this.tState === TRUE3) { if (101 !== buffer[i]) return this.charError(buffer, i); this.tState = START, this.onToken(TRUE, !0), this.offset += 3; } else if (this.tState === FALSE1) { if (97 !== buffer[i]) return this.charError(buffer, i); this.tState = FALSE2; } else if (this.tState === FALSE2) { if (108 !== buffer[i]) return this.charError(buffer, i); this.tState = FALSE3; } else if (this.tState === FALSE3) { if (115 !== buffer[i]) return this.charError(buffer, i); this.tState = FALSE4; } else if (this.tState === FALSE4) { if (101 !== buffer[i]) return this.charError(buffer, i); this.tState = START, this.onToken(FALSE, !1), this.offset += 4; } else if (this.tState === NULL1) { if (117 !== buffer[i]) return this.charError(buffer, i); this.tState = NULL2; } else if (this.tState === NULL2) { if (108 !== buffer[i]) return this.charError(buffer, i); this.tState = NULL3; } else if (this.tState === NULL3) { if (108 !== buffer[i]) return this.charError(buffer, i); this.tState = START, this.onToken(NULL, null), this.offset += 3; } }, proto.onToken = function(token, value) {}, proto.parseError = function(token, value) { this.tState = STOP, this.onError(new Error("Unexpected " + Parser.toknam(token) + (value ? "(" + JSON.stringify(value) + ")" : "") + " in state " + Parser.toknam(this.state))); }, proto.push = function() { this.stack.push({ value: this.value, key: this.key, mode: this.mode }); }, proto.pop = function() { var value = this.value, parent = this.stack.pop(); this.value = parent.value, this.key = parent.key, this.mode = parent.mode, this.emit(value), this.mode || (this.state = VALUE); }, proto.emit = function(value) { this.mode && (this.state = COMMA), this.onValue(value); }, proto.onValue = function(value) {}, proto.onToken = function(token, value) { if (this.state === VALUE) if (token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL) this.value && (this.value[this.key] = value), this.emit(value); else if (token === LEFT_BRACE) this.push(), this.value ? this.value = this.value[this.key] = {} : this.value = {}, this.key = void 0, this.state = KEY, this.mode = OBJECT; else if (token === LEFT_BRACKET) this.push(), this.value ? this.value = this.value[this.key] = [] : this.value = [], this.key = 0, this.mode = ARRAY, this.state = VALUE; else if (token === RIGHT_BRACE) { if (this.mode !== OBJECT) return this.parseError(token, value); this.pop(); } else { if (token !== RIGHT_BRACKET) return this.parseError(token, value); if (this.mode !== ARRAY) return this.parseError(token, value); this.pop(); } else if (this.state === KEY) if (token === STRING) this.key = value, this.state = COLON; else { if (token !== RIGHT_BRACE) return this.parseError(token, value); this.pop(); } else if (this.state === COLON) { if (token !== COLON) return this.parseError(token, value); this.state = VALUE; } else { if (this.state !== COMMA) return this.parseError(token, value); if (token === COMMA) this.mode === ARRAY ? (this.key++, this.state = VALUE) : this.mode === OBJECT && (this.state = KEY); else { if (!(token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT)) return this.parseError(token, value); this.pop(); } } }, Parser.C = C, module.exports = Parser; }, function(module, exports, __webpack_require__) { var Stream = __webpack_require__(3); function through(write, end, opts) { write = write || function(data) { this.queue(data); }, end = end || function() { this.queue(null); }; var ended = !1, destroyed = !1, buffer = [], _ended = !1, stream = new Stream; function drain() { for (;buffer.length && !stream.paused; ) { var data = buffer.shift(); if (null === data) return stream.emit("end"); stream.emit("data", data); } } function _end() { stream.writable = !1, end.call(stream), !stream.readable && stream.autoDestroy && stream.destroy(); } return stream.readable = stream.writable = !0, stream.paused = !1, stream.autoDestroy = !(opts && !1 === opts.autoDestroy), stream.write = function(data) { return write.call(this, data), !stream.paused; }, stream.queue = stream.push = function(data) { return _ended || (null === data && (_ended = !0), buffer.push(data), drain()), stream; }, stream.on("end", (function() { stream.readable = !1, !stream.writable && stream.autoDestroy && process.nextTick((function() { stream.destroy(); })); })), stream.end = function(data) { if (!ended) return ended = !0, arguments.length && stream.write(data), _end(), stream; }, stream.destroy = function() { if (!destroyed) return destroyed = !0, ended = !0, buffer.length = 0, stream.writable = stream.readable = !1, stream.emit("close"), stream; }, stream.pause = function() { if (!stream.paused) return stream.paused = !0, stream; }, stream.resume = function() { return stream.paused && (stream.paused = !1, stream.emit("resume")), drain(), stream.paused || stream.emit("drain"), stream; }, stream; } module.exports = through, through.through = through; }, function(module, exports, __webpack_require__) { const querystring = __webpack_require__(24), {Mutex: Mutex} = __webpack_require__(437), userSettings = __webpack_require__(105), retrieveMediaSamples = __webpack_require__(440), probeMedia = __webpack_require__(432), m3u8 = __webpack_require__(466), MediaConverter = __webpack_require__(918), IGNORED_STREAM_CODECS = [ "dvb_subtitle", "dvd_subtitle", "hdmv_pgs_subtitle", "xsub" ]; class ConverterDestroyedError extends Error { constructor() { super("MasterConverter is destroyed"), this.name = "ConverterDestroyedError"; } } module.exports = function({ffmpeg: ffmpeg, ffprobe: ffprobe, id: id, mediaURL: mediaURL, maxAudioChannels: maxAudioChannels, videoCodecs: videoCodecs, audioCodecs: audioCodecs, forceTranscoding: forceTranscoding, profile: profile, maxWidth: maxWidth}) { if ("string" != typeof mediaURL || 0 === mediaURL.length) throw new Error("Invalid media url"); if ("number" == typeof maxAudioChannels && maxAudioChannels <= 0) throw new Error("Invalid audio channels"); let destroyed = !1; const queryData = { mediaURL: mediaURL }; maxAudioChannels && (queryData.maxAudioChannels = maxAudioChannels), forceTranscoding && (queryData.forceTranscoding = "1"), Array.isArray(videoCodecs) && (queryData.videoCodecs = videoCodecs), Array.isArray(audioCodecs) && (queryData.audioCodecs = audioCodecs), profile && (queryData.profile = profile), maxWidth && (queryData.maxWidth = maxWidth); const query = querystring.stringify(queryData), probe = { mutex: new Mutex(new ConverterDestroyedError), value: null, error: null, get: async () => { if (probe.mutex.isLocked() && await probe.mutex.acquire().then((release => release())), null !== probe.value) return probe.value; if (null !== probe.error) throw probe.error; const release = await probe.mutex.acquire(); try { process.env.HLS_DEBUG && console.log("HLSV2:probe:start", mediaURL); const {streams: streams, format: format} = await probeMedia({ ffprobe: ffprobe, mediaURL: mediaURL }).then((({streams: streams, format: format}) => ({ streams: streams.filter(((stream, index, streams) => "video" === stream.track && index === streams.findIndex((({track: track}) => "video" === track)) || "audio" === stream.track || "subtitle" === stream.track)), format: format }))); if (process.env.HLS_DEBUG && console.log("HLSV2:probe:result", JSON.stringify({ streams: streams, format: format }, null, 4)), !probe.mutex.isLocked()) throw new ConverterDestroyedError; if ("number" != typeof format.duration) throw new Error("Live media is not supported"); const avStreams = streams.filter((({track: track}) => "video" === track || "audio" === track)); if (0 === avStreams.length) throw new Error("No video or audio streams found"); let samples = {}; try { const avIndexes = avStreams.map((({index: index}) => index)); format.name.includes("mp4") ? samples = await retrieveMediaSamples.mp4(mediaURL, avIndexes) : format.name.includes("matroska") && (samples = await retrieveMediaSamples.matroska(mediaURL, avIndexes)); } catch (_) {} if (!probe.mutex.isLocked()) throw new ConverterDestroyedError; return probe.value = { streams: streams, format: format, samples: samples }, release(), probe.value; } catch (error) { throw process.env.HLS_DEBUG && console.log("HLSV2:probe:error", error), error instanceof ConverterDestroyedError || (probe.error = error), release(), error; } }, destroy: () => { probe.mutex.cancel(), value = null, error = null; } }, converters = { value: {}, get: async track => { if ("string" != typeof track) throw new Error("Invalid track requested"); if (!converters.value[track]) { const trackType = track.replace(/[0-9]/g, ""); Object.keys(converters.value).filter((track => track.startsWith(trackType))).sort(((trackA, trackB) => converters.value[trackB].touched - converters.value[trackA].touched)).slice(userSettings.transcodeTrackConcurrency - 1).forEach((track => { console.log(`hls-converter ${id} destroying track ${track} due to passing track concurrency of ${userSettings.transcodeTrackConcurrency}`), converters.value[track].destroy(), delete converters.value[track]; })), converters.value[track] = { mutex: new Mutex(new ConverterDestroyedError), value: null, error: null, touched: new Date, destroy: () => { converters.value[track].mutex.cancel(), converters.value[track].value && converters.value[track].value.destroy(), converters.value[track].value = null, converters.value[track].error = null; } }; } const converter = converters.value[track]; if (converter.touched.setTime(Date.now()), converter.mutex.isLocked() && await converter.mutex.acquire().then((release => release())), null !== converter.value) return converter.value; if (null !== converter.error) throw converter.error; const release = await converter.mutex.acquire(); try { const {streams: streams, format: format, samples: samples} = await probe.get(), stream = streams.find((stream => `${stream.track}${stream.id}` === track)); if (!stream) throw new Error("Track not found"); return converter.value = new MediaConverter({ ffmpeg: ffmpeg, mediaURL: mediaURL, maxAudioChannels: maxAudioChannels, videoCodecs: videoCodecs, audioCodecs: audioCodecs, forceTranscoding: forceTranscoding, profile: profile, maxWidth: maxWidth, stream: stream, format: format, samples: samples[stream.index] ? samples[stream.index].samples : [], sampleDuration: samples[stream.index] ? samples[stream.index].sampleDuration : null, query: query }), release(), converter.value; } catch (error) { throw error instanceof ConverterDestroyedError || (converter.error = error), release(), error; } }, destroy: () => { Object.values(converters.value).forEach((converter => { converter.destroy(); })), converters.value = {}; } }; this.playlist = async track => { if (destroyed) throw new ConverterDestroyedError; if ("master" === track) { const {streams: streams} = await probe.get(); return m3u8.master({ streams: streams.filter((stream => -1 === IGNORED_STREAM_CODECS.indexOf(stream.codec))), query: query }); } return (await converters.get(track)).playlist(); }, this.initSegment = async track => { if (destroyed) throw new ConverterDestroyedError; return (await converters.get(track)).initSegment(); }, this.mediaSegment = async (track, sequenceNumber) => { if (destroyed) throw new ConverterDestroyedError; return (await converters.get(track)).mediaSegment(sequenceNumber); }, this.burnSubtitles = async ({url: url, id: id}) => { if (destroyed) throw new ConverterDestroyedError; return (await converters.get("video0")).burnSubtitles({ url: url, id: id }); }, this.status = async () => { if (destroyed) throw new ConverterDestroyedError; const result = { query: query, probe: { value: probe.value, error: probe.error ? probe.error.toString() : null }, converters: {} }; for (const track of Object.keys(converters.value)) try { const converter = await converters.get(track); result.converters[track] = await converter.status(); } catch (error) { result.converters[track] = error.toString(); } return result; }, this.destroy = () => { destroyed = !0, probe.destroy(), converters.destroy(); }; }; }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); var tslib_1 = __webpack_require__(143), Semaphore_1 = __webpack_require__(438), Mutex = (function() { function Mutex(cancelError) { this._semaphore = new Semaphore_1.default(1, cancelError); } return Mutex.prototype.acquire = function() { return (0, tslib_1.__awaiter)(this, void 0, void 0, (function() { return (0, tslib_1.__generator)(this, (function(_b) { switch (_b.label) { case 0: return [ 4, this._semaphore.acquire() ]; case 1: return [ 2, _b.sent()[1] ]; } })); })); }, Mutex.prototype.runExclusive = function(callback) { return this._semaphore.runExclusive((function() { return callback(); })); }, Mutex.prototype.isLocked = function() { return this._semaphore.isLocked(); }, Mutex.prototype.waitForUnlock = function() { return this._semaphore.waitForUnlock(); }, Mutex.prototype.release = function() { this._semaphore.release(); }, Mutex.prototype.cancel = function() { return this._semaphore.cancel(); }, Mutex; })(); exports.default = Mutex; }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.tryAcquire = void 0; var errors_1 = __webpack_require__(144), withTimeout_1 = __webpack_require__(439); exports.tryAcquire = function(sync, alreadyAcquiredError) { return void 0 === alreadyAcquiredError && (alreadyAcquiredError = errors_1.E_ALREADY_LOCKED), (0, withTimeout_1.withTimeout)(sync, 0, alreadyAcquiredError); }; }, function(module, exports, __webpack_require__) { const {Decoder: Decoder, Schema: Schema} = __webpack_require__(871), TRACK_TYPE_NAMES = { 1: "video", 2: "audio" }; module.exports = async function(url, trackIndexes = []) { const segment = (await (async function(url, ebmlIDs = [], skipTags = {}) { return new Promise(((resolve, reject) => { new Decoder({ skipTags: skipTags }).parseEbmlIDs(url, ebmlIDs, ((error, document) => { error ? reject(error) : resolve(document); })); })); })(url, [ Schema.byName.Info, Schema.byName.Cues, Schema.byName.Tracks ], { SimpleBlock: !0, Void: !0, Block: !0, FileData: !0, TagBinary: !0 })).children.find((({ebmlID: ebmlID}) => ebmlID === Schema.byName.Segment)); if (!segment) throw new Error("Segment element missing"); const info = segment.children.find((({ebmlID: ebmlID}) => ebmlID === Schema.byName.Info)); if (!info) throw new Error("Info element missing"); const tracks = segment.children.find((({ebmlID: ebmlID}) => ebmlID === Schema.byName.Tracks)); if (!tracks) throw new Error("Tracks element missing"); const cues = segment.children.find((({ebmlID: ebmlID}) => ebmlID === Schema.byName.Cues)), cuesPoints = (cues ? cues.children : []).filter((({ebmlID: ebmlID}) => ebmlID === Schema.byName.CuePoint)), timecodeScale = info.timecodeScale; return tracks.children.filter((({ebmlID: ebmlID}) => ebmlID === Schema.byName.TrackEntry)).reduce(((result, track, index) => { const trackNumber = track.trackNumber, trackType = track.trackType, defaultDuration = track.defaultDuration; if (!TRACK_TYPE_NAMES[trackType] || trackIndexes.length > 0 && !trackIndexes.includes(index)) return result; const type = TRACK_TYPE_NAMES[trackType], timescale = timecodeScale / 1e3, sampleDuration = "number" == typeof defaultDuration ? defaultDuration / timecodeScale : null, samples = cuesPoints.reduce(((result, cuePoint) => { if (cuePoint.children.find((({ebmlID: ebmlID}) => ebmlID === Schema.byName.CueTrackPositions)).children.find((({ebmlID: ebmlID}) => ebmlID === Schema.byName.CueTrack)).getUInt() === trackNumber) { const cueTime = cuePoint.children.find((({ebmlID: ebmlID}) => ebmlID === Schema.byName.CueTime)); result.push({ key: !0, pts: cueTime.getUInt() }); } return result; }), []).sort(((a, b) => a.pts - b.pts)); return { ...result, [index]: { type: type, timescale: timescale, sampleDuration: sampleDuration, samples: samples } }; }), {}); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { Decoder: __webpack_require__(872), Document: __webpack_require__(441), Schema: __webpack_require__(13), FileSource: __webpack_require__(444), HttpSource: __webpack_require__(445), StreamFactorySource: __webpack_require__(878) }; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(46)("matroska:decoder"), debugTag = __webpack_require__(46)("matroska:decoder:tag"), url = (__webpack_require__(2), __webpack_require__(7)), util = (__webpack_require__(10).SlowBuffer, __webpack_require__(0)), Writable = __webpack_require__(3).Writable, Document2 = __webpack_require__(874), Source = __webpack_require__(443), FileSource = __webpack_require__(444), HttpSource = __webpack_require__(445), tools = __webpack_require__(86), schema = __webpack_require__(13); function Decoder(options) { Writable.call(this, options), options = options || {}, this.options = options, this.skipTags = options.skipTags, void 0 === this.skipTags && (this.skipTags = { SimpleBlock: !0, Void: !0, Block: !0, FileData: !0, TagBinary: !0 }), this._streamSession = {}, this.ignoreData = options.ignoreData, this._buffer = null, this._tag_stack = [], this._state = 1, this._bufferOffset = 0, this._fileOffset = 0, this._tagVint = {}, this._workingBuffer = new Buffer(64), this.document = new Document2, this._skipTagData = !0 === this.ignoreData; var self = this; this.on("finish", (function() { self.document._buildLinks(), self.emit("$document", self.document); })); } module.exports = Decoder, util.inherits(Decoder, Writable), Decoder.OnlyMetaDatas = function() { return { skipTags: { SimpleBlock: !0, Void: !0, Block: !0, FileData: !0, Cluster: !0, Cues: !0, Tracks: !0 } }; }, Decoder.AllDatas = function() { return { skipTags: {} }; }, Decoder.prototype._getStream = function(source, callback) { var self = this, enabled = !0; debug("Request stream ", self._readOffset), source.getStream(this._streamSession, { start: self._readOffset }, (function(error, stream) { if (error) return callback(error); self._fileOffset = self._readOffset, self._buffer = null, self._bufferOffset = 0, self._skipBytes = 0, stream.on("end", (function() { enabled && (enabled = !1, callback(null, self.document)); })), stream.on("error", (function(error) { enabled && callback(error); })), stream.on("readable", (function() { if (enabled) { for (var bs = []; ;) { var b = stream.read(); if (!b) break; bs.push(b); } if (bs.length) { var buffer = bs.length > 1 ? Buffer.concat(bs) : bs[0], bytesRead = buffer.length; if (self._skipBytes) { if (debug.enabled && debug("SkipBytes catch " + bytesRead + "/" + self._skipBytes), bytesRead <= self._skipBytes) return self._skipBytes -= bytesRead, void (self._fileOffset += bytesRead); bytesRead = (buffer = buffer.slice(self._skipBytes)).length, self._fileOffset += self._skipBytes, self._skipBytes = 0; } self._readOffset += bytesRead; var currentPosition = self._readOffset; debug.enabled && debug("Buffer Read length=", bytesRead, " readOffset=" + self._readOffset + " fileOffset=" + self._fileOffset), self._write(buffer, null, (function() { if (self._stop) return enabled = !1, void callback(self._parsingError, self.document); if (self._skipBytes) { if (debug.enabled && debug("skipBytes " + self._skipBytes), self._buffer) { var left = self._buffer.length - self._bufferOffset; if (debug("skipBytes left=" + left), self._skipBytes <= left) return self._bufferOffset += self._skipBytes, self._fileOffset += self._skipBytes, void (self._skipBytes = 0); self._skipBytes -= left, self._fileOffset += left, self._buffer = null, self._bufferOffset = 0; } if (self._skipBytes < 32e3) return; self._readOffset += self._skipBytes; } return currentPosition !== self._readOffset ? (debug.enabled && debug("Read offset changed to " + self._readOffset), enabled = !1, stream.destroy(), void setImmediate(self._getStream.bind(self, source, callback))) : void 0; })); } else debug("No buffer"); } })); })); }, Decoder.prototype.parse = function(source, callback) { if (this.document.children) return callback(new Error("Document has already children")); if ("string" == typeof source && (/^http(s?):\/\//.test(source) ? source = new HttpSource(source) : (/^file:\/\//.test(source) && (source = url.fileURLToPath(source)), source = new FileSource(source))), source instanceof Source == 0) throw new Error("Invalid source parameter (" + source + ")"); this.document.source = source, this._skipTagData = !0 === this.ignoreData, this._readOffset = 0; var self = this; this._getStream(source, (function(error, document) { source.end(self._streamSession, (function() { document && document._buildLinks(), callback(error, document); })); })); }, Decoder.prototype._write = function(chunk, enc, done) { if (debug.enabled && debug("State=" + this._state + " skip=" + this._skipBytes + " bufferOffset=" + this._bufferOffset + " chunk=" + chunk.length), 4 === this._state) { if (this._skipBytes >= chunk.length ? (this._skipBytes -= chunk.length, this._fileOffset += chunk.length, this._bufferOffset = 0, chunk = null) : (this._fileOffset += this._skipBytes, this._bufferOffset = this._skipBytes, this._skipBytes = 0), this._skipBytes || (this._skipEndFunc && (this._skipEndFunc(), this._skipEndFunc = null), this._state = 1), !chunk || !chunk.length) return void done(); this._buffer = null; } if (this._buffer) { var buf = this._buffer; this._bufferOffset && (buf = buf.slice(this._bufferOffset)), this._buffer = Buffer.concat([ buf, chunk ]); } else this._buffer = chunk; this._bufferOffset = 0; try { for (;!this._stop && this._buffer && this._bufferOffset < this._buffer.length; ) if (1 !== this._state) { if (2 !== this._state) { if (3 !== this._state) { if (4 === this._state) break; debug("Invalid state ", this._state); } else if (!this.readContent()) break; } else if (!this.readSize()) break; } else if (!this.readTag()) break; } catch (x) { return this._parsingError = x, this._stop = !0, void done(); } this._buffer && this._bufferOffset === this._buffer.length && (this._buffer = null, this._bufferOffset = 0), done(); }, Decoder.prototype.readTag = function() { debugTag.enabled && debugTag("parsing tag"); var tag, start = this._fileOffset; try { tag = tools.readHInt(this._buffer, this._bufferOffset, this._tagVint); } catch (x) { throw x; } if (null === tag) return !this._EBMLFormatVerified && this._buffer.length > 7 ? (debug("Invalid format !"), this._parsingError = new Error("Invalid format for " + this.document), this._stop = !0, !1) : (debug("waiting for more data"), !1); if (!this._EBMLFormatVerified) { if (tag.value !== schema.byName.EBML) return debug("Invalid format !"), this._parsingError = new Error("Invalid format for " + this.document), this._stop = !0, !1; this._EBMLFormatVerified = !0; } this._bufferOffset += tag.length, this._fileOffset += tag.length, this._state = 2; var parent, stack = this._tag_stack; stack.length && (parent = stack[stack.length - 1]); var tagObj = this.document.createElement(tag.value, start, tag.length); return (parent || this.document).appendChild(tagObj, !1), stack.push(tagObj), debugTag.enabled && debugTag("push tag: " + util.inspect(tagObj, { depth: 1 })), !0; }, Decoder.prototype.readSize = function() { var tagObj = this._tag_stack[this._tag_stack.length - 1]; debugTag.enabled && debugTag("parsing size for tag: 0x" + tagObj.ebmlID.toString(16)); var size = tools.readVInt(this._buffer, this._bufferOffset, this._tagVint); if (null === size) return debugTag.enabled && debugTag("waiting for more data (size is null) " + this._bufferOffset + "/" + this._buffer.length), !1; if (size.value < 0) throw new Error("Invalid size " + size.value + " cursor=" + this._bufferOffset + " buffer=" + this._buffer.length); return this._bufferOffset += size.length, this._fileOffset += size.length, this._state = 3, tagObj._setDataSize(size.value, size.length), debugTag.enabled && debugTag("read size: " + size.value), 0 !== size.value || this.endContent(tagObj); }, Decoder.prototype.readContent = function() { var stack = this._tag_stack, tag = stack[stack.length - 1]; if (debugTag.enabled && debugTag("parsing content for tag: " + tag.ebmlID.toString(16)), tag.masterType) { if (debugTag.enabled && debugTag("content should be tags"), this.emit(tag._name, tag), this._state = 1, this.skipTags && this.skipTags[tag._name]) { stack.pop(); var leftBytes = this._buffer.length - this._bufferOffset, contentBytes = tag.end - this._fileOffset; return contentBytes >= leftBytes ? (this._skipBytes = contentBytes - leftBytes, this._fileOffset += leftBytes, this._buffer = null, this._bufferOffset = 0, this._state = 4, !1) : (this._bufferOffset += contentBytes, this._fileOffset += contentBytes, !0); } return !0; } if ((leftBytes = this._buffer.length - this._bufferOffset) < tag.dataSize) return debugTag.enabled && debugTag("waiting for more data: got=" + leftBytes, "need=" + (tag.dataSize - leftBytes)), (this._skipTagData || this.skipTags && this.skipTags[tag._name]) && (this._skipBytes = tag.dataSize - leftBytes, this._fileOffset += leftBytes, this._buffer = null, this._bufferOffset = 0, this._state = 4, this._skipEndFunc = this.endContent.bind(this, tag)), !1; if (debugTag.enabled && debugTag("Get content data: got=" + leftBytes, "need=" + (tag.dataSize - leftBytes)), !(this.ignoreData || this.skipTags && this.skipTags[tag._name])) { var data = this._buffer.slice(this._bufferOffset, this._bufferOffset + tag.dataSize); tag._setData(data); } return this._fileOffset += tag.dataSize, this._buffer = this._buffer.slice(this._bufferOffset + tag.dataSize), this._bufferOffset = 0, this.endContent(tag); }, Decoder.prototype.endContent = function(tagObj) { var stack = this._tag_stack; for (stack.pop(); stack.length; ) { var topElement = stack[stack.length - 1]; if (this._fileOffset < topElement.end) break; debugTag.enabled && debugTag("Pop " + topElement._name), this.emit(topElement._name + ":end", topElement), stack.pop(); } return this.emit(tagObj._name, tagObj), debugTag.enabled && (tagObj.data ? tagObj.data.length <= 128 ? debugTag('read data: len="+tagData.length+" value=0x' + tagObj.data.toString("hex")) : debugTag("read data:", tagObj.data) : debugTag("read data: NULL")), debugTag.enabled && debugTag("Push " + util.inspect(tagObj, { depth: 0 })), this._state = 1, !0; }, Decoder.parseInfoTagsAndAttachments = function(source, callback) { new Decoder(Decoder.OnlyMetaDatas()).parseEbmlIDs(source, [ schema.byName.Info, schema.byName.Tags, schema.byName.Attachments ], callback); }, Decoder.prototype.parseEbmlIDs = function(source, ebmlIDs, callback) { util.isArray(ebmlIDs) || (ebmlIDs = [ ebmlIDs ]), this.document._partial = !0; var segmentContentPosition, self = this, toParse = {}, targets = {}, positions = []; function nextPosition() { if (positions.length) { var position = positions.shift(), newOffset = segmentContentPosition + position; if (debug.enabled && debug("New offset=" + newOffset, "fileOffset=", self._fileOffset, "bufferOffset=", self._bufferOffset, "buffer.length=", self._buffer.length), self._buffer) { var start = self._fileOffset - self._bufferOffset; if (newOffset >= start && newOffset < start + self._buffer.length) return self._fileOffset = newOffset, self._bufferOffset = newOffset - start, self._skipBytes = 0, void (self._state = 1); } if (newOffset > self._readOffset) return self._skipBytes = newOffset - self._readOffset, self._fileOffset = self._readOffset, self._buffer = null, self._bufferOffset = 0, void (self._state = 1); self._readOffset = newOffset, self._fileOffset = newOffset, self._buffer = null, self._bufferOffset = 0, self._skipBytes = 0, self._state = 1; } else self._stop = !0; } ebmlIDs.forEach((function(name) { var ebmlID = tools.convertEbmlID(name); if (!toParse[ebmlID]) { toParse[ebmlID] = !0; var ebmlName = schema.byEbmlID[ebmlID].name; self.on(ebmlName, (function(tag) { targets[tag.ebmlID] = tag; })), self.on(ebmlName + ":end", (function(tag) { nextPosition(); })); } })), this.on("Seek:end", (function(tag) { var sid = tag.seekID; toParse[sid] && positions.push(tag.seekPosition); })), this.on("SeekHead:end", (function(seekHead) { segmentContentPosition = seekHead.getLevel1().getContentPosition(), positions.sort((function(v1, v2) { return v1 - v2; })), nextPosition(); })), this.parse(source, (function(error, document) { if (error) return callback(error); callback(null, self.document, targets); })); }; }, function(module, exports) { function debug(name) { return debug.enabled(name) ? function(fmt) { fmt = coerce(fmt); var curr = new Date, ms = curr - (debug[name] || curr); debug[name] = curr, fmt = name + " " + fmt + " +" + debug.humanize(ms), window.console && console.log && Function.prototype.apply.call(console.log, console, arguments); } : function() {}; } function coerce(val) { return val instanceof Error ? val.stack || val.message : val; } module.exports = debug, debug.names = [], debug.skips = [], debug.enable = function(name) { try { localStorage.debug = name; } catch (e) {} for (var split = (name || "").split(/[\s,]+/), len = split.length, i = 0; i < len; i++) "-" === (name = split[i].replace("*", ".*?"))[0] ? debug.skips.push(new RegExp("^" + name.substr(1) + "$")) : debug.names.push(new RegExp("^" + name + "$")); }, debug.disable = function() { debug.enable(""); }, debug.humanize = function(ms) { return ms >= 36e5 ? (ms / 36e5).toFixed(1) + "h" : ms >= 6e4 ? (ms / 6e4).toFixed(1) + "m" : ms >= 1e3 ? (ms / 1e3 | 0) + "s" : ms + "ms"; }, debug.enabled = function(name) { for (var i = 0, len = debug.skips.length; i < len; i++) if (debug.skips[i].test(name)) return !1; for (i = 0, len = debug.names.length; i < len; i++) if (debug.names[i].test(name)) return !0; return !1; }; try { window.localStorage && debug.enable(localStorage.debug); } catch (e) {} }, function(module, exports, __webpack_require__) { "use strict"; var async = __webpack_require__(40), util = __webpack_require__(0), Document1 = __webpack_require__(875); function Document2() { Document1.call(this); } __webpack_require__(13), util.inherits(Document2, Document1), module.exports = Document2, Document2.prototype.optimizeData = function(options, callback) { return 1 === arguments.length && "function" == typeof options && (callback = options, options = null), this.children ? (options = options || {}, this.deepWalk((function(child) { child._optimizeData(options); })), callback()) : callback(); }, Document2.prototype.normalizeSegments = function(options, callback) { var segments = this.segments; options = options || {}, async.eachSeries(segments, (function(segment, callback) { segment.normalize(options, callback); }), callback); }, Document2.prototype._prepareDocument = function(options, callback) { var fcts = [], self = this; !1 !== options.normalizeSegments && fcts.push((function(callback) { self.normalizeSegments(options, callback); })), !1 !== options.optimizeData && fcts.push((function(callback) { self.optimizeData(options, callback); })), void 0 !== options.forceStereoMode && this.segments.forEach((function(segment) { segment.tracks.trackEntries.forEach((function(trackEntry) { try { var video = trackEntry.video; if (!video) return; video.stereoMode = options.forceStereoMode; } catch (x) {} })); })), self = this, async.series(fcts, (function(error) { if (error) return callback(error); Document1.prototype._prepareDocument.call(self, options, callback); })); }; }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(40); var util = __webpack_require__(0), Document = __webpack_require__(441), schema = __webpack_require__(13); function Document1() { Document.call(this); } util.inherits(Document1, Document), module.exports = Document1, Document1.prototype.getEBML = function() { return this.getFirstChildByName(schema.byName.EBML); }, Document1.prototype.getFirstSegment = function() { return this.getFirstChildByName(schema.byName.Segment); }, Object.defineProperty(Document1.prototype, "firstSegment", { iterable: !1, get: function() { return this.getFirstSegment(); } }), Object.defineProperty(Document1.prototype, "head", { iterable: !1, get: function() { return this.getEBML(); } }), Object.defineProperty(Document1.prototype, "segments", { iterable: !1, get: function() { return this.listChildrenByName(schema.byName.Segment); } }); }, function(module, exports, __webpack_require__) { var map = { "./_proto": 19, "./_proto.js": 19, "./attachedFile": 202, "./attachedFile.js": 202, "./attachments": 203, "./attachments.js": 203, "./audio": 204, "./audio.js": 204, "./crc-32": 205, "./crc-32.js": 205, "./cuePoint": 206, "./cuePoint.js": 206, "./cueReference": 207, "./cueReference.js": 207, "./cueTrackPositions": 209, "./cueTrackPositions.js": 209, "./cues": 208, "./cues.js": 208, "./element1": 47, "./element1.js": 47, "./info": 210, "./info.js": 210, "./masterElement": 30, "./masterElement.js": 30, "./seek": 211, "./seek.js": 211, "./seekHead": 212, "./seekHead.js": 212, "./segment": 145, "./segment.js": 145, "./segment1": 146, "./segment1.js": 146, "./segment2": 147, "./segment2.js": 147, "./segment3": 213, "./segment3.js": 213, "./simpleTag": 214, "./simpleTag.js": 214, "./tag": 215, "./tag.js": 215, "./tags": 216, "./tags.js": 216, "./targets": 217, "./targets.js": 217, "./trackEntry": 218, "./trackEntry.js": 218, "./tracks": 219, "./tracks.js": 219, "./video": 220, "./video.js": 220 }; function webpackContext(req) { var id = webpackContextResolve(req); return __webpack_require__(id); } function webpackContextResolve(req) { if (!__webpack_require__.o(map, req)) { var e = new Error("Cannot find module '" + req + "'"); throw e.code = "MODULE_NOT_FOUND", e; } return map[req]; } webpackContext.keys = function() { return Object.keys(map); }, webpackContext.resolve = webpackContextResolve, module.exports = webpackContext, webpackContext.id = 876; }, function(module, exports, __webpack_require__) { var debug; module.exports = function() { if (!debug) { try { debug = __webpack_require__(46)("follow-redirects"); } catch (error) {} "function" != typeof debug && (debug = function() {}); } debug.apply(null, arguments); }; }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(2); var util = __webpack_require__(0), AbstractSource = (__webpack_require__(46)("matroska:streamFactorySource"), __webpack_require__(221)); function StreamFactorySource(streamFactory) { if (AbstractSource.call(this), "function" != typeof streamFactory.getStream) throw new Error("Invalid streamFactory object (getStream function)"); if (streamFactory.end && "function" != typeof streamFactory.end) throw new Error("Invalid streamFactory object (end function)"); this.streamFactory = streamFactory; } util.inherits(StreamFactorySource, AbstractSource), module.exports = StreamFactorySource, StreamFactorySource.prototype.getStream = function(session, options, callback) { switch (arguments.length) { case 1: callback = session, session = null; break; case 2: callback = options, options = null; } this.streamFactory.getStream(session, options, callback); }, StreamFactorySource.prototype._end = function(session, callback) { if (!this.streamFactory.end) return callback(); this.streamFactory.end(session, callback); }, StreamFactorySource.prototype.toString = function() { return "[StreamFactorySource factory=" + this.streamFactory + "]"; }; }, function(module, exports, __webpack_require__) { const muxjs = __webpack_require__(447), getMoovBox = __webpack_require__(902), TRACK_TYPE_NAMES = { vide: "video", soun: "audio" }; module.exports = async function(url, trackIndexes = []) { const moovBuffer = await getMoovBox(url), moov = muxjs.mp4.tools.inspect(moovBuffer)[0], mvhd = moov.boxes.find((({type: type}) => "mvhd" === type)); if (!mvhd) throw new Error("mvhd atom missing"); return moov.boxes.filter((({type: type}) => "trak" === type)).reduce(((result, trak, index) => { const mdia = trak.boxes.find((({type: type}) => "mdia" === type)); if (!mdia) throw new Error("mdia atom missing"); const hdlr = mdia.boxes.find((({type: type}) => "hdlr" === type)); if (!hdlr) throw new Error("hdlr atom missing"); if (!TRACK_TYPE_NAMES[hdlr.handlerType] || trackIndexes.length > 0 && !trackIndexes.includes(index)) return result; const mdhd = mdia.boxes.find((({type: type}) => "mdhd" === type)); if (!mdhd) throw new Error("mdhd atom missing"); const minf = mdia.boxes.find((({type: type}) => "minf" === type)); if (!minf) throw new Error("minf atom missing"); const stbl = minf.boxes.find((({type: type}) => "stbl" === type)); if (!stbl) throw new Error("stbl atom missing"); const edts = trak.boxes.find((({type: type}) => "edts" === type)), elst = edts && edts.boxes.find((({type: type}) => "elst" === type)), stts = stbl.boxes.find((({type: type}) => "stts" === type)), ctts = stbl.boxes.find((({type: type}) => "ctts" === type)), stss = stbl.boxes.find((({type: type}) => "stss" === type)), type = TRACK_TYPE_NAMES[hdlr.handlerType], timescale = mdhd.timescale, startTime = (elst ? elst.edits : []).reduce(((result, {mediaTime: mediaTime, segmentDuration: segmentDuration}) => mediaTime >= 0 ? result - mediaTime : -1 === mediaTime ? result + Math.round(segmentDuration * timescale / mvhd.timescale) : result), 0), compositionOffsets = (ctts ? ctts.compositionOffsets : []).reduce(((result, {sampleCount: sampleCount, sampleOffset: sampleOffset}) => { for (let i = 0; i < sampleCount; i++) result.push(sampleOffset); return result; }), []), durations = (stts ? stts.timeToSamples : []).reduce(((result, {sampleCount: sampleCount, sampleDelta: sampleDelta}) => { for (let i = 0; i < sampleCount; i++) result.push(sampleDelta); return result; }), []), samples = durations.reduce(((result, duration, index) => { const dts = index > 0 ? result[index - 1].dts + result[index - 1].duration : 0, pts = dts + ("number" == typeof compositionOffsets[index] ? compositionOffsets[index] : 0); return result.push({ key: !stss || stss.syncSamples.includes(index + 1), pts: pts + (0 === index ? startTime : 0), dts: dts + (0 === index ? startTime : 0), duration: duration }), result; }), []), sampleDuration = samples.length > 0 ? samples.reduce(((result, {duration: duration}) => result + duration), 0) / samples.length : null; return { ...result, [index]: { type: type, timescale: timescale, sampleDuration: sampleDuration, samples: samples } }; }), {}); }; }, function(module, exports, __webpack_require__) { "use strict"; var ExpGolomb; ExpGolomb = function(workingData) { var workingBytesAvailable = workingData.byteLength, workingWord = 0, workingBitsAvailable = 0; this.length = function() { return 8 * workingBytesAvailable; }, this.bitsAvailable = function() { return 8 * workingBytesAvailable + workingBitsAvailable; }, this.loadWord = function() { var position = workingData.byteLength - workingBytesAvailable, workingBytes = new Uint8Array(4), availableBytes = Math.min(4, workingBytesAvailable); if (0 === availableBytes) throw new Error("no bytes available"); workingBytes.set(workingData.subarray(position, position + availableBytes)), workingWord = new DataView(workingBytes.buffer).getUint32(0), workingBitsAvailable = 8 * availableBytes, workingBytesAvailable -= availableBytes; }, this.skipBits = function(count) { var skipBytes; workingBitsAvailable > count ? (workingWord <<= count, workingBitsAvailable -= count) : (count -= workingBitsAvailable, count -= 8 * (skipBytes = Math.floor(count / 8)), workingBytesAvailable -= skipBytes, this.loadWord(), workingWord <<= count, workingBitsAvailable -= count); }, this.readBits = function(size) { var bits = Math.min(workingBitsAvailable, size), valu = workingWord >>> 32 - bits; return (workingBitsAvailable -= bits) > 0 ? workingWord <<= bits : workingBytesAvailable > 0 && this.loadWord(), (bits = size - bits) > 0 ? valu << bits | this.readBits(bits) : valu; }, this.skipLeadingZeros = function() { var leadingZeroCount; for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) if (0 != (workingWord & 2147483648 >>> leadingZeroCount)) return workingWord <<= leadingZeroCount, workingBitsAvailable -= leadingZeroCount, leadingZeroCount; return this.loadWord(), leadingZeroCount + this.skipLeadingZeros(); }, this.skipUnsignedExpGolomb = function() { this.skipBits(1 + this.skipLeadingZeros()); }, this.skipExpGolomb = function() { this.skipBits(1 + this.skipLeadingZeros()); }, this.readUnsignedExpGolomb = function() { var clz = this.skipLeadingZeros(); return this.readBits(clz + 1) - 1; }, this.readExpGolomb = function() { var valu = this.readUnsignedExpGolomb(); return 1 & valu ? 1 + valu >>> 1 : -1 * (valu >>> 1); }, this.readBoolean = function() { return 1 === this.readBits(1); }, this.readUnsignedByte = function() { return this.readBits(8); }, this.loadWord(); }, module.exports = ExpGolomb; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { generator: __webpack_require__(149), probe: __webpack_require__(882), Transmuxer: __webpack_require__(228).Transmuxer, AudioSegmentStream: __webpack_require__(228).AudioSegmentStream, VideoSegmentStream: __webpack_require__(228).VideoSegmentStream, CaptionParser: __webpack_require__(886) }; }, function(module, exports, __webpack_require__) { "use strict"; var timescale, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader, toUnsigned = __webpack_require__(150).toUnsigned, toHexString = __webpack_require__(150).toHexString, findBox = __webpack_require__(223), parseType = __webpack_require__(224), parseTfhd = __webpack_require__(225), parseTrun = __webpack_require__(226), parseTfdt = __webpack_require__(227); timescale = function(init) { return findBox(init, [ "moov", "trak" ]).reduce((function(result, trak) { var tkhd, version, index, id, mdhd; return (tkhd = findBox(trak, [ "tkhd" ])[0]) ? (version = tkhd[0], id = toUnsigned(tkhd[index = 0 === version ? 12 : 20] << 24 | tkhd[index + 1] << 16 | tkhd[index + 2] << 8 | tkhd[index + 3]), (mdhd = findBox(trak, [ "mdia", "mdhd" ])[0]) ? (index = 0 === (version = mdhd[0]) ? 12 : 20, result[id] = toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]), result) : null) : null; }), {}); }, startTime = function(timescale, fragment) { var trafs, baseTimes, result; return trafs = findBox(fragment, [ "moof", "traf" ]), baseTimes = [].concat.apply([], trafs.map((function(traf) { return findBox(traf, [ "tfhd" ]).map((function(tfhd) { var id, scale, baseTime; return id = toUnsigned(tfhd[4] << 24 | tfhd[5] << 16 | tfhd[6] << 8 | tfhd[7]), scale = timescale[id] || 9e4, baseTime = findBox(traf, [ "tfdt" ]).map((function(tfdt) { var version, result; return version = tfdt[0], result = toUnsigned(tfdt[4] << 24 | tfdt[5] << 16 | tfdt[6] << 8 | tfdt[7]), 1 === version && (result *= Math.pow(2, 32), result += toUnsigned(tfdt[8] << 24 | tfdt[9] << 16 | tfdt[10] << 8 | tfdt[11])), result; }))[0], (baseTime = "number" != typeof baseTime || isNaN(baseTime) ? 1 / 0 : baseTime) / scale; })); }))), result = Math.min.apply(null, baseTimes), isFinite(result) ? result : 0; }, compositionStartTime = function(timescales, fragment) { var trackId, trafBoxes = findBox(fragment, [ "moof", "traf" ]), baseMediaDecodeTime = 0, compositionTimeOffset = 0; if (trafBoxes && trafBoxes.length) { var tfhd = findBox(trafBoxes[0], [ "tfhd" ])[0], trun = findBox(trafBoxes[0], [ "trun" ])[0], tfdt = findBox(trafBoxes[0], [ "tfdt" ])[0]; if (tfhd && (trackId = parseTfhd(tfhd).trackId), tfdt && (baseMediaDecodeTime = parseTfdt(tfdt).baseMediaDecodeTime), trun) { var parsedTrun = parseTrun(trun); parsedTrun.samples && parsedTrun.samples.length && (compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0); } } return (baseMediaDecodeTime + compositionTimeOffset) / (timescales[trackId] || 9e4); }, getVideoTrackIds = function(init) { var traks = findBox(init, [ "moov", "trak" ]), videoTrackIds = []; return traks.forEach((function(trak) { var hdlrs = findBox(trak, [ "mdia", "hdlr" ]), tkhds = findBox(trak, [ "tkhd" ]); hdlrs.forEach((function(hdlr, index) { var view, trackId, handlerType = parseType(hdlr.subarray(8, 12)), tkhd = tkhds[index]; "vide" === handlerType && (trackId = 0 === (view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength)).getUint8(0) ? view.getUint32(12) : view.getUint32(20), videoTrackIds.push(trackId)); })); })), videoTrackIds; }, getTimescaleFromMediaHeader = function(mdhd) { var index = 0 === mdhd[0] ? 12 : 20; return toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]); }, getTracks = function(init) { var traks = findBox(init, [ "moov", "trak" ]), tracks = []; return traks.forEach((function(trak) { var view, tkhdVersion, track = {}, tkhd = findBox(trak, [ "tkhd" ])[0]; tkhd && (tkhdVersion = (view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength)).getUint8(0), track.id = 0 === tkhdVersion ? view.getUint32(12) : view.getUint32(20)); var hdlr = findBox(trak, [ "mdia", "hdlr" ])[0]; if (hdlr) { var type = parseType(hdlr.subarray(8, 12)); track.type = "vide" === type ? "video" : "soun" === type ? "audio" : type; } var stsd = findBox(trak, [ "mdia", "minf", "stbl", "stsd" ])[0]; if (stsd) { var sampleDescriptions = stsd.subarray(8); track.codec = parseType(sampleDescriptions.subarray(4, 8)); var codecConfig, codecBox = findBox(sampleDescriptions, [ track.codec ])[0]; codecBox && (/^[a-z]vc[1-9]$/i.test(track.codec) ? (codecConfig = codecBox.subarray(78), "avcC" === parseType(codecConfig.subarray(4, 8)) && codecConfig.length > 11 ? (track.codec += ".", track.codec += toHexString(codecConfig[9]), track.codec += toHexString(codecConfig[10]), track.codec += toHexString(codecConfig[11])) : track.codec = "avc1.4d400d") : /^mp4[a,v]$/i.test(track.codec) ? (codecConfig = codecBox.subarray(28), "esds" === parseType(codecConfig.subarray(4, 8)) && codecConfig.length > 20 && 0 !== codecConfig[19] ? (track.codec += "." + toHexString(codecConfig[19]), track.codec += "." + toHexString(codecConfig[20] >>> 2 & 63).replace(/^0/, "")) : track.codec = "mp4a.40.2") : track.codec = track.codec.toLowerCase()); } var mdhd = findBox(trak, [ "mdia", "mdhd" ])[0]; mdhd && (track.timescale = getTimescaleFromMediaHeader(mdhd)), tracks.push(track); })), tracks; }, module.exports = { findBox: findBox, parseType: parseType, timescale: timescale, startTime: startTime, compositionStartTime: compositionStartTime, videoTrackIds: getVideoTrackIds, tracks: getTracks, getTimescaleFromMediaHeader: getTimescaleFromMediaHeader }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(flags) { return { isLeading: (12 & flags[0]) >>> 2, dependsOn: 3 & flags[0], isDependedOn: (192 & flags[1]) >>> 6, hasRedundancy: (48 & flags[1]) >>> 4, paddingValue: (14 & flags[1]) >>> 1, isNonSyncSample: 1 & flags[1], degradationPriority: flags[2] << 8 | flags[3] }; }; }, function(module, exports, __webpack_require__) { "use strict"; var silence, highPrefix = [ 33, 16, 5, 32, 164, 27 ], lowPrefix = [ 33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252 ], zeroFill = function(count) { for (var a = []; count--; ) a.push(0); return a; }; module.exports = function() { if (!silence) { var coneOfSilence = { 96e3: [ highPrefix, [ 227, 64 ], zeroFill(154), [ 56 ] ], 88200: [ highPrefix, [ 231 ], zeroFill(170), [ 56 ] ], 64e3: [ highPrefix, [ 248, 192 ], zeroFill(240), [ 56 ] ], 48e3: [ highPrefix, [ 255, 192 ], zeroFill(268), [ 55, 148, 128 ], zeroFill(54), [ 112 ] ], 44100: [ highPrefix, [ 255, 192 ], zeroFill(268), [ 55, 163, 128 ], zeroFill(84), [ 112 ] ], 32e3: [ highPrefix, [ 255, 192 ], zeroFill(268), [ 55, 234 ], zeroFill(226), [ 112 ] ], 24e3: [ highPrefix, [ 255, 192 ], zeroFill(268), [ 55, 255, 128 ], zeroFill(268), [ 111, 112 ], zeroFill(126), [ 224 ] ], 16e3: [ highPrefix, [ 255, 192 ], zeroFill(268), [ 55, 255, 128 ], zeroFill(268), [ 111, 255 ], zeroFill(269), [ 223, 108 ], zeroFill(195), [ 1, 192 ] ], 12e3: [ lowPrefix, zeroFill(268), [ 3, 127, 248 ], zeroFill(268), [ 6, 255, 240 ], zeroFill(268), [ 13, 255, 224 ], zeroFill(268), [ 27, 253, 128 ], zeroFill(259), [ 56 ] ], 11025: [ lowPrefix, zeroFill(268), [ 3, 127, 248 ], zeroFill(268), [ 6, 255, 240 ], zeroFill(268), [ 13, 255, 224 ], zeroFill(268), [ 27, 255, 192 ], zeroFill(268), [ 55, 175, 128 ], zeroFill(108), [ 112 ] ], 8e3: [ lowPrefix, zeroFill(268), [ 3, 121, 16 ], zeroFill(47), [ 7 ] ] }; metaTable = coneOfSilence, silence = Object.keys(metaTable).reduce((function(obj, key) { return obj[key] = new Uint8Array(metaTable[key].reduce((function(arr, part) { return arr.concat(part); }), [])), obj; }), {}); } var metaTable; return silence; }; }, function(module, exports, __webpack_require__) { "use strict"; var _MetadataStream, Stream = __webpack_require__(38), StreamTypes = __webpack_require__(153), percentEncode = function(bytes, start, end) { var i, result = ""; for (i = start; i < end; i++) result += "%" + ("00" + bytes[i].toString(16)).slice(-2); return result; }, parseUtf8 = function(bytes, start, end) { return decodeURIComponent(percentEncode(bytes, start, end)); }, parseSyncSafeInteger = function(data) { return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3]; }, tagParsers = { TXXX: function(tag) { var i; if (3 === tag.data[0]) { for (i = 1; i < tag.data.length; i++) if (0 === tag.data[i]) { tag.description = parseUtf8(tag.data, 1, i), tag.value = parseUtf8(tag.data, i + 1, tag.data.length).replace(/\0*$/, ""); break; } tag.data = tag.value; } }, WXXX: function(tag) { var i; if (3 === tag.data[0]) for (i = 1; i < tag.data.length; i++) if (0 === tag.data[i]) { tag.description = parseUtf8(tag.data, 1, i), tag.url = parseUtf8(tag.data, i + 1, tag.data.length); break; } }, PRIV: function(tag) { var i, bytes; for (i = 0; i < tag.data.length; i++) if (0 === tag.data[i]) { tag.owner = (bytes = tag.data, unescape(percentEncode(bytes, 0, i))); break; } tag.privateData = tag.data.subarray(i + 1), tag.data = tag.privateData; } }; (_MetadataStream = function(options) { var i, settings = { descriptor: options && options.descriptor }, tagSize = 0, buffer = [], bufferSize = 0; if (_MetadataStream.prototype.init.call(this), this.dispatchType = StreamTypes.METADATA_STREAM_TYPE.toString(16), settings.descriptor) for (i = 0; i < settings.descriptor.length; i++) this.dispatchType += ("00" + settings.descriptor[i].toString(16)).slice(-2); this.push = function(chunk) { var tag, frameStart, frameSize, frame, i; if ("timed-metadata" === chunk.type) if (chunk.dataAlignmentIndicator && (bufferSize = 0, buffer.length = 0), 0 === buffer.length && (chunk.data.length < 10 || chunk.data[0] !== "I".charCodeAt(0) || chunk.data[1] !== "D".charCodeAt(0) || chunk.data[2] !== "3".charCodeAt(0))) this.trigger("log", { level: "warn", message: "Skipping unrecognized metadata packet" }); else if (buffer.push(chunk), bufferSize += chunk.data.byteLength, 1 === buffer.length && (tagSize = parseSyncSafeInteger(chunk.data.subarray(6, 10)), tagSize += 10), !(bufferSize < tagSize)) { for (tag = { data: new Uint8Array(tagSize), frames: [], pts: buffer[0].pts, dts: buffer[0].dts }, i = 0; i < tagSize; ) tag.data.set(buffer[0].data.subarray(0, tagSize - i), i), i += buffer[0].data.byteLength, bufferSize -= buffer[0].data.byteLength, buffer.shift(); frameStart = 10, 64 & tag.data[5] && (frameStart += 4, frameStart += parseSyncSafeInteger(tag.data.subarray(10, 14)), tagSize -= parseSyncSafeInteger(tag.data.subarray(16, 20))); do { if ((frameSize = parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8))) < 1) return void this.trigger("log", { level: "warn", message: "Malformed ID3 frame encountered. Skipping metadata parsing." }); if ((frame = { id: String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]), data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10) }).key = frame.id, tagParsers[frame.id] && (tagParsers[frame.id](frame), "com.apple.streaming.transportStreamTimestamp" === frame.owner)) { var d = frame.data, size = (1 & d[3]) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2; size *= 4, size += 3 & d[7], frame.timeStamp = size, void 0 === tag.pts && void 0 === tag.dts && (tag.pts = frame.timeStamp, tag.dts = frame.timeStamp), this.trigger("timestamp", frame); } tag.frames.push(frame), frameStart += 10, frameStart += frameSize; } while (frameStart < tagSize); this.trigger("data", tag); } }; }).prototype = new Stream, module.exports = _MetadataStream; }, function(module, exports, __webpack_require__) { "use strict"; var discardEmulationPreventionBytes = __webpack_require__(452).discardEmulationPreventionBytes, CaptionStream = __webpack_require__(451).CaptionStream, findBox = __webpack_require__(223), parseTfdt = __webpack_require__(227), parseTrun = __webpack_require__(226), parseTfhd = __webpack_require__(225), mapToSample = function(offset, samples) { for (var approximateOffset = offset, i = 0; i < samples.length; i++) { var sample = samples[i]; if (approximateOffset < sample.size) return sample; approximateOffset -= sample.size; } return null; }; module.exports = function() { var captionStream, segmentCache, trackId, timescale, parsedCaptions, parsingPartial, isInitialized = !1; this.isInitialized = function() { return isInitialized; }, this.init = function(options) { captionStream = new CaptionStream, isInitialized = !0, parsingPartial = !!options && options.isPartial, captionStream.on("data", (function(event) { event.startTime = event.startPts / timescale, event.endTime = event.endPts / timescale, parsedCaptions.captions.push(event), parsedCaptions.captionStreams[event.stream] = !0; })), captionStream.on("log", (function(log) { parsedCaptions.logs.push(log); })); }, this.isNewInit = function(videoTrackIds, timescales) { return !(videoTrackIds && 0 === videoTrackIds.length || timescales && "object" == typeof timescales && 0 === Object.keys(timescales).length || trackId === videoTrackIds[0] && timescale === timescales[trackId]); }, this.parse = function(segment, videoTrackIds, timescales) { var parsedData; if (!this.isInitialized()) return null; if (!videoTrackIds || !timescales) return null; if (this.isNewInit(videoTrackIds, timescales)) trackId = videoTrackIds[0], timescale = timescales[trackId]; else if (null === trackId || !timescale) return segmentCache.push(segment), null; for (;segmentCache.length > 0; ) { var cachedSegment = segmentCache.shift(); this.parse(cachedSegment, videoTrackIds, timescales); } return parsedData = (function(segment, trackId, timescale) { if (null === trackId) return null; var trackNals = (function(segment, videoTrackId) { var trafs = findBox(segment, [ "moof", "traf" ]), mdats = findBox(segment, [ "mdat" ]), captionNals = {}, mdatTrafPairs = []; return mdats.forEach((function(mdat, index) { var matchingTraf = trafs[index]; mdatTrafPairs.push({ mdat: mdat, traf: matchingTraf }); })), mdatTrafPairs.forEach((function(pair) { var samples, result, mdat = pair.mdat, traf = pair.traf, tfhd = findBox(traf, [ "tfhd" ]), headerInfo = parseTfhd(tfhd[0]), trackId = headerInfo.trackId, tfdt = findBox(traf, [ "tfdt" ]), baseMediaDecodeTime = tfdt.length > 0 ? parseTfdt(tfdt[0]).baseMediaDecodeTime : 0, truns = findBox(traf, [ "trun" ]); videoTrackId === trackId && truns.length > 0 && (samples = (function(truns, baseMediaDecodeTime, tfhd) { var currentDts = baseMediaDecodeTime, defaultSampleDuration = tfhd.defaultSampleDuration || 0, defaultSampleSize = tfhd.defaultSampleSize || 0, trackId = tfhd.trackId, allSamples = []; return truns.forEach((function(trun) { var samples = parseTrun(trun).samples; samples.forEach((function(sample) { void 0 === sample.duration && (sample.duration = defaultSampleDuration), void 0 === sample.size && (sample.size = defaultSampleSize), sample.trackId = trackId, sample.dts = currentDts, void 0 === sample.compositionTimeOffset && (sample.compositionTimeOffset = 0), sample.pts = currentDts + sample.compositionTimeOffset, currentDts += sample.duration; })), allSamples = allSamples.concat(samples); })), allSamples; })(truns, baseMediaDecodeTime, headerInfo), result = (function(avcStream, samples, trackId) { var seiNal, i, length, lastMatchedSample, avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength), result = { logs: [], seiNals: [] }; for (i = 0; i + 4 < avcStream.length; i += length) if (length = avcView.getUint32(i), i += 4, !(length <= 0)) switch (31 & avcStream[i]) { case 6: var data = avcStream.subarray(i + 1, i + 1 + length), matchingSample = mapToSample(i, samples); if (seiNal = { nalUnitType: "sei_rbsp", size: length, data: data, escapedRBSP: discardEmulationPreventionBytes(data), trackId: trackId }, matchingSample) seiNal.pts = matchingSample.pts, seiNal.dts = matchingSample.dts, lastMatchedSample = matchingSample; else { if (!lastMatchedSample) { result.logs.push({ level: "warn", message: "We've encountered a nal unit without data at " + i + " for trackId " + trackId + ". See mux.js#223." }); break; } seiNal.pts = lastMatchedSample.pts, seiNal.dts = lastMatchedSample.dts; } result.seiNals.push(seiNal); } return result; })(mdat, samples, trackId), captionNals[trackId] || (captionNals[trackId] = { seiNals: [], logs: [] }), captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals), captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs)); })), captionNals; })(segment, trackId)[trackId] || {}; return { seiNals: trackNals.seiNals, logs: trackNals.logs, timescale: timescale }; })(segment, trackId, timescale), parsedData && parsedData.logs && (parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs)), null !== parsedData && parsedData.seiNals ? (this.pushNals(parsedData.seiNals), this.flushStream(), parsedCaptions) : parsedCaptions.logs.length ? { logs: parsedCaptions.logs, captions: [], captionStreams: [] } : null; }, this.pushNals = function(nals) { if (!this.isInitialized() || !nals || 0 === nals.length) return null; nals.forEach((function(nal) { captionStream.push(nal); })); }, this.flushStream = function() { if (!this.isInitialized()) return null; parsingPartial ? captionStream.partialFlush() : captionStream.flush(); }, this.clearParsedCaptions = function() { parsedCaptions.captions = [], parsedCaptions.captionStreams = {}, parsedCaptions.logs = []; }, this.resetCaptionStream = function() { if (!this.isInitialized()) return null; captionStream.reset(); }, this.clearAllCaptions = function() { this.clearParsedCaptions(), this.resetCaptionStream(); }, this.reset = function() { segmentCache = [], trackId = null, timescale = null, parsedCaptions ? this.clearParsedCaptions() : parsedCaptions = { captions: [], captionStreams: {}, logs: [] }, this.resetCaptionStream(); }, this.reset(); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { tag: __webpack_require__(229), Transmuxer: __webpack_require__(888), getFlvHeader: __webpack_require__(891) }; }, function(module, exports, __webpack_require__) { "use strict"; var _Transmuxer, _VideoSegmentStream, _AudioSegmentStream, collectTimelineInfo, metaDataTag, extraDataTag, Stream = __webpack_require__(38), FlvTag = __webpack_require__(229), m2ts = __webpack_require__(152), AdtsStream = __webpack_require__(148), H264Stream = __webpack_require__(222).H264Stream, CoalesceStream = __webpack_require__(889), TagList = __webpack_require__(890); collectTimelineInfo = function(track, data) { "number" == typeof data.pts && (void 0 === track.timelineStartInfo.pts ? track.timelineStartInfo.pts = data.pts : track.timelineStartInfo.pts = Math.min(track.timelineStartInfo.pts, data.pts)), "number" == typeof data.dts && (void 0 === track.timelineStartInfo.dts ? track.timelineStartInfo.dts = data.dts : track.timelineStartInfo.dts = Math.min(track.timelineStartInfo.dts, data.dts)); }, metaDataTag = function(track, pts) { var tag = new FlvTag(FlvTag.METADATA_TAG); return tag.dts = pts, tag.pts = pts, tag.writeMetaDataDouble("videocodecid", 7), tag.writeMetaDataDouble("width", track.width), tag.writeMetaDataDouble("height", track.height), tag; }, extraDataTag = function(track, pts) { var i, tag = new FlvTag(FlvTag.VIDEO_TAG, !0); for (tag.dts = pts, tag.pts = pts, tag.writeByte(1), tag.writeByte(track.profileIdc), tag.writeByte(track.profileCompatibility), tag.writeByte(track.levelIdc), tag.writeByte(255), tag.writeByte(225), tag.writeShort(track.sps[0].length), tag.writeBytes(track.sps[0]), tag.writeByte(track.pps.length), i = 0; i < track.pps.length; ++i) tag.writeShort(track.pps[i].length), tag.writeBytes(track.pps[i]); return tag; }, (_AudioSegmentStream = function(track) { var oldExtraData, adtsFrames = [], videoKeyFrames = []; _AudioSegmentStream.prototype.init.call(this), this.push = function(data) { collectTimelineInfo(track, data), track && (track.audioobjecttype = data.audioobjecttype, track.channelcount = data.channelcount, track.samplerate = data.samplerate, track.samplingfrequencyindex = data.samplingfrequencyindex, track.samplesize = data.samplesize, track.extraData = track.audioobjecttype << 11 | track.samplingfrequencyindex << 7 | track.channelcount << 3), data.pts = Math.round(data.pts / 90), data.dts = Math.round(data.dts / 90), adtsFrames.push(data); }, this.flush = function() { var currentFrame, adtsFrame, lastMetaPts, tags = new TagList; if (0 !== adtsFrames.length) { for (lastMetaPts = -1 / 0; adtsFrames.length; ) currentFrame = adtsFrames.shift(), videoKeyFrames.length && currentFrame.pts >= videoKeyFrames[0] && (lastMetaPts = videoKeyFrames.shift(), this.writeMetaDataTags(tags, lastMetaPts)), (track.extraData !== oldExtraData || currentFrame.pts - lastMetaPts >= 1e3) && (this.writeMetaDataTags(tags, currentFrame.pts), oldExtraData = track.extraData, lastMetaPts = currentFrame.pts), (adtsFrame = new FlvTag(FlvTag.AUDIO_TAG)).pts = currentFrame.pts, adtsFrame.dts = currentFrame.dts, adtsFrame.writeBytes(currentFrame.data), tags.push(adtsFrame.finalize()); videoKeyFrames.length = 0, oldExtraData = null, this.trigger("data", { track: track, tags: tags.list }), this.trigger("done", "AudioSegmentStream"); } else this.trigger("done", "AudioSegmentStream"); }, this.writeMetaDataTags = function(tags, pts) { var adtsFrame; (adtsFrame = new FlvTag(FlvTag.METADATA_TAG)).pts = pts, adtsFrame.dts = pts, adtsFrame.writeMetaDataDouble("audiocodecid", 10), adtsFrame.writeMetaDataBoolean("stereo", 2 === track.channelcount), adtsFrame.writeMetaDataDouble("audiosamplerate", track.samplerate), adtsFrame.writeMetaDataDouble("audiosamplesize", 16), tags.push(adtsFrame.finalize()), (adtsFrame = new FlvTag(FlvTag.AUDIO_TAG, !0)).pts = pts, adtsFrame.dts = pts, adtsFrame.view.setUint16(adtsFrame.position, track.extraData), adtsFrame.position += 2, adtsFrame.length = Math.max(adtsFrame.length, adtsFrame.position), tags.push(adtsFrame.finalize()); }, this.onVideoKeyFrame = function(pts) { videoKeyFrames.push(pts); }; }).prototype = new Stream, (_VideoSegmentStream = function(track) { var config, h264Frame, nalUnits = []; _VideoSegmentStream.prototype.init.call(this), this.finishFrame = function(tags, frame) { if (frame) { if (config && track && track.newMetadata && (frame.keyFrame || 0 === tags.length)) { var metaTag = metaDataTag(config, frame.dts).finalize(), extraTag = extraDataTag(track, frame.dts).finalize(); metaTag.metaDataTag = extraTag.metaDataTag = !0, tags.push(metaTag), tags.push(extraTag), track.newMetadata = !1, this.trigger("keyframe", frame.dts); } frame.endNalUnit(), tags.push(frame.finalize()), h264Frame = null; } }, this.push = function(data) { collectTimelineInfo(track, data), data.pts = Math.round(data.pts / 90), data.dts = Math.round(data.dts / 90), nalUnits.push(data); }, this.flush = function() { for (var currentNal, tags = new TagList; nalUnits.length && "access_unit_delimiter_rbsp" !== nalUnits[0].nalUnitType; ) nalUnits.shift(); if (0 !== nalUnits.length) { for (;nalUnits.length; ) "seq_parameter_set_rbsp" === (currentNal = nalUnits.shift()).nalUnitType ? (track.newMetadata = !0, config = currentNal.config, track.width = config.width, track.height = config.height, track.sps = [ currentNal.data ], track.profileIdc = config.profileIdc, track.levelIdc = config.levelIdc, track.profileCompatibility = config.profileCompatibility, h264Frame.endNalUnit()) : "pic_parameter_set_rbsp" === currentNal.nalUnitType ? (track.newMetadata = !0, track.pps = [ currentNal.data ], h264Frame.endNalUnit()) : "access_unit_delimiter_rbsp" === currentNal.nalUnitType ? (h264Frame && this.finishFrame(tags, h264Frame), (h264Frame = new FlvTag(FlvTag.VIDEO_TAG)).pts = currentNal.pts, h264Frame.dts = currentNal.dts) : ("slice_layer_without_partitioning_rbsp_idr" === currentNal.nalUnitType && (h264Frame.keyFrame = !0), h264Frame.endNalUnit()), h264Frame.startNalUnit(), h264Frame.writeBytes(currentNal.data); h264Frame && this.finishFrame(tags, h264Frame), this.trigger("data", { track: track, tags: tags.list }), this.trigger("done", "VideoSegmentStream"); } else this.trigger("done", "VideoSegmentStream"); }; }).prototype = new Stream, (_Transmuxer = function(options) { var packetStream, parseStream, elementaryStream, videoTimestampRolloverStream, audioTimestampRolloverStream, timedMetadataTimestampRolloverStream, adtsStream, h264Stream, videoSegmentStream, audioSegmentStream, captionStream, coalesceStream, self = this; _Transmuxer.prototype.init.call(this), options = options || {}, this.metadataStream = new m2ts.MetadataStream, options.metadataStream = this.metadataStream, packetStream = new m2ts.TransportPacketStream, parseStream = new m2ts.TransportParseStream, elementaryStream = new m2ts.ElementaryStream, videoTimestampRolloverStream = new m2ts.TimestampRolloverStream("video"), audioTimestampRolloverStream = new m2ts.TimestampRolloverStream("audio"), timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream("timed-metadata"), adtsStream = new AdtsStream, h264Stream = new H264Stream, coalesceStream = new CoalesceStream(options), packetStream.pipe(parseStream).pipe(elementaryStream), elementaryStream.pipe(videoTimestampRolloverStream).pipe(h264Stream), elementaryStream.pipe(audioTimestampRolloverStream).pipe(adtsStream), elementaryStream.pipe(timedMetadataTimestampRolloverStream).pipe(this.metadataStream).pipe(coalesceStream), captionStream = new m2ts.CaptionStream(options), h264Stream.pipe(captionStream).pipe(coalesceStream), elementaryStream.on("data", (function(data) { var i, videoTrack, audioTrack; if ("metadata" === data.type) { for (i = data.tracks.length; i--; ) "video" === data.tracks[i].type ? videoTrack = data.tracks[i] : "audio" === data.tracks[i].type && (audioTrack = data.tracks[i]); videoTrack && !videoSegmentStream && (coalesceStream.numberOfTracks++, videoSegmentStream = new _VideoSegmentStream(videoTrack), h264Stream.pipe(videoSegmentStream).pipe(coalesceStream)), audioTrack && !audioSegmentStream && (coalesceStream.numberOfTracks++, audioSegmentStream = new _AudioSegmentStream(audioTrack), adtsStream.pipe(audioSegmentStream).pipe(coalesceStream), videoSegmentStream && videoSegmentStream.on("keyframe", audioSegmentStream.onVideoKeyFrame)); } })), this.push = function(data) { packetStream.push(data); }, this.flush = function() { packetStream.flush(); }, this.resetCaptions = function() { captionStream.reset(); }, coalesceStream.on("data", (function(event) { self.trigger("data", event); })), coalesceStream.on("done", (function() { self.trigger("done"); })); }).prototype = new Stream, module.exports = _Transmuxer; }, function(module, exports, __webpack_require__) { "use strict"; var Stream = __webpack_require__(38), CoalesceStream = function CoalesceStream(options) { this.numberOfTracks = 0, this.metadataStream = options.metadataStream, this.videoTags = [], this.audioTags = [], this.videoTrack = null, this.audioTrack = null, this.pendingCaptions = [], this.pendingMetadata = [], this.pendingTracks = 0, this.processedTracks = 0, CoalesceStream.prototype.init.call(this), this.push = function(output) { return output.text ? this.pendingCaptions.push(output) : output.frames ? this.pendingMetadata.push(output) : ("video" === output.track.type && (this.videoTrack = output.track, this.videoTags = output.tags, this.pendingTracks++), void ("audio" === output.track.type && (this.audioTrack = output.track, this.audioTags = output.tags, this.pendingTracks++))); }; }; (CoalesceStream.prototype = new Stream).flush = function(flushSource) { var id3, caption, i, timelineStartPts, event = { tags: {}, captions: [], captionStreams: {}, metadata: [] }; if (this.pendingTracks < this.numberOfTracks) { if ("VideoSegmentStream" !== flushSource && "AudioSegmentStream" !== flushSource) return; if (0 === this.pendingTracks && (this.processedTracks++, this.processedTracks < this.numberOfTracks)) return; } if (this.processedTracks += this.pendingTracks, this.pendingTracks = 0, !(this.processedTracks < this.numberOfTracks)) { for (this.videoTrack ? timelineStartPts = this.videoTrack.timelineStartInfo.pts : this.audioTrack && (timelineStartPts = this.audioTrack.timelineStartInfo.pts), event.tags.videoTags = this.videoTags, event.tags.audioTags = this.audioTags, i = 0; i < this.pendingCaptions.length; i++) (caption = this.pendingCaptions[i]).startTime = caption.startPts - timelineStartPts, caption.startTime /= 9e4, caption.endTime = caption.endPts - timelineStartPts, caption.endTime /= 9e4, event.captionStreams[caption.stream] = !0, event.captions.push(caption); for (i = 0; i < this.pendingMetadata.length; i++) (id3 = this.pendingMetadata[i]).cueTime = id3.pts - timelineStartPts, id3.cueTime /= 9e4, event.metadata.push(id3); event.metadata.dispatchType = this.metadataStream.dispatchType, this.videoTrack = null, this.audioTrack = null, this.videoTags = [], this.audioTags = [], this.pendingCaptions.length = 0, this.pendingMetadata.length = 0, this.pendingTracks = 0, this.processedTracks = 0, this.trigger("data", event), this.trigger("done"); } }, module.exports = CoalesceStream; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function() { var self = this; this.list = [], this.push = function(tag) { this.list.push({ bytes: tag.bytes, dts: tag.dts, pts: tag.pts, keyFrame: tag.keyFrame, metaDataTag: tag.metaDataTag }); }, Object.defineProperty(this, "length", { get: function() { return self.list.length; } }); }; }, function(module, exports, __webpack_require__) { "use strict"; var FlvTag = __webpack_require__(229); module.exports = function(duration, audio, video) { var metadata, result, metadataLength, headBytes = new Uint8Array(9), head = new DataView(headBytes.buffer); return duration = duration || 0, audio = void 0 === audio || audio, video = void 0 === video || video, head.setUint8(0, 70), head.setUint8(1, 76), head.setUint8(2, 86), head.setUint8(3, 1), head.setUint8(4, (audio ? 4 : 0) | (video ? 1 : 0)), head.setUint32(5, headBytes.byteLength), duration <= 0 ? ((result = new Uint8Array(headBytes.byteLength + 4)).set(headBytes), result.set([ 0, 0, 0, 0 ], headBytes.byteLength), result) : ((metadata = new FlvTag(FlvTag.METADATA_TAG)).pts = metadata.dts = 0, metadata.writeMetaDataDouble("duration", duration), metadataLength = metadata.finalize().length, (result = new Uint8Array(headBytes.byteLength + metadataLength)).set(headBytes), result.set(head.byteLength, metadataLength), result); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(152); }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { Transmuxer: __webpack_require__(894) }; }, function(module, exports, __webpack_require__) { "use strict"; var Stream = __webpack_require__(38), m2ts = __webpack_require__(152), codecs = __webpack_require__(448), AudioSegmentStream = __webpack_require__(895), VideoSegmentStream = __webpack_require__(896), trackInfo = __webpack_require__(151), isLikelyAacData = __webpack_require__(154).isLikelyAacData, AdtsStream = __webpack_require__(148), AacStream = __webpack_require__(454), clock = __webpack_require__(59), createPipeline = function(object) { return object.prototype = new Stream, object.prototype.init.call(object), object; }, setupPipelineListeners = function(pipeline, transmuxer) { pipeline.on("data", transmuxer.trigger.bind(transmuxer, "data")), pipeline.on("done", transmuxer.trigger.bind(transmuxer, "done")), pipeline.on("partialdone", transmuxer.trigger.bind(transmuxer, "partialdone")), pipeline.on("endedtimeline", transmuxer.trigger.bind(transmuxer, "endedtimeline")), pipeline.on("audioTimingInfo", transmuxer.trigger.bind(transmuxer, "audioTimingInfo")), pipeline.on("videoTimingInfo", transmuxer.trigger.bind(transmuxer, "videoTimingInfo")), pipeline.on("trackinfo", transmuxer.trigger.bind(transmuxer, "trackinfo")), pipeline.on("id3Frame", (function(event) { event.dispatchType = pipeline.metadataStream.dispatchType, event.cueTime = clock.videoTsToSeconds(event.pts), transmuxer.trigger("id3Frame", event); })), pipeline.on("caption", (function(event) { transmuxer.trigger("caption", event); })); }, Transmuxer = function Transmuxer(options) { var pipeline = null, hasFlushed = !0; options = options || {}, Transmuxer.prototype.init.call(this), options.baseMediaDecodeTime = options.baseMediaDecodeTime || 0, this.push = function(bytes) { if (hasFlushed) { var isAac = isLikelyAacData(bytes); !isAac || pipeline && "aac" === pipeline.type ? isAac || pipeline && "ts" === pipeline.type || (pipeline = (function(options) { var pipeline = { type: "ts", tracks: { audio: null, video: null }, packet: new m2ts.TransportPacketStream, parse: new m2ts.TransportParseStream, elementary: new m2ts.ElementaryStream, timestampRollover: new m2ts.TimestampRolloverStream, adts: new codecs.Adts, h264: new codecs.h264.H264Stream, captionStream: new m2ts.CaptionStream(options), metadataStream: new m2ts.MetadataStream }; return pipeline.headOfPipeline = pipeline.packet, pipeline.packet.pipe(pipeline.parse).pipe(pipeline.elementary).pipe(pipeline.timestampRollover), pipeline.timestampRollover.pipe(pipeline.h264), pipeline.h264.pipe(pipeline.captionStream), pipeline.timestampRollover.pipe(pipeline.metadataStream), pipeline.timestampRollover.pipe(pipeline.adts), pipeline.elementary.on("data", (function(data) { if ("metadata" === data.type) { for (var i = 0; i < data.tracks.length; i++) pipeline.tracks[data.tracks[i].type] || (pipeline.tracks[data.tracks[i].type] = data.tracks[i], pipeline.tracks[data.tracks[i].type].timelineStartInfo.baseMediaDecodeTime = options.baseMediaDecodeTime); pipeline.tracks.video && !pipeline.videoSegmentStream && (pipeline.videoSegmentStream = new VideoSegmentStream(pipeline.tracks.video, options), pipeline.videoSegmentStream.on("timelineStartInfo", (function(timelineStartInfo) { pipeline.tracks.audio && !options.keepOriginalTimestamps && pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - options.baseMediaDecodeTime); })), pipeline.videoSegmentStream.on("timingInfo", pipeline.trigger.bind(pipeline, "videoTimingInfo")), pipeline.videoSegmentStream.on("data", (function(data) { pipeline.trigger("data", { type: "video", data: data }); })), pipeline.videoSegmentStream.on("done", pipeline.trigger.bind(pipeline, "done")), pipeline.videoSegmentStream.on("partialdone", pipeline.trigger.bind(pipeline, "partialdone")), pipeline.videoSegmentStream.on("endedtimeline", pipeline.trigger.bind(pipeline, "endedtimeline")), pipeline.h264.pipe(pipeline.videoSegmentStream)), pipeline.tracks.audio && !pipeline.audioSegmentStream && (pipeline.audioSegmentStream = new AudioSegmentStream(pipeline.tracks.audio, options), pipeline.audioSegmentStream.on("data", (function(data) { pipeline.trigger("data", { type: "audio", data: data }); })), pipeline.audioSegmentStream.on("done", pipeline.trigger.bind(pipeline, "done")), pipeline.audioSegmentStream.on("partialdone", pipeline.trigger.bind(pipeline, "partialdone")), pipeline.audioSegmentStream.on("endedtimeline", pipeline.trigger.bind(pipeline, "endedtimeline")), pipeline.audioSegmentStream.on("timingInfo", pipeline.trigger.bind(pipeline, "audioTimingInfo")), pipeline.adts.pipe(pipeline.audioSegmentStream)), pipeline.trigger("trackinfo", { hasAudio: !!pipeline.tracks.audio, hasVideo: !!pipeline.tracks.video }); } })), pipeline.captionStream.on("data", (function(caption) { var timelineStartPts; timelineStartPts = pipeline.tracks.video && pipeline.tracks.video.timelineStartInfo.pts || 0, caption.startTime = clock.metadataTsToSeconds(caption.startPts, timelineStartPts, options.keepOriginalTimestamps), caption.endTime = clock.metadataTsToSeconds(caption.endPts, timelineStartPts, options.keepOriginalTimestamps), pipeline.trigger("caption", caption); })), (pipeline = createPipeline(pipeline)).metadataStream.on("data", pipeline.trigger.bind(pipeline, "id3Frame")), pipeline; })(options), setupPipelineListeners(pipeline, this)) : (pipeline = (function(options) { var pipeline = { type: "aac", tracks: { audio: null }, metadataStream: new m2ts.MetadataStream, aacStream: new AacStream, audioRollover: new m2ts.TimestampRolloverStream("audio"), timedMetadataRollover: new m2ts.TimestampRolloverStream("timed-metadata"), adtsStream: new AdtsStream(!0) }; return pipeline.headOfPipeline = pipeline.aacStream, pipeline.aacStream.pipe(pipeline.audioRollover).pipe(pipeline.adtsStream), pipeline.aacStream.pipe(pipeline.timedMetadataRollover).pipe(pipeline.metadataStream), pipeline.metadataStream.on("timestamp", (function(frame) { pipeline.aacStream.setTimestamp(frame.timeStamp); })), pipeline.aacStream.on("data", (function(data) { "timed-metadata" !== data.type && "audio" !== data.type || pipeline.audioSegmentStream || (pipeline.tracks.audio = pipeline.tracks.audio || { timelineStartInfo: { baseMediaDecodeTime: options.baseMediaDecodeTime }, codec: "adts", type: "audio" }, pipeline.audioSegmentStream = new AudioSegmentStream(pipeline.tracks.audio, options), pipeline.audioSegmentStream.on("data", (function(data) { pipeline.trigger("data", { type: "audio", data: data }); })), pipeline.audioSegmentStream.on("partialdone", pipeline.trigger.bind(pipeline, "partialdone")), pipeline.audioSegmentStream.on("done", pipeline.trigger.bind(pipeline, "done")), pipeline.audioSegmentStream.on("endedtimeline", pipeline.trigger.bind(pipeline, "endedtimeline")), pipeline.audioSegmentStream.on("timingInfo", pipeline.trigger.bind(pipeline, "audioTimingInfo")), pipeline.adtsStream.pipe(pipeline.audioSegmentStream), pipeline.trigger("trackinfo", { hasAudio: !!pipeline.tracks.audio, hasVideo: !!pipeline.tracks.video })); })), (pipeline = createPipeline(pipeline)).metadataStream.on("data", pipeline.trigger.bind(pipeline, "id3Frame")), pipeline; })(options), setupPipelineListeners(pipeline, this)), hasFlushed = !1; } pipeline.headOfPipeline.push(bytes); }, this.flush = function() { pipeline && (hasFlushed = !0, pipeline.headOfPipeline.flush()); }, this.partialFlush = function() { pipeline && pipeline.headOfPipeline.partialFlush(); }, this.endTimeline = function() { pipeline && pipeline.headOfPipeline.endTimeline(); }, this.reset = function() { pipeline && pipeline.headOfPipeline.reset(); }, this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) { options.keepOriginalTimestamps || (options.baseMediaDecodeTime = baseMediaDecodeTime), pipeline && (pipeline.tracks.audio && (pipeline.tracks.audio.timelineStartInfo.dts = void 0, pipeline.tracks.audio.timelineStartInfo.pts = void 0, trackInfo.clearDtsInfo(pipeline.tracks.audio), pipeline.audioRollover && pipeline.audioRollover.discontinuity()), pipeline.tracks.video && (pipeline.videoSegmentStream && (pipeline.videoSegmentStream.gopCache_ = []), pipeline.tracks.video.timelineStartInfo.dts = void 0, pipeline.tracks.video.timelineStartInfo.pts = void 0, trackInfo.clearDtsInfo(pipeline.tracks.video)), pipeline.timestampRollover && pipeline.timestampRollover.discontinuity()); }, this.setRemux = function(val) { options.remux = val, pipeline && pipeline.coalesceStream && pipeline.coalesceStream.setRemux(val); }, this.setAudioAppendStart = function(audioAppendStart) { pipeline && pipeline.tracks.audio && pipeline.audioSegmentStream && pipeline.audioSegmentStream.setAudioAppendStart(audioAppendStart); }, this.alignGopsWith = function(gopsToAlignWith) {}; }; Transmuxer.prototype = new Stream, module.exports = Transmuxer; }, function(module, exports, __webpack_require__) { "use strict"; var Stream = __webpack_require__(38), mp4 = __webpack_require__(149), audioFrameUtils = __webpack_require__(450), trackInfo = __webpack_require__(151), ONE_SECOND_IN_TS = __webpack_require__(59).ONE_SECOND_IN_TS, AUDIO_PROPERTIES = __webpack_require__(455), AudioSegmentStream = function AudioSegmentStream(track, options) { var adtsFrames = [], sequenceNumber = 0, earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = 1 / 0, segmentStartPts = null, segmentEndPts = null; options = options || {}, AudioSegmentStream.prototype.init.call(this), this.push = function(data) { trackInfo.collectDtsInfo(track, data), track && AUDIO_PROPERTIES.forEach((function(prop) { track[prop] = data[prop]; })), adtsFrames.push(data); }, this.setEarliestDts = function(earliestDts) { earliestAllowedDts = earliestDts; }, this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) { videoBaseMediaDecodeTime = baseMediaDecodeTime; }, this.setAudioAppendStart = function(timestamp) { audioAppendStartTs = timestamp; }, this.processFrames_ = function() { var frames, moof, mdat, boxes, timingInfo; 0 !== adtsFrames.length && 0 !== (frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts)).length && (track.baseMediaDecodeTime = trackInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps), audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime), track.samples = audioFrameUtils.generateSampleTable(frames), mdat = mp4.mdat(audioFrameUtils.concatenateFrameData(frames)), adtsFrames = [], moof = mp4.moof(sequenceNumber, [ track ]), sequenceNumber++, track.initSegment = mp4.initSegment([ track ]), (boxes = new Uint8Array(moof.byteLength + mdat.byteLength)).set(moof), boxes.set(mdat, moof.byteLength), trackInfo.clearDtsInfo(track), null === segmentStartPts && (segmentEndPts = segmentStartPts = frames[0].pts), segmentEndPts += frames.length * (1024 * ONE_SECOND_IN_TS / track.samplerate), timingInfo = { start: segmentStartPts }, this.trigger("timingInfo", timingInfo), this.trigger("data", { track: track, boxes: boxes })); }, this.flush = function() { this.processFrames_(), this.trigger("timingInfo", { start: segmentStartPts, end: segmentEndPts }), this.resetTiming_(), this.trigger("done", "AudioSegmentStream"); }, this.partialFlush = function() { this.processFrames_(), this.trigger("partialdone", "AudioSegmentStream"); }, this.endTimeline = function() { this.flush(), this.trigger("endedtimeline", "AudioSegmentStream"); }, this.resetTiming_ = function() { trackInfo.clearDtsInfo(track), segmentStartPts = null, segmentEndPts = null; }, this.reset = function() { this.resetTiming_(), adtsFrames = [], this.trigger("reset"); }; }; AudioSegmentStream.prototype = new Stream, module.exports = AudioSegmentStream; }, function(module, exports, __webpack_require__) { "use strict"; var Stream = __webpack_require__(38), mp4 = __webpack_require__(149), trackInfo = __webpack_require__(151), frameUtils = __webpack_require__(449), VIDEO_PROPERTIES = __webpack_require__(456), VideoSegmentStream = function VideoSegmentStream(track, options) { var config, pps, gops, sequenceNumber = 0, nalUnits = [], frameCache = [], segmentStartPts = null, segmentEndPts = null, ensureNextFrameIsKeyFrame = !0; options = options || {}, VideoSegmentStream.prototype.init.call(this), this.push = function(nalUnit) { trackInfo.collectDtsInfo(track, nalUnit), void 0 === track.timelineStartInfo.dts && (track.timelineStartInfo.dts = nalUnit.dts), "seq_parameter_set_rbsp" !== nalUnit.nalUnitType || config || (config = nalUnit.config, track.sps = [ nalUnit.data ], VIDEO_PROPERTIES.forEach((function(prop) { track[prop] = config[prop]; }), this)), "pic_parameter_set_rbsp" !== nalUnit.nalUnitType || pps || (pps = nalUnit.data, track.pps = [ nalUnit.data ]), nalUnits.push(nalUnit); }, this.processNals_ = function(cacheLastFrame) { var i; for (nalUnits = frameCache.concat(nalUnits); nalUnits.length && "access_unit_delimiter_rbsp" !== nalUnits[0].nalUnitType; ) nalUnits.shift(); if (0 !== nalUnits.length) { var frames = frameUtils.groupNalsIntoFrames(nalUnits); if (frames.length) if (frameCache = frames[frames.length - 1], cacheLastFrame && (frames.pop(), frames.duration -= frameCache.duration, frames.nalCount -= frameCache.length, frames.byteLength -= frameCache.byteLength), frames.length) { if (this.trigger("timelineStartInfo", track.timelineStartInfo), ensureNextFrameIsKeyFrame) { if (!(gops = frameUtils.groupFramesIntoGops(frames))[0][0].keyFrame) { if (!(gops = frameUtils.extendFirstKeyFrame(gops))[0][0].keyFrame) return nalUnits = [].concat.apply([], frames).concat(frameCache), void (frameCache = []); (frames = [].concat.apply([], gops)).duration = gops.duration; } ensureNextFrameIsKeyFrame = !1; } for (null === segmentStartPts && (segmentStartPts = frames[0].pts, segmentEndPts = segmentStartPts), segmentEndPts += frames.duration, this.trigger("timingInfo", { start: segmentStartPts, end: segmentEndPts }), i = 0; i < frames.length; i++) { var frame = frames[i]; track.samples = frameUtils.generateSampleTableForFrame(frame); var mdat = mp4.mdat(frameUtils.concatenateNalDataForFrame(frame)); trackInfo.clearDtsInfo(track), trackInfo.collectDtsInfo(track, frame), track.baseMediaDecodeTime = trackInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps); var moof = mp4.moof(sequenceNumber, [ track ]); sequenceNumber++, track.initSegment = mp4.initSegment([ track ]); var boxes = new Uint8Array(moof.byteLength + mdat.byteLength); boxes.set(moof), boxes.set(mdat, moof.byteLength), this.trigger("data", { track: track, boxes: boxes, sequence: sequenceNumber, videoFrameDts: frame.dts, videoFramePts: frame.pts }); } nalUnits = []; } else nalUnits = []; } }, this.resetTimingAndConfig_ = function() { config = void 0, pps = void 0, segmentStartPts = null, segmentEndPts = null; }, this.partialFlush = function() { this.processNals_(!0), this.trigger("partialdone", "VideoSegmentStream"); }, this.flush = function() { this.processNals_(!1), this.resetTimingAndConfig_(), this.trigger("done", "VideoSegmentStream"); }, this.endTimeline = function() { this.flush(), this.trigger("endedtimeline", "VideoSegmentStream"); }, this.reset = function() { this.resetTimingAndConfig_(), frameCache = [], nalUnits = [], ensureNextFrameIsKeyFrame = !0, this.trigger("reset"); }; }; VideoSegmentStream.prototype = new Stream, module.exports = VideoSegmentStream; }, function(module, exports, __webpack_require__) { "use strict"; var inspectMp4, _textifyMp, MAX_UINT32 = Math.pow(2, 32), parseMp4Date = function(seconds) { return new Date(1e3 * seconds - 20828448e5); }, parseType = __webpack_require__(224), findBox = __webpack_require__(223), nalParse = function(avcStream) { var i, length, avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength), result = []; for (i = 0; i + 4 < avcStream.length; i += length) if (length = avcView.getUint32(i), i += 4, length <= 0) result.push("MALFORMED DATA"); else switch (31 & avcStream[i]) { case 1: result.push("slice_layer_without_partitioning_rbsp"); break; case 5: result.push("slice_layer_without_partitioning_rbsp_idr"); break; case 6: result.push("sei_rbsp"); break; case 7: result.push("seq_parameter_set_rbsp"); break; case 8: result.push("pic_parameter_set_rbsp"); break; case 9: result.push("access_unit_delimiter_rbsp"); break; default: result.push("UNKNOWN NAL - " + avcStream[i] & 31); } return result; }, parse = { avc1: function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength); return { dataReferenceIndex: view.getUint16(6), width: view.getUint16(24), height: view.getUint16(26), horizresolution: view.getUint16(28) + view.getUint16(30) / 16, vertresolution: view.getUint16(32) + view.getUint16(34) / 16, frameCount: view.getUint16(40), depth: view.getUint16(74), config: inspectMp4(data.subarray(78, data.byteLength)) }; }, avcC: function(data) { var numOfPictureParameterSets, nalSize, offset, i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { configurationVersion: data[0], avcProfileIndication: data[1], profileCompatibility: data[2], avcLevelIndication: data[3], lengthSizeMinusOne: 3 & data[4], sps: [], pps: [] }, numOfSequenceParameterSets = 31 & data[5]; for (offset = 6, i = 0; i < numOfSequenceParameterSets; i++) nalSize = view.getUint16(offset), offset += 2, result.sps.push(new Uint8Array(data.subarray(offset, offset + nalSize))), offset += nalSize; for (numOfPictureParameterSets = data[offset], offset++, i = 0; i < numOfPictureParameterSets; i++) nalSize = view.getUint16(offset), offset += 2, result.pps.push(new Uint8Array(data.subarray(offset, offset + nalSize))), offset += nalSize; return result; }, btrt: function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength); return { bufferSizeDB: view.getUint32(0), maxBitrate: view.getUint32(4), avgBitrate: view.getUint32(8) }; }, edts: function(data) { return { boxes: inspectMp4(data) }; }, elst: function(data) { var i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { version: view.getUint8(0), flags: new Uint8Array(data.subarray(1, 4)), edits: [] }, entryCount = view.getUint32(4); for (i = 8; entryCount; entryCount--) 0 === result.version ? (result.edits.push({ segmentDuration: view.getUint32(i), mediaTime: view.getInt32(i + 4), mediaRate: view.getUint16(i + 8) + view.getUint16(i + 10) / 65536 }), i += 12) : (result.edits.push({ segmentDuration: view.getUint32(i) * MAX_UINT32 + view.getUint32(i + 4), mediaTime: view.getUint32(i + 8) * MAX_UINT32 + view.getUint32(i + 12), mediaRate: view.getUint16(i + 16) + view.getUint16(i + 18) / 65536 }), i += 20); return result; }, esds: function(data) { return { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), esId: data[6] << 8 | data[7], streamPriority: 31 & data[8], decoderConfig: { objectProfileIndication: data[11], streamType: data[12] >>> 2 & 63, bufferSize: data[13] << 16 | data[14] << 8 | data[15], maxBitrate: data[16] << 24 | data[17] << 16 | data[18] << 8 | data[19], avgBitrate: data[20] << 24 | data[21] << 16 | data[22] << 8 | data[23], decoderConfigDescriptor: { tag: data[24], length: data[25], audioObjectType: data[26] >>> 3 & 31, samplingFrequencyIndex: (7 & data[26]) << 1 | data[27] >>> 7 & 1, channelConfiguration: data[27] >>> 3 & 15 } } }; }, ftyp: function(data) { for (var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { majorBrand: parseType(data.subarray(0, 4)), minorVersion: view.getUint32(4), compatibleBrands: [] }, i = 8; i < data.byteLength; ) result.compatibleBrands.push(parseType(data.subarray(i, i + 4))), i += 4; return result; }, dinf: function(data) { return { boxes: inspectMp4(data) }; }, dref: function(data) { return { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), dataReferences: inspectMp4(data.subarray(8)) }; }, hdlr: function(data) { var result = { version: new DataView(data.buffer, data.byteOffset, data.byteLength).getUint8(0), flags: new Uint8Array(data.subarray(1, 4)), handlerType: parseType(data.subarray(8, 12)), name: "" }, i = 8; for (i = 24; i < data.byteLength; i++) { if (0 === data[i]) { i++; break; } result.name += String.fromCharCode(data[i]); } return result.name = decodeURIComponent(escape(result.name)), result; }, mdat: function(data) { return { byteLength: data.byteLength, nals: nalParse(data) }; }, mdhd: function(data) { var language, view = new DataView(data.buffer, data.byteOffset, data.byteLength), i = 4, result = { version: view.getUint8(0), flags: new Uint8Array(data.subarray(1, 4)), language: "" }; return 1 === result.version ? (i += 4, result.creationTime = parseMp4Date(view.getUint32(i)), i += 8, result.modificationTime = parseMp4Date(view.getUint32(i)), i += 4, result.timescale = view.getUint32(i), i += 8, result.duration = view.getUint32(i)) : (result.creationTime = parseMp4Date(view.getUint32(i)), i += 4, result.modificationTime = parseMp4Date(view.getUint32(i)), i += 4, result.timescale = view.getUint32(i), i += 4, result.duration = view.getUint32(i)), i += 4, language = view.getUint16(i), result.language += String.fromCharCode(96 + (language >> 10)), result.language += String.fromCharCode(96 + ((992 & language) >> 5)), result.language += String.fromCharCode(96 + (31 & language)), result; }, mdia: function(data) { return { boxes: inspectMp4(data) }; }, mfhd: function(data) { return { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), sequenceNumber: data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7] }; }, minf: function(data) { return { boxes: inspectMp4(data) }; }, mp4a: function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { dataReferenceIndex: view.getUint16(6), channelcount: view.getUint16(16), samplesize: view.getUint16(18), samplerate: view.getUint16(24) + view.getUint16(26) / 65536 }; return data.byteLength > 28 && (result.streamDescriptor = inspectMp4(data.subarray(28))[0]), result; }, moof: function(data) { return { boxes: inspectMp4(data) }; }, moov: function(data) { return { boxes: inspectMp4(data) }; }, mvex: function(data) { return { boxes: inspectMp4(data) }; }, mvhd: function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength), i = 4, result = { version: view.getUint8(0), flags: new Uint8Array(data.subarray(1, 4)) }; return 1 === result.version ? (i += 4, result.creationTime = parseMp4Date(view.getUint32(i)), i += 8, result.modificationTime = parseMp4Date(view.getUint32(i)), i += 4, result.timescale = view.getUint32(i), i += 8, result.duration = view.getUint32(i)) : (result.creationTime = parseMp4Date(view.getUint32(i)), i += 4, result.modificationTime = parseMp4Date(view.getUint32(i)), i += 4, result.timescale = view.getUint32(i), i += 4, result.duration = view.getUint32(i)), i += 4, result.rate = view.getUint16(i) + view.getUint16(i + 2) / 16, i += 4, result.volume = view.getUint8(i) + view.getUint8(i + 1) / 8, i += 2, i += 2, i += 8, result.matrix = new Uint32Array(data.subarray(i, i + 36)), i += 36, i += 24, result.nextTrackId = view.getUint32(i), result; }, pdin: function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength); return { version: view.getUint8(0), flags: new Uint8Array(data.subarray(1, 4)), rate: view.getUint32(4), initialDelay: view.getUint32(8) }; }, sdtp: function(data) { var i, result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), samples: [] }; for (i = 4; i < data.byteLength; i++) result.samples.push({ dependsOn: (48 & data[i]) >> 4, isDependedOn: (12 & data[i]) >> 2, hasRedundancy: 3 & data[i] }); return result; }, sidx: __webpack_require__(898), smhd: function(data) { return { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), balance: data[4] + data[5] / 256 }; }, stbl: function(data) { return { boxes: inspectMp4(data) }; }, ctts: function(data) { var i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { version: view.getUint8(0), flags: new Uint8Array(data.subarray(1, 4)), compositionOffsets: [] }, entryCount = view.getUint32(4); for (i = 8; entryCount; i += 8, entryCount--) result.compositionOffsets.push({ sampleCount: view.getUint32(i), sampleOffset: view[0 === result.version ? "getUint32" : "getInt32"](i + 4) }); return result; }, stss: function(data) { var i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { version: view.getUint8(0), flags: new Uint8Array(data.subarray(1, 4)), syncSamples: [] }, entryCount = view.getUint32(4); for (i = 8; entryCount; i += 4, entryCount--) result.syncSamples.push(view.getUint32(i)); return result; }, stco: function(data) { var i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), chunkOffsets: [] }, entryCount = view.getUint32(4); for (i = 8; entryCount; i += 4, entryCount--) result.chunkOffsets.push(view.getUint32(i)); return result; }, stsc: function(data) { var i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), entryCount = view.getUint32(4), result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), sampleToChunks: [] }; for (i = 8; entryCount; i += 12, entryCount--) result.sampleToChunks.push({ firstChunk: view.getUint32(i), samplesPerChunk: view.getUint32(i + 4), sampleDescriptionIndex: view.getUint32(i + 8) }); return result; }, stsd: function(data) { return { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), sampleDescriptions: inspectMp4(data.subarray(8)) }; }, stsz: function(data) { var i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), sampleSize: view.getUint32(4), entries: [] }; for (i = 12; i < data.byteLength; i += 4) result.entries.push(view.getUint32(i)); return result; }, stts: function(data) { var i, view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), timeToSamples: [] }, entryCount = view.getUint32(4); for (i = 8; entryCount; i += 8, entryCount--) result.timeToSamples.push({ sampleCount: view.getUint32(i), sampleDelta: view.getUint32(i + 4) }); return result; }, styp: function(data) { return parse.ftyp(data); }, tfdt: __webpack_require__(227), tfhd: __webpack_require__(225), tkhd: function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength), i = 4, result = { version: view.getUint8(0), flags: new Uint8Array(data.subarray(1, 4)) }; return 1 === result.version ? (i += 4, result.creationTime = parseMp4Date(view.getUint32(i)), i += 8, result.modificationTime = parseMp4Date(view.getUint32(i)), i += 4, result.trackId = view.getUint32(i), i += 4, i += 8, result.duration = view.getUint32(i)) : (result.creationTime = parseMp4Date(view.getUint32(i)), i += 4, result.modificationTime = parseMp4Date(view.getUint32(i)), i += 4, result.trackId = view.getUint32(i), i += 4, i += 4, result.duration = view.getUint32(i)), i += 4, i += 8, result.layer = view.getUint16(i), i += 2, result.alternateGroup = view.getUint16(i), i += 2, result.volume = view.getUint8(i) + view.getUint8(i + 1) / 8, i += 2, i += 2, result.matrix = new Uint32Array(data.subarray(i, i + 36)), i += 36, result.width = view.getUint16(i) + view.getUint16(i + 2) / 65536, i += 4, result.height = view.getUint16(i) + view.getUint16(i + 2) / 65536, result; }, traf: function(data) { return { boxes: inspectMp4(data) }; }, trak: function(data) { return { boxes: inspectMp4(data) }; }, trex: function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength); return { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), trackId: view.getUint32(4), defaultSampleDescriptionIndex: view.getUint32(8), defaultSampleDuration: view.getUint32(12), defaultSampleSize: view.getUint32(16), sampleDependsOn: 3 & data[20], sampleIsDependedOn: (192 & data[21]) >> 6, sampleHasRedundancy: (48 & data[21]) >> 4, samplePaddingValue: (14 & data[21]) >> 1, sampleIsDifferenceSample: !!(1 & data[21]), sampleDegradationPriority: view.getUint16(22) }; }, trun: __webpack_require__(226), "url ": function(data) { return { version: data[0], flags: new Uint8Array(data.subarray(1, 4)) }; }, vmhd: function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength); return { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), graphicsmode: view.getUint16(4), opcolor: new Uint16Array([ view.getUint16(6), view.getUint16(8), view.getUint16(10) ]) }; } }; inspectMp4 = function(data) { for (var view, size, type, end, box, i = 0, result = [], ab = new ArrayBuffer(data.length), v = new Uint8Array(ab), z = 0; z < data.length; ++z) v[z] = data[z]; for (view = new DataView(ab); i < data.byteLength; ) size = view.getUint32(i), type = parseType(data.subarray(i + 4, i + 8)), end = size > 1 ? i + size : data.byteLength, (box = (parse[type] || function(data) { return { data: data }; })(data.subarray(i + 8, end))).size = size, box.type = type, result.push(box), i = end; return result; }, _textifyMp = function(inspectedMp4, depth) { var indent; return depth = depth || 0, indent = new Array(2 * depth + 1).join(" "), inspectedMp4.map((function(box, index) { return indent + box.type + "\n" + Object.keys(box).filter((function(key) { return "type" !== key && "boxes" !== key; })).map((function(key) { var prefix = indent + " " + key + ": ", value = box[key]; if (value instanceof Uint8Array || value instanceof Uint32Array) { var bytes = Array.prototype.slice.call(new Uint8Array(value.buffer, value.byteOffset, value.byteLength)).map((function(byte) { return " " + ("00" + byte.toString(16)).slice(-2); })).join("").match(/.{1,24}/g); return bytes ? 1 === bytes.length ? prefix + "<" + bytes.join("").slice(1) + ">" : prefix + "<\n" + bytes.map((function(line) { return indent + " " + line; })).join("\n") + "\n" + indent + " >" : prefix + "<>"; } return prefix + JSON.stringify(value, null, 2).split("\n").map((function(line, index) { return 0 === index ? line : indent + " " + line; })).join("\n"); })).join("\n") + (box.boxes ? "\n" + _textifyMp(box.boxes, depth + 1) : ""); })).join("\n"); }, module.exports = { inspect: inspectMp4, textify: _textifyMp, parseType: parseType, findBox: findBox, parseTraf: parse.traf, parseTfdt: parse.tfdt, parseHdlr: parse.hdlr, parseTfhd: parse.tfhd, parseTrun: parse.trun, parseSidx: parse.sidx }; }, function(module, exports, __webpack_require__) { "use strict"; var MAX_UINT32 = Math.pow(2, 32); module.exports = function(data) { var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = { version: data[0], flags: new Uint8Array(data.subarray(1, 4)), references: [], referenceId: view.getUint32(4), timescale: view.getUint32(8) }, i = 12; 0 === result.version ? (result.earliestPresentationTime = view.getUint32(i), result.firstOffset = view.getUint32(i + 4), i += 8) : (result.earliestPresentationTime = view.getUint32(i) * MAX_UINT32 + view.getUint32(i + 4), result.firstOffset = view.getUint32(i + 8) * MAX_UINT32 + view.getUint32(i + 12), i += 16), i += 2; var referenceCount = view.getUint16(i); for (i += 2; referenceCount > 0; i += 12, referenceCount--) result.references.push({ referenceType: (128 & data[i]) >>> 7, referencedSize: 2147483647 & view.getUint32(i), subsegmentDuration: view.getUint32(i + 4), startsWithSap: !!(128 & data[i + 8]), sapType: (112 & data[i + 8]) >>> 4, sapDeltaTime: 268435455 & view.getUint32(i + 8) }); return result; }; }, function(module, exports, __webpack_require__) { "use strict"; var tagTypes = { 8: "audio", 9: "video", 18: "metadata" }, hex = function(val) { return "0x" + ("00" + val.toString(16)).slice(-2).toUpperCase(); }, hexStringList = function(data) { for (var i, arr = []; data.byteLength > 0; ) i = 0, arr.push(hex(data[i++])), data = data.subarray(1); return arr.join(" "); }, inspectFlvTag = function(tag) { var header = (function(tag) { return { tagType: tagTypes[tag[0]], dataSize: tag[1] << 16 | tag[2] << 8 | tag[3], timestamp: tag[7] << 24 | tag[4] << 16 | tag[5] << 8 | tag[6], streamID: tag[8] << 16 | tag[9] << 8 | tag[10] }; })(tag); switch (tag[0]) { case 8: !(function(tag, obj) { var soundFormat = (tag[0] & parseInt("11110000", 2)) >>> 4; (obj = obj || {}).soundFormat = [ "Linear PCM, platform endian", "ADPCM", "MP3", "Linear PCM, little endian", "Nellymoser 16-kHz mono", "Nellymoser 8-kHz mono", "Nellymoser", "G.711 A-law logarithmic PCM", "G.711 mu-law logarithmic PCM", "reserved", "AAC", "Speex", "MP3 8-Khz", "Device-specific sound" ][soundFormat], obj.soundRate = [ "5.5-kHz", "11-kHz", "22-kHz", "44-kHz" ][(tag[0] & parseInt("00001100", 2)) >>> 2], obj.soundSize = (tag[0] & parseInt("00000010", 2)) >>> 1 ? "16-bit" : "8-bit", obj.soundType = tag[0] & parseInt("00000001", 2) ? "Stereo" : "Mono", 10 === soundFormat && (function(tag, obj) { (obj = obj || {}).aacPacketType = [ "AAC Sequence Header", "AAC Raw" ][tag[0]], obj.data = hexStringList(tag.subarray(1)); })(tag.subarray(1), obj); })(tag.subarray(11), header); break; case 9: !(function(tag, obj) { var codecID = tag[0] & parseInt("00001111", 2); (obj = obj || {}).frameType = [ "Unknown", "Keyframe (for AVC, a seekable frame)", "Inter frame (for AVC, a nonseekable frame)", "Disposable inter frame (H.263 only)", "Generated keyframe (reserved for server use only)", "Video info/command frame" ][(tag[0] & parseInt("11110000", 2)) >>> 4], obj.codecID = codecID, 7 === codecID && (function(tag, obj) { var compositionTime = tag[1] & parseInt("01111111", 2) << 16 | tag[2] << 8 | tag[3]; (obj = obj || {}).avcPacketType = [ "AVC Sequence Header", "AVC NALU", "AVC End-of-Sequence" ][tag[0]], obj.CompositionTime = tag[1] & parseInt("10000000", 2) ? -compositionTime : compositionTime, 1 === tag[0] ? obj.nalUnitTypeRaw = hexStringList(tag.subarray(4, 100)) : obj.data = hexStringList(tag.subarray(4)); })(tag.subarray(1), obj); })(tag.subarray(11), header); } return header; }; module.exports = { inspectTag: inspectFlvTag, inspect: function(bytes) { var dataSize, tag, i = 9, parsedResults = []; for (i += 4; i < bytes.byteLength; ) dataSize = bytes[i + 1] << 16, dataSize |= bytes[i + 2] << 8, dataSize |= bytes[i + 3], dataSize += 11, tag = bytes.subarray(i, i + dataSize), parsedResults.push(inspectFlvTag(tag)), i += dataSize + 4; return parsedResults; }, textify: function(flvTagArray) { return JSON.stringify(flvTagArray, null, 2); } }; }, function(module, exports, __webpack_require__) { "use strict"; var StreamTypes = __webpack_require__(153), handleRollover = __webpack_require__(453).handleRollover, probe = {}; probe.ts = __webpack_require__(901), probe.aac = __webpack_require__(154); var ONE_SECOND_IN_TS = __webpack_require__(59).ONE_SECOND_IN_TS, parseAudioPes_ = function(bytes, pmt, result) { for (var packet, pesType, pusi, parsed, startIndex = 0, endIndex = 188, endLoop = !1; endIndex <= bytes.byteLength; ) if (71 !== bytes[startIndex] || 71 !== bytes[endIndex] && endIndex !== bytes.byteLength) startIndex++, endIndex++; else { if (packet = bytes.subarray(startIndex, endIndex), "pes" === probe.ts.parseType(packet, pmt.pid) && (pesType = probe.ts.parsePesType(packet, pmt.table), pusi = probe.ts.parsePayloadUnitStartIndicator(packet), "audio" === pesType && pusi && (parsed = probe.ts.parsePesTime(packet)) && (parsed.type = "audio", result.audio.push(parsed), endLoop = !0)), endLoop) break; startIndex += 188, endIndex += 188; } for (startIndex = (endIndex = bytes.byteLength) - 188, endLoop = !1; startIndex >= 0; ) if (71 !== bytes[startIndex] || 71 !== bytes[endIndex] && endIndex !== bytes.byteLength) startIndex--, endIndex--; else { if (packet = bytes.subarray(startIndex, endIndex), "pes" === probe.ts.parseType(packet, pmt.pid) && (pesType = probe.ts.parsePesType(packet, pmt.table), pusi = probe.ts.parsePayloadUnitStartIndicator(packet), "audio" === pesType && pusi && (parsed = probe.ts.parsePesTime(packet)) && (parsed.type = "audio", result.audio.push(parsed), endLoop = !0)), endLoop) break; startIndex -= 188, endIndex -= 188; } }, parseVideoPes_ = function(bytes, pmt, result) { for (var packet, pesType, pusi, parsed, frame, i, pes, startIndex = 0, endIndex = 188, endLoop = !1, currentFrame = { data: [], size: 0 }; endIndex < bytes.byteLength; ) if (71 !== bytes[startIndex] || 71 !== bytes[endIndex]) startIndex++, endIndex++; else { if (packet = bytes.subarray(startIndex, endIndex), "pes" === probe.ts.parseType(packet, pmt.pid) && (pesType = probe.ts.parsePesType(packet, pmt.table), pusi = probe.ts.parsePayloadUnitStartIndicator(packet), "video" === pesType && (pusi && !endLoop && (parsed = probe.ts.parsePesTime(packet)) && (parsed.type = "video", result.video.push(parsed), endLoop = !0), !result.firstKeyFrame))) { if (pusi && 0 !== currentFrame.size) { for (frame = new Uint8Array(currentFrame.size), i = 0; currentFrame.data.length; ) pes = currentFrame.data.shift(), frame.set(pes, i), i += pes.byteLength; if (probe.ts.videoPacketContainsKeyFrame(frame)) { var firstKeyFrame = probe.ts.parsePesTime(frame); firstKeyFrame ? (result.firstKeyFrame = firstKeyFrame, result.firstKeyFrame.type = "video") : console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself."); } currentFrame.size = 0; } currentFrame.data.push(packet), currentFrame.size += packet.byteLength; } if (endLoop && result.firstKeyFrame) break; startIndex += 188, endIndex += 188; } for (startIndex = (endIndex = bytes.byteLength) - 188, endLoop = !1; startIndex >= 0; ) if (71 !== bytes[startIndex] || 71 !== bytes[endIndex]) startIndex--, endIndex--; else { if (packet = bytes.subarray(startIndex, endIndex), "pes" === probe.ts.parseType(packet, pmt.pid) && (pesType = probe.ts.parsePesType(packet, pmt.table), pusi = probe.ts.parsePayloadUnitStartIndicator(packet), "video" === pesType && pusi && (parsed = probe.ts.parsePesTime(packet)) && (parsed.type = "video", result.video.push(parsed), endLoop = !0)), endLoop) break; startIndex -= 188, endIndex -= 188; } }; module.exports = { inspect: function(bytes, baseTimestamp) { var result; return result = probe.aac.isLikelyAacData(bytes) ? (function(bytes) { for (var packet, endLoop = !1, audioCount = 0, sampleRate = null, timestamp = null, frameSize = 0, byteIndex = 0; bytes.length - byteIndex >= 3; ) { switch (probe.aac.parseType(bytes, byteIndex)) { case "timed-metadata": if (bytes.length - byteIndex < 10) { endLoop = !0; break; } if ((frameSize = probe.aac.parseId3TagSize(bytes, byteIndex)) > bytes.length) { endLoop = !0; break; } null === timestamp && (packet = bytes.subarray(byteIndex, byteIndex + frameSize), timestamp = probe.aac.parseAacTimestamp(packet)), byteIndex += frameSize; break; case "audio": if (bytes.length - byteIndex < 7) { endLoop = !0; break; } if ((frameSize = probe.aac.parseAdtsSize(bytes, byteIndex)) > bytes.length) { endLoop = !0; break; } null === sampleRate && (packet = bytes.subarray(byteIndex, byteIndex + frameSize), sampleRate = probe.aac.parseSampleRate(packet)), audioCount++, byteIndex += frameSize; break; default: byteIndex++; } if (endLoop) return null; } if (null === sampleRate || null === timestamp) return null; var audioTimescale = ONE_SECOND_IN_TS / sampleRate; return { audio: [ { type: "audio", dts: timestamp, pts: timestamp }, { type: "audio", dts: timestamp + 1024 * audioCount * audioTimescale, pts: timestamp + 1024 * audioCount * audioTimescale } ] }; })(bytes) : (function(bytes) { var pmt = { pid: null, table: null }, result = {}; for (var pid in (function(bytes, pmt) { for (var packet, startIndex = 0, endIndex = 188; endIndex < bytes.byteLength; ) if (71 !== bytes[startIndex] || 71 !== bytes[endIndex]) startIndex++, endIndex++; else { switch (packet = bytes.subarray(startIndex, endIndex), probe.ts.parseType(packet, pmt.pid)) { case "pat": pmt.pid = probe.ts.parsePat(packet); break; case "pmt": var table = probe.ts.parsePmt(packet); pmt.table = pmt.table || {}, Object.keys(table).forEach((function(key) { pmt.table[key] = table[key]; })); } startIndex += 188, endIndex += 188; } })(bytes, pmt), pmt.table) if (pmt.table.hasOwnProperty(pid)) switch (pmt.table[pid]) { case StreamTypes.H264_STREAM_TYPE: result.video = [], parseVideoPes_(bytes, pmt, result), 0 === result.video.length && delete result.video; break; case StreamTypes.ADTS_STREAM_TYPE: result.audio = [], parseAudioPes_(bytes, pmt, result), 0 === result.audio.length && delete result.audio; } return result; })(bytes), result && (result.audio || result.video) ? ((function(segmentInfo, baseTimestamp) { if (segmentInfo.audio && segmentInfo.audio.length) { var audioBaseTimestamp = baseTimestamp; (void 0 === audioBaseTimestamp || isNaN(audioBaseTimestamp)) && (audioBaseTimestamp = segmentInfo.audio[0].dts), segmentInfo.audio.forEach((function(info) { info.dts = handleRollover(info.dts, audioBaseTimestamp), info.pts = handleRollover(info.pts, audioBaseTimestamp), info.dtsTime = info.dts / ONE_SECOND_IN_TS, info.ptsTime = info.pts / ONE_SECOND_IN_TS; })); } if (segmentInfo.video && segmentInfo.video.length) { var videoBaseTimestamp = baseTimestamp; if ((void 0 === videoBaseTimestamp || isNaN(videoBaseTimestamp)) && (videoBaseTimestamp = segmentInfo.video[0].dts), segmentInfo.video.forEach((function(info) { info.dts = handleRollover(info.dts, videoBaseTimestamp), info.pts = handleRollover(info.pts, videoBaseTimestamp), info.dtsTime = info.dts / ONE_SECOND_IN_TS, info.ptsTime = info.pts / ONE_SECOND_IN_TS; })), segmentInfo.firstKeyFrame) { var frame = segmentInfo.firstKeyFrame; frame.dts = handleRollover(frame.dts, videoBaseTimestamp), frame.pts = handleRollover(frame.pts, videoBaseTimestamp), frame.dtsTime = frame.dts / ONE_SECOND_IN_TS, frame.ptsTime = frame.pts / ONE_SECOND_IN_TS; } } })(result, baseTimestamp), result) : null; }, parseAudioPes_: parseAudioPes_ }; }, function(module, exports, __webpack_require__) { "use strict"; var StreamTypes = __webpack_require__(153), parsePid = function(packet) { var pid = 31 & packet[1]; return (pid <<= 8) | packet[2]; }, parsePayloadUnitStartIndicator = function(packet) { return !!(64 & packet[1]); }, parseAdaptionField = function(packet) { var offset = 0; return (48 & packet[3]) >>> 4 > 1 && (offset += packet[4] + 1), offset; }, parseNalUnitType = function(type) { switch (type) { case 5: return "slice_layer_without_partitioning_rbsp_idr"; case 6: return "sei_rbsp"; case 7: return "seq_parameter_set_rbsp"; case 8: return "pic_parameter_set_rbsp"; case 9: return "access_unit_delimiter_rbsp"; default: return null; } }; module.exports = { parseType: function(packet, pmtPid) { var pid = parsePid(packet); return 0 === pid ? "pat" : pid === pmtPid ? "pmt" : pmtPid ? "pes" : null; }, parsePat: function(packet) { var pusi = parsePayloadUnitStartIndicator(packet), offset = 4 + parseAdaptionField(packet); return pusi && (offset += packet[offset] + 1), (31 & packet[offset + 10]) << 8 | packet[offset + 11]; }, parsePmt: function(packet) { var programMapTable = {}, pusi = parsePayloadUnitStartIndicator(packet), payloadOffset = 4 + parseAdaptionField(packet); if (pusi && (payloadOffset += packet[payloadOffset] + 1), 1 & packet[payloadOffset + 5]) { var tableEnd; tableEnd = 3 + ((15 & packet[payloadOffset + 1]) << 8 | packet[payloadOffset + 2]) - 4; for (var offset = 12 + ((15 & packet[payloadOffset + 10]) << 8 | packet[payloadOffset + 11]); offset < tableEnd; ) { var i = payloadOffset + offset; programMapTable[(31 & packet[i + 1]) << 8 | packet[i + 2]] = packet[i], offset += 5 + ((15 & packet[i + 3]) << 8 | packet[i + 4]); } return programMapTable; } }, parsePayloadUnitStartIndicator: parsePayloadUnitStartIndicator, parsePesType: function(packet, programMapTable) { switch (programMapTable[parsePid(packet)]) { case StreamTypes.H264_STREAM_TYPE: return "video"; case StreamTypes.ADTS_STREAM_TYPE: return "audio"; case StreamTypes.METADATA_STREAM_TYPE: return "timed-metadata"; default: return null; } }, parsePesTime: function(packet) { if (!parsePayloadUnitStartIndicator(packet)) return null; var offset = 4 + parseAdaptionField(packet); if (offset >= packet.byteLength) return null; var ptsDtsFlags, pes = null; return 192 & (ptsDtsFlags = packet[offset + 7]) && ((pes = {}).pts = (14 & packet[offset + 9]) << 27 | (255 & packet[offset + 10]) << 20 | (254 & packet[offset + 11]) << 12 | (255 & packet[offset + 12]) << 5 | (254 & packet[offset + 13]) >>> 3, pes.pts *= 4, pes.pts += (6 & packet[offset + 13]) >>> 1, pes.dts = pes.pts, 64 & ptsDtsFlags && (pes.dts = (14 & packet[offset + 14]) << 27 | (255 & packet[offset + 15]) << 20 | (254 & packet[offset + 16]) << 12 | (255 & packet[offset + 17]) << 5 | (254 & packet[offset + 18]) >>> 3, pes.dts *= 4, pes.dts += (6 & packet[offset + 18]) >>> 1)), pes; }, videoPacketContainsKeyFrame: function(packet) { for (var offset = 4 + parseAdaptionField(packet), frameBuffer = packet.subarray(offset), frameI = 0, frameSyncPoint = 0, foundKeyFrame = !1; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) if (1 === frameBuffer[frameSyncPoint + 2]) { frameI = frameSyncPoint + 5; break; } for (;frameI < frameBuffer.byteLength; ) switch (frameBuffer[frameI]) { case 0: if (0 !== frameBuffer[frameI - 1]) { frameI += 2; break; } if (0 !== frameBuffer[frameI - 2]) { frameI++; break; } frameSyncPoint + 3 !== frameI - 2 && "slice_layer_without_partitioning_rbsp_idr" === parseNalUnitType(31 & frameBuffer[frameSyncPoint + 3]) && (foundKeyFrame = !0); do { frameI++; } while (1 !== frameBuffer[frameI] && frameI < frameBuffer.length); frameSyncPoint = frameI - 2, frameI += 3; break; case 1: if (0 !== frameBuffer[frameI - 1] || 0 !== frameBuffer[frameI - 2]) { frameI += 3; break; } "slice_layer_without_partitioning_rbsp_idr" === parseNalUnitType(31 & frameBuffer[frameSyncPoint + 3]) && (foundKeyFrame = !0), frameSyncPoint = frameI - 2, frameI += 3; break; default: frameI += 3; } return frameBuffer = frameBuffer.subarray(frameSyncPoint), frameI -= frameSyncPoint, frameSyncPoint = 0, frameBuffer && frameBuffer.byteLength > 3 && "slice_layer_without_partitioning_rbsp_idr" === parseNalUnitType(31 & frameBuffer[frameSyncPoint + 3]) && (foundKeyFrame = !0), foundKeyFrame; } }; }, function(module, exports, __webpack_require__) { const {finished: finished} = __webpack_require__(3), DecodeStream = __webpack_require__(457), readChunk = __webpack_require__(231), {open: openInputStream, close: closeInputStream} = __webpack_require__(913); async function parseBoxHeaders(buffer) { return new Promise(((resolve, reject) => { const boxes = [], decodeStream = new DecodeStream, cleanupDecodeStream = finished(decodeStream, (error => { cleanupDecodeStream(), decodeStream.off("box", onBox), error ? reject(error) : resolve(boxes); })); decodeStream.on("box", onBox); try { decodeStream.write(buffer), decodeStream._writableState.length > 0 && decodeStream._writableState.onwrite(), decodeStream.end(); } catch (error) { decodeStream.destroy(error); } function onBox(box) { boxes.push(box), decodeStream.ignore(); } })); } module.exports = async function(url) { for (let seek = 0, seekOffset = 0; seek < 4; seek++) { const stream = await openInputStream(url, seekOffset), chunk = await readChunk(stream), boxes = await parseBoxHeaders(chunk), moovIndex = boxes.findIndex((({type: type}) => "moov" === type)); if (-1 !== moovIndex) { const moovOffset = boxes.slice(0, moovIndex).reduce(((result, {length: length}) => result + length), 0), missingLength = boxes[moovIndex].length - (chunk.length - moovOffset); if (missingLength <= 0) return closeInputStream(stream), chunk.slice(moovOffset, moovOffset + boxes[moovIndex].length); const missingChunk = await readChunk(stream, missingLength); return closeInputStream(stream), Buffer.concat([ chunk.slice(moovOffset), missingChunk ]); } closeInputStream(stream), seekOffset += boxes.reduce(((result, {length: length}) => result + length), 0); } throw new Error("max seeks exceeded"); }; }, function(module, exports, __webpack_require__) { var Stream = __webpack_require__(3); "disable" === process.env.READABLE_STREAM && Stream ? (module.exports = Stream.Readable, Object.assign(module.exports, Stream), module.exports.Stream = Stream) : ((exports = module.exports = __webpack_require__(458)).Stream = Stream || exports, exports.Readable = exports, exports.Writable = __webpack_require__(462), exports.Duplex = __webpack_require__(87), exports.Transform = __webpack_require__(463), exports.PassThrough = __webpack_require__(907), exports.finished = __webpack_require__(230), exports.pipeline = __webpack_require__(908)); }, function(module, exports, __webpack_require__) { "use strict"; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter((function(sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }))), keys.push.apply(keys, symbols); } return keys; } function _defineProperty(obj, key, value) { return key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, obj; } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } var Buffer = __webpack_require__(10).Buffer, inspect = __webpack_require__(0).inspect, custom = inspect && inspect.custom || "inspect"; module.exports = (function() { function BufferList() { !(function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); })(this, BufferList), this.head = null, this.tail = null, this.length = 0; } var Constructor, protoProps; return Constructor = BufferList, protoProps = [ { key: "push", value: function(v) { var entry = { data: v, next: null }; this.length > 0 ? this.tail.next = entry : this.head = entry, this.tail = entry, ++this.length; } }, { key: "unshift", value: function(v) { var entry = { data: v, next: this.head }; 0 === this.length && (this.tail = entry), this.head = entry, ++this.length; } }, { key: "shift", value: function() { if (0 !== this.length) { var ret = this.head.data; return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, ret; } } }, { key: "clear", value: function() { this.head = this.tail = null, this.length = 0; } }, { key: "join", value: function(s) { if (0 === this.length) return ""; for (var p = this.head, ret = "" + p.data; p = p.next; ) ret += s + p.data; return ret; } }, { key: "concat", value: function(n) { if (0 === this.length) return Buffer.alloc(0); for (var src, target, offset, ret = Buffer.allocUnsafe(n >>> 0), p = this.head, i = 0; p; ) src = p.data, target = ret, offset = i, Buffer.prototype.copy.call(src, target, offset), i += p.data.length, p = p.next; return ret; } }, { key: "consume", value: function(n, hasStrings) { var ret; return n < this.head.data.length ? (ret = this.head.data.slice(0, n), this.head.data = this.head.data.slice(n)) : ret = n === this.head.data.length ? this.shift() : hasStrings ? this._getString(n) : this._getBuffer(n), ret; } }, { key: "first", value: function() { return this.head.data; } }, { key: "_getString", value: function(n) { var p = this.head, c = 1, ret = p.data; for (n -= ret.length; p = p.next; ) { var str = p.data, nb = n > str.length ? str.length : n; if (nb === str.length ? ret += str : ret += str.slice(0, n), 0 == (n -= nb)) { nb === str.length ? (++c, p.next ? this.head = p.next : this.head = this.tail = null) : (this.head = p, p.data = str.slice(nb)); break; } ++c; } return this.length -= c, ret; } }, { key: "_getBuffer", value: function(n) { var ret = Buffer.allocUnsafe(n), p = this.head, c = 1; for (p.data.copy(ret), n -= p.data.length; p = p.next; ) { var buf = p.data, nb = n > buf.length ? buf.length : n; if (buf.copy(ret, ret.length - n, 0, nb), 0 == (n -= nb)) { nb === buf.length ? (++c, p.next ? this.head = p.next : this.head = this.tail = null) : (this.head = p, p.data = buf.slice(nb)); break; } ++c; } return this.length -= c, ret; } }, { key: custom, value: function(_, options) { return inspect(this, (function(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach((function(key) { _defineProperty(target, key, source[key]); })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach((function(key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); })); } return target; })({}, options, { depth: 0, customInspect: !1 })); } } ], protoProps && _defineProperties(Constructor.prototype, protoProps), BufferList; })(); }, function(module, exports, __webpack_require__) { "use strict"; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { return key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, obj; } var finished = __webpack_require__(230), kLastResolve = Symbol("lastResolve"), kLastReject = Symbol("lastReject"), kError = Symbol("error"), kEnded = Symbol("ended"), kLastPromise = Symbol("lastPromise"), kHandlePromise = Symbol("handlePromise"), kStream = Symbol("stream"); function createIterResult(value, done) { return { value: value, done: done }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (null !== resolve) { var data = iter[kStream].read(); null !== data && (iter[kLastPromise] = null, iter[kLastResolve] = null, iter[kLastReject] = null, resolve(createIterResult(data, !1))); } } function onReadable(iter) { process.nextTick(readAndResolve, iter); } var AsyncIteratorPrototype = Object.getPrototypeOf((function() {})), ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_defineProperty(_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function() { var _this = this, error = this[kError]; if (null !== error) return Promise.reject(error); if (this[kEnded]) return Promise.resolve(createIterResult(void 0, !0)); if (this[kStream].destroyed) return new Promise((function(resolve, reject) { process.nextTick((function() { _this[kError] ? reject(_this[kError]) : resolve(createIterResult(void 0, !0)); })); })); var promise, lastPromise = this[kLastPromise]; if (lastPromise) promise = new Promise((function(lastPromise, iter) { return function(resolve, reject) { lastPromise.then((function() { iter[kEnded] ? resolve(createIterResult(void 0, !0)) : iter[kHandlePromise](resolve, reject); }), reject); }; })(lastPromise, this)); else { var data = this[kStream].read(); if (null !== data) return Promise.resolve(createIterResult(data, !1)); promise = new Promise(this[kHandlePromise]); } return this[kLastPromise] = promise, promise; } }, Symbol.asyncIterator, (function() { return this; })), _defineProperty(_Object$setPrototypeO, "return", (function() { var _this2 = this; return new Promise((function(resolve, reject) { _this2[kStream].destroy(null, (function(err) { err ? reject(err) : resolve(createIterResult(void 0, !0)); })); })); })), _Object$setPrototypeO), AsyncIteratorPrototype); module.exports = function(stream) { var _Object$create, iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_defineProperty(_Object$create = {}, kStream, { value: stream, writable: !0 }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: !0 }), _defineProperty(_Object$create, kLastReject, { value: null, writable: !0 }), _defineProperty(_Object$create, kError, { value: null, writable: !0 }), _defineProperty(_Object$create, kEnded, { value: stream._readableState.endEmitted, writable: !0 }), _defineProperty(_Object$create, kHandlePromise, { value: function(resolve, reject) { var data = iterator[kStream].read(); data ? (iterator[kLastPromise] = null, iterator[kLastResolve] = null, iterator[kLastReject] = null, resolve(createIterResult(data, !1))) : (iterator[kLastResolve] = resolve, iterator[kLastReject] = reject); }, writable: !0 }), _Object$create)); return iterator[kLastPromise] = null, finished(stream, (function(err) { if (err && "ERR_STREAM_PREMATURE_CLOSE" !== err.code) { var reject = iterator[kLastReject]; return null !== reject && (iterator[kLastPromise] = null, iterator[kLastResolve] = null, iterator[kLastReject] = null, reject(err)), void (iterator[kError] = err); } var resolve = iterator[kLastResolve]; null !== resolve && (iterator[kLastPromise] = null, iterator[kLastResolve] = null, iterator[kLastReject] = null, resolve(createIterResult(void 0, !0))), iterator[kEnded] = !0; })), stream.on("readable", onReadable.bind(null, iterator)), iterator; }; }, function(module, exports, __webpack_require__) { "use strict"; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg), value = info.value; } catch (error) { return void reject(error); } info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw); } function _asyncToGenerator(fn) { return function() { var self = this, args = arguments; return new Promise((function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(void 0); })); }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter((function(sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }))), keys.push.apply(keys, symbols); } return keys; } function _defineProperty(obj, key, value) { return key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, obj; } var ERR_INVALID_ARG_TYPE = __webpack_require__(74).codes.ERR_INVALID_ARG_TYPE; module.exports = function(Readable, iterable, opts) { var iterator; if (iterable && "function" == typeof iterable.next) iterator = iterable; else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator](); else { if (!iterable || !iterable[Symbol.iterator]) throw new ERR_INVALID_ARG_TYPE("iterable", [ "Iterable" ], iterable); iterator = iterable[Symbol.iterator](); } var readable = new Readable((function(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach((function(key) { _defineProperty(target, key, source[key]); })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach((function(key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); })); } return target; })({ objectMode: !0 }, opts)), reading = !1; function next() { return _next2.apply(this, arguments); } function _next2() { return (_next2 = _asyncToGenerator((function*() { try { var _ref = yield iterator.next(), value = _ref.value; _ref.done ? readable.push(null) : readable.push(yield value) ? next() : reading = !1; } catch (err) { readable.destroy(err); } }))).apply(this, arguments); } return readable._read = function() { reading || (reading = !0, next()); }, readable; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = PassThrough; var Transform = __webpack_require__(463); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } __webpack_require__(8)(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; }, function(module, exports, __webpack_require__) { "use strict"; var eos, _require$codes = __webpack_require__(74).codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop(err) { if (err) throw err; } function destroyer(stream, reading, writing, callback) { callback = (function(callback) { var called = !1; return function() { called || (called = !0, callback.apply(void 0, arguments)); }; })(callback); var closed = !1; stream.on("close", (function() { closed = !0; })), void 0 === eos && (eos = __webpack_require__(230)), eos(stream, { readable: reading, writable: writing }, (function(err) { if (err) return callback(err); closed = !0, callback(); })); var destroyed = !1; return function(err) { if (!closed && !destroyed) return destroyed = !0, (function(stream) { return stream.setHeader && "function" == typeof stream.abort; })(stream) ? stream.abort() : "function" == typeof stream.destroy ? stream.destroy() : void callback(err || new ERR_STREAM_DESTROYED("pipe")); }; } function call(fn) { fn(); } function pipe(from, to) { return from.pipe(to); } function popCallback(streams) { return streams.length ? "function" != typeof streams[streams.length - 1] ? noop : streams.pop() : noop; } module.exports = function() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) streams[_key] = arguments[_key]; var error, callback = popCallback(streams); if (Array.isArray(streams[0]) && (streams = streams[0]), streams.length < 2) throw new ERR_MISSING_ARGS("streams"); var destroys = streams.map((function(stream, i) { var reading = i < streams.length - 1; return destroyer(stream, reading, i > 0, (function(err) { error || (error = err), err && destroys.forEach(call), reading || (destroys.forEach(call), callback(error)); })); })); return streams.reduce(pipe); }; }, function(module, exports) { module.exports = function(emitter, name) { var next = null; return emitter.on(name, (function(data) { if (next) { var fn = next; next = null, fn(data); } })), function(once) { next = once; }; }; }, function(module, exports, __webpack_require__) { var Box = __webpack_require__(464), Descriptor = __webpack_require__(911), uint64be = __webpack_require__(465); function writeReserved(buf, offset, end) { for (var i = offset; i < end; i++) buf[i] = 0; } function writeDate(date, buf, offset) { buf.writeUInt32BE(Math.floor((date.getTime() + 20828448e5) / 1e3), offset); } function writeDate64(date, buf, offset) { buf.writeUIntBE(Math.floor((date.getTime() + 20828448e5) / 1e3), offset, 6); } function writeFixed32(num, buf, offset) { buf.writeUInt16BE(Math.floor(num) % 65536, offset), buf.writeUInt16BE(Math.floor(256 * num * 256) % 65536, offset + 2); } function writeMatrix(list, buf, offset) { list || (list = [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]); for (var i = 0; i < list.length; i++) writeFixed32(list[i], buf, offset + 4 * i); } function readMatrix(buf) { for (var list = new Array(buf.length / 4), i = 0; i < list.length; i++) list[i] = readFixed32(buf, 4 * i); return list; } function readDate64(buf, offset) { return new Date(1e3 * buf.readUIntBE(offset, 6) - 20828448e5); } function readDate(buf, offset) { return new Date(1e3 * buf.readUInt32BE(offset) - 20828448e5); } function readFixed32(buf, offset) { return buf.readUInt16BE(offset) + buf.readUInt16BE(offset + 2) / 65536; } function readFixed16(buf, offset) { return buf[offset] + buf[offset + 1] / 256; } function readString(buf, offset, length) { var i; for (i = 0; i < length && 0 !== buf[offset + i]; i++) ; return buf.toString("utf8", offset, offset + i); } exports.fullBoxes = {}, [ "mvhd", "tkhd", "mdhd", "vmhd", "smhd", "stsd", "esds", "stsz", "stco", "co64", "stss", "stts", "ctts", "stsc", "dref", "elst", "hdlr", "mehd", "trex", "mfhd", "tfhd", "tfdt", "trun" ].forEach((function(type) { exports.fullBoxes[type] = !0; })), exports.ftyp = {}, exports.ftyp.encode = function(box, buf, offset) { buf = buf ? buf.slice(offset) : Buffer.alloc(exports.ftyp.encodingLength(box)); var brands = box.compatibleBrands || []; buf.write(box.brand, 0, 4, "ascii"), buf.writeUInt32BE(box.brandVersion, 4); for (var i = 0; i < brands.length; i++) buf.write(brands[i], 8 + 4 * i, 4, "ascii"); return exports.ftyp.encode.bytes = 8 + 4 * brands.length, buf; }, exports.ftyp.decode = function(buf, offset) { for (var brand = (buf = buf.slice(offset)).toString("ascii", 0, 4), version = buf.readUInt32BE(4), compatibleBrands = [], i = 8; i < buf.length; i += 4) compatibleBrands.push(buf.toString("ascii", i, i + 4)); return { brand: brand, brandVersion: version, compatibleBrands: compatibleBrands }; }, exports.ftyp.encodingLength = function(box) { return 8 + 4 * (box.compatibleBrands || []).length; }, exports.mvhd = {}, exports.mvhd.encode = function(box, buf, offset) { return buf = buf ? buf.slice(offset) : Buffer.alloc(96), writeDate(box.ctime || new Date, buf, 0), writeDate(box.mtime || new Date, buf, 4), buf.writeUInt32BE(box.timeScale || 0, 8), buf.writeUInt32BE(box.duration || 0, 12), writeFixed32(box.preferredRate || 0, buf, 16), (function(num, buf, offset) { buf[20] = Math.floor(num) % 256, buf[21] = Math.floor(256 * num) % 256; })(box.preferredVolume || 0, buf), writeReserved(buf, 22, 32), writeMatrix(box.matrix, buf, 32), buf.writeUInt32BE(box.previewTime || 0, 68), buf.writeUInt32BE(box.previewDuration || 0, 72), buf.writeUInt32BE(box.posterTime || 0, 76), buf.writeUInt32BE(box.selectionTime || 0, 80), buf.writeUInt32BE(box.selectionDuration || 0, 84), buf.writeUInt32BE(box.currentTime || 0, 88), buf.writeUInt32BE(box.nextTrackId || 0, 92), exports.mvhd.encode.bytes = 96, buf; }, exports.mvhd.decode = function(buf, offset) { return { ctime: readDate(buf = buf.slice(offset), 0), mtime: readDate(buf, 4), timeScale: buf.readUInt32BE(8), duration: buf.readUInt32BE(12), preferredRate: readFixed32(buf, 16), preferredVolume: readFixed16(buf, 20), matrix: readMatrix(buf.slice(32, 68)), previewTime: buf.readUInt32BE(68), previewDuration: buf.readUInt32BE(72), posterTime: buf.readUInt32BE(76), selectionTime: buf.readUInt32BE(80), selectionDuration: buf.readUInt32BE(84), currentTime: buf.readUInt32BE(88), nextTrackId: buf.readUInt32BE(92) }; }, exports.mvhd.encodingLength = function(box) { return 96; }, exports.tkhd = {}, exports.tkhd.encode = function(box, buf, offset) { return buf = buf ? buf.slice(offset) : Buffer.alloc(80), writeDate(box.ctime || new Date, buf, 0), writeDate(box.mtime || new Date, buf, 4), buf.writeUInt32BE(box.trackId || 0, 8), writeReserved(buf, 12, 16), buf.writeUInt32BE(box.duration || 0, 16), writeReserved(buf, 20, 28), buf.writeUInt16BE(box.layer || 0, 28), buf.writeUInt16BE(box.alternateGroup || 0, 30), buf.writeUInt16BE(box.volume || 0, 32), writeMatrix(box.matrix, buf, 36), buf.writeUInt32BE(box.trackWidth || 0, 72), buf.writeUInt32BE(box.trackHeight || 0, 76), exports.tkhd.encode.bytes = 80, buf; }, exports.tkhd.decode = function(buf, offset) { return { ctime: readDate(buf = buf.slice(offset), 0), mtime: readDate(buf, 4), trackId: buf.readUInt32BE(8), duration: buf.readUInt32BE(16), layer: buf.readUInt16BE(28), alternateGroup: buf.readUInt16BE(30), volume: buf.readUInt16BE(32), matrix: readMatrix(buf.slice(36, 72)), trackWidth: buf.readUInt32BE(72), trackHeight: buf.readUInt32BE(76) }; }, exports.tkhd.encodingLength = function(box) { return 80; }, exports.mdhd = {}, exports.mdhd.encode = function(box, buf, offset) { return 1 === box.version ? (buf = buf ? buf.slice(offset) : Buffer.alloc(32), writeDate64(box.ctime || new Date, buf, 0), writeDate64(box.mtime || new Date, buf, 8), buf.writeUInt32BE(box.timeScale || 0, 16), buf.writeUIntBE(box.duration || 0, 20, 6), buf.writeUInt16BE(box.language || 0, 28), buf.writeUInt16BE(box.quality || 0, 30), exports.mdhd.encode.bytes = 32, buf) : (buf = buf ? buf.slice(offset) : Buffer.alloc(20), writeDate(box.ctime || new Date, buf, 0), writeDate(box.mtime || new Date, buf, 4), buf.writeUInt32BE(box.timeScale || 0, 8), buf.writeUInt32BE(box.duration || 0, 12), buf.writeUInt16BE(box.language || 0, 16), buf.writeUInt16BE(box.quality || 0, 18), exports.mdhd.encode.bytes = 20, buf); }, exports.mdhd.decode = function(buf, offset, end) { return buf = buf.slice(offset), end - offset != 20 ? { ctime: readDate64(buf, 0), mtime: readDate64(buf, 8), timeScale: buf.readUInt32BE(16), duration: buf.readUIntBE(20, 6), language: buf.readUInt16BE(28), quality: buf.readUInt16BE(30) } : { ctime: readDate(buf, 0), mtime: readDate(buf, 4), timeScale: buf.readUInt32BE(8), duration: buf.readUInt32BE(12), language: buf.readUInt16BE(16), quality: buf.readUInt16BE(18) }; }, exports.mdhd.encodingLength = function(box) { return 1 === box.version ? 32 : 20; }, exports.vmhd = {}, exports.vmhd.encode = function(box, buf, offset) { (buf = buf ? buf.slice(offset) : Buffer.alloc(8)).writeUInt16BE(box.graphicsMode || 0, 0); var opcolor = box.opcolor || [ 0, 0, 0 ]; return buf.writeUInt16BE(opcolor[0], 2), buf.writeUInt16BE(opcolor[1], 4), buf.writeUInt16BE(opcolor[2], 6), exports.vmhd.encode.bytes = 8, buf; }, exports.vmhd.decode = function(buf, offset) { return { graphicsMode: (buf = buf.slice(offset)).readUInt16BE(0), opcolor: [ buf.readUInt16BE(2), buf.readUInt16BE(4), buf.readUInt16BE(6) ] }; }, exports.vmhd.encodingLength = function(box) { return 8; }, exports.smhd = {}, exports.smhd.encode = function(box, buf, offset) { return (buf = buf ? buf.slice(offset) : Buffer.alloc(4)).writeUInt16BE(box.balance || 0, 0), writeReserved(buf, 2, 4), exports.smhd.encode.bytes = 4, buf; }, exports.smhd.decode = function(buf, offset) { return { balance: (buf = buf.slice(offset)).readUInt16BE(0) }; }, exports.smhd.encodingLength = function(box) { return 4; }, exports.stsd = {}, exports.stsd.encode = function(box, buf, offset) { buf = buf ? buf.slice(offset) : Buffer.alloc(exports.stsd.encodingLength(box)); var entries = box.entries || []; buf.writeUInt32BE(entries.length, 0); for (var ptr = 4, i = 0; i < entries.length; i++) { var entry = entries[i]; Box.encode(entry, buf, ptr), ptr += Box.encode.bytes; } return exports.stsd.encode.bytes = ptr, buf; }, exports.stsd.decode = function(buf, offset, end) { for (var num = (buf = buf.slice(offset)).readUInt32BE(0), entries = new Array(num), ptr = 4, i = 0; i < num; i++) { var entry = Box.decode(buf, ptr, end); entries[i] = entry, ptr += entry.length; } return { entries: entries }; }, exports.stsd.encodingLength = function(box) { var totalSize = 4; if (!box.entries) return totalSize; for (var i = 0; i < box.entries.length; i++) totalSize += Box.encodingLength(box.entries[i]); return totalSize; }, exports.avc1 = exports.VisualSampleEntry = {}, exports.VisualSampleEntry.encode = function(box, buf, offset) { writeReserved(buf = buf ? buf.slice(offset) : Buffer.alloc(exports.VisualSampleEntry.encodingLength(box)), 0, 6), buf.writeUInt16BE(box.dataReferenceIndex || 0, 6), writeReserved(buf, 8, 24), buf.writeUInt16BE(box.width || 0, 24), buf.writeUInt16BE(box.height || 0, 26), buf.writeUInt32BE(box.hResolution || 4718592, 28), buf.writeUInt32BE(box.vResolution || 4718592, 32), writeReserved(buf, 36, 40), buf.writeUInt16BE(box.frameCount || 1, 40); var compressorName = box.compressorName || "", nameLen = Math.min(compressorName.length, 31); buf.writeUInt8(nameLen, 42), buf.write(compressorName, 43, nameLen, "utf8"), buf.writeUInt16BE(box.depth || 24, 74), buf.writeInt16BE(-1, 76); var ptr = 78; (box.children || []).forEach((function(child) { Box.encode(child, buf, ptr), ptr += Box.encode.bytes; })), exports.VisualSampleEntry.encode.bytes = ptr; }, exports.VisualSampleEntry.decode = function(buf, offset, end) { buf = buf.slice(offset); for (var length = end - offset, nameLen = Math.min(buf.readUInt8(42), 31), box = { dataReferenceIndex: buf.readUInt16BE(6), width: buf.readUInt16BE(24), height: buf.readUInt16BE(26), hResolution: buf.readUInt32BE(28), vResolution: buf.readUInt32BE(32), frameCount: buf.readUInt16BE(40), compressorName: buf.toString("utf8", 43, 43 + nameLen), depth: buf.readUInt16BE(74), children: [] }, ptr = 78; length - ptr >= 8; ) { var child = Box.decode(buf, ptr, length); box.children.push(child), box[child.type] = child, ptr += child.length; } return box; }, exports.VisualSampleEntry.encodingLength = function(box) { var len = 78; return (box.children || []).forEach((function(child) { len += Box.encodingLength(child); })), len; }, exports.avcC = {}, exports.avcC.encode = function(box, buf, offset) { buf = buf ? buf.slice(offset) : Buffer.alloc(box.buffer.length), box.buffer.copy(buf), exports.avcC.encode.bytes = box.buffer.length; }, exports.avcC.decode = function(buf, offset, end) { return { mimeCodec: (buf = buf.slice(offset, end)).toString("hex", 1, 4), buffer: Buffer.from(buf) }; }, exports.avcC.encodingLength = function(box) { return box.buffer.length; }, exports.mp4a = exports.AudioSampleEntry = {}, exports.AudioSampleEntry.encode = function(box, buf, offset) { writeReserved(buf = buf ? buf.slice(offset) : Buffer.alloc(exports.AudioSampleEntry.encodingLength(box)), 0, 6), buf.writeUInt16BE(box.dataReferenceIndex || 0, 6), writeReserved(buf, 8, 16), buf.writeUInt16BE(box.channelCount || 2, 16), buf.writeUInt16BE(box.sampleSize || 16, 18), writeReserved(buf, 20, 24), buf.writeUInt32BE(box.sampleRate || 0, 24); var ptr = 28; (box.children || []).forEach((function(child) { Box.encode(child, buf, ptr), ptr += Box.encode.bytes; })), exports.AudioSampleEntry.encode.bytes = ptr; }, exports.AudioSampleEntry.decode = function(buf, offset, end) { for (var length = end - offset, box = { dataReferenceIndex: (buf = buf.slice(offset, end)).readUInt16BE(6), channelCount: buf.readUInt16BE(16), sampleSize: buf.readUInt16BE(18), sampleRate: buf.readUInt32BE(24), children: [] }, ptr = 28; length - ptr >= 8; ) { var child = Box.decode(buf, ptr, length); box.children.push(child), box[child.type] = child, ptr += child.length; } return box; }, exports.AudioSampleEntry.encodingLength = function(box) { var len = 28; return (box.children || []).forEach((function(child) { len += Box.encodingLength(child); })), len; }, exports.esds = {}, exports.esds.encode = function(box, buf, offset) { buf = buf ? buf.slice(offset) : Buffer.alloc(box.buffer.length), box.buffer.copy(buf, 0), exports.esds.encode.bytes = box.buffer.length; }, exports.esds.decode = function(buf, offset, end) { buf = buf.slice(offset, end); var desc = Descriptor.Descriptor.decode(buf, 0, buf.length), dcd = ("ESDescriptor" === desc.tagName ? desc : {}).DecoderConfigDescriptor || {}, oti = dcd.oti || 0, dsi = dcd.DecoderSpecificInfo, audioConfig = dsi ? (248 & dsi.buffer.readUInt8(0)) >> 3 : 0, mimeCodec = null; return oti && (mimeCodec = oti.toString(16), audioConfig && (mimeCodec += "." + audioConfig)), { mimeCodec: mimeCodec, buffer: Buffer.from(buf.slice(0)) }; }, exports.esds.encodingLength = function(box) { return box.buffer.length; }, exports.stsz = {}, exports.stsz.encode = function(box, buf, offset) { var entries = box.entries || []; (buf = buf ? buf.slice(offset) : Buffer.alloc(exports.stsz.encodingLength(box))).writeUInt32BE(0, 0), buf.writeUInt32BE(entries.length, 4); for (var i = 0; i < entries.length; i++) buf.writeUInt32BE(entries[i], 4 * i + 8); return exports.stsz.encode.bytes = 8 + 4 * entries.length, buf; }, exports.stsz.decode = function(buf, offset) { for (var size = (buf = buf.slice(offset)).readUInt32BE(0), num = buf.readUInt32BE(4), entries = new Array(num), i = 0; i < num; i++) entries[i] = 0 === size ? buf.readUInt32BE(4 * i + 8) : size; return { entries: entries }; }, exports.stsz.encodingLength = function(box) { return 8 + 4 * box.entries.length; }, exports.stss = exports.stco = {}, exports.stco.encode = function(box, buf, offset) { var entries = box.entries || []; (buf = buf ? buf.slice(offset) : Buffer.alloc(exports.stco.encodingLength(box))).writeUInt32BE(entries.length, 0); for (var i = 0; i < entries.length; i++) buf.writeUInt32BE(entries[i], 4 * i + 4); return exports.stco.encode.bytes = 4 + 4 * entries.length, buf; }, exports.stco.decode = function(buf, offset) { for (var num = (buf = buf.slice(offset)).readUInt32BE(0), entries = new Array(num), i = 0; i < num; i++) entries[i] = buf.readUInt32BE(4 * i + 4); return { entries: entries }; }, exports.stco.encodingLength = function(box) { return 4 + 4 * box.entries.length; }, exports.co64 = {}, exports.co64.encode = function(box, buf, offset) { var entries = box.entries || []; (buf = buf ? buf.slice(offset) : Buffer.alloc(exports.co64.encodingLength(box))).writeUInt32BE(entries.length, 0); for (var i = 0; i < entries.length; i++) uint64be.encode(entries[i], buf, 8 * i + 4); return exports.co64.encode.bytes = 4 + 8 * entries.length, buf; }, exports.co64.decode = function(buf, offset) { for (var num = (buf = buf.slice(offset)).readUInt32BE(0), entries = new Array(num), i = 0; i < num; i++) entries[i] = uint64be.decode(buf, 8 * i + 4); return { entries: entries }; }, exports.co64.encodingLength = function(box) { return 4 + 8 * box.entries.length; }, exports.stts = {}, exports.stts.encode = function(box, buf, offset) { var entries = box.entries || []; (buf = buf ? buf.slice(offset) : Buffer.alloc(exports.stts.encodingLength(box))).writeUInt32BE(entries.length, 0); for (var i = 0; i < entries.length; i++) { var ptr = 8 * i + 4; buf.writeUInt32BE(entries[i].count || 0, ptr), buf.writeUInt32BE(entries[i].duration || 0, ptr + 4); } return exports.stts.encode.bytes = 4 + 8 * box.entries.length, buf; }, exports.stts.decode = function(buf, offset) { for (var num = (buf = buf.slice(offset)).readUInt32BE(0), entries = new Array(num), i = 0; i < num; i++) { var ptr = 8 * i + 4; entries[i] = { count: buf.readUInt32BE(ptr), duration: buf.readUInt32BE(ptr + 4) }; } return { entries: entries }; }, exports.stts.encodingLength = function(box) { return 4 + 8 * box.entries.length; }, exports.ctts = {}, exports.ctts.encode = function(box, buf, offset) { var entries = box.entries || []; (buf = buf ? buf.slice(offset) : Buffer.alloc(exports.ctts.encodingLength(box))).writeUInt32BE(entries.length, 0); for (var i = 0; i < entries.length; i++) { var ptr = 8 * i + 4; buf.writeUInt32BE(entries[i].count || 0, ptr), buf.writeUInt32BE(entries[i].compositionOffset || 0, ptr + 4); } return exports.ctts.encode.bytes = 4 + 8 * entries.length, buf; }, exports.ctts.decode = function(buf, offset) { for (var num = (buf = buf.slice(offset)).readUInt32BE(0), entries = new Array(num), i = 0; i < num; i++) { var ptr = 8 * i + 4; entries[i] = { count: buf.readUInt32BE(ptr), compositionOffset: buf.readInt32BE(ptr + 4) }; } return { entries: entries }; }, exports.ctts.encodingLength = function(box) { return 4 + 8 * box.entries.length; }, exports.stsc = {}, exports.stsc.encode = function(box, buf, offset) { var entries = box.entries || []; (buf = buf ? buf.slice(offset) : Buffer.alloc(exports.stsc.encodingLength(box))).writeUInt32BE(entries.length, 0); for (var i = 0; i < entries.length; i++) { var ptr = 12 * i + 4; buf.writeUInt32BE(entries[i].firstChunk || 0, ptr), buf.writeUInt32BE(entries[i].samplesPerChunk || 0, ptr + 4), buf.writeUInt32BE(entries[i].sampleDescriptionId || 0, ptr + 8); } return exports.stsc.encode.bytes = 4 + 12 * entries.length, buf; }, exports.stsc.decode = function(buf, offset) { for (var num = (buf = buf.slice(offset)).readUInt32BE(0), entries = new Array(num), i = 0; i < num; i++) { var ptr = 12 * i + 4; entries[i] = { firstChunk: buf.readUInt32BE(ptr), samplesPerChunk: buf.readUInt32BE(ptr + 4), sampleDescriptionId: buf.readUInt32BE(ptr + 8) }; } return { entries: entries }; }, exports.stsc.encodingLength = function(box) { return 4 + 12 * box.entries.length; }, exports.dref = {}, exports.dref.encode = function(box, buf, offset) { buf = buf ? buf.slice(offset) : Buffer.alloc(exports.dref.encodingLength(box)); var entries = box.entries || []; buf.writeUInt32BE(entries.length, 0); for (var ptr = 4, i = 0; i < entries.length; i++) { var entry = entries[i], size = (entry.buf ? entry.buf.length : 0) + 4 + 4; buf.writeUInt32BE(size, ptr), ptr += 4, buf.write(entry.type, ptr, 4, "ascii"), ptr += 4, entry.buf && (entry.buf.copy(buf, ptr), ptr += entry.buf.length); } return exports.dref.encode.bytes = ptr, buf; }, exports.dref.decode = function(buf, offset) { for (var num = (buf = buf.slice(offset)).readUInt32BE(0), entries = new Array(num), ptr = 4, i = 0; i < num; i++) { var size = buf.readUInt32BE(ptr), type = buf.toString("ascii", ptr + 4, ptr + 8), tmp = buf.slice(ptr + 8, ptr + size); ptr += size, entries[i] = { type: type, buf: tmp }; } return { entries: entries }; }, exports.dref.encodingLength = function(box) { var totalSize = 4; if (!box.entries) return totalSize; for (var i = 0; i < box.entries.length; i++) { var buf = box.entries[i].buf; totalSize += (buf ? buf.length : 0) + 4 + 4; } return totalSize; }, exports.elst = {}, exports.elst.encode = function(box, buf, offset) { var entries = box.entries || []; (buf = buf ? buf.slice(offset) : Buffer.alloc(exports.elst.encodingLength(box))).writeUInt32BE(entries.length, 0); for (var i = 0; i < entries.length; i++) { var ptr = 12 * i + 4; buf.writeUInt32BE(entries[i].trackDuration || 0, ptr), buf.writeUInt32BE(entries[i].mediaTime || 0, ptr + 4), writeFixed32(entries[i].mediaRate || 0, buf, ptr + 8); } return exports.elst.encode.bytes = 4 + 12 * entries.length, buf; }, exports.elst.decode = function(buf, offset) { for (var num = (buf = buf.slice(offset)).readUInt32BE(0), entries = new Array(num), i = 0; i < num; i++) { var ptr = 12 * i + 4; entries[i] = { trackDuration: buf.readUInt32BE(ptr), mediaTime: buf.readInt32BE(ptr + 4), mediaRate: readFixed32(buf, ptr + 8) }; } return { entries: entries }; }, exports.elst.encodingLength = function(box) { return 4 + 12 * box.entries.length; }, exports.hdlr = {}, exports.hdlr.encode = function(box, buf, offset) { buf = buf ? buf.slice(offset) : Buffer.alloc(exports.hdlr.encodingLength(box)); var len = 21 + (box.name || "").length; return buf.fill(0, 0, len), buf.write(box.handlerType || "", 4, 4, "ascii"), (function(str, buf, offset) { var strBuffer = Buffer.from(str, "utf8"); strBuffer.copy(buf, 20), buf[20 + strBuffer.length] = 0; })(box.name || "", buf), exports.hdlr.encode.bytes = len, buf; }, exports.hdlr.decode = function(buf, offset, end) { return { handlerType: (buf = buf.slice(offset)).toString("ascii", 4, 8), name: readString(buf, 20, end) }; }, exports.hdlr.encodingLength = function(box) { return 21 + (box.name || "").length; }, exports.mehd = {}, exports.mehd.encode = function(box, buf, offset) { return (buf = buf ? buf.slice(offset) : Buffer.alloc(4)).writeUInt32BE(box.fragmentDuration || 0, 0), exports.mehd.encode.bytes = 4, buf; }, exports.mehd.decode = function(buf, offset) { return { fragmentDuration: (buf = buf.slice(offset)).readUInt32BE(0) }; }, exports.mehd.encodingLength = function(box) { return 4; }, exports.trex = {}, exports.trex.encode = function(box, buf, offset) { return (buf = buf ? buf.slice(offset) : Buffer.alloc(20)).writeUInt32BE(box.trackId || 0, 0), buf.writeUInt32BE(box.defaultSampleDescriptionIndex || 0, 4), buf.writeUInt32BE(box.defaultSampleDuration || 0, 8), buf.writeUInt32BE(box.defaultSampleSize || 0, 12), buf.writeUInt32BE(box.defaultSampleFlags || 0, 16), exports.trex.encode.bytes = 20, buf; }, exports.trex.decode = function(buf, offset) { return { trackId: (buf = buf.slice(offset)).readUInt32BE(0), defaultSampleDescriptionIndex: buf.readUInt32BE(4), defaultSampleDuration: buf.readUInt32BE(8), defaultSampleSize: buf.readUInt32BE(12), defaultSampleFlags: buf.readUInt32BE(16) }; }, exports.trex.encodingLength = function(box) { return 20; }, exports.mfhd = {}, exports.mfhd.encode = function(box, buf, offset) { return (buf = buf ? buf.slice(offset) : Buffer.alloc(4)).writeUInt32BE(box.sequenceNumber || 0, 0), exports.mfhd.encode.bytes = 4, buf; }, exports.mfhd.decode = function(buf, offset) { return { sequenceNumber: buf.readUInt32BE(0) }; }, exports.mfhd.encodingLength = function(box) { return 4; }, exports.tfhd = {}, exports.tfhd.encode = function(box, buf, offset) { return (buf = buf ? buf.slice(offset) : Buffer.alloc(4)).writeUInt32BE(box.trackId, 0), exports.tfhd.encode.bytes = 4, buf; }, exports.tfhd.decode = function(buf, offset) {}, exports.tfhd.encodingLength = function(box) { return 4; }, exports.tfdt = {}, exports.tfdt.encode = function(box, buf, offset) { return (buf = buf ? buf.slice(offset) : Buffer.alloc(4)).writeUInt32BE(box.baseMediaDecodeTime || 0, 0), exports.tfdt.encode.bytes = 4, buf; }, exports.tfdt.decode = function(buf, offset) {}, exports.tfdt.encodingLength = function(box) { return 4; }, exports.trun = {}, exports.trun.encode = function(box, buf, offset) { (buf = buf ? buf.slice(offset) : Buffer.alloc(8 + 16 * box.entries.length)).writeUInt32BE(box.entries.length, 0), buf.writeInt32BE(box.dataOffset, 4); for (var ptr = 8, i = 0; i < box.entries.length; i++) { var entry = box.entries[i]; buf.writeUInt32BE(entry.sampleDuration, ptr), ptr += 4, buf.writeUInt32BE(entry.sampleSize, ptr), ptr += 4, buf.writeUInt32BE(entry.sampleFlags, ptr), ptr += 4, 0 === (box.version || 0) ? buf.writeUInt32BE(entry.sampleCompositionTimeOffset, ptr) : buf.writeInt32BE(entry.sampleCompositionTimeOffset, ptr), ptr += 4; } exports.trun.encode.bytes = ptr; }, exports.trun.decode = function(buf, offset) {}, exports.trun.encodingLength = function(box) { return 8 + 16 * box.entries.length; }, exports.mdat = {}, exports.mdat.encode = function(box, buf, offset) { box.buffer ? (box.buffer.copy(buf, offset), exports.mdat.encode.bytes = box.buffer.length) : exports.mdat.encode.bytes = exports.mdat.encodingLength(box); }, exports.mdat.decode = function(buf, start, end) { return { buffer: Buffer.from(buf.slice(start, end)) }; }, exports.mdat.encodingLength = function(box) { return box.buffer ? box.buffer.length : box.contentLength; }; }, function(module, exports) { var tagToName = { 3: "ESDescriptor", 4: "DecoderConfigDescriptor", 5: "DecoderSpecificInfo", 6: "SLConfigDescriptor" }; exports.Descriptor = {}, exports.Descriptor.decode = function(buf, start, end) { var lenByte, obj, tag = buf.readUInt8(start), ptr = start + 1, len = 0; do { len = len << 7 | 127 & (lenByte = buf.readUInt8(ptr++)); } while (128 & lenByte); var tagName = tagToName[tag]; return (obj = exports[tagName] ? exports[tagName].decode(buf, ptr, end) : { buffer: Buffer.from(buf.slice(ptr, ptr + len)) }).tag = tag, obj.tagName = tagName, obj.length = ptr - start + len, obj.contentsLen = len, obj; }, exports.DescriptorArray = {}, exports.DescriptorArray.decode = function(buf, start, end) { for (var ptr = start, obj = {}; ptr + 2 <= end; ) { var descriptor = exports.Descriptor.decode(buf, ptr, end); ptr += descriptor.length, obj[tagToName[descriptor.tag] || "Descriptor" + descriptor.tag] = descriptor; } return obj; }, exports.ESDescriptor = {}, exports.ESDescriptor.decode = function(buf, start, end) { var flags = buf.readUInt8(start + 2), ptr = start + 3; return 128 & flags && (ptr += 2), 64 & flags && (ptr += buf.readUInt8(ptr) + 1), 32 & flags && (ptr += 2), exports.DescriptorArray.decode(buf, ptr, end); }, exports.DecoderConfigDescriptor = {}, exports.DecoderConfigDescriptor.decode = function(buf, start, end) { var oti = buf.readUInt8(start), obj = exports.DescriptorArray.decode(buf, start + 13, end); return obj.oti = oti, obj; }; }, function(module, exports, __webpack_require__) { const {finished: finished} = __webpack_require__(3); module.exports = async function(stream, size) { return new Promise(((resolve, reject) => { if (!stream.readable) return void reject(new Error("stream not readable")); let missing = size; const chunks = [], cleanup = finished(stream, onFinished); function read() { if (0 === stream.readableLength) return; const chunk = "number" == typeof missing ? stream.read(Math.min(missing, stream.readableLength)) : stream.read(); chunks.push(chunk), "number" == typeof missing && (missing -= chunk.length), "number" == typeof missing && 0 !== missing || (cleanup(), stream.off("readable", read), resolve(Buffer.concat(chunks))); } function onFinished(error) { cleanup(), stream.off("readable", read), size === 1 / 0 && chunks.length > 0 ? resolve(Buffer.concat(chunks)) : reject(error || new Error("stream ended")); } stream.on("readable", read), stream.readableLength > 0 && read(), stream._readableState.ended && onFinished(); })); }; }, function(module, exports, __webpack_require__) { const fs = __webpack_require__(2), {http: http, https: https} = __webpack_require__(914), {URL: URL, fileURLToPath: fileURLToPath} = __webpack_require__(7); module.exports = { open: async function(url, offset) { const {protocol: protocol, href: href} = new URL(url); return new Promise(((resolve, reject) => { switch (protocol) { case "http:": http.get(href, { headers: { range: `bytes=${offset}-` } }, resolve).on("error", reject); break; case "https:": https.get(href, { headers: { range: `bytes=${offset}-` } }, resolve).on("error", reject); break; case "file:": resolve(fs.createReadStream(fileURLToPath(href), { start: offset })); break; default: reject(new Error("Unsupported protocol")); } })); }, close: function(stream) { stream.req && "function" == typeof stream.req.abort ? stream.req.abort() : "function" == typeof stream.destroy && stream.destroy(); } }; }, function(module, exports, __webpack_require__) { var url = __webpack_require__(7), URL = url.URL, http = __webpack_require__(11), https = __webpack_require__(21), Writable = __webpack_require__(3).Writable, assert = __webpack_require__(25), debug = __webpack_require__(915), eventHandlers = Object.create(null); [ "abort", "aborted", "connect", "error", "socket", "timeout" ].forEach((function(event) { eventHandlers[event] = function(arg1, arg2, arg3) { this._redirectable.emit(event, arg1, arg2, arg3); }; })); var RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE", ""), TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded"), MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit"), WriteAfterEndError = createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); function RedirectableRequest(options, responseCallback) { Writable.call(this), this._sanitizeOptions(options), this._options = options, this._ended = !1, this._ending = !1, this._redirectCount = 0, this._redirects = [], this._requestBodyLength = 0, this._requestBodyBuffers = [], responseCallback && this.on("response", responseCallback); var self = this; this._onNativeResponse = function(response) { self._processResponse(response); }, this._performRequest(); } function wrap(protocols) { var exports = { maxRedirects: 21, maxBodyLength: 10485760 }, nativeProtocols = {}; return Object.keys(protocols).forEach((function(scheme) { var protocol = scheme + ":", nativeProtocol = nativeProtocols[protocol] = protocols[scheme], wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); Object.defineProperties(wrappedProtocol, { request: { value: function(input, options, callback) { if ("string" == typeof input) { var urlStr = input; try { input = urlToOptions(new URL(urlStr)); } catch (err) { input = url.parse(urlStr); } } else URL && input instanceof URL ? input = urlToOptions(input) : (callback = options, options = input, input = { protocol: protocol }); return "function" == typeof options && (callback = options, options = null), (options = Object.assign({ maxRedirects: exports.maxRedirects, maxBodyLength: exports.maxBodyLength }, input, options)).nativeProtocols = nativeProtocols, assert.equal(options.protocol, protocol, "protocol mismatch"), debug("options", options), new RedirectableRequest(options, callback); }, configurable: !0, enumerable: !0, writable: !0 }, get: { value: function(input, options, callback) { var wrappedRequest = wrappedProtocol.request(input, options, callback); return wrappedRequest.end(), wrappedRequest; }, configurable: !0, enumerable: !0, writable: !0 } }); })), exports; } function noop() {} function urlToOptions(urlObject) { var options = { protocol: urlObject.protocol, hostname: urlObject.hostname.startsWith("[") ? urlObject.hostname.slice(1, -1) : urlObject.hostname, hash: urlObject.hash, search: urlObject.search, pathname: urlObject.pathname, path: urlObject.pathname + urlObject.search, href: urlObject.href }; return "" !== urlObject.port && (options.port = Number(urlObject.port)), options; } function removeMatchingHeaders(regex, headers) { var lastValue; for (var header in headers) regex.test(header) && (lastValue = headers[header], delete headers[header]); return lastValue; } function createErrorType(code, defaultMessage) { function CustomError(message) { Error.captureStackTrace(this, this.constructor), this.message = message || defaultMessage; } return CustomError.prototype = new Error, CustomError.prototype.constructor = CustomError, CustomError.prototype.name = "Error [" + code + "]", CustomError.prototype.code = code, CustomError; } RedirectableRequest.prototype = Object.create(Writable.prototype), RedirectableRequest.prototype.abort = function() { this._currentRequest.removeAllListeners(), this._currentRequest.on("error", noop), this._currentRequest.abort(), this.emit("abort"), this.removeAllListeners(); }, RedirectableRequest.prototype.write = function(data, encoding, callback) { if (this._ending) throw new WriteAfterEndError; if (!("string" == typeof data || "object" == typeof data && "length" in data)) throw new TypeError("data should be a string, Buffer or Uint8Array"); "function" == typeof encoding && (callback = encoding, encoding = null), 0 !== data.length ? this._requestBodyLength + data.length <= this._options.maxBodyLength ? (this._requestBodyLength += data.length, this._requestBodyBuffers.push({ data: data, encoding: encoding }), this._currentRequest.write(data, encoding, callback)) : (this.emit("error", new MaxBodyLengthExceededError), this.abort()) : callback && callback(); }, RedirectableRequest.prototype.end = function(data, encoding, callback) { if ("function" == typeof data ? (callback = data, data = encoding = null) : "function" == typeof encoding && (callback = encoding, encoding = null), data) { var self = this, currentRequest = this._currentRequest; this.write(data, encoding, (function() { self._ended = !0, currentRequest.end(null, null, callback); })), this._ending = !0; } else this._ended = this._ending = !0, this._currentRequest.end(null, null, callback); }, RedirectableRequest.prototype.setHeader = function(name, value) { this._options.headers[name] = value, this._currentRequest.setHeader(name, value); }, RedirectableRequest.prototype.removeHeader = function(name) { delete this._options.headers[name], this._currentRequest.removeHeader(name); }, RedirectableRequest.prototype.setTimeout = function(msecs, callback) { var self = this; function startTimer() { self._timeout && clearTimeout(self._timeout), self._timeout = setTimeout((function() { self.emit("timeout"), clearTimer(); }), msecs); } function clearTimer() { clearTimeout(this._timeout), callback && self.removeListener("timeout", callback), this.socket || self._currentRequest.removeListener("socket", startTimer); } return callback && this.on("timeout", callback), this.socket ? startTimer() : this._currentRequest.once("socket", startTimer), this.once("response", clearTimer), this.once("error", clearTimer), this; }, [ "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive" ].forEach((function(method) { RedirectableRequest.prototype[method] = function(a, b) { return this._currentRequest[method](a, b); }; })), [ "aborted", "connection", "socket" ].forEach((function(property) { Object.defineProperty(RedirectableRequest.prototype, property, { get: function() { return this._currentRequest[property]; } }); })), RedirectableRequest.prototype._sanitizeOptions = function(options) { if (options.headers || (options.headers = {}), options.host && (options.hostname || (options.hostname = options.host), delete options.host), !options.pathname && options.path) { var searchPos = options.path.indexOf("?"); searchPos < 0 ? options.pathname = options.path : (options.pathname = options.path.substring(0, searchPos), options.search = options.path.substring(searchPos)); } }, RedirectableRequest.prototype._performRequest = function() { var protocol = this._options.protocol, nativeProtocol = this._options.nativeProtocols[protocol]; if (nativeProtocol) { if (this._options.agents) { var scheme = protocol.substr(0, protocol.length - 1); this._options.agent = this._options.agents[scheme]; } var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); for (var event in this._currentUrl = url.format(this._options), request._redirectable = this, eventHandlers) event && request.on(event, eventHandlers[event]); if (this._isRedirect) { var i = 0, self = this, buffers = this._requestBodyBuffers; !(function writeNext(error) { if (request === self._currentRequest) if (error) self.emit("error", error); else if (i < buffers.length) { var buffer = buffers[i++]; request.finished || request.write(buffer.data, buffer.encoding, writeNext); } else self._ended && request.end(); })(); } } else this.emit("error", new TypeError("Unsupported protocol " + protocol)); }, RedirectableRequest.prototype._processResponse = function(response) { var statusCode = response.statusCode; this._options.trackRedirects && this._redirects.push({ url: this._currentUrl, headers: response.headers, statusCode: statusCode }); var location = response.headers.location; if (location && !1 !== this._options.followRedirects && statusCode >= 300 && statusCode < 400) { if (this._currentRequest.removeAllListeners(), this._currentRequest.on("error", noop), this._currentRequest.abort(), response.destroy(), ++this._redirectCount > this._options.maxRedirects) return void this.emit("error", new TooManyRedirectsError); ((301 === statusCode || 302 === statusCode) && "POST" === this._options.method || 303 === statusCode && !/^(?:GET|HEAD)$/.test(this._options.method)) && (this._options.method = "GET", this._requestBodyBuffers = [], removeMatchingHeaders(/^content-/i, this._options.headers)); var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) || url.parse(this._currentUrl).hostname, redirectUrl = url.resolve(this._currentUrl, location); debug("redirecting to", redirectUrl), this._isRedirect = !0; var redirectUrlParts = url.parse(redirectUrl); if (Object.assign(this._options, redirectUrlParts), redirectUrlParts.hostname !== previousHostName && removeMatchingHeaders(/^authorization$/i, this._options.headers), "function" == typeof this._options.beforeRedirect) { var responseDetails = { headers: response.headers }; try { this._options.beforeRedirect.call(null, this._options, responseDetails); } catch (err) { return void this.emit("error", err); } this._sanitizeOptions(this._options); } try { this._performRequest(); } catch (cause) { var error = new RedirectionError("Redirected request failed: " + cause.message); error.cause = cause, this.emit("error", error); } } else response.responseUrl = this._currentUrl, response.redirects = this._redirects, this.emit("response", response), this._requestBodyBuffers = []; }, module.exports = wrap({ http: http, https: https }), module.exports.wrap = wrap; }, function(module, exports, __webpack_require__) { var debug; module.exports = function() { if (!debug) try { debug = __webpack_require__(9)("follow-redirects"); } catch (error) { debug = function() {}; } debug.apply(null, arguments); }; }, function(module, exports) { module.exports = function({streams: streams, query: query}) { const video = streams.find((({track: track}) => "video" === track)), audio = streams.filter((({track: track}) => "audio" === track)), subtitles = streams.filter((({track: track}) => "subtitle" === track)); return [ "#EXTM3U", "#EXT-X-VERSION:7", ...video ? [ '#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="video",NAME="Video",AUTOSELECT=YES,DEFAULT=YES' ] : [], ...audio.map((({id: id, title: title, language: language}) => `#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="${"string" == typeof title ? title : "string" == typeof language ? language : id}"${"string" == typeof language ? `,LANGUAGE="${language}"` : ""},AUTOSELECT=YES,DEFAULT=${0 === id ? "YES" : "NO"}${video ? `,URI="audio${id}.m3u8?${query}"` : ""}`)), ...subtitles.map((({id: id, title: title, language: language}) => `#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="${"string" == typeof title ? title : "string" == typeof language ? language : id}"${"string" == typeof language ? `,LANGUAGE="${language}"` : ""},AUTOSELECT=NO,DEFAULT=NO,FORCED=NO,URI="subtitle${id}.m3u8?${query}"`)), `#EXT-X-STREAM-INF:BANDWIDTH=164000${video ? ',VIDEO="video"' : ""}${audio.length > 0 ? ',AUDIO="audio"' : ""}${subtitles.length > 0 ? ',SUBTITLES="subtitles"' : ""},NAME="Main"`, ...video ? [ `video0.m3u8?${query}` ] : audio.length > 0 ? [ `audio0.m3u8?${query}` ] : [] ].join("\n"); }; }, function(module, exports) { module.exports = function({mediaSegments: mediaSegments, timescale: timescale, track: track, query: query}) { const durations = Array.from(mediaSegments.values()).map((({duration: duration, extraSegments: extraSegments = []}) => { const totalDuration = duration + extraSegments.reduce(((result, {duration: duration}) => result + duration), 0); return Math.ceil(totalDuration / timescale); })), ext = track.match(/^(?:video|audio).+$/) ? "m4s" : "vtt"; return [ "#EXTM3U", "#EXT-X-VERSION:7", `#EXT-X-TARGETDURATION:${Math.max.apply(null, durations.concat(1))}`, "#EXT-X-MEDIA-SEQUENCE:1", "#EXT-X-PLAYLIST-TYPE:VOD", ...track.match(/^(?:video|audio).+$/) ? [ `#EXT-X-MAP:URI="${track}/init.mp4?${query}"` ] : [], ...Array.from(mediaSegments.entries()).map((([sequenceNumber, {duration: duration, extraSegments: extraSegments = []}]) => { const totalDuration = duration + extraSegments.reduce(((result, {duration: duration}) => result + duration), 0); return [ `#EXTINF:${(totalDuration / timescale).toFixed(6)},`, `${track}/segment${sequenceNumber}.${ext}?${query}` ]; })).reduce(((result, segment) => result.concat(segment)), []), "#EXT-X-ENDLIST" ].join("\n"); }; }, function(module, exports, __webpack_require__) { const fs = __webpack_require__(2), path = __webpack_require__(5), muxjs = __webpack_require__(447), {Mutex: Mutex} = __webpack_require__(437), readChunk = __webpack_require__(231), segmenter = __webpack_require__(919), mp4 = __webpack_require__(921), vtt = __webpack_require__(925), m3u8 = __webpack_require__(466), spawnConvertProcess = __webpack_require__(934), TRANSMUXED_VIDEO_CODECS = [ "h264" ], TRANSMUXED_AUDIO_CODECS = [ "aac", "mp3" ], TRANSCODING_AAC_SAMPLE_RATES = [ 7350, 8e3, 11025, 12e3, 16e3, 22050, 24e3, 32e3, 44100, 48e3, 64e3, 88200, 96e3 ]; class ConverterDestroyedError extends Error { constructor() { super("MediaConverter is destroyed"), this.name = "ConverterDestroyedError"; } } class SegmentCanceledError extends Error { constructor() { super("Segment is canceled"), this.name = "SegmentCanceledError"; } } module.exports = function({ffmpeg: ffmpeg, mediaURL: mediaURL, maxAudioChannels: maxAudioChannels, videoCodecs: videoCodecs, audioCodecs: audioCodecs, forceTranscoding: forceTranscoding, profile: profile, maxWidth: maxWidth, stream: stream, format: format, samples: samples, sampleDuration: sampleDuration, query: query}) { let destroyed = !1; const initMutex = new Mutex(new ConverterDestroyedError); let initError = null, initSegmentBuffer = null, mediaSegments = null, timescale = null; const convertMutex = new Mutex(new SegmentCanceledError); let convertOptions = null, convertProcess = null, sequenceNumber = null; const debugDir = process.env.HLS_DEBUG_DIR || path.resolve("./"), debugOutput = process.env.HLS_DEBUG && "android" !== process.platform ? fs.createWriteStream(path.join(debugDir, `media_${stream.track}${stream.id}_${encodeURIComponent(new URL(mediaURL).pathname)}.log`)) : null; function debug(message) { process.env.HLS_DEBUG && ("android" === process.platform ? console.log(`HLSV2:convert:${stream.track}${stream.id}:debug`, message) : debugOutput.write(`${(new Date).toLocaleTimeString()} ${message}\n`)); } async function init(subtitles) { if (initMutex.isLocked() && (debug("init:pending"), await initMutex.acquire().then((release => release()))), null !== initError) throw initError; if (null !== mediaSegments) return; const release = await initMutex.acquire(); debug(`init:started:${JSON.stringify({ ffmpeg: ffmpeg, mediaURL: mediaURL, maxAudioChannels: maxAudioChannels, videoCodecs: videoCodecs, audioCodecs: audioCodecs, forceTranscoding: forceTranscoding, stream: stream, format: format, samples: samples, sampleDuration: sampleDuration, query: query, subtitles: subtitles }, null, 4)}`); try { if ("video" === stream.track || "audio" === stream.track) { const transmuxedCodecs = "video" === stream.track ? Array.isArray(videoCodecs) ? videoCodecs : TRANSMUXED_VIDEO_CODECS : Array.isArray(audioCodecs) ? audioCodecs : TRANSMUXED_AUDIO_CODECS, requiresTranscoding = forceTranscoding || !samples.some((({key: key}) => key)) && ("number" != typeof sampleDuration || "video" === stream.track) || ("video" === stream.track ? !transmuxedCodecs.includes(stream.codec) || !!subtitles : !transmuxedCodecs.includes(stream.codec) || "number" == typeof maxAudioChannels && stream.channels > maxAudioChannels), track = stream.track; if (requiresTranscoding) { const audioSampleRate = "audio" === track ? TRANSCODING_AAC_SAMPLE_RATES.includes(stream.sampleRate) ? stream.sampleRate : "number" == typeof stream.sampleRate ? TRANSCODING_AAC_SAMPLE_RATES.reduce(((result, sampleRate) => stream.sampleRate <= TRANSCODING_AAC_SAMPLE_RATES[0] ? TRANSCODING_AAC_SAMPLE_RATES[0] : stream.sampleRate >= TRANSCODING_AAC_SAMPLE_RATES[TRANSCODING_AAC_SAMPLE_RATES.length - 1] ? TRANSCODING_AAC_SAMPLE_RATES[TRANSCODING_AAC_SAMPLE_RATES.length - 1] : Math.abs(sampleRate - stream.sampleRate) < Math.abs(result - stream.sampleRate) ? sampleRate : result), TRANSCODING_AAC_SAMPLE_RATES[0]) : 48e3 : null; convertOptions = { ffmpeg: ffmpeg, mediaURL: mediaURL, segmentDuration: "video" === track ? 4 : 196608 / audioSampleRate, format: format, [track]: { ...stream, transcode: !0, override: { frameRate: "video" === track ? 24 : null, embeddedSubtitlesId: "video" === track && subtitles && "string" == typeof subtitles.id ? subtitles.id : null, externalSubtitlesUrl: "video" === track && subtitles && "string" == typeof subtitles.url ? subtitles.url : null, channels: "audio" === track && "number" == typeof maxAudioChannels && stream.channels > maxAudioChannels ? maxAudioChannels : stream.channels, sampleRate: "audio" === track ? audioSampleRate : null } }, track: `${stream.track}${stream.id}`, profile: profile, maxWidth: maxWidth }; } else convertOptions = { ffmpeg: ffmpeg, mediaURL: mediaURL, segmentDuration: "video" === track ? 6 : 4.096, format: format, [track]: stream, track: `${stream.track}${stream.id}`, profile: profile, maxWidth: maxWidth }; if (convertProcess = spawnConvertProcess(convertOptions), await convertProcess.create(), initSegmentBuffer = await mp4.init(convertProcess.stream), !initMutex.isLocked()) throw new ConverterDestroyedError; if (timescale = muxjs.mp4.probe.timescale(initSegmentBuffer)[1], "audio" === track && convertOptions.audio.transcode && convertOptions.audio.override.sampleRate !== timescale) throw new Error("Output audio timescale does not match the sample rate"); mediaSegments = requiresTranscoding ? segmenter.predict({ stream: stream, format: format, timescale: timescale, segmentDuration: convertOptions.segmentDuration }) : segmenter.retrieve({ stream: stream, format: format, timescale: timescale, segmentDuration: convertOptions.segmentDuration, samples: samples, sampleDuration: sampleDuration }), release(); } else convertOptions = { ffmpeg: ffmpeg, mediaURL: mediaURL, format: format, [stream.track]: stream, track: `${stream.track}${stream.id}` }, convertProcess = spawnConvertProcess(convertOptions), await convertProcess.create(), timescale = stream.timescale, mediaSegments = segmenter.predict({ stream: stream, format: format, timescale: timescale, segmentDuration: 10 }), release(); } catch (error) { throw debug(`init:error:${error}`), error instanceof ConverterDestroyedError || (initError = error), initSegmentBuffer = null, mediaSegments = null, timescale = null, convertMutex.cancel(), convertOptions = null, stop(), release(), error; } debug(`init:ended:${JSON.stringify(convertOptions, null, 4)}`); } function stop() { debug("stop"), sequenceNumber = null, null !== convertProcess && (convertProcess.destroy(), convertProcess = null); } function clear() { debug("clear"); for (const [_, mediaSegment] of mediaSegments) { mediaSegment.buffer = null, mediaSegment.cues = []; for (const extraSegment of mediaSegment.extraSegments) extraSegment.buffer = null; } } async function seek(targetSequenceNumber, blank) { debug(`seek:started:${targetSequenceNumber}`); const seekSequenceNumber = mediaSegments.has(targetSequenceNumber - 1) ? targetSequenceNumber - 1 : targetSequenceNumber, seekMediaSegment = mediaSegments.get(seekSequenceNumber), seekConvertProcess = spawnConvertProcess({ ...convertOptions, blank: blank, sequenceNumber: seekMediaSegment.sequenceNumber, time: seekMediaSegment.seekTime / timescale }); if (sequenceNumber = targetSequenceNumber, convertProcess = seekConvertProcess, await seekConvertProcess.create(), seekConvertProcess !== convertProcess) throw new SegmentCanceledError; if (("video" === stream.track || "audio" === stream.track) && (await mp4.init(seekConvertProcess.stream), seekConvertProcess !== convertProcess)) throw new SegmentCanceledError; if (seekSequenceNumber !== targetSequenceNumber) { try { await readOutputSegment(seekSequenceNumber); } catch (error) {} if (seekConvertProcess !== convertProcess) throw new SegmentCanceledError; "video" !== stream.track && "audio" !== stream.track || clear(); } debug(`seek:ended:${targetSequenceNumber}`); } async function readOutputSegment(targetSequenceNumber) { return "video" === stream.track ? (async function(targetSequenceNumber) { debug(`read:started:${targetSequenceNumber}`); const targetConvertProcess = convertProcess, targetMediaSegment = mediaSegments.get(targetSequenceNumber); for (let i = 0; i < targetMediaSegment.extraSegments.length + 1; i++) { const chunks = [], targetDuration = 0 === i ? targetMediaSegment.duration : targetMediaSegment.extraSegments[i - 1].duration; for (let duration = 0; duration < targetDuration; ) { let mediaSegmentBuffer; try { mediaSegmentBuffer = await mp4.media(targetConvertProcess.stream); } catch (error) { if (targetConvertProcess !== convertProcess) throw new SegmentCanceledError; throw error; } if (targetConvertProcess !== convertProcess) throw new SegmentCanceledError; const boxes = muxjs.mp4.tools.inspect(mediaSegmentBuffer), sidx = boxes.find((({type: type}) => "sidx" === type)); mp4.updateBaseMediaDecodeTime({ buffer: mediaSegmentBuffer, baseMediaDecodeTime: sidx.earliestPresentationTime, trackId: 1, boxes: boxes }), duration += sidx.references.reduce(((duration, {subsegmentDuration: subsegmentDuration}) => duration + subsegmentDuration), 0), chunks.push(mediaSegmentBuffer); } 0 === i ? targetMediaSegment.buffer = Buffer.concat(chunks) : targetMediaSegment.extraSegments[i - 1].buffer = Buffer.concat(chunks); } debug(`read:ended:${targetSequenceNumber}`); })(targetSequenceNumber) : "audio" === stream.track ? (async function(targetSequenceNumber) { debug(`read:started:${targetSequenceNumber}`); const targetConvertProcess = convertProcess, targetMediaSegment = mediaSegments.get(targetSequenceNumber); let mediaSegmentBuffer; try { mediaSegmentBuffer = await mp4.media(targetConvertProcess.stream); } catch (error) { if (targetConvertProcess !== convertProcess) throw new SegmentCanceledError; throw error; } if (targetConvertProcess !== convertProcess) throw new SegmentCanceledError; const boxes = muxjs.mp4.tools.inspect(mediaSegmentBuffer), sidx = boxes.find((({type: type}) => "sidx" === type)); mp4.updateBaseMediaDecodeTime({ buffer: mediaSegmentBuffer, baseMediaDecodeTime: sidx.earliestPresentationTime, trackId: 1, boxes: boxes }), targetMediaSegment.buffer = mediaSegmentBuffer, debug(`read:ended:${targetSequenceNumber}`); })(targetSequenceNumber) : (async function(targetSequenceNumber) { debug(`read:started:${targetSequenceNumber}`); const targetConvertProcess = convertProcess, targetMediaSegment = mediaSegments.get(targetSequenceNumber); for (;null === targetMediaSegment.buffer; ) { let text = ""; try { const size = targetSequenceNumber === mediaSegments.size ? 1 / 0 : null; text = (await readChunk(targetConvertProcess.stream, size)).toString(); } catch (error) { if (null === targetConvertProcess.exitCode && null === targetConvertProcess.signalCode && await new Promise((resolve => { targetConvertProcess.events.on("exit", resolve); })), targetConvertProcess !== convertProcess) throw new SegmentCanceledError; if (0 !== targetConvertProcess.exitCode) throw error; } if (targetConvertProcess !== convertProcess) throw new SegmentCanceledError; const cues = vtt.parse(text); for (const cue of cues) { const startSequenceNumber = Math.floor(cue.startTime / 10) + 1, endSequenceNumber = Math.floor(cue.endTime / 10) + 1; for (let sequenceNumber = startSequenceNumber; sequenceNumber <= endSequenceNumber; sequenceNumber++) mediaSegments.get(sequenceNumber).cues.push(cue); } const lastSequenceNumber = 0 === targetConvertProcess.exitCode || targetSequenceNumber === mediaSegments.size ? mediaSegments.size : Array.from(mediaSegments.entries()).reduceRight(((lastSequenceNumber, [sequenceNumber, {cues: cues}]) => null === lastSequenceNumber && cues.length > 0 ? sequenceNumber - 1 : lastSequenceNumber), null); if (null !== lastSequenceNumber) for (let sequenceNumber = targetSequenceNumber; sequenceNumber <= lastSequenceNumber; sequenceNumber++) { const mediaSegment = mediaSegments.get(sequenceNumber); null === mediaSegment.buffer && (mediaSegment.buffer = Buffer.from(vtt.format(mediaSegment.cues))); } } debug(`read:ended:${targetSequenceNumber}`); })(targetSequenceNumber); } this.playlist = async () => { if (destroyed) throw new ConverterDestroyedError; return await init(), m3u8.media({ mediaSegments: mediaSegments, timescale: timescale, track: `${stream.track}${stream.id}`, query: query }); }, this.initSegment = async () => { if (destroyed) throw new ConverterDestroyedError; if ("video" !== stream.track && "audio" !== stream.track) throw new Error("init segment is available only for A/V streams"); return await init(), initSegmentBuffer; }, this.mediaSegment = async targetSequenceNumber => { if (destroyed) throw new ConverterDestroyedError; if (await init(), !mediaSegments.has(targetSequenceNumber)) throw new Error("Sequence number out of range"); const targetMediaSegment = mediaSegments.get(targetSequenceNumber); if (null === targetMediaSegment.buffer || targetMediaSegment.extraSegments.some((({buffer: buffer}) => null === buffer))) { targetSequenceNumber !== sequenceNumber && (convertMutex.cancel(), stop()); const release = await convertMutex.acquire(); if (null !== targetMediaSegment.buffer) return release(), debug(`mediaSegment:buffered:${targetSequenceNumber}`), Buffer.concat([ targetMediaSegment.buffer ].concat("video" === stream.track ? targetMediaSegment.extraSegments.map((({buffer: buffer}) => buffer)) : [])); "video" !== stream.track && "audio" !== stream.track && targetSequenceNumber === sequenceNumber || clear(); try { targetSequenceNumber !== sequenceNumber && await seek(targetSequenceNumber); try { await readOutputSegment(targetSequenceNumber); } catch (error) { if (error instanceof SegmentCanceledError) throw error; if ("video" !== stream.track && "audio" !== stream.track) throw error; const targetConvertProcess = convertProcess; if (null === targetConvertProcess.exitCode && null === targetConvertProcess.signalCode && await new Promise((resolve => { targetConvertProcess.events.on("exit", resolve); })), targetConvertProcess !== convertProcess) throw new SegmentCanceledError; if (0 !== targetConvertProcess.exitCode) throw error; clear(), await seek(targetSequenceNumber, !0), await readOutputSegment(targetSequenceNumber); } } catch (error) { throw debug(`mediaSegment:error:${targetSequenceNumber}:${error}`), error instanceof SegmentCanceledError || stop(), release(), error; } sequenceNumber = Array.from(mediaSegments.entries()).reduceRight(((result, [sequenceNumber, {buffer: buffer}]) => null === result && null !== buffer ? sequenceNumber + 1 : result), null), mediaSegments.has(sequenceNumber) || stop(), release(); } return debug(`mediaSegment:read:${targetSequenceNumber}`), Buffer.concat([ targetMediaSegment.buffer ].concat("video" === stream.track ? targetMediaSegment.extraSegments.map((({buffer: buffer}) => buffer)) : [])); }, this.burnSubtitles = async ({url: url, id: id}) => { if (destroyed) throw new ConverterDestroyedError; if (initMutex.isLocked() && await initMutex.acquire().then((release => release())), "video" !== stream.track || null !== convertOptions && !convertOptions.video.transcode) throw new Error("Burning subtitles only allowed for the transcoded video track"); initError = null, initSegmentBuffer = null, mediaSegments = null, timescale = null, convertMutex.cancel(), convertOptions = null, stop(), await init({ url: url, id: id }); }, this.status = async () => { if (destroyed) throw new ConverterDestroyedError; try { await init(); } catch (e) {} return { convertOptions: convertOptions, sequenceNumber: sequenceNumber, initError: initError, init: null !== initSegmentBuffer }; }, this.destroy = () => { debug("destroy"), destroyed = !0, initMutex.cancel(), initError = null, initSegmentBuffer = null, mediaSegments = null, timescale = null, convertMutex.cancel(), convertOptions = null, stop(); }; }; }, function(module, exports, __webpack_require__) { const predict = __webpack_require__(467), retrieve = __webpack_require__(920); module.exports = { predict: predict, retrieve: retrieve }; }, function(module, exports, __webpack_require__) { const predict = __webpack_require__(467); module.exports = function({stream: stream, format: format, samples: samples, sampleDuration: sampleDuration, timescale: timescale, segmentDuration: segmentDuration}) { const timescaleCoef = timescale / stream.timescale, segmentDurationTs = Math.ceil(segmentDuration * timescale), sampleDurationTs = sampleDuration * timescaleCoef; if (samples.some((({key: key}) => key))) return samples.filter((({key: key}) => key)).map((({pts: pts}, index, keySamples) => ({ sequenceNumber: index + 1, seekTime: pts * timescaleCoef, duration: index + 1 < keySamples.length ? (keySamples[index + 1].pts - pts) * timescaleCoef : sampleDurationTs, buffer: null, cues: [], extraSegments: [] }))).map(((segment, index, segments) => [ segment, "video" === stream.track && [ segment, segments[index - 1] ].some((segment => segment && segment.duration < 20 * sampleDurationTs)) ])).reduce(((result, [segment, extra]) => { if (result.has(result.size)) { const lastRootSegment = result.get(result.size), lastRootSegmentTotalDuration = lastRootSegment.duration + lastRootSegment.extraSegments.reduce(((result, {duration: duration}) => result + duration), 0); if (lastRootSegmentTotalDuration < segmentDurationTs || extra) return "audio" === stream.track && (segment.sequenceNumber = null), lastRootSegment.extraSegments.push(segment), result; } return "audio" === stream.track && (segment.sequenceNumber = result.size + 1), result.set(result.size + 1, segment), result; }), new Map); const samplesPerSegment = Math.ceil(segmentDurationTs / (sampleDuration * timescaleCoef)); return predict({ stream: stream, format: format, segmentDuration: samplesPerSegment * sampleDuration / stream.timescale, timescale: timescale }); }; }, function(module, exports, __webpack_require__) { const init = __webpack_require__(922), media = __webpack_require__(923), updateBaseMediaDecodeTime = __webpack_require__(924); module.exports = { init: init, media: media, updateBaseMediaDecodeTime: updateBaseMediaDecodeTime }; }, function(module, exports, __webpack_require__) { const readUntilBox = __webpack_require__(468); module.exports = async function(stream) { return readUntilBox(stream, "moov"); }; }, function(module, exports, __webpack_require__) { const readUntilBox = __webpack_require__(468); module.exports = async function(stream) { return readUntilBox(stream, "mdat"); }; }, function(module, exports) { module.exports = function({buffer: buffer, baseMediaDecodeTime: baseMediaDecodeTime, boxes: boxes, trackId: trackId}) { const moofIndex = boxes.findIndex((({type: type}) => "moof" === type)); if (-1 === moofIndex) return; const trafIndex = boxes[moofIndex].boxes.findIndex((({type: type, boxes: boxes}) => "traf" === type && boxes.some((box => "tfhd" === box.type && box.trackId === trackId)))); if (-1 === trafIndex) return; const tfdtIndex = boxes[moofIndex].boxes[trafIndex].boxes.findIndex((({type: type}) => "tfdt" === type)); if (-1 === tfdtIndex) return; const tfdtDataOffset = boxes.slice(0, moofIndex).reduce(((result, {size: size}) => result + size), 0) + 8 + boxes[moofIndex].boxes.slice(0, trafIndex).reduce(((result, {size: size}) => result + size), 0) + 8 + boxes[moofIndex].boxes[trafIndex].boxes.slice(0, tfdtIndex).reduce(((result, {size: size}) => result + size), 0) + 8; buffer.writeUInt8(1, tfdtDataOffset), buffer.writeBigUInt64BE(BigInt(Math.max(baseMediaDecodeTime, 0)), tfdtDataOffset + 4); }; }, function(module, exports, __webpack_require__) { const format = __webpack_require__(926), parse = __webpack_require__(927); module.exports = { format: format, parse: parse }; }, function(module, exports) { function formatTime(time) { return [ Math.floor(time / 3600), Math.floor(time / 60) % 60, (time % 60).toFixed(3) ].map((v => v < 10 ? "0" + v : v)).join(":"); } module.exports = function(cues) { return "WEBVTT\n\n" + cues.map((cue => `${formatTime(cue.startTime)} --\x3e ${formatTime(cue.endTime)}\n${cue.text}\n`)).join("\n"); }; }, function(module, exports, __webpack_require__) { const {WebVTT: WebVTT, VTTCue: VTTCue} = __webpack_require__(928); global.navigator = { userAgent: "" }, module.exports = function(text) { const parser = new WebVTT.Parser({ VTTCue: VTTCue }, WebVTT.StringDecoder()), errors = [], cues = []; if (parser.oncue = cue => { cues.push(cue); }, parser.onparsingerror = error => { errors.push(error); }, parser.parse(text.startsWith("WEBVTT") ? text : "WEBVTT\n\n" + text), parser.flush(), parser.oncue = null, parser.onparsingerror = null, 0 === cues.length && errors.length > 0) throw errors[0]; return cues; }; }, function(module, exports, __webpack_require__) { module.exports = { WebVTT: __webpack_require__(929).WebVTT, VTTCue: __webpack_require__(930).VTTCue, VTTRegion: __webpack_require__(932).VTTRegion }; }, function(module, exports) { !(function(global) { function makeColorSet(color, opacity) { return void 0 === opacity && (opacity = 1), "rgba(" + [ parseInt(color.substring(0, 2), 16), parseInt(color.substring(2, 4), 16), parseInt(color.substring(4, 6), 16), opacity ].join(",") + ")"; } var fontScale = 1; function observe(subject, topic, data) { switch (data) { case "webvtt.font.color": case "webvtt.font.opacity": var fontColor = Services.prefs.getCharPref("webvtt.font.color"), fontOpacity = Services.prefs.getIntPref("webvtt.font.opacity") / 100; WebVTTSet.fontSet = makeColorSet(fontColor, fontOpacity); break; case "webvtt.font.scale": fontScale = Services.prefs.getIntPref("webvtt.font.scale") / 100; break; case "webvtt.bg.color": case "webvtt.bg.opacity": var backgroundColor = Services.prefs.getCharPref("webvtt.bg.color"), backgroundOpacity = Services.prefs.getIntPref("webvtt.bg.opacity") / 100; WebVTTSet.backgroundSet = makeColorSet(backgroundColor, backgroundOpacity); break; case "webvtt.edge.color": case "webvtt.edge.type": var edgeType = Services.prefs.getIntPref("webvtt.edge.type"), edgeColor = Services.prefs.getCharPref("webvtt.edge.color"); WebVTTSet.edgeSet = [ "", "0px 0px ", "4px 4px 4px ", "-2px -2px ", "2px 2px " ][edgeType] + makeColorSet(edgeColor); } } if ("undefined" != typeof Services) { var WebVTTSet = {}; [ "webvtt.font.color", "webvtt.font.opacity", "webvtt.font.scale", "webvtt.bg.color", "webvtt.bg.opacity", "webvtt.edge.color", "webvtt.edge.type" ].forEach((function(pref) { observe(0, 0, pref), Services.prefs.addObserver(pref, observe, !1); })); } var _objCreate = Object.create || (function() { function F() {} return function(o) { if (1 !== arguments.length) throw new Error("Object.create shim only accepts one parameter."); return F.prototype = o, new F; }; })(); function ParsingError(errorData, message) { this.name = "ParsingError", this.code = errorData.code, this.message = message || errorData.message; } function parseTimeStamp(input) { function computeSeconds(h, m, s, f) { return 3600 * (0 | h) + 60 * (0 | m) + (0 | s) + (0 | f) / 1e3; } var m = input.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/); return m ? m[3] ? computeSeconds(m[1], m[2], m[3].replace(":", ""), m[4]) : m[1] > 59 ? computeSeconds(m[1], m[2], 0, m[4]) : computeSeconds(0, m[1], m[2], m[4]) : null; } function Settings() { this.values = _objCreate(null); } function parseOptions(input, callback, keyValueDelim, groupDelim) { var groups = groupDelim ? input.split(groupDelim) : [ input ]; for (var i in groups) if ("string" == typeof groups[i]) { var kv = groups[i].split(keyValueDelim); 2 === kv.length && callback(kv[0], kv[1]); } } function parseCue(input, cue, regionList) { var oInput = input; function consumeTimeStamp() { var ts = parseTimeStamp(input); if (null === ts) throw new ParsingError(ParsingError.Errors.BadTimeStamp, "Malformed timestamp: " + oInput); return input = input.replace(/^[^\sa-zA-Z-]+/, ""), ts; } function skipWhitespace() { input = input.replace(/^\s+/, ""); } if (skipWhitespace(), cue.startTime = consumeTimeStamp(), skipWhitespace(), "--\x3e" !== input.substr(0, 3)) throw new ParsingError(ParsingError.Errors.BadTimeStamp, "Malformed time stamp (time stamps must be separated by '--\x3e'): " + oInput); input = input.substr(3), skipWhitespace(), cue.endTime = consumeTimeStamp(), skipWhitespace(), (function(input, cue) { var settings = new Settings; parseOptions(input, (function(k, v) { switch (k) { case "region": for (var i = regionList.length - 1; i >= 0; i--) if (regionList[i].id === v) { settings.set(k, regionList[i].region); break; } break; case "vertical": settings.alt(k, v, [ "rl", "lr" ]); break; case "line": var vals = v.split(","), vals0 = vals[0]; settings.integer(k, vals0), settings.percent(k, vals0) && settings.set("snapToLines", !1), settings.alt(k, vals0, [ "auto" ]), 2 === vals.length && settings.alt("lineAlign", vals[1], [ "start", "middle", "end" ]); break; case "position": vals = v.split(","), settings.percent(k, vals[0]), 2 === vals.length && settings.alt("positionAlign", vals[1], [ "start", "middle", "end" ]); break; case "size": settings.percent(k, v); break; case "align": settings.alt(k, v, [ "start", "middle", "end", "left", "right" ]); } }), /:/, /\s/), cue.region = settings.get("region", null), cue.vertical = settings.get("vertical", ""), cue.line = settings.get("line", "auto"), cue.lineAlign = settings.get("lineAlign", "start"), cue.snapToLines = settings.get("snapToLines", !0), cue.size = settings.get("size", 100), cue.align = settings.get("align", "middle"), cue.position = settings.get("position", "auto"), cue.positionAlign = settings.get("positionAlign", { start: "start", left: "start", middle: "middle", end: "end", right: "end" }, cue.align); })(input, cue); } ParsingError.prototype = _objCreate(Error.prototype), ParsingError.prototype.constructor = ParsingError, ParsingError.Errors = { BadSignature: { code: 0, message: "Malformed WebVTT signature." }, BadTimeStamp: { code: 1, message: "Malformed time stamp." } }, Settings.prototype = { set: function(k, v) { this.get(k) || "" === v || (this.values[k] = v); }, get: function(k, dflt, defaultKey) { return defaultKey ? this.has(k) ? this.values[k] : dflt[defaultKey] : this.has(k) ? this.values[k] : dflt; }, has: function(k) { return k in this.values; }, alt: function(k, v, a) { for (var n = 0; n < a.length; ++n) if (v === a[n]) { this.set(k, v); break; } }, integer: function(k, v) { /^-?\d+$/.test(v) && this.set(k, parseInt(v, 10)); }, percent: function(k, v) { return !!(v.match(/^([\d]{1,3})(\.[\d]*)?%$/) && (v = parseFloat(v)) >= 0 && v <= 100) && (this.set(k, v), !0); } }; var ESCAPE = { "&": "&", "<": "<", ">": ">", "‎": "‎", "‏": "‏", " ": " " }, TAG_NAME = { c: "span", i: "i", b: "b", u: "u", ruby: "ruby", rt: "rt", v: "span", lang: "span" }, TAG_ANNOTATION = { v: "title", lang: "lang" }, NEEDS_PARENT = { rt: "ruby" }; function parseContent(window, input) { function nextToken() { if (!input) return null; var result, m = input.match(/^([^<]*)(<[^>]+>?)?/); return result = m[1] ? m[1] : m[2], input = input.substr(result.length), result; } function unescape1(e) { return ESCAPE[e]; } function unescape(s) { for (;m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/); ) s = s.replace(m[0], unescape1); return s; } function shouldAdd(current, element) { return !NEEDS_PARENT[element.localName] || NEEDS_PARENT[element.localName] === current.localName; } function createElement(type, annotation) { var tagName = TAG_NAME[type]; if (!tagName) return null; var element = window.document.createElement(tagName); element.localName = tagName; var name = TAG_ANNOTATION[type]; return name && annotation && (element[name] = annotation.trim()), element; } for (var t, rootDiv = window.document.createElement("div"), current = rootDiv, tagStack = []; null !== (t = nextToken()); ) if ("<" !== t[0]) current.appendChild(window.document.createTextNode(unescape(t))); else { if ("/" === t[1]) { tagStack.length && tagStack[tagStack.length - 1] === t.substr(2).replace(">", "") && (tagStack.pop(), current = current.parentNode); continue; } var node, ts = parseTimeStamp(t.substr(1, t.length - 2)); if (ts) { node = window.document.createProcessingInstruction("timestamp", ts), current.appendChild(node); continue; } var m = t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/); if (!m) continue; if (!(node = createElement(m[1], m[3]))) continue; if (!shouldAdd(current, node)) continue; m[2] && (node.className = m[2].substr(1).replace(".", " ")), tagStack.push(m[1]), current.appendChild(node), current = node; } return rootDiv; } var strongRTLRanges = [ [ 1470, 1470 ], [ 1472, 1472 ], [ 1475, 1475 ], [ 1478, 1478 ], [ 1488, 1514 ], [ 1520, 1524 ], [ 1544, 1544 ], [ 1547, 1547 ], [ 1549, 1549 ], [ 1563, 1563 ], [ 1566, 1610 ], [ 1645, 1647 ], [ 1649, 1749 ], [ 1765, 1766 ], [ 1774, 1775 ], [ 1786, 1805 ], [ 1807, 1808 ], [ 1810, 1839 ], [ 1869, 1957 ], [ 1969, 1969 ], [ 1984, 2026 ], [ 2036, 2037 ], [ 2042, 2042 ], [ 2048, 2069 ], [ 2074, 2074 ], [ 2084, 2084 ], [ 2088, 2088 ], [ 2096, 2110 ], [ 2112, 2136 ], [ 2142, 2142 ], [ 2208, 2208 ], [ 2210, 2220 ], [ 8207, 8207 ], [ 64285, 64285 ], [ 64287, 64296 ], [ 64298, 64310 ], [ 64312, 64316 ], [ 64318, 64318 ], [ 64320, 64321 ], [ 64323, 64324 ], [ 64326, 64449 ], [ 64467, 64829 ], [ 64848, 64911 ], [ 64914, 64967 ], [ 65008, 65020 ], [ 65136, 65140 ], [ 65142, 65276 ], [ 67584, 67589 ], [ 67592, 67592 ], [ 67594, 67637 ], [ 67639, 67640 ], [ 67644, 67644 ], [ 67647, 67669 ], [ 67671, 67679 ], [ 67840, 67867 ], [ 67872, 67897 ], [ 67903, 67903 ], [ 67968, 68023 ], [ 68030, 68031 ], [ 68096, 68096 ], [ 68112, 68115 ], [ 68117, 68119 ], [ 68121, 68147 ], [ 68160, 68167 ], [ 68176, 68184 ], [ 68192, 68223 ], [ 68352, 68405 ], [ 68416, 68437 ], [ 68440, 68466 ], [ 68472, 68479 ], [ 68608, 68680 ], [ 126464, 126467 ], [ 126469, 126495 ], [ 126497, 126498 ], [ 126500, 126500 ], [ 126503, 126503 ], [ 126505, 126514 ], [ 126516, 126519 ], [ 126521, 126521 ], [ 126523, 126523 ], [ 126530, 126530 ], [ 126535, 126535 ], [ 126537, 126537 ], [ 126539, 126539 ], [ 126541, 126543 ], [ 126545, 126546 ], [ 126548, 126548 ], [ 126551, 126551 ], [ 126553, 126553 ], [ 126555, 126555 ], [ 126557, 126557 ], [ 126559, 126559 ], [ 126561, 126562 ], [ 126564, 126564 ], [ 126567, 126570 ], [ 126572, 126578 ], [ 126580, 126583 ], [ 126585, 126588 ], [ 126590, 126590 ], [ 126592, 126601 ], [ 126603, 126619 ], [ 126625, 126627 ], [ 126629, 126633 ], [ 126635, 126651 ], [ 1114109, 1114109 ] ]; function isStrongRTLChar(charCode) { for (var i = 0; i < strongRTLRanges.length; i++) { var currentRange = strongRTLRanges[i]; if (charCode >= currentRange[0] && charCode <= currentRange[1]) return !0; } return !1; } function StyleBox() {} function CueStyleBox(window, cue, styleOptions) { var isIE8 = "undefined" != typeof navigator && /MSIE\s8\.0/.test(navigator.userAgent), color = "rgba(255, 255, 255, 1)", backgroundColor = "rgba(0, 0, 0, 0.8)", textShadow = ""; void 0 !== WebVTTSet && (color = WebVTTSet.fontSet, backgroundColor = WebVTTSet.backgroundSet, textShadow = WebVTTSet.edgeSet), isIE8 && (color = "rgb(255, 255, 255)", backgroundColor = "rgb(0, 0, 0)"), StyleBox.call(this), this.cue = cue, this.cueDiv = parseContent(window, cue.text); var styles = { color: color, backgroundColor: backgroundColor, textShadow: textShadow, position: "relative", left: 0, right: 0, top: 0, bottom: 0, display: "inline" }; isIE8 || (styles.writingMode = "" === cue.vertical ? "horizontal-tb" : "lr" === cue.vertical ? "vertical-lr" : "vertical-rl", styles.unicodeBidi = "plaintext"), this.applyStyles(styles, this.cueDiv), this.div = window.document.createElement("div"), styles = { textAlign: "middle" === cue.align ? "center" : cue.align, font: styleOptions.font, whiteSpace: "pre-line", position: "absolute" }, isIE8 || (styles.direction = (function(cueDiv) { var nodeStack = [], text = ""; if (!cueDiv || !cueDiv.childNodes) return "ltr"; function pushNodes(nodeStack, node) { for (var i = node.childNodes.length - 1; i >= 0; i--) nodeStack.push(node.childNodes[i]); } function nextTextNode(nodeStack) { if (!nodeStack || !nodeStack.length) return null; var node = nodeStack.pop(), text = node.textContent || node.innerText; if (text) { var m = text.match(/^.*(\n|\r)/); return m ? (nodeStack.length = 0, m[0]) : text; } return "ruby" === node.tagName ? nextTextNode(nodeStack) : node.childNodes ? (pushNodes(nodeStack, node), nextTextNode(nodeStack)) : void 0; } for (pushNodes(nodeStack, cueDiv); text = nextTextNode(nodeStack); ) for (var i = 0; i < text.length; i++) if (isStrongRTLChar(text.charCodeAt(i))) return "rtl"; return "ltr"; })(this.cueDiv), styles.writingMode = "" === cue.vertical ? "horizontal-tb" : "lr" === cue.vertical ? "vertical-lr" : "vertical-rl".stylesunicodeBidi = "plaintext"), this.applyStyles(styles), this.div.appendChild(this.cueDiv); var textPos = 0; switch (cue.positionAlign) { case "start": textPos = cue.position; break; case "middle": textPos = cue.position - cue.size / 2; break; case "end": textPos = cue.position - cue.size; } "" === cue.vertical ? this.applyStyles({ left: this.formatStyle(textPos, "%"), width: this.formatStyle(cue.size, "%") }) : this.applyStyles({ top: this.formatStyle(textPos, "%"), height: this.formatStyle(cue.size, "%") }), this.move = function(box) { this.applyStyles({ top: this.formatStyle(box.top, "px"), bottom: this.formatStyle(box.bottom, "px"), left: this.formatStyle(box.left, "px"), right: this.formatStyle(box.right, "px"), height: this.formatStyle(box.height, "px"), width: this.formatStyle(box.width, "px") }); }; } function BoxPosition(obj) { var lh, height, width, top, isIE8 = "undefined" != typeof navigator && /MSIE\s8\.0/.test(navigator.userAgent); if (obj.div) { height = obj.div.offsetHeight, width = obj.div.offsetWidth, top = obj.div.offsetTop; var rects = (rects = obj.div.childNodes) && (rects = rects[0]) && rects.getClientRects && rects.getClientRects(); obj = obj.div.getBoundingClientRect(), lh = rects ? Math.max(rects[0] && rects[0].height || 0, obj.height / rects.length) : 0; } this.left = obj.left, this.right = obj.right, this.top = obj.top || top, this.height = obj.height || height, this.bottom = obj.bottom || top + (obj.height || height), this.width = obj.width || width, this.lineHeight = void 0 !== lh ? lh : obj.lineHeight, isIE8 && !this.lineHeight && (this.lineHeight = 13); } function moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) { var boxPosition = new BoxPosition(styleBox), cue = styleBox.cue, linePos = (function(cue) { if ("number" == typeof cue.line && (cue.snapToLines || cue.line >= 0 && cue.line <= 100)) return cue.line; if (!cue.track || !cue.track.textTrackList || !cue.track.textTrackList.mediaElement) return -1; for (var track = cue.track, trackList = track.textTrackList, count = 0, i = 0; i < trackList.length && trackList[i] !== track; i++) "showing" === trackList[i].mode && count++; return -1 * ++count; })(cue), axis = []; if (cue.snapToLines) { var size; switch (cue.vertical) { case "": axis = [ "+y", "-y" ], size = "height"; break; case "rl": axis = [ "+x", "-x" ], size = "width"; break; case "lr": axis = [ "-x", "+x" ], size = "width"; } var step = boxPosition.lineHeight, position = step * Math.round(linePos), maxPosition = containerBox[size] + step, initialAxis = axis[0]; Math.abs(position) > maxPosition && (position = position < 0 ? -1 : 1, position *= Math.ceil(maxPosition / step) * step), linePos < 0 && (position += "" === cue.vertical ? containerBox.height : containerBox.width, axis = axis.reverse()), boxPosition.move(initialAxis, position); } else { var calculatedPercentage = boxPosition.lineHeight / containerBox.height * 100; switch (cue.lineAlign) { case "middle": linePos -= calculatedPercentage / 2; break; case "end": linePos -= calculatedPercentage; } switch (cue.vertical) { case "": styleBox.applyStyles({ top: styleBox.formatStyle(linePos, "%") }); break; case "rl": styleBox.applyStyles({ left: styleBox.formatStyle(linePos, "%") }); break; case "lr": styleBox.applyStyles({ right: styleBox.formatStyle(linePos, "%") }); } axis = [ "+y", "-x", "+x", "-y" ], boxPosition = new BoxPosition(styleBox); } var bestPosition = (function(b, axis) { for (var bestPosition, specifiedPosition = new BoxPosition(b), percentage = 1, i = 0; i < axis.length; i++) { for (;b.overlapsOppositeAxis(containerBox, axis[i]) || b.within(containerBox) && b.overlapsAny(boxPositions); ) b.move(axis[i]); if (b.within(containerBox)) return b; var p = b.intersectPercentage(containerBox); percentage > p && (bestPosition = new BoxPosition(b), percentage = p), b = new BoxPosition(specifiedPosition); } return bestPosition || specifiedPosition; })(boxPosition, axis); styleBox.move(bestPosition.toCSSCompatValues(containerBox)); } function WebVTT() {} StyleBox.prototype.applyStyles = function(styles, div) { for (var prop in div = div || this.div, styles) styles.hasOwnProperty(prop) && (div.style[prop] = styles[prop]); }, StyleBox.prototype.formatStyle = function(val, unit) { return 0 === val ? 0 : val + unit; }, CueStyleBox.prototype = _objCreate(StyleBox.prototype), CueStyleBox.prototype.constructor = CueStyleBox, BoxPosition.prototype.move = function(axis, toMove) { switch (toMove = void 0 !== toMove ? toMove : this.lineHeight, axis) { case "+x": this.left += toMove, this.right += toMove; break; case "-x": this.left -= toMove, this.right -= toMove; break; case "+y": this.top += toMove, this.bottom += toMove; break; case "-y": this.top -= toMove, this.bottom -= toMove; } }, BoxPosition.prototype.overlaps = function(b2) { return this.left < b2.right && this.right > b2.left && this.top < b2.bottom && this.bottom > b2.top; }, BoxPosition.prototype.overlapsAny = function(boxes) { for (var i = 0; i < boxes.length; i++) if (this.overlaps(boxes[i])) return !0; return !1; }, BoxPosition.prototype.within = function(container) { return this.top >= container.top && this.bottom <= container.bottom && this.left >= container.left && this.right <= container.right; }, BoxPosition.prototype.overlapsOppositeAxis = function(container, axis) { switch (axis) { case "+x": return this.left < container.left; case "-x": return this.right > container.right; case "+y": return this.top < container.top; case "-y": return this.bottom > container.bottom; } }, BoxPosition.prototype.intersectPercentage = function(b2) { return Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)) * Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)) / (this.height * this.width); }, BoxPosition.prototype.toCSSCompatValues = function(reference) { return { top: this.top - reference.top, bottom: reference.bottom - this.bottom, left: this.left - reference.left, right: reference.right - this.right, height: this.height, width: this.width }; }, BoxPosition.getSimpleBoxPosition = function(obj) { var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0, width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0, top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0; return { left: (obj = obj.div ? obj.div.getBoundingClientRect() : obj.tagName ? obj.getBoundingClientRect() : obj).left, right: obj.right, top: obj.top || top, height: obj.height || height, bottom: obj.bottom || top + (obj.height || height), width: obj.width || width }; }, WebVTT.StringDecoder = function() { return { decode: function(data) { if (!data) return ""; if ("string" != typeof data) throw new Error("Error - expected string data."); return decodeURIComponent(encodeURIComponent(data)); } }; }, WebVTT.convertCueToDOMTree = function(window, cuetext) { return window && cuetext ? parseContent(window, cuetext) : null; }, WebVTT.processCues = function(window, cues, overlay) { if (!window || !cues || !overlay) return null; for (;overlay.firstChild; ) overlay.removeChild(overlay.firstChild); var paddedOverlay = window.document.createElement("div"); if (paddedOverlay.style.position = "absolute", paddedOverlay.style.left = "0", paddedOverlay.style.right = "0", paddedOverlay.style.top = "0", paddedOverlay.style.bottom = "0", paddedOverlay.style.margin = "1.5%", overlay.appendChild(paddedOverlay), (function(cues) { for (var i = 0; i < cues.length; i++) if (cues[i].hasBeenReset || !cues[i].displayState) return !0; return !1; })(cues)) { var boxPositions = [], containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay), styleOptions = { font: Math.round(.05 * containerBox.height * 100) / 100 * fontScale + "px sans-serif" }; !(function() { for (var styleBox, cue, i = 0; i < cues.length; i++) cue = cues[i], styleBox = new CueStyleBox(window, cue, styleOptions), paddedOverlay.appendChild(styleBox.div), moveBoxToLinePosition(0, styleBox, containerBox, boxPositions), cue.displayState = styleBox.div, boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox)); })(); } else for (var i = 0; i < cues.length; i++) paddedOverlay.appendChild(cues[i].displayState); }, WebVTT.Parser = function(window, decoder) { this.window = window, this.state = "INITIAL", this.buffer = "", this.decoder = decoder || new TextDecoder("utf8"), this.regionList = []; }, WebVTT.Parser.prototype = { reportOrThrowError: function(e) { if (!(e instanceof ParsingError)) throw e; this.onparsingerror && this.onparsingerror(e); }, parse: function(data) { var self = this; function collectNextLine() { for (var buffer = self.buffer, pos = 0; pos < buffer.length && "\r" !== buffer[pos] && "\n" !== buffer[pos]; ) ++pos; var line = buffer.substr(0, pos); return "\r" === buffer[pos] && ++pos, "\n" === buffer[pos] && ++pos, self.buffer = buffer.substr(pos), line; } data && (self.buffer += self.decoder.decode(data, { stream: !0 })); try { var line; if ("INITIAL" === self.state) { if (!/\r\n|\n/.test(self.buffer)) return this; var m = (line = collectNextLine()).match(/^WEBVTT([ \t].*)?$/); if (!m || !m[0]) throw new ParsingError(ParsingError.Errors.BadSignature); self.state = "HEADER"; } for (var alreadyCollectedLine = !1; self.buffer; ) { if (!/\r\n|\n/.test(self.buffer)) return this; switch (alreadyCollectedLine ? alreadyCollectedLine = !1 : line = collectNextLine(), self.state) { case "HEADER": /:/.test(line) ? parseOptions(line, (function(k, v) { "Region" === k && (function(input) { var settings = new Settings; if (parseOptions(input, (function(k, v) { switch (k) { case "id": settings.set(k, v); break; case "width": settings.percent(k, v); break; case "lines": settings.integer(k, v); break; case "regionanchor": case "viewportanchor": var xy = v.split(","); if (2 !== xy.length) break; var anchor = new Settings; if (anchor.percent("x", xy[0]), anchor.percent("y", xy[1]), !anchor.has("x") || !anchor.has("y")) break; settings.set(k + "X", anchor.get("x")), settings.set(k + "Y", anchor.get("y")); break; case "scroll": settings.alt(k, v, [ "up" ]); } }), /=/, /\s/), settings.has("id")) { var region = new self.window.VTTRegion; region.width = settings.get("width", 100), region.lines = settings.get("lines", 3), region.regionAnchorX = settings.get("regionanchorX", 0), region.regionAnchorY = settings.get("regionanchorY", 100), region.viewportAnchorX = settings.get("viewportanchorX", 0), region.viewportAnchorY = settings.get("viewportanchorY", 100), region.scroll = settings.get("scroll", ""), self.onregion && self.onregion(region), self.regionList.push({ id: settings.get("id"), region: region }); } })(v); }), /:/) : line || (self.state = "ID"); continue; case "NOTE": line || (self.state = "ID"); continue; case "ID": if (/^NOTE($|[ \t])/.test(line)) { self.state = "NOTE"; break; } if (!line) continue; if (self.cue = new self.window.VTTCue(0, 0, ""), self.state = "CUE", -1 === line.indexOf("--\x3e")) { self.cue.id = line; continue; } case "CUE": try { parseCue(line, self.cue, self.regionList); } catch (e) { self.reportOrThrowError(e), self.cue = null, self.state = "BADCUE"; continue; } self.state = "CUETEXT"; continue; case "CUETEXT": var hasSubstring = -1 !== line.indexOf("--\x3e"); if (!line || hasSubstring && (alreadyCollectedLine = !0)) { self.oncue && self.oncue(self.cue), self.cue = null, self.state = "ID"; continue; } self.cue.text && (self.cue.text += "\n"), self.cue.text += line; continue; case "BADCUE": line || (self.state = "ID"); continue; } } } catch (e) { self.reportOrThrowError(e), "CUETEXT" === self.state && self.cue && self.oncue && self.oncue(self.cue), self.cue = null, self.state = "INITIAL" === self.state ? "BADWEBVTT" : "BADCUE"; } return this; }, flush: function() { try { if (this.buffer += this.decoder.decode(), (this.cue || "HEADER" === this.state) && (this.buffer += "\n\n", this.parse()), "INITIAL" === this.state) throw new ParsingError(ParsingError.Errors.BadSignature); } catch (e) { this.reportOrThrowError(e); } return this.onflush && this.onflush(), this; } }, global.WebVTT = WebVTT; })(this); }, function(module, exports, __webpack_require__) { var root; module.exports && (this.VTTCue = this.VTTCue || __webpack_require__(931).VTTCue), (root = this).VTTCue.prototype.toJSON = function() { var cue = {}, self = this; return Object.keys(this).forEach((function(key) { "getCueAsHTML" !== key && "hasBeenReset" !== key && "displayState" !== key && (cue[key] = self[key]); })), cue; }, root.VTTCue.create = function(options) { if (!options.hasOwnProperty("startTime") || !options.hasOwnProperty("endTime") || !options.hasOwnProperty("text")) throw new Error("You must at least have start time, end time, and text."); var cue = new root.VTTCue(options.startTime, options.endTime, options.text); for (var key in options) cue.hasOwnProperty(key) && (cue[key] = options[key]); return cue; }, root.VTTCue.fromJSON = function(json) { return this.create(JSON.parse(json)); }; }, function(module, exports) { !(function(root) { var directionSetting = { "": !0, lr: !0, rl: !0 }, alignSetting = { start: !0, middle: !0, end: !0, left: !0, right: !0 }; function findAlignSetting(value) { return "string" == typeof value && !!alignSetting[value.toLowerCase()] && value.toLowerCase(); } function extend(obj) { for (var i = 1; i < arguments.length; i++) { var cobj = arguments[i]; for (var p in cobj) obj[p] = cobj[p]; } return obj; } function VTTCue(startTime, endTime, text) { var cue = this, isIE8 = /MSIE\s8\.0/.test(navigator.userAgent), baseObj = {}; isIE8 ? cue = document.createElement("custom") : baseObj.enumerable = !0, cue.hasBeenReset = !1; var _id = "", _pauseOnExit = !1, _startTime = startTime, _endTime = endTime, _text = text, _region = null, _vertical = "", _snapToLines = !0, _line = "auto", _lineAlign = "start", _position = 50, _positionAlign = "middle", _size = 50, _align = "middle"; if (Object.defineProperty(cue, "id", extend({}, baseObj, { get: function() { return _id; }, set: function(value) { _id = "" + value; } })), Object.defineProperty(cue, "pauseOnExit", extend({}, baseObj, { get: function() { return _pauseOnExit; }, set: function(value) { _pauseOnExit = !!value; } })), Object.defineProperty(cue, "startTime", extend({}, baseObj, { get: function() { return _startTime; }, set: function(value) { if ("number" != typeof value) throw new TypeError("Start time must be set to a number."); _startTime = value, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "endTime", extend({}, baseObj, { get: function() { return _endTime; }, set: function(value) { if ("number" != typeof value) throw new TypeError("End time must be set to a number."); _endTime = value, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "text", extend({}, baseObj, { get: function() { return _text; }, set: function(value) { _text = "" + value, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "region", extend({}, baseObj, { get: function() { return _region; }, set: function(value) { _region = value, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "vertical", extend({}, baseObj, { get: function() { return _vertical; }, set: function(value) { var setting = (function(value) { return "string" == typeof value && !!directionSetting[value.toLowerCase()] && value.toLowerCase(); })(value); if (!1 === setting) throw new SyntaxError("An invalid or illegal string was specified."); _vertical = setting, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "snapToLines", extend({}, baseObj, { get: function() { return _snapToLines; }, set: function(value) { _snapToLines = !!value, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "line", extend({}, baseObj, { get: function() { return _line; }, set: function(value) { if ("number" != typeof value && "auto" !== value) throw new SyntaxError("An invalid number or illegal string was specified."); _line = value, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "lineAlign", extend({}, baseObj, { get: function() { return _lineAlign; }, set: function(value) { var setting = findAlignSetting(value); if (!setting) throw new SyntaxError("An invalid or illegal string was specified."); _lineAlign = setting, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "position", extend({}, baseObj, { get: function() { return _position; }, set: function(value) { if (value < 0 || value > 100) throw new Error("Position must be between 0 and 100."); _position = value, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "positionAlign", extend({}, baseObj, { get: function() { return _positionAlign; }, set: function(value) { var setting = findAlignSetting(value); if (!setting) throw new SyntaxError("An invalid or illegal string was specified."); _positionAlign = setting, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "size", extend({}, baseObj, { get: function() { return _size; }, set: function(value) { if (value < 0 || value > 100) throw new Error("Size must be between 0 and 100."); _size = value, this.hasBeenReset = !0; } })), Object.defineProperty(cue, "align", extend({}, baseObj, { get: function() { return _align; }, set: function(value) { var setting = findAlignSetting(value); if (!setting) throw new SyntaxError("An invalid or illegal string was specified."); _align = setting, this.hasBeenReset = !0; } })), cue.displayState = void 0, isIE8) return cue; } VTTCue.prototype.getCueAsHTML = function() { return WebVTT.convertCueToDOMTree(window, this.text); }, root.VTTCue = root.VTTCue || VTTCue; })(this); }, function(module, exports, __webpack_require__) { var root; module.exports && (this.VTTRegion = __webpack_require__(933).VTTRegion), (root = this).VTTRegion.create = function(options) { var region = new root.VTTRegion; for (var key in options) region.hasOwnProperty(key) && (region[key] = options[key]); return region; }, root.VTTRegion.fromJSON = function(json) { return this.create(JSON.parse(json)); }; }, function(module, exports) { !(function(root) { var scrollSetting = { "": !0, up: !0 }; function isValidPercentValue(value) { return "number" == typeof value && value >= 0 && value <= 100; } root.VTTRegion = root.VTTRegion || function() { var _width = 100, _lines = 3, _regionAnchorX = 0, _regionAnchorY = 100, _viewportAnchorX = 0, _viewportAnchorY = 100, _scroll = ""; Object.defineProperties(this, { width: { enumerable: !0, get: function() { return _width; }, set: function(value) { if (!isValidPercentValue(value)) throw new Error("Width must be between 0 and 100."); _width = value; } }, lines: { enumerable: !0, get: function() { return _lines; }, set: function(value) { if ("number" != typeof value) throw new TypeError("Lines must be set to a number."); _lines = value; } }, regionAnchorY: { enumerable: !0, get: function() { return _regionAnchorY; }, set: function(value) { if (!isValidPercentValue(value)) throw new Error("RegionAnchorX must be between 0 and 100."); _regionAnchorY = value; } }, regionAnchorX: { enumerable: !0, get: function() { return _regionAnchorX; }, set: function(value) { if (!isValidPercentValue(value)) throw new Error("RegionAnchorY must be between 0 and 100."); _regionAnchorX = value; } }, viewportAnchorY: { enumerable: !0, get: function() { return _viewportAnchorY; }, set: function(value) { if (!isValidPercentValue(value)) throw new Error("ViewportAnchorY must be between 0 and 100."); _viewportAnchorY = value; } }, viewportAnchorX: { enumerable: !0, get: function() { return _viewportAnchorX; }, set: function(value) { if (!isValidPercentValue(value)) throw new Error("ViewportAnchorX must be between 0 and 100."); _viewportAnchorX = value; } }, scroll: { enumerable: !0, get: function() { return _scroll; }, set: function(value) { var setting = (function(value) { return "string" == typeof value && !!scrollSetting[value.toLowerCase()] && value.toLowerCase(); })(value); if (!1 === setting) throw new SyntaxError("An invalid or illegal string was specified."); _scroll = setting; } } }); }; })(this); }, function(module, exports, __webpack_require__) { const {ffmpeg: ffmpeg} = __webpack_require__(433), bitrate = __webpack_require__(935), os = __webpack_require__(23), userSettings = __webpack_require__(105), applyProfile = __webpack_require__(411).applyProfile; module.exports = function(options = {}) { !options.profile && userSettings.transcodeHardwareAccel && userSettings.transcodeProfile && (options.profile = userSettings.transcodeProfile); const cpuCores = (os.cpus() || []).length, audioChannels = options.audio ? options.audio.override && "number" == typeof options.audio.override.channels ? options.audio.override.channels : options.audio.channels || 2 : 2, videoBitRate = !!(options.video || {}).transcode && bitrate.video(options.video, options.video.codec, "libx264", userSettings.transcodeMaxBitRate), audioBitRate = !!(options.audio || {}).transcode && bitrate.audio(options.audio, "aac", audioChannels), encodeThreads = cpuCores ? cpuCores * userSettings.transcodeHorsepower : 0; let accelConfig = { inputArgs: [], maxWidth: options.maxWidth || userSettings.transcodeMaxWidth, videoBitRate: videoBitRate, audioBitRate: audioBitRate, encoderH264: "libx264", levelH264: "51", encoderAAC: "aac", videoPreset: "ultrafast", pixelFormat: "yuv420p", videoTune: "zerolatency", resizeHeightAuto: "-2", scaleExtra: ":flags=lanczos", scalePrefix: "", wrapSwFilters: !1, scale: !1, noH264Level: !1, extraVideoOutputArgs: [], hwFilters: [], encodeThreads: isNaN(encodeThreads) ? 0 : encodeThreads, colorSpace: "bt709" }; accelConfig = applyProfile(options.profile, accelConfig, options); const filters = () => (() => { const filters = [ options.video.override ? "string" == typeof options.video.override.embeddedSubtitlesId ? `subtitles='${options.mediaURL.replace(/\:/g, "\\:")}':stream_index=${options.video.override.embeddedSubtitlesId}` : "string" == typeof options.video.override.externalSubtitlesUrl ? `subtitles='${options.video.override.externalSubtitlesUrl.replace(/\:/g, "\\:")}'` : null : null, options.blank ? "tpad=stop=-1" : null ].concat(accelConfig.extraSwFilters || []).filter((v => null !== v)); return accelConfig.scale || (options.video.width > accelConfig.maxWidth && filters.push(`${accelConfig.scalePrefix}scale=${accelConfig.maxWidth}:${accelConfig.resizeHeightAuto}${accelConfig.scaleExtra}`), filters.push(`format=${accelConfig.pixelFormat}`)), filters.length && accelConfig.wrapSwFilters && (accelConfig.wrapSwFilters[0] && filters.unshift(accelConfig.wrapSwFilters[0]), accelConfig.wrapSwFilters[1] && filters.push(accelConfig.wrapSwFilters[1])), filters; })().concat((() => { if (!(options.video || {}).transcode) return []; const filters = [ accelConfig.scale ? options.video.width > accelConfig.maxWidth ? `${accelConfig.scalePrefix}${accelConfig.scale}=${accelConfig.maxWidth}:${accelConfig.resizeHeightAuto}${accelConfig.scaleExtra}:format=${accelConfig.pixelFormat}` : accelConfig.pixelFormat ? `${accelConfig.scale || "scale"}=format=${accelConfig.pixelFormat}` : null : null ].concat(accelConfig.hwFilters || []); return filters.unshift(`setparams=color_primaries=${accelConfig.colorSpace}:color_trc=${accelConfig.colorSpace}:colorspace=${accelConfig.colorSpace}`), filters.filter((v => null !== v)); })()); return options.args = [ ...(options.video || {}).transcode && accelConfig.inputArgs ? accelConfig.inputArgs : [], "-fflags", "+genpts", "-noaccurate_seek", "-seek_timestamp", "1", "-copyts", ...options.format && options.format.name.includes("matroska") ? [ "-seek2any", "1" ] : [], ..."number" == typeof options.time ? [ "-ss", options.time ] : [], "-i", options.mediaURL, "-threads", accelConfig.encodeThreads + "", ..."number" == typeof options.time && (options.audio || options.video && options.video.transcode) ? [ "-ss", options.time, "-output_ts_offset", options.time ] : [], "-max_muxing_queue_size", "2048", "-ignore_unknown", "-map_metadata", "-1", "-map_chapters", "-1", "-map", "-0:d?", "-map", "-0:t?", ...options.video ? [ "-map", `v:${options.video.id}`, ...options.video.transcode ? [ ...filters().length ? [ "-vf", filters().join(",") ] : [], "-c:v", accelConfig.encoderH264, "-preset:v", accelConfig.videoPreset, "-profile:v", "high", "-tune:v", accelConfig.videoTune, ...accelConfig.noH264Level ? [] : [ "-level", accelConfig.levelH264 ], ...options.video.override && "number" == typeof options.video.override.frameRate ? [ "-vsync", "cfr", "-r:v", options.video.override.frameRate, ..."number" == typeof options.segmentDuration ? [ "-sc_threshold", "0", "-g", options.video.override.frameRate * options.segmentDuration, "-keyint_min", options.video.override.frameRate * options.segmentDuration ] : [] ] : [], ...accelConfig.extraVideoOutputArgs ? accelConfig.extraVideoOutputArgs.map((v => "{bitrate}" === v ? accelConfig.videoBitRate + "" : "{bufsize}" === v ? 2 * accelConfig.videoBitRate + "" : v)) : [] ] : [ "-c:v", "copy", "-force_key_frames:v", "source" ] ] : [ "-map", "-0:v?" ], ...options.audio ? [ "-map", `a:${options.audio.id}`, ...options.audio.transcode ? [ "-c:a", accelConfig.encoderAAC, "-filter:a", "apad", "-async", 1, ...options.audio.override && "number" == typeof options.audio.override.channels ? [ "-ac:a", options.audio.override.channels, "-ab", `${accelConfig.audioBitRate}` ] : [], ...options.audio.override && "number" == typeof options.audio.override.sampleRate ? [ "-ar:a", options.audio.override.sampleRate ] : [] ] : [ "-c:a", "copy", ..."aac" === options.audio.codec ? [ "-bsf:a", "aac_adtstoasc" ] : [] ] ] : [ "-map", "-0:a?" ], ...options.subtitle ? [ "-map", `s:${options.subtitle.id}` ] : [ "-map", "-0:s?" ], ..."number" == typeof options.segmentDuration && (options.audio || options.video && options.video.transcode) ? [ "-frag_duration", Math.floor(1e3 * options.segmentDuration * 1e3) ] : [], ..."number" == typeof options.sequenceNumber && (options.video || options.audio) ? [ "-fragment_index", options.sequenceNumber ] : [], ...options.video ? [ "-movflags", "frag_keyframe+empty_moov+default_base_moof+delay_moov+dash" ] : options.audio ? [ "-movflags", "empty_moov+default_base_moof+delay_moov+dash" ] : [], ...options.video || options.audio ? [ "-use_editlist", "1", "-f", "mp4" ] : options.subtitle ? [ "-f", "webvtt" ] : [] ], new ffmpeg(options); }; }, function(module, exports) { const getVideoBitrateScaleFactor = codec => "h265" === codec || "hevc" === codec || "vp9" === codec || "av1" === codec ? .6 : 1; module.exports = { video: (stream, inputVideoCodec, outputVideoCodec, maxBitRate) => { var bitrate = (stream => { if (!isNaN(stream.streamBitRate) && stream.streamBitRate) return stream.streamBitRate; let bps = 3145728; if (!isNaN(stream.bps) && stream.bps) bps = stream.bps; else if (stream.formatDuration && stream.numberOfBytes) { const mathBps = Math.floor(8 * Number(stream.numberOfBytes) / Number(stream.formatDuration)); mathBps && !isNaN(mathBps) && (bps = mathBps); } else stream.formatBitRate && (bps = Math.floor(.8 * stream.formatBitRate)); return Math.floor(bps || 0); })(stream); return bitrate && (bitrate = ((bitrate, inputVideoCodec, outputVideoCodec) => { const inputScaleFactor = getVideoBitrateScaleFactor(inputVideoCodec); let scaleFactor = getVideoBitrateScaleFactor(outputVideoCodec) / inputScaleFactor; return bitrate <= 5e5 ? scaleFactor = Math.max(scaleFactor, 4) : bitrate <= 1e6 ? scaleFactor = Math.max(scaleFactor, 3) : bitrate <= 2e6 ? scaleFactor = Math.max(scaleFactor, 2.5) : bitrate <= 3e6 && (scaleFactor = Math.max(scaleFactor, 2)), scaleFactor * bitrate; })(bitrate, inputVideoCodec, outputVideoCodec), maxBitRate && (bitrate = Math.min(bitrate, maxBitRate))), Math.min(bitrate || 0, 1073741823.5); }, audio: (stream, audioCodec, audioChannels) => { let bitrate = (stream => { if (!isNaN(stream.streamBitRate) && stream.streamBitRate) return stream.streamBitRate; let bps = 0; if (!isNaN(stream.bps) && stream.bps) bps = stream.bps; else if (stream.formatDuration && stream.numberOfBytes) { const mathBps = Math.floor(8 * Number(stream.numberOfBytes) / Number(stream.formatDuration)); mathBps && !isNaN(mathBps) && (bps = mathBps); } return Math.floor(bps || 0); })(stream); return "aac" !== audioCodec || bitrate || (bitrate = 64e3 * audioChannels), bitrate ? ((audioBitRate, audioCodec, audioChannels) => { if (audioBitRate && !audioCodec) return Math.min(384e3, audioBitRate); if (audioBitRate && audioCodec) { if ("aac" === audioCodec || "mp3" === audioCodec || "opus" === audioCodec || "vorbis" === audioCodec || "ac3" === audioCodec || "eac3" === audioCodec) return (audioChannels || 0) >= 6 ? Math.min(64e4, audioBitRate) : Math.min(384e3, audioBitRate); if ("flac" === audioCodec || "alac" === audioCodec) return (audioChannels || 0) >= 6 ? Math.min(3584e3, audioBitRate) : Math.min(1536e3, audioBitRate); } return 128e3; })(bitrate, audioCodec, audioChannels) : 0; } }; }, function(module, exports) { module.exports = { "aac-6chan": { container: "wav", mime: "audio/x-wav", data: "UklGRuAAAABXQVZFZm10IC4AAAD+/wYARKwAAIGmAAAAEhAAGwAQAD8AAAD/AAAAAAAQAIAAAKoAOJtxEjBW5QAAZmFjdAQAAAAAFAAATElTVBoAAABJTkZPSVNGVA4AAABMYXZmNTkuMTYuMTAwAGRhdGFwAAAA3gIATGF2YzU5LjE4LjEwMAACMEACEQBGCMBGIAjBGBhGAAHAARggAQiAIwRgIxAEYIwMIwAA4AEYIAEIgCMEYCMQBGCMDCMAAOABGCABCIAjBGAjEARgjAwjAADgARggAQiAIwRgIxAEYIwMIwAA4A==" }, "ac3-2chan": { container: "wav", mime: "audio/x-wav", data: "UklGRqYQAABXQVZFZm10IBIAAAAAIAIARKwAAMBdAAAADxAAAABmYWN0BAAAAAAeAABMSVNUGgAAAElORk9JU0ZUDgAAAExhdmY1OS4xNi4xMDAAZGF0YVIQAAALd6F6VEBD4Qb1dfCAghAQQVx8+fPnz58+fPnz58+fPnz58+fPnz58+fPv+dXz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz4/51fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPjL/EECBIAAAAAA8bbbbbbbbx48eO7u7u7gAAAAAAAAAO7u7u7u7vHjxttt8+a1rWta1rWta1rWta1rWta0AAAABtttttttvHjx47u7u7uAAAAAAAAAA7u7u7u7u8ePG223z5rWta1rWta1rWta1rWta1rTAAAAAAAB422222223jx48d3d3d3AAAAAAAAAAd3d3d3d3ePHjbbb581rWta1rWta1rWta1rWta1oAAAADbbbbbbbePHjx3d3d3cAAAAAAAAAB3d3d3d3d48eNttvnzWta1rWta1rWta1rWta1rWmAAAAAAADxtttttttvHjx47u7u7uAAAAAAAAAA7u7u7u7u8ePG223z5rWta1rWta1rWta1rWta1rQAAAAG22222228ePHju7u7u4AAAAAAAAADu7u7u7u7x48bbbfPmta1rWta1rWta1rWta1rWtMAAAAAAAHjbbbbbbbePHjx3d3d3cAAAAAAAAAB3d3d3d3d48eNttvnzWta1rWta1rWta1rWta1rWgAAAANttttttt48ePHd3d3dwAAAAAAAAAHd3d3d3d3jx4222+fNa1rWta1rWta1rWta1rWtaYAAAAAAAPG22222228ePHju7u7u4AAAAAAAAADu7u7u7u7x48bbbfPmta1rWta1rWta1rWta1rWtAAAAAbbbbbbbbx48eO7u7u7gAAAAAAAAAO7u7u7u7vHjxttt8+a1rWta1rWta1rWta1rWta0wAAAAAAAeNttttttt48ePHd3d3dwAAAAAAAAAHd3d3d3d3jx4222+fNa1rWta1rWta1rWta1rWtaAAAAA22222223jx48d3d3d3AAAAAAAAAAd3d3d3d3ePHjbbb581rWta1rWta1rWta1rWta1oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3sgLdydwVUBD4Qb1dfCAghAQQVx8+fPnz58+fPnz58+fPnz58+fPnz58+fPv+dXz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz4/51fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPjL/EkSJIAAAAAA8bbbbbbePHjx3d3d3AAAAAAAAAAAAAAAAADu7u7x48bbbbbbfPmta1rWta1rWta1rWta1rQAAAAHjbbbbbbx48eO7u7u4AAAAAAAAAAAAAAAAAd3d3ePHjbbbbbb581rWta1rWta1rWta1rWtaYAAAAAAAPG222223jx48d3d3dwAAAAAAAAAAAAAAAAA7u7u8ePG222223z5rWta1rWta1rWta1rWta0AAAAB42222228ePHju7u7uAAAAAAAAAAAAAAAAAHd3d3jx4222222+fNa1rWta1rWta1rWta1rWmAAAAAAADxtttttt48ePHd3d3cAAAAAAAAAAAAAAAAAO7u7vHjxtttttt8+a1rWta1rWta1rWta1rWtAAAAAeNtttttvHjx47u7u7gAAAAAAAAAAAAAAAAB3d3d48eNtttttvnzWta1rWta1rWta1rWta1pgAAAAAAA8bbbbbbePHjx3d3d3AAAAAAAAAAAAAAAAADu7u7x48bbbbbbfPmta1rWta1rWta1rWta1rQAAAAHjbbbbbbx48eO7u7u4AAAAAAAAAAAAAAAAAd3d3ePHjbbbbbb581rWta1rWta1rWta1rWtaYAAAAAAAPG222223jx48d3d3dwAAAAAAAAAAAAAAAAA7u7u8ePG222223z5rWta1rWta1rWta1rWta0AAAAB42222228ePHju7u7uAAAAAAAAAAAAAAAAAHd3d3jx4222222+fNa1rWta1rWta1rWta1rWmAAAAAAADxtttttt48ePHd3d3cAAAAAAAAAAAAAAAAAO7u7vHjxtttttt8+a1rWta1rWta1rWta1rWtAAAAAeNtttttvHjx47u7u7gAAAAAAAAAAAAAAAAB3d3d48eNtttttvnzWta1rWta1rWta1rWta1oAyugt3J3BVQEPhBvV18ICCEBBBXHz58+fPnz58+fPnz58+fPnz58+fPnz58+/51fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPj/nV8+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+Mv8SRIkgAAAAADxtttttt48ePHd3d3cAAAAAAAAAAAAAAAAAO7u7vHjxtttttt8+a1rWta1rWta1rWta1rWtAAAAAeNtttttvHjx47u7u7gAAAAAAAAAAAAAAAAB3d3d48eNtttttvnzWta1rWta1rWta1rWta1pgAAAAAAA8bbbbbbePHjx3d3d3AAAAAAAAAAAAAAAAADu7u7x48bbbbbbfPmta1rWta1rWta1rWta1rQAAAAHjbbbbbbx48eO7u7u4AAAAAAAAAAAAAAAAAd3d3ePHjbbbbbb581rWta1rWta1rWta1rWtaYAAAAAAAPG222223jx48d3d3dwAAAAAAAAAAAAAAAAA7u7u8ePG222223z5rWta1rWta1rWta1rWta0AAAAB42222228ePHju7u7uAAAAAAAAAAAAAAAAAHd3d3jx4222222+fNa1rWta1rWta1rWta1rWmAAAAAAADxtttttt48ePHd3d3cAAAAAAAAAAAAAAAAAO7u7vHjxtttttt8+a1rWta1rWta1rWta1rWtAAAAAeNtttttvHjx47u7u7gAAAAAAAAAAAAAAAAB3d3d48eNtttttvnzWta1rWta1rWta1rWta1pgAAAAAAA8bbbbbbePHjx3d3d3AAAAAAAAAAAAAAAAADu7u7x48bbbbbbfPmta1rWta1rWta1rWta1rQAAAAHjbbbbbbx48eO7u7u4AAAAAAAAAAAAAAAAAd3d3ePHjbbbbbb581rWta1rWta1rWta1rWtaYAAAAAAAPG222223jx48d3d3dwAAAAAAAAAAAAAAAAA7u7u8ePG222223z5rWta1rWta1rWta1rWta0AAAAB42222228ePHju7u7uAAAAAAAAAAAAAAAAAHd3d3jx4222222+fNa1rWta1rWta1rWta1rWgDK6C3cncFVAQ+EG9XXwgIIQEEFcfPnz58+fPnz58+fPnz58+fPnz58+fPnz7/nV8+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+P+dXz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz4y/xJEiSAAAAAAPG222223jx48d3d3dwAAAAAAAAAAAAAAAAA7u7u8ePG222223z5rWta1rWta1rWta1rWta0AAAAB42222228ePHju7u7uAAAAAAAAAAAAAAAAAHd3d3jx4222222+fNa1rWta1rWta1rWta1rWmAAAAAAADxtttttt48ePHd3d3cAAAAAAAAAAAAAAAAAO7u7vHjxtttttt8+a1rWta1rWta1rWta1rWtAAAAAeNtttttvHjx47u7u7gAAAAAAAAAAAAAAAAB3d3d48eNtttttvnzWta1rWta1rWta1rWta1pgAAAAAAA8bbbbbbePHjx3d3d3AAAAAAAAAAAAAAAAADu7u7x48bbbbbbfPmta1rWta1rWta1rWta1rQAAAAHjbbbbbbx48eO7u7u4AAAAAAAAAAAAAAAAAd3d3ePHjbbbbbb581rWta1rWta1rWta1rWtaYAAAAAAAPG222223jx48d3d3dwAAAAAAAAAAAAAAAAA7u7u8ePG222223z5rWta1rWta1rWta1rWta0AAAAB42222228ePHju7u7uAAAAAAAAAAAAAAAAAHd3d3jx4222222+fNa1rWta1rWta1rWta1rWmAAAAAAADxtttttt48ePHd3d3cAAAAAAAAAAAAAAAAAO7u7vHjxtttttt8+a1rWta1rWta1rWta1rWtAAAAAeNtttttvHjx47u7u7gAAAAAAAAAAAAAAAAB3d3d48eNtttttvnzWta1rWta1rWta1rWta1pgAAAAAAA8bbbbbbePHjx3d3d3AAAAAAAAAAAAAAAAADu7u7x48bbbbbbfPmta1rWta1rWta1rWta1rQAAAAHjbbbbbbx48eO7u7u4AAAAAAAAAAAAAAAAAd3d3ePHjbbbbbb581rWta1rWta1rWta1rWtaAMroLdydwVUBD4Qb1dfCAghAQQVx8+fPnz58+fPnz58+fPnz58+fPnz58+fPv+dXz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz4/51fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPnz58+fPjL/EkSJIAAAAAA8bbbbbbePHjx3d3d3AAAAAAAAAAAAAAAAADu7u7x48bbbbbbfPmta1rWta1rWta1rWta1rQAAAAHjbbbbbbx48eO7u7u4AAAAAAAAAAAAAAAAAd3d3ePHjbbbbbb581rWta1rWta1rWta1rWtaYAAAAAAAPG222223jx48d3d3dwAAAAAAAAAAAAAAAAA7u7u8ePG222223z5rWta1rWta1rWta1rWta0AAAAB42222228ePHju7u7uAAAAAAAAAAAAAAAAAHd3d3jx4222222+fNa1rWta1rWta1rWta1rWmAAAAAAADxtttttt48ePHd3d3cAAAAAAAAAAAAAAAAAO7u7vHjxtttttt8+a1rWta1rWta1rWta1rWtAAAAAeNtttttvHjx47u7u7gAAAAAAAAAAAAAAAAB3d3d48eNtttttvnzWta1rWta1rWta1rWta1pgAAAAAAA8bbbbbbePHjx3d3d3AAAAAAAAAAAAAAAAADu7u7x48bbbbbbfPmta1rWta1rWta1rWta1rQAAAAHjbbbbbbx48eO7u7u4AAAAAAAAAAAAAAAAAd3d3ePHjbbbbbb581rWta1rWta1rWta1rWtaYAAAAAAAPG222223jx48d3d3dwAAAAAAAAAAAAAAAAA7u7u8ePG222223z5rWta1rWta1rWta1rWta0AAAAB42222228ePHju7u7uAAAAAAAAAAAAAAAAAHd3d3jx4222222+fNa1rWta1rWta1rWta1rWmAAAAAAADxtttttt48ePHd3d3cAAAAAAAAAAAAAAAAAO7u7vHjxtttttt8+a1rWta1rWta1rWta1rWtAAAAAeNtttttvHjx47u7u7gAAAAAAAAAAAAAAAAB3d3d48eNtttttvnzWta1rWta1rWta1rWta1oAyug==" }, hevc: { container: "mkv", mime: "video/x-matroska", data: "GkXfo6NChoEBQveBAULygQRC84EIQoKIbWF0cm9za2FCh4EEQoWBAhhTgGcBAAAAAAAPPxFNm3TAv4QoiMc2TbuLU6uEFUmpZlOsgaFNu4tTq4QWVK5rU6yB8U27jFOrhBJUw2dTrIIK1027jFOrhBxTu2tTrIIPI+wBAAAAAAAAUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFUmpZsu/hKWsdsYq17GDD0JATYCNTGF2ZjU5LjE2LjEwMFdBjUxhdmY1OS4xNi4xMDBzpJCbCXiosnZ5+kwi7p4jwfjnRImIQGkAAAAAAAAWVK5rSeC/hOMyVqauAQAAAAAACdHXgQFzxYhOuit5hFVH5pyBACK1nIN1bmSIgQCGkFZfTVBFR0gvSVNPL0hFVkODgQEj44OEAmJaAOABAAAAAAAAC7CCB4C6ggPAmoECY6JJgQEBYAAAAJAAAAAAAHjwAPz9+PgAAA8EIAABABhAAQwB//8BYAAAAwCQAAADAAADAHiVmAkhAAEAK0IBAQFgAAADAJAAAAMAAAMAeKADwIA8FllZpJMrwFoCAAADAAIAAAMAMhAiAAEAB0QBwXK0YkAnAAEJDE4BBf///////////wcsot4JtRdH27tVpP5/wvxOeDI2NSAoYnVpbGQgMjAzKSAtIDMuNSsyMC0xNzgzOWNjMGQ6W01hYyBPUyBYXVtjbGFuZyAxMS4wLjBdWzY0IGJpdF0gOGJpdCsxMGJpdCsxMmJpdCAtIEguMjY1L0hFVkMgY29kZWMgLSBDb3B5cmlnaHQgMjAxMy0yMDE4IChjKSBNdWx0aWNvcmV3YXJlLCBJbmMgLSBodHRwOi8veDI2NS5vcmcgLSBvcHRpb25zOiBjcHVpZD0xMTExMDM5IGZyYW1lLXRocmVhZHM9MyB3cHAgbm8tcG1vZGUgbm8tcG1lIG5vLXBzbnIgbm8tc3NpbSBsb2ctbGV2ZWw9MiBiaXRkZXB0aD04IGlucHV0LWNzcD0xIGZwcz0yNS8xIGlucHV0LXJlcz0xOTIweDk2MCBpbnRlcmxhY2U9MCB0b3RhbC1mcmFtZXM9MCBsZXZlbC1pZGM9MCBoaWdoLXRpZXI9MSB1aGQtYmQ9MCByZWY9MyBuby1hbGxvdy1ub24tY29uZm9ybWFuY2Ugbm8tcmVwZWF0LWhlYWRlcnMgYW5uZXhiIG5vLWF1ZCBuby1lb2Igbm8tZW9zIG5vLWhyZCBpbmZvIGhhc2g9MCBuby10ZW1wb3JhbC1sYXllcnMgb3Blbi1nb3AgbWluLWtleWludD0yNSBrZXlpbnQ9MjUwIGdvcC1sb29rYWhlYWQ9MCBiZnJhbWVzPTQgYi1hZGFwdD0yIGItcHlyYW1pZCBiZnJhbWUtYmlhcz0wIHJjLWxvb2thaGVhZD0yMCBsb29rYWhlYWQtc2xpY2VzPTYgc2NlbmVjdXQ9NDAgbm8taGlzdC1zY2VuZWN1dCByYWRsPTAgbm8tc3BsaWNlIG5vLWludHJhLXJlZnJlc2ggY3R1PTY0IG1pbi1jdS1zaXplPTggbm8tcmVjdCBuby1hbXAgbWF4LXR1LXNpemU9MzIgdHUtaW50ZXItZGVwdGg9MSB0dS1pbnRyYS1kZXB0aD0xIGxpbWl0LXR1PTAgcmRvcS1sZXZlbD0wIGR5bmFtaWMtcmQ9MC4wMCBuby1zc2ltLXJkIHNpZ25oaWRlIG5vLXRza2lwIG5yLWludHJhPTAgbnItaW50ZXI9MCBuby1jb25zdHJhaW5lZC1pbnRyYSBzdHJvbmctaW50cmEtc21vb3RoaW5nIG1heC1tZXJnZT0zIGxpbWl0LXJlZnM9MSBuby1saW1pdC1tb2RlcyBtZT0xIHN1Ym1lPTIgbWVyYW5nZT01NyB0ZW1wb3JhbC1tdnAgbm8tZnJhbWUtZHVwIG5vLWhtZSB3ZWlnaHRwIG5vLXdlaWdodGIgbm8tYW5hbHl6ZS1zcmMtcGljcyBkZWJsb2NrPTA6MCBzYW8gbm8tc2FvLW5vbi1kZWJsb2NrIHJkPTMgc2VsZWN0aXZlLXNhbz00IGVhcmx5LXNraXAgcnNraXAgbm8tZmFzdC1pbnRyYSBuby10c2tpcC1mYXN0IG5vLWN1LWxvc3NsZXNzIGItaW50cmEgbm8tc3BsaXRyZC1za2lwIHJkcGVuYWx0eT0wIHBzeS1yZD0yLjAwIHBzeS1yZG9xPTAuMDAgbm8tcmQtcmVmaW5lIG5vLWxvc3NsZXNzIGNicXBvZmZzPTAgY3JxcG9mZnM9MCByYz1jcmYgY3JmPTI4LjAgcWNvbXA9MC42MCBxcHN0ZXA9NCBzdGF0cy13cml0ZT0wIHN0YXRzLXJlYWQ9MCBpcHJhdGlvPTEuNDAgcGJyYXRpbz0xLjMwIGFxLW1vZGU9MiBhcS1zdHJlbmd0aD0xLjAwIGN1dHJlZSB6b25lLWNvdW50PTAgbm8tc3RyaWN0LWNiciBxZy1zaXplPTMyIG5vLXJjLWdyYWluIHFwbWF4PTY5IHFwbWluPTAgbm8tY29uc3QtdmJ2IHNhcj0xIG92ZXJzY2FuPTAgdmlkZW9mb3JtYXQ9NSByYW5nZT0wIGNvbG9ycHJpbT0yIHRyYW5zZmVyPTIgY29sb3JtYXRyaXg9MiBjaHJvbWFsb2M9MCBkaXNwbGF5LXdpbmRvdz0wIGNsbD0wLDAgbWluLWx1bWE9MCBtYXgtbHVtYT0yNTUgbG9nMi1tYXgtcG9jLWxzYj04IHZ1aS10aW1pbmctaW5mbyB2dWktaHJkLWluZm8gc2xpY2VzPTEgbm8tb3B0LXFwLXBwcyBuby1vcHQtcmVmLWxpc3QtbGVuZ3RoLXBwcyBuby1tdWx0aS1wYXNzLW9wdC1ycHMgc2NlbmVjdXQtYmlhcz0wLjA1IGhpc3QtdGhyZXNob2xkPTAuMDMgbm8tb3B0LWN1LWRlbHRhLXFwIG5vLWFxLW1vdGlvbiBuby1oZHIxMCBuby1oZHIxMC1vcHQgbm8tZGhkcjEwLW9wdCBuby1pZHItcmVjb3Zlcnktc2VpIGFuYWx5c2lzLXJldXNlLWxldmVsPTAgYW5hbHlzaXMtc2F2ZS1yZXVzZS1sZXZlbD0wIGFuYWx5c2lzLWxvYWQtcmV1c2UtbGV2ZWw9MCBzY2FsZS1mYWN0b3I9MCByZWZpbmUtaW50cmE9MCByZWZpbmUtaW50ZXI9MCByZWZpbmUtbXY9MSByZWZpbmUtY3R1LWRpc3RvcnRpb249MCBuby1saW1pdC1zYW8gY3R1LWluZm89MCBuby1sb3dwYXNzLWRjdCByZWZpbmUtYW5hbHlzaXMtdHlwZT0wIGNvcHktcGljPTEgbWF4LWF1c2l6ZS1mYWN0b3I9MS4wIG5vLWR5bmFtaWMtcmVmaW5lIG5vLXNpbmdsZS1zZWkgbm8taGV2Yy1hcSBuby1zdnQgbm8tZmllbGQgcXAtYWRhcHRhdGlvbi1yYW5nZT0xLjAwIHNjZW5lY3V0LWF3YXJlLXFwPTBjb25mb3JtYW5jZS13aW5kb3ctb2Zmc2V0cyByaWdodD0wIGJvdHRvbT0wIGRlY29kZXItbWF4LXJhdGU9MCBuby12YnYtbGl2ZS1tdWx0aS1wYXNzgBJUw2dAoL+E/o9i5XNzAQAAAAAAACdjwIBnyAEAAAAAAAAaRaOHRU5DT0RFUkSHjUxhdmY1OS4xNi4xMDBzcwEAAAAAAABfY8CLY8WITroreYRVR+ZnyAEAAAAAAAAiRaOHRU5DT0RFUkSHlUxhdmM1OS4xOC4xMDAgbGlieDI2NWfIokWjiERVUkFUSU9ORIeUMDA6MDA6MDAuMjAwMDAwMDAwAAAfQ7Z1Q6C/hO1dHxTngQCjQeuBAACAAAAB4ygBrx0ebCF995111xxtttuA98+hP/7yvn/Lfh/bKVrr6zWG148ECGSYwAAAAwAAAwAAAwAAAwAAAwAAAwAAAwABuagXlgNMThqAAAADAAADAAADAAADAAADAAADAAADAAADAZeTC5NAAAADAAADAAADAAADAAADAAADAAADAAADAAAOaIcAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAG3AAAADAAADAAADAAADAAADAAADAAADAAADAAADAAA7YAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAEXAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAi4AAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwCegAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwGRAAADAAADAAADAAADAAADAAADAAADAAADAAADAtoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAVMAAADAAADAAADAAADAAADAAADAAADAAADAAAIWAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAADvgAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAABawAAADAAADAAADAAADAAADAAADAAADAAADAAAgIKPxgQCgAAAAAGkCAdAhSeEMY6PI0szKqqiGZ/mIlQAA6YDzkhioAAADAC3g00qAAABbwMMAAAMAEJAAAAMAANiAAAADAAW0AAADABPQAAADAEZAAAADAMeAAAADAY0AAAMD4gAABuwAAA0IAAAVkAAAIqCj6IEAUAAAAABgAgHgRJV4YSDyJDKqqiGZmcCLgAAr4JMr8QAAAwAXsGEAAAMAHxBlAAADAoYAAAMAEtAAAAMAYcAAAAMA8YAAAAMB4QAAAwO2AAAHFAAAChgAAA8IAAAVUAAAHRAAACVgo+SBACgAAAAAXAAB4CT9fosKR5EdURVRDMzOiYAAS0CUN8OAAAAOuGWAAAAaEGmAAAJ6XYAAD9gAAAMAQcAAAAMAvIAAAAMBowAAAwNGAAAF7AAACCgAAAv4AAAR8AAAGLAAAB9Qo+SBAHgAAAAAXAAB4Ga1/UYUDyI6oiqiGZmciYAAS0CUN8OAAAAOuGWAAAAaEGmAAAJ6XYAAD9gAAAMAQcAAAAMAvIAAAAMBowAAAwNGAAAF7AAACCgAAAv4AAAR8AAAGLAAAB9QHFO7a5e/hBPLdeu7j7OBALeK94EB8YILffCBCQ==" } }; }, function(module, exports, __webpack_require__) { const PassThrough = __webpack_require__(3).PassThrough, getInfo = __webpack_require__(938), utils = __webpack_require__(107), formatUtils = __webpack_require__(470), urlUtils = __webpack_require__(471), sig = __webpack_require__(473), miniget = __webpack_require__(156), m3u8stream = __webpack_require__(232), {parseTimestamp: parseTimestamp} = __webpack_require__(232), ytdl = (link, options) => { const stream = createStream(options); return ytdl.getInfo(link, options).then((info => { downloadFromInfoCallback(stream, info, options); }), stream.emit.bind(stream, "error")), stream; }; module.exports = ytdl, ytdl.getBasicInfo = getInfo.getBasicInfo, ytdl.getInfo = getInfo.getInfo, ytdl.chooseFormat = formatUtils.chooseFormat, ytdl.filterFormats = formatUtils.filterFormats, ytdl.validateID = urlUtils.validateID, ytdl.validateURL = urlUtils.validateURL, ytdl.getURLVideoID = urlUtils.getURLVideoID, ytdl.getVideoID = urlUtils.getVideoID, ytdl.cache = { sig: sig.cache, info: getInfo.cache, watch: getInfo.watchPageCache, cookie: getInfo.cookieCache }, ytdl.version = __webpack_require__(469).version; const createStream = options => { const stream = new PassThrough({ highWaterMark: options && options.highWaterMark || 524288 }); return stream._destroy = () => { stream.destroyed = !0; }, stream; }, pipeAndSetEvents = (req, stream, end) => { [ "abort", "request", "response", "error", "redirect", "retry", "reconnect" ].forEach((event => { req.prependListener(event, stream.emit.bind(stream, event)); })), req.pipe(stream, { end: end }); }, downloadFromInfoCallback = (stream, info, options) => { options = options || {}; let format, err = utils.playError(info.player_response, [ "UNPLAYABLE", "LIVE_STREAM_OFFLINE", "LOGIN_REQUIRED" ]); if (err) return void stream.emit("error", err); if (!info.formats.length) return void stream.emit("error", Error("This video is unavailable")); try { format = formatUtils.chooseFormat(info.formats, options); } catch (e) { return void stream.emit("error", e); } if (stream.emit("info", info, format), stream.destroyed) return; let contentLength, downloaded = 0; const ondata = chunk => { downloaded += chunk.length, stream.emit("progress", chunk.length, downloaded, contentLength); }, dlChunkSize = options.dlChunkSize || 10485760; let req, shouldEnd = !0; if (format.isHLS || format.isDashMPD) req = m3u8stream(format.url, { chunkReadahead: +info.live_chunk_readahead, begin: options.begin || format.isLive && Date.now(), liveBuffer: options.liveBuffer, requestOptions: options.requestOptions, parser: format.isDashMPD ? "dash-mpd" : "m3u8", id: format.itag }), req.on("progress", ((segment, totalSegments) => { stream.emit("progress", segment.size, segment.num, totalSegments); })), pipeAndSetEvents(req, stream, shouldEnd); else { const requestOptions = Object.assign({}, options.requestOptions, { maxReconnects: 6, maxRetries: 3, backoff: { inc: 500, max: 1e4 } }); if (0 === dlChunkSize || format.hasAudio && format.hasVideo) options.begin && (format.url += `&begin=${parseTimestamp(options.begin)}`), options.range && (options.range.start || options.range.end) && (requestOptions.headers = Object.assign({}, requestOptions.headers, { Range: `bytes=${options.range.start || "0"}-${options.range.end || ""}` })), req = miniget(format.url, requestOptions), req.on("response", (res => { stream.destroyed || (contentLength = contentLength || parseInt(res.headers["content-length"])); })), req.on("data", ondata), pipeAndSetEvents(req, stream, shouldEnd); else { let start = options.range && options.range.start || 0, end = start + dlChunkSize; const rangeEnd = options.range && options.range.end; contentLength = options.range ? (rangeEnd ? rangeEnd + 1 : parseInt(format.contentLength)) - start : parseInt(format.contentLength); const getNextChunk = () => { !rangeEnd && end >= contentLength && (end = 0), rangeEnd && end > rangeEnd && (end = rangeEnd), shouldEnd = !end || end === rangeEnd, requestOptions.headers = Object.assign({}, requestOptions.headers, { Range: `bytes=${start}-${end || ""}` }), req = miniget(format.url, requestOptions), req.on("data", ondata), req.on("end", (() => { stream.destroyed || end && end !== rangeEnd && (start = end + 1, end += dlChunkSize, getNextChunk()); })), pipeAndSetEvents(req, stream, shouldEnd); }; getNextChunk(); } } stream._destroy = () => { stream.destroyed = !0, req.destroy(), req.end(); }; }; ytdl.downloadFromInfo = (info, options) => { const stream = createStream(options); if (!info.full) throw Error("Cannot use `ytdl.downloadFromInfo()` when called with info from `ytdl.getBasicInfo()`"); return setImmediate((() => { downloadFromInfoCallback(stream, info, options); })), stream; }; }, function(module, exports, __webpack_require__) { const querystring = __webpack_require__(24), sax = __webpack_require__(104), miniget = __webpack_require__(156), utils = __webpack_require__(107), {setTimeout: setTimeout} = __webpack_require__(103), formatUtils = __webpack_require__(470), urlUtils = __webpack_require__(471), extras = __webpack_require__(940), sig = __webpack_require__(473), Cache = __webpack_require__(474), BASE_URL = "https://www.youtube.com/watch?v="; exports.cache = new Cache, exports.cookieCache = new Cache(864e5), exports.watchPageCache = new Cache; let cver = "2.20210622.10.00"; class UnrecoverableError extends Error {} const AGE_RESTRICTED_URLS = [ "support.google.com/youtube/?p=age_restrictions", "youtube.com/t/community_guidelines" ]; exports.getBasicInfo = async (id, options) => { const retryOptions = Object.assign({}, miniget.defaultOptions, options.requestOptions); options.requestOptions = Object.assign({}, options.requestOptions, {}), options.requestOptions.headers = Object.assign({}, { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36" }, options.requestOptions.headers); let info = await pipeline([ id, options ], (info => { let playErr = utils.playError(info.player_response, [ "ERROR" ], UnrecoverableError), privateErr = privateVideoError(info.player_response); if (playErr || privateErr) throw playErr || privateErr; return info && info.player_response && (info.player_response.streamingData || isRental(info.player_response) || isNotYetBroadcasted(info.player_response)); }), retryOptions, [ getWatchHTMLPage, getWatchJSONPage, getVideoInfoPage ]); Object.assign(info, { formats: parseFormats(info.player_response), related_videos: extras.getRelatedVideos(info) }); const media = extras.getMedia(info), additional = { author: extras.getAuthor(info), media: media, likes: extras.getLikes(info), dislikes: extras.getDislikes(info), age_restricted: !!(media && media.notice_url && AGE_RESTRICTED_URLS.some((url => media.notice_url.includes(url)))), video_url: BASE_URL + id, storyboards: extras.getStoryboards(info), chapters: extras.getChapters(info) }; return info.videoDetails = extras.cleanVideoDetails(Object.assign({}, info.player_response && info.player_response.microformat && info.player_response.microformat.playerMicroformatRenderer, info.player_response && info.player_response.videoDetails, additional), info), info; }; const privateVideoError = player_response => { let playability = player_response && player_response.playabilityStatus; return playability && "LOGIN_REQUIRED" === playability.status && playability.messages && playability.messages.filter((m => /This is a private video/.test(m))).length ? new UnrecoverableError(playability.reason || playability.messages && playability.messages[0]) : null; }, isRental = player_response => { let playability = player_response.playabilityStatus; return playability && "UNPLAYABLE" === playability.status && playability.errorScreen && playability.errorScreen.playerLegacyDesktopYpcOfferRenderer; }, isNotYetBroadcasted = player_response => { let playability = player_response.playabilityStatus; return playability && "LIVE_STREAM_OFFLINE" === playability.status; }, getWatchHTMLURL = (id, options) => `${BASE_URL + id}&hl=${options.lang || "en"}`, getWatchHTMLPageBody = (id, options) => { const url = getWatchHTMLURL(id, options); return exports.watchPageCache.getOrSet(url, (() => utils.exposedMiniget(url, options).text())); }, getHTML5player = body => { let html5playerRes = /|"jsUrl":"([^"]+)"/.exec(body); return html5playerRes ? html5playerRes[1] || html5playerRes[2] : null; }, pipeline = async (args, validate, retryOptions, endpoints) => { let info; for (let func of endpoints) try { const newInfo = await retryFunc(func, args.concat([ info ]), retryOptions); if (newInfo.player_response && (newInfo.player_response.videoDetails = assign(info && info.player_response && info.player_response.videoDetails, newInfo.player_response.videoDetails), newInfo.player_response = assign(info && info.player_response, newInfo.player_response)), info = assign(info, newInfo), validate(info, !1)) break; } catch (err) { if (err instanceof UnrecoverableError || func === endpoints[endpoints.length - 1]) throw err; } return info; }, assign = (target, source) => { if (!target || !source) return target || source; for (let [key, value] of Object.entries(source)) null != value && (target[key] = value); return target; }, retryFunc = async (func, args, options) => { let result, currentTry = 0; for (;currentTry <= options.maxRetries; ) try { result = await func(...args); break; } catch (err) { if (err instanceof UnrecoverableError || err instanceof miniget.MinigetError && err.statusCode < 500 || currentTry >= options.maxRetries) throw err; let wait = Math.min(++currentTry * options.backoff.inc, options.backoff.max); await new Promise((resolve => setTimeout(resolve, wait))); } return result; }, jsonClosingChars = /^[)\]}'\s]+/, parseJSON = (source, varName, json) => { if (!json || "object" == typeof json) return json; try { return json = json.replace(jsonClosingChars, ""), JSON.parse(json); } catch (err) { throw Error(`Error parsing ${varName} in ${source}: ${err.message}`); } }, findJSON = (source, varName, body, left, right, prependJSON) => { let jsonStr = utils.between(body, left, right); if (!jsonStr) throw Error(`Could not find ${varName} in ${source}`); return parseJSON(source, varName, utils.cutAfterJSON(`${prependJSON}${jsonStr}`)); }, findPlayerResponse = (source, info) => { const player_response = info && (info.args && info.args.player_response || info.player_response || info.playerResponse || info.embedded_player_response); return parseJSON(source, "player_response", player_response); }, getWatchJSONPage = async (id, options) => { const reqOptions = Object.assign({ headers: {} }, options.requestOptions); let cookie = reqOptions.headers.Cookie || reqOptions.headers.cookie; reqOptions.headers = Object.assign({ "x-youtube-client-name": "1", "x-youtube-client-version": cver, "x-youtube-identity-token": exports.cookieCache.get(cookie || "browser") || "" }, reqOptions.headers); const setIdentityToken = async (key, throwIfNotFound) => { reqOptions.headers["x-youtube-identity-token"] || (reqOptions.headers["x-youtube-identity-token"] = await ((id, options, key, throwIfNotFound) => exports.cookieCache.getOrSet(key, (async () => { let match = (await getWatchHTMLPageBody(id, options)).match(/(["'])ID_TOKEN\1[:,]\s?"([^"]+)"/); if (!match && throwIfNotFound) throw new UnrecoverableError("Cookie header used in request, but unable to find YouTube identity token"); return match && match[2]; })))(id, options, key, throwIfNotFound)); }; cookie && await setIdentityToken(cookie, !0); const jsonUrl = ((id, options) => `${getWatchHTMLURL(id, options)}&pbj=1`)(id, options), body = await utils.exposedMiniget(jsonUrl, options, reqOptions).text(); let parsedBody = parseJSON("watch.json", "body", body); if ("now" === parsedBody.reload && await setIdentityToken("browser", !1), "now" === parsedBody.reload || !Array.isArray(parsedBody)) throw Error("Unable to retrieve video metadata in watch.json"); let info = parsedBody.reduce(((part, curr) => Object.assign(curr, part)), {}); return info.player_response = findPlayerResponse("watch.json", info), info.html5player = info.player && info.player.assets && info.player.assets.js, info; }, getWatchHTMLPage = async (id, options) => { let body = await getWatchHTMLPageBody(id, options), info = { page: "watch" }; try { cver = utils.between(body, '{"key":"cver","value":"', '"}'), info.player_response = findJSON("watch.html", "player_response", body, /\bytInitialPlayerResponse\s*=\s*\{/i, "<\/script>", "{"); } catch (err) { let args = findJSON("watch.html", "player_response", body, /\bytplayer\.config\s*=\s*{/, "<\/script>", "{"); info.player_response = findPlayerResponse("watch.html", args); } return info.response = findJSON("watch.html", "response", body, /\bytInitialData("\])?\s*=\s*\{/i, "<\/script>", "{"), info.html5player = getHTML5player(body), info; }, getVideoInfoPage = async (id, options) => { const url = new URL("https://www.youtube.com/get_video_info"); url.searchParams.set("video_id", id), url.searchParams.set("c", "TVHTML5"), url.searchParams.set("cver", `7${cver.substr(1)}`), url.searchParams.set("eurl", "https://youtube.googleapis.com/v/" + id), url.searchParams.set("ps", "default"), url.searchParams.set("gl", "US"), url.searchParams.set("hl", options.lang || "en"), url.searchParams.set("html5", "1"); const body = await utils.exposedMiniget(url.toString(), options).text(); let info = querystring.parse(body); return info.player_response = findPlayerResponse("get_video_info", info), info; }, parseFormats = player_response => { let formats = []; return player_response && player_response.streamingData && (formats = formats.concat(player_response.streamingData.formats || []).concat(player_response.streamingData.adaptiveFormats || [])), formats; }; exports.getInfo = async (id, options) => { let info = await exports.getBasicInfo(id, options); const hasManifest = info.player_response && info.player_response.streamingData && (info.player_response.streamingData.dashManifestUrl || info.player_response.streamingData.hlsManifestUrl); let funcs = []; if (info.formats.length) { if (info.html5player = info.html5player || getHTML5player(await getWatchHTMLPageBody(id, options)) || getHTML5player(await ((id, options) => { const embedUrl = `${"https://www.youtube.com/embed/" + id}?hl=${options.lang || "en"}`; return utils.exposedMiniget(embedUrl, options).text(); })(id, options)), !info.html5player) throw Error("Unable to find html5player file"); const html5player = new URL(info.html5player, BASE_URL).toString(); funcs.push(sig.decipherFormats(info.formats, html5player, options)); } if (hasManifest && info.player_response.streamingData.dashManifestUrl) { let url = info.player_response.streamingData.dashManifestUrl; funcs.push(getDashManifest(url, options)); } if (hasManifest && info.player_response.streamingData.hlsManifestUrl) { let url = info.player_response.streamingData.hlsManifestUrl; funcs.push(getM3U8(url, options)); } let results = await Promise.all(funcs); return info.formats = Object.values(Object.assign({}, ...results)), info.formats = info.formats.map(formatUtils.addFormatMeta), info.formats.sort(formatUtils.sortFormats), info.full = !0, info; }; const getDashManifest = (url, options) => new Promise(((resolve, reject) => { let formats = {}; const parser = sax.parser(!1); let adaptationSet; parser.onerror = reject, parser.onopentag = node => { if ("ADAPTATIONSET" === node.name) adaptationSet = node.attributes; else if ("REPRESENTATION" === node.name) { const itag = parseInt(node.attributes.ID); isNaN(itag) || (formats[url] = Object.assign({ itag: itag, url: url, bitrate: parseInt(node.attributes.BANDWIDTH), mimeType: `${adaptationSet.MIMETYPE}; codecs="${node.attributes.CODECS}"` }, node.attributes.HEIGHT ? { width: parseInt(node.attributes.WIDTH), height: parseInt(node.attributes.HEIGHT), fps: parseInt(node.attributes.FRAMERATE) } : { audioSampleRate: node.attributes.AUDIOSAMPLINGRATE })); } }, parser.onend = () => { resolve(formats); }; const req = utils.exposedMiniget(new URL(url, BASE_URL).toString(), options); req.setEncoding("utf8"), req.on("error", reject), req.on("data", (chunk => { parser.write(chunk); })), req.on("end", parser.close.bind(parser)); })), getM3U8 = async (url, options) => { url = new URL(url, BASE_URL); const body = await utils.exposedMiniget(url.toString(), options).text(); let formats = {}; return body.split("\n").filter((line => /^https?:\/\//.test(line))).forEach((line => { const itag = parseInt(line.match(/\/itag\/(\d+)\//)[1]); formats[line] = { itag: itag, url: line }; })), formats; }; for (let funcName of [ "getBasicInfo", "getInfo" ]) { const func = exports[funcName]; exports[funcName] = async (link, options = {}) => { utils.checkForUpdates(); let id = await urlUtils.getVideoID(link); const key = [ funcName, id, options.lang ].join("-"); return exports.cache.getOrSet(key, (() => func(id, options))); }; } exports.validateID = urlUtils.validateID, exports.validateURL = urlUtils.validateURL, exports.getURLVideoID = urlUtils.getURLVideoID, exports.getVideoID = urlUtils.getVideoID; }, function(module, exports) { module.exports = { 5: { mimeType: 'video/flv; codecs="Sorenson H.283, mp3"', qualityLabel: "240p", bitrate: 25e4, audioBitrate: 64 }, 6: { mimeType: 'video/flv; codecs="Sorenson H.263, mp3"', qualityLabel: "270p", bitrate: 8e5, audioBitrate: 64 }, 13: { mimeType: 'video/3gp; codecs="MPEG-4 Visual, aac"', qualityLabel: null, bitrate: 5e5, audioBitrate: null }, 17: { mimeType: 'video/3gp; codecs="MPEG-4 Visual, aac"', qualityLabel: "144p", bitrate: 5e4, audioBitrate: 24 }, 18: { mimeType: 'video/mp4; codecs="H.264, aac"', qualityLabel: "360p", bitrate: 5e5, audioBitrate: 96 }, 22: { mimeType: 'video/mp4; codecs="H.264, aac"', qualityLabel: "720p", bitrate: 2e6, audioBitrate: 192 }, 34: { mimeType: 'video/flv; codecs="H.264, aac"', qualityLabel: "360p", bitrate: 5e5, audioBitrate: 128 }, 35: { mimeType: 'video/flv; codecs="H.264, aac"', qualityLabel: "480p", bitrate: 8e5, audioBitrate: 128 }, 36: { mimeType: 'video/3gp; codecs="MPEG-4 Visual, aac"', qualityLabel: "240p", bitrate: 175e3, audioBitrate: 32 }, 37: { mimeType: 'video/mp4; codecs="H.264, aac"', qualityLabel: "1080p", bitrate: 3e6, audioBitrate: 192 }, 38: { mimeType: 'video/mp4; codecs="H.264, aac"', qualityLabel: "3072p", bitrate: 35e5, audioBitrate: 192 }, 43: { mimeType: 'video/webm; codecs="VP8, vorbis"', qualityLabel: "360p", bitrate: 5e5, audioBitrate: 128 }, 44: { mimeType: 'video/webm; codecs="VP8, vorbis"', qualityLabel: "480p", bitrate: 1e6, audioBitrate: 128 }, 45: { mimeType: 'video/webm; codecs="VP8, vorbis"', qualityLabel: "720p", bitrate: 2e6, audioBitrate: 192 }, 46: { mimeType: 'audio/webm; codecs="vp8, vorbis"', qualityLabel: "1080p", bitrate: null, audioBitrate: 192 }, 82: { mimeType: 'video/mp4; codecs="H.264, aac"', qualityLabel: "360p", bitrate: 5e5, audioBitrate: 96 }, 83: { mimeType: 'video/mp4; codecs="H.264, aac"', qualityLabel: "240p", bitrate: 5e5, audioBitrate: 96 }, 84: { mimeType: 'video/mp4; codecs="H.264, aac"', qualityLabel: "720p", bitrate: 2e6, audioBitrate: 192 }, 85: { mimeType: 'video/mp4; codecs="H.264, aac"', qualityLabel: "1080p", bitrate: 3e6, audioBitrate: 192 }, 91: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "144p", bitrate: 1e5, audioBitrate: 48 }, 92: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "240p", bitrate: 15e4, audioBitrate: 48 }, 93: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "360p", bitrate: 5e5, audioBitrate: 128 }, 94: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "480p", bitrate: 8e5, audioBitrate: 128 }, 95: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "720p", bitrate: 15e5, audioBitrate: 256 }, 96: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "1080p", bitrate: 25e5, audioBitrate: 256 }, 100: { mimeType: 'audio/webm; codecs="VP8, vorbis"', qualityLabel: "360p", bitrate: null, audioBitrate: 128 }, 101: { mimeType: 'audio/webm; codecs="VP8, vorbis"', qualityLabel: "360p", bitrate: null, audioBitrate: 192 }, 102: { mimeType: 'audio/webm; codecs="VP8, vorbis"', qualityLabel: "720p", bitrate: null, audioBitrate: 192 }, 120: { mimeType: 'video/flv; codecs="H.264, aac"', qualityLabel: "720p", bitrate: 2e6, audioBitrate: 128 }, 127: { mimeType: 'audio/ts; codecs="aac"', qualityLabel: null, bitrate: null, audioBitrate: 96 }, 128: { mimeType: 'audio/ts; codecs="aac"', qualityLabel: null, bitrate: null, audioBitrate: 96 }, 132: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "240p", bitrate: 15e4, audioBitrate: 48 }, 133: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "240p", bitrate: 2e5, audioBitrate: null }, 134: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "360p", bitrate: 3e5, audioBitrate: null }, 135: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "480p", bitrate: 5e5, audioBitrate: null }, 136: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "720p", bitrate: 1e6, audioBitrate: null }, 137: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "1080p", bitrate: 25e5, audioBitrate: null }, 138: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "4320p", bitrate: 135e5, audioBitrate: null }, 139: { mimeType: 'audio/mp4; codecs="aac"', qualityLabel: null, bitrate: null, audioBitrate: 48 }, 140: { mimeType: 'audio/m4a; codecs="aac"', qualityLabel: null, bitrate: null, audioBitrate: 128 }, 141: { mimeType: 'audio/mp4; codecs="aac"', qualityLabel: null, bitrate: null, audioBitrate: 256 }, 151: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "720p", bitrate: 5e4, audioBitrate: 24 }, 160: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "144p", bitrate: 1e5, audioBitrate: null }, 171: { mimeType: 'audio/webm; codecs="vorbis"', qualityLabel: null, bitrate: null, audioBitrate: 128 }, 172: { mimeType: 'audio/webm; codecs="vorbis"', qualityLabel: null, bitrate: null, audioBitrate: 192 }, 242: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "240p", bitrate: 1e5, audioBitrate: null }, 243: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "360p", bitrate: 25e4, audioBitrate: null }, 244: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "480p", bitrate: 5e5, audioBitrate: null }, 247: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "720p", bitrate: 7e5, audioBitrate: null }, 248: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "1080p", bitrate: 15e5, audioBitrate: null }, 249: { mimeType: 'audio/webm; codecs="opus"', qualityLabel: null, bitrate: null, audioBitrate: 48 }, 250: { mimeType: 'audio/webm; codecs="opus"', qualityLabel: null, bitrate: null, audioBitrate: 64 }, 251: { mimeType: 'audio/webm; codecs="opus"', qualityLabel: null, bitrate: null, audioBitrate: 160 }, 264: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "1440p", bitrate: 4e6, audioBitrate: null }, 266: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "2160p", bitrate: 125e5, audioBitrate: null }, 271: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "1440p", bitrate: 9e6, audioBitrate: null }, 272: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "4320p", bitrate: 2e7, audioBitrate: null }, 278: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "144p 30fps", bitrate: 8e4, audioBitrate: null }, 298: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "720p", bitrate: 3e6, audioBitrate: null }, 299: { mimeType: 'video/mp4; codecs="H.264"', qualityLabel: "1080p", bitrate: 55e5, audioBitrate: null }, 300: { mimeType: 'video/ts; codecs="H.264, aac"', qualityLabel: "720p", bitrate: 1318e3, audioBitrate: 48 }, 302: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "720p HFR", bitrate: 25e5, audioBitrate: null }, 303: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "1080p HFR", bitrate: 5e6, audioBitrate: null }, 308: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "1440p HFR", bitrate: 1e7, audioBitrate: null }, 313: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "2160p", bitrate: 13e6, audioBitrate: null }, 315: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "2160p HFR", bitrate: 2e7, audioBitrate: null }, 330: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "144p HDR, HFR", bitrate: 8e4, audioBitrate: null }, 331: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "240p HDR, HFR", bitrate: 1e5, audioBitrate: null }, 332: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "360p HDR, HFR", bitrate: 25e4, audioBitrate: null }, 333: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "240p HDR, HFR", bitrate: 5e5, audioBitrate: null }, 334: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "720p HDR, HFR", bitrate: 1e6, audioBitrate: null }, 335: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "1080p HDR, HFR", bitrate: 15e5, audioBitrate: null }, 336: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "1440p HDR, HFR", bitrate: 5e6, audioBitrate: null }, 337: { mimeType: 'video/webm; codecs="VP9"', qualityLabel: "2160p HDR, HFR", bitrate: 12e6, audioBitrate: null } }; }, function(module, exports, __webpack_require__) { const utils = __webpack_require__(107), qs = __webpack_require__(24), {parseTimestamp: parseTimestamp} = __webpack_require__(232), BASE_URL = "https://www.youtube.com/watch?v=", TITLE_TO_CATEGORY = { song: { name: "Music", url: "https://music.youtube.com/" } }, getText = obj => obj ? obj.runs ? obj.runs[0].text : obj.simpleText : null; exports.getMedia = info => { let media = {}, results = []; try { results = info.response.contents.twoColumnWatchNextResults.results.results.contents; } catch (err) {} let result = results.find((v => v.videoSecondaryInfoRenderer)); if (!result) return {}; try { let metadataRows = (result.metadataRowContainer || result.videoSecondaryInfoRenderer.metadataRowContainer).metadataRowContainerRenderer.rows; for (let row of metadataRows) if (row.metadataRowRenderer) { let title = getText(row.metadataRowRenderer.title).toLowerCase(), contents = row.metadataRowRenderer.contents[0]; media[title] = getText(contents); let runs = contents.runs; runs && runs[0].navigationEndpoint && (media[`${title}_url`] = new URL(runs[0].navigationEndpoint.commandMetadata.webCommandMetadata.url, BASE_URL).toString()), title in TITLE_TO_CATEGORY && (media.category = TITLE_TO_CATEGORY[title].name, media.category_url = TITLE_TO_CATEGORY[title].url); } else if (row.richMetadataRowRenderer) { let contents = row.richMetadataRowRenderer.contents, boxArt = contents.filter((meta => "RICH_METADATA_RENDERER_STYLE_BOX_ART" === meta.richMetadataRenderer.style)); for (let {richMetadataRenderer: richMetadataRenderer} of boxArt) { let meta = richMetadataRenderer; media.year = getText(meta.subtitle); let type = getText(meta.callToAction).split(" ")[1]; media[type] = getText(meta.title), media[`${type}_url`] = new URL(meta.endpoint.commandMetadata.webCommandMetadata.url, BASE_URL).toString(), media.thumbnails = meta.thumbnail.thumbnails; } let topic = contents.filter((meta => "RICH_METADATA_RENDERER_STYLE_TOPIC" === meta.richMetadataRenderer.style)); for (let {richMetadataRenderer: richMetadataRenderer} of topic) { let meta = richMetadataRenderer; media.category = getText(meta.title), media.category_url = new URL(meta.endpoint.commandMetadata.webCommandMetadata.url, BASE_URL).toString(); } } } catch (err) {} return media; }; const isVerified = badges => !(!badges || !badges.find((b => "Verified" === b.metadataBadgeRenderer.tooltip))); exports.getAuthor = info => { let channelId, subscriberCount, thumbnails = [], verified = !1; try { let videoOwnerRenderer = info.response.contents.twoColumnWatchNextResults.results.results.contents.find((v2 => v2.videoSecondaryInfoRenderer && v2.videoSecondaryInfoRenderer.owner && v2.videoSecondaryInfoRenderer.owner.videoOwnerRenderer)).videoSecondaryInfoRenderer.owner.videoOwnerRenderer; channelId = videoOwnerRenderer.navigationEndpoint.browseEndpoint.browseId, thumbnails = videoOwnerRenderer.thumbnail.thumbnails.map((thumbnail => (thumbnail.url = new URL(thumbnail.url, BASE_URL).toString(), thumbnail))), subscriberCount = utils.parseAbbreviatedNumber(getText(videoOwnerRenderer.subscriberCountText)), verified = isVerified(videoOwnerRenderer.badges); } catch (err) {} try { let videoDetails = info.player_response.microformat && info.player_response.microformat.playerMicroformatRenderer, id = videoDetails && videoDetails.channelId || channelId || info.player_response.videoDetails.channelId, author = { id: id, name: videoDetails ? videoDetails.ownerChannelName : info.player_response.videoDetails.author, user: videoDetails ? videoDetails.ownerProfileUrl.split("/").slice(-1)[0] : null, channel_url: `https://www.youtube.com/channel/${id}`, external_channel_url: videoDetails ? `https://www.youtube.com/channel/${videoDetails.externalChannelId}` : "", user_url: videoDetails ? new URL(videoDetails.ownerProfileUrl, BASE_URL).toString() : "", thumbnails: thumbnails, verified: verified, subscriber_count: subscriberCount }; return thumbnails.length && utils.deprecate(author, "avatar", author.thumbnails[0].url, "author.avatar", "author.thumbnails[0].url"), author; } catch (err) { return {}; } }; const parseRelatedVideo = (details, rvsParams) => { if (details) try { let viewCount = getText(details.viewCountText), shortViewCount = getText(details.shortViewCountText), rvsDetails = rvsParams.find((elem => elem.id === details.videoId)); /^\d/.test(shortViewCount) || (shortViewCount = rvsDetails && rvsDetails.short_view_count_text || ""), viewCount = (/^\d/.test(viewCount) ? viewCount : shortViewCount).split(" ")[0]; let browseEndpoint = details.shortBylineText.runs[0].navigationEndpoint.browseEndpoint, channelId = browseEndpoint.browseId, name = getText(details.shortBylineText), user = (browseEndpoint.canonicalBaseUrl || "").split("/").slice(-1)[0], video = { id: details.videoId, title: getText(details.title), published: getText(details.publishedTimeText), author: { id: channelId, name: name, user: user, channel_url: `https://www.youtube.com/channel/${channelId}`, user_url: `https://www.youtube.com/user/${user}`, thumbnails: details.channelThumbnail.thumbnails.map((thumbnail => (thumbnail.url = new URL(thumbnail.url, BASE_URL).toString(), thumbnail))), verified: isVerified(details.ownerBadges), [Symbol.toPrimitive]: () => (console.warn("`relatedVideo.author` will be removed in a near future release, use `relatedVideo.author.name` instead."), video.author.name) }, short_view_count_text: shortViewCount.split(" ")[0], view_count: viewCount.replace(/,/g, ""), length_seconds: details.lengthText ? Math.floor(parseTimestamp(getText(details.lengthText)) / 1e3) : rvsParams && `${rvsParams.length_seconds}`, thumbnails: details.thumbnail.thumbnails, richThumbnails: details.richThumbnail ? details.richThumbnail.movingThumbnailRenderer.movingThumbnailDetails.thumbnails : [], isLive: !(!details.badges || !details.badges.find((b => "LIVE NOW" === b.metadataBadgeRenderer.label))) }; return utils.deprecate(video, "author_thumbnail", video.author.thumbnails[0].url, "relatedVideo.author_thumbnail", "relatedVideo.author.thumbnails[0].url"), utils.deprecate(video, "ucid", video.author.id, "relatedVideo.ucid", "relatedVideo.author.id"), utils.deprecate(video, "video_thumbnail", video.thumbnails[0].url, "relatedVideo.video_thumbnail", "relatedVideo.thumbnails[0].url"), video; } catch (err) {} }; exports.getRelatedVideos = info => { let rvsParams = [], secondaryResults = []; try { rvsParams = info.response.webWatchNextResponseExtensionData.relatedVideoArgs.split(",").map((e => qs.parse(e))); } catch (err) {} try { secondaryResults = info.response.contents.twoColumnWatchNextResults.secondaryResults.secondaryResults.results; } catch (err) { return []; } let videos = []; for (let result of secondaryResults || []) { let details = result.compactVideoRenderer; if (details) { let video = parseRelatedVideo(details, rvsParams); video && videos.push(video); } else { let autoplay = result.compactAutoplayRenderer || result.itemSectionRenderer; if (!autoplay || !Array.isArray(autoplay.contents)) continue; for (let content of autoplay.contents) { let video = parseRelatedVideo(content.compactVideoRenderer, rvsParams); video && videos.push(video); } } } return videos; }, exports.getLikes = info => { try { let like = info.response.contents.twoColumnWatchNextResults.results.results.contents.find((r => r.videoPrimaryInfoRenderer)).videoPrimaryInfoRenderer.videoActions.menuRenderer.topLevelButtons.find((b => b.toggleButtonRenderer && "LIKE" === b.toggleButtonRenderer.defaultIcon.iconType)); return parseInt(like.toggleButtonRenderer.defaultText.accessibility.accessibilityData.label.replace(/\D+/g, "")); } catch (err) { return null; } }, exports.getDislikes = info => { try { let dislike = info.response.contents.twoColumnWatchNextResults.results.results.contents.find((r => r.videoPrimaryInfoRenderer)).videoPrimaryInfoRenderer.videoActions.menuRenderer.topLevelButtons.find((b => b.toggleButtonRenderer && "DISLIKE" === b.toggleButtonRenderer.defaultIcon.iconType)); return parseInt(dislike.toggleButtonRenderer.defaultText.accessibility.accessibilityData.label.replace(/\D+/g, "")); } catch (err) { return null; } }, exports.cleanVideoDetails = (videoDetails, info) => (videoDetails.thumbnails = videoDetails.thumbnail.thumbnails, delete videoDetails.thumbnail, utils.deprecate(videoDetails, "thumbnail", { thumbnails: videoDetails.thumbnails }, "videoDetails.thumbnail.thumbnails", "videoDetails.thumbnails"), videoDetails.description = videoDetails.shortDescription || getText(videoDetails.description), delete videoDetails.shortDescription, utils.deprecate(videoDetails, "shortDescription", videoDetails.description, "videoDetails.shortDescription", "videoDetails.description"), videoDetails.lengthSeconds = info.player_response.microformat && info.player_response.microformat.playerMicroformatRenderer.lengthSeconds || info.player_response.videoDetails.lengthSeconds, videoDetails), exports.getStoryboards = info => { const parts = info.player_response.storyboards && info.player_response.storyboards.playerStoryboardSpecRenderer && info.player_response.storyboards.playerStoryboardSpecRenderer.spec && info.player_response.storyboards.playerStoryboardSpecRenderer.spec.split("|"); if (!parts) return []; const url = new URL(parts.shift()); return parts.map(((part, i) => { let [thumbnailWidth, thumbnailHeight, thumbnailCount, columns, rows, interval, nameReplacement, sigh] = part.split("#"); url.searchParams.set("sigh", sigh), thumbnailCount = parseInt(thumbnailCount, 10), columns = parseInt(columns, 10), rows = parseInt(rows, 10); const storyboardCount = Math.ceil(thumbnailCount / (columns * rows)); return { templateUrl: url.toString().replace("$L", i).replace("$N", nameReplacement), thumbnailWidth: parseInt(thumbnailWidth, 10), thumbnailHeight: parseInt(thumbnailHeight, 10), thumbnailCount: thumbnailCount, interval: parseInt(interval, 10), columns: columns, rows: rows, storyboardCount: storyboardCount }; })); }, exports.getChapters = info => { const playerOverlayRenderer = info.response && info.response.playerOverlays && info.response.playerOverlays.playerOverlayRenderer, playerBar = playerOverlayRenderer && playerOverlayRenderer.decoratedPlayerBarRenderer && playerOverlayRenderer.decoratedPlayerBarRenderer.decoratedPlayerBarRenderer && playerOverlayRenderer.decoratedPlayerBarRenderer.decoratedPlayerBarRenderer.playerBar, markersMap = playerBar && playerBar.multiMarkersPlayerBarRenderer && playerBar.multiMarkersPlayerBarRenderer.markersMap, marker = Array.isArray(markersMap) && markersMap.find((m => m.value && Array.isArray(m.value.chapters))); return marker ? marker.value.chapters.map((chapter => ({ title: getText(chapter.chapterRenderer.title), start_time: chapter.chapterRenderer.timeRangeStartMillis / 1e3 }))) : []; }; }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); const stream_1 = __webpack_require__(3); class m3u8Parser extends stream_1.Writable { constructor() { super(), this._lastLine = "", this._seq = 0, this._nextItemDuration = null, this._nextItemRange = null, this._lastItemRangeEnd = 0, this.on("finish", (() => { this._parseLine(this._lastLine), this.emit("end"); })); } _parseAttrList(value) { let match, attrs = {}, regex = /([A-Z0-9-]+)=(?:"([^"]*?)"|([^,]*?))/g; for (;null != (match = regex.exec(value)); ) attrs[match[1]] = match[2] || match[3]; return attrs; } _parseRange(value) { if (!value) return null; let svalue = value.split("@"), start = svalue[1] ? parseInt(svalue[1]) : this._lastItemRangeEnd + 1, range = { start: start, end: start + parseInt(svalue[0]) - 1 }; return this._lastItemRangeEnd = range.end, range; } _parseLine(line) { let match = line.match(/^#(EXT[A-Z0-9-]+)(?::(.*))?/); if (match) { const tag = match[1], value = match[2] || ""; switch (tag) { case "EXT-X-PROGRAM-DATE-TIME": this.emit("starttime", new Date(value).getTime()); break; case "EXT-X-MEDIA-SEQUENCE": this._seq = parseInt(value); break; case "EXT-X-MAP": { let attrs = this._parseAttrList(value); if (!attrs.URI) return void this.destroy(new Error("`EXT-X-MAP` found without required attribute `URI`")); this.emit("item", { url: attrs.URI, seq: this._seq, init: !0, duration: 0, range: this._parseRange(attrs.BYTERANGE) }); break; } case "EXT-X-BYTERANGE": this._nextItemRange = this._parseRange(value); break; case "EXTINF": this._nextItemDuration = Math.round(1e3 * parseFloat(value.split(",")[0])); break; case "EXT-X-ENDLIST": this.emit("endlist"); } } else !/^#/.test(line) && line.trim() && (this.emit("item", { url: line.trim(), seq: this._seq++, duration: this._nextItemDuration, range: this._nextItemRange }), this._nextItemRange = null); } _write(chunk, encoding, callback) { let lines = chunk.toString("utf8").split("\n"); this._lastLine && (lines[0] = this._lastLine + lines[0]), lines.forEach(((line, i) => { this.destroyed || (i < lines.length - 1 ? this._parseLine(line) : this._lastLine = line); })), callback(); } } exports.default = m3u8Parser; }, function(module, exports, __webpack_require__) { "use strict"; var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; Object.defineProperty(exports, "__esModule", { value: !0 }); const stream_1 = __webpack_require__(3), sax_1 = __importDefault(__webpack_require__(104)), parse_time_1 = __webpack_require__(472); class DashMPDParser extends stream_1.Writable { constructor(targetID) { let lastTag; super(), this._parser = sax_1.default.createStream(!1, { lowercase: !0 }), this._parser.on("error", this.destroy.bind(this)); let segmentTemplate, timescale, offset, duration, baseURL, isStatic, treeLevel, periodStart, currtime = 0, seq = 0, timeline = [], getSegments = !1, gotSegments = !1; const tmpl = str => { const context = { RepresentationID: targetID, Number: seq, Time: currtime }; return str.replace(/\$(\w+)\$/g, ((m, p1) => context[p1] + "")); }; this._parser.on("opentag", (node => { switch (node.name) { case "mpd": currtime = node.attributes.availabilitystarttime ? new Date(node.attributes.availabilitystarttime).getTime() : 0, isStatic = "dynamic" !== node.attributes.type; break; case "period": seq = 0, timescale = 1e3, duration = 0, offset = 0, baseURL = [], treeLevel = 0, periodStart = parse_time_1.durationStr(node.attributes.start) || 0; break; case "segmentlist": seq = parseInt(node.attributes.startnumber) || seq, timescale = parseInt(node.attributes.timescale) || timescale, duration = parseInt(node.attributes.duration) || duration, offset = parseInt(node.attributes.presentationtimeoffset) || offset; break; case "segmenttemplate": segmentTemplate = node.attributes, seq = parseInt(node.attributes.startnumber) || seq, timescale = parseInt(node.attributes.timescale) || timescale; break; case "segmenttimeline": case "baseurl": lastTag = node.name; break; case "s": timeline.push({ duration: parseInt(node.attributes.d), repeat: parseInt(node.attributes.r), time: parseInt(node.attributes.t) }); break; case "adaptationset": case "representation": treeLevel++, null == targetID && (targetID = node.attributes.id), getSegments = node.attributes.id === targetID + "", getSegments && (periodStart && (currtime += periodStart), offset && (currtime -= offset / timescale * 1e3), this.emit("starttime", currtime)); break; case "initialization": getSegments && this.emit("item", { url: baseURL.filter((s => !!s)).join("") + node.attributes.sourceurl, seq: seq, init: !0, duration: 0 }); break; case "segmenturl": if (getSegments) { gotSegments = !0; let tl = timeline.shift(), segmentDuration = (tl && tl.duration || duration) / timescale * 1e3; this.emit("item", { url: baseURL.filter((s => !!s)).join("") + node.attributes.media, seq: seq++, duration: segmentDuration }), currtime += segmentDuration; } } })); const onEnd = () => { isStatic && this.emit("endlist"), getSegments ? this.emit("end") : this.destroy(Error(`Representation '${targetID}' not found`)); }; this._parser.on("closetag", (tagName => { switch (tagName) { case "adaptationset": case "representation": if (treeLevel--, segmentTemplate && timeline.length) { gotSegments = !0, segmentTemplate.initialization && this.emit("item", { url: baseURL.filter((s => !!s)).join("") + tmpl(segmentTemplate.initialization), seq: seq, init: !0, duration: 0 }); for (let {duration: duration, repeat: repeat, time: time} of timeline) { duration = duration / timescale * 1e3, repeat = repeat || 1, currtime = time || currtime; for (let i = 0; i < repeat; i++) this.emit("item", { url: baseURL.filter((s => !!s)).join("") + tmpl(segmentTemplate.media), seq: seq++, duration: duration }), currtime += duration; } } gotSegments && (this.emit("endearly"), onEnd(), this._parser.removeAllListeners(), this.removeAllListeners("finish")); } })), this._parser.on("text", (text => { "baseurl" === lastTag && (baseURL[treeLevel] = text, lastTag = null); })), this.on("finish", onEnd); } _write(chunk, encoding, callback) { this._parser.write(chunk, encoding), callback(); } } exports.default = DashMPDParser; }, function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.default = class { constructor(worker, options = {}) { this._worker = worker, this._concurrency = options.concurrency || 1, this.tasks = [], this.total = 0, this.active = 0; } push(item, callback) { this.tasks.push({ item: item, callback: callback }), this.total++, this._next(); } _next() { if (this.active >= this._concurrency || !this.tasks.length) return; const {item: item, callback: callback} = this.tasks.shift(); let callbackCalled = !1; this.active++, this._worker(item, ((err, result) => { callbackCalled || (this.active--, callbackCalled = !0, callback && callback(err, result), this._next()); })); } die() { this.tasks = []; } }; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2), path = __webpack_require__(5), tmp = __webpack_require__(475), child = __webpack_require__(32), fetch = __webpack_require__(34), pump = __webpack_require__(179), URL = (__webpack_require__(946), __webpack_require__(7).URL), castingUtils = __webpack_require__(233), Discovery = __webpack_require__(947), ExternalDiscovery = __webpack_require__(948), MDNSDiscovery = __webpack_require__(953), SSDPDiscovery = __webpack_require__(962), ChromecastClient = __webpack_require__(998), DLNAClient = __webpack_require__(1008), Router = __webpack_require__(122), discovery = new Discovery([ SSDPDiscovery, MDNSDiscovery, ExternalDiscovery ]), noop = Function.prototype; function Casting(executables) { var self = this; this.ffmpegErrors = "ignore", this.players = {}, this.executables = executables, this.middleware = Router(), this.middleware.param("devID", (function(req, res, next, devID) { if (!discovery.devices[devID]) return console.log(" ^ Device not found!"), res.statusCode = 404, res.setHeader("Content-Type", "text/plain; charset=utf8"), res.end("Device not found"); var player = self.players[devID]; switch (discovery.devices[devID].type) { case "chromecast": player = player || new ChromecastClient(discovery.devices[devID], self.executables); break; case "tv": player = player || new DLNAClient(discovery.devices[devID], self.executables); break; case "external": (player = discovery.devices[devID]).time = 0; } if (self.players[devID] = player, !player) return next(new Error("Unsupported device " + discovery.devices[devID].type)); req.player = player, next(); })), this.middleware.get("/", (function(req, res) { res.setHeader("Content-Type", "application/json; charset=utf8"), res.end(JSON.stringify(Object.keys(discovery.devices).map((function(key) { return discovery.devices[key]; })))); })), this.middleware.get("/transcode:ext?", this.transcode.bind(this)), this.middleware.get("/convert:ext?", this.transcode.bind(this)), this.middleware.get("/:devID", (function(req, res, next) { res.setHeader("Content-Type", "application/json; charset=utf8"), res.end(JSON.stringify(discovery.devices[req.params.devID])); })), this.middleware.all("/:devID/player", (function(req, res, next) { return req.player.middleware.bind(req.player)(req, res, next); })); } Casting.prototype.makeSubs = function(subsUrl, offset) { if (!subsUrl) return Promise.resolve(); var self = this; return fetch("http://127.0.0.1:11470/subtitles.srt?from=" + encodeURIComponent(subsUrl)).then((function(res) { return res.text(); })).then((function(text) { return new Promise((function(resolve, reject) { tmp.file({ prefix: "subs-", postfix: ".srt" }, (function(err, path, fd) { if (err) return reject(err); var written = fs.close.bind(fs, fd, resolve.bind(null, path)), subs = Buffer.from(text.replace(/\r/g, ""), "utf8"); fs.write(fd, subs, 0, subs.length, 0, written); })); })); })).then((function(sourceSubsFn) { return offset ? new Promise((function(resolve, reject) { tmp.file({ prefix: "subs-", postfix: ".srt", discardDescriptor: !0 }, (function(err, path) { if (err) return reject(err); var args = [ "-ss", offset, "-i", sourceSubsFn, "-y", path ], procOpts = { detached: !0, stdio: [ "ignore", "ignore", self.ffmpegErrors ] }; child.spawn(self.executables.ffmpeg, args, procOpts).once("close", (function(code) { return code ? reject("ffmpeg error " + code + " while subtitles alignment") : (fs.unlink(sourceSubsFn, noop), resolve(path)); })); })); })) : sourceSubsFn; })).catch((function(err) { console.log("Subtitles error", err); })); }, Casting.prototype.transcode = function(req, res) { if (!req.query.video) return res.statusCode = 400, void res.end("provide ?video"); req.once("error", noop); var isFMP4 = req.query.fmp4, audioTrack = req.query.audioTrack, offset = parseInt(req.query.time, 10) || 0, subtitlesDelay = parseInt(req.query.subtitlesDelay, 10) || 0; Promise.all([ castingUtils.getVideoInfo(this.executables.ffmpeg, req.query.video), castingUtils.getRemoteFileMeta(req.query.video), this.makeSubs(req.query.subtitles, Math.max(0, offset - subtitlesDelay)), this.executables.ffmpeg, this.ffmpegErrors ]).then((function(data) { var duration = data[0].duration, length = data[1].length, subtitles = (data[1].type, data[2]), ffmpegPath = data[3], ffmpegErrors = data[4]; duration && (length -= length * offset / duration, duration -= offset); var headers = { "Content-Type": isFMP4 ? "video/mp4" : "video/x-mkv", "Transfer-Encoding": "chunked", "Accept-Ranges": "none", Connection: "Close", "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01300000000000000000000000000000" }; if (req.headers["getmediainfo.sec"] && (headers["MediaInfo.sec"] = "SEC_Duration=" + 1e3 * duration + ";"), res.writeHead(200, headers), console.log("RESPONSE HEADERS", res._header), "HEAD" != req.method) { var audioStream, copyVideo = !subtitles, copyAudio = !0, videoStream = data[0].streams.find((function(stream) { return "Video" == stream.type && "h264" == stream.codec; })); videoStream || (copyVideo = !1, videoStream = data[0].streams.find((function(stream) { return "Video" == stream.type; }))), (audioStream = audioTrack ? data[0].streams.find((function(stream) { return "Audio" == stream.type && stream.id == audioTrack; })) : data[0].streams.find((function(stream) { return "Audio" == stream.type && stream.default; }))) && (copyAudio = "aac" == audioStream.codec && "stereo" == audioStream.channels), audioStream && duration || (copyAudio = !1, audioStream = data[0].streams.find((function(stream) { return "Audio" == stream.type; }))); var transmuxing = copyAudio && copyVideo, args = []; req.query.flagRe && args.push("-re"); var videoURL = req.query.video; videoURL.startsWith("file:") && (videoURL = decodeURI(new URL(videoURL).pathname).replace(/^\/([a-z]+:\/)/i, "$1").replace("/", path.sep)), args.push("-copyts", "-ss", duration > 0 ? offset : 0, "-i", videoURL), duration > 0 && args.push("-t", duration + offset), videoStream && args.push("-map", videoStream.id), audioStream && args.push("-map", audioStream.id), transmuxing ? args.push("-c", "copy") : (videoStream && (copyVideo ? args.push("-c:v", "copy") : (args.push("-c:v", "libx264", "-preset", "ultrafast", "-tune", "zerolatency", "-pix_fmt", "yuv420p"), subtitles && args.push("-vf", "subtitles=" + subtitles))), audioStream && (copyAudio ? args.push("-c:a", "copy") : args.push("-strict", "-2", "-c:a", "aac", "-ac", "2"))), isFMP4 && args.push("-movflags", "frag_keyframe+empty_moov"), args.push("-f", isFMP4 ? "mp4" : "matroska", "-threads", "0", "pipe:1"), console.log("Arguments " + args.join(" ")); var procOpts = { detached: !0, stdio: [ "ignore", null, ffmpegErrors ] }, transcodingProc = child.spawn(ffmpegPath, args, procOpts); pump(transcodingProc.stdout, res, (function(e) { console.log(" ---\x3e CLOSE", e ? e.message : ""), transcodingProc.kill("SIGKILL"), subtitles && fs.unlink(subtitles, noop); })); } else res.end(); })).catch((function(e) { console.log("Transcoding error:", e), res.end(e.message); })); }, module.exports = Casting; }, function(module, exports, __webpack_require__) { "use strict"; var isWindows = "win32" === process.platform, trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; module.exports = function() { var path; return path = isWindows ? process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + "\\temp" : process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp", trailingSlashRe.test(path) && (path = path.slice(0, -1)), path; }; }, function(module, exports) { module.exports = require("domain"); }, function(module, exports, __webpack_require__) { "use strict"; function Discovery(Facilities) { if (!Array.isArray(Facilities)) throw new TypeError("Invalid facilities"); for (var i in this.facilities = [], this.devices = {}, Facilities) { var facility = new (0, Facilities[i]); facility.on("device", this.collect.bind(this)), facility.search(), this.facilities.push(facility); } } Discovery.prototype.collect = function(device) { this.devices[device.id] || (console.log('Discovery of new %s device "%s" - %s', device.type, device.id, device.name), this.devices[device.id] = device); }, module.exports = Discovery; }, function(module, exports, __webpack_require__) { "use strict"; var EventEmitter = __webpack_require__(4), util = __webpack_require__(0), externalPlayers = __webpack_require__(949); function ExternalDiscovery() { EventEmitter.call(this); var self = this; this.devices = { groups: {}, update: function() { self.devices.groups.external.forEach(self.emit.bind(self, "device")); } }; } util.inherits(ExternalDiscovery, EventEmitter), ExternalDiscovery.prototype.search = function() { externalPlayers(this.devices); }, module.exports = ExternalDiscovery; }, function(module, exports, __webpack_require__) { var child = __webpack_require__(32), fs = __webpack_require__(2), stremioCast = __webpack_require__(950), enginefs = __webpack_require__(172), http = __webpack_require__(11), os = __webpack_require__(23), path = __webpack_require__(5); module.exports = function(devices) { var players = { vlc: { title: "VLC", args: [ "--no-video-title-show" ], subArg: "--sub-file=", timeArg: "--start-time=", playArg: "", darwin: { path: [ "/Applications/VLC.app/Contents/MacOS/VLC" ] }, linux: { path: [ "/usr/bin/vlc", "/usr/local/bin/vlc" ] }, win32: { path: [ '"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe"', '"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe"' ] } }, mplayerx: { title: "MPlayerX", args: [ "" ], subArg: "-SubFileNameRule ", timeArg: "-SeekStepTimeU ", playArg: "-url ", darwin: { path: [ "/Applications/MPlayerX.app/Contents/MacOS/MPlayerX" ] }, linux: { path: [] }, win32: { path: [] } }, mplayer: { title: "MPlayer", args: [ "" ], subArg: "-sub ", timeArg: "-ss ", playArg: "", darwin: { path: [ "/usr/local/bin/mplayer", "/opt/local/bin/mplayer", "/sw/bin/mplayer" ] }, linux: { path: [ "/usr/bin/mplayer" ] }, win32: { path: [] } }, mpv: { title: "MPV", args: [ "--no-terminal" ], subArg: "--sub-file=", timeArg: "--start=", playArg: "", darwin: { path: [ "/usr/local/bin/mpv", "/opt/local/bin/mpv", "/sw/bin/mpv" ] }, linux: { path: [ "/usr/bin/mpv" ] }, win32: { path: [] } }, bomi: { title: "Bomi", args: [], subArg: "--set-subtitle ", timeArg: "", playArg: "", darwin: { path: [] }, linux: { path: [ "/usr/bin/bomi" ] }, win32: { path: [] } }, mpcBe: { title: "MPC-BE", args: [ "" ], subArg: "/sub ", timeArg: "start ", playArg: "", darwin: { path: [] }, linux: { path: [] }, win32: { path: [ '"C:\\Program Files (x86)\\MPC-BE x64\\mpc-be4.exe"', '"C:\\Program Files\\MPC-BE x64\\mpc-be64.exe"' ] } } }; devices.groups.external = [], Object.keys(players).forEach((function(el) { var player = players[el]; player[process.platform] && player[process.platform].path.forEach((function(p) { fs.existsSync(p.replace(/"/gi, "")) && devices.groups.external.push((function(player, platform) { var playerObj = players[player], platformObj = playerObj[platform]; return { name: playerObj.title, type: "external", id: player, onlyHtml5Formats: playerObj.onlyHtml5Formats, play: function(src) { var torrentUrl = src.match(/\/(?[0-9a-f]{40})\/(?[0-9]+)$/); if (torrentUrl) { var fileIdx = torrentUrl.groups.id, filename = enginefs.getFilename(torrentUrl.groups.ih, fileIdx); filename && (src = src.replace(new RegExp(fileIdx + "$"), encodeURIComponent(filename))); } var self = this; setTimeout((function() { var port = enginefs.baseUrl.match(".*?:([0-9]+)")[1], host = enginefs.baseUrl.match("^http://(.*):[0-9]+$")[1], subsPath = self.subtitlesSrc, time = self.time, subsFile = "", playExternal = function() { var playerPaths = platformObj.path.filter((function(path) { return fs.existsSync(path.replace(/"/gi, "")); })); if (playerPaths.length > 0) { var wrappedSrc = '"' + src + '"', subsCmd = subsFile && players[player].subArg && players[player].subArg.length > 0 ? players[player].subArg + subsFile : "", argsCmd = players[player].args && players[player].args.length > 0 ? players[player].args.join(" ") : "", timeCmd = players[player].timeArg && players[player].timeArg.length > 0 ? players[player].timeArg + parseInt(time / 1e3) : "", playCmd = players[player].playArg && players[player].playArg.length > 0 ? players[player].playArg + wrappedSrc : wrappedSrc, fullCmd = playerPaths[0] + " " + timeCmd + " " + argsCmd + " " + subsCmd + " " + playCmd; child.exec(fullCmd, (function(error) { console.error("Failed executing external player command:", error); })).on("exit", (function() { if (subsFile) try { fs.unlinkSync(subsFile); } catch (e) { console.error("Cannot remove the subtitles file:", e); } })); } }; subsPath ? (subsFile = path.join(os.tmpdir(), "stremio-" + player + "-subtitles.srt"), http.request({ host: host, path: "/subtitles.srt?from=" + encodeURIComponent(subsPath), port: port }, (function(response) { var data = ""; response.on("data", (function(d) { data += d.toString(); })), response.on("end", (function() { try { fs.writeFileSync(subsFile, data.toString()); } catch (e) { console.error("Cannot get the subtitles:", e), subsFile = ""; } playExternal(); })); })).end()) : playExternal(); }), 1500); } }; })(el, process.platform)); })); })), devices.groups.external.forEach((function(dev) { dev.usePlayerUI = !0, dev.stop = function() {}, dev.middleware = new stremioCast.Server(dev); })), devices.update(); }; }, function(module, exports, __webpack_require__) { module.exports = { Client: __webpack_require__(951), Server: __webpack_require__(952) }; }, function(module, exports, __webpack_require__) { var fetch = "undefined" != typeof window ? window.fetch : __webpack_require__(34), events = __webpack_require__(4), PROPS = [ "audio", "audioTrack", "volume", "time", "paused", "state", "length", "mediaSessionId", "subtitlesSrc", "subtitlesDelay", "subtitlesSize" ]; module.exports = function(url) { var self = new events.EventEmitter; self.initialized = !1; var status = {}, modified = {}, timer = null; function sync() { var p = fetch(url, { method: "POST", body: JSON.stringify(modified), headers: { "content-type": "application/json" } }); modified = {}, p.then((function(res) { return res.json(); })).then((function(resp) { var old, current; old = status, (current = status = resp).state === old.state && current.source === old.source && current.mediaSessionId === old.mediaSessionId || self.emit("statechanged", { state: current.state }), current.time !== old.time && self.emit("timeupdate", { time: current.time }), resetTimer(); })); } function resetTimer(t) { clearTimeout(timer), timer = self.source ? setTimeout(sync, t || 1e3) : null; } return PROPS.forEach((function(p) { Object.defineProperty(self, p, { get: function() { return modified.hasOwnProperty(p) ? modified[p] : status[p]; }, set: function(v) { modified[p] = v, resetTimer(50), "volume" === p && self.emit("volumechanged"); } }); })), self.play = function(src) { self.source = modified.source = src, resetTimer(50); }, self.stop = function() { self.source && (resetTimer(50), self.source = modified.source = null); }, self; }; }, function(module, exports) { var PROPS = [ "volume", "time", "paused", "state", "length", "source", "mediaSessionId", "subtitlesSrc", "subtitlesDelay", "subtitlesSize" ]; module.exports = function(player, manifest) { return function(req, res, next) { if (!req.body) return res.end(400); var modifications = req.body || {}; Object.keys(modifications).forEach((function(k) { "source" === k && (modifications.source ? player.play(modifications.source) : player.stop()), modifications[k] !== player[k] && (player[k] = modifications[k]); })), (function(next) { player.update ? player.update(next) : next(); })((function() { var status = {}; PROPS.forEach((function(k) { status[k] = player[k]; })), res.setHeader("content-type", "application/json"), res.end(JSON.stringify(status)); })); }; }; }, function(module, exports, __webpack_require__) { "use strict"; var EventEmitter = __webpack_require__(4), txt = __webpack_require__(954)(), MDNS = __webpack_require__(956); function MDNSDiscovery() { EventEmitter.call(this), this.MDNSServices = { "_googlecast._tcp.local": "chromecast" }, this.mdns = MDNS({ loopback: !0, reuseAddr: !0 }), this.mdns.on("response", this.onResponse.bind(this)), this.mdns.on("error", (function(e) { console.log("MDNS error", e); })); } __webpack_require__(0).inherits(MDNSDiscovery, EventEmitter), MDNSDiscovery.prototype.search = function() { for (var service in this.MDNSServices) this.mdns.query(service, "PTR"); }, MDNSDiscovery.prototype.propMap = function(res, item) { return res[item.type] = item.data, res; }, MDNSDiscovery.prototype.onResponse = function(response) { if (0 !== response.answers.length && void 0 !== this.MDNSServices[response.answers[0].name]) { var records = response.additionals.reduce(this.propMap, {}); if (response.answers.reduce(this.propMap, records), records.TXT && records.SRV) { var device = { facility: "MDNS", id: records.SRV.target.slice(0, records.SRV.target.indexOf(".local") >>> 0), name: txt.decode(records.TXT).fn || records.PTR.replace("." + response.answers[0].name, ""), host: records.A, location: records.A, type: this.MDNSServices[response.answers[0].name], icon: "chromecast", playerUIRoles: [ "playpause", "seek", "dub", "subtitles", "volume" ], usePlayerUI: !0, onlyHtml5Formats: !1 }; this.emit("device", device); } } }, module.exports = MDNSDiscovery; }, function(module, exports, __webpack_require__) { "use strict"; var bindexOf = __webpack_require__(955), equalSign = new Buffer("="); function decodeBlock(buf, offset) { var len = buf[offset], to = offset + 1 + len, b = buf.slice(offset + 1, to > buf.length ? buf.length : to); return decodeBlock.bytes = len + 1, b; } module.exports = function(opts) { var binary = !!opts && opts.binary, that = { encode: function(data, buf, offset) { data || (data = {}), offset || (offset = 0), buf || (buf = new Buffer(that.encodingLength(data) + offset)); var oldOffset = offset, keys = Object.keys(data); return 0 === keys.length && (buf[offset] = 0, offset++), keys.forEach((function(key) { var val = data[key], oldOffset = offset; if (offset++, !0 === val) offset += buf.write(key, offset); else if (Buffer.isBuffer(val)) { offset += buf.write(key + "=", offset); var len = val.length; val.copy(buf, offset, 0, len), offset += len; } else offset += buf.write(key + "=" + val, offset); buf[oldOffset] = offset - oldOffset - 1; })), that.encode.bytes = offset - oldOffset, buf; }, decode: function(buf, offset, len) { offset || (offset = 0), Number.isFinite(len) || (len = buf.length); for (var data = {}, oldOffset = offset; offset < len; ) { var b = decodeBlock(buf, offset), i = bindexOf(b, equalSign); if (offset += decodeBlock.bytes, 0 !== b.length) if (-1 === i) data[b.toString().toLowerCase()] = !0; else { if (0 === i) continue; var key = b.slice(0, i).toString().toLowerCase(); if (key in data) continue; data[key] = binary ? b.slice(i + 1) : b.slice(i + 1).toString(); } } return that.decode.bytes = offset - oldOffset, data; }, encodingLength: function(data) { if (!data) return 1; var keys = Object.keys(data); return 0 === keys.length ? 1 : keys.reduce((function(total, key) { var val = data[key]; return total += Buffer.byteLength(key) + 1, Buffer.isBuffer(val) ? total += val.length + 1 : !0 !== val && (total += Buffer.byteLength(String(val)) + 1), total; }), 0); } }; return that; }; }, function(module, exports) { module.exports = function(buff, search, offset, encoding) { if (!Buffer.isBuffer(buff)) throw TypeError("buffer is not a buffer"); if (void 0 === encoding && "string" == typeof offset && (encoding = offset, offset = void 0), "string" == typeof search) search = new Buffer(search, encoding || "utf8"); else if ("number" != typeof search || isNaN(search)) { if (!Buffer.isBuffer(search)) throw TypeError("search is not a bufferable object"); } else search = new Buffer([ search ]); if (0 === search.length) return -1; if (void 0 === offset || "number" == typeof offset && isNaN(offset)) offset = 0; else if ("number" != typeof offset) throw TypeError("offset is not a number"); offset < 0 && (offset = buff.length + offset), offset < 0 && (offset = 0); for (var m = 0, s = -1, i = offset; i < buff.length && (buff[i] != search[m] && (s = -1, i -= m - 1, m = 0), buff[i] != search[m] || (-1 == s && (s = i), ++m != search.length)); ++i) ; return s > -1 && buff.length - s < search.length ? -1 : s; }; }, function(module, exports, __webpack_require__) { var packet = __webpack_require__(957), dgram = __webpack_require__(79), thunky = __webpack_require__(961), events = __webpack_require__(4), os = __webpack_require__(23), noop = function() {}; module.exports = function(opts) { opts || (opts = {}); var that = new events.EventEmitter, port = "number" == typeof opts.port ? opts.port : 5353, type = opts.type || "udp4", ip = opts.ip || opts.host || ("udp4" === type ? "224.0.0.251" : null), me = { address: ip, port: port }, memberships = {}, destroyed = !1, interval = null; if (!("udp6" !== type || ip && opts.interface)) throw new Error("For IPv6 multicast you must specify `ip` and `interface`"); var socket = opts.socket || dgram.createSocket({ type: type, reuseAddr: !1 !== opts.reuseAddr, toString: function() { return type; } }); socket.on("error", (function(err) { "EACCES" === err.code || "EADDRINUSE" === err.code ? that.emit("error", err) : that.emit("warning", err); })), socket.on("message", (function(message, rinfo) { try { message = packet.decode(message); } catch (err) { return void that.emit("warning", err); } that.emit("packet", message, rinfo), "query" === message.type && that.emit("query", message, rinfo), "response" === message.type && that.emit("response", message, rinfo); })), socket.on("listening", (function() { port || (port = me.port = socket.address().port), !1 !== opts.multicast && (that.update(), interval = setInterval(that.update, 5e3), socket.setMulticastTTL(opts.ttl || 255), socket.setMulticastLoopback(!1 !== opts.loopback)); })); var bind = thunky((function(cb) { if (!port) return cb(null); socket.once("error", cb), socket.bind(port, opts.interface, (function() { socket.removeListener("error", cb), cb(null); })); })); return bind((function(err) { if (err) return that.emit("error", err); that.emit("ready"); })), that.send = function(value, rinfo, cb) { if ("function" == typeof rinfo) return that.send(value, null, rinfo); cb || (cb = noop), rinfo || (rinfo = me), bind((function(err) { if (destroyed) return cb(); if (err) return cb(err); var message = packet.encode(value); socket.send(message, 0, message.length, rinfo.port, rinfo.address || rinfo.host, cb); })); }, that.response = that.respond = function(res, rinfo, cb) { Array.isArray(res) && (res = { answers: res }), res.type = "response", res.flags = (res.flags || 0) | packet.AUTHORITATIVE_ANSWER, that.send(res, rinfo, cb); }, that.query = function(q, type, rinfo, cb) { return "function" == typeof type ? that.query(q, null, null, type) : "object" == typeof type && type && type.port ? that.query(q, null, type, rinfo) : "function" == typeof rinfo ? that.query(q, type, null, rinfo) : (cb || (cb = noop), "string" == typeof q && (q = [ { name: q, type: type || "ANY" } ]), Array.isArray(q) && (q = { type: "query", questions: q }), q.type = "query", void that.send(q, rinfo, cb)); }, that.destroy = function(cb) { if (cb || (cb = noop), destroyed) return process.nextTick(cb); destroyed = !0, clearInterval(interval), socket.once("close", cb), socket.close(); }, that.update = function() { for (var ifaces = opts.interface ? [].concat(opts.interface) : (function() { for (var networks = os.networkInterfaces(), names = Object.keys(networks), res = [], i = 0; i < names.length; i++) for (var net = networks[names[i]], j = 0; j < net.length; j++) { var iface = net[j]; if ("IPv4" === iface.family) { res.push(iface.address); break; } } return res; })(), updated = !1, i = 0; i < ifaces.length; i++) { var addr = ifaces[i]; if (!memberships[addr]) { memberships[addr] = !0, updated = !0; try { socket.addMembership(ip, addr); } catch (err) { that.emit("warning", err); } } } updated && socket.setMulticastInterface && socket.setMulticastInterface(opts.interface || (function() { for (var networks = os.networkInterfaces(), names = Object.keys(networks), i = 0; i < names.length; i++) for (var net = networks[names[i]], j = 0; j < net.length; j++) { var iface = net[j]; if ("IPv4" === iface.family && !iface.internal) return iface.address; } return "127.0.0.1"; })()); }, that; }; }, function(module, exports, __webpack_require__) { var types = __webpack_require__(958), rcodes = __webpack_require__(959), opcodes = __webpack_require__(960), ip = __webpack_require__(127), Buffer = __webpack_require__(26).Buffer, name = exports.txt = exports.name = {}; name.encode = function(str, buf, offset) { buf || (buf = Buffer.allocUnsafe(name.encodingLength(str))), offset || (offset = 0); var oldOffset = offset, n = str.replace(/^\.|\.$/gm, ""); if (n.length) for (var list = n.split("."), i = 0; i < list.length; i++) { var len = buf.write(list[i], offset + 1); buf[offset] = len, offset += len + 1; } return buf[offset++] = 0, name.encode.bytes = offset - oldOffset, buf; }, name.encode.bytes = 0, name.decode = function(buf, offset) { offset || (offset = 0); var list = [], oldOffset = offset, len = buf[offset++]; if (0 === len) return name.decode.bytes = 1, "."; if (len >= 192) { var res = name.decode(buf, buf.readUInt16BE(offset - 1) - 49152); return name.decode.bytes = 2, res; } for (;len; ) { if (len >= 192) { list.push(name.decode(buf, buf.readUInt16BE(offset - 1) - 49152)), offset++; break; } list.push(buf.toString("utf-8", offset, offset + len)), offset += len, len = buf[offset++]; } return name.decode.bytes = offset - oldOffset, list.join("."); }, name.decode.bytes = 0, name.encodingLength = function(n) { return Buffer.byteLength(n) + 2; }; var string = { encode: function(s, buf, offset) { buf || (buf = Buffer.allocUnsafe(string.encodingLength(s))), offset || (offset = 0); var len = buf.write(s, offset + 1); return buf[offset] = len, string.encode.bytes = len + 1, buf; } }; string.encode.bytes = 0, string.decode = function(buf, offset) { offset || (offset = 0); var len = buf[offset], s = buf.toString("utf-8", offset + 1, offset + 1 + len); return string.decode.bytes = len + 1, s; }, string.decode.bytes = 0, string.encodingLength = function(s) { return Buffer.byteLength(s) + 1; }; var header = { encode: function(h, buf, offset) { buf || (buf = header.encodingLength(h)), offset || (offset = 0); var flags = 32767 & (h.flags || 0), type = "response" === h.type ? 32768 : 0; return buf.writeUInt16BE(h.id || 0, offset), buf.writeUInt16BE(flags | type, offset + 2), buf.writeUInt16BE(h.questions.length, offset + 4), buf.writeUInt16BE(h.answers.length, offset + 6), buf.writeUInt16BE(h.authorities.length, offset + 8), buf.writeUInt16BE(h.additionals.length, offset + 10), buf; } }; header.encode.bytes = 12, header.decode = function(buf, offset) { if (offset || (offset = 0), buf.length < 12) throw new Error("Header must be 12 bytes"); var flags = buf.readUInt16BE(offset + 2); return { id: buf.readUInt16BE(offset), type: 32768 & flags ? "response" : "query", flags: 32767 & flags, flag_qr: 1 == (flags >> 15 & 1), opcode: opcodes.toString(flags >> 11 & 15), flag_auth: 1 == (flags >> 10 & 1), flag_trunc: 1 == (flags >> 9 & 1), flag_rd: 1 == (flags >> 8 & 1), flag_ra: 1 == (flags >> 7 & 1), flag_z: 1 == (flags >> 6 & 1), flag_ad: 1 == (flags >> 5 & 1), flag_cd: 1 == (flags >> 4 & 1), rcode: rcodes.toString(15 & flags), questions: new Array(buf.readUInt16BE(offset + 4)), answers: new Array(buf.readUInt16BE(offset + 6)), authorities: new Array(buf.readUInt16BE(offset + 8)), additionals: new Array(buf.readUInt16BE(offset + 10)) }; }, header.decode.bytes = 12, header.encodingLength = function() { return 12; }; var runknown = exports.unknown = {}; runknown.encode = function(data, buf, offset) { return buf || (buf = Buffer.allocUnsafe(runknown.encodingLength(data))), offset || (offset = 0), buf.writeUInt16BE(data.length, offset), data.copy(buf, offset + 2), runknown.encode.bytes = data.length + 2, buf; }, runknown.encode.bytes = 0, runknown.decode = function(buf, offset) { offset || (offset = 0); var len = buf.readUInt16BE(offset), data = buf.slice(offset + 2, offset + 2 + len); return runknown.decode.bytes = len + 2, data; }, runknown.decode.bytes = 0, runknown.encodingLength = function(data) { return data.length + 2; }; var rns = exports.ns = {}; rns.encode = function(data, buf, offset) { return buf || (buf = Buffer.allocUnsafe(rns.encodingLength(data))), offset || (offset = 0), name.encode(data, buf, offset + 2), buf.writeUInt16BE(name.encode.bytes, offset), rns.encode.bytes = name.encode.bytes + 2, buf; }, rns.encode.bytes = 0, rns.decode = function(buf, offset) { offset || (offset = 0); var len = buf.readUInt16BE(offset), dd = name.decode(buf, offset + 2); return rns.decode.bytes = len + 2, dd; }, rns.decode.bytes = 0, rns.encodingLength = function(data) { return name.encodingLength(data) + 2; }; var rsoa = exports.soa = {}; rsoa.encode = function(data, buf, offset) { buf || (buf = Buffer.allocUnsafe(rsoa.encodingLength(data))), offset || (offset = 0); var oldOffset = offset; return offset += 2, name.encode(data.mname, buf, offset), offset += name.encode.bytes, name.encode(data.rname, buf, offset), offset += name.encode.bytes, buf.writeUInt32BE(data.serial || 0, offset), offset += 4, buf.writeUInt32BE(data.refresh || 0, offset), offset += 4, buf.writeUInt32BE(data.retry || 0, offset), offset += 4, buf.writeUInt32BE(data.expire || 0, offset), offset += 4, buf.writeUInt32BE(data.minimum || 0, offset), offset += 4, buf.writeUInt16BE(offset - oldOffset - 2, oldOffset), rsoa.encode.bytes = offset - oldOffset, buf; }, rsoa.encode.bytes = 0, rsoa.decode = function(buf, offset) { offset || (offset = 0); var oldOffset = offset, data = {}; return offset += 2, data.mname = name.decode(buf, offset), offset += name.decode.bytes, data.rname = name.decode(buf, offset), offset += name.decode.bytes, data.serial = buf.readUInt32BE(offset), offset += 4, data.refresh = buf.readUInt32BE(offset), offset += 4, data.retry = buf.readUInt32BE(offset), offset += 4, data.expire = buf.readUInt32BE(offset), offset += 4, data.minimum = buf.readUInt32BE(offset), offset += 4, rsoa.decode.bytes = offset - oldOffset, data; }, rsoa.decode.bytes = 0, rsoa.encodingLength = function(data) { return 22 + name.encodingLength(data.mname) + name.encodingLength(data.rname); }; var rtxt = exports.txt = exports.null = {}, rnull = rtxt; rtxt.encode = function(data, buf, offset) { buf || (buf = Buffer.allocUnsafe(rtxt.encodingLength(data))), offset || (offset = 0), "string" == typeof data && (data = Buffer.from(data)), data || (data = Buffer.allocUnsafe(0)); var oldOffset = offset; offset += 2; var len = data.length; return data.copy(buf, offset, 0, len), offset += len, buf.writeUInt16BE(offset - oldOffset - 2, oldOffset), rtxt.encode.bytes = offset - oldOffset, buf; }, rtxt.encode.bytes = 0, rtxt.decode = function(buf, offset) { offset || (offset = 0); var oldOffset = offset, len = buf.readUInt16BE(offset); offset += 2; var data = buf.slice(offset, offset + len); return offset += len, rtxt.decode.bytes = offset - oldOffset, data; }, rtxt.decode.bytes = 0, rtxt.encodingLength = function(data) { return data ? (Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data)) + 2 : 2; }; var rhinfo = exports.hinfo = {}; rhinfo.encode = function(data, buf, offset) { buf || (buf = Buffer.allocUnsafe(rhinfo.encodingLength(data))), offset || (offset = 0); var oldOffset = offset; return offset += 2, string.encode(data.cpu, buf, offset), offset += string.encode.bytes, string.encode(data.os, buf, offset), offset += string.encode.bytes, buf.writeUInt16BE(offset - oldOffset - 2, oldOffset), rhinfo.encode.bytes = offset - oldOffset, buf; }, rhinfo.encode.bytes = 0, rhinfo.decode = function(buf, offset) { offset || (offset = 0); var oldOffset = offset, data = {}; return offset += 2, data.cpu = string.decode(buf, offset), offset += string.decode.bytes, data.os = string.decode(buf, offset), offset += string.decode.bytes, rhinfo.decode.bytes = offset - oldOffset, data; }, rhinfo.decode.bytes = 0, rhinfo.encodingLength = function(data) { return string.encodingLength(data.cpu) + string.encodingLength(data.os) + 2; }; var rptr = exports.ptr = {}, rcname = exports.cname = rptr, rdname = exports.dname = rptr; rptr.encode = function(data, buf, offset) { return buf || (buf = Buffer.allocUnsafe(rptr.encodingLength(data))), offset || (offset = 0), name.encode(data, buf, offset + 2), buf.writeUInt16BE(name.encode.bytes, offset), rptr.encode.bytes = name.encode.bytes + 2, buf; }, rptr.encode.bytes = 0, rptr.decode = function(buf, offset) { offset || (offset = 0); var data = name.decode(buf, offset + 2); return rptr.decode.bytes = name.decode.bytes + 2, data; }, rptr.decode.bytes = 0, rptr.encodingLength = function(data) { return name.encodingLength(data) + 2; }; var rsrv = exports.srv = {}; rsrv.encode = function(data, buf, offset) { buf || (buf = Buffer.allocUnsafe(rsrv.encodingLength(data))), offset || (offset = 0), buf.writeUInt16BE(data.priority || 0, offset + 2), buf.writeUInt16BE(data.weight || 0, offset + 4), buf.writeUInt16BE(data.port || 0, offset + 6), name.encode(data.target, buf, offset + 8); var len = name.encode.bytes + 6; return buf.writeUInt16BE(len, offset), rsrv.encode.bytes = len + 2, buf; }, rsrv.encode.bytes = 0, rsrv.decode = function(buf, offset) { offset || (offset = 0); var len = buf.readUInt16BE(offset), data = {}; return data.priority = buf.readUInt16BE(offset + 2), data.weight = buf.readUInt16BE(offset + 4), data.port = buf.readUInt16BE(offset + 6), data.target = name.decode(buf, offset + 8), rsrv.decode.bytes = len + 2, data; }, rsrv.decode.bytes = 0, rsrv.encodingLength = function(data) { return 8 + name.encodingLength(data.target); }; var rcaa = exports.caa = {}; rcaa.ISSUER_CRITICAL = 128, rcaa.encode = function(data, buf, offset) { var len = rcaa.encodingLength(data); return buf || (buf = Buffer.allocUnsafe(rcaa.encodingLength(data))), offset || (offset = 0), data.issuerCritical && (data.flags = rcaa.ISSUER_CRITICAL), buf.writeUInt16BE(len - 2, offset), offset += 2, buf.writeUInt8(data.flags || 0, offset), offset += 1, string.encode(data.tag, buf, offset), offset += string.encode.bytes, buf.write(data.value, offset), offset += Buffer.byteLength(data.value), rcaa.encode.bytes = len, buf; }, rcaa.encode.bytes = 0, rcaa.decode = function(buf, offset) { offset || (offset = 0); var len = buf.readUInt16BE(offset), oldOffset = offset += 2, data = {}; return data.flags = buf.readUInt8(offset), offset += 1, data.tag = string.decode(buf, offset), offset += string.decode.bytes, data.value = buf.toString("utf-8", offset, oldOffset + len), data.issuerCritical = !!(data.flags & rcaa.ISSUER_CRITICAL), rcaa.decode.bytes = len + 2, data; }, rcaa.decode.bytes = 0, rcaa.encodingLength = function(data) { return string.encodingLength(data.tag) + string.encodingLength(data.value) + 2; }; var ra = exports.a = {}; ra.encode = function(host, buf, offset) { return buf || (buf = Buffer.allocUnsafe(ra.encodingLength(host))), offset || (offset = 0), buf.writeUInt16BE(4, offset), offset += 2, ip.toBuffer(host, buf, offset), ra.encode.bytes = 6, buf; }, ra.encode.bytes = 0, ra.decode = function(buf, offset) { offset || (offset = 0), offset += 2; var host = ip.toString(buf, offset, 4); return ra.decode.bytes = 6, host; }, ra.decode.bytes = 0, ra.encodingLength = function() { return 6; }; var raaaa = exports.aaaa = {}; raaaa.encode = function(host, buf, offset) { return buf || (buf = Buffer.allocUnsafe(raaaa.encodingLength(host))), offset || (offset = 0), buf.writeUInt16BE(16, offset), offset += 2, ip.toBuffer(host, buf, offset), raaaa.encode.bytes = 18, buf; }, raaaa.encode.bytes = 0, raaaa.decode = function(buf, offset) { offset || (offset = 0), offset += 2; var host = ip.toString(buf, offset, 16); return raaaa.decode.bytes = 18, host; }, raaaa.decode.bytes = 0, raaaa.encodingLength = function() { return 18; }; var renc = exports.record = function(type) { switch (type.toUpperCase()) { case "A": return ra; case "PTR": return rptr; case "CNAME": return rcname; case "DNAME": return rdname; case "TXT": return rtxt; case "NULL": return rnull; case "AAAA": return raaaa; case "SRV": return rsrv; case "HINFO": return rhinfo; case "CAA": return rcaa; case "NS": return rns; case "SOA": return rsoa; } return runknown; }, answer = exports.answer = {}; answer.encode = function(a, buf, offset) { buf || (buf = Buffer.allocUnsafe(answer.encodingLength(a))), offset || (offset = 0); var oldOffset = offset; name.encode(a.name, buf, offset), offset += name.encode.bytes, buf.writeUInt16BE(types.toType(a.type), offset); var klass = void 0 === a.class ? 1 : a.class; a.flush && (klass |= 32768), buf.writeUInt16BE(klass, offset + 2), buf.writeUInt32BE(a.ttl || 0, offset + 4); var enc = renc(a.type); return enc.encode(a.data, buf, offset + 8), offset += 8 + enc.encode.bytes, answer.encode.bytes = offset - oldOffset, buf; }, answer.encode.bytes = 0, answer.decode = function(buf, offset) { offset || (offset = 0); var a = {}, oldOffset = offset; a.name = name.decode(buf, offset), offset += name.decode.bytes, a.type = types.toString(buf.readUInt16BE(offset)), a.class = buf.readUInt16BE(offset + 2), a.ttl = buf.readUInt32BE(offset + 4), a.flush = !!(32768 & a.class), a.flush && (a.class &= -32769); var enc = renc(a.type); return a.data = enc.decode(buf, offset + 8), offset += 8 + enc.decode.bytes, answer.decode.bytes = offset - oldOffset, a; }, answer.decode.bytes = 0, answer.encodingLength = function(a) { return name.encodingLength(a.name) + 8 + renc(a.type).encodingLength(a.data); }; var question = exports.question = {}; function encodingLengthList(list, enc) { for (var len = 0, i = 0; i < list.length; i++) len += enc.encodingLength(list[i]); return len; } function encodeList(list, enc, buf, offset) { for (var i = 0; i < list.length; i++) enc.encode(list[i], buf, offset), offset += enc.encode.bytes; return offset; } function decodeList(list, enc, buf, offset) { for (var i = 0; i < list.length; i++) list[i] = enc.decode(buf, offset), offset += enc.decode.bytes; return offset; } question.encode = function(q, buf, offset) { buf || (buf = Buffer.allocUnsafe(question.encodingLength(q))), offset || (offset = 0); var oldOffset = offset; return name.encode(q.name, buf, offset), offset += name.encode.bytes, buf.writeUInt16BE(types.toType(q.type), offset), offset += 2, buf.writeUInt16BE(void 0 === q.class ? 1 : q.class, offset), offset += 2, question.encode.bytes = offset - oldOffset, q; }, question.encode.bytes = 0, question.decode = function(buf, offset) { offset || (offset = 0); var oldOffset = offset, q = {}; return q.name = name.decode(buf, offset), offset += name.decode.bytes, q.type = types.toString(buf.readUInt16BE(offset)), offset += 2, q.class = buf.readUInt16BE(offset), offset += 2, !!(32768 & q.class) && (q.class &= -32769), question.decode.bytes = offset - oldOffset, q; }, question.decode.bytes = 0, question.encodingLength = function(q) { return name.encodingLength(q.name) + 4; }, exports.AUTHORITATIVE_ANSWER = 1024, exports.TRUNCATED_RESPONSE = 512, exports.RECURSION_DESIRED = 256, exports.RECURSION_AVAILABLE = 128, exports.AUTHENTIC_DATA = 32, exports.CHECKING_DISABLED = 16, exports.encode = function(result, buf, offset) { buf || (buf = Buffer.allocUnsafe(exports.encodingLength(result))), offset || (offset = 0); var oldOffset = offset; return result.questions || (result.questions = []), result.answers || (result.answers = []), result.authorities || (result.authorities = []), result.additionals || (result.additionals = []), header.encode(result, buf, offset), offset += header.encode.bytes, offset = encodeList(result.questions, question, buf, offset), offset = encodeList(result.answers, answer, buf, offset), offset = encodeList(result.authorities, answer, buf, offset), offset = encodeList(result.additionals, answer, buf, offset), exports.encode.bytes = offset - oldOffset, buf; }, exports.encode.bytes = 0, exports.decode = function(buf, offset) { offset || (offset = 0); var oldOffset = offset, result = header.decode(buf, offset); return offset += header.decode.bytes, offset = decodeList(result.questions, question, buf, offset), offset = decodeList(result.answers, answer, buf, offset), offset = decodeList(result.authorities, answer, buf, offset), offset = decodeList(result.additionals, answer, buf, offset), exports.decode.bytes = offset - oldOffset, result; }, exports.decode.bytes = 0, exports.encodingLength = function(result) { return header.encodingLength(result) + encodingLengthList(result.questions || [], question) + encodingLengthList(result.answers || [], answer) + encodingLengthList(result.authorities || [], answer) + encodingLengthList(result.additionals || [], answer); }; }, function(module, exports) { exports.toString = function(type) { switch (type) { case 1: return "A"; case 10: return "NULL"; case 28: return "AAAA"; case 18: return "AFSDB"; case 42: return "APL"; case 257: return "CAA"; case 60: return "CDNSKEY"; case 59: return "CDS"; case 37: return "CERT"; case 5: return "CNAME"; case 49: return "DHCID"; case 32769: return "DLV"; case 39: return "DNAME"; case 48: return "DNSKEY"; case 43: return "DS"; case 55: return "HIP"; case 13: return "HINFO"; case 45: return "IPSECKEY"; case 25: return "KEY"; case 36: return "KX"; case 29: return "LOC"; case 15: return "MX"; case 35: return "NAPTR"; case 2: return "NS"; case 47: return "NSEC"; case 50: return "NSEC3"; case 51: return "NSEC3PARAM"; case 12: return "PTR"; case 46: return "RRSIG"; case 17: return "RP"; case 24: return "SIG"; case 6: return "SOA"; case 99: return "SPF"; case 33: return "SRV"; case 44: return "SSHFP"; case 32768: return "TA"; case 249: return "TKEY"; case 52: return "TLSA"; case 250: return "TSIG"; case 16: return "TXT"; case 252: return "AXFR"; case 251: return "IXFR"; case 41: return "OPT"; case 255: return "ANY"; } return "UNKNOWN_" + type; }, exports.toType = function(name) { switch (name.toUpperCase()) { case "A": return 1; case "NULL": return 10; case "AAAA": return 28; case "AFSDB": return 18; case "APL": return 42; case "CAA": return 257; case "CDNSKEY": return 60; case "CDS": return 59; case "CERT": return 37; case "CNAME": return 5; case "DHCID": return 49; case "DLV": return 32769; case "DNAME": return 39; case "DNSKEY": return 48; case "DS": return 43; case "HIP": return 55; case "HINFO": return 13; case "IPSECKEY": return 45; case "KEY": return 25; case "KX": return 36; case "LOC": return 29; case "MX": return 15; case "NAPTR": return 35; case "NS": return 2; case "NSEC": return 47; case "NSEC3": return 50; case "NSEC3PARAM": return 51; case "PTR": return 12; case "RRSIG": return 46; case "RP": return 17; case "SIG": return 24; case "SOA": return 6; case "SPF": return 99; case "SRV": return 33; case "SSHFP": return 44; case "TA": return 32768; case "TKEY": return 249; case "TLSA": return 52; case "TSIG": return 250; case "TXT": return 16; case "AXFR": return 252; case "IXFR": return 251; case "OPT": return 41; case "ANY": case "*": return 255; } return 0; }; }, function(module, exports) { exports.toString = function(rcode) { switch (rcode) { case 0: return "NOERROR"; case 1: return "FORMERR"; case 2: return "SERVFAIL"; case 3: return "NXDOMAIN"; case 4: return "NOTIMP"; case 5: return "REFUSED"; case 6: return "YXDOMAIN"; case 7: return "YXRRSET"; case 8: return "NXRRSET"; case 9: return "NOTAUTH"; case 10: return "NOTZONE"; case 11: return "RCODE_11"; case 12: return "RCODE_12"; case 13: return "RCODE_13"; case 14: return "RCODE_14"; case 15: return "RCODE_15"; } return "RCODE_" + rcode; }, exports.toRcode = function(code) { switch (code.toUpperCase()) { case "NOERROR": return 0; case "FORMERR": return 1; case "SERVFAIL": return 2; case "NXDOMAIN": return 3; case "NOTIMP": return 4; case "REFUSED": return 5; case "YXDOMAIN": return 6; case "YXRRSET": return 7; case "NXRRSET": return 8; case "NOTAUTH": return 9; case "NOTZONE": return 10; case "RCODE_11": return 11; case "RCODE_12": return 12; case "RCODE_13": return 13; case "RCODE_14": return 14; case "RCODE_15": return 15; } return 0; }; }, function(module, exports) { exports.toString = function(opcode) { switch (opcode) { case 0: return "QUERY"; case 1: return "IQUERY"; case 2: return "STATUS"; case 3: return "OPCODE_3"; case 4: return "NOTIFY"; case 5: return "UPDATE"; case 6: return "OPCODE_6"; case 7: return "OPCODE_7"; case 8: return "OPCODE_8"; case 9: return "OPCODE_9"; case 10: return "OPCODE_10"; case 11: return "OPCODE_11"; case 12: return "OPCODE_12"; case 13: return "OPCODE_13"; case 14: return "OPCODE_14"; case 15: return "OPCODE_15"; } return "OPCODE_" + opcode; }, exports.toOpcode = function(code) { switch (code.toUpperCase()) { case "QUERY": return 0; case "IQUERY": return 1; case "STATUS": return 2; case "OPCODE_3": return 3; case "NOTIFY": return 4; case "UPDATE": return 5; case "OPCODE_6": return 6; case "OPCODE_7": return 7; case "OPCODE_8": return 8; case "OPCODE_9": return 9; case "OPCODE_10": return 10; case "OPCODE_11": return 11; case "OPCODE_12": return 12; case "OPCODE_13": return 13; case "OPCODE_14": return 14; case "OPCODE_15": return 15; } return 0; }; }, function(module, exports, __webpack_require__) { "use strict"; var nextTick = function(fn, a, b) { process.nextTick((function() { fn(a, b); })); }; function isError(err) { return "[object Error]" === Object.prototype.toString.call(err); } function noop() {} function apply(callback, args) { callback.apply(null, args); } process.nextTick((function(val) { 42 === val && (nextTick = process.nextTick); }), 42), module.exports = function(fn) { var state = function run(callback) { var stack = [ callback ]; state = function(callback) { stack.push(callback); }, fn((function(err) { var args = arguments; for (state = isError(err) ? run : finished; stack.length; ) finished(stack.shift()); function finished(callback) { nextTick(apply, callback, args); } })); }; return function(callback) { state(callback || noop); }; }; }, function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(7), EventEmitter = __webpack_require__(4), parseXML = __webpack_require__(234).promisify(__webpack_require__(188).parseString), fetch = __webpack_require__(34), SSDP = __webpack_require__(993).Client; function SSDPDiscovery() { EventEmitter.call(this), this.SSDPServices = { "urn:dial-multiscreen-org:device:dial:1": "chromecast", "urn:schemas-upnp-org:device:MediaRenderer:1": "tv" }, this.ssdp = new SSDP, this.ssdp.on("response", this.handleResponse.bind(this)), this.ssdp.on("error", (function(err) { console.log("SSDP error:", err); })); } __webpack_require__(0).inherits(SSDPDiscovery, EventEmitter), SSDPDiscovery.prototype.search = function() { for (var service in this.SSDPServices) this.ssdp.browse(service); }, SSDPDiscovery.prototype.normalizeObject = function(location, ssdpData) { try { if (!this.SSDPServices[ssdpData.root.device[0].deviceType[0]]) return; var device = { facility: "SSDP", id: ssdpData.root.device[0].UDN[0].slice(5), name: ssdpData.root.device[0].friendlyName[0], host: url.parse(location).hostname, location: location, type: this.SSDPServices[ssdpData.root.device[0].deviceType[0]], icon: this.SSDPServices[ssdpData.root.device[0].deviceType[0]], playerUIRoles: [ "playpause", "seek", "dub", "subtitles", "volume" ], usePlayerUI: !0, onlyHtml5Formats: !1 }; this.emit("device", device); } catch (e) { console.log("SSDP Parse error", e.toString(), ssdpData.root.device); } }, SSDPDiscovery.prototype.handleResponse = function(response) { var location = response.headers.LOCATION; location && fetch(location).then((function(res) { return res.text(); })).then(parseXML).then(this.normalizeObject.bind(this, location)).catch((function(err) { console.log("SSDP Location error:", err); })); }, module.exports = SSDPDiscovery; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function() { var makeSelfResolutionError = function() { return new TypeError("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n"); }, reflectHandler = function() { return new Promise.PromiseInspection(this._target()); }, apiRejection = function(msg) { return Promise.reject(new TypeError(msg)); }; function Proxyable() {} var getDomain, UNDEFINED_BINDING = {}, util = __webpack_require__(16); getDomain = util.isNode ? function() { var ret = process.domain; return void 0 === ret && (ret = null), ret; } : function() { return null; }, util.notEnumerableProp(Promise, "_getDomain", getDomain); var es5 = __webpack_require__(75), Async = __webpack_require__(964), async = new Async; es5.defineProperty(Promise, "_async", { value: async }); var errors = __webpack_require__(60), TypeError = Promise.TypeError = errors.TypeError; Promise.RangeError = errors.RangeError; var CancellationError = Promise.CancellationError = errors.CancellationError; Promise.TimeoutError = errors.TimeoutError, Promise.OperationalError = errors.OperationalError, Promise.RejectionError = errors.OperationalError, Promise.AggregateError = errors.AggregateError; var INTERNAL = function() {}, APPLY = {}, NEXT_FILTER = {}, tryConvertToPromise = __webpack_require__(967)(Promise, INTERNAL), PromiseArray = __webpack_require__(968)(Promise, INTERNAL, tryConvertToPromise, apiRejection, Proxyable), Context = __webpack_require__(969)(Promise), createContext = Context.create, debug = __webpack_require__(970)(Promise, Context), PassThroughHandlerContext = (debug.CapturedTrace, __webpack_require__(971)(Promise, tryConvertToPromise, NEXT_FILTER)), catchFilter = __webpack_require__(476)(NEXT_FILTER), nodebackForPromise = __webpack_require__(477), errorObj = util.errorObj, tryCatch = util.tryCatch; function Promise(executor) { executor !== INTERNAL && (function(self, executor) { if (null == self || self.constructor !== Promise) throw new TypeError("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n"); if ("function" != typeof executor) throw new TypeError("expecting a function but got " + util.classString(executor)); })(this, executor), this._bitField = 0, this._fulfillmentHandler0 = void 0, this._rejectionHandler0 = void 0, this._promise0 = void 0, this._receiver0 = void 0, this._resolveFromExecutor(executor), this._promiseCreated(), this._fireEvent("promiseCreated", this); } function deferResolve(v) { this.promise._resolveCallback(v); } function deferReject(v) { this.promise._rejectCallback(v, !1); } function fillTypes(value) { var p = new Promise(INTERNAL); p._fulfillmentHandler0 = value, p._rejectionHandler0 = value, p._promise0 = value, p._receiver0 = value; } return Promise.prototype.toString = function() { return "[object Promise]"; }, Promise.prototype.caught = Promise.prototype.catch = function(fn) { var len = arguments.length; if (len > 1) { var i, catchInstances = new Array(len - 1), j = 0; for (i = 0; i < len - 1; ++i) { var item = arguments[i]; if (!util.isObject(item)) return apiRejection("Catch statement predicate: expecting an object but got " + util.classString(item)); catchInstances[j++] = item; } if (catchInstances.length = j, "function" != typeof (fn = arguments[i])) throw new TypeError("The last argument to .catch() must be a function, got " + util.toString(fn)); return this.then(void 0, catchFilter(catchInstances, fn, this)); } return this.then(void 0, fn); }, Promise.prototype.reflect = function() { return this._then(reflectHandler, reflectHandler, void 0, this, void 0); }, Promise.prototype.then = function(didFulfill, didReject) { if (debug.warnings() && arguments.length > 0 && "function" != typeof didFulfill && "function" != typeof didReject) { var msg = ".then() only accepts functions but was passed: " + util.classString(didFulfill); arguments.length > 1 && (msg += ", " + util.classString(didReject)), this._warn(msg); } return this._then(didFulfill, didReject, void 0, void 0, void 0); }, Promise.prototype.done = function(didFulfill, didReject) { this._then(didFulfill, didReject, void 0, void 0, void 0)._setIsFinal(); }, Promise.prototype.spread = function(fn) { return "function" != typeof fn ? apiRejection("expecting a function but got " + util.classString(fn)) : this.all()._then(fn, void 0, void 0, APPLY, void 0); }, Promise.prototype.toJSON = function() { var ret = { isFulfilled: !1, isRejected: !1, fulfillmentValue: void 0, rejectionReason: void 0 }; return this.isFulfilled() ? (ret.fulfillmentValue = this.value(), ret.isFulfilled = !0) : this.isRejected() && (ret.rejectionReason = this.reason(), ret.isRejected = !0), ret; }, Promise.prototype.all = function() { return arguments.length > 0 && this._warn(".all() was passed arguments but it does not take any"), new PromiseArray(this).promise(); }, Promise.prototype.error = function(fn) { return this.caught(util.originatesFromRejection, fn); }, Promise.getNewLibraryCopy = module.exports, Promise.is = function(val) { return val instanceof Promise; }, Promise.fromNode = Promise.fromCallback = function(fn) { var ret = new Promise(INTERNAL); ret._captureStackTrace(); var multiArgs = arguments.length > 1 && !!Object(arguments[1]).multiArgs, result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); return result === errorObj && ret._rejectCallback(result.e, !0), ret._isFateSealed() || ret._setAsyncGuaranteed(), ret; }, Promise.all = function(promises) { return new PromiseArray(promises).promise(); }, Promise.cast = function(obj) { var ret = tryConvertToPromise(obj); return ret instanceof Promise || ((ret = new Promise(INTERNAL))._captureStackTrace(), ret._setFulfilled(), ret._rejectionHandler0 = obj), ret; }, Promise.resolve = Promise.fulfilled = Promise.cast, Promise.reject = Promise.rejected = function(reason) { var ret = new Promise(INTERNAL); return ret._captureStackTrace(), ret._rejectCallback(reason, !0), ret; }, Promise.setScheduler = function(fn) { if ("function" != typeof fn) throw new TypeError("expecting a function but got " + util.classString(fn)); return async.setScheduler(fn); }, Promise.prototype._then = function(didFulfill, didReject, _, receiver, internalData) { var haveInternalData = void 0 !== internalData, promise = haveInternalData ? internalData : new Promise(INTERNAL), target = this._target(), bitField = target._bitField; haveInternalData || (promise._propagateFrom(this, 3), promise._captureStackTrace(), void 0 === receiver && 0 != (2097152 & this._bitField) && (receiver = 0 != (50397184 & bitField) ? this._boundValue() : target === this ? void 0 : this._boundTo), this._fireEvent("promiseChained", this, promise)); var domain = getDomain(); if (0 != (50397184 & bitField)) { var handler, value, settler = target._settlePromiseCtx; 0 != (33554432 & bitField) ? (value = target._rejectionHandler0, handler = didFulfill) : 0 != (16777216 & bitField) ? (value = target._fulfillmentHandler0, handler = didReject, target._unsetRejectionIsUnhandled()) : (settler = target._settlePromiseLateCancellationObserver, value = new CancellationError("late cancellation observer"), target._attachExtraTrace(value), handler = didReject), async.invoke(settler, target, { handler: null === domain ? handler : "function" == typeof handler && util.domainBind(domain, handler), promise: promise, receiver: receiver, value: value }); } else target._addCallbacks(didFulfill, didReject, promise, receiver, domain); return promise; }, Promise.prototype._length = function() { return 65535 & this._bitField; }, Promise.prototype._isFateSealed = function() { return 0 != (117506048 & this._bitField); }, Promise.prototype._isFollowing = function() { return 67108864 == (67108864 & this._bitField); }, Promise.prototype._setLength = function(len) { this._bitField = -65536 & this._bitField | 65535 & len; }, Promise.prototype._setFulfilled = function() { this._bitField = 33554432 | this._bitField, this._fireEvent("promiseFulfilled", this); }, Promise.prototype._setRejected = function() { this._bitField = 16777216 | this._bitField, this._fireEvent("promiseRejected", this); }, Promise.prototype._setFollowing = function() { this._bitField = 67108864 | this._bitField, this._fireEvent("promiseResolved", this); }, Promise.prototype._setIsFinal = function() { this._bitField = 4194304 | this._bitField; }, Promise.prototype._isFinal = function() { return (4194304 & this._bitField) > 0; }, Promise.prototype._unsetCancelled = function() { this._bitField = -65537 & this._bitField; }, Promise.prototype._setCancelled = function() { this._bitField = 65536 | this._bitField, this._fireEvent("promiseCancelled", this); }, Promise.prototype._setWillBeCancelled = function() { this._bitField = 8388608 | this._bitField; }, Promise.prototype._setAsyncGuaranteed = function() { async.hasCustomScheduler() || (this._bitField = 134217728 | this._bitField); }, Promise.prototype._receiverAt = function(index) { var ret = 0 === index ? this._receiver0 : this[4 * index - 4 + 3]; if (ret !== UNDEFINED_BINDING) return void 0 === ret && this._isBound() ? this._boundValue() : ret; }, Promise.prototype._promiseAt = function(index) { return this[4 * index - 4 + 2]; }, Promise.prototype._fulfillmentHandlerAt = function(index) { return this[4 * index - 4 + 0]; }, Promise.prototype._rejectionHandlerAt = function(index) { return this[4 * index - 4 + 1]; }, Promise.prototype._boundValue = function() {}, Promise.prototype._migrateCallback0 = function(follower) { follower._bitField; var fulfill = follower._fulfillmentHandler0, reject = follower._rejectionHandler0, promise = follower._promise0, receiver = follower._receiverAt(0); void 0 === receiver && (receiver = UNDEFINED_BINDING), this._addCallbacks(fulfill, reject, promise, receiver, null); }, Promise.prototype._migrateCallbackAt = function(follower, index) { var fulfill = follower._fulfillmentHandlerAt(index), reject = follower._rejectionHandlerAt(index), promise = follower._promiseAt(index), receiver = follower._receiverAt(index); void 0 === receiver && (receiver = UNDEFINED_BINDING), this._addCallbacks(fulfill, reject, promise, receiver, null); }, Promise.prototype._addCallbacks = function(fulfill, reject, promise, receiver, domain) { var index = this._length(); if (index >= 65531 && (index = 0, this._setLength(0)), 0 === index) this._promise0 = promise, this._receiver0 = receiver, "function" == typeof fulfill && (this._fulfillmentHandler0 = null === domain ? fulfill : util.domainBind(domain, fulfill)), "function" == typeof reject && (this._rejectionHandler0 = null === domain ? reject : util.domainBind(domain, reject)); else { var base = 4 * index - 4; this[base + 2] = promise, this[base + 3] = receiver, "function" == typeof fulfill && (this[base + 0] = null === domain ? fulfill : util.domainBind(domain, fulfill)), "function" == typeof reject && (this[base + 1] = null === domain ? reject : util.domainBind(domain, reject)); } return this._setLength(index + 1), index; }, Promise.prototype._proxy = function(proxyable, arg) { this._addCallbacks(void 0, void 0, arg, proxyable, null); }, Promise.prototype._resolveCallback = function(value, shouldBind) { if (0 == (117506048 & this._bitField)) { if (value === this) return this._rejectCallback(makeSelfResolutionError(), !1); var maybePromise = tryConvertToPromise(value, this); if (!(maybePromise instanceof Promise)) return this._fulfill(value); shouldBind && this._propagateFrom(maybePromise, 2); var promise = maybePromise._target(); if (promise !== this) { var bitField = promise._bitField; if (0 == (50397184 & bitField)) { var len = this._length(); len > 0 && promise._migrateCallback0(this); for (var i = 1; i < len; ++i) promise._migrateCallbackAt(this, i); this._setFollowing(), this._setLength(0), this._setFollowee(promise); } else if (0 != (33554432 & bitField)) this._fulfill(promise._value()); else if (0 != (16777216 & bitField)) this._reject(promise._reason()); else { var reason = new CancellationError("late cancellation observer"); promise._attachExtraTrace(reason), this._reject(reason); } } else this._reject(makeSelfResolutionError()); } }, Promise.prototype._rejectCallback = function(reason, synchronous, ignoreNonErrorWarnings) { var trace = util.ensureErrorObject(reason), hasStack = trace === reason; if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { var message = "a promise was rejected with a non-error: " + util.classString(reason); this._warn(message, !0); } this._attachExtraTrace(trace, !!synchronous && hasStack), this._reject(reason); }, Promise.prototype._resolveFromExecutor = function(executor) { if (executor !== INTERNAL) { var promise = this; this._captureStackTrace(), this._pushContext(); var synchronous = !0, r = this._execute(executor, (function(value) { promise._resolveCallback(value); }), (function(reason) { promise._rejectCallback(reason, synchronous); })); synchronous = !1, this._popContext(), void 0 !== r && promise._rejectCallback(r, !0); } }, Promise.prototype._settlePromiseFromHandler = function(handler, receiver, value, promise) { var bitField = promise._bitField; if (0 == (65536 & bitField)) { var x; promise._pushContext(), receiver === APPLY ? value && "number" == typeof value.length ? x = tryCatch(handler).apply(this._boundValue(), value) : (x = errorObj).e = new TypeError("cannot .spread() a non-array: " + util.classString(value)) : x = tryCatch(handler).call(receiver, value); var promiseCreated = promise._popContext(); 0 == (65536 & (bitField = promise._bitField)) && (x === NEXT_FILTER ? promise._reject(value) : x === errorObj ? promise._rejectCallback(x.e, !1) : (debug.checkForgottenReturns(x, promiseCreated, "", promise, this), promise._resolveCallback(x))); } }, Promise.prototype._target = function() { for (var ret = this; ret._isFollowing(); ) ret = ret._followee(); return ret; }, Promise.prototype._followee = function() { return this._rejectionHandler0; }, Promise.prototype._setFollowee = function(promise) { this._rejectionHandler0 = promise; }, Promise.prototype._settlePromise = function(promise, handler, receiver, value) { var isPromise = promise instanceof Promise, bitField = this._bitField, asyncGuaranteed = 0 != (134217728 & bitField); 0 != (65536 & bitField) ? (isPromise && promise._invokeInternalOnCancel(), receiver instanceof PassThroughHandlerContext && receiver.isFinallyHandler() ? (receiver.cancelPromise = promise, tryCatch(handler).call(receiver, value) === errorObj && promise._reject(errorObj.e)) : handler === reflectHandler ? promise._fulfill(reflectHandler.call(receiver)) : receiver instanceof Proxyable ? receiver._promiseCancelled(promise) : isPromise || promise instanceof PromiseArray ? promise._cancel() : receiver.cancel()) : "function" == typeof handler ? isPromise ? (asyncGuaranteed && promise._setAsyncGuaranteed(), this._settlePromiseFromHandler(handler, receiver, value, promise)) : handler.call(receiver, value, promise) : receiver instanceof Proxyable ? receiver._isResolved() || (0 != (33554432 & bitField) ? receiver._promiseFulfilled(value, promise) : receiver._promiseRejected(value, promise)) : isPromise && (asyncGuaranteed && promise._setAsyncGuaranteed(), 0 != (33554432 & bitField) ? promise._fulfill(value) : promise._reject(value)); }, Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { var handler = ctx.handler, promise = ctx.promise, receiver = ctx.receiver, value = ctx.value; "function" == typeof handler ? promise instanceof Promise ? this._settlePromiseFromHandler(handler, receiver, value, promise) : handler.call(receiver, value, promise) : promise instanceof Promise && promise._reject(value); }, Promise.prototype._settlePromiseCtx = function(ctx) { this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); }, Promise.prototype._settlePromise0 = function(handler, value, bitField) { var promise = this._promise0, receiver = this._receiverAt(0); this._promise0 = void 0, this._receiver0 = void 0, this._settlePromise(promise, handler, receiver, value); }, Promise.prototype._clearCallbackDataAtIndex = function(index) { var base = 4 * index - 4; this[base + 2] = this[base + 3] = this[base + 0] = this[base + 1] = void 0; }, Promise.prototype._fulfill = function(value) { var bitField = this._bitField; if (!((117506048 & bitField) >>> 16)) { if (value === this) { var err = makeSelfResolutionError(); return this._attachExtraTrace(err), this._reject(err); } this._setFulfilled(), this._rejectionHandler0 = value, (65535 & bitField) > 0 && (0 != (134217728 & bitField) ? this._settlePromises() : async.settlePromises(this), this._dereferenceTrace()); } }, Promise.prototype._reject = function(reason) { var bitField = this._bitField; if (!((117506048 & bitField) >>> 16)) { if (this._setRejected(), this._fulfillmentHandler0 = reason, this._isFinal()) return async.fatalError(reason, util.isNode); (65535 & bitField) > 0 ? async.settlePromises(this) : this._ensurePossibleRejectionHandled(); } }, Promise.prototype._fulfillPromises = function(len, value) { for (var i = 1; i < len; i++) { var handler = this._fulfillmentHandlerAt(i), promise = this._promiseAt(i), receiver = this._receiverAt(i); this._clearCallbackDataAtIndex(i), this._settlePromise(promise, handler, receiver, value); } }, Promise.prototype._rejectPromises = function(len, reason) { for (var i = 1; i < len; i++) { var handler = this._rejectionHandlerAt(i), promise = this._promiseAt(i), receiver = this._receiverAt(i); this._clearCallbackDataAtIndex(i), this._settlePromise(promise, handler, receiver, reason); } }, Promise.prototype._settlePromises = function() { var bitField = this._bitField, len = 65535 & bitField; if (len > 0) { if (0 != (16842752 & bitField)) { var reason = this._fulfillmentHandler0; this._settlePromise0(this._rejectionHandler0, reason, bitField), this._rejectPromises(len, reason); } else { var value = this._rejectionHandler0; this._settlePromise0(this._fulfillmentHandler0, value, bitField), this._fulfillPromises(len, value); } this._setLength(0); } this._clearCancellationData(); }, Promise.prototype._settledValue = function() { var bitField = this._bitField; return 0 != (33554432 & bitField) ? this._rejectionHandler0 : 0 != (16777216 & bitField) ? this._fulfillmentHandler0 : void 0; }, "undefined" != typeof Symbol && Symbol.toStringTag && es5.defineProperty(Promise.prototype, Symbol.toStringTag, { get: function() { return "Object"; } }), Promise.defer = Promise.pending = function() { return debug.deprecated("Promise.defer", "new Promise"), { promise: new Promise(INTERNAL), resolve: deferResolve, reject: deferReject }; }, util.notEnumerableProp(Promise, "_makeSelfResolutionError", makeSelfResolutionError), __webpack_require__(972)(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug), __webpack_require__(973)(Promise, INTERNAL, tryConvertToPromise, debug), __webpack_require__(974)(Promise, PromiseArray, apiRejection, debug), __webpack_require__(975)(Promise), __webpack_require__(976)(Promise), __webpack_require__(977)(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain), Promise.Promise = Promise, Promise.version = "3.5.5", __webpack_require__(978)(Promise), __webpack_require__(979)(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug), __webpack_require__(980)(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug), __webpack_require__(981)(Promise), __webpack_require__(982)(Promise, INTERNAL), __webpack_require__(983)(Promise, PromiseArray, tryConvertToPromise, apiRejection), __webpack_require__(984)(Promise, INTERNAL, tryConvertToPromise, apiRejection), __webpack_require__(985)(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug), __webpack_require__(986)(Promise, PromiseArray, debug), __webpack_require__(987)(Promise, PromiseArray, apiRejection), __webpack_require__(988)(Promise, INTERNAL, debug), __webpack_require__(989)(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug), __webpack_require__(990)(Promise), __webpack_require__(991)(Promise, INTERNAL), __webpack_require__(992)(Promise, INTERNAL), util.toFastProperties(Promise), util.toFastProperties(Promise.prototype), fillTypes({ a: 1 }), fillTypes({ b: 2 }), fillTypes({ c: 3 }), fillTypes(1), fillTypes((function() {})), fillTypes(void 0), fillTypes(!1), fillTypes(new Promise(INTERNAL)), debug.setBounds(Async.firstLineError, util.lastLineError), Promise; }; }, function(module, exports, __webpack_require__) { "use strict"; var firstLineError; try { throw new Error; } catch (e) { firstLineError = e; } var schedule = __webpack_require__(965), Queue = __webpack_require__(966), util = __webpack_require__(16); function Async() { this._customScheduler = !1, this._isTickUsed = !1, this._lateQueue = new Queue(16), this._normalQueue = new Queue(16), this._haveDrainedQueues = !1, this._trampolineEnabled = !0; var self = this; this.drainQueues = function() { self._drainQueues(); }, this._schedule = schedule; } function AsyncInvokeLater(fn, receiver, arg) { this._lateQueue.push(fn, receiver, arg), this._queueTick(); } function AsyncInvoke(fn, receiver, arg) { this._normalQueue.push(fn, receiver, arg), this._queueTick(); } function AsyncSettlePromises(promise) { this._normalQueue._pushOne(promise), this._queueTick(); } function _drainQueue(queue) { for (;queue.length() > 0; ) _drainQueueStep(queue); } function _drainQueueStep(queue) { var fn = queue.shift(); if ("function" != typeof fn) fn._settlePromises(); else { var receiver = queue.shift(), arg = queue.shift(); fn.call(receiver, arg); } } Async.prototype.setScheduler = function(fn) { var prev = this._schedule; return this._schedule = fn, this._customScheduler = !0, prev; }, Async.prototype.hasCustomScheduler = function() { return this._customScheduler; }, Async.prototype.enableTrampoline = function() { this._trampolineEnabled = !0; }, Async.prototype.disableTrampolineIfNecessary = function() { util.hasDevTools && (this._trampolineEnabled = !1); }, Async.prototype.haveItemsQueued = function() { return this._isTickUsed || this._haveDrainedQueues; }, Async.prototype.fatalError = function(e, isNode) { isNode ? (process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + "\n"), process.exit(2)) : this.throwLater(e); }, Async.prototype.throwLater = function(fn, arg) { if (1 === arguments.length && (arg = fn, fn = function() { throw arg; }), "undefined" != typeof setTimeout) setTimeout((function() { fn(arg); }), 0); else try { this._schedule((function() { fn(arg); })); } catch (e) { throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n"); } }, util.hasDevTools ? (Async.prototype.invokeLater = function(fn, receiver, arg) { this._trampolineEnabled ? AsyncInvokeLater.call(this, fn, receiver, arg) : this._schedule((function() { setTimeout((function() { fn.call(receiver, arg); }), 100); })); }, Async.prototype.invoke = function(fn, receiver, arg) { this._trampolineEnabled ? AsyncInvoke.call(this, fn, receiver, arg) : this._schedule((function() { fn.call(receiver, arg); })); }, Async.prototype.settlePromises = function(promise) { this._trampolineEnabled ? AsyncSettlePromises.call(this, promise) : this._schedule((function() { promise._settlePromises(); })); }) : (Async.prototype.invokeLater = AsyncInvokeLater, Async.prototype.invoke = AsyncInvoke, Async.prototype.settlePromises = AsyncSettlePromises), Async.prototype._drainQueues = function() { _drainQueue(this._normalQueue), this._reset(), this._haveDrainedQueues = !0, _drainQueue(this._lateQueue); }, Async.prototype._queueTick = function() { this._isTickUsed || (this._isTickUsed = !0, this._schedule(this.drainQueues)); }, Async.prototype._reset = function() { this._isTickUsed = !1; }, module.exports = Async, module.exports.firstLineError = firstLineError; }, function(module, exports, __webpack_require__) { "use strict"; var schedule, util = __webpack_require__(16), NativePromise = util.getNativePromise(); if (util.isNode && "undefined" == typeof MutationObserver) { var GlobalSetImmediate = global.setImmediate, ProcessNextTick = process.nextTick; schedule = util.isRecentNode ? function(fn) { GlobalSetImmediate.call(global, fn); } : function(fn) { ProcessNextTick.call(process, fn); }; } else if ("function" == typeof NativePromise && "function" == typeof NativePromise.resolve) { var nativePromise = NativePromise.resolve(); schedule = function(fn) { nativePromise.then(fn); }; } else schedule = "undefined" == typeof MutationObserver || "undefined" != typeof window && window.navigator && (window.navigator.standalone || window.cordova) || !("classList" in document.documentElement) ? "undefined" != typeof setImmediate ? function(fn) { setImmediate(fn); } : "undefined" != typeof setTimeout ? function(fn) { setTimeout(fn, 0); } : function() { throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n"); } : (function() { var div = document.createElement("div"), opts = { attributes: !0 }, toggleScheduled = !1, div2 = document.createElement("div"); return new MutationObserver((function() { div.classList.toggle("foo"), toggleScheduled = !1; })).observe(div2, opts), function(fn) { var o = new MutationObserver((function() { o.disconnect(), fn(); })); o.observe(div, opts), toggleScheduled || (toggleScheduled = !0, div2.classList.toggle("foo")); }; })(); module.exports = schedule; }, function(module, exports, __webpack_require__) { "use strict"; function Queue(capacity) { this._capacity = capacity, this._length = 0, this._front = 0; } Queue.prototype._willBeOverCapacity = function(size) { return this._capacity < size; }, Queue.prototype._pushOne = function(arg) { var length = this.length(); this._checkCapacity(length + 1), this[this._front + length & this._capacity - 1] = arg, this._length = length + 1; }, Queue.prototype.push = function(fn, receiver, arg) { var length = this.length() + 3; if (this._willBeOverCapacity(length)) return this._pushOne(fn), this._pushOne(receiver), void this._pushOne(arg); var j = this._front + length - 3; this._checkCapacity(length); var wrapMask = this._capacity - 1; this[j + 0 & wrapMask] = fn, this[j + 1 & wrapMask] = receiver, this[j + 2 & wrapMask] = arg, this._length = length; }, Queue.prototype.shift = function() { var front = this._front, ret = this[front]; return this[front] = void 0, this._front = front + 1 & this._capacity - 1, this._length--, ret; }, Queue.prototype.length = function() { return this._length; }, Queue.prototype._checkCapacity = function(size) { this._capacity < size && this._resizeTo(this._capacity << 1); }, Queue.prototype._resizeTo = function(capacity) { var oldCapacity = this._capacity; this._capacity = capacity, (function(src, srcIndex, dst, dstIndex, len) { for (var j = 0; j < len; ++j) dst[j + dstIndex] = src[j + 0], src[j + 0] = void 0; })(this, 0, this, oldCapacity, this._front + this._length & oldCapacity - 1); }, module.exports = Queue; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var util = __webpack_require__(16), errorObj = util.errorObj, isObject = util.isObject, hasProp = {}.hasOwnProperty; return function(obj, context) { if (isObject(obj)) { if (obj instanceof Promise) return obj; var then = (function(obj) { try { return (function(obj) { return obj.then; })(obj); } catch (e) { return errorObj.e = e, errorObj; } })(obj); if (then === errorObj) { context && context._pushContext(); var ret = Promise.reject(then.e); return context && context._popContext(), ret; } if ("function" == typeof then) return (function(obj) { try { return hasProp.call(obj, "_promise0"); } catch (e) { return !1; } })(obj) ? (ret = new Promise(INTERNAL), obj._then(ret._fulfill, ret._reject, void 0, ret, null), ret) : (function(x, then, context) { var promise = new Promise(INTERNAL), ret = promise; context && context._pushContext(), promise._captureStackTrace(), context && context._popContext(); var result = util.tryCatch(then).call(x, (function(value) { promise && (promise._resolveCallback(value), promise = null); }), (function(reason) { promise && (promise._rejectCallback(reason, false, !0), promise = null); })); return !1, promise && result === errorObj && (promise._rejectCallback(result.e, !0, !0), promise = null), ret; })(obj, then, context); } return obj; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection, Proxyable) { var util = __webpack_require__(16); function PromiseArray(values) { var promise = this._promise = new Promise(INTERNAL); values instanceof Promise && promise._propagateFrom(values, 3), promise._setOnCancel(this), this._values = values, this._length = 0, this._totalResolved = 0, this._init(void 0, -2); } return util.isArray, util.inherits(PromiseArray, Proxyable), PromiseArray.prototype.length = function() { return this._length; }, PromiseArray.prototype.promise = function() { return this._promise; }, PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { var values = tryConvertToPromise(this._values, this._promise); if (values instanceof Promise) { var bitField = (values = values._target())._bitField; if (this._values = values, 0 == (50397184 & bitField)) return this._promise._setAsyncGuaranteed(), values._then(init, this._reject, void 0, this, resolveValueIfEmpty); if (0 == (33554432 & bitField)) return 0 != (16777216 & bitField) ? this._reject(values._reason()) : this._cancel(); values = values._value(); } if (null !== (values = util.asArray(values))) 0 !== values.length ? this._iterate(values) : -5 === resolveValueIfEmpty ? this._resolveEmptyArray() : this._resolve((function(val) { switch (val) { case -2: return []; case -3: return {}; case -6: return new Map; } })(resolveValueIfEmpty)); else { var err = apiRejection("expecting an array or an iterable object but got " + util.classString(values)).reason(); this._promise._rejectCallback(err, !1); } }, PromiseArray.prototype._iterate = function(values) { var len = this.getActualLength(values.length); this._length = len, this._values = this.shouldCopyValues() ? new Array(len) : this._values; for (var result = this._promise, isResolved = !1, bitField = null, i = 0; i < len; ++i) { var maybePromise = tryConvertToPromise(values[i], result); bitField = maybePromise instanceof Promise ? (maybePromise = maybePromise._target())._bitField : null, isResolved ? null !== bitField && maybePromise.suppressUnhandledRejections() : null !== bitField ? 0 == (50397184 & bitField) ? (maybePromise._proxy(this, i), this._values[i] = maybePromise) : isResolved = 0 != (33554432 & bitField) ? this._promiseFulfilled(maybePromise._value(), i) : 0 != (16777216 & bitField) ? this._promiseRejected(maybePromise._reason(), i) : this._promiseCancelled(i) : isResolved = this._promiseFulfilled(maybePromise, i); } isResolved || result._setAsyncGuaranteed(); }, PromiseArray.prototype._isResolved = function() { return null === this._values; }, PromiseArray.prototype._resolve = function(value) { this._values = null, this._promise._fulfill(value); }, PromiseArray.prototype._cancel = function() { !this._isResolved() && this._promise._isCancellable() && (this._values = null, this._promise._cancel()); }, PromiseArray.prototype._reject = function(reason) { this._values = null, this._promise._rejectCallback(reason, !1); }, PromiseArray.prototype._promiseFulfilled = function(value, index) { return this._values[index] = value, ++this._totalResolved >= this._length && (this._resolve(this._values), !0); }, PromiseArray.prototype._promiseCancelled = function() { return this._cancel(), !0; }, PromiseArray.prototype._promiseRejected = function(reason) { return this._totalResolved++, this._reject(reason), !0; }, PromiseArray.prototype._resultCancelled = function() { if (!this._isResolved()) { var values = this._values; if (this._cancel(), values instanceof Promise) values.cancel(); else for (var i = 0; i < values.length; ++i) values[i] instanceof Promise && values[i].cancel(); } }, PromiseArray.prototype.shouldCopyValues = function() { return !0; }, PromiseArray.prototype.getActualLength = function(len) { return len; }, PromiseArray; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var longStackTraces = !1, contextStack = []; function Context() { this._trace = new Context.CapturedTrace(peekContext()); } function peekContext() { var lastIndex = contextStack.length - 1; if (lastIndex >= 0) return contextStack[lastIndex]; } return Promise.prototype._promiseCreated = function() {}, Promise.prototype._pushContext = function() {}, Promise.prototype._popContext = function() { return null; }, Promise._peekContext = Promise.prototype._peekContext = function() {}, Context.prototype._pushContext = function() { void 0 !== this._trace && (this._trace._promiseCreated = null, contextStack.push(this._trace)); }, Context.prototype._popContext = function() { if (void 0 !== this._trace) { var trace = contextStack.pop(), ret = trace._promiseCreated; return trace._promiseCreated = null, ret; } return null; }, Context.CapturedTrace = null, Context.create = function() { if (longStackTraces) return new Context; }, Context.deactivateLongStackTraces = function() {}, Context.activateLongStackTraces = function() { var Promise_pushContext = Promise.prototype._pushContext, Promise_popContext = Promise.prototype._popContext, Promise_PeekContext = Promise._peekContext, Promise_peekContext = Promise.prototype._peekContext, Promise_promiseCreated = Promise.prototype._promiseCreated; Context.deactivateLongStackTraces = function() { Promise.prototype._pushContext = Promise_pushContext, Promise.prototype._popContext = Promise_popContext, Promise._peekContext = Promise_PeekContext, Promise.prototype._peekContext = Promise_peekContext, Promise.prototype._promiseCreated = Promise_promiseCreated, longStackTraces = !1; }, longStackTraces = !0, Promise.prototype._pushContext = Context.prototype._pushContext, Promise.prototype._popContext = Context.prototype._popContext, Promise._peekContext = Promise.prototype._peekContext = peekContext, Promise.prototype._promiseCreated = function() { var ctx = this._peekContext(); ctx && null == ctx._promiseCreated && (ctx._promiseCreated = this); }; }, Context; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, Context) { var unhandledRejectionHandled, possiblyUnhandledRejection, printWarning, getDomain = Promise._getDomain, async = Promise._async, Warning = __webpack_require__(60).Warning, util = __webpack_require__(16), es5 = __webpack_require__(75), canAttachTrace = util.canAttachTrace, bluebirdFramePattern = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/, nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/, parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/, stackFramePattern = null, formatStack = null, indentStackFrames = !1, debugging = !(0 == util.env("BLUEBIRD_DEBUG") || !util.env("BLUEBIRD_DEBUG") && "development" !== util.env("NODE_ENV")), warnings = !(0 == util.env("BLUEBIRD_WARNINGS") || !debugging && !util.env("BLUEBIRD_WARNINGS")), longStackTraces = !(0 == util.env("BLUEBIRD_LONG_STACK_TRACES") || !debugging && !util.env("BLUEBIRD_LONG_STACK_TRACES")), wForgottenReturn = 0 != util.env("BLUEBIRD_W_FORGOTTEN_RETURN") && (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); Promise.prototype.suppressUnhandledRejections = function() { var target = this._target(); target._bitField = -1048577 & target._bitField | 524288; }, Promise.prototype._ensurePossibleRejectionHandled = function() { if (0 == (524288 & this._bitField)) { this._setRejectionIsUnhandled(); var self = this; setTimeout((function() { self._notifyUnhandledRejection(); }), 1); } }, Promise.prototype._notifyUnhandledRejectionIsHandled = function() { fireRejectionEvent("rejectionHandled", unhandledRejectionHandled, void 0, this); }, Promise.prototype._setReturnedNonUndefined = function() { this._bitField = 268435456 | this._bitField; }, Promise.prototype._returnedNonUndefined = function() { return 0 != (268435456 & this._bitField); }, Promise.prototype._notifyUnhandledRejection = function() { if (this._isRejectionUnhandled()) { var reason = this._settledValue(); this._setUnhandledRejectionIsNotified(), fireRejectionEvent("unhandledRejection", possiblyUnhandledRejection, reason, this); } }, Promise.prototype._setUnhandledRejectionIsNotified = function() { this._bitField = 262144 | this._bitField; }, Promise.prototype._unsetUnhandledRejectionIsNotified = function() { this._bitField = -262145 & this._bitField; }, Promise.prototype._isUnhandledRejectionNotified = function() { return (262144 & this._bitField) > 0; }, Promise.prototype._setRejectionIsUnhandled = function() { this._bitField = 1048576 | this._bitField; }, Promise.prototype._unsetRejectionIsUnhandled = function() { this._bitField = -1048577 & this._bitField, this._isUnhandledRejectionNotified() && (this._unsetUnhandledRejectionIsNotified(), this._notifyUnhandledRejectionIsHandled()); }, Promise.prototype._isRejectionUnhandled = function() { return (1048576 & this._bitField) > 0; }, Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { return warn(message, shouldUseOwnTrace, promise || this); }, Promise.onPossiblyUnhandledRejection = function(fn) { var domain = getDomain(); possiblyUnhandledRejection = "function" == typeof fn ? null === domain ? fn : util.domainBind(domain, fn) : void 0; }, Promise.onUnhandledRejectionHandled = function(fn) { var domain = getDomain(); unhandledRejectionHandled = "function" == typeof fn ? null === domain ? fn : util.domainBind(domain, fn) : void 0; }; var disableLongStackTraces = function() {}; Promise.longStackTraces = function() { if (async.haveItemsQueued() && !config.longStackTraces) throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"); if (!config.longStackTraces && longStackTracesIsSupported()) { var Promise_captureStackTrace = Promise.prototype._captureStackTrace, Promise_attachExtraTrace = Promise.prototype._attachExtraTrace, Promise_dereferenceTrace = Promise.prototype._dereferenceTrace; config.longStackTraces = !0, disableLongStackTraces = function() { if (async.haveItemsQueued() && !config.longStackTraces) throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"); Promise.prototype._captureStackTrace = Promise_captureStackTrace, Promise.prototype._attachExtraTrace = Promise_attachExtraTrace, Promise.prototype._dereferenceTrace = Promise_dereferenceTrace, Context.deactivateLongStackTraces(), async.enableTrampoline(), config.longStackTraces = !1; }, Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace, Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace, Promise.prototype._dereferenceTrace = longStackTracesDereferenceTrace, Context.activateLongStackTraces(), async.disableTrampolineIfNecessary(); } }, Promise.hasLongStackTraces = function() { return config.longStackTraces && longStackTracesIsSupported(); }; var fireDomEvent = (function() { try { if ("function" == typeof CustomEvent) { var event = new CustomEvent("CustomEvent"); return util.global.dispatchEvent(event), function(name, event) { var eventData = { detail: event, cancelable: !0 }; es5.defineProperty(eventData, "promise", { value: event.promise }), es5.defineProperty(eventData, "reason", { value: event.reason }); var domEvent = new CustomEvent(name.toLowerCase(), eventData); return !util.global.dispatchEvent(domEvent); }; } return "function" == typeof Event ? (event = new Event("CustomEvent"), util.global.dispatchEvent(event), function(name, event) { var domEvent = new Event(name.toLowerCase(), { cancelable: !0 }); return domEvent.detail = event, es5.defineProperty(domEvent, "promise", { value: event.promise }), es5.defineProperty(domEvent, "reason", { value: event.reason }), !util.global.dispatchEvent(domEvent); }) : ((event = document.createEvent("CustomEvent")).initCustomEvent("testingtheevent", !1, !0, {}), util.global.dispatchEvent(event), function(name, event) { var domEvent = document.createEvent("CustomEvent"); return domEvent.initCustomEvent(name.toLowerCase(), !1, !0, event), !util.global.dispatchEvent(domEvent); }); } catch (e) {} return function() { return !1; }; })(), fireGlobalEvent = util.isNode ? function() { return process.emit.apply(process, arguments); } : util.global ? function(name) { var methodName = "on" + name.toLowerCase(), method = util.global[methodName]; return !!method && (method.apply(util.global, [].slice.call(arguments, 1)), !0); } : function() { return !1; }; function generatePromiseLifecycleEventObject(name, promise) { return { promise: promise }; } var eventToObjectGenerator = { promiseCreated: generatePromiseLifecycleEventObject, promiseFulfilled: generatePromiseLifecycleEventObject, promiseRejected: generatePromiseLifecycleEventObject, promiseResolved: generatePromiseLifecycleEventObject, promiseCancelled: generatePromiseLifecycleEventObject, promiseChained: function(name, promise, child) { return { promise: promise, child: child }; }, warning: function(name, warning) { return { warning: warning }; }, unhandledRejection: function(name, reason, promise) { return { reason: reason, promise: promise }; }, rejectionHandled: generatePromiseLifecycleEventObject }, activeFireEvent = function(name) { var globalEventFired = !1; try { globalEventFired = fireGlobalEvent.apply(null, arguments); } catch (e) { async.throwLater(e), globalEventFired = !0; } var domEventFired = !1; try { domEventFired = fireDomEvent(name, eventToObjectGenerator[name].apply(null, arguments)); } catch (e) { async.throwLater(e), domEventFired = !0; } return domEventFired || globalEventFired; }; function defaultFireEvent() { return !1; } function cancellationExecute(executor, resolve, reject) { var promise = this; try { executor(resolve, reject, (function(onCancel) { if ("function" != typeof onCancel) throw new TypeError("onCancel must be a function, got: " + util.toString(onCancel)); promise._attachCancellationCallback(onCancel); })); } catch (e) { return e; } } function cancellationAttachCancellationCallback(onCancel) { if (!this._isCancellable()) return this; var previousOnCancel = this._onCancel(); void 0 !== previousOnCancel ? util.isArray(previousOnCancel) ? previousOnCancel.push(onCancel) : this._setOnCancel([ previousOnCancel, onCancel ]) : this._setOnCancel(onCancel); } function cancellationOnCancel() { return this._onCancelField; } function cancellationSetOnCancel(onCancel) { this._onCancelField = onCancel; } function cancellationClearCancellationData() { this._cancellationParent = void 0, this._onCancelField = void 0; } function cancellationPropagateFrom(parent, flags) { if (0 != (1 & flags)) { this._cancellationParent = parent; var branchesRemainingToCancel = parent._branchesRemainingToCancel; void 0 === branchesRemainingToCancel && (branchesRemainingToCancel = 0), parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; } 0 != (2 & flags) && parent._isBound() && this._setBoundTo(parent._boundTo); } Promise.config = function(opts) { if ("longStackTraces" in (opts = Object(opts)) && (opts.longStackTraces ? Promise.longStackTraces() : !opts.longStackTraces && Promise.hasLongStackTraces() && disableLongStackTraces()), "warnings" in opts) { var warningsOption = opts.warnings; config.warnings = !!warningsOption, wForgottenReturn = config.warnings, util.isObject(warningsOption) && "wForgottenReturn" in warningsOption && (wForgottenReturn = !!warningsOption.wForgottenReturn); } if ("cancellation" in opts && opts.cancellation && !config.cancellation) { if (async.haveItemsQueued()) throw new Error("cannot enable cancellation after promises are in use"); Promise.prototype._clearCancellationData = cancellationClearCancellationData, Promise.prototype._propagateFrom = cancellationPropagateFrom, Promise.prototype._onCancel = cancellationOnCancel, Promise.prototype._setOnCancel = cancellationSetOnCancel, Promise.prototype._attachCancellationCallback = cancellationAttachCancellationCallback, Promise.prototype._execute = cancellationExecute, propagateFromFunction = cancellationPropagateFrom, config.cancellation = !0; } return "monitoring" in opts && (opts.monitoring && !config.monitoring ? (config.monitoring = !0, Promise.prototype._fireEvent = activeFireEvent) : !opts.monitoring && config.monitoring && (config.monitoring = !1, Promise.prototype._fireEvent = defaultFireEvent)), Promise; }, Promise.prototype._fireEvent = defaultFireEvent, Promise.prototype._execute = function(executor, resolve, reject) { try { executor(resolve, reject); } catch (e) { return e; } }, Promise.prototype._onCancel = function() {}, Promise.prototype._setOnCancel = function(handler) {}, Promise.prototype._attachCancellationCallback = function(onCancel) {}, Promise.prototype._captureStackTrace = function() {}, Promise.prototype._attachExtraTrace = function() {}, Promise.prototype._dereferenceTrace = function() {}, Promise.prototype._clearCancellationData = function() {}, Promise.prototype._propagateFrom = function(parent, flags) {}; var propagateFromFunction = function(parent, flags) { 0 != (2 & flags) && parent._isBound() && this._setBoundTo(parent._boundTo); }; function boundValueFunction() { var ret = this._boundTo; return void 0 !== ret && ret instanceof Promise ? ret.isFulfilled() ? ret.value() : void 0 : ret; } function longStackTracesCaptureStackTrace() { this._trace = new CapturedTrace(this._peekContext()); } function longStackTracesAttachExtraTrace(error, ignoreSelf) { if (canAttachTrace(error)) { var trace = this._trace; if (void 0 !== trace && ignoreSelf && (trace = trace._parent), void 0 !== trace) trace.attachExtraTrace(error); else if (!error.__stackCleaned__) { var parsed = parseStackAndMessage(error); util.notEnumerableProp(error, "stack", parsed.message + "\n" + parsed.stack.join("\n")), util.notEnumerableProp(error, "__stackCleaned__", !0); } } } function longStackTracesDereferenceTrace() { this._trace = void 0; } function warn(message, shouldUseOwnTrace, promise) { if (config.warnings) { var ctx, warning = new Warning(message); if (shouldUseOwnTrace) promise._attachExtraTrace(warning); else if (config.longStackTraces && (ctx = Promise._peekContext())) ctx.attachExtraTrace(warning); else { var parsed = parseStackAndMessage(warning); warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); } activeFireEvent("warning", warning) || formatAndLogError(warning, "", !0); } } function cleanStack(stack) { for (var ret = [], i = 0; i < stack.length; ++i) { var line = stack[i], isTraceLine = " (No stack trace)" === line || stackFramePattern.test(line), isInternalFrame = isTraceLine && shouldIgnore(line); isTraceLine && !isInternalFrame && (indentStackFrames && " " !== line.charAt(0) && (line = " " + line), ret.push(line)); } return ret; } function parseStackAndMessage(error) { var stack = error.stack, message = error.toString(); return stack = "string" == typeof stack && stack.length > 0 ? (function(error) { for (var stack = error.stack.replace(/\s+$/g, "").split("\n"), i = 0; i < stack.length; ++i) { var line = stack[i]; if (" (No stack trace)" === line || stackFramePattern.test(line)) break; } return i > 0 && "SyntaxError" != error.name && (stack = stack.slice(i)), stack; })(error) : [ " (No stack trace)" ], { message: message, stack: "SyntaxError" == error.name ? stack : cleanStack(stack) }; } function formatAndLogError(error, title, isSoft) { if ("undefined" != typeof console) { var message; if (util.isObject(error)) { var stack = error.stack; message = title + formatStack(stack, error); } else message = title + String(error); "function" == typeof printWarning ? printWarning(message, isSoft) : "function" != typeof console.log && "object" != typeof console.log || console.log(message); } } function fireRejectionEvent(name, localHandler, reason, promise) { var localEventFired = !1; try { "function" == typeof localHandler && (localEventFired = !0, "rejectionHandled" === name ? localHandler(promise) : localHandler(reason, promise)); } catch (e) { async.throwLater(e); } "unhandledRejection" === name ? activeFireEvent(name, reason, promise) || localEventFired || formatAndLogError(reason, "Unhandled rejection ") : activeFireEvent(name, promise); } function formatNonError(obj) { var str; if ("function" == typeof obj) str = "[function " + (obj.name || "anonymous") + "]"; else { if (str = obj && "function" == typeof obj.toString ? obj.toString() : util.toString(obj), /\[object [a-zA-Z0-9$_]+\]/.test(str)) try { str = JSON.stringify(obj); } catch (e) {} 0 === str.length && (str = "(empty array)"); } return "(<" + (function(str) { return str.length < 41 ? str : str.substr(0, 38) + "..."; })(str) + ">, no stack trace)"; } function longStackTracesIsSupported() { return "function" == typeof captureStackTrace; } var shouldIgnore = function() { return !1; }, parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; function parseLineInfo(line) { var matches = line.match(parseLineInfoRegex); if (matches) return { fileName: matches[1], line: parseInt(matches[2], 10) }; } function CapturedTrace(parent) { this._parent = parent, this._promisesCreated = 0; var length = this._length = 1 + (void 0 === parent ? 0 : parent._length); captureStackTrace(this, CapturedTrace), length > 32 && this.uncycle(); } util.inherits(CapturedTrace, Error), Context.CapturedTrace = CapturedTrace, CapturedTrace.prototype.uncycle = function() { var length = this._length; if (!(length < 2)) { for (var nodes = [], stackToIndex = {}, i = 0, node = this; void 0 !== node; ++i) nodes.push(node), node = node._parent; for (i = (length = this._length = i) - 1; i >= 0; --i) { var stack = nodes[i].stack; void 0 === stackToIndex[stack] && (stackToIndex[stack] = i); } for (i = 0; i < length; ++i) { var index = stackToIndex[nodes[i].stack]; if (void 0 !== index && index !== i) { index > 0 && (nodes[index - 1]._parent = void 0, nodes[index - 1]._length = 1), nodes[i]._parent = void 0, nodes[i]._length = 1; var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; index < length - 1 ? (cycleEdgeNode._parent = nodes[index + 1], cycleEdgeNode._parent.uncycle(), cycleEdgeNode._length = cycleEdgeNode._parent._length + 1) : (cycleEdgeNode._parent = void 0, cycleEdgeNode._length = 1); for (var currentChildLength = cycleEdgeNode._length + 1, j = i - 2; j >= 0; --j) nodes[j]._length = currentChildLength, currentChildLength++; return; } } } }, CapturedTrace.prototype.attachExtraTrace = function(error) { if (!error.__stackCleaned__) { this.uncycle(); for (var parsed = parseStackAndMessage(error), message = parsed.message, stacks = [ parsed.stack ], trace = this; void 0 !== trace; ) stacks.push(cleanStack(trace.stack.split("\n"))), trace = trace._parent; !(function(stacks) { for (var current = stacks[0], i = 1; i < stacks.length; ++i) { for (var prev = stacks[i], currentLastIndex = current.length - 1, currentLastLine = current[currentLastIndex], commonRootMeetPoint = -1, j = prev.length - 1; j >= 0; --j) if (prev[j] === currentLastLine) { commonRootMeetPoint = j; break; } for (j = commonRootMeetPoint; j >= 0; --j) { var line = prev[j]; if (current[currentLastIndex] !== line) break; current.pop(), currentLastIndex--; } current = prev; } })(stacks), (function(stacks) { for (var i = 0; i < stacks.length; ++i) (0 === stacks[i].length || i + 1 < stacks.length && stacks[i][0] === stacks[i + 1][0]) && (stacks.splice(i, 1), i--); })(stacks), util.notEnumerableProp(error, "stack", (function(message, stacks) { for (var i = 0; i < stacks.length - 1; ++i) stacks[i].push("From previous event:"), stacks[i] = stacks[i].join("\n"); return i < stacks.length && (stacks[i] = stacks[i].join("\n")), message + "\n" + stacks.join("\n"); })(message, stacks)), util.notEnumerableProp(error, "__stackCleaned__", !0); } }; var captureStackTrace = (function() { var v8stackFramePattern = /^\s*at\s*/, v8stackFormatter = function(stack, error) { return "string" == typeof stack ? stack : void 0 !== error.name && void 0 !== error.message ? error.toString() : formatNonError(error); }; if ("number" == typeof Error.stackTraceLimit && "function" == typeof Error.captureStackTrace) { Error.stackTraceLimit += 6, stackFramePattern = v8stackFramePattern, formatStack = v8stackFormatter; var captureStackTrace = Error.captureStackTrace; return shouldIgnore = function(line) { return bluebirdFramePattern.test(line); }, function(receiver, ignoreUntil) { Error.stackTraceLimit += 6, captureStackTrace(receiver, ignoreUntil), Error.stackTraceLimit -= 6; }; } var hasStackAfterThrow, err = new Error; if ("string" == typeof err.stack && err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) return stackFramePattern = /@/, formatStack = v8stackFormatter, indentStackFrames = !0, function(o) { o.stack = (new Error).stack; }; try { throw new Error; } catch (e) { hasStackAfterThrow = "stack" in e; } return !("stack" in err) && hasStackAfterThrow && "number" == typeof Error.stackTraceLimit ? (stackFramePattern = v8stackFramePattern, formatStack = v8stackFormatter, function(o) { Error.stackTraceLimit += 6; try { throw new Error; } catch (e) { o.stack = e.stack; } Error.stackTraceLimit -= 6; }) : (formatStack = function(stack, error) { return "string" == typeof stack ? stack : "object" != typeof error && "function" != typeof error || void 0 === error.name || void 0 === error.message ? formatNonError(error) : error.toString(); }, null); })(); "undefined" != typeof console && void 0 !== console.warn && (printWarning = function(message) { console.warn(message); }, util.isNode && process.stderr.isTTY ? printWarning = function(message, isSoft) { var color = isSoft ? "" : ""; console.warn(color + message + "\n"); } : util.isNode || "string" != typeof (new Error).stack || (printWarning = function(message, isSoft) { console.warn("%c" + message, isSoft ? "color: darkorange" : "color: red"); })); var config = { warnings: warnings, longStackTraces: !1, cancellation: !1, monitoring: !1 }; return longStackTraces && Promise.longStackTraces(), { longStackTraces: function() { return config.longStackTraces; }, warnings: function() { return config.warnings; }, cancellation: function() { return config.cancellation; }, monitoring: function() { return config.monitoring; }, propagateFromFunction: function() { return propagateFromFunction; }, boundValueFunction: function() { return boundValueFunction; }, checkForgottenReturns: function(returnValue, promiseCreated, name, promise, parent) { if (void 0 === returnValue && null !== promiseCreated && wForgottenReturn) { if (void 0 !== parent && parent._returnedNonUndefined()) return; if (0 == (65535 & promise._bitField)) return; name && (name += " "); var handlerLine = "", creatorLine = ""; if (promiseCreated._trace) { for (var traceLines = promiseCreated._trace.stack.split("\n"), stack = cleanStack(traceLines), i = stack.length - 1; i >= 0; --i) { var line = stack[i]; if (!nodeFramePattern.test(line)) { var lineMatches = line.match(parseLinePattern); lineMatches && (handlerLine = "at " + lineMatches[1] + ":" + lineMatches[2] + ":" + lineMatches[3] + " "); break; } } if (stack.length > 0) { var firstUserLine = stack[0]; for (i = 0; i < traceLines.length; ++i) if (traceLines[i] === firstUserLine) { i > 0 && (creatorLine = "\n" + traceLines[i - 1]); break; } } } var msg = "a promise was created in a " + name + "handler " + handlerLine + "but was not returned from it, see http://goo.gl/rRqMUw" + creatorLine; promise._warn(msg, !0, promiseCreated); } }, setBounds: function(firstLineError, lastLineError) { if (longStackTracesIsSupported()) { for (var firstFileName, lastFileName, firstStackLines = (firstLineError.stack || "").split("\n"), lastStackLines = (lastLineError.stack || "").split("\n"), firstIndex = -1, lastIndex = -1, i = 0; i < firstStackLines.length; ++i) if (result = parseLineInfo(firstStackLines[i])) { firstFileName = result.fileName, firstIndex = result.line; break; } for (i = 0; i < lastStackLines.length; ++i) { var result; if (result = parseLineInfo(lastStackLines[i])) { lastFileName = result.fileName, lastIndex = result.line; break; } } firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex || (shouldIgnore = function(line) { if (bluebirdFramePattern.test(line)) return !0; var info = parseLineInfo(line); return !!(info && info.fileName === firstFileName && firstIndex <= info.line && info.line <= lastIndex); }); } }, warn: warn, deprecated: function(name, replacement) { var message = name + " is deprecated and will be removed in a future version."; return replacement && (message += " Use " + replacement + " instead."), warn(message); }, CapturedTrace: CapturedTrace, fireDomEvent: fireDomEvent, fireGlobalEvent: fireGlobalEvent }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { var util = __webpack_require__(16), CancellationError = Promise.CancellationError, errorObj = util.errorObj, catchFilter = __webpack_require__(476)(NEXT_FILTER); function PassThroughHandlerContext(promise, type, handler) { this.promise = promise, this.type = type, this.handler = handler, this.called = !1, this.cancelPromise = null; } function FinallyHandlerCancelReaction(finallyHandler) { this.finallyHandler = finallyHandler; } function checkCancel(ctx, reason) { return null != ctx.cancelPromise && (arguments.length > 1 ? ctx.cancelPromise._reject(reason) : ctx.cancelPromise._cancel(), ctx.cancelPromise = null, !0); } function succeed() { return finallyHandler.call(this, this.promise._target()._settledValue()); } function fail(reason) { if (!checkCancel(this, reason)) return errorObj.e = reason, errorObj; } function finallyHandler(reasonOrValue) { var promise = this.promise, handler = this.handler; if (!this.called) { this.called = !0; var ret = this.isFinallyHandler() ? handler.call(promise._boundValue()) : handler.call(promise._boundValue(), reasonOrValue); if (ret === NEXT_FILTER) return ret; if (void 0 !== ret) { promise._setReturnedNonUndefined(); var maybePromise = tryConvertToPromise(ret, promise); if (maybePromise instanceof Promise) { if (null != this.cancelPromise) { if (maybePromise._isCancelled()) { var reason = new CancellationError("late cancellation observer"); return promise._attachExtraTrace(reason), errorObj.e = reason, errorObj; } maybePromise.isPending() && maybePromise._attachCancellationCallback(new FinallyHandlerCancelReaction(this)); } return maybePromise._then(succeed, fail, void 0, this, void 0); } } } return promise.isRejected() ? (checkCancel(this), errorObj.e = reasonOrValue, errorObj) : (checkCancel(this), reasonOrValue); } return PassThroughHandlerContext.prototype.isFinallyHandler = function() { return 0 === this.type; }, FinallyHandlerCancelReaction.prototype._resultCancelled = function() { checkCancel(this.finallyHandler); }, Promise.prototype._passThrough = function(handler, type, success, fail) { return "function" != typeof handler ? this.then() : this._then(success, fail, void 0, new PassThroughHandlerContext(this, type, handler), void 0); }, Promise.prototype.lastly = Promise.prototype.finally = function(handler) { return this._passThrough(handler, 0, finallyHandler, finallyHandler); }, Promise.prototype.tap = function(handler) { return this._passThrough(handler, 1, finallyHandler); }, Promise.prototype.tapCatch = function(handlerOrPredicate) { var len = arguments.length; if (1 === len) return this._passThrough(handlerOrPredicate, 1, void 0, finallyHandler); var i, catchInstances = new Array(len - 1), j = 0; for (i = 0; i < len - 1; ++i) { var item = arguments[i]; if (!util.isObject(item)) return Promise.reject(new TypeError("tapCatch statement predicate: expecting an object but got " + util.classString(item))); catchInstances[j++] = item; } catchInstances.length = j; var handler = arguments[i]; return this._passThrough(catchFilter(catchInstances, handler, this), 1, void 0, finallyHandler); }, PassThroughHandlerContext; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { var util = __webpack_require__(16), tryCatch = util.tryCatch; Promise.method = function(fn) { if ("function" != typeof fn) throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); return function() { var ret = new Promise(INTERNAL); ret._captureStackTrace(), ret._pushContext(); var value = tryCatch(fn).apply(this, arguments), promiseCreated = ret._popContext(); return debug.checkForgottenReturns(value, promiseCreated, "Promise.method", ret), ret._resolveFromSyncValue(value), ret; }; }, Promise.attempt = Promise.try = function(fn) { if ("function" != typeof fn) return apiRejection("expecting a function but got " + util.classString(fn)); var value, ret = new Promise(INTERNAL); if (ret._captureStackTrace(), ret._pushContext(), arguments.length > 1) { debug.deprecated("calling Promise.try with more than 1 argument"); var arg = arguments[1], ctx = arguments[2]; value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) : tryCatch(fn).call(ctx, arg); } else value = tryCatch(fn)(); var promiseCreated = ret._popContext(); return debug.checkForgottenReturns(value, promiseCreated, "Promise.try", ret), ret._resolveFromSyncValue(value), ret; }, Promise.prototype._resolveFromSyncValue = function(value) { value === util.errorObj ? this._rejectCallback(value.e, !1) : this._resolveCallback(value, !0); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { var calledBind = !1, rejectThis = function(_, e) { this._reject(e); }, targetRejected = function(e, context) { context.promiseRejectionQueued = !0, context.bindingPromise._then(rejectThis, rejectThis, null, this, e); }, bindingResolved = function(thisArg, context) { 0 == (50397184 & this._bitField) && this._resolveCallback(context.target); }, bindingRejected = function(e, context) { context.promiseRejectionQueued || this._reject(e); }; Promise.prototype.bind = function(thisArg) { calledBind || (calledBind = !0, Promise.prototype._propagateFrom = debug.propagateFromFunction(), Promise.prototype._boundValue = debug.boundValueFunction()); var maybePromise = tryConvertToPromise(thisArg), ret = new Promise(INTERNAL); ret._propagateFrom(this, 1); var target = this._target(); if (ret._setBoundTo(maybePromise), maybePromise instanceof Promise) { var context = { promiseRejectionQueued: !1, promise: ret, target: target, bindingPromise: maybePromise }; target._then(INTERNAL, targetRejected, void 0, ret, context), maybePromise._then(bindingResolved, bindingRejected, void 0, ret, context), ret._setOnCancel(maybePromise); } else ret._resolveCallback(target); return ret; }, Promise.prototype._setBoundTo = function(obj) { void 0 !== obj ? (this._bitField = 2097152 | this._bitField, this._boundTo = obj) : this._bitField = -2097153 & this._bitField; }, Promise.prototype._isBound = function() { return 2097152 == (2097152 & this._bitField); }, Promise.bind = function(thisArg, value) { return Promise.resolve(value).bind(thisArg); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, debug) { var util = __webpack_require__(16), tryCatch = util.tryCatch, errorObj = util.errorObj, async = Promise._async; Promise.prototype.break = Promise.prototype.cancel = function() { if (!debug.cancellation()) return this._warn("cancellation is disabled"); for (var promise = this, child = promise; promise._isCancellable(); ) { if (!promise._cancelBy(child)) { child._isFollowing() ? child._followee().cancel() : child._cancelBranched(); break; } var parent = promise._cancellationParent; if (null == parent || !parent._isCancellable()) { promise._isFollowing() ? promise._followee().cancel() : promise._cancelBranched(); break; } promise._isFollowing() && promise._followee().cancel(), promise._setWillBeCancelled(), child = promise, promise = parent; } }, Promise.prototype._branchHasCancelled = function() { this._branchesRemainingToCancel--; }, Promise.prototype._enoughBranchesHaveCancelled = function() { return void 0 === this._branchesRemainingToCancel || this._branchesRemainingToCancel <= 0; }, Promise.prototype._cancelBy = function(canceller) { return canceller === this ? (this._branchesRemainingToCancel = 0, this._invokeOnCancel(), !0) : (this._branchHasCancelled(), !!this._enoughBranchesHaveCancelled() && (this._invokeOnCancel(), !0)); }, Promise.prototype._cancelBranched = function() { this._enoughBranchesHaveCancelled() && this._cancel(); }, Promise.prototype._cancel = function() { this._isCancellable() && (this._setCancelled(), async.invoke(this._cancelPromises, this, void 0)); }, Promise.prototype._cancelPromises = function() { this._length() > 0 && this._settlePromises(); }, Promise.prototype._unsetOnCancel = function() { this._onCancelField = void 0; }, Promise.prototype._isCancellable = function() { return this.isPending() && !this._isCancelled(); }, Promise.prototype.isCancellable = function() { return this.isPending() && !this.isCancelled(); }, Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { if (util.isArray(onCancelCallback)) for (var i = 0; i < onCancelCallback.length; ++i) this._doInvokeOnCancel(onCancelCallback[i], internalOnly); else if (void 0 !== onCancelCallback) if ("function" == typeof onCancelCallback) { if (!internalOnly) { var e = tryCatch(onCancelCallback).call(this._boundValue()); e === errorObj && (this._attachExtraTrace(e.e), async.throwLater(e.e)); } } else onCancelCallback._resultCancelled(this); }, Promise.prototype._invokeOnCancel = function() { var onCancelCallback = this._onCancel(); this._unsetOnCancel(), async.invoke(this._doInvokeOnCancel, this, onCancelCallback); }, Promise.prototype._invokeInternalOnCancel = function() { this._isCancellable() && (this._doInvokeOnCancel(this._onCancel(), !0), this._unsetOnCancel()); }, Promise.prototype._resultCancelled = function() { this.cancel(); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { function returner() { return this.value; } function thrower() { throw this.reason; } Promise.prototype.return = Promise.prototype.thenReturn = function(value) { return value instanceof Promise && value.suppressUnhandledRejections(), this._then(returner, void 0, void 0, { value: value }, void 0); }, Promise.prototype.throw = Promise.prototype.thenThrow = function(reason) { return this._then(thrower, void 0, void 0, { reason: reason }, void 0); }, Promise.prototype.catchThrow = function(reason) { if (arguments.length <= 1) return this._then(void 0, thrower, void 0, { reason: reason }, void 0); var _reason = arguments[1], handler = function() { throw _reason; }; return this.caught(reason, handler); }, Promise.prototype.catchReturn = function(value) { if (arguments.length <= 1) return value instanceof Promise && value.suppressUnhandledRejections(), this._then(void 0, returner, void 0, { value: value }, void 0); var _value = arguments[1]; _value instanceof Promise && _value.suppressUnhandledRejections(); var handler = function() { return _value; }; return this.caught(value, handler); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { function PromiseInspection(promise) { void 0 !== promise ? (promise = promise._target(), this._bitField = promise._bitField, this._settledValueField = promise._isFateSealed() ? promise._settledValue() : void 0) : (this._bitField = 0, this._settledValueField = void 0); } PromiseInspection.prototype._settledValue = function() { return this._settledValueField; }; var value = PromiseInspection.prototype.value = function() { if (!this.isFulfilled()) throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n"); return this._settledValue(); }, reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function() { if (!this.isRejected()) throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n"); return this._settledValue(); }, isFulfilled = PromiseInspection.prototype.isFulfilled = function() { return 0 != (33554432 & this._bitField); }, isRejected = PromiseInspection.prototype.isRejected = function() { return 0 != (16777216 & this._bitField); }, isPending = PromiseInspection.prototype.isPending = function() { return 0 == (50397184 & this._bitField); }, isResolved = PromiseInspection.prototype.isResolved = function() { return 0 != (50331648 & this._bitField); }; PromiseInspection.prototype.isCancelled = function() { return 0 != (8454144 & this._bitField); }, Promise.prototype.__isCancelled = function() { return 65536 == (65536 & this._bitField); }, Promise.prototype._isCancelled = function() { return this._target().__isCancelled(); }, Promise.prototype.isCancelled = function() { return 0 != (8454144 & this._target()._bitField); }, Promise.prototype.isPending = function() { return isPending.call(this._target()); }, Promise.prototype.isRejected = function() { return isRejected.call(this._target()); }, Promise.prototype.isFulfilled = function() { return isFulfilled.call(this._target()); }, Promise.prototype.isResolved = function() { return isResolved.call(this._target()); }, Promise.prototype.value = function() { return value.call(this._target()); }, Promise.prototype.reason = function() { var target = this._target(); return target._unsetRejectionIsUnhandled(), reason.call(target); }, Promise.prototype._value = function() { return this._settledValue(); }, Promise.prototype._reason = function() { return this._unsetRejectionIsUnhandled(), this._settledValue(); }, Promise.PromiseInspection = PromiseInspection; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain) { var reject, util = __webpack_require__(16), canEvaluate = util.canEvaluate, tryCatch = util.tryCatch, errorObj = util.errorObj; if (canEvaluate) { for (var thenCallback = function(i) { return new Function("value", "holder", " \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g, i)); }, promiseSetter = function(i) { return new Function("promise", "holder", " \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g, i)); }, generateHolderClass = function(total) { for (var props = new Array(total), i = 0; i < props.length; ++i) props[i] = "this.p" + (i + 1); var assignment = props.join(" = ") + " = null;", cancellationCode = "var promise;\n" + props.map((function(prop) { return " \n promise = " + prop + "; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "; })).join("\n"), passedArguments = props.join(", "), name = "Holder$" + total, code = "return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n "; return code = code.replace(/\[TheName\]/g, name).replace(/\[TheTotal\]/g, total).replace(/\[ThePassedArguments\]/g, passedArguments).replace(/\[TheProperties\]/g, assignment).replace(/\[CancellationCode\]/g, cancellationCode), new Function("tryCatch", "errorObj", "Promise", "async", code)(tryCatch, errorObj, Promise, async); }, holderClasses = [], thenCallbacks = [], promiseSetters = [], i = 0; i < 8; ++i) holderClasses.push(generateHolderClass(i + 1)), thenCallbacks.push(thenCallback(i + 1)), promiseSetters.push(promiseSetter(i + 1)); reject = function(reason) { this._reject(reason); }; } Promise.join = function() { var fn, last = arguments.length - 1; if (last > 0 && "function" == typeof arguments[last] && (fn = arguments[last], last <= 8 && canEvaluate)) { (ret = new Promise(INTERNAL))._captureStackTrace(); for (var HolderClass = holderClasses[last - 1], holder = new HolderClass(fn), callbacks = thenCallbacks, i = 0; i < last; ++i) { var maybePromise = tryConvertToPromise(arguments[i], ret); if (maybePromise instanceof Promise) { var bitField = (maybePromise = maybePromise._target())._bitField; 0 == (50397184 & bitField) ? (maybePromise._then(callbacks[i], reject, void 0, ret, holder), promiseSetters[i](maybePromise, holder), holder.asyncNeeded = !1) : 0 != (33554432 & bitField) ? callbacks[i].call(ret, maybePromise._value(), holder) : 0 != (16777216 & bitField) ? ret._reject(maybePromise._reason()) : ret._cancel(); } else callbacks[i].call(ret, maybePromise, holder); } if (!ret._isFateSealed()) { if (holder.asyncNeeded) { var domain = getDomain(); null !== domain && (holder.fn = util.domainBind(domain, holder.fn)); } ret._setAsyncGuaranteed(), ret._setOnCancel(holder); } return ret; } for (var $_len = arguments.length, args = new Array($_len), $_i = 0; $_i < $_len; ++$_i) args[$_i] = arguments[$_i]; fn && args.pop(); var ret = new PromiseArray(args).promise(); return void 0 !== fn ? ret.spread(fn) : ret; }; }; }, function(module, exports, __webpack_require__) { "use strict"; var cr = Object.create; if (cr) { var callerCache = cr(null), getterCache = cr(null); callerCache[" size"] = getterCache[" size"] = 0; } module.exports = function(Promise) { var getMethodCaller, getGetter, util = __webpack_require__(16), canEvaluate = util.canEvaluate, isIdentifier = util.isIdentifier, makeMethodCaller = function(methodName) { return new Function("ensureMethod", " \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g, methodName))(ensureMethod); }, makeGetter = function(propertyName) { return new Function("obj", " \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName", propertyName)); }, getCompiled = function(name, compiler, cache) { var ret = cache[name]; if ("function" != typeof ret) { if (!isIdentifier(name)) return null; if (ret = compiler(name), cache[name] = ret, cache[" size"]++, cache[" size"] > 512) { for (var keys = Object.keys(cache), i = 0; i < 256; ++i) delete cache[keys[i]]; cache[" size"] = keys.length - 256; } } return ret; }; function ensureMethod(obj, methodName) { var fn; if (null != obj && (fn = obj[methodName]), "function" != typeof fn) { var message = "Object " + util.classString(obj) + " has no method '" + util.toString(methodName) + "'"; throw new Promise.TypeError(message); } return fn; } function caller(obj) { return ensureMethod(obj, this.pop()).apply(obj, this); } function namedGetter(obj) { return obj[this]; } function indexedGetter(obj) { var index = +this; return index < 0 && (index = Math.max(0, index + obj.length)), obj[index]; } getMethodCaller = function(name) { return getCompiled(name, makeMethodCaller, callerCache); }, getGetter = function(name) { return getCompiled(name, makeGetter, getterCache); }, Promise.prototype.call = function(methodName) { for (var $_len = arguments.length, args = new Array(Math.max($_len - 1, 0)), $_i = 1; $_i < $_len; ++$_i) args[$_i - 1] = arguments[$_i]; if (canEvaluate) { var maybeCaller = getMethodCaller(methodName); if (null !== maybeCaller) return this._then(maybeCaller, void 0, void 0, args, void 0); } return args.push(methodName), this._then(caller, void 0, void 0, args, void 0); }, Promise.prototype.get = function(propertyName) { var getter; if ("number" == typeof propertyName) getter = indexedGetter; else if (canEvaluate) { var maybeGetter = getGetter(propertyName); getter = null !== maybeGetter ? maybeGetter : namedGetter; } else getter = namedGetter; return this._then(getter, void 0, void 0, propertyName, void 0); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug) { var TypeError = __webpack_require__(60).TypeError, util = __webpack_require__(16), errorObj = util.errorObj, tryCatch = util.tryCatch, yieldHandlers = []; function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { if (debug.cancellation()) { var internal = new Promise(INTERNAL), _finallyPromise = this._finallyPromise = new Promise(INTERNAL); this._promise = internal.lastly((function() { return _finallyPromise; })), internal._captureStackTrace(), internal._setOnCancel(this); } else (this._promise = new Promise(INTERNAL))._captureStackTrace(); this._stack = stack, this._generatorFunction = generatorFunction, this._receiver = receiver, this._generator = void 0, this._yieldHandlers = "function" == typeof yieldHandler ? [ yieldHandler ].concat(yieldHandlers) : yieldHandlers, this._yieldedPromise = null, this._cancellationPhase = !1; } util.inherits(PromiseSpawn, Proxyable), PromiseSpawn.prototype._isResolved = function() { return null === this._promise; }, PromiseSpawn.prototype._cleanup = function() { this._promise = this._generator = null, debug.cancellation() && null !== this._finallyPromise && (this._finallyPromise._fulfill(), this._finallyPromise = null); }, PromiseSpawn.prototype._promiseCancelled = function() { if (!this._isResolved()) { var result; if (void 0 !== this._generator.return) this._promise._pushContext(), result = tryCatch(this._generator.return).call(this._generator, void 0), this._promise._popContext(); else { var reason = new Promise.CancellationError("generator .return() sentinel"); Promise.coroutine.returnSentinel = reason, this._promise._attachExtraTrace(reason), this._promise._pushContext(), result = tryCatch(this._generator.throw).call(this._generator, reason), this._promise._popContext(); } this._cancellationPhase = !0, this._yieldedPromise = null, this._continue(result); } }, PromiseSpawn.prototype._promiseFulfilled = function(value) { this._yieldedPromise = null, this._promise._pushContext(); var result = tryCatch(this._generator.next).call(this._generator, value); this._promise._popContext(), this._continue(result); }, PromiseSpawn.prototype._promiseRejected = function(reason) { this._yieldedPromise = null, this._promise._attachExtraTrace(reason), this._promise._pushContext(); var result = tryCatch(this._generator.throw).call(this._generator, reason); this._promise._popContext(), this._continue(result); }, PromiseSpawn.prototype._resultCancelled = function() { if (this._yieldedPromise instanceof Promise) { var promise = this._yieldedPromise; this._yieldedPromise = null, promise.cancel(); } }, PromiseSpawn.prototype.promise = function() { return this._promise; }, PromiseSpawn.prototype._run = function() { this._generator = this._generatorFunction.call(this._receiver), this._receiver = this._generatorFunction = void 0, this._promiseFulfilled(void 0); }, PromiseSpawn.prototype._continue = function(result) { var promise = this._promise; if (result === errorObj) return this._cleanup(), this._cancellationPhase ? promise.cancel() : promise._rejectCallback(result.e, !1); var value = result.value; if (!0 === result.done) return this._cleanup(), this._cancellationPhase ? promise.cancel() : promise._resolveCallback(value); var maybePromise = tryConvertToPromise(value, this._promise); if (maybePromise instanceof Promise || (maybePromise = (function(value, yieldHandlers, traceParent) { for (var i = 0; i < yieldHandlers.length; ++i) { traceParent._pushContext(); var result = tryCatch(yieldHandlers[i])(value); if (traceParent._popContext(), result === errorObj) { traceParent._pushContext(); var ret = Promise.reject(errorObj.e); return traceParent._popContext(), ret; } var maybePromise = tryConvertToPromise(result, traceParent); if (maybePromise instanceof Promise) return maybePromise; } return null; })(maybePromise, this._yieldHandlers, this._promise), null !== maybePromise)) { var bitField = (maybePromise = maybePromise._target())._bitField; 0 == (50397184 & bitField) ? (this._yieldedPromise = maybePromise, maybePromise._proxy(this, null)) : 0 != (33554432 & bitField) ? Promise._async.invoke(this._promiseFulfilled, this, maybePromise._value()) : 0 != (16777216 & bitField) ? Promise._async.invoke(this._promiseRejected, this, maybePromise._reason()) : this._promiseCancelled(); } else this._promiseRejected(new TypeError("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s", String(value)) + "From coroutine:\n" + this._stack.split("\n").slice(1, -7).join("\n"))); }, Promise.coroutine = function(generatorFunction, options) { if ("function" != typeof generatorFunction) throw new TypeError("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n"); var yieldHandler = Object(options).yieldHandler, PromiseSpawn$ = PromiseSpawn, stack = (new Error).stack; return function() { var generator = generatorFunction.apply(this, arguments), spawn = new PromiseSpawn$(void 0, void 0, yieldHandler, stack), ret = spawn.promise(); return spawn._generator = generator, spawn._promiseFulfilled(void 0), ret; }; }, Promise.coroutine.addYieldHandler = function(fn) { if ("function" != typeof fn) throw new TypeError("expecting a function but got " + util.classString(fn)); yieldHandlers.push(fn); }, Promise.spawn = function(generatorFunction) { if (debug.deprecated("Promise.spawn()", "Promise.coroutine()"), "function" != typeof generatorFunction) return apiRejection("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n"); var spawn = new PromiseSpawn(generatorFunction, this), ret = spawn.promise(); return spawn._run(Promise.spawn), ret; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { var getDomain = Promise._getDomain, util = __webpack_require__(16), tryCatch = util.tryCatch, errorObj = util.errorObj, async = Promise._async; function MappingPromiseArray(promises, fn, limit, _filter) { this.constructor$(promises), this._promise._captureStackTrace(); var domain = getDomain(); this._callback = null === domain ? fn : util.domainBind(domain, fn), this._preservedValues = _filter === INTERNAL ? new Array(this.length()) : null, this._limit = limit, this._inFlight = 0, this._queue = [], async.invoke(this._asyncInit, this, void 0); } function map(promises, fn, options, _filter) { if ("function" != typeof fn) return apiRejection("expecting a function but got " + util.classString(fn)); var limit = 0; if (void 0 !== options) { if ("object" != typeof options || null === options) return Promise.reject(new TypeError("options argument must be an object but it is " + util.classString(options))); if ("number" != typeof options.concurrency) return Promise.reject(new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency))); limit = options.concurrency; } return new MappingPromiseArray(promises, fn, limit = "number" == typeof limit && isFinite(limit) && limit >= 1 ? limit : 0, _filter).promise(); } util.inherits(MappingPromiseArray, PromiseArray), MappingPromiseArray.prototype._asyncInit = function() { this._init$(void 0, -2); }, MappingPromiseArray.prototype._init = function() {}, MappingPromiseArray.prototype._promiseFulfilled = function(value, index) { var values = this._values, length = this.length(), preservedValues = this._preservedValues, limit = this._limit; if (index < 0) { if (values[index = -1 * index - 1] = value, limit >= 1 && (this._inFlight--, this._drainQueue(), this._isResolved())) return !0; } else { if (limit >= 1 && this._inFlight >= limit) return values[index] = value, this._queue.push(index), !1; null !== preservedValues && (preservedValues[index] = value); var promise = this._promise, callback = this._callback, receiver = promise._boundValue(); promise._pushContext(); var ret = tryCatch(callback).call(receiver, value, index, length), promiseCreated = promise._popContext(); if (debug.checkForgottenReturns(ret, promiseCreated, null !== preservedValues ? "Promise.filter" : "Promise.map", promise), ret === errorObj) return this._reject(ret.e), !0; var maybePromise = tryConvertToPromise(ret, this._promise); if (maybePromise instanceof Promise) { var bitField = (maybePromise = maybePromise._target())._bitField; if (0 == (50397184 & bitField)) return limit >= 1 && this._inFlight++, values[index] = maybePromise, maybePromise._proxy(this, -1 * (index + 1)), !1; if (0 == (33554432 & bitField)) return 0 != (16777216 & bitField) ? (this._reject(maybePromise._reason()), !0) : (this._cancel(), !0); ret = maybePromise._value(); } values[index] = ret; } return ++this._totalResolved >= length && (null !== preservedValues ? this._filter(values, preservedValues) : this._resolve(values), !0); }, MappingPromiseArray.prototype._drainQueue = function() { for (var queue = this._queue, limit = this._limit, values = this._values; queue.length > 0 && this._inFlight < limit; ) { if (this._isResolved()) return; var index = queue.pop(); this._promiseFulfilled(values[index], index); } }, MappingPromiseArray.prototype._filter = function(booleans, values) { for (var len = values.length, ret = new Array(len), j = 0, i = 0; i < len; ++i) booleans[i] && (ret[j++] = values[i]); ret.length = j, this._resolve(ret); }, MappingPromiseArray.prototype.preservedValues = function() { return this._preservedValues; }, Promise.prototype.map = function(fn, options) { return map(this, fn, options, null); }, Promise.map = function(promises, fn, options, _filter) { return map(promises, fn, options, _filter); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var util = __webpack_require__(16), async = Promise._async, tryCatch = util.tryCatch, errorObj = util.errorObj; function spreadAdapter(val, nodeback) { if (!util.isArray(val)) return successAdapter.call(this, val, nodeback); var ret = tryCatch(nodeback).apply(this._boundValue(), [ null ].concat(val)); ret === errorObj && async.throwLater(ret.e); } function successAdapter(val, nodeback) { var receiver = this._boundValue(), ret = void 0 === val ? tryCatch(nodeback).call(receiver, null) : tryCatch(nodeback).call(receiver, null, val); ret === errorObj && async.throwLater(ret.e); } function errorAdapter(reason, nodeback) { if (!reason) { var newReason = new Error(reason + ""); newReason.cause = reason, reason = newReason; } var ret = tryCatch(nodeback).call(this._boundValue(), reason); ret === errorObj && async.throwLater(ret.e); } Promise.prototype.asCallback = Promise.prototype.nodeify = function(nodeback, options) { if ("function" == typeof nodeback) { var adapter = successAdapter; void 0 !== options && Object(options).spread && (adapter = spreadAdapter), this._then(adapter, errorAdapter, void 0, this, nodeback); } return this; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var THIS = {}, util = __webpack_require__(16), nodebackForPromise = __webpack_require__(477), withAppended = util.withAppended, maybeWrapAsError = util.maybeWrapAsError, canEvaluate = util.canEvaluate, TypeError = __webpack_require__(60).TypeError, defaultPromisified = { __isPromisified__: !0 }, noCopyPropsPattern = new RegExp("^(?:" + [ "arity", "length", "name", "arguments", "caller", "callee", "prototype", "__isPromisified__" ].join("|") + ")$"), defaultFilter = function(name) { return util.isIdentifier(name) && "_" !== name.charAt(0) && "constructor" !== name; }; function propsFilter(key) { return !noCopyPropsPattern.test(key); } function isPromisified(fn) { try { return !0 === fn.__isPromisified__; } catch (e) { return !1; } } function hasPromisified(obj, key, suffix) { var val = util.getDataPropertyOrDefault(obj, key + suffix, defaultPromisified); return !!val && isPromisified(val); } var makeNodePromisified = canEvaluate ? function(callback, receiver, originalName, fn, _, multiArgs) { var newParameterCount = Math.max(0, (function(fn) { return "number" == typeof fn.length ? Math.max(Math.min(fn.length, 1024), 0) : 0; })(fn) - 1), argumentOrder = (function(likelyArgumentCount) { for (var ret = [ likelyArgumentCount ], min = Math.max(0, likelyArgumentCount - 1 - 3), i = likelyArgumentCount - 1; i >= min; --i) ret.push(i); for (i = likelyArgumentCount + 1; i <= 3; ++i) ret.push(i); return ret; })(newParameterCount), shouldProxyThis = "string" == typeof callback || receiver === THIS; var parameterCount, getFunctionCode = "string" == typeof callback ? "this != null ? this['" + callback + "'] : fn" : "fn", body = "'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]", (function() { for (var ret = "", i = 0; i < argumentOrder.length; ++i) ret += "case " + argumentOrder[i] + ":" + (count = argumentOrder[i], argumentCount = void 0, args = void 0, comma = void 0, args = (argumentCount = count, util.filledRange(argumentCount, "_arg", "")).join(", "), comma = count > 0 ? ", " : "", (shouldProxyThis ? "ret = callback.call(this, {{args}}, nodeback); break;\n" : void 0 === receiver ? "ret = callback({{args}}, nodeback); break;\n" : "ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}", args).replace(", ", comma)); var count, argumentCount, args, comma; return ret + " \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]", shouldProxyThis ? "ret = callback.apply(this, args);\n" : "ret = callback.apply(receiver, args);\n"); })()).replace("[GetFunctionCode]", getFunctionCode); return body = body.replace("Parameters", (parameterCount = newParameterCount, util.filledRange(Math.max(parameterCount, 3), "_arg", ""))), new Function("Promise", "fn", "receiver", "withAppended", "maybeWrapAsError", "nodebackForPromise", "tryCatch", "errorObj", "notEnumerableProp", "INTERNAL", body)(Promise, fn, receiver, withAppended, maybeWrapAsError, nodebackForPromise, util.tryCatch, util.errorObj, util.notEnumerableProp, INTERNAL); } : function(callback, receiver, _, fn, __, multiArgs) { var defaultThis = (function() { return this; })(), method = callback; function promisified() { var _receiver = receiver; receiver === THIS && (_receiver = this); var promise = new Promise(INTERNAL); promise._captureStackTrace(); var cb = "string" == typeof method && this !== defaultThis ? this[method] : callback, fn = nodebackForPromise(promise, multiArgs); try { cb.apply(_receiver, withAppended(arguments, fn)); } catch (e) { promise._rejectCallback(maybeWrapAsError(e), !0, !0); } return promise._isFateSealed() || promise._setAsyncGuaranteed(), promise; } return "string" == typeof method && (callback = fn), util.notEnumerableProp(promisified, "__isPromisified__", !0), promisified; }; function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { for (var suffixRegexp = new RegExp(suffix.replace(/([$])/, "\\$") + "$"), methods = (function(obj, suffix, suffixRegexp, filter) { for (var keys = util.inheritedDataKeys(obj), ret = [], i = 0; i < keys.length; ++i) { var key = keys[i], value = obj[key], passesDefaultFilter = filter === defaultFilter || defaultFilter(key); "function" != typeof value || isPromisified(value) || hasPromisified(obj, key, suffix) || !filter(key, value, obj, passesDefaultFilter) || ret.push(key, value); } return (function(ret, suffix, suffixRegexp) { for (var i = 0; i < ret.length; i += 2) { var key = ret[i]; if (suffixRegexp.test(key)) for (var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""), j = 0; j < ret.length; j += 2) if (ret[j] === keyWithoutAsyncSuffix) throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s", suffix)); } })(ret, suffix, suffixRegexp), ret; })(obj, suffix, suffixRegexp, filter), i = 0, len = methods.length; i < len; i += 2) { var key = methods[i], fn = methods[i + 1], promisifiedKey = key + suffix; if (promisifier === makeNodePromisified) obj[promisifiedKey] = makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); else { var promisified = promisifier(fn, (function() { return makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); })); util.notEnumerableProp(promisified, "__isPromisified__", !0), obj[promisifiedKey] = promisified; } } return util.toFastProperties(obj), obj; } Promise.promisify = function(fn, options) { if ("function" != typeof fn) throw new TypeError("expecting a function but got " + util.classString(fn)); if (isPromisified(fn)) return fn; var callback, receiver, multiArgs, ret = (callback = fn, receiver = void 0 === (options = Object(options)).context ? THIS : options.context, multiArgs = !!options.multiArgs, makeNodePromisified(callback, receiver, void 0, callback, null, multiArgs)); return util.copyDescriptors(fn, ret, propsFilter), ret; }, Promise.promisifyAll = function(target, options) { if ("function" != typeof target && "object" != typeof target) throw new TypeError("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n"); var multiArgs = !!(options = Object(options)).multiArgs, suffix = options.suffix; "string" != typeof suffix && (suffix = "Async"); var filter = options.filter; "function" != typeof filter && (filter = defaultFilter); var promisifier = options.promisifier; if ("function" != typeof promisifier && (promisifier = makeNodePromisified), !util.isIdentifier(suffix)) throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n"); for (var keys = util.inheritedDataKeys(target), i = 0; i < keys.length; ++i) { var value = target[keys[i]]; "constructor" !== keys[i] && util.isClass(value) && (promisifyAll(value.prototype, suffix, filter, promisifier, multiArgs), promisifyAll(value, suffix, filter, promisifier, multiArgs)); } return promisifyAll(target, suffix, filter, promisifier, multiArgs); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, tryConvertToPromise, apiRejection) { var Es6Map, util = __webpack_require__(16), isObject = util.isObject, es5 = __webpack_require__(75); "function" == typeof Map && (Es6Map = Map); var mapToEntries = (function() { var index = 0, size = 0; function extractEntry(value, key) { this[index] = value, this[index + size] = key, index++; } return function(map) { size = map.size, index = 0; var ret = new Array(2 * map.size); return map.forEach(extractEntry, ret), ret; }; })(); function PropertiesPromiseArray(obj) { var entries, isMap = !1; if (void 0 !== Es6Map && obj instanceof Es6Map) entries = mapToEntries(obj), isMap = !0; else { var keys = es5.keys(obj), len = keys.length; entries = new Array(2 * len); for (var i = 0; i < len; ++i) { var key = keys[i]; entries[i] = obj[key], entries[i + len] = key; } } this.constructor$(entries), this._isMap = isMap, this._init$(void 0, isMap ? -6 : -3); } function props(promises) { var ret, castValue = tryConvertToPromise(promises); return isObject(castValue) ? (ret = castValue instanceof Promise ? castValue._then(Promise.props, void 0, void 0, void 0, void 0) : new PropertiesPromiseArray(castValue).promise(), castValue instanceof Promise && ret._propagateFrom(castValue, 2), ret) : apiRejection("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n"); } util.inherits(PropertiesPromiseArray, PromiseArray), PropertiesPromiseArray.prototype._init = function() {}, PropertiesPromiseArray.prototype._promiseFulfilled = function(value, index) { if (this._values[index] = value, ++this._totalResolved >= this._length) { var val; if (this._isMap) val = (function(entries) { for (var ret = new Es6Map, length = entries.length / 2 | 0, i = 0; i < length; ++i) { var key = entries[length + i], value = entries[i]; ret.set(key, value); } return ret; })(this._values); else { val = {}; for (var keyOffset = this.length(), i = 0, len = this.length(); i < len; ++i) val[this._values[i + keyOffset]] = this._values[i]; } return this._resolve(val), !0; } return !1; }, PropertiesPromiseArray.prototype.shouldCopyValues = function() { return !1; }, PropertiesPromiseArray.prototype.getActualLength = function(len) { return len >> 1; }, Promise.prototype.props = function() { return props(this); }, Promise.props = function(promises) { return props(promises); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection) { var util = __webpack_require__(16); function race(promises, parent) { var promise, maybePromise = tryConvertToPromise(promises); if (maybePromise instanceof Promise) return (promise = maybePromise).then((function(array) { return race(array, promise); })); if (null === (promises = util.asArray(promises))) return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); var ret = new Promise(INTERNAL); void 0 !== parent && ret._propagateFrom(parent, 3); for (var fulfill = ret._fulfill, reject = ret._reject, i = 0, len = promises.length; i < len; ++i) { var val = promises[i]; (void 0 !== val || i in promises) && Promise.cast(val)._then(fulfill, reject, void 0, ret, null); } return ret; } Promise.race = function(promises) { return race(promises, void 0); }, Promise.prototype.race = function() { return race(this, void 0); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { var getDomain = Promise._getDomain, util = __webpack_require__(16), tryCatch = util.tryCatch; function ReductionPromiseArray(promises, fn, initialValue, _each) { this.constructor$(promises); var domain = getDomain(); this._fn = null === domain ? fn : util.domainBind(domain, fn), void 0 !== initialValue && (initialValue = Promise.resolve(initialValue))._attachCancellationCallback(this), this._initialValue = initialValue, this._currentCancellable = null, this._eachValues = _each === INTERNAL ? Array(this._length) : 0 === _each ? null : void 0, this._promise._captureStackTrace(), this._init$(void 0, -5); } function completed(valueOrReason, array) { this.isFulfilled() ? array._resolve(valueOrReason) : array._reject(valueOrReason); } function reduce(promises, fn, initialValue, _each) { return "function" != typeof fn ? apiRejection("expecting a function but got " + util.classString(fn)) : new ReductionPromiseArray(promises, fn, initialValue, _each).promise(); } function gotAccum(accum) { this.accum = accum, this.array._gotAccum(accum); var value = tryConvertToPromise(this.value, this.array._promise); return value instanceof Promise ? (this.array._currentCancellable = value, value._then(gotValue, void 0, void 0, this, void 0)) : gotValue.call(this, value); } function gotValue(value) { var ret, array = this.array, promise = array._promise, fn = tryCatch(array._fn); promise._pushContext(), (ret = void 0 !== array._eachValues ? fn.call(promise._boundValue(), value, this.index, this.length) : fn.call(promise._boundValue(), this.accum, value, this.index, this.length)) instanceof Promise && (array._currentCancellable = ret); var promiseCreated = promise._popContext(); return debug.checkForgottenReturns(ret, promiseCreated, void 0 !== array._eachValues ? "Promise.each" : "Promise.reduce", promise), ret; } util.inherits(ReductionPromiseArray, PromiseArray), ReductionPromiseArray.prototype._gotAccum = function(accum) { void 0 !== this._eachValues && null !== this._eachValues && accum !== INTERNAL && this._eachValues.push(accum); }, ReductionPromiseArray.prototype._eachComplete = function(value) { return null !== this._eachValues && this._eachValues.push(value), this._eachValues; }, ReductionPromiseArray.prototype._init = function() {}, ReductionPromiseArray.prototype._resolveEmptyArray = function() { this._resolve(void 0 !== this._eachValues ? this._eachValues : this._initialValue); }, ReductionPromiseArray.prototype.shouldCopyValues = function() { return !1; }, ReductionPromiseArray.prototype._resolve = function(value) { this._promise._resolveCallback(value), this._values = null; }, ReductionPromiseArray.prototype._resultCancelled = function(sender) { if (sender === this._initialValue) return this._cancel(); this._isResolved() || (this._resultCancelled$(), this._currentCancellable instanceof Promise && this._currentCancellable.cancel(), this._initialValue instanceof Promise && this._initialValue.cancel()); }, ReductionPromiseArray.prototype._iterate = function(values) { var value, i; this._values = values; var length = values.length; if (void 0 !== this._initialValue ? (value = this._initialValue, i = 0) : (value = Promise.resolve(values[0]), i = 1), this._currentCancellable = value, !value.isRejected()) for (;i < length; ++i) { var ctx = { accum: null, value: values[i], index: i, length: length, array: this }; value = value._then(gotAccum, void 0, void 0, ctx, void 0); } void 0 !== this._eachValues && (value = value._then(this._eachComplete, void 0, void 0, this, void 0)), value._then(completed, completed, void 0, value, this); }, Promise.prototype.reduce = function(fn, initialValue) { return reduce(this, fn, initialValue, null); }, Promise.reduce = function(promises, fn, initialValue, _each) { return reduce(promises, fn, initialValue, _each); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, debug) { var PromiseInspection = Promise.PromiseInspection; function SettledPromiseArray(values) { this.constructor$(values); } __webpack_require__(16).inherits(SettledPromiseArray, PromiseArray), SettledPromiseArray.prototype._promiseResolved = function(index, inspection) { return this._values[index] = inspection, ++this._totalResolved >= this._length && (this._resolve(this._values), !0); }, SettledPromiseArray.prototype._promiseFulfilled = function(value, index) { var ret = new PromiseInspection; return ret._bitField = 33554432, ret._settledValueField = value, this._promiseResolved(index, ret); }, SettledPromiseArray.prototype._promiseRejected = function(reason, index) { var ret = new PromiseInspection; return ret._bitField = 16777216, ret._settledValueField = reason, this._promiseResolved(index, ret); }, Promise.settle = function(promises) { return debug.deprecated(".settle()", ".reflect()"), new SettledPromiseArray(promises).promise(); }, Promise.prototype.settle = function() { return Promise.settle(this); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection) { var util = __webpack_require__(16), RangeError = __webpack_require__(60).RangeError, AggregateError = __webpack_require__(60).AggregateError, isArray = util.isArray, CANCELLATION = {}; function SomePromiseArray(values) { this.constructor$(values), this._howMany = 0, this._unwrap = !1, this._initialized = !1; } function some(promises, howMany) { if ((0 | howMany) !== howMany || howMany < 0) return apiRejection("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n"); var ret = new SomePromiseArray(promises), promise = ret.promise(); return ret.setHowMany(howMany), ret.init(), promise; } util.inherits(SomePromiseArray, PromiseArray), SomePromiseArray.prototype._init = function() { if (this._initialized) if (0 !== this._howMany) { this._init$(void 0, -5); var isArrayResolved = isArray(this._values); !this._isResolved() && isArrayResolved && this._howMany > this._canPossiblyFulfill() && this._reject(this._getRangeError(this.length())); } else this._resolve([]); }, SomePromiseArray.prototype.init = function() { this._initialized = !0, this._init(); }, SomePromiseArray.prototype.setUnwrap = function() { this._unwrap = !0; }, SomePromiseArray.prototype.howMany = function() { return this._howMany; }, SomePromiseArray.prototype.setHowMany = function(count) { this._howMany = count; }, SomePromiseArray.prototype._promiseFulfilled = function(value) { return this._addFulfilled(value), this._fulfilled() === this.howMany() && (this._values.length = this.howMany(), 1 === this.howMany() && this._unwrap ? this._resolve(this._values[0]) : this._resolve(this._values), !0); }, SomePromiseArray.prototype._promiseRejected = function(reason) { return this._addRejected(reason), this._checkOutcome(); }, SomePromiseArray.prototype._promiseCancelled = function() { return this._values instanceof Promise || null == this._values ? this._cancel() : (this._addRejected(CANCELLATION), this._checkOutcome()); }, SomePromiseArray.prototype._checkOutcome = function() { if (this.howMany() > this._canPossiblyFulfill()) { for (var e = new AggregateError, i = this.length(); i < this._values.length; ++i) this._values[i] !== CANCELLATION && e.push(this._values[i]); return e.length > 0 ? this._reject(e) : this._cancel(), !0; } return !1; }, SomePromiseArray.prototype._fulfilled = function() { return this._totalResolved; }, SomePromiseArray.prototype._rejected = function() { return this._values.length - this.length(); }, SomePromiseArray.prototype._addRejected = function(reason) { this._values.push(reason); }, SomePromiseArray.prototype._addFulfilled = function(value) { this._values[this._totalResolved++] = value; }, SomePromiseArray.prototype._canPossiblyFulfill = function() { return this.length() - this._rejected(); }, SomePromiseArray.prototype._getRangeError = function(count) { var message = "Input array must contain at least " + this._howMany + " items but contains only " + count + " items"; return new RangeError(message); }, SomePromiseArray.prototype._resolveEmptyArray = function() { this._reject(this._getRangeError(0)); }, Promise.some = function(promises, howMany) { return some(promises, howMany); }, Promise.prototype.some = function(howMany) { return some(this, howMany); }, Promise._SomePromiseArray = SomePromiseArray; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, debug) { var util = __webpack_require__(16), TimeoutError = Promise.TimeoutError; function HandleWrapper(handle) { this.handle = handle; } HandleWrapper.prototype._resultCancelled = function() { clearTimeout(this.handle); }; var afterValue = function(value) { return delay(+this).thenReturn(value); }, delay = Promise.delay = function(ms, value) { var ret, handle; return void 0 !== value ? (ret = Promise.resolve(value)._then(afterValue, null, null, ms, void 0), debug.cancellation() && value instanceof Promise && ret._setOnCancel(value)) : (ret = new Promise(INTERNAL), handle = setTimeout((function() { ret._fulfill(); }), +ms), debug.cancellation() && ret._setOnCancel(new HandleWrapper(handle)), ret._captureStackTrace()), ret._setAsyncGuaranteed(), ret; }; function successClear(value) { return clearTimeout(this.handle), value; } function failureClear(reason) { throw clearTimeout(this.handle), reason; } Promise.prototype.delay = function(ms) { return delay(ms, this); }, Promise.prototype.timeout = function(ms, message) { var ret, parent; ms = +ms; var handleWrapper = new HandleWrapper(setTimeout((function() { ret.isPending() && (function(promise, message, parent) { var err; err = "string" != typeof message ? message instanceof Error ? message : new TimeoutError("operation timed out") : new TimeoutError(message), util.markAsOriginatingFromRejection(err), promise._attachExtraTrace(err), promise._reject(err), null != parent && parent.cancel(); })(ret, message, parent); }), ms)); return debug.cancellation() ? (parent = this.then(), (ret = parent._then(successClear, failureClear, void 0, handleWrapper, void 0))._setOnCancel(handleWrapper)) : ret = this._then(successClear, failureClear, void 0, handleWrapper, void 0), ret; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug) { var util = __webpack_require__(16), TypeError = __webpack_require__(60).TypeError, inherits = __webpack_require__(16).inherits, errorObj = util.errorObj, tryCatch = util.tryCatch, NULL = {}; function thrower(e) { setTimeout((function() { throw e; }), 0); } function dispose(resources, inspection) { var i = 0, len = resources.length, ret = new Promise(INTERNAL); return (function iterator() { if (i >= len) return ret._fulfill(); var maybePromise = (function(thenable) { var maybePromise = tryConvertToPromise(thenable); return maybePromise !== thenable && "function" == typeof thenable._isDisposable && "function" == typeof thenable._getDisposer && thenable._isDisposable() && maybePromise._setDisposable(thenable._getDisposer()), maybePromise; })(resources[i++]); if (maybePromise instanceof Promise && maybePromise._isDisposable()) { try { maybePromise = tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection), resources.promise); } catch (e) { return thrower(e); } if (maybePromise instanceof Promise) return maybePromise._then(iterator, thrower, null, null, null); } iterator(); })(), ret; } function Disposer(data, promise, context) { this._data = data, this._promise = promise, this._context = context; } function FunctionDisposer(fn, promise, context) { this.constructor$(fn, promise, context); } function maybeUnwrapDisposer(value) { return Disposer.isDisposer(value) ? (this.resources[this.index]._setDisposable(value), value.promise()) : value; } function ResourceList(length) { this.length = length, this.promise = null, this[length - 1] = null; } Disposer.prototype.data = function() { return this._data; }, Disposer.prototype.promise = function() { return this._promise; }, Disposer.prototype.resource = function() { return this.promise().isFulfilled() ? this.promise().value() : NULL; }, Disposer.prototype.tryDispose = function(inspection) { var resource = this.resource(), context = this._context; void 0 !== context && context._pushContext(); var ret = resource !== NULL ? this.doDispose(resource, inspection) : null; return void 0 !== context && context._popContext(), this._promise._unsetDisposable(), this._data = null, ret; }, Disposer.isDisposer = function(d) { return null != d && "function" == typeof d.resource && "function" == typeof d.tryDispose; }, inherits(FunctionDisposer, Disposer), FunctionDisposer.prototype.doDispose = function(resource, inspection) { return this.data().call(resource, resource, inspection); }, ResourceList.prototype._resultCancelled = function() { for (var len = this.length, i = 0; i < len; ++i) { var item = this[i]; item instanceof Promise && item.cancel(); } }, Promise.using = function() { var len = arguments.length; if (len < 2) return apiRejection("you must pass at least 2 arguments to Promise.using"); var input, fn = arguments[len - 1]; if ("function" != typeof fn) return apiRejection("expecting a function but got " + util.classString(fn)); var spreadArgs = !0; 2 === len && Array.isArray(arguments[0]) ? (len = (input = arguments[0]).length, spreadArgs = !1) : (input = arguments, len--); for (var resources = new ResourceList(len), i = 0; i < len; ++i) { var resource = input[i]; if (Disposer.isDisposer(resource)) { var disposer = resource; (resource = resource.promise())._setDisposable(disposer); } else { var maybePromise = tryConvertToPromise(resource); maybePromise instanceof Promise && (resource = maybePromise._then(maybeUnwrapDisposer, null, null, { resources: resources, index: i }, void 0)); } resources[i] = resource; } var reflectedResources = new Array(resources.length); for (i = 0; i < reflectedResources.length; ++i) reflectedResources[i] = Promise.resolve(resources[i]).reflect(); var resultPromise = Promise.all(reflectedResources).then((function(inspections) { for (var i = 0; i < inspections.length; ++i) { var inspection = inspections[i]; if (inspection.isRejected()) return errorObj.e = inspection.error(), errorObj; if (!inspection.isFulfilled()) return void resultPromise.cancel(); inspections[i] = inspection.value(); } promise._pushContext(), fn = tryCatch(fn); var ret = spreadArgs ? fn.apply(void 0, inspections) : fn(inspections), promiseCreated = promise._popContext(); return debug.checkForgottenReturns(ret, promiseCreated, "Promise.using", promise), ret; })), promise = resultPromise.lastly((function() { var inspection = new Promise.PromiseInspection(resultPromise); return dispose(resources, inspection); })); return resources.promise = promise, promise._setOnCancel(resources), promise; }, Promise.prototype._setDisposable = function(disposer) { this._bitField = 131072 | this._bitField, this._disposer = disposer; }, Promise.prototype._isDisposable = function() { return (131072 & this._bitField) > 0; }, Promise.prototype._getDisposer = function() { return this._disposer; }, Promise.prototype._unsetDisposable = function() { this._bitField = -131073 & this._bitField, this._disposer = void 0; }, Promise.prototype.disposer = function(fn) { if ("function" == typeof fn) return new FunctionDisposer(fn, this, createContext()); throw new TypeError; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var SomePromiseArray = Promise._SomePromiseArray; function any(promises) { var ret = new SomePromiseArray(promises), promise = ret.promise(); return ret.setHowMany(1), ret.setUnwrap(), ret.init(), promise; } Promise.any = function(promises) { return any(promises); }, Promise.prototype.any = function() { return any(this); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var PromiseReduce = Promise.reduce, PromiseAll = Promise.all; function promiseAllThis() { return PromiseAll(this); } Promise.prototype.each = function(fn) { return PromiseReduce(this, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, this, void 0); }, Promise.prototype.mapSeries = function(fn) { return PromiseReduce(this, fn, INTERNAL, INTERNAL); }, Promise.each = function(promises, fn) { return PromiseReduce(promises, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, promises, void 0); }, Promise.mapSeries = function(promises, fn) { return PromiseReduce(promises, fn, INTERNAL, INTERNAL); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var PromiseMap = Promise.map; Promise.prototype.filter = function(fn, options) { return PromiseMap(this, fn, options, INTERNAL); }, Promise.filter = function(promises, fn, options) { return PromiseMap(promises, fn, options, INTERNAL); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { Server: __webpack_require__(994), Client: __webpack_require__(997), Core: __webpack_require__(236) }; }, function(module, exports, __webpack_require__) { "use strict"; !(function() { var inherits = __webpack_require__(0).inherits, EventEmitter = __webpack_require__(4).EventEmitter, constants = __webpack_require__(235), extend = __webpack_require__(157), SSDP = __webpack_require__(236), uuidV4 = __webpack_require__(158), self = function(opts) { opts = opts || {}, this.advertisementInterval = opts.advertisementInterval || 1e4, this.description = opts.description || "upnp/desc.php", this.packetTtl = opts.packetTtl || 1800, this.suppressRootDeviceAdvertisement = opts.suppressRootDeviceAdvertisement || !1, this.extraHeaders = opts.headers || {}, this.passive = opts.passiveResponder || !1, this.queryAuthenticator = "function" == typeof opts.queryAuthenticator && opts.queryAuthenticator, this.usns = [], this.location = opts.location || "http://127.0.0.1/upnp/desc.html", this.udn = opts.udn || "uuid:" + uuidV4(), this.suppressRootDeviceAdvertisement || (this.usns[this.udn] = this.udn), opts.bindPort = 1900, this.ssdp = new SSDP(opts), this.timer = !1; }; inherits(self, EventEmitter), self.prototype.start = function() { var that = this; this.ssdp.on("start", (function() { that.emit("start", !0), that.timer = setInterval((function() { that.advertise(); }), that.advertisementInterval), that.advertise(); })), this.ssdp.on("delay", (function(obj) { that.emit("delay", obj); })), this.ssdp.on("error", (function(err) { that.emit("error", { type: "ssdp", error: err }); })), this.ssdp.on("msearch", (function(headers, statusCode, rinfo) { that.emit("msearch", headers, statusCode, rinfo), that.respondToSearch(headers.ST, rinfo); })), this.ssdp.on("send", (function(msg, ip, port) { that.emit("send", msg, ip, port); })), this.ssdp.start(); }, self.prototype.stop = function() { this.timer && clearInterval(this.timer), this.ssdp.stop(); }, self.prototype.advertise = function(service) { if (!this.timer) { var that = this; this.on("start", (function() { that.advertise(service); })), this.start(); } if (service && this.addUSN(service), !this.passive) for (var usn in this.usns) { var udn = this.usns[usn], nts = constants.alive, headers = { HOST: this.ssdp.host, NT: usn, NTS: nts, USN: udn, LOCATION: this.location, "CACHE-CONTROL": "max-age=" + this.packetTtl, SERVER: this.ssdp.sig }; extend(headers, this.extraHeaders); var message = this.ssdp.getSSDPHeader(constants.notify, headers); this.ssdp.send(new Buffer(message)), this.emit("advertise", message); } }, self.prototype.addUSN = function(device) { this.usns[device] = this.udn + "::" + device; }, self.prototype.respondToSearch = function(serviceType, rinfo) { var acceptor, stRegex, peer = { address: rinfo.address, port: rinfo.port }; if (!this.queryAuthenticator || this.queryAuthenticator(serviceType, rinfo)) for (var usn in '"' === serviceType[0] && '"' === serviceType[serviceType.length - 1] && (serviceType = serviceType.slice(1, -1)), this.allowWildcards ? (stRegex = new RegExp(serviceType.replace(/\*/g, ".*") + "$"), acceptor = function(usn, serviceType) { return serviceType === constants.all || stRegex.test(usn); }) : acceptor = function(usn, serviceType) { return serviceType === constants.all || usn === serviceType; }, this.usns) { var udn = this.usns[usn]; if (this.allowWildcards && (udn = udn.replace(stRegex, serviceType)), acceptor(usn, serviceType)) { var pkt = this.ssdp.getSSDPHeader("200 OK", extend({ ST: serviceType === constants.all ? usn : serviceType, USN: udn, LOCATION: this.location, "CACHE-CONTROL": "max-age=" + this.packetTtl, DATE: (new Date).toUTCString(), SERVER: this.sig, EXT: "" }, this.extraHeaders), !0); this.emit("respondToSearch", peer.addr, peer.port); var message = new Buffer(pkt); this.ssdp.send(message, peer.address, peer.port); } } }, module.exports = self; })(); }, function(module, exports, __webpack_require__) { var crypto = __webpack_require__(6); module.exports = function() { return crypto.randomBytes(16); }; }, function(module, exports) { for (var byteToHex = [], i = 0; i < 256; ++i) byteToHex[i] = (i + 256).toString(16).substr(1); module.exports = function(buf, offset) { var i = offset || 0, bth = byteToHex; return [ bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], "-", bth[buf[i++]], bth[buf[i++]], "-", bth[buf[i++]], bth[buf[i++]], "-", bth[buf[i++]], bth[buf[i++]], "-", bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]] ].join(""); }; }, function(module, exports, __webpack_require__) { "use strict"; !(function() { var inherits = __webpack_require__(0).inherits, EventEmitter = __webpack_require__(4).EventEmitter, constants = __webpack_require__(235), SSDP = __webpack_require__(236), self = function(opts) { opts = opts || {}, this.searchInterval = opts.searchInterval || 1e4, this.ssdp = new SSDP(opts), this.timer = !1; }; inherits(self, EventEmitter), self.prototype.start = function() { var that = this; this.ssdp.on("start", (function() { that.emit("start", !0); })), this.ssdp.on("delay", (function(obj) { that.emit("delay", obj); })), this.ssdp.on("error", (function(err) { that.emit("error", { type: "ssdp", error: err }); })), this.ssdp.on("bind", (function(socket) { that.emit("bind", socket); })), this.ssdp.on("response", (function(headers, statusCode, rinfo) { that.processResponse(headers, statusCode, rinfo); })), this.ssdp.on("send", (function(msg, ip, port) { that.emit("send", msg, ip, port); })), this.ssdp.start(); }, self.prototype.stop = function() { this.timer && clearInterval(this.timer), this.ssdp.stop(); }, self.prototype.browse = function(serviceType) { var that = this; if (!this.ssdp.running) return this.on("start", (function() { that.browse(serviceType); })), this.start(); var pkt = this.ssdp.getSSDPHeader(constants.msearch, { HOST: this.ssdp.host, ST: serviceType, MAN: '"ssdp:discover"', MX: 3 }), message = new Buffer(pkt), search = function() { that.emit("msearch", message), that.ssdp.send(message); }; search(), this.timer = setInterval((function() { search(); }), this.searchInterval); }, self.prototype.processResponse = function(headers, statusCode, rInfo) { this.emit("response", { headers: headers, statusCode: statusCode, referrer: rInfo }); }, module.exports = self; })(); }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(479); var castingUtils = __webpack_require__(233), querystring = __webpack_require__(24), Promise = __webpack_require__(234), Client = __webpack_require__(999).Client, util = __webpack_require__(0), Player = __webpack_require__(482); function ChromecastClient(device, executables) { Player.call(this, device), this.audio = { tracks: [], currentTrack: null }, this.seekTime = 0, this.stateFlags = 1, this.msgId = 0, this.sessionHeartbeat = null, this.sessionStatus = null, this.mediaSender = null, this.mediaReceiver = null, this.mediaSessionStatus = {}, this.executables = executables, this.device = device, this._conformStatus = this._conformStatus.bind(this), this.client = new Client, this.client.on("error", (function(err) { console.log("ChromeCast client error", err); })); } util.inherits(ChromecastClient, Player), ChromecastClient.APP_ID = "74B9F456", ChromecastClient.MESSAGE_TIMEOUT = 5e3, ChromecastClient.PLAYBACK_DELAY = 4e3, ChromecastClient.DEFAULT_SENDER = "sender-0", ChromecastClient.DEFAULT_RECEIVER = "receiver-0", ChromecastClient.channelsNS = { connection: "urn:x-cast:com.google.cast.tp.connection", heartbeat: "urn:x-cast:com.google.cast.tp.heartbeat", receiver: "urn:x-cast:com.google.cast.receiver", media: "urn:x-cast:com.google.cast.media" }, ChromecastClient.mapState = function(statusText) { return { "Ready To Cast": 6, BUFFERING: 2, PLAYING: 3, PAUSED: 4, STOPPED: 5, NO_MEDIA_PRESENT: 6, ERROR_OCCURRED: 7 }[statusText]; }, ChromecastClient.prototype.request = function(ns, msg, sender, receiver) { sender = sender || ChromecastClient.DEFAULT_SENDER, receiver = receiver || ChromecastClient.DEFAULT_RECEIVER, this.client.send(sender, receiver, ns, JSON.stringify(msg)); }, ChromecastClient.prototype.requestResponse = function(ns, msg, sender, receiver) { var self = this; return sender = sender || ChromecastClient.DEFAULT_SENDER, receiver = receiver || ChromecastClient.DEFAULT_RECEIVER, new Promise((function(resolve, reject) { var messageTimeout = setTimeout((function() { self.client.removeListener("message", getMessage), reject("Response timeout for " + ns + " with session ID: " + receiver); }), ChromecastClient.MESSAGE_TIMEOUT); if ("PING" !== msg.type) { var requestId = ++self.msgId; msg.requestId = requestId; } function getMessage(sourceId, destinationId, namespace, data) { if (sourceId == receiver && (destinationId === sender || "*" === destinationId) && namespace === ns) { var response = JSON.parse(data); if ("PONG" === response.type || response.requestId === requestId) return self.client.removeListener("message", getMessage), clearTimeout(messageTimeout), "INVALID_REQUEST" === response.type ? reject("Invalid request: " + response.reason) : resolve(response); } } self.client.on("message", getMessage), self.request(ns, msg, sender, receiver); })); }, ChromecastClient.prototype._disconnect = function() { this.client.socket && (this.request(ChromecastClient.channelsNS.connection, { type: "CLOSE" }), this.client.close()); }, ChromecastClient.prototype._connect = function() { var self = this; return this.client.ps ? self.requestResponse(ChromecastClient.channelsNS.receiver, { type: "GET_STATUS" }) : (this._disconnect(), new Promise((function(resolve, reject) { self.client.connect(self.device.host, (function() { self.request(ChromecastClient.channelsNS.connection, { type: "CONNECT" }), heartbeat(), self.requestResponse(ChromecastClient.channelsNS.receiver, { type: "GET_STATUS" }).then(resolve); })); }))); function heartbeat() { self.client.ps ? self.requestResponse(ChromecastClient.channelsNS.heartbeat, { type: "PING" }).then((function(pong) { setTimeout(heartbeat, 5e3); })).catch((function(err) { console.log("heartbeat error", err); })) : console.log("Heart stops."); } }, ChromecastClient.prototype._connectMedia = function() { var self = this; return this.mediaSender = "client-" + Math.floor(1e6 * Math.random()), this.mediaReceiver = this.sessionStatus.applications[0].sessionId, this.request(ChromecastClient.channelsNS.connection, { type: "CONNECT" }, this.mediaSender, this.mediaReceiver), this.requestResponse(ChromecastClient.channelsNS.media, { type: "GET_STATUS" }, this.mediaSender, this.mediaReceiver).catch((function(err) { return console.log("!MediaSessionEerror", err), { status: [ { error: err } ] }; })).then((function(res) { res.status && res.status[0] && (self.mediaSessionStatus = res.status[0] || {}); })); }, ChromecastClient.prototype.init = function() { var self = this; return this.mediaSessionStatus = {}, this._connect().then((function(res) { return res.status && res.status.applications && res.status.applications[0].appId === ChromecastClient.APP_ID ? res : self.requestResponse(ChromecastClient.channelsNS.receiver, { type: "LAUNCH", appId: ChromecastClient.APP_ID }); })).then((function(res) { self.sessionStatus = res.status; })); }, ChromecastClient.prototype._conformStatus = function(status) { (status = status || {}).status && (status = status.status); var conformedStatus = this.mediaStatus; if (status.volume && !conformedStatus.volume && (conformedStatus.volume = status.volume.level), status.applications && status.applications[0]) { var app = status.applications[0]; conformedStatus.state = ChromecastClient.mapState(app.statusText); } return status.playerState && (conformedStatus.state = ChromecastClient.mapState(status.playerState)), 6 == conformedStatus.state && this.stateFlags && (conformedStatus.state = 5), conformedStatus.paused = 4 == conformedStatus.state, status.currentTime && (conformedStatus.time = 1e3 * status.currentTime), conformedStatus; }, ChromecastClient.prototype._subsPrepare = function(subsURL, offset, style) { return { trackId: 1, trackContentId: subsURL = subsURL ? this.endpoint + "/subtitles.srt?from=" + encodeURIComponent(subsURL) : "", trackContentType: "text/vtt", type: "TEXT", subtype: "SUBTITLES", offset: parseFloat(offset, 10) || 0, style: style || null }; }, ChromecastClient.prototype.middleware = function(req, res, next) { return this.setEndpoint(req), this.transcodeURL = this.endpoint + req.baseUrl + "/transcode", Player.prototype.middleware.call(this, req, res, next); }, ChromecastClient.prototype.status = function() { var self = this; return this._connectMedia().then((function() { return self.mediaStatus.volume = 0, self.mediaStatus.audio = self.audio.tracks, self.mediaStatus.audioTrack = self.audio.currentTrack, self._conformStatus(self.sessionStatus), self._conformStatus(self.mediaSessionStatus), self.mediaStatus; })); }, ChromecastClient.prototype._mediaRequest = function(data) { var self = this; return this._connectMedia().then((function() { return self.mediaSessionStatus.mediaSessionId && (data.mediaSessionId = self.mediaSessionStatus.mediaSessionId), self.requestResponse(ChromecastClient.channelsNS.media, data, self.mediaSender, self.mediaReceiver); })).then(this._conformStatus); }, ChromecastClient.prototype.playFromStatus = function() { if (clearTimeout(this.deferedPlay), !this.mediaStatus.source) return Promise.reject("No source!"); this.mediaStatus.time = parseInt(this.mediaStatus.time, 10); var media = { contentId: this.transcodeURL + "?" + querystring.stringify({ video: this.mediaStatus.source, audioTrack: this.audio.currentTrack, time: this.seekTime }), streamType: "BUFFERED", contentType: "video/x-matroska", metadata: { seekTime: this.seekTime, duration: this.mediaStatus.length, type: 1, metadataType: 1 }, tracks: [] }; return this.mediaStatus.subtitlesSrc && media.tracks.push(this._subsPrepare(this.mediaStatus.subtitlesSrc, this.mediaStatus.subtitlesDelay, { fontSize: parseInt(this.mediaStatus.subtitlesSize, 10) + 1 + "vw" })), this._mediaRequest({ type: "LOAD", media: media, autoplay: !0, currentTime: 0, activeTrackIds: [], repeatMode: "REPEAT_OFF" }); }, ChromecastClient.prototype.play = function(srcURL) { this.seekTime = 0, this.mediaStatus.source = srcURL, this.mediaStatus.time = 0, this.mediaStatus.subtitlesSrc = null, this.mediaStatus.subtitlesDelay = 0; var self = this; return castingUtils.getVideoInfo(this.executables.ffmpeg, srcURL).then((function(info) { return self.audio.tracks = info.streams.filter((function(stream) { return "Audio" === stream.type; })), self.audio.currentTrack = (self.audio[0] || {}).id, self.mediaStatus.length = 1e3 * info.duration, self.stateFlags = 0, self.status().then((function(status) { return status.state = 3, self.deferedPlay = setTimeout((function() { self.playFromStatus(); }), ChromecastClient.PLAYBACK_DELAY), status; })); })); }, ChromecastClient.prototype.audioTrack = function(audioTrack, offset) { return offset && console.log("Audio track offset is not implemented yet"), 3 != this.mediaStatus.state ? Promise.resolve() : (this.audio.currentTrack = audioTrack, this.playFromStatus()); }, ChromecastClient.prototype.subtitles = function(subsURL, offset, style) { this.mediaStatus.subtitlesSrc = subsURL, this.mediaStatus.subtitlesDelay = offset; var subs = this._subsPrepare(subsURL, offset, style); return this._mediaRequest(subs); }, ChromecastClient.prototype.resume = function() { return this._mediaRequest({ type: "PLAY" }); }, ChromecastClient.prototype.pause = function() { return this._mediaRequest({ type: "PAUSE" }); }, ChromecastClient.prototype.stop = function() { return this.close(); }, ChromecastClient.prototype.seek = function(time) { return 3 != this.mediaStatus.state ? Promise.resolve() : (this.seekTime = parseInt(time, 10) / 1e3 || 0, this.playFromStatus()); }, ChromecastClient.prototype.volume = function(vol) { return this.requestResponse(ChromecastClient.channelsNS.receiver, { type: "SET_VOLUME", volume: { level: parseFloat(vol, 10) } }).then(this._conformStatus); }, ChromecastClient.prototype.close = function() { var self = this; return this.stateFlags = 1, this.requestResponse(ChromecastClient.channelsNS.receiver, { type: "STOP", sessionId: this.sessionStatus.applications[0].sessionId }).then((function() { self._disconnect(); })); }, module.exports = ChromecastClient; }, function(module, exports, __webpack_require__) { var Client = __webpack_require__(1e3), Server = __webpack_require__(1007), DeviceAuthMessage = __webpack_require__(237).DeviceAuthMessage; module.exports.Client = Client, module.exports.Server = Server, module.exports.DeviceAuthMessage = DeviceAuthMessage; }, function(module, exports, __webpack_require__) { var EventEmitter = __webpack_require__(4).EventEmitter, util = __webpack_require__(0), tls = __webpack_require__(70), debug = __webpack_require__(9)("castv2"), protocol = __webpack_require__(237), PacketStreamWrapper = __webpack_require__(481), Channel = __webpack_require__(1006), CastMessage = protocol.CastMessage; function Client() { EventEmitter.call(this), this.socket = null, this.ps = null; } util.inherits(Client, EventEmitter), Client.prototype.connect = function(options, callback) { var self = this; function onerror(err) { debug("error: %s %j", err.message, err), self.emit("error", err); } function onpacket(buf) { var message = CastMessage.parse(buf); if (debug("recv message: protocolVersion=%s sourceId=%s destinationId=%s namespace=%s data=%s", message.protocol_version, message.source_id, message.destination_id, message.namespace, 1 === message.payload_type ? util.inspect(message.payload_binary) : message.payload_utf8), 0 !== message.protocol_version) return self.emit("error", new Error("Unsupported protocol version: " + message.protocol_version)), void self.close(); self.emit("message", message.source_id, message.destination_id, message.namespace, 1 === message.payload_type ? message.payload_binary : message.payload_utf8); } "string" == typeof options && (options = { host: options }), options.port = options.port || 8009, options.rejectUnauthorized = !1, callback && this.once("connect", callback), debug("connecting to %s:%d ...", options.host, options.port), this.socket = tls.connect(options, (function() { self.ps = new PacketStreamWrapper(self.socket), self.ps.on("packet", onpacket), debug("connected"), self.emit("connect"); })), this.socket.on("error", onerror), this.socket.once("close", (function() { debug("connection closed"), self.socket.removeListener("error", onerror), self.socket = null, self.ps && (self.ps.removeListener("packet", onpacket), self.ps = null), self.emit("close"); })); }, Client.prototype.close = function() { debug("closing connection ..."), this.socket.destroy(); }, Client.prototype.send = function(sourceId, destinationId, namespace, data) { var message = { protocol_version: 0, source_id: sourceId, destination_id: destinationId, namespace: namespace }; Buffer.isBuffer(data) ? (message.payload_type = 1, message.payload_binary = data) : (message.payload_type = 0, message.payload_utf8 = data), debug("send message: protocolVersion=%s sourceId=%s destinationId=%s namespace=%s data=%s", message.protocol_version, message.source_id, message.destination_id, message.namespace, 1 === message.payload_type ? util.inspect(message.payload_binary) : message.payload_utf8); var buf = CastMessage.serialize(message); this.ps.send(buf); }, Client.prototype.createChannel = function(sourceId, destinationId, namespace, encoding) { return new Channel(this, sourceId, destinationId, namespace, encoding); }, module.exports = Client; }, function(module, exports, __webpack_require__) { var ProtoBuf = __webpack_require__(1002); module.exports = ProtoBuf; }, function(module, exports, __webpack_require__) { (function(module) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; !(function(global) { "use strict"; function init(ByteBuffer) { var ProtoBuf = { VERSION: "3.8.2", WIRE_TYPES: {} }; return ProtoBuf.WIRE_TYPES.VARINT = 0, ProtoBuf.WIRE_TYPES.BITS64 = 1, ProtoBuf.WIRE_TYPES.LDELIM = 2, ProtoBuf.WIRE_TYPES.STARTGROUP = 3, ProtoBuf.WIRE_TYPES.ENDGROUP = 4, ProtoBuf.WIRE_TYPES.BITS32 = 5, ProtoBuf.PACKABLE_WIRE_TYPES = [ ProtoBuf.WIRE_TYPES.VARINT, ProtoBuf.WIRE_TYPES.BITS64, ProtoBuf.WIRE_TYPES.BITS32 ], ProtoBuf.TYPES = { int32: { name: "int32", wireType: ProtoBuf.WIRE_TYPES.VARINT }, uint32: { name: "uint32", wireType: ProtoBuf.WIRE_TYPES.VARINT }, sint32: { name: "sint32", wireType: ProtoBuf.WIRE_TYPES.VARINT }, int64: { name: "int64", wireType: ProtoBuf.WIRE_TYPES.VARINT }, uint64: { name: "uint64", wireType: ProtoBuf.WIRE_TYPES.VARINT }, sint64: { name: "sint64", wireType: ProtoBuf.WIRE_TYPES.VARINT }, bool: { name: "bool", wireType: ProtoBuf.WIRE_TYPES.VARINT }, double: { name: "double", wireType: ProtoBuf.WIRE_TYPES.BITS64 }, string: { name: "string", wireType: ProtoBuf.WIRE_TYPES.LDELIM }, bytes: { name: "bytes", wireType: ProtoBuf.WIRE_TYPES.LDELIM }, fixed32: { name: "fixed32", wireType: ProtoBuf.WIRE_TYPES.BITS32 }, sfixed32: { name: "sfixed32", wireType: ProtoBuf.WIRE_TYPES.BITS32 }, fixed64: { name: "fixed64", wireType: ProtoBuf.WIRE_TYPES.BITS64 }, sfixed64: { name: "sfixed64", wireType: ProtoBuf.WIRE_TYPES.BITS64 }, float: { name: "float", wireType: ProtoBuf.WIRE_TYPES.BITS32 }, enum: { name: "enum", wireType: ProtoBuf.WIRE_TYPES.VARINT }, message: { name: "message", wireType: ProtoBuf.WIRE_TYPES.LDELIM }, group: { name: "group", wireType: ProtoBuf.WIRE_TYPES.STARTGROUP } }, ProtoBuf.ID_MIN = 1, ProtoBuf.ID_MAX = 536870911, ProtoBuf.ByteBuffer = ByteBuffer, ProtoBuf.Long = ByteBuffer.Long || null, ProtoBuf.convertFieldsToCamelCase = !1, ProtoBuf.populateAccessors = !0, ProtoBuf.Util = (function() { Object.create || (Object.create = function(o) { if (arguments.length > 1) throw Error("Object.create polyfill only accepts the first parameter."); function F() {} return F.prototype = o, new F; }); var Util = { IS_NODE: !1 }; try { Util.IS_NODE = "function" == typeof __webpack_require__(2).readFileSync && "function" == typeof __webpack_require__(5).resolve; } catch (e) {} return Util.XHR = function() { for (var XMLHttpFactories = [ function() { return new XMLHttpRequest; }, function() { return new ActiveXObject("Msxml2.XMLHTTP"); }, function() { return new ActiveXObject("Msxml3.XMLHTTP"); }, function() { return new ActiveXObject("Microsoft.XMLHTTP"); } ], xhr = null, i = 0; i < XMLHttpFactories.length; i++) { try { xhr = XMLHttpFactories[i](); } catch (e) { continue; } break; } if (!xhr) throw Error("XMLHttpRequest is not supported"); return xhr; }, Util.fetch = function(path, callback) { if (callback && "function" != typeof callback && (callback = null), Util.IS_NODE) if (callback) __webpack_require__(2).readFile(path, (function(err, data) { callback(err ? null : "" + data); })); else try { return __webpack_require__(2).readFileSync(path); } catch (e) { return null; } else { var xhr = Util.XHR(); if (xhr.open("GET", path, !!callback), xhr.setRequestHeader("Accept", "text/plain"), "function" == typeof xhr.overrideMimeType && xhr.overrideMimeType("text/plain"), !callback) return xhr.send(null), 200 == xhr.status || 0 == xhr.status && "string" == typeof xhr.responseText ? xhr.responseText : null; if (xhr.onreadystatechange = function() { 4 == xhr.readyState && (200 == xhr.status || 0 == xhr.status && "string" == typeof xhr.responseText ? callback(xhr.responseText) : callback(null)); }, 4 == xhr.readyState) return; xhr.send(null); } }, Util.isArray = Array.isArray || function(obj) { return "[object Array]" === Object.prototype.toString.call(obj); }, Util; })(), ProtoBuf.Lang = { OPEN: "{", CLOSE: "}", OPTOPEN: "[", OPTCLOSE: "]", OPTEND: ",", EQUAL: "=", END: ";", STRINGOPEN: '"', STRINGCLOSE: '"', STRINGOPEN_SQ: "'", STRINGCLOSE_SQ: "'", COPTOPEN: "(", COPTCLOSE: ")", DELIM: /[\s\{\}=;\[\],'"\(\)]/g, RULE: /^(?:required|optional|repeated)$/, TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/, FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/, NUMBER: /^-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+|([0-9]*\.[0-9]+([Ee][+-]?[0-9]+)?))$/, NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, NUMBER_HEX: /^0x[0-9a-fA-F]+$/, NUMBER_OCT: /^0[0-7]+$/, NUMBER_FLT: /^[0-9]*\.[0-9]+([Ee][+-]?[0-9]+)?$/, ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, WHITESPACE: /\s/, STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, BOOL: /^(?:true|false)$/i }, ProtoBuf.DotProto = (function(ProtoBuf, Lang) { var DotProto = {}, Tokenizer = function(proto) { this.source = "" + proto, this.index = 0, this.line = 1, this.stack = [], this.readingString = !1, this.stringEndsWith = Lang.STRINGCLOSE; }, TokenizerPrototype = Tokenizer.prototype; TokenizerPrototype._readString = function() { var match; if (Lang.STRING.lastIndex = this.index - 1, null !== (match = Lang.STRING.exec(this.source))) { var s = void 0 !== match[1] ? match[1] : match[2]; return this.index = Lang.STRING.lastIndex, this.stack.push(this.stringEndsWith), s; } throw Error("Unterminated string at line " + this.line + ", index " + this.index); }, TokenizerPrototype.next = function() { if (this.stack.length > 0) return this.stack.shift(); if (this.index >= this.source.length) return null; if (this.readingString) return this.readingString = !1, this._readString(); var repeat, last; do { for (repeat = !1; Lang.WHITESPACE.test(last = this.source.charAt(this.index)); ) if (this.index++, "\n" === last && this.line++, this.index === this.source.length) return null; if ("/" === this.source.charAt(this.index)) if ("/" === this.source.charAt(++this.index)) { for (;"\n" !== this.source.charAt(this.index); ) if (this.index++, this.index == this.source.length) return null; this.index++, this.line++, repeat = !0; } else { if ("*" !== this.source.charAt(this.index)) throw Error("Unterminated comment at line " + this.line + ": /" + this.source.charAt(this.index)); for (last = ""; last + (last = this.source.charAt(this.index)) !== "*/"; ) if (this.index++, "\n" === last && this.line++, this.index === this.source.length) return null; this.index++, repeat = !0; } } while (repeat); if (this.index === this.source.length) return null; var end = this.index; if (Lang.DELIM.lastIndex = 0, Lang.DELIM.test(this.source.charAt(end))) ++end; else for (++end; end < this.source.length && !Lang.DELIM.test(this.source.charAt(end)); ) end++; var token = this.source.substring(this.index, this.index = end); return token === Lang.STRINGOPEN ? (this.readingString = !0, this.stringEndsWith = Lang.STRINGCLOSE) : token === Lang.STRINGOPEN_SQ && (this.readingString = !0, this.stringEndsWith = Lang.STRINGCLOSE_SQ), token; }, TokenizerPrototype.peek = function() { if (0 === this.stack.length) { var token = this.next(); if (null === token) return null; this.stack.push(token); } return this.stack[0]; }, TokenizerPrototype.toString = function() { return "Tokenizer(" + this.index + "/" + this.source.length + " at line " + this.line + ")"; }, DotProto.Tokenizer = Tokenizer; var Parser = function(proto) { this.tn = new Tokenizer(proto); }, ParserPrototype = Parser.prototype; return ParserPrototype.parse = function() { for (var token, topLevel = { name: "[ROOT]", package: null, messages: [], enums: [], imports: [], options: {}, services: [] }, head = !0; token = this.tn.next(); ) switch (token) { case "package": if (!head || null !== topLevel.package) throw Error("Unexpected package at line " + this.tn.line); topLevel.package = this._parsePackage(token); break; case "import": if (!head) throw Error("Unexpected import at line " + this.tn.line); topLevel.imports.push(this._parseImport(token)); break; case "message": this._parseMessage(topLevel, null, token), head = !1; break; case "enum": this._parseEnum(topLevel, token), head = !1; break; case "option": if (!head) throw Error("Unexpected option at line " + this.tn.line); this._parseOption(topLevel, token); break; case "service": this._parseService(topLevel, token); break; case "extend": this._parseExtend(topLevel, token); break; case "syntax": this._parseIgnoredStatement(topLevel, token); break; default: throw Error("Unexpected token at line " + this.tn.line + ": " + token); } return delete topLevel.name, topLevel; }, ParserPrototype._parseNumber = function(val) { var sign = 1; if ("-" == val.charAt(0) && (sign = -1, val = val.substring(1)), Lang.NUMBER_DEC.test(val)) return sign * parseInt(val, 10); if (Lang.NUMBER_HEX.test(val)) return sign * parseInt(val.substring(2), 16); if (Lang.NUMBER_OCT.test(val)) return sign * parseInt(val.substring(1), 8); if (Lang.NUMBER_FLT.test(val)) return sign * parseFloat(val); throw Error("Illegal number at line " + this.tn.line + ": " + (sign < 0 ? "-" : "") + val); }, ParserPrototype._parseString = function() { var token, value = ""; do { if (token = this.tn.next(), value += this.tn.next(), (token = this.tn.next()) !== this.tn.stringEndsWith) throw Error("Illegal end of string at line " + this.tn.line + ": " + token); token = this.tn.peek(); } while (token === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ); return value; }, ParserPrototype._parseId = function(val, neg) { var id = -1, sign = 1; if ("-" == val.charAt(0) && (sign = -1, val = val.substring(1)), Lang.NUMBER_DEC.test(val)) id = parseInt(val); else if (Lang.NUMBER_HEX.test(val)) id = parseInt(val.substring(2), 16); else { if (!Lang.NUMBER_OCT.test(val)) throw Error("Illegal id at line " + this.tn.line + ": " + (sign < 0 ? "-" : "") + val); id = parseInt(val.substring(1), 8); } if (id = sign * id | 0, !neg && id < 0) throw Error("Illegal id at line " + this.tn.line + ": " + (sign < 0 ? "-" : "") + val); return id; }, ParserPrototype._parsePackage = function(token) { if (token = this.tn.next(), !Lang.TYPEREF.test(token)) throw Error("Illegal package name at line " + this.tn.line + ": " + token); var pkg = token; if ((token = this.tn.next()) != Lang.END) throw Error("Illegal end of package at line " + this.tn.line + ": " + token); return pkg; }, ParserPrototype._parseImport = function(token) { if ("public" === (token = this.tn.peek()) && (this.tn.next(), token = this.tn.peek()), token !== Lang.STRINGOPEN && token !== Lang.STRINGOPEN_SQ) throw Error("Illegal start of import at line " + this.tn.line + ": " + token); var imported = this._parseString(); if ((token = this.tn.next()) !== Lang.END) throw Error("Illegal end of import at line " + this.tn.line + ": " + token); return imported; }, ParserPrototype._parseOption = function(parent, token) { var custom = !1; if ((token = this.tn.next()) == Lang.COPTOPEN && (custom = !0, token = this.tn.next()), !Lang.TYPEREF.test(token) && !/google\.protobuf\./.test(token)) throw Error("Illegal option name in message " + parent.name + " at line " + this.tn.line + ": " + token); var value, name = token; if (token = this.tn.next(), custom) { if (token !== Lang.COPTCLOSE) throw Error("Illegal end in message " + parent.name + ", option " + name + " at line " + this.tn.line + ": " + token); name = "(" + name + ")", token = this.tn.next(), Lang.FQTYPEREF.test(token) && (name += token, token = this.tn.next()); } if (token !== Lang.EQUAL) throw Error("Illegal operator in message " + parent.name + ", option " + name + " at line " + this.tn.line + ": " + token); if ((token = this.tn.peek()) === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ) value = this._parseString(); else if (this.tn.next(), Lang.NUMBER.test(token)) value = this._parseNumber(token, !0); else if (Lang.BOOL.test(token)) value = "true" === token; else { if (!Lang.TYPEREF.test(token)) throw Error("Illegal option value in message " + parent.name + ", option " + name + " at line " + this.tn.line + ": " + token); value = token; } if ((token = this.tn.next()) !== Lang.END) throw Error("Illegal end of option in message " + parent.name + ", option " + name + " at line " + this.tn.line + ": " + token); parent.options[name] = value; }, ParserPrototype._parseIgnoredStatement = function(parent, keyword) { for (var token; ;) { if (null === (token = this.tn.next())) throw Error("Unexpected EOF in " + parent.name + ", " + keyword + " at line " + this.tn.line); if (token === Lang.END) break; } }, ParserPrototype._parseService = function(parent, token) { if (token = this.tn.next(), !Lang.NAME.test(token)) throw Error("Illegal service name at line " + this.tn.line + ": " + token); var name = token, svc = { name: name, rpc: {}, options: {} }; if ((token = this.tn.next()) !== Lang.OPEN) throw Error("Illegal start of service " + name + " at line " + this.tn.line + ": " + token); do { if ("option" === (token = this.tn.next())) this._parseOption(svc, token); else if ("rpc" === token) this._parseServiceRPC(svc, token); else if (token !== Lang.CLOSE) throw Error("Illegal type of service " + name + " at line " + this.tn.line + ": " + token); } while (token !== Lang.CLOSE); parent.services.push(svc); }, ParserPrototype._parseServiceRPC = function(svc, token) { var type = token; if (token = this.tn.next(), !Lang.NAME.test(token)) throw Error("Illegal method name in service " + svc.name + " at line " + this.tn.line + ": " + token); var name = token, method = { request: null, response: null, options: {} }; if ((token = this.tn.next()) !== Lang.COPTOPEN) throw Error("Illegal start of request type in service " + svc.name + "#" + name + " at line " + this.tn.line + ": " + token); if (token = this.tn.next(), !Lang.TYPEREF.test(token)) throw Error("Illegal request type in service " + svc.name + "#" + name + " at line " + this.tn.line + ": " + token); if (method.request = token, (token = this.tn.next()) != Lang.COPTCLOSE) throw Error("Illegal end of request type in service " + svc.name + "#" + name + " at line " + this.tn.line + ": " + token); if ("returns" !== (token = this.tn.next()).toLowerCase()) throw Error("Illegal delimiter in service " + svc.name + "#" + name + " at line " + this.tn.line + ": " + token); if ((token = this.tn.next()) != Lang.COPTOPEN) throw Error("Illegal start of response type in service " + svc.name + "#" + name + " at line " + this.tn.line + ": " + token); if (token = this.tn.next(), method.response = token, (token = this.tn.next()) !== Lang.COPTCLOSE) throw Error("Illegal end of response type in service " + svc.name + "#" + name + " at line " + this.tn.line + ": " + token); if ((token = this.tn.next()) === Lang.OPEN) { do { if ("option" === (token = this.tn.next())) this._parseOption(method, token); else if (token !== Lang.CLOSE) throw Error("Illegal start of option inservice " + svc.name + "#" + name + " at line " + this.tn.line + ": " + token); } while (token !== Lang.CLOSE); this.tn.peek() === Lang.END && this.tn.next(); } else if (token !== Lang.END) throw Error("Illegal delimiter in service " + svc.name + "#" + name + " at line " + this.tn.line + ": " + token); void 0 === svc[type] && (svc[type] = {}), svc[type][name] = method; }, ParserPrototype._parseMessage = function(parent, fld, token) { var msg = {}, isGroup = "group" === token; if (token = this.tn.next(), !Lang.NAME.test(token)) throw Error("Illegal " + (isGroup ? "group" : "message") + " name" + (parent ? " in message " + parent.name : "") + " at line " + this.tn.line + ": " + token); if (msg.name = token, isGroup) { if ((token = this.tn.next()) !== Lang.EQUAL) throw Error("Illegal id assignment after group " + msg.name + " at line " + this.tn.line + ": " + token); token = this.tn.next(); try { fld.id = this._parseId(token); } catch (e) { throw Error("Illegal field id value for group " + msg.name + "#" + fld.name + " at line " + this.tn.line + ": " + token); } msg.isGroup = !0; } if (msg.fields = [], msg.enums = [], msg.messages = [], msg.options = {}, msg.oneofs = {}, (token = this.tn.next()) === Lang.OPTOPEN && fld && (this._parseFieldOptions(msg, fld, token), token = this.tn.next()), token !== Lang.OPEN) throw Error("Illegal start of " + (isGroup ? "group" : "message") + " " + msg.name + " at line " + this.tn.line + ": " + token); for (;;) { if ((token = this.tn.next()) === Lang.CLOSE) { (token = this.tn.peek()) === Lang.END && this.tn.next(); break; } if (Lang.RULE.test(token)) this._parseMessageField(msg, token); else if ("oneof" === token) this._parseMessageOneOf(msg, token); else if ("enum" === token) this._parseEnum(msg, token); else if ("message" === token) this._parseMessage(msg, null, token); else if ("option" === token) this._parseOption(msg, token); else if ("extensions" === token) msg.extensions = this._parseExtensions(msg, token); else { if ("extend" !== token) throw Error("Illegal token in message " + msg.name + " at line " + this.tn.line + ": " + token); this._parseExtend(msg, token); } } return parent.messages.push(msg), msg; }, ParserPrototype._parseMessageField = function(msg, token) { var fld = {}, grp = null; if (fld.rule = token, fld.options = {}, "group" === (token = this.tn.next())) { if (grp = this._parseMessage(msg, fld, token), !/^[A-Z]/.test(grp.name)) throw Error("Group names must start with a capital letter"); fld.type = grp.name, fld.name = grp.name.toLowerCase(), (token = this.tn.peek()) === Lang.END && this.tn.next(); } else { if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token)) throw Error("Illegal field type in message " + msg.name + " at line " + this.tn.line + ": " + token); if (fld.type = token, token = this.tn.next(), !Lang.NAME.test(token)) throw Error("Illegal field name in message " + msg.name + " at line " + this.tn.line + ": " + token); if (fld.name = token, (token = this.tn.next()) !== Lang.EQUAL) throw Error("Illegal token in field " + msg.name + "#" + fld.name + " at line " + this.tn.line + ": " + token); token = this.tn.next(); try { fld.id = this._parseId(token); } catch (e) { throw Error("Illegal field id in message " + msg.name + "#" + fld.name + " at line " + this.tn.line + ": " + token); } if ((token = this.tn.next()) === Lang.OPTOPEN && (this._parseFieldOptions(msg, fld, token), token = this.tn.next()), token !== Lang.END) throw Error("Illegal delimiter in message " + msg.name + "#" + fld.name + " at line " + this.tn.line + ": " + token); } return msg.fields.push(fld), fld; }, ParserPrototype._parseMessageOneOf = function(msg, token) { if (token = this.tn.next(), !Lang.NAME.test(token)) throw Error("Illegal oneof name in message " + msg.name + " at line " + this.tn.line + ": " + token); var fld, name = token, fields = []; if ((token = this.tn.next()) !== Lang.OPEN) throw Error("Illegal start of oneof " + name + " at line " + this.tn.line + ": " + token); for (;this.tn.peek() !== Lang.CLOSE; ) (fld = this._parseMessageField(msg, "optional")).oneof = name, fields.push(fld.id); this.tn.next(), msg.oneofs[name] = fields; }, ParserPrototype._parseFieldOptions = function(msg, fld, token) { for (var first = !0; (token = this.tn.next()) !== Lang.OPTCLOSE; ) { if (token === Lang.OPTEND) { if (first) throw Error("Illegal start of options in message " + msg.name + "#" + fld.name + " at line " + this.tn.line + ": " + token); token = this.tn.next(); } this._parseFieldOption(msg, fld, token), first = !1; } }, ParserPrototype._parseFieldOption = function(msg, fld, token) { var custom = !1; if (token === Lang.COPTOPEN && (token = this.tn.next(), custom = !0), !Lang.TYPEREF.test(token)) throw Error("Illegal field option in " + msg.name + "#" + fld.name + " at line " + this.tn.line + ": " + token); var value, name = token; if (token = this.tn.next(), custom) { if (token !== Lang.COPTCLOSE) throw Error("Illegal delimiter in " + msg.name + "#" + fld.name + " at line " + this.tn.line + ": " + token); name = "(" + name + ")", token = this.tn.next(), Lang.FQTYPEREF.test(token) && (name += token, token = this.tn.next()); } if (token !== Lang.EQUAL) throw Error("Illegal token in " + msg.name + "#" + fld.name + " at line " + this.tn.line + ": " + token); if ((token = this.tn.peek()) === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ) value = this._parseString(); else if (Lang.NUMBER.test(token, !0)) value = this._parseNumber(this.tn.next(), !0); else if (Lang.BOOL.test(token)) value = "true" === this.tn.next().toLowerCase(); else { if (!Lang.TYPEREF.test(token)) throw Error("Illegal value in message " + msg.name + "#" + fld.name + ", option " + name + " at line " + this.tn.line + ": " + token); value = this.tn.next(); } fld.options[name] = value; }, ParserPrototype._parseEnum = function(msg, token) { var enm = {}; if (token = this.tn.next(), !Lang.NAME.test(token)) throw Error("Illegal enum name in message " + msg.name + " at line " + this.tn.line + ": " + token); if (enm.name = token, (token = this.tn.next()) !== Lang.OPEN) throw Error("Illegal start of enum " + enm.name + " at line " + this.tn.line + ": " + token); for (enm.values = [], enm.options = {}; ;) { if ((token = this.tn.next()) === Lang.CLOSE) { (token = this.tn.peek()) === Lang.END && this.tn.next(); break; } if ("option" == token) this._parseOption(enm, token); else { if (!Lang.NAME.test(token)) throw Error("Illegal name in enum " + enm.name + " at line " + this.tn.line + ": " + token); this._parseEnumValue(enm, token); } } msg.enums.push(enm); }, ParserPrototype._parseEnumValue = function(enm, token) { var val = {}; if (val.name = token, (token = this.tn.next()) !== Lang.EQUAL) throw Error("Illegal token in enum " + enm.name + " at line " + this.tn.line + ": " + token); token = this.tn.next(); try { val.id = this._parseId(token, !0); } catch (e) { throw Error("Illegal id in enum " + enm.name + " at line " + this.tn.line + ": " + token); } if (enm.values.push(val), (token = this.tn.next()) === Lang.OPTOPEN && (this._parseFieldOptions(enm, { options: {} }, token), token = this.tn.next()), token !== Lang.END) throw Error("Illegal delimiter in enum " + enm.name + " at line " + this.tn.line + ": " + token); }, ParserPrototype._parseExtensions = function(msg, token) { var range = []; if ("min" === (token = this.tn.next()) ? range.push(ProtoBuf.ID_MIN) : "max" === token ? range.push(ProtoBuf.ID_MAX) : range.push(this._parseNumber(token)), "to" !== (token = this.tn.next())) throw Error("Illegal extensions delimiter in message " + msg.name + " at line " + this.tn.line + ": " + token); if ("min" === (token = this.tn.next()) ? range.push(ProtoBuf.ID_MIN) : "max" === token ? range.push(ProtoBuf.ID_MAX) : range.push(this._parseNumber(token)), (token = this.tn.next()) !== Lang.END) throw Error("Illegal extensions delimiter in message " + msg.name + " at line " + this.tn.line + ": " + token); return range; }, ParserPrototype._parseExtend = function(parent, token) { if (token = this.tn.next(), !Lang.TYPEREF.test(token)) throw Error("Illegal message name at line " + this.tn.line + ": " + token); var ext = {}; if (ext.ref = token, ext.fields = [], (token = this.tn.next()) !== Lang.OPEN) throw Error("Illegal start of extend " + ext.name + " at line " + this.tn.line + ": " + token); for (;;) { if ((token = this.tn.next()) === Lang.CLOSE) { (token = this.tn.peek()) == Lang.END && this.tn.next(); break; } if (!Lang.RULE.test(token)) throw Error("Illegal token in extend " + ext.name + " at line " + this.tn.line + ": " + token); this._parseMessageField(ext, token); } return parent.messages.push(ext), ext; }, ParserPrototype.toString = function() { return "Parser"; }, DotProto.Parser = Parser, DotProto; })(ProtoBuf, ProtoBuf.Lang), ProtoBuf.Reflect = (function(ProtoBuf) { var Reflect = {}, T = function(builder, parent, name) { this.builder = builder, this.parent = parent, this.name = name, this.className; }, TPrototype = T.prototype; TPrototype.fqn = function() { for (var name = this.name, ptr = this; null != (ptr = ptr.parent); ) name = ptr.name + "." + name; return name; }, TPrototype.toString = function(includeClass) { return (includeClass ? this.className + " " : "") + this.fqn(); }, TPrototype.build = function() { throw Error(this.toString(!0) + " cannot be built directly"); }, Reflect.T = T; var Namespace = function(builder, parent, name, options) { T.call(this, builder, parent, name), this.className = "Namespace", this.children = [], this.options = options || {}; }, NamespacePrototype = Namespace.prototype = Object.create(T.prototype); NamespacePrototype.getChildren = function(type) { if (null == (type = type || null)) return this.children.slice(); for (var children = [], i = 0, k = this.children.length; i < k; ++i) this.children[i] instanceof type && children.push(this.children[i]); return children; }, NamespacePrototype.addChild = function(child) { var other; if (other = this.getChild(child.name)) if (other instanceof Message.Field && other.name !== other.originalName && null === this.getChild(other.originalName)) other.name = other.originalName; else { if (!(child instanceof Message.Field && child.name !== child.originalName && null === this.getChild(child.originalName))) throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + child.name); child.name = child.originalName; } this.children.push(child); }, NamespacePrototype.getChild = function(nameOrId) { for (var key = "number" == typeof nameOrId ? "id" : "name", i = 0, k = this.children.length; i < k; ++i) if (this.children[i][key] === nameOrId) return this.children[i]; return null; }, NamespacePrototype.resolve = function(qn, excludeFields) { var child, part = qn.split("."), ptr = this, i = 0; if ("" === part[i]) { for (;null !== ptr.parent; ) ptr = ptr.parent; i++; } do { do { if (!(child = ptr.getChild(part[i])) || !(child instanceof Reflect.T) || excludeFields && child instanceof Reflect.Message.Field) { ptr = null; break; } ptr = child, i++; } while (i < part.length); if (null != ptr) break; if (null !== this.parent) return this.parent.resolve(qn, excludeFields); } while (null != ptr); return ptr; }, NamespacePrototype.build = function() { for (var child, ns = {}, children = this.children, i = 0, k = children.length; i < k; ++i) (child = children[i]) instanceof Namespace && (ns[child.name] = child.build()); return Object.defineProperty && Object.defineProperty(ns, "$options", { value: this.buildOpt() }), ns; }, NamespacePrototype.buildOpt = function() { for (var opt = {}, keys = Object.keys(this.options), i = 0, k = keys.length; i < k; ++i) { var key = keys[i], val = this.options[keys[i]]; opt[key] = val; } return opt; }, NamespacePrototype.getOption = function(name) { return void 0 === name ? this.options : void 0 !== this.options[name] ? this.options[name] : null; }, Reflect.Namespace = Namespace; var Message = function(builder, parent, name, options, isGroup) { Namespace.call(this, builder, parent, name, options), this.className = "Message", this.extensions = [ ProtoBuf.ID_MIN, ProtoBuf.ID_MAX ], this.clazz = null, this.isGroup = !!isGroup, this._fields = null, this._fieldsById = null, this._fieldsByName = null; }, MessagePrototype = Message.prototype = Object.create(Namespace.prototype); function skipTillGroupEnd(expectedId, buf) { var tag = buf.readVarint32(), wireType = 7 & tag, id = tag >> 3; switch (wireType) { case ProtoBuf.WIRE_TYPES.VARINT: do { tag = buf.readUint8(); } while (128 == (128 & tag)); break; case ProtoBuf.WIRE_TYPES.BITS64: buf.offset += 8; break; case ProtoBuf.WIRE_TYPES.LDELIM: tag = buf.readVarint32(), buf.offset += tag; break; case ProtoBuf.WIRE_TYPES.STARTGROUP: skipTillGroupEnd(id, buf); break; case ProtoBuf.WIRE_TYPES.ENDGROUP: if (id === expectedId) return !1; throw Error("Illegal GROUPEND after unknown group: " + id + " (" + expectedId + " expected)"); case ProtoBuf.WIRE_TYPES.BITS32: buf.offset += 4; break; default: throw Error("Illegal wire type in unknown group " + expectedId + ": " + wireType); } return !0; } MessagePrototype.build = function(rebuild) { if (this.clazz && !rebuild) return this.clazz; var clazz = (function(ProtoBuf, T) { var fields = T.getChildren(ProtoBuf.Reflect.Message.Field), oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf), Message = function(values, var_args) { ProtoBuf.Builder.Message.call(this); for (var i = 0, k = oneofs.length; i < k; ++i) this[oneofs[i].name] = null; for (i = 0, k = fields.length; i < k; ++i) { var field = fields[i]; this[field.name] = field.repeated ? [] : null, field.required && null !== field.defaultValue && (this[field.name] = field.defaultValue); } if (arguments.length > 0) if (1 !== arguments.length || "object" != typeof values || "function" == typeof values.encode || ProtoBuf.Util.isArray(values) || values instanceof ByteBuffer || values instanceof ArrayBuffer || ProtoBuf.Long && values instanceof ProtoBuf.Long) for (i = 0, k = arguments.length; i < k; ++i) this.$set(fields[i].name, arguments[i]); else { var keys = Object.keys(values); for (i = 0, k = keys.length; i < k; ++i) this.$set(keys[i], values[keys[i]]); } }, MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype); MessagePrototype.add = function(key, value, noAssert) { var field = T._fieldsByName[key]; if (!noAssert) { if (!field) throw Error(this + "#" + key + " is undefined"); if (!(field instanceof ProtoBuf.Reflect.Message.Field)) throw Error(this + "#" + key + " is not a field: " + field.toString(!0)); if (!field.repeated) throw Error(this + "#" + key + " is not a repeated field"); } null === this[field.name] && (this[field.name] = []), this[field.name].push(noAssert ? value : field.verifyValue(value, !0)); }, MessagePrototype.$add = MessagePrototype.add, MessagePrototype.set = function(key, value, noAssert) { if (key && "object" == typeof key) { for (var i in key) key.hasOwnProperty(i) && this.$set(i, key[i], noAssert); return this; } var field = T._fieldsByName[key]; if (noAssert) this[field.name] = value; else { if (!field) throw Error(this + "#" + key + " is not a field: undefined"); if (!(field instanceof ProtoBuf.Reflect.Message.Field)) throw Error(this + "#" + key + " is not a field: " + field.toString(!0)); this[field.name] = value = field.verifyValue(value); } return field.oneof && (null !== value ? (null !== this[field.oneof.name] && (this[this[field.oneof.name]] = null), this[field.oneof.name] = field.name) : field.oneof.name === key && (this[field.oneof.name] = null)), this; }, MessagePrototype.$set = MessagePrototype.set, MessagePrototype.get = function(key, noAssert) { if (noAssert) return this[key]; var field = T._fieldsByName[key]; if (!(field && field instanceof ProtoBuf.Reflect.Message.Field)) throw Error(this + "#" + key + " is not a field: undefined"); if (!(field instanceof ProtoBuf.Reflect.Message.Field)) throw Error(this + "#" + key + " is not a field: " + field.toString(!0)); return this[field.name]; }, MessagePrototype.$get = MessagePrototype.get; for (var i = 0; i < fields.length; i++) { var field = fields[i]; field instanceof ProtoBuf.Reflect.Message.ExtensionField || T.builder.options.populateAccessors && (function(field) { var Name = field.originalName.replace(/(_[a-zA-Z])/g, (function(match) { return match.toUpperCase().replace("_", ""); })); Name = Name.substring(0, 1).toUpperCase() + Name.substring(1); var name = field.originalName.replace(/([A-Z])/g, (function(match) { return "_" + match; })), setter = function(value, noAssert) { return this[field.name] = noAssert ? value : field.verifyValue(value), this; }, getter = function() { return this[field.name]; }; null === T.getChild("set" + Name) && (MessagePrototype["set" + Name] = setter), null === T.getChild("set_" + name) && (MessagePrototype["set_" + name] = setter), null === T.getChild("get" + Name) && (MessagePrototype["get" + Name] = getter), null === T.getChild("get_" + name) && (MessagePrototype["get_" + name] = getter); })(field); } function cloneRaw(obj, includeBinaryAsBase64) { var clone = {}; for (var i in obj) obj.hasOwnProperty(i) && (null === obj[i] || "object" != typeof obj[i] ? clone[i] = obj[i] : obj[i] instanceof ByteBuffer ? includeBinaryAsBase64 && (clone[i] = obj[i].toBase64()) : clone[i] = cloneRaw(obj[i], includeBinaryAsBase64)); return clone; } return MessagePrototype.encode = function(buffer, noVerify) { "boolean" == typeof buffer && (noVerify = buffer, buffer = void 0); var isNew = !1; buffer || (buffer = new ByteBuffer, isNew = !0); var le = buffer.littleEndian; try { return T.encode(this, buffer.LE(), noVerify), (isNew ? buffer.flip() : buffer).LE(le); } catch (e) { throw buffer.LE(le), e; } }, MessagePrototype.calculate = function() { return T.calculate(this); }, MessagePrototype.encodeDelimited = function(buffer) { var isNew = !1; buffer || (buffer = new ByteBuffer, isNew = !0); var enc = (new ByteBuffer).LE(); return T.encode(this, enc).flip(), buffer.writeVarint32(enc.remaining()), buffer.append(enc), isNew ? buffer.flip() : buffer; }, MessagePrototype.encodeAB = function() { try { return this.encode().toArrayBuffer(); } catch (e) { throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e; } }, MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB, MessagePrototype.encodeNB = function() { try { return this.encode().toBuffer(); } catch (e) { throw e.encoded && (e.encoded = e.encoded.toBuffer()), e; } }, MessagePrototype.toBuffer = MessagePrototype.encodeNB, MessagePrototype.encode64 = function() { try { return this.encode().toBase64(); } catch (e) { throw e.encoded && (e.encoded = e.encoded.toBase64()), e; } }, MessagePrototype.toBase64 = MessagePrototype.encode64, MessagePrototype.encodeHex = function() { try { return this.encode().toHex(); } catch (e) { throw e.encoded && (e.encoded = e.encoded.toHex()), e; } }, MessagePrototype.toHex = MessagePrototype.encodeHex, MessagePrototype.toRaw = function(includeBinaryAsBase64) { return cloneRaw(this, !!includeBinaryAsBase64); }, Message.decode = function(buffer, enc) { "string" == typeof buffer && (buffer = ByteBuffer.wrap(buffer, enc || "base64")); var le = (buffer = buffer instanceof ByteBuffer ? buffer : ByteBuffer.wrap(buffer)).littleEndian; try { var msg = T.decode(buffer.LE()); return buffer.LE(le), msg; } catch (e) { throw buffer.LE(le), e; } }, Message.decodeDelimited = function(buffer, enc) { if ("string" == typeof buffer && (buffer = ByteBuffer.wrap(buffer, enc || "base64")), (buffer = buffer instanceof ByteBuffer ? buffer : ByteBuffer.wrap(buffer)).remaining() < 1) return null; var off = buffer.offset, len = buffer.readVarint32(); if (buffer.remaining() < len) return buffer.offset = off, null; try { var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE()); return buffer.offset += len, msg; } catch (err) { throw buffer.offset += len, err; } }, Message.decode64 = function(str) { return Message.decode(str, "base64"); }, Message.decodeHex = function(str) { return Message.decode(str, "hex"); }, MessagePrototype.toString = function() { return T.toString(); }, Object.defineProperty && (Object.defineProperty(Message, "$options", { value: T.buildOpt() }), Object.defineProperty(MessagePrototype, "$type", { get: function() { return T; } })), Message; })(ProtoBuf, this); this._fields = [], this._fieldsById = {}, this._fieldsByName = {}; for (var child, i = 0, k = this.children.length; i < k; i++) if ((child = this.children[i]) instanceof Enum) clazz[child.name] = child.build(); else if (child instanceof Message) clazz[child.name] = child.build(); else if (child instanceof Message.Field) child.build(), this._fields.push(child), this._fieldsById[child.id] = child, this._fieldsByName[child.name] = child; else if (!(child instanceof Message.OneOf || child instanceof Extension)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + children[i].toString(!0)); return this.clazz = clazz; }, MessagePrototype.encode = function(message, buffer, noVerify) { for (var field, val, fieldMissing = null, i = 0, k = this._fields.length; i < k; ++i) val = message[(field = this._fields[i]).name], field.required && null === val ? null === fieldMissing && (fieldMissing = field) : field.encode(noVerify ? val : field.verifyValue(val), buffer); if (null !== fieldMissing) { var err = Error("Missing at least one required field for " + this.toString(!0) + ": " + fieldMissing); throw err.encoded = buffer, err; } return buffer; }, MessagePrototype.calculate = function(message) { for (var field, val, n = 0, i = 0, k = this._fields.length; i < k; ++i) { if (val = message[(field = this._fields[i]).name], field.required && null === val) throw Error("Missing at least one required field for " + this.toString(!0) + ": " + field); n += field.calculate(val); } return n; }, MessagePrototype.decode = function(buffer, length, expectedGroupEndId) { length = "number" == typeof length ? length : -1; for (var tag, wireType, id, field, start = buffer.offset, msg = new this.clazz; buffer.offset < start + length || -1 === length && buffer.remaining() > 0; ) { if (id = (tag = buffer.readVarint32()) >> 3, (wireType = 7 & tag) === ProtoBuf.WIRE_TYPES.ENDGROUP) { if (id !== expectedGroupEndId) throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + id + " (" + (expectedGroupEndId ? expectedGroupEndId + " expected" : "not a group") + ")"); break; } if (field = this._fieldsById[id]) field.repeated && !field.options.packed ? msg[field.name].push(field.decode(wireType, buffer)) : (msg[field.name] = field.decode(wireType, buffer), field.oneof && (null !== this[field.oneof.name] && (this[this[field.oneof.name]] = null), msg[field.oneof.name] = field.name)); else switch (wireType) { case ProtoBuf.WIRE_TYPES.VARINT: buffer.readVarint32(); break; case ProtoBuf.WIRE_TYPES.BITS32: buffer.offset += 4; break; case ProtoBuf.WIRE_TYPES.BITS64: buffer.offset += 8; break; case ProtoBuf.WIRE_TYPES.LDELIM: var len = buffer.readVarint32(); buffer.offset += len; break; case ProtoBuf.WIRE_TYPES.STARTGROUP: for (;skipTillGroupEnd(id, buffer); ) ; break; default: throw Error("Illegal wire type for unknown field " + id + " in " + this.toString(!0) + "#decode: " + wireType); } } for (var i = 0, k = this._fields.length; i < k; ++i) if (null === msg[(field = this._fields[i]).name]) { if (field.required) { var err = Error("Missing at least one required field for " + this.toString(!0) + ": " + field.name); throw err.decoded = msg, err; } null !== field.defaultValue && (msg[field.name] = field.defaultValue); } return msg; }, Reflect.Message = Message; var Field = function(builder, message, rule, type, name, id, options, oneof) { T.call(this, builder, message, name), this.className = "Message.Field", this.required = "required" === rule, this.repeated = "repeated" === rule, this.type = type, this.resolvedType = null, this.id = id, this.options = options || {}, this.defaultValue = null, this.oneof = oneof || null, this.originalName = this.name, !this.builder.options.convertFieldsToCamelCase || this instanceof Message.ExtensionField || (this.name = Field._toCamelCase(this.name)); }; Field._toCamelCase = function(name) { return name.replace(/_([a-zA-Z])/g, (function($0, $1) { return $1.toUpperCase(); })); }; var FieldPrototype = Field.prototype = Object.create(T.prototype); function mkLong(value, unsigned) { if (value && "number" == typeof value.low && "number" == typeof value.high && "boolean" == typeof value.unsigned && value.low == value.low && value.high == value.high) return new ProtoBuf.Long(value.low, value.high, void 0 === unsigned ? value.unsigned : unsigned); if ("string" == typeof value) return ProtoBuf.Long.fromString(value, unsigned || !1, 10); if ("number" == typeof value) return ProtoBuf.Long.fromNumber(value, unsigned || !1); throw Error("not convertible to Long"); } FieldPrototype.build = function() { this.defaultValue = void 0 !== this.options.default ? this.verifyValue(this.options.default) : null; }, FieldPrototype.verifyValue = function(value, skipRepeated) { skipRepeated = skipRepeated || !1; var fail = function(val, msg) { throw Error("Illegal value for " + this.toString(!0) + " of type " + this.type.name + ": " + val + " (" + msg + ")"); }.bind(this); if (null === value) return this.required && fail(typeof value, "required"), null; if (this.repeated && !skipRepeated) { ProtoBuf.Util.isArray(value) || (value = [ value ]); var res = []; for (i = 0; i < value.length; i++) res.push(this.verifyValue(value[i], !0)); return res; } switch (!this.repeated && ProtoBuf.Util.isArray(value) && fail(typeof value, "no array expected"), this.type) { case ProtoBuf.TYPES.int32: case ProtoBuf.TYPES.sint32: case ProtoBuf.TYPES.sfixed32: return ("number" != typeof value || value == value && value % 1 != 0) && fail(typeof value, "not an integer"), value > 4294967295 ? 0 | value : value; case ProtoBuf.TYPES.uint32: case ProtoBuf.TYPES.fixed32: return ("number" != typeof value || value == value && value % 1 != 0) && fail(typeof value, "not an integer"), value < 0 ? value >>> 0 : value; case ProtoBuf.TYPES.int64: case ProtoBuf.TYPES.sint64: case ProtoBuf.TYPES.sfixed64: if (ProtoBuf.Long) try { return mkLong(value, !1); } catch (e) { fail(typeof value, e.message); } else fail(typeof value, "requires Long.js"); case ProtoBuf.TYPES.uint64: case ProtoBuf.TYPES.fixed64: if (ProtoBuf.Long) try { return mkLong(value, !0); } catch (e) { fail(typeof value, e.message); } else fail(typeof value, "requires Long.js"); case ProtoBuf.TYPES.bool: return "boolean" != typeof value && fail(typeof value, "not a boolean"), value; case ProtoBuf.TYPES.float: case ProtoBuf.TYPES.double: return "number" != typeof value && fail(typeof value, "not a number"), value; case ProtoBuf.TYPES.string: return "string" == typeof value || value && value instanceof String || fail(typeof value, "not a string"), "" + value; case ProtoBuf.TYPES.bytes: return ByteBuffer.isByteBuffer(value) ? value : ByteBuffer.wrap(value, "base64"); case ProtoBuf.TYPES.enum: var values = this.resolvedType.getChildren(Enum.Value); for (i = 0; i < values.length; i++) { if (values[i].name == value) return values[i].id; if (values[i].id == value) return values[i].id; } fail(value, "not a valid enum value"); case ProtoBuf.TYPES.group: case ProtoBuf.TYPES.message: if (value && "object" == typeof value || fail(typeof value, "object expected"), value instanceof this.resolvedType.clazz) return value; if (value instanceof ProtoBuf.Builder.Message) { var obj = {}; for (var i in value) value.hasOwnProperty(i) && (obj[i] = value[i]); value = obj; } return new this.resolvedType.clazz(value); } throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + value + " (undefined type " + this.type + ")"); }, FieldPrototype.encode = function(value, buffer) { if (null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type); if (null === value || this.repeated && 0 == value.length) return buffer; try { var i; if (this.repeated) if (this.options.packed && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { buffer.writeVarint32(this.id << 3 | ProtoBuf.WIRE_TYPES.LDELIM), buffer.ensureCapacity(buffer.offset += 1); var start = buffer.offset; for (i = 0; i < value.length; i++) this.encodeValue(value[i], buffer); var len = buffer.offset - start, varintLen = ByteBuffer.calculateVarint32(len); if (varintLen > 1) { var contents = buffer.slice(start, buffer.offset); start += varintLen - 1, buffer.offset = start, buffer.append(contents); } buffer.writeVarint32(len, start - varintLen); } else for (i = 0; i < value.length; i++) buffer.writeVarint32(this.id << 3 | this.type.wireType), this.encodeValue(value[i], buffer); else buffer.writeVarint32(this.id << 3 | this.type.wireType), this.encodeValue(value, buffer); } catch (e) { throw Error("Illegal value for " + this.toString(!0) + ": " + value + " (" + e + ")"); } return buffer; }, FieldPrototype.encodeValue = function(value, buffer) { if (null === value) return buffer; switch (this.type) { case ProtoBuf.TYPES.int32: value < 0 ? buffer.writeVarint64(value) : buffer.writeVarint32(value); break; case ProtoBuf.TYPES.uint32: buffer.writeVarint32(value); break; case ProtoBuf.TYPES.sint32: buffer.writeVarint32ZigZag(value); break; case ProtoBuf.TYPES.fixed32: buffer.writeUint32(value); break; case ProtoBuf.TYPES.sfixed32: buffer.writeInt32(value); break; case ProtoBuf.TYPES.int64: case ProtoBuf.TYPES.uint64: buffer.writeVarint64(value); break; case ProtoBuf.TYPES.sint64: buffer.writeVarint64ZigZag(value); break; case ProtoBuf.TYPES.fixed64: buffer.writeUint64(value); break; case ProtoBuf.TYPES.sfixed64: buffer.writeInt64(value); break; case ProtoBuf.TYPES.bool: "string" == typeof value ? buffer.writeVarint32("false" === value.toLowerCase() ? 0 : !!value) : buffer.writeVarint32(value ? 1 : 0); break; case ProtoBuf.TYPES.enum: buffer.writeVarint32(value); break; case ProtoBuf.TYPES.float: buffer.writeFloat32(value); break; case ProtoBuf.TYPES.double: buffer.writeFloat64(value); break; case ProtoBuf.TYPES.string: buffer.writeVString(value); break; case ProtoBuf.TYPES.bytes: if (value.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + value.remaining() + " bytes remaining"); var prevOffset = value.offset; buffer.writeVarint32(value.remaining()), buffer.append(value), value.offset = prevOffset; break; case ProtoBuf.TYPES.message: var bb = (new ByteBuffer).LE(); this.resolvedType.encode(value, bb), buffer.writeVarint32(bb.offset), buffer.append(bb.flip()); break; case ProtoBuf.TYPES.group: this.resolvedType.encode(value, buffer), buffer.writeVarint32(this.id << 3 | ProtoBuf.WIRE_TYPES.ENDGROUP); break; default: throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + value + " (unknown type)"); } return buffer; }, FieldPrototype.calculate = function(value) { if (value = this.verifyValue(value), null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type); if (null === value || this.repeated && 0 == value.length) return 0; var n = 0; try { var i, ni; if (this.repeated) if (this.options.packed && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { for (n += ByteBuffer.calculateVarint32(this.id << 3 | ProtoBuf.WIRE_TYPES.LDELIM), ni = 0, i = 0; i < value.length; i++) ni += this.calculateValue(value[i]); n += ByteBuffer.calculateVarint32(ni), n += ni; } else for (i = 0; i < value.length; i++) n += ByteBuffer.calculateVarint32(this.id << 3 | this.type.wireType), n += this.calculateValue(value[i]); else n += ByteBuffer.calculateVarint32(this.id << 3 | this.type.wireType), n += this.calculateValue(value); } catch (e) { throw Error("Illegal value for " + this.toString(!0) + ": " + value + " (" + e + ")"); } return n; }, FieldPrototype.calculateValue = function(value) { if (null === value) return 0; var n; switch (this.type) { case ProtoBuf.TYPES.int32: return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value); case ProtoBuf.TYPES.uint32: return ByteBuffer.calculateVarint32(value); case ProtoBuf.TYPES.sint32: return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value)); case ProtoBuf.TYPES.fixed32: case ProtoBuf.TYPES.sfixed32: case ProtoBuf.TYPES.float: return 4; case ProtoBuf.TYPES.int64: case ProtoBuf.TYPES.uint64: return ByteBuffer.calculateVarint64(value); case ProtoBuf.TYPES.sint64: return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value)); case ProtoBuf.TYPES.fixed64: case ProtoBuf.TYPES.sfixed64: return 8; case ProtoBuf.TYPES.bool: return 1; case ProtoBuf.TYPES.enum: return ByteBuffer.calculateVarint32(value); case ProtoBuf.TYPES.double: return 8; case ProtoBuf.TYPES.string: return n = ByteBuffer.calculateUTF8Bytes(value), ByteBuffer.calculateVarint32(n) + n; case ProtoBuf.TYPES.bytes: if (value.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + value.remaining() + " bytes remaining"); return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining(); case ProtoBuf.TYPES.message: return n = this.resolvedType.calculate(value), ByteBuffer.calculateVarint32(n) + n; case ProtoBuf.TYPES.group: return (n = this.resolvedType.calculate(value)) + ByteBuffer.calculateVarint32(this.id << 3 | ProtoBuf.WIRE_TYPES.ENDGROUP); } throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + value + " (unknown type)"); }, FieldPrototype.decode = function(wireType, buffer, skipRepeated) { var value, nBytes; if (wireType != this.type.wireType && (skipRepeated || wireType != ProtoBuf.WIRE_TYPES.LDELIM || !this.repeated)) throw Error("Illegal wire type for field " + this.toString(!0) + ": " + wireType + " (" + this.type.wireType + " expected)"); if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !skipRepeated) { nBytes = buffer.readVarint32(), nBytes = buffer.offset + nBytes; for (var values = []; buffer.offset < nBytes; ) values.push(this.decode(this.type.wireType, buffer, !0)); return values; } switch (this.type) { case ProtoBuf.TYPES.int32: return 0 | buffer.readVarint32(); case ProtoBuf.TYPES.uint32: return buffer.readVarint32() >>> 0; case ProtoBuf.TYPES.sint32: return 0 | buffer.readVarint32ZigZag(); case ProtoBuf.TYPES.fixed32: return buffer.readUint32() >>> 0; case ProtoBuf.TYPES.sfixed32: return 0 | buffer.readInt32(); case ProtoBuf.TYPES.int64: return buffer.readVarint64(); case ProtoBuf.TYPES.uint64: return buffer.readVarint64().toUnsigned(); case ProtoBuf.TYPES.sint64: return buffer.readVarint64ZigZag(); case ProtoBuf.TYPES.fixed64: return buffer.readUint64(); case ProtoBuf.TYPES.sfixed64: return buffer.readInt64(); case ProtoBuf.TYPES.bool: return !!buffer.readVarint32(); case ProtoBuf.TYPES.enum: return buffer.readVarint32(); case ProtoBuf.TYPES.float: return buffer.readFloat(); case ProtoBuf.TYPES.double: return buffer.readDouble(); case ProtoBuf.TYPES.string: return buffer.readVString(); case ProtoBuf.TYPES.bytes: if (nBytes = buffer.readVarint32(), buffer.remaining() < nBytes) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + nBytes + " required but got only " + buffer.remaining()); return (value = buffer.clone()).limit = value.offset + nBytes, buffer.offset += nBytes, value; case ProtoBuf.TYPES.message: return nBytes = buffer.readVarint32(), this.resolvedType.decode(buffer, nBytes); case ProtoBuf.TYPES.group: return this.resolvedType.decode(buffer, -1, this.id); } throw Error("[INTERNAL] Illegal wire type for " + this.toString(!0) + ": " + wireType); }, Reflect.Message.Field = Field; var ExtensionField = function(builder, message, rule, type, name, id, options) { Field.call(this, builder, message, rule, type, name, id, options), this.extension; }; ExtensionField.prototype = Object.create(Field.prototype), Reflect.Message.ExtensionField = ExtensionField, Reflect.Message.OneOf = function(builder, message, name) { T.call(this, builder, message, name), this.fields = []; }; var Enum = function(builder, parent, name, options) { Namespace.call(this, builder, parent, name, options), this.className = "Enum", this.object = null; }; (Enum.prototype = Object.create(Namespace.prototype)).build = function() { for (var enm = {}, values = this.getChildren(Enum.Value), i = 0, k = values.length; i < k; ++i) enm[values[i].name] = values[i].id; return Object.defineProperty && Object.defineProperty(enm, "$options", { value: this.buildOpt() }), this.object = enm; }, Reflect.Enum = Enum; var Value = function(builder, enm, name, id) { T.call(this, builder, enm, name), this.className = "Enum.Value", this.id = id; }; Value.prototype = Object.create(T.prototype), Reflect.Enum.Value = Value; var Extension = function(builder, parent, name, field) { T.call(this, builder, parent, name), this.field = field; }; Extension.prototype = Object.create(T.prototype), Reflect.Extension = Extension; var Service = function(builder, root, name, options) { Namespace.call(this, builder, root, name, options), this.className = "Service", this.clazz = null; }; (Service.prototype = Object.create(Namespace.prototype)).build = function(rebuild) { return this.clazz && !rebuild ? this.clazz : this.clazz = (function(ProtoBuf, T) { var Service = function(rpcImpl) { ProtoBuf.Builder.Service.call(this), this.rpcImpl = rpcImpl || function(name, msg, callback) { setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); }; }, ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype); Object.defineProperty && (Object.defineProperty(Service, "$options", { value: T.buildOpt() }), Object.defineProperty(ServicePrototype, "$options", { value: Service.$options })); for (var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod), i = 0; i < rpc.length; i++) !(function(method) { ServicePrototype[method.name] = function(req, callback) { try { if (!(req && req instanceof method.resolvedRequestType.clazz)) return void setTimeout(callback.bind(this, Error("Illegal request type provided to service method " + T.name + "#" + method.name)), 0); this.rpcImpl(method.fqn(), req, (function(err, res) { if (err) callback(err); else { try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {} res && res instanceof method.resolvedResponseType.clazz ? callback(null, res) : callback(Error("Illegal response type received in service method " + T.name + "#" + method.name)); } })); } catch (err) { setTimeout(callback.bind(this, err), 0); } }, Service[method.name] = function(rpcImpl, req, callback) { new Service(rpcImpl)[method.name](req, callback); }, Object.defineProperty && (Object.defineProperty(Service[method.name], "$options", { value: method.buildOpt() }), Object.defineProperty(ServicePrototype[method.name], "$options", { value: Service[method.name].$options })); })(rpc[i]); return Service; })(ProtoBuf, this); }, Reflect.Service = Service; var Method = function(builder, svc, name, options) { T.call(this, builder, svc, name), this.className = "Service.Method", this.options = options || {}; }; (Method.prototype = Object.create(T.prototype)).buildOpt = NamespacePrototype.buildOpt, Reflect.Service.Method = Method; var RPCMethod = function(builder, svc, name, request, response, options) { Method.call(this, builder, svc, name, options), this.className = "Service.RPCMethod", this.requestName = request, this.responseName = response, this.resolvedRequestType = null, this.resolvedResponseType = null; }; return RPCMethod.prototype = Object.create(Method.prototype), Reflect.Service.RPCMethod = RPCMethod, Reflect; })(ProtoBuf), ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) { var Builder = function(options) { this.ns = new Reflect.Namespace(this, null, ""), this.ptr = this.ns, this.resolved = !1, this.result = null, this.files = {}, this.importRoot = null, this.options = options || {}; }, BuilderPrototype = Builder.prototype; return BuilderPrototype.reset = function() { this.ptr = this.ns; }, BuilderPrototype.define = function(pkg, options) { if ("string" != typeof pkg || !Lang.TYPEREF.test(pkg)) throw Error("Illegal package: " + pkg); var i, part = pkg.split("."); for (i = 0; i < part.length; i++) if (!Lang.NAME.test(part[i])) throw Error("Illegal package: " + part[i]); for (i = 0; i < part.length; i++) null === this.ptr.getChild(part[i]) && this.ptr.addChild(new Reflect.Namespace(this, this.ptr, part[i], options)), this.ptr = this.ptr.getChild(part[i]); return this; }, Builder.isValidMessage = function(def) { if ("string" != typeof def.name || !Lang.NAME.test(def.name)) return !1; if (void 0 !== def.values || void 0 !== def.rpc) return !1; var i; if (void 0 !== def.fields) { if (!ProtoBuf.Util.isArray(def.fields)) return !1; var id, ids = []; for (i = 0; i < def.fields.length; i++) { if (!Builder.isValidMessageField(def.fields[i])) return !1; if (id = parseInt(def.fields[i].id, 10), ids.indexOf(id) >= 0) return !1; ids.push(id); } ids = null; } if (void 0 !== def.enums) { if (!ProtoBuf.Util.isArray(def.enums)) return !1; for (i = 0; i < def.enums.length; i++) if (!Builder.isValidEnum(def.enums[i])) return !1; } if (void 0 !== def.messages) { if (!ProtoBuf.Util.isArray(def.messages)) return !1; for (i = 0; i < def.messages.length; i++) if (!Builder.isValidMessage(def.messages[i]) && !Builder.isValidExtend(def.messages[i])) return !1; } return !!(void 0 === def.extensions || ProtoBuf.Util.isArray(def.extensions) && 2 === def.extensions.length && "number" == typeof def.extensions[0] && "number" == typeof def.extensions[1]); }, Builder.isValidMessageField = function(def) { if ("string" != typeof def.rule || "string" != typeof def.name || "string" != typeof def.type || void 0 === def.id) return !1; if (!(Lang.RULE.test(def.rule) && Lang.NAME.test(def.name) && Lang.TYPEREF.test(def.type) && Lang.ID.test("" + def.id))) return !1; if (void 0 !== def.options) { if ("object" != typeof def.options) return !1; for (var key, keys = Object.keys(def.options), i = 0; i < keys.length; i++) if ("string" != typeof (key = keys[i]) || "string" != typeof def.options[key] && "number" != typeof def.options[key] && "boolean" != typeof def.options[key]) return !1; } return !0; }, Builder.isValidEnum = function(def) { if ("string" != typeof def.name || !Lang.NAME.test(def.name)) return !1; if (void 0 === def.values || !ProtoBuf.Util.isArray(def.values) || 0 == def.values.length) return !1; for (var i = 0; i < def.values.length; i++) { if ("object" != typeof def.values[i]) return !1; if ("string" != typeof def.values[i].name || void 0 === def.values[i].id) return !1; if (!Lang.NAME.test(def.values[i].name) || !Lang.NEGID.test("" + def.values[i].id)) return !1; } return !0; }, BuilderPrototype.create = function(defs) { if (!defs) return this; if (ProtoBuf.Util.isArray(defs) || (defs = [ defs ]), 0 == defs.length) return this; var stack = []; for (stack.push(defs); stack.length > 0; ) { if (defs = stack.pop(), !ProtoBuf.Util.isArray(defs)) throw Error("Not a valid namespace: " + JSON.stringify(defs)); for (;defs.length > 0; ) { var def = defs.shift(); if (Builder.isValidMessage(def)) { var obj = new Reflect.Message(this, this.ptr, def.name, def.options, def.isGroup), oneofs = {}; if (def.oneofs) for (var keys = Object.keys(def.oneofs), i = 0, k = keys.length; i < k; ++i) obj.addChild(oneofs[keys[i]] = new Reflect.Message.OneOf(this, obj, keys[i])); if (def.fields && def.fields.length > 0) for (i = 0, k = def.fields.length; i < k; ++i) { var fld = def.fields[i]; if (null !== obj.getChild(fld.id)) throw Error("Duplicate field id in message " + obj.name + ": " + fld.id); if (fld.options) for (var opts = Object.keys(fld.options), j = 0, l = opts.length; j < l; ++j) { if ("string" != typeof opts[j]) throw Error("Illegal field option name in message " + obj.name + "#" + fld.name + ": " + opts[j]); if ("string" != typeof fld.options[opts[j]] && "number" != typeof fld.options[opts[j]] && "boolean" != typeof fld.options[opts[j]]) throw Error("Illegal field option value in message " + obj.name + "#" + fld.name + "#" + opts[j] + ": " + fld.options[opts[j]]); } var oneof = null; if ("string" == typeof fld.oneof && void 0 === (oneof = oneofs[fld.oneof])) throw Error("Illegal oneof in message " + obj.name + "#" + fld.name + ": " + fld.oneof); fld = new Reflect.Message.Field(this, obj, fld.rule, fld.type, fld.name, fld.id, fld.options, oneof), oneof && oneof.fields.push(fld), obj.addChild(fld); } var subObj = []; if (void 0 !== def.enums && def.enums.length > 0) for (i = 0; i < def.enums.length; i++) subObj.push(def.enums[i]); if (def.messages && def.messages.length > 0) for (i = 0; i < def.messages.length; i++) subObj.push(def.messages[i]); if (def.extensions && (obj.extensions = def.extensions, obj.extensions[0] < ProtoBuf.ID_MIN && (obj.extensions[0] = ProtoBuf.ID_MIN), obj.extensions[1] > ProtoBuf.ID_MAX && (obj.extensions[1] = ProtoBuf.ID_MAX)), this.ptr.addChild(obj), subObj.length > 0) { stack.push(defs), defs = subObj, subObj = null, this.ptr = obj, obj = null; continue; } subObj = null, obj = null; } else if (Builder.isValidEnum(def)) { for (obj = new Reflect.Enum(this, this.ptr, def.name, def.options), i = 0; i < def.values.length; i++) obj.addChild(new Reflect.Enum.Value(this, obj, def.values[i].name, def.values[i].id)); this.ptr.addChild(obj), obj = null; } else if (Builder.isValidService(def)) { for (i in obj = new Reflect.Service(this, this.ptr, def.name, def.options), def.rpc) def.rpc.hasOwnProperty(i) && obj.addChild(new Reflect.Service.RPCMethod(this, obj, i, def.rpc[i].request, def.rpc[i].response, def.rpc[i].options)); this.ptr.addChild(obj), obj = null; } else { if (!Builder.isValidExtend(def)) throw Error("Not a valid definition: " + JSON.stringify(def)); if (obj = this.ptr.resolve(def.ref)) for (i = 0; i < def.fields.length; i++) { if (null !== obj.getChild(def.fields[i].id)) throw Error("Duplicate extended field id in message " + obj.name + ": " + def.fields[i].id); if (def.fields[i].id < obj.extensions[0] || def.fields[i].id > obj.extensions[1]) throw Error("Illegal extended field id in message " + obj.name + ": " + def.fields[i].id + " (" + obj.extensions.join(" to ") + " expected)"); var name = def.fields[i].name; this.options.convertFieldsToCamelCase && (name = Reflect.Message.Field._toCamelCase(def.fields[i].name)), fld = new Reflect.Message.ExtensionField(this, obj, def.fields[i].rule, def.fields[i].type, this.ptr.fqn() + "." + name, def.fields[i].id, def.fields[i].options); var ext = new Reflect.Extension(this, this.ptr, def.fields[i].name, fld); fld.extension = ext, this.ptr.addChild(ext), obj.addChild(fld); } else if (!/\.?google\.protobuf\./.test(def.ref)) throw Error("Extended message " + def.ref + " is not defined"); } def = null; } defs = null, this.ptr = this.ptr.parent; } return this.resolved = !1, this.result = null, this; }, BuilderPrototype.import = function(json, filename) { if ("string" == typeof filename) { if (ProtoBuf.Util.IS_NODE && (filename = __webpack_require__(5).resolve(filename)), !0 === this.files[filename]) return this.reset(), this; this.files[filename] = !0; } if (json.imports && json.imports.length > 0) { var importRoot, delim = "/", resetRoot = !1; "object" == typeof filename ? (this.importRoot = filename.root, resetRoot = !0, importRoot = this.importRoot, filename = filename.file, (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) && (delim = "\\")) : "string" == typeof filename ? this.importRoot ? importRoot = this.importRoot : filename.indexOf("/") >= 0 ? "" === (importRoot = filename.replace(/\/[^\/]*$/, "")) && (importRoot = "/") : filename.indexOf("\\") >= 0 ? (importRoot = filename.replace(/\\[^\\]*$/, ""), delim = "\\") : importRoot = "." : importRoot = null; for (var i = 0; i < json.imports.length; i++) if ("string" == typeof json.imports[i]) { if (!importRoot) throw Error("Cannot determine import root: File name is unknown"); var importFilename = json.imports[i]; if (/^google\/protobuf\//.test(importFilename)) continue; if (importFilename = importRoot + delim + importFilename, !0 === this.files[importFilename]) continue; /\.proto$/i.test(importFilename) && !ProtoBuf.DotProto && (importFilename = importFilename.replace(/\.proto$/, ".json")); var contents = ProtoBuf.Util.fetch(importFilename); if (null === contents) throw Error("Failed to import '" + importFilename + "' in '" + filename + "': File not found"); /\.json$/i.test(importFilename) ? this.import(JSON.parse(contents + ""), importFilename) : this.import(new ProtoBuf.DotProto.Parser(contents + "").parse(), importFilename); } else filename ? /\.(\w+)$/.test(filename) ? this.import(json.imports[i], filename.replace(/^(.+)\.(\w+)$/, (function($0, $1, $2) { return $1 + "_import" + i + "." + $2; }))) : this.import(json.imports[i], filename + "_import" + i) : this.import(json.imports[i]); resetRoot && (this.importRoot = null); } return json.messages && (json.package && this.define(json.package, json.options), this.create(json.messages), this.reset()), json.enums && (json.package && this.define(json.package, json.options), this.create(json.enums), this.reset()), json.services && (json.package && this.define(json.package, json.options), this.create(json.services), this.reset()), json.extends && (json.package && this.define(json.package, json.options), this.create(json.extends), this.reset()), this; }, Builder.isValidService = function(def) { return !("string" != typeof def.name || !Lang.NAME.test(def.name) || "object" != typeof def.rpc); }, Builder.isValidExtend = function(def) { if ("string" != typeof def.ref || !Lang.TYPEREF.test(def.ref)) return !1; var i; if (void 0 !== def.fields) { if (!ProtoBuf.Util.isArray(def.fields)) return !1; var id, ids = []; for (i = 0; i < def.fields.length; i++) { if (!Builder.isValidMessageField(def.fields[i])) return !1; if (id = parseInt(def.id, 10), ids.indexOf(id) >= 0) return !1; ids.push(id); } ids = null; } return !0; }, BuilderPrototype.resolveAll = function() { var res; if (null != this.ptr && "object" != typeof this.ptr.type) { if (this.ptr instanceof Reflect.Namespace) for (var children = this.ptr.children, i = 0, k = children.length; i < k; ++i) this.ptr = children[i], this.resolveAll(); else if (this.ptr instanceof Reflect.Message.Field) if (Lang.TYPE.test(this.ptr.type)) this.ptr.type = ProtoBuf.TYPES[this.ptr.type]; else { if (!Lang.TYPEREF.test(this.ptr.type)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type); if (!(res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0))) throw Error("Unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type); if (this.ptr.resolvedType = res, res instanceof Reflect.Enum) this.ptr.type = ProtoBuf.TYPES.enum; else { if (!(res instanceof Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type); this.ptr.type = res.isGroup ? ProtoBuf.TYPES.group : ProtoBuf.TYPES.message; } } else if (this.ptr instanceof ProtoBuf.Reflect.Enum.Value) ; else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) { if (!(this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod)) throw Error("Illegal service type in " + this.ptr.toString(!0)); if (!((res = this.ptr.parent.resolve(this.ptr.requestName)) && res instanceof ProtoBuf.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName); if (this.ptr.resolvedRequestType = res, !((res = this.ptr.parent.resolve(this.ptr.responseName)) && res instanceof ProtoBuf.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName); this.ptr.resolvedResponseType = res; } else if (!(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf || this.ptr instanceof ProtoBuf.Reflect.Extension)) throw Error("Illegal object in namespace: " + typeof this.ptr + ":" + this.ptr); this.reset(); } }, BuilderPrototype.build = function(path) { if (this.reset(), this.resolved || (this.resolveAll(), this.resolved = !0, this.result = null), null == this.result && (this.result = this.ns.build()), path) { for (var part = path.split("."), ptr = this.result, i = 0; i < part.length; i++) { if (!ptr[part[i]]) { ptr = null; break; } ptr = ptr[part[i]]; } return ptr; } return this.result; }, BuilderPrototype.lookup = function(path) { return path ? this.ns.resolve(path) : this.ns; }, BuilderPrototype.toString = function() { return "Builder"; }, Builder.Message = function() {}, Builder.Service = function() {}, Builder; })(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect), ProtoBuf.loadProto = function(proto, builder, filename) { return ("string" == typeof builder || builder && "string" == typeof builder.file && "string" == typeof builder.root) && (filename = builder, builder = void 0), ProtoBuf.loadJson(new ProtoBuf.DotProto.Parser(proto).parse(), builder, filename); }, ProtoBuf.protoFromString = ProtoBuf.loadProto, ProtoBuf.loadProtoFile = function(filename, callback, builder) { if (callback && "object" == typeof callback ? (builder = callback, callback = null) : callback && "function" == typeof callback || (callback = null), callback) return ProtoBuf.Util.fetch("string" == typeof filename ? filename : filename.root + "/" + filename.file, (function(contents) { if (null !== contents) try { callback(null, ProtoBuf.loadProto(contents, builder, filename)); } catch (e) { callback(e); } else callback(Error("Failed to fetch file")); })); var contents = ProtoBuf.Util.fetch("object" == typeof filename ? filename.root + "/" + filename.file : filename); return null === contents ? null : ProtoBuf.loadProto(contents, builder, filename); }, ProtoBuf.protoFromFile = ProtoBuf.loadProtoFile, ProtoBuf.newBuilder = function(options) { return void 0 === (options = options || {}).convertFieldsToCamelCase && (options.convertFieldsToCamelCase = ProtoBuf.convertFieldsToCamelCase), void 0 === options.populateAccessors && (options.populateAccessors = ProtoBuf.populateAccessors), new ProtoBuf.Builder(options); }, ProtoBuf.loadJson = function(json, builder, filename) { return ("string" == typeof builder || builder && "string" == typeof builder.file && "string" == typeof builder.root) && (filename = builder, builder = null), builder && "object" == typeof builder || (builder = ProtoBuf.newBuilder()), "string" == typeof json && (json = JSON.parse(json)), builder.import(json, filename), builder.resolveAll(), builder; }, ProtoBuf.loadJsonFile = function(filename, callback, builder) { if (callback && "object" == typeof callback ? (builder = callback, callback = null) : callback && "function" == typeof callback || (callback = null), callback) return ProtoBuf.Util.fetch("string" == typeof filename ? filename : filename.root + "/" + filename.file, (function(contents) { if (null !== contents) try { callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename)); } catch (e) { callback(e); } else callback(Error("Failed to fetch file")); })); var contents = ProtoBuf.Util.fetch("object" == typeof filename ? filename.root + "/" + filename.file : filename); return null === contents ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename); }, ProtoBuf; } module && "object" == typeof exports && exports ? module.exports = init(__webpack_require__(480)) : (__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(480) ], void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof (__WEBPACK_AMD_DEFINE_FACTORY__ = init) ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); })(); }).call(this, __webpack_require__(69)(module)); }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__; void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof (__WEBPACK_AMD_DEFINE_FACTORY__ = function() { "use strict"; function Long(low, high, unsigned) { this.low = 0 | low, this.high = 0 | high, this.unsigned = !!unsigned; } Long.__isLong__, Object.defineProperty(Long.prototype, "__isLong__", { value: !0, enumerable: !1, configurable: !1 }), Long.isLong = function(obj) { return !0 === (obj && obj.__isLong__); }; var INT_CACHE = {}, UINT_CACHE = {}; Long.fromInt = function(value, unsigned) { var obj, cachedObj; return unsigned ? 0 <= (value >>>= 0) && value < 256 && (cachedObj = UINT_CACHE[value]) ? cachedObj : (obj = new Long(value, (0 | value) < 0 ? -1 : 0, !0), 0 <= value && value < 256 && (UINT_CACHE[value] = obj), obj) : -128 <= (value |= 0) && value < 128 && (cachedObj = INT_CACHE[value]) ? cachedObj : (obj = new Long(value, value < 0 ? -1 : 0, !1), -128 <= value && value < 128 && (INT_CACHE[value] = obj), obj); }, Long.fromNumber = function(value, unsigned) { return unsigned = !!unsigned, isNaN(value) || !isFinite(value) ? Long.ZERO : !unsigned && value <= -TWO_PWR_63_DBL ? Long.MIN_VALUE : !unsigned && value + 1 >= TWO_PWR_63_DBL ? Long.MAX_VALUE : unsigned && value >= TWO_PWR_64_DBL ? Long.MAX_UNSIGNED_VALUE : value < 0 ? Long.fromNumber(-value, unsigned).negate() : new Long(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); }, Long.fromBits = function(lowBits, highBits, unsigned) { return new Long(lowBits, highBits, unsigned); }, Long.fromString = function(str, unsigned, radix) { if (0 === str.length) throw Error("number format error: empty string"); if ("NaN" === str || "Infinity" === str || "+Infinity" === str || "-Infinity" === str) return Long.ZERO; if ("number" == typeof unsigned && (radix = unsigned, unsigned = !1), (radix = radix || 10) < 2 || 36 < radix) throw Error("radix out of range: " + radix); var p; if ((p = str.indexOf("-")) > 0) throw Error('number format error: interior "-" character: ' + str); if (0 === p) return Long.fromString(str.substring(1), unsigned, radix).negate(); for (var radixToPower = Long.fromNumber(Math.pow(radix, 8)), result = Long.ZERO, i = 0; i < str.length; i += 8) { var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); if (size < 8) { var power = Long.fromNumber(Math.pow(radix, size)); result = result.multiply(power).add(Long.fromNumber(value)); } else result = (result = result.multiply(radixToPower)).add(Long.fromNumber(value)); } return result.unsigned = unsigned, result; }, Long.fromValue = function(val) { return val instanceof Long ? val : "number" == typeof val ? Long.fromNumber(val) : "string" == typeof val ? Long.fromString(val) : new Long(val.low, val.high, val.unsigned); }; var TWO_PWR_32_DBL = 4294967296, TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL, TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2, TWO_PWR_24 = Long.fromInt(1 << 24); return Long.ZERO = Long.fromInt(0), Long.UZERO = Long.fromInt(0, !0), Long.ONE = Long.fromInt(1), Long.UONE = Long.fromInt(1, !0), Long.NEG_ONE = Long.fromInt(-1), Long.MAX_VALUE = Long.fromBits(-1, 2147483647, !1), Long.MAX_UNSIGNED_VALUE = Long.fromBits(-1, -1, !0), Long.MIN_VALUE = Long.fromBits(0, -2147483648, !1), Long.prototype.toInt = function() { return this.unsigned ? this.low >>> 0 : this.low; }, Long.prototype.toNumber = function() { return this.unsigned ? (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0) : this.high * TWO_PWR_32_DBL + (this.low >>> 0); }, Long.prototype.toString = function(radix) { if ((radix = radix || 10) < 2 || 36 < radix) throw RangeError("radix out of range: " + radix); if (this.isZero()) return "0"; var rem; if (this.isNegative()) { if (this.equals(Long.MIN_VALUE)) { var radixLong = Long.fromNumber(radix), div = this.divide(radixLong); return rem = div.multiply(radixLong).subtract(this), div.toString(radix) + rem.toInt().toString(radix); } return "-" + this.negate().toString(radix); } var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); rem = this; for (var result = ""; ;) { var remDiv = rem.divide(radixToPower), digits = (rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0).toString(radix); if ((rem = remDiv).isZero()) return digits + result; for (;digits.length < 6; ) digits = "0" + digits; result = "" + digits + result; } }, Long.prototype.getHighBits = function() { return this.high; }, Long.prototype.getHighBitsUnsigned = function() { return this.high >>> 0; }, Long.prototype.getLowBits = function() { return this.low; }, Long.prototype.getLowBitsUnsigned = function() { return this.low >>> 0; }, Long.prototype.getNumBitsAbs = function() { if (this.isNegative()) return this.equals(Long.MIN_VALUE) ? 64 : this.negate().getNumBitsAbs(); for (var val = 0 != this.high ? this.high : this.low, bit = 31; bit > 0 && 0 == (val & 1 << bit); bit--) ; return 0 != this.high ? bit + 33 : bit + 1; }, Long.prototype.isZero = function() { return 0 === this.high && 0 === this.low; }, Long.prototype.isNegative = function() { return !this.unsigned && this.high < 0; }, Long.prototype.isPositive = function() { return this.unsigned || this.high >= 0; }, Long.prototype.isOdd = function() { return 1 == (1 & this.low); }, Long.prototype.isEven = function() { return 0 == (1 & this.low); }, Long.prototype.equals = function(other) { return Long.isLong(other) || (other = Long.fromValue(other)), (this.unsigned === other.unsigned || this.high >>> 31 != 1 || other.high >>> 31 != 1) && this.high === other.high && this.low === other.low; }, Long.eq = Long.prototype.equals, Long.prototype.notEquals = function(other) { return !this.equals(other); }, Long.neq = Long.prototype.notEquals, Long.prototype.lessThan = function(other) { return this.compare(other) < 0; }, Long.prototype.lt = Long.prototype.lessThan, Long.prototype.lessThanOrEqual = function(other) { return this.compare(other) <= 0; }, Long.prototype.lte = Long.prototype.lessThanOrEqual, Long.prototype.greaterThan = function(other) { return this.compare(other) > 0; }, Long.prototype.gt = Long.prototype.greaterThan, Long.prototype.greaterThanOrEqual = function(other) { return this.compare(other) >= 0; }, Long.prototype.gte = Long.prototype.greaterThanOrEqual, Long.prototype.compare = function(other) { if (Long.isLong(other) || (other = Long.fromValue(other)), this.equals(other)) return 0; var thisNeg = this.isNegative(), otherNeg = other.isNegative(); return thisNeg && !otherNeg ? -1 : !thisNeg && otherNeg ? 1 : this.unsigned ? other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.subtract(other).isNegative() ? -1 : 1; }, Long.prototype.negate = function() { return !this.unsigned && this.equals(Long.MIN_VALUE) ? Long.MIN_VALUE : this.not().add(Long.ONE); }, Long.prototype.neg = Long.prototype.negate, Long.prototype.add = function(addend) { Long.isLong(addend) || (addend = Long.fromValue(addend)); var a48 = this.high >>> 16, a32 = 65535 & this.high, a16 = this.low >>> 16, a00 = 65535 & this.low, b48 = addend.high >>> 16, b32 = 65535 & addend.high, b16 = addend.low >>> 16, c48 = 0, c32 = 0, c16 = 0, c00 = 0; return c16 += (c00 += a00 + (65535 & addend.low)) >>> 16, c00 &= 65535, c32 += (c16 += a16 + b16) >>> 16, c16 &= 65535, c48 += (c32 += a32 + b32) >>> 16, c32 &= 65535, c48 += a48 + b48, c48 &= 65535, Long.fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); }, Long.prototype.subtract = function(subtrahend) { return Long.isLong(subtrahend) || (subtrahend = Long.fromValue(subtrahend)), this.add(subtrahend.negate()); }, Long.prototype.sub = Long.prototype.subtract, Long.prototype.multiply = function(multiplier) { if (this.isZero()) return Long.ZERO; if (Long.isLong(multiplier) || (multiplier = Long.fromValue(multiplier)), multiplier.isZero()) return Long.ZERO; if (this.equals(Long.MIN_VALUE)) return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; if (multiplier.equals(Long.MIN_VALUE)) return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; if (this.isNegative()) return multiplier.isNegative() ? this.negate().multiply(multiplier.negate()) : this.negate().multiply(multiplier).negate(); if (multiplier.isNegative()) return this.multiply(multiplier.negate()).negate(); if (this.lessThan(TWO_PWR_24) && multiplier.lessThan(TWO_PWR_24)) return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); var a48 = this.high >>> 16, a32 = 65535 & this.high, a16 = this.low >>> 16, a00 = 65535 & this.low, b48 = multiplier.high >>> 16, b32 = 65535 & multiplier.high, b16 = multiplier.low >>> 16, b00 = 65535 & multiplier.low, c48 = 0, c32 = 0, c16 = 0, c00 = 0; return c16 += (c00 += a00 * b00) >>> 16, c00 &= 65535, c32 += (c16 += a16 * b00) >>> 16, c16 &= 65535, c32 += (c16 += a00 * b16) >>> 16, c16 &= 65535, c48 += (c32 += a32 * b00) >>> 16, c32 &= 65535, c48 += (c32 += a16 * b16) >>> 16, c32 &= 65535, c48 += (c32 += a00 * b32) >>> 16, c32 &= 65535, c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48, c48 &= 65535, Long.fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); }, Long.prototype.mul = Long.prototype.multiply, Long.prototype.divide = function(divisor) { if (Long.isLong(divisor) || (divisor = Long.fromValue(divisor)), divisor.isZero()) throw new Error("division by zero"); if (this.isZero()) return this.unsigned ? Long.UZERO : Long.ZERO; var approx, rem, res; if (this.equals(Long.MIN_VALUE)) return divisor.equals(Long.ONE) || divisor.equals(Long.NEG_ONE) ? Long.MIN_VALUE : divisor.equals(Long.MIN_VALUE) ? Long.ONE : (approx = this.shiftRight(1).divide(divisor).shiftLeft(1)).equals(Long.ZERO) ? divisor.isNegative() ? Long.ONE : Long.NEG_ONE : (rem = this.subtract(divisor.multiply(approx)), res = approx.add(rem.divide(divisor))); if (divisor.equals(Long.MIN_VALUE)) return this.unsigned ? Long.UZERO : Long.ZERO; if (this.isNegative()) return divisor.isNegative() ? this.negate().divide(divisor.negate()) : this.negate().divide(divisor).negate(); if (divisor.isNegative()) return this.divide(divisor.negate()).negate(); for (res = Long.ZERO, rem = this; rem.greaterThanOrEqual(divisor); ) { approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); for (var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48), approxRes = Long.fromNumber(approx), approxRem = approxRes.multiply(divisor); approxRem.isNegative() || approxRem.greaterThan(rem); ) approx -= delta, approxRem = (approxRes = Long.fromNumber(approx, this.unsigned)).multiply(divisor); approxRes.isZero() && (approxRes = Long.ONE), res = res.add(approxRes), rem = rem.subtract(approxRem); } return res; }, Long.prototype.div = Long.prototype.divide, Long.prototype.modulo = function(divisor) { return Long.isLong(divisor) || (divisor = Long.fromValue(divisor)), this.subtract(this.divide(divisor).multiply(divisor)); }, Long.prototype.mod = Long.prototype.modulo, Long.prototype.not = function() { return Long.fromBits(~this.low, ~this.high, this.unsigned); }, Long.prototype.and = function(other) { return Long.isLong(other) || (other = Long.fromValue(other)), Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); }, Long.prototype.or = function(other) { return Long.isLong(other) || (other = Long.fromValue(other)), Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); }, Long.prototype.xor = function(other) { return Long.isLong(other) || (other = Long.fromValue(other)), Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); }, Long.prototype.shiftLeft = function(numBits) { return Long.isLong(numBits) && (numBits = numBits.toInt()), 0 == (numBits &= 63) ? this : numBits < 32 ? Long.fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned) : Long.fromBits(0, this.low << numBits - 32, this.unsigned); }, Long.prototype.shl = Long.prototype.shiftLeft, Long.prototype.shiftRight = function(numBits) { return Long.isLong(numBits) && (numBits = numBits.toInt()), 0 == (numBits &= 63) ? this : numBits < 32 ? Long.fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned) : Long.fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); }, Long.prototype.shr = Long.prototype.shiftRight, Long.prototype.shiftRightUnsigned = function(numBits) { if (Long.isLong(numBits) && (numBits = numBits.toInt()), 0 == (numBits &= 63)) return this; var high = this.high; if (numBits < 32) { var low = this.low; return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits, this.unsigned); } return 32 === numBits ? Long.fromBits(high, 0, this.unsigned) : Long.fromBits(high >>> numBits - 32, 0, this.unsigned); }, Long.prototype.shru = Long.prototype.shiftRightUnsigned, Long.prototype.toSigned = function() { return this.unsigned ? new Long(this.low, this.high, !1) : this; }, Long.prototype.toUnsigned = function() { return this.unsigned ? this : new Long(this.low, this.high, !0); }, Long; }) ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, []) : __WEBPACK_AMD_DEFINE_FACTORY__) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); }, function(module, exports) { module.exports = require("memcpy"); }, function(module, exports) { module.exports = { package: "extensions.api.cast_channel", messages: [ { name: "CastMessage", fields: [ { rule: "required", options: {}, type: "ProtocolVersion", name: "protocol_version", id: 1 }, { rule: "required", options: {}, type: "string", name: "source_id", id: 2 }, { rule: "required", options: {}, type: "string", name: "destination_id", id: 3 }, { rule: "required", options: {}, type: "string", name: "namespace", id: 4 }, { rule: "required", options: {}, type: "PayloadType", name: "payload_type", id: 5 }, { rule: "optional", options: {}, type: "string", name: "payload_utf8", id: 6 }, { rule: "optional", options: {}, type: "bytes", name: "payload_binary", id: 7 } ], enums: [ { name: "ProtocolVersion", values: [ { name: "CASTV2_1_0", id: 0 } ], options: {} }, { name: "PayloadType", values: [ { name: "STRING", id: 0 }, { name: "BINARY", id: 1 } ], options: {} } ], messages: [], options: {}, oneofs: {} }, { name: "AuthChallenge", fields: [], enums: [], messages: [], options: {}, oneofs: {} }, { name: "AuthResponse", fields: [ { rule: "required", options: {}, type: "bytes", name: "signature", id: 1 }, { rule: "required", options: {}, type: "bytes", name: "client_auth_certificate", id: 2 }, { rule: "repeated", options: {}, type: "bytes", name: "client_ca", id: 3 } ], enums: [], messages: [], options: {}, oneofs: {} }, { name: "AuthError", fields: [ { rule: "required", options: {}, type: "ErrorType", name: "error_type", id: 1 } ], enums: [ { name: "ErrorType", values: [ { name: "INTERNAL_ERROR", id: 0 }, { name: "NO_TLS", id: 1 } ], options: {} } ], messages: [], options: {}, oneofs: {} }, { name: "DeviceAuthMessage", fields: [ { rule: "optional", options: {}, type: "AuthChallenge", name: "challenge", id: 1 }, { rule: "optional", options: {}, type: "AuthResponse", name: "response", id: 2 }, { rule: "optional", options: {}, type: "AuthError", name: "error", id: 3 } ], enums: [], messages: [], options: {}, oneofs: {} } ], enums: [], imports: [], options: { optimize_for: "LITE_RUNTIME" }, services: [] }; }, function(module, exports, __webpack_require__) { var EventEmitter = __webpack_require__(4).EventEmitter, util = __webpack_require__(0); function Channel(bus, sourceId, destinationId, namespace, encoding) { EventEmitter.call(this), this.bus = bus, this.sourceId = sourceId, this.destinationId = destinationId, this.namespace = namespace, this.encoding = encoding; var self = this; function onmessage(sourceId, destinationId, namespace, data) { sourceId === self.destinationId && (destinationId !== self.sourceId && "*" !== destinationId || namespace === self.namespace && self.emit("message", (function(data, encoding) { if (!encoding) return data; if ("JSON" === encoding) return JSON.parse(data); throw new Error("Unsupported channel encoding: " + encoding); })(data, self.encoding), "*" === destinationId)); } this.bus.on("message", onmessage), this.bus.on("close", self.close), this.once("close", (function() { self.bus.removeListener("message", onmessage); })); } __webpack_require__(9)("castv2"), util.inherits(Channel, EventEmitter), Channel.prototype.send = function(data) { this.bus.send(this.sourceId, this.destinationId, this.namespace, (function(data, encoding) { if (!encoding) return data; if ("JSON" === encoding) return JSON.stringify(data); throw new Error("Unsupported channel encoding: " + encoding); })(data, this.encoding)); }, Channel.prototype.close = function() { this.emit("close"); }, module.exports = Channel; }, function(module, exports, __webpack_require__) { var EventEmitter = __webpack_require__(4).EventEmitter, util = __webpack_require__(0), tls = __webpack_require__(70), debug = __webpack_require__(9)("castv2"), protocol = __webpack_require__(237), PacketStreamWrapper = __webpack_require__(481), CastMessage = protocol.CastMessage; function Server(options) { EventEmitter.call(this), this.server = new tls.Server(options), this.clients = {}; } function genClientId(socket) { return [ socket.remoteAddress, socket.remotePort ].join(":"); } util.inherits(Server, EventEmitter), Server.prototype.listen = function(port, host, callback) { var self = this, args = Array.prototype.slice.call(arguments); function onlisten() { var addr = self.server.address(); debug("server listening on %s:%d", addr.address, addr.port), callback && callback(); } function onconnect(socket) { debug("connection from %s:%d", socket.remoteAddress, socket.remotePort); var ps = new PacketStreamWrapper(socket), clientId = genClientId(socket); function onpacket(buf) { var message = CastMessage.parse(buf); if (debug("recv message: clientId=%s protocolVersion=%s sourceId=%s destinationId=%s namespace=%s data=%s", clientId, message.protocol_version, message.source_id, message.destination_id, message.namespace, 1 === message.payload_type ? util.inspect(message.payload_binary) : message.payload_utf8), 0 !== message.protocol_version) return debug("client error: clientId=%s unsupported protocol version (%s)", clientId, message.protocolVersion), void self.clients[clientId].socket.end(); self.emit("message", clientId, message.source_id, message.destination_id, message.namespace, 1 === message.payload_type ? message.payload_binary : message.payload_utf8); } ps.on("packet", onpacket), socket.once("close", (function() { debug("client %s disconnected", clientId), ps.removeListener("packet", onpacket), delete self.clients[clientId]; })), self.clients[clientId] = { socket: socket, ps: ps }; } function onshutdown() { debug("server shutting down"), self.server.removeListener("secureConnection", onconnect), self.emit("close"); } function onerror(err) { debug("error: %s %j", err.message, err), self.emit("error", err); } "function" == typeof args[args.length - 1] && (callback = args.pop()), this.server.listen.apply(this.server, args.concat([ onlisten ])), this.server.on("secureConnection", onconnect), this.server.on("error", onerror), this.server.once("close", onshutdown); }, Server.prototype.close = function() { for (var clientId in this.server.close(), this.clients) this.clients[clientId].socket.end(); }, Server.prototype.send = function(clientId, sourceId, destinationId, namespace, data) { var message = { protocol_version: 0, source_id: sourceId, destination_id: destinationId, namespace: namespace }; Buffer.isBuffer(data) ? (message.payload_type = 1, message.payload_binary = data) : (message.payload_type = 0, message.payload_utf8 = data), debug("send message: clientId=%s protocolVersion=%s sourceId=%s destinationId=%s namespace=%s data=%s", clientId, message.protocol_version, message.source_id, message.destination_id, message.namespace, 1 === message.payload_type ? util.inspect(message.payload_binary) : message.payload_utf8); var buf = CastMessage.serialize(message); this.clients[clientId].ps.send(buf); }, module.exports = Server; }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(7); var querystring = __webpack_require__(24), Promise = __webpack_require__(234), MediaRendererClient = (__webpack_require__(34), Promise.promisifyAll(__webpack_require__(475)), __webpack_require__(32), __webpack_require__(179), __webpack_require__(1009)), util = __webpack_require__(0), castingUtils = __webpack_require__(233), Player = __webpack_require__(482); function DLNAClient(device, executables) { Player.call(this, device), this.device = device, this.seekTime = 0, this.stateFlags = 1, this.executables = executables, this.videoDuration = {}, this._handleError = this._handleError.bind(this), this._updateStatus = this._updateStatus.bind(this); var client = new MediaRendererClient(device.location); this.player = Promise.promisifyAll(client); var self = this; client.on("status", this._updateStatus), client.on("loading", (function() { self._updateStatusField("state", "TRANSITIONING"); })), client.on("playing", (function() { self._updateStatusField("state", "PLAYING"); })), client.on("paused", (function() { self._updateStatusField("state", "PAUSED_PLAYBACK"); })), client.on("stopped", (function() { self._updateStatusField("state", "STOPPED"); })), client.on("error", this._handleError); } util.inherits(DLNAClient, Player), DLNAClient.FLAG_DISABLE_UPDATES = 2, DLNAClient.PLAYBACK_DELAY = 3e3, DLNAClient.prototype._handleError = function(err) { this.mediaStatus.state = 7, console.log(err.toString()); }, DLNAClient.prototype._updateStatusField = function(field, value) { if (void 0 !== value && !(this.stateFlags & DLNAClient.FLAG_DISABLE_UPDATES)) switch (field) { case "state": this.mediaStatus.realStatus = value, this.mediaStatus[field] = { IDLE: 0, TRANSITIONING: 2, PLAYING: 3, PAUSED_PLAYBACK: 4, STOPPED: 5, NO_MEDIA_PRESENT: 6, ERROR_OCCURRED: 7 }[value], 6 == this.mediaStatus[field] && this.stateFlags && (this.mediaStatus[field] = 5), this.mediaStatus.paused = 4 == this.mediaStatus[field]; break; case "time": this.mediaStatus[field] = this.seekTime + 1e3 * parseInt(value, 10); break; case "volume": this.mediaStatus[field] = parseFloat(value, 10) / 100; break; default: this.mediaStatus[field] = value; } }, DLNAClient.prototype._updateStatus = function(status) { status && (this._updateStatusField("state", status.TransportState), this._updateStatusField("time", status.CurrentTrackPosition), this._updateStatusField("volume", status.CurrentVolume)); }, DLNAClient.prototype.middleware = function(req, res, next) { return this.setEndpoint(req), this.transcodeURL = this.endpoint + req.baseUrl + "/transcode.mp4", Player.prototype.middleware.call(this, req, res, next); }, DLNAClient.prototype.init = function() { var self = this; return Promise.all([ this.player.getPositionAsync(), this.player.getVolumeAsync() ]).then((function(res) { return self._updateStatus({ CurrentTrackPosition: res[0], CurrentVolume: res[1] }), self.mediaStatus; })); }, DLNAClient.prototype._simplePlayerCommand = function(cmd, args) { return args = args || [], this.player[cmd].apply(this.player, args).then(this.status.bind(this)); }, DLNAClient.prototype.status = function() { return Promise.resolve(this.mediaStatus); }, DLNAClient.prototype.playFromStatus = function() { if (!this.mediaStatus.source) return Promise.reject("No source!"); this.stateFlags |= DLNAClient.FLAG_DISABLE_UPDATES, this.mediaStatus.state = 3, this.seekTime = this.mediaStatus.time; var options = { autoplay: !0, contentType: "video/x-mkv", metadata: { title: "Video by Stremio", creator: "Stremio", type: "video" } }, proxySrv = this.transcodeURL + "?" + querystring.stringify({ video: this.mediaStatus.source, audioTrack: this.mediaStatus.audioTrack, time: this.mediaStatus.time / 1e3 || 0, subtitles: this.mediaStatus.subtitlesSrc, subtitlesDelay: this.mediaStatus.subtitlesDelay }), self = this; return this.player.stopAsync().catch(Function.prototype).then((function() { return self.stateFlags &= ~DLNAClient.FLAG_DISABLE_UPDATES, self.player.loadAsync(proxySrv, options); })); }, DLNAClient.prototype.delayedPlayFromStatus = function() { clearTimeout(this.deferedPlay), this.stateFlags |= DLNAClient.FLAG_DISABLE_UPDATES, this.mediaStatus.state = 3; var playFromStatus = this.playFromStatus.bind(this); return this.deferedPlay = setTimeout(playFromStatus, DLNAClient.PLAYBACK_DELAY), this.mediaStatus; }, DLNAClient.prototype.play = function(srcURL) { this.mediaStatus.source = srcURL, this.mediaStatus.time = 0, this.mediaStatus.subtitlesSrc = null, this.mediaStatus.subtitlesDelay = 0; var self = this; return castingUtils.getVideoInfo(this.executables.ffmpeg, srcURL).then((function(info) { return self.mediaStatus.audio = info.streams.filter((function(stream) { return "Audio" === stream.type; })), self.mediaStatus.audioTrack = (self.mediaStatus.audio[0] || {}).id, self.stateFlags = 0, self.mediaStatus.length = 1e3 * info.duration, self.delayedPlayFromStatus(); })); }, DLNAClient.prototype.audioTrack = function(audioTrack, offset) { return offset && console.log("Audio track offset is not implemented yet"), this.mediaStatus.source ? (this.mediaStatus.audioTrack = audioTrack, this.delayedPlayFromStatus()) : this.status(); }, DLNAClient.prototype.subtitles = function(subsURL, offset, style) { return this.mediaStatus.source ? (this.mediaStatus.subtitlesSrc = subsURL, this.mediaStatus.subtitlesDelay = offset, this.delayedPlayFromStatus()) : this.status(); }, DLNAClient.prototype.resume = function() { return this._simplePlayerCommand("playAsync"); }, DLNAClient.prototype.pause = function() { return this._simplePlayerCommand("pauseAsync"); }, DLNAClient.prototype.stop = function() { return this._simplePlayerCommand("stopAsync"); }, DLNAClient.prototype.seek = function(time) { return 3 != this.mediaStatus.state ? this.status() : (this.mediaStatus.time = parseInt(time, 10), this.delayedPlayFromStatus()); }, DLNAClient.prototype.volume = function(vol) { return this._simplePlayerCommand("setVolumeAsync", [ 100 * parseFloat(vol, 10) ]); }, DLNAClient.prototype.close = function() { return this.stateFlags = 1, this.stop(); }, module.exports = DLNAClient; }, function(module, exports, __webpack_require__) { var DeviceClient = __webpack_require__(1010), util = __webpack_require__(0), et = (__webpack_require__(9)("upnp-mediarenderer-client"), __webpack_require__(238)), MEDIA_EVENTS = [ "status", "loading", "playing", "paused", "stopped", "speedChanged" ]; function MediaRendererClient(url) { DeviceClient.call(this, url), this.instanceId = 0; var receivedState, self = this, refs = 0; function onstatus(e) { if (self.emit("status", e), receivedState) { if (e.hasOwnProperty("TransportState")) switch (e.TransportState) { case "TRANSITIONING": self.emit("loading"); break; case "PLAYING": self.emit("playing"); break; case "PAUSED_PLAYBACK": self.emit("paused"); break; case "STOPPED": self.emit("stopped"); } e.hasOwnProperty("TransportPlaySpeed") && self.emit("speedChanged", Number(e.TransportPlaySpeed)); } else receivedState = !0; } this.addListener("newListener", (function(eventName, listener) { -1 !== MEDIA_EVENTS.indexOf(eventName) && (0 === refs && (receivedState = !1, self.subscribe("AVTransport", onstatus)), refs++); })), this.addListener("removeListener", (function(eventName, listener) { -1 !== MEDIA_EVENTS.indexOf(eventName) && 0 == --refs && self.unsubscribe("AVTransport", onstatus); })); } function formatTime(seconds) { var s, h = 0, m = 0; function pad(v) { return v < 10 ? "0" + v : v; } return s = seconds - 3600 * (h = Math.floor((seconds - 0 * h - 0 * m) / 3600)) - 60 * (m = Math.floor((seconds - 3600 * h - 0 * m) / 60)), [ pad(h), pad(m), pad(s) ].join(":"); } function parseTime(time) { var parts = time.split(":").map(Number); return 3600 * parts[0] + 60 * parts[1] + parts[2]; } function buildMetadata(metadata) { var didl = et.Element("DIDL-Lite"); didl.set("xmlns", "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"), didl.set("xmlns:dc", "http://purl.org/dc/elements/1.1/"), didl.set("xmlns:upnp", "urn:schemas-upnp-org:metadata-1-0/upnp/"), didl.set("xmlns:sec", "http://www.sec.co.kr/"); var item = et.SubElement(didl, "item"); if (item.set("id", 0), item.set("parentID", -1), item.set("restricted", !1), metadata.type && (et.SubElement(item, "upnp:class").text = { audio: "object.item.audioItem.musicTrack", video: "object.item.videoItem.movie", image: "object.item.imageItem.photo" }[metadata.type]), metadata.title && (et.SubElement(item, "dc:title").text = metadata.title), metadata.creator && (et.SubElement(item, "dc:creator").text = metadata.creator), metadata.url && metadata.protocolInfo && ((res = et.SubElement(item, "res")).set("protocolInfo", metadata.protocolInfo), res.text = metadata.url), metadata.subtitlesUrl) { var captionInfo = et.SubElement(item, "sec:CaptionInfo"); captionInfo.set("sec:type", "srt"), captionInfo.text = metadata.subtitlesUrl; var res, captionInfoEx = et.SubElement(item, "sec:CaptionInfoEx"); captionInfoEx.set("sec:type", "srt"), captionInfoEx.text = metadata.subtitlesUrl, (res = et.SubElement(item, "res")).set("protocolInfo", "http-get:*:text/srt:*"), res.text = metadata.subtitlesUrl; } return new et.ElementTree(didl).write({ xml_declaration: !1 }); } function noop() {} util.inherits(MediaRendererClient, DeviceClient), MediaRendererClient.prototype.getSupportedProtocols = function(callback) { this.callAction("ConnectionManager", "GetProtocolInfo", {}, (function(err, result) { if (err) return callback(err); var protocols = result.Sink.split(",").map((function(line) { var tmp = line.split(":"); return { protocol: tmp[0], network: tmp[1], contentFormat: tmp[2], additionalInfo: tmp[3] }; })); callback(null, protocols); })); }, MediaRendererClient.prototype.getPosition = function(callback) { this.callAction("AVTransport", "GetPositionInfo", { InstanceID: this.instanceId }, (function(err, result) { if (err) return callback(err); var str = "NOT_IMPLEMENTED" !== result.AbsTime ? result.AbsTime : result.RelTime; callback(null, parseTime(str)); })); }, MediaRendererClient.prototype.getDuration = function(callback) { this.callAction("AVTransport", "GetMediaInfo", { InstanceID: this.instanceId }, (function(err, result) { if (err) return callback(err); callback(null, parseTime(result.MediaDuration)); })); }, MediaRendererClient.prototype.load = function(url, options, callback) { var self = this; "function" == typeof options && (callback = options, options = {}); var protocolInfo = "http-get:*:" + (options.contentType || "video/mpeg") + ":*", metadata = options.metadata || {}; metadata.url = url, metadata.protocolInfo = protocolInfo; var params = { RemoteProtocolInfo: protocolInfo, PeerConnectionManager: null, PeerConnectionID: -1, Direction: "Input" }; this.callAction("ConnectionManager", "PrepareForConnection", params, (function(err, result) { if (err) { if ("ENOACTION" !== err.code) return callback(err); } else self.instanceId = result.AVTransportID; var params = { InstanceID: self.instanceId, CurrentURI: url, CurrentURIMetaData: buildMetadata(metadata) }; self.callAction("AVTransport", "SetAVTransportURI", params, (function(err) { if (err) return callback(err); options.autoplay ? self.play(callback) : callback(); })); })); }, MediaRendererClient.prototype.play = function(callback) { var params = { InstanceID: this.instanceId, Speed: 1 }; this.callAction("AVTransport", "Play", params, callback || noop); }, MediaRendererClient.prototype.pause = function(callback) { var params = { InstanceID: this.instanceId }; this.callAction("AVTransport", "Pause", params, callback || noop); }, MediaRendererClient.prototype.stop = function(callback) { var params = { InstanceID: this.instanceId }; this.callAction("AVTransport", "Stop", params, callback || noop); }, MediaRendererClient.prototype.seek = function(seconds, callback) { var params = { InstanceID: this.instanceId, Unit: "REL_TIME", Target: formatTime(seconds) }; this.callAction("AVTransport", "Seek", params, callback || noop); }, MediaRendererClient.prototype.getVolume = function(callback) { this.callAction("RenderingControl", "GetVolume", { InstanceID: this.instanceId, Channel: "Master" }, (function(err, result) { if (err) return callback(err); callback(null, parseInt(result.CurrentVolume)); })); }, MediaRendererClient.prototype.setVolume = function(volume, callback) { var params = { InstanceID: this.instanceId, Channel: "Master", DesiredVolume: volume }; this.callAction("RenderingControl", "SetVolume", params, callback || noop); }, module.exports = MediaRendererClient; }, function(module, exports, __webpack_require__) { var http = __webpack_require__(11), util = __webpack_require__(0), EventEmitter = __webpack_require__(4).EventEmitter, et = __webpack_require__(238), parseUrl = __webpack_require__(7).parse, os = __webpack_require__(23), concat = __webpack_require__(1018), address = __webpack_require__(1022), debug = __webpack_require__(9)("upnp-device-client"), pkg = __webpack_require__(1023), OS_VERSION = [ os.platform(), os.release() ].join("/"), PACKAGE_VERSION = [ pkg.name, pkg.version ].join("/"); function DeviceClient(url) { EventEmitter.call(this), this.url = url, this.deviceDescription = null, this.serviceDescriptions = {}, this.server = null, this.listening = !1, this.subscriptions = {}; } function parseTimeout(header) { return Number(header.split("-")[1]); } function fetch(url, callback) { var req = http.get(url, (function(res) { if (200 !== res.statusCode) { var err = new Error("Request failed"); return err.statusCode = res.statusCode, callback(err); } res.pipe(concat((function(buf) { callback(null, buf.toString()); }))); })); req.on("error", callback), req.end(); } function extractFields(node, fields) { var data = {}; return fields.forEach((function(field) { var value = node.findtext("./" + field); void 0 !== value && (data[field] = value); })), data; } function buildAbsoluteUrl(base, url) { return "" === url ? "" : "http" === url.substring(0, 4) ? url : "/" === url[0] ? base.split("/").slice(0, 3).join("/") + url : base + "/" + url; } function resolveService(serviceId) { return -1 === serviceId.indexOf(":") ? "urn:upnp-org:serviceId:" + serviceId : serviceId; } util.inherits(DeviceClient, EventEmitter), DeviceClient.prototype.getDeviceDescription = function(callback) { var self = this; this.deviceDescription ? process.nextTick((function() { callback(null, self.deviceDescription); })) : (debug("fetch device description"), fetch(this.url, (function(err, body) { if (err) return callback(err); var desc = (function(xml, url) { var doc = et.parse(xml), desc = extractFields(doc.find("./device"), [ "deviceType", "friendlyName", "manufacturer", "manufacturerURL", "modelName", "modelNumber", "modelDescription", "UDN" ]), nodes = doc.findall("./device/iconList/icon"); desc.icons = nodes.map((function(icon) { return extractFields(icon, [ "mimetype", "width", "height", "depth", "url" ]); })), nodes = doc.findall("./device/serviceList/service"), desc.services = {}, nodes.forEach((function(service) { var tmp = extractFields(service, [ "serviceType", "serviceId", "SCPDURL", "controlURL", "eventSubURL" ]), id = tmp.serviceId; delete tmp.serviceId, desc.services[id] = tmp; })); var baseUrl = (function(url) { return url.split("/").slice(0, -1).join("/"); })(url); return desc.icons.map((function(icon) { return icon.url = buildAbsoluteUrl(baseUrl, icon.url), icon; })), Object.keys(desc.services).forEach((function(id) { var service = desc.services[id]; service.SCPDURL = buildAbsoluteUrl(baseUrl, service.SCPDURL), service.controlURL = buildAbsoluteUrl(baseUrl, service.controlURL), service.eventSubURL = buildAbsoluteUrl(baseUrl, service.eventSubURL); })), desc; })(body, self.url); self.deviceDescription = desc, callback(null, desc); }))); }, DeviceClient.prototype.getServiceDescription = function(serviceId, callback) { var self = this; serviceId = resolveService(serviceId), this.getDeviceDescription((function(err, desc) { if (err) return callback(err); var service = desc.services[serviceId]; return service ? self.serviceDescriptions[serviceId] ? callback(null, self.serviceDescriptions[serviceId]) : (debug("fetch service description (%s)", serviceId), void fetch(service.SCPDURL, (function(err, body) { if (err) return callback(err); var desc = (function(xml) { var doc = et.parse(xml), desc = { actions: {} }; return doc.findall("./actionList/action").forEach((function(action) { var name = action.findtext("./name"), inputs = [], outputs = []; action.findall("./argumentList/argument").forEach((function(argument) { var arg = extractFields(argument, [ "name", "direction", "relatedStateVariable" ]), direction = arg.direction; delete arg.direction, "in" === direction ? inputs.push(arg) : outputs.push(arg); })), desc.actions[name] = { inputs: inputs, outputs: outputs }; })), desc.stateVariables = {}, doc.findall("./serviceStateTable/stateVariable").forEach((function(stateVariable) { var name = stateVariable.findtext("./name"), allowedValues = stateVariable.findall("./allowedValueList/allowedValue").map((function(allowedValue) { return allowedValue.text; })); desc.stateVariables[name] = { dataType: stateVariable.findtext("./dataType"), sendEvents: stateVariable.get("sendEvents"), allowedValues: allowedValues, defaultValue: stateVariable.findtext("./defaultValue") }; })), desc; })(body); self.serviceDescriptions[serviceId] = desc, callback(null, desc); }))) : ((err = new Error("Service " + serviceId + " not provided by device")).code = "ENOSERVICE", callback(err)); })); }, DeviceClient.prototype.callAction = function(serviceId, actionName, params, callback) { var self = this; serviceId = resolveService(serviceId), this.getServiceDescription(serviceId, (function(err, desc) { if (err) return callback(err); if (!desc.actions[actionName]) return (err = new Error("Action " + actionName + " not implemented by service")).code = "ENOACTION", callback(err); var service = self.deviceDescription.services[serviceId], envelope = et.Element("s:Envelope"); envelope.set("xmlns:s", "http://schemas.xmlsoap.org/soap/envelope/"), envelope.set("s:encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/"); var body = et.SubElement(envelope, "s:Body"), action = et.SubElement(body, "u:" + actionName); action.set("xmlns:u", service.serviceType), Object.keys(params).forEach((function(paramName) { var tmp = et.SubElement(action, paramName), value = params[paramName]; tmp.text = null === value ? "" : params[paramName].toString(); })); var xml = new et.ElementTree(envelope).write({ xml_declaration: !0 }), options = parseUrl(service.controlURL); options.method = "POST", options.headers = { "Content-Type": 'text/xml; charset="utf-8"', "Content-Length": xml.length, Connection: "close", SOAPACTION: '"' + service.serviceType + "#" + actionName + '"' }, debug("call action %s on service %s with params %j", actionName, serviceId, params); var req = http.request(options, (function(res) { res.pipe(concat((function(buf) { var doc = et.parse(buf.toString()); if (200 !== res.statusCode) { var errorCode = doc.findtext(".//errorCode"), errorDescription = doc.findtext(".//errorDescription").trim(), err = new Error(errorDescription + " (" + errorCode + ")"); return err.code = "EUPNP", err.statusCode = res.statusCode, err.errorCode = errorCode, callback(err); } var outputs = self.serviceDescriptions[serviceId].actions[actionName].outputs.map((function(desc) { return desc.name; })), result = {}; outputs.forEach((function(name) { result[name] = doc.findtext(".//" + name); })), callback(null, result); }))); })); req.on("error", callback), req.end(xml); })); }, DeviceClient.prototype.subscribe = function(serviceId, listener) { var self = this; serviceId = resolveService(serviceId), this.subscriptions[serviceId] ? this.subscriptions[serviceId].listeners.push(listener) : this.getDeviceDescription((function(err, desc) { if (err) return self.emit("error", err); var service = desc.services[serviceId]; if (!service) return (err = new Error("Service " + serviceId + " not provided by device")).code = "ENOSERVICE", self.emit("error", err); self.ensureEventingServer((function() { var options = parseUrl(service.eventSubURL), server = self.server; options.method = "SUBSCRIBE", options.headers = { HOST: options.host, "USER-AGENT": [ OS_VERSION, "UPnP/1.1", PACKAGE_VERSION ].join(" "), CALLBACK: "", NT: "upnp:event", TIMEOUT: "Second-300" }; var req = http.request(options, (function(res) { if (200 !== res.statusCode) { var err = new Error("SUBSCRIBE error"); return err.statusCode = res.statusCode, self.releaseEventingServer(), void self.emit("error", err); } var sid = res.headers.sid, timeout = parseTimeout(res.headers.timeout), renewTimeout = Math.max(timeout - 30, 30); debug("renewing subscription to %s in %d seconds", serviceId, renewTimeout); var timer = setTimeout((function renew() { debug("renew subscription to %s", serviceId); var options = parseUrl(service.eventSubURL); options.method = "SUBSCRIBE", options.headers = { HOST: options.host, SID: sid, TIMEOUT: "Second-300" }; var req = http.request(options, (function(res) { if (200 !== res.statusCode) { var err = new Error("SUBSCRIBE renewal error"); return err.statusCode = res.statusCode, void self.emit("error", err); } var timeout = parseTimeout(res.headers.timeout), renewTimeout = Math.max(timeout - 30, 30); debug("renewing subscription to %s in %d seconds", serviceId, renewTimeout); var timer = setTimeout(renew, 1e3 * renewTimeout); self.subscriptions[serviceId].timer = timer; })); req.on("error", (function(err) { self.emit("error", err); })), req.end(); }), 1e3 * renewTimeout); self.subscriptions[serviceId] = { sid: sid, url: service.eventSubURL, timer: timer, listeners: [ listener ] }; })); req.on("error", (function(err) { self.releaseEventingServer(), self.emit("error", err); })), req.end(); })); })); }, DeviceClient.prototype.unsubscribe = function(serviceId, listener) { var self = this; serviceId = resolveService(serviceId); var subscription = this.subscriptions[serviceId]; if (subscription) { var idx = subscription.listeners.indexOf(listener); if (-1 !== idx && (subscription.listeners.splice(idx, 1), 0 === subscription.listeners.length)) { debug("unsubscribe from service %s", serviceId); var options = parseUrl(subscription.url); options.method = "UNSUBSCRIBE", options.headers = { HOST: options.host, SID: subscription.sid }; var req = http.request(options, (function(res) { if (200 !== res.statusCode) { var err = new Error("UNSUBSCRIBE error"); return err.statusCode = res.statusCode, self.emit("error", err); } clearTimeout(self.subscriptions[serviceId].timer), delete self.subscriptions[serviceId], self.releaseEventingServer(); })); req.on("error", (function(err) { self.emit("error", err); })), req.end(); } } }, DeviceClient.prototype.ensureEventingServer = function(callback) { var self = this; this.server || (debug("create eventing server"), this.server = http.createServer((function(req, res) { req.pipe(concat((function(buf) { var sid = req.headers.sid, seq = req.headers.seq, events = (function(buf) { var events = [], doc = et.parse(buf.toString()), lastChange = doc.findtext(".//LastChange"); if (lastChange) (doc = et.parse(lastChange)).findall("./InstanceID").forEach((function(instance) { var data = { InstanceID: Number(instance.get("val")) }; instance.findall("./*").forEach((function(node) { data[node.tag] = node.get("val"); })), events.push(data); })); else { var data = {}; doc.findall("./property/*").forEach((function(node) { data[node.tag] = node.text; })), events.push(data); } return events; })(buf); debug("received events %s %d %j", sid, seq, events); var keys = Object.keys(self.subscriptions), idx = keys.map((function(key) { return self.subscriptions[key].sid; })).indexOf(sid); if (-1 !== idx) { var serviceId = keys[idx]; self.subscriptions[serviceId].listeners.forEach((function(listener) { events.forEach((function(e) { listener(e); })); })); } else debug("WARNING unknown SID %s", sid); }))); })), this.server.listen(0, address.ipv4())), this.listening ? process.nextTick(callback) : this.server.on("listening", (function() { self.listening = !0, callback(); })); }, DeviceClient.prototype.releaseEventingServer = function() { 0 === Object.keys(this.subscriptions).length && (debug("shutdown eventing server"), this.server.close(), this.server = null, this.listening = !1); }, module.exports = DeviceClient; }, function(module, exports, __webpack_require__) { var sprintf = __webpack_require__(239).sprintf, utils = __webpack_require__(483), SyntaxError = __webpack_require__(1012).SyntaxError, _cache = {}, RE = new RegExp("('[^']*'|\"[^\"]*\"|::|//?|\\.\\.|\\(\\)|[/.*:\\[\\]\\(\\)@=])|((?:\\{[^}]+\\})?[^/\\[\\]\\(\\)@=\\s]+)|\\s+", "g"), xpath_tokenizer = utils.findall.bind(null, RE), ops = { "": function(next, token) { var tag = token[0]; return function(context, result) { var i, len, rv = []; for (i = 0, len = result.length; i < len; i++) result[i]._children.forEach((function(e) { e.tag === tag && rv.push(e); })); return rv; }; }, "*": function(next, token) { return function(context, result) { var i, len, rv = []; for (i = 0, len = result.length; i < len; i++) result[i]._children.forEach((function(e) { rv.push(e); })); return rv; }; }, ".": function(next, token) { return function(context, result) { var i, len, elem, rv = []; for (i = 0, len = result.length; i < len; i++) elem = result[i], rv.push(elem); return rv; }; }, "..": function(next, token) { return function(context, result) { var i, len, elem, rv = [], parent_map = context.parent_map; for (parent_map || (context.parent_map = parent_map = {}, context.root.iter(null, (function(p) { p._children.forEach((function(e) { parent_map[e] = p; })); }))), i = 0, len = result.length; i < len; i++) elem = result[i], parent_map.hasOwnProperty(elem) && rv.push(parent_map[elem]); return rv; }; }, "//": function(next, token) { var tag; if ("*" === (token = next())[1]) tag = "*"; else { if (token[1]) throw new SyntaxError(token); tag = token[0] || ""; } return function(context, result) { var i, len, elem, rv = []; for (i = 0, len = result.length; i < len; i++) (elem = result[i]).iter(tag, (function(e) { e !== elem && rv.push(e); })); return rv; }; }, "[": function(next, token) { var tag, key, value, select; if ("@" === (token = next())[1]) { if ((token = next())[1]) throw new SyntaxError(token, "Invalid attribute predicate"); if (key = token[0], "]" === (token = next())[1]) select = function(context, result) { var i, len, elem, rv = []; for (i = 0, len = result.length; i < len; i++) (elem = result[i]).get(key) && rv.push(elem); return rv; }; else if ("=" === token[1]) { if ('"' !== (value = next()[1])[0] && "'" !== value[value.length - 1]) throw new SyntaxError(token, "Ivalid comparison target"); value = value.slice(1, value.length - 1), token = next(), select = function(context, result) { var i, len, elem, rv = []; for (i = 0, len = result.length; i < len; i++) (elem = result[i]).get(key) === value && rv.push(elem); return rv; }; } if ("]" !== token[1]) throw new SyntaxError(token, "Invalid attribute predicate"); } else { if (token[1]) throw new SyntaxError(null, "Invalid predicate"); if (tag = token[0] || "", "]" !== (token = next())[1]) throw new SyntaxError(token, "Invalid node predicate"); select = function(context, result) { var i, len, elem, rv = []; for (i = 0, len = result.length; i < len; i++) (elem = result[i]).find(tag) && rv.push(elem); return rv; }; } return select; } }; function _SelectorContext(root) { this.parent_map = null, this.root = root; } function findall(elem, path) { var selector, result, i, len, token, value, select, context; if (_cache.hasOwnProperty(path)) selector = _cache[path]; else { if (Object.keys(_cache).length > 100 && (_cache = {}), "/" === path.charAt(0)) throw new SyntaxError(null, "Cannot use absolute path on element"); function getToken() { return result.shift(); } for (result = xpath_tokenizer(path), selector = [], token = getToken(); ;) { var c = token[1] || ""; if (!(value = ops[c](getToken, token))) throw new SyntaxError(null, sprintf("Invalid path: %s", path)); if (selector.push(value), !(token = getToken())) break; if ("/" === token[1] && (token = getToken()), !token) break; } _cache[path] = selector; } for (result = [ elem ], context = new _SelectorContext(elem), i = 0, len = selector.length; i < len; i++) select = selector[i], result = select(context, result); return result || []; } exports.find = function(element, path) { var resultElements = findall(element, path); return resultElements && resultElements.length > 0 ? resultElements[0] : null; }, exports.findall = findall, exports.findtext = function(element, path, defvalue) { var resultElements = findall(element, path); return resultElements && resultElements.length > 0 ? resultElements[0].text : defvalue; }; }, function(module, exports, __webpack_require__) { var util = __webpack_require__(0), sprintf = __webpack_require__(239).sprintf; function SyntaxError(token, msg) { msg = msg || sprintf("Syntax Error at token %s", token.toString()), this.token = token, this.message = msg, Error.call(this, msg); } util.inherits(SyntaxError, Error), exports.SyntaxError = SyntaxError; }, function(module, exports, __webpack_require__) { __webpack_require__(0); var parsers = __webpack_require__(1014); exports.get_parser = function(name) { if ("sax" === name) return parsers.sax; throw new Error("Invalid parser: " + name); }; }, function(module, exports, __webpack_require__) { exports.sax = __webpack_require__(1015); }, function(module, exports, __webpack_require__) { __webpack_require__(0); var sax = __webpack_require__(1016), TreeBuilder = __webpack_require__(484).TreeBuilder; function XMLParser(target) { this.parser = sax.parser(!0), this.target = target || new TreeBuilder, this.parser.onopentag = this._handleOpenTag.bind(this), this.parser.ontext = this._handleText.bind(this), this.parser.oncdata = this._handleCdata.bind(this), this.parser.ondoctype = this._handleDoctype.bind(this), this.parser.oncomment = this._handleComment.bind(this), this.parser.onclosetag = this._handleCloseTag.bind(this), this.parser.onerror = this._handleError.bind(this); } XMLParser.prototype._handleOpenTag = function(tag) { this.target.start(tag.name, tag.attributes); }, XMLParser.prototype._handleText = function(text) { this.target.data(text); }, XMLParser.prototype._handleCdata = function(text) { this.target.data(text); }, XMLParser.prototype._handleDoctype = function(text) {}, XMLParser.prototype._handleComment = function(comment) {}, XMLParser.prototype._handleCloseTag = function(tag) { this.target.end(tag); }, XMLParser.prototype._handleError = function(err) { throw err; }, XMLParser.prototype.feed = function(chunk) { this.parser.write(chunk); }, XMLParser.prototype.close = function() { return this.parser.close(), this.target.close(); }, exports.XMLParser = XMLParser; }, function(module, exports, __webpack_require__) { !(function(sax) { sax.parser = function(strict, opt) { return new SAXParser(strict, opt); }, sax.SAXParser = SAXParser, sax.SAXStream = SAXStream, sax.createStream = function(strict, opt) { return new SAXStream(strict, opt); }, sax.MAX_BUFFER_LENGTH = 65536; var Stream, buffers = [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ]; function SAXParser(strict, opt) { if (!(this instanceof SAXParser)) return new SAXParser(strict, opt); !(function(parser) { for (var i = 0, l = buffers.length; i < l; i++) parser[buffers[i]] = ""; })(this), this.q = this.c = "", this.bufferCheckPosition = sax.MAX_BUFFER_LENGTH, this.opt = opt || {}, this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags, this.looseCase = this.opt.lowercase ? "toLowerCase" : "toUpperCase", this.tags = [], this.closed = this.closedRoot = this.sawRoot = !1, this.tag = this.error = null, this.strict = !!strict, this.noscript = !(!strict && !this.opt.noscript), this.state = S.BEGIN, this.strictEntities = this.opt.strictEntities, this.ENTITIES = this.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES), this.attribList = [], this.opt.xmlns && (this.ns = Object.create(rootNS)), this.trackPosition = !1 !== this.opt.position, this.trackPosition && (this.position = this.line = this.column = 0), emit(this, "onready"); } sax.EVENTS = [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace" ], Object.create || (Object.create = function(o) { function F() {} return F.prototype = o, new F; }), Object.keys || (Object.keys = function(o) { var a = []; for (var i in o) o.hasOwnProperty(i) && a.push(i); return a; }), SAXParser.prototype = { end: function() { end(this); }, write: function(chunk) { if (this.error) throw this.error; if (this.closed) return error(this, "Cannot write after close. Assign an onready handler."); if (null === chunk) return end(this); for (var parser, num, entity, entityLC, numStr, i = 0, c = ""; c = chunk.charAt(i++), this.c = c, c; ) switch (this.trackPosition && (this.position++, "\n" === c ? (this.line++, this.column = 0) : this.column++), this.state) { case S.BEGIN: if (this.state = S.BEGIN_WHITESPACE, "\ufeff" === c) continue; beginWhiteSpace(this, c); continue; case S.BEGIN_WHITESPACE: beginWhiteSpace(this, c); continue; case S.TEXT: if (this.sawRoot && !this.closedRoot) { for (var starti = i - 1; c && "<" !== c && "&" !== c; ) (c = chunk.charAt(i++)) && this.trackPosition && (this.position++, "\n" === c ? (this.line++, this.column = 0) : this.column++); this.textNode += chunk.substring(starti, i - 1); } "<" !== c || this.sawRoot && this.closedRoot && !this.strict ? (!not(whitespace, c) || this.sawRoot && !this.closedRoot || strictFail(this, "Text data outside of root node."), "&" === c ? this.state = S.TEXT_ENTITY : this.textNode += c) : (this.state = S.OPEN_WAKA, this.startTagPosition = this.position); continue; case S.SCRIPT: "<" === c ? this.state = S.SCRIPT_ENDING : this.script += c; continue; case S.SCRIPT_ENDING: "/" === c ? this.state = S.CLOSE_TAG : (this.script += "<" + c, this.state = S.SCRIPT); continue; case S.OPEN_WAKA: if ("!" === c) this.state = S.SGML_DECL, this.sgmlDecl = ""; else if (is(whitespace, c)) ; else if (is(nameStart, c)) this.state = S.OPEN_TAG, this.tagName = c; else if ("/" === c) this.state = S.CLOSE_TAG, this.tagName = ""; else if ("?" === c) this.state = S.PROC_INST, this.procInstName = this.procInstBody = ""; else { if (strictFail(this, "Unencoded <"), this.startTagPosition + 1 < this.position) { var pad = this.position - this.startTagPosition; c = new Array(pad).join(" ") + c; } this.textNode += "<" + c, this.state = S.TEXT; } continue; case S.SGML_DECL: "[CDATA[" === (this.sgmlDecl + c).toUpperCase() ? (emitNode(this, "onopencdata"), this.state = S.CDATA, this.sgmlDecl = "", this.cdata = "") : this.sgmlDecl + c === "--" ? (this.state = S.COMMENT, this.comment = "", this.sgmlDecl = "") : "DOCTYPE" === (this.sgmlDecl + c).toUpperCase() ? (this.state = S.DOCTYPE, (this.doctype || this.sawRoot) && strictFail(this, "Inappropriately located doctype declaration"), this.doctype = "", this.sgmlDecl = "") : ">" === c ? (emitNode(this, "onsgmldeclaration", this.sgmlDecl), this.sgmlDecl = "", this.state = S.TEXT) : is(quote, c) ? (this.state = S.SGML_DECL_QUOTED, this.sgmlDecl += c) : this.sgmlDecl += c; continue; case S.SGML_DECL_QUOTED: c === this.q && (this.state = S.SGML_DECL, this.q = ""), this.sgmlDecl += c; continue; case S.DOCTYPE: ">" === c ? (this.state = S.TEXT, emitNode(this, "ondoctype", this.doctype), this.doctype = !0) : (this.doctype += c, "[" === c ? this.state = S.DOCTYPE_DTD : is(quote, c) && (this.state = S.DOCTYPE_QUOTED, this.q = c)); continue; case S.DOCTYPE_QUOTED: this.doctype += c, c === this.q && (this.q = "", this.state = S.DOCTYPE); continue; case S.DOCTYPE_DTD: this.doctype += c, "]" === c ? this.state = S.DOCTYPE : is(quote, c) && (this.state = S.DOCTYPE_DTD_QUOTED, this.q = c); continue; case S.DOCTYPE_DTD_QUOTED: this.doctype += c, c === this.q && (this.state = S.DOCTYPE_DTD, this.q = ""); continue; case S.COMMENT: "-" === c ? this.state = S.COMMENT_ENDING : this.comment += c; continue; case S.COMMENT_ENDING: "-" === c ? (this.state = S.COMMENT_ENDED, this.comment = textopts(this.opt, this.comment), this.comment && emitNode(this, "oncomment", this.comment), this.comment = "") : (this.comment += "-" + c, this.state = S.COMMENT); continue; case S.COMMENT_ENDED: ">" !== c ? (strictFail(this, "Malformed comment"), this.comment += "--" + c, this.state = S.COMMENT) : this.state = S.TEXT; continue; case S.CDATA: "]" === c ? this.state = S.CDATA_ENDING : this.cdata += c; continue; case S.CDATA_ENDING: "]" === c ? this.state = S.CDATA_ENDING_2 : (this.cdata += "]" + c, this.state = S.CDATA); continue; case S.CDATA_ENDING_2: ">" === c ? (this.cdata && emitNode(this, "oncdata", this.cdata), emitNode(this, "onclosecdata"), this.cdata = "", this.state = S.TEXT) : "]" === c ? this.cdata += "]" : (this.cdata += "]]" + c, this.state = S.CDATA); continue; case S.PROC_INST: "?" === c ? this.state = S.PROC_INST_ENDING : is(whitespace, c) ? this.state = S.PROC_INST_BODY : this.procInstName += c; continue; case S.PROC_INST_BODY: if (!this.procInstBody && is(whitespace, c)) continue; "?" === c ? this.state = S.PROC_INST_ENDING : this.procInstBody += c; continue; case S.PROC_INST_ENDING: ">" === c ? (emitNode(this, "onprocessinginstruction", { name: this.procInstName, body: this.procInstBody }), this.procInstName = this.procInstBody = "", this.state = S.TEXT) : (this.procInstBody += "?" + c, this.state = S.PROC_INST_BODY); continue; case S.OPEN_TAG: is(nameBody, c) ? this.tagName += c : (newTag(this), ">" === c ? openTag(this) : "/" === c ? this.state = S.OPEN_TAG_SLASH : (not(whitespace, c) && strictFail(this, "Invalid character in tag name"), this.state = S.ATTRIB)); continue; case S.OPEN_TAG_SLASH: ">" === c ? (openTag(this, !0), closeTag(this)) : (strictFail(this, "Forward-slash in opening tag not followed by >"), this.state = S.ATTRIB); continue; case S.ATTRIB: if (is(whitespace, c)) continue; ">" === c ? openTag(this) : "/" === c ? this.state = S.OPEN_TAG_SLASH : is(nameStart, c) ? (this.attribName = c, this.attribValue = "", this.state = S.ATTRIB_NAME) : strictFail(this, "Invalid attribute name"); continue; case S.ATTRIB_NAME: "=" === c ? this.state = S.ATTRIB_VALUE : ">" === c ? (strictFail(this, "Attribute without value"), this.attribValue = this.attribName, attrib(this), openTag(this)) : is(whitespace, c) ? this.state = S.ATTRIB_NAME_SAW_WHITE : is(nameBody, c) ? this.attribName += c : strictFail(this, "Invalid attribute name"); continue; case S.ATTRIB_NAME_SAW_WHITE: if ("=" === c) this.state = S.ATTRIB_VALUE; else { if (is(whitespace, c)) continue; strictFail(this, "Attribute without value"), this.tag.attributes[this.attribName] = "", this.attribValue = "", emitNode(this, "onattribute", { name: this.attribName, value: "" }), this.attribName = "", ">" === c ? openTag(this) : is(nameStart, c) ? (this.attribName = c, this.state = S.ATTRIB_NAME) : (strictFail(this, "Invalid attribute name"), this.state = S.ATTRIB); } continue; case S.ATTRIB_VALUE: if (is(whitespace, c)) continue; is(quote, c) ? (this.q = c, this.state = S.ATTRIB_VALUE_QUOTED) : (strictFail(this, "Unquoted attribute value"), this.state = S.ATTRIB_VALUE_UNQUOTED, this.attribValue = c); continue; case S.ATTRIB_VALUE_QUOTED: if (c !== this.q) { "&" === c ? this.state = S.ATTRIB_VALUE_ENTITY_Q : this.attribValue += c; continue; } attrib(this), this.q = "", this.state = S.ATTRIB_VALUE_CLOSED; continue; case S.ATTRIB_VALUE_CLOSED: is(whitespace, c) ? this.state = S.ATTRIB : ">" === c ? openTag(this) : "/" === c ? this.state = S.OPEN_TAG_SLASH : is(nameStart, c) ? (strictFail(this, "No whitespace between attributes"), this.attribName = c, this.attribValue = "", this.state = S.ATTRIB_NAME) : strictFail(this, "Invalid attribute name"); continue; case S.ATTRIB_VALUE_UNQUOTED: if (not(attribEnd, c)) { "&" === c ? this.state = S.ATTRIB_VALUE_ENTITY_U : this.attribValue += c; continue; } attrib(this), ">" === c ? openTag(this) : this.state = S.ATTRIB; continue; case S.CLOSE_TAG: if (this.tagName) ">" === c ? closeTag(this) : is(nameBody, c) ? this.tagName += c : this.script ? (this.script += "" === c ? closeTag(this) : strictFail(this, "Invalid characters in closing tag"); continue; case S.TEXT_ENTITY: case S.ATTRIB_VALUE_ENTITY_Q: case S.ATTRIB_VALUE_ENTITY_U: var returnState, buffer; switch (this.state) { case S.TEXT_ENTITY: returnState = S.TEXT, buffer = "textNode"; break; case S.ATTRIB_VALUE_ENTITY_Q: returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"; break; case S.ATTRIB_VALUE_ENTITY_U: returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"; } ";" === c ? (this[buffer] += (num = void 0, entity = void 0, entityLC = void 0, numStr = void 0, entity = (parser = this).entity, entityLC = entity.toLowerCase(), numStr = "", parser.ENTITIES[entity] ? parser.ENTITIES[entity] : parser.ENTITIES[entityLC] ? parser.ENTITIES[entityLC] : ("#" === (entity = entityLC).charAt(0) && ("x" === entity.charAt(1) ? (entity = entity.slice(2), numStr = (num = parseInt(entity, 16)).toString(16)) : (entity = entity.slice(1), numStr = (num = parseInt(entity, 10)).toString(10))), entity = entity.replace(/^0+/, ""), numStr.toLowerCase() !== entity ? (strictFail(parser, "Invalid character entity"), "&" + parser.entity + ";") : String.fromCodePoint(num))), this.entity = "", this.state = returnState) : is(this.entity.length ? entityBody : entityStart, c) ? this.entity += c : (strictFail(this, "Invalid character in entity name"), this[buffer] += "&" + this.entity + c, this.entity = "", this.state = returnState); continue; default: throw new Error(this, "Unknown state: " + this.state); } return this.position >= this.bufferCheckPosition && (function(parser) { for (var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10), maxActual = 0, i = 0, l = buffers.length; i < l; i++) { var len = parser[buffers[i]].length; if (len > maxAllowed) switch (buffers[i]) { case "textNode": closeText(parser); break; case "cdata": emitNode(parser, "oncdata", parser.cdata), parser.cdata = ""; break; case "script": emitNode(parser, "onscript", parser.script), parser.script = ""; break; default: error(parser, "Max buffer length exceeded: " + buffers[i]); } maxActual = Math.max(maxActual, len); } var m = sax.MAX_BUFFER_LENGTH - maxActual; parser.bufferCheckPosition = m + parser.position; })(this), this; }, resume: function() { return this.error = null, this; }, close: function() { return this.write(null); }, flush: function() { closeText(this), "" !== this.cdata && (emitNode(this, "oncdata", this.cdata), this.cdata = ""), "" !== this.script && (emitNode(this, "onscript", this.script), this.script = ""); } }; try { Stream = __webpack_require__(3).Stream; } catch (ex) { Stream = function() {}; } var streamWraps = sax.EVENTS.filter((function(ev) { return "error" !== ev && "end" !== ev; })); function SAXStream(strict, opt) { if (!(this instanceof SAXStream)) return new SAXStream(strict, opt); Stream.apply(this), this._parser = new SAXParser(strict, opt), this.writable = !0, this.readable = !0; var me = this; this._parser.onend = function() { me.emit("end"); }, this._parser.onerror = function(er) { me.emit("error", er), me._parser.error = null; }, this._decoder = null, streamWraps.forEach((function(ev) { Object.defineProperty(me, "on" + ev, { get: function() { return me._parser["on" + ev]; }, set: function(h) { if (!h) return me.removeAllListeners(ev), me._parser["on" + ev] = h, h; me.on(ev, h); }, enumerable: !0, configurable: !1 }); })); } SAXStream.prototype = Object.create(Stream.prototype, { constructor: { value: SAXStream } }), SAXStream.prototype.write = function(data) { if ("function" == typeof Buffer && "function" == typeof Buffer.isBuffer && Buffer.isBuffer(data)) { if (!this._decoder) { var SD = __webpack_require__(173).StringDecoder; this._decoder = new SD("utf8"); } data = this._decoder.write(data); } return this._parser.write(data.toString()), this.emit("data", data), !0; }, SAXStream.prototype.end = function(chunk) { return chunk && chunk.length && this.write(chunk), this._parser.end(), !0; }, SAXStream.prototype.on = function(ev, handler) { var me = this; return me._parser["on" + ev] || -1 === streamWraps.indexOf(ev) || (me._parser["on" + ev] = function() { var args = 1 === arguments.length ? [ arguments[0] ] : Array.apply(null, arguments); args.splice(0, 0, ev), me.emit.apply(me, args); }), Stream.prototype.on.call(me, ev, handler); }; var whitespace = "\r\n\t ", number = "0124356789", letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", quote = "'\"", attribEnd = whitespace + ">", XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace", rootNS = { xml: XML_NAMESPACE, xmlns: "http://www.w3.org/2000/xmlns/" }; whitespace = charClass(whitespace), number = charClass(number), letter = charClass(letter); var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/, entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/; function charClass(str) { return str.split("").reduce((function(s, c) { return s[c] = !0, s; }), {}); } function is(charclass, c) { return (function(c) { return "[object RegExp]" === Object.prototype.toString.call(c); })(charclass) ? !!c.match(charclass) : charclass[c]; } function not(charclass, c) { return !is(charclass, c); } quote = charClass(quote), attribEnd = charClass(attribEnd); var stringFromCharCode, floor, fromCodePoint, S = 0; for (var s in sax.STATE = { BEGIN: S++, BEGIN_WHITESPACE: S++, TEXT: S++, TEXT_ENTITY: S++, OPEN_WAKA: S++, SGML_DECL: S++, SGML_DECL_QUOTED: S++, DOCTYPE: S++, DOCTYPE_QUOTED: S++, DOCTYPE_DTD: S++, DOCTYPE_DTD_QUOTED: S++, COMMENT_STARTING: S++, COMMENT: S++, COMMENT_ENDING: S++, COMMENT_ENDED: S++, CDATA: S++, CDATA_ENDING: S++, CDATA_ENDING_2: S++, PROC_INST: S++, PROC_INST_BODY: S++, PROC_INST_ENDING: S++, OPEN_TAG: S++, OPEN_TAG_SLASH: S++, ATTRIB: S++, ATTRIB_NAME: S++, ATTRIB_NAME_SAW_WHITE: S++, ATTRIB_VALUE: S++, ATTRIB_VALUE_QUOTED: S++, ATTRIB_VALUE_CLOSED: S++, ATTRIB_VALUE_UNQUOTED: S++, ATTRIB_VALUE_ENTITY_Q: S++, ATTRIB_VALUE_ENTITY_U: S++, CLOSE_TAG: S++, CLOSE_TAG_SAW_WHITE: S++, SCRIPT: S++, SCRIPT_ENDING: S++ }, sax.XML_ENTITIES = { amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, sax.ENTITIES = { amp: "&", gt: ">", lt: "<", quot: '"', apos: "'", AElig: 198, Aacute: 193, Acirc: 194, Agrave: 192, Aring: 197, Atilde: 195, Auml: 196, Ccedil: 199, ETH: 208, Eacute: 201, Ecirc: 202, Egrave: 200, Euml: 203, Iacute: 205, Icirc: 206, Igrave: 204, Iuml: 207, Ntilde: 209, Oacute: 211, Ocirc: 212, Ograve: 210, Oslash: 216, Otilde: 213, Ouml: 214, THORN: 222, Uacute: 218, Ucirc: 219, Ugrave: 217, Uuml: 220, Yacute: 221, aacute: 225, acirc: 226, aelig: 230, agrave: 224, aring: 229, atilde: 227, auml: 228, ccedil: 231, eacute: 233, ecirc: 234, egrave: 232, eth: 240, euml: 235, iacute: 237, icirc: 238, igrave: 236, iuml: 239, ntilde: 241, oacute: 243, ocirc: 244, ograve: 242, oslash: 248, otilde: 245, ouml: 246, szlig: 223, thorn: 254, uacute: 250, ucirc: 251, ugrave: 249, uuml: 252, yacute: 253, yuml: 255, copy: 169, reg: 174, nbsp: 160, iexcl: 161, cent: 162, pound: 163, curren: 164, yen: 165, brvbar: 166, sect: 167, uml: 168, ordf: 170, laquo: 171, not: 172, shy: 173, macr: 175, deg: 176, plusmn: 177, sup1: 185, sup2: 178, sup3: 179, acute: 180, micro: 181, para: 182, middot: 183, cedil: 184, ordm: 186, raquo: 187, frac14: 188, frac12: 189, frac34: 190, iquest: 191, times: 215, divide: 247, OElig: 338, oelig: 339, Scaron: 352, scaron: 353, Yuml: 376, fnof: 402, circ: 710, tilde: 732, Alpha: 913, Beta: 914, Gamma: 915, Delta: 916, Epsilon: 917, Zeta: 918, Eta: 919, Theta: 920, Iota: 921, Kappa: 922, Lambda: 923, Mu: 924, Nu: 925, Xi: 926, Omicron: 927, Pi: 928, Rho: 929, Sigma: 931, Tau: 932, Upsilon: 933, Phi: 934, Chi: 935, Psi: 936, Omega: 937, alpha: 945, beta: 946, gamma: 947, delta: 948, epsilon: 949, zeta: 950, eta: 951, theta: 952, iota: 953, kappa: 954, lambda: 955, mu: 956, nu: 957, xi: 958, omicron: 959, pi: 960, rho: 961, sigmaf: 962, sigma: 963, tau: 964, upsilon: 965, phi: 966, chi: 967, psi: 968, omega: 969, thetasym: 977, upsih: 978, piv: 982, ensp: 8194, emsp: 8195, thinsp: 8201, zwnj: 8204, zwj: 8205, lrm: 8206, rlm: 8207, ndash: 8211, mdash: 8212, lsquo: 8216, rsquo: 8217, sbquo: 8218, ldquo: 8220, rdquo: 8221, bdquo: 8222, dagger: 8224, Dagger: 8225, bull: 8226, hellip: 8230, permil: 8240, prime: 8242, Prime: 8243, lsaquo: 8249, rsaquo: 8250, oline: 8254, frasl: 8260, euro: 8364, image: 8465, weierp: 8472, real: 8476, trade: 8482, alefsym: 8501, larr: 8592, uarr: 8593, rarr: 8594, darr: 8595, harr: 8596, crarr: 8629, lArr: 8656, uArr: 8657, rArr: 8658, dArr: 8659, hArr: 8660, forall: 8704, part: 8706, exist: 8707, empty: 8709, nabla: 8711, isin: 8712, notin: 8713, ni: 8715, prod: 8719, sum: 8721, minus: 8722, lowast: 8727, radic: 8730, prop: 8733, infin: 8734, ang: 8736, and: 8743, or: 8744, cap: 8745, cup: 8746, int: 8747, there4: 8756, sim: 8764, cong: 8773, asymp: 8776, ne: 8800, equiv: 8801, le: 8804, ge: 8805, sub: 8834, sup: 8835, nsub: 8836, sube: 8838, supe: 8839, oplus: 8853, otimes: 8855, perp: 8869, sdot: 8901, lceil: 8968, rceil: 8969, lfloor: 8970, rfloor: 8971, lang: 9001, rang: 9002, loz: 9674, spades: 9824, clubs: 9827, hearts: 9829, diams: 9830 }, Object.keys(sax.ENTITIES).forEach((function(key) { var e = sax.ENTITIES[key], s = "number" == typeof e ? String.fromCharCode(e) : e; sax.ENTITIES[key] = s; })), sax.STATE) sax.STATE[sax.STATE[s]] = s; function emit(parser, event, data) { parser[event] && parser[event](data); } function emitNode(parser, nodeType, data) { parser.textNode && closeText(parser), emit(parser, nodeType, data); } function closeText(parser) { parser.textNode = textopts(parser.opt, parser.textNode), parser.textNode && emit(parser, "ontext", parser.textNode), parser.textNode = ""; } function textopts(opt, text) { return opt.trim && (text = text.trim()), opt.normalize && (text = text.replace(/\s+/g, " ")), text; } function error(parser, er) { return closeText(parser), parser.trackPosition && (er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c), er = new Error(er), parser.error = er, emit(parser, "onerror", er), parser; } function end(parser) { return parser.sawRoot && !parser.closedRoot && strictFail(parser, "Unclosed root tag"), parser.state !== S.BEGIN && parser.state !== S.BEGIN_WHITESPACE && parser.state !== S.TEXT && error(parser, "Unexpected end"), closeText(parser), parser.c = "", parser.closed = !0, emit(parser, "onend"), SAXParser.call(parser, parser.strict, parser.opt), parser; } function strictFail(parser, message) { if ("object" != typeof parser || !(parser instanceof SAXParser)) throw new Error("bad call to strictFail"); parser.strict && error(parser, message); } function newTag(parser) { parser.strict || (parser.tagName = parser.tagName[parser.looseCase]()); var parent = parser.tags[parser.tags.length - 1] || parser, tag = parser.tag = { name: parser.tagName, attributes: {} }; parser.opt.xmlns && (tag.ns = parent.ns), parser.attribList.length = 0; } function qname(name, attribute) { var qualName = name.indexOf(":") < 0 ? [ "", name ] : name.split(":"), prefix = qualName[0], local = qualName[1]; return attribute && "xmlns" === name && (prefix = "xmlns", local = ""), { prefix: prefix, local: local }; } function attrib(parser) { if (parser.strict || (parser.attribName = parser.attribName[parser.looseCase]()), -1 !== parser.attribList.indexOf(parser.attribName) || parser.tag.attributes.hasOwnProperty(parser.attribName)) parser.attribName = parser.attribValue = ""; else { if (parser.opt.xmlns) { var qn = qname(parser.attribName, !0), prefix = qn.prefix, local = qn.local; if ("xmlns" === prefix) if ("xml" === local && parser.attribValue !== XML_NAMESPACE) strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser.attribValue); else if ("xmlns" === local && "http://www.w3.org/2000/xmlns/" !== parser.attribValue) strictFail(parser, "xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: " + parser.attribValue); else { var tag = parser.tag, parent = parser.tags[parser.tags.length - 1] || parser; tag.ns === parent.ns && (tag.ns = Object.create(parent.ns)), tag.ns[local] = parser.attribValue; } parser.attribList.push([ parser.attribName, parser.attribValue ]); } else parser.tag.attributes[parser.attribName] = parser.attribValue, emitNode(parser, "onattribute", { name: parser.attribName, value: parser.attribValue }); parser.attribName = parser.attribValue = ""; } } function openTag(parser, selfClosing) { if (parser.opt.xmlns) { var tag = parser.tag, qn = qname(parser.tagName); tag.prefix = qn.prefix, tag.local = qn.local, tag.uri = tag.ns[qn.prefix] || "", tag.prefix && !tag.uri && (strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName)), tag.uri = qn.prefix); var parent = parser.tags[parser.tags.length - 1] || parser; tag.ns && parent.ns !== tag.ns && Object.keys(tag.ns).forEach((function(p) { emitNode(parser, "onopennamespace", { prefix: p, uri: tag.ns[p] }); })); for (var i = 0, l = parser.attribList.length; i < l; i++) { var nv = parser.attribList[i], name = nv[0], value = nv[1], qualName = qname(name, !0), prefix = qualName.prefix, local = qualName.local, uri = "" === prefix ? "" : tag.ns[prefix] || "", a = { name: name, value: value, prefix: prefix, local: local, uri: uri }; prefix && "xmlns" !== prefix && !uri && (strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix)), a.uri = prefix), parser.tag.attributes[name] = a, emitNode(parser, "onattribute", a); } parser.attribList.length = 0; } parser.tag.isSelfClosing = !!selfClosing, parser.sawRoot = !0, parser.tags.push(parser.tag), emitNode(parser, "onopentag", parser.tag), selfClosing || (parser.noscript || "script" !== parser.tagName.toLowerCase() ? parser.state = S.TEXT : parser.state = S.SCRIPT, parser.tag = null, parser.tagName = ""), parser.attribName = parser.attribValue = "", parser.attribList.length = 0; } function closeTag(parser) { if (!parser.tagName) return strictFail(parser, "Weird empty close tag."), parser.textNode += "", void (parser.state = S.TEXT); if (parser.script) { if ("script" !== parser.tagName) return parser.script += "", parser.tagName = "", void (parser.state = S.SCRIPT); emitNode(parser, "onscript", parser.script), parser.script = ""; } var t = parser.tags.length, tagName = parser.tagName; parser.strict || (tagName = tagName[parser.looseCase]()); for (var closeTo = tagName; t-- && parser.tags[t].name !== closeTo; ) strictFail(parser, "Unexpected close tag"); if (t < 0) return strictFail(parser, "Unmatched closing tag: " + parser.tagName), parser.textNode += "", void (parser.state = S.TEXT); parser.tagName = tagName; for (var s = parser.tags.length; s-- > t; ) { var tag = parser.tag = parser.tags.pop(); parser.tagName = parser.tag.name, emitNode(parser, "onclosetag", parser.tagName); var x = {}; for (var i in tag.ns) x[i] = tag.ns[i]; var parent = parser.tags[parser.tags.length - 1] || parser; parser.opt.xmlns && tag.ns !== parent.ns && Object.keys(tag.ns).forEach((function(p) { var n = tag.ns[p]; emitNode(parser, "onclosenamespace", { prefix: p, uri: n }); })); } 0 === t && (parser.closedRoot = !0), parser.tagName = parser.attribValue = parser.attribName = "", parser.attribList.length = 0, parser.state = S.TEXT; } function beginWhiteSpace(parser, c) { "<" === c ? (parser.state = S.OPEN_WAKA, parser.startTagPosition = parser.position) : not(whitespace, c) && (strictFail(parser, "Non-whitespace before first tag."), parser.textNode = c, parser.state = S.TEXT); } S = sax.STATE, String.fromCodePoint || (stringFromCharCode = String.fromCharCode, floor = Math.floor, fromCodePoint = function() { var highSurrogate, lowSurrogate, MAX_SIZE = 16384, codeUnits = [], index = -1, length = arguments.length; if (!length) return ""; for (var result = ""; ++index < length; ) { var codePoint = Number(arguments[index]); if (!isFinite(codePoint) || codePoint < 0 || codePoint > 1114111 || floor(codePoint) !== codePoint) throw RangeError("Invalid code point: " + codePoint); codePoint <= 65535 ? codeUnits.push(codePoint) : (highSurrogate = 55296 + ((codePoint -= 65536) >> 10), lowSurrogate = codePoint % 1024 + 56320, codeUnits.push(highSurrogate, lowSurrogate)), (index + 1 === length || codeUnits.length > MAX_SIZE) && (result += stringFromCharCode.apply(null, codeUnits), codeUnits.length = 0); } return result; }, Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", { value: fromCodePoint, configurable: !0, writable: !0 }) : String.fromCodePoint = fromCodePoint); })(exports); }, function(module, exports) { exports.DEFAULT_PARSER = "sax"; }, function(module, exports, __webpack_require__) { var Writable = __webpack_require__(88).Writable, inherits = __webpack_require__(8), bufferFrom = __webpack_require__(421); if ("undefined" == typeof Uint8Array) var U8 = __webpack_require__(1021).Uint8Array; else U8 = Uint8Array; function ConcatStream(opts, cb) { if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb); "function" == typeof opts && (cb = opts, opts = {}), opts || (opts = {}); var encoding = opts.encoding, shouldInferEncoding = !1; encoding ? "u8" !== (encoding = String(encoding).toLowerCase()) && "uint8" !== encoding || (encoding = "uint8array") : shouldInferEncoding = !0, Writable.call(this, { objectMode: !0 }), this.encoding = encoding, this.shouldInferEncoding = shouldInferEncoding, cb && this.on("finish", (function() { cb(this.getBody()); })), this.body = []; } function isBufferish(p) { return "string" == typeof p || (arr = p, /Array\]$/.test(Object.prototype.toString.call(arr))) || p && "function" == typeof p.subarray; var arr; } module.exports = ConcatStream, inherits(ConcatStream, Writable), ConcatStream.prototype._write = function(chunk, enc, next) { this.body.push(chunk), next(); }, ConcatStream.prototype.inferEncoding = function(buff) { var firstBuffer = void 0 === buff ? this.body[0] : buff; return Buffer.isBuffer(firstBuffer) ? "buffer" : "undefined" != typeof Uint8Array && firstBuffer instanceof Uint8Array ? "uint8array" : Array.isArray(firstBuffer) ? "array" : "string" == typeof firstBuffer ? "string" : "[object Object]" === Object.prototype.toString.call(firstBuffer) ? "object" : "buffer"; }, ConcatStream.prototype.getBody = function() { return this.encoding || 0 !== this.body.length ? (this.shouldInferEncoding && (this.encoding = this.inferEncoding()), "array" === this.encoding ? (function(parts) { for (var res = [], i = 0; i < parts.length; i++) res.push.apply(res, parts[i]); return res; })(this.body) : "string" === this.encoding ? (function(parts) { for (var strings = [], i = 0; i < parts.length; i++) { var p = parts[i]; "string" == typeof p || Buffer.isBuffer(p) ? strings.push(p) : isBufferish(p) ? strings.push(bufferFrom(p)) : strings.push(bufferFrom(String(p))); } return strings = Buffer.isBuffer(parts[0]) ? (strings = Buffer.concat(strings)).toString("utf8") : strings.join(""); })(this.body) : "buffer" === this.encoding ? (function(parts) { for (var bufs = [], i = 0; i < parts.length; i++) { var p = parts[i]; Buffer.isBuffer(p) ? bufs.push(p) : isBufferish(p) ? bufs.push(bufferFrom(p)) : bufs.push(bufferFrom(String(p))); } return Buffer.concat(bufs); })(this.body) : "uint8array" === this.encoding ? (function(parts) { for (var len = 0, i = 0; i < parts.length; i++) "string" == typeof parts[i] && (parts[i] = bufferFrom(parts[i])), len += parts[i].length; for (var u8 = new U8(len), offset = (i = 0, 0); i < parts.length; i++) for (var part = parts[i], j = 0; j < part.length; j++) u8[offset++] = part[j]; return u8; })(this.body) : this.body) : []; }, Array.isArray; }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(26).Buffer, util = __webpack_require__(0); module.exports = (function() { function BufferList() { !(function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); })(this, BufferList), this.head = null, this.tail = null, this.length = 0; } return BufferList.prototype.push = function(v) { var entry = { data: v, next: null }; this.length > 0 ? this.tail.next = entry : this.head = entry, this.tail = entry, ++this.length; }, BufferList.prototype.unshift = function(v) { var entry = { data: v, next: this.head }; 0 === this.length && (this.tail = entry), this.head = entry, ++this.length; }, BufferList.prototype.shift = function() { if (0 !== this.length) { var ret = this.head.data; return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, ret; } }, BufferList.prototype.clear = function() { this.head = this.tail = null, this.length = 0; }, BufferList.prototype.join = function(s) { if (0 === this.length) return ""; for (var p = this.head, ret = "" + p.data; p = p.next; ) ret += s + p.data; return ret; }, BufferList.prototype.concat = function(n) { if (0 === this.length) return Buffer.alloc(0); if (1 === this.length) return this.head.data; for (var target, offset, ret = Buffer.allocUnsafe(n >>> 0), p = this.head, i = 0; p; ) target = ret, offset = i, p.data.copy(target, offset), i += p.data.length, p = p.next; return ret; }, BufferList; })(), util && util.inspect && util.inspect.custom && (module.exports.prototype[util.inspect.custom] = function() { var obj = util.inspect({ length: this.length }); return this.constructor.name + " " + obj; }); }, function(module, exports, __webpack_require__) { "use strict"; module.exports = PassThrough; var Transform = __webpack_require__(489), util = __webpack_require__(33); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } util.inherits = __webpack_require__(8), util.inherits(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; }, function(module, exports) { var defineProp, ECMAScript = (function() { var opts = Object.prototype.toString, ophop = Object.prototype.hasOwnProperty; return { Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ""); }, HasProperty: function(o, p) { return p in o; }, HasOwnProperty: function(o, p) { return ophop.call(o, p); }, IsCallable: function(o) { return "function" == typeof o; }, ToInt32: function(v) { return v >> 0; }, ToUint32: function(v) { return v >>> 0; } }; })(), LN2 = Math.LN2, abs = Math.abs, floor = Math.floor, log = Math.log, min = Math.min, pow = Math.pow, round = Math.round; function configureProperties(obj) { if (getOwnPropNames && defineProp) { var i, props = getOwnPropNames(obj); for (i = 0; i < props.length; i += 1) defineProp(obj, props[i], { value: obj[props[i]], writable: !1, enumerable: !1, configurable: !1 }); } } defineProp = Object.defineProperty && (function() { try { return Object.defineProperty({}, "x", {}), !0; } catch (e) { return !1; } })() ? Object.defineProperty : function(o, p, desc) { if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object"); return ECMAScript.HasProperty(desc, "get") && Object.prototype.__defineGetter__ && Object.prototype.__defineGetter__.call(o, p, desc.get), ECMAScript.HasProperty(desc, "set") && Object.prototype.__defineSetter__ && Object.prototype.__defineSetter__.call(o, p, desc.set), ECMAScript.HasProperty(desc, "value") && (o[p] = desc.value), o; }; var getOwnPropNames = Object.getOwnPropertyNames || function(o) { if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); var p, props = []; for (p in o) ECMAScript.HasOwnProperty(o, p) && props.push(p); return props; }; function makeArrayAccessors(obj) { if (defineProp) { if (obj.length > 1e5) throw new RangeError("Array too large for polyfill"); var i; for (i = 0; i < obj.length; i += 1) makeArrayAccessor(i); } function makeArrayAccessor(index) { defineProp(obj, index, { get: function() { return obj._getter(index); }, set: function(v) { obj._setter(index, v); }, enumerable: !0, configurable: !1 }); } } function as_signed(value, bits) { var s = 32 - bits; return value << s >> s; } function as_unsigned(value, bits) { var s = 32 - bits; return value << s >>> s; } function packI8(n) { return [ 255 & n ]; } function unpackI8(bytes) { return as_signed(bytes[0], 8); } function packU8(n) { return [ 255 & n ]; } function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } function packU8Clamped(n) { return [ (n = round(Number(n))) < 0 ? 0 : n > 255 ? 255 : 255 & n ]; } function packI16(n) { return [ n >> 8 & 255, 255 & n ]; } function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); } function packU16(n) { return [ n >> 8 & 255, 255 & n ]; } function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); } function packI32(n) { return [ n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, 255 & n ]; } function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } function packU32(n) { return [ n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, 255 & n ]; } function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } function packIEEE754(v, ebits, fbits) { var s, e, f, i, bits, str, bytes, bias = (1 << ebits - 1) - 1; function roundToEven(n) { var w = floor(n), f = n - w; return f < .5 ? w : f > .5 || w % 2 ? w + 1 : w; } for (v != v ? (e = (1 << ebits) - 1, f = pow(2, fbits - 1), s = 0) : v === 1 / 0 || v === -1 / 0 ? (e = (1 << ebits) - 1, f = 0, s = v < 0 ? 1 : 0) : 0 === v ? (e = 0, f = 0, s = 1 / v == -1 / 0 ? 1 : 0) : (s = v < 0, (v = abs(v)) >= pow(2, 1 - bias) ? (e = min(floor(log(v) / LN2), 1023), (f = roundToEven(v / pow(2, e) * pow(2, fbits))) / pow(2, fbits) >= 2 && (e += 1, f = 1), e > bias ? (e = (1 << ebits) - 1, f = 0) : (e += bias, f -= pow(2, fbits))) : (e = 0, f = roundToEven(v / pow(2, 1 - bias - fbits)))), bits = [], i = fbits; i; i -= 1) bits.push(f % 2 ? 1 : 0), f = floor(f / 2); for (i = ebits; i; i -= 1) bits.push(e % 2 ? 1 : 0), e = floor(e / 2); for (bits.push(s ? 1 : 0), bits.reverse(), str = bits.join(""), bytes = []; str.length; ) bytes.push(parseInt(str.substring(0, 8), 2)), str = str.substring(8); return bytes; } function unpackIEEE754(bytes, ebits, fbits) { var i, j, b, str, bias, s, e, f, bits = []; for (i = bytes.length; i; i -= 1) for (b = bytes[i - 1], j = 8; j; j -= 1) bits.push(b % 2 ? 1 : 0), b >>= 1; return bits.reverse(), str = bits.join(""), bias = (1 << ebits - 1) - 1, s = parseInt(str.substring(0, 1), 2) ? -1 : 1, e = parseInt(str.substring(1, 1 + ebits), 2), f = parseInt(str.substring(1 + ebits), 2), e === (1 << ebits) - 1 ? 0 !== f ? NaN : s * (1 / 0) : e > 0 ? s * pow(2, e - bias) * (1 + f / pow(2, fbits)) : 0 !== f ? s * pow(2, -(bias - 1)) * (f / pow(2, fbits)) : s < 0 ? -0 : 0; } function unpackF64(b) { return unpackIEEE754(b, 11, 52); } function packF64(v) { return packIEEE754(v, 11, 52); } function unpackF32(b) { return unpackIEEE754(b, 8, 23); } function packF32(v) { return packIEEE754(v, 8, 23); } !(function() { var ArrayBuffer = function(length) { if ((length = ECMAScript.ToInt32(length)) < 0) throw new RangeError("ArrayBuffer size is not a small enough positive integer"); var i; for (this.byteLength = length, this._bytes = [], this._bytes.length = length, i = 0; i < this.byteLength; i += 1) this._bytes[i] = 0; configureProperties(this); }; exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer; var ArrayBufferView = function() {}; function makeConstructor(bytesPerElement, pack, unpack) { var ctor; return ctor = function(buffer, byteOffset, length) { var array, sequence, i, s; if (arguments.length && "number" != typeof arguments[0]) if ("object" == typeof arguments[0] && arguments[0].constructor === ctor) for (array = arguments[0], this.length = array.length, this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new ArrayBuffer(this.byteLength), this.byteOffset = 0, i = 0; i < this.length; i += 1) this._setter(i, array._getter(i)); else if ("object" != typeof arguments[0] || arguments[0] instanceof ArrayBuffer || "ArrayBuffer" === ECMAScript.Class(arguments[0])) { if ("object" != typeof arguments[0] || !(arguments[0] instanceof ArrayBuffer || "ArrayBuffer" === ECMAScript.Class(arguments[0]))) throw new TypeError("Unexpected argument type(s)"); if (this.buffer = buffer, this.byteOffset = ECMAScript.ToUint32(byteOffset), this.byteOffset > this.buffer.byteLength) throw new RangeError("byteOffset out of range"); if (this.byteOffset % this.BYTES_PER_ELEMENT) throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); if (arguments.length < 3) { if (this.byteLength = this.buffer.byteLength - this.byteOffset, this.byteLength % this.BYTES_PER_ELEMENT) throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); this.length = this.byteLength / this.BYTES_PER_ELEMENT; } else this.length = ECMAScript.ToUint32(length), this.byteLength = this.length * this.BYTES_PER_ELEMENT; if (this.byteOffset + this.byteLength > this.buffer.byteLength) throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); } else for (sequence = arguments[0], this.length = ECMAScript.ToUint32(sequence.length), this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new ArrayBuffer(this.byteLength), this.byteOffset = 0, i = 0; i < this.length; i += 1) s = sequence[i], this._setter(i, Number(s)); else { if (this.length = ECMAScript.ToInt32(arguments[0]), length < 0) throw new RangeError("ArrayBufferView size is not a small enough positive integer"); this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new ArrayBuffer(this.byteLength), this.byteOffset = 0; } this.constructor = ctor, configureProperties(this), makeArrayAccessors(this); }, ctor.prototype = new ArrayBufferView, ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement, ctor.prototype._pack = pack, ctor.prototype._unpack = unpack, ctor.BYTES_PER_ELEMENT = bytesPerElement, ctor.prototype._getter = function(index) { if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); if (!((index = ECMAScript.ToUint32(index)) >= this.length)) { var i, o, bytes = []; for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1, o += 1) bytes.push(this.buffer._bytes[o]); return this._unpack(bytes); } }, ctor.prototype.get = ctor.prototype._getter, ctor.prototype._setter = function(index, value) { if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); if (!((index = ECMAScript.ToUint32(index)) >= this.length)) { var i, o, bytes = this._pack(value); for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1, o += 1) this.buffer._bytes[o] = bytes[i]; } }, ctor.prototype.set = function(index, value) { if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); var array, sequence, offset, len, i, s, d, byteOffset, byteLength, tmp; if ("object" == typeof arguments[0] && arguments[0].constructor === this.constructor) { if (array = arguments[0], (offset = ECMAScript.ToUint32(arguments[1])) + array.length > this.length) throw new RangeError("Offset plus length of array is out of range"); if (byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT, byteLength = array.length * this.BYTES_PER_ELEMENT, array.buffer === this.buffer) { for (tmp = [], i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) tmp[i] = array.buffer._bytes[s]; for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) this.buffer._bytes[d] = tmp[i]; } else for (i = 0, s = array.byteOffset, d = byteOffset; i < byteLength; i += 1, s += 1, d += 1) this.buffer._bytes[d] = array.buffer._bytes[s]; } else { if ("object" != typeof arguments[0] || void 0 === arguments[0].length) throw new TypeError("Unexpected argument type(s)"); if (sequence = arguments[0], len = ECMAScript.ToUint32(sequence.length), (offset = ECMAScript.ToUint32(arguments[1])) + len > this.length) throw new RangeError("Offset plus length of array is out of range"); for (i = 0; i < len; i += 1) s = sequence[i], this._setter(offset + i, Number(s)); } }, ctor.prototype.subarray = function(start, end) { function clamp(v, min, max) { return v < min ? min : v > max ? max : v; } start = ECMAScript.ToInt32(start), end = ECMAScript.ToInt32(end), arguments.length < 1 && (start = 0), arguments.length < 2 && (end = this.length), start < 0 && (start = this.length + start), end < 0 && (end = this.length + end), start = clamp(start, 0, this.length); var len = (end = clamp(end, 0, this.length)) - start; return len < 0 && (len = 0), new this.constructor(this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len); }, ctor; } var Int8Array = makeConstructor(1, packI8, unpackI8), Uint8Array = makeConstructor(1, packU8, unpackU8), Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8), Int16Array = makeConstructor(2, packI16, unpackI16), Uint16Array = makeConstructor(2, packU16, unpackU16), Int32Array = makeConstructor(4, packI32, unpackI32), Uint32Array = makeConstructor(4, packU32, unpackU32), Float32Array = makeConstructor(4, packF32, unpackF32), Float64Array = makeConstructor(8, packF64, unpackF64); exports.Int8Array = exports.Int8Array || Int8Array, exports.Uint8Array = exports.Uint8Array || Uint8Array, exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray, exports.Int16Array = exports.Int16Array || Int16Array, exports.Uint16Array = exports.Uint16Array || Uint16Array, exports.Int32Array = exports.Int32Array || Int32Array, exports.Uint32Array = exports.Uint32Array || Uint32Array, exports.Float32Array = exports.Float32Array || Float32Array, exports.Float64Array = exports.Float64Array || Float64Array; })(), (function() { function r(array, index) { return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; } var u16array, IS_BIG_ENDIAN = (u16array = new exports.Uint16Array([ 4660 ]), 18 === r(new exports.Uint8Array(u16array.buffer), 0)), DataView = function(buffer, byteOffset, byteLength) { if (0 === arguments.length) buffer = new exports.ArrayBuffer(0); else if (!(buffer instanceof exports.ArrayBuffer || "ArrayBuffer" === ECMAScript.Class(buffer))) throw new TypeError("TypeError"); if (this.buffer = buffer || new exports.ArrayBuffer(0), this.byteOffset = ECMAScript.ToUint32(byteOffset), this.byteOffset > this.buffer.byteLength) throw new RangeError("byteOffset out of range"); if (this.byteLength = arguments.length < 3 ? this.buffer.byteLength - this.byteOffset : ECMAScript.ToUint32(byteLength), this.byteOffset + this.byteLength > this.buffer.byteLength) throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); configureProperties(this); }; function makeGetter(arrayType) { return function(byteOffset, littleEndian) { if ((byteOffset = ECMAScript.ToUint32(byteOffset)) + arrayType.BYTES_PER_ELEMENT > this.byteLength) throw new RangeError("Array index out of range"); byteOffset += this.byteOffset; var i, uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), bytes = []; for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) bytes.push(r(uint8Array, i)); return Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN) && bytes.reverse(), r(new arrayType(new exports.Uint8Array(bytes).buffer), 0); }; } function makeSetter(arrayType) { return function(byteOffset, value, littleEndian) { if ((byteOffset = ECMAScript.ToUint32(byteOffset)) + arrayType.BYTES_PER_ELEMENT > this.byteLength) throw new RangeError("Array index out of range"); var i, typeArray = new arrayType([ value ]), byteArray = new exports.Uint8Array(typeArray.buffer), bytes = []; for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) bytes.push(r(byteArray, i)); Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN) && bytes.reverse(), new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT).set(bytes); }; } DataView.prototype.getUint8 = makeGetter(exports.Uint8Array), DataView.prototype.getInt8 = makeGetter(exports.Int8Array), DataView.prototype.getUint16 = makeGetter(exports.Uint16Array), DataView.prototype.getInt16 = makeGetter(exports.Int16Array), DataView.prototype.getUint32 = makeGetter(exports.Uint32Array), DataView.prototype.getInt32 = makeGetter(exports.Int32Array), DataView.prototype.getFloat32 = makeGetter(exports.Float32Array), DataView.prototype.getFloat64 = makeGetter(exports.Float64Array), DataView.prototype.setUint8 = makeSetter(exports.Uint8Array), DataView.prototype.setInt8 = makeSetter(exports.Int8Array), DataView.prototype.setUint16 = makeSetter(exports.Uint16Array), DataView.prototype.setInt16 = makeSetter(exports.Int16Array), DataView.prototype.setUint32 = makeSetter(exports.Uint32Array), DataView.prototype.setInt32 = makeSetter(exports.Int32Array), DataView.prototype.setFloat32 = makeSetter(exports.Float32Array), DataView.prototype.setFloat64 = makeSetter(exports.Float64Array), exports.DataView = exports.DataView || DataView; })(); }, function(module, exports, __webpack_require__) { var os = __webpack_require__(23); function pickInterface(interfaces, family) { for (var i in interfaces) for (var j = interfaces[i].length - 1; j >= 0; j--) { var face = interfaces[i][j], reachable = "IPv4" === family || 0 === face.scopeid; if (!face.internal && face.family === family && reachable) return face.address; } return "IPv4" === family ? "127.0.0.1" : "::1"; } function reduceInterfaces(interfaces, iface) { var ifaces = {}; for (var i in interfaces) i === iface && (ifaces[i] = interfaces[i]); return ifaces; } function ipv4(iface) { var interfaces = os.networkInterfaces(); return iface && (interfaces = reduceInterfaces(interfaces, iface)), pickInterface(interfaces, "IPv4"); } ipv4.ipv4 = ipv4, ipv4.ipv6 = function(iface) { var interfaces = os.networkInterfaces(); return iface && (interfaces = reduceInterfaces(interfaces, iface)), pickInterface(interfaces, "IPv6"); }, module.exports = ipv4; }, function(module) { module.exports = { name: "upnp-device-client", version: "1.0.2", description: "A simple and versatile UPnP device client", author: "thibauts", license: "MIT", main: "index.js", dependencies: { "concat-stream": "^1.4.8", debug: "^2.1.3", elementtree: "~0.1.6", "network-address": "^1.0.0" }, scripts: { test: 'echo "Error: no test specified" && exit 1' }, repository: { type: "git", url: "git://github.com/thibauts/node-upnp-device-client.git" }, keywords: [ "upnp", "dlna" ] }; }, function(module, exports, __webpack_require__) { const addonSDK = __webpack_require__(1025), fs = __webpack_require__(2); let engineUrl = "http://127.0.0.1:11470"; const manifest = __webpack_require__(499), manifestNoCatalogs = __webpack_require__(1054), catalogHandler = __webpack_require__(1055), metaHandler = __webpack_require__(1056), streamHandler = __webpack_require__(1078), Storage = __webpack_require__(1079), findFiles = __webpack_require__(1080), indexer = __webpack_require__(501), mapEntryToMeta = __webpack_require__(502), storage = new Storage({ validateRecord: function(index, entry) { fs.accessSync(index, fs.constants.R_OK); }, entryIndexes: [ "itemId" ] }), metaStorage = new Storage; function logError(err) { console.log("Error:", err); } function onDiscoveredFile(fPath) { storage.indexes.primaryKey.has(fPath) || storage.indexes.primaryKey.size >= 1e4 || indexer.indexFile(fPath, (function(err, entry) { err ? indexLog(fPath, "indexing error: " + (err.message || err)) : entry && (storage.saveEntry(fPath, entry, (function(err) { err ? console.log(err) : entry.itemId && indexLog(fPath, "is now indexed: " + entry.itemId); })), entry.files && entry.files.length > 0 && entry.itemId && mapEntryToMeta(entry).then((function(meta) { metaStorage.saveEntry(meta.id, meta, (function() {})); })).catch((() => {}))); })); } function indexLog(fPath, status) { console.log("-> " + fPath + ": " + status); } module.exports = { addon: function(options) { const addonBuilder = new addonSDK((options = options || {}).disableCatalogSupport ? manifestNoCatalogs : manifest); return addonBuilder.defineCatalogHandler((function(args, cb) { catalogHandler(storage, metaStorage, args, cb); })), addonBuilder.defineMetaHandler((function(args, cb) { metaHandler(storage, metaStorage, engineUrl, args, cb); })), addonBuilder.defineStreamHandler((function(args, cb) { streamHandler(storage, args, cb); })), addonBuilder; }, setEngineUrl: function(url) { engineUrl = url; }, startIndexing: function(fPath) { Promise.all([ metaStorage.load(fPath + "Meta").catch(logError), storage.load(fPath).catch(logError) ]).then((function(err) { findFiles().on("file", onDiscoveredFile); })); } }; }, function(module, exports, __webpack_require__) { const express = __webpack_require__(240), cors = __webpack_require__(1047), http = __webpack_require__(11), linter = __webpack_require__(1049), qs = __webpack_require__(24), publishToDir = __webpack_require__(1052), publishToCentral = __webpack_require__(1053); module.exports = function(manifest) { const addonHTTP = express.Router(); addonHTTP.use(cors()); const handlers = {}, linterRes = linter.lintManifest(manifest); if (!linterRes.valid) throw linterRes.errors[0]; linterRes.warnings.length && linterRes.warnings.forEach((function(warning) { console.log("WARNING:", warning.message); })); const manifestBuf = new Buffer(JSON.stringify(manifest)); if (manifestBuf.length > 8192) throw "manifest size exceeds 8kb, which is incompatible with addonCollection API"; return addonHTTP.get("/manifest.json", (function(req, res) { res.setHeader("Content-Type", "application/json; charset=utf-8"), res.end(manifestBuf); })), addonHTTP.get("/:resource/:type/:id/:extra?.json", (function(req, res, next) { let handler = handlers[req.params.resource]; handler ? (res.setHeader("Content-Type", "application/json; charset=utf-8"), handler({ type: req.params.type, id: req.params.id, extra: req.params.extra ? qs.parse(req.params.extra) : {} }, (function(err, resp) { err && (console.error(err), res.writeHead(500), res.end(JSON.stringify({ err: "handler error" }))), res.end(JSON.stringify(resp)); }))) : next(); })), this.defineResourceHandler = function(resource, handler) { if (handlers[resource]) throw "handler for " + resource + " already defined"; handlers[resource] = handler; }, this.defineStreamHandler = this.defineResourceHandler.bind(this, "stream"), this.defineMetaHandler = this.defineResourceHandler.bind(this, "meta"), this.defineCatalogHandler = this.defineResourceHandler.bind(this, "catalog"), this.defineSubtitleHandler = this.defineResourceHandler.bind(this, "subtitles"), this.run = function(cb) { this.runHTTPWithOptions({ port: process.env.PORT || null, cache: 7200 }, cb); }, this.runHTTPWithOptions = function(options, cb) { var addonHTTPApp = express(); addonHTTPApp.use((function(req, res, next) { options.cache && res.setHeader("Cache-Control", "max-age=" + options.cache), next(); })), addonHTTPApp.use("/", addonHTTP); var server = http.createServer(addonHTTPApp); server.listen(options.port, (function() { var url = "http://127.0.0.1:" + server.address().port + "/manifest.json"; console.log("HTTP addon accessible at:", url), cb && cb(null, { server: server, url: url }); })); }, this.getRouter = function() { return addonHTTP; }, this.publishToCentral = function(addonURL, apiURL) { return publishToCentral(addonURL, apiURL); }, this.publishToDir = function(baseDir) { publishToDir(baseDir || "./publish-" + manifest.id, manifest, handlers); }, this; }; }, function(module, exports, __webpack_require__) { "use strict"; var bodyParser = __webpack_require__(50), EventEmitter = __webpack_require__(4).EventEmitter, mixin = __webpack_require__(1027), proto = __webpack_require__(1028), Route = __webpack_require__(491), Router = __webpack_require__(490), req = __webpack_require__(1036), res = __webpack_require__(1043); (exports = module.exports = function() { var app = function(req, res, next) { app.handle(req, res, next); }; return mixin(app, EventEmitter.prototype, !1), mixin(app, proto, !1), app.request = Object.create(req, { app: { configurable: !0, enumerable: !0, writable: !0, value: app } }), app.response = Object.create(res, { app: { configurable: !0, enumerable: !0, writable: !0, value: app } }), app.init(), app; }).application = proto, exports.request = req, exports.response = res, exports.Route = Route, exports.Router = Router, exports.json = bodyParser.json, exports.query = __webpack_require__(493), exports.raw = bodyParser.raw, exports.static = __webpack_require__(1046), exports.text = bodyParser.text, exports.urlencoded = bodyParser.urlencoded, [ "bodyParser", "compress", "cookieSession", "session", "logger", "cookieParser", "favicon", "responseTime", "errorHandler", "timeout", "methodOverride", "vhost", "csrf", "directory", "limit", "multipart", "staticCache" ].forEach((function(name) { Object.defineProperty(exports, name, { get: function() { throw new Error("Most middleware (like " + name + ") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware."); }, configurable: !0 }); })); }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(dest, src, redefine) { if (!dest) throw new TypeError("argument dest is required"); if (!src) throw new TypeError("argument src is required"); return void 0 === redefine && (redefine = !0), Object.getOwnPropertyNames(src).forEach((function(name) { if (redefine || !hasOwnProperty.call(dest, name)) { var descriptor = Object.getOwnPropertyDescriptor(src, name); Object.defineProperty(dest, name, descriptor); } })), dest; }; var hasOwnProperty = Object.prototype.hasOwnProperty; }, function(module, exports, __webpack_require__) { "use strict"; var finalhandler = __webpack_require__(1029), Router = __webpack_require__(490), methods = __webpack_require__(68), middleware = __webpack_require__(1030), query = __webpack_require__(493), debug = __webpack_require__(9)("express:application"), View = __webpack_require__(1031), http = __webpack_require__(11), compileETag = __webpack_require__(76).compileETag, compileQueryParser = __webpack_require__(76).compileQueryParser, compileTrust = __webpack_require__(76).compileTrust, deprecate = __webpack_require__(51)("express"), flatten = __webpack_require__(159), merge = __webpack_require__(67), resolve = __webpack_require__(5).resolve, setPrototypeOf = __webpack_require__(119), slice = Array.prototype.slice, app = module.exports = {}; function logerror(err) { "test" !== this.get("env") && console.error(err.stack || err.toString()); } app.init = function() { this.cache = {}, this.engines = {}, this.settings = {}, this.defaultConfiguration(); }, app.defaultConfiguration = function() { var env = "production"; this.enable("x-powered-by"), this.set("etag", "weak"), this.set("env", env), this.set("query parser", "extended"), this.set("subdomain offset", 2), this.set("trust proxy", !1), Object.defineProperty(this.settings, "@@symbol:trust_proxy_default", { configurable: !0, value: !0 }), debug("booting in %s mode", env), this.on("mount", (function(parent) { !0 === this.settings["@@symbol:trust_proxy_default"] && "function" == typeof parent.settings["trust proxy fn"] && (delete this.settings["trust proxy"], delete this.settings["trust proxy fn"]), setPrototypeOf(this.request, parent.request), setPrototypeOf(this.response, parent.response), setPrototypeOf(this.engines, parent.engines), setPrototypeOf(this.settings, parent.settings); })), this.locals = Object.create(null), this.mountpath = "/", this.locals.settings = this.settings, this.set("view", View), this.set("views", resolve("views")), this.set("jsonp callback name", "callback"), this.enable("view cache"), Object.defineProperty(this, "router", { get: function() { throw new Error("'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app."); } }); }, app.lazyrouter = function() { this._router || (this._router = new Router({ caseSensitive: this.enabled("case sensitive routing"), strict: this.enabled("strict routing") }), this._router.use(query(this.get("query parser fn"))), this._router.use(middleware.init(this))); }, app.handle = function(req, res, callback) { var router = this._router, done = callback || finalhandler(req, res, { env: this.get("env"), onerror: logerror.bind(this) }); if (!router) return debug("no routes defined on app"), void done(); router.handle(req, res, done); }, app.use = function(fn) { var offset = 0, path = "/"; if ("function" != typeof fn) { for (var arg = fn; Array.isArray(arg) && 0 !== arg.length; ) arg = arg[0]; "function" != typeof arg && (offset = 1, path = fn); } var fns = flatten(slice.call(arguments, offset)); if (0 === fns.length) throw new TypeError("app.use() requires a middleware function"); this.lazyrouter(); var router = this._router; return fns.forEach((function(fn) { if (!fn || !fn.handle || !fn.set) return router.use(path, fn); debug(".use app under %s", path), fn.mountpath = path, fn.parent = this, router.use(path, (function(req, res, next) { var orig = req.app; fn.handle(req, res, (function(err) { setPrototypeOf(req, orig.request), setPrototypeOf(res, orig.response), next(err); })); })), fn.emit("mount", this); }), this), this; }, app.route = function(path) { return this.lazyrouter(), this._router.route(path); }, app.engine = function(ext, fn) { if ("function" != typeof fn) throw new Error("callback function required"); var extension = "." !== ext[0] ? "." + ext : ext; return this.engines[extension] = fn, this; }, app.param = function(name, fn) { if (this.lazyrouter(), Array.isArray(name)) { for (var i = 0; i < name.length; i++) this.param(name[i], fn); return this; } return this._router.param(name, fn), this; }, app.set = function(setting, val) { if (1 === arguments.length) return this.settings[setting]; switch (debug('set "%s" to %o', setting, val), this.settings[setting] = val, setting) { case "etag": this.set("etag fn", compileETag(val)); break; case "query parser": this.set("query parser fn", compileQueryParser(val)); break; case "trust proxy": this.set("trust proxy fn", compileTrust(val)), Object.defineProperty(this.settings, "@@symbol:trust_proxy_default", { configurable: !0, value: !1 }); } return this; }, app.path = function() { return this.parent ? this.parent.path() + this.mountpath : ""; }, app.enabled = function(setting) { return Boolean(this.set(setting)); }, app.disabled = function(setting) { return !this.set(setting); }, app.enable = function(setting) { return this.set(setting, !0); }, app.disable = function(setting) { return this.set(setting, !1); }, methods.forEach((function(method) { app[method] = function(path) { if ("get" === method && 1 === arguments.length) return this.set(path); this.lazyrouter(); var route = this._router.route(path); return route[method].apply(route, slice.call(arguments, 1)), this; }; })), app.all = function(path) { this.lazyrouter(); for (var route = this._router.route(path), args = slice.call(arguments, 1), i = 0; i < methods.length; i++) route[methods[i]].apply(route, args); return this; }, app.del = deprecate.function(app.delete, "app.del: Use app.delete instead"), app.render = function(name, options, callback) { var view, cache = this.cache, done = callback, engines = this.engines, opts = options, renderOptions = {}; if ("function" == typeof options && (done = options, opts = {}), merge(renderOptions, this.locals), opts._locals && merge(renderOptions, opts._locals), merge(renderOptions, opts), null == renderOptions.cache && (renderOptions.cache = this.enabled("view cache")), renderOptions.cache && (view = cache[name]), !view) { if (!(view = new (this.get("view"))(name, { defaultEngine: this.get("view engine"), root: this.get("views"), engines: engines })).path) { var dirs = Array.isArray(view.root) && view.root.length > 1 ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"' : 'directory "' + view.root + '"', err = new Error('Failed to lookup view "' + name + '" in views ' + dirs); return err.view = view, done(err); } renderOptions.cache && (cache[name] = view); } !(function(view, options, callback) { try { view.render(options, callback); } catch (err) { callback(err); } })(view, renderOptions, done); }, app.listen = function() { var server = http.createServer(this); return server.listen.apply(server, arguments); }; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("finalhandler"), encodeUrl = __webpack_require__(94), escapeHtml = __webpack_require__(95), onFinished = __webpack_require__(96), parseUrl = __webpack_require__(49), statuses = __webpack_require__(120), unpipe = __webpack_require__(175), DOUBLE_SPACE_REGEXP = /\x20{2}/g, NEWLINE_REGEXP = /\n/g, defer = "function" == typeof setImmediate ? setImmediate : function(fn) { process.nextTick(fn.bind.apply(fn, arguments)); }, isFinished = onFinished.isFinished; function headersSent(res) { return "boolean" != typeof res.headersSent ? Boolean(res._header) : res.headersSent; } module.exports = function(req, res, options) { var opts = options || {}, env = opts.env || "production", onerror = opts.onerror; return function(err) { var headers, msg, status; if (err || !headersSent(res)) { if (err ? (status = (function(err) { return "number" == typeof err.status && err.status >= 400 && err.status < 600 ? err.status : "number" == typeof err.statusCode && err.statusCode >= 400 && err.statusCode < 600 ? err.statusCode : void 0; })(err), void 0 === status ? status = (function(res) { var status = res.statusCode; return ("number" != typeof status || status < 400 || status > 599) && (status = 500), status; })(res) : headers = (function(err) { if (err.headers && "object" == typeof err.headers) { for (var headers = Object.create(null), keys = Object.keys(err.headers), i = 0; i < keys.length; i++) { var key = keys[i]; headers[key] = err.headers[key]; } return headers; } })(err), msg = (function(err, status, env) { var msg; return "production" !== env && ((msg = err.stack) || "function" != typeof err.toString || (msg = err.toString())), msg || statuses[status]; })(err, status, env)) : (status = 404, msg = "Cannot " + req.method + " " + encodeUrl((function(req) { try { return parseUrl.original(req).pathname; } catch (e) { return "resource"; } })(req))), debug("default %s", status), err && onerror && defer(onerror, err, req, res), headersSent(res)) return debug("cannot %d after headers sent", status), void req.socket.destroy(); !(function(req, res, status, headers, message) { function write() { var body = (function(message) { return '\n\n\n\nError\n\n\n
' + escapeHtml(message).replace(NEWLINE_REGEXP, "
").replace(DOUBLE_SPACE_REGEXP, "  ") + "
\n\n\n"; })(message); res.statusCode = status, res.statusMessage = statuses[status], (function(res, headers) { if (headers) for (var keys = Object.keys(headers), i = 0; i < keys.length; i++) { var key = keys[i]; res.setHeader(key, headers[key]); } })(res, headers), res.setHeader("Content-Security-Policy", "default-src 'none'"), res.setHeader("X-Content-Type-Options", "nosniff"), res.setHeader("Content-Type", "text/html; charset=utf-8"), res.setHeader("Content-Length", Buffer.byteLength(body, "utf8")), "HEAD" !== req.method ? res.end(body, "utf8") : res.end(); } isFinished(req) ? write() : (unpipe(req), onFinished(req, write), req.resume()); })(req, res, status, headers, msg); } else debug("cannot 404 after headers sent"); }; }; }, function(module, exports, __webpack_require__) { "use strict"; var setPrototypeOf = __webpack_require__(119); exports.init = function(app) { return function(req, res, next) { app.enabled("x-powered-by") && res.setHeader("X-Powered-By", "Express"), req.res = res, res.req = req, req.next = next, setPrototypeOf(req, app.request), setPrototypeOf(res, app.response), res.locals = res.locals || Object.create(null), next(); }; }; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("express:view"), path = __webpack_require__(5), fs = __webpack_require__(2), dirname = path.dirname, basename = path.basename, extname = path.extname, join = path.join, resolve = path.resolve; function View(name, options) { var opts = options || {}; if (this.defaultEngine = opts.defaultEngine, this.ext = extname(name), this.name = name, this.root = opts.root, !this.ext && !this.defaultEngine) throw new Error("No default engine was specified and no extension was provided."); var fileName = name; if (this.ext || (this.ext = "." !== this.defaultEngine[0] ? "." + this.defaultEngine : this.defaultEngine, fileName += this.ext), !opts.engines[this.ext]) { var mod = this.ext.substr(1); debug('require "%s"', mod); var fn = __webpack_require__(1032)(mod).__express; if ("function" != typeof fn) throw new Error('Module "' + mod + '" does not provide a view engine.'); opts.engines[this.ext] = fn; } this.engine = opts.engines[this.ext], this.path = this.lookup(fileName); } function tryStat(path) { debug('stat "%s"', path); try { return fs.statSync(path); } catch (e) { return; } } module.exports = View, View.prototype.lookup = function(name) { var path, roots = [].concat(this.root); debug('lookup "%s"', name); for (var i = 0; i < roots.length && !path; i++) { var root = roots[i], loc = resolve(root, name), dir = dirname(loc), file = basename(loc); path = this.resolve(dir, file); } return path; }, View.prototype.render = function(options, callback) { debug('render "%s"', this.path), this.engine(this.path, options, callback); }, View.prototype.resolve = function(dir, file) { var ext = this.ext, path = join(dir, file), stat = tryStat(path); return stat && stat.isFile() || (stat = tryStat(path = join(dir, basename(file, ext), "index" + ext))) && stat.isFile() ? path : void 0; }; }, function(module, exports) { function webpackEmptyContext(req) { var e = new Error("Cannot find module '" + req + "'"); throw e.code = "MODULE_NOT_FOUND", e; } webpackEmptyContext.keys = function() { return []; }, webpackEmptyContext.resolve = webpackEmptyContext, module.exports = webpackEmptyContext, webpackEmptyContext.id = 1032; }, function(module, exports, __webpack_require__) { "use strict"; var ReadStream = __webpack_require__(2).ReadStream, Stream = __webpack_require__(3); function onOpenClose() { "number" == typeof this.fd && this.close(); } module.exports = function(stream) { return stream instanceof ReadStream ? (function(stream) { return stream.destroy(), "function" == typeof stream.close && stream.on("open", onOpenClose), stream; })(stream) : stream instanceof Stream ? ("function" == typeof stream.destroy && stream.destroy(), stream) : stream; }; }, function(module, exports) { var s = 1e3, m = 60 * s, h = 60 * m, d = 24 * h; function plural(ms, msAbs, n, name) { var isPlural = msAbs >= 1.5 * n; return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } module.exports = function(val, options) { options = options || {}; var ms, msAbs, type = typeof val; if ("string" === type && val.length > 0) return (function(str) { if (!((str = String(str)).length > 100)) { var match = /^((?:\d+)?\-?\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) { var n = parseFloat(match[1]); switch ((match[2] || "ms").toLowerCase()) { case "years": case "year": case "yrs": case "yr": case "y": return 315576e5 * n; case "weeks": case "week": case "w": return 6048e5 * n; 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; } } } })(val); if ("number" === type && !1 === isNaN(val)) return options.long ? (ms = val, (msAbs = Math.abs(ms)) >= d ? plural(ms, msAbs, d, "day") : msAbs >= h ? plural(ms, msAbs, h, "hour") : msAbs >= m ? plural(ms, msAbs, m, "minute") : msAbs >= s ? plural(ms, msAbs, s, "second") : ms + " ms") : (function(ms) { var msAbs = Math.abs(ms); return msAbs >= d ? Math.round(ms / d) + "d" : msAbs >= h ? Math.round(ms / h) + "h" : msAbs >= m ? Math.round(ms / m) + "m" : msAbs >= s ? Math.round(ms / s) + "s" : ms + "ms"; })(val); throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val)); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(req) { if (!req) throw new TypeError("argument req is required"); var proxyAddrs = (function(header) { for (var end = header.length, list = [], start = header.length, i = header.length - 1; i >= 0; i--) switch (header.charCodeAt(i)) { case 32: start === end && (start = end = i); break; case 44: start !== end && list.push(header.substring(start, end)), start = end = i; break; default: start = i; } return start !== end && list.push(header.substring(start, end)), list; })(req.headers["x-forwarded-for"] || ""); return [ req.connection.remoteAddress ].concat(proxyAddrs); }; }, function(module, exports, __webpack_require__) { "use strict"; var accepts = __webpack_require__(1037), deprecate = __webpack_require__(51)("express"), isIP = __webpack_require__(39).isIP, typeis = __webpack_require__(99), http = __webpack_require__(11), fresh = __webpack_require__(496), parseRange = __webpack_require__(176), parse = __webpack_require__(49), proxyaddr = __webpack_require__(497), req = Object.create(http.IncomingMessage.prototype); function defineGetter(obj, name, getter) { Object.defineProperty(obj, name, { configurable: !0, enumerable: !0, get: getter }); } module.exports = req, req.get = req.header = function(name) { if (!name) throw new TypeError("name argument is required to req.get"); if ("string" != typeof name) throw new TypeError("name must be a string to req.get"); var lc = name.toLowerCase(); switch (lc) { case "referer": case "referrer": return this.headers.referrer || this.headers.referer; default: return this.headers[lc]; } }, req.accepts = function() { var accept = accepts(this); return accept.types.apply(accept, arguments); }, req.acceptsEncodings = function() { var accept = accepts(this); return accept.encodings.apply(accept, arguments); }, req.acceptsEncoding = deprecate.function(req.acceptsEncodings, "req.acceptsEncoding: Use acceptsEncodings instead"), req.acceptsCharsets = function() { var accept = accepts(this); return accept.charsets.apply(accept, arguments); }, req.acceptsCharset = deprecate.function(req.acceptsCharsets, "req.acceptsCharset: Use acceptsCharsets instead"), req.acceptsLanguages = function() { var accept = accepts(this); return accept.languages.apply(accept, arguments); }, req.acceptsLanguage = deprecate.function(req.acceptsLanguages, "req.acceptsLanguage: Use acceptsLanguages instead"), req.range = function(size, options) { var range = this.get("Range"); if (range) return parseRange(size, range, options); }, req.param = function(name, defaultValue) { var params = this.params || {}, body = this.body || {}, query = this.query || {}, args = 1 === arguments.length ? "name" : "name, default"; return deprecate("req.param(" + args + "): Use req.params, req.body, or req.query instead"), null != params[name] && params.hasOwnProperty(name) ? params[name] : null != body[name] ? body[name] : null != query[name] ? query[name] : defaultValue; }, req.is = function(types) { var arr = types; if (!Array.isArray(types)) { arr = new Array(arguments.length); for (var i = 0; i < arr.length; i++) arr[i] = arguments[i]; } return typeis(this, arr); }, defineGetter(req, "protocol", (function() { var proto = this.connection.encrypted ? "https" : "http"; if (!this.app.get("trust proxy fn")(this.connection.remoteAddress, 0)) return proto; var header = this.get("X-Forwarded-Proto") || proto, index = header.indexOf(","); return -1 !== index ? header.substring(0, index).trim() : header.trim(); })), defineGetter(req, "secure", (function() { return "https" === this.protocol; })), defineGetter(req, "ip", (function() { var trust = this.app.get("trust proxy fn"); return proxyaddr(this, trust); })), defineGetter(req, "ips", (function() { var trust = this.app.get("trust proxy fn"), addrs = proxyaddr.all(this, trust); return addrs.reverse().pop(), addrs; })), defineGetter(req, "subdomains", (function() { var hostname = this.hostname; if (!hostname) return []; var offset = this.app.get("subdomain offset"); return (isIP(hostname) ? [ hostname ] : hostname.split(".").reverse()).slice(offset); })), defineGetter(req, "path", (function() { return parse(this).pathname; })), defineGetter(req, "hostname", (function() { var trust = this.app.get("trust proxy fn"), host = this.get("X-Forwarded-Host"); if (host && trust(this.connection.remoteAddress, 0) ? -1 !== host.indexOf(",") && (host = host.substring(0, host.indexOf(",")).trimRight()) : host = this.get("Host"), host) { var offset = "[" === host[0] ? host.indexOf("]") + 1 : 0, index = host.indexOf(":", offset); return -1 !== index ? host.substring(0, index) : host; } })), defineGetter(req, "host", deprecate.function((function() { return this.hostname; }), "req.host: Use req.hostname instead")), defineGetter(req, "fresh", (function() { var method = this.method, res = this.res, status = res.statusCode; return ("GET" === method || "HEAD" === method) && (status >= 200 && status < 300 || 304 === status) && fresh(this.headers, { etag: res.get("ETag"), "last-modified": res.get("Last-Modified") }); })), defineGetter(req, "stale", (function() { return !this.fresh; })), defineGetter(req, "xhr", (function() { return "xmlhttprequest" === (this.get("X-Requested-With") || "").toLowerCase(); })); }, function(module, exports, __webpack_require__) { "use strict"; var Negotiator = __webpack_require__(1038), mime = __webpack_require__(78); function Accepts(req) { if (!(this instanceof Accepts)) return new Accepts(req); this.headers = req.headers, this.negotiator = new Negotiator(req); } function extToMime(type) { return -1 === type.indexOf("/") ? mime.lookup(type) : type; } function validMime(type) { return "string" == typeof type; } module.exports = Accepts, Accepts.prototype.type = Accepts.prototype.types = function(types_) { var types = types_; if (types && !Array.isArray(types)) { types = new Array(arguments.length); for (var i = 0; i < types.length; i++) types[i] = arguments[i]; } if (!types || 0 === types.length) return this.negotiator.mediaTypes(); if (!this.headers.accept) return types[0]; var mimes = types.map(extToMime), accepts = this.negotiator.mediaTypes(mimes.filter(validMime)), first = accepts[0]; return !!first && types[mimes.indexOf(first)]; }, Accepts.prototype.encoding = Accepts.prototype.encodings = function(encodings_) { var encodings = encodings_; if (encodings && !Array.isArray(encodings)) { encodings = new Array(arguments.length); for (var i = 0; i < encodings.length; i++) encodings[i] = arguments[i]; } return encodings && 0 !== encodings.length ? this.negotiator.encodings(encodings)[0] || !1 : this.negotiator.encodings(); }, Accepts.prototype.charset = Accepts.prototype.charsets = function(charsets_) { var charsets = charsets_; if (charsets && !Array.isArray(charsets)) { charsets = new Array(arguments.length); for (var i = 0; i < charsets.length; i++) charsets[i] = arguments[i]; } return charsets && 0 !== charsets.length ? this.negotiator.charsets(charsets)[0] || !1 : this.negotiator.charsets(); }, Accepts.prototype.lang = Accepts.prototype.langs = Accepts.prototype.language = Accepts.prototype.languages = function(languages_) { var languages = languages_; if (languages && !Array.isArray(languages)) { languages = new Array(arguments.length); for (var i = 0; i < languages.length; i++) languages[i] = arguments[i]; } return languages && 0 !== languages.length ? this.negotiator.languages(languages)[0] || !1 : this.negotiator.languages(); }; }, function(module, exports, __webpack_require__) { "use strict"; var modules = Object.create(null); function Negotiator(request) { if (!(this instanceof Negotiator)) return new Negotiator(request); this.request = request; } function loadModule(moduleName) { var module = modules[moduleName]; if (void 0 !== module) return module; switch (moduleName) { case "charset": module = __webpack_require__(1039); break; case "encoding": module = __webpack_require__(1040); break; case "language": module = __webpack_require__(1041); break; case "mediaType": module = __webpack_require__(1042); break; default: throw new Error("Cannot find module '" + moduleName + "'"); } return modules[moduleName] = module, module; } module.exports = Negotiator, module.exports.Negotiator = Negotiator, Negotiator.prototype.charset = function(available) { var set = this.charsets(available); return set && set[0]; }, Negotiator.prototype.charsets = function(available) { return (0, loadModule("charset").preferredCharsets)(this.request.headers["accept-charset"], available); }, Negotiator.prototype.encoding = function(available) { var set = this.encodings(available); return set && set[0]; }, Negotiator.prototype.encodings = function(available) { return (0, loadModule("encoding").preferredEncodings)(this.request.headers["accept-encoding"], available); }, Negotiator.prototype.language = function(available) { var set = this.languages(available); return set && set[0]; }, Negotiator.prototype.languages = function(available) { return (0, loadModule("language").preferredLanguages)(this.request.headers["accept-language"], available); }, Negotiator.prototype.mediaType = function(available) { var set = this.mediaTypes(available); return set && set[0]; }, Negotiator.prototype.mediaTypes = function(available) { return (0, loadModule("mediaType").preferredMediaTypes)(this.request.headers.accept, available); }, Negotiator.prototype.preferredCharset = Negotiator.prototype.charset, Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets, Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding, Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings, Negotiator.prototype.preferredLanguage = Negotiator.prototype.language, Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages, Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType, Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = preferredCharsets, module.exports.preferredCharsets = preferredCharsets; var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; function parseCharset(str, i) { var match = simpleCharsetRegExp.exec(str); if (!match) return null; var charset = match[1], q = 1; if (match[2]) for (var params = match[2].split(";"), j = 0; j < params.length; j++) { var p = params[j].trim().split("="); if ("q" === p[0]) { q = parseFloat(p[1]); break; } } return { charset: charset, q: q, i: i }; } function specify(charset, spec, index) { var s = 0; if (spec.charset.toLowerCase() === charset.toLowerCase()) s |= 1; else if ("*" !== spec.charset) return null; return { i: index, o: spec.i, q: spec.q, s: s }; } function preferredCharsets(accept, provided) { var accepts = (function(accept) { for (var accepts = accept.split(","), i = 0, j = 0; i < accepts.length; i++) { var charset = parseCharset(accepts[i].trim(), i); charset && (accepts[j++] = charset); } return accepts.length = j, accepts; })(void 0 === accept ? "*" : accept || ""); if (!provided) return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset); var priorities = provided.map((function(type, index) { return (function(charset, accepted, index) { for (var priority = { o: -1, q: 0, s: 0 }, i = 0; i < accepted.length; i++) { var spec = specify(charset, accepted[i], index); spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0 && (priority = spec); } return priority; })(type, accepts, index); })); return priorities.filter(isQuality).sort(compareSpecs).map((function(priority) { return provided[priorities.indexOf(priority)]; })); } function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } function getFullCharset(spec) { return spec.charset; } function isQuality(spec) { return spec.q > 0; } }, function(module, exports, __webpack_require__) { "use strict"; module.exports = preferredEncodings, module.exports.preferredEncodings = preferredEncodings; var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; function parseEncoding(str, i) { var match = simpleEncodingRegExp.exec(str); if (!match) return null; var encoding = match[1], q = 1; if (match[2]) for (var params = match[2].split(";"), j = 0; j < params.length; j++) { var p = params[j].trim().split("="); if ("q" === p[0]) { q = parseFloat(p[1]); break; } } return { encoding: encoding, q: q, i: i }; } function specify(encoding, spec, index) { var s = 0; if (spec.encoding.toLowerCase() === encoding.toLowerCase()) s |= 1; else if ("*" !== spec.encoding) return null; return { i: index, o: spec.i, q: spec.q, s: s }; } function preferredEncodings(accept, provided) { var accepts = (function(accept) { for (var accepts = accept.split(","), hasIdentity = !1, minQuality = 1, i = 0, j = 0; i < accepts.length; i++) { var encoding = parseEncoding(accepts[i].trim(), i); encoding && (accepts[j++] = encoding, hasIdentity = hasIdentity || specify("identity", encoding), minQuality = Math.min(minQuality, encoding.q || 1)); } return hasIdentity || (accepts[j++] = { encoding: "identity", q: minQuality, i: i }), accepts.length = j, accepts; })(accept || ""); if (!provided) return accepts.filter(isQuality).sort(compareSpecs).map(getFullEncoding); var priorities = provided.map((function(type, index) { return (function(encoding, accepted, index) { for (var priority = { o: -1, q: 0, s: 0 }, i = 0; i < accepted.length; i++) { var spec = specify(encoding, accepted[i], index); spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0 && (priority = spec); } return priority; })(type, accepts, index); })); return priorities.filter(isQuality).sort(compareSpecs).map((function(priority) { return provided[priorities.indexOf(priority)]; })); } function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } function getFullEncoding(spec) { return spec.encoding; } function isQuality(spec) { return spec.q > 0; } }, function(module, exports, __webpack_require__) { "use strict"; module.exports = preferredLanguages, module.exports.preferredLanguages = preferredLanguages; var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; function parseLanguage(str, i) { var match = simpleLanguageRegExp.exec(str); if (!match) return null; var prefix = match[1], suffix = match[2], full = prefix; suffix && (full += "-" + suffix); var q = 1; if (match[3]) for (var params = match[3].split(";"), j = 0; j < params.length; j++) { var p = params[j].split("="); "q" === p[0] && (q = parseFloat(p[1])); } return { prefix: prefix, suffix: suffix, q: q, i: i, full: full }; } function specify(language, spec, index) { var p = parseLanguage(language); if (!p) return null; var s = 0; if (spec.full.toLowerCase() === p.full.toLowerCase()) s |= 4; else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) s |= 2; else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) s |= 1; else if ("*" !== spec.full) return null; return { i: index, o: spec.i, q: spec.q, s: s }; } function preferredLanguages(accept, provided) { var accepts = (function(accept) { for (var accepts = accept.split(","), i = 0, j = 0; i < accepts.length; i++) { var language = parseLanguage(accepts[i].trim(), i); language && (accepts[j++] = language); } return accepts.length = j, accepts; })(void 0 === accept ? "*" : accept || ""); if (!provided) return accepts.filter(isQuality).sort(compareSpecs).map(getFullLanguage); var priorities = provided.map((function(type, index) { return (function(language, accepted, index) { for (var priority = { o: -1, q: 0, s: 0 }, i = 0; i < accepted.length; i++) { var spec = specify(language, accepted[i], index); spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0 && (priority = spec); } return priority; })(type, accepts, index); })); return priorities.filter(isQuality).sort(compareSpecs).map((function(priority) { return provided[priorities.indexOf(priority)]; })); } function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } function getFullLanguage(spec) { return spec.full; } function isQuality(spec) { return spec.q > 0; } }, function(module, exports, __webpack_require__) { "use strict"; module.exports = preferredMediaTypes, module.exports.preferredMediaTypes = preferredMediaTypes; var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; function parseMediaType(str, i) { var match = simpleMediaTypeRegExp.exec(str); if (!match) return null; var params = Object.create(null), q = 1, subtype = match[2], type = match[1]; if (match[3]) for (var kvps = (function(str) { for (var parameters = str.split(";"), i = 1, j = 0; i < parameters.length; i++) quoteCount(parameters[j]) % 2 == 0 ? parameters[++j] = parameters[i] : parameters[j] += ";" + parameters[i]; for (parameters.length = j + 1, i = 0; i < parameters.length; i++) parameters[i] = parameters[i].trim(); return parameters; })(match[3]).map(splitKeyValuePair), j = 0; j < kvps.length; j++) { var pair = kvps[j], key = pair[0].toLowerCase(), val = pair[1], value = val && '"' === val[0] && '"' === val[val.length - 1] ? val.substr(1, val.length - 2) : val; if ("q" === key) { q = parseFloat(value); break; } params[key] = value; } return { type: type, subtype: subtype, params: params, q: q, i: i }; } function specify(type, spec, index) { var p = parseMediaType(type), s = 0; if (!p) return null; if (spec.type.toLowerCase() == p.type.toLowerCase()) s |= 4; else if ("*" != spec.type) return null; if (spec.subtype.toLowerCase() == p.subtype.toLowerCase()) s |= 2; else if ("*" != spec.subtype) return null; var keys = Object.keys(spec.params); if (keys.length > 0) { if (!keys.every((function(k) { return "*" == spec.params[k] || (spec.params[k] || "").toLowerCase() == (p.params[k] || "").toLowerCase(); }))) return null; s |= 1; } return { i: index, o: spec.i, q: spec.q, s: s }; } function preferredMediaTypes(accept, provided) { var accepts = (function(accept) { for (var accepts = (function(accept) { for (var accepts = accept.split(","), i = 1, j = 0; i < accepts.length; i++) quoteCount(accepts[j]) % 2 == 0 ? accepts[++j] = accepts[i] : accepts[j] += "," + accepts[i]; return accepts.length = j + 1, accepts; })(accept), i = 0, j = 0; i < accepts.length; i++) { var mediaType = parseMediaType(accepts[i].trim(), i); mediaType && (accepts[j++] = mediaType); } return accepts.length = j, accepts; })(void 0 === accept ? "*/*" : accept || ""); if (!provided) return accepts.filter(isQuality).sort(compareSpecs).map(getFullType); var priorities = provided.map((function(type, index) { return (function(type, accepted, index) { for (var priority = { o: -1, q: 0, s: 0 }, i = 0; i < accepted.length; i++) { var spec = specify(type, accepted[i], index); spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0 && (priority = spec); } return priority; })(type, accepts, index); })); return priorities.filter(isQuality).sort(compareSpecs).map((function(priority) { return provided[priorities.indexOf(priority)]; })); } function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } function getFullType(spec) { return spec.type + "/" + spec.subtype; } function isQuality(spec) { return spec.q > 0; } function quoteCount(string) { for (var count = 0, index = 0; -1 !== (index = string.indexOf('"', index)); ) count++, index++; return count; } function splitKeyValuePair(str) { var key, val, index = str.indexOf("="); return -1 === index ? key = str : (key = str.substr(0, index), val = str.substr(index + 1)), [ key, val ]; } }, function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(26).Buffer, contentDisposition = __webpack_require__(494), deprecate = __webpack_require__(51)("express"), encodeUrl = __webpack_require__(94), escapeHtml = __webpack_require__(95), http = __webpack_require__(11), isAbsolute = __webpack_require__(76).isAbsolute, onFinished = __webpack_require__(96), path = __webpack_require__(5), statuses = __webpack_require__(120), merge = __webpack_require__(67), sign = __webpack_require__(1044).sign, normalizeType = __webpack_require__(76).normalizeType, normalizeTypes = __webpack_require__(76).normalizeTypes, setCharset = __webpack_require__(76).setCharset, cookie = __webpack_require__(1045), send = __webpack_require__(241), extname = path.extname, mime = send.mime, resolve = path.resolve, vary = __webpack_require__(498), res = Object.create(http.ServerResponse.prototype); module.exports = res; var charsetRegExp = /;\s*charset\s*=/; function sendfile(res, file, options, callback) { var streaming, done = !1; function onaborted() { if (!done) { done = !0; var err = new Error("Request aborted"); err.code = "ECONNABORTED", callback(err); } } function onerror(err) { done || (done = !0, callback(err)); } file.on("directory", (function() { if (!done) { done = !0; var err = new Error("EISDIR, read"); err.code = "EISDIR", callback(err); } })), file.on("end", (function() { done || (done = !0, callback()); })), file.on("error", onerror), file.on("file", (function() { streaming = !1; })), file.on("stream", (function() { streaming = !0; })), onFinished(res, (function(err) { return err && "ECONNRESET" === err.code ? onaborted() : err ? onerror(err) : void (done || setImmediate((function() { !1 === streaming || done ? done || (done = !0, callback()) : onaborted(); }))); })), options.headers && file.on("headers", (function(res) { for (var obj = options.headers, keys = Object.keys(obj), i = 0; i < keys.length; i++) { var k = keys[i]; res.setHeader(k, obj[k]); } })), file.pipe(res); } function stringify(value, replacer, spaces, escape) { var json = replacer || spaces ? JSON.stringify(value, replacer, spaces) : JSON.stringify(value); return escape && (json = json.replace(/[<>&]/g, (function(c) { switch (c.charCodeAt(0)) { case 60: return "\\u003c"; case 62: return "\\u003e"; case 38: return "\\u0026"; default: return c; } }))), json; } res.status = function(code) { return this.statusCode = code, this; }, res.links = function(links) { var link = this.get("Link") || ""; return link && (link += ", "), this.set("Link", link + Object.keys(links).map((function(rel) { return "<" + links[rel] + '>; rel="' + rel + '"'; })).join(", ")); }, res.send = function(body) { var encoding, type, chunk = body, req = this.req, app = this.app; switch (2 === arguments.length && ("number" != typeof arguments[0] && "number" == typeof arguments[1] ? (deprecate("res.send(body, status): Use res.status(status).send(body) instead"), this.statusCode = arguments[1]) : (deprecate("res.send(status, body): Use res.status(status).send(body) instead"), this.statusCode = arguments[0], chunk = arguments[1])), "number" == typeof chunk && 1 === arguments.length && (this.get("Content-Type") || this.type("txt"), deprecate("res.send(status): Use res.sendStatus(status) instead"), this.statusCode = chunk, chunk = statuses[chunk]), typeof chunk) { case "string": this.get("Content-Type") || this.type("html"); break; case "boolean": case "number": case "object": if (null === chunk) chunk = ""; else { if (!Buffer.isBuffer(chunk)) return this.json(chunk); this.get("Content-Type") || this.type("bin"); } } "string" == typeof chunk && (encoding = "utf8", "string" == typeof (type = this.get("Content-Type")) && this.set("Content-Type", setCharset(type, "utf-8"))); var len, etag, etagFn = app.get("etag fn"), generateETag = !this.get("ETag") && "function" == typeof etagFn; return void 0 !== chunk && (Buffer.isBuffer(chunk) ? len = chunk.length : !generateETag && chunk.length < 1e3 ? len = Buffer.byteLength(chunk, encoding) : (chunk = Buffer.from(chunk, encoding), encoding = void 0, len = chunk.length), this.set("Content-Length", len)), generateETag && void 0 !== len && (etag = etagFn(chunk, encoding)) && this.set("ETag", etag), req.fresh && (this.statusCode = 304), 204 !== this.statusCode && 304 !== this.statusCode || (this.removeHeader("Content-Type"), this.removeHeader("Content-Length"), this.removeHeader("Transfer-Encoding"), chunk = ""), "HEAD" === req.method ? this.end() : this.end(chunk, encoding), this; }, res.json = function(obj) { var val = obj; 2 === arguments.length && ("number" == typeof arguments[1] ? (deprecate("res.json(obj, status): Use res.status(status).json(obj) instead"), this.statusCode = arguments[1]) : (deprecate("res.json(status, obj): Use res.status(status).json(obj) instead"), this.statusCode = arguments[0], val = arguments[1])); var app = this.app, escape = app.get("json escape"), replacer = app.get("json replacer"), spaces = app.get("json spaces"), body = stringify(val, replacer, spaces, escape); return this.get("Content-Type") || this.set("Content-Type", "application/json"), this.send(body); }, res.jsonp = function(obj) { var val = obj; 2 === arguments.length && ("number" == typeof arguments[1] ? (deprecate("res.jsonp(obj, status): Use res.status(status).json(obj) instead"), this.statusCode = arguments[1]) : (deprecate("res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead"), this.statusCode = arguments[0], val = arguments[1])); var app = this.app, escape = app.get("json escape"), replacer = app.get("json replacer"), spaces = app.get("json spaces"), body = stringify(val, replacer, spaces, escape), callback = this.req.query[app.get("jsonp callback name")]; return this.get("Content-Type") || (this.set("X-Content-Type-Options", "nosniff"), this.set("Content-Type", "application/json")), Array.isArray(callback) && (callback = callback[0]), "string" == typeof callback && 0 !== callback.length && (this.set("X-Content-Type-Options", "nosniff"), this.set("Content-Type", "text/javascript"), body = "/**/ typeof " + (callback = callback.replace(/[^\[\]\w$.]/g, "")) + " === 'function' && " + callback + "(" + (body = body.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029")) + ");"), this.send(body); }, res.sendStatus = function(statusCode) { var body = statuses[statusCode] || String(statusCode); return this.statusCode = statusCode, this.type("txt"), this.send(body); }, res.sendFile = function(path, options, callback) { var done = callback, req = this.req, next = req.next, opts = options || {}; if (!path) throw new TypeError("path argument is required to res.sendFile"); if ("string" != typeof path) throw new TypeError("path must be a string to res.sendFile"); if ("function" == typeof options && (done = options, opts = {}), !opts.root && !isAbsolute(path)) throw new TypeError("path must be absolute or specify root to res.sendFile"); var pathname = encodeURI(path); sendfile(this, send(req, pathname, opts), opts, (function(err) { return done ? done(err) : err && "EISDIR" === err.code ? next() : void (err && "ECONNABORTED" !== err.code && "write" !== err.syscall && next(err)); })); }, res.sendfile = function(path, options, callback) { var done = callback, req = this.req, next = req.next, opts = options || {}; "function" == typeof options && (done = options, opts = {}), sendfile(this, send(req, path, opts), opts, (function(err) { return done ? done(err) : err && "EISDIR" === err.code ? next() : void (err && "ECONNABORTED" !== err.code && "write" !== err.syscall && next(err)); })); }, res.sendfile = deprecate.function(res.sendfile, "res.sendfile: Use res.sendFile instead"), res.download = function(path, filename, options, callback) { var done = callback, name = filename, opts = options || null; "function" == typeof filename ? (done = filename, name = null, opts = null) : "function" == typeof options && (done = options, opts = null); var headers = { "Content-Disposition": contentDisposition(name || path) }; if (opts && opts.headers) for (var keys = Object.keys(opts.headers), i = 0; i < keys.length; i++) { var key = keys[i]; "content-disposition" !== key.toLowerCase() && (headers[key] = opts.headers[key]); } (opts = Object.create(opts)).headers = headers; var fullPath = resolve(path); return this.sendFile(fullPath, opts, done); }, res.contentType = res.type = function(type) { var ct = -1 === type.indexOf("/") ? mime.lookup(type) : type; return this.set("Content-Type", ct); }, res.format = function(obj) { var req = this.req, next = req.next, fn = obj.default; fn && delete obj.default; var keys = Object.keys(obj), key = keys.length > 0 && req.accepts(keys); if (this.vary("Accept"), key) this.set("Content-Type", normalizeType(key).value), obj[key](req, this, next); else if (fn) fn(); else { var err = new Error("Not Acceptable"); err.status = err.statusCode = 406, err.types = normalizeTypes(keys).map((function(o) { return o.value; })), next(err); } return this; }, res.attachment = function(filename) { return filename && this.type(extname(filename)), this.set("Content-Disposition", contentDisposition(filename)), this; }, res.append = function(field, val) { var prev = this.get(field), value = val; return prev && (value = Array.isArray(prev) ? prev.concat(val) : Array.isArray(val) ? [ prev ].concat(val) : [ prev, val ]), this.set(field, value); }, res.set = res.header = function(field, val) { if (2 === arguments.length) { var value = Array.isArray(val) ? val.map(String) : String(val); if ("content-type" === field.toLowerCase()) { if (Array.isArray(value)) throw new TypeError("Content-Type cannot be set to an Array"); if (!charsetRegExp.test(value)) { var charset = mime.charsets.lookup(value.split(";")[0]); charset && (value += "; charset=" + charset.toLowerCase()); } } this.setHeader(field, value); } else for (var key in field) this.set(key, field[key]); return this; }, res.get = function(field) { return this.getHeader(field); }, res.clearCookie = function(name, options) { var opts = merge({ expires: new Date(1), path: "/" }, options); return this.cookie(name, "", opts); }, res.cookie = function(name, value, options) { var opts = merge({}, options), secret = this.req.secret, signed = opts.signed; if (signed && !secret) throw new Error('cookieParser("secret") required for signed cookies'); var val = "object" == typeof value ? "j:" + JSON.stringify(value) : String(value); return signed && (val = "s:" + sign(val, secret)), "maxAge" in opts && (opts.expires = new Date(Date.now() + opts.maxAge), opts.maxAge /= 1e3), null == opts.path && (opts.path = "/"), this.append("Set-Cookie", cookie.serialize(name, String(val), opts)), this; }, res.location = function(url) { var loc = url; return "back" === url && (loc = this.req.get("Referrer") || "/"), this.set("Location", encodeUrl(loc)); }, res.redirect = function(url) { var body, address = url, status = 302; 2 === arguments.length && ("number" == typeof arguments[0] ? (status = arguments[0], address = arguments[1]) : (deprecate("res.redirect(url, status): Use res.redirect(status, url) instead"), status = arguments[1])), address = this.location(address).get("Location"), this.format({ text: function() { body = statuses[status] + ". Redirecting to " + address; }, html: function() { var u = escapeHtml(address); body = "

" + statuses[status] + '. Redirecting to ' + u + "

"; }, default: function() { body = ""; } }), this.statusCode = status, this.set("Content-Length", Buffer.byteLength(body)), "HEAD" === this.req.method ? this.end() : this.end(body); }, res.vary = function(field) { return !field || Array.isArray(field) && !field.length ? (deprecate("res.vary(): Provide a field name"), this) : (vary(this, field), this); }, res.render = function(view, options, callback) { var app = this.req.app, done = callback, opts = options || {}, req = this.req, self = this; "function" == typeof options && (done = options, opts = {}), opts._locals = self.locals, done = done || function(err, str) { if (err) return req.next(err); self.send(str); }, app.render(view, opts, done); }; }, function(module, exports, __webpack_require__) { var crypto = __webpack_require__(6); function sha1(str) { return crypto.createHash("sha1").update(str).digest("hex"); } exports.sign = function(val, secret) { if ("string" != typeof val) throw new TypeError("Cookie value must be provided as a string."); if ("string" != typeof secret) throw new TypeError("Secret string must be provided."); return val + "." + crypto.createHmac("sha256", secret).update(val).digest("base64").replace(/\=+$/, ""); }, exports.unsign = function(val, secret) { if ("string" != typeof val) throw new TypeError("Signed cookie string must be provided."); if ("string" != typeof secret) throw new TypeError("Secret string must be provided."); var str = val.slice(0, val.lastIndexOf(".")); return sha1(exports.sign(str, secret)) == sha1(val) && str; }; }, function(module, exports, __webpack_require__) { "use strict"; exports.parse = function(str, options) { if ("string" != typeof str) throw new TypeError("argument str must be a string"); for (var obj = {}, opt = options || {}, pairs = str.split(pairSplitRegExp), dec = opt.decode || decode, i = 0; i < pairs.length; i++) { var pair = pairs[i], eq_idx = pair.indexOf("="); if (!(eq_idx < 0)) { var key = pair.substr(0, eq_idx).trim(), val = pair.substr(++eq_idx, pair.length).trim(); '"' == val[0] && (val = val.slice(1, -1)), null == obj[key] && (obj[key] = tryDecode(val, dec)); } } return obj; }, exports.serialize = function(name, val, options) { var opt = options || {}, enc = opt.encode || encode; if ("function" != typeof enc) throw new TypeError("option encode is invalid"); if (!fieldContentRegExp.test(name)) throw new TypeError("argument name is invalid"); var value = enc(val); if (value && !fieldContentRegExp.test(value)) throw new TypeError("argument val is invalid"); var str = name + "=" + value; if (null != opt.maxAge) { var maxAge = opt.maxAge - 0; if (isNaN(maxAge)) throw new Error("maxAge should be a Number"); str += "; Max-Age=" + Math.floor(maxAge); } if (opt.domain) { if (!fieldContentRegExp.test(opt.domain)) throw new TypeError("option domain is invalid"); str += "; Domain=" + opt.domain; } if (opt.path) { if (!fieldContentRegExp.test(opt.path)) throw new TypeError("option path is invalid"); str += "; Path=" + opt.path; } if (opt.expires) { if ("function" != typeof opt.expires.toUTCString) throw new TypeError("option expires is invalid"); str += "; Expires=" + opt.expires.toUTCString(); } if (opt.httpOnly && (str += "; HttpOnly"), opt.secure && (str += "; Secure"), opt.sameSite) switch ("string" == typeof opt.sameSite ? opt.sameSite.toLowerCase() : opt.sameSite) { case !0: str += "; SameSite=Strict"; break; case "lax": str += "; SameSite=Lax"; break; case "strict": str += "; SameSite=Strict"; break; case "none": str += "; SameSite=None"; break; default: throw new TypeError("option sameSite is invalid"); } return str; }; var decode = decodeURIComponent, encode = encodeURIComponent, pairSplitRegExp = /; */, fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; function tryDecode(str, decode) { try { return decode(str); } catch (e) { return str; } } }, function(module, exports, __webpack_require__) { "use strict"; var encodeUrl = __webpack_require__(94), escapeHtml = __webpack_require__(95), parseUrl = __webpack_require__(49), resolve = __webpack_require__(5).resolve, send = __webpack_require__(241), url = __webpack_require__(7); module.exports = function(root, options) { if (!root) throw new TypeError("root path required"); if ("string" != typeof root) throw new TypeError("root path must be a string"); var opts = Object.create(options || null), fallthrough = !1 !== opts.fallthrough, redirect = !1 !== opts.redirect, setHeaders = opts.setHeaders; if (setHeaders && "function" != typeof setHeaders) throw new TypeError("option setHeaders must be function"); opts.maxage = opts.maxage || opts.maxAge || 0, opts.root = resolve(root); var onDirectory = redirect ? function(res) { if (this.hasTrailingSlash()) this.error(404); else { var originalUrl = parseUrl.original(this.req); originalUrl.path = null, originalUrl.pathname = (function(str) { for (var i = 0; i < str.length && 47 === str.charCodeAt(i); i++) ; return i > 1 ? "/" + str.substr(i) : str; })(originalUrl.pathname + "/"); var loc = encodeUrl(url.format(originalUrl)), doc = ("Redirecting", '\n\n\n\nRedirecting\n\n\n
' + ('Redirecting to ' + escapeHtml(loc) + "") + "
\n\n\n"); res.statusCode = 301, res.setHeader("Content-Type", "text/html; charset=UTF-8"), res.setHeader("Content-Length", Buffer.byteLength(doc)), res.setHeader("Content-Security-Policy", "default-src 'none'"), res.setHeader("X-Content-Type-Options", "nosniff"), res.setHeader("Location", loc), res.end(doc); } } : function() { this.error(404); }; return function(req, res, next) { if ("GET" !== req.method && "HEAD" !== req.method) return fallthrough ? next() : (res.statusCode = 405, res.setHeader("Allow", "GET, HEAD"), res.setHeader("Content-Length", "0"), void res.end()); var forwardError = !fallthrough, originalUrl = parseUrl.original(req), path = parseUrl(req).pathname; "/" === path && "/" !== originalUrl.pathname.substr(-1) && (path = ""); var stream = send(req, path, opts); stream.on("directory", onDirectory), setHeaders && stream.on("headers", setHeaders), fallthrough && stream.on("file", (function() { forwardError = !0; })), stream.on("error", (function(err) { !forwardError && err.statusCode < 500 ? next() : next(err); })), stream.pipe(res); }; }, module.exports.mime = send.mime; }, function(module, exports, __webpack_require__) { !(function() { "use strict"; var assign = __webpack_require__(1048), vary = __webpack_require__(498), defaults = { origin: "*", methods: "GET,HEAD,PUT,PATCH,POST,DELETE", preflightContinue: !1, optionsSuccessStatus: 204 }; function isString(s) { return "string" == typeof s || s instanceof String; } function isOriginAllowed(origin, allowedOrigin) { if (Array.isArray(allowedOrigin)) { for (var i = 0; i < allowedOrigin.length; ++i) if (isOriginAllowed(origin, allowedOrigin[i])) return !0; return !1; } return isString(allowedOrigin) ? origin === allowedOrigin : allowedOrigin instanceof RegExp ? allowedOrigin.test(origin) : !!allowedOrigin; } function configureOrigin(options, req) { var isAllowed, requestOrigin = req.headers.origin, headers = []; return options.origin && "*" !== options.origin ? isString(options.origin) ? (headers.push([ { key: "Access-Control-Allow-Origin", value: options.origin } ]), headers.push([ { key: "Vary", value: "Origin" } ])) : (isAllowed = isOriginAllowed(requestOrigin, options.origin), headers.push([ { key: "Access-Control-Allow-Origin", value: !!isAllowed && requestOrigin } ]), headers.push([ { key: "Vary", value: "Origin" } ])) : headers.push([ { key: "Access-Control-Allow-Origin", value: "*" } ]), headers; } function configureCredentials(options) { return !0 === options.credentials ? { key: "Access-Control-Allow-Credentials", value: "true" } : null; } function configureExposedHeaders(options) { var headers = options.exposedHeaders; return headers ? (headers.join && (headers = headers.join(",")), headers && headers.length ? { key: "Access-Control-Expose-Headers", value: headers } : null) : null; } function applyHeaders(headers, res) { for (var i = 0, n = headers.length; i < n; i++) { var header = headers[i]; header && (Array.isArray(header) ? applyHeaders(header, res) : "Vary" === header.key && header.value ? vary(res, header.value) : header.value && res.setHeader(header.key, header.value)); } } module.exports = function(o) { var optionsCallback = null; return optionsCallback = "function" == typeof o ? o : function(req, cb) { cb(null, o); }, function(req, res, next) { optionsCallback(req, (function(err, options) { if (err) next(err); else { var corsOptions = assign({}, defaults, options), originCallback = null; corsOptions.origin && "function" == typeof corsOptions.origin ? originCallback = corsOptions.origin : corsOptions.origin && (originCallback = function(origin, cb) { cb(null, corsOptions.origin); }), originCallback ? originCallback(req.headers.origin, (function(err2, origin) { err2 || !origin ? next(err2) : (corsOptions.origin = origin, (function(options, req, res, next) { var headers = []; "OPTIONS" === (req.method && req.method.toUpperCase && req.method.toUpperCase()) ? (headers.push(configureOrigin(options, req)), headers.push(configureCredentials(options)), headers.push((function(options) { var methods = options.methods; return methods.join && (methods = options.methods.join(",")), { key: "Access-Control-Allow-Methods", value: methods }; })(options)), headers.push((function(options, req) { var allowedHeaders = options.allowedHeaders || options.headers, headers = []; return allowedHeaders ? allowedHeaders.join && (allowedHeaders = allowedHeaders.join(",")) : (allowedHeaders = req.headers["access-control-request-headers"], headers.push([ { key: "Vary", value: "Access-Control-Request-Headers" } ])), allowedHeaders && allowedHeaders.length && headers.push([ { key: "Access-Control-Allow-Headers", value: allowedHeaders } ]), headers; })(options, req)), headers.push((function(options) { var maxAge = ("number" == typeof options.maxAge || options.maxAge) && options.maxAge.toString(); return maxAge && maxAge.length ? { key: "Access-Control-Max-Age", value: maxAge } : null; })(options)), headers.push(configureExposedHeaders(options)), applyHeaders(headers, res), options.preflightContinue ? next() : (res.statusCode = options.optionsSuccessStatus, res.setHeader("Content-Length", "0"), res.end())) : (headers.push(configureOrigin(options, req)), headers.push(configureCredentials(options)), headers.push(configureExposedHeaders(options)), applyHeaders(headers, res), next()); })(corsOptions, req, res, next)); })) : next(); } })); }; }; })(); }, function(module, exports, __webpack_require__) { "use strict"; var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (null == val) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(val); } module.exports = (function() { try { if (!Object.assign) return !1; var test1 = new String("abc"); if (test1[5] = "de", "5" === Object.getOwnPropertyNames(test1)[0]) return !1; for (var test2 = {}, i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; if ("0123456789" !== Object.getOwnPropertyNames(test2).map((function(n) { return test2[n]; })).join("")) return !1; var test3 = {}; return "abcdefghijklmnopqrst".split("").forEach((function(letter) { test3[letter] = letter; })), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, test3)).join(""); } catch (err) { return !1; } })() ? Object.assign : function(target, source) { for (var from, symbols, to = toObject(target), s = 1; s < arguments.length; s++) { for (var key in from = Object(arguments[s])) hasOwnProperty.call(from, key) && (to[key] = from[key]); if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]); } } return to; }; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(1050); }, function(module, exports, __webpack_require__) { const semver = __webpack_require__(1051); function lintManifest(manifest) { var errors = [], warnings = []; if (!manifest || "object" != typeof manifest) return { valid: !1, errors: [ new Error("manifest must be an object") ] }; function assertString(val, name) { "string" != typeof val && errors.push(new Error(name + " must be a string")); } function assertArray(val, name) { Array.isArray(val) || errors.push(new Error(name + " must be an array")); } return assertString(manifest.id, "manifest.id"), assertString(manifest.name, "manifest.name"), (function(val, name) { "string" == typeof val && semver.valid(val) || errors.push(new Error("manifest.version must be a valid semver string")); })(manifest.version), assertArray(manifest.resources, "manifest.resources"), Array.isArray(manifest.resources) && (function(val, set, name) { Array.isArray(val) && val.forEach((function(m) { set.includes(m) || warnings.push(new Error("manifest.resources: unknown value " + m)); })); })(manifest.resources.map((function(r) { return r && r.name ? r.name : r; })), [ "catalog", "meta", "stream", "subtitles" ]), assertArray(manifest.types, "manifest.types"), assertArray(manifest.catalogs, "manifest.catalogs"), manifest.hasOwnProperty("idPrefixes") && null !== manifest.idPrefixes && assertArray(manifest.idPrefixes, "manifest.idPrefixes"), Array.isArray(manifest.catalogs) && manifest.catalogs.forEach((function(catalog, i) { "string" == typeof catalog.id && "string" == typeof catalog.type || errors.push(new Error("manifest.catalogs[" + i + "]: id and type must be string properties")), catalog.hasOwnProperty("extra") && assertArray(catalog.extra, "manifest.catalogs[" + i + "].extra"), catalog.hasOwnProperty("extraSupported") && assertArray(catalog.extraSupported, "manifest.catalogs[" + i + "].extraSupported"), catalog.hasOwnProperty("extraRequired") && assertArray(catalog.extraRequired, "manifest.catalogs[" + i + "].extraRequired"); })), { valid: !errors.length, errors: errors, warnings: warnings }; } module.exports = { lintManifest: lintManifest, lintCollection: function(col) { var errors = []; return Array.isArray(col) ? col.forEach((function(item, i) { "string" != typeof item.transportUrl && errors.push(new Error(i + ": transportUrl must be a string")), "string" != typeof item.transportName && errors.push(new Error(i + ": transportName must be a string")), errors = errors.concat(lintManifest(item.manifest).errors); })) : errors.push(new Error("col is not an array")), { valid: !errors.length, errors: errors, warnings: [] }; } }; }, function(module, exports) { var debug; exports = module.exports = SemVer, debug = "object" == typeof process && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? function() { var args = Array.prototype.slice.call(arguments, 0); args.unshift("SEMVER"), console.log.apply(console, args); } : function() {}, exports.SEMVER_SPEC_VERSION = "2.0.0"; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991, re = exports.re = [], src = exports.src = [], R = 0, NUMERICIDENTIFIER = R++; src[NUMERICIDENTIFIER] = "0|[1-9]\\d*"; var NUMERICIDENTIFIERLOOSE = R++; src[NUMERICIDENTIFIERLOOSE] = "[0-9]+"; var NONNUMERICIDENTIFIER = R++; src[NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-][a-zA-Z0-9-]*"; var MAINVERSION = R++; src[MAINVERSION] = "(" + src[NUMERICIDENTIFIER] + ")\\.(" + src[NUMERICIDENTIFIER] + ")\\.(" + src[NUMERICIDENTIFIER] + ")"; var MAINVERSIONLOOSE = R++; src[MAINVERSIONLOOSE] = "(" + src[NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[NUMERICIDENTIFIERLOOSE] + ")"; var PRERELEASEIDENTIFIER = R++; src[PRERELEASEIDENTIFIER] = "(?:" + src[NUMERICIDENTIFIER] + "|" + src[NONNUMERICIDENTIFIER] + ")"; var PRERELEASEIDENTIFIERLOOSE = R++; src[PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[NUMERICIDENTIFIERLOOSE] + "|" + src[NONNUMERICIDENTIFIER] + ")"; var PRERELEASE = R++; src[PRERELEASE] = "(?:-(" + src[PRERELEASEIDENTIFIER] + "(?:\\." + src[PRERELEASEIDENTIFIER] + ")*))"; var PRERELEASELOOSE = R++; src[PRERELEASELOOSE] = "(?:-?(" + src[PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[PRERELEASEIDENTIFIERLOOSE] + ")*))"; var BUILDIDENTIFIER = R++; src[BUILDIDENTIFIER] = "[0-9A-Za-z-]+"; var BUILD = R++; src[BUILD] = "(?:\\+(" + src[BUILDIDENTIFIER] + "(?:\\." + src[BUILDIDENTIFIER] + ")*))"; var FULL = R++, FULLPLAIN = "v?" + src[MAINVERSION] + src[PRERELEASE] + "?" + src[BUILD] + "?"; src[FULL] = "^" + FULLPLAIN + "$"; var LOOSEPLAIN = "[v=\\s]*" + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + "?" + src[BUILD] + "?", LOOSE = R++; src[LOOSE] = "^" + LOOSEPLAIN + "$"; var GTLT = R++; src[GTLT] = "((?:<|>)?=?)"; var XRANGEIDENTIFIERLOOSE = R++; src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"; var XRANGEIDENTIFIER = R++; src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + "|x|X|\\*"; var XRANGEPLAIN = R++; src[XRANGEPLAIN] = "[v=\\s]*(" + src[XRANGEIDENTIFIER] + ")(?:\\.(" + src[XRANGEIDENTIFIER] + ")(?:\\.(" + src[XRANGEIDENTIFIER] + ")(?:" + src[PRERELEASE] + ")?" + src[BUILD] + "?)?)?"; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[XRANGEIDENTIFIERLOOSE] + ")(?:" + src[PRERELEASELOOSE] + ")?" + src[BUILD] + "?)?)?"; var XRANGE = R++; src[XRANGE] = "^" + src[GTLT] + "\\s*" + src[XRANGEPLAIN] + "$"; var XRANGELOOSE = R++; src[XRANGELOOSE] = "^" + src[GTLT] + "\\s*" + src[XRANGEPLAINLOOSE] + "$"; var COERCE = R++; src[COERCE] = "(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])"; var LONETILDE = R++; src[LONETILDE] = "(?:~>?)"; var TILDETRIM = R++; src[TILDETRIM] = "(\\s*)" + src[LONETILDE] + "\\s+", re[TILDETRIM] = new RegExp(src[TILDETRIM], "g"); var TILDE = R++; src[TILDE] = "^" + src[LONETILDE] + src[XRANGEPLAIN] + "$"; var TILDELOOSE = R++; src[TILDELOOSE] = "^" + src[LONETILDE] + src[XRANGEPLAINLOOSE] + "$"; var LONECARET = R++; src[LONECARET] = "(?:\\^)"; var CARETTRIM = R++; src[CARETTRIM] = "(\\s*)" + src[LONECARET] + "\\s+", re[CARETTRIM] = new RegExp(src[CARETTRIM], "g"); var CARET = R++; src[CARET] = "^" + src[LONECARET] + src[XRANGEPLAIN] + "$"; var CARETLOOSE = R++; src[CARETLOOSE] = "^" + src[LONECARET] + src[XRANGEPLAINLOOSE] + "$"; var COMPARATORLOOSE = R++; src[COMPARATORLOOSE] = "^" + src[GTLT] + "\\s*(" + LOOSEPLAIN + ")$|^$"; var COMPARATOR = R++; src[COMPARATOR] = "^" + src[GTLT] + "\\s*(" + FULLPLAIN + ")$|^$"; var COMPARATORTRIM = R++; src[COMPARATORTRIM] = "(\\s*)" + src[GTLT] + "\\s*(" + LOOSEPLAIN + "|" + src[XRANGEPLAIN] + ")", re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], "g"); var HYPHENRANGE = R++; src[HYPHENRANGE] = "^\\s*(" + src[XRANGEPLAIN] + ")\\s+-\\s+(" + src[XRANGEPLAIN] + ")\\s*$"; var HYPHENRANGELOOSE = R++; src[HYPHENRANGELOOSE] = "^\\s*(" + src[XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[XRANGEPLAINLOOSE] + ")\\s*$"; var STAR = R++; src[STAR] = "(<|>)?=?\\s*\\*"; for (var i = 0; i < 35; i++) debug(i, src[i]), re[i] || (re[i] = new RegExp(src[i])); function parse(version, options) { if (options && "object" == typeof options || (options = { loose: !!options, includePrerelease: !1 }), version instanceof SemVer) return version; if ("string" != typeof version) return null; if (version.length > 256) return null; if (!(options.loose ? re[LOOSE] : re[FULL]).test(version)) return null; try { return new SemVer(version, options); } catch (er) { return null; } } function SemVer(version, options) { if (options && "object" == typeof options || (options = { loose: !!options, includePrerelease: !1 }), version instanceof SemVer) { if (version.loose === options.loose) return version; version = version.version; } else if ("string" != typeof version) throw new TypeError("Invalid Version: " + version); if (version.length > 256) throw new TypeError("version is longer than 256 characters"); if (!(this instanceof SemVer)) return new SemVer(version, options); debug("SemVer", version, options), this.options = options, this.loose = !!options.loose; var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]); if (!m) throw new TypeError("Invalid Version: " + version); if (this.raw = version, this.major = +m[1], this.minor = +m[2], this.patch = +m[3], this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version"); if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version"); if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version"); m[4] ? this.prerelease = m[4].split(".").map((function(id) { if (/^[0-9]+$/.test(id)) { var num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) return num; } return id; })) : this.prerelease = [], this.build = m[5] ? m[5].split(".") : [], this.format(); } exports.parse = parse, exports.valid = function(version, options) { var v = parse(version, options); return v ? v.version : null; }, exports.clean = function(version, options) { var s = parse(version.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }, exports.SemVer = SemVer, SemVer.prototype.format = function() { return this.version = this.major + "." + this.minor + "." + this.patch, this.prerelease.length && (this.version += "-" + this.prerelease.join(".")), this.version; }, SemVer.prototype.toString = function() { return this.version; }, SemVer.prototype.compare = function(other) { return debug("SemVer.compare", this.version, this.options, other), other instanceof SemVer || (other = new SemVer(other, this.options)), this.compareMain(other) || this.comparePre(other); }, SemVer.prototype.compareMain = function(other) { return other instanceof SemVer || (other = new SemVer(other, this.options)), compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); }, SemVer.prototype.comparePre = function(other) { if (other instanceof SemVer || (other = new SemVer(other, this.options)), this.prerelease.length && !other.prerelease.length) return -1; if (!this.prerelease.length && other.prerelease.length) return 1; if (!this.prerelease.length && !other.prerelease.length) return 0; var i = 0; do { var a = this.prerelease[i], b = other.prerelease[i]; if (debug("prerelease compare", i, a, b), void 0 === a && void 0 === b) return 0; if (void 0 === b) return 1; if (void 0 === a) return -1; if (a !== b) return compareIdentifiers(a, b); } while (++i); }, SemVer.prototype.inc = function(release, identifier) { switch (release) { case "premajor": this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", identifier); break; case "preminor": this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", identifier); break; case "prepatch": this.prerelease.length = 0, this.inc("patch", identifier), this.inc("pre", identifier); break; case "prerelease": 0 === this.prerelease.length && this.inc("patch", identifier), this.inc("pre", identifier); break; case "major": 0 === this.minor && 0 === this.patch && 0 !== this.prerelease.length || this.major++, this.minor = 0, this.patch = 0, this.prerelease = []; break; case "minor": 0 === this.patch && 0 !== this.prerelease.length || this.minor++, this.patch = 0, this.prerelease = []; break; case "patch": 0 === this.prerelease.length && this.patch++, this.prerelease = []; break; case "pre": if (0 === this.prerelease.length) this.prerelease = [ 0 ]; else { for (var i = this.prerelease.length; --i >= 0; ) "number" == typeof this.prerelease[i] && (this.prerelease[i]++, i = -2); -1 === i && this.prerelease.push(0); } identifier && (this.prerelease[0] === identifier ? isNaN(this.prerelease[1]) && (this.prerelease = [ identifier, 0 ]) : this.prerelease = [ identifier, 0 ]); break; default: throw new Error("invalid increment argument: " + release); } return this.format(), this.raw = this.version, this; }, exports.inc = function(version, release, loose, identifier) { "string" == typeof loose && (identifier = loose, loose = void 0); try { return new SemVer(version, loose).inc(release, identifier).version; } catch (er) { return null; } }, exports.diff = function(version1, version2) { if (eq(version1, version2)) return null; var v1 = parse(version1), v2 = parse(version2), prefix = ""; if (v1.prerelease.length || v2.prerelease.length) { prefix = "pre"; var defaultResult = "prerelease"; } for (var key in v1) if (("major" === key || "minor" === key || "patch" === key) && v1[key] !== v2[key]) return prefix + key; return defaultResult; }, exports.compareIdentifiers = compareIdentifiers; var numeric = /^[0-9]+$/; function compareIdentifiers(a, b) { var anum = numeric.test(a), bnum = numeric.test(b); return anum && bnum && (a = +a, b = +b), a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } function compare(a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)); } function gt(a, b, loose) { return compare(a, b, loose) > 0; } function lt(a, b, loose) { return compare(a, b, loose) < 0; } function eq(a, b, loose) { return 0 === compare(a, b, loose); } function neq(a, b, loose) { return 0 !== compare(a, b, loose); } function gte(a, b, loose) { return compare(a, b, loose) >= 0; } function lte(a, b, loose) { return compare(a, b, loose) <= 0; } function cmp(a, op, b, loose) { switch (op) { case "===": return "object" == typeof a && (a = a.version), "object" == typeof b && (b = b.version), a === b; case "!==": return "object" == typeof a && (a = a.version), "object" == typeof b && (b = b.version), a !== b; case "": case "=": case "==": return eq(a, b, loose); case "!=": return neq(a, b, loose); case ">": return gt(a, b, loose); case ">=": return gte(a, b, loose); case "<": return lt(a, b, loose); case "<=": return lte(a, b, loose); default: throw new TypeError("Invalid operator: " + op); } } function Comparator(comp, options) { if (options && "object" == typeof options || (options = { loose: !!options, includePrerelease: !1 }), comp instanceof Comparator) { if (comp.loose === !!options.loose) return comp; comp = comp.value; } if (!(this instanceof Comparator)) return new Comparator(comp, options); debug("comparator", comp, options), this.options = options, this.loose = !!options.loose, this.parse(comp), this.semver === ANY ? this.value = "" : this.value = this.operator + this.semver.version, debug("comp", this); } exports.rcompareIdentifiers = function(a, b) { return compareIdentifiers(b, a); }, exports.major = function(a, loose) { return new SemVer(a, loose).major; }, exports.minor = function(a, loose) { return new SemVer(a, loose).minor; }, exports.patch = function(a, loose) { return new SemVer(a, loose).patch; }, exports.compare = compare, exports.compareLoose = function(a, b) { return compare(a, b, !0); }, exports.rcompare = function(a, b, loose) { return compare(b, a, loose); }, exports.sort = function(list, loose) { return list.sort((function(a, b) { return exports.compare(a, b, loose); })); }, exports.rsort = function(list, loose) { return list.sort((function(a, b) { return exports.rcompare(a, b, loose); })); }, exports.gt = gt, exports.lt = lt, exports.eq = eq, exports.neq = neq, exports.gte = gte, exports.lte = lte, exports.cmp = cmp, exports.Comparator = Comparator; var ANY = {}; function Range(range, options) { if (options && "object" == typeof options || (options = { loose: !!options, includePrerelease: !1 }), range instanceof Range) return range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ? range : new Range(range.raw, options); if (range instanceof Comparator) return new Range(range.value, options); if (!(this instanceof Range)) return new Range(range, options); if (this.options = options, this.loose = !!options.loose, this.includePrerelease = !!options.includePrerelease, this.raw = range, this.set = range.split(/\s*\|\|\s*/).map((function(range) { return this.parseRange(range.trim()); }), this).filter((function(c) { return c.length; })), !this.set.length) throw new TypeError("Invalid SemVer Range: " + range); this.format(); } function isX(id) { return !id || "x" === id.toLowerCase() || "*" === id; } function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { return ((from = isX(fM) ? "" : isX(fm) ? ">=" + fM + ".0.0" : isX(fp) ? ">=" + fM + "." + fm + ".0" : ">=" + from) + " " + (to = isX(tM) ? "" : isX(tm) ? "<" + (+tM + 1) + ".0.0" : isX(tp) ? "<" + tM + "." + (+tm + 1) + ".0" : tpr ? "<=" + tM + "." + tm + "." + tp + "-" + tpr : "<=" + to)).trim(); } function testSet(set, version, options) { for (var i = 0; i < set.length; i++) if (!set[i].test(version)) return !1; if (version.prerelease.length && !options.includePrerelease) { for (i = 0; i < set.length; i++) if (debug(set[i].semver), set[i].semver !== ANY && set[i].semver.prerelease.length > 0) { var allowed = set[i].semver; if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return !0; } return !1; } return !0; } function satisfies(version, range, options) { try { range = new Range(range, options); } catch (er) { return !1; } return range.test(version); } function outside(version, range, hilo, options) { var gtfn, ltefn, ltfn, comp, ecomp; switch (version = new SemVer(version, options), range = new Range(range, options), hilo) { case ">": gtfn = gt, ltefn = lte, ltfn = lt, comp = ">", ecomp = ">="; break; case "<": gtfn = lt, ltefn = gte, ltfn = gt, comp = "<", ecomp = "<="; break; default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } if (satisfies(version, range, options)) return !1; for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i], high = null, low = null; if (comparators.forEach((function(comparator) { comparator.semver === ANY && (comparator = new Comparator(">=0.0.0")), high = high || comparator, low = low || comparator, gtfn(comparator.semver, high.semver, options) ? high = comparator : ltfn(comparator.semver, low.semver, options) && (low = comparator); })), high.operator === comp || high.operator === ecomp) return !1; if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return !1; if (low.operator === ecomp && ltfn(version, low.semver)) return !1; } return !0; } Comparator.prototype.parse = function(comp) { var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR], m = comp.match(r); if (!m) throw new TypeError("Invalid comparator: " + comp); this.operator = m[1], "=" === this.operator && (this.operator = ""), m[2] ? this.semver = new SemVer(m[2], this.options.loose) : this.semver = ANY; }, Comparator.prototype.toString = function() { return this.value; }, Comparator.prototype.test = function(version) { return debug("Comparator.test", version, this.options.loose), this.semver === ANY || ("string" == typeof version && (version = new SemVer(version, this.options)), cmp(version, this.operator, this.semver, this.options)); }, Comparator.prototype.intersects = function(comp, options) { if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required"); var rangeTmp; if (options && "object" == typeof options || (options = { loose: !!options, includePrerelease: !1 }), "" === this.operator) return rangeTmp = new Range(comp.value, options), satisfies(this.value, rangeTmp, options); if ("" === comp.operator) return rangeTmp = new Range(this.value, options), satisfies(comp.semver, rangeTmp, options); var sameDirectionIncreasing = !(">=" !== this.operator && ">" !== this.operator || ">=" !== comp.operator && ">" !== comp.operator), sameDirectionDecreasing = !("<=" !== this.operator && "<" !== this.operator || "<=" !== comp.operator && "<" !== comp.operator), sameSemVer = this.semver.version === comp.semver.version, differentDirectionsInclusive = !(">=" !== this.operator && "<=" !== this.operator || ">=" !== comp.operator && "<=" !== comp.operator), oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (">=" === this.operator || ">" === this.operator) && ("<=" === comp.operator || "<" === comp.operator), oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ("<=" === this.operator || "<" === this.operator) && (">=" === comp.operator || ">" === comp.operator); return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; }, exports.Range = Range, Range.prototype.format = function() { return this.range = this.set.map((function(comps) { return comps.join(" ").trim(); })).join("||").trim(), this.range; }, Range.prototype.toString = function() { return this.range; }, Range.prototype.parseRange = function(range) { var loose = this.options.loose; range = range.trim(); var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; range = range.replace(hr, hyphenReplace), debug("hyphen replace", range), range = range.replace(re[COMPARATORTRIM], "$1$2$3"), debug("comparator trim", range, re[COMPARATORTRIM]), range = (range = (range = range.replace(re[TILDETRIM], "$1~")).replace(re[CARETTRIM], "$1^")).split(/\s+/).join(" "); var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR], set = range.split(" ").map((function(comp) { return (function(comp, options) { return debug("comp", comp, options), comp = (function(comp, options) { return comp.trim().split(/\s+/).map((function(comp) { return (function(comp, options) { debug("caret", comp, options); var r = options.loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, (function(_, M, m, p, pr) { var ret; return debug("caret", comp, _, M, m, p, pr), isX(M) ? ret = "" : isX(m) ? ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0" : isX(p) ? ret = "0" === M ? ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0" : ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0" : pr ? (debug("replaceCaret pr", pr), ret = "0" === M ? "0" === m ? ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1) : ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0" : ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0") : (debug("no pr"), ret = "0" === M ? "0" === m ? ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1) : ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0" : ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"), debug("caret return", ret), ret; })); })(comp, options); })).join(" "); })(comp, options), debug("caret", comp), comp = (function(comp, options) { return comp.trim().split(/\s+/).map((function(comp) { return (function(comp, options) { var r = options.loose ? re[TILDELOOSE] : re[TILDE]; return comp.replace(r, (function(_, M, m, p, pr) { var ret; return debug("tilde", comp, _, M, m, p, pr), isX(M) ? ret = "" : isX(m) ? ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0" : isX(p) ? ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0" : pr ? (debug("replaceTilde pr", pr), ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0") : ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0", debug("tilde return", ret), ret; })); })(comp, options); })).join(" "); })(comp, options), debug("tildes", comp), comp = (function(comp, options) { return debug("replaceXRanges", comp, options), comp.split(/\s+/).map((function(comp) { return (function(comp, options) { comp = comp.trim(); var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]; return comp.replace(r, (function(ret, gtlt, M, m, p, pr) { debug("xRange", comp, ret, gtlt, M, m, p, pr); var xM = isX(M), xm = xM || isX(m), xp = xm || isX(p); return "=" === gtlt && xp && (gtlt = ""), xM ? ret = ">" === gtlt || "<" === gtlt ? "<0.0.0" : "*" : gtlt && xp ? (xm && (m = 0), p = 0, ">" === gtlt ? (gtlt = ">=", xm ? (M = +M + 1, m = 0, p = 0) : (m = +m + 1, p = 0)) : "<=" === gtlt && (gtlt = "<", xm ? M = +M + 1 : m = +m + 1), ret = gtlt + M + "." + m + "." + p) : xm ? ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0" : xp && (ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"), debug("xRange return", ret), ret; })); })(comp, options); })).join(" "); })(comp, options), debug("xrange", comp), comp = (function(comp, options) { return debug("replaceStars", comp, options), comp.trim().replace(re[STAR], ""); })(comp, options), debug("stars", comp), comp; })(comp, this.options); }), this).join(" ").split(/\s+/); return this.options.loose && (set = set.filter((function(comp) { return !!comp.match(compRe); }))), set.map((function(comp) { return new Comparator(comp, this.options); }), this); }, Range.prototype.intersects = function(range, options) { if (!(range instanceof Range)) throw new TypeError("a Range is required"); return this.set.some((function(thisComparators) { return thisComparators.every((function(thisComparator) { return range.set.some((function(rangeComparators) { return rangeComparators.every((function(rangeComparator) { return thisComparator.intersects(rangeComparator, options); })); })); })); })); }, exports.toComparators = function(range, options) { return new Range(range, options).set.map((function(comp) { return comp.map((function(c) { return c.value; })).join(" ").trim().split(" "); })); }, Range.prototype.test = function(version) { if (!version) return !1; "string" == typeof version && (version = new SemVer(version, this.options)); for (var i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return !0; return !1; }, exports.satisfies = satisfies, exports.maxSatisfying = function(versions, range, options) { var max = null, maxSV = null; try { var rangeObj = new Range(range, options); } catch (er) { return null; } return versions.forEach((function(v) { rangeObj.test(v) && (max && -1 !== maxSV.compare(v) || (maxSV = new SemVer(max = v, options))); })), max; }, exports.minSatisfying = function(versions, range, options) { var min = null, minSV = null; try { var rangeObj = new Range(range, options); } catch (er) { return null; } return versions.forEach((function(v) { rangeObj.test(v) && (min && 1 !== minSV.compare(v) || (minSV = new SemVer(min = v, options))); })), min; }, exports.minVersion = function(range, loose) { range = new Range(range, loose); var minver = new SemVer("0.0.0"); if (range.test(minver)) return minver; if (minver = new SemVer("0.0.0-0"), range.test(minver)) return minver; minver = null; for (var i = 0; i < range.set.length; ++i) range.set[i].forEach((function(comparator) { var compver = new SemVer(comparator.semver.version); switch (comparator.operator) { case ">": 0 === compver.prerelease.length ? compver.patch++ : compver.prerelease.push(0), compver.raw = compver.format(); case "": case ">=": minver && !gt(minver, compver) || (minver = compver); break; case "<": case "<=": break; default: throw new Error("Unexpected operation: " + comparator.operator); } })); return minver && range.test(minver) ? minver : null; }, exports.validRange = function(range, options) { try { return new Range(range, options).range || "*"; } catch (er) { return null; } }, exports.ltr = function(version, range, options) { return outside(version, range, "<", options); }, exports.gtr = function(version, range, options) { return outside(version, range, ">", options); }, exports.outside = outside, exports.prerelease = function(version, options) { var parsed = parse(version, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }, exports.intersects = function(r1, r2, options) { return r1 = new Range(r1, options), r2 = new Range(r2, options), r1.intersects(r2); }, exports.coerce = function(version) { if (version instanceof SemVer) return version; if ("string" != typeof version) return null; var match = version.match(re[COERCE]); return null == match ? null : parse(match[1] + "." + (match[2] || "0") + "." + (match[3] || "0")); }; }, function(module, exports, __webpack_require__) { const mkdirp = __webpack_require__(142), path = __webpack_require__(5), fs = __webpack_require__(2); function commitRes(endPath, res) { mkdirp(path.dirname(endPath), (function(err) { if (err) return console.error(err); fs.writeFile(endPath, JSON.stringify(res), (function(err) { if (err) return console.error(err); console.log("Written " + endPath); })); })); } module.exports = function(baseDir, manifest, handlers) { function addToQueue(res, type, id, extra, cb) { const endPath = path.join(baseDir, res, type, id + ".json"); handlers[res]({ id: id, type: type, extra: {} }, (function(err, res) { if (err) return cb(err); commitRes(endPath, res), cb(null, res); })); } mkdirp.sync(baseDir), commitRes(path.join(baseDir, "manifest.json"), manifest), manifest.catalogs && handlers.catalog && manifest.catalogs.forEach((function(cat) { addToQueue("catalog", cat.type, cat.id, 0, (function(err, res) { err && console.error(err), res && Array.isArray(res.metas) && (function(res) { res.metas.forEach((function(meta) { meta.id && addToQueue("meta", meta.type, meta.id, 0, (function(err, res) { err && console.error(err); })); })); })(res); })); })); }; }, function(module, exports, __webpack_require__) { const fetch = __webpack_require__(34); module.exports = function(addonURL, apiURL) { return fetch((apiURL = apiURL || "https://api.strem.io") + "/api/addonPublish", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ transportUrl: addonURL, transportName: "http" }) }).then((function(res) { return res.json(); })).then((function(resp) { if (resp.error) throw resp.error; return resp.result; })); }; }, function(module, exports, __webpack_require__) { const manifest = __webpack_require__(499), manifestNoCatalogs = Object.assign({}, manifest); manifestNoCatalogs.name += " (without catalog support)", manifestNoCatalogs.catalogs = [], manifestNoCatalogs.resources = manifest.resources.filter((resource => "catalog" != resource.name && "catalog" != resource)), module.exports = manifestNoCatalogs; }, function(module, exports, __webpack_require__) { const consts = __webpack_require__(90); module.exports = function(storage, metaStorage, args, cb) { const metas = []; storage.indexes.itemId.forEach((function(items, itemId) { const entry = storage.getAggrEntry("itemId", itemId, [ "files" ]); if (!(entry.itemId && entry.files && entry.files.length)) return; const firstFile = entry.files[0], meta = metaStorage.indexes.primaryKey.get(entry.itemId); metas.push(meta || { id: entry.itemId, type: "other", name: firstFile.parsedName || entry.name, poster: firstFile.imdb_id ? consts.METAHUB_URL + "/poster/medium/" + firstFile.imdb_id + "/img" : null }); })), cb(null, { metas: metas }); }; }, function(module, exports, __webpack_require__) { const fetch = __webpack_require__(34), indexer = __webpack_require__(501), mapEntryToMeta = __webpack_require__(502), consts = __webpack_require__(90); function mapFile(entry, uxTime, file, index) { const stream = entry.ih ? { infoHash: entry.ih, fileIdx: file.idx, title: entry.ih + "/" + file.idx, sources: entry.sources } : { title: file.path, url: "file://" + file.path, subtitle: consts.STREAM_LOCALFILE_SUBTITLE }, videoId = [ file.imdb_id, file.season, file.episode ].filter((x => x)).join(":"), thumbnail = file.season && file.episode ? `${consts.METAHUB_EPISODES_URL}/${file.imdb_id}/${file.season}/${file.episode}/w780.jpg` : `${consts.METAHUB_URL}/background/medium/${file.imdb_id}/img`; return { id: videoId || stream.title, title: file.name, publishedAt: entry.dateModified || new Date, released: new Date(uxTime - 6e4 * index), stream: stream, season: file.season, episode: file.episode, thumbnail: file.imdb_id ? thumbnail : null }; } module.exports = function(storage, metaStorage, engineUrl, args, cb) { let entry = storage.getAggrEntry("itemId", args.id, [ "files" ]); if (!entry && args.id.startsWith(consts.PREFIX_BT) && (entry = (function(engineUrl, ih) { return fetch(engineUrl + "/" + ih + "/create", { method: "POST" }).then((function(resp) { return resp.json(); })).then((function(torrent) { return new Promise((function(resolve, reject) { indexer.indexParsedTorrent(torrent, (function(err, entry) { return err ? reject(err) : entry ? void resolve(entry) : reject(new Error("internal err: no entry from indexParsedTorrent")); })); })); })); })(engineUrl, args.id.slice(consts.PREFIX_BT.length))), !entry) return cb(null, null); Promise.resolve(entry).then((function(entry) { const videos = entry.files.sort((function(a, b) { try { return a.season - b.season || a.episode - b.episode; } catch (e) {} return 0; })).map(mapFile.bind(null, entry, (new Date).getTime())); return Promise.resolve(metaStorage.indexes.primaryKey.get(entry.itemId)).then((function(meta) { return meta || mapEntryToMeta(entry); })).then((function(meta) { meta.videos = videos, cb(null, { meta: meta }); })); })).catch((function(err) { console.log(err), cb(null, null); })); }; }, function(module, exports, __webpack_require__) { const bencode = __webpack_require__(1058), blobToBuffer = __webpack_require__(1061), fs = __webpack_require__(2), get = __webpack_require__(1062), magnet = __webpack_require__(1063), path = __webpack_require__(5), sha1 = __webpack_require__(182), uniq = __webpack_require__(125); function parseTorrent(torrentId) { if ("string" == typeof torrentId && /^(stream-)?magnet:/.test(torrentId)) return magnet(torrentId); if ("string" == typeof torrentId && (/^[a-f0-9]{40}$/i.test(torrentId) || /^[a-z2-7]{32}$/i.test(torrentId))) return magnet(`magnet:?xt=urn:btih:${torrentId}`); if (Buffer.isBuffer(torrentId) && 20 === torrentId.length) return magnet(`magnet:?xt=urn:btih:${torrentId.toString("hex")}`); if (Buffer.isBuffer(torrentId)) return (function(torrent) { Buffer.isBuffer(torrent) && (torrent = bencode.decode(torrent)), ensure(torrent.info, "info"), ensure(torrent.info["name.utf-8"] || torrent.info.name, "info.name"), ensure(torrent.info["piece length"], "info['piece length']"), ensure(torrent.info.pieces, "info.pieces"), torrent.info.files ? torrent.info.files.forEach((file => { ensure("number" == typeof file.length, "info.files[0].length"), ensure(file["path.utf-8"] || file.path, "info.files[0].path"); })) : ensure("number" == typeof torrent.info.length, "info.length"); const result = { info: torrent.info, infoBuffer: bencode.encode(torrent.info), name: (torrent.info["name.utf-8"] || torrent.info.name).toString(), announce: [] }; result.infoHash = sha1.sync(result.infoBuffer), result.infoHashBuffer = Buffer.from(result.infoHash, "hex"), void 0 !== torrent.info.private && (result.private = !!torrent.info.private), torrent["creation date"] && (result.created = new Date(1e3 * torrent["creation date"])), torrent["created by"] && (result.createdBy = torrent["created by"].toString()), Buffer.isBuffer(torrent.comment) && (result.comment = torrent.comment.toString()), Array.isArray(torrent["announce-list"]) && torrent["announce-list"].length > 0 ? torrent["announce-list"].forEach((urls => { urls.forEach((url => { result.announce.push(url.toString()); })); })) : torrent.announce && result.announce.push(torrent.announce.toString()), Buffer.isBuffer(torrent["url-list"]) && (torrent["url-list"] = torrent["url-list"].length > 0 ? [ torrent["url-list"] ] : []), result.urlList = (torrent["url-list"] || []).map((url => url.toString())), uniq(result.announce), uniq(result.urlList); const files = torrent.info.files || [ torrent.info ]; result.files = files.map(((file, i) => { const parts = [].concat(result.name, file["path.utf-8"] || file.path || []).map((p => p.toString())); return { path: path.join.apply(null, [ path.sep ].concat(parts)).slice(1), name: parts[parts.length - 1], length: file.length, offset: files.slice(0, i).reduce(sumLength, 0) }; })), result.length = files.reduce(sumLength, 0); const lastFile = result.files[result.files.length - 1]; return result.pieceLength = torrent.info["piece length"], result.lastPieceLength = (lastFile.offset + lastFile.length) % result.pieceLength || result.pieceLength, result.pieces = (function(buf) { const pieces = []; for (let i = 0; i < buf.length; i += 20) pieces.push(buf.slice(i, i + 20).toString("hex")); return pieces; })(torrent.info.pieces), result; })(torrentId); if (torrentId && torrentId.infoHash) return torrentId.infoHash = torrentId.infoHash.toLowerCase(), torrentId.announce || (torrentId.announce = []), "string" == typeof torrentId.announce && (torrentId.announce = [ torrentId.announce ]), torrentId.urlList || (torrentId.urlList = []), torrentId; throw new Error("Invalid torrent identifier"); } function sumLength(sum, file) { return sum + file.length; } function ensure(bool, fieldName) { if (!bool) throw new Error(`Torrent is missing required field: ${fieldName}`); } module.exports = parseTorrent, module.exports.remote = function(torrentId, cb) { let parsedTorrent; if ("function" != typeof cb) throw new Error("second argument must be a Function"); try { parsedTorrent = parseTorrent(torrentId); } catch (err) {} function parseOrThrow(torrentBuf) { try { parsedTorrent = parseTorrent(torrentBuf); } catch (err) { return cb(err); } parsedTorrent && parsedTorrent.infoHash ? cb(null, parsedTorrent) : cb(new Error("Invalid torrent identifier")); } parsedTorrent && parsedTorrent.infoHash ? process.nextTick((() => { cb(null, parsedTorrent); })) : "undefined" != typeof Blob && torrentId instanceof Blob ? blobToBuffer(torrentId, ((err, torrentBuf) => { if (err) return cb(new Error(`Error converting Blob: ${err.message}`)); parseOrThrow(torrentBuf); })) : "function" == typeof get && /^https?:/.test(torrentId) ? get.concat({ url: torrentId, timeout: 3e4, headers: { "user-agent": "WebTorrent (https://webtorrent.io)" } }, ((err, res, torrentBuf) => { if (err) return cb(new Error(`Error downloading torrent: ${err.message}`)); parseOrThrow(torrentBuf); })) : "function" == typeof fs.readFile && "string" == typeof torrentId ? fs.readFile(torrentId, ((err, torrentBuf) => { if (err) return cb(new Error("Invalid torrent identifier")); parseOrThrow(torrentBuf); })) : process.nextTick((() => { cb(new Error("Invalid torrent identifier")); })); }, module.exports.toMagnetURI = magnet.encode, module.exports.toTorrentFile = function(parsed) { const torrent = { info: parsed.info }; return torrent["announce-list"] = (parsed.announce || []).map((url => (torrent.announce || (torrent.announce = url), [ url = Buffer.from(url, "utf8") ]))), torrent["url-list"] = parsed.urlList || [], void 0 !== parsed.private && (torrent.private = Number(parsed.private)), parsed.created && (torrent["creation date"] = parsed.created.getTime() / 1e3 | 0), parsed.createdBy && (torrent["created by"] = parsed.createdBy), parsed.comment && (torrent.comment = parsed.comment), bencode.encode(torrent); }, Buffer.alloc(0); }, function(module, exports, __webpack_require__) { var bencode = module.exports; bencode.encode = __webpack_require__(1059), bencode.decode = __webpack_require__(1060), bencode.byteLength = bencode.encodingLength = function(value) { return bencode.encode(value).length; }; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(100).Buffer; function encode(data, buffer, offset) { var buffers = [], result = null; return encode._encode(buffers, data), result = Buffer.concat(buffers), encode.bytes = result.length, Buffer.isBuffer(buffer) ? (result.copy(buffer, offset), buffer) : result; } encode.bytes = -1, encode._floatConversionDetected = !1, encode.getType = function(value) { return Buffer.isBuffer(value) ? "buffer" : Array.isArray(value) ? "array" : ArrayBuffer.isView(value) ? "arraybufferview" : value instanceof Number ? "number" : value instanceof Boolean ? "boolean" : value instanceof ArrayBuffer ? "arraybuffer" : typeof value; }, encode._encode = function(buffers, data) { if (null != data) switch (encode.getType(data)) { case "buffer": encode.buffer(buffers, data); break; case "object": encode.dict(buffers, data); break; case "array": encode.list(buffers, data); break; case "string": encode.string(buffers, data); break; case "number": case "boolean": encode.number(buffers, data); break; case "arraybufferview": encode.buffer(buffers, Buffer.from(data.buffer, data.byteOffset, data.byteLength)); break; case "arraybuffer": encode.buffer(buffers, Buffer.from(data)); } }; var buffE = Buffer.from("e"), buffD = Buffer.from("d"), buffL = Buffer.from("l"); encode.buffer = function(buffers, data) { buffers.push(Buffer.from(data.length + ":"), data); }, encode.string = function(buffers, data) { buffers.push(Buffer.from(Buffer.byteLength(data) + ":" + data)); }, encode.number = function(buffers, data) { var val = 2147483648 * (data / 2147483648 << 0) + (data % 2147483648 << 0); buffers.push(Buffer.from("i" + val + "e")), val === data || encode._floatConversionDetected || (encode._floatConversionDetected = !0, console.warn('WARNING: Possible data corruption detected with value "' + data + '":', 'Bencoding only defines support for integers, value was converted to "' + val + '"'), console.trace()); }, encode.dict = function(buffers, data) { buffers.push(buffD); for (var k, j = 0, keys = Object.keys(data).sort(), kl = keys.length; j < kl; j++) null != data[k = keys[j]] && (encode.string(buffers, k), encode._encode(buffers, data[k])); buffers.push(buffE); }, encode.list = function(buffers, data) { var i = 0, c = data.length; for (buffers.push(buffL); i < c; i++) null != data[i] && encode._encode(buffers, data[i]); buffers.push(buffE); }, module.exports = encode; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(100).Buffer; function getIntFromBuffer(buffer, start, end) { for (var sum = 0, sign = 1, i = start; i < end; i++) { var num = buffer[i]; if (num < 58 && num >= 48) sum = 10 * sum + (num - 48); else if (i !== start || 43 !== num) { if (i !== start || 45 !== num) { if (46 === num) break; throw new Error("not a number: buffer[" + i + "] = " + num); } sign = -1; } } return sum * sign; } function decode(data, start, end, encoding) { return null == data || 0 === data.length ? null : ("number" != typeof start && null == encoding && (encoding = start, start = void 0), "number" != typeof end && null == encoding && (encoding = end, end = void 0), decode.position = 0, decode.encoding = encoding || null, decode.data = Buffer.isBuffer(data) ? data.slice(start, end) : Buffer.from(data), decode.bytes = decode.data.length, decode.next()); } decode.bytes = 0, decode.position = 0, decode.data = null, decode.encoding = null, decode.next = function() { switch (decode.data[decode.position]) { case 100: return decode.dictionary(); case 108: return decode.list(); case 105: return decode.integer(); default: return decode.buffer(); } }, decode.find = function(chr) { for (var i = decode.position, c = decode.data.length, d = decode.data; i < c; ) { if (d[i] === chr) return i; i++; } throw new Error('Invalid data: Missing delimiter "' + String.fromCharCode(chr) + '" [0x' + chr.toString(16) + "]"); }, decode.dictionary = function() { decode.position++; for (var dict = {}; 101 !== decode.data[decode.position]; ) dict[decode.buffer()] = decode.next(); return decode.position++, dict; }, decode.list = function() { decode.position++; for (var lst = []; 101 !== decode.data[decode.position]; ) lst.push(decode.next()); return decode.position++, lst; }, decode.integer = function() { var end = decode.find(101), number = getIntFromBuffer(decode.data, decode.position + 1, end); return decode.position += end + 1 - decode.position, number; }, decode.buffer = function() { var sep = decode.find(58), length = getIntFromBuffer(decode.data, decode.position, sep), end = ++sep + length; return decode.position = end, decode.encoding ? decode.data.toString(decode.encoding, sep, end) : decode.data.slice(sep, end); }, module.exports = decode; }, function(module, exports) { module.exports = function(blob, cb) { if ("undefined" == typeof Blob || !(blob instanceof Blob)) throw new Error("first argument must be a Blob"); if ("function" != typeof cb) throw new Error("second argument must be a function"); var reader = new FileReader; reader.addEventListener("loadend", (function onLoadEnd(e) { reader.removeEventListener("loadend", onLoadEnd, !1), e.error ? cb(e.error) : cb(null, Buffer.from(reader.result)); }), !1), reader.readAsArrayBuffer(blob); }; }, function(module, exports, __webpack_require__) { module.exports = simpleGet; const concat = __webpack_require__(292), decompressResponse = __webpack_require__(293), http = __webpack_require__(11), https = __webpack_require__(21), once = __webpack_require__(35), querystring = __webpack_require__(24), url = __webpack_require__(7), isStream = o => null !== o && "object" == typeof o && "function" == typeof o.pipe; function simpleGet(opts, cb) { if (opts = Object.assign({ maxRedirects: 10 }, "string" == typeof opts ? { url: opts } : opts), cb = once(cb), opts.url) { const {hostname: hostname, port: port, protocol: protocol, auth: auth, path: path} = url.parse(opts.url); delete opts.url, hostname || port || protocol || auth ? Object.assign(opts, { hostname: hostname, port: port, protocol: protocol, auth: auth, path: path }) : opts.path = path; } const headers = { "accept-encoding": "gzip, deflate" }; let body; opts.headers && Object.keys(opts.headers).forEach((k => headers[k.toLowerCase()] = opts.headers[k])), opts.headers = headers, opts.body ? body = opts.json && !isStream(opts.body) ? JSON.stringify(opts.body) : opts.body : opts.form && (body = "string" == typeof opts.form ? opts.form : querystring.stringify(opts.form), opts.headers["content-type"] = "application/x-www-form-urlencoded"), body && (opts.method || (opts.method = "POST"), isStream(body) || (opts.headers["content-length"] = Buffer.byteLength(body)), opts.json && !opts.form && (opts.headers["content-type"] = "application/json")), delete opts.body, delete opts.form, opts.json && (opts.headers.accept = "application/json"), opts.method && (opts.method = opts.method.toUpperCase()); const req = ("https:" === opts.protocol ? https : http).request(opts, (res => { if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) return opts.url = res.headers.location, delete opts.headers.host, res.resume(), "POST" === opts.method && [ 301, 302 ].includes(res.statusCode) && (opts.method = "GET", delete opts.headers["content-length"], delete opts.headers["content-type"]), 0 == opts.maxRedirects-- ? cb(new Error("too many redirects")) : simpleGet(opts, cb); const tryUnzip = "function" == typeof decompressResponse && "HEAD" !== opts.method; cb(null, tryUnzip ? decompressResponse(res) : res); })); return req.on("timeout", (() => { req.abort(), cb(new Error("Request timed out")); })), req.on("error", cb), isStream(body) ? body.on("error", cb).pipe(req) : req.end(body), req; } simpleGet.concat = (opts, cb) => simpleGet(opts, ((err, res) => { if (err) return cb(err); concat(res, ((err, data) => { if (err) return cb(err); if (opts.json) try { data = JSON.parse(data.toString()); } catch (err) { return cb(err, res, data); } cb(null, res, data); })); })), [ "get", "post", "put", "patch", "head", "delete" ].forEach((method => { simpleGet[method] = (opts, cb) => ("string" == typeof opts && (opts = { url: opts }), simpleGet(Object.assign({ method: method.toUpperCase() }, opts), cb)); })); }, function(module, exports, __webpack_require__) { module.exports = magnetURIDecode, module.exports.decode = magnetURIDecode, module.exports.encode = function(obj) { (obj = Object.assign({}, obj)).infoHashBuffer && (obj.xt = `urn:btih:${obj.infoHashBuffer.toString("hex")}`), obj.infoHash && (obj.xt = `urn:btih:${obj.infoHash}`), obj.name && (obj.dn = obj.name), obj.keywords && (obj.kt = obj.keywords), obj.announce && (obj.tr = obj.announce), obj.urlList && (obj.ws = obj.urlList, delete obj.as); let result = "magnet:?"; return Object.keys(obj).filter((key => 2 === key.length)).forEach(((key, i) => { (Array.isArray(obj[key]) ? obj[key] : [ obj[key] ]).forEach(((val, j) => { !(i > 0 || j > 0) || "kt" === key && 0 !== j || (result += "&"), "dn" === key && (val = encodeURIComponent(val).replace(/%20/g, "+")), "tr" !== key && "xs" !== key && "as" !== key && "ws" !== key || (val = encodeURIComponent(val)), "kt" === key && (val = encodeURIComponent(val)), result += "kt" === key && j > 0 ? `+${val}` : `${key}=${val}`; })); })), result; }; const base32 = __webpack_require__(1064), uniq = __webpack_require__(125); function magnetURIDecode(uri) { const result = {}, data = uri.split("magnet:?")[1]; let m; return (data && data.length >= 0 ? data.split("&") : []).forEach((param => { const keyval = param.split("="); if (2 !== keyval.length) return; const key = keyval[0]; let val = keyval[1]; if ("dn" === key && (val = decodeURIComponent(val).replace(/\+/g, " ")), "tr" !== key && "xs" !== key && "as" !== key && "ws" !== key || (val = decodeURIComponent(val)), "kt" === key && (val = decodeURIComponent(val).split("+")), "ix" === key && (val = Number(val)), result[key]) if (Array.isArray(result[key])) result[key].push(val); else { const old = result[key]; result[key] = [ old, val ]; } else result[key] = val; })), result.xt && (Array.isArray(result.xt) ? result.xt : [ result.xt ]).forEach((xt => { if (m = xt.match(/^urn:btih:(.{40})/)) result.infoHash = m[1].toLowerCase(); else if (m = xt.match(/^urn:btih:(.{32})/)) { const decodedStr = base32.decode(m[1]); result.infoHash = Buffer.from(decodedStr, "binary").toString("hex"); } })), result.infoHash && (result.infoHashBuffer = Buffer.from(result.infoHash, "hex")), result.dn && (result.name = result.dn), result.kt && (result.keywords = result.kt), "string" == typeof result.tr ? result.announce = [ result.tr ] : Array.isArray(result.tr) ? result.announce = result.tr : result.announce = [], result.urlList = [], ("string" == typeof result.as || Array.isArray(result.as)) && (result.urlList = result.urlList.concat(result.as)), ("string" == typeof result.ws || Array.isArray(result.ws)) && (result.urlList = result.urlList.concat(result.ws)), uniq(result.announce), uniq(result.urlList), result; } }, function(module, exports, __webpack_require__) { var base32 = __webpack_require__(1065); exports.encode = base32.encode, exports.decode = base32.decode; }, function(module, exports, __webpack_require__) { "use strict"; var byteTable = [ 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 ]; exports.encode = function(plain) { Buffer.isBuffer(plain) || (plain = new Buffer(plain)); for (var buff, quintets, i = 0, j = 0, shiftIndex = 0, digit = 0, encoded = new Buffer(8 * (buff = plain, quintets = Math.floor(buff.length / 5), buff.length % 5 == 0 ? quintets : quintets + 1)); i < plain.length; ) { var current = plain[i]; shiftIndex > 3 ? (digit = (digit = current & 255 >> shiftIndex) << (shiftIndex = (shiftIndex + 5) % 8) | (i + 1 < plain.length ? plain[i + 1] : 0) >> 8 - shiftIndex, i++) : (digit = current >> 8 - (shiftIndex + 5) & 31, 0 == (shiftIndex = (shiftIndex + 5) % 8) && i++), encoded[j] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(digit), j++; } for (i = j; i < encoded.length; i++) encoded[i] = 61; return encoded; }, exports.decode = function(encoded) { var plainChar, shiftIndex = 0, plainDigit = 0, plainPos = 0; Buffer.isBuffer(encoded) || (encoded = new Buffer(encoded)); for (var decoded = new Buffer(Math.ceil(5 * encoded.length / 8)), i = 0; i < encoded.length && 61 !== encoded[i]; i++) { var encodedByte = encoded[i] - 48; if (!(encodedByte < byteTable.length)) throw new Error("Invalid input - it is not base32 encoded string"); plainDigit = byteTable[encodedByte], shiftIndex <= 3 ? 0 == (shiftIndex = (shiftIndex + 5) % 8) ? (plainChar |= plainDigit, decoded[plainPos] = plainChar, plainPos++, plainChar = 0) : plainChar |= 255 & plainDigit << 8 - shiftIndex : (plainChar |= 255 & plainDigit >>> (shiftIndex = (shiftIndex + 5) % 8), decoded[plainPos] = plainChar, plainPos++, plainChar = 255 & plainDigit << 8 - shiftIndex); } return decoded.slice(0, plainPos); }; }, function(module, exports, __webpack_require__) { const namedQueue = __webpack_require__(71), helpers = __webpack_require__(242); var providers = { metadata: __webpack_require__(1068), imdbFind: __webpack_require__(1069) }, defaultProviders = [ "metadata", "imdbFind" ], cache = {}, cacheLastSet = {}, queue = new namedQueue((function(task, cb) { var prov = [].concat(task.providers); !(function nextProv() { var n = prov.shift(); if (!n) return cb(null, null); var provider = providers[n]; if (!provider) return cb(new Error("unknown provider: " + n)); provider(task.q, (function(err, res) { return err ? cb(err) : res ? cb(null, res, { match: n }) : void nextProv(); })); })(); }), 3); module.exports = function(args, cb) { args = "string" == typeof args ? { name: args } : args; var q = { name: helpers.parseSearchTerm(args.name) }; if (args.year && (q.year = args.year), args.type && (q.type = args.type), !q.name) return cb(new Error("empty name")); if (q.year && "string" == typeof q.year && (q.year = parseInt(q.year.split("-")[0])), q.year && isNaN(q.year)) return cb(new Error("invalid year")); if (q.type && "movie" != q.type && "series" != q.type) return cb(null, null); var key = new Buffer.from(args.hintUrl || Object.values(q).join(":")).toString("ascii"); if (cache.hasOwnProperty(key) && Date.now() - cacheLastSet[key] < 432e5) return cb(null, cache[key][0], { match: cache[key][1].match, isCached: !0 }); queue.push({ id: key, q: q, providers: args.providers || defaultProviders }, (function(err, res, match) { if (err) return cb(err); res && res.id && (cache[key] = [ res.id, match ], cacheLastSet[key] = Date.now()), cb(null, (res || {}).id, { ...match, meta: res }); })); }; }, function(module, exports) { exports.remove = function(str) { return str.replace(/[^\u0000-\u007e]/g, (function(c) { return diacriticsMap[c] || c; })); }; for (var replacementList = [ { base: " ", chars: " " }, { base: "0", chars: "߀" }, { base: "A", chars: "ⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ" }, { base: "AA", chars: "Ꜳ" }, { base: "AE", chars: "ÆǼǢ" }, { base: "AO", chars: "Ꜵ" }, { base: "AU", chars: "Ꜷ" }, { base: "AV", chars: "ꜸꜺ" }, { base: "AY", chars: "Ꜽ" }, { base: "B", chars: "ⒷBḂḄḆɃƁ" }, { base: "C", chars: "ⒸCꜾḈĆCĈĊČÇƇȻ" }, { base: "D", chars: "ⒹDḊĎḌḐḒḎĐƊƉᴅꝹ" }, { base: "Dh", chars: "Ð" }, { base: "DZ", chars: "DZDŽ" }, { base: "Dz", chars: "DzDž" }, { base: "E", chars: "ɛⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎᴇ" }, { base: "F", chars: "ꝼⒻFḞƑꝻ" }, { base: "G", chars: "ⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾɢ" }, { base: "H", chars: "ⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ" }, { base: "I", chars: "ⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ" }, { base: "J", chars: "ⒿJĴɈȷ" }, { base: "K", chars: "ⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ" }, { base: "L", chars: "ⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ" }, { base: "LJ", chars: "LJ" }, { base: "Lj", chars: "Lj" }, { base: "M", chars: "ⓂMḾṀṂⱮƜϻ" }, { base: "N", chars: "ꞤȠⓃNǸŃÑṄŇṆŅṊṈƝꞐᴎ" }, { base: "NJ", chars: "NJ" }, { base: "Nj", chars: "Nj" }, { base: "O", chars: "ⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ" }, { base: "OE", chars: "Œ" }, { base: "OI", chars: "Ƣ" }, { base: "OO", chars: "Ꝏ" }, { base: "OU", chars: "Ȣ" }, { base: "P", chars: "ⓅPṔṖƤⱣꝐꝒꝔ" }, { base: "Q", chars: "ⓆQꝖꝘɊ" }, { base: "R", chars: "ⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ" }, { base: "S", chars: "ⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ" }, { base: "T", chars: "ⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ" }, { base: "Th", chars: "Þ" }, { base: "TZ", chars: "Ꜩ" }, { base: "U", chars: "ⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ" }, { base: "V", chars: "ⓋVṼṾƲꝞɅ" }, { base: "VY", chars: "Ꝡ" }, { base: "W", chars: "ⓌWẀẂŴẆẄẈⱲ" }, { base: "X", chars: "ⓍXẊẌ" }, { base: "Y", chars: "ⓎYỲÝŶỸȲẎŸỶỴƳɎỾ" }, { base: "Z", chars: "ⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ" }, { base: "a", chars: "ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐɑ" }, { base: "aa", chars: "ꜳ" }, { base: "ae", chars: "æǽǣ" }, { base: "ao", chars: "ꜵ" }, { base: "au", chars: "ꜷ" }, { base: "av", chars: "ꜹꜻ" }, { base: "ay", chars: "ꜽ" }, { base: "b", chars: "ⓑbḃḅḇƀƃɓƂ" }, { base: "c", chars: "cⓒćĉċčçḉƈȼꜿↄ" }, { base: "d", chars: "ⓓdḋďḍḑḓḏđƌɖɗƋᏧԁꞪ" }, { base: "dh", chars: "ð" }, { base: "dz", chars: "dzdž" }, { base: "e", chars: "ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇǝ" }, { base: "f", chars: "ⓕfḟƒ" }, { base: "ff", chars: "ff" }, { base: "fi", chars: "fi" }, { base: "fl", chars: "fl" }, { base: "ffi", chars: "ffi" }, { base: "ffl", chars: "ffl" }, { base: "g", chars: "ⓖgǵĝḡğġǧģǥɠꞡꝿᵹ" }, { base: "h", chars: "ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ" }, { base: "hv", chars: "ƕ" }, { base: "i", chars: "ⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı" }, { base: "j", chars: "ⓙjĵǰɉ" }, { base: "k", chars: "ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ" }, { base: "l", chars: "ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇɭ" }, { base: "lj", chars: "lj" }, { base: "m", chars: "ⓜmḿṁṃɱɯ" }, { base: "n", chars: "ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥлԉ" }, { base: "nj", chars: "nj" }, { base: "o", chars: "ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿꝋꝍɵɔᴑ" }, { base: "oe", chars: "œ" }, { base: "oi", chars: "ƣ" }, { base: "oo", chars: "ꝏ" }, { base: "ou", chars: "ȣ" }, { base: "p", chars: "ⓟpṕṗƥᵽꝑꝓꝕρ" }, { base: "q", chars: "ⓠqɋꝗꝙ" }, { base: "r", chars: "ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ" }, { base: "s", chars: "ⓢsśṥŝṡšṧṣṩșşȿꞩꞅẛʂ" }, { base: "ss", chars: "ß" }, { base: "t", chars: "ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ" }, { base: "th", chars: "þ" }, { base: "tz", chars: "ꜩ" }, { base: "u", chars: "ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ" }, { base: "v", chars: "ⓥvṽṿʋꝟʌ" }, { base: "vy", chars: "ꝡ" }, { base: "w", chars: "ⓦwẁẃŵẇẅẘẉⱳ" }, { base: "x", chars: "ⓧxẋẍ" }, { base: "y", chars: "ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ" }, { base: "z", chars: "ⓩzźẑżžẓẕƶȥɀⱬꝣ" } ], diacriticsMap = {}, i = 0; i < replacementList.length; i += 1) for (var chars = replacementList[i].chars, j = 0; j < chars.length; j += 1) diacriticsMap[chars[j]] = replacementList[i].base; exports.replacementList = replacementList, exports.diacriticsMap = diacriticsMap; }, function(module, exports, __webpack_require__) { var fetch = __webpack_require__(34), helpers = __webpack_require__(242), cinemetaUrls = { movie: "https://cinemeta.strem.io/stremioget/stremio/v1/q.json?b=eyJwYXJhbXMiOltudWxsLHt9XSwibWV0aG9kIjoibmFtZXMubW92aWUiLCJpZCI6MSwianNvbnJwYyI6IjIuMCJ9", series: "https://cinemeta.strem.io/stremioget/stremio/v1/q.json?b=eyJwYXJhbXMiOltudWxsLHt9XSwibWV0aG9kIjoibmFtZXMuc2VyaWVzIiwiaWQiOjEsImpzb25ycGMiOiIyLjAifQ==" }; function indexEntry(entry) { entry.year && (entry.year = parseInt(entry.year.toString().split("-")[0])); var n = helpers.simplifyName(entry); meta[n] || (meta[n] = []), meta[n].push(entry), byImdb[entry.imdb_id] = entry; } var pulled = { movie: !1, series: !1 }, meta = {}, byImdb = {}; module.exports = function(query, cb) { function match() { var name = helpers.simplifyName(query); if (!name) return cb(null, null); var m = (meta[name] || []).find((function(match) { return match.type === query.type && ("movie" !== query.type || !query.hasOwnProperty("year") || helpers.yearSimilar(query.year, match.year)); })), res = !!m && { id: m.imdb_id, name: m.name, year: m.year, type: m.type, yearRange: void 0, image: void 0, starring: void 0, similarity: void 0 }; return cb(null, res); } query.type && !pulled[query.type] && cinemetaUrls[query.type] ? fetch(cinemetaUrls[query.type]).then((function(resp) { return resp.json(); })).then((function(resp) { return resp.result; })).then((function(res) { res.forEach(indexEntry), pulled[query.type] = 1; })).catch((function(e) { console.error(e); })).then((function() { match(); })) : process.nextTick(match); }; }, function(module, exports, __webpack_require__) { var needle = __webpack_require__(1070), helpers = __webpack_require__(242); module.exports = function imdbFind(task, cb, loose) { var shouldRetry = !loose && task.year, retry = function() { return shouldRetry ? imdbFind(task, cb, !0) : void cb(null, null); }; !(function(searchTerm, cb) { var url = "https://sg.media-imdb.com/suggests/" + searchTerm.charAt(0).toLowerCase() + "/" + encodeURIComponent(searchTerm) + ".json"; needle.get(url, (function(err, res) { if (!err && 200 == res.statusCode && res.body) { var results = JSON.parse(res.body.toString().match(/{.*}/g)).d; cb(!(!results || !results.length) && results, url); } else cb(!1); })); })(shouldRetry ? task.name + " " + task.year : task.name, (function(results, url) { results ? matchSimilar(results, (function(result) { result ? cb(null, result, { match: url }) : retry(); })) : retry(); })); var matchSimilar = function(results, callback) { var pick, secondBest, firstResult; results.forEach((function(result) { if ((result || {}).id && result.id.match(/tt\d{7,8}/g)) { var res = { id: result.id, name: result.l, year: result.y, type: result.q, yearRange: result.yr, image: result.i ? { src: result.i[0], width: result.i[1], height: result.i[2] } : void 0, starring: result.s }, movieMatch = "movie" == task.type && [ "feature", "TV special" ].indexOf(res.type) > -1, seriesMatch = "series" == task.type && [ "TV series", "TV mini-series" ].indexOf(res.type) > -1; if ((!task.type || movieMatch || seriesMatch) && helpers.yearSimilar(task.year, res.year)) { var similarity = helpers.nameSimilar(task.name, res.name); similarity > .6 && (!pick || pick && similarity > pick.similarity) && ((pick = res).similarity = similarity), !secondBest && helpers.nameAlmostSimilar(task.name, res.name) && (secondBest = res), firstResult || task.strict || (firstResult = res); } } })), secondBest && pick && (helpers.nameAlmostSimilar(task.name, pick.name) || (pick = secondBest)), callback(pick || secondBest || firstResult || null); }; }; }, function(module, exports, __webpack_require__) { var fs = __webpack_require__(2), http = __webpack_require__(11), https = __webpack_require__(21), url = __webpack_require__(7), stream = __webpack_require__(3), debug = __webpack_require__(9)("needle"), stringify = __webpack_require__(1071).build, multipart = __webpack_require__(1072), auth = __webpack_require__(1073), cookies = __webpack_require__(1074), parsers = __webpack_require__(1075), decoder = __webpack_require__(1076), version = __webpack_require__(1077).version, user_agent = "Needle/" + version; user_agent += " (Node.js " + process.version + "; " + process.platform + " " + process.arch + ")"; var close_by_default = !http.Agent || http.Agent.defaultMaxSockets != 1 / 0, extend = Object.assign ? Object.assign : __webpack_require__(0)._extend, redirect_codes = [ 301, 302, 303, 307 ], decompressors = {}; try { var zlib = __webpack_require__(43); decompressors["x-deflate"] = zlib.Inflate, decompressors.deflate = zlib.Inflate, decompressors["x-gzip"] = zlib.Gunzip, decompressors.gzip = zlib.Gunzip; var zlib_options = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH }; } catch (e) {} var defaults = { boundary: "--------------------NODENEEDLEHTTPCLIENT", encoding: "utf8", parse_response: "all", proxy: null, accept: "*/*", user_agent: user_agent, open_timeout: 1e4, read_timeout: 0, follow_max: 0, stream_length: -1, decode_response: !0, parse_cookies: !0, follow_set_cookies: !1, follow_set_referer: !1, follow_keep_method: !1, follow_if_same_host: !1, follow_if_same_protocol: !1 }, aliased = { options: { decode: "decode_response", parse: "parse_response", timeout: "open_timeout", follow: "follow_max" }, inverted: {} }; function keys_by_type(type) { return Object.keys(defaults).map((function(el) { if (null !== defaults[el] && defaults[el].constructor == type) return el; })).filter((function(el) { return el; })); } function is_stream(obj) { return "function" == typeof obj.pipe; } function Needle(method, uri, data, options, callback) { if ("string" != typeof uri) throw new TypeError("URL must be a string, not " + uri); this.method = method, this.uri = uri, this.data = data, "function" == typeof options ? (this.callback = options, this.options = {}) : (this.callback = callback, this.options = options); } Object.keys(aliased.options).map((function(k) { var value = aliased.options[k]; aliased.inverted[value] = k; })), Needle.prototype.setup = function(uri, options) { function get_option(key, fallback) { return void 0 !== options[key] ? options[key] : void 0 !== options[aliased.inverted[key]] ? options[aliased.inverted[key]] : fallback; } function check_value(expected, key) { var value = get_option(key), type = typeof value; if ("undefined" != type && type != expected) throw new TypeError(type + " received for " + key + ", but expected a " + expected); return type == expected ? value : defaults[key]; } var config = { http_opts: {}, output: options.output, proxy: get_option("proxy", defaults.proxy), parser: get_option("parse_response", defaults.parse_response), encoding: options.encoding || (options.multipart ? "binary" : defaults.encoding) }; if (keys_by_type(Boolean).forEach((function(key) { config[key] = check_value("boolean", key); })), keys_by_type(Number).forEach((function(key) { config[key] = check_value("number", key); })), "agent pfx key passphrase cert ca ciphers rejectUnauthorized secureProtocol checkServerIdentity".split(" ").forEach((function(key) { void 0 !== options[key] && (config.http_opts[key] = options[key], void 0 === options.agent && (config.http_opts.agent = !1)); })), config.headers = { accept: options.accept || defaults.accept, "user-agent": options.user_agent || defaults.user_agent }, options.content_type && (config.headers["content-type"] = options.content_type), (options.connection || close_by_default) && (config.headers.connection = options.connection || "close"), (options.compressed || defaults.compressed) && void 0 !== zlib && (config.headers["accept-encoding"] = "gzip,deflate"), options.cookies && (config.headers.cookie = cookies.write(options.cookies)), -1 !== uri.indexOf("@")) { var parts = (url.parse(uri).auth || "").split(":"); options.username = parts[0], options.password = parts[1]; } if (options.username && (!options.auth || "auto" != options.auth && "digest" != options.auth ? config.headers.authorization = auth.basic(options.username, options.password) : config.credentials = [ options.username, options.password ]), config.proxy) { if (-1 === config.proxy.indexOf("http") && (config.proxy = "http://" + config.proxy), -1 !== config.proxy.indexOf("@")) { var proxy = (url.parse(config.proxy).auth || "").split(":"); options.proxy_user = proxy[0], options.proxy_pass = proxy[1]; } options.proxy_user && (config.headers["proxy-authorization"] = auth.basic(options.proxy_user, options.proxy_pass)); } for (var h in options.headers) config.headers[h.toLowerCase()] = options.headers[h]; return config; }, Needle.prototype.start = function() { var out = new stream.PassThrough({ objectMode: !1 }), uri = this.uri, data = this.data, method = this.method, callback = "function" == typeof this.options ? this.options : this.callback, options = this.options || {}; -1 === uri.indexOf("http") && (uri = uri.replace(/^(\/\/)?/, "http://")); var body, self = this, waiting = !1, config = this.setup(uri, options), json = options.json || !1 !== options.json && "application/json" == config.headers["content-type"]; if (data) if (options.multipart) { var boundary = options.boundary || defaults.boundary; waiting = !0, multipart.build(data, boundary, (function(err, parts) { if (err) throw err; config.headers["content-type"] = "multipart/form-data; boundary=" + boundary, next(parts); })); } else if (is_stream(data)) { if ("GET" == method.toUpperCase()) throw new Error("Refusing to pipe() a stream via GET. Did you mean .post?"); config.stream_length > 0 || 0 === config.stream_length && data.path ? (waiting = !0, (function(stream, given_length, cb) { given_length > 0 ? cb(given_length) : void 0 !== stream.end && stream.end !== 1 / 0 && void 0 !== stream.start ? cb(stream.end + 1 - (stream.start || 0)) : fs.stat(stream.path, (function(err, stat) { cb(stat ? stat.size - (stream.start || 0) : null); })); })(data, config.stream_length, (function(length) { data.length = length, next(data); }))) : body = data; } else Buffer.isBuffer(data) ? body = data : "GET" != method.toUpperCase() || json ? (body = "string" == typeof data ? data : json ? JSON.stringify(data) : stringify(data), body = new Buffer(body, config.encoding)) : uri = uri.replace(/\?.*|$/, "?" + stringify(data)); function next(body) { body && (body.length && (config.headers["content-length"] = body.length), config.headers["content-type"] || (config.headers["content-type"] = json ? "application/json; charset=utf-8" : "application/x-www-form-urlencoded")), !options.json || options.accept || (options.headers || {}).accept || (config.headers.accept = "application/json"), self.send_request(1, method, uri, config, body, out, callback); } return waiting || next(body), out; }, Needle.prototype.get_request_opts = function(method, uri, config) { var opts = config.http_opts, proxy = config.proxy, remote = proxy ? url.parse(proxy) : url.parse(uri); if (opts.protocol = remote.protocol, opts.host = remote.hostname, opts.port = remote.port || ("https:" == remote.protocol ? 443 : 80), opts.path = proxy ? uri : remote.pathname + (remote.search || ""), opts.method = method, opts.headers = config.headers, !opts.headers.host) { var target = proxy ? url.parse(uri) : remote; opts.headers.host = target.hostname, target.port && -1 === [ 80, 443 ].indexOf(target.port) && (opts.headers.host += ":" + target.port); } return opts; }, Needle.prototype.should_follow = function(location, config, original) { if (!location) return !1; function matches(property) { return property = original[property], -1 !== location.indexOf(property); } return !(location === original || config.follow_if_same_host && !matches("host") || config.follow_if_same_protocol && !matches("protocol")); }, Needle.prototype.send_request = function(count, method, uri, config, post_data, out, callback) { var timer, returned = 0, self = this, request_opts = this.get_request_opts(method, uri, config), protocol = "https:" == request_opts.protocol ? https : http; function done(err, resp) { return returned++ > 0 ? debug("Already finished, stopping here.") : (timer && clearTimeout(timer), request.removeListener("error", had_error), callback ? callback(err, resp, resp ? resp.body : void 0) : void out.emit("done", err)); } function had_error(err) { debug("Request error", err), out.emit("err", err), done(err || new Error("Unknown error when making request.")); } function set_timeout(type, milisecs) { milisecs <= 0 || (timer = setTimeout((function() { out.emit("timeout", type), request.abort(); }), milisecs)); } function on_socket_end() { this.writable || !1 !== this.destroyed || (this.destroy(), had_error(new Error("Remote end closed socket abruptly."))); } debug("Making request #" + count, request_opts); var request = protocol.request(request_opts, (function(resp) { var headers = resp.headers; if (debug("Got response", resp.statusCode, headers), out.emit("response", resp), timer && clearTimeout(timer), set_timeout("read", config.read_timeout), config.parse_cookies && (headers["set-cookie"] || config.stored_cookies) && (resp.cookies = extend(config.stored_cookies || {}, cookies.read(headers["set-cookie"])), debug("Got cookies", resp.cookies)), -1 !== redirect_codes.indexOf(resp.statusCode) && self.should_follow(headers.location, config, uri)) { if (count <= config.follow_max) return out.emit("redirect", headers.location), config.follow_keep_method || (method = "GET", post_data = null, delete config.headers["content-length"]), config.follow_set_cookies && resp.cookies && (config.stored_cookies = resp.cookies, config.headers.cookie = cookies.write(resp.cookies)), config.follow_set_referer && (config.headers.referer = uri), config.headers.host = null, debug("Redirecting to " + url.resolve(uri, headers.location)), self.send_request(++count, method, url.resolve(uri, headers.location), config, post_data, out, callback); if (config.follow_max > 0) return done(new Error("Max redirects reached. Possible loop in: " + headers.location)); } if (401 == resp.statusCode && headers["www-authenticate"] && config.credentials && !config.headers.authorization) { var auth_header = auth.header(headers["www-authenticate"], config.credentials, request_opts); if (auth_header) return config.headers.authorization = auth_header, self.send_request(count, method, uri, config, post_data, out, callback); } out.emit("header", resp.statusCode, headers), out.emit("headers", headers); var pipeline = [], mime = (function(header) { if (!header || "" === header) return {}; var charset = "iso-8859-1", arr = header.split(";"); try { charset = arr[1].match(/charset=(.+)/)[1]; } catch (e) {} return { type: arr[0], charset: charset }; })(headers["content-type"]), text_response = mime.type && -1 != mime.type.indexOf("text/"); if (headers["content-encoding"] && decompressors[headers["content-encoding"]]) { var decompressor = decompressors[headers["content-encoding"]](zlib_options); decompressor.on("error", had_error), pipeline.push(decompressor); } if (config.parser && parsers[mime.type]) { var parser_name = config.parser.toString().toLowerCase(); -1 != [ "xml", "json" ].indexOf(parser_name) && parsers[mime.type].name != parser_name || (out.parser = parsers[mime.type].name, pipeline.push(parsers[mime.type].fn()), out._writableState.objectMode = !0, out._readableState.objectMode = !0); } else text_response && config.decode_response && mime.charset && !mime.charset.match(/utf-?8$/i) && pipeline.push(decoder(mime.charset)); pipeline.push(out); for (var tmp = resp; pipeline.length; ) tmp = tmp.pipe(pipeline.shift()); if (config.output && 200 == resp.statusCode) { var file = fs.createWriteStream(config.output); file.on("error", had_error), out.on("end", (function() { file.writable && file.end(); })), file.on("close", (function() { delete out.file; })), out.on("readable", (function() { for (var chunk; null !== (chunk = this.read()); ) file.writable && file.write(chunk), resp.body && resp.body.push(chunk); })), out.file = file; } if (callback) { resp.raw = [], resp.body = [], resp.bytes = 0; var clean_pipe = new stream.PassThrough; resp.pipe(clean_pipe), clean_pipe.on("readable", (function() { for (var chunk; null != (chunk = this.read()); ) resp.bytes += chunk.length, resp.raw.push(chunk); })), config.output && 200 == resp.statusCode || out.on("readable", (function() { for (var chunk; null !== (chunk = this.read()); ) "string" == typeof chunk && (chunk = new Buffer(chunk)), resp.body.push(chunk); })), out.on("end", (function() { resp.raw = Buffer.concat(resp.raw), void 0 === resp.body[0] || Buffer.isBuffer(resp.body[0]) ? (resp.body = Buffer.concat(resp.body), (text_response || out.parser) && (resp.body = resp.body.toString())) : (resp.body = resp.body[0], out.parser && (resp.parser = out.parser)), out.file ? out.file.on("close", (function() { done(null, resp, resp.body); })) : done(null, resp, resp.body); })); } })); return set_timeout("open", config.open_timeout), request.on("error", had_error), request.once("socket", (function(socket) { socket.on_socket_end || (socket.on_socket_end = on_socket_end, socket.on("end", socket.on_socket_end)); })), post_data ? is_stream(post_data) ? post_data.pipe(request) : (request.write(post_data, config.encoding), request.end()) : request.end(), out.request = request, out; }, exports.version = version, exports.defaults = function(obj) { for (var key in obj) { var target_key = aliased.options[key] || key; if (defaults.hasOwnProperty(target_key) && void 0 !== obj[key]) { if ("parse_response" != target_key && "proxy" != target_key) { var valid_type = defaults[target_key].constructor.name; if (obj[key].constructor.name != valid_type) throw new TypeError("Invalid type for " + key + ", should be " + valid_type); } defaults[target_key] = obj[key]; } } return defaults; }, "head get".split(" ").forEach((function(method) { exports[method] = function(uri, options, callback) { return new Needle(method, uri, null, options, callback).start(); }; })), "post put patch delete".split(" ").forEach((function(method) { exports[method] = function(uri, data, options, callback) { return new Needle(method, uri, data, options, callback).start(); }; })), exports.request = function(method, uri, data, opts, callback) { return new Needle(method, uri, data, opts, callback).start(); }; }, function(module, exports) { var toString = Object.prototype.toString; exports.build = function stringify(obj, prefix) { if (prefix && null == obj) return prefix + "="; if ("[object Array]" == toString.call(obj)) return (function(arr, prefix) { for (var ret = [], i = 0, len = arr.length; i < len; i++) prefix ? ret.push(stringify(arr[i], prefix + "[" + i + "]")) : ret.push(stringify(arr[i])); return ret.join("&"); })(obj, prefix); if ("[object Object]" == toString.call(obj)) return (function(obj, prefix) { var ret = []; return Object.keys(obj).forEach((function(key) { ret.push(stringify(obj[key], prefix ? prefix + "[" + encodeURIComponent(key) + "]" : encodeURIComponent(key))); })), ret.join("&"); })(obj, prefix); if ("[object Date]" == toString.call(obj)) return obj.toISOString(); if (prefix) return prefix + "=" + encodeURIComponent(String(obj)); if (-1 !== String(obj).indexOf("=")) return String(obj); throw new TypeError("Cannot build a querystring out of: " + obj); }; }, function(module, exports, __webpack_require__) { var readFile = __webpack_require__(2).readFile, basename = __webpack_require__(5).basename; function generate_part(name, part, boundary, callback) { var return_part = "--" + boundary + "\r\n"; function append(data, filename) { if (data) { var binary = -1 == part.content_type.indexOf("text"); return_part += '; filename="' + encodeURIComponent(filename) + '"\r\n', binary && (return_part += "Content-Transfer-Encoding: binary\r\n"), return_part += "Content-Type: " + part.content_type + "\r\n\r\n", return_part += binary ? data.toString("binary") : data.toString("utf8"); } callback(null, return_part + "\r\n"); } if (return_part += 'Content-Disposition: form-data; name="' + name + '"', (part.file || part.buffer) && part.content_type) { var filename = part.filename ? part.filename : part.file ? basename(part.file) : name; if (part.buffer) return append(part.buffer, filename); readFile(part.file, (function(err, data) { if (err) return callback(err); append(data, filename); })); } else { if ("object" == typeof part.value) return callback(new Error("Object received for " + name + ", expected string.")); part.content_type && (return_part += "\r\n", return_part += "Content-Type: " + part.content_type), return_part += "\r\n\r\n", return_part += new Buffer(String(part.value), "utf8").toString("binary"), append(); } } function flatten(object, into, prefix) { for (var key in into = into || {}, object) { var prefix_key = prefix ? prefix + "[" + key + "]" : key, prop = object[key]; prop && "object" == typeof prop && !(prop.buffer || prop.file || prop.content_type) ? flatten(prop, into, prefix_key) : into[prefix_key] = prop; } return into; } exports.build = function(data, boundary, callback) { if ("object" != typeof data || "function" == typeof data.pipe) return callback(new Error("Multipart builder expects data as key/val object.")); var body = "", object = flatten(data), count = Object.keys(object).length; if (0 === count) return callback(new Error("Empty multipart body. Invalid data.")); function done(err, section) { if (err) return callback(err); section && (body += section), --count || callback(null, body + "--" + boundary + "--"); } for (var key in object) { var value = object[key]; null == value ? done() : generate_part(key, value.buffer || value.file || value.content_type ? value : { value: value }, boundary, done); } }; }, function(module, exports, __webpack_require__) { var createHash = __webpack_require__(6).createHash; function md5(string) { return createHash("md5").update(string).digest("hex"); } function basic(user, pass) { var str = void 0 === pass ? user : [ user, pass ].join(":"); return "Basic " + new Buffer(str).toString("base64"); } var digest = { parse_header: function(header) { for (var challenge = {}, matches = header.match(/([a-z0-9_-]+)="?([a-z0-9=\/\.@\s-]+)"?/gi), i = 0, l = matches.length; i < l; i++) { var parts = matches[i].split("="), key = parts.shift(), val = parts.join("=").replace(/^"/, "").replace(/"$/, ""); challenge[key] = val; } return challenge; }, update_nc: function(nc) { return ++nc > 99999999 && (nc = 1), nc += "", (new Array(8).join("0") + "").substr(0, 8 - nc.length) + nc; }, generate: function(header, user, pass, method, path) { var nc = 1, cnonce = null, challenge = digest.parse_header(header), ha1 = md5(user + ":" + challenge.realm + ":" + pass), ha2 = md5(method.toUpperCase() + ":" + path), resp = [ ha1, challenge.nonce ]; "string" == typeof challenge.qop && (cnonce = md5(Math.random().toString(36)).substr(0, 8), nc = digest.update_nc(nc), resp = resp.concat(nc, cnonce)), resp = resp.concat(challenge.qop, ha2); var params = { uri: path, realm: challenge.realm, nonce: challenge.nonce, username: user, response: md5(resp.join(":")) }; for (var k in challenge.qop && (params.qop = challenge.qop), challenge.opaque && (params.opaque = challenge.opaque), cnonce && (params.nc = nc, params.cnonce = cnonce), header = [], params) header.push(k + '="' + params[k] + '"'); return "Digest " + header.join(", "); } }; module.exports = { header: function(header, credentials, opts) { var type = header.split(" ")[0], user = credentials[0], pass = credentials[1]; return "Digest" == type ? digest.generate(header, user, pass, opts.method, opts.path) : "Basic" == type ? basic(user, pass) : void 0; }, basic: basic, digest: digest.generate }; }, function(module, exports, __webpack_require__) { var unescape = __webpack_require__(24).unescape; const COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/, EXCLUDED_CHARS = /[\x00-\x1F\x7F\x3B\x3B\s\"\,\\"%]/g; function encodeCookieComponent(str) { return str.toString().replace(EXCLUDED_CHARS, encodeURIComponent); } exports.read = function(header) { return header ? (header = header instanceof Array ? header : [ header ]).reduce((function(res, str) { var cookie = (function(str) { str = (function(str) { var index = str.indexOf(";"); return -1 === index ? str : str.substr(0, index); })(str = (function(str) { return str.trim().replace(/\x3B+$/, ""); })(str)); var res = COOKIE_PAIR.exec(str); return res && res[3] ? { name: unescape(res[1]), value: unescape(res[3]) } : null; })(str); return cookie && (res[cookie.name] = cookie.value), res; }), {}) : {}; }, exports.write = function(obj) { return Object.keys(obj).reduce((function(str, name) { return str + (str ? "; " : "") + encodeCookieComponent(name) + "=" + encodeCookieComponent(obj[name]); }), ""); }; }, function(module, exports, __webpack_require__) { var Transform = __webpack_require__(3).Transform; function parserFactory(name, fn) { return { fn: function() { var chunks = [], stream = new Transform({ objectMode: !0 }); return stream._transform = function(chunk, encoding, done) { chunks.push(chunk), done(); }, stream._flush = function(done) { var self = this, data = Buffer.concat(chunks); try { fn(data, (function(err, result) { if (err) throw err; self.push(result); })); } catch (err) { self.push(data); } finally { done(); } }, stream; }, name: name }; } var json = parserFactory("json", (function(buffer, cb) { var err, data; try { data = JSON.parse(buffer); } catch (e) { err = e; } cb(err, data); })); module.exports["application/json"] = json, module.exports["text/javascript"] = json; try { var xml = parserFactory("xml", new (__webpack_require__(188).Parser)({ explicitRoot: !0, explicitArray: !1 }).parseString); module.exports["text/xml"] = xml, module.exports["application/xml"] = xml, module.exports["application/rdf+xml"] = xml, module.exports["application/rss+xml"] = xml, module.exports["application/atom+xml"] = xml; } catch (e) {} }, function(module, exports, __webpack_require__) { var iconv, inherits = __webpack_require__(0).inherits, stream = __webpack_require__(3), regex = /(?:charset|encoding)\s*=\s*['"]? *([\w\-]+)/i; function StreamDecoder(charset) { if (!(this instanceof StreamDecoder)) return new StreamDecoder(charset); stream.Transform.call(this, charset), this.charset = charset, this.parsed_chunk = !1; } inherits(StreamDecoder, stream.Transform), StreamDecoder.prototype._transform = function(chunk, encoding, done) { var res, found; if ("iso-8859-1" == this.charset && !this.parsed_chunk) { this.parsed_chunk = !0; var matches = regex.exec(chunk.toString()); matches && (found = matches[1].toLowerCase(), this.charset = "utf-8" == found ? "utf8" : found); } try { res = iconv.decode(chunk, this.charset); } catch (e) { res = chunk; } this.push(res), done(); }, module.exports = function(charset) { try { iconv || (iconv = __webpack_require__(66)); } catch (e) {} return iconv ? new StreamDecoder(charset) : new stream.PassThrough; }; }, function(module) { module.exports = { name: "needle", version: "1.6.0", description: "The leanest and most handsome HTTP client in the Nodelands.", keywords: [ "http", "https", "simple", "request", "client", "multipart", "upload", "proxy", "deflate", "timeout", "charset", "iconv", "cookie", "redirect" ], tags: [ "http", "https", "simple", "request", "client", "multipart", "upload", "proxy", "deflate", "timeout", "charset", "iconv", "cookie", "redirect" ], author: "Tomás Pollak ", repository: { type: "git", url: "https://github.com/tomas/needle.git" }, dependencies: { debug: "^2.1.2", "iconv-lite": "^0.4.4" }, devDependencies: { mocha: "", sinon: "", should: "", xml2js: "", JSONStream: "", q: "", jschardet: "" }, scripts: { test: "mocha test" }, directories: { lib: "./lib" }, main: "./lib/needle", bin: { needle: "./bin/needle" }, license: "MIT", engines: { node: ">= 0.10.x" } }; }, function(module, exports, __webpack_require__) { const path = __webpack_require__(5), consts = __webpack_require__(90), SUPPORTED_TYPES = [ "movie", "series" ]; function getFileVideoId(f) { return (f.season && f.episode ? [ f.imdb_id, f.season, f.episode ] : [ f.imdb_id ]).join(":"); } module.exports = function(storage, args, cb) { if (!args.id.startsWith(consts.PREFIX_IMDB) || !SUPPORTED_TYPES.includes(args.type)) return cb(null, { streams: [] }); const idSplit = args.id.split(":"), itemIdLocal = consts.PREFIX_LOCAL + idSplit[0], streams = []; if (storage.indexes.itemId.has(itemIdLocal)) { const entries = storage.indexes.itemId.get(itemIdLocal); for (var entry of entries.values()) { const f = entry.files[0]; args.type === f.type && args.id === getFileVideoId(f) && streams.push({ id: "file://" + f.path, url: "file://" + f.path, subtitle: consts.STREAM_LOCALFILE_SUBTITLE, title: path.basename(f.path) }); } } for (let k of storage.indexes.itemId.keys()) if (k.startsWith(consts.PREFIX_BT)) { const entry = storage.indexes.itemId.get(k).values().next().value; entry.files.forEach((function(f, i) { args.type === f.type && args.id === getFileVideoId(f) && streams.push({ title: path.basename(f.path), infoHash: entry.ih, fileIdx: i, id: entry.ih + "/" + i, sources: entry.sources }); })); } cb(null, { streams: streams }); }; }, function(module, exports, __webpack_require__) { const pkg = __webpack_require__(500); var fs = __webpack_require__(2), byline = __webpack_require__(102), promisify = __webpack_require__(0).promisify; module.exports = function(opts) { var writeStream, self = this; function commitEntry(key, entry) { self.indexes.primaryKey.set(key, entry), self.opts.entryIndexes.forEach((function(property) { entry[property] && (self.indexes[property].has(entry[property]) || self.indexes[property].set(entry[property], new Map), self.indexes[property].get(entry[property]).set(key, entry)); })); } function persistEntry(key, entry, cb) { if (!writeStream) return cb(new Error("unable to persist, no fd")); writeStream.write(JSON.stringify({ id: key, entry: entry, v: pkg.version }) + "\n", cb); } function onInternalErr(err) { console.error("storage", err); } this.opts = Object.assign({ entryIndexes: [], validateRecord: null }, opts), this.indexes = { primaryKey: new Map }, this.opts.entryIndexes.forEach((function(key) { self.indexes[key] = new Map; })), this.load = function(dbPath) { var truncate = !1, open = promisify(fs.open), close = promisify(fs.close); return open(dbPath, "a+").then((function(fd) { return new Promise((function(resolve) { fs.createReadStream(null, { fd: fd, autoClose: !1 }).on("error", onInternalErr).pipe(byline()).on("error", onInternalErr).on("data", (function(line) { var record; try { if ((record = JSON.parse(line.toString())).v !== pkg.version) throw "Version missmatch"; self.opts.validateRecord && self.opts.validateRecord(record.id, record.entry), commitEntry(record.id, record.entry); } catch (e) { truncate = !0; } })).on("finish", (function() { Promise.resolve().then((function() { return truncate ? close(fd).then((function() { return open(dbPath, "w"); })) : fd; })).then((function(fd) { (writeStream = fs.createWriteStream(null, { fd: fd, autoClose: !1 })).on("error", onInternalErr), truncate && self.indexes.primaryKey.forEach((function(entry, key) { persistEntry(key, entry); })); })).catch(onInternalErr).then(resolve); })); })); })); }, this.saveEntry = function(primaryKey, entry, cb) { if (self.indexes.primaryKey.has(primaryKey)) return cb(); commitEntry(primaryKey, entry), persistEntry(primaryKey, entry, cb); }, this.getAggrEntry = function(index, key, groups) { const items = this.indexes[index].get(key); if (!items) return null; let entry; return items.forEach((function(item) { if (entry) for (let group of groups) { if (void 0 === entry[group]) return; Array.isArray(entry[group]) || (entry[group] = [ entry[group] ]), entry[group] = entry[group].concat(item[group]); } else entry = Object.assign({}, item); })), entry; }; }; }, function(module, exports, __webpack_require__) { const os = __webpack_require__(23), findFilesWin = __webpack_require__(1081), findFilesDarwin = __webpack_require__(1082); let findFiles = __webpack_require__(1083); "win32" === os.platform() && (findFiles = findFilesWin), "darwin" === os.platform() && (findFiles = findFilesDarwin), module.exports = findFiles; }, function(module, exports, __webpack_require__) { const child = __webpack_require__(32), byline = __webpack_require__(102), events = __webpack_require__(4); module.exports = function() { const ev = new events.EventEmitter; var propsProc = child.spawn("powershell", [ "-command", "\n[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding\n$sql = \"SELECT System.ItemUrl FROM SystemIndex WHERE scope='file:' AND (System.Kind IS Null OR System.Kind = 'Video') AND System.FileAttributes <> ALL BITWISE 0x2 AND NOT System.ItemUrl LIKE '%/Program Files%' AND NOT System.ItemUrl LIKE '%/SteamLibrary/%' AND NOT System.ItemUrl LIKE '%/node_modules/%' AND (System.fileExtension = '.torrent' OR System.FileExtension = '.mp4' OR System.FileExtension = '.mkv' OR System.FileExtension = '.avi')\"\n$connector = New-Object -ComObject ADODB.Connection\n$rs = New-Object -ComObject ADODB.Recordset\n$connector.Open(\"Provider=Search.CollatorDSO;Extended Properties='Application=Windows';DateTimeFormat=Ticks;\")\n$rs.Open($sql, $connector)\nWhile (-Not $rs.EOF) {\n $pos = $rs.Fields.Item(\"System.ItemUrl\").Value.IndexOf(\":\")\n $rs.Fields.Item(\"System.ItemUrl\").Value.Substring($pos + 1)\n $rs.MoveNext()\n}\n" ]); return propsProc.on("error", (function(err) { ev.emit("err", err); })), propsProc.stdout.pipe(byline()).on("data", (function(line) { ev.emit("file", line.toString().trim()); })), propsProc.stderr.on("data", (function(chunk) { console.log("powershell search: " + chunk.toString()); })), propsProc.on("close", (function() { ev.emit("finished"); })), ev; }; }, function(module, exports, __webpack_require__) { const child = __webpack_require__(32), byline = __webpack_require__(102), events = __webpack_require__(4); module.exports = function() { const ev = new events.EventEmitter; var p = child.exec("mdfind '(kMDItemFSName=*.avi || kMDItemFSName=*.mp4 || kMDItemFSName=*.mkv || kMDItemFSName=*.torrent)'"); return p.on("error", (function(err) { ev.emit("err", err); })), p.stdout.pipe(byline()).on("data", (function(line) { ev.emit("file", line.toString().trim()); })), ev; }; }, function(module, exports, __webpack_require__) { const child = __webpack_require__(32), events = __webpack_require__(4), byline = __webpack_require__(102), which = __webpack_require__(1084), cmdLine = [ "-L", process.env.HOME, "-maxdepth", "7", "-not", "-path", "*/\\.*", "-not", "-path", "*/node_modules/*", "-not", "-path", "*/bin/*", "-not", "-path", "*/src/*", "-not", "-path", "*/build/*", "-not", "-path", "*/dist/*", "-type", "f", "(", "-iname", "*.torrent", "-o", "-iname", "*.mp4", "-o", "-iname", "*.mkv", "-o", "-iname", "*.avi", ")" ]; function startIndexing() { var ev = this; const findPath = which.sync("find"); if (findPath) { var p = child.spawn(findPath, cmdLine); p.on("error", (function(err) { ev.emit("err", err); })), p.stdout.pipe(byline()).on("data", (function(line) { ev.emit("file", line.toString().trim()); })).on("close", (function() { ev.emit("finished"); })); } else ev.emit("err", "find executable not found in PATH"); } module.exports = function() { const ev = new events.EventEmitter; return setImmediate(startIndexing.bind(ev)), ev; }; }, function(module, exports, __webpack_require__) { module.exports = which, which.sync = function(cmd, opt) { for (var info = getPathInfo(cmd, opt = opt || {}), pathEnv = info.env, pathExt = info.ext, pathExtExe = info.extExe, found = [], i = 0, l = pathEnv.length; i < l; i++) { var pathPart = pathEnv[i]; '"' === pathPart.charAt(0) && '"' === pathPart.slice(-1) && (pathPart = pathPart.slice(1, -1)); var p = path.join(pathPart, cmd); !pathPart && /^\.[\\\/]/.test(cmd) && (p = cmd.slice(0, 2) + p); for (var j = 0, ll = pathExt.length; j < ll; j++) { var cur = p + pathExt[j]; try { if (isexe.sync(cur, { pathExt: pathExtExe })) { if (!opt.all) return cur; found.push(cur); } } catch (ex) {} } } if (opt.all && found.length) return found; if (opt.nothrow) return null; throw getNotFoundError(cmd); }; var isWindows = "win32" === process.platform || "cygwin" === process.env.OSTYPE || "msys" === process.env.OSTYPE, path = __webpack_require__(5), COLON = isWindows ? ";" : ":", isexe = __webpack_require__(1085); function getNotFoundError(cmd) { var er = new Error("not found: " + cmd); return er.code = "ENOENT", er; } function getPathInfo(cmd, opt) { var colon = opt.colon || COLON, pathEnv = opt.path || process.env.PATH || "", pathExt = [ "" ]; pathEnv = pathEnv.split(colon); var pathExtExe = ""; return isWindows && (pathEnv.unshift(process.cwd()), pathExt = (pathExtExe = opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM").split(colon), -1 !== cmd.indexOf(".") && "" !== pathExt[0] && pathExt.unshift("")), (cmd.match(/\//) || isWindows && cmd.match(/\\/)) && (pathEnv = [ "" ]), { env: pathEnv, ext: pathExt, extExe: pathExtExe }; } function which(cmd, opt, cb) { "function" == typeof opt && (cb = opt, opt = {}); var info = getPathInfo(cmd, opt), pathEnv = info.env, pathExt = info.ext, pathExtExe = info.extExe, found = []; !(function F(i, l) { if (i === l) return opt.all && found.length ? cb(null, found) : cb(getNotFoundError(cmd)); var pathPart = pathEnv[i]; '"' === pathPart.charAt(0) && '"' === pathPart.slice(-1) && (pathPart = pathPart.slice(1, -1)); var p = path.join(pathPart, cmd); !pathPart && /^\.[\\\/]/.test(cmd) && (p = cmd.slice(0, 2) + p), (function E(ii, ll) { if (ii === ll) return F(i + 1, l); var ext = pathExt[ii]; isexe(p + ext, { pathExt: pathExtExe }, (function(er, is) { if (!er && is) { if (!opt.all) return cb(null, p + ext); found.push(p + ext); } return E(ii + 1, ll); })); })(0, pathExt.length); })(0, pathEnv.length); } }, function(module, exports, __webpack_require__) { var core; function isexe(path, options, cb) { if ("function" == typeof options && (cb = options, options = {}), !cb) { if ("function" != typeof Promise) throw new TypeError("callback not provided"); return new Promise((function(resolve, reject) { isexe(path, options || {}, (function(er, is) { er ? reject(er) : resolve(is); })); })); } core(path, options || {}, (function(er, is) { er && ("EACCES" === er.code || options && options.ignoreErrors) && (er = null, is = !1), cb(er, is); })); } __webpack_require__(2), core = "win32" === process.platform || global.TESTING_WINDOWS ? __webpack_require__(1086) : __webpack_require__(1087), module.exports = isexe, isexe.sync = function(path, options) { try { return core.sync(path, options || {}); } catch (er) { if (options && options.ignoreErrors || "EACCES" === er.code) return !1; throw er; } }; }, function(module, exports, __webpack_require__) { module.exports = isexe, isexe.sync = function(path, options) { return checkStat(fs.statSync(path), path, options); }; var fs = __webpack_require__(2); function checkStat(stat, path, options) { return !(!stat.isSymbolicLink() && !stat.isFile()) && (function(path, options) { var pathext = void 0 !== options.pathExt ? options.pathExt : process.env.PATHEXT; if (!pathext) return !0; if (-1 !== (pathext = pathext.split(";")).indexOf("")) return !0; for (var i = 0; i < pathext.length; i++) { var p = pathext[i].toLowerCase(); if (p && path.substr(-p.length).toLowerCase() === p) return !0; } return !1; })(path, options); } function isexe(path, options, cb) { fs.stat(path, (function(er, stat) { cb(er, !er && checkStat(stat, path, options)); })); } }, function(module, exports, __webpack_require__) { module.exports = isexe, isexe.sync = function(path, options) { return checkStat(fs.statSync(path), options); }; var fs = __webpack_require__(2); function isexe(path, options, cb) { fs.stat(path, (function(er, stat) { cb(er, !er && checkStat(stat, options)); })); } function checkStat(stat, options) { return stat.isFile() && (function(stat, options) { var mod = stat.mode, uid = stat.uid, gid = stat.gid, myUid = void 0 !== options.uid ? options.uid : process.getuid && process.getuid(), myGid = void 0 !== options.gid ? options.gid : process.getgid && process.getgid(), u = parseInt("100", 8), g = parseInt("010", 8); return mod & parseInt("001", 8) || mod & g && gid === myGid || mod & u && uid === myUid || mod & (u | g) && 0 === myUid; })(stat, options); } }, function(module, exports, __webpack_require__) { const nzbGrabber = __webpack_require__(1089), nzbParser = __webpack_require__(504), needle = __webpack_require__(73), mime = __webpack_require__(78), ee = __webpack_require__(4), stream = __webpack_require__(3), bodyParser = __webpack_require__(50), router = __webpack_require__(240)(), lzDecompress = __webpack_require__(77).decompressFromEncodedURIComponent, initEmitter = new ee, RXX_EXTENSION = "\\.R(\\d\\d?\\d?\\d?\\d?)|\\.RAR", PARTXX_GZIP_EXTENSION = "\\.TAR\\.GZ\\.(\\d\\d?\\d?\\d?\\d?)|\\.TGZ\\.(\\d\\d?\\d?\\d?\\d?)|\\.GZ|\\.TGZ", nntpUrlRegex = /(nntps?)\:\/\/(.*)\:(.*)\@(.*)\:([0-9]+)\/([0-9]+)/i; let ip = "127.0.0.1", port = 11470; const cryptojs = __webpack_require__(6), nodeMajorVersion = parseInt(process.version.split(".")[0].substring(1)); function subarray(buff, start, end) { return buff[nodeMajorVersion < 16 ? "slice" : "subarray"](start, end); } function fileRegexEndOnly(rgx) { return new RegExp(`${rgx}$|${rgx}"`, "i"); } function toFixedIfNecessary(value, dp) { return +parseFloat(value).toFixed(dp); } function parseNntpUrl(url) { const matches = url.match(nntpUrlRegex); return !!(matches || []).length && { protocol: matches[1], user: decodeURIComponent(matches[2]), pass: decodeURIComponent(matches[3]), host: matches[4], port: parseInt(matches[5]), conn: parseInt(matches[6]) }; } module.exports = { router: function() { const streams = {}, initKeys = {}; function getUniqueId() { const idStr = "" + Math.random().toString(16).slice(2); return streams[idStr] ? getUniqueId() : idStr; } function getOneSegmentBackbone(key, segment, backboneIdx, isDone, cb) { if (backboneIdx = backboneIdx || 0, !streams[key].backboneClient[backboneIdx] && streams[key].clientUrls[backboneIdx + 1] && (streams[key].backboneClient[backboneIdx] = new nzbGrabber(parseNntpUrl(streams[key].clientUrls[backboneIdx + 1]))), !streams[key].backboneClient[backboneIdx]) return console.log("no backbone available"), void cb("could not retrieve", null, null, isDone, segment.group, segment.article, segment.bytes, !0); streams[key].backboneClient[backboneIdx].grabSegments([ segment ], ((err, filename, chunk, done, group, article, bytes) => { err && "useless" !== err ? streams[key].clientUrls[backboneIdx + 2] ? getOneSegmentBackbone(key, segment, backboneIdx + 1, isDone, cb) : cb(err, filename, chunk, isDone, group, article, bytes, !0) : cb(err, filename, chunk, isDone, group, article, bytes); }), !1); } function getOne(key, segment, filename) { return new Promise(((resolve, reject) => { streams[key].client || (streams[key].client = new nzbGrabber(parseNntpUrl(streams[key].clientUrls[0]))); const controller = streams[key].client.grabSegments([ segment ], (function(err, filenameFromChunk, chunk, done, group, article, bytes, chunkIdx, noBackbones) { if (filename = filename || filenameFromChunk, err && "useless" !== err) return !noBackbones && streams[key].clientUrls.length > 1 && "nntp_nope" !== article ? void getOneSegmentBackbone(key, segment, 0, done, ((err, filenameFromChunk, chunk, done, group, article, bytes, notOnBackbones) => { notOnBackbones && (console.log("not on any backbones"), chunk = done ? new Buffer(lastChunkSize[filename]).fill(0) : chunkSize[filename] ? new Buffer(chunkSize[filename]).fill(0) : null, resolve({ err: null, filename: filename, chunk: chunk, done: done, group: group, article: article, bytes: bytes, noBackbones: noBackbones, chunkIdx: chunkIdx, isMissingPiece: !0 })), controller.pushFromBackbone(err, filenameFromChunk, chunk, done, group, article, bytes, chunkIdx); })) : (err = null, chunk = new Buffer(done ? lastChunkSize[filename] : chunkSize[filename]).fill(0), resolve({ err: err, filename: filename, chunk: chunk, done: done, group: group, article: article, bytes: bytes, noBackbones: noBackbones, chunkIdx: chunkIdx, isMissingPiece: !0 }), void controller.skipSegment(filenameFromChunk || filename, group, article, bytes, chunkIdx)); resolve({ err: err, filename: filenameFromChunk, chunk: chunk, done: done, group: group, article: article, bytes: bytes, noBackbones: noBackbones, isMissingPiece: !1 }); }), !1); })); } const fileSizes = {}, chunkSize = {}, lastChunkSize = {}; let firstSegment = null, lastSegment = null, timerRemoveFirst = null, timerRemoveLast = null; async function sendFile(key, filename, req, res) { if ("OPTIONS" === req.method && req.headers["access-control-request-headers"]) return res.writeHead(200, { "Access-Control-Allow-Origin": req.headers.origin, "Access-Control-Allow-Methods": "POST, GET, OPTIONS", "Access-Control-Allow-Headers": req.headers["access-control-request-headers"], "Access-Control-Max-Age": "1728000" }), res.end(); streams[key].fileSegments; const fileNames = streams[key].fileNames, size = fileSizes[filename], range = req.headers.range || null, mimeType = mime.lookup(filename); let start = null, end = null; if (range) { let parts = range.replace(/bytes=/, "").split("-"); if (start = parts[0], end = parts[1], start = parseInt(start, 10), end = end ? parseInt(end, 10) : size - 1, !isNaN(start) && isNaN(end) && (end = size - 1), isNaN(start) && !isNaN(end) && (start = size - end, end = size - 1), start >= size || end >= size || start < 0 || end < 0) return res.writeHead(416, { "Content-Range": `bytes */${size}` }), void res.end(); if (res.writeHead(200, { "Access-Control-Allow-Origin": req.headers.origin || "*", "Content-Range": `bytes ${start}-${end}/${size}`, "Accept-Ranges": "bytes", "Content-Length": end - start + 1 + "", "Content-Type": mimeType, "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" }), "HEAD" === req.method) return res.end(); if (filename === fileNames[0] && start < chunkSize[filename]) { if (firstSegment && end <= chunkSize[filename]) return res.write(subarray(firstSegment.chunk, start, end + 1)), res.end(), clearTimeout(timerRemoveFirst), void (timerRemoveFirst = setTimeout((() => { firstSegment = null; }), 5e3)); } else if (filename === fileNames[fileNames.length - 1] && lastSegment && start >= size - lastChunkSize[filename]) return res.write(subarray(lastSegment.chunk, lastChunkSize[filename] - (size - start), lastChunkSize[filename] - (size - end) + 1)), res.end(), clearTimeout(timerRemoveLast), void (timerRemoveLast = setTimeout((() => { lastSegment = null; }), 5e3)); } else if (res.writeHead(200, { "Access-Control-Allow-Origin": req.headers.origin || "*", "Content-Length": size + "", "Content-Type": mimeType, "Accept-Ranges": "bytes", "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" }), "HEAD" === req.method) return res.end(); let chunkBuffer = Buffer.alloc(0), bufferSize = 0, isDone = !1; const evEmitter = new ee, controller = (function(key, filename, range, cb) { let segments = [], offset = 0, firstSegmentOffset = 0, setFirstSegment = !1; function getBytes(segment) { return (function(segment) { const fileSegments = streams[key].fileSegments[filename], lastSegment = fileSegments[fileSegments.length - 1]; return `${lastSegment.group}.${lastSegment.article}` == `${segment.group}.${segment.article}`; })(segment) ? lastChunkSize[filename] : chunkSize[filename]; } if (range && (range.start || range.end)) for (const segment of streams[key].fileSegments[filename]) { const segBytes = getBytes(segment); if (range.end && offset >= range.end) break; offset + segBytes < range.start || (setFirstSegment || (firstSegmentOffset = offset, setFirstSegment = !0), segments.push(segment)), offset += segBytes; } else segments = streams[key].fileSegments[filename]; offset = firstSegmentOffset, streams[key].client || (streams[key].client = new nzbGrabber(parseNntpUrl(streams[key].clientUrls[0]))); const controller = streams[key].client.grabSegments(segments, (function(err, filenameFromChunk, chunk, done, group, article, bytes, chunkIdx, noBackbones) { if (err) { if ("useless" !== err) { if (!noBackbones && streams[key].clientUrls.length > 1) return void getOneSegmentBackbone(key, { group: group, article: article, bytes: bytes }, 0, done, ((err, filenameFromChunk, chunk, done, group, article, bytes, notOnBackbones) => { notOnBackbones && (console.log("not on any backbones"), done ? chunk = new Buffer(lastChunkSize[filename]).fill(0) : chunkSize[filename] && (chunk = new Buffer(chunkSize[filename]).fill(0)), cb({ err: null, filename: filename, chunk: chunk, done: done, group: group, article: article, bytes: bytes, noBackbones: noBackbones, isMissingPiece: !0 })), controller.pushFromBackbone(err, filenameFromChunk, chunk, done, group, article, bytes, chunkIdx); })); err = null, chunk = done ? new Buffer(lastChunkSize[filename]).fill(0) : new Buffer(chunkSize[filename]).fill(0), cb({ err: err, filename: filename, chunk: chunk, done: done, group: group, article: article, bytes: bytes, noBackbones: noBackbones, isMissingPiece: !0 }), controller.skipSegment(filenameFromChunk || filename, group, article, bytes, chunkIdx); } } else { if (!chunk) return void cb(null); if (bytes = chunk.length, range && (range.start || range.end)) { const startPart = range.start - offset >= 0 ? range.start - offset : 0; let endPart; range.end && (endPart = range.end - offset < bytes ? range.end - offset : bytes), 0 === startPart && (!endPart || endPart >= bytes) || (chunk = !endPart || endPart >= bytes ? subarray(chunk, startPart) : subarray(chunk, startPart, endPart)); } offset += bytes, cb({ err: err, filename: filenameFromChunk, chunk: chunk, done: done, group: group, article: article, bytes: bytes, noBackbones: noBackbones, isMissingPiece: !1 }); } }), !0); return controller; })(key, filename, start || end ? { start: start, end: end + 1 } : null, (resp => { resp.chunk && (bufferSize += resp.chunk.length, chunkBuffer = Buffer.concat([ chunkBuffer, resp.chunk ], bufferSize), evEmitter.emit("chunk")), resp.done ? isDone = !0 : 31457280 > bufferSize && controller.pause(); })); req.on("close", (function() { controller.stop(), chunkBuffer = null; })), res.on("finish", (function() { controller.stop(), chunkBuffer = null; })); let stopped = !1; const readable = new stream.Readable; readable._read = async () => { if (stopped || isDone && !bufferSize) readable.push(null); else { let data = null; try { data = await (async function() { return new Promise(((resolve, reject) => { function answerBuffer(chkBuffer) { resolve(chkBuffer), chunkBuffer = Buffer.alloc(0), bufferSize = 0, controller.resume(); } bufferSize ? answerBuffer(chunkBuffer) : (controller.resume(), evEmitter.addListener("chunk", (function chunked() { answerBuffer(chunkBuffer), evEmitter.removeListener("chunk", chunked); }))); })); })(); } catch (e) { return console.error(e), void (readable.destroy ? readable.destroy() : (readable.unpipe(), readable._destroy())); } readable.push(data); } }, readable._destroy = () => { stopped = !0; }, readable.pipe(res).on("error", (err => { console.log("pipeline error", err), readable.destroy ? readable.destroy() : (readable.unpipe(), readable._destroy()); })); } router.use(bodyParser.json()); const creatingKey = {}; async function createKeyHandler(req, res) { let clientUrls = !1, nzbUrl = !1, lzKey = !1; if ("POST" === req.method) { if (!(req.body && req.body.servers && Array.isArray(req.body.servers) && req.body.servers.length && req.body.nzbUrl)) return void res.status(500).send("Cannot parse JSON data, err 1"); clientUrls = req.body.servers, nzbUrl = req.body.nzbUrl; } else { if (!req.query.lz) return void res.status(500).send("Cannot parse JSON data, err 2"); let lzData = !1; try { lzData = JSON.parse(lzDecompress(req.query.lz)); } catch (e) {} if (!lzData) return void res.status(500).send("Cannot parse JSON data, err 3"); if (txt = req.query.lz, lzKey = cryptojs.createHash("sha256").update(txt).digest("hex"), (streams[lzKey] || {}).missingInitPieces) return res.statusCode = 500, void res.end(); if (creatingKey[lzKey]) { try { await waitForKeyData(req, lzKey); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } return (streams[lzKey] || {}).missingInitPieces ? (res.statusCode = 500, void res.end()) : void res.redirect(initKeys[`init-${lzKey}`].serverPath); } creatingKey[lzKey] = !0, clientUrls = lzData.servers, nzbUrl = lzData.nzbUrl; } var txt; if (!clientUrls || !nzbUrl) return void res.status(500).send("Cannot parse JSON data, err 3"); const key = lzKey || req.params.createKey || getUniqueId(); if (streams[key] && streams[key].streamUrl) return delete creatingKey[key], void res.redirect(streams[key].streamUrl); function disableStreamMissingPieces(filename, pieceLoc) { delete creatingKey[key], streams[key].missingInitPieces = !0, initEmitter.emit(`init-${key}`), res.status(500).send(`Missing ${pieceLoc ? pieceLoc + " " : ""}piece${filename ? ' of "' + filename + '"' : ""}, breaking connection`); } async function getFileSize(filename) { const fileSegments = streams[key].fileSegments, fileNames = streams[key].fileNames || []; if (!chunkSize[filename]) { let firstSeg = null; try { firstSeg = await getOne(key, fileSegments[filename][0], filename); } catch (e) { return console.error(e), console.error(Error(`Error fetching first segment of file "${filename}", breaking connection`)), null; } if (firstSeg.isMissingPiece) return console.error(Error(`Missing piece for first segment of file "${filename}", breaking connection`)), null; fileNames[0] === filename && (firstSegment = firstSeg, timerRemoveFirst = setTimeout((() => { firstSegment = null; }), 7e3)), chunkSize[filename] = firstSeg.chunk.length; } if (!lastChunkSize[filename]) { let lastSeg = null; try { lastSeg = await getOne(key, fileSegments[filename][fileSegments[filename].length - 1], filename); } catch (e) { return console.error(e), console.error(Error(`Error fetching last segment of file "${filename}", breaking connection`)), null; } if (lastSeg.isMissingPiece) return console.error(Error(`Missing piece for last segment of file "${filename}", breaking connection`)), null; fileNames[fileNames.length - 1] === filename && (lastSegment = lastSeg, timerRemoveLast = setTimeout((() => { lastSegment = null; }), 7e3)), lastChunkSize[filename] = lastSeg.chunk.length; } return fileSizes[filename] || (fileSizes[filename] = (fileSegments[filename].length - 1) * chunkSize[filename] + lastChunkSize[filename]), fileSizes[filename]; } streams[key] = { clientUrls: clientUrls, nzbUrl: nzbUrl.split("&").join("&"), client: !1, backboneClient: [] }, needle.get(streams[key].nzbUrl, ((err, resp, body) => { nzbParser(body.toString(), (async (err, files) => { if (delete streams[key].nzbUrl, err) return void res.status(500).send((err || {}).message || "Unknown error"); function fileDetect(type, REGEX_ARR, fileSegments) { const file = fileSegments.find((el => !!(el || {})[type])); return !!file && !!REGEX_ARR.map((el => fileRegexEndOnly(el))).find((REGEX => file[type].match(REGEX))); } let interestingFiles = files.filter(fileDetect.bind(null, "subject", [ "\\.PART(\\d\\d?\\d?\\d?\\d?)\\.RAR", RXX_EXTENSION, "\\.7Z\\.(\\d\\d?\\d?\\d?\\d?)|\\.7Z", "\\.Z(\\d\\d?\\d?\\d?\\d?)|\\.ZIP", "\\.TAR.(\\d\\d?\\d?\\d?\\d?)|\\.TAR", PARTXX_GZIP_EXTENSION ])), isVideoFile = !1; if (interestingFiles.length || (interestingFiles = files.filter(fileDetect.bind(null, "subject", [ "\\.(MKV|MP4|AVI|TS)" ])), interestingFiles.length && (isVideoFile = !0)), !interestingFiles.length) { const allFileSegments = {}; files.forEach((el => { allFileSegments[el[0].subject] = el; })); for (let i = 0; i < files.length; i++) { let nntpFileData = null; try { nntpFileData = await getOne(key, files[i][0]); } catch (e) { return console.error(e), void disableStreamMissingPieces(files[i][0], "first"); } if (nntpFileData.isMissingPiece) return console.error(Error(`Missing piece for first segment of file "${files[i][0].subject}", breaking connection`)), void disableStreamMissingPieces(files[i][0].subject, "first"); nntpFileData.filename && files[i].forEach((el => { el.filename = nntpFileData.filename; })); } if (interestingFiles = files.filter(fileDetect.bind(null, "filename", [ "\\.PART(\\d\\d?\\d?\\d?\\d?)\\.RAR", RXX_EXTENSION, "\\.7Z\\.(\\d\\d?\\d?\\d?\\d?)|\\.7Z", "\\.Z(\\d\\d?\\d?\\d?\\d?)|\\.ZIP", "\\.TAR.(\\d\\d?\\d?\\d?\\d?)|\\.TAR", PARTXX_GZIP_EXTENSION ])), interestingFiles.length || (interestingFiles = files.filter(fileDetect.bind(null, "filename", [ "\\.(MKV|MP4|AVI|TS)" ])), interestingFiles.length && (isVideoFile = !0)), !interestingFiles.length) return void res.status(500).send("no interesting files"); } let totalPieces = 0, missingPieces = 0; for (var i = 0; interestingFiles[i]; i++) { if (!interestingFiles[i][0] || !interestingFiles[i][interestingFiles[i].length - 1]) return console.log("missing initial pieces from a file in nzb metadata"), void disableStreamMissingPieces(); for (var k = 0; k < interestingFiles[i].length; k++) if (totalPieces++, !interestingFiles[i][k]) { missingPieces++; const availablePiece = interestingFiles[i].find((el => !!el)); if (!availablePiece) return console.log("missing all pieces for a file from nzb metadata"), void disableStreamMissingPieces(); interestingFiles[i][k] = { group: availablePiece.group, article: "nntp_nope", bytes: availablePiece.bytes, subject: "nntp_nope" }; } } if (missingPieces / totalPieces > .02) return console.log("availability is " + toFixedIfNecessary(missingPieces / totalPieces * 100, 2) + "%"), console.error(Error("more than 2% of pieces are missing, breaking connection")), void disableStreamMissingPieces(); missingPieces && console.log("warning: missing " + toFixedIfNecessary(missingPieces / totalPieces * 100, 2) + "% pieces but attempting to play anyway (under 2% threshold)"); const httpPrefix = `http://${ip}:${port}/nzb/stream/${key}/`; let fileSegments = {}; function fileMatcher(rgx, el) { const REGEX = (function(rgx) { return new RegExp(`^${rgx}$|"${rgx}"`, "i"); })(rgx); let name = el[0].filename; if (!name) { const nameMatches = el[0].subject.match(REGEX); name = nameMatches && nameMatches.length >= 1 ? nameMatches[1] || nameMatches[5] : null; } return fileSegments[name] = el, name; } function fileSorter(REGEX, def, first, second) { const firstMatch = first.match(REGEX), secondMatch = second.match(REGEX); return +(firstMatch && firstMatch[1] || def || 0) - +(secondMatch && secondMatch[1] || def || 0); } const firstFileSubject = interestingFiles[0][0].filename || interestingFiles[0][0].subject; let fileNames = []; if (isVideoFile) { fileNames = interestingFiles.map(fileMatcher.bind(null, "((.*)(\\.(MKV|MP4|AVI|TS)))")), streams[key].fileSegments = fileSegments, streams[key].fileNames = fileNames, streams[key].client || (streams[key].client = new nzbGrabber(parseNntpUrl(streams[key].clientUrls[0]))); let firstFileSize = null; try { firstFileSize = await getFileSize(fileNames[0]); } catch (e) { console.error(e); } if (!firstFileSize) return void disableStreamMissingPieces(fileNames[0], "first"); let lastFileSize = null; try { lastFileSize = await getFileSize(fileNames[fileNames.length - 1]); } catch (e) { console.error(e); } if (!lastFileSize) return void disableStreamMissingPieces(fileNames[fileNames.length - 1], "last"); for (let i = 0; fileNames[i]; i++) chunkSize[fileNames[i]] || (chunkSize[fileNames[i]] = chunkSize[fileNames[0]]), lastChunkSize[fileNames[i]] || (lastChunkSize[fileNames[i]] = lastChunkSize[fileNames[0]]), fileSizes[fileNames[i]] || (fileSizes[fileNames[i]] = fileSizes[fileNames[0]]); return streams[key].streamUrl = `/nzb/stream/${key}/${encodeURIComponent(fileNames[0])}`, initKeys[`init-${key}`] = { serverPath: streams[key].streamUrl }, initEmitter.emit(`init-${key}`), void ("POST" === req.method ? (res.setHeader("Content-Length", JSON.stringify({ key: key }).length + ""), res.setHeader("Content-Type", "application/json"), res.end(JSON.stringify({ key: key }))) : (delete creatingKey[key], res.redirect(streams[key].streamUrl))); } let archiveType = null; function firstFileMatch(rgx) { const REGEX = fileRegexEndOnly(rgx); return !!firstFileSubject.match(REGEX); } if (firstFileMatch("\\.7Z\\.(\\d\\d?\\d?\\d?\\d?)|\\.7Z")) archiveType = "7zip", fileNames = interestingFiles.map(fileMatcher.bind(null, "((.*)(\\.7Z\\.(\\d\\d?\\d?\\d?\\d?)|\\.7Z))")).sort(fileSorter.bind(null, /\.7Z\.(\d\d?\d?\d?\d?)$/i, 0)); else if (firstFileMatch("\\.Z(\\d\\d?\\d?\\d?\\d?)|\\.ZIP")) archiveType = "zip", fileNames = interestingFiles.map(fileMatcher.bind(null, "((.*)(\\.Z(\\d\\d?\\d?\\d?\\d?)|\\.ZIP))")).sort(fileSorter.bind(null, /\.Z(\d\d?\d?\d?\d?)$/i, 99999)); else if (firstFileMatch("\\.PART(\\d\\d?\\d?\\d?\\d?)\\.RAR")) archiveType = "rar", fileNames = interestingFiles.map(fileMatcher.bind(null, "((.*)(\\.PART(\\d\\d?\\d?\\d?\\d?)\\.RAR))")).sort(fileSorter.bind(null, /\.PART(\d\d?\d?\d?\d?)\.RAR$/i, 0)); else if (firstFileMatch(RXX_EXTENSION)) archiveType = "rar", fileNames = interestingFiles.map(fileMatcher.bind(null, `((.*)(${RXX_EXTENSION}))`)).sort(((first, second) => first.match(fileRegexEndOnly("\\.RAR")) ? -1 : second.match(fileRegexEndOnly("\\.RAR")) ? 1 : fileSorter(/\.R(\d\d?\d?\d?\d?)$/i, 0, first, second))); else if (firstFileMatch("\\.TAR.(\\d\\d?\\d?\\d?\\d?)|\\.TAR")) archiveType = "tar", fileNames = interestingFiles.map(fileMatcher.bind(null, "((.*)(\\.TAR.(\\d\\d?\\d?\\d?\\d?)|\\.TAR))")).sort(fileSorter.bind(null, /\.TAR\.(\d\d?\d?\d?\d?)$/i, 0)); else { if (!firstFileMatch(PARTXX_GZIP_EXTENSION)) return void res.status(500).send("missing rar files in nzb file"); archiveType = "tgz", fileNames = interestingFiles.map(fileMatcher.bind(null, `((.*)(${PARTXX_GZIP_EXTENSION}))`)).sort(fileSorter.bind(null, /\.(\d\d?\d?\d?\d?)$/i, 0)); } streams[key].fileSegments = fileSegments, streams[key].fileNames = fileNames, streams[key].client || (streams[key].client = new nzbGrabber(parseNntpUrl(streams[key].clientUrls[0]))); let firstFileSize = null; try { firstFileSize = await getFileSize(fileNames[0]); } catch (e) { console.error(e); } if (!firstFileSize) return void disableStreamMissingPieces(fileNames[0], "first"); let lastFileSize = null; try { lastFileSize = await getFileSize(fileNames[fileNames.length - 1]); } catch (e) { console.error(e); } if (!lastFileSize) return void disableStreamMissingPieces(fileNames[fileNames.length - 1], "last"); for (let i = 0; fileNames[i]; i++) chunkSize[fileNames[i]] || (chunkSize[fileNames[i]] = chunkSize[fileNames[0]]), lastChunkSize[fileNames[i]] || (lastChunkSize[fileNames[i]] = lastChunkSize[fileNames[0]]), fileSizes[fileNames[i]] || (fileSizes[fileNames[i]] = fileSizes[fileNames[0]]); const archiveArr = fileNames.map((el => ({ url: `${httpPrefix}${encodeURIComponent(el)}`, bytes: fileSizes[el] }))); streams[key].streamUrl = `/${archiveType}/stream?key=${key}`, initKeys[`init-${key}`] = { serverPath: streams[key].streamUrl }, initEmitter.emit(`init-${key}`), needle.post(`http://${ip}:${port}/${archiveType}/create/${key}`, archiveArr, { json: !0 }, ((err, resp, body) => {})), "POST" === req.method ? (res.setHeader("Content-Length", JSON.stringify({ key: key }).length + ""), res.setHeader("Content-Type", "application/json"), res.end(JSON.stringify({ key: key }))) : (delete creatingKey[key], res.redirect(streams[key].streamUrl)); })); })); } router.post("/create/:createKey", createKeyHandler), router.all("/create", createKeyHandler); let countStreams = {}, closeTimer = {}; function waitForKeyData(req, forceKey) { return new Promise(((resolve, reject) => { const key = `init-${forceKey || req.query.key}`; key ? initKeys[key] ? resolve(key) : initEmitter.addListener(key, (function gotData() { initEmitter.removeListener(key, gotData), resolve(key); })) : reject(Error("No stream key provided")); })); } return router.get("/stream/:key/:fileName", (async (req, res) => { sendFile(req.params.key, req.params.fileName, req, res); const reqKey = req.params.key; countStreams[reqKey] ? countStreams[reqKey]++ : countStreams[reqKey] = 1, req.on("close", (function() { countStreams[reqKey]--, countStreams[reqKey] || (closeTimer[reqKey] && clearTimeout(closeTimer[reqKey]), closeTimer[reqKey] = setTimeout((() => { if (!countStreams[reqKey] && (console.log("closing all connections for nntp engine", reqKey), streams[reqKey].client && streams[reqKey].client.closeAllConns(), streams[reqKey].clientUrls.length > 1)) for (let k = 0; k < streams[reqKey].clientUrls.length - 1; k++) streams[reqKey].backboneClient[k] && streams[reqKey].backboneClient[k].closeAllConns(); }), 3e4)); })); })), router.get("/stream", (async (req, res) => { try { await waitForKeyData(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } res.redirect(initKeys[`init-${req.query.key}`].serverPath); })), router; }, setIP: i => { ip = i; }, setPort: p => { port = p; } }; }, function(module, exports, __webpack_require__) { var NNTPWorker, NzbGrabber, nzb, yenc; __webpack_require__(243), __webpack_require__(244), NNTPWorker = __webpack_require__(1102), nzb = __webpack_require__(504), yenc = __webpack_require__(1115), subscriber = __webpack_require__(1117), NzbGrabber = (function() { const selectionIds = {}, requestIds = {}; let lastSelectionId = ""; function getSelectionId() { const idStr = "" + Math.random().toString(16).slice(2); return selectionIds[idStr] ? getSelectionId() : idStr; } function getChunkId() { const idStr = "" + Math.random().toString(16).slice(2); return requestIds[idStr] ? getChunkId() : idStr; } function NzbGrabber(opts) { var self, workers; if (this.opts = opts, !this.opts.conn) throw "No conections"; workers = function() { var k, ref, results; for (results = [], k = 0, ref = this.opts.conn; 0 <= ref ? k < ref : k > ref; 0 <= ref ? ++k : --k) results.push(new NNTPWorker(this.opts)); return results; }.call(this), self = this, this.queue = { next: function() { var article, callback, group, bytes, k, len, task, worker; let selIds = Object.keys(selectionIds); if (!selIds.length) return; let qId = selIds[0]; if (lastSelectionId && lastSelectionId !== selIds[selIds.length - 1] || !selectionIds[qId].length) { let afterLast = !1; selIds.some((selId => selId === lastSelectionId ? (afterLast = !0, !1) : !(!afterLast || !selectionIds[selId].length || (qId = selId, 0)))); } if (lastSelectionId = qId, task = selectionIds[qId][0]) for (group = task[0], article = task[1], bytes = task[2], callback = task[3], k = 0, len = workers.length; k < len; k++) if ("BUSY" !== (worker = workers[k]).state) return selectionIds[qId].shift(), worker.getArticle(group, article, (function(err, code, buffer) { return callback(err, buffer, group, article, bytes), self.queue.next(); })); }, push: function(chunk, callback) { return selectionIds[chunk.selectionId].push([ chunk.group, chunk.article, chunk.bytes, callback, chunk.reqId ]), self.queue.next(); }, clear: function(selectionId) { delete selectionIds[selectionId]; }, getWorkers: function() { return workers; } }; } return NzbGrabber.prototype.grabSegments = function(segs, cb, pushAll, requestId) { var selectionId = getSelectionId(); selectionIds[selectionId] = []; var self = this, stopped = !1; requestId = requestId || subscriber.expected(segs); var cache, chunks, filename, todo = 0; filename = null, cache = [], todo += chunks = segs.length; var chunkIds = [], fileChunks = segs.slice(), chunk = fileChunks.shift(), nextIdx = 0; function nextChunk(i) { if (!stopped && fileChunks.length) return pushChunk(fileChunks.shift(), i); } function pushChunk(chunk, i) { chunk ? (subscriber.subscribe(requestId, chunk.group, chunk.article, (function(err, buffer, group, article, bytes) { var decoded, item, j, ref; if (!stopped) if (!err && buffer) { if (ref = yenc(buffer), filename = ref[0], decoded = ref[1], cache[i] = decoded, chunks -= 1, filename) for (j = 0; cache[j]; ) { if (item = cache[j], j += 1, "boolean" == typeof item) continue; 1 !== segs.length && segs.length; const isDone = !(todo -= 1); isDone && delete selectionIds[selectionId], cb(null, filename, item, isDone, group, article, bytes, j - 1), cache[j - 1] = !0; } else if (!chunks) return cache = null, pushAll || nextChunk(i + 1), cb("useless"); pushAll || nextChunk(i + 1); } else cb(err || "unknown error", null, null, !1, group, article, bytes, i); })), chunk.reqId = getChunkId(), chunk.selectionId = selectionId, requestIds[chunk.reqId] = !0, chunkIds.push(chunk.reqId), self.queue.push(chunk, (function(err, buffer, group, article, bytes) { chunkIds.splice(chunkIds.indexOf(chunk.reqId), 1), delete requestIds[chunk.reqId], subscriber.pushSegment(err, buffer, group, article, bytes); }))) : pushAll || nextChunk(i + 1); } if (pushAll) { pushChunk(chunk, 0); for (var idx = 1; fileChunks.length; ) nextChunk(idx), idx++; } else pushChunk(chunk, 0); let holdQueue = !1; const controller = { stop: () => { stopped = !0, self.queue.clear(selectionId); }, pause: () => { selectionIds[selectionId] && (holdQueue = selectionIds[selectionId], delete selectionIds[selectionId]); }, resume: () => { stopped || (pushAll ? holdQueue && (selectionIds[selectionId] = holdQueue, holdQueue = !1, controller.resumeQueue()) : fileChunks.length && nextChunk(nextIdx)); }, skipSegment: (filename, group, article, bytes, skipIdx) => { console.log("skip piece nr", skipIdx), cache[skipIdx] = !0, nextIdx = 1, chunks -= 1; for (var j = 0; cache[j]; ) { if (item = cache[j], j += 1, "boolean" == typeof item) continue; seg = "", 1 !== segs.length && (seg = " (" + j + "/" + segs.length + ")"); const isDone = !(todo -= 1); isDone && delete selectionIds[selectionId], cb(null, filename, item, isDone, group, article, bytes, j - 1), cache[j - 1] = !0; } controller.resumeQueue(); }, resumeQueue: () => { self.queue.next(); for (let i = 1; i < self.opts.conn; i++) setTimeout((() => { self.queue.next(); })); }, pushFromBackbone: (err, filename, chunk, done, group, article, bytes, chunkIdx) => { if (!err && chunk) { if (cache[chunkIdx] = chunk, chunks -= 1, filename) { for (j = 0; cache[j]; ) { if (item = cache[j], j += 1, "boolean" == typeof item) continue; seg = "", 1 !== segs.length && (seg = " (" + j + "/" + segs.length + ")"); const isDone = !(todo -= 1); isDone && delete selectionIds[selectionId], cb(null, filename, item, isDone, group, article, bytes, j - 1), cache[j - 1] = !0; } controller.resumeQueue(); } else if (!chunks) return cache = null, pushAll || nextChunk(1), cb("useless", null, null, null, group, article, bytes, chunkIdx); } else controller.skipSegment(filename, group, article, bytes, chunkIdx); } }; return controller; }, NzbGrabber.prototype.parse = nzb, NzbGrabber.prototype.closeAllConns = function() { for (var workers = this.queue.getWorkers(), k = 0; workers[k]; k++) workers[k].close(); }, NzbGrabber; })(), module.exports = NzbGrabber; }, function(module, exports, __webpack_require__) { __webpack_require__(1091); var util = __webpack_require__(0), level = "debug", LEVELS = { debug: 1, info: 2, error: 3, critical: 4 }, EXCLUDES = [ "password" ], WHITELIST = [], BLACKLIST = [], logging = exports; function getStamp() { var date = new Date; return [ "[", [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ][date.getDay()], " ", date.getFullYear(), "-", date.getMonth() + 1, "-", date.getDate(), " ", date.getHours(), ":", date.getMinutes(), ":", date.getSeconds(), ".", date.getMilliseconds(), " GMT", date.getTimezoneOffset() / 60, "]" ].join("").grey; } function prettyPrintObj(o, excludes) { if (excludes = void 0 === excludes ? EXCLUDES : excludes, !o || "object" != typeof o || !Object.keys(o).length) return "*".grey + " " + "n/a".green + "\n"; var rows = []; return Object.keys(o).forEach((function(key) { var value; value = excludes.length && excludes.indexOf(key) < 0 ? null === o[key] ? "null".grey : void 0 === o[key] ? "undefined".grey : o[key].toString() : "(excluded)".grey, rows.push("*".grey + " " + key.green + ": " + value); })), rows.join("\n") + "\n"; } function log(msg, flag, minlvl, trace, block) { LEVELS[level] > LEVELS[minlvl] || (msg = (function(msg) { return WHITELIST.length || BLACKLIST.length ? !WHITELIST.length && BLACKLIST.length ? (BLACKLIST.forEach((function(r) { msg = msg.replace(r, ""); })), msg) : (WHITELIST.forEach((function(r) { var badUniqueChars = []; msg.split(r).forEach((function(c) { c.length && -1 === badUniqueChars.indexOf(c) && badUniqueChars.push(c); })), badUniqueChars.forEach((function(c) { msg = msg.replace(new RegExp(c.replace(/\\/g, "\\\\").replace(/\./g, "\\."), "gm"), ""); })); })), msg) : msg; })(msg), (block = block || !1) ? util.debug(getStamp() + " " + flag + ": " + msg) : console.log(getStamp() + " " + flag + ": " + msg), trace && console.trace()); } function convertToRegExp(arr) { var regexes = []; return arr.forEach((function(r) { "string" == typeof r ? "/" === r[0] && "/" === a.slice(-1) ? regexes.push(new RegExp(r.slice(0, -1), "gm")) : regexes.push(new RegExp(r, "gm")) : r instanceof RegExp && regexes.push(new RegExp(r.source, "gm")); })), regexes; } logging.pretty = prettyPrintObj, logging.setLevel = function(lvl) { level = Object.keys(LEVELS).indexOf(level) < 0 ? "info" : lvl; }, logging.setBlacklist = function(blacklist) { Array.isArray(blacklist) && (BLACKLIST = convertToRegExp(blacklist)); }, logging.setWhitelist = function(whitelist) { Array.isArray(whitelist) && (WHITELIST = convertToRegExp(whitelist)); }, logging.setExcludes = function(excludes) { EXCLUDES = excludes; }, logging.inf = function(msg, trace) { log(msg, "INF".bold.green, "info", trace); }, logging.dbg = function(msg, trace) { log(msg, "DBG".bold.yellow, "debug", trace); }, logging.err = function(msg, trace) { log(msg, "ERR".bold.red, "error", trace); }, logging.bad = function(msg, trace) { log(msg.toString().red.bold, "BAD".bold.red.inverse, "critical", trace, !0); }, logging.inspect = function(obj, trace) { logging.debug(utils.inspect(obj, !0, null), trace); }, logging.startTimer = function() { var startTime = (new Date).getTime(); return function(msg, trace) { msg = msg + " " + ("(took " + ((new Date).getTime() - startTime) + "ms)").yellow, logging.dbg(msg, trace); }; }, logging.requestLogger = function(req, res, next) { var connectionDetails, terminated = !1, startTime = (new Date).getTime(), log = "Request for ".green.bold + (req.method + " " + req.url.toString()).yellow.bold + "\n\n", memoryUsage = process.memoryUsage(), userMessages = [], socket = req.connection.socket; function completeLog() { if (!terminated) { var endTime = (new Date).getTime(); log += "Request details:\n".cyan.bold, log += "\n", log += "Path parameters:\n".cyan.italic, log += prettyPrintObj(req.params) + "\n", log += "Query parameters:\n".cyan.italic, log += prettyPrintObj(req.query) + "\n", log += "Request body:\n".cyan.italic, log += prettyPrintObj(req.body) + "\n", log += "==/\n\n".cyan.bold, Object.keys(memoryUsage).forEach((function(key) { var i; memoryUsage[key] = (i = memoryUsage[key]) > 1073741824 ? Math.round(i / 1073741824 * 100) / 100 + " GiB" : i > 1048576 ? Math.round(i / 1048576 * 100) / 100 + " MiB" : Math.round(i / 1024 * 100) / 100 + " KiB"; })), log += "Request headers:\n".cyan.bold, log += prettyPrintObj(req.headers), log += "==/\n\n".cyan.bold, log += "Response headers:\n".cyan.bold, log += prettyPrintObj(res._headers), log += "==/\n\n".cyan.bold, connectionDetails = { address: socket && socket.remoteAddress || "n/a", port: socket && socket.remotePort || "n/a", HTTP: req.httpVersionMajor + "." + req.httpVersionMinor, SSL: req.connection.encrypted ? "yes" : "no", socket: socket && socket.type || "n/a", "open connections": socket && socket.server && socket.server.connections || "n/a" }, log += "Connection details:\n".cyan.bold, log += prettyPrintObj(connectionDetails), log += "==/\n\n".cyan.bold, log += "Memory usage:\n".cyan.bold, log += prettyPrintObj(memoryUsage), log += "==/\n\n".cyan.bold, userMessages.length && (log += "User messages:\n".cyan.bold, userMessages.forEach((function(message) { log += "*".grey + " " + message + "\n"; })), log += "\n"), log += "Total request time: ".cyan.bold, log += (endTime - startTime + "ms\n").yellow.bold, (log = res.statusCode.toString().red + " " + log) && logging.dbg(log); } } req.log = {}, req.log.startTimer = function(name) { var time = (new Date).getTime(); req.log["end" + name] = function(msg) { var start = time - startTime, end = (new Date).getTime() - startTime; time = (new Date).getTime() - time, userMessages.push(("(" + start + "ms -> " + end + "ms)").yellow.bold + " " + msg.toString().green + " " + ("(took " + time + "ms)").yellow); }; }, req.log.push = function(msg) { var start = (new Date).getTime() - startTime; userMessages.push(("(" + start + "ms)").yellow.bold + " " + msg.toString().green); }, req.log.inspect = function(msg, obj) { var start = (new Date).getTime() - startTime; userMessages.push(("(" + start + "ms)").yellow.bold + " " + msg.toString().green + ":\n" + util.inspect(obj, !0, null)); }, res.on("finish", completeLog), req.log.terminate = function(msg) { log = "[TERM] ".red.bold + log, userMessages.push("TERMINATED:".red.bold + msg.yellow.bold + "\n"), completeLog(), terminated = !0; }, next(); }; }, function(module, exports, __webpack_require__) { var colors = __webpack_require__(503); module.exports = colors, __webpack_require__(1101)(); }, function(module, exports) { var styles = {}; module.exports = styles; var codes = { reset: [ 0, 0 ], bold: [ 1, 22 ], dim: [ 2, 22 ], italic: [ 3, 23 ], underline: [ 4, 24 ], inverse: [ 7, 27 ], hidden: [ 8, 28 ], strikethrough: [ 9, 29 ], black: [ 30, 39 ], red: [ 31, 39 ], green: [ 32, 39 ], yellow: [ 33, 39 ], blue: [ 34, 39 ], magenta: [ 35, 39 ], cyan: [ 36, 39 ], white: [ 37, 39 ], gray: [ 90, 39 ], grey: [ 90, 39 ], brightRed: [ 91, 39 ], brightGreen: [ 92, 39 ], brightYellow: [ 93, 39 ], brightBlue: [ 94, 39 ], brightMagenta: [ 95, 39 ], brightCyan: [ 96, 39 ], brightWhite: [ 97, 39 ], bgBlack: [ 40, 49 ], bgRed: [ 41, 49 ], bgGreen: [ 42, 49 ], bgYellow: [ 43, 49 ], bgBlue: [ 44, 49 ], bgMagenta: [ 45, 49 ], bgCyan: [ 46, 49 ], bgWhite: [ 47, 49 ], bgGray: [ 100, 49 ], bgGrey: [ 100, 49 ], bgBrightRed: [ 101, 49 ], bgBrightGreen: [ 102, 49 ], bgBrightYellow: [ 103, 49 ], bgBrightBlue: [ 104, 49 ], bgBrightMagenta: [ 105, 49 ], bgBrightCyan: [ 106, 49 ], bgBrightWhite: [ 107, 49 ], blackBG: [ 40, 49 ], redBG: [ 41, 49 ], greenBG: [ 42, 49 ], yellowBG: [ 43, 49 ], blueBG: [ 44, 49 ], magentaBG: [ 45, 49 ], cyanBG: [ 46, 49 ], whiteBG: [ 47, 49 ] }; Object.keys(codes).forEach((function(key) { var val = codes[key], style = styles[key] = []; style.open = "[" + val[0] + "m", style.close = "[" + val[1] + "m"; })); }, function(module, exports, __webpack_require__) { "use strict"; var os = __webpack_require__(23), hasFlag = __webpack_require__(1094), env = process.env, forceColor = void 0; function getSupportLevel(stream) { var level = (function(stream) { if (!1 === forceColor) return 0; if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3; if (hasFlag("color=256")) return 2; if (stream && !stream.isTTY && !0 !== forceColor) return 0; var min = forceColor ? 1 : 0; if ("win32" === process.platform) { var osRelease = os.release().split("."); return Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ? Number(osRelease[2]) >= 14931 ? 3 : 2 : 1; } if ("CI" in env) return [ "TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI" ].some((function(sign) { return sign in env; })) || "codeship" === env.CI_NAME ? 1 : min; if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; if ("TERM_PROGRAM" in env) { var version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": return version >= 3 ? 3 : 2; case "Hyper": return 3; case "Apple_Terminal": return 2; } } return /-256(color)?$/i.test(env.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM) || "COLORTERM" in env ? 1 : (env.TERM, min); })(stream); return (function(level) { return 0 !== level && { level: level, hasBasic: !0, has256: level >= 2, has16m: level >= 3 }; })(level); } hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") ? forceColor = !1 : (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) && (forceColor = !0), "FORCE_COLOR" in env && (forceColor = 0 === env.FORCE_COLOR.length || 0 !== parseInt(env.FORCE_COLOR, 10)), module.exports = { supportsColor: getSupportLevel, stdout: getSupportLevel(process.stdout), stderr: getSupportLevel(process.stderr) }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(flag, argv) { var terminatorPos = (argv = argv || process.argv).indexOf("--"), prefix = /^-{1,2}/.test(flag) ? "" : "--", pos = argv.indexOf(prefix + flag); return -1 !== pos && (-1 === terminatorPos || pos < terminatorPos); }; }, function(module, exports) { module.exports = function(text, options) { var result = ""; text = (text = text || "Run the trap, drop the bass").split(""); var trap = { a: [ "@", "Ą", "Ⱥ", "Ʌ", "Δ", "Λ", "Д" ], b: [ "ß", "Ɓ", "Ƀ", "ɮ", "β", "฿" ], c: [ "©", "Ȼ", "Ͼ" ], d: [ "Ð", "Ɗ", "Ԁ", "ԁ", "Ԃ", "ԃ" ], e: [ "Ë", "ĕ", "Ǝ", "ɘ", "Σ", "ξ", "Ҽ", "੬" ], f: [ "Ӻ" ], g: [ "ɢ" ], h: [ "Ħ", "ƕ", "Ң", "Һ", "Ӈ", "Ԋ" ], i: [ "༏" ], j: [ "Ĵ" ], k: [ "ĸ", "Ҡ", "Ӄ", "Ԟ" ], l: [ "Ĺ" ], m: [ "ʍ", "Ӎ", "ӎ", "Ԡ", "ԡ", "൩" ], n: [ "Ñ", "ŋ", "Ɲ", "Ͷ", "Π", "Ҋ" ], o: [ "Ø", "õ", "ø", "Ǿ", "ʘ", "Ѻ", "ם", "۝", "๏" ], p: [ "Ƿ", "Ҏ" ], q: [ "্" ], r: [ "®", "Ʀ", "Ȑ", "Ɍ", "ʀ", "Я" ], s: [ "§", "Ϟ", "ϟ", "Ϩ" ], t: [ "Ł", "Ŧ", "ͳ" ], u: [ "Ʊ", "Ս" ], v: [ "ט" ], w: [ "Ш", "Ѡ", "Ѽ", "൰" ], x: [ "Ҳ", "Ӿ", "Ӽ", "ӽ" ], y: [ "¥", "Ұ", "Ӌ" ], z: [ "Ƶ", "ɀ" ] }; return text.forEach((function(c) { c = c.toLowerCase(); var chars = trap[c] || [ " " ], rand = Math.floor(Math.random() * chars.length); result += void 0 !== trap[c] ? trap[c][rand] : c; })), result; }; }, function(module, exports) { module.exports = function(text, options) { text = text || " he is here "; var soul = { up: [ "̍", "̎", "̄", "̅", "̿", "̑", "̆", "̐", "͒", "͗", "͑", "̇", "̈", "̊", "͂", "̓", "̈", "͊", "͋", "͌", "̃", "̂", "̌", "͐", "̀", "́", "̋", "̏", "̒", "̓", "̔", "̽", "̉", "ͣ", "ͤ", "ͥ", "ͦ", "ͧ", "ͨ", "ͩ", "ͪ", "ͫ", "ͬ", "ͭ", "ͮ", "ͯ", "̾", "͛", "͆", "̚" ], down: [ "̖", "̗", "̘", "̙", "̜", "̝", "̞", "̟", "̠", "̤", "̥", "̦", "̩", "̪", "̫", "̬", "̭", "̮", "̯", "̰", "̱", "̲", "̳", "̹", "̺", "̻", "̼", "ͅ", "͇", "͈", "͉", "͍", "͎", "͓", "͔", "͕", "͖", "͙", "͚", "̣" ], mid: [ "̕", "̛", "̀", "́", "͘", "̡", "̢", "̧", "̨", "̴", "̵", "̶", "͜", "͝", "͞", "͟", "͠", "͢", "̸", "̷", "͡", " ҉" ] }, all = [].concat(soul.up, soul.down, soul.mid); function randomNumber(range) { return Math.floor(Math.random() * range); } function isChar(character) { var bool = !1; return all.filter((function(i) { bool = i === character; })), bool; } return (function(text, options) { var counts, l, result = ""; for (l in (options = options || {}).up = void 0 === options.up || options.up, options.mid = void 0 === options.mid || options.mid, options.down = void 0 === options.down || options.down, options.size = void 0 !== options.size ? options.size : "maxi", text = text.split("")) if (!isChar(l)) { switch (result += text[l], counts = { up: 0, down: 0, mid: 0 }, options.size) { case "mini": counts.up = randomNumber(8), counts.mid = randomNumber(2), counts.down = randomNumber(8); break; case "maxi": counts.up = randomNumber(16) + 3, counts.mid = randomNumber(4) + 1, counts.down = randomNumber(64) + 3; break; default: counts.up = randomNumber(8) + 1, counts.mid = randomNumber(6) / 2, counts.down = randomNumber(8) + 1; } var arr = [ "up", "mid", "down" ]; for (var d in arr) for (var index = arr[d], i = 0; i <= counts[index]; i++) options[index] && (result += soul[index][randomNumber(soul[index].length)]); } return result; })(text, options); }; }, function(module, exports) { module.exports = function(colors) { return function(letter, i, exploded) { if (" " === letter) return letter; switch (i % 3) { case 0: return colors.red(letter); case 1: return colors.white(letter); case 2: return colors.blue(letter); } }; }; }, function(module, exports) { module.exports = function(colors) { return function(letter, i, exploded) { return i % 2 == 0 ? letter : colors.inverse(letter); }; }; }, function(module, exports) { module.exports = function(colors) { var rainbowColors = [ "red", "yellow", "green", "blue", "magenta" ]; return function(letter, i, exploded) { return " " === letter ? letter : colors[rainbowColors[i++ % rainbowColors.length]](letter); }; }; }, function(module, exports) { module.exports = function(colors) { var available = [ "underline", "inverse", "grey", "yellow", "red", "green", "blue", "white", "cyan", "magenta", "brightYellow", "brightRed", "brightGreen", "brightBlue", "brightWhite", "brightCyan", "brightMagenta" ]; return function(letter, i, exploded) { return " " === letter ? letter : colors[available[Math.round(Math.random() * (available.length - 2))]](letter); }; }; }, function(module, exports, __webpack_require__) { var colors = __webpack_require__(503); module.exports = function() { var addProperty = function(color, func) { String.prototype.__defineGetter__(color, func); }; addProperty("strip", (function() { return colors.strip(this); })), addProperty("stripColors", (function() { return colors.strip(this); })), addProperty("trap", (function() { return colors.trap(this); })), addProperty("zalgo", (function() { return colors.zalgo(this); })), addProperty("zebra", (function() { return colors.zebra(this); })), addProperty("rainbow", (function() { return colors.rainbow(this); })), addProperty("random", (function() { return colors.random(this); })), addProperty("america", (function() { return colors.america(this); })), Object.keys(colors.styles).forEach((function(style) { addProperty(style, (function() { return colors.stylize(this, style); })); })), colors.setTheme = function(theme) { "string" != typeof theme ? (function(theme) { var stringPrototypeBlacklist = [ "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "charAt", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf", "charCodeAt", "indexOf", "lastIndexOf", "length", "localeCompare", "match", "repeat", "replace", "search", "slice", "split", "substring", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toUpperCase", "trim", "trimLeft", "trimRight" ]; Object.keys(theme).forEach((function(prop) { if (-1 !== stringPrototypeBlacklist.indexOf(prop)) console.log("warn: ".red + ("String.prototype" + prop).magenta + " is probably something you don't want to override. Ignoring style name"); else if ("string" == typeof theme[prop]) colors[prop] = colors[theme[prop]], addProperty(prop, (function() { return colors[prop](this); })); else { var themePropApplicator = function(str) { for (var ret = str || this, t = 0; t < theme[prop].length; t++) ret = colors[theme[prop][t]](ret); return ret; }; addProperty(prop, themePropApplicator), colors[prop] = function(str) { return themePropApplicator(str); }; } })); })(theme) : console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));"); }; }; }, function(module, exports, __webpack_require__) { var NNTPWorker, async, id, net, bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; }; net = __webpack_require__(39), tls = __webpack_require__(70), __webpack_require__(244), __webpack_require__(3), async = __webpack_require__(243), id = 0, NNTPWorker = (function() { function NNTPWorker(opts) { var self; this.opts = opts, this.onData = bind(this.onData, this), this.connect = bind(this.connect, this), self = this, this.id = id++, this.callbacks = (function() { var q; return q = [], { call: function(code, res) { var item; if (item = q.shift()) { if ("function" != typeof item) throw "Callback is not a function"; return item(self.error, code, res); } }, add: function(callback) { return q.push(callback); } }; })(); } return NNTPWorker.prototype.state = "OFFLINE", NNTPWorker.prototype.error = null, NNTPWorker.prototype.group = null, NNTPWorker.prototype.connect = function(cb) { var self; return self = this, this.callbacks.add((function() { if (self.opts.user || self.opts.pass) return async.waterfall([ function(cb) { return self.mode = "MESSAGE", self.sendCommand("AUTHINFO USER " + self.opts.user, 381, cb); }, function(code, res, cb) { return self.mode = "MESSAGE", self.sendCommand("AUTHINFO PASS " + self.opts.pass, 2, cb); } ], (function(err) { return err && (self.error = err), cb(null); })); cb(null); })), this.mode = "MESSAGE", "nntps" === this.opts.protocol ? this.client = tls.connect({ host: this.opts.host, port: this.opts.port, rejectUnauthorized: !1 }, (function() {})) : this.client = net.connect({ host: this.opts.host, port: this.opts.port }, (function() {})), this.client.on("end", (function() {})), this.client.on("error", (function(err) { return self.error = err; })), this.client.on("timeout", (function() {})), this.client.on("close", (function() { if ("OFFLINE" !== self.state) return self.ready = 0, self.group = null, self.client && self.client.destroy(), self.state = "OFFLINE", self.client = null; })), this.client.on("data", this.onData); }, NNTPWorker.prototype.close = function() { "OFFLINE" !== this.state && (this.ready = 0, this.group = null, this.client.destroy(), this.state = "OFFLINE", this.client = null); }, NNTPWorker.prototype.sendCommand = function(command, expected, callback) { var i, p, pattern, ref; if ("function" == typeof expected) callback = expected, expected = null; else { for (i in pattern = [ "\\d", "\\d", "\\d" ], ref = String(expected).split("")) p = ref[i], pattern[i] = p; expected = new RegExp("^" + pattern.join("") + "$"); } return expected ? this.callbacks.add((function(err, code, buffer) { return err ? callback(err) : code.match(expected) ? callback(null, code, buffer) : callback(code + " does not match " + expected); })) : this.callbacks.add(callback), this.code = null, this.client.write(command + "\r\n"); }, NNTPWorker.prototype.onData = function(buffer) { var getCode, isArticleEnd, length, removeHeaders, res; switch (getCode = function() { return buffer.toString("ascii", 0, 3); }, isArticleEnd = function() { var length; return length = buffer.length, "\r\n.\r\n" === buffer.toString("ascii", length - 5); }, removeHeaders = function(input) { var length; return length = input.length, input.slice(input.indexOf("\r\n\r\n") + 4, length - 3); }, this.mode) { case "MESSAGE": return length = buffer.length, res = buffer.slice(0, length - 2), this.callbacks.call(getCode(), res); case "ARTICLE_BEGIN": return this.code = getCode(), "430" === this.code ? (this.state = "READY", void this.callbacks.call(this.code, null)) : isArticleEnd() ? (this.state = "READY", this.callbacks.call(this.code, removeHeaders(buffer))) : (this.mode = "ARTICLE_CONTINUE", this.article = [ buffer ]); case "ARTICLE_CONTINUE": if (this.article.push(buffer), isArticleEnd()) return this.state = "READY", this.callbacks.call(this.code, removeHeaders(Buffer.concat(this.article))); } }, NNTPWorker.prototype.getArticle = function(group, article, cb) { var self, sendArticle, sendGroup, steps; return self = this, sendGroup = function(cb) { return self.mode = "MESSAGE", self.group = group, self.sendCommand("GROUP " + group, 2, (function() { return cb(null); })); }, sendArticle = function(cb) { return article.match(/^<(\S*)>$/) || (article = "<" + article + ">"), self.mode = "ARTICLE_BEGIN", self.sendCommand("ARTICLE " + article, 2, cb); }, steps = "OFFLINE" === this.state ? [ this.connect, sendGroup, sendArticle ] : this.group !== group ? [ sendGroup, sendArticle ] : [ sendArticle ], this.state = "BUSY", async.waterfall(steps, cb); }, NNTPWorker; })(), module.exports = NNTPWorker; }, function(module, exports, __webpack_require__) { (function() { "use strict"; var builder, defaults, parser, processors, hasProp = {}.hasOwnProperty; defaults = __webpack_require__(245), builder = __webpack_require__(1104), parser = __webpack_require__(1113), processors = __webpack_require__(511), exports.defaults = defaults.defaults, exports.processors = processors, exports.ValidationError = (function(superClass) { function ValidationError(message) { this.message = message; } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(ValidationError, Error), ValidationError; })(), exports.Builder = builder.Builder, exports.Parser = parser.Parser, exports.parseString = parser.parseString, exports.parseStringPromise = parser.parseStringPromise; }).call(this); }, function(module, exports, __webpack_require__) { (function() { "use strict"; var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty; builder = __webpack_require__(1105), defaults = __webpack_require__(245).defaults, requiresCDATA = function(entry) { return "string" == typeof entry && (entry.indexOf("&") >= 0 || entry.indexOf(">") >= 0 || entry.indexOf("<") >= 0); }, wrapCDATA = function(entry) { return ""; }, escapeCDATA = function(entry) { return entry.replace("]]>", "]]]]>"); }, exports.Builder = (function() { function Builder(opts) { var key, ref, value; for (key in this.options = {}, ref = defaults[.2]) hasProp.call(ref, key) && (value = ref[key], this.options[key] = value); for (key in opts) hasProp.call(opts, key) && (value = opts[key], this.options[key] = value); } return Builder.prototype.buildObject = function(rootObj) { var attrkey, charkey, render, rootElement, rootName, _this; return attrkey = this.options.attrkey, charkey = this.options.charkey, 1 === Object.keys(rootObj).length && this.options.rootName === defaults[.2].rootName ? rootObj = rootObj[rootName = Object.keys(rootObj)[0]] : rootName = this.options.rootName, _this = this, render = function(element, obj) { var attr, child, entry, index, key, value; if ("object" != typeof obj) _this.options.cdata && requiresCDATA(obj) ? element.raw(wrapCDATA(obj)) : element.txt(obj); else if (Array.isArray(obj)) { for (index in obj) if (hasProp.call(obj, index)) for (key in child = obj[index]) entry = child[key], element = render(element.ele(key), entry).up(); } else for (key in obj) if (hasProp.call(obj, key)) if (child = obj[key], key === attrkey) { if ("object" == typeof child) for (attr in child) value = child[attr], element = element.att(attr, value); } else if (key === charkey) element = _this.options.cdata && requiresCDATA(child) ? element.raw(wrapCDATA(child)) : element.txt(child); else if (Array.isArray(child)) for (index in child) hasProp.call(child, index) && (element = "string" == typeof (entry = child[index]) ? _this.options.cdata && requiresCDATA(entry) ? element.ele(key).raw(wrapCDATA(entry)).up() : element.ele(key, entry).up() : render(element.ele(key), entry).up()); else "object" == typeof child ? element = render(element.ele(key), child).up() : "string" == typeof child && _this.options.cdata && requiresCDATA(child) ? element = element.ele(key).raw(wrapCDATA(child)).up() : (null == child && (child = ""), element = element.ele(key, child.toString()).up()); return element; }, rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, { headless: this.options.headless, allowSurrogateChars: this.options.allowSurrogateChars }), render(rootElement, rootObj).end(this.options.renderOpts); }, Builder; })(); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref; ref = __webpack_require__(52), assign = ref.assign, isFunction = ref.isFunction, XMLDOMImplementation = __webpack_require__(505), XMLDocument = __webpack_require__(506), XMLDocumentCB = __webpack_require__(1111), XMLStringWriter = __webpack_require__(259), XMLStreamWriter = __webpack_require__(1112), NodeType = __webpack_require__(22), WriterState = __webpack_require__(161), module.exports.create = function(name, xmldec, doctype, options) { var doc, root; if (null == name) throw new Error("Root element needs a name."); return options = assign({}, xmldec, doctype, options), root = (doc = new XMLDocument(options)).element(name), options.headless || (doc.declaration(options), null == options.pubID && null == options.sysID || doc.dtd(options)), root; }, module.exports.begin = function(options, onData, onEnd) { var ref1; return isFunction(options) && (onData = (ref1 = [ options, onData ])[0], onEnd = ref1[1], options = {}), onData ? new XMLDocumentCB(options, onData, onEnd) : new XMLDocument(options); }, module.exports.stringWriter = function(options) { return new XMLStringWriter(options); }, module.exports.streamWriter = function(stream, options) { return new XMLStreamWriter(stream, options); }, module.exports.implementation = new XMLDOMImplementation, module.exports.nodeType = NodeType, module.exports.writerState = WriterState; }).call(this); }, function(module, exports, __webpack_require__) { (function() { var XMLDOMErrorHandler, XMLDOMStringList; XMLDOMErrorHandler = __webpack_require__(1107), XMLDOMStringList = __webpack_require__(1108), module.exports = (function() { function XMLDOMConfiguration() { this.defaultParams = { "canonical-form": !1, "cdata-sections": !1, comments: !1, "datatype-normalization": !1, "element-content-whitespace": !0, entities: !0, "error-handler": new XMLDOMErrorHandler, infoset: !0, "validate-if-schema": !1, namespaces: !0, "namespace-declarations": !0, "normalize-characters": !1, "schema-location": "", "schema-type": "", "split-cdata-sections": !0, validate: !1, "well-formed": !0 }, this.params = Object.create(this.defaultParams); } return Object.defineProperty(XMLDOMConfiguration.prototype, "parameterNames", { get: function() { return new XMLDOMStringList(Object.keys(this.defaultParams)); } }), XMLDOMConfiguration.prototype.getParameter = function(name) { return this.params.hasOwnProperty(name) ? this.params[name] : null; }, XMLDOMConfiguration.prototype.canSetParameter = function(name, value) { return !0; }, XMLDOMConfiguration.prototype.setParameter = function(name, value) { return null != value ? this.params[name] = value : delete this.params[name]; }, XMLDOMConfiguration; })(); }).call(this); }, function(module, exports) { (function() { module.exports = (function() { function XMLDOMErrorHandler() {} return XMLDOMErrorHandler.prototype.handleError = function(error) { throw new Error(error); }, XMLDOMErrorHandler; })(); }).call(this); }, function(module, exports) { (function() { module.exports = (function() { function XMLDOMStringList(arr) { this.arr = arr || []; } return Object.defineProperty(XMLDOMStringList.prototype, "length", { get: function() { return this.arr.length; } }), XMLDOMStringList.prototype.item = function(index) { return this.arr[index] || null; }, XMLDOMStringList.prototype.contains = function(str) { return -1 !== this.arr.indexOf(str); }, XMLDOMStringList; })(); }).call(this); }, function(module, exports) { (function() { module.exports = (function() { function XMLNodeList(nodes) { this.nodes = nodes; } return Object.defineProperty(XMLNodeList.prototype, "length", { get: function() { return this.nodes.length || 0; } }), XMLNodeList.prototype.clone = function() { return this.nodes = null; }, XMLNodeList.prototype.item = function(index) { return this.nodes[index] || null; }, XMLNodeList; })(); }).call(this); }, function(module, exports) { (function() { module.exports = { Disconnected: 1, Preceding: 2, Following: 4, Contains: 8, ContainedBy: 16, ImplementationSpecific: 32 }; }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref, hasProp = {}.hasOwnProperty; ref = __webpack_require__(52), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue, NodeType = __webpack_require__(22), XMLDocument = __webpack_require__(506), XMLElement = __webpack_require__(246), XMLCData = __webpack_require__(248), XMLComment = __webpack_require__(249), XMLRaw = __webpack_require__(256), XMLText = __webpack_require__(257), XMLProcessingInstruction = __webpack_require__(258), XMLDeclaration = __webpack_require__(250), XMLDocType = __webpack_require__(251), XMLDTDAttList = __webpack_require__(252), XMLDTDEntity = __webpack_require__(253), XMLDTDElement = __webpack_require__(254), XMLDTDNotation = __webpack_require__(255), XMLAttribute = __webpack_require__(507), XMLStringifier = __webpack_require__(509), XMLStringWriter = __webpack_require__(259), WriterState = __webpack_require__(161), module.exports = (function() { function XMLDocumentCB(options, onData, onEnd) { var writerOptions; this.name = "?xml", this.type = NodeType.Document, options || (options = {}), writerOptions = {}, options.writer ? isPlainObject(options.writer) && (writerOptions = options.writer, options.writer = new XMLStringWriter) : options.writer = new XMLStringWriter, this.options = options, this.writer = options.writer, this.writerOptions = this.writer.filterOptions(writerOptions), this.stringify = new XMLStringifier(options), this.onDataCallback = onData || function() {}, this.onEndCallback = onEnd || function() {}, this.currentNode = null, this.currentLevel = -1, this.openTags = {}, this.documentStarted = !1, this.documentCompleted = !1, this.root = null; } return XMLDocumentCB.prototype.createChildNode = function(node) { var att, attName, attributes, child, i, len, ref1, ref2; switch (node.type) { case NodeType.CData: this.cdata(node.value); break; case NodeType.Comment: this.comment(node.value); break; case NodeType.Element: for (attName in attributes = {}, ref1 = node.attribs) hasProp.call(ref1, attName) && (att = ref1[attName], attributes[attName] = att.value); this.node(node.name, attributes); break; case NodeType.Dummy: this.dummy(); break; case NodeType.Raw: this.raw(node.value); break; case NodeType.Text: this.text(node.value); break; case NodeType.ProcessingInstruction: this.instruction(node.target, node.value); break; default: throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name); } for (i = 0, len = (ref2 = node.children).length; i < len; i++) child = ref2[i], this.createChildNode(child), child.type === NodeType.Element && this.up(); return this; }, XMLDocumentCB.prototype.dummy = function() { return this; }, XMLDocumentCB.prototype.node = function(name, attributes, text) { var ref1; if (null == name) throw new Error("Missing node name."); if (this.root && -1 === this.currentLevel) throw new Error("Document can only have one root node. " + this.debugInfo(name)); return this.openCurrent(), name = getValue(name), null == attributes && (attributes = {}), attributes = getValue(attributes), isObject(attributes) || (text = (ref1 = [ attributes, text ])[0], attributes = ref1[1]), this.currentNode = new XMLElement(this, name, attributes), this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, null != text && this.text(text), this; }, XMLDocumentCB.prototype.element = function(name, attributes, text) { var child, i, len, oldValidationFlag, ref1, root; if (this.currentNode && this.currentNode.type === NodeType.DocType) this.dtdElement.apply(this, arguments); else if (Array.isArray(name) || isObject(name) || isFunction(name)) for (oldValidationFlag = this.options.noValidation, this.options.noValidation = !0, (root = new XMLDocument(this.options).element("TEMP_ROOT")).element(name), this.options.noValidation = oldValidationFlag, i = 0, len = (ref1 = root.children).length; i < len; i++) child = ref1[i], this.createChildNode(child), child.type === NodeType.Element && this.up(); else this.node(name, attributes, text); return this; }, XMLDocumentCB.prototype.attribute = function(name, value) { var attName, attValue; if (!this.currentNode || this.currentNode.children) throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name)); if (null != name && (name = getValue(name)), isObject(name)) for (attName in name) hasProp.call(name, attName) && (attValue = name[attName], this.attribute(attName, attValue)); else isFunction(value) && (value = value.apply()), this.options.keepNullAttributes && null == value ? this.currentNode.attribs[name] = new XMLAttribute(this, name, "") : null != value && (this.currentNode.attribs[name] = new XMLAttribute(this, name, value)); return this; }, XMLDocumentCB.prototype.text = function(value) { var node; return this.openCurrent(), node = new XMLText(this, value), this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.cdata = function(value) { var node; return this.openCurrent(), node = new XMLCData(this, value), this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.comment = function(value) { var node; return this.openCurrent(), node = new XMLComment(this, value), this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.raw = function(value) { var node; return this.openCurrent(), node = new XMLRaw(this, value), this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.instruction = function(target, value) { var i, insTarget, insValue, len, node; if (this.openCurrent(), null != target && (target = getValue(target)), null != value && (value = getValue(value)), Array.isArray(target)) for (i = 0, len = target.length; i < len; i++) insTarget = target[i], this.instruction(insTarget); else if (isObject(target)) for (insTarget in target) hasProp.call(target, insTarget) && (insValue = target[insTarget], this.instruction(insTarget, insValue)); else isFunction(value) && (value = value.apply()), node = new XMLProcessingInstruction(this, target, value), this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); return this; }, XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) { var node; if (this.openCurrent(), this.documentStarted) throw new Error("declaration() must be the first node."); return node = new XMLDeclaration(this, version, encoding, standalone), this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) { if (this.openCurrent(), null == root) throw new Error("Missing root node name."); if (this.root) throw new Error("dtd() must come before the root node."); return this.currentNode = new XMLDocType(this, pubID, sysID), this.currentNode.rootNodeName = root, this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, this; }, XMLDocumentCB.prototype.dtdElement = function(name, value) { var node; return this.openCurrent(), node = new XMLDTDElement(this, name, value), this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { var node; return this.openCurrent(), node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue), this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.entity = function(name, value) { var node; return this.openCurrent(), node = new XMLDTDEntity(this, !1, name, value), this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.pEntity = function(name, value) { var node; return this.openCurrent(), node = new XMLDTDEntity(this, !0, name, value), this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.notation = function(name, value) { var node; return this.openCurrent(), node = new XMLDTDNotation(this, name, value), this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this; }, XMLDocumentCB.prototype.up = function() { if (this.currentLevel < 0) throw new Error("The document node has no parent."); return this.currentNode ? (this.currentNode.children ? this.closeNode(this.currentNode) : this.openNode(this.currentNode), this.currentNode = null) : this.closeNode(this.openTags[this.currentLevel]), delete this.openTags[this.currentLevel], this.currentLevel--, this; }, XMLDocumentCB.prototype.end = function() { for (;this.currentLevel >= 0; ) this.up(); return this.onEnd(); }, XMLDocumentCB.prototype.openCurrent = function() { if (this.currentNode) return this.currentNode.children = !0, this.openNode(this.currentNode); }, XMLDocumentCB.prototype.openNode = function(node) { var att, chunk, name, ref1; if (!node.isOpen) { if (this.root || 0 !== this.currentLevel || node.type !== NodeType.Element || (this.root = node), chunk = "", node.type === NodeType.Element) { for (name in this.writerOptions.state = WriterState.OpenTag, chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<" + node.name, ref1 = node.attribs) hasProp.call(ref1, name) && (att = ref1[name], chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel)); chunk += (node.children ? ">" : "/>") + this.writer.endline(node, this.writerOptions, this.currentLevel), this.writerOptions.state = WriterState.InsideTag; } else this.writerOptions.state = WriterState.OpenTag, chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ""), chunk += this.writer.endline(node, this.writerOptions, this.currentLevel); return this.onData(chunk, this.currentLevel), node.isOpen = !0; } }, XMLDocumentCB.prototype.closeNode = function(node) { var chunk; if (!node.isClosed) return "", this.writerOptions.state = WriterState.CloseTag, chunk = node.type === NodeType.Element ? this.writer.indent(node, this.writerOptions, this.currentLevel) + "" + this.writer.endline(node, this.writerOptions, this.currentLevel) : this.writer.indent(node, this.writerOptions, this.currentLevel) + "]>" + this.writer.endline(node, this.writerOptions, this.currentLevel), this.writerOptions.state = WriterState.None, this.onData(chunk, this.currentLevel), node.isClosed = !0; }, XMLDocumentCB.prototype.onData = function(chunk, level) { return this.documentStarted = !0, this.onDataCallback(chunk, level + 1); }, XMLDocumentCB.prototype.onEnd = function() { return this.documentCompleted = !0, this.onEndCallback(); }, XMLDocumentCB.prototype.debugInfo = function(name) { return null == name ? "" : "node: <" + name + ">"; }, XMLDocumentCB.prototype.ele = function() { return this.element.apply(this, arguments); }, XMLDocumentCB.prototype.nod = function(name, attributes, text) { return this.node(name, attributes, text); }, XMLDocumentCB.prototype.txt = function(value) { return this.text(value); }, XMLDocumentCB.prototype.dat = function(value) { return this.cdata(value); }, XMLDocumentCB.prototype.com = function(value) { return this.comment(value); }, XMLDocumentCB.prototype.ins = function(target, value) { return this.instruction(target, value); }, XMLDocumentCB.prototype.dec = function(version, encoding, standalone) { return this.declaration(version, encoding, standalone); }, XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) { return this.doctype(root, pubID, sysID); }, XMLDocumentCB.prototype.e = function(name, attributes, text) { return this.element(name, attributes, text); }, XMLDocumentCB.prototype.n = function(name, attributes, text) { return this.node(name, attributes, text); }, XMLDocumentCB.prototype.t = function(value) { return this.text(value); }, XMLDocumentCB.prototype.d = function(value) { return this.cdata(value); }, XMLDocumentCB.prototype.c = function(value) { return this.comment(value); }, XMLDocumentCB.prototype.r = function(value) { return this.raw(value); }, XMLDocumentCB.prototype.i = function(target, value) { return this.instruction(target, value); }, XMLDocumentCB.prototype.att = function() { return this.currentNode && this.currentNode.type === NodeType.DocType ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments); }, XMLDocumentCB.prototype.a = function() { return this.currentNode && this.currentNode.type === NodeType.DocType ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments); }, XMLDocumentCB.prototype.ent = function(name, value) { return this.entity(name, value); }, XMLDocumentCB.prototype.pent = function(name, value) { return this.pEntity(name, value); }, XMLDocumentCB.prototype.not = function(name, value) { return this.notation(name, value); }, XMLDocumentCB; })(); }).call(this); }, function(module, exports, __webpack_require__) { (function() { var NodeType, WriterState, XMLWriterBase, hasProp = {}.hasOwnProperty; NodeType = __webpack_require__(22), XMLWriterBase = __webpack_require__(510), WriterState = __webpack_require__(161), module.exports = (function(superClass) { function XMLStreamWriter(stream, options) { this.stream = stream, XMLStreamWriter.__super__.constructor.call(this, options); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(XMLStreamWriter, superClass), XMLStreamWriter.prototype.endline = function(node, options, level) { return node.isLastRootNode && options.state === WriterState.CloseTag ? "" : XMLStreamWriter.__super__.endline.call(this, node, options, level); }, XMLStreamWriter.prototype.document = function(doc, options) { var child, i, j, k, len, len1, ref, ref1, results; for (i = j = 0, len = (ref = doc.children).length; j < len; i = ++j) (child = ref[i]).isLastRootNode = i === doc.children.length - 1; for (options = this.filterOptions(options), results = [], k = 0, len1 = (ref1 = doc.children).length; k < len1; k++) child = ref1[k], results.push(this.writeChildNode(child, options, 0)); return results; }, XMLStreamWriter.prototype.attribute = function(att, options, level) { return this.stream.write(XMLStreamWriter.__super__.attribute.call(this, att, options, level)); }, XMLStreamWriter.prototype.cdata = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.cdata.call(this, node, options, level)); }, XMLStreamWriter.prototype.comment = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.comment.call(this, node, options, level)); }, XMLStreamWriter.prototype.declaration = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.declaration.call(this, node, options, level)); }, XMLStreamWriter.prototype.docType = function(node, options, level) { var child, j, len, ref; if (level || (level = 0), this.openNode(node, options, level), options.state = WriterState.OpenTag, this.stream.write(this.indent(node, options, level)), this.stream.write(" 0) { for (this.stream.write(" ["), this.stream.write(this.endline(node, options, level)), options.state = WriterState.InsideTag, j = 0, len = (ref = node.children).length; j < len; j++) child = ref[j], this.writeChildNode(child, options, level + 1); options.state = WriterState.CloseTag, this.stream.write("]"); } return options.state = WriterState.CloseTag, this.stream.write(options.spaceBeforeSlash + ">"), this.stream.write(this.endline(node, options, level)), options.state = WriterState.None, this.closeNode(node, options, level); }, XMLStreamWriter.prototype.element = function(node, options, level) { var att, child, childNodeCount, firstChildNode, j, len, name, ref, ref1; for (name in level || (level = 0), this.openNode(node, options, level), options.state = WriterState.OpenTag, this.stream.write(this.indent(node, options, level) + "<" + node.name), ref = node.attribs) hasProp.call(ref, name) && (att = ref[name], this.attribute(att, options, level)); if (firstChildNode = 0 === (childNodeCount = node.children.length) ? null : node.children[0], 0 === childNodeCount || node.children.every((function(e) { return (e.type === NodeType.Text || e.type === NodeType.Raw) && "" === e.value; }))) options.allowEmpty ? (this.stream.write(">"), options.state = WriterState.CloseTag, this.stream.write("")) : (options.state = WriterState.CloseTag, this.stream.write(options.spaceBeforeSlash + "/>")); else if (!options.pretty || 1 !== childNodeCount || firstChildNode.type !== NodeType.Text && firstChildNode.type !== NodeType.Raw || null == firstChildNode.value) { for (this.stream.write(">" + this.endline(node, options, level)), options.state = WriterState.InsideTag, j = 0, len = (ref1 = node.children).length; j < len; j++) child = ref1[j], this.writeChildNode(child, options, level + 1); options.state = WriterState.CloseTag, this.stream.write(this.indent(node, options, level) + ""); } else this.stream.write(">"), options.state = WriterState.InsideTag, options.suppressPrettyCount++, this.writeChildNode(firstChildNode, options, level + 1), options.suppressPrettyCount--, options.state = WriterState.CloseTag, this.stream.write(""); return this.stream.write(this.endline(node, options, level)), options.state = WriterState.None, this.closeNode(node, options, level); }, XMLStreamWriter.prototype.processingInstruction = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this, node, options, level)); }, XMLStreamWriter.prototype.raw = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.raw.call(this, node, options, level)); }, XMLStreamWriter.prototype.text = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.text.call(this, node, options, level)); }, XMLStreamWriter.prototype.dtdAttList = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this, node, options, level)); }, XMLStreamWriter.prototype.dtdElement = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this, node, options, level)); }, XMLStreamWriter.prototype.dtdEntity = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this, node, options, level)); }, XMLStreamWriter.prototype.dtdNotation = function(node, options, level) { return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this, node, options, level)); }, XMLStreamWriter; })(XMLWriterBase); }).call(this); }, function(module, exports, __webpack_require__) { (function() { "use strict"; var bom, defaults, defineProperty, events, isEmpty, processItem, processors, sax, setImmediate, bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; }, hasProp = {}.hasOwnProperty; sax = __webpack_require__(104), events = __webpack_require__(4), bom = __webpack_require__(1114), processors = __webpack_require__(511), setImmediate = __webpack_require__(103).setImmediate, defaults = __webpack_require__(245).defaults, isEmpty = function(thing) { return "object" == typeof thing && null != thing && 0 === Object.keys(thing).length; }, processItem = function(processors, item, key) { var i, len; for (i = 0, len = processors.length; i < len; i++) item = (0, processors[i])(item, key); return item; }, defineProperty = function(obj, key, value) { var descriptor; return (descriptor = Object.create(null)).value = value, descriptor.writable = !0, descriptor.enumerable = !0, descriptor.configurable = !0, Object.defineProperty(obj, key, descriptor); }, exports.Parser = (function(superClass) { function Parser(opts) { var key, ref, value; if (this.parseStringPromise = bind(this.parseStringPromise, this), this.parseString = bind(this.parseString, this), this.reset = bind(this.reset, this), this.assignOrPush = bind(this.assignOrPush, this), this.processAsync = bind(this.processAsync, this), !(this instanceof exports.Parser)) return new exports.Parser(opts); for (key in this.options = {}, ref = defaults[.2]) hasProp.call(ref, key) && (value = ref[key], this.options[key] = value); for (key in opts) hasProp.call(opts, key) && (value = opts[key], this.options[key] = value); this.options.xmlns && (this.options.xmlnskey = this.options.attrkey + "ns"), this.options.normalizeTags && (this.options.tagNameProcessors || (this.options.tagNameProcessors = []), this.options.tagNameProcessors.unshift(processors.normalize)), this.reset(); } return (function(child, parent) { for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); function ctor() { this.constructor = child; } ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; })(Parser, superClass), Parser.prototype.processAsync = function() { var chunk, err; try { return this.remaining.length <= this.options.chunkSize ? (chunk = this.remaining, this.remaining = "", this.saxParser = this.saxParser.write(chunk), this.saxParser.close()) : (chunk = this.remaining.substr(0, this.options.chunkSize), this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length), this.saxParser = this.saxParser.write(chunk), setImmediate(this.processAsync)); } catch (error1) { if (err = error1, !this.saxParser.errThrown) return this.saxParser.errThrown = !0, this.emit(err); } }, Parser.prototype.assignOrPush = function(obj, key, newValue) { return key in obj ? (obj[key] instanceof Array || defineProperty(obj, key, [ obj[key] ]), obj[key].push(newValue)) : this.options.explicitArray ? defineProperty(obj, key, [ newValue ]) : defineProperty(obj, key, newValue); }, Parser.prototype.reset = function() { var attrkey, charkey, ontext, stack, _this; return this.removeAllListeners(), this.saxParser = sax.parser(this.options.strict, { trim: !1, normalize: !1, xmlns: this.options.xmlns }), this.saxParser.errThrown = !1, this.saxParser.onerror = (_this = this, function(error) { if (_this.saxParser.resume(), !_this.saxParser.errThrown) return _this.saxParser.errThrown = !0, _this.emit("error", error); }), this.saxParser.onend = (function(_this) { return function() { if (!_this.saxParser.ended) return _this.saxParser.ended = !0, _this.emit("end", _this.resultObject); }; })(this), this.saxParser.ended = !1, this.EXPLICIT_CHARKEY = this.options.explicitCharkey, this.resultObject = null, stack = [], attrkey = this.options.attrkey, charkey = this.options.charkey, this.saxParser.onopentag = (function(_this) { return function(node) { var key, newValue, obj, processedKey, ref; if ((obj = {})[charkey] = "", !_this.options.ignoreAttrs) for (key in ref = node.attributes) hasProp.call(ref, key) && (attrkey in obj || _this.options.mergeAttrs || (obj[attrkey] = {}), newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key], processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key, _this.options.mergeAttrs ? _this.assignOrPush(obj, processedKey, newValue) : defineProperty(obj[attrkey], processedKey, newValue)); return obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name, _this.options.xmlns && (obj[_this.options.xmlnskey] = { uri: node.uri, local: node.local }), stack.push(obj); }; })(this), this.saxParser.onclosetag = (function(_this) { return function() { var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath; if (obj = stack.pop(), nodeName = obj["#name"], _this.options.explicitChildren && _this.options.preserveChildrenOrder || delete obj["#name"], !0 === obj.cdata && (cdata = obj.cdata, delete obj.cdata), s = stack[stack.length - 1], obj[charkey].match(/^\s*$/) && !cdata ? (emptyStr = obj[charkey], delete obj[charkey]) : (_this.options.trim && (obj[charkey] = obj[charkey].trim()), _this.options.normalize && (obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim()), obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey], 1 === Object.keys(obj).length && charkey in obj && !_this.EXPLICIT_CHARKEY && (obj = obj[charkey])), isEmpty(obj) && (obj = "function" == typeof _this.options.emptyTag ? _this.options.emptyTag() : "" !== _this.options.emptyTag ? _this.options.emptyTag : emptyStr), null != _this.options.validator && (xpath = "/" + (function() { var i, len, results; for (results = [], i = 0, len = stack.length; i < len; i++) node = stack[i], results.push(node["#name"]); return results; })().concat(nodeName).join("/"), (function() { var err; try { obj = _this.options.validator(xpath, s && s[nodeName], obj); } catch (error1) { return err = error1, _this.emit("error", err); } })()), _this.options.explicitChildren && !_this.options.mergeAttrs && "object" == typeof obj) if (_this.options.preserveChildrenOrder) { if (s) { for (key in s[_this.options.childkey] = s[_this.options.childkey] || [], objClone = {}, obj) hasProp.call(obj, key) && defineProperty(objClone, key, obj[key]); s[_this.options.childkey].push(objClone), delete obj["#name"], 1 === Object.keys(obj).length && charkey in obj && !_this.EXPLICIT_CHARKEY && (obj = obj[charkey]); } } else node = {}, _this.options.attrkey in obj && (node[_this.options.attrkey] = obj[_this.options.attrkey], delete obj[_this.options.attrkey]), !_this.options.charsAsChildren && _this.options.charkey in obj && (node[_this.options.charkey] = obj[_this.options.charkey], delete obj[_this.options.charkey]), Object.getOwnPropertyNames(obj).length > 0 && (node[_this.options.childkey] = obj), obj = node; return stack.length > 0 ? _this.assignOrPush(s, nodeName, obj) : (_this.options.explicitRoot && (old = obj, defineProperty(obj = {}, nodeName, old)), _this.resultObject = obj, _this.saxParser.ended = !0, _this.emit("end", _this.resultObject)); }; })(this), ontext = (function(_this) { return function(text) { var charChild, s; if (s = stack[stack.length - 1]) return s[charkey] += text, _this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || "" !== text.replace(/\\n/g, "").trim()) && (s[_this.options.childkey] = s[_this.options.childkey] || [], (charChild = { "#name": "__text__" })[charkey] = text, _this.options.normalize && (charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim()), s[_this.options.childkey].push(charChild)), s; }; })(this), this.saxParser.ontext = ontext, this.saxParser.oncdata = function(text) { var s; if (s = ontext(text)) return s.cdata = !0; }; }, Parser.prototype.parseString = function(str, cb) { var err; null != cb && "function" == typeof cb && (this.on("end", (function(result) { return this.reset(), cb(null, result); })), this.on("error", (function(err) { return this.reset(), cb(err); }))); try { return "" === (str = str.toString()).trim() ? (this.emit("end", null), !0) : (str = bom.stripBOM(str), this.options.async ? (this.remaining = str, setImmediate(this.processAsync), this.saxParser) : this.saxParser.write(str).close()); } catch (error1) { if (err = error1, !this.saxParser.errThrown && !this.saxParser.ended) return this.emit("error", err), this.saxParser.errThrown = !0; if (this.saxParser.ended) throw err; } }, Parser.prototype.parseStringPromise = function(str) { return new Promise((_this = this, function(resolve, reject) { return _this.parseString(str, (function(err, value) { return err ? reject(err) : resolve(value); })); })); var _this; }, Parser; })(events), exports.parseString = function(str, a, b) { var cb, options; return null != b ? ("function" == typeof b && (cb = b), "object" == typeof a && (options = a)) : ("function" == typeof a && (cb = a), options = {}), new exports.Parser(options).parseString(str, cb); }, exports.parseStringPromise = function(str, a) { var options; return "object" == typeof a && (options = a), new exports.Parser(options).parseStringPromise(str); }; }).call(this); }, function(module, exports) { (function() { "use strict"; exports.stripBOM = function(str) { return "\ufeff" === str[0] ? str.substring(1) : str; }; }).call(this); }, function(module, exports, __webpack_require__) { var c, char, crc32, k, len, log, ref; for (crc32 = __webpack_require__(1116), log = __webpack_require__(244), c = {}, k = 0, len = (ref = [ ".", "\n", "\r", "=" ]).length; k < len; k++) c[char = ref[k]] = char.charCodeAt(0); module.exports = function(input) { var buffer, code, filename, i, j, length, line, processLine; for (line = [], filename = null, buffer = new Buffer(input.length), i = 0, processLine = function() { var calc, calc2, code, escape, l, len1, match, pcrc32, ref1, results; if (0 !== line.length) { if (line[0] === (ref1 = line[1]) && ref1 === c["."] && line.shift(), !(match = new Buffer(line.slice(0, 7)).toString().match(/^\=(ybegin|ypart|yend)/))) { for (escape = !1, results = [], l = 0, len1 = line.length; l < len1; l++) (code = line[l]) !== c["="] || escape ? (escape && (code -= 64, escape = !1), code -= 42, results.push(buffer[i++] = code)) : results.push(escape = !0); return results; } switch (match[1]) { case "ybegin": (match = new Buffer(line).toString().match(/name\=(.*)/)) && (filename = match[1]); break; case "yend": buffer = buffer.slice(0, i), (pcrc32 = new Buffer(line).toString().match(/pcrc32\=([^\s]*)/)) && (calc = crc32.unsigned(buffer).toString(16).toLowerCase().replace(/^0+/, "")) !== (calc2 = pcrc32[1].toLowerCase().replace(/^0+/, "")) && log.err("File " + filename.bold + " crc fail, expected " + calc2 + " got " + calc); } } }, j = 0, length = input.length; j < length; ) (code = input[j++]) !== c["\n"] && code !== c["\r"] ? line.push(code) : (processLine(), line = []); return processLine(), input = null, [ filename, buffer ]; }; }, function(module, exports, __webpack_require__) { var Buffer = __webpack_require__(10).Buffer, CRC_TABLE = [ 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ]; function ensureBuffer(input) { if (Buffer.isBuffer(input)) return input; var hasNewBufferAPI = "function" == typeof Buffer.alloc && "function" == typeof Buffer.from; if ("number" == typeof input) return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); if ("string" == typeof input) return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); throw new Error("input must be buffer, number, or string, received " + typeof input); } function bufferizeInt(num) { var tmp = ensureBuffer(4); return tmp.writeInt32BE(num, 0), tmp; } function _crc32(buf, previous) { buf = ensureBuffer(buf), Buffer.isBuffer(previous) && (previous = previous.readUInt32BE(0)); for (var crc = -1 ^ ~~previous, n = 0; n < buf.length; n++) crc = CRC_TABLE[255 & (crc ^ buf[n])] ^ crc >>> 8; return -1 ^ crc; } function crc32() { return bufferizeInt(_crc32.apply(null, arguments)); } "undefined" != typeof Int32Array && (CRC_TABLE = new Int32Array(CRC_TABLE)), crc32.signed = function() { return _crc32.apply(null, arguments); }, crc32.unsigned = function() { return _crc32.apply(null, arguments) >>> 0; }, module.exports = crc32; }, function(module, exports) { var subscribers = {}, requestIds = []; function getUniqueId() { const idStr = "" + Math.random().toString(16).slice(2); return requestIds[idStr] ? getUniqueId() : idStr; } function isStillExpected(segmentId) { return Object.values(expectedSegments).flat().includes(segmentId); } var expectedSegments = {}, cache = {}, cacheSize = 0; module.exports = { expected: segments => { var segmentIds = segments.map((el => `${el.group}.${el.article}`)), requestId = getUniqueId(); return requestIds.push(requestId), expectedSegments[requestId] || (expectedSegments[requestId] = []), expectedSegments[requestId] = expectedSegments[requestId].concat(segmentIds), requestId; }, subscribe: (requestId, group, article, cb) => { var segmentId = `${group}.${article}`, fn = (err, buffer, group, article, bytes) => { if (expectedSegments[requestId]) { var segIdx = expectedSegments[requestId].findIndex((el => el === segmentId)); segIdx > -1 && expectedSegments[requestId].splice(segIdx, 1), expectedSegments[requestId].length || delete expectedSegments[requestId]; } return cache[segmentId] && (isStillExpected(segmentId) || (cacheSize -= cache[segmentId][1], delete cache[segmentId])), cb(err, buffer, group, article, bytes); }; if (!cache[segmentId]) return subscribers[segmentId] ? (subscribers[segmentId].push(fn), !1) : (subscribers[segmentId] = [ fn ], !0); fn(null, cache[segmentId][0], group, article, cache[segmentId][1]); }, pushSegment: (err, buffer, group, article, bytes) => { var segmentId = `${group}.${article}`; if ((subscribers[segmentId] || []).length) { for (;subscribers[segmentId].length; ) subscribers[segmentId].shift()(err, buffer, group, article, bytes); delete subscribers[segmentId], buffer && isStillExpected(segmentId) && !cache[segmentId] && cacheSize < 0 && (cache[segmentId] = [ buffer, bytes ], cacheSize += bytes); } } }; }, function(module, exports, __webpack_require__) { (function(__dirname) { var exec = __webpack_require__(32).exec, path = __webpack_require__(5); function escape(s) { return s.replace(/"/g, '\\"'); } module.exports = function(target, appName, callback) { var opener; switch ("function" == typeof appName && (callback = appName, appName = null), process.platform) { case "darwin": opener = appName ? 'open -a "' + escape(appName) + '"' : "open"; break; case "win32": opener = appName ? 'start "" "' + escape(appName) + '"' : 'start ""'; break; default: opener = appName ? escape(appName) : path.join(__dirname, "../vendor/xdg-open"); } return process.env.SUDO_USER && (opener = "sudo -u " + process.env.SUDO_USER + " " + opener), exec(opener + ' "' + escape(target) + '"', callback); }; }).call(this, "/"); }, function(module, exports, __webpack_require__) { const store = __webpack_require__(162), getRouter = __webpack_require__(1120), getRarStream = __webpack_require__(514); module.exports = { router: getRouter, create: rarUrls => { if (!rarUrls || !Array.isArray(rarUrls)) throw Error('"rarUrls" is undefined or not an array'); return store.set(rarUrls); }, file: async (key, opts) => { if (!key) throw Error('Missing "key"'); return await getRarStream({ url: key, query: { o: JSON.stringify(opts || {}), key: key } }); } }; }, function(module, exports, __webpack_require__) { const Router = __webpack_require__(108), bodyParser = __webpack_require__(50), getRarStream = __webpack_require__(514), getContentType = __webpack_require__(1230), keyHandler = (__webpack_require__(162), __webpack_require__(271), new (__webpack_require__(4)), __webpack_require__(1231)); module.exports = function() { const router = Router(); return router.use(bodyParser.json()), router.post("/create/:createKey", keyHandler.createKey.bind(null, "rar", null, null)), router.all("/create", keyHandler.createKey.bind(null, "rar", null, null)), router.get("/stream", (async (req, res) => { try { await keyHandler.waitForKey(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } let rarInnerFile; try { rarInnerFile = await getRarStream(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } if (!rarInnerFile) { const errMsg = "There was an error with the rar parser."; return console.error(Error(errMsg)), res.statusCode = 500, void res.end(errMsg); } if ("HEAD" === req.method) return res.statusCode = 204, res.setHeader("Accept-Ranges", "bytes"), res.setHeader("Content-Length", rarInnerFile.length + ""), res.setHeader("Content-Type", getContentType(rarInnerFile)), void res.end(); const fileSize = rarInnerFile.length, range = req.headers.range; let start = 0, end = fileSize - 1; if (res.setHeader("Accept-Ranges", "bytes"), res.setHeader("Content-Type", getContentType(rarInnerFile)), Object.values(range || {}).length) { const parts = range.replace(/bytes=/, "").split("-"); start = parseInt(parts[0], 10) || 0, end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1, res.statusCode = 206, res.setHeader("Content-Range", `bytes ${start}-${end}/${fileSize}`); const chunksize = end - start + 1; res.setHeader("Content-Length", chunksize + ""); } else res.statusCode = 200, res.setHeader("Content-Length", fileSize + ""); const readable = await rarInnerFile.createReadStream({ start: start, end: end }); req.on("close", (function() { readable.stream.request.abort(); })), readable.pipe(res); })), router; }; }, function(module, exports, __webpack_require__) { "use strict"; var debug = __webpack_require__(9)("router:route"), flatten = __webpack_require__(512).flatten, Layer = __webpack_require__(513), methods = __webpack_require__(68), slice = Array.prototype.slice, defer = "function" == typeof setImmediate ? setImmediate : function(fn) { process.nextTick(fn.bind.apply(fn, arguments)); }; function Route(path) { debug("new %o", path), this.path = path, this.stack = [], this.methods = Object.create(null); } module.exports = Route, Route.prototype._handles_method = function(method) { if (this.methods._all) return !0; var name = "string" == typeof method ? method.toLowerCase() : method; return "head" !== name || this.methods.head || (name = "get"), Boolean(this.methods[name]); }, Route.prototype._methods = function() { var methods = Object.keys(this.methods); this.methods.get && !this.methods.head && methods.push("head"); for (var i = 0; i < methods.length; i++) methods[i] = methods[i].toUpperCase(); return methods; }, Route.prototype.dispatch = function(req, res, done) { var idx = 0, stack = this.stack, sync = 0; if (0 === stack.length) return done(); var method = "string" == typeof req.method ? req.method.toLowerCase() : req.method; "head" !== method || this.methods.head || (method = "get"), req.route = this, (function next(err) { if (err && "route" === err) return done(); if (err && "router" === err) return done(err); if (idx >= stack.length) return done(err); if (++sync > 100) return defer(next, err); for (var layer, match; !0 !== match && idx < stack.length; ) match = !(layer = stack[idx++]).method || layer.method === method; if (!0 !== match) return done(err); err ? layer.handle_error(err, req, res, next) : layer.handle_request(req, res, next), sync = 0; })(); }, Route.prototype.all = function(handler) { var callbacks = flatten(slice.call(arguments)); if (0 === callbacks.length) throw new TypeError("argument handler is required"); for (var i = 0; i < callbacks.length; i++) { var fn = callbacks[i]; if ("function" != typeof fn) throw new TypeError("argument handler must be a function"); var layer = Layer("/", {}, fn); layer.method = void 0, this.methods._all = !0, this.stack.push(layer); } return this; }, methods.forEach((function(method) { Route.prototype[method] = function(handler) { var callbacks = flatten(slice.call(arguments)); if (0 === callbacks.length) throw new TypeError("argument handler is required"); for (var i = 0; i < callbacks.length; i++) { var fn = callbacks[i]; if ("function" != typeof fn) throw new TypeError("argument handler must be a function"); debug("%s %s", method, this.path); var layer = Layer("/", {}, fn); layer.method = method, this.methods[method] = !0, this.stack.push(layer); } return this; }; })); }, function(module, exports, __webpack_require__) { "use strict"; module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(obj, proto) { return obj.__proto__ = proto, obj; } : function(obj, proto) { for (var prop in proto) Object.prototype.hasOwnProperty.call(obj, prop) || (obj[prop] = proto[prop]); return obj; }); }, function(module, exports, __webpack_require__) { "use strict"; function _optionalChain(ops) { let lastAccessLHS, value = ops[0], i = 1; for (;i < ops.length; ) { const op = ops[i], fn = ops[i + 1]; if (i += 2, ("optionalAccess" === op || "optionalCall" === op) && null == value) return; "access" === op || "optionalAccess" === op ? (lastAccessLHS = value, value = fn(value)) : "call" !== op && "optionalCall" !== op || (value = fn(((...args) => value.call(lastAccessLHS, ...args))), lastAccessLHS = void 0); } return value; } var _class, _class2, _class3, _class4, _class5, _class6, _class7; Object.defineProperty(exports, "__esModule", { value: !0 }); var _events = __webpack_require__(4), RXX_EXTENSION = /\.R(\d\d?\d?\d?\d?\d?)$|\.RAR$/i, RAR_EXTENSION = /\.RAR$/i, PARTXX_RAR_EXTENSION = /\.PART(\d\d?\d?\d?\d?)\.RAR$/i, makeRarFileBundle = (fileMedias = []) => ((fileMedias = []) => fileMedias.filter((file => file.name && file.name.match(PARTXX_RAR_EXTENSION))).length > 0)(fileMedias) ? new class { constructor(fileMedias = []) { this.fileMedias = fileMedias, this.fileMedias.length > 0 && (this.filter(), this.sort()); } filter() { this.fileMedias = this.fileMedias.filter((file => file.name.match(PARTXX_RAR_EXTENSION))); } sort() { this.fileMedias.sort(((first, second) => { const firstMatch = first.name.match(PARTXX_RAR_EXTENSION), secondMatch = second.name.match(PARTXX_RAR_EXTENSION); return +(firstMatch && firstMatch[1] || 0) - +(secondMatch && secondMatch[1] || 0); })); } get length() { return this.fileMedias.length; } get fileNames() { return this.fileMedias.map((file => file.name)); } get files() { return this.fileMedias; } }(fileMedias) : new class { constructor(fileMedias = []) { this.fileMedias = fileMedias, this.fileMedias.length > 0 && (this.filter(), this.sort()); } filter() { this.fileMedias = this.fileMedias.filter((file => file.name && file.name.match(RXX_EXTENSION))); } sort() { this.fileMedias.sort(((first, second) => { if (first.name.match(RAR_EXTENSION)) return -1; if (second.name.match(RAR_EXTENSION)) return 1; { const firstMatch = first.name.match(RXX_EXTENSION), secondMatch = second.name.match(RXX_EXTENSION); return +(firstMatch && firstMatch[1] || 0) - +(secondMatch && secondMatch[1] || 0); } })); } get length() { return this.fileMedias.length; } get fileNames() { return this.fileMedias.map((file => file.name)); } get files() { return this.fileMedias; } }(fileMedias), RarFileChunk = class _RarFileChunk { constructor(fileMedia, startOffset, endOffset) { this.fileMedia = fileMedia, this.startOffset = startOffset, this.endOffset = endOffset; } padEnd(endPadding) { return new _RarFileChunk(this.fileMedia, this.startOffset, this.endOffset - endPadding); } padStart(startPadding) { return new _RarFileChunk(this.fileMedia, this.startOffset + startPadding, this.endOffset); } get length() { return Math.max(0, this.endOffset - this.startOffset); } getStream() { return this.fileMedia.createReadStream({ start: this.startOffset, end: this.endOffset }); } }, _stream = __webpack_require__(3), InnerFileStream = class extends _stream.Readable { constructor(rarFileChunks, options) { super(options), this.rarFileChunks = rarFileChunks; } pushData(data) { this.push(data) || _optionalChain([ this, "access", _2 => _2.stream, "optionalAccess", _3 => _3.pause, "call", _4 => _4() ]); } get isStarted() { return !!this.stream; } async next() { const chunk = this.rarFileChunks.shift(); chunk ? (this.stream = await chunk.getStream(), _optionalChain([ this, "access", _5 => _5.stream, "optionalAccess", _6 => _6.on, "call", _7 => _7("data", (data => this.pushData(data))) ]), _optionalChain([ this, "access", _8 => _8.stream, "optionalAccess", _9 => _9.on, "call", _10 => _10("end", (() => this.next())) ])) : this.push(null); } _read() { this.isStarted ? _optionalChain([ this, "access", _11 => _11.stream, "optionalAccess", _12 => _12.resume, "call", _13 => _13() ]) : this.next(); } }, streamToBuffer = async stream => new Promise(((resolve, reject) => { const buffers = []; stream.on("error", reject), stream.on("data", (data => buffers.push(data))), stream.on("end", (() => resolve(Buffer.concat(buffers)))); })), MarkerHeaderParser = ((_class = class { constructor(headerBuffer) { this.headerBuffer = headerBuffer; } static __initStatic() { this.HEADER_SIZE = 11; } parse() { const crc = this.headerBuffer.readUInt16LE(0), type = this.headerBuffer.readUInt8(2), flags = this.headerBuffer.readUInt16LE(3); let size = this.headerBuffer.readUInt16LE(5); return 0 != (32768 & flags) && (size += this.headerBuffer.readUint32LE(7) || 0), { crc: crc, type: type, flags: flags, size: size }; } }).__initStatic(), _class), ArchiveHeaderParser = ((_class2 = class { constructor(buffer) { this.buffer = buffer; } static __initStatic2() { this.HEADER_SIZE = 13; } parse() { let vars = { crc: this.buffer.readUInt16LE(0), type: this.buffer.readUInt8(2), flags: this.buffer.readUInt16LE(3), size: this.buffer.readUInt16LE(5), reserved1: this.buffer.readUInt16LE(7), reserved2: this.buffer.readUInt32LE(9) }; return { ...(parsedVars = vars, { hasVolumeAttributes: 0 != (1 & parsedVars.flags), hasComment: 0 != (2 & parsedVars.flags), isLocked: 0 != (4 & parsedVars.flags), hasSolidAttributes: 0 != (8 & parsedVars.flags), isNewNameScheme: 0 != (16 & parsedVars.flags), hasAuthInfo: 0 != (32 & parsedVars.flags), hasRecovery: 0 != (64 & parsedVars.flags), isBlockEncoded: 0 != (128 & parsedVars.flags), isFirstVolume: 0 != (256 & parsedVars.flags) }), ...vars }; var parsedVars; } }).__initStatic2(), _class2), nodeMajorVersion = parseInt((((process || {}).version || "").split(".")[0] || "").substring(1)), FileHeaderParser = ((_class3 = class { constructor(buffer) { _class3.prototype.__init.call(this), this.buffer = buffer; } static __initStatic3() { this.HEADER_SIZE = 280; } __init() { this.offset = 0; } handleHighFileSize(parsedVars) { if (parsedVars.hasHighSize) { const highPackSize = this.buffer.readInt32LE(this.offset); this.offset += 4; const highUnpackSize = this.buffer.readInt32LE(this.offset); this.offset += 4, parsedVars.size = 4294967296 * highPackSize + parsedVars.size, parsedVars.unpackedSize = 4294967296 * highUnpackSize + parsedVars.unpackedSize; } } parseFileName(parsedVars) { var buff, start, end; parsedVars.name = (buff = this.buffer, start = this.offset, end = this.offset + parsedVars.nameSize, buff[nodeMajorVersion < 16 ? "slice" : "subarray"](start, end)).toString("utf8"); } parseFlags(parsedVars) { return { continuesFromPrevious: 0 != (1 & parsedVars.flags), continuesInNext: 0 != (2 & parsedVars.flags), isEncrypted: 0 != (4 & parsedVars.flags), hasComment: 0 != (8 & parsedVars.flags), hasInfoFromPrevious: 0 != (16 & parsedVars.flags), hasHighSize: 0 != (256 & parsedVars.flags), hasSpecialName: 0 != (512 & parsedVars.flags), hasSalt: 0 != (1024 & parsedVars.flags), isOldVersion: 0 != (2048 & parsedVars.flags), hasExtendedTime: 0 != (4096 & parsedVars.flags) }; } parse() { const crc = this.buffer.readUInt16LE(this.offset); this.offset += 2; const type = this.buffer.readUInt8(this.offset); this.offset += 1; const flags = this.buffer.readUInt16LE(this.offset); this.offset += 2; const headSize = this.buffer.readUInt16LE(this.offset); this.offset += 2; const size = this.buffer.readUInt32LE(this.offset); this.offset += 4; const unpackedSize = this.buffer.readUInt32LE(this.offset); this.offset += 4; const host = this.buffer.readUInt8(this.offset); this.offset += 1; const fileCrc = this.buffer.readUInt32LE(this.offset); this.offset += 4; const timestamp = this.buffer.readUInt32LE(this.offset); this.offset += 4; const version = this.buffer.readUInt8(this.offset); this.offset += 1; const method = this.buffer.readUInt8(this.offset); this.offset += 1; const nameSize = this.buffer.readUInt16LE(this.offset); this.offset += 2; const attributes = this.buffer.readUInt32LE(this.offset); this.offset += 4; let vars = { crc: crc, type: type, flags: flags, headSize: headSize, size: size, unpackedSize: unpackedSize, host: host, fileCrc: fileCrc, timestamp: timestamp, version: version, method: method, nameSize: nameSize, attributes: attributes, name: "" }; const boolFlags = this.parseFlags(vars), header = { ...vars, ...boolFlags }; return this.handleHighFileSize(header), this.parseFileName(header), this.offset = 0, header; } }).__initStatic3(), _class3), TerminatorHeaderParser = ((_class4 = class { constructor(headerBuffer) { this.headerBuffer = headerBuffer; } static __initStatic4() { this.HEADER_SIZE = 27; } parse() { return { crc: this.headerBuffer.readUInt16LE(0), type: this.headerBuffer.readUInt8(2), flags: this.headerBuffer.readUInt16LE(3), size: this.headerBuffer.readUInt16LE(5) }; } }).__initStatic4(), _class4), nodeMajorVersion2 = parseInt((((process || {}).version || "").split(".")[0] || "").substring(1)); function subarray2(buff, start, end) { return buff[nodeMajorVersion2 < 16 ? "slice" : "subarray"](start, end); } var RawRead = ((_class5 = class _RawRead { constructor(rarFile) { this.srcFile = rarFile, this.Data = Buffer.alloc(0), this.ReadPos = 0; } reset() { this.Data.fill(null), this.ReadPos = 0; } async Read(size) { return this.Data = Buffer.concat([ this.Data, await this.srcFile.read(size) ]), this.Data.length; } Size() { return this.Data.length; } getBytes(length) { const start = this.ReadPos, end = this.ReadPos + length; return this.ReadPos += length, subarray2(this.Data, start, end); } _getInteger(bytes) { if (this.ReadPos + bytes >= this.Data.length) return 0; const Result = this.Data.readUIntLE(this.ReadPos, bytes); return this.ReadPos += bytes, Result; } getDword() { return this._getInteger(4); } getVarInt() { let result = 0, multiplier = 1; for (let shift = 0; this.ReadPos < this.Data.length && shift < 64; shift += 7) { const byte = this.Data[this.ReadPos++]; if (result += (127 & byte) * multiplier, multiplier *= 128, 0 == (128 & byte)) break; } return result; } GetCRC50() { return _RawRead.CRC32(subarray2(this.Data, 4)); } static __initStatic5() { this._CRC_table = new Uint32Array(256).map(((_, c) => { for (let i = 0; i < 8; i++) c = 1 & c ? 3988292384 ^ c >>> 1 : c >>> 1; return c; })); } static CRC32(chunk) { for (var crc = 4294967295, i = 0, iTop = chunk.length; i < iTop; i++) crc = crc >>> 8 ^ _RawRead._CRC_table[255 & (crc ^ chunk[i])]; return (-1 ^ crc) >>> 0; } }).__initStatic5(), _class5), HEADER_TYPE = Object.freeze({ HEAD_MAIN: 1, HEAD_FILE: 2, HEAD_SERVICE: 3, HEAD_CRYPT: 4, HEAD_ENDARC: 5 }), HOST_SYSTEM = Object.freeze({ HOST5_WINDOWS: 0, HOST5_UNIX: 1 }), HOST_SYSTEM_TYPE = Object.freeze({ HSYS_WINDOWS: 0, HSYS_UNIX: 1, HSYS_UNKNOWN: 2 }), BaseBlock = _class6 = class { constructor() { _class6.prototype.__init2.call(this), _class6.prototype.__init3.call(this), _class6.prototype.__init4.call(this), _class6.prototype.__init5.call(this), _class6.prototype.__init6.call(this), _class6.prototype.__init7.call(this), _class6.prototype.__init8.call(this), _class6.prototype.__init9.call(this), _class6.prototype.__init10.call(this), _class6.prototype.__init11.call(this), _class6.prototype.__init12.call(this), _class6.prototype.__init13.call(this), _class6.prototype.__init14.call(this), _class6.prototype.__init15.call(this), _class6.prototype.__init16.call(this), _class6.prototype.__init17.call(this), _class6.prototype.__init18.call(this), _class6.prototype.__init19.call(this), _class6.prototype.__init20.call(this), _class6.prototype.__init21.call(this), _class6.prototype.__init22.call(this), _class6.prototype.__init23.call(this), _class6.prototype.__init24.call(this), _class6.prototype.__init25.call(this), _class6.prototype.__init26.call(this), _class6.prototype.__init27.call(this), _class6.prototype.__init28.call(this), _class6.prototype.__init29.call(this), _class6.prototype.__init30.call(this), _class6.prototype.__init31.call(this), _class6.prototype.__init32.call(this), _class6.prototype.__init33.call(this), _class6.prototype.__init34.call(this); } reset() { this.headerType = 0, this.HeadCRC = 0, this.Flags = 0, this.HeadSize = 0, this.SkipIfUnknow = !1, this.ExtraSize = 0, this.DataSize = 0, this.VolNumber = 0, this.locator = !1, this.qopenOffset = 0, this.LargeFile = !1, this.PackSize = 0, this.FileFlags = 0, this.UnpSize = 0, this.UnknownUnpSize = !1, this.MaxSize = 0, this.FileAttr = 0, this.FileHash = { type: null, CRC32: 0 }, this.Method = 0, this.UnpVer = 0, this.HostOS = 0, this.Inherited = !1, this.HSType = null, this.SplitBefore = !1, this.SplitAfter = !1, this.SubBlock = !1, this.Dir = !1, this.WinSize = 0, this.Name = "", this.mtime = null, this.ctime = null, this.atime = null, this.NextVolume = !1; } __init2() { this.headerType = 0; } __init3() { this.HeadCRC = 0; } __init4() { this.Flags = 0; } __init5() { this.HeadSize = 0; } __init6() { this.SkipIfUnknow = !1; } __init7() { this.ExtraSize = 0; } __init8() { this.DataSize = 0; } __init9() { this.VolNumber = 0; } __init10() { this.locator = !1; } __init11() { this.qopenOffset = 0; } __init12() { this.LargeFile = !1; } __init13() { this.PackSize = 0; } __init14() { this.FileFlags = 0; } __init15() { this.UnpSize = 0; } __init16() { this.UnknownUnpSize = !1; } __init17() { this.MaxSize = 0; } __init18() { this.FileAttr = 0; } __init19() { this.FileHash = { type: null, CRC32: 0 }; } __init20() { this.Method = 0; } __init21() { this.UnpVer = 0; } __init22() { this.HostOS = 0; } __init23() { this.Inherited = !1; } __init24() { this.HSType = null; } __init25() { this.SplitBefore = !1; } __init26() { this.SplitAfter = !1; } __init27() { this.SubBlock = !1; } __init28() { this.Dir = !1; } __init29() { this.WinSize = 0; } __init30() { this.Name = ""; } __init31() { this.mtime = null; } __init32() { this.ctime = null; } __init33() { this.atime = null; } __init34() { this.NextVolume = !1; } }, AcRead = _class7 = class { constructor(readable) { _class7.prototype.__init35.call(this), _class7.prototype.__init36.call(this), _class7.prototype.__init37.call(this), this.shortBlock = new BaseBlock, this.file = readable; } __init35() { this.ReadPos = 0; } __init36() { this.CurBlockPos = 0; } __init37() { this.NextBlockPos = 0; } async readHeader50(onlySize) { const Raw = new RawRead(this.file); if (await Raw.Read(7) < 7) return console.log("Failed to read the first block header"), 0; this.shortBlock.reset(), this.shortBlock.HeadCRC = Raw.getDword(); let SizeBytes = Raw.ReadPos; const BlockSize = Raw.getVarInt(); if (SizeBytes = Raw.ReadPos - SizeBytes, 0 == BlockSize || 0 == SizeBytes) return console.log("Block size is 0"), 0; const SizeToRead = BlockSize - (7 - SizeBytes - 4), HeaderSize = 4 + SizeBytes + BlockSize; if (onlySize) return HeaderSize; if (SizeToRead < 0 || HeaderSize < 7) return console.log("Invalid block size or header size"), 0; if (await Raw.Read(SizeToRead), Raw.Size() < HeaderSize) return console.log("Failed to read the entire block header"), 0; const HeaderCRC = Raw.GetCRC50(); if (Raw.ReadPos, this.shortBlock.headerType = Raw.getVarInt(), this.shortBlock.Flags = Raw.getVarInt(), this.shortBlock.SkipIfUnknow = 0 != (4 & this.shortBlock.Flags), this.shortBlock.HeadSize = HeaderSize, this.CurHeaderType = this.shortBlock.headerType, this.shortBlock.HeadCRC != HeaderCRC && console.log("Bad CRC"), this.shortBlock.ExtraSize = 0 != (1 & this.shortBlock.Flags) ? Raw.getVarInt() : 0, this.shortBlock.ExtraSize >= this.shortBlock.HeadSize) return console.log("Extra size is too large"), 0; switch (this.shortBlock.DataSize = 0 != (2 & this.shortBlock.Flags) ? Raw.getVarInt() : 0, this.NextBlockPos = this.CurBlockPos + this.shortBlock.HeadSize + this.shortBlock.DataSize || 0, this.shortBlock.headerType) { case HEADER_TYPE.HEAD_CRYPT: console.log("Crypt header"); break; case HEADER_TYPE.HEAD_MAIN: { const ArcFlags2 = Raw.getVarInt(); this.shortBlock.VolNumber = 0 != (2 & ArcFlags2) ? Raw.getVarInt() : 0; break; } case HEADER_TYPE.HEAD_FILE: case HEADER_TYPE.HEAD_SERVICE: { this.shortBlock.headerType, HEADER_TYPE.HEAD_FILE, this.shortBlock.LargeFile = !0, this.shortBlock.PackSize = this.shortBlock.DataSize, this.shortBlock.FileFlags = Raw.getVarInt(), this.shortBlock.UnpSize = Raw.getVarInt(), this.shortBlock.UnknownUnpSize = 0 != (8 & this.shortBlock.FileFlags), this.shortBlock.UnknownUnpSize && (this.shortBlock.UnpSize = 1 / 0), this.shortBlock.MaxSize = Math.max(this.shortBlock.UnpSize, this.shortBlock.PackSize), this.shortBlock.FileAttr = Raw.getVarInt(), 0 != (2 & this.shortBlock.FileFlags) && (this.shortBlock.mtime = new Date(1e3 * Raw.getDword())), this.shortBlock.FileHash = { type: null, CRC32: null }, 0 != (4 & this.shortBlock.FileFlags) && (this.shortBlock.FileHash.type = "crc32", this.shortBlock.FileHash.CRC32 = Raw.getDword()); const CompInfo = Raw.getVarInt(); this.shortBlock.Method = CompInfo >> 7 & 7; const UnpVer = 63 & CompInfo; this.shortBlock.UnpVer = 0 == UnpVer ? 50 : 1 == UnpVer ? 70 : 9999, this.shortBlock.HostOS = Raw.getVarInt(); const NameSize = Raw.getVarInt(); this.shortBlock.Inherited = 0 != (64 & this.shortBlock.Flags), this.shortBlock.HSType = HOST_SYSTEM_TYPE.HSYS_UNKNOWN, this.shortBlock.HostOS == HOST_SYSTEM.HOST5_UNIX ? this.shortBlock.HSType = HOST_SYSTEM.HSYS_UNIX : this.shortBlock.HostOS == HOST_SYSTEM.HOST5_WINDOWS && (this.shortBlock.HSType = HOST_SYSTEM_TYPE.HSYS_WINDOWS), this.shortBlock.SplitBefore = 0 != (8 & this.shortBlock.Flags), this.shortBlock.SplitAfter = 0 != (16 & this.shortBlock.Flags), this.shortBlock.SubBlock = 0 != (32 & this.shortBlock.Flags), this.shortBlock.Dir = 0 != (1 & this.shortBlock.FileFlags), this.shortBlock.Dir || UnpVer > 1 ? this.shortBlock.WinSize = 0 : (this.shortBlock.WinSize = 131072 << (CompInfo >> 10 & (0 == UnpVer ? 15 : 31)), 1 == UnpVer && (this.shortBlock.WinSize += this.shortBlock.WinSize / 32 * (CompInfo >> 15 & 31), 0 != (1048576 & CompInfo) && (this.shortBlock.UnpVer = 50), this.shortBlock.WinSize > 68719476736 && (this.shortBlock.UnpVer = 9999))), this.shortBlock.Name = Raw.getBytes(NameSize).toString(); break; } case HEADER_TYPE.HEAD_ENDARC: const ArcFlags = Raw.getVarInt(); this.shortBlock.NextVolume = 0 != (1 & ArcFlags); break; default: console.log("Unknown header", this.shortBlock.headerType.toString(16), "at offset", this.ReadPos.toString(16)); } return { crc: this.shortBlock.HeadCRC, type: this.shortBlock.headerType, flags: this.shortBlock.Flags, headSize: this.shortBlock.HeadSize, size: this.shortBlock.DataSize, unpackedSize: this.shortBlock.UnpSize, host: this.shortBlock.HostOS, fileCrc: this.shortBlock.FileHash.CRC32, timestamp: 0, version: this.shortBlock.UnpVer, method: this.shortBlock.Method, nameSize: 0, attributes: this.shortBlock.FileAttr, name: this.shortBlock.Name, continuesFromPrevious: this.shortBlock.SplitBefore, continuesInNext: this.shortBlock.SplitAfter, isEncrypted: !1, hasComment: !1, hasInfoFromPrevious: !1, hasHighSize: !1, hasSpecialName: !1, hasSalt: !1, isOldVersion: !1, hasExtendedTime: !1 }; } }; function readHeader50(readable) { return new AcRead(readable).readHeader50(); } var parseHeader = async (Parser, fileMedia, offset = 0) => { const stream = await fileMedia.createReadStream({ start: offset, end: offset + Parser.HEADER_SIZE }); return new Parser(await streamToBuffer(stream)).parse(); }, RarFilesPackage = class extends _events.EventEmitter { constructor(fileMedias) { super(), this.rarFileBundle = makeRarFileBundle(fileMedias); } async parseFile(rarFile, opts) { let countAllFiles = 0; const fileChunks = []; let fileOffset = 0; const stream = await rarFile.createReadStream({ start: 0, end: 6 }); if ((await streamToBuffer(stream)).equals(Buffer.from([ 82, 97, 114, 33, 26, 7, 1 ]))) { fileOffset += 8; let headSizeOffset = fileOffset; const markerHeaderSize = await (readable = { read: async size => { const readable = await rarFile.createReadStream({ start: headSizeOffset, end: headSizeOffset + size - 1 }); return headSizeOffset += size, streamToBuffer(readable); } }, new AcRead(readable).readHeader50(!0)); fileOffset += markerHeaderSize; let countFiles = 0, retrievedFiles = 0; for (;fileOffset < rarFile.length - TerminatorHeaderParser.HEADER_SIZE; ) { let getFileChunk2 = function() { if (0 !== fileHead.method) throw new Error("Decompression is not implemented"); return { name: fileHead.name, fileHead: fileHead, chunk: new RarFileChunk(rarFile, fileOffset, fileOffset + fileHead.size - 1) }; }, fileHeadOffset = fileOffset; const fileHead = await readHeader50({ read: async size => { const readable = await rarFile.createReadStream({ start: fileHeadOffset, end: fileHeadOffset + size - 1 }); return fileHeadOffset += size, streamToBuffer(readable); } }); if (2 !== fileHead.type) break; if (fileOffset += fileHead.headSize, opts.filter) { if (opts.filter(fileHead.name, countFiles) && (fileChunks.push(getFileChunk2()), retrievedFiles++, opts.hasOwnProperty("maxFiles") && retrievedFiles === opts.maxFiles)) { countAllFiles++; break; } } else fileChunks.push(getFileChunk2()); fileOffset += fileHead.size, countFiles++, countAllFiles++; } return this.emit("file-parsed", rarFile), { chunks: fileChunks, count: countAllFiles }; } { const markerHead = await parseHeader(MarkerHeaderParser, rarFile); fileOffset += markerHead.size; const archiveHeader = await parseHeader(ArchiveHeaderParser, rarFile, fileOffset); fileOffset += archiveHeader.size; let countFiles = 0, retrievedFiles = 0; for (;fileOffset < rarFile.length - TerminatorHeaderParser.HEADER_SIZE; ) { let getFileChunk2 = function() { if (48 !== fileHead.method) throw new Error("Decompression is not implemented"); return { name: fileHead.name, fileHead: fileHead, chunk: new RarFileChunk(rarFile, fileOffset, fileOffset + fileHead.size - 1) }; }; const fileHead = await parseHeader(FileHeaderParser, rarFile, fileOffset); if (116 !== fileHead.type) break; if (fileOffset += fileHead.headSize, opts.filter) { if (opts.filter(fileHead.name, countFiles) && (fileChunks.push(getFileChunk2()), retrievedFiles++, opts.hasOwnProperty("maxFiles") && retrievedFiles === opts.maxFiles)) { countAllFiles++; break; } } else fileChunks.push(getFileChunk2()); fileOffset += fileHead.size, countFiles++, countAllFiles++; } return this.emit("file-parsed", rarFile), { chunks: fileChunks, count: countAllFiles }; } var readable; } async parse(opts) { opts = opts || {}, this.emit("parsing-start", this.rarFileBundle); const parsedFileChunks = [], {files: files} = this.rarFileBundle; for (let i = 0; i < files.length; ++i) { const file = files[i], {chunks: chunks, count: count} = await this.parseFile(file, opts); if (!chunks.length) return this.emit("parsing-complete", []), []; const {fileHead: fileHead, chunk: chunk} = chunks[chunks.length - 1], chunkSize = Math.abs(chunk.endOffset - chunk.startOffset); let innerFileSize = fileHead.unpackedSize; if (parsedFileChunks.push(chunks), fileHead.continuesInNext && 1 === count && i > 0) for (;Math.abs(innerFileSize - chunkSize) >= chunkSize; ) { const nextFile = files[++i]; parsedFileChunks.push([ { name: fileHead.name, chunk: new RarFileChunk(nextFile, chunk.startOffset, chunk.endOffset) } ]), this.emit("file-parsed", nextFile), innerFileSize -= chunkSize; } } const fileChunks = parsedFileChunks.flat(), grouped = (fn = f => f.name, object = fileChunks.reduce(((prev, curr) => { const groupKey = fn(curr), group = prev[groupKey] || []; return group.push(curr), { ...prev, [groupKey]: group }; }), {}), mapper = value => value.map((v => v.chunk)), Object.fromEntries(Object.entries(object).map((([key, value]) => [ key, mapper(value) ])))); var object, mapper, fn; const innerFiles = Object.entries(grouped).map((([name, chunks]) => new class { constructor(name, rarFileChunks) { this.name = name, this.rarFileChunks = rarFileChunks, this.length = rarFileChunks.map((c => c.length)).reduce(((s, n) => s + n)), this.chunkMap = this.calculateChunkMap(rarFileChunks), this.name = name; } async readToEnd() { const stream = await this.createReadStream({ start: 0, end: this.length - 1 }); return streamToBuffer(stream); } getChunksToStream(fileStart, fileEnd) { const {index: startIndex, start: startOffset} = this.findMappedChunk(fileStart); let {index: endIndex, end: endOffset} = this.findMappedChunk(fileEnd); const chunksToStream = this.rarFileChunks.slice(startIndex, endIndex + 1), last = chunksToStream.length - 1; chunksToStream[0] = chunksToStream[0].padStart(Math.abs(startOffset - fileStart)); let diff = Math.abs(endOffset - fileEnd); return diff === this.rarFileChunks.length && (diff = 0), 0 !== diff && (chunksToStream[last] = chunksToStream[last].padEnd(diff)), chunksToStream; } createReadStream(interval) { interval || (interval = { start: 0, end: this.length - 1 }); let {start: start, end: end} = interval; if (start < 0 || end >= this.length) throw Error("Illegal start/end offset"); return Promise.resolve(new InnerFileStream(this.getChunksToStream(start, end))); } calculateChunkMap(rarFileChunks) { const chunkMap = []; let index = 0, fileOffset = 0; for (const chunk of rarFileChunks) { const start = fileOffset, end = fileOffset + chunk.length; fileOffset = end + 1, chunkMap.push({ index: index, start: start, end: end, chunk: chunk }), index++; } return chunkMap; } findMappedChunk(offset) { let selectedMap = this.chunkMap[0]; for (const chunkMapping of this.chunkMap) if (offset >= chunkMapping.start && offset <= chunkMapping.end) { selectedMap = chunkMapping; break; } return selectedMap; } }(name, chunks))); return this.emit("parsing-complete", innerFiles), innerFiles; } }, _path = __webpack_require__(5), _fs = __webpack_require__(2); exports.LocalFileMedia = class { constructor(path) { this.path = path, this.name = _path.basename.call(void 0, path), this.length = _fs.statSync.call(void 0, path).size; } createReadStream(interval) { return Promise.resolve(_fs.createReadStream.call(void 0, this.path, interval)); } }, exports.RarFilesPackage = RarFilesPackage; }, function(module, exports, __webpack_require__) { const needle = __webpack_require__(73), getContentLength = __webpack_require__(1125); module.exports = async function(url) { return new Promise((async (resolve, reject) => { let contentLength = !1; if ("object" == typeof url && (contentLength = url.bytes, url = url.url), !contentLength) try { contentLength = await getContentLength(url); } catch (e) { return console.error(e), void reject(e); } let fileName = url.split("/").pop(); (fileName || "").includes(".") ? (fileName = decodeURIComponent(fileName), fileName.includes("?") && (fileName = fileName.split("?")[0])) : fileName = "archive.rar", resolve({ length: parseInt(contentLength), name: fileName, createReadStream: range => { const opts = { follow_max: 5, rejectUnauthorized: !1 }; return Object.values(range).length && (range.start = range.start || 0, range.end = range.end || 0, (range.end > contentLength - 1 || 0 === range.end) && (range.end = ""), opts.headers = { range: `bytes=${range.start}-${range.end}` }), needle.get(url, opts); } }); })); }; }, function(module, exports, __webpack_require__) { const request = __webpack_require__(61); module.exports = async function(url) { return new Promise(((resolve, reject) => { const req = request({ url: url, followRedirect: !0, maxRedirects: 5, strictSSL: !1 }); req.on("response", (function(d) { req.abort(), d.headers["content-length"] ? resolve(d.headers["content-length"]) : reject("Could not retrieve content-length from ranged request"); })).on("error", reject); })); }; }, function(module, exports, __webpack_require__) { "use strict"; var punycode, net = __webpack_require__(39), urlParse = __webpack_require__(7).parse, util = __webpack_require__(0), pubsuffix = __webpack_require__(516), Store = __webpack_require__(518).Store, MemoryCookieStore = __webpack_require__(1129).MemoryCookieStore, pathMatch = __webpack_require__(520).pathMatch, VERSION = __webpack_require__(1130).version; try { punycode = __webpack_require__(517); } catch (e) { console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization"); } var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/, CONTROL_CHARS = /[\x00-\x1F]/, TERMINATORS = [ "\n", "\r", "\0" ], PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/, DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/, MONTH_TO_NUM = { jan: 0, feb: 1, mar: 2, apr: 3, may: 4, jun: 5, jul: 6, aug: 7, sep: 8, oct: 9, nov: 10, dec: 11 }, NUM_TO_MONTH = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], NUM_TO_DAY = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]; function parseDigits(token, minDigits, maxDigits, trailingOK) { for (var count = 0; count < token.length; ) { var c = token.charCodeAt(count); if (c <= 47 || c >= 58) break; count++; } return count < minDigits || count > maxDigits ? null : trailingOK || count == token.length ? parseInt(token.substr(0, count), 10) : null; } function parseTime(token) { var parts = token.split(":"), result = [ 0, 0, 0 ]; if (3 !== parts.length) return null; for (var i = 0; i < 3; i++) { var trailingOK = 2 == i, num = parseDigits(parts[i], 1, 2, trailingOK); if (null === num) return null; result[i] = num; } return result; } function parseMonth(token) { token = String(token).substr(0, 3).toLowerCase(); var num = MONTH_TO_NUM[token]; return num >= 0 ? num : null; } function parseDate(str) { if (str) { var tokens = str.split(DATE_DELIM); if (tokens) { for (var hour = null, minute = null, second = null, dayOfMonth = null, month = null, year = null, i = 0; i < tokens.length; i++) { var result, token = tokens[i].trim(); token.length && (null === second && (result = parseTime(token)) ? (hour = result[0], minute = result[1], second = result[2]) : null !== dayOfMonth || null === (result = parseDigits(token, 1, 2, !0)) ? null !== month || null === (result = parseMonth(token)) ? null === year && null !== (result = parseDigits(token, 2, 4, !0)) && ((year = result) >= 70 && year <= 99 ? year += 1900 : year >= 0 && year <= 69 && (year += 2e3)) : month = result : dayOfMonth = result); } if (!(null === dayOfMonth || null === month || null === year || null === second || dayOfMonth < 1 || dayOfMonth > 31 || year < 1601 || hour > 23 || minute > 59 || second > 59)) return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second)); } } } function formatDate(date) { var d = date.getUTCDate(); d = d >= 10 ? d : "0" + d; var h = date.getUTCHours(); h = h >= 10 ? h : "0" + h; var m = date.getUTCMinutes(); m = m >= 10 ? m : "0" + m; var s = date.getUTCSeconds(); return s = s >= 10 ? s : "0" + s, NUM_TO_DAY[date.getUTCDay()] + ", " + d + " " + NUM_TO_MONTH[date.getUTCMonth()] + " " + date.getUTCFullYear() + " " + h + ":" + m + ":" + s + " GMT"; } function canonicalDomain(str) { return null == str ? null : (str = str.trim().replace(/^\./, ""), punycode && /[^\u0001-\u007f]/.test(str) && (str = punycode.toASCII(str)), str.toLowerCase()); } function domainMatch(str, domStr, canonicalize) { if (null == str || null == domStr) return null; if (!1 !== canonicalize && (str = canonicalDomain(str), domStr = canonicalDomain(domStr)), str == domStr) return !0; if (net.isIP(str)) return !1; var idx = str.indexOf(domStr); return !(idx <= 0) && str.length === domStr.length + idx && "." === str.substr(idx - 1, 1); } function defaultPath(path) { if (!path || "/" !== path.substr(0, 1)) return "/"; if ("/" === path) return path; var rightSlash = path.lastIndexOf("/"); return 0 === rightSlash ? "/" : path.slice(0, rightSlash); } function parse(str, options) { options && "object" == typeof options || (options = {}); var firstSemi = (str = str.trim()).indexOf(";"), c = (function(cookiePair, looseMode) { var cookieName, cookieValue, firstEq = (cookiePair = (function(str) { for (var t = 0; t < TERMINATORS.length; t++) { var terminatorIdx = str.indexOf(TERMINATORS[t]); -1 !== terminatorIdx && (str = str.substr(0, terminatorIdx)); } return str; })(cookiePair)).indexOf("="); if (looseMode) 0 === firstEq && (firstEq = (cookiePair = cookiePair.substr(1)).indexOf("=")); else if (firstEq <= 0) return; if (firstEq <= 0 ? (cookieName = "", cookieValue = cookiePair.trim()) : (cookieName = cookiePair.substr(0, firstEq).trim(), cookieValue = cookiePair.substr(firstEq + 1).trim()), !CONTROL_CHARS.test(cookieName) && !CONTROL_CHARS.test(cookieValue)) { var c = new Cookie; return c.key = cookieName, c.value = cookieValue, c; } })(-1 === firstSemi ? str : str.substr(0, firstSemi), !!options.loose); if (c) { if (-1 === firstSemi) return c; var unparsed = str.slice(firstSemi + 1).trim(); if (0 === unparsed.length) return c; for (var cookie_avs = unparsed.split(";"); cookie_avs.length; ) { var av = cookie_avs.shift().trim(); if (0 !== av.length) { var av_key, av_value, av_sep = av.indexOf("="); switch (-1 === av_sep ? (av_key = av, av_value = null) : (av_key = av.substr(0, av_sep), av_value = av.substr(av_sep + 1)), av_key = av_key.trim().toLowerCase(), av_value && (av_value = av_value.trim()), av_key) { case "expires": if (av_value) { var exp = parseDate(av_value); exp && (c.expires = exp); } break; case "max-age": if (av_value && /^-?[0-9]+$/.test(av_value)) { var delta = parseInt(av_value, 10); c.setMaxAge(delta); } break; case "domain": if (av_value) { var domain = av_value.trim().replace(/^\./, ""); domain && (c.domain = domain.toLowerCase()); } break; case "path": c.path = av_value && "/" === av_value[0] ? av_value : null; break; case "secure": c.secure = !0; break; case "httponly": c.httpOnly = !0; break; default: c.extensions = c.extensions || [], c.extensions.push(av); } } } return c; } } function jsonParse(str) { var obj; try { obj = JSON.parse(str); } catch (e) { return e; } return obj; } function fromJSON(str) { if (!str) return null; var obj; if ("string" == typeof str) { if ((obj = jsonParse(str)) instanceof Error) return null; } else obj = str; for (var c = new Cookie, i = 0; i < Cookie.serializableProperties.length; i++) { var prop = Cookie.serializableProperties[i]; void 0 !== obj[prop] && obj[prop] !== Cookie.prototype[prop] && ("expires" === prop || "creation" === prop || "lastAccessed" === prop ? null === obj[prop] ? c[prop] = null : c[prop] = "Infinity" == obj[prop] ? "Infinity" : new Date(obj[prop]) : c[prop] = obj[prop]); } return c; } function cookieCompare(a, b) { var cmp = 0, aPathLen = a.path ? a.path.length : 0; return 0 != (cmp = (b.path ? b.path.length : 0) - aPathLen) || 0 != (cmp = (a.creation ? a.creation.getTime() : 2147483647e3) - (b.creation ? b.creation.getTime() : 2147483647e3)) ? cmp : cmp = a.creationIndex - b.creationIndex; } function getCookieContext(url) { if (url instanceof Object) return url; try { url = decodeURI(url); } catch (err) {} return urlParse(url); } function Cookie(options) { options = options || {}, Object.keys(options).forEach((function(prop) { Cookie.prototype.hasOwnProperty(prop) && Cookie.prototype[prop] !== options[prop] && "_" !== prop.substr(0, 1) && (this[prop] = options[prop]); }), this), this.creation = this.creation || new Date, Object.defineProperty(this, "creationIndex", { configurable: !1, enumerable: !1, writable: !0, value: ++Cookie.cookiesCreated }); } function CookieJar(store, options) { "boolean" == typeof options ? options = { rejectPublicSuffixes: options } : null == options && (options = {}), null != options.rejectPublicSuffixes && (this.rejectPublicSuffixes = options.rejectPublicSuffixes), null != options.looseMode && (this.enableLooseMode = options.looseMode), store || (store = new MemoryCookieStore), this.store = store; } Cookie.cookiesCreated = 0, Cookie.parse = parse, Cookie.fromJSON = fromJSON, Cookie.prototype.key = "", Cookie.prototype.value = "", Cookie.prototype.expires = "Infinity", Cookie.prototype.maxAge = null, Cookie.prototype.domain = null, Cookie.prototype.path = null, Cookie.prototype.secure = !1, Cookie.prototype.httpOnly = !1, Cookie.prototype.extensions = null, Cookie.prototype.hostOnly = null, Cookie.prototype.pathIsDefault = null, Cookie.prototype.creation = null, Cookie.prototype.lastAccessed = null, Object.defineProperty(Cookie.prototype, "creationIndex", { configurable: !0, enumerable: !1, writable: !0, value: 0 }), Cookie.serializableProperties = Object.keys(Cookie.prototype).filter((function(prop) { return !(Cookie.prototype[prop] instanceof Function || "creationIndex" === prop || "_" === prop.substr(0, 1)); })), Cookie.prototype.inspect = function() { var now = Date.now(); return 'Cookie="' + this.toString() + "; hostOnly=" + (null != this.hostOnly ? this.hostOnly : "?") + "; aAge=" + (this.lastAccessed ? now - this.lastAccessed.getTime() + "ms" : "?") + "; cAge=" + (this.creation ? now - this.creation.getTime() + "ms" : "?") + '"'; }, util.inspect.custom && (Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect), Cookie.prototype.toJSON = function() { for (var obj = {}, props = Cookie.serializableProperties, i = 0; i < props.length; i++) { var prop = props[i]; this[prop] !== Cookie.prototype[prop] && ("expires" === prop || "creation" === prop || "lastAccessed" === prop ? null === this[prop] ? obj[prop] = null : obj[prop] = "Infinity" == this[prop] ? "Infinity" : this[prop].toISOString() : "maxAge" === prop ? null !== this[prop] && (obj[prop] = this[prop] == 1 / 0 || this[prop] == -1 / 0 ? this[prop].toString() : this[prop]) : this[prop] !== Cookie.prototype[prop] && (obj[prop] = this[prop])); } return obj; }, Cookie.prototype.clone = function() { return fromJSON(this.toJSON()); }, Cookie.prototype.validate = function() { if (!COOKIE_OCTETS.test(this.value)) return !1; if (!(this.expires == 1 / 0 || this.expires instanceof Date || parseDate(this.expires))) return !1; if (null != this.maxAge && this.maxAge <= 0) return !1; if (null != this.path && !PATH_VALUE.test(this.path)) return !1; var cdomain = this.cdomain(); if (cdomain) { if (cdomain.match(/\.$/)) return !1; if (null == pubsuffix.getPublicSuffix(cdomain)) return !1; } return !0; }, Cookie.prototype.setExpires = function(exp) { exp instanceof Date ? this.expires = exp : this.expires = parseDate(exp) || "Infinity"; }, Cookie.prototype.setMaxAge = function(age) { this.maxAge = age === 1 / 0 || age === -1 / 0 ? age.toString() : age; }, Cookie.prototype.cookieString = function() { var val = this.value; return null == val && (val = ""), "" === this.key ? val : this.key + "=" + val; }, Cookie.prototype.toString = function() { var str = this.cookieString(); return this.expires != 1 / 0 && (this.expires instanceof Date ? str += "; Expires=" + formatDate(this.expires) : str += "; Expires=" + this.expires), null != this.maxAge && this.maxAge != 1 / 0 && (str += "; Max-Age=" + this.maxAge), this.domain && !this.hostOnly && (str += "; Domain=" + this.domain), this.path && (str += "; Path=" + this.path), this.secure && (str += "; Secure"), this.httpOnly && (str += "; HttpOnly"), this.extensions && this.extensions.forEach((function(ext) { str += "; " + ext; })), str; }, Cookie.prototype.TTL = function(now) { if (null != this.maxAge) return this.maxAge <= 0 ? 0 : 1e3 * this.maxAge; var expires = this.expires; return expires != 1 / 0 ? (expires instanceof Date || (expires = parseDate(expires) || 1 / 0), expires == 1 / 0 ? 1 / 0 : expires.getTime() - (now || Date.now())) : 1 / 0; }, Cookie.prototype.expiryTime = function(now) { if (null != this.maxAge) { var relativeTo = now || this.creation || new Date, age = this.maxAge <= 0 ? -1 / 0 : 1e3 * this.maxAge; return relativeTo.getTime() + age; } return this.expires == 1 / 0 ? 1 / 0 : this.expires.getTime(); }, Cookie.prototype.expiryDate = function(now) { var millisec = this.expiryTime(now); return millisec == 1 / 0 ? new Date(2147483647e3) : millisec == -1 / 0 ? new Date(0) : new Date(millisec); }, Cookie.prototype.isPersistent = function() { return null != this.maxAge || this.expires != 1 / 0; }, Cookie.prototype.cdomain = Cookie.prototype.canonicalizedDomain = function() { return null == this.domain ? null : canonicalDomain(this.domain); }, CookieJar.prototype.store = null, CookieJar.prototype.rejectPublicSuffixes = !0, CookieJar.prototype.enableLooseMode = !1; var CAN_BE_SYNC = []; CAN_BE_SYNC.push("setCookie"), CookieJar.prototype.setCookie = function(cookie, url, options, cb) { var err, context = getCookieContext(url); options instanceof Function && (cb = options, options = {}); var host = canonicalDomain(context.hostname), loose = this.enableLooseMode; if (null != options.loose && (loose = options.loose), cookie instanceof Cookie || (cookie = Cookie.parse(cookie, { loose: loose })), !cookie) return err = new Error("Cookie failed to parse"), cb(options.ignoreError ? null : err); var now = options.now || new Date; if (this.rejectPublicSuffixes && cookie.domain && null == pubsuffix.getPublicSuffix(cookie.cdomain())) return err = new Error("Cookie has domain set to a public suffix"), cb(options.ignoreError ? null : err); if (cookie.domain) { if (!domainMatch(host, cookie.cdomain(), !1)) return err = new Error("Cookie not in this host's domain. Cookie:" + cookie.cdomain() + " Request:" + host), cb(options.ignoreError ? null : err); null == cookie.hostOnly && (cookie.hostOnly = !1); } else cookie.hostOnly = !0, cookie.domain = host; if (cookie.path && "/" === cookie.path[0] || (cookie.path = defaultPath(context.pathname), cookie.pathIsDefault = !0), !1 === options.http && cookie.httpOnly) return err = new Error("Cookie is HttpOnly and this isn't an HTTP API"), cb(options.ignoreError ? null : err); var store = this.store; store.updateCookie || (store.updateCookie = function(oldCookie, newCookie, cb) { this.putCookie(newCookie, cb); }), store.findCookie(cookie.domain, cookie.path, cookie.key, (function(err, oldCookie) { if (err) return cb(err); var next = function(err) { if (err) return cb(err); cb(null, cookie); }; if (oldCookie) { if (!1 === options.http && oldCookie.httpOnly) return err = new Error("old Cookie is HttpOnly and this isn't an HTTP API"), cb(options.ignoreError ? null : err); cookie.creation = oldCookie.creation, cookie.creationIndex = oldCookie.creationIndex, cookie.lastAccessed = now, store.updateCookie(oldCookie, cookie, next); } else cookie.creation = cookie.lastAccessed = now, store.putCookie(cookie, next); })); }, CAN_BE_SYNC.push("getCookies"), CookieJar.prototype.getCookies = function(url, options, cb) { var context = getCookieContext(url); options instanceof Function && (cb = options, options = {}); var host = canonicalDomain(context.hostname), path = context.pathname || "/", secure = options.secure; null != secure || !context.protocol || "https:" != context.protocol && "wss:" != context.protocol || (secure = !0); var http = options.http; null == http && (http = !0); var now = options.now || Date.now(), expireCheck = !1 !== options.expire, allPaths = !!options.allPaths, store = this.store; function matchingCookie(c) { if (c.hostOnly) { if (c.domain != host) return !1; } else if (!domainMatch(host, c.domain, !1)) return !1; return !(!allPaths && !pathMatch(path, c.path) || c.secure && !secure || c.httpOnly && !http || expireCheck && c.expiryTime() <= now && (store.removeCookie(c.domain, c.path, c.key, (function() {})), 1)); } store.findCookies(host, allPaths ? null : path, (function(err, cookies) { if (err) return cb(err); cookies = cookies.filter(matchingCookie), !1 !== options.sort && (cookies = cookies.sort(cookieCompare)); var now = new Date; cookies.forEach((function(c) { c.lastAccessed = now; })), cb(null, cookies); })); }, CAN_BE_SYNC.push("getCookieString"), CookieJar.prototype.getCookieString = function() { var args = Array.prototype.slice.call(arguments, 0), cb = args.pop(), next = function(err, cookies) { err ? cb(err) : cb(null, cookies.sort(cookieCompare).map((function(c) { return c.cookieString(); })).join("; ")); }; args.push(next), this.getCookies.apply(this, args); }, CAN_BE_SYNC.push("getSetCookieStrings"), CookieJar.prototype.getSetCookieStrings = function() { var args = Array.prototype.slice.call(arguments, 0), cb = args.pop(), next = function(err, cookies) { err ? cb(err) : cb(null, cookies.map((function(c) { return c.toString(); }))); }; args.push(next), this.getCookies.apply(this, args); }, CAN_BE_SYNC.push("serialize"), CookieJar.prototype.serialize = function(cb) { var type = this.store.constructor.name; "Object" === type && (type = null); var serialized = { version: "tough-cookie@" + VERSION, storeType: type, rejectPublicSuffixes: !!this.rejectPublicSuffixes, cookies: [] }; if (!this.store.getAllCookies || "function" != typeof this.store.getAllCookies) return cb(new Error("store does not support getAllCookies and cannot be serialized")); this.store.getAllCookies((function(err, cookies) { return err ? cb(err) : (serialized.cookies = cookies.map((function(cookie) { return delete (cookie = cookie instanceof Cookie ? cookie.toJSON() : cookie).creationIndex, cookie; })), cb(null, serialized)); })); }, CookieJar.prototype.toJSON = function() { return this.serializeSync(); }, CAN_BE_SYNC.push("_importCookies"), CookieJar.prototype._importCookies = function(serialized, cb) { var jar = this, cookies = serialized.cookies; if (!cookies || !Array.isArray(cookies)) return cb(new Error("serialized jar has no cookies array")); cookies = cookies.slice(), (function putNext(err) { if (err) return cb(err); if (!cookies.length) return cb(err, jar); var cookie; try { cookie = fromJSON(cookies.shift()); } catch (e) { return cb(e); } if (null === cookie) return putNext(null); jar.store.putCookie(cookie, putNext); })(); }, CookieJar.deserialize = function(strOrObj, store, cb) { var serialized; if (3 !== arguments.length && (cb = store, store = null), "string" == typeof strOrObj) { if ((serialized = jsonParse(strOrObj)) instanceof Error) return cb(serialized); } else serialized = strOrObj; var jar = new CookieJar(store, serialized.rejectPublicSuffixes); jar._importCookies(serialized, (function(err) { if (err) return cb(err); cb(null, jar); })); }, CookieJar.deserializeSync = function(strOrObj, store) { var serialized = "string" == typeof strOrObj ? JSON.parse(strOrObj) : strOrObj, jar = new CookieJar(store, serialized.rejectPublicSuffixes); if (!jar.store.synchronous) throw new Error("CookieJar store is not synchronous; use async API instead."); return jar._importCookiesSync(serialized), jar; }, CookieJar.fromJSON = CookieJar.deserializeSync, CAN_BE_SYNC.push("clone"), CookieJar.prototype.clone = function(newStore, cb) { 1 === arguments.length && (cb = newStore, newStore = null), this.serialize((function(err, serialized) { if (err) return cb(err); CookieJar.deserialize(newStore, serialized, cb); })); }, CAN_BE_SYNC.forEach((function(method) { CookieJar.prototype[method + "Sync"] = (function(method) { return function() { if (!this.store.synchronous) throw new Error("CookieJar store is not synchronous; use async API instead."); var syncErr, syncResult, args = Array.prototype.slice.call(arguments); if (args.push((function(err, result) { syncErr = err, syncResult = result; })), this[method].apply(this, args), syncErr) throw syncErr; return syncResult; }; })(method); })), exports.CookieJar = CookieJar, exports.Cookie = Cookie, exports.Store = Store, exports.MemoryCookieStore = MemoryCookieStore, exports.parseDate = parseDate, exports.formatDate = formatDate, exports.parse = parse, exports.fromJSON = fromJSON, exports.domainMatch = domainMatch, exports.defaultPath = defaultPath, exports.pathMatch = pathMatch, exports.getPublicSuffix = pubsuffix.getPublicSuffix, exports.cookieCompare = cookieCompare, exports.permuteDomain = __webpack_require__(519).permuteDomain, exports.permutePath = function(path) { if ("/" === path) return [ "/" ]; path.lastIndexOf("/") === path.length - 1 && (path = path.substr(0, path.length - 1)); for (var permutations = [ path ]; path.length > 1; ) { var lindex = path.lastIndexOf("/"); if (0 === lindex) break; path = path.substr(0, lindex), permutations.push(path); } return permutations.push("/"), permutations; }, exports.canonicalDomain = canonicalDomain; }, function(module, exports, __webpack_require__) { "use strict"; var Punycode = __webpack_require__(517), internals = {}; internals.rules = __webpack_require__(1128).map((function(rule) { return { rule: rule, suffix: rule.replace(/^(\*\.|\!)/, ""), punySuffix: -1, wildcard: "*" === rule.charAt(0), exception: "!" === rule.charAt(0) }; })), internals.endsWith = function(str, suffix) { return -1 !== str.indexOf(suffix, str.length - suffix.length); }, internals.findRule = function(domain) { var punyDomain = Punycode.toASCII(domain); return internals.rules.reduce((function(memo, rule) { return -1 === rule.punySuffix && (rule.punySuffix = Punycode.toASCII(rule.suffix)), internals.endsWith(punyDomain, "." + rule.punySuffix) || punyDomain === rule.punySuffix ? rule : memo; }), null); }, exports.errorCodes = { DOMAIN_TOO_SHORT: "Domain name too short.", DOMAIN_TOO_LONG: "Domain name too long. It should be no more than 255 chars.", LABEL_STARTS_WITH_DASH: "Domain name label can not start with a dash.", LABEL_ENDS_WITH_DASH: "Domain name label can not end with a dash.", LABEL_TOO_LONG: "Domain name label should be at most 63 chars long.", LABEL_TOO_SHORT: "Domain name label should be at least 1 character long.", LABEL_INVALID_CHARS: "Domain name label can only contain alphanumeric characters or dashes." }, internals.validate = function(input) { var ascii = Punycode.toASCII(input); if (ascii.length < 1) return "DOMAIN_TOO_SHORT"; if (ascii.length > 255) return "DOMAIN_TOO_LONG"; for (var label, labels = ascii.split("."), i = 0; i < labels.length; ++i) { if (!(label = labels[i]).length) return "LABEL_TOO_SHORT"; if (label.length > 63) return "LABEL_TOO_LONG"; if ("-" === label.charAt(0)) return "LABEL_STARTS_WITH_DASH"; if ("-" === label.charAt(label.length - 1)) return "LABEL_ENDS_WITH_DASH"; if (!/^[a-z0-9\-]+$/.test(label)) return "LABEL_INVALID_CHARS"; } }, exports.parse = function(input) { if ("string" != typeof input) throw new TypeError("Domain name must be a string."); var domain = input.slice(0).toLowerCase(); "." === domain.charAt(domain.length - 1) && (domain = domain.slice(0, domain.length - 1)); var error = internals.validate(domain); if (error) return { input: input, error: { message: exports.errorCodes[error], code: error } }; var parsed = { input: input, tld: null, sld: null, domain: null, subdomain: null, listed: !1 }, domainParts = domain.split("."); if ("local" === domainParts[domainParts.length - 1]) return parsed; var handlePunycode = function() { return /xn--/.test(domain) ? (parsed.domain && (parsed.domain = Punycode.toASCII(parsed.domain)), parsed.subdomain && (parsed.subdomain = Punycode.toASCII(parsed.subdomain)), parsed) : parsed; }, rule = internals.findRule(domain); if (!rule) return domainParts.length < 2 ? parsed : (parsed.tld = domainParts.pop(), parsed.sld = domainParts.pop(), parsed.domain = [ parsed.sld, parsed.tld ].join("."), domainParts.length && (parsed.subdomain = domainParts.pop()), handlePunycode()); parsed.listed = !0; var tldParts = rule.suffix.split("."), privateParts = domainParts.slice(0, domainParts.length - tldParts.length); return rule.exception && privateParts.push(tldParts.shift()), parsed.tld = tldParts.join("."), privateParts.length ? (rule.wildcard && (tldParts.unshift(privateParts.pop()), parsed.tld = tldParts.join(".")), privateParts.length ? (parsed.sld = privateParts.pop(), parsed.domain = [ parsed.sld, parsed.tld ].join("."), privateParts.length && (parsed.subdomain = privateParts.join(".")), handlePunycode()) : handlePunycode()) : handlePunycode(); }, exports.get = function(domain) { return domain && exports.parse(domain).domain || null; }, exports.isValid = function(domain) { var parsed = exports.parse(domain); return Boolean(parsed.domain && parsed.listed); }; }, function(module) { module.exports = [ "ac", "com.ac", "edu.ac", "gov.ac", "net.ac", "mil.ac", "org.ac", "ad", "nom.ad", "ae", "co.ae", "net.ae", "org.ae", "sch.ae", "ac.ae", "gov.ae", "mil.ae", "aero", "accident-investigation.aero", "accident-prevention.aero", "aerobatic.aero", "aeroclub.aero", "aerodrome.aero", "agents.aero", "aircraft.aero", "airline.aero", "airport.aero", "air-surveillance.aero", "airtraffic.aero", "air-traffic-control.aero", "ambulance.aero", "amusement.aero", "association.aero", "author.aero", "ballooning.aero", "broker.aero", "caa.aero", "cargo.aero", "catering.aero", "certification.aero", "championship.aero", "charter.aero", "civilaviation.aero", "club.aero", "conference.aero", "consultant.aero", "consulting.aero", "control.aero", "council.aero", "crew.aero", "design.aero", "dgca.aero", "educator.aero", "emergency.aero", "engine.aero", "engineer.aero", "entertainment.aero", "equipment.aero", "exchange.aero", "express.aero", "federation.aero", "flight.aero", "freight.aero", "fuel.aero", "gliding.aero", "government.aero", "groundhandling.aero", "group.aero", "hanggliding.aero", "homebuilt.aero", "insurance.aero", "journal.aero", "journalist.aero", "leasing.aero", "logistics.aero", "magazine.aero", "maintenance.aero", "media.aero", "microlight.aero", "modelling.aero", "navigation.aero", "parachuting.aero", "paragliding.aero", "passenger-association.aero", "pilot.aero", "press.aero", "production.aero", "recreation.aero", "repbody.aero", "res.aero", "research.aero", "rotorcraft.aero", "safety.aero", "scientist.aero", "services.aero", "show.aero", "skydiving.aero", "software.aero", "student.aero", "trader.aero", "trading.aero", "trainer.aero", "union.aero", "workinggroup.aero", "works.aero", "af", "gov.af", "com.af", "org.af", "net.af", "edu.af", "ag", "com.ag", "org.ag", "net.ag", "co.ag", "nom.ag", "ai", "off.ai", "com.ai", "net.ai", "org.ai", "al", "com.al", "edu.al", "gov.al", "mil.al", "net.al", "org.al", "am", "co.am", "com.am", "commune.am", "net.am", "org.am", "ao", "ed.ao", "gv.ao", "og.ao", "co.ao", "pb.ao", "it.ao", "aq", "ar", "com.ar", "edu.ar", "gob.ar", "gov.ar", "int.ar", "mil.ar", "musica.ar", "net.ar", "org.ar", "tur.ar", "arpa", "e164.arpa", "in-addr.arpa", "ip6.arpa", "iris.arpa", "uri.arpa", "urn.arpa", "as", "gov.as", "asia", "at", "ac.at", "co.at", "gv.at", "or.at", "au", "com.au", "net.au", "org.au", "edu.au", "gov.au", "asn.au", "id.au", "info.au", "conf.au", "oz.au", "act.au", "nsw.au", "nt.au", "qld.au", "sa.au", "tas.au", "vic.au", "wa.au", "act.edu.au", "nsw.edu.au", "nt.edu.au", "qld.edu.au", "sa.edu.au", "tas.edu.au", "vic.edu.au", "wa.edu.au", "qld.gov.au", "sa.gov.au", "tas.gov.au", "vic.gov.au", "wa.gov.au", "aw", "com.aw", "ax", "az", "com.az", "net.az", "int.az", "gov.az", "org.az", "edu.az", "info.az", "pp.az", "mil.az", "name.az", "pro.az", "biz.az", "ba", "com.ba", "edu.ba", "gov.ba", "mil.ba", "net.ba", "org.ba", "bb", "biz.bb", "co.bb", "com.bb", "edu.bb", "gov.bb", "info.bb", "net.bb", "org.bb", "store.bb", "tv.bb", "*.bd", "be", "ac.be", "bf", "gov.bf", "bg", "a.bg", "b.bg", "c.bg", "d.bg", "e.bg", "f.bg", "g.bg", "h.bg", "i.bg", "j.bg", "k.bg", "l.bg", "m.bg", "n.bg", "o.bg", "p.bg", "q.bg", "r.bg", "s.bg", "t.bg", "u.bg", "v.bg", "w.bg", "x.bg", "y.bg", "z.bg", "0.bg", "1.bg", "2.bg", "3.bg", "4.bg", "5.bg", "6.bg", "7.bg", "8.bg", "9.bg", "bh", "com.bh", "edu.bh", "net.bh", "org.bh", "gov.bh", "bi", "co.bi", "com.bi", "edu.bi", "or.bi", "org.bi", "biz", "bj", "asso.bj", "barreau.bj", "gouv.bj", "bm", "com.bm", "edu.bm", "gov.bm", "net.bm", "org.bm", "bn", "com.bn", "edu.bn", "gov.bn", "net.bn", "org.bn", "bo", "com.bo", "edu.bo", "gob.bo", "int.bo", "org.bo", "net.bo", "mil.bo", "tv.bo", "web.bo", "academia.bo", "agro.bo", "arte.bo", "blog.bo", "bolivia.bo", "ciencia.bo", "cooperativa.bo", "democracia.bo", "deporte.bo", "ecologia.bo", "economia.bo", "empresa.bo", "indigena.bo", "industria.bo", "info.bo", "medicina.bo", "movimiento.bo", "musica.bo", "natural.bo", "nombre.bo", "noticias.bo", "patria.bo", "politica.bo", "profesional.bo", "plurinacional.bo", "pueblo.bo", "revista.bo", "salud.bo", "tecnologia.bo", "tksat.bo", "transporte.bo", "wiki.bo", "br", "9guacu.br", "abc.br", "adm.br", "adv.br", "agr.br", "aju.br", "am.br", "anani.br", "aparecida.br", "arq.br", "art.br", "ato.br", "b.br", "barueri.br", "belem.br", "bhz.br", "bio.br", "blog.br", "bmd.br", "boavista.br", "bsb.br", "campinagrande.br", "campinas.br", "caxias.br", "cim.br", "cng.br", "cnt.br", "com.br", "contagem.br", "coop.br", "cri.br", "cuiaba.br", "curitiba.br", "def.br", "ecn.br", "eco.br", "edu.br", "emp.br", "eng.br", "esp.br", "etc.br", "eti.br", "far.br", "feira.br", "flog.br", "floripa.br", "fm.br", "fnd.br", "fortal.br", "fot.br", "foz.br", "fst.br", "g12.br", "ggf.br", "goiania.br", "gov.br", "ac.gov.br", "al.gov.br", "am.gov.br", "ap.gov.br", "ba.gov.br", "ce.gov.br", "df.gov.br", "es.gov.br", "go.gov.br", "ma.gov.br", "mg.gov.br", "ms.gov.br", "mt.gov.br", "pa.gov.br", "pb.gov.br", "pe.gov.br", "pi.gov.br", "pr.gov.br", "rj.gov.br", "rn.gov.br", "ro.gov.br", "rr.gov.br", "rs.gov.br", "sc.gov.br", "se.gov.br", "sp.gov.br", "to.gov.br", "gru.br", "imb.br", "ind.br", "inf.br", "jab.br", "jampa.br", "jdf.br", "joinville.br", "jor.br", "jus.br", "leg.br", "lel.br", "londrina.br", "macapa.br", "maceio.br", "manaus.br", "maringa.br", "mat.br", "med.br", "mil.br", "morena.br", "mp.br", "mus.br", "natal.br", "net.br", "niteroi.br", "*.nom.br", "not.br", "ntr.br", "odo.br", "ong.br", "org.br", "osasco.br", "palmas.br", "poa.br", "ppg.br", "pro.br", "psc.br", "psi.br", "pvh.br", "qsl.br", "radio.br", "rec.br", "recife.br", "ribeirao.br", "rio.br", "riobranco.br", "riopreto.br", "salvador.br", "sampa.br", "santamaria.br", "santoandre.br", "saobernardo.br", "saogonca.br", "sjc.br", "slg.br", "slz.br", "sorocaba.br", "srv.br", "taxi.br", "tc.br", "teo.br", "the.br", "tmp.br", "trd.br", "tur.br", "tv.br", "udi.br", "vet.br", "vix.br", "vlog.br", "wiki.br", "zlg.br", "bs", "com.bs", "net.bs", "org.bs", "edu.bs", "gov.bs", "bt", "com.bt", "edu.bt", "gov.bt", "net.bt", "org.bt", "bv", "bw", "co.bw", "org.bw", "by", "gov.by", "mil.by", "com.by", "of.by", "bz", "com.bz", "net.bz", "org.bz", "edu.bz", "gov.bz", "ca", "ab.ca", "bc.ca", "mb.ca", "nb.ca", "nf.ca", "nl.ca", "ns.ca", "nt.ca", "nu.ca", "on.ca", "pe.ca", "qc.ca", "sk.ca", "yk.ca", "gc.ca", "cat", "cc", "cd", "gov.cd", "cf", "cg", "ch", "ci", "org.ci", "or.ci", "com.ci", "co.ci", "edu.ci", "ed.ci", "ac.ci", "net.ci", "go.ci", "asso.ci", "aéroport.ci", "int.ci", "presse.ci", "md.ci", "gouv.ci", "*.ck", "!www.ck", "cl", "gov.cl", "gob.cl", "co.cl", "mil.cl", "cm", "co.cm", "com.cm", "gov.cm", "net.cm", "cn", "ac.cn", "com.cn", "edu.cn", "gov.cn", "net.cn", "org.cn", "mil.cn", "公司.cn", "网络.cn", "網絡.cn", "ah.cn", "bj.cn", "cq.cn", "fj.cn", "gd.cn", "gs.cn", "gz.cn", "gx.cn", "ha.cn", "hb.cn", "he.cn", "hi.cn", "hl.cn", "hn.cn", "jl.cn", "js.cn", "jx.cn", "ln.cn", "nm.cn", "nx.cn", "qh.cn", "sc.cn", "sd.cn", "sh.cn", "sn.cn", "sx.cn", "tj.cn", "xj.cn", "xz.cn", "yn.cn", "zj.cn", "hk.cn", "mo.cn", "tw.cn", "co", "arts.co", "com.co", "edu.co", "firm.co", "gov.co", "info.co", "int.co", "mil.co", "net.co", "nom.co", "org.co", "rec.co", "web.co", "com", "coop", "cr", "ac.cr", "co.cr", "ed.cr", "fi.cr", "go.cr", "or.cr", "sa.cr", "cu", "com.cu", "edu.cu", "org.cu", "net.cu", "gov.cu", "inf.cu", "cv", "cw", "com.cw", "edu.cw", "net.cw", "org.cw", "cx", "gov.cx", "cy", "ac.cy", "biz.cy", "com.cy", "ekloges.cy", "gov.cy", "ltd.cy", "name.cy", "net.cy", "org.cy", "parliament.cy", "press.cy", "pro.cy", "tm.cy", "cz", "de", "dj", "dk", "dm", "com.dm", "net.dm", "org.dm", "edu.dm", "gov.dm", "do", "art.do", "com.do", "edu.do", "gob.do", "gov.do", "mil.do", "net.do", "org.do", "sld.do", "web.do", "dz", "com.dz", "org.dz", "net.dz", "gov.dz", "edu.dz", "asso.dz", "pol.dz", "art.dz", "ec", "com.ec", "info.ec", "net.ec", "fin.ec", "k12.ec", "med.ec", "pro.ec", "org.ec", "edu.ec", "gov.ec", "gob.ec", "mil.ec", "edu", "ee", "edu.ee", "gov.ee", "riik.ee", "lib.ee", "med.ee", "com.ee", "pri.ee", "aip.ee", "org.ee", "fie.ee", "eg", "com.eg", "edu.eg", "eun.eg", "gov.eg", "mil.eg", "name.eg", "net.eg", "org.eg", "sci.eg", "*.er", "es", "com.es", "nom.es", "org.es", "gob.es", "edu.es", "et", "com.et", "gov.et", "org.et", "edu.et", "biz.et", "name.et", "info.et", "net.et", "eu", "fi", "aland.fi", "*.fj", "*.fk", "fm", "fo", "fr", "asso.fr", "com.fr", "gouv.fr", "nom.fr", "prd.fr", "tm.fr", "aeroport.fr", "avocat.fr", "avoues.fr", "cci.fr", "chambagri.fr", "chirurgiens-dentistes.fr", "experts-comptables.fr", "geometre-expert.fr", "greta.fr", "huissier-justice.fr", "medecin.fr", "notaires.fr", "pharmacien.fr", "port.fr", "veterinaire.fr", "ga", "gb", "gd", "ge", "com.ge", "edu.ge", "gov.ge", "org.ge", "mil.ge", "net.ge", "pvt.ge", "gf", "gg", "co.gg", "net.gg", "org.gg", "gh", "com.gh", "edu.gh", "gov.gh", "org.gh", "mil.gh", "gi", "com.gi", "ltd.gi", "gov.gi", "mod.gi", "edu.gi", "org.gi", "gl", "co.gl", "com.gl", "edu.gl", "net.gl", "org.gl", "gm", "gn", "ac.gn", "com.gn", "edu.gn", "gov.gn", "org.gn", "net.gn", "gov", "gp", "com.gp", "net.gp", "mobi.gp", "edu.gp", "org.gp", "asso.gp", "gq", "gr", "com.gr", "edu.gr", "net.gr", "org.gr", "gov.gr", "gs", "gt", "com.gt", "edu.gt", "gob.gt", "ind.gt", "mil.gt", "net.gt", "org.gt", "gu", "com.gu", "edu.gu", "gov.gu", "guam.gu", "info.gu", "net.gu", "org.gu", "web.gu", "gw", "gy", "co.gy", "com.gy", "edu.gy", "gov.gy", "net.gy", "org.gy", "hk", "com.hk", "edu.hk", "gov.hk", "idv.hk", "net.hk", "org.hk", "公司.hk", "教育.hk", "敎育.hk", "政府.hk", "個人.hk", "个人.hk", "箇人.hk", "網络.hk", "网络.hk", "组織.hk", "網絡.hk", "网絡.hk", "组织.hk", "組織.hk", "組织.hk", "hm", "hn", "com.hn", "edu.hn", "org.hn", "net.hn", "mil.hn", "gob.hn", "hr", "iz.hr", "from.hr", "name.hr", "com.hr", "ht", "com.ht", "shop.ht", "firm.ht", "info.ht", "adult.ht", "net.ht", "pro.ht", "org.ht", "med.ht", "art.ht", "coop.ht", "pol.ht", "asso.ht", "edu.ht", "rel.ht", "gouv.ht", "perso.ht", "hu", "co.hu", "info.hu", "org.hu", "priv.hu", "sport.hu", "tm.hu", "2000.hu", "agrar.hu", "bolt.hu", "casino.hu", "city.hu", "erotica.hu", "erotika.hu", "film.hu", "forum.hu", "games.hu", "hotel.hu", "ingatlan.hu", "jogasz.hu", "konyvelo.hu", "lakas.hu", "media.hu", "news.hu", "reklam.hu", "sex.hu", "shop.hu", "suli.hu", "szex.hu", "tozsde.hu", "utazas.hu", "video.hu", "id", "ac.id", "biz.id", "co.id", "desa.id", "go.id", "mil.id", "my.id", "net.id", "or.id", "ponpes.id", "sch.id", "web.id", "ie", "gov.ie", "il", "ac.il", "co.il", "gov.il", "idf.il", "k12.il", "muni.il", "net.il", "org.il", "im", "ac.im", "co.im", "com.im", "ltd.co.im", "net.im", "org.im", "plc.co.im", "tt.im", "tv.im", "in", "co.in", "firm.in", "net.in", "org.in", "gen.in", "ind.in", "nic.in", "ac.in", "edu.in", "res.in", "gov.in", "mil.in", "info", "int", "eu.int", "io", "com.io", "iq", "gov.iq", "edu.iq", "mil.iq", "com.iq", "org.iq", "net.iq", "ir", "ac.ir", "co.ir", "gov.ir", "id.ir", "net.ir", "org.ir", "sch.ir", "ایران.ir", "ايران.ir", "is", "net.is", "com.is", "edu.is", "gov.is", "org.is", "int.is", "it", "gov.it", "edu.it", "abr.it", "abruzzo.it", "aosta-valley.it", "aostavalley.it", "bas.it", "basilicata.it", "cal.it", "calabria.it", "cam.it", "campania.it", "emilia-romagna.it", "emiliaromagna.it", "emr.it", "friuli-v-giulia.it", "friuli-ve-giulia.it", "friuli-vegiulia.it", "friuli-venezia-giulia.it", "friuli-veneziagiulia.it", "friuli-vgiulia.it", "friuliv-giulia.it", "friulive-giulia.it", "friulivegiulia.it", "friulivenezia-giulia.it", "friuliveneziagiulia.it", "friulivgiulia.it", "fvg.it", "laz.it", "lazio.it", "lig.it", "liguria.it", "lom.it", "lombardia.it", "lombardy.it", "lucania.it", "mar.it", "marche.it", "mol.it", "molise.it", "piedmont.it", "piemonte.it", "pmn.it", "pug.it", "puglia.it", "sar.it", "sardegna.it", "sardinia.it", "sic.it", "sicilia.it", "sicily.it", "taa.it", "tos.it", "toscana.it", "trentin-sud-tirol.it", "trentin-süd-tirol.it", "trentin-sudtirol.it", "trentin-südtirol.it", "trentin-sued-tirol.it", "trentin-suedtirol.it", "trentino-a-adige.it", "trentino-aadige.it", "trentino-alto-adige.it", "trentino-altoadige.it", "trentino-s-tirol.it", "trentino-stirol.it", "trentino-sud-tirol.it", "trentino-süd-tirol.it", "trentino-sudtirol.it", "trentino-südtirol.it", "trentino-sued-tirol.it", "trentino-suedtirol.it", "trentino.it", "trentinoa-adige.it", "trentinoaadige.it", "trentinoalto-adige.it", "trentinoaltoadige.it", "trentinos-tirol.it", "trentinostirol.it", "trentinosud-tirol.it", "trentinosüd-tirol.it", "trentinosudtirol.it", "trentinosüdtirol.it", "trentinosued-tirol.it", "trentinosuedtirol.it", "trentinsud-tirol.it", "trentinsüd-tirol.it", "trentinsudtirol.it", "trentinsüdtirol.it", "trentinsued-tirol.it", "trentinsuedtirol.it", "tuscany.it", "umb.it", "umbria.it", "val-d-aosta.it", "val-daosta.it", "vald-aosta.it", "valdaosta.it", "valle-aosta.it", "valle-d-aosta.it", "valle-daosta.it", "valleaosta.it", "valled-aosta.it", "valledaosta.it", "vallee-aoste.it", "vallée-aoste.it", "vallee-d-aoste.it", "vallée-d-aoste.it", "valleeaoste.it", "valléeaoste.it", "valleedaoste.it", "valléedaoste.it", "vao.it", "vda.it", "ven.it", "veneto.it", "ag.it", "agrigento.it", "al.it", "alessandria.it", "alto-adige.it", "altoadige.it", "an.it", "ancona.it", "andria-barletta-trani.it", "andria-trani-barletta.it", "andriabarlettatrani.it", "andriatranibarletta.it", "ao.it", "aosta.it", "aoste.it", "ap.it", "aq.it", "aquila.it", "ar.it", "arezzo.it", "ascoli-piceno.it", "ascolipiceno.it", "asti.it", "at.it", "av.it", "avellino.it", "ba.it", "balsan-sudtirol.it", "balsan-südtirol.it", "balsan-suedtirol.it", "balsan.it", "bari.it", "barletta-trani-andria.it", "barlettatraniandria.it", "belluno.it", "benevento.it", "bergamo.it", "bg.it", "bi.it", "biella.it", "bl.it", "bn.it", "bo.it", "bologna.it", "bolzano-altoadige.it", "bolzano.it", "bozen-sudtirol.it", "bozen-südtirol.it", "bozen-suedtirol.it", "bozen.it", "br.it", "brescia.it", "brindisi.it", "bs.it", "bt.it", "bulsan-sudtirol.it", "bulsan-südtirol.it", "bulsan-suedtirol.it", "bulsan.it", "bz.it", "ca.it", "cagliari.it", "caltanissetta.it", "campidano-medio.it", "campidanomedio.it", "campobasso.it", "carbonia-iglesias.it", "carboniaiglesias.it", "carrara-massa.it", "carraramassa.it", "caserta.it", "catania.it", "catanzaro.it", "cb.it", "ce.it", "cesena-forli.it", "cesena-forlì.it", "cesenaforli.it", "cesenaforlì.it", "ch.it", "chieti.it", "ci.it", "cl.it", "cn.it", "co.it", "como.it", "cosenza.it", "cr.it", "cremona.it", "crotone.it", "cs.it", "ct.it", "cuneo.it", "cz.it", "dell-ogliastra.it", "dellogliastra.it", "en.it", "enna.it", "fc.it", "fe.it", "fermo.it", "ferrara.it", "fg.it", "fi.it", "firenze.it", "florence.it", "fm.it", "foggia.it", "forli-cesena.it", "forlì-cesena.it", "forlicesena.it", "forlìcesena.it", "fr.it", "frosinone.it", "ge.it", "genoa.it", "genova.it", "go.it", "gorizia.it", "gr.it", "grosseto.it", "iglesias-carbonia.it", "iglesiascarbonia.it", "im.it", "imperia.it", "is.it", "isernia.it", "kr.it", "la-spezia.it", "laquila.it", "laspezia.it", "latina.it", "lc.it", "le.it", "lecce.it", "lecco.it", "li.it", "livorno.it", "lo.it", "lodi.it", "lt.it", "lu.it", "lucca.it", "macerata.it", "mantova.it", "massa-carrara.it", "massacarrara.it", "matera.it", "mb.it", "mc.it", "me.it", "medio-campidano.it", "mediocampidano.it", "messina.it", "mi.it", "milan.it", "milano.it", "mn.it", "mo.it", "modena.it", "monza-brianza.it", "monza-e-della-brianza.it", "monza.it", "monzabrianza.it", "monzaebrianza.it", "monzaedellabrianza.it", "ms.it", "mt.it", "na.it", "naples.it", "napoli.it", "no.it", "novara.it", "nu.it", "nuoro.it", "og.it", "ogliastra.it", "olbia-tempio.it", "olbiatempio.it", "or.it", "oristano.it", "ot.it", "pa.it", "padova.it", "padua.it", "palermo.it", "parma.it", "pavia.it", "pc.it", "pd.it", "pe.it", "perugia.it", "pesaro-urbino.it", "pesarourbino.it", "pescara.it", "pg.it", "pi.it", "piacenza.it", "pisa.it", "pistoia.it", "pn.it", "po.it", "pordenone.it", "potenza.it", "pr.it", "prato.it", "pt.it", "pu.it", "pv.it", "pz.it", "ra.it", "ragusa.it", "ravenna.it", "rc.it", "re.it", "reggio-calabria.it", "reggio-emilia.it", "reggiocalabria.it", "reggioemilia.it", "rg.it", "ri.it", "rieti.it", "rimini.it", "rm.it", "rn.it", "ro.it", "roma.it", "rome.it", "rovigo.it", "sa.it", "salerno.it", "sassari.it", "savona.it", "si.it", "siena.it", "siracusa.it", "so.it", "sondrio.it", "sp.it", "sr.it", "ss.it", "suedtirol.it", "südtirol.it", "sv.it", "ta.it", "taranto.it", "te.it", "tempio-olbia.it", "tempioolbia.it", "teramo.it", "terni.it", "tn.it", "to.it", "torino.it", "tp.it", "tr.it", "trani-andria-barletta.it", "trani-barletta-andria.it", "traniandriabarletta.it", "tranibarlettaandria.it", "trapani.it", "trento.it", "treviso.it", "trieste.it", "ts.it", "turin.it", "tv.it", "ud.it", "udine.it", "urbino-pesaro.it", "urbinopesaro.it", "va.it", "varese.it", "vb.it", "vc.it", "ve.it", "venezia.it", "venice.it", "verbania.it", "vercelli.it", "verona.it", "vi.it", "vibo-valentia.it", "vibovalentia.it", "vicenza.it", "viterbo.it", "vr.it", "vs.it", "vt.it", "vv.it", "je", "co.je", "net.je", "org.je", "*.jm", "jo", "com.jo", "org.jo", "net.jo", "edu.jo", "sch.jo", "gov.jo", "mil.jo", "name.jo", "jobs", "jp", "ac.jp", "ad.jp", "co.jp", "ed.jp", "go.jp", "gr.jp", "lg.jp", "ne.jp", "or.jp", "aichi.jp", "akita.jp", "aomori.jp", "chiba.jp", "ehime.jp", "fukui.jp", "fukuoka.jp", "fukushima.jp", "gifu.jp", "gunma.jp", "hiroshima.jp", "hokkaido.jp", "hyogo.jp", "ibaraki.jp", "ishikawa.jp", "iwate.jp", "kagawa.jp", "kagoshima.jp", "kanagawa.jp", "kochi.jp", "kumamoto.jp", "kyoto.jp", "mie.jp", "miyagi.jp", "miyazaki.jp", "nagano.jp", "nagasaki.jp", "nara.jp", "niigata.jp", "oita.jp", "okayama.jp", "okinawa.jp", "osaka.jp", "saga.jp", "saitama.jp", "shiga.jp", "shimane.jp", "shizuoka.jp", "tochigi.jp", "tokushima.jp", "tokyo.jp", "tottori.jp", "toyama.jp", "wakayama.jp", "yamagata.jp", "yamaguchi.jp", "yamanashi.jp", "栃木.jp", "愛知.jp", "愛媛.jp", "兵庫.jp", "熊本.jp", "茨城.jp", "北海道.jp", "千葉.jp", "和歌山.jp", "長崎.jp", "長野.jp", "新潟.jp", "青森.jp", "静岡.jp", "東京.jp", "石川.jp", "埼玉.jp", "三重.jp", "京都.jp", "佐賀.jp", "大分.jp", "大阪.jp", "奈良.jp", "宮城.jp", "宮崎.jp", "富山.jp", "山口.jp", "山形.jp", "山梨.jp", "岩手.jp", "岐阜.jp", "岡山.jp", "島根.jp", "広島.jp", "徳島.jp", "沖縄.jp", "滋賀.jp", "神奈川.jp", "福井.jp", "福岡.jp", "福島.jp", "秋田.jp", "群馬.jp", "香川.jp", "高知.jp", "鳥取.jp", "鹿児島.jp", "*.kawasaki.jp", "*.kitakyushu.jp", "*.kobe.jp", "*.nagoya.jp", "*.sapporo.jp", "*.sendai.jp", "*.yokohama.jp", "!city.kawasaki.jp", "!city.kitakyushu.jp", "!city.kobe.jp", "!city.nagoya.jp", "!city.sapporo.jp", "!city.sendai.jp", "!city.yokohama.jp", "aisai.aichi.jp", "ama.aichi.jp", "anjo.aichi.jp", "asuke.aichi.jp", "chiryu.aichi.jp", "chita.aichi.jp", "fuso.aichi.jp", "gamagori.aichi.jp", "handa.aichi.jp", "hazu.aichi.jp", "hekinan.aichi.jp", "higashiura.aichi.jp", "ichinomiya.aichi.jp", "inazawa.aichi.jp", "inuyama.aichi.jp", "isshiki.aichi.jp", "iwakura.aichi.jp", "kanie.aichi.jp", "kariya.aichi.jp", "kasugai.aichi.jp", "kira.aichi.jp", "kiyosu.aichi.jp", "komaki.aichi.jp", "konan.aichi.jp", "kota.aichi.jp", "mihama.aichi.jp", "miyoshi.aichi.jp", "nishio.aichi.jp", "nisshin.aichi.jp", "obu.aichi.jp", "oguchi.aichi.jp", "oharu.aichi.jp", "okazaki.aichi.jp", "owariasahi.aichi.jp", "seto.aichi.jp", "shikatsu.aichi.jp", "shinshiro.aichi.jp", "shitara.aichi.jp", "tahara.aichi.jp", "takahama.aichi.jp", "tobishima.aichi.jp", "toei.aichi.jp", "togo.aichi.jp", "tokai.aichi.jp", "tokoname.aichi.jp", "toyoake.aichi.jp", "toyohashi.aichi.jp", "toyokawa.aichi.jp", "toyone.aichi.jp", "toyota.aichi.jp", "tsushima.aichi.jp", "yatomi.aichi.jp", "akita.akita.jp", "daisen.akita.jp", "fujisato.akita.jp", "gojome.akita.jp", "hachirogata.akita.jp", "happou.akita.jp", "higashinaruse.akita.jp", "honjo.akita.jp", "honjyo.akita.jp", "ikawa.akita.jp", "kamikoani.akita.jp", "kamioka.akita.jp", "katagami.akita.jp", "kazuno.akita.jp", "kitaakita.akita.jp", "kosaka.akita.jp", "kyowa.akita.jp", "misato.akita.jp", "mitane.akita.jp", "moriyoshi.akita.jp", "nikaho.akita.jp", "noshiro.akita.jp", "odate.akita.jp", "oga.akita.jp", "ogata.akita.jp", "semboku.akita.jp", "yokote.akita.jp", "yurihonjo.akita.jp", "aomori.aomori.jp", "gonohe.aomori.jp", "hachinohe.aomori.jp", "hashikami.aomori.jp", "hiranai.aomori.jp", "hirosaki.aomori.jp", "itayanagi.aomori.jp", "kuroishi.aomori.jp", "misawa.aomori.jp", "mutsu.aomori.jp", "nakadomari.aomori.jp", "noheji.aomori.jp", "oirase.aomori.jp", "owani.aomori.jp", "rokunohe.aomori.jp", "sannohe.aomori.jp", "shichinohe.aomori.jp", "shingo.aomori.jp", "takko.aomori.jp", "towada.aomori.jp", "tsugaru.aomori.jp", "tsuruta.aomori.jp", "abiko.chiba.jp", "asahi.chiba.jp", "chonan.chiba.jp", "chosei.chiba.jp", "choshi.chiba.jp", "chuo.chiba.jp", "funabashi.chiba.jp", "futtsu.chiba.jp", "hanamigawa.chiba.jp", "ichihara.chiba.jp", "ichikawa.chiba.jp", "ichinomiya.chiba.jp", "inzai.chiba.jp", "isumi.chiba.jp", "kamagaya.chiba.jp", "kamogawa.chiba.jp", "kashiwa.chiba.jp", "katori.chiba.jp", "katsuura.chiba.jp", "kimitsu.chiba.jp", "kisarazu.chiba.jp", "kozaki.chiba.jp", "kujukuri.chiba.jp", "kyonan.chiba.jp", "matsudo.chiba.jp", "midori.chiba.jp", "mihama.chiba.jp", "minamiboso.chiba.jp", "mobara.chiba.jp", "mutsuzawa.chiba.jp", "nagara.chiba.jp", "nagareyama.chiba.jp", "narashino.chiba.jp", "narita.chiba.jp", "noda.chiba.jp", "oamishirasato.chiba.jp", "omigawa.chiba.jp", "onjuku.chiba.jp", "otaki.chiba.jp", "sakae.chiba.jp", "sakura.chiba.jp", "shimofusa.chiba.jp", "shirako.chiba.jp", "shiroi.chiba.jp", "shisui.chiba.jp", "sodegaura.chiba.jp", "sosa.chiba.jp", "tako.chiba.jp", "tateyama.chiba.jp", "togane.chiba.jp", "tohnosho.chiba.jp", "tomisato.chiba.jp", "urayasu.chiba.jp", "yachimata.chiba.jp", "yachiyo.chiba.jp", "yokaichiba.chiba.jp", "yokoshibahikari.chiba.jp", "yotsukaido.chiba.jp", "ainan.ehime.jp", "honai.ehime.jp", "ikata.ehime.jp", "imabari.ehime.jp", "iyo.ehime.jp", "kamijima.ehime.jp", "kihoku.ehime.jp", "kumakogen.ehime.jp", "masaki.ehime.jp", "matsuno.ehime.jp", "matsuyama.ehime.jp", "namikata.ehime.jp", "niihama.ehime.jp", "ozu.ehime.jp", "saijo.ehime.jp", "seiyo.ehime.jp", "shikokuchuo.ehime.jp", "tobe.ehime.jp", "toon.ehime.jp", "uchiko.ehime.jp", "uwajima.ehime.jp", "yawatahama.ehime.jp", "echizen.fukui.jp", "eiheiji.fukui.jp", "fukui.fukui.jp", "ikeda.fukui.jp", "katsuyama.fukui.jp", "mihama.fukui.jp", "minamiechizen.fukui.jp", "obama.fukui.jp", "ohi.fukui.jp", "ono.fukui.jp", "sabae.fukui.jp", "sakai.fukui.jp", "takahama.fukui.jp", "tsuruga.fukui.jp", "wakasa.fukui.jp", "ashiya.fukuoka.jp", "buzen.fukuoka.jp", "chikugo.fukuoka.jp", "chikuho.fukuoka.jp", "chikujo.fukuoka.jp", "chikushino.fukuoka.jp", "chikuzen.fukuoka.jp", "chuo.fukuoka.jp", "dazaifu.fukuoka.jp", "fukuchi.fukuoka.jp", "hakata.fukuoka.jp", "higashi.fukuoka.jp", "hirokawa.fukuoka.jp", "hisayama.fukuoka.jp", "iizuka.fukuoka.jp", "inatsuki.fukuoka.jp", "kaho.fukuoka.jp", "kasuga.fukuoka.jp", "kasuya.fukuoka.jp", "kawara.fukuoka.jp", "keisen.fukuoka.jp", "koga.fukuoka.jp", "kurate.fukuoka.jp", "kurogi.fukuoka.jp", "kurume.fukuoka.jp", "minami.fukuoka.jp", "miyako.fukuoka.jp", "miyama.fukuoka.jp", "miyawaka.fukuoka.jp", "mizumaki.fukuoka.jp", "munakata.fukuoka.jp", "nakagawa.fukuoka.jp", "nakama.fukuoka.jp", "nishi.fukuoka.jp", "nogata.fukuoka.jp", "ogori.fukuoka.jp", "okagaki.fukuoka.jp", "okawa.fukuoka.jp", "oki.fukuoka.jp", "omuta.fukuoka.jp", "onga.fukuoka.jp", "onojo.fukuoka.jp", "oto.fukuoka.jp", "saigawa.fukuoka.jp", "sasaguri.fukuoka.jp", "shingu.fukuoka.jp", "shinyoshitomi.fukuoka.jp", "shonai.fukuoka.jp", "soeda.fukuoka.jp", "sue.fukuoka.jp", "tachiarai.fukuoka.jp", "tagawa.fukuoka.jp", "takata.fukuoka.jp", "toho.fukuoka.jp", "toyotsu.fukuoka.jp", "tsuiki.fukuoka.jp", "ukiha.fukuoka.jp", "umi.fukuoka.jp", "usui.fukuoka.jp", "yamada.fukuoka.jp", "yame.fukuoka.jp", "yanagawa.fukuoka.jp", "yukuhashi.fukuoka.jp", "aizubange.fukushima.jp", "aizumisato.fukushima.jp", "aizuwakamatsu.fukushima.jp", "asakawa.fukushima.jp", "bandai.fukushima.jp", "date.fukushima.jp", "fukushima.fukushima.jp", "furudono.fukushima.jp", "futaba.fukushima.jp", "hanawa.fukushima.jp", "higashi.fukushima.jp", "hirata.fukushima.jp", "hirono.fukushima.jp", "iitate.fukushima.jp", "inawashiro.fukushima.jp", "ishikawa.fukushima.jp", "iwaki.fukushima.jp", "izumizaki.fukushima.jp", "kagamiishi.fukushima.jp", "kaneyama.fukushima.jp", "kawamata.fukushima.jp", "kitakata.fukushima.jp", "kitashiobara.fukushima.jp", "koori.fukushima.jp", "koriyama.fukushima.jp", "kunimi.fukushima.jp", "miharu.fukushima.jp", "mishima.fukushima.jp", "namie.fukushima.jp", "nango.fukushima.jp", "nishiaizu.fukushima.jp", "nishigo.fukushima.jp", "okuma.fukushima.jp", "omotego.fukushima.jp", "ono.fukushima.jp", "otama.fukushima.jp", "samegawa.fukushima.jp", "shimogo.fukushima.jp", "shirakawa.fukushima.jp", "showa.fukushima.jp", "soma.fukushima.jp", "sukagawa.fukushima.jp", "taishin.fukushima.jp", "tamakawa.fukushima.jp", "tanagura.fukushima.jp", "tenei.fukushima.jp", "yabuki.fukushima.jp", "yamato.fukushima.jp", "yamatsuri.fukushima.jp", "yanaizu.fukushima.jp", "yugawa.fukushima.jp", "anpachi.gifu.jp", "ena.gifu.jp", "gifu.gifu.jp", "ginan.gifu.jp", "godo.gifu.jp", "gujo.gifu.jp", "hashima.gifu.jp", "hichiso.gifu.jp", "hida.gifu.jp", "higashishirakawa.gifu.jp", "ibigawa.gifu.jp", "ikeda.gifu.jp", "kakamigahara.gifu.jp", "kani.gifu.jp", "kasahara.gifu.jp", "kasamatsu.gifu.jp", "kawaue.gifu.jp", "kitagata.gifu.jp", "mino.gifu.jp", "minokamo.gifu.jp", "mitake.gifu.jp", "mizunami.gifu.jp", "motosu.gifu.jp", "nakatsugawa.gifu.jp", "ogaki.gifu.jp", "sakahogi.gifu.jp", "seki.gifu.jp", "sekigahara.gifu.jp", "shirakawa.gifu.jp", "tajimi.gifu.jp", "takayama.gifu.jp", "tarui.gifu.jp", "toki.gifu.jp", "tomika.gifu.jp", "wanouchi.gifu.jp", "yamagata.gifu.jp", "yaotsu.gifu.jp", "yoro.gifu.jp", "annaka.gunma.jp", "chiyoda.gunma.jp", "fujioka.gunma.jp", "higashiagatsuma.gunma.jp", "isesaki.gunma.jp", "itakura.gunma.jp", "kanna.gunma.jp", "kanra.gunma.jp", "katashina.gunma.jp", "kawaba.gunma.jp", "kiryu.gunma.jp", "kusatsu.gunma.jp", "maebashi.gunma.jp", "meiwa.gunma.jp", "midori.gunma.jp", "minakami.gunma.jp", "naganohara.gunma.jp", "nakanojo.gunma.jp", "nanmoku.gunma.jp", "numata.gunma.jp", "oizumi.gunma.jp", "ora.gunma.jp", "ota.gunma.jp", "shibukawa.gunma.jp", "shimonita.gunma.jp", "shinto.gunma.jp", "showa.gunma.jp", "takasaki.gunma.jp", "takayama.gunma.jp", "tamamura.gunma.jp", "tatebayashi.gunma.jp", "tomioka.gunma.jp", "tsukiyono.gunma.jp", "tsumagoi.gunma.jp", "ueno.gunma.jp", "yoshioka.gunma.jp", "asaminami.hiroshima.jp", "daiwa.hiroshima.jp", "etajima.hiroshima.jp", "fuchu.hiroshima.jp", "fukuyama.hiroshima.jp", "hatsukaichi.hiroshima.jp", "higashihiroshima.hiroshima.jp", "hongo.hiroshima.jp", "jinsekikogen.hiroshima.jp", "kaita.hiroshima.jp", "kui.hiroshima.jp", "kumano.hiroshima.jp", "kure.hiroshima.jp", "mihara.hiroshima.jp", "miyoshi.hiroshima.jp", "naka.hiroshima.jp", "onomichi.hiroshima.jp", "osakikamijima.hiroshima.jp", "otake.hiroshima.jp", "saka.hiroshima.jp", "sera.hiroshima.jp", "seranishi.hiroshima.jp", "shinichi.hiroshima.jp", "shobara.hiroshima.jp", "takehara.hiroshima.jp", "abashiri.hokkaido.jp", "abira.hokkaido.jp", "aibetsu.hokkaido.jp", "akabira.hokkaido.jp", "akkeshi.hokkaido.jp", "asahikawa.hokkaido.jp", "ashibetsu.hokkaido.jp", "ashoro.hokkaido.jp", "assabu.hokkaido.jp", "atsuma.hokkaido.jp", "bibai.hokkaido.jp", "biei.hokkaido.jp", "bifuka.hokkaido.jp", "bihoro.hokkaido.jp", "biratori.hokkaido.jp", "chippubetsu.hokkaido.jp", "chitose.hokkaido.jp", "date.hokkaido.jp", "ebetsu.hokkaido.jp", "embetsu.hokkaido.jp", "eniwa.hokkaido.jp", "erimo.hokkaido.jp", "esan.hokkaido.jp", "esashi.hokkaido.jp", "fukagawa.hokkaido.jp", "fukushima.hokkaido.jp", "furano.hokkaido.jp", "furubira.hokkaido.jp", "haboro.hokkaido.jp", "hakodate.hokkaido.jp", "hamatonbetsu.hokkaido.jp", "hidaka.hokkaido.jp", "higashikagura.hokkaido.jp", "higashikawa.hokkaido.jp", "hiroo.hokkaido.jp", "hokuryu.hokkaido.jp", "hokuto.hokkaido.jp", "honbetsu.hokkaido.jp", "horokanai.hokkaido.jp", "horonobe.hokkaido.jp", "ikeda.hokkaido.jp", "imakane.hokkaido.jp", "ishikari.hokkaido.jp", "iwamizawa.hokkaido.jp", "iwanai.hokkaido.jp", "kamifurano.hokkaido.jp", "kamikawa.hokkaido.jp", "kamishihoro.hokkaido.jp", "kamisunagawa.hokkaido.jp", "kamoenai.hokkaido.jp", "kayabe.hokkaido.jp", "kembuchi.hokkaido.jp", "kikonai.hokkaido.jp", "kimobetsu.hokkaido.jp", "kitahiroshima.hokkaido.jp", "kitami.hokkaido.jp", "kiyosato.hokkaido.jp", "koshimizu.hokkaido.jp", "kunneppu.hokkaido.jp", "kuriyama.hokkaido.jp", "kuromatsunai.hokkaido.jp", "kushiro.hokkaido.jp", "kutchan.hokkaido.jp", "kyowa.hokkaido.jp", "mashike.hokkaido.jp", "matsumae.hokkaido.jp", "mikasa.hokkaido.jp", "minamifurano.hokkaido.jp", "mombetsu.hokkaido.jp", "moseushi.hokkaido.jp", "mukawa.hokkaido.jp", "muroran.hokkaido.jp", "naie.hokkaido.jp", "nakagawa.hokkaido.jp", "nakasatsunai.hokkaido.jp", "nakatombetsu.hokkaido.jp", "nanae.hokkaido.jp", "nanporo.hokkaido.jp", "nayoro.hokkaido.jp", "nemuro.hokkaido.jp", "niikappu.hokkaido.jp", "niki.hokkaido.jp", "nishiokoppe.hokkaido.jp", "noboribetsu.hokkaido.jp", "numata.hokkaido.jp", "obihiro.hokkaido.jp", "obira.hokkaido.jp", "oketo.hokkaido.jp", "okoppe.hokkaido.jp", "otaru.hokkaido.jp", "otobe.hokkaido.jp", "otofuke.hokkaido.jp", "otoineppu.hokkaido.jp", "oumu.hokkaido.jp", "ozora.hokkaido.jp", "pippu.hokkaido.jp", "rankoshi.hokkaido.jp", "rebun.hokkaido.jp", "rikubetsu.hokkaido.jp", "rishiri.hokkaido.jp", "rishirifuji.hokkaido.jp", "saroma.hokkaido.jp", "sarufutsu.hokkaido.jp", "shakotan.hokkaido.jp", "shari.hokkaido.jp", "shibecha.hokkaido.jp", "shibetsu.hokkaido.jp", "shikabe.hokkaido.jp", "shikaoi.hokkaido.jp", "shimamaki.hokkaido.jp", "shimizu.hokkaido.jp", "shimokawa.hokkaido.jp", "shinshinotsu.hokkaido.jp", "shintoku.hokkaido.jp", "shiranuka.hokkaido.jp", "shiraoi.hokkaido.jp", "shiriuchi.hokkaido.jp", "sobetsu.hokkaido.jp", "sunagawa.hokkaido.jp", "taiki.hokkaido.jp", "takasu.hokkaido.jp", "takikawa.hokkaido.jp", "takinoue.hokkaido.jp", "teshikaga.hokkaido.jp", "tobetsu.hokkaido.jp", "tohma.hokkaido.jp", "tomakomai.hokkaido.jp", "tomari.hokkaido.jp", "toya.hokkaido.jp", "toyako.hokkaido.jp", "toyotomi.hokkaido.jp", "toyoura.hokkaido.jp", "tsubetsu.hokkaido.jp", "tsukigata.hokkaido.jp", "urakawa.hokkaido.jp", "urausu.hokkaido.jp", "uryu.hokkaido.jp", "utashinai.hokkaido.jp", "wakkanai.hokkaido.jp", "wassamu.hokkaido.jp", "yakumo.hokkaido.jp", "yoichi.hokkaido.jp", "aioi.hyogo.jp", "akashi.hyogo.jp", "ako.hyogo.jp", "amagasaki.hyogo.jp", "aogaki.hyogo.jp", "asago.hyogo.jp", "ashiya.hyogo.jp", "awaji.hyogo.jp", "fukusaki.hyogo.jp", "goshiki.hyogo.jp", "harima.hyogo.jp", "himeji.hyogo.jp", "ichikawa.hyogo.jp", "inagawa.hyogo.jp", "itami.hyogo.jp", "kakogawa.hyogo.jp", "kamigori.hyogo.jp", "kamikawa.hyogo.jp", "kasai.hyogo.jp", "kasuga.hyogo.jp", "kawanishi.hyogo.jp", "miki.hyogo.jp", "minamiawaji.hyogo.jp", "nishinomiya.hyogo.jp", "nishiwaki.hyogo.jp", "ono.hyogo.jp", "sanda.hyogo.jp", "sannan.hyogo.jp", "sasayama.hyogo.jp", "sayo.hyogo.jp", "shingu.hyogo.jp", "shinonsen.hyogo.jp", "shiso.hyogo.jp", "sumoto.hyogo.jp", "taishi.hyogo.jp", "taka.hyogo.jp", "takarazuka.hyogo.jp", "takasago.hyogo.jp", "takino.hyogo.jp", "tamba.hyogo.jp", "tatsuno.hyogo.jp", "toyooka.hyogo.jp", "yabu.hyogo.jp", "yashiro.hyogo.jp", "yoka.hyogo.jp", "yokawa.hyogo.jp", "ami.ibaraki.jp", "asahi.ibaraki.jp", "bando.ibaraki.jp", "chikusei.ibaraki.jp", "daigo.ibaraki.jp", "fujishiro.ibaraki.jp", "hitachi.ibaraki.jp", "hitachinaka.ibaraki.jp", "hitachiomiya.ibaraki.jp", "hitachiota.ibaraki.jp", "ibaraki.ibaraki.jp", "ina.ibaraki.jp", "inashiki.ibaraki.jp", "itako.ibaraki.jp", "iwama.ibaraki.jp", "joso.ibaraki.jp", "kamisu.ibaraki.jp", "kasama.ibaraki.jp", "kashima.ibaraki.jp", "kasumigaura.ibaraki.jp", "koga.ibaraki.jp", "miho.ibaraki.jp", "mito.ibaraki.jp", "moriya.ibaraki.jp", "naka.ibaraki.jp", "namegata.ibaraki.jp", "oarai.ibaraki.jp", "ogawa.ibaraki.jp", "omitama.ibaraki.jp", "ryugasaki.ibaraki.jp", "sakai.ibaraki.jp", "sakuragawa.ibaraki.jp", "shimodate.ibaraki.jp", "shimotsuma.ibaraki.jp", "shirosato.ibaraki.jp", "sowa.ibaraki.jp", "suifu.ibaraki.jp", "takahagi.ibaraki.jp", "tamatsukuri.ibaraki.jp", "tokai.ibaraki.jp", "tomobe.ibaraki.jp", "tone.ibaraki.jp", "toride.ibaraki.jp", "tsuchiura.ibaraki.jp", "tsukuba.ibaraki.jp", "uchihara.ibaraki.jp", "ushiku.ibaraki.jp", "yachiyo.ibaraki.jp", "yamagata.ibaraki.jp", "yawara.ibaraki.jp", "yuki.ibaraki.jp", "anamizu.ishikawa.jp", "hakui.ishikawa.jp", "hakusan.ishikawa.jp", "kaga.ishikawa.jp", "kahoku.ishikawa.jp", "kanazawa.ishikawa.jp", "kawakita.ishikawa.jp", "komatsu.ishikawa.jp", "nakanoto.ishikawa.jp", "nanao.ishikawa.jp", "nomi.ishikawa.jp", "nonoichi.ishikawa.jp", "noto.ishikawa.jp", "shika.ishikawa.jp", "suzu.ishikawa.jp", "tsubata.ishikawa.jp", "tsurugi.ishikawa.jp", "uchinada.ishikawa.jp", "wajima.ishikawa.jp", "fudai.iwate.jp", "fujisawa.iwate.jp", "hanamaki.iwate.jp", "hiraizumi.iwate.jp", "hirono.iwate.jp", "ichinohe.iwate.jp", "ichinoseki.iwate.jp", "iwaizumi.iwate.jp", "iwate.iwate.jp", "joboji.iwate.jp", "kamaishi.iwate.jp", "kanegasaki.iwate.jp", "karumai.iwate.jp", "kawai.iwate.jp", "kitakami.iwate.jp", "kuji.iwate.jp", "kunohe.iwate.jp", "kuzumaki.iwate.jp", "miyako.iwate.jp", "mizusawa.iwate.jp", "morioka.iwate.jp", "ninohe.iwate.jp", "noda.iwate.jp", "ofunato.iwate.jp", "oshu.iwate.jp", "otsuchi.iwate.jp", "rikuzentakata.iwate.jp", "shiwa.iwate.jp", "shizukuishi.iwate.jp", "sumita.iwate.jp", "tanohata.iwate.jp", "tono.iwate.jp", "yahaba.iwate.jp", "yamada.iwate.jp", "ayagawa.kagawa.jp", "higashikagawa.kagawa.jp", "kanonji.kagawa.jp", "kotohira.kagawa.jp", "manno.kagawa.jp", "marugame.kagawa.jp", "mitoyo.kagawa.jp", "naoshima.kagawa.jp", "sanuki.kagawa.jp", "tadotsu.kagawa.jp", "takamatsu.kagawa.jp", "tonosho.kagawa.jp", "uchinomi.kagawa.jp", "utazu.kagawa.jp", "zentsuji.kagawa.jp", "akune.kagoshima.jp", "amami.kagoshima.jp", "hioki.kagoshima.jp", "isa.kagoshima.jp", "isen.kagoshima.jp", "izumi.kagoshima.jp", "kagoshima.kagoshima.jp", "kanoya.kagoshima.jp", "kawanabe.kagoshima.jp", "kinko.kagoshima.jp", "kouyama.kagoshima.jp", "makurazaki.kagoshima.jp", "matsumoto.kagoshima.jp", "minamitane.kagoshima.jp", "nakatane.kagoshima.jp", "nishinoomote.kagoshima.jp", "satsumasendai.kagoshima.jp", "soo.kagoshima.jp", "tarumizu.kagoshima.jp", "yusui.kagoshima.jp", "aikawa.kanagawa.jp", "atsugi.kanagawa.jp", "ayase.kanagawa.jp", "chigasaki.kanagawa.jp", "ebina.kanagawa.jp", "fujisawa.kanagawa.jp", "hadano.kanagawa.jp", "hakone.kanagawa.jp", "hiratsuka.kanagawa.jp", "isehara.kanagawa.jp", "kaisei.kanagawa.jp", "kamakura.kanagawa.jp", "kiyokawa.kanagawa.jp", "matsuda.kanagawa.jp", "minamiashigara.kanagawa.jp", "miura.kanagawa.jp", "nakai.kanagawa.jp", "ninomiya.kanagawa.jp", "odawara.kanagawa.jp", "oi.kanagawa.jp", "oiso.kanagawa.jp", "sagamihara.kanagawa.jp", "samukawa.kanagawa.jp", "tsukui.kanagawa.jp", "yamakita.kanagawa.jp", "yamato.kanagawa.jp", "yokosuka.kanagawa.jp", "yugawara.kanagawa.jp", "zama.kanagawa.jp", "zushi.kanagawa.jp", "aki.kochi.jp", "geisei.kochi.jp", "hidaka.kochi.jp", "higashitsuno.kochi.jp", "ino.kochi.jp", "kagami.kochi.jp", "kami.kochi.jp", "kitagawa.kochi.jp", "kochi.kochi.jp", "mihara.kochi.jp", "motoyama.kochi.jp", "muroto.kochi.jp", "nahari.kochi.jp", "nakamura.kochi.jp", "nankoku.kochi.jp", "nishitosa.kochi.jp", "niyodogawa.kochi.jp", "ochi.kochi.jp", "okawa.kochi.jp", "otoyo.kochi.jp", "otsuki.kochi.jp", "sakawa.kochi.jp", "sukumo.kochi.jp", "susaki.kochi.jp", "tosa.kochi.jp", "tosashimizu.kochi.jp", "toyo.kochi.jp", "tsuno.kochi.jp", "umaji.kochi.jp", "yasuda.kochi.jp", "yusuhara.kochi.jp", "amakusa.kumamoto.jp", "arao.kumamoto.jp", "aso.kumamoto.jp", "choyo.kumamoto.jp", "gyokuto.kumamoto.jp", "kamiamakusa.kumamoto.jp", "kikuchi.kumamoto.jp", "kumamoto.kumamoto.jp", "mashiki.kumamoto.jp", "mifune.kumamoto.jp", "minamata.kumamoto.jp", "minamioguni.kumamoto.jp", "nagasu.kumamoto.jp", "nishihara.kumamoto.jp", "oguni.kumamoto.jp", "ozu.kumamoto.jp", "sumoto.kumamoto.jp", "takamori.kumamoto.jp", "uki.kumamoto.jp", "uto.kumamoto.jp", "yamaga.kumamoto.jp", "yamato.kumamoto.jp", "yatsushiro.kumamoto.jp", "ayabe.kyoto.jp", "fukuchiyama.kyoto.jp", "higashiyama.kyoto.jp", "ide.kyoto.jp", "ine.kyoto.jp", "joyo.kyoto.jp", "kameoka.kyoto.jp", "kamo.kyoto.jp", "kita.kyoto.jp", "kizu.kyoto.jp", "kumiyama.kyoto.jp", "kyotamba.kyoto.jp", "kyotanabe.kyoto.jp", "kyotango.kyoto.jp", "maizuru.kyoto.jp", "minami.kyoto.jp", "minamiyamashiro.kyoto.jp", "miyazu.kyoto.jp", "muko.kyoto.jp", "nagaokakyo.kyoto.jp", "nakagyo.kyoto.jp", "nantan.kyoto.jp", "oyamazaki.kyoto.jp", "sakyo.kyoto.jp", "seika.kyoto.jp", "tanabe.kyoto.jp", "uji.kyoto.jp", "ujitawara.kyoto.jp", "wazuka.kyoto.jp", "yamashina.kyoto.jp", "yawata.kyoto.jp", "asahi.mie.jp", "inabe.mie.jp", "ise.mie.jp", "kameyama.mie.jp", "kawagoe.mie.jp", "kiho.mie.jp", "kisosaki.mie.jp", "kiwa.mie.jp", "komono.mie.jp", "kumano.mie.jp", "kuwana.mie.jp", "matsusaka.mie.jp", "meiwa.mie.jp", "mihama.mie.jp", "minamiise.mie.jp", "misugi.mie.jp", "miyama.mie.jp", "nabari.mie.jp", "shima.mie.jp", "suzuka.mie.jp", "tado.mie.jp", "taiki.mie.jp", "taki.mie.jp", "tamaki.mie.jp", "toba.mie.jp", "tsu.mie.jp", "udono.mie.jp", "ureshino.mie.jp", "watarai.mie.jp", "yokkaichi.mie.jp", "furukawa.miyagi.jp", "higashimatsushima.miyagi.jp", "ishinomaki.miyagi.jp", "iwanuma.miyagi.jp", "kakuda.miyagi.jp", "kami.miyagi.jp", "kawasaki.miyagi.jp", "marumori.miyagi.jp", "matsushima.miyagi.jp", "minamisanriku.miyagi.jp", "misato.miyagi.jp", "murata.miyagi.jp", "natori.miyagi.jp", "ogawara.miyagi.jp", "ohira.miyagi.jp", "onagawa.miyagi.jp", "osaki.miyagi.jp", "rifu.miyagi.jp", "semine.miyagi.jp", "shibata.miyagi.jp", "shichikashuku.miyagi.jp", "shikama.miyagi.jp", "shiogama.miyagi.jp", "shiroishi.miyagi.jp", "tagajo.miyagi.jp", "taiwa.miyagi.jp", "tome.miyagi.jp", "tomiya.miyagi.jp", "wakuya.miyagi.jp", "watari.miyagi.jp", "yamamoto.miyagi.jp", "zao.miyagi.jp", "aya.miyazaki.jp", "ebino.miyazaki.jp", "gokase.miyazaki.jp", "hyuga.miyazaki.jp", "kadogawa.miyazaki.jp", "kawaminami.miyazaki.jp", "kijo.miyazaki.jp", "kitagawa.miyazaki.jp", "kitakata.miyazaki.jp", "kitaura.miyazaki.jp", "kobayashi.miyazaki.jp", "kunitomi.miyazaki.jp", "kushima.miyazaki.jp", "mimata.miyazaki.jp", "miyakonojo.miyazaki.jp", "miyazaki.miyazaki.jp", "morotsuka.miyazaki.jp", "nichinan.miyazaki.jp", "nishimera.miyazaki.jp", "nobeoka.miyazaki.jp", "saito.miyazaki.jp", "shiiba.miyazaki.jp", "shintomi.miyazaki.jp", "takaharu.miyazaki.jp", "takanabe.miyazaki.jp", "takazaki.miyazaki.jp", "tsuno.miyazaki.jp", "achi.nagano.jp", "agematsu.nagano.jp", "anan.nagano.jp", "aoki.nagano.jp", "asahi.nagano.jp", "azumino.nagano.jp", "chikuhoku.nagano.jp", "chikuma.nagano.jp", "chino.nagano.jp", "fujimi.nagano.jp", "hakuba.nagano.jp", "hara.nagano.jp", "hiraya.nagano.jp", "iida.nagano.jp", "iijima.nagano.jp", "iiyama.nagano.jp", "iizuna.nagano.jp", "ikeda.nagano.jp", "ikusaka.nagano.jp", "ina.nagano.jp", "karuizawa.nagano.jp", "kawakami.nagano.jp", "kiso.nagano.jp", "kisofukushima.nagano.jp", "kitaaiki.nagano.jp", "komagane.nagano.jp", "komoro.nagano.jp", "matsukawa.nagano.jp", "matsumoto.nagano.jp", "miasa.nagano.jp", "minamiaiki.nagano.jp", "minamimaki.nagano.jp", "minamiminowa.nagano.jp", "minowa.nagano.jp", "miyada.nagano.jp", "miyota.nagano.jp", "mochizuki.nagano.jp", "nagano.nagano.jp", "nagawa.nagano.jp", "nagiso.nagano.jp", "nakagawa.nagano.jp", "nakano.nagano.jp", "nozawaonsen.nagano.jp", "obuse.nagano.jp", "ogawa.nagano.jp", "okaya.nagano.jp", "omachi.nagano.jp", "omi.nagano.jp", "ookuwa.nagano.jp", "ooshika.nagano.jp", "otaki.nagano.jp", "otari.nagano.jp", "sakae.nagano.jp", "sakaki.nagano.jp", "saku.nagano.jp", "sakuho.nagano.jp", "shimosuwa.nagano.jp", "shinanomachi.nagano.jp", "shiojiri.nagano.jp", "suwa.nagano.jp", "suzaka.nagano.jp", "takagi.nagano.jp", "takamori.nagano.jp", "takayama.nagano.jp", "tateshina.nagano.jp", "tatsuno.nagano.jp", "togakushi.nagano.jp", "togura.nagano.jp", "tomi.nagano.jp", "ueda.nagano.jp", "wada.nagano.jp", "yamagata.nagano.jp", "yamanouchi.nagano.jp", "yasaka.nagano.jp", "yasuoka.nagano.jp", "chijiwa.nagasaki.jp", "futsu.nagasaki.jp", "goto.nagasaki.jp", "hasami.nagasaki.jp", "hirado.nagasaki.jp", "iki.nagasaki.jp", "isahaya.nagasaki.jp", "kawatana.nagasaki.jp", "kuchinotsu.nagasaki.jp", "matsuura.nagasaki.jp", "nagasaki.nagasaki.jp", "obama.nagasaki.jp", "omura.nagasaki.jp", "oseto.nagasaki.jp", "saikai.nagasaki.jp", "sasebo.nagasaki.jp", "seihi.nagasaki.jp", "shimabara.nagasaki.jp", "shinkamigoto.nagasaki.jp", "togitsu.nagasaki.jp", "tsushima.nagasaki.jp", "unzen.nagasaki.jp", "ando.nara.jp", "gose.nara.jp", "heguri.nara.jp", "higashiyoshino.nara.jp", "ikaruga.nara.jp", "ikoma.nara.jp", "kamikitayama.nara.jp", "kanmaki.nara.jp", "kashiba.nara.jp", "kashihara.nara.jp", "katsuragi.nara.jp", "kawai.nara.jp", "kawakami.nara.jp", "kawanishi.nara.jp", "koryo.nara.jp", "kurotaki.nara.jp", "mitsue.nara.jp", "miyake.nara.jp", "nara.nara.jp", "nosegawa.nara.jp", "oji.nara.jp", "ouda.nara.jp", "oyodo.nara.jp", "sakurai.nara.jp", "sango.nara.jp", "shimoichi.nara.jp", "shimokitayama.nara.jp", "shinjo.nara.jp", "soni.nara.jp", "takatori.nara.jp", "tawaramoto.nara.jp", "tenkawa.nara.jp", "tenri.nara.jp", "uda.nara.jp", "yamatokoriyama.nara.jp", "yamatotakada.nara.jp", "yamazoe.nara.jp", "yoshino.nara.jp", "aga.niigata.jp", "agano.niigata.jp", "gosen.niigata.jp", "itoigawa.niigata.jp", "izumozaki.niigata.jp", "joetsu.niigata.jp", "kamo.niigata.jp", "kariwa.niigata.jp", "kashiwazaki.niigata.jp", "minamiuonuma.niigata.jp", "mitsuke.niigata.jp", "muika.niigata.jp", "murakami.niigata.jp", "myoko.niigata.jp", "nagaoka.niigata.jp", "niigata.niigata.jp", "ojiya.niigata.jp", "omi.niigata.jp", "sado.niigata.jp", "sanjo.niigata.jp", "seiro.niigata.jp", "seirou.niigata.jp", "sekikawa.niigata.jp", "shibata.niigata.jp", "tagami.niigata.jp", "tainai.niigata.jp", "tochio.niigata.jp", "tokamachi.niigata.jp", "tsubame.niigata.jp", "tsunan.niigata.jp", "uonuma.niigata.jp", "yahiko.niigata.jp", "yoita.niigata.jp", "yuzawa.niigata.jp", "beppu.oita.jp", "bungoono.oita.jp", "bungotakada.oita.jp", "hasama.oita.jp", "hiji.oita.jp", "himeshima.oita.jp", "hita.oita.jp", "kamitsue.oita.jp", "kokonoe.oita.jp", "kuju.oita.jp", "kunisaki.oita.jp", "kusu.oita.jp", "oita.oita.jp", "saiki.oita.jp", "taketa.oita.jp", "tsukumi.oita.jp", "usa.oita.jp", "usuki.oita.jp", "yufu.oita.jp", "akaiwa.okayama.jp", "asakuchi.okayama.jp", "bizen.okayama.jp", "hayashima.okayama.jp", "ibara.okayama.jp", "kagamino.okayama.jp", "kasaoka.okayama.jp", "kibichuo.okayama.jp", "kumenan.okayama.jp", "kurashiki.okayama.jp", "maniwa.okayama.jp", "misaki.okayama.jp", "nagi.okayama.jp", "niimi.okayama.jp", "nishiawakura.okayama.jp", "okayama.okayama.jp", "satosho.okayama.jp", "setouchi.okayama.jp", "shinjo.okayama.jp", "shoo.okayama.jp", "soja.okayama.jp", "takahashi.okayama.jp", "tamano.okayama.jp", "tsuyama.okayama.jp", "wake.okayama.jp", "yakage.okayama.jp", "aguni.okinawa.jp", "ginowan.okinawa.jp", "ginoza.okinawa.jp", "gushikami.okinawa.jp", "haebaru.okinawa.jp", "higashi.okinawa.jp", "hirara.okinawa.jp", "iheya.okinawa.jp", "ishigaki.okinawa.jp", "ishikawa.okinawa.jp", "itoman.okinawa.jp", "izena.okinawa.jp", "kadena.okinawa.jp", "kin.okinawa.jp", "kitadaito.okinawa.jp", "kitanakagusuku.okinawa.jp", "kumejima.okinawa.jp", "kunigami.okinawa.jp", "minamidaito.okinawa.jp", "motobu.okinawa.jp", "nago.okinawa.jp", "naha.okinawa.jp", "nakagusuku.okinawa.jp", "nakijin.okinawa.jp", "nanjo.okinawa.jp", "nishihara.okinawa.jp", "ogimi.okinawa.jp", "okinawa.okinawa.jp", "onna.okinawa.jp", "shimoji.okinawa.jp", "taketomi.okinawa.jp", "tarama.okinawa.jp", "tokashiki.okinawa.jp", "tomigusuku.okinawa.jp", "tonaki.okinawa.jp", "urasoe.okinawa.jp", "uruma.okinawa.jp", "yaese.okinawa.jp", "yomitan.okinawa.jp", "yonabaru.okinawa.jp", "yonaguni.okinawa.jp", "zamami.okinawa.jp", "abeno.osaka.jp", "chihayaakasaka.osaka.jp", "chuo.osaka.jp", "daito.osaka.jp", "fujiidera.osaka.jp", "habikino.osaka.jp", "hannan.osaka.jp", "higashiosaka.osaka.jp", "higashisumiyoshi.osaka.jp", "higashiyodogawa.osaka.jp", "hirakata.osaka.jp", "ibaraki.osaka.jp", "ikeda.osaka.jp", "izumi.osaka.jp", "izumiotsu.osaka.jp", "izumisano.osaka.jp", "kadoma.osaka.jp", "kaizuka.osaka.jp", "kanan.osaka.jp", "kashiwara.osaka.jp", "katano.osaka.jp", "kawachinagano.osaka.jp", "kishiwada.osaka.jp", "kita.osaka.jp", "kumatori.osaka.jp", "matsubara.osaka.jp", "minato.osaka.jp", "minoh.osaka.jp", "misaki.osaka.jp", "moriguchi.osaka.jp", "neyagawa.osaka.jp", "nishi.osaka.jp", "nose.osaka.jp", "osakasayama.osaka.jp", "sakai.osaka.jp", "sayama.osaka.jp", "sennan.osaka.jp", "settsu.osaka.jp", "shijonawate.osaka.jp", "shimamoto.osaka.jp", "suita.osaka.jp", "tadaoka.osaka.jp", "taishi.osaka.jp", "tajiri.osaka.jp", "takaishi.osaka.jp", "takatsuki.osaka.jp", "tondabayashi.osaka.jp", "toyonaka.osaka.jp", "toyono.osaka.jp", "yao.osaka.jp", "ariake.saga.jp", "arita.saga.jp", "fukudomi.saga.jp", "genkai.saga.jp", "hamatama.saga.jp", "hizen.saga.jp", "imari.saga.jp", "kamimine.saga.jp", "kanzaki.saga.jp", "karatsu.saga.jp", "kashima.saga.jp", "kitagata.saga.jp", "kitahata.saga.jp", "kiyama.saga.jp", "kouhoku.saga.jp", "kyuragi.saga.jp", "nishiarita.saga.jp", "ogi.saga.jp", "omachi.saga.jp", "ouchi.saga.jp", "saga.saga.jp", "shiroishi.saga.jp", "taku.saga.jp", "tara.saga.jp", "tosu.saga.jp", "yoshinogari.saga.jp", "arakawa.saitama.jp", "asaka.saitama.jp", "chichibu.saitama.jp", "fujimi.saitama.jp", "fujimino.saitama.jp", "fukaya.saitama.jp", "hanno.saitama.jp", "hanyu.saitama.jp", "hasuda.saitama.jp", "hatogaya.saitama.jp", "hatoyama.saitama.jp", "hidaka.saitama.jp", "higashichichibu.saitama.jp", "higashimatsuyama.saitama.jp", "honjo.saitama.jp", "ina.saitama.jp", "iruma.saitama.jp", "iwatsuki.saitama.jp", "kamiizumi.saitama.jp", "kamikawa.saitama.jp", "kamisato.saitama.jp", "kasukabe.saitama.jp", "kawagoe.saitama.jp", "kawaguchi.saitama.jp", "kawajima.saitama.jp", "kazo.saitama.jp", "kitamoto.saitama.jp", "koshigaya.saitama.jp", "kounosu.saitama.jp", "kuki.saitama.jp", "kumagaya.saitama.jp", "matsubushi.saitama.jp", "minano.saitama.jp", "misato.saitama.jp", "miyashiro.saitama.jp", "miyoshi.saitama.jp", "moroyama.saitama.jp", "nagatoro.saitama.jp", "namegawa.saitama.jp", "niiza.saitama.jp", "ogano.saitama.jp", "ogawa.saitama.jp", "ogose.saitama.jp", "okegawa.saitama.jp", "omiya.saitama.jp", "otaki.saitama.jp", "ranzan.saitama.jp", "ryokami.saitama.jp", "saitama.saitama.jp", "sakado.saitama.jp", "satte.saitama.jp", "sayama.saitama.jp", "shiki.saitama.jp", "shiraoka.saitama.jp", "soka.saitama.jp", "sugito.saitama.jp", "toda.saitama.jp", "tokigawa.saitama.jp", "tokorozawa.saitama.jp", "tsurugashima.saitama.jp", "urawa.saitama.jp", "warabi.saitama.jp", "yashio.saitama.jp", "yokoze.saitama.jp", "yono.saitama.jp", "yorii.saitama.jp", "yoshida.saitama.jp", "yoshikawa.saitama.jp", "yoshimi.saitama.jp", "aisho.shiga.jp", "gamo.shiga.jp", "higashiomi.shiga.jp", "hikone.shiga.jp", "koka.shiga.jp", "konan.shiga.jp", "kosei.shiga.jp", "koto.shiga.jp", "kusatsu.shiga.jp", "maibara.shiga.jp", "moriyama.shiga.jp", "nagahama.shiga.jp", "nishiazai.shiga.jp", "notogawa.shiga.jp", "omihachiman.shiga.jp", "otsu.shiga.jp", "ritto.shiga.jp", "ryuoh.shiga.jp", "takashima.shiga.jp", "takatsuki.shiga.jp", "torahime.shiga.jp", "toyosato.shiga.jp", "yasu.shiga.jp", "akagi.shimane.jp", "ama.shimane.jp", "gotsu.shimane.jp", "hamada.shimane.jp", "higashiizumo.shimane.jp", "hikawa.shimane.jp", "hikimi.shimane.jp", "izumo.shimane.jp", "kakinoki.shimane.jp", "masuda.shimane.jp", "matsue.shimane.jp", "misato.shimane.jp", "nishinoshima.shimane.jp", "ohda.shimane.jp", "okinoshima.shimane.jp", "okuizumo.shimane.jp", "shimane.shimane.jp", "tamayu.shimane.jp", "tsuwano.shimane.jp", "unnan.shimane.jp", "yakumo.shimane.jp", "yasugi.shimane.jp", "yatsuka.shimane.jp", "arai.shizuoka.jp", "atami.shizuoka.jp", "fuji.shizuoka.jp", "fujieda.shizuoka.jp", "fujikawa.shizuoka.jp", "fujinomiya.shizuoka.jp", "fukuroi.shizuoka.jp", "gotemba.shizuoka.jp", "haibara.shizuoka.jp", "hamamatsu.shizuoka.jp", "higashiizu.shizuoka.jp", "ito.shizuoka.jp", "iwata.shizuoka.jp", "izu.shizuoka.jp", "izunokuni.shizuoka.jp", "kakegawa.shizuoka.jp", "kannami.shizuoka.jp", "kawanehon.shizuoka.jp", "kawazu.shizuoka.jp", "kikugawa.shizuoka.jp", "kosai.shizuoka.jp", "makinohara.shizuoka.jp", "matsuzaki.shizuoka.jp", "minamiizu.shizuoka.jp", "mishima.shizuoka.jp", "morimachi.shizuoka.jp", "nishiizu.shizuoka.jp", "numazu.shizuoka.jp", "omaezaki.shizuoka.jp", "shimada.shizuoka.jp", "shimizu.shizuoka.jp", "shimoda.shizuoka.jp", "shizuoka.shizuoka.jp", "susono.shizuoka.jp", "yaizu.shizuoka.jp", "yoshida.shizuoka.jp", "ashikaga.tochigi.jp", "bato.tochigi.jp", "haga.tochigi.jp", "ichikai.tochigi.jp", "iwafune.tochigi.jp", "kaminokawa.tochigi.jp", "kanuma.tochigi.jp", "karasuyama.tochigi.jp", "kuroiso.tochigi.jp", "mashiko.tochigi.jp", "mibu.tochigi.jp", "moka.tochigi.jp", "motegi.tochigi.jp", "nasu.tochigi.jp", "nasushiobara.tochigi.jp", "nikko.tochigi.jp", "nishikata.tochigi.jp", "nogi.tochigi.jp", "ohira.tochigi.jp", "ohtawara.tochigi.jp", "oyama.tochigi.jp", "sakura.tochigi.jp", "sano.tochigi.jp", "shimotsuke.tochigi.jp", "shioya.tochigi.jp", "takanezawa.tochigi.jp", "tochigi.tochigi.jp", "tsuga.tochigi.jp", "ujiie.tochigi.jp", "utsunomiya.tochigi.jp", "yaita.tochigi.jp", "aizumi.tokushima.jp", "anan.tokushima.jp", "ichiba.tokushima.jp", "itano.tokushima.jp", "kainan.tokushima.jp", "komatsushima.tokushima.jp", "matsushige.tokushima.jp", "mima.tokushima.jp", "minami.tokushima.jp", "miyoshi.tokushima.jp", "mugi.tokushima.jp", "nakagawa.tokushima.jp", "naruto.tokushima.jp", "sanagochi.tokushima.jp", "shishikui.tokushima.jp", "tokushima.tokushima.jp", "wajiki.tokushima.jp", "adachi.tokyo.jp", "akiruno.tokyo.jp", "akishima.tokyo.jp", "aogashima.tokyo.jp", "arakawa.tokyo.jp", "bunkyo.tokyo.jp", "chiyoda.tokyo.jp", "chofu.tokyo.jp", "chuo.tokyo.jp", "edogawa.tokyo.jp", "fuchu.tokyo.jp", "fussa.tokyo.jp", "hachijo.tokyo.jp", "hachioji.tokyo.jp", "hamura.tokyo.jp", "higashikurume.tokyo.jp", "higashimurayama.tokyo.jp", "higashiyamato.tokyo.jp", "hino.tokyo.jp", "hinode.tokyo.jp", "hinohara.tokyo.jp", "inagi.tokyo.jp", "itabashi.tokyo.jp", "katsushika.tokyo.jp", "kita.tokyo.jp", "kiyose.tokyo.jp", "kodaira.tokyo.jp", "koganei.tokyo.jp", "kokubunji.tokyo.jp", "komae.tokyo.jp", "koto.tokyo.jp", "kouzushima.tokyo.jp", "kunitachi.tokyo.jp", "machida.tokyo.jp", "meguro.tokyo.jp", "minato.tokyo.jp", "mitaka.tokyo.jp", "mizuho.tokyo.jp", "musashimurayama.tokyo.jp", "musashino.tokyo.jp", "nakano.tokyo.jp", "nerima.tokyo.jp", "ogasawara.tokyo.jp", "okutama.tokyo.jp", "ome.tokyo.jp", "oshima.tokyo.jp", "ota.tokyo.jp", "setagaya.tokyo.jp", "shibuya.tokyo.jp", "shinagawa.tokyo.jp", "shinjuku.tokyo.jp", "suginami.tokyo.jp", "sumida.tokyo.jp", "tachikawa.tokyo.jp", "taito.tokyo.jp", "tama.tokyo.jp", "toshima.tokyo.jp", "chizu.tottori.jp", "hino.tottori.jp", "kawahara.tottori.jp", "koge.tottori.jp", "kotoura.tottori.jp", "misasa.tottori.jp", "nanbu.tottori.jp", "nichinan.tottori.jp", "sakaiminato.tottori.jp", "tottori.tottori.jp", "wakasa.tottori.jp", "yazu.tottori.jp", "yonago.tottori.jp", "asahi.toyama.jp", "fuchu.toyama.jp", "fukumitsu.toyama.jp", "funahashi.toyama.jp", "himi.toyama.jp", "imizu.toyama.jp", "inami.toyama.jp", "johana.toyama.jp", "kamiichi.toyama.jp", "kurobe.toyama.jp", "nakaniikawa.toyama.jp", "namerikawa.toyama.jp", "nanto.toyama.jp", "nyuzen.toyama.jp", "oyabe.toyama.jp", "taira.toyama.jp", "takaoka.toyama.jp", "tateyama.toyama.jp", "toga.toyama.jp", "tonami.toyama.jp", "toyama.toyama.jp", "unazuki.toyama.jp", "uozu.toyama.jp", "yamada.toyama.jp", "arida.wakayama.jp", "aridagawa.wakayama.jp", "gobo.wakayama.jp", "hashimoto.wakayama.jp", "hidaka.wakayama.jp", "hirogawa.wakayama.jp", "inami.wakayama.jp", "iwade.wakayama.jp", "kainan.wakayama.jp", "kamitonda.wakayama.jp", "katsuragi.wakayama.jp", "kimino.wakayama.jp", "kinokawa.wakayama.jp", "kitayama.wakayama.jp", "koya.wakayama.jp", "koza.wakayama.jp", "kozagawa.wakayama.jp", "kudoyama.wakayama.jp", "kushimoto.wakayama.jp", "mihama.wakayama.jp", "misato.wakayama.jp", "nachikatsuura.wakayama.jp", "shingu.wakayama.jp", "shirahama.wakayama.jp", "taiji.wakayama.jp", "tanabe.wakayama.jp", "wakayama.wakayama.jp", "yuasa.wakayama.jp", "yura.wakayama.jp", "asahi.yamagata.jp", "funagata.yamagata.jp", "higashine.yamagata.jp", "iide.yamagata.jp", "kahoku.yamagata.jp", "kaminoyama.yamagata.jp", "kaneyama.yamagata.jp", "kawanishi.yamagata.jp", "mamurogawa.yamagata.jp", "mikawa.yamagata.jp", "murayama.yamagata.jp", "nagai.yamagata.jp", "nakayama.yamagata.jp", "nanyo.yamagata.jp", "nishikawa.yamagata.jp", "obanazawa.yamagata.jp", "oe.yamagata.jp", "oguni.yamagata.jp", "ohkura.yamagata.jp", "oishida.yamagata.jp", "sagae.yamagata.jp", "sakata.yamagata.jp", "sakegawa.yamagata.jp", "shinjo.yamagata.jp", "shirataka.yamagata.jp", "shonai.yamagata.jp", "takahata.yamagata.jp", "tendo.yamagata.jp", "tozawa.yamagata.jp", "tsuruoka.yamagata.jp", "yamagata.yamagata.jp", "yamanobe.yamagata.jp", "yonezawa.yamagata.jp", "yuza.yamagata.jp", "abu.yamaguchi.jp", "hagi.yamaguchi.jp", "hikari.yamaguchi.jp", "hofu.yamaguchi.jp", "iwakuni.yamaguchi.jp", "kudamatsu.yamaguchi.jp", "mitou.yamaguchi.jp", "nagato.yamaguchi.jp", "oshima.yamaguchi.jp", "shimonoseki.yamaguchi.jp", "shunan.yamaguchi.jp", "tabuse.yamaguchi.jp", "tokuyama.yamaguchi.jp", "toyota.yamaguchi.jp", "ube.yamaguchi.jp", "yuu.yamaguchi.jp", "chuo.yamanashi.jp", "doshi.yamanashi.jp", "fuefuki.yamanashi.jp", "fujikawa.yamanashi.jp", "fujikawaguchiko.yamanashi.jp", "fujiyoshida.yamanashi.jp", "hayakawa.yamanashi.jp", "hokuto.yamanashi.jp", "ichikawamisato.yamanashi.jp", "kai.yamanashi.jp", "kofu.yamanashi.jp", "koshu.yamanashi.jp", "kosuge.yamanashi.jp", "minami-alps.yamanashi.jp", "minobu.yamanashi.jp", "nakamichi.yamanashi.jp", "nanbu.yamanashi.jp", "narusawa.yamanashi.jp", "nirasaki.yamanashi.jp", "nishikatsura.yamanashi.jp", "oshino.yamanashi.jp", "otsuki.yamanashi.jp", "showa.yamanashi.jp", "tabayama.yamanashi.jp", "tsuru.yamanashi.jp", "uenohara.yamanashi.jp", "yamanakako.yamanashi.jp", "yamanashi.yamanashi.jp", "ke", "ac.ke", "co.ke", "go.ke", "info.ke", "me.ke", "mobi.ke", "ne.ke", "or.ke", "sc.ke", "kg", "org.kg", "net.kg", "com.kg", "edu.kg", "gov.kg", "mil.kg", "*.kh", "ki", "edu.ki", "biz.ki", "net.ki", "org.ki", "gov.ki", "info.ki", "com.ki", "km", "org.km", "nom.km", "gov.km", "prd.km", "tm.km", "edu.km", "mil.km", "ass.km", "com.km", "coop.km", "asso.km", "presse.km", "medecin.km", "notaires.km", "pharmaciens.km", "veterinaire.km", "gouv.km", "kn", "net.kn", "org.kn", "edu.kn", "gov.kn", "kp", "com.kp", "edu.kp", "gov.kp", "org.kp", "rep.kp", "tra.kp", "kr", "ac.kr", "co.kr", "es.kr", "go.kr", "hs.kr", "kg.kr", "mil.kr", "ms.kr", "ne.kr", "or.kr", "pe.kr", "re.kr", "sc.kr", "busan.kr", "chungbuk.kr", "chungnam.kr", "daegu.kr", "daejeon.kr", "gangwon.kr", "gwangju.kr", "gyeongbuk.kr", "gyeonggi.kr", "gyeongnam.kr", "incheon.kr", "jeju.kr", "jeonbuk.kr", "jeonnam.kr", "seoul.kr", "ulsan.kr", "kw", "com.kw", "edu.kw", "emb.kw", "gov.kw", "ind.kw", "net.kw", "org.kw", "ky", "edu.ky", "gov.ky", "com.ky", "org.ky", "net.ky", "kz", "org.kz", "edu.kz", "net.kz", "gov.kz", "mil.kz", "com.kz", "la", "int.la", "net.la", "info.la", "edu.la", "gov.la", "per.la", "com.la", "org.la", "lb", "com.lb", "edu.lb", "gov.lb", "net.lb", "org.lb", "lc", "com.lc", "net.lc", "co.lc", "org.lc", "edu.lc", "gov.lc", "li", "lk", "gov.lk", "sch.lk", "net.lk", "int.lk", "com.lk", "org.lk", "edu.lk", "ngo.lk", "soc.lk", "web.lk", "ltd.lk", "assn.lk", "grp.lk", "hotel.lk", "ac.lk", "lr", "com.lr", "edu.lr", "gov.lr", "org.lr", "net.lr", "ls", "ac.ls", "biz.ls", "co.ls", "edu.ls", "gov.ls", "info.ls", "net.ls", "org.ls", "sc.ls", "lt", "gov.lt", "lu", "lv", "com.lv", "edu.lv", "gov.lv", "org.lv", "mil.lv", "id.lv", "net.lv", "asn.lv", "conf.lv", "ly", "com.ly", "net.ly", "gov.ly", "plc.ly", "edu.ly", "sch.ly", "med.ly", "org.ly", "id.ly", "ma", "co.ma", "net.ma", "gov.ma", "org.ma", "ac.ma", "press.ma", "mc", "tm.mc", "asso.mc", "md", "me", "co.me", "net.me", "org.me", "edu.me", "ac.me", "gov.me", "its.me", "priv.me", "mg", "org.mg", "nom.mg", "gov.mg", "prd.mg", "tm.mg", "edu.mg", "mil.mg", "com.mg", "co.mg", "mh", "mil", "mk", "com.mk", "org.mk", "net.mk", "edu.mk", "gov.mk", "inf.mk", "name.mk", "ml", "com.ml", "edu.ml", "gouv.ml", "gov.ml", "net.ml", "org.ml", "presse.ml", "*.mm", "mn", "gov.mn", "edu.mn", "org.mn", "mo", "com.mo", "net.mo", "org.mo", "edu.mo", "gov.mo", "mobi", "mp", "mq", "mr", "gov.mr", "ms", "com.ms", "edu.ms", "gov.ms", "net.ms", "org.ms", "mt", "com.mt", "edu.mt", "net.mt", "org.mt", "mu", "com.mu", "net.mu", "org.mu", "gov.mu", "ac.mu", "co.mu", "or.mu", "museum", "academy.museum", "agriculture.museum", "air.museum", "airguard.museum", "alabama.museum", "alaska.museum", "amber.museum", "ambulance.museum", "american.museum", "americana.museum", "americanantiques.museum", "americanart.museum", "amsterdam.museum", "and.museum", "annefrank.museum", "anthro.museum", "anthropology.museum", "antiques.museum", "aquarium.museum", "arboretum.museum", "archaeological.museum", "archaeology.museum", "architecture.museum", "art.museum", "artanddesign.museum", "artcenter.museum", "artdeco.museum", "arteducation.museum", "artgallery.museum", "arts.museum", "artsandcrafts.museum", "asmatart.museum", "assassination.museum", "assisi.museum", "association.museum", "astronomy.museum", "atlanta.museum", "austin.museum", "australia.museum", "automotive.museum", "aviation.museum", "axis.museum", "badajoz.museum", "baghdad.museum", "bahn.museum", "bale.museum", "baltimore.museum", "barcelona.museum", "baseball.museum", "basel.museum", "baths.museum", "bauern.museum", "beauxarts.museum", "beeldengeluid.museum", "bellevue.museum", "bergbau.museum", "berkeley.museum", "berlin.museum", "bern.museum", "bible.museum", "bilbao.museum", "bill.museum", "birdart.museum", "birthplace.museum", "bonn.museum", "boston.museum", "botanical.museum", "botanicalgarden.museum", "botanicgarden.museum", "botany.museum", "brandywinevalley.museum", "brasil.museum", "bristol.museum", "british.museum", "britishcolumbia.museum", "broadcast.museum", "brunel.museum", "brussel.museum", "brussels.museum", "bruxelles.museum", "building.museum", "burghof.museum", "bus.museum", "bushey.museum", "cadaques.museum", "california.museum", "cambridge.museum", "can.museum", "canada.museum", "capebreton.museum", "carrier.museum", "cartoonart.museum", "casadelamoneda.museum", "castle.museum", "castres.museum", "celtic.museum", "center.museum", "chattanooga.museum", "cheltenham.museum", "chesapeakebay.museum", "chicago.museum", "children.museum", "childrens.museum", "childrensgarden.museum", "chiropractic.museum", "chocolate.museum", "christiansburg.museum", "cincinnati.museum", "cinema.museum", "circus.museum", "civilisation.museum", "civilization.museum", "civilwar.museum", "clinton.museum", "clock.museum", "coal.museum", "coastaldefence.museum", "cody.museum", "coldwar.museum", "collection.museum", "colonialwilliamsburg.museum", "coloradoplateau.museum", "columbia.museum", "columbus.museum", "communication.museum", "communications.museum", "community.museum", "computer.museum", "computerhistory.museum", "comunicações.museum", "contemporary.museum", "contemporaryart.museum", "convent.museum", "copenhagen.museum", "corporation.museum", "correios-e-telecomunicações.museum", "corvette.museum", "costume.museum", "countryestate.museum", "county.museum", "crafts.museum", "cranbrook.museum", "creation.museum", "cultural.museum", "culturalcenter.museum", "culture.museum", "cyber.museum", "cymru.museum", "dali.museum", "dallas.museum", "database.museum", "ddr.museum", "decorativearts.museum", "delaware.museum", "delmenhorst.museum", "denmark.museum", "depot.museum", "design.museum", "detroit.museum", "dinosaur.museum", "discovery.museum", "dolls.museum", "donostia.museum", "durham.museum", "eastafrica.museum", "eastcoast.museum", "education.museum", "educational.museum", "egyptian.museum", "eisenbahn.museum", "elburg.museum", "elvendrell.museum", "embroidery.museum", "encyclopedic.museum", "england.museum", "entomology.museum", "environment.museum", "environmentalconservation.museum", "epilepsy.museum", "essex.museum", "estate.museum", "ethnology.museum", "exeter.museum", "exhibition.museum", "family.museum", "farm.museum", "farmequipment.museum", "farmers.museum", "farmstead.museum", "field.museum", "figueres.museum", "filatelia.museum", "film.museum", "fineart.museum", "finearts.museum", "finland.museum", "flanders.museum", "florida.museum", "force.museum", "fortmissoula.museum", "fortworth.museum", "foundation.museum", "francaise.museum", "frankfurt.museum", "franziskaner.museum", "freemasonry.museum", "freiburg.museum", "fribourg.museum", "frog.museum", "fundacio.museum", "furniture.museum", "gallery.museum", "garden.museum", "gateway.museum", "geelvinck.museum", "gemological.museum", "geology.museum", "georgia.museum", "giessen.museum", "glas.museum", "glass.museum", "gorge.museum", "grandrapids.museum", "graz.museum", "guernsey.museum", "halloffame.museum", "hamburg.museum", "handson.museum", "harvestcelebration.museum", "hawaii.museum", "health.museum", "heimatunduhren.museum", "hellas.museum", "helsinki.museum", "hembygdsforbund.museum", "heritage.museum", "histoire.museum", "historical.museum", "historicalsociety.museum", "historichouses.museum", "historisch.museum", "historisches.museum", "history.museum", "historyofscience.museum", "horology.museum", "house.museum", "humanities.museum", "illustration.museum", "imageandsound.museum", "indian.museum", "indiana.museum", "indianapolis.museum", "indianmarket.museum", "intelligence.museum", "interactive.museum", "iraq.museum", "iron.museum", "isleofman.museum", "jamison.museum", "jefferson.museum", "jerusalem.museum", "jewelry.museum", "jewish.museum", "jewishart.museum", "jfk.museum", "journalism.museum", "judaica.museum", "judygarland.museum", "juedisches.museum", "juif.museum", "karate.museum", "karikatur.museum", "kids.museum", "koebenhavn.museum", "koeln.museum", "kunst.museum", "kunstsammlung.museum", "kunstunddesign.museum", "labor.museum", "labour.museum", "lajolla.museum", "lancashire.museum", "landes.museum", "lans.museum", "läns.museum", "larsson.museum", "lewismiller.museum", "lincoln.museum", "linz.museum", "living.museum", "livinghistory.museum", "localhistory.museum", "london.museum", "losangeles.museum", "louvre.museum", "loyalist.museum", "lucerne.museum", "luxembourg.museum", "luzern.museum", "mad.museum", "madrid.museum", "mallorca.museum", "manchester.museum", "mansion.museum", "mansions.museum", "manx.museum", "marburg.museum", "maritime.museum", "maritimo.museum", "maryland.museum", "marylhurst.museum", "media.museum", "medical.museum", "medizinhistorisches.museum", "meeres.museum", "memorial.museum", "mesaverde.museum", "michigan.museum", "midatlantic.museum", "military.museum", "mill.museum", "miners.museum", "mining.museum", "minnesota.museum", "missile.museum", "missoula.museum", "modern.museum", "moma.museum", "money.museum", "monmouth.museum", "monticello.museum", "montreal.museum", "moscow.museum", "motorcycle.museum", "muenchen.museum", "muenster.museum", "mulhouse.museum", "muncie.museum", "museet.museum", "museumcenter.museum", "museumvereniging.museum", "music.museum", "national.museum", "nationalfirearms.museum", "nationalheritage.museum", "nativeamerican.museum", "naturalhistory.museum", "naturalhistorymuseum.museum", "naturalsciences.museum", "nature.museum", "naturhistorisches.museum", "natuurwetenschappen.museum", "naumburg.museum", "naval.museum", "nebraska.museum", "neues.museum", "newhampshire.museum", "newjersey.museum", "newmexico.museum", "newport.museum", "newspaper.museum", "newyork.museum", "niepce.museum", "norfolk.museum", "north.museum", "nrw.museum", "nuernberg.museum", "nuremberg.museum", "nyc.museum", "nyny.museum", "oceanographic.museum", "oceanographique.museum", "omaha.museum", "online.museum", "ontario.museum", "openair.museum", "oregon.museum", "oregontrail.museum", "otago.museum", "oxford.museum", "pacific.museum", "paderborn.museum", "palace.museum", "paleo.museum", "palmsprings.museum", "panama.museum", "paris.museum", "pasadena.museum", "pharmacy.museum", "philadelphia.museum", "philadelphiaarea.museum", "philately.museum", "phoenix.museum", "photography.museum", "pilots.museum", "pittsburgh.museum", "planetarium.museum", "plantation.museum", "plants.museum", "plaza.museum", "portal.museum", "portland.museum", "portlligat.museum", "posts-and-telecommunications.museum", "preservation.museum", "presidio.museum", "press.museum", "project.museum", "public.museum", "pubol.museum", "quebec.museum", "railroad.museum", "railway.museum", "research.museum", "resistance.museum", "riodejaneiro.museum", "rochester.museum", "rockart.museum", "roma.museum", "russia.museum", "saintlouis.museum", "salem.museum", "salvadordali.museum", "salzburg.museum", "sandiego.museum", "sanfrancisco.museum", "santabarbara.museum", "santacruz.museum", "santafe.museum", "saskatchewan.museum", "satx.museum", "savannahga.museum", "schlesisches.museum", "schoenbrunn.museum", "schokoladen.museum", "school.museum", "schweiz.museum", "science.museum", "scienceandhistory.museum", "scienceandindustry.museum", "sciencecenter.museum", "sciencecenters.museum", "science-fiction.museum", "sciencehistory.museum", "sciences.museum", "sciencesnaturelles.museum", "scotland.museum", "seaport.museum", "settlement.museum", "settlers.museum", "shell.museum", "sherbrooke.museum", "sibenik.museum", "silk.museum", "ski.museum", "skole.museum", "society.museum", "sologne.museum", "soundandvision.museum", "southcarolina.museum", "southwest.museum", "space.museum", "spy.museum", "square.museum", "stadt.museum", "stalbans.museum", "starnberg.museum", "state.museum", "stateofdelaware.museum", "station.museum", "steam.museum", "steiermark.museum", "stjohn.museum", "stockholm.museum", "stpetersburg.museum", "stuttgart.museum", "suisse.museum", "surgeonshall.museum", "surrey.museum", "svizzera.museum", "sweden.museum", "sydney.museum", "tank.museum", "tcm.museum", "technology.museum", "telekommunikation.museum", "television.museum", "texas.museum", "textile.museum", "theater.museum", "time.museum", "timekeeping.museum", "topology.museum", "torino.museum", "touch.museum", "town.museum", "transport.museum", "tree.museum", "trolley.museum", "trust.museum", "trustee.museum", "uhren.museum", "ulm.museum", "undersea.museum", "university.museum", "usa.museum", "usantiques.museum", "usarts.museum", "uscountryestate.museum", "usculture.museum", "usdecorativearts.museum", "usgarden.museum", "ushistory.museum", "ushuaia.museum", "uslivinghistory.museum", "utah.museum", "uvic.museum", "valley.museum", "vantaa.museum", "versailles.museum", "viking.museum", "village.museum", "virginia.museum", "virtual.museum", "virtuel.museum", "vlaanderen.museum", "volkenkunde.museum", "wales.museum", "wallonie.museum", "war.museum", "washingtondc.museum", "watchandclock.museum", "watch-and-clock.museum", "western.museum", "westfalen.museum", "whaling.museum", "wildlife.museum", "williamsburg.museum", "windmill.museum", "workshop.museum", "york.museum", "yorkshire.museum", "yosemite.museum", "youth.museum", "zoological.museum", "zoology.museum", "ירושלים.museum", "иком.museum", "mv", "aero.mv", "biz.mv", "com.mv", "coop.mv", "edu.mv", "gov.mv", "info.mv", "int.mv", "mil.mv", "museum.mv", "name.mv", "net.mv", "org.mv", "pro.mv", "mw", "ac.mw", "biz.mw", "co.mw", "com.mw", "coop.mw", "edu.mw", "gov.mw", "int.mw", "museum.mw", "net.mw", "org.mw", "mx", "com.mx", "org.mx", "gob.mx", "edu.mx", "net.mx", "my", "com.my", "net.my", "org.my", "gov.my", "edu.my", "mil.my", "name.my", "mz", "ac.mz", "adv.mz", "co.mz", "edu.mz", "gov.mz", "mil.mz", "net.mz", "org.mz", "na", "info.na", "pro.na", "name.na", "school.na", "or.na", "dr.na", "us.na", "mx.na", "ca.na", "in.na", "cc.na", "tv.na", "ws.na", "mobi.na", "co.na", "com.na", "org.na", "name", "nc", "asso.nc", "nom.nc", "ne", "net", "nf", "com.nf", "net.nf", "per.nf", "rec.nf", "web.nf", "arts.nf", "firm.nf", "info.nf", "other.nf", "store.nf", "ng", "com.ng", "edu.ng", "gov.ng", "i.ng", "mil.ng", "mobi.ng", "name.ng", "net.ng", "org.ng", "sch.ng", "ni", "ac.ni", "biz.ni", "co.ni", "com.ni", "edu.ni", "gob.ni", "in.ni", "info.ni", "int.ni", "mil.ni", "net.ni", "nom.ni", "org.ni", "web.ni", "nl", "no", "fhs.no", "vgs.no", "fylkesbibl.no", "folkebibl.no", "museum.no", "idrett.no", "priv.no", "mil.no", "stat.no", "dep.no", "kommune.no", "herad.no", "aa.no", "ah.no", "bu.no", "fm.no", "hl.no", "hm.no", "jan-mayen.no", "mr.no", "nl.no", "nt.no", "of.no", "ol.no", "oslo.no", "rl.no", "sf.no", "st.no", "svalbard.no", "tm.no", "tr.no", "va.no", "vf.no", "gs.aa.no", "gs.ah.no", "gs.bu.no", "gs.fm.no", "gs.hl.no", "gs.hm.no", "gs.jan-mayen.no", "gs.mr.no", "gs.nl.no", "gs.nt.no", "gs.of.no", "gs.ol.no", "gs.oslo.no", "gs.rl.no", "gs.sf.no", "gs.st.no", "gs.svalbard.no", "gs.tm.no", "gs.tr.no", "gs.va.no", "gs.vf.no", "akrehamn.no", "åkrehamn.no", "algard.no", "ålgård.no", "arna.no", "brumunddal.no", "bryne.no", "bronnoysund.no", "brønnøysund.no", "drobak.no", "drøbak.no", "egersund.no", "fetsund.no", "floro.no", "florø.no", "fredrikstad.no", "hokksund.no", "honefoss.no", "hønefoss.no", "jessheim.no", "jorpeland.no", "jørpeland.no", "kirkenes.no", "kopervik.no", "krokstadelva.no", "langevag.no", "langevåg.no", "leirvik.no", "mjondalen.no", "mjøndalen.no", "mo-i-rana.no", "mosjoen.no", "mosjøen.no", "nesoddtangen.no", "orkanger.no", "osoyro.no", "osøyro.no", "raholt.no", "råholt.no", "sandnessjoen.no", "sandnessjøen.no", "skedsmokorset.no", "slattum.no", "spjelkavik.no", "stathelle.no", "stavern.no", "stjordalshalsen.no", "stjørdalshalsen.no", "tananger.no", "tranby.no", "vossevangen.no", "afjord.no", "åfjord.no", "agdenes.no", "al.no", "ål.no", "alesund.no", "ålesund.no", "alstahaug.no", "alta.no", "áltá.no", "alaheadju.no", "álaheadju.no", "alvdal.no", "amli.no", "åmli.no", "amot.no", "åmot.no", "andebu.no", "andoy.no", "andøy.no", "andasuolo.no", "ardal.no", "årdal.no", "aremark.no", "arendal.no", "ås.no", "aseral.no", "åseral.no", "asker.no", "askim.no", "askvoll.no", "askoy.no", "askøy.no", "asnes.no", "åsnes.no", "audnedaln.no", "aukra.no", "aure.no", "aurland.no", "aurskog-holand.no", "aurskog-høland.no", "austevoll.no", "austrheim.no", "averoy.no", "averøy.no", "balestrand.no", "ballangen.no", "balat.no", "bálát.no", "balsfjord.no", "bahccavuotna.no", "báhccavuotna.no", "bamble.no", "bardu.no", "beardu.no", "beiarn.no", "bajddar.no", "bájddar.no", "baidar.no", "báidár.no", "berg.no", "bergen.no", "berlevag.no", "berlevåg.no", "bearalvahki.no", "bearalváhki.no", "bindal.no", "birkenes.no", "bjarkoy.no", "bjarkøy.no", "bjerkreim.no", "bjugn.no", "bodo.no", "bodø.no", "badaddja.no", "bådåddjå.no", "budejju.no", "bokn.no", "bremanger.no", "bronnoy.no", "brønnøy.no", "bygland.no", "bykle.no", "barum.no", "bærum.no", "bo.telemark.no", "bø.telemark.no", "bo.nordland.no", "bø.nordland.no", "bievat.no", "bievát.no", "bomlo.no", "bømlo.no", "batsfjord.no", "båtsfjord.no", "bahcavuotna.no", "báhcavuotna.no", "dovre.no", "drammen.no", "drangedal.no", "dyroy.no", "dyrøy.no", "donna.no", "dønna.no", "eid.no", "eidfjord.no", "eidsberg.no", "eidskog.no", "eidsvoll.no", "eigersund.no", "elverum.no", "enebakk.no", "engerdal.no", "etne.no", "etnedal.no", "evenes.no", "evenassi.no", "evenášši.no", "evje-og-hornnes.no", "farsund.no", "fauske.no", "fuossko.no", "fuoisku.no", "fedje.no", "fet.no", "finnoy.no", "finnøy.no", "fitjar.no", "fjaler.no", "fjell.no", "flakstad.no", "flatanger.no", "flekkefjord.no", "flesberg.no", "flora.no", "fla.no", "flå.no", "folldal.no", "forsand.no", "fosnes.no", "frei.no", "frogn.no", "froland.no", "frosta.no", "frana.no", "fræna.no", "froya.no", "frøya.no", "fusa.no", "fyresdal.no", "forde.no", "førde.no", "gamvik.no", "gangaviika.no", "gáŋgaviika.no", "gaular.no", "gausdal.no", "gildeskal.no", "gildeskål.no", "giske.no", "gjemnes.no", "gjerdrum.no", "gjerstad.no", "gjesdal.no", "gjovik.no", "gjøvik.no", "gloppen.no", "gol.no", "gran.no", "grane.no", "granvin.no", "gratangen.no", "grimstad.no", "grong.no", "kraanghke.no", "kråanghke.no", "grue.no", "gulen.no", "hadsel.no", "halden.no", "halsa.no", "hamar.no", "hamaroy.no", "habmer.no", "hábmer.no", "hapmir.no", "hápmir.no", "hammerfest.no", "hammarfeasta.no", "hámmárfeasta.no", "haram.no", "hareid.no", "harstad.no", "hasvik.no", "aknoluokta.no", "ákŋoluokta.no", "hattfjelldal.no", "aarborte.no", "haugesund.no", "hemne.no", "hemnes.no", "hemsedal.no", "heroy.more-og-romsdal.no", "herøy.møre-og-romsdal.no", "heroy.nordland.no", "herøy.nordland.no", "hitra.no", "hjartdal.no", "hjelmeland.no", "hobol.no", "hobøl.no", "hof.no", "hol.no", "hole.no", "holmestrand.no", "holtalen.no", "holtålen.no", "hornindal.no", "horten.no", "hurdal.no", "hurum.no", "hvaler.no", "hyllestad.no", "hagebostad.no", "hægebostad.no", "hoyanger.no", "høyanger.no", "hoylandet.no", "høylandet.no", "ha.no", "hå.no", "ibestad.no", "inderoy.no", "inderøy.no", "iveland.no", "jevnaker.no", "jondal.no", "jolster.no", "jølster.no", "karasjok.no", "karasjohka.no", "kárášjohka.no", "karlsoy.no", "galsa.no", "gálsá.no", "karmoy.no", "karmøy.no", "kautokeino.no", "guovdageaidnu.no", "klepp.no", "klabu.no", "klæbu.no", "kongsberg.no", "kongsvinger.no", "kragero.no", "kragerø.no", "kristiansand.no", "kristiansund.no", "krodsherad.no", "krødsherad.no", "kvalsund.no", "rahkkeravju.no", "ráhkkerávju.no", "kvam.no", "kvinesdal.no", "kvinnherad.no", "kviteseid.no", "kvitsoy.no", "kvitsøy.no", "kvafjord.no", "kvæfjord.no", "giehtavuoatna.no", "kvanangen.no", "kvænangen.no", "navuotna.no", "návuotna.no", "kafjord.no", "kåfjord.no", "gaivuotna.no", "gáivuotna.no", "larvik.no", "lavangen.no", "lavagis.no", "loabat.no", "loabát.no", "lebesby.no", "davvesiida.no", "leikanger.no", "leirfjord.no", "leka.no", "leksvik.no", "lenvik.no", "leangaviika.no", "leaŋgaviika.no", "lesja.no", "levanger.no", "lier.no", "lierne.no", "lillehammer.no", "lillesand.no", "lindesnes.no", "lindas.no", "lindås.no", "lom.no", "loppa.no", "lahppi.no", "láhppi.no", "lund.no", "lunner.no", "luroy.no", "lurøy.no", "luster.no", "lyngdal.no", "lyngen.no", "ivgu.no", "lardal.no", "lerdal.no", "lærdal.no", "lodingen.no", "lødingen.no", "lorenskog.no", "lørenskog.no", "loten.no", "løten.no", "malvik.no", "masoy.no", "måsøy.no", "muosat.no", "muosát.no", "mandal.no", "marker.no", "marnardal.no", "masfjorden.no", "meland.no", "meldal.no", "melhus.no", "meloy.no", "meløy.no", "meraker.no", "meråker.no", "moareke.no", "moåreke.no", "midsund.no", "midtre-gauldal.no", "modalen.no", "modum.no", "molde.no", "moskenes.no", "moss.no", "mosvik.no", "malselv.no", "målselv.no", "malatvuopmi.no", "málatvuopmi.no", "namdalseid.no", "aejrie.no", "namsos.no", "namsskogan.no", "naamesjevuemie.no", "nååmesjevuemie.no", "laakesvuemie.no", "nannestad.no", "narvik.no", "narviika.no", "naustdal.no", "nedre-eiker.no", "nes.akershus.no", "nes.buskerud.no", "nesna.no", "nesodden.no", "nesseby.no", "unjarga.no", "unjárga.no", "nesset.no", "nissedal.no", "nittedal.no", "nord-aurdal.no", "nord-fron.no", "nord-odal.no", "norddal.no", "nordkapp.no", "davvenjarga.no", "davvenjárga.no", "nordre-land.no", "nordreisa.no", "raisa.no", "ráisa.no", "nore-og-uvdal.no", "notodden.no", "naroy.no", "nærøy.no", "notteroy.no", "nøtterøy.no", "odda.no", "oksnes.no", "øksnes.no", "oppdal.no", "oppegard.no", "oppegård.no", "orkdal.no", "orland.no", "ørland.no", "orskog.no", "ørskog.no", "orsta.no", "ørsta.no", "os.hedmark.no", "os.hordaland.no", "osen.no", "osteroy.no", "osterøy.no", "ostre-toten.no", "østre-toten.no", "overhalla.no", "ovre-eiker.no", "øvre-eiker.no", "oyer.no", "øyer.no", "oygarden.no", "øygarden.no", "oystre-slidre.no", "øystre-slidre.no", "porsanger.no", "porsangu.no", "porsáŋgu.no", "porsgrunn.no", "radoy.no", "radøy.no", "rakkestad.no", "rana.no", "ruovat.no", "randaberg.no", "rauma.no", "rendalen.no", "rennebu.no", "rennesoy.no", "rennesøy.no", "rindal.no", "ringebu.no", "ringerike.no", "ringsaker.no", "rissa.no", "risor.no", "risør.no", "roan.no", "rollag.no", "rygge.no", "ralingen.no", "rælingen.no", "rodoy.no", "rødøy.no", "romskog.no", "rømskog.no", "roros.no", "røros.no", "rost.no", "røst.no", "royken.no", "røyken.no", "royrvik.no", "røyrvik.no", "rade.no", "råde.no", "salangen.no", "siellak.no", "saltdal.no", "salat.no", "sálát.no", "sálat.no", "samnanger.no", "sande.more-og-romsdal.no", "sande.møre-og-romsdal.no", "sande.vestfold.no", "sandefjord.no", "sandnes.no", "sandoy.no", "sandøy.no", "sarpsborg.no", "sauda.no", "sauherad.no", "sel.no", "selbu.no", "selje.no", "seljord.no", "sigdal.no", "siljan.no", "sirdal.no", "skaun.no", "skedsmo.no", "ski.no", "skien.no", "skiptvet.no", "skjervoy.no", "skjervøy.no", "skierva.no", "skiervá.no", "skjak.no", "skjåk.no", "skodje.no", "skanland.no", "skånland.no", "skanit.no", "skánit.no", "smola.no", "smøla.no", "snillfjord.no", "snasa.no", "snåsa.no", "snoasa.no", "snaase.no", "snåase.no", "sogndal.no", "sokndal.no", "sola.no", "solund.no", "songdalen.no", "sortland.no", "spydeberg.no", "stange.no", "stavanger.no", "steigen.no", "steinkjer.no", "stjordal.no", "stjørdal.no", "stokke.no", "stor-elvdal.no", "stord.no", "stordal.no", "storfjord.no", "omasvuotna.no", "strand.no", "stranda.no", "stryn.no", "sula.no", "suldal.no", "sund.no", "sunndal.no", "surnadal.no", "sveio.no", "svelvik.no", "sykkylven.no", "sogne.no", "søgne.no", "somna.no", "sømna.no", "sondre-land.no", "søndre-land.no", "sor-aurdal.no", "sør-aurdal.no", "sor-fron.no", "sør-fron.no", "sor-odal.no", "sør-odal.no", "sor-varanger.no", "sør-varanger.no", "matta-varjjat.no", "mátta-várjjat.no", "sorfold.no", "sørfold.no", "sorreisa.no", "sørreisa.no", "sorum.no", "sørum.no", "tana.no", "deatnu.no", "time.no", "tingvoll.no", "tinn.no", "tjeldsund.no", "dielddanuorri.no", "tjome.no", "tjøme.no", "tokke.no", "tolga.no", "torsken.no", "tranoy.no", "tranøy.no", "tromso.no", "tromsø.no", "tromsa.no", "romsa.no", "trondheim.no", "troandin.no", "trysil.no", "trana.no", "træna.no", "trogstad.no", "trøgstad.no", "tvedestrand.no", "tydal.no", "tynset.no", "tysfjord.no", "divtasvuodna.no", "divttasvuotna.no", "tysnes.no", "tysvar.no", "tysvær.no", "tonsberg.no", "tønsberg.no", "ullensaker.no", "ullensvang.no", "ulvik.no", "utsira.no", "vadso.no", "vadsø.no", "cahcesuolo.no", "čáhcesuolo.no", "vaksdal.no", "valle.no", "vang.no", "vanylven.no", "vardo.no", "vardø.no", "varggat.no", "várggát.no", "vefsn.no", "vaapste.no", "vega.no", "vegarshei.no", "vegårshei.no", "vennesla.no", "verdal.no", "verran.no", "vestby.no", "vestnes.no", "vestre-slidre.no", "vestre-toten.no", "vestvagoy.no", "vestvågøy.no", "vevelstad.no", "vik.no", "vikna.no", "vindafjord.no", "volda.no", "voss.no", "varoy.no", "værøy.no", "vagan.no", "vågan.no", "voagat.no", "vagsoy.no", "vågsøy.no", "vaga.no", "vågå.no", "valer.ostfold.no", "våler.østfold.no", "valer.hedmark.no", "våler.hedmark.no", "*.np", "nr", "biz.nr", "info.nr", "gov.nr", "edu.nr", "org.nr", "net.nr", "com.nr", "nu", "nz", "ac.nz", "co.nz", "cri.nz", "geek.nz", "gen.nz", "govt.nz", "health.nz", "iwi.nz", "kiwi.nz", "maori.nz", "mil.nz", "māori.nz", "net.nz", "org.nz", "parliament.nz", "school.nz", "om", "co.om", "com.om", "edu.om", "gov.om", "med.om", "museum.om", "net.om", "org.om", "pro.om", "onion", "org", "pa", "ac.pa", "gob.pa", "com.pa", "org.pa", "sld.pa", "edu.pa", "net.pa", "ing.pa", "abo.pa", "med.pa", "nom.pa", "pe", "edu.pe", "gob.pe", "nom.pe", "mil.pe", "org.pe", "com.pe", "net.pe", "pf", "com.pf", "org.pf", "edu.pf", "*.pg", "ph", "com.ph", "net.ph", "org.ph", "gov.ph", "edu.ph", "ngo.ph", "mil.ph", "i.ph", "pk", "com.pk", "net.pk", "edu.pk", "org.pk", "fam.pk", "biz.pk", "web.pk", "gov.pk", "gob.pk", "gok.pk", "gon.pk", "gop.pk", "gos.pk", "info.pk", "pl", "com.pl", "net.pl", "org.pl", "aid.pl", "agro.pl", "atm.pl", "auto.pl", "biz.pl", "edu.pl", "gmina.pl", "gsm.pl", "info.pl", "mail.pl", "miasta.pl", "media.pl", "mil.pl", "nieruchomosci.pl", "nom.pl", "pc.pl", "powiat.pl", "priv.pl", "realestate.pl", "rel.pl", "sex.pl", "shop.pl", "sklep.pl", "sos.pl", "szkola.pl", "targi.pl", "tm.pl", "tourism.pl", "travel.pl", "turystyka.pl", "gov.pl", "ap.gov.pl", "ic.gov.pl", "is.gov.pl", "us.gov.pl", "kmpsp.gov.pl", "kppsp.gov.pl", "kwpsp.gov.pl", "psp.gov.pl", "wskr.gov.pl", "kwp.gov.pl", "mw.gov.pl", "ug.gov.pl", "um.gov.pl", "umig.gov.pl", "ugim.gov.pl", "upow.gov.pl", "uw.gov.pl", "starostwo.gov.pl", "pa.gov.pl", "po.gov.pl", "psse.gov.pl", "pup.gov.pl", "rzgw.gov.pl", "sa.gov.pl", "so.gov.pl", "sr.gov.pl", "wsa.gov.pl", "sko.gov.pl", "uzs.gov.pl", "wiih.gov.pl", "winb.gov.pl", "pinb.gov.pl", "wios.gov.pl", "witd.gov.pl", "wzmiuw.gov.pl", "piw.gov.pl", "wiw.gov.pl", "griw.gov.pl", "wif.gov.pl", "oum.gov.pl", "sdn.gov.pl", "zp.gov.pl", "uppo.gov.pl", "mup.gov.pl", "wuoz.gov.pl", "konsulat.gov.pl", "oirm.gov.pl", "augustow.pl", "babia-gora.pl", "bedzin.pl", "beskidy.pl", "bialowieza.pl", "bialystok.pl", "bielawa.pl", "bieszczady.pl", "boleslawiec.pl", "bydgoszcz.pl", "bytom.pl", "cieszyn.pl", "czeladz.pl", "czest.pl", "dlugoleka.pl", "elblag.pl", "elk.pl", "glogow.pl", "gniezno.pl", "gorlice.pl", "grajewo.pl", "ilawa.pl", "jaworzno.pl", "jelenia-gora.pl", "jgora.pl", "kalisz.pl", "kazimierz-dolny.pl", "karpacz.pl", "kartuzy.pl", "kaszuby.pl", "katowice.pl", "kepno.pl", "ketrzyn.pl", "klodzko.pl", "kobierzyce.pl", "kolobrzeg.pl", "konin.pl", "konskowola.pl", "kutno.pl", "lapy.pl", "lebork.pl", "legnica.pl", "lezajsk.pl", "limanowa.pl", "lomza.pl", "lowicz.pl", "lubin.pl", "lukow.pl", "malbork.pl", "malopolska.pl", "mazowsze.pl", "mazury.pl", "mielec.pl", "mielno.pl", "mragowo.pl", "naklo.pl", "nowaruda.pl", "nysa.pl", "olawa.pl", "olecko.pl", "olkusz.pl", "olsztyn.pl", "opoczno.pl", "opole.pl", "ostroda.pl", "ostroleka.pl", "ostrowiec.pl", "ostrowwlkp.pl", "pila.pl", "pisz.pl", "podhale.pl", "podlasie.pl", "polkowice.pl", "pomorze.pl", "pomorskie.pl", "prochowice.pl", "pruszkow.pl", "przeworsk.pl", "pulawy.pl", "radom.pl", "rawa-maz.pl", "rybnik.pl", "rzeszow.pl", "sanok.pl", "sejny.pl", "slask.pl", "slupsk.pl", "sosnowiec.pl", "stalowa-wola.pl", "skoczow.pl", "starachowice.pl", "stargard.pl", "suwalki.pl", "swidnica.pl", "swiebodzin.pl", "swinoujscie.pl", "szczecin.pl", "szczytno.pl", "tarnobrzeg.pl", "tgory.pl", "turek.pl", "tychy.pl", "ustka.pl", "walbrzych.pl", "warmia.pl", "warszawa.pl", "waw.pl", "wegrow.pl", "wielun.pl", "wlocl.pl", "wloclawek.pl", "wodzislaw.pl", "wolomin.pl", "wroclaw.pl", "zachpomor.pl", "zagan.pl", "zarow.pl", "zgora.pl", "zgorzelec.pl", "pm", "pn", "gov.pn", "co.pn", "org.pn", "edu.pn", "net.pn", "post", "pr", "com.pr", "net.pr", "org.pr", "gov.pr", "edu.pr", "isla.pr", "pro.pr", "biz.pr", "info.pr", "name.pr", "est.pr", "prof.pr", "ac.pr", "pro", "aaa.pro", "aca.pro", "acct.pro", "avocat.pro", "bar.pro", "cpa.pro", "eng.pro", "jur.pro", "law.pro", "med.pro", "recht.pro", "ps", "edu.ps", "gov.ps", "sec.ps", "plo.ps", "com.ps", "org.ps", "net.ps", "pt", "net.pt", "gov.pt", "org.pt", "edu.pt", "int.pt", "publ.pt", "com.pt", "nome.pt", "pw", "co.pw", "ne.pw", "or.pw", "ed.pw", "go.pw", "belau.pw", "py", "com.py", "coop.py", "edu.py", "gov.py", "mil.py", "net.py", "org.py", "qa", "com.qa", "edu.qa", "gov.qa", "mil.qa", "name.qa", "net.qa", "org.qa", "sch.qa", "re", "asso.re", "com.re", "nom.re", "ro", "arts.ro", "com.ro", "firm.ro", "info.ro", "nom.ro", "nt.ro", "org.ro", "rec.ro", "store.ro", "tm.ro", "www.ro", "rs", "ac.rs", "co.rs", "edu.rs", "gov.rs", "in.rs", "org.rs", "ru", "ac.ru", "edu.ru", "gov.ru", "int.ru", "mil.ru", "test.ru", "rw", "ac.rw", "co.rw", "coop.rw", "gov.rw", "mil.rw", "net.rw", "org.rw", "sa", "com.sa", "net.sa", "org.sa", "gov.sa", "med.sa", "pub.sa", "edu.sa", "sch.sa", "sb", "com.sb", "edu.sb", "gov.sb", "net.sb", "org.sb", "sc", "com.sc", "gov.sc", "net.sc", "org.sc", "edu.sc", "sd", "com.sd", "net.sd", "org.sd", "edu.sd", "med.sd", "tv.sd", "gov.sd", "info.sd", "se", "a.se", "ac.se", "b.se", "bd.se", "brand.se", "c.se", "d.se", "e.se", "f.se", "fh.se", "fhsk.se", "fhv.se", "g.se", "h.se", "i.se", "k.se", "komforb.se", "kommunalforbund.se", "komvux.se", "l.se", "lanbib.se", "m.se", "n.se", "naturbruksgymn.se", "o.se", "org.se", "p.se", "parti.se", "pp.se", "press.se", "r.se", "s.se", "t.se", "tm.se", "u.se", "w.se", "x.se", "y.se", "z.se", "sg", "com.sg", "net.sg", "org.sg", "gov.sg", "edu.sg", "per.sg", "sh", "com.sh", "net.sh", "gov.sh", "org.sh", "mil.sh", "si", "sj", "sk", "sl", "com.sl", "net.sl", "edu.sl", "gov.sl", "org.sl", "sm", "sn", "art.sn", "com.sn", "edu.sn", "gouv.sn", "org.sn", "perso.sn", "univ.sn", "so", "com.so", "net.so", "org.so", "sr", "st", "co.st", "com.st", "consulado.st", "edu.st", "embaixada.st", "gov.st", "mil.st", "net.st", "org.st", "principe.st", "saotome.st", "store.st", "su", "sv", "com.sv", "edu.sv", "gob.sv", "org.sv", "red.sv", "sx", "gov.sx", "sy", "edu.sy", "gov.sy", "net.sy", "mil.sy", "com.sy", "org.sy", "sz", "co.sz", "ac.sz", "org.sz", "tc", "td", "tel", "tf", "tg", "th", "ac.th", "co.th", "go.th", "in.th", "mi.th", "net.th", "or.th", "tj", "ac.tj", "biz.tj", "co.tj", "com.tj", "edu.tj", "go.tj", "gov.tj", "int.tj", "mil.tj", "name.tj", "net.tj", "nic.tj", "org.tj", "test.tj", "web.tj", "tk", "tl", "gov.tl", "tm", "com.tm", "co.tm", "org.tm", "net.tm", "nom.tm", "gov.tm", "mil.tm", "edu.tm", "tn", "com.tn", "ens.tn", "fin.tn", "gov.tn", "ind.tn", "intl.tn", "nat.tn", "net.tn", "org.tn", "info.tn", "perso.tn", "tourism.tn", "edunet.tn", "rnrt.tn", "rns.tn", "rnu.tn", "mincom.tn", "agrinet.tn", "defense.tn", "turen.tn", "to", "com.to", "gov.to", "net.to", "org.to", "edu.to", "mil.to", "tr", "av.tr", "bbs.tr", "bel.tr", "biz.tr", "com.tr", "dr.tr", "edu.tr", "gen.tr", "gov.tr", "info.tr", "mil.tr", "k12.tr", "kep.tr", "name.tr", "net.tr", "org.tr", "pol.tr", "tel.tr", "tsk.tr", "tv.tr", "web.tr", "nc.tr", "gov.nc.tr", "tt", "co.tt", "com.tt", "org.tt", "net.tt", "biz.tt", "info.tt", "pro.tt", "int.tt", "coop.tt", "jobs.tt", "mobi.tt", "travel.tt", "museum.tt", "aero.tt", "name.tt", "gov.tt", "edu.tt", "tv", "tw", "edu.tw", "gov.tw", "mil.tw", "com.tw", "net.tw", "org.tw", "idv.tw", "game.tw", "ebiz.tw", "club.tw", "網路.tw", "組織.tw", "商業.tw", "tz", "ac.tz", "co.tz", "go.tz", "hotel.tz", "info.tz", "me.tz", "mil.tz", "mobi.tz", "ne.tz", "or.tz", "sc.tz", "tv.tz", "ua", "com.ua", "edu.ua", "gov.ua", "in.ua", "net.ua", "org.ua", "cherkassy.ua", "cherkasy.ua", "chernigov.ua", "chernihiv.ua", "chernivtsi.ua", "chernovtsy.ua", "ck.ua", "cn.ua", "cr.ua", "crimea.ua", "cv.ua", "dn.ua", "dnepropetrovsk.ua", "dnipropetrovsk.ua", "dominic.ua", "donetsk.ua", "dp.ua", "if.ua", "ivano-frankivsk.ua", "kh.ua", "kharkiv.ua", "kharkov.ua", "kherson.ua", "khmelnitskiy.ua", "khmelnytskyi.ua", "kiev.ua", "kirovograd.ua", "km.ua", "kr.ua", "krym.ua", "ks.ua", "kv.ua", "kyiv.ua", "lg.ua", "lt.ua", "lugansk.ua", "lutsk.ua", "lv.ua", "lviv.ua", "mk.ua", "mykolaiv.ua", "nikolaev.ua", "od.ua", "odesa.ua", "odessa.ua", "pl.ua", "poltava.ua", "rivne.ua", "rovno.ua", "rv.ua", "sb.ua", "sebastopol.ua", "sevastopol.ua", "sm.ua", "sumy.ua", "te.ua", "ternopil.ua", "uz.ua", "uzhgorod.ua", "vinnica.ua", "vinnytsia.ua", "vn.ua", "volyn.ua", "yalta.ua", "zaporizhzhe.ua", "zaporizhzhia.ua", "zhitomir.ua", "zhytomyr.ua", "zp.ua", "zt.ua", "ug", "co.ug", "or.ug", "ac.ug", "sc.ug", "go.ug", "ne.ug", "com.ug", "org.ug", "uk", "ac.uk", "co.uk", "gov.uk", "ltd.uk", "me.uk", "net.uk", "nhs.uk", "org.uk", "plc.uk", "police.uk", "*.sch.uk", "us", "dni.us", "fed.us", "isa.us", "kids.us", "nsn.us", "ak.us", "al.us", "ar.us", "as.us", "az.us", "ca.us", "co.us", "ct.us", "dc.us", "de.us", "fl.us", "ga.us", "gu.us", "hi.us", "ia.us", "id.us", "il.us", "in.us", "ks.us", "ky.us", "la.us", "ma.us", "md.us", "me.us", "mi.us", "mn.us", "mo.us", "ms.us", "mt.us", "nc.us", "nd.us", "ne.us", "nh.us", "nj.us", "nm.us", "nv.us", "ny.us", "oh.us", "ok.us", "or.us", "pa.us", "pr.us", "ri.us", "sc.us", "sd.us", "tn.us", "tx.us", "ut.us", "vi.us", "vt.us", "va.us", "wa.us", "wi.us", "wv.us", "wy.us", "k12.ak.us", "k12.al.us", "k12.ar.us", "k12.as.us", "k12.az.us", "k12.ca.us", "k12.co.us", "k12.ct.us", "k12.dc.us", "k12.de.us", "k12.fl.us", "k12.ga.us", "k12.gu.us", "k12.ia.us", "k12.id.us", "k12.il.us", "k12.in.us", "k12.ks.us", "k12.ky.us", "k12.la.us", "k12.ma.us", "k12.md.us", "k12.me.us", "k12.mi.us", "k12.mn.us", "k12.mo.us", "k12.ms.us", "k12.mt.us", "k12.nc.us", "k12.ne.us", "k12.nh.us", "k12.nj.us", "k12.nm.us", "k12.nv.us", "k12.ny.us", "k12.oh.us", "k12.ok.us", "k12.or.us", "k12.pa.us", "k12.pr.us", "k12.ri.us", "k12.sc.us", "k12.tn.us", "k12.tx.us", "k12.ut.us", "k12.vi.us", "k12.vt.us", "k12.va.us", "k12.wa.us", "k12.wi.us", "k12.wy.us", "cc.ak.us", "cc.al.us", "cc.ar.us", "cc.as.us", "cc.az.us", "cc.ca.us", "cc.co.us", "cc.ct.us", "cc.dc.us", "cc.de.us", "cc.fl.us", "cc.ga.us", "cc.gu.us", "cc.hi.us", "cc.ia.us", "cc.id.us", "cc.il.us", "cc.in.us", "cc.ks.us", "cc.ky.us", "cc.la.us", "cc.ma.us", "cc.md.us", "cc.me.us", "cc.mi.us", "cc.mn.us", "cc.mo.us", "cc.ms.us", "cc.mt.us", "cc.nc.us", "cc.nd.us", "cc.ne.us", "cc.nh.us", "cc.nj.us", "cc.nm.us", "cc.nv.us", "cc.ny.us", "cc.oh.us", "cc.ok.us", "cc.or.us", "cc.pa.us", "cc.pr.us", "cc.ri.us", "cc.sc.us", "cc.sd.us", "cc.tn.us", "cc.tx.us", "cc.ut.us", "cc.vi.us", "cc.vt.us", "cc.va.us", "cc.wa.us", "cc.wi.us", "cc.wv.us", "cc.wy.us", "lib.ak.us", "lib.al.us", "lib.ar.us", "lib.as.us", "lib.az.us", "lib.ca.us", "lib.co.us", "lib.ct.us", "lib.dc.us", "lib.fl.us", "lib.ga.us", "lib.gu.us", "lib.hi.us", "lib.ia.us", "lib.id.us", "lib.il.us", "lib.in.us", "lib.ks.us", "lib.ky.us", "lib.la.us", "lib.ma.us", "lib.md.us", "lib.me.us", "lib.mi.us", "lib.mn.us", "lib.mo.us", "lib.ms.us", "lib.mt.us", "lib.nc.us", "lib.nd.us", "lib.ne.us", "lib.nh.us", "lib.nj.us", "lib.nm.us", "lib.nv.us", "lib.ny.us", "lib.oh.us", "lib.ok.us", "lib.or.us", "lib.pa.us", "lib.pr.us", "lib.ri.us", "lib.sc.us", "lib.sd.us", "lib.tn.us", "lib.tx.us", "lib.ut.us", "lib.vi.us", "lib.vt.us", "lib.va.us", "lib.wa.us", "lib.wi.us", "lib.wy.us", "pvt.k12.ma.us", "chtr.k12.ma.us", "paroch.k12.ma.us", "ann-arbor.mi.us", "cog.mi.us", "dst.mi.us", "eaton.mi.us", "gen.mi.us", "mus.mi.us", "tec.mi.us", "washtenaw.mi.us", "uy", "com.uy", "edu.uy", "gub.uy", "mil.uy", "net.uy", "org.uy", "uz", "co.uz", "com.uz", "net.uz", "org.uz", "va", "vc", "com.vc", "net.vc", "org.vc", "gov.vc", "mil.vc", "edu.vc", "ve", "arts.ve", "co.ve", "com.ve", "e12.ve", "edu.ve", "firm.ve", "gob.ve", "gov.ve", "info.ve", "int.ve", "mil.ve", "net.ve", "org.ve", "rec.ve", "store.ve", "tec.ve", "web.ve", "vg", "vi", "co.vi", "com.vi", "k12.vi", "net.vi", "org.vi", "vn", "com.vn", "net.vn", "org.vn", "edu.vn", "gov.vn", "int.vn", "ac.vn", "biz.vn", "info.vn", "name.vn", "pro.vn", "health.vn", "vu", "com.vu", "edu.vu", "net.vu", "org.vu", "wf", "ws", "com.ws", "net.ws", "org.ws", "gov.ws", "edu.ws", "yt", "امارات", "հայ", "বাংলা", "бг", "бел", "中国", "中國", "الجزائر", "مصر", "ею", "გე", "ελ", "香港", "公司.香港", "教育.香港", "政府.香港", "個人.香港", "網絡.香港", "組織.香港", "ಭಾರತ", "ଭାରତ", "ভাৰত", "भारतम्", "भारोत", "ڀارت", "ഭാരതം", "भारत", "بارت", "بھارت", "భారత్", "ભારત", "ਭਾਰਤ", "ভারত", "இந்தியா", "ایران", "ايران", "عراق", "الاردن", "한국", "қаз", "ලංකා", "இலங்கை", "المغرب", "мкд", "мон", "澳門", "澳门", "مليسيا", "عمان", "پاکستان", "پاكستان", "فلسطين", "срб", "пр.срб", "орг.срб", "обр.срб", "од.срб", "упр.срб", "ак.срб", "рф", "قطر", "السعودية", "السعودیة", "السعودیۃ", "السعوديه", "سودان", "新加坡", "சிங்கப்பூர்", "سورية", "سوريا", "ไทย", "ศึกษา.ไทย", "ธุรกิจ.ไทย", "รัฐบาล.ไทย", "ทหาร.ไทย", "เน็ต.ไทย", "องค์กร.ไทย", "تونس", "台灣", "台湾", "臺灣", "укр", "اليمن", "xxx", "*.ye", "ac.za", "agric.za", "alt.za", "co.za", "edu.za", "gov.za", "grondar.za", "law.za", "mil.za", "net.za", "ngo.za", "nis.za", "nom.za", "org.za", "school.za", "tm.za", "web.za", "zm", "ac.zm", "biz.zm", "co.zm", "com.zm", "edu.zm", "gov.zm", "info.zm", "mil.zm", "net.zm", "org.zm", "sch.zm", "zw", "ac.zw", "co.zw", "gov.zw", "mil.zw", "org.zw", "aaa", "aarp", "abarth", "abb", "abbott", "abbvie", "abc", "able", "abogado", "abudhabi", "academy", "accenture", "accountant", "accountants", "aco", "actor", "adac", "ads", "adult", "aeg", "aetna", "afamilycompany", "afl", "africa", "agakhan", "agency", "aig", "aigo", "airbus", "airforce", "airtel", "akdn", "alfaromeo", "alibaba", "alipay", "allfinanz", "allstate", "ally", "alsace", "alstom", "americanexpress", "americanfamily", "amex", "amfam", "amica", "amsterdam", "analytics", "android", "anquan", "anz", "aol", "apartments", "app", "apple", "aquarelle", "arab", "aramco", "archi", "army", "art", "arte", "asda", "associates", "athleta", "attorney", "auction", "audi", "audible", "audio", "auspost", "author", "auto", "autos", "avianca", "aws", "axa", "azure", "baby", "baidu", "banamex", "bananarepublic", "band", "bank", "bar", "barcelona", "barclaycard", "barclays", "barefoot", "bargains", "baseball", "basketball", "bauhaus", "bayern", "bbc", "bbt", "bbva", "bcg", "bcn", "beats", "beauty", "beer", "bentley", "berlin", "best", "bestbuy", "bet", "bharti", "bible", "bid", "bike", "bing", "bingo", "bio", "black", "blackfriday", "blockbuster", "blog", "bloomberg", "blue", "bms", "bmw", "bnl", "bnpparibas", "boats", "boehringer", "bofa", "bom", "bond", "boo", "book", "booking", "bosch", "bostik", "boston", "bot", "boutique", "box", "bradesco", "bridgestone", "broadway", "broker", "brother", "brussels", "budapest", "bugatti", "build", "builders", "business", "buy", "buzz", "bzh", "cab", "cafe", "cal", "call", "calvinklein", "cam", "camera", "camp", "cancerresearch", "canon", "capetown", "capital", "capitalone", "car", "caravan", "cards", "care", "career", "careers", "cars", "cartier", "casa", "case", "caseih", "cash", "casino", "catering", "catholic", "cba", "cbn", "cbre", "cbs", "ceb", "center", "ceo", "cern", "cfa", "cfd", "chanel", "channel", "charity", "chase", "chat", "cheap", "chintai", "christmas", "chrome", "chrysler", "church", "cipriani", "circle", "cisco", "citadel", "citi", "citic", "city", "cityeats", "claims", "cleaning", "click", "clinic", "clinique", "clothing", "cloud", "club", "clubmed", "coach", "codes", "coffee", "college", "cologne", "comcast", "commbank", "community", "company", "compare", "computer", "comsec", "condos", "construction", "consulting", "contact", "contractors", "cooking", "cookingchannel", "cool", "corsica", "country", "coupon", "coupons", "courses", "credit", "creditcard", "creditunion", "cricket", "crown", "crs", "cruise", "cruises", "csc", "cuisinella", "cymru", "cyou", "dabur", "dad", "dance", "data", "date", "dating", "datsun", "day", "dclk", "dds", "deal", "dealer", "deals", "degree", "delivery", "dell", "deloitte", "delta", "democrat", "dental", "dentist", "desi", "design", "dev", "dhl", "diamonds", "diet", "digital", "direct", "directory", "discount", "discover", "dish", "diy", "dnp", "docs", "doctor", "dodge", "dog", "domains", "dot", "download", "drive", "dtv", "dubai", "duck", "dunlop", "duns", "dupont", "durban", "dvag", "dvr", "earth", "eat", "eco", "edeka", "education", "email", "emerck", "energy", "engineer", "engineering", "enterprises", "epson", "equipment", "ericsson", "erni", "esq", "estate", "esurance", "etisalat", "eurovision", "eus", "events", "everbank", "exchange", "expert", "exposed", "express", "extraspace", "fage", "fail", "fairwinds", "faith", "family", "fan", "fans", "farm", "farmers", "fashion", "fast", "fedex", "feedback", "ferrari", "ferrero", "fiat", "fidelity", "fido", "film", "final", "finance", "financial", "fire", "firestone", "firmdale", "fish", "fishing", "fit", "fitness", "flickr", "flights", "flir", "florist", "flowers", "fly", "foo", "food", "foodnetwork", "football", "ford", "forex", "forsale", "forum", "foundation", "fox", "free", "fresenius", "frl", "frogans", "frontdoor", "frontier", "ftr", "fujitsu", "fujixerox", "fun", "fund", "furniture", "futbol", "fyi", "gal", "gallery", "gallo", "gallup", "game", "games", "gap", "garden", "gbiz", "gdn", "gea", "gent", "genting", "george", "ggee", "gift", "gifts", "gives", "giving", "glade", "glass", "gle", "global", "globo", "gmail", "gmbh", "gmo", "gmx", "godaddy", "gold", "goldpoint", "golf", "goo", "goodyear", "goog", "google", "gop", "got", "grainger", "graphics", "gratis", "green", "gripe", "grocery", "group", "guardian", "gucci", "guge", "guide", "guitars", "guru", "hair", "hamburg", "hangout", "haus", "hbo", "hdfc", "hdfcbank", "health", "healthcare", "help", "helsinki", "here", "hermes", "hgtv", "hiphop", "hisamitsu", "hitachi", "hiv", "hkt", "hockey", "holdings", "holiday", "homedepot", "homegoods", "homes", "homesense", "honda", "honeywell", "horse", "hospital", "host", "hosting", "hot", "hoteles", "hotels", "hotmail", "house", "how", "hsbc", "hughes", "hyatt", "hyundai", "ibm", "icbc", "ice", "icu", "ieee", "ifm", "ikano", "imamat", "imdb", "immo", "immobilien", "inc", "industries", "infiniti", "ing", "ink", "institute", "insurance", "insure", "intel", "international", "intuit", "investments", "ipiranga", "irish", "iselect", "ismaili", "ist", "istanbul", "itau", "itv", "iveco", "jaguar", "java", "jcb", "jcp", "jeep", "jetzt", "jewelry", "jio", "jll", "jmp", "jnj", "joburg", "jot", "joy", "jpmorgan", "jprs", "juegos", "juniper", "kaufen", "kddi", "kerryhotels", "kerrylogistics", "kerryproperties", "kfh", "kia", "kim", "kinder", "kindle", "kitchen", "kiwi", "koeln", "komatsu", "kosher", "kpmg", "kpn", "krd", "kred", "kuokgroup", "kyoto", "lacaixa", "ladbrokes", "lamborghini", "lamer", "lancaster", "lancia", "lancome", "land", "landrover", "lanxess", "lasalle", "lat", "latino", "latrobe", "law", "lawyer", "lds", "lease", "leclerc", "lefrak", "legal", "lego", "lexus", "lgbt", "liaison", "lidl", "life", "lifeinsurance", "lifestyle", "lighting", "like", "lilly", "limited", "limo", "lincoln", "linde", "link", "lipsy", "live", "living", "lixil", "llc", "loan", "loans", "locker", "locus", "loft", "lol", "london", "lotte", "lotto", "love", "lpl", "lplfinancial", "ltd", "ltda", "lundbeck", "lupin", "luxe", "luxury", "macys", "madrid", "maif", "maison", "makeup", "man", "management", "mango", "map", "market", "marketing", "markets", "marriott", "marshalls", "maserati", "mattel", "mba", "mckinsey", "med", "media", "meet", "melbourne", "meme", "memorial", "men", "menu", "merckmsd", "metlife", "miami", "microsoft", "mini", "mint", "mit", "mitsubishi", "mlb", "mls", "mma", "mobile", "mobily", "moda", "moe", "moi", "mom", "monash", "money", "monster", "mopar", "mormon", "mortgage", "moscow", "moto", "motorcycles", "mov", "movie", "movistar", "msd", "mtn", "mtr", "mutual", "nab", "nadex", "nagoya", "nationwide", "natura", "navy", "nba", "nec", "netbank", "netflix", "network", "neustar", "new", "newholland", "news", "next", "nextdirect", "nexus", "nfl", "ngo", "nhk", "nico", "nike", "nikon", "ninja", "nissan", "nissay", "nokia", "northwesternmutual", "norton", "now", "nowruz", "nowtv", "nra", "nrw", "ntt", "nyc", "obi", "observer", "off", "office", "okinawa", "olayan", "olayangroup", "oldnavy", "ollo", "omega", "one", "ong", "onl", "online", "onyourside", "ooo", "open", "oracle", "orange", "organic", "origins", "osaka", "otsuka", "ott", "ovh", "page", "panasonic", "paris", "pars", "partners", "parts", "party", "passagens", "pay", "pccw", "pet", "pfizer", "pharmacy", "phd", "philips", "phone", "photo", "photography", "photos", "physio", "piaget", "pics", "pictet", "pictures", "pid", "pin", "ping", "pink", "pioneer", "pizza", "place", "play", "playstation", "plumbing", "plus", "pnc", "pohl", "poker", "politie", "porn", "pramerica", "praxi", "press", "prime", "prod", "productions", "prof", "progressive", "promo", "properties", "property", "protection", "pru", "prudential", "pub", "pwc", "qpon", "quebec", "quest", "qvc", "racing", "radio", "raid", "read", "realestate", "realtor", "realty", "recipes", "red", "redstone", "redumbrella", "rehab", "reise", "reisen", "reit", "reliance", "ren", "rent", "rentals", "repair", "report", "republican", "rest", "restaurant", "review", "reviews", "rexroth", "rich", "richardli", "ricoh", "rightathome", "ril", "rio", "rip", "rmit", "rocher", "rocks", "rodeo", "rogers", "room", "rsvp", "rugby", "ruhr", "run", "rwe", "ryukyu", "saarland", "safe", "safety", "sakura", "sale", "salon", "samsclub", "samsung", "sandvik", "sandvikcoromant", "sanofi", "sap", "sarl", "sas", "save", "saxo", "sbi", "sbs", "sca", "scb", "schaeffler", "schmidt", "scholarships", "school", "schule", "schwarz", "science", "scjohnson", "scor", "scot", "search", "seat", "secure", "security", "seek", "select", "sener", "services", "ses", "seven", "sew", "sex", "sexy", "sfr", "shangrila", "sharp", "shaw", "shell", "shia", "shiksha", "shoes", "shop", "shopping", "shouji", "show", "showtime", "shriram", "silk", "sina", "singles", "site", "ski", "skin", "sky", "skype", "sling", "smart", "smile", "sncf", "soccer", "social", "softbank", "software", "sohu", "solar", "solutions", "song", "sony", "soy", "space", "sport", "spot", "spreadbetting", "srl", "srt", "stada", "staples", "star", "starhub", "statebank", "statefarm", "stc", "stcgroup", "stockholm", "storage", "store", "stream", "studio", "study", "style", "sucks", "supplies", "supply", "support", "surf", "surgery", "suzuki", "swatch", "swiftcover", "swiss", "sydney", "symantec", "systems", "tab", "taipei", "talk", "taobao", "target", "tatamotors", "tatar", "tattoo", "tax", "taxi", "tci", "tdk", "team", "tech", "technology", "telefonica", "temasek", "tennis", "teva", "thd", "theater", "theatre", "tiaa", "tickets", "tienda", "tiffany", "tips", "tires", "tirol", "tjmaxx", "tjx", "tkmaxx", "tmall", "today", "tokyo", "tools", "top", "toray", "toshiba", "total", "tours", "town", "toyota", "toys", "trade", "trading", "training", "travel", "travelchannel", "travelers", "travelersinsurance", "trust", "trv", "tube", "tui", "tunes", "tushu", "tvs", "ubank", "ubs", "uconnect", "unicom", "university", "uno", "uol", "ups", "vacations", "vana", "vanguard", "vegas", "ventures", "verisign", "versicherung", "vet", "viajes", "video", "vig", "viking", "villas", "vin", "vip", "virgin", "visa", "vision", "vistaprint", "viva", "vivo", "vlaanderen", "vodka", "volkswagen", "volvo", "vote", "voting", "voto", "voyage", "vuelos", "wales", "walmart", "walter", "wang", "wanggou", "warman", "watch", "watches", "weather", "weatherchannel", "webcam", "weber", "website", "wed", "wedding", "weibo", "weir", "whoswho", "wien", "wiki", "williamhill", "win", "windows", "wine", "winners", "wme", "wolterskluwer", "woodside", "work", "works", "world", "wow", "wtc", "wtf", "xbox", "xerox", "xfinity", "xihuan", "xin", "कॉम", "セール", "佛山", "慈善", "集团", "在线", "大众汽车", "点看", "คอม", "八卦", "موقع", "公益", "公司", "香格里拉", "网站", "移动", "我爱你", "москва", "католик", "онлайн", "сайт", "联通", "קום", "时尚", "微博", "淡马锡", "ファッション", "орг", "नेट", "ストア", "삼성", "商标", "商店", "商城", "дети", "ポイント", "新闻", "工行", "家電", "كوم", "中文网", "中信", "娱乐", "谷歌", "電訊盈科", "购物", "クラウド", "通販", "网店", "संगठन", "餐厅", "网络", "ком", "诺基亚", "食品", "飞利浦", "手表", "手机", "ارامكو", "العليان", "اتصالات", "بازار", "موبايلي", "ابوظبي", "كاثوليك", "همراه", "닷컴", "政府", "شبكة", "بيتك", "عرب", "机构", "组织机构", "健康", "招聘", "рус", "珠宝", "大拿", "みんな", "グーグル", "世界", "書籍", "网址", "닷넷", "コム", "天主教", "游戏", "vermögensberater", "vermögensberatung", "企业", "信息", "嘉里大酒店", "嘉里", "广东", "政务", "xyz", "yachts", "yahoo", "yamaxun", "yandex", "yodobashi", "yoga", "yokohama", "you", "youtube", "yun", "zappos", "zara", "zero", "zip", "zone", "zuerich", "cc.ua", "inf.ua", "ltd.ua", "beep.pl", "barsy.ca", "*.compute.estate", "*.alces.network", "alwaysdata.net", "cloudfront.net", "*.compute.amazonaws.com", "*.compute-1.amazonaws.com", "*.compute.amazonaws.com.cn", "us-east-1.amazonaws.com", "cn-north-1.eb.amazonaws.com.cn", "cn-northwest-1.eb.amazonaws.com.cn", "elasticbeanstalk.com", "ap-northeast-1.elasticbeanstalk.com", "ap-northeast-2.elasticbeanstalk.com", "ap-northeast-3.elasticbeanstalk.com", "ap-south-1.elasticbeanstalk.com", "ap-southeast-1.elasticbeanstalk.com", "ap-southeast-2.elasticbeanstalk.com", "ca-central-1.elasticbeanstalk.com", "eu-central-1.elasticbeanstalk.com", "eu-west-1.elasticbeanstalk.com", "eu-west-2.elasticbeanstalk.com", "eu-west-3.elasticbeanstalk.com", "sa-east-1.elasticbeanstalk.com", "us-east-1.elasticbeanstalk.com", "us-east-2.elasticbeanstalk.com", "us-gov-west-1.elasticbeanstalk.com", "us-west-1.elasticbeanstalk.com", "us-west-2.elasticbeanstalk.com", "*.elb.amazonaws.com", "*.elb.amazonaws.com.cn", "s3.amazonaws.com", "s3-ap-northeast-1.amazonaws.com", "s3-ap-northeast-2.amazonaws.com", "s3-ap-south-1.amazonaws.com", "s3-ap-southeast-1.amazonaws.com", "s3-ap-southeast-2.amazonaws.com", "s3-ca-central-1.amazonaws.com", "s3-eu-central-1.amazonaws.com", "s3-eu-west-1.amazonaws.com", "s3-eu-west-2.amazonaws.com", "s3-eu-west-3.amazonaws.com", "s3-external-1.amazonaws.com", "s3-fips-us-gov-west-1.amazonaws.com", "s3-sa-east-1.amazonaws.com", "s3-us-gov-west-1.amazonaws.com", "s3-us-east-2.amazonaws.com", "s3-us-west-1.amazonaws.com", "s3-us-west-2.amazonaws.com", "s3.ap-northeast-2.amazonaws.com", "s3.ap-south-1.amazonaws.com", "s3.cn-north-1.amazonaws.com.cn", "s3.ca-central-1.amazonaws.com", "s3.eu-central-1.amazonaws.com", "s3.eu-west-2.amazonaws.com", "s3.eu-west-3.amazonaws.com", "s3.us-east-2.amazonaws.com", "s3.dualstack.ap-northeast-1.amazonaws.com", "s3.dualstack.ap-northeast-2.amazonaws.com", "s3.dualstack.ap-south-1.amazonaws.com", "s3.dualstack.ap-southeast-1.amazonaws.com", "s3.dualstack.ap-southeast-2.amazonaws.com", "s3.dualstack.ca-central-1.amazonaws.com", "s3.dualstack.eu-central-1.amazonaws.com", "s3.dualstack.eu-west-1.amazonaws.com", "s3.dualstack.eu-west-2.amazonaws.com", "s3.dualstack.eu-west-3.amazonaws.com", "s3.dualstack.sa-east-1.amazonaws.com", "s3.dualstack.us-east-1.amazonaws.com", "s3.dualstack.us-east-2.amazonaws.com", "s3-website-us-east-1.amazonaws.com", "s3-website-us-west-1.amazonaws.com", "s3-website-us-west-2.amazonaws.com", "s3-website-ap-northeast-1.amazonaws.com", "s3-website-ap-southeast-1.amazonaws.com", "s3-website-ap-southeast-2.amazonaws.com", "s3-website-eu-west-1.amazonaws.com", "s3-website-sa-east-1.amazonaws.com", "s3-website.ap-northeast-2.amazonaws.com", "s3-website.ap-south-1.amazonaws.com", "s3-website.ca-central-1.amazonaws.com", "s3-website.eu-central-1.amazonaws.com", "s3-website.eu-west-2.amazonaws.com", "s3-website.eu-west-3.amazonaws.com", "s3-website.us-east-2.amazonaws.com", "t3l3p0rt.net", "tele.amune.org", "apigee.io", "on-aptible.com", "user.party.eus", "pimienta.org", "poivron.org", "potager.org", "sweetpepper.org", "myasustor.com", "go-vip.co", "go-vip.net", "wpcomstaging.com", "myfritz.net", "*.awdev.ca", "*.advisor.ws", "b-data.io", "backplaneapp.io", "app.banzaicloud.io", "betainabox.com", "bnr.la", "blackbaudcdn.net", "boomla.net", "boxfuse.io", "square7.ch", "bplaced.com", "bplaced.de", "square7.de", "bplaced.net", "square7.net", "browsersafetymark.io", "uk0.bigv.io", "dh.bytemark.co.uk", "vm.bytemark.co.uk", "mycd.eu", "carrd.co", "crd.co", "uwu.ai", "ae.org", "ar.com", "br.com", "cn.com", "com.de", "com.se", "de.com", "eu.com", "gb.com", "gb.net", "hu.com", "hu.net", "jp.net", "jpn.com", "kr.com", "mex.com", "no.com", "qc.com", "ru.com", "sa.com", "se.net", "uk.com", "uk.net", "us.com", "uy.com", "za.bz", "za.com", "africa.com", "gr.com", "in.net", "us.org", "co.com", "c.la", "certmgr.org", "xenapponazure.com", "discourse.group", "virtueeldomein.nl", "cleverapps.io", "*.lcl.dev", "*.stg.dev", "c66.me", "cloud66.ws", "cloud66.zone", "jdevcloud.com", "wpdevcloud.com", "cloudaccess.host", "freesite.host", "cloudaccess.net", "cloudcontrolled.com", "cloudcontrolapp.com", "workers.dev", "wnext.app", "co.ca", "*.otap.co", "co.cz", "c.cdn77.org", "cdn77-ssl.net", "r.cdn77.net", "rsc.cdn77.org", "ssl.origin.cdn77-secure.org", "cloudns.asia", "cloudns.biz", "cloudns.club", "cloudns.cc", "cloudns.eu", "cloudns.in", "cloudns.info", "cloudns.org", "cloudns.pro", "cloudns.pw", "cloudns.us", "cloudeity.net", "cnpy.gdn", "co.nl", "co.no", "webhosting.be", "hosting-cluster.nl", "dyn.cosidns.de", "dynamisches-dns.de", "dnsupdater.de", "internet-dns.de", "l-o-g-i-n.de", "dynamic-dns.info", "feste-ip.net", "knx-server.net", "static-access.net", "realm.cz", "*.cryptonomic.net", "cupcake.is", "cyon.link", "cyon.site", "daplie.me", "localhost.daplie.me", "dattolocal.com", "dattorelay.com", "dattoweb.com", "mydatto.com", "dattolocal.net", "mydatto.net", "biz.dk", "co.dk", "firm.dk", "reg.dk", "store.dk", "*.dapps.earth", "*.bzz.dapps.earth", "debian.net", "dedyn.io", "dnshome.de", "online.th", "shop.th", "drayddns.com", "dreamhosters.com", "mydrobo.com", "drud.io", "drud.us", "duckdns.org", "dy.fi", "tunk.org", "dyndns-at-home.com", "dyndns-at-work.com", "dyndns-blog.com", "dyndns-free.com", "dyndns-home.com", "dyndns-ip.com", "dyndns-mail.com", "dyndns-office.com", "dyndns-pics.com", "dyndns-remote.com", "dyndns-server.com", "dyndns-web.com", "dyndns-wiki.com", "dyndns-work.com", "dyndns.biz", "dyndns.info", "dyndns.org", "dyndns.tv", "at-band-camp.net", "ath.cx", "barrel-of-knowledge.info", "barrell-of-knowledge.info", "better-than.tv", "blogdns.com", "blogdns.net", "blogdns.org", "blogsite.org", "boldlygoingnowhere.org", "broke-it.net", "buyshouses.net", "cechire.com", "dnsalias.com", "dnsalias.net", "dnsalias.org", "dnsdojo.com", "dnsdojo.net", "dnsdojo.org", "does-it.net", "doesntexist.com", "doesntexist.org", "dontexist.com", "dontexist.net", "dontexist.org", "doomdns.com", "doomdns.org", "dvrdns.org", "dyn-o-saur.com", "dynalias.com", "dynalias.net", "dynalias.org", "dynathome.net", "dyndns.ws", "endofinternet.net", "endofinternet.org", "endoftheinternet.org", "est-a-la-maison.com", "est-a-la-masion.com", "est-le-patron.com", "est-mon-blogueur.com", "for-better.biz", "for-more.biz", "for-our.info", "for-some.biz", "for-the.biz", "forgot.her.name", "forgot.his.name", "from-ak.com", "from-al.com", "from-ar.com", "from-az.net", "from-ca.com", "from-co.net", "from-ct.com", "from-dc.com", "from-de.com", "from-fl.com", "from-ga.com", "from-hi.com", "from-ia.com", "from-id.com", "from-il.com", "from-in.com", "from-ks.com", "from-ky.com", "from-la.net", "from-ma.com", "from-md.com", "from-me.org", "from-mi.com", "from-mn.com", "from-mo.com", "from-ms.com", "from-mt.com", "from-nc.com", "from-nd.com", "from-ne.com", "from-nh.com", "from-nj.com", "from-nm.com", "from-nv.com", "from-ny.net", "from-oh.com", "from-ok.com", "from-or.com", "from-pa.com", "from-pr.com", "from-ri.com", "from-sc.com", "from-sd.com", "from-tn.com", "from-tx.com", "from-ut.com", "from-va.com", "from-vt.com", "from-wa.com", "from-wi.com", "from-wv.com", "from-wy.com", "ftpaccess.cc", "fuettertdasnetz.de", "game-host.org", "game-server.cc", "getmyip.com", "gets-it.net", "go.dyndns.org", "gotdns.com", "gotdns.org", "groks-the.info", "groks-this.info", "ham-radio-op.net", "here-for-more.info", "hobby-site.com", "hobby-site.org", "home.dyndns.org", "homedns.org", "homeftp.net", "homeftp.org", "homeip.net", "homelinux.com", "homelinux.net", "homelinux.org", "homeunix.com", "homeunix.net", "homeunix.org", "iamallama.com", "in-the-band.net", "is-a-anarchist.com", "is-a-blogger.com", "is-a-bookkeeper.com", "is-a-bruinsfan.org", "is-a-bulls-fan.com", "is-a-candidate.org", "is-a-caterer.com", "is-a-celticsfan.org", "is-a-chef.com", "is-a-chef.net", "is-a-chef.org", "is-a-conservative.com", "is-a-cpa.com", "is-a-cubicle-slave.com", "is-a-democrat.com", "is-a-designer.com", "is-a-doctor.com", "is-a-financialadvisor.com", "is-a-geek.com", "is-a-geek.net", "is-a-geek.org", "is-a-green.com", "is-a-guru.com", "is-a-hard-worker.com", "is-a-hunter.com", "is-a-knight.org", "is-a-landscaper.com", "is-a-lawyer.com", "is-a-liberal.com", "is-a-libertarian.com", "is-a-linux-user.org", "is-a-llama.com", "is-a-musician.com", "is-a-nascarfan.com", "is-a-nurse.com", "is-a-painter.com", "is-a-patsfan.org", "is-a-personaltrainer.com", "is-a-photographer.com", "is-a-player.com", "is-a-republican.com", "is-a-rockstar.com", "is-a-socialist.com", "is-a-soxfan.org", "is-a-student.com", "is-a-teacher.com", "is-a-techie.com", "is-a-therapist.com", "is-an-accountant.com", "is-an-actor.com", "is-an-actress.com", "is-an-anarchist.com", "is-an-artist.com", "is-an-engineer.com", "is-an-entertainer.com", "is-by.us", "is-certified.com", "is-found.org", "is-gone.com", "is-into-anime.com", "is-into-cars.com", "is-into-cartoons.com", "is-into-games.com", "is-leet.com", "is-lost.org", "is-not-certified.com", "is-saved.org", "is-slick.com", "is-uberleet.com", "is-very-bad.org", "is-very-evil.org", "is-very-good.org", "is-very-nice.org", "is-very-sweet.org", "is-with-theband.com", "isa-geek.com", "isa-geek.net", "isa-geek.org", "isa-hockeynut.com", "issmarterthanyou.com", "isteingeek.de", "istmein.de", "kicks-ass.net", "kicks-ass.org", "knowsitall.info", "land-4-sale.us", "lebtimnetz.de", "leitungsen.de", "likes-pie.com", "likescandy.com", "merseine.nu", "mine.nu", "misconfused.org", "mypets.ws", "myphotos.cc", "neat-url.com", "office-on-the.net", "on-the-web.tv", "podzone.net", "podzone.org", "readmyblog.org", "saves-the-whales.com", "scrapper-site.net", "scrapping.cc", "selfip.biz", "selfip.com", "selfip.info", "selfip.net", "selfip.org", "sells-for-less.com", "sells-for-u.com", "sells-it.net", "sellsyourhome.org", "servebbs.com", "servebbs.net", "servebbs.org", "serveftp.net", "serveftp.org", "servegame.org", "shacknet.nu", "simple-url.com", "space-to-rent.com", "stuff-4-sale.org", "stuff-4-sale.us", "teaches-yoga.com", "thruhere.net", "traeumtgerade.de", "webhop.biz", "webhop.info", "webhop.net", "webhop.org", "worse-than.tv", "writesthisblog.com", "ddnss.de", "dyn.ddnss.de", "dyndns.ddnss.de", "dyndns1.de", "dyn-ip24.de", "home-webserver.de", "dyn.home-webserver.de", "myhome-server.de", "ddnss.org", "definima.net", "definima.io", "bci.dnstrace.pro", "ddnsfree.com", "ddnsgeek.com", "giize.com", "gleeze.com", "kozow.com", "loseyourip.com", "ooguy.com", "theworkpc.com", "casacam.net", "dynu.net", "accesscam.org", "camdvr.org", "freeddns.org", "mywire.org", "webredirect.org", "myddns.rocks", "blogsite.xyz", "dynv6.net", "e4.cz", "mytuleap.com", "onred.one", "staging.onred.one", "enonic.io", "customer.enonic.io", "eu.org", "al.eu.org", "asso.eu.org", "at.eu.org", "au.eu.org", "be.eu.org", "bg.eu.org", "ca.eu.org", "cd.eu.org", "ch.eu.org", "cn.eu.org", "cy.eu.org", "cz.eu.org", "de.eu.org", "dk.eu.org", "edu.eu.org", "ee.eu.org", "es.eu.org", "fi.eu.org", "fr.eu.org", "gr.eu.org", "hr.eu.org", "hu.eu.org", "ie.eu.org", "il.eu.org", "in.eu.org", "int.eu.org", "is.eu.org", "it.eu.org", "jp.eu.org", "kr.eu.org", "lt.eu.org", "lu.eu.org", "lv.eu.org", "mc.eu.org", "me.eu.org", "mk.eu.org", "mt.eu.org", "my.eu.org", "net.eu.org", "ng.eu.org", "nl.eu.org", "no.eu.org", "nz.eu.org", "paris.eu.org", "pl.eu.org", "pt.eu.org", "q-a.eu.org", "ro.eu.org", "ru.eu.org", "se.eu.org", "si.eu.org", "sk.eu.org", "tr.eu.org", "uk.eu.org", "us.eu.org", "eu-1.evennode.com", "eu-2.evennode.com", "eu-3.evennode.com", "eu-4.evennode.com", "us-1.evennode.com", "us-2.evennode.com", "us-3.evennode.com", "us-4.evennode.com", "twmail.cc", "twmail.net", "twmail.org", "mymailer.com.tw", "url.tw", "apps.fbsbx.com", "ru.net", "adygeya.ru", "bashkiria.ru", "bir.ru", "cbg.ru", "com.ru", "dagestan.ru", "grozny.ru", "kalmykia.ru", "kustanai.ru", "marine.ru", "mordovia.ru", "msk.ru", "mytis.ru", "nalchik.ru", "nov.ru", "pyatigorsk.ru", "spb.ru", "vladikavkaz.ru", "vladimir.ru", "abkhazia.su", "adygeya.su", "aktyubinsk.su", "arkhangelsk.su", "armenia.su", "ashgabad.su", "azerbaijan.su", "balashov.su", "bashkiria.su", "bryansk.su", "bukhara.su", "chimkent.su", "dagestan.su", "east-kazakhstan.su", "exnet.su", "georgia.su", "grozny.su", "ivanovo.su", "jambyl.su", "kalmykia.su", "kaluga.su", "karacol.su", "karaganda.su", "karelia.su", "khakassia.su", "krasnodar.su", "kurgan.su", "kustanai.su", "lenug.su", "mangyshlak.su", "mordovia.su", "msk.su", "murmansk.su", "nalchik.su", "navoi.su", "north-kazakhstan.su", "nov.su", "obninsk.su", "penza.su", "pokrovsk.su", "sochi.su", "spb.su", "tashkent.su", "termez.su", "togliatti.su", "troitsk.su", "tselinograd.su", "tula.su", "tuva.su", "vladikavkaz.su", "vladimir.su", "vologda.su", "channelsdvr.net", "fastly-terrarium.com", "fastlylb.net", "map.fastlylb.net", "freetls.fastly.net", "map.fastly.net", "a.prod.fastly.net", "global.prod.fastly.net", "a.ssl.fastly.net", "b.ssl.fastly.net", "global.ssl.fastly.net", "fastpanel.direct", "fastvps-server.com", "fhapp.xyz", "fedorainfracloud.org", "fedorapeople.org", "cloud.fedoraproject.org", "app.os.fedoraproject.org", "app.os.stg.fedoraproject.org", "mydobiss.com", "filegear.me", "filegear-au.me", "filegear-de.me", "filegear-gb.me", "filegear-ie.me", "filegear-jp.me", "filegear-sg.me", "firebaseapp.com", "flynnhub.com", "flynnhosting.net", "freebox-os.com", "freeboxos.com", "fbx-os.fr", "fbxos.fr", "freebox-os.fr", "freeboxos.fr", "freedesktop.org", "*.futurecms.at", "*.ex.futurecms.at", "*.in.futurecms.at", "futurehosting.at", "futuremailing.at", "*.ex.ortsinfo.at", "*.kunden.ortsinfo.at", "*.statics.cloud", "service.gov.uk", "gehirn.ne.jp", "usercontent.jp", "lab.ms", "github.io", "githubusercontent.com", "gitlab.io", "glitch.me", "cloudapps.digital", "london.cloudapps.digital", "homeoffice.gov.uk", "ro.im", "shop.ro", "goip.de", "run.app", "a.run.app", "*.0emm.com", "appspot.com", "blogspot.ae", "blogspot.al", "blogspot.am", "blogspot.ba", "blogspot.be", "blogspot.bg", "blogspot.bj", "blogspot.ca", "blogspot.cf", "blogspot.ch", "blogspot.cl", "blogspot.co.at", "blogspot.co.id", "blogspot.co.il", "blogspot.co.ke", "blogspot.co.nz", "blogspot.co.uk", "blogspot.co.za", "blogspot.com", "blogspot.com.ar", "blogspot.com.au", "blogspot.com.br", "blogspot.com.by", "blogspot.com.co", "blogspot.com.cy", "blogspot.com.ee", "blogspot.com.eg", "blogspot.com.es", "blogspot.com.mt", "blogspot.com.ng", "blogspot.com.tr", "blogspot.com.uy", "blogspot.cv", "blogspot.cz", "blogspot.de", "blogspot.dk", "blogspot.fi", "blogspot.fr", "blogspot.gr", "blogspot.hk", "blogspot.hr", "blogspot.hu", "blogspot.ie", "blogspot.in", "blogspot.is", "blogspot.it", "blogspot.jp", "blogspot.kr", "blogspot.li", "blogspot.lt", "blogspot.lu", "blogspot.md", "blogspot.mk", "blogspot.mr", "blogspot.mx", "blogspot.my", "blogspot.nl", "blogspot.no", "blogspot.pe", "blogspot.pt", "blogspot.qa", "blogspot.re", "blogspot.ro", "blogspot.rs", "blogspot.ru", "blogspot.se", "blogspot.sg", "blogspot.si", "blogspot.sk", "blogspot.sn", "blogspot.td", "blogspot.tw", "blogspot.ug", "blogspot.vn", "cloudfunctions.net", "cloud.goog", "codespot.com", "googleapis.com", "googlecode.com", "pagespeedmobilizer.com", "publishproxy.com", "withgoogle.com", "withyoutube.com", "fin.ci", "free.hr", "caa.li", "ua.rs", "conf.se", "hashbang.sh", "hasura.app", "hasura-app.io", "hepforge.org", "herokuapp.com", "herokussl.com", "myravendb.com", "ravendb.community", "ravendb.me", "development.run", "ravendb.run", "bpl.biz", "orx.biz", "ng.city", "ng.ink", "biz.gl", "col.ng", "gen.ng", "ltd.ng", "sch.so", "häkkinen.fi", "*.moonscale.io", "moonscale.net", "iki.fi", "dyn-berlin.de", "in-berlin.de", "in-brb.de", "in-butter.de", "in-dsl.de", "in-dsl.net", "in-dsl.org", "in-vpn.de", "in-vpn.net", "in-vpn.org", "biz.at", "info.at", "info.cx", "ac.leg.br", "al.leg.br", "am.leg.br", "ap.leg.br", "ba.leg.br", "ce.leg.br", "df.leg.br", "es.leg.br", "go.leg.br", "ma.leg.br", "mg.leg.br", "ms.leg.br", "mt.leg.br", "pa.leg.br", "pb.leg.br", "pe.leg.br", "pi.leg.br", "pr.leg.br", "rj.leg.br", "rn.leg.br", "ro.leg.br", "rr.leg.br", "rs.leg.br", "sc.leg.br", "se.leg.br", "sp.leg.br", "to.leg.br", "pixolino.com", "ipifony.net", "mein-iserv.de", "test-iserv.de", "myjino.ru", "*.hosting.myjino.ru", "*.landing.myjino.ru", "*.spectrum.myjino.ru", "*.vps.myjino.ru", "*.triton.zone", "*.cns.joyent.com", "js.org", "kaas.gg", "khplay.nl", "keymachine.de", "knightpoint.systems", "co.krd", "edu.krd", "git-repos.de", "lcube-server.de", "svn-repos.de", "leadpages.co", "lpages.co", "lpusercontent.com", "co.business", "co.education", "co.events", "co.financial", "co.network", "co.place", "co.technology", "app.lmpm.com", "linkitools.space", "linkyard.cloud", "linkyard-cloud.ch", "members.linode.com", "nodebalancer.linode.com", "we.bs", "loginline.app", "loginline.dev", "loginline.io", "loginline.services", "loginline.site", "krasnik.pl", "leczna.pl", "lubartow.pl", "lublin.pl", "poniatowa.pl", "swidnik.pl", "uklugs.org", "glug.org.uk", "lug.org.uk", "lugs.org.uk", "barsy.bg", "barsy.co.uk", "barsyonline.co.uk", "barsycenter.com", "barsyonline.com", "barsy.club", "barsy.de", "barsy.eu", "barsy.in", "barsy.info", "barsy.io", "barsy.me", "barsy.menu", "barsy.mobi", "barsy.net", "barsy.online", "barsy.org", "barsy.pro", "barsy.pub", "barsy.shop", "barsy.site", "barsy.support", "barsy.uk", "*.magentosite.cloud", "mayfirst.info", "mayfirst.org", "hb.cldmail.ru", "miniserver.com", "memset.net", "cloud.metacentrum.cz", "custom.metacentrum.cz", "flt.cloud.muni.cz", "usr.cloud.muni.cz", "meteorapp.com", "eu.meteorapp.com", "co.pl", "azurecontainer.io", "azurewebsites.net", "azure-mobile.net", "cloudapp.net", "mozilla-iot.org", "bmoattachments.org", "net.ru", "org.ru", "pp.ru", "ui.nabu.casa", "pony.club", "of.fashion", "on.fashion", "of.football", "in.london", "of.london", "for.men", "and.mom", "for.mom", "for.one", "for.sale", "of.work", "to.work", "nctu.me", "bitballoon.com", "netlify.com", "4u.com", "ngrok.io", "nh-serv.co.uk", "nfshost.com", "dnsking.ch", "mypi.co", "n4t.co", "001www.com", "ddnslive.com", "myiphost.com", "forumz.info", "16-b.it", "32-b.it", "64-b.it", "soundcast.me", "tcp4.me", "dnsup.net", "hicam.net", "now-dns.net", "ownip.net", "vpndns.net", "dynserv.org", "now-dns.org", "x443.pw", "now-dns.top", "ntdll.top", "freeddns.us", "crafting.xyz", "zapto.xyz", "nsupdate.info", "nerdpol.ovh", "blogsyte.com", "brasilia.me", "cable-modem.org", "ciscofreak.com", "collegefan.org", "couchpotatofries.org", "damnserver.com", "ddns.me", "ditchyourip.com", "dnsfor.me", "dnsiskinky.com", "dvrcam.info", "dynns.com", "eating-organic.net", "fantasyleague.cc", "geekgalaxy.com", "golffan.us", "health-carereform.com", "homesecuritymac.com", "homesecuritypc.com", "hopto.me", "ilovecollege.info", "loginto.me", "mlbfan.org", "mmafan.biz", "myactivedirectory.com", "mydissent.net", "myeffect.net", "mymediapc.net", "mypsx.net", "mysecuritycamera.com", "mysecuritycamera.net", "mysecuritycamera.org", "net-freaks.com", "nflfan.org", "nhlfan.net", "no-ip.ca", "no-ip.co.uk", "no-ip.net", "noip.us", "onthewifi.com", "pgafan.net", "point2this.com", "pointto.us", "privatizehealthinsurance.net", "quicksytes.com", "read-books.org", "securitytactics.com", "serveexchange.com", "servehumour.com", "servep2p.com", "servesarcasm.com", "stufftoread.com", "ufcfan.org", "unusualperson.com", "workisboring.com", "3utilities.com", "bounceme.net", "ddns.net", "ddnsking.com", "gotdns.ch", "hopto.org", "myftp.biz", "myftp.org", "myvnc.com", "no-ip.biz", "no-ip.info", "no-ip.org", "noip.me", "redirectme.net", "servebeer.com", "serveblog.net", "servecounterstrike.com", "serveftp.com", "servegame.com", "servehalflife.com", "servehttp.com", "serveirc.com", "serveminecraft.net", "servemp3.com", "servepics.com", "servequake.com", "sytes.net", "webhop.me", "zapto.org", "stage.nodeart.io", "nodum.co", "nodum.io", "pcloud.host", "nyc.mn", "nom.ae", "nom.af", "nom.ai", "nom.al", "nym.by", "nym.bz", "nom.cl", "nom.gd", "nom.ge", "nom.gl", "nym.gr", "nom.gt", "nym.gy", "nom.hn", "nym.ie", "nom.im", "nom.ke", "nym.kz", "nym.la", "nym.lc", "nom.li", "nym.li", "nym.lt", "nym.lu", "nym.me", "nom.mk", "nym.mn", "nym.mx", "nom.nu", "nym.nz", "nym.pe", "nym.pt", "nom.pw", "nom.qa", "nym.ro", "nom.rs", "nom.si", "nym.sk", "nom.st", "nym.su", "nym.sx", "nom.tj", "nym.tw", "nom.ug", "nom.uy", "nom.vc", "nom.vg", "cya.gg", "cloudycluster.net", "nid.io", "opencraft.hosting", "operaunite.com", "outsystemscloud.com", "ownprovider.com", "own.pm", "ox.rs", "oy.lc", "pgfog.com", "pagefrontapp.com", "art.pl", "gliwice.pl", "krakow.pl", "poznan.pl", "wroc.pl", "zakopane.pl", "pantheonsite.io", "gotpantheon.com", "mypep.link", "on-web.fr", "*.platform.sh", "*.platformsh.site", "co.bn", "xen.prgmr.com", "priv.at", "prvcy.page", "*.dweb.link", "protonet.io", "chirurgiens-dentistes-en-france.fr", "byen.site", "instantcloud.cn", "ras.ru", "qa2.com", "dev-myqnapcloud.com", "alpha-myqnapcloud.com", "myqnapcloud.com", "*.quipelements.com", "vapor.cloud", "vaporcloud.io", "rackmaze.com", "rackmaze.net", "*.on-rancher.cloud", "*.on-rio.io", "readthedocs.io", "rhcloud.com", "app.render.com", "onrender.com", "repl.co", "repl.run", "resindevice.io", "devices.resinstaging.io", "hzc.io", "wellbeingzone.eu", "ptplus.fit", "wellbeingzone.co.uk", "git-pages.rit.edu", "sandcats.io", "logoip.de", "logoip.com", "schokokeks.net", "scrysec.com", "firewall-gateway.com", "firewall-gateway.de", "my-gateway.de", "my-router.de", "spdns.de", "spdns.eu", "firewall-gateway.net", "my-firewall.org", "myfirewall.org", "spdns.org", "*.s5y.io", "*.sensiosite.cloud", "biz.ua", "co.ua", "pp.ua", "shiftedit.io", "myshopblocks.com", "mo-siemens.io", "1kapp.com", "appchizi.com", "applinzi.com", "sinaapp.com", "vipsinaapp.com", "siteleaf.net", "bounty-full.com", "alpha.bounty-full.com", "beta.bounty-full.com", "stackhero-network.com", "static.land", "dev.static.land", "sites.static.land", "apps.lair.io", "*.stolos.io", "spacekit.io", "customer.speedpartner.de", "api.stdlib.com", "storj.farm", "utwente.io", "soc.srcf.net", "user.srcf.net", "temp-dns.com", "applicationcloud.io", "scapp.io", "syncloud.it", "diskstation.me", "dscloud.biz", "dscloud.me", "dscloud.mobi", "dsmynas.com", "dsmynas.net", "dsmynas.org", "familyds.com", "familyds.net", "familyds.org", "i234.me", "myds.me", "synology.me", "vpnplus.to", "taifun-dns.de", "gda.pl", "gdansk.pl", "gdynia.pl", "med.pl", "sopot.pl", "edugit.org", "telebit.app", "telebit.io", "*.telebit.xyz", "gwiddle.co.uk", "thingdustdata.com", "cust.dev.thingdust.io", "cust.disrec.thingdust.io", "cust.prod.thingdust.io", "cust.testing.thingdust.io", "arvo.network", "azimuth.network", "bloxcms.com", "townnews-staging.com", "12hp.at", "2ix.at", "4lima.at", "lima-city.at", "12hp.ch", "2ix.ch", "4lima.ch", "lima-city.ch", "trafficplex.cloud", "de.cool", "12hp.de", "2ix.de", "4lima.de", "lima-city.de", "1337.pictures", "clan.rip", "lima-city.rocks", "webspace.rocks", "lima.zone", "*.transurl.be", "*.transurl.eu", "*.transurl.nl", "tuxfamily.org", "dd-dns.de", "diskstation.eu", "diskstation.org", "dray-dns.de", "draydns.de", "dyn-vpn.de", "dynvpn.de", "mein-vigor.de", "my-vigor.de", "my-wan.de", "syno-ds.de", "synology-diskstation.de", "synology-ds.de", "uber.space", "*.uberspace.de", "hk.com", "hk.org", "ltd.hk", "inc.hk", "virtualuser.de", "virtual-user.de", "lib.de.us", "2038.io", "router.management", "v-info.info", "voorloper.cloud", "wafflecell.com", "wedeploy.io", "wedeploy.me", "wedeploy.sh", "remotewd.com", "wmflabs.org", "half.host", "xnbay.com", "u2.xnbay.com", "u2-local.xnbay.com", "cistron.nl", "demon.nl", "xs4all.space", "official.academy", "yolasite.com", "ybo.faith", "yombo.me", "homelink.one", "ybo.party", "ybo.review", "ybo.science", "ybo.trade", "nohost.me", "noho.st", "za.net", "za.org", "now.sh", "bss.design", "basicserver.io", "virtualserver.io", "site.builder.nu", "enterprisecloud.nu", "zone.id" ]; }, function(module, exports, __webpack_require__) { "use strict"; var Store = __webpack_require__(518).Store, permuteDomain = __webpack_require__(519).permuteDomain, pathMatch = __webpack_require__(520).pathMatch, util = __webpack_require__(0); function MemoryCookieStore() { Store.call(this), this.idx = {}; } util.inherits(MemoryCookieStore, Store), exports.MemoryCookieStore = MemoryCookieStore, MemoryCookieStore.prototype.idx = null, MemoryCookieStore.prototype.synchronous = !0, MemoryCookieStore.prototype.inspect = function() { return "{ idx: " + util.inspect(this.idx, !1, 2) + " }"; }, util.inspect.custom && (MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect), MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) { return this.idx[domain] && this.idx[domain][path] ? cb(null, this.idx[domain][path][key] || null) : cb(null, void 0); }, MemoryCookieStore.prototype.findCookies = function(domain, path, cb) { var pathMatcher, results = []; if (!domain) return cb(null, []); pathMatcher = path ? function(domainIndex) { Object.keys(domainIndex).forEach((function(cookiePath) { if (pathMatch(path, cookiePath)) { var pathIndex = domainIndex[cookiePath]; for (var key in pathIndex) results.push(pathIndex[key]); } })); } : function(domainIndex) { for (var curPath in domainIndex) { var pathIndex = domainIndex[curPath]; for (var key in pathIndex) results.push(pathIndex[key]); } }; var domains = permuteDomain(domain) || [ domain ], idx = this.idx; domains.forEach((function(curDomain) { var domainIndex = idx[curDomain]; domainIndex && pathMatcher(domainIndex); })), cb(null, results); }, MemoryCookieStore.prototype.putCookie = function(cookie, cb) { this.idx[cookie.domain] || (this.idx[cookie.domain] = {}), this.idx[cookie.domain][cookie.path] || (this.idx[cookie.domain][cookie.path] = {}), this.idx[cookie.domain][cookie.path][cookie.key] = cookie, cb(null); }, MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) { this.putCookie(newCookie, cb); }, MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) { this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key] && delete this.idx[domain][path][key], cb(null); }, MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) { return this.idx[domain] && (path ? delete this.idx[domain][path] : delete this.idx[domain]), cb(null); }, MemoryCookieStore.prototype.getAllCookies = function(cb) { var cookies = [], idx = this.idx; Object.keys(idx).forEach((function(domain) { Object.keys(idx[domain]).forEach((function(path) { Object.keys(idx[domain][path]).forEach((function(key) { null !== key && cookies.push(idx[domain][path][key]); })); })); })), cookies.sort((function(a, b) { return (a.creationIndex || 0) - (b.creationIndex || 0); })), cb(null, cookies); }; }, function(module) { module.exports = { author: { name: "Jeremy Stashewsky", email: "jstash@gmail.com", website: "https://github.com/stash" }, contributors: [ { name: "Alexander Savin", website: "https://github.com/apsavin" }, { name: "Ian Livingstone", website: "https://github.com/ianlivingstone" }, { name: "Ivan Nikulin", website: "https://github.com/inikulin" }, { name: "Lalit Kapoor", website: "https://github.com/lalitkapoor" }, { name: "Sam Thompson", website: "https://github.com/sambthompson" }, { name: "Sebastian Mayr", website: "https://github.com/Sebmaster" } ], license: "BSD-3-Clause", name: "tough-cookie", description: "RFC6265 Cookies and Cookie Jar for node.js", keywords: [ "HTTP", "cookie", "cookies", "set-cookie", "cookiejar", "jar", "RFC6265", "RFC2965" ], version: "2.4.3", homepage: "https://github.com/salesforce/tough-cookie", repository: { type: "git", url: "git://github.com/salesforce/tough-cookie.git" }, bugs: { url: "https://github.com/salesforce/tough-cookie/issues" }, main: "./lib/cookie", files: [ "lib" ], scripts: { test: "vows test/*_test.js", cover: "nyc --reporter=lcov --reporter=html vows test/*_test.js" }, engines: { node: ">=0.8" }, devDependencies: { async: "^1.4.2", nyc: "^11.6.0", "string.prototype.repeat": "^0.2.0", vows: "^0.8.1" }, dependencies: { psl: "^1.1.24", punycode: "^1.4.1" } }; }, function(module, exports) { function serializer(replacer, cycleReplacer) { var stack = [], keys = []; return null == cycleReplacer && (cycleReplacer = function(key, value) { return stack[0] === value ? "[Circular ~]" : "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; }), function(key, value) { if (stack.length > 0) { var thisPos = stack.indexOf(this); ~thisPos ? stack.splice(thisPos + 1) : stack.push(this), ~thisPos ? keys.splice(thisPos, 1 / 0, key) : keys.push(key), ~stack.indexOf(value) && (value = cycleReplacer.call(this, key, value)); } else stack.push(value); return null == replacer ? value : replacer.call(this, key, value); }; } (module.exports = function(obj, replacer, spaces, cycleReplacer) { return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces); }).getSerialize = serializer; }, function(module, exports, __webpack_require__) { "use strict"; var http = __webpack_require__(11), https = __webpack_require__(21), url = __webpack_require__(7), util = __webpack_require__(0), stream = __webpack_require__(3), zlib = __webpack_require__(43), aws2 = __webpack_require__(1133), aws4 = __webpack_require__(1134), httpSignature = __webpack_require__(1136), mime = __webpack_require__(78), caseless = __webpack_require__(267), ForeverAgent = __webpack_require__(1153), FormData = __webpack_require__(1154), extend = __webpack_require__(157), isstream = __webpack_require__(534), isTypedArray = __webpack_require__(185).strict, helpers = __webpack_require__(260), cookies = __webpack_require__(515), getProxyFromURI = __webpack_require__(1161), Querystring = __webpack_require__(1162).Querystring, Har = __webpack_require__(1165).Har, Auth = __webpack_require__(1221).Auth, OAuth = __webpack_require__(1222).OAuth, hawk = __webpack_require__(1224), Multipart = __webpack_require__(1225).Multipart, Redirect = __webpack_require__(1226).Redirect, Tunnel = __webpack_require__(1227).Tunnel, now = __webpack_require__(1229), Buffer = __webpack_require__(26).Buffer, safeStringify = helpers.safeStringify, isReadStream = helpers.isReadStream, toBase64 = helpers.toBase64, defer = helpers.defer, copy = helpers.copy, version = helpers.version, globalCookieJar = cookies.jar(), globalPool = {}; function requestToJSON() { return { uri: this.uri, method: this.method, headers: this.headers }; } function responseToJSON() { return { statusCode: this.statusCode, body: this.body, headers: this.headers, request: requestToJSON.call(this.request) }; } function Request(options) { options.har && (this._har = new Har(this), options = this._har.options(options)), stream.Stream.call(this); var reserved = Object.keys(Request.prototype), nonReserved = (function(reserved, options) { var object = {}; for (var i in options) -1 === reserved.indexOf(i) && (object[i] = options[i]); return object; })(reserved, options); extend(this, nonReserved), options = (function(reserved, options) { var object = {}; for (var i in options) { var isReserved = !(-1 === reserved.indexOf(i)), isFunction = "function" == typeof options[i]; isReserved && isFunction || (object[i] = options[i]); } return object; })(reserved, options), this.readable = !0, this.writable = !0, options.method && (this.explicitMethod = !0), this._qs = new Querystring(this), this._auth = new Auth(this), this._oauth = new OAuth(this), this._multipart = new Multipart(this), this._redirect = new Redirect(this), this._tunnel = new Tunnel(this), this.init(options); } function debug() { Request.debug && console.error("REQUEST %s", util.format.apply(util, arguments)); } util.inherits(Request, stream.Stream), Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG), Request.prototype.debug = debug, Request.prototype.init = function(options) { var self = this; for (var headerName in options || (options = {}), self.headers = self.headers ? copy(self.headers) : {}, self.headers) void 0 === self.headers[headerName] && delete self.headers[headerName]; if (caseless.httpify(self, self.headers), self.method || (self.method = options.method || "GET"), self.localAddress || (self.localAddress = options.localAddress), self._qs.init(options), debug(options), self.pool || !1 === self.pool || (self.pool = globalPool), self.dests = self.dests || [], self.__isRequestRequest = !0, !self._callback && self.callback && (self._callback = self.callback, self.callback = function() { self._callbackCalled || (self._callbackCalled = !0, self._callback.apply(self, arguments)); }, self.on("error", self.callback.bind()), self.on("complete", self.callback.bind(self, null))), !self.uri && self.url && (self.uri = self.url, delete self.url), self.baseUrl) { if ("string" != typeof self.baseUrl) return self.emit("error", new Error("options.baseUrl must be a string")); if ("string" != typeof self.uri) return self.emit("error", new Error("options.uri must be a string when using options.baseUrl")); if (0 === self.uri.indexOf("//") || -1 !== self.uri.indexOf("://")) return self.emit("error", new Error("options.uri must be a path when using options.baseUrl")); var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf("/") === self.baseUrl.length - 1, uriStartsWithSlash = 0 === self.uri.indexOf("/"); baseUrlEndsWithSlash && uriStartsWithSlash ? self.uri = self.baseUrl + self.uri.slice(1) : baseUrlEndsWithSlash || uriStartsWithSlash ? self.uri = self.baseUrl + self.uri : "" === self.uri ? self.uri = self.baseUrl : self.uri = self.baseUrl + "/" + self.uri, delete self.baseUrl; } if (!self.uri) return self.emit("error", new Error("options.uri is a required argument")); if ("string" == typeof self.uri && (self.uri = url.parse(self.uri)), self.uri.href || (self.uri.href = url.format(self.uri)), "unix:" === self.uri.protocol) return self.emit("error", new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`")); if ("unix" === self.uri.host && self.enableUnixSocket(), !1 === self.strictSSL && (self.rejectUnauthorized = !1), self.uri.pathname || (self.uri.pathname = "/"), !(self.uri.host || self.uri.hostname && self.uri.port || self.uri.isUnix)) { var message = 'Invalid URI "' + url.format(self.uri) + '"'; return 0 === Object.keys(options).length && (message += ". This can be caused by a crappy redirection."), self.abort(), self.emit("error", new Error(message)); } if (self.hasOwnProperty("proxy") || (self.proxy = getProxyFromURI(self.uri)), self.tunnel = self._tunnel.isEnabled(), self.proxy && self._tunnel.setup(options), self._redirect.onRequest(options), self.setHost = !1, !self.hasHeader("host")) { var hostHeaderName = self.originalHostHeaderName || "host"; self.setHeader(hostHeaderName, self.uri.host), self.uri.port && ("80" === self.uri.port && "http:" === self.uri.protocol || "443" === self.uri.port && "https:" === self.uri.protocol) && self.setHeader(hostHeaderName, self.uri.hostname), self.setHost = !0; } if (self.jar(self._jar || options.jar), self.uri.port || ("http:" === self.uri.protocol ? self.uri.port = 80 : "https:" === self.uri.protocol && (self.uri.port = 443)), self.proxy && !self.tunnel ? (self.port = self.proxy.port, self.host = self.proxy.hostname) : (self.port = self.uri.port, self.host = self.uri.hostname), options.form && self.form(options.form), options.formData) { var formData = options.formData, requestForm = self.form(), appendFormValue = function(key, value) { value && value.hasOwnProperty("value") && value.hasOwnProperty("options") ? requestForm.append(key, value.value, value.options) : requestForm.append(key, value); }; for (var formKey in formData) if (formData.hasOwnProperty(formKey)) { var formValue = formData[formKey]; if (formValue instanceof Array) for (var j = 0; j < formValue.length; j++) appendFormValue(formKey, formValue[j]); else appendFormValue(formKey, formValue); } } if (options.qs && self.qs(options.qs), self.uri.path ? self.path = self.uri.path : self.path = self.uri.pathname + (self.uri.search || ""), 0 === self.path.length && (self.path = "/"), options.aws && self.aws(options.aws), options.hawk && self.hawk(options.hawk), options.httpSignature && self.httpSignature(options.httpSignature), options.auth && (Object.prototype.hasOwnProperty.call(options.auth, "username") && (options.auth.user = options.auth.username), Object.prototype.hasOwnProperty.call(options.auth, "password") && (options.auth.pass = options.auth.password), self.auth(options.auth.user, options.auth.pass, options.auth.sendImmediately, options.auth.bearer)), self.gzip && !self.hasHeader("accept-encoding") && self.setHeader("accept-encoding", "gzip, deflate"), self.uri.auth && !self.hasHeader("authorization")) { var uriAuthPieces = self.uri.auth.split(":").map((function(item) { return self._qs.unescape(item); })); self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(":"), !0); } if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader("proxy-authorization")) { var proxyAuthPieces = self.proxy.auth.split(":").map((function(item) { return self._qs.unescape(item); })), authHeader = "Basic " + toBase64(proxyAuthPieces.join(":")); self.setHeader("proxy-authorization", authHeader); } function setContentLength() { var length; isTypedArray(self.body) && (self.body = Buffer.from(self.body)), self.hasHeader("content-length") || ((length = "string" == typeof self.body ? Buffer.byteLength(self.body) : Array.isArray(self.body) ? self.body.reduce((function(a, b) { return a + b.length; }), 0) : self.body.length) ? self.setHeader("content-length", length) : self.emit("error", new Error("Argument error, options.body."))); } self.proxy && !self.tunnel && (self.path = self.uri.protocol + "//" + self.uri.host + self.path), options.json && self.json(options.json), options.multipart && self.multipart(options.multipart), options.time && (self.timing = !0, self.elapsedTime = self.elapsedTime || 0), self.body && !isstream(self.body) && setContentLength(), options.oauth ? self.oauth(options.oauth) : self._oauth.params && self.hasHeader("authorization") && self.oauth(self._oauth.params); var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol, defaultModules = { "http:": http, "https:": https }, httpModules = self.httpModules || {}; if (self.httpModule = httpModules[protocol] || defaultModules[protocol], !self.httpModule) return self.emit("error", new Error("Invalid protocol: " + protocol)); if (options.ca && (self.ca = options.ca), !self.agent) if (options.agentOptions && (self.agentOptions = options.agentOptions), options.agentClass) self.agentClass = options.agentClass; else if (options.forever) { var v = version(); 0 === v.major && v.minor <= 10 ? self.agentClass = "http:" === protocol ? ForeverAgent : ForeverAgent.SSL : (self.agentClass = self.httpModule.Agent, self.agentOptions = self.agentOptions || {}, self.agentOptions.keepAlive = !0); } else self.agentClass = self.httpModule.Agent; !1 === self.pool ? self.agent = !1 : self.agent = self.agent || self.getNewAgent(), self.on("pipe", (function(src) { if (self.ntick && self._started && self.emit("error", new Error("You cannot pipe to this stream after the outbound request has started.")), self.src = src, isReadStream(src)) self.hasHeader("content-type") || self.setHeader("content-type", mime.lookup(src.path)); else { if (src.headers) for (var i in src.headers) self.hasHeader(i) || self.setHeader(i, src.headers[i]); self._json && !self.hasHeader("content-type") && self.setHeader("content-type", "application/json"), src.method && !self.explicitMethod && (self.method = src.method); } })), defer((function() { if (!self._aborted) { var end = function() { if (self._form && (self._auth.hasAuth ? self._auth.hasAuth && self._auth.sentAuth && self._form.pipe(self) : self._form.pipe(self)), self._multipart && self._multipart.chunked && self._multipart.body.pipe(self), self.body) isstream(self.body) ? self.body.pipe(self) : (setContentLength(), Array.isArray(self.body) ? self.body.forEach((function(part) { self.write(part); })) : self.write(self.body), self.end()); else if (self.requestBodyStream) console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe."), self.requestBodyStream.pipe(self); else if (!self.src) { if (self._auth.hasAuth && !self._auth.sentAuth) return void self.end(); "GET" !== self.method && void 0 !== self.method && self.setHeader("content-length", 0), self.end(); } }; self._form && !self.hasHeader("content-length") ? (self.setHeader(self._form.getHeaders(), !0), self._form.getLength((function(err, length) { err || isNaN(length) || self.setHeader("content-length", length), end(); }))) : end(), self.ntick = !0; } })); }, Request.prototype.getNewAgent = function() { var Agent = this.agentClass, options = {}; if (this.agentOptions) for (var i in this.agentOptions) options[i] = this.agentOptions[i]; this.ca && (options.ca = this.ca), this.ciphers && (options.ciphers = this.ciphers), this.secureProtocol && (options.secureProtocol = this.secureProtocol), this.secureOptions && (options.secureOptions = this.secureOptions), void 0 !== this.rejectUnauthorized && (options.rejectUnauthorized = this.rejectUnauthorized), this.cert && this.key && (options.key = this.key, options.cert = this.cert), this.pfx && (options.pfx = this.pfx), this.passphrase && (options.passphrase = this.passphrase); var poolKey = ""; Agent !== this.httpModule.Agent && (poolKey += Agent.name); var proxy = this.proxy; return "string" == typeof proxy && (proxy = url.parse(proxy)), (proxy && "https:" === proxy.protocol || "https:" === this.uri.protocol) && (options.ca && (poolKey && (poolKey += ":"), poolKey += options.ca), void 0 !== options.rejectUnauthorized && (poolKey && (poolKey += ":"), poolKey += options.rejectUnauthorized), options.cert && (poolKey && (poolKey += ":"), poolKey += options.cert.toString("ascii") + options.key.toString("ascii")), options.pfx && (poolKey && (poolKey += ":"), poolKey += options.pfx.toString("ascii")), options.ciphers && (poolKey && (poolKey += ":"), poolKey += options.ciphers), options.secureProtocol && (poolKey && (poolKey += ":"), poolKey += options.secureProtocol), options.secureOptions && (poolKey && (poolKey += ":"), poolKey += options.secureOptions)), this.pool === globalPool && !poolKey && 0 === Object.keys(options).length && this.httpModule.globalAgent ? this.httpModule.globalAgent : (poolKey = this.uri.protocol + poolKey, this.pool[poolKey] || (this.pool[poolKey] = new Agent(options), this.pool.maxSockets && (this.pool[poolKey].maxSockets = this.pool.maxSockets)), this.pool[poolKey]); }, Request.prototype.start = function() { var self = this; if (self.timing) var startTime = (new Date).getTime(), startTimeNow = now(); if (!self._aborted) { self._started = !0, self.method = self.method || "GET", self.href = self.uri.href, self.src && self.src.stat && self.src.stat.size && !self.hasHeader("content-length") && self.setHeader("content-length", self.src.stat.size), self._aws && self.aws(self._aws, !0); var timeout, reqOptions = copy(self); delete reqOptions.auth, debug("make request", self.uri.href), delete reqOptions.timeout; try { self.req = self.httpModule.request(reqOptions); } catch (err) { return void self.emit("error", err); } self.timing && (self.startTime = startTime, self.startTimeNow = startTimeNow, self.timings = {}), self.timeout && !self.timeoutTimer && (self.timeout < 0 ? timeout = 0 : "number" == typeof self.timeout && isFinite(self.timeout) && (timeout = self.timeout)), self.req.on("response", self.onRequestResponse.bind(self)), self.req.on("error", self.onRequestError.bind(self)), self.req.on("drain", (function() { self.emit("drain"); })), self.req.on("socket", (function(socket) { var isConnecting = socket._connecting || socket.connecting; if (self.timing && (self.timings.socket = now() - self.startTimeNow, isConnecting)) { var onLookupTiming = function() { self.timings.lookup = now() - self.startTimeNow; }, onConnectTiming = function() { self.timings.connect = now() - self.startTimeNow; }; socket.once("lookup", onLookupTiming), socket.once("connect", onConnectTiming), self.req.once("error", (function() { socket.removeListener("lookup", onLookupTiming), socket.removeListener("connect", onConnectTiming); })); } var setReqTimeout = function() { self.req.setTimeout(timeout, (function() { if (self.req) { self.abort(); var e = new Error("ESOCKETTIMEDOUT"); e.code = "ESOCKETTIMEDOUT", e.connect = !1, self.emit("error", e); } })); }; if (void 0 !== timeout) if (isConnecting) { var onReqSockConnect = function() { socket.removeListener("connect", onReqSockConnect), clearTimeout(self.timeoutTimer), self.timeoutTimer = null, setReqTimeout(); }; socket.on("connect", onReqSockConnect), self.req.on("error", (function(err) { socket.removeListener("connect", onReqSockConnect); })), self.timeoutTimer = setTimeout((function() { socket.removeListener("connect", onReqSockConnect), self.abort(); var e = new Error("ETIMEDOUT"); e.code = "ETIMEDOUT", e.connect = !0, self.emit("error", e); }), timeout); } else setReqTimeout(); self.emit("socket", socket); })), self.emit("request", self.req); } }, Request.prototype.onRequestError = function(error) { if (!this._aborted) { if (this.req && this.req._reusedSocket && "ECONNRESET" === error.code && this.agent.addRequestNoreuse) return this.agent = { addRequest: this.agent.addRequestNoreuse.bind(this.agent) }, this.start(), void this.req.end(); this.timeout && this.timeoutTimer && (clearTimeout(this.timeoutTimer), this.timeoutTimer = null), this.emit("error", error); } }, Request.prototype.onRequestResponse = function(response) { var self = this; if (self.timing && (self.timings.response = now() - self.startTimeNow), debug("onRequestResponse", self.uri.href, response.statusCode, response.headers), response.on("end", (function() { self.timing && (self.timings.end = now() - self.startTimeNow, response.timingStart = self.startTime, self.timings.socket || (self.timings.socket = 0), self.timings.lookup || (self.timings.lookup = self.timings.socket), self.timings.connect || (self.timings.connect = self.timings.lookup), self.timings.response || (self.timings.response = self.timings.connect), debug("elapsed time", self.timings.end), self.elapsedTime += Math.round(self.timings.end), response.elapsedTime = self.elapsedTime, response.timings = self.timings, response.timingPhases = { wait: self.timings.socket, dns: self.timings.lookup - self.timings.socket, tcp: self.timings.connect - self.timings.lookup, firstByte: self.timings.response - self.timings.connect, download: self.timings.end - self.timings.response, total: self.timings.end }), debug("response end", self.uri.href, response.statusCode, response.headers); })), self._aborted) return debug("aborted", self.uri.href), void response.resume(); if (self.response = response, response.request = self, response.toJSON = responseToJSON, self.httpModule !== https || !self.strictSSL || response.hasOwnProperty("socket") && response.socket.authorized) { self.originalHost = self.getHeader("host"), self.originalHostHeaderName || (self.originalHostHeaderName = self.hasHeader("host")), self.setHost && self.removeHeader("host"), self.timeout && self.timeoutTimer && (clearTimeout(self.timeoutTimer), self.timeoutTimer = null); var targetCookieJar = self._jar && self._jar.setCookie ? self._jar : globalCookieJar, addCookie = function(cookie) { try { targetCookieJar.setCookie(cookie, self.uri.href, { ignoreError: !0 }); } catch (e) { self.emit("error", e); } }; if (response.caseless = caseless(response.headers), response.caseless.has("set-cookie") && !self._disableCookies) { var headerName = response.caseless.has("set-cookie"); Array.isArray(response.headers[headerName]) ? response.headers[headerName].forEach(addCookie) : addCookie(response.headers[headerName]); } if (!self._redirect.onResponse(response)) { var responseContent, code; if (response.on("close", (function() { self._ended || self.response.emit("end"); })), response.once("end", (function() { self._ended = !0; })), !self.gzip || (code = response.statusCode, "HEAD" === self.method || code >= 100 && code < 200 || 204 === code || 304 === code)) responseContent = response; else { var contentEncoding = response.headers["content-encoding"] || "identity"; contentEncoding = contentEncoding.trim().toLowerCase(); var zlibOptions = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH }; "gzip" === contentEncoding ? (responseContent = zlib.createGunzip(zlibOptions), response.pipe(responseContent)) : "deflate" === contentEncoding ? (responseContent = zlib.createInflate(zlibOptions), response.pipe(responseContent)) : ("identity" !== contentEncoding && debug("ignoring unrecognized Content-Encoding " + contentEncoding), responseContent = response); } self.encoding && (0 !== self.dests.length ? console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.") : responseContent.setEncoding(self.encoding)), self._paused && responseContent.pause(), self.responseContent = responseContent, self.emit("response", response), self.dests.forEach((function(dest) { self.pipeDest(dest); })), responseContent.on("data", (function(chunk) { self.timing && !self.responseStarted && (self.responseStartTime = (new Date).getTime(), response.responseStartTime = self.responseStartTime), self._destdata = !0, self.emit("data", chunk); })), responseContent.once("end", (function(chunk) { self.emit("end", chunk); })), responseContent.on("error", (function(error) { self.emit("error", error); })), responseContent.on("close", (function() { self.emit("close"); })), self.callback ? self.readResponseBody(response) : self.on("end", (function() { self._aborted ? debug("aborted", self.uri.href) : self.emit("complete", response); })), debug("finish init function", self.uri.href); } } else { debug("strict ssl error", self.uri.href); var sslErr = response.hasOwnProperty("socket") ? response.socket.authorizationError : self.uri.href + " does not support SSL"; self.emit("error", new Error("SSL Error: " + sslErr)); } }, Request.prototype.readResponseBody = function(response) { var self = this; debug("reading response's body"); var buffers = [], bufferLength = 0, strings = []; self.on("data", (function(chunk) { Buffer.isBuffer(chunk) ? chunk.length && (bufferLength += chunk.length, buffers.push(chunk)) : strings.push(chunk); })), self.on("end", (function() { if (debug("end event", self.uri.href), self._aborted) return debug("aborted", self.uri.href), buffers = [], void (bufferLength = 0); if (bufferLength ? (debug("has body", self.uri.href, bufferLength), response.body = Buffer.concat(buffers, bufferLength), null !== self.encoding && (response.body = response.body.toString(self.encoding)), buffers = [], bufferLength = 0) : strings.length && ("utf8" === self.encoding && strings[0].length > 0 && "\ufeff" === strings[0][0] && (strings[0] = strings[0].substring(1)), response.body = strings.join("")), self._json) try { response.body = JSON.parse(response.body, self._jsonReviver); } catch (e) { debug("invalid JSON received", self.uri.href); } debug("emitting complete", self.uri.href), void 0 !== response.body || self._json || (response.body = null === self.encoding ? Buffer.alloc(0) : ""), self.emit("complete", response, response.body); })); }, Request.prototype.abort = function() { this._aborted = !0, this.req ? this.req.abort() : this.response && this.response.destroy(), this.emit("abort"); }, Request.prototype.pipeDest = function(dest) { var response = this.response; if (dest.headers && !dest.headersSent) { if (response.caseless.has("content-type")) { var ctname = response.caseless.has("content-type"); dest.setHeader ? dest.setHeader(ctname, response.headers[ctname]) : dest.headers[ctname] = response.headers[ctname]; } if (response.caseless.has("content-length")) { var clname = response.caseless.has("content-length"); dest.setHeader ? dest.setHeader(clname, response.headers[clname]) : dest.headers[clname] = response.headers[clname]; } } if (dest.setHeader && !dest.headersSent) { for (var i in response.headers) this.gzip && "content-encoding" === i || dest.setHeader(i, response.headers[i]); dest.statusCode = response.statusCode; } this.pipefilter && this.pipefilter(response, dest); }, Request.prototype.qs = function(q, clobber) { var base; for (var i in base = !clobber && this.uri.query ? this._qs.parse(this.uri.query) : {}, q) base[i] = q[i]; var qs = this._qs.stringify(base); return "" === qs || (this.uri = url.parse(this.uri.href.split("?")[0] + "?" + qs), this.url = this.uri, this.path = this.uri.path, "unix" === this.uri.host && this.enableUnixSocket()), this; }, Request.prototype.form = function(form) { var self = this; return form ? (/^application\/x-www-form-urlencoded\b/.test(self.getHeader("content-type")) || self.setHeader("content-type", "application/x-www-form-urlencoded"), self.body = "string" == typeof form ? self._qs.rfc3986(form.toString("utf8")) : self._qs.stringify(form).toString("utf8"), self) : (self._form = new FormData, self._form.on("error", (function(err) { err.message = "form-data: " + err.message, self.emit("error", err), self.abort(); })), self._form); }, Request.prototype.multipart = function(multipart) { return this._multipart.onRequest(multipart), this._multipart.chunked || (this.body = this._multipart.body), this; }, Request.prototype.json = function(val) { return this.hasHeader("accept") || this.setHeader("accept", "application/json"), "function" == typeof this.jsonReplacer && (this._jsonReplacer = this.jsonReplacer), this._json = !0, "boolean" == typeof val ? void 0 !== this.body && (/^application\/x-www-form-urlencoded\b/.test(this.getHeader("content-type")) ? this.body = this._qs.rfc3986(this.body) : this.body = safeStringify(this.body, this._jsonReplacer), this.hasHeader("content-type") || this.setHeader("content-type", "application/json")) : (this.body = safeStringify(val, this._jsonReplacer), this.hasHeader("content-type") || this.setHeader("content-type", "application/json")), "function" == typeof this.jsonReviver && (this._jsonReviver = this.jsonReviver), this; }, Request.prototype.getHeader = function(name, headers) { var result, re; return headers || (headers = this.headers), Object.keys(headers).forEach((function(key) { key.length === name.length && (re = new RegExp(name, "i"), key.match(re) && (result = headers[key])); })), result; }, Request.prototype.enableUnixSocket = function() { var unixParts = this.uri.path.split(":"), host = unixParts[0], path = unixParts[1]; this.socketPath = host, this.uri.pathname = path, this.uri.path = path, this.uri.host = host, this.uri.hostname = host, this.uri.isUnix = !0; }, Request.prototype.auth = function(user, pass, sendImmediately, bearer) { return this._auth.onRequest(user, pass, sendImmediately, bearer), this; }, Request.prototype.aws = function(opts, now) { if (!now) return this._aws = opts, this; if (4 === opts.sign_version || "4" === opts.sign_version) { var options = { host: this.uri.host, path: this.uri.path, method: this.method, headers: this.headers, body: this.body }; opts.service && (options.service = opts.service); var signRes = aws4.sign(options, { accessKeyId: opts.key, secretAccessKey: opts.secret, sessionToken: opts.session }); this.setHeader("authorization", signRes.headers.Authorization), this.setHeader("x-amz-date", signRes.headers["X-Amz-Date"]), signRes.headers["X-Amz-Security-Token"] && this.setHeader("x-amz-security-token", signRes.headers["X-Amz-Security-Token"]); } else { var date = new Date; this.setHeader("date", date.toUTCString()); var auth = { key: opts.key, secret: opts.secret, verb: this.method.toUpperCase(), date: date, contentType: this.getHeader("content-type") || "", md5: this.getHeader("content-md5") || "", amazonHeaders: aws2.canonicalizeHeaders(this.headers) }, path = this.uri.path; opts.bucket && path ? auth.resource = "/" + opts.bucket + path : opts.bucket && !path ? auth.resource = "/" + opts.bucket : !opts.bucket && path ? auth.resource = path : opts.bucket || path || (auth.resource = "/"), auth.resource = aws2.canonicalizeResource(auth.resource), this.setHeader("authorization", aws2.authorization(auth)); } return this; }, Request.prototype.httpSignature = function(opts) { var self = this; return httpSignature.signRequest({ getHeader: function(header) { return self.getHeader(header, self.headers); }, setHeader: function(header, value) { self.setHeader(header, value); }, method: self.method, path: self.path }, opts), debug("httpSignature authorization", self.getHeader("authorization")), self; }, Request.prototype.hawk = function(opts) { this.setHeader("Authorization", hawk.header(this.uri, this.method, opts)); }, Request.prototype.oauth = function(_oauth) { return this._oauth.onRequest(_oauth), this; }, Request.prototype.jar = function(jar) { var cookies; if (0 === this._redirect.redirectsFollowed && (this.originalCookieHeader = this.getHeader("cookie")), jar) { var targetCookieJar = jar && jar.getCookieString ? jar : globalCookieJar, urihref = this.uri.href; targetCookieJar && (cookies = targetCookieJar.getCookieString(urihref)); } else cookies = !1, this._disableCookies = !0; return cookies && cookies.length && (this.originalCookieHeader ? this.setHeader("cookie", this.originalCookieHeader + "; " + cookies) : this.setHeader("cookie", cookies)), this._jar = jar, this; }, Request.prototype.pipe = function(dest, opts) { if (!this.response) return this.dests.push(dest), stream.Stream.prototype.pipe.call(this, dest, opts), dest; if (this._destdata) this.emit("error", new Error("You cannot pipe after data has been emitted from the response.")); else { if (!this._ended) return stream.Stream.prototype.pipe.call(this, dest, opts), this.pipeDest(dest), dest; this.emit("error", new Error("You cannot pipe after the response has been ended.")); } }, Request.prototype.write = function() { var self = this; if (!self._aborted) return self._started || self.start(), self.req ? self.req.write.apply(self.req, arguments) : void 0; }, Request.prototype.end = function(chunk) { this._aborted || (chunk && this.write(chunk), this._started || this.start(), this.req && this.req.end()); }, Request.prototype.pause = function() { var self = this; self.responseContent ? self.responseContent.pause.apply(self.responseContent, arguments) : self._paused = !0; }, Request.prototype.resume = function() { var self = this; self.responseContent ? self.responseContent.resume.apply(self.responseContent, arguments) : self._paused = !1; }, Request.prototype.destroy = function() { this._ended ? this.response && this.response.destroy() : this.end(); }, Request.defaultProxyHeaderWhiteList = Tunnel.defaultProxyHeaderWhiteList.slice(), Request.defaultProxyHeaderExclusiveList = Tunnel.defaultProxyHeaderExclusiveList.slice(), Request.prototype.toJSON = requestToJSON, module.exports = Request; }, function(module, exports, __webpack_require__) { var crypto = __webpack_require__(6), parse = __webpack_require__(7).parse, keys = [ "acl", "location", "logging", "notification", "partNumber", "policy", "requestPayment", "torrent", "uploadId", "uploads", "versionId", "versioning", "versions", "website" ]; function authorization(options) { return "AWS " + options.key + ":" + sign(options); } function hmacSha1(options) { return crypto.createHmac("sha1", options.secret).update(options.message).digest("base64"); } function sign(options) { return options.message = stringToSign(options), hmacSha1(options); } function stringToSign(options) { var headers = options.amazonHeaders || ""; return headers && (headers += "\n"), [ options.verb, options.md5, options.contentType, options.date ? options.date.toUTCString() : "", headers + options.resource ].join("\n"); } function queryStringToSign(options) { return "GET\n\n\n" + options.date + "\n" + options.resource; } module.exports = authorization, module.exports.authorization = authorization, module.exports.hmacSha1 = hmacSha1, module.exports.sign = sign, module.exports.signQuery = function(options) { return options.message = queryStringToSign(options), hmacSha1(options); }, module.exports.stringToSign = stringToSign, module.exports.queryStringToSign = queryStringToSign, module.exports.canonicalizeHeaders = function(headers) { for (var buf = [], fields = Object.keys(headers), i = 0, len = fields.length; i < len; ++i) { var field, val = headers[field = fields[i]]; 0 === (field = field.toLowerCase()).indexOf("x-amz") && buf.push(field + ":" + val); } return buf.sort().join("\n"); }, module.exports.canonicalizeResource = function(resource) { var url = parse(resource, !0), path = url.pathname, buf = []; return Object.keys(url.query).forEach((function(key) { if (~keys.indexOf(key)) { var val = "" == url.query[key] ? "" : "=" + encodeURIComponent(url.query[key]); buf.push(key + val); } })), path + (buf.length ? "?" + buf.sort().join("&") : ""); }; }, function(module, exports, __webpack_require__) { var aws4 = exports, url = __webpack_require__(7), querystring = __webpack_require__(24), crypto = __webpack_require__(6), credentialsCache = __webpack_require__(1135)(1e3); function hmac(key, string, encoding) { return crypto.createHmac("sha256", key).update(string, "utf8").digest(encoding); } function hash(string, encoding) { return crypto.createHash("sha256").update(string, "utf8").digest(encoding); } function encodeRfc3986(urlEncodedString) { return urlEncodedString.replace(/[!'()*]/g, (function(c) { return "%" + c.charCodeAt(0).toString(16).toUpperCase(); })); } function RequestSigner(request, credentials) { "string" == typeof request && (request = url.parse(request)); var headers = request.headers = request.headers || {}, hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host); this.request = request, this.credentials = credentials || this.defaultCredentials(), this.service = request.service || hostParts[0] || "", this.region = request.region || hostParts[1] || "us-east-1", "email" === this.service && (this.service = "ses"), !request.method && request.body && (request.method = "POST"), headers.Host || headers.host || (headers.Host = request.hostname || request.host || this.createHost(), request.port && (headers.Host += ":" + request.port)), request.hostname || request.host || (request.hostname = headers.Host || headers.host), this.isCodeCommitGit = "codecommit" === this.service && "GIT" === request.method; } RequestSigner.prototype.matchHost = function(host) { var hostParts = ((host || "").match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/) || []).slice(1, 3); return "es" === hostParts[1] && (hostParts = hostParts.reverse()), hostParts; }, RequestSigner.prototype.isSingleRegion = function() { return [ "s3", "sdb" ].indexOf(this.service) >= 0 && "us-east-1" === this.region || [ "cloudfront", "ls", "route53", "iam", "importexport", "sts" ].indexOf(this.service) >= 0; }, RequestSigner.prototype.createHost = function() { var region = this.isSingleRegion() ? "" : ("s3" === this.service && "us-east-1" !== this.region ? "-" : ".") + this.region; return ("ses" === this.service ? "email" : this.service) + region + ".amazonaws.com"; }, RequestSigner.prototype.prepareRequest = function() { this.parsePath(); var query, request = this.request, headers = request.headers; request.signQuery ? (this.parsedPath.query = query = this.parsedPath.query || {}, this.credentials.sessionToken && (query["X-Amz-Security-Token"] = this.credentials.sessionToken), "s3" !== this.service || query["X-Amz-Expires"] || (query["X-Amz-Expires"] = 86400), query["X-Amz-Date"] ? this.datetime = query["X-Amz-Date"] : query["X-Amz-Date"] = this.getDateTime(), query["X-Amz-Algorithm"] = "AWS4-HMAC-SHA256", query["X-Amz-Credential"] = this.credentials.accessKeyId + "/" + this.credentialString(), query["X-Amz-SignedHeaders"] = this.signedHeaders()) : (request.doNotModifyHeaders || this.isCodeCommitGit || (!request.body || headers["Content-Type"] || headers["content-type"] || (headers["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8"), !request.body || headers["Content-Length"] || headers["content-length"] || (headers["Content-Length"] = Buffer.byteLength(request.body)), !this.credentials.sessionToken || headers["X-Amz-Security-Token"] || headers["x-amz-security-token"] || (headers["X-Amz-Security-Token"] = this.credentials.sessionToken), "s3" !== this.service || headers["X-Amz-Content-Sha256"] || headers["x-amz-content-sha256"] || (headers["X-Amz-Content-Sha256"] = hash(this.request.body || "", "hex")), headers["X-Amz-Date"] || headers["x-amz-date"] ? this.datetime = headers["X-Amz-Date"] || headers["x-amz-date"] : headers["X-Amz-Date"] = this.getDateTime()), delete headers.Authorization, delete headers.authorization); }, RequestSigner.prototype.sign = function() { return this.parsedPath || this.prepareRequest(), this.request.signQuery ? this.parsedPath.query["X-Amz-Signature"] = this.signature() : this.request.headers.Authorization = this.authHeader(), this.request.path = this.formatPath(), this.request; }, RequestSigner.prototype.getDateTime = function() { if (!this.datetime) { var headers = this.request.headers, date = new Date(headers.Date || headers.date || new Date); this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, ""), this.isCodeCommitGit && (this.datetime = this.datetime.slice(0, -1)); } return this.datetime; }, RequestSigner.prototype.getDate = function() { return this.getDateTime().substr(0, 8); }, RequestSigner.prototype.authHeader = function() { return [ "AWS4-HMAC-SHA256 Credential=" + this.credentials.accessKeyId + "/" + this.credentialString(), "SignedHeaders=" + this.signedHeaders(), "Signature=" + this.signature() ].join(", "); }, RequestSigner.prototype.signature = function() { var kDate, kRegion, kService, date = this.getDate(), cacheKey = [ this.credentials.secretAccessKey, date, this.region, this.service ].join(), kCredentials = credentialsCache.get(cacheKey); return kCredentials || (kDate = hmac("AWS4" + this.credentials.secretAccessKey, date), kRegion = hmac(kDate, this.region), kService = hmac(kRegion, this.service), kCredentials = hmac(kService, "aws4_request"), credentialsCache.set(cacheKey, kCredentials)), hmac(kCredentials, this.stringToSign(), "hex"); }, RequestSigner.prototype.stringToSign = function() { return [ "AWS4-HMAC-SHA256", this.getDateTime(), this.credentialString(), hash(this.canonicalString(), "hex") ].join("\n"); }, RequestSigner.prototype.canonicalString = function() { this.parsedPath || this.prepareRequest(); var bodyHash, pathStr = this.parsedPath.path, query = this.parsedPath.query, headers = this.request.headers, queryStr = "", normalizePath = "s3" !== this.service, decodePath = "s3" === this.service || this.request.doNotEncodePath, decodeSlashesInPath = "s3" === this.service, firstValOnly = "s3" === this.service; return bodyHash = "s3" === this.service && this.request.signQuery ? "UNSIGNED-PAYLOAD" : this.isCodeCommitGit ? "" : headers["X-Amz-Content-Sha256"] || headers["x-amz-content-sha256"] || hash(this.request.body || "", "hex"), query && (queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce((function(obj, key) { return key ? (obj[key] = Array.isArray(query[key]) ? firstValOnly ? query[key][0] : query[key].slice().sort() : query[key], obj) : obj; }), {})))), "/" !== pathStr && (normalizePath && (pathStr = pathStr.replace(/\/{2,}/g, "/")), "/" !== (pathStr = pathStr.split("/").reduce((function(path, piece) { return normalizePath && ".." === piece ? path.pop() : normalizePath && "." === piece || (decodePath && (piece = decodeURIComponent(piece)), path.push(encodeRfc3986(encodeURIComponent(piece)))), path; }), []).join("/"))[0] && (pathStr = "/" + pathStr), decodeSlashesInPath && (pathStr = pathStr.replace(/%2F/g, "/"))), [ this.request.method || "GET", pathStr, queryStr, this.canonicalHeaders() + "\n", this.signedHeaders(), bodyHash ].join("\n"); }, RequestSigner.prototype.canonicalHeaders = function() { var headers = this.request.headers; return Object.keys(headers).sort((function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1; })).map((function(key) { return key.toLowerCase() + ":" + headers[key].toString().trim().replace(/\s+/g, " "); })).join("\n"); }, RequestSigner.prototype.signedHeaders = function() { return Object.keys(this.request.headers).map((function(key) { return key.toLowerCase(); })).sort().join(";"); }, RequestSigner.prototype.credentialString = function() { return [ this.getDate(), this.region, this.service, "aws4_request" ].join("/"); }, RequestSigner.prototype.defaultCredentials = function() { var env = process.env; return { accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, sessionToken: env.AWS_SESSION_TOKEN }; }, RequestSigner.prototype.parsePath = function() { var path = this.request.path || "/", queryIx = path.indexOf("?"), query = null; queryIx >= 0 && (query = querystring.parse(path.slice(queryIx + 1)), path = path.slice(0, queryIx)), /[^0-9A-Za-z!'()*\-._~%/]/.test(path) && (path = path.split("/").map((function(piece) { return encodeURIComponent(decodeURIComponent(piece)); })).join("/")), this.parsedPath = { path: path, query: query }; }, RequestSigner.prototype.formatPath = function() { var path = this.parsedPath.path, query = this.parsedPath.query; return query ? (null != query[""] && delete query[""], path + "?" + encodeRfc3986(querystring.stringify(query))) : path; }, aws4.RequestSigner = RequestSigner, aws4.sign = function(request, credentials) { return new RequestSigner(request, credentials).sign(); }; }, function(module, exports) { function LruCache(size) { this.capacity = 0 | size, this.map = Object.create(null), this.list = new DoublyLinkedList; } function DoublyLinkedList() { this.firstNode = null, this.lastNode = null; } function DoublyLinkedNode(key, val) { this.key = key, this.val = val, this.prev = null, this.next = null; } module.exports = function(size) { return new LruCache(size); }, LruCache.prototype.get = function(key) { var node = this.map[key]; if (null != node) return this.used(node), node.val; }, LruCache.prototype.set = function(key, val) { var node = this.map[key]; if (null != node) node.val = val; else { if (this.capacity || this.prune(), !this.capacity) return !1; node = new DoublyLinkedNode(key, val), this.map[key] = node, this.capacity--; } return this.used(node), !0; }, LruCache.prototype.used = function(node) { this.list.moveToFront(node); }, LruCache.prototype.prune = function() { var node = this.list.pop(); null != node && (delete this.map[node.key], this.capacity++); }, DoublyLinkedList.prototype.moveToFront = function(node) { this.firstNode != node && (this.remove(node), null == this.firstNode ? (this.firstNode = node, this.lastNode = node, node.prev = null, node.next = null) : (node.prev = null, node.next = this.firstNode, node.next.prev = node, this.firstNode = node)); }, DoublyLinkedList.prototype.pop = function() { var lastNode = this.lastNode; return null != lastNode && this.remove(lastNode), lastNode; }, DoublyLinkedList.prototype.remove = function(node) { this.firstNode == node ? this.firstNode = node.next : null != node.prev && (node.prev.next = node.next), this.lastNode == node ? this.lastNode = node.prev : null != node.next && (node.next.prev = node.prev); }; }, function(module, exports, __webpack_require__) { var parser = __webpack_require__(1137), signer = __webpack_require__(1145), verify = __webpack_require__(1152), utils = __webpack_require__(163); module.exports = { parse: parser.parseRequest, parseRequest: parser.parseRequest, sign: signer.signRequest, signRequest: signer.signRequest, createSigner: signer.createSigner, isSigner: signer.isSigner, sshKeyToPEM: utils.sshKeyToPEM, sshKeyFingerprint: utils.fingerprint, pemToRsaSSHKey: utils.pemToRsaSSHKey, verify: verify.verifySignature, verifySignature: verify.verifySignature, verifyHMAC: verify.verifyHMAC }; }, function(module, exports, __webpack_require__) { var assert = __webpack_require__(15), util = __webpack_require__(0), utils = __webpack_require__(163), HttpSignatureError = (utils.HASH_ALGOS, utils.PK_ALGOS, utils.HttpSignatureError), InvalidAlgorithmError = utils.InvalidAlgorithmError, validateAlgorithm = utils.validateAlgorithm; function ExpiredRequestError(message) { HttpSignatureError.call(this, message, ExpiredRequestError); } function InvalidHeaderError(message) { HttpSignatureError.call(this, message, InvalidHeaderError); } function InvalidParamsError(message) { HttpSignatureError.call(this, message, InvalidParamsError); } function MissingHeaderError(message) { HttpSignatureError.call(this, message, MissingHeaderError); } function StrictParsingError(message) { HttpSignatureError.call(this, message, StrictParsingError); } util.inherits(ExpiredRequestError, HttpSignatureError), util.inherits(InvalidHeaderError, HttpSignatureError), util.inherits(InvalidParamsError, HttpSignatureError), util.inherits(MissingHeaderError, HttpSignatureError), util.inherits(StrictParsingError, HttpSignatureError), module.exports = { parseRequest: function(request, options) { assert.object(request, "request"), assert.object(request.headers, "request.headers"), void 0 === options && (options = {}), void 0 === options.headers && (options.headers = [ request.headers["x-date"] ? "x-date" : "date" ]), assert.object(options, "options"), assert.arrayOfString(options.headers, "options.headers"), assert.optionalFinite(options.clockSkew, "options.clockSkew"); var authzHeaderName = options.authorizationHeaderName || "authorization"; if (!request.headers[authzHeaderName]) throw new MissingHeaderError("no " + authzHeaderName + " header present in the request"); options.clockSkew = options.clockSkew || 300; var date, i = 0, state = 0, substate = 0, tmpName = "", tmpValue = "", parsed = { scheme: "", params: {}, signingString: "" }, authz = request.headers[authzHeaderName]; for (i = 0; i < authz.length; i++) { var c = authz.charAt(i); switch (Number(state)) { case 0: " " !== c ? parsed.scheme += c : state = 1; break; case 1: switch (Number(substate)) { case 0: var code = c.charCodeAt(0); if (code >= 65 && code <= 90 || code >= 97 && code <= 122) tmpName += c; else { if ("=" !== c) throw new InvalidHeaderError("bad param format"); if (0 === tmpName.length) throw new InvalidHeaderError("bad param format"); substate = 1; } break; case 1: if ('"' !== c) throw new InvalidHeaderError("bad param format"); tmpValue = "", substate = 2; break; case 2: '"' === c ? (parsed.params[tmpName] = tmpValue, substate = 3) : tmpValue += c; break; case 3: if ("," !== c) throw new InvalidHeaderError("bad param format"); tmpName = "", substate = 0; break; default: throw new Error("Invalid substate"); } break; default: throw new Error("Invalid substate"); } } if (parsed.params.headers && "" !== parsed.params.headers ? parsed.params.headers = parsed.params.headers.split(" ") : request.headers["x-date"] ? parsed.params.headers = [ "x-date" ] : parsed.params.headers = [ "date" ], !parsed.scheme || "Signature" !== parsed.scheme) throw new InvalidHeaderError('scheme was not "Signature"'); if (!parsed.params.keyId) throw new InvalidHeaderError("keyId was not specified"); if (!parsed.params.algorithm) throw new InvalidHeaderError("algorithm was not specified"); if (!parsed.params.signature) throw new InvalidHeaderError("signature was not specified"); parsed.params.algorithm = parsed.params.algorithm.toLowerCase(); try { validateAlgorithm(parsed.params.algorithm); } catch (e) { throw e instanceof InvalidAlgorithmError ? new InvalidParamsError(parsed.params.algorithm + " is not supported") : e; } for (i = 0; i < parsed.params.headers.length; i++) { var h = parsed.params.headers[i].toLowerCase(); if (parsed.params.headers[i] = h, "request-line" === h) { if (options.strict) throw new StrictParsingError("request-line is not a valid header with strict parsing enabled."); parsed.signingString += request.method + " " + request.url + " HTTP/" + request.httpVersion; } else if ("(request-target)" === h) parsed.signingString += "(request-target): " + request.method.toLowerCase() + " " + request.url; else { var value = request.headers[h]; if (void 0 === value) throw new MissingHeaderError(h + " was not in the request"); parsed.signingString += h + ": " + value; } i + 1 < parsed.params.headers.length && (parsed.signingString += "\n"); } if (request.headers.date || request.headers["x-date"]) { date = request.headers["x-date"] ? new Date(request.headers["x-date"]) : new Date(request.headers.date); var now = new Date, skew = Math.abs(now.getTime() - date.getTime()); if (skew > 1e3 * options.clockSkew) throw new ExpiredRequestError("clock skew of " + skew / 1e3 + "s was greater than " + options.clockSkew + "s"); } if (options.headers.forEach((function(hdr) { if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0) throw new MissingHeaderError(hdr + " was not a signed header"); })), options.algorithms && -1 === options.algorithms.indexOf(parsed.params.algorithm)) throw new InvalidParamsError(parsed.params.algorithm + " is not a supported algorithm"); return parsed.algorithm = parsed.params.algorithm.toUpperCase(), parsed.keyId = parsed.params.keyId, parsed; } }; }, function(module, exports, __webpack_require__) { var errors = __webpack_require__(262), types = __webpack_require__(263), Reader = __webpack_require__(1139), Writer = __webpack_require__(1140); for (var t in module.exports = { Reader: Reader, Writer: Writer }, types) types.hasOwnProperty(t) && (module.exports[t] = types[t]); for (var e in errors) errors.hasOwnProperty(e) && (module.exports[e] = errors[e]); }, function(module, exports, __webpack_require__) { var assert = __webpack_require__(25), Buffer = __webpack_require__(14).Buffer, ASN1 = __webpack_require__(263), newInvalidAsn1Error = __webpack_require__(262).newInvalidAsn1Error; function Reader(data) { if (!data || !Buffer.isBuffer(data)) throw new TypeError("data must be a node Buffer"); this._buf = data, this._size = data.length, this._len = 0, this._offset = 0; } Object.defineProperty(Reader.prototype, "length", { enumerable: !0, get: function() { return this._len; } }), Object.defineProperty(Reader.prototype, "offset", { enumerable: !0, get: function() { return this._offset; } }), Object.defineProperty(Reader.prototype, "remain", { get: function() { return this._size - this._offset; } }), Object.defineProperty(Reader.prototype, "buffer", { get: function() { return this._buf.slice(this._offset); } }), Reader.prototype.readByte = function(peek) { if (this._size - this._offset < 1) return null; var b = 255 & this._buf[this._offset]; return peek || (this._offset += 1), b; }, Reader.prototype.peek = function() { return this.readByte(!0); }, Reader.prototype.readLength = function(offset) { if (void 0 === offset && (offset = this._offset), offset >= this._size) return null; var lenB = 255 & this._buf[offset++]; if (null === lenB) return null; if (128 == (128 & lenB)) { if (0 == (lenB &= 127)) throw newInvalidAsn1Error("Indefinite length not supported"); if (lenB > 4) throw newInvalidAsn1Error("encoding too long"); if (this._size - offset < lenB) return null; this._len = 0; for (var i = 0; i < lenB; i++) this._len = (this._len << 8) + (255 & this._buf[offset++]); } else this._len = lenB; return offset; }, Reader.prototype.readSequence = function(tag) { var seq = this.peek(); if (null === seq) return null; if (void 0 !== tag && tag !== seq) throw newInvalidAsn1Error("Expected 0x" + tag.toString(16) + ": got 0x" + seq.toString(16)); var o = this.readLength(this._offset + 1); return null === o ? null : (this._offset = o, seq); }, Reader.prototype.readInt = function() { return this._readTag(ASN1.Integer); }, Reader.prototype.readBoolean = function() { return 0 !== this._readTag(ASN1.Boolean); }, Reader.prototype.readEnumeration = function() { return this._readTag(ASN1.Enumeration); }, Reader.prototype.readString = function(tag, retbuf) { tag || (tag = ASN1.OctetString); var b = this.peek(); if (null === b) return null; if (b !== tag) throw newInvalidAsn1Error("Expected 0x" + tag.toString(16) + ": got 0x" + b.toString(16)); var o = this.readLength(this._offset + 1); if (null === o) return null; if (this.length > this._size - o) return null; if (this._offset = o, 0 === this.length) return retbuf ? Buffer.alloc(0) : ""; var str = this._buf.slice(this._offset, this._offset + this.length); return this._offset += this.length, retbuf ? str : str.toString("utf8"); }, Reader.prototype.readOID = function(tag) { tag || (tag = ASN1.OID); var b = this.readString(tag, !0); if (null === b) return null; for (var values = [], value = 0, i = 0; i < b.length; i++) { var byte = 255 & b[i]; value <<= 7, value += 127 & byte, 0 == (128 & byte) && (values.push(value), value = 0); } return value = values.shift(), values.unshift(value % 40), values.unshift(value / 40 >> 0), values.join("."); }, Reader.prototype._readTag = function(tag) { assert.ok(void 0 !== tag); var b = this.peek(); if (null === b) return null; if (b !== tag) throw newInvalidAsn1Error("Expected 0x" + tag.toString(16) + ": got 0x" + b.toString(16)); var o = this.readLength(this._offset + 1); if (null === o) return null; if (this.length > 4) throw newInvalidAsn1Error("Integer too long: " + this.length); if (this.length > this._size - o) return null; this._offset = o; for (var fb = this._buf[this._offset], value = 0, i = 0; i < this.length; i++) value <<= 8, value |= 255 & this._buf[this._offset++]; return 128 == (128 & fb) && 4 !== i && (value -= 1 << 8 * i), value >> 0; }, module.exports = Reader; }, function(module, exports, __webpack_require__) { var assert = __webpack_require__(25), Buffer = __webpack_require__(14).Buffer, ASN1 = __webpack_require__(263), newInvalidAsn1Error = __webpack_require__(262).newInvalidAsn1Error, DEFAULT_OPTS = { size: 1024, growthFactor: 8 }; function Writer(options) { var from, to; from = DEFAULT_OPTS, to = options || {}, assert.ok(from), assert.equal(typeof from, "object"), assert.ok(to), assert.equal(typeof to, "object"), Object.getOwnPropertyNames(from).forEach((function(key) { if (!to[key]) { var value = Object.getOwnPropertyDescriptor(from, key); Object.defineProperty(to, key, value); } })), options = to, this._buf = Buffer.alloc(options.size || 1024), this._size = this._buf.length, this._offset = 0, this._options = options, this._seq = []; } Object.defineProperty(Writer.prototype, "buffer", { get: function() { if (this._seq.length) throw newInvalidAsn1Error(this._seq.length + " unended sequence(s)"); return this._buf.slice(0, this._offset); } }), Writer.prototype.writeByte = function(b) { if ("number" != typeof b) throw new TypeError("argument must be a Number"); this._ensure(1), this._buf[this._offset++] = b; }, Writer.prototype.writeInt = function(i, tag) { if ("number" != typeof i) throw new TypeError("argument must be a Number"); "number" != typeof tag && (tag = ASN1.Integer); for (var sz = 4; (0 == (4286578688 & i) || -8388608 == (4286578688 & i)) && sz > 1; ) sz--, i <<= 8; if (sz > 4) throw newInvalidAsn1Error("BER ints cannot be > 0xffffffff"); for (this._ensure(2 + sz), this._buf[this._offset++] = tag, this._buf[this._offset++] = sz; sz-- > 0; ) this._buf[this._offset++] = (4278190080 & i) >>> 24, i <<= 8; }, Writer.prototype.writeNull = function() { this.writeByte(ASN1.Null), this.writeByte(0); }, Writer.prototype.writeEnumeration = function(i, tag) { if ("number" != typeof i) throw new TypeError("argument must be a Number"); return "number" != typeof tag && (tag = ASN1.Enumeration), this.writeInt(i, tag); }, Writer.prototype.writeBoolean = function(b, tag) { if ("boolean" != typeof b) throw new TypeError("argument must be a Boolean"); "number" != typeof tag && (tag = ASN1.Boolean), this._ensure(3), this._buf[this._offset++] = tag, this._buf[this._offset++] = 1, this._buf[this._offset++] = b ? 255 : 0; }, Writer.prototype.writeString = function(s, tag) { if ("string" != typeof s) throw new TypeError("argument must be a string (was: " + typeof s + ")"); "number" != typeof tag && (tag = ASN1.OctetString); var len = Buffer.byteLength(s); this.writeByte(tag), this.writeLength(len), len && (this._ensure(len), this._buf.write(s, this._offset), this._offset += len); }, Writer.prototype.writeBuffer = function(buf, tag) { if ("number" != typeof tag) throw new TypeError("tag must be a number"); if (!Buffer.isBuffer(buf)) throw new TypeError("argument must be a buffer"); this.writeByte(tag), this.writeLength(buf.length), this._ensure(buf.length), buf.copy(this._buf, this._offset, 0, buf.length), this._offset += buf.length; }, Writer.prototype.writeStringArray = function(strings) { if (!strings instanceof Array) throw new TypeError("argument must be an Array[String]"); var self = this; strings.forEach((function(s) { self.writeString(s); })); }, Writer.prototype.writeOID = function(s, tag) { if ("string" != typeof s) throw new TypeError("argument must be a string"); if ("number" != typeof tag && (tag = ASN1.OID), !/^([0-9]+\.){3,}[0-9]+$/.test(s)) throw new Error("argument is not a valid OID string"); var tmp = s.split("."), bytes = []; bytes.push(40 * parseInt(tmp[0], 10) + parseInt(tmp[1], 10)), tmp.slice(2).forEach((function(b) { !(function(bytes, octet) { octet < 128 ? bytes.push(octet) : octet < 16384 ? (bytes.push(octet >>> 7 | 128), bytes.push(127 & octet)) : octet < 2097152 ? (bytes.push(octet >>> 14 | 128), bytes.push(255 & (octet >>> 7 | 128)), bytes.push(127 & octet)) : octet < 268435456 ? (bytes.push(octet >>> 21 | 128), bytes.push(255 & (octet >>> 14 | 128)), bytes.push(255 & (octet >>> 7 | 128)), bytes.push(127 & octet)) : (bytes.push(255 & (octet >>> 28 | 128)), bytes.push(255 & (octet >>> 21 | 128)), bytes.push(255 & (octet >>> 14 | 128)), bytes.push(255 & (octet >>> 7 | 128)), bytes.push(127 & octet)); })(bytes, parseInt(b, 10)); })); var self = this; this._ensure(2 + bytes.length), this.writeByte(tag), this.writeLength(bytes.length), bytes.forEach((function(b) { self.writeByte(b); })); }, Writer.prototype.writeLength = function(len) { if ("number" != typeof len) throw new TypeError("argument must be a Number"); if (this._ensure(4), len <= 127) this._buf[this._offset++] = len; else if (len <= 255) this._buf[this._offset++] = 129, this._buf[this._offset++] = len; else if (len <= 65535) this._buf[this._offset++] = 130, this._buf[this._offset++] = len >> 8, this._buf[this._offset++] = len; else { if (!(len <= 16777215)) throw newInvalidAsn1Error("Length too long (> 4 bytes)"); this._buf[this._offset++] = 131, this._buf[this._offset++] = len >> 16, this._buf[this._offset++] = len >> 8, this._buf[this._offset++] = len; } }, Writer.prototype.startSequence = function(tag) { "number" != typeof tag && (tag = ASN1.Sequence | ASN1.Constructor), this.writeByte(tag), this._seq.push(this._offset), this._ensure(3), this._offset += 3; }, Writer.prototype.endSequence = function() { var seq = this._seq.pop(), start = seq + 3, len = this._offset - start; if (len <= 127) this._shift(start, len, -2), this._buf[seq] = len; else if (len <= 255) this._shift(start, len, -1), this._buf[seq] = 129, this._buf[seq + 1] = len; else if (len <= 65535) this._buf[seq] = 130, this._buf[seq + 1] = len >> 8, this._buf[seq + 2] = len; else { if (!(len <= 16777215)) throw newInvalidAsn1Error("Sequence too long"); this._shift(start, len, 1), this._buf[seq] = 131, this._buf[seq + 1] = len >> 16, this._buf[seq + 2] = len >> 8, this._buf[seq + 3] = len; } }, Writer.prototype._shift = function(start, len, shift) { assert.ok(void 0 !== start), assert.ok(void 0 !== len), assert.ok(shift), this._buf.copy(this._buf, start + shift, start, start + len), this._offset += shift; }, Writer.prototype._ensure = function(len) { if (assert.ok(len), this._size - this._offset < len) { var sz = this._size * this._options.growthFactor; sz - this._offset < len && (sz += len); var buf = Buffer.alloc(sz); this._buf.copy(buf, 0, 0, this._offset), this._buf = buf, this._size = sz; } }, module.exports = Writer; }, function(module, exports, __webpack_require__) { var crypto = __webpack_require__(6), BigInteger = __webpack_require__(110).BigInteger, Buffer = (__webpack_require__(164).ECPointFp, __webpack_require__(14).Buffer); function unstupid(hex, len) { return hex.length >= len ? hex : unstupid("0" + hex, len); } exports.ECCurves = __webpack_require__(1142), exports.ECKey = function(curve, key, isPublic) { var priv, c = curve(), n = c.getN(), bytes = Math.floor(n.bitLength() / 8); if (key) if (isPublic) curve = c.getCurve(), this.P = curve.decodePointHex(key.toString("hex")); else { if (key.length != bytes) return !1; priv = new BigInteger(key.toString("hex"), 16); } else { var n1 = n.subtract(BigInteger.ONE), r = new BigInteger(crypto.randomBytes(n.bitLength())); priv = r.mod(n1).add(BigInteger.ONE), this.P = c.getG().multiply(priv); } this.P && (this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P), "hex")), priv && (this.PrivateKey = Buffer.from(unstupid(priv.toString(16), 2 * bytes), "hex"), this.deriveSharedSecret = function(key) { if (!key || !key.P) return !1; var S = key.P.multiply(priv); return Buffer.from(unstupid(S.getX().toBigInteger().toString(16), 2 * bytes), "hex"); }); }; }, function(module, exports, __webpack_require__) { var BigInteger = __webpack_require__(110).BigInteger, ECCurveFp = __webpack_require__(164).ECCurveFp; function X9ECParameters(curve, g, n, h) { this.curve = curve, this.g = g, this.n = n, this.h = h; } function fromHex(s) { return new BigInteger(s, 16); } X9ECParameters.prototype.getCurve = function() { return this.curve; }, X9ECParameters.prototype.getG = function() { return this.g; }, X9ECParameters.prototype.getN = function() { return this.n; }, X9ECParameters.prototype.getH = function() { return this.h; }, module.exports = { secp128r1: function() { var p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"), a = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"), b = fromHex("E87579C11079F43DD824993C2CEE5ED3"), n = fromHex("FFFFFFFE0000000075A30D1B9038A115"), h = BigInteger.ONE, curve = new ECCurveFp(p, a, b), G = curve.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"); return new X9ECParameters(curve, G, n, h); }, secp160k1: function() { var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"), a = BigInteger.ZERO, b = fromHex("7"), n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"), h = BigInteger.ONE, curve = new ECCurveFp(p, a, b), G = curve.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"); return new X9ECParameters(curve, G, n, h); }, secp160r1: function() { var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"), a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"), b = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"), n = fromHex("0100000000000000000001F4C8F927AED3CA752257"), h = BigInteger.ONE, curve = new ECCurveFp(p, a, b), G = curve.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"); return new X9ECParameters(curve, G, n, h); }, secp192k1: function() { var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"), a = BigInteger.ZERO, b = fromHex("3"), n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"), h = BigInteger.ONE, curve = new ECCurveFp(p, a, b), G = curve.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"); return new X9ECParameters(curve, G, n, h); }, secp192r1: function() { var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"), a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"), b = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"), n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"), h = BigInteger.ONE, curve = new ECCurveFp(p, a, b), G = curve.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"); return new X9ECParameters(curve, G, n, h); }, secp224r1: function() { var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"), a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"), b = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"), n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"), h = BigInteger.ONE, curve = new ECCurveFp(p, a, b), G = curve.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"); return new X9ECParameters(curve, G, n, h); }, secp256r1: function() { var p = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"), a = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"), b = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"), n = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"), h = BigInteger.ONE, curve = new ECCurveFp(p, a, b), G = curve.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"); return new X9ECParameters(curve, G, n, h); } }; }, function(module, exports, __webpack_require__) { module.exports = { read: function(buf, options) { Buffer.isBuffer(buf) && (buf = buf.toString("ascii")); var parts = buf.trim().split(/[ \t\n]+/g); if (parts.length < 2 || parts.length > 3) throw new Error("Not a valid SSH certificate line"); var algo = parts[0], data = parts[1]; return fromBuffer(data = Buffer.from(data, "base64"), algo); }, verify: function(cert, key) { return !1; }, sign: function(cert, key) { void 0 === cert.signatures.openssh && (cert.signatures.openssh = {}); try { var blob = toBuffer(cert, !0); } catch (e) { return delete cert.signatures.openssh, !1; } var sig = cert.signatures.openssh, hashAlgo = void 0; "rsa" !== key.type && "dsa" !== key.type || (hashAlgo = "sha1"); var signer = key.createSign(hashAlgo); return signer.write(blob), sig.signature = signer.sign(), !0; }, signAsync: function(cert, signer, done) { void 0 === cert.signatures.openssh && (cert.signatures.openssh = {}); try { var blob = toBuffer(cert, !0); } catch (e) { return delete cert.signatures.openssh, void done(e); } var sig = cert.signatures.openssh; signer(blob, (function(err, signature) { if (err) done(err); else { try { signature.toBuffer("ssh"); } catch (e) { return void done(e); } sig.signature = signature, done(); } })); }, write: function(cert, options) { void 0 === options && (options = {}); var blob = toBuffer(cert), out = getCertType(cert.subjectKey) + " " + blob.toString("base64"); return options.comment && (out = out + " " + options.comment), out; }, fromBuffer: fromBuffer, toBuffer: toBuffer }; var assert = __webpack_require__(15), SSHBuffer = __webpack_require__(112), crypto = __webpack_require__(6), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(31), Key = __webpack_require__(27), Identity = (__webpack_require__(29), __webpack_require__(115)), rfc4253 = __webpack_require__(63), Signature = __webpack_require__(53), utils = __webpack_require__(28), Certificate = __webpack_require__(114), TYPES = { user: 1, host: 2 }; Object.keys(TYPES).forEach((function(k) { TYPES[TYPES[k]] = k; })); var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/; function fromBuffer(data, algo, partial) { var sshbuf = new SSHBuffer({ buffer: data }), innerAlgo = sshbuf.readString(); if (void 0 !== algo && innerAlgo !== algo) throw new Error("SSH certificate algorithm mismatch"); void 0 === algo && (algo = innerAlgo); var cert = { signatures: {} }; cert.signatures.openssh = {}, cert.signatures.openssh.nonce = sshbuf.readBuffer(); var key = {}, parts = key.parts = []; key.type = (function(certType) { if ("ssh-rsa-cert-v01@openssh.com" === certType) return "rsa"; if ("ssh-dss-cert-v01@openssh.com" === certType) return "dsa"; if (certType.match(ECDSA_ALGO)) return "ecdsa"; if ("ssh-ed25519-cert-v01@openssh.com" === certType) return "ed25519"; throw new Error("Unsupported cert type " + certType); })(algo); for (var partCount = algs.info[key.type].parts.length; parts.length < partCount; ) parts.push(sshbuf.readPart()); assert.ok(parts.length >= 1, "key must have at least one part"); var algInfo = algs.info[key.type]; if ("ecdsa" === key.type) { var res = ECDSA_ALGO.exec(algo); assert.ok(null !== res), assert.strictEqual(res[1], parts[0].data.toString()); } for (var i = 0; i < algInfo.parts.length; ++i) if (parts[i].name = algInfo.parts[i], "curve" !== parts[i].name && !1 !== algInfo.normalize) { var p = parts[i]; p.data = utils.mpNormalize(p.data); } cert.subjectKey = new Key(key), cert.serial = sshbuf.readInt64(); var type = TYPES[sshbuf.readInt()]; assert.string(type, "valid cert type"), cert.signatures.openssh.keyId = sshbuf.readString(); for (var principals = [], pbuf = sshbuf.readBuffer(), psshbuf = new SSHBuffer({ buffer: pbuf }); !psshbuf.atEnd(); ) principals.push(psshbuf.readString()); 0 === principals.length && (principals = [ "*" ]), cert.subjects = principals.map((function(pr) { if ("user" === type) return Identity.forUser(pr); if ("host" === type) return Identity.forHost(pr); throw new Error("Unknown identity type " + type); })), cert.validFrom = int64ToDate(sshbuf.readInt64()), cert.validUntil = int64ToDate(sshbuf.readInt64()); for (var ext, exts = [], extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); !extbuf.atEnd(); ) (ext = { critical: !0 }).name = extbuf.readString(), ext.data = extbuf.readBuffer(), exts.push(ext); for (extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); !extbuf.atEnd(); ) (ext = { critical: !1 }).name = extbuf.readString(), ext.data = extbuf.readBuffer(), exts.push(ext); cert.signatures.openssh.exts = exts, sshbuf.readBuffer(); var signingKeyBuf = sshbuf.readBuffer(); cert.issuerKey = rfc4253.read(signingKeyBuf), cert.issuer = Identity.forHost("**"); var sigBuf = sshbuf.readBuffer(); return cert.signatures.openssh.signature = Signature.parse(sigBuf, cert.issuerKey.type, "ssh"), void 0 !== partial && (partial.remainder = sshbuf.remainder(), partial.consumed = sshbuf._offset), new Certificate(cert); } function int64ToDate(buf) { var i = 4294967296 * buf.readUInt32BE(0); i += buf.readUInt32BE(4); var d = new Date; return d.setTime(1e3 * i), d.sourceInt64 = buf, d; } function dateToInt64(date) { if (void 0 !== date.sourceInt64) return date.sourceInt64; var i = Math.round(date.getTime() / 1e3), upper = Math.floor(i / 4294967296), lower = Math.floor(i % 4294967296), buf = Buffer.alloc(8); return buf.writeUInt32BE(upper, 0), buf.writeUInt32BE(lower, 4), buf; } function toBuffer(cert, noSig) { assert.object(cert.signatures.openssh, "signature for openssh format"); var sig = cert.signatures.openssh; void 0 === sig.nonce && (sig.nonce = crypto.randomBytes(16)); var buf = new SSHBuffer({}); buf.writeString(getCertType(cert.subjectKey)), buf.writeBuffer(sig.nonce); var key = cert.subjectKey; algs.info[key.type].parts.forEach((function(part) { buf.writePart(key.part[part]); })), buf.writeInt64(cert.serial); var type = cert.subjects[0].type; assert.notStrictEqual(type, "unknown"), cert.subjects.forEach((function(id) { assert.strictEqual(id.type, type); })), type = TYPES[type], buf.writeInt(type), void 0 === sig.keyId && (sig.keyId = cert.subjects[0].type + "_" + (cert.subjects[0].uid || cert.subjects[0].hostname)), buf.writeString(sig.keyId); var sub = new SSHBuffer({}); cert.subjects.forEach((function(id) { type === TYPES.host ? sub.writeString(id.hostname) : type === TYPES.user && sub.writeString(id.uid); })), buf.writeBuffer(sub.toBuffer()), buf.writeInt64(dateToInt64(cert.validFrom)), buf.writeInt64(dateToInt64(cert.validUntil)); var exts = sig.exts; void 0 === exts && (exts = []); var extbuf = new SSHBuffer({}); return exts.forEach((function(ext) { !0 === ext.critical && (extbuf.writeString(ext.name), extbuf.writeBuffer(ext.data)); })), buf.writeBuffer(extbuf.toBuffer()), extbuf = new SSHBuffer({}), exts.forEach((function(ext) { !0 !== ext.critical && (extbuf.writeString(ext.name), extbuf.writeBuffer(ext.data)); })), buf.writeBuffer(extbuf.toBuffer()), buf.writeBuffer(Buffer.alloc(0)), sub = rfc4253.write(cert.issuerKey), buf.writeBuffer(sub), noSig || buf.writeBuffer(sig.signature.toBuffer("ssh")), buf.toBuffer(); } function getCertType(key) { if ("rsa" === key.type) return "ssh-rsa-cert-v01@openssh.com"; if ("dsa" === key.type) return "ssh-dss-cert-v01@openssh.com"; if ("ecdsa" === key.type) return "ecdsa-sha2-" + key.curve + "-cert-v01@openssh.com"; if ("ed25519" === key.type) return "ssh-ed25519-cert-v01@openssh.com"; throw new Error("Unsupported key type " + key.type); } }, function(module, exports, __webpack_require__) { var x509 = __webpack_require__(526); module.exports = { read: function(buf, options) { "string" != typeof buf && (assert.buffer(buf, "buf"), buf = buf.toString("ascii")); for (var m, m2, lines = buf.trim().split(/[\r\n]+/g), si = -1; !m && si < lines.length; ) m = lines[++si].match(/[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); assert.ok(m, "invalid PEM header"); for (var ei = lines.length; !m2 && ei > 0; ) m2 = lines[--ei].match(/[-]+[ ]*END CERTIFICATE[ ]*[-]+/); assert.ok(m2, "invalid PEM footer"), lines = lines.slice(si, ei + 1); for (var headers = {}; m = (lines = lines.slice(1))[0].match(/^([A-Za-z0-9-]+): (.+)$/); ) headers[m[1].toLowerCase()] = m[2]; return lines = lines.slice(0, -1).join(""), buf = Buffer.from(lines, "base64"), x509.read(buf, options); }, verify: x509.verify, sign: x509.sign, write: function(cert, options) { var tmp = x509.write(cert, options).toString("base64"), len = tmp.length + tmp.length / 64 + 18 + 16 + 2 * "CERTIFICATE".length + 10, buf = Buffer.alloc(len), o = 0; o += buf.write("-----BEGIN CERTIFICATE-----\n", o); for (var i = 0; i < tmp.length; ) { var limit = i + 64; limit > tmp.length && (limit = tmp.length), o += buf.write(tmp.slice(i, limit), o), buf[o++] = 10, i = limit; } return o += buf.write("-----END CERTIFICATE-----\n", o), buf.slice(0, o); } }; var assert = __webpack_require__(15), Buffer = (__webpack_require__(54), __webpack_require__(14).Buffer); __webpack_require__(31), __webpack_require__(28), __webpack_require__(27), __webpack_require__(29), __webpack_require__(62), __webpack_require__(115), __webpack_require__(53), __webpack_require__(114); }, function(module, exports, __webpack_require__) { var assert = __webpack_require__(15), crypto = __webpack_require__(6), util = (__webpack_require__(11), __webpack_require__(0)), sshpk = __webpack_require__(261), jsprim = __webpack_require__(1146), utils = __webpack_require__(163), sprintf = __webpack_require__(0).format, HASH_ALGOS = utils.HASH_ALGOS, PK_ALGOS = utils.PK_ALGOS, InvalidAlgorithmError = utils.InvalidAlgorithmError, HttpSignatureError = utils.HttpSignatureError, validateAlgorithm = utils.validateAlgorithm, AUTHZ_FMT = 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"'; function MissingHeaderError(message) { HttpSignatureError.call(this, message, MissingHeaderError); } function StrictParsingError(message) { HttpSignatureError.call(this, message, StrictParsingError); } function RequestSigner(options) { assert.object(options, "options"); var alg = []; if (void 0 !== options.algorithm && (assert.string(options.algorithm, "options.algorithm"), alg = validateAlgorithm(options.algorithm)), this.rs_alg = alg, void 0 !== options.sign) assert.func(options.sign, "options.sign"), this.rs_signFunc = options.sign; else if ("hmac" === alg[0] && void 0 !== options.key) { if (assert.string(options.keyId, "options.keyId"), this.rs_keyId = options.keyId, "string" != typeof options.key && !Buffer.isBuffer(options.key)) throw new TypeError("options.key for HMAC must be a string or Buffer"); this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key), this.rs_signer.sign = function() { var digest = this.digest("base64"); return { hashAlgorithm: alg[1], toString: function() { return digest; } }; }; } else { if (void 0 === options.key) throw new TypeError("options.sign (func) or options.key is required"); var key = options.key; if (("string" == typeof key || Buffer.isBuffer(key)) && (key = sshpk.parsePrivateKey(key)), assert.ok(sshpk.PrivateKey.isPrivateKey(key, [ 1, 2 ]), "options.key must be a sshpk.PrivateKey"), this.rs_key = key, assert.string(options.keyId, "options.keyId"), this.rs_keyId = options.keyId, !PK_ALGOS[key.type]) throw new InvalidAlgorithmError(key.type.toUpperCase() + " type keys are not supported"); if (void 0 !== alg[0] && key.type !== alg[0]) throw new InvalidAlgorithmError("options.key must be a " + alg[0].toUpperCase() + " key, was given a " + key.type.toUpperCase() + " key instead"); this.rs_signer = key.createSign(alg[1]); } this.rs_headers = [], this.rs_lines = []; } util.inherits(MissingHeaderError, HttpSignatureError), util.inherits(StrictParsingError, HttpSignatureError), RequestSigner.prototype.writeHeader = function(header, value) { if (assert.string(header, "header"), header = header.toLowerCase(), assert.string(value, "value"), this.rs_headers.push(header), this.rs_signFunc) this.rs_lines.push(header + ": " + value); else { var line = header + ": " + value; this.rs_headers.length > 0 && (line = "\n" + line), this.rs_signer.update(line); } return value; }, RequestSigner.prototype.writeDateHeader = function() { return this.writeHeader("date", jsprim.rfc1123(new Date)); }, RequestSigner.prototype.writeTarget = function(method, path) { assert.string(method, "method"), assert.string(path, "path"), method = method.toLowerCase(), this.writeHeader("(request-target)", method + " " + path); }, RequestSigner.prototype.sign = function(cb) { if (assert.func(cb, "callback"), this.rs_headers.length < 1) throw new Error("At least one header must be signed"); var alg, authz; if (this.rs_signFunc) { var data = this.rs_lines.join("\n"), self = this; this.rs_signFunc(data, (function(err, sig) { if (err) cb(err); else { try { assert.object(sig, "signature"), assert.string(sig.keyId, "signature.keyId"), assert.string(sig.algorithm, "signature.algorithm"), assert.string(sig.signature, "signature.signature"), alg = validateAlgorithm(sig.algorithm), authz = sprintf(AUTHZ_FMT, sig.keyId, sig.algorithm, self.rs_headers.join(" "), sig.signature); } catch (e) { return void cb(e); } cb(null, authz); } })); } else { try { var sigObj = this.rs_signer.sign(); } catch (e) { return void cb(e); } alg = (this.rs_alg[0] || this.rs_key.type) + "-" + sigObj.hashAlgorithm; var signature = sigObj.toString(); authz = sprintf(AUTHZ_FMT, this.rs_keyId, alg, this.rs_headers.join(" "), signature), cb(null, authz); } }, module.exports = { isSigner: function(obj) { return "object" == typeof obj && obj instanceof RequestSigner; }, createSigner: function(options) { return new RequestSigner(options); }, signRequest: function(request, options) { assert.object(request, "request"), assert.object(options, "options"), assert.optionalString(options.algorithm, "options.algorithm"), assert.string(options.keyId, "options.keyId"), assert.optionalArrayOfString(options.headers, "options.headers"), assert.optionalString(options.httpVersion, "options.httpVersion"), request.getHeader("Date") || request.setHeader("Date", jsprim.rfc1123(new Date)), options.headers || (options.headers = [ "date" ]), options.httpVersion || (options.httpVersion = "1.1"); var i, alg = []; options.algorithm && (options.algorithm = options.algorithm.toLowerCase(), alg = validateAlgorithm(options.algorithm)); var signature, stringToSign = ""; for (i = 0; i < options.headers.length; i++) { if ("string" != typeof options.headers[i]) throw new TypeError("options.headers must be an array of Strings"); var h = options.headers[i].toLowerCase(); if ("request-line" === h) { if (options.strict) throw new StrictParsingError("request-line is not a valid header with strict parsing enabled."); stringToSign += request.method + " " + request.path + " HTTP/" + options.httpVersion; } else if ("(request-target)" === h) stringToSign += "(request-target): " + request.method.toLowerCase() + " " + request.path; else { var value = request.getHeader(h); if (void 0 === value || "" === value) throw new MissingHeaderError(h + " was not in the request"); stringToSign += h + ": " + value; } i + 1 < options.headers.length && (stringToSign += "\n"); } if (request.hasOwnProperty("_stringToSign") && (request._stringToSign = stringToSign), "hmac" === alg[0]) { if ("string" != typeof options.key && !Buffer.isBuffer(options.key)) throw new TypeError("options.key must be a string or Buffer"); var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key); hmac.update(stringToSign), signature = hmac.digest("base64"); } else { var key = options.key; if (("string" == typeof key || Buffer.isBuffer(key)) && (key = sshpk.parsePrivateKey(options.key)), assert.ok(sshpk.PrivateKey.isPrivateKey(key, [ 1, 2 ]), "options.key must be a sshpk.PrivateKey"), !PK_ALGOS[key.type]) throw new InvalidAlgorithmError(key.type.toUpperCase() + " type keys are not supported"); if (void 0 !== alg[0] && key.type !== alg[0]) throw new InvalidAlgorithmError("options.key must be a " + alg[0].toUpperCase() + " key, was given a " + key.type.toUpperCase() + " key instead"); var signer = key.createSign(alg[1]); signer.update(stringToSign); var sigObj = signer.sign(); if (!HASH_ALGOS[sigObj.hashAlgorithm]) throw new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() + " is not a supported hash algorithm"); options.algorithm = key.type + "-" + sigObj.hashAlgorithm, signature = sigObj.toString(), assert.notStrictEqual(signature, "", "empty signature produced"); } var authzHeaderName = options.authorizationHeaderName || "Authorization"; return request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT, options.keyId, options.algorithm, options.headers.join(" "), signature)), !0; } }; }, function(module, exports, __webpack_require__) { var mod_assert = __webpack_require__(15), mod_extsprintf = (__webpack_require__(0), __webpack_require__(1147)), mod_verror = __webpack_require__(1148), mod_jsonschema = __webpack_require__(1151); function hasKey(obj, key) { return mod_assert.equal(typeof key, "string"), Object.prototype.hasOwnProperty.call(obj, key); } function pluckv(obj, key) { if (null !== obj && "object" == typeof obj) { if (obj.hasOwnProperty(key)) return obj[key]; var i = key.indexOf("."); if (-1 != i) { var key1 = key.substr(0, i); if (obj.hasOwnProperty(key1)) return pluckv(obj[key1], key.substr(i + 1)); } } } function doFlattenIter(data, depth, accum, callback) { var each, key; if (0 === depth) return (each = accum.slice(0)).push(data), void callback(each); for (key in mod_assert.ok(null !== data), mod_assert.equal(typeof data, "object"), mod_assert.equal(typeof depth, "number"), mod_assert.ok(depth >= 0), data) (each = accum.slice(0)).push(key), doFlattenIter(data[key], depth - 1, each, callback); } exports.deepCopy = function deepCopy(obj) { var ret, key, marker = "__deepCopy"; if (obj && obj[marker]) throw new Error("attempted deep copy of cyclic object"); if (obj && obj.constructor == Object) { for (key in ret = {}, obj[marker] = !0, obj) key != marker && (ret[key] = deepCopy(obj[key])); return delete obj[marker], ret; } if (obj && obj.constructor == Array) { for (ret = [], obj[marker] = !0, key = 0; key < obj.length; key++) ret.push(deepCopy(obj[key])); return delete obj[marker], ret; } return obj; }, exports.deepEqual = function deepEqual(obj1, obj2) { if (typeof obj1 != typeof obj2) return !1; if (null === obj1 || null === obj2 || "object" != typeof obj1) return obj1 === obj2; if (obj1.constructor != obj2.constructor) return !1; var k; for (k in obj1) { if (!obj2.hasOwnProperty(k)) return !1; if (!deepEqual(obj1[k], obj2[k])) return !1; } for (k in obj2) if (!obj1.hasOwnProperty(k)) return !1; return !0; }, exports.isEmpty = function(obj) { var key; for (key in obj) return !1; return !0; }, exports.hasKey = hasKey, exports.forEachKey = function(obj, callback) { for (var key in obj) hasKey(obj, key) && callback(key, obj[key]); }, exports.pluck = function(obj, key) { return mod_assert.equal(typeof key, "string"), pluckv(obj, key); }, exports.flattenObject = function flattenObject(data, depth) { if (0 === depth) return [ data ]; mod_assert.ok(null !== data), mod_assert.equal(typeof data, "object"), mod_assert.equal(typeof depth, "number"), mod_assert.ok(depth >= 0); var key, rv = []; for (key in data) flattenObject(data[key], depth - 1).forEach((function(p) { rv.push([ key ].concat(p)); })); return rv; }, exports.flattenIter = function(data, depth, callback) { doFlattenIter(data, depth, [], callback); }, exports.validateJsonObject = validateJsonObjectJS, exports.validateJsonObjectJS = validateJsonObjectJS, exports.randElt = function(arr) { return mod_assert.ok(Array.isArray(arr) && arr.length > 0, "randElt argument must be a non-empty array"), arr[Math.floor(Math.random() * arr.length)]; }, exports.extraProperties = function(obj, allowed) { mod_assert.ok("object" == typeof obj && null !== obj, "obj argument must be a non-null object"), mod_assert.ok(Array.isArray(allowed), "allowed argument must be an array of strings"); for (var i = 0; i < allowed.length; i++) mod_assert.ok("string" == typeof allowed[i], "allowed argument must be an array of strings"); return Object.keys(obj).filter((function(key) { return -1 === allowed.indexOf(key); })); }, exports.mergeObjects = mergeObjects, exports.startsWith = function(str, prefix) { return str.substr(0, prefix.length) == prefix; }, exports.endsWith = function(str, suffix) { return str.substr(str.length - suffix.length, suffix.length) == suffix; }, exports.parseInteger = function(str, uopts) { mod_assert.string(str, "str"), mod_assert.optionalObject(uopts, "options"); var c, baseOverride = !1, options = PI_DEFAULTS; uopts && (baseOverride = hasKey(uopts, "base"), options = mergeObjects(options, uopts), mod_assert.number(options.base, "options.base"), mod_assert.ok(options.base >= 2, "options.base >= 2"), mod_assert.ok(options.base <= 36, "options.base <= 36"), mod_assert.bool(options.allowSign, "options.allowSign"), mod_assert.bool(options.allowPrefix, "options.allowPrefix"), mod_assert.bool(options.allowTrailing, "options.allowTrailing"), mod_assert.bool(options.allowImprecise, "options.allowImprecise"), mod_assert.bool(options.trimWhitespace, "options.trimWhitespace"), mod_assert.bool(options.leadingZeroIsOctal, "options.leadingZeroIsOctal"), options.leadingZeroIsOctal && mod_assert.ok(!baseOverride, '"base" and "leadingZeroIsOctal" are mutually exclusive')); var start, d, pbase = -1, base = options.base, mult = 1, value = 0, idx = 0, len = str.length; if (options.trimWhitespace) for (;idx < len && isSpace(str.charCodeAt(idx)); ) ++idx; for (options.allowSign && ("-" === str[idx] ? (idx += 1, mult = -1) : "+" === str[idx] && (idx += 1)), "0" === str[idx] && (options.allowPrefix && (pbase = (function(c) { return 98 === c || 66 === c ? 2 : 111 === c || 79 === c ? 8 : 116 === c || 84 === c ? 10 : 120 === c || 88 === c ? 16 : -1; })(str.charCodeAt(idx + 1)), -1 === pbase || baseOverride && pbase !== base || (base = pbase, idx += 2)), -1 === pbase && options.leadingZeroIsOctal && (base = 8)), start = idx; idx < len && -1 != (c = (d = str.charCodeAt(idx)) >= 48 && d <= 57 ? d - 48 : d >= 65 && d <= 90 ? d - 55 : d >= 97 && d <= 122 ? d - 87 : -1) && c < base; ++idx) value *= base, value += c; if (start === idx) return new Error("invalid number: " + JSON.stringify(str)); if (options.trimWhitespace) for (;idx < len && isSpace(str.charCodeAt(idx)); ) ++idx; if (idx < len && !options.allowTrailing) return new Error("trailing characters after number: " + JSON.stringify(str.slice(idx))); if (0 === value) return 0; var result = value * mult; return !options.allowImprecise && (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER) ? new Error("number is outside of the supported range: " + JSON.stringify(str.slice(start, idx))) : result; }, exports.iso8601 = function(d) { return "number" == typeof d && (d = new Date(d)), mod_assert.ok(d.constructor === Date), mod_extsprintf.sprintf("%4d-%02d-%02dT%02d:%02d:%02d.%03dZ", d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()); }, exports.rfc1123 = function(date) { return mod_extsprintf.sprintf("%s, %02d %s %04d %02d:%02d:%02d GMT", RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(), RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); }, exports.parseDateTime = function(str) { var numeric = +str; return isNaN(numeric) ? new Date(str) : new Date(numeric); }, exports.hrtimediff = hrtimeDiff, exports.hrtimeDiff = hrtimeDiff, exports.hrtimeAccum = hrtimeAccum, exports.hrtimeAdd = function(a, b) { return assertHrtime(a), hrtimeAccum([ a[0], a[1] ], b); }, exports.hrtimeNanosec = function(a) { return assertHrtime(a), Math.floor(1e9 * a[0] + a[1]); }, exports.hrtimeMicrosec = function(a) { return assertHrtime(a), Math.floor(1e6 * a[0] + a[1] / 1e3); }, exports.hrtimeMillisec = function(a) { return assertHrtime(a), Math.floor(1e3 * a[0] + a[1] / 1e6); }; var RFC1123_MONTHS = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], RFC1123_DAYS = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991, MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991, PI_DEFAULTS = { base: 10, allowSign: !0, allowPrefix: !1, allowTrailing: !1, allowImprecise: !1, trimWhitespace: !1, leadingZeroIsOctal: !1 }; function isSpace(c) { return 32 === c || c >= 9 && c <= 13 || 160 === c || 5760 === c || 6158 === c || c >= 8192 && c <= 8202 || 8232 === c || 8233 === c || 8239 === c || 8287 === c || 12288 === c || 65279 === c; } function validateJsonObjectJS(schema, input) { var report = mod_jsonschema.validate(input, schema); if (0 === report.errors.length) return null; var i, j, error = report.errors[0], propname = error.property, reason = error.message.toLowerCase(); -1 != (i = reason.indexOf("the property ")) && -1 != (j = reason.indexOf(" is not defined in the schema and the schema does not allow additional properties")) && (i += "the property ".length, propname = "" === propname ? reason.substr(i, j - i) : propname + "." + reason.substr(i, j - i), reason = "unsupported property"); var rv = new mod_verror.VError('property "%s": %s', propname, reason); return rv.jsv_details = error, rv; } function assertHrtime(a) { mod_assert.ok(a[0] >= 0 && a[1] >= 0, "negative numbers not allowed in hrtimes"), mod_assert.ok(a[1] < 1e9, "nanoseconds column overflow"); } function hrtimeDiff(a, b) { assertHrtime(a), assertHrtime(b), mod_assert.ok(a[0] > b[0] || a[0] == b[0] && a[1] >= b[1], "negative differences not allowed"); var rv = [ a[0] - b[0], 0 ]; return a[1] >= b[1] ? rv[1] = a[1] - b[1] : (rv[0]--, rv[1] = 1e9 - (b[1] - a[1])), rv; } function hrtimeAccum(a, b) { return assertHrtime(a), assertHrtime(b), a[1] += b[1], a[1] >= 1e9 && (a[0]++, a[1] -= 1e9), a[0] += b[0], a; } function mergeObjects(provided, overrides, defaults) { var rv, k; if (rv = {}, defaults) for (k in defaults) rv[k] = defaults[k]; if (provided) for (k in provided) rv[k] = provided[k]; if (overrides) for (k in overrides) rv[k] = overrides[k]; return rv; } }, function(module, exports, __webpack_require__) { var mod_assert = __webpack_require__(25), mod_util = __webpack_require__(0); function jsSprintf(fmt) { var flags, width, precision, conversion, left, pad, sign, arg, match, regex = [ "([^%]*)", "%", "(['\\-+ #0]*?)", "([1-9]\\d*)?", "(\\.([1-9]\\d*))?", "[lhjztL]*?", "([diouxXfFeEgGaAcCsSp%jr])" ].join(""), re = new RegExp(regex), args = Array.prototype.slice.call(arguments, 1), ret = "", argn = 1; for (mod_assert.equal("string", typeof fmt); null !== (match = re.exec(fmt)); ) if (ret += match[1], fmt = fmt.substring(match[0].length), flags = match[2] || "", width = match[3] || 0, precision = match[4] || "", left = !1, sign = !1, pad = " ", "%" != (conversion = match[6])) { if (0 === args.length) throw new Error("too few args to sprintf"); if (arg = args.shift(), argn++, flags.match(/[\' #]/)) throw new Error("unsupported flags: " + flags); if (precision.length > 0) throw new Error("non-zero precision not supported"); switch (flags.match(/-/) && (left = !0), flags.match(/0/) && (pad = "0"), flags.match(/\+/) && (sign = !0), conversion) { case "s": if (null == arg) throw new Error("argument " + argn + ": attempted to print undefined or null as a string"); ret += doPad(pad, width, left, arg.toString()); break; case "d": arg = Math.floor(arg); case "f": ret += (sign = sign && arg > 0 ? "+" : "") + doPad(pad, width, left, arg.toString()); break; case "x": ret += doPad(pad, width, left, arg.toString(16)); break; case "j": 0 === width && (width = 10), ret += mod_util.inspect(arg, !1, width); break; case "r": ret += dumpException(arg); break; default: throw new Error("unsupported conversion: " + conversion); } } else ret += "%"; return ret + fmt; } function jsFprintf(stream) { var args = Array.prototype.slice.call(arguments, 1); return stream.write(jsSprintf.apply(this, args)); } function doPad(chr, width, left, str) { for (var ret = str; ret.length < width; ) left ? ret += chr : ret = chr + ret; return ret; } function dumpException(ex) { var ret; if (!(ex instanceof Error)) throw new Error(jsSprintf("invalid type for %%r: %j", ex)); if (ret = "EXCEPTION: " + ex.constructor.name + ": " + ex.stack, ex.cause && "function" == typeof ex.cause) { var cex = ex.cause(); cex && (ret += "\nCaused by: " + dumpException(cex)); } return ret; } exports.sprintf = jsSprintf, exports.printf = function() { var args = Array.prototype.slice.call(arguments); args.unshift(process.stdout), jsFprintf.apply(null, args); }, exports.fprintf = jsFprintf; }, function(module, exports, __webpack_require__) { var mod_assertplus = __webpack_require__(15), mod_util = __webpack_require__(0), mod_extsprintf = __webpack_require__(1149), mod_isError = __webpack_require__(1150).isError, sprintf = mod_extsprintf.sprintf; function parseConstructorArguments(args) { var argv, options, sprintf_args, k; if (mod_assertplus.object(args, "args"), mod_assertplus.bool(args.strict, "args.strict"), mod_assertplus.array(args.argv, "args.argv"), 0 === (argv = args.argv).length) options = {}, sprintf_args = []; else if (mod_isError(argv[0])) options = { cause: argv[0] }, sprintf_args = argv.slice(1); else if ("object" == typeof argv[0]) { for (k in options = {}, argv[0]) options[k] = argv[0][k]; sprintf_args = argv.slice(1); } else mod_assertplus.string(argv[0], "first argument to VError, SError, or WError constructor must be a string, object, or Error"), options = {}, sprintf_args = argv; return mod_assertplus.object(options), options.strict || args.strict || (sprintf_args = sprintf_args.map((function(a) { return null === a ? "null" : void 0 === a ? "undefined" : a; }))), { options: options, shortmessage: 0 === sprintf_args.length ? "" : sprintf.apply(null, sprintf_args) }; } function VError() { var args, obj, parsed, cause, ctor, message, k; if (args = Array.prototype.slice.call(arguments, 0), !(this instanceof VError)) return obj = Object.create(VError.prototype), VError.apply(obj, arguments), obj; if ((parsed = parseConstructorArguments({ argv: args, strict: !1 })).options.name && (mod_assertplus.string(parsed.options.name, 'error\'s "name" must be a string'), this.name = parsed.options.name), this.jse_shortmsg = parsed.shortmessage, message = parsed.shortmessage, (cause = parsed.options.cause) && (mod_assertplus.ok(mod_isError(cause), "cause is not an Error"), this.jse_cause = cause, parsed.options.skipCauseMessage || (message += ": " + cause.message)), this.jse_info = {}, parsed.options.info) for (k in parsed.options.info) this.jse_info[k] = parsed.options.info[k]; return this.message = message, Error.call(this, message), Error.captureStackTrace && (ctor = parsed.options.constructorOpt || this.constructor, Error.captureStackTrace(this, ctor)), this; } function SError() { var args, obj, parsed, options; return args = Array.prototype.slice.call(arguments, 0), this instanceof SError ? (options = (parsed = parseConstructorArguments({ argv: args, strict: !0 })).options, VError.call(this, options, "%s", parsed.shortmessage), this) : (obj = Object.create(SError.prototype), SError.apply(obj, arguments), obj); } function MultiError(errors) { mod_assertplus.array(errors, "list of errors"), mod_assertplus.ok(errors.length > 0, "must be at least one error"), this.ase_errors = errors, VError.call(this, { cause: errors[0] }, "first of %d error%s", errors.length, 1 == errors.length ? "" : "s"); } function WError() { var args, obj, parsed, options; return args = Array.prototype.slice.call(arguments, 0), this instanceof WError ? ((options = (parsed = parseConstructorArguments({ argv: args, strict: !1 })).options).skipCauseMessage = !0, VError.call(this, options, "%s", parsed.shortmessage), this) : (obj = Object.create(WError.prototype), WError.apply(obj, args), obj); } module.exports = VError, VError.VError = VError, VError.SError = SError, VError.WError = WError, VError.MultiError = MultiError, mod_util.inherits(VError, Error), VError.prototype.name = "VError", VError.prototype.toString = function() { var str = this.hasOwnProperty("name") && this.name || this.constructor.name || this.constructor.prototype.name; return this.message && (str += ": " + this.message), str; }, VError.prototype.cause = function() { var cause = VError.cause(this); return null === cause ? void 0 : cause; }, VError.cause = function(err) { return mod_assertplus.ok(mod_isError(err), "err must be an Error"), mod_isError(err.jse_cause) ? err.jse_cause : null; }, VError.info = function(err) { var rv, cause, k; if (mod_assertplus.ok(mod_isError(err), "err must be an Error"), rv = null !== (cause = VError.cause(err)) ? VError.info(cause) : {}, "object" == typeof err.jse_info && null !== err.jse_info) for (k in err.jse_info) rv[k] = err.jse_info[k]; return rv; }, VError.findCauseByName = function(err, name) { var cause; for (mod_assertplus.ok(mod_isError(err), "err must be an Error"), mod_assertplus.string(name, "name"), mod_assertplus.ok(name.length > 0, "name cannot be empty"), cause = err; null !== cause; cause = VError.cause(cause)) if (mod_assertplus.ok(mod_isError(cause)), cause.name == name) return cause; return null; }, VError.hasCauseWithName = function(err, name) { return null !== VError.findCauseByName(err, name); }, VError.fullStack = function(err) { mod_assertplus.ok(mod_isError(err), "err must be an Error"); var cause = VError.cause(err); return cause ? err.stack + "\ncaused by: " + VError.fullStack(cause) : err.stack; }, VError.errorFromList = function(errors) { return mod_assertplus.arrayOfObject(errors, "errors"), 0 === errors.length ? null : (errors.forEach((function(e) { mod_assertplus.ok(mod_isError(e)); })), 1 == errors.length ? errors[0] : new MultiError(errors)); }, VError.errorForEach = function(err, func) { mod_assertplus.ok(mod_isError(err), "err must be an Error"), mod_assertplus.func(func, "func"), err instanceof MultiError ? err.errors().forEach((function(e) { func(e); })) : func(err); }, mod_util.inherits(SError, VError), mod_util.inherits(MultiError, VError), MultiError.prototype.name = "MultiError", MultiError.prototype.errors = function() { return this.ase_errors.slice(0); }, mod_util.inherits(WError, VError), WError.prototype.name = "WError", WError.prototype.toString = function() { var str = this.hasOwnProperty("name") && this.name || this.constructor.name || this.constructor.prototype.name; return this.message && (str += ": " + this.message), this.jse_cause && this.jse_cause.message && (str += "; caused by " + this.jse_cause.toString()), str; }, WError.prototype.cause = function(c) { return mod_isError(c) && (this.jse_cause = c), this.jse_cause; }; }, function(module, exports, __webpack_require__) { var mod_assert = __webpack_require__(25), mod_util = __webpack_require__(0); function jsSprintf(ofmt) { var flags, width, precision, conversion, left, pad, sign, arg, match, convposn, curconv, regex = [ "([^%]*)", "%", "(['\\-+ #0]*?)", "([1-9]\\d*)?", "(\\.([1-9]\\d*))?", "[lhjztL]*?", "([diouxXfFeEgGaAcCsSp%jr])" ].join(""), re = new RegExp(regex), args = Array.prototype.slice.call(arguments, 1), fmt = ofmt, ret = "", argn = 1, posn = 0; for (mod_assert.equal("string", typeof fmt, "first argument must be a format string"); null !== (match = re.exec(fmt)); ) if (ret += match[1], fmt = fmt.substring(match[0].length), curconv = match[0].substring(match[1].length), convposn = posn + match[1].length + 1, posn += match[0].length, flags = match[2] || "", width = match[3] || 0, precision = match[4] || "", left = !1, sign = !1, pad = " ", "%" != (conversion = match[6])) { if (0 === args.length) throw jsError(ofmt, convposn, curconv, "has no matching argument (too few arguments passed)"); if (arg = args.shift(), argn++, flags.match(/[\' #]/)) throw jsError(ofmt, convposn, curconv, "uses unsupported flags"); if (precision.length > 0) throw jsError(ofmt, convposn, curconv, "uses non-zero precision (not supported)"); switch (flags.match(/-/) && (left = !0), flags.match(/0/) && (pad = "0"), flags.match(/\+/) && (sign = !0), conversion) { case "s": if (null == arg) throw jsError(ofmt, convposn, curconv, "attempted to print undefined or null as a string (argument " + argn + " to sprintf)"); ret += doPad(pad, width, left, arg.toString()); break; case "d": arg = Math.floor(arg); case "f": ret += (sign = sign && arg > 0 ? "+" : "") + doPad(pad, width, left, arg.toString()); break; case "x": ret += doPad(pad, width, left, arg.toString(16)); break; case "j": 0 === width && (width = 10), ret += mod_util.inspect(arg, !1, width); break; case "r": ret += dumpException(arg); break; default: throw jsError(ofmt, convposn, curconv, "is not supported"); } } else ret += "%"; return ret + fmt; } function jsError(fmtstr, convposn, curconv, reason) { return mod_assert.equal(typeof fmtstr, "string"), mod_assert.equal(typeof curconv, "string"), mod_assert.equal(typeof convposn, "number"), mod_assert.equal(typeof reason, "string"), new Error('format string "' + fmtstr + '": conversion specifier "' + curconv + '" at character ' + convposn + " " + reason); } function jsFprintf(stream) { var args = Array.prototype.slice.call(arguments, 1); return stream.write(jsSprintf.apply(this, args)); } function doPad(chr, width, left, str) { for (var ret = str; ret.length < width; ) left ? ret += chr : ret = chr + ret; return ret; } function dumpException(ex) { var ret; if (!(ex instanceof Error)) throw new Error(jsSprintf("invalid type for %%r: %j", ex)); if (ret = "EXCEPTION: " + ex.constructor.name + ": " + ex.stack, ex.cause && "function" == typeof ex.cause) { var cex = ex.cause(); cex && (ret += "\nCaused by: " + dumpException(cex)); } return ret; } exports.sprintf = jsSprintf, exports.printf = function() { var args = Array.prototype.slice.call(arguments); args.unshift(process.stdout), jsFprintf.apply(null, args); }, exports.fprintf = jsFprintf; }, function(module, exports) { function objectToString(o) { return Object.prototype.toString.call(o); } exports.isArray = function(arg) { return Array.isArray ? Array.isArray(arg) : "[object Array]" === objectToString(arg); }, exports.isBoolean = function(arg) { return "boolean" == typeof arg; }, exports.isNull = function(arg) { return null === arg; }, exports.isNullOrUndefined = function(arg) { return null == arg; }, exports.isNumber = function(arg) { return "number" == typeof arg; }, exports.isString = function(arg) { return "string" == typeof arg; }, exports.isSymbol = function(arg) { return "symbol" == typeof arg; }, exports.isUndefined = function(arg) { return void 0 === arg; }, exports.isRegExp = function(re) { return "[object RegExp]" === objectToString(re); }, exports.isObject = function(arg) { return "object" == typeof arg && null !== arg; }, exports.isDate = function(d) { return "[object Date]" === objectToString(d); }, exports.isError = function(e) { return "[object Error]" === objectToString(e) || e instanceof Error; }, exports.isFunction = function(arg) { return "function" == typeof arg; }, exports.isPrimitive = function(arg) { return null === arg || "boolean" == typeof arg || "number" == typeof arg || "string" == typeof arg || "symbol" == typeof arg || void 0 === arg; }, exports.isBuffer = Buffer.isBuffer; }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; __WEBPACK_AMD_DEFINE_RESULT__ = function() { return (function() { var exports = validate; exports.Integer = { type: "integer" }; var primitiveConstructors = { String: String, Boolean: Boolean, Number: Number, Object: Object, Array: Array, Date: Date }; function validate(instance, schema) { return validate(instance, schema, { changing: !1 }); } exports.validate = validate, exports.checkPropertyChange = function(value, schema, property) { return validate(value, schema, { changing: property || "property" }); }; var validate = exports._validate = function(instance, schema, options) { options || (options = {}); var _changing = options.changing; function getType(schema) { return schema.type || primitiveConstructors[schema.name] == schema && schema.name.toLowerCase(); } var errors = []; function checkProp(value, schema, path, i) { var l; function addError(message) { errors.push({ property: path, message: message }); } if (path += path ? "number" == typeof i ? "[" + i + "]" : void 0 === i ? "" : "." + i : i, ("object" != typeof schema || schema instanceof Array) && (path || "function" != typeof schema) && (!schema || !getType(schema))) return "function" == typeof schema ? value instanceof schema || addError("is not an instance of the class/constructor " + schema.name) : schema && addError("Invalid schema/property definition " + schema), null; function checkType(type, value) { if (type) { if (!("string" != typeof type || "any" == type || ("null" == type ? null === value : typeof value == type) || value instanceof Array && "array" == type || value instanceof Date && "date" == type || "integer" == type && value % 1 == 0)) return [ { property: path, message: typeof value + " value found, but a " + type + " is required" } ]; if (type instanceof Array) { for (var unionErrors = [], j = 0; j < type.length && (unionErrors = checkType(type[j], value)).length; j++) ; if (unionErrors.length) return unionErrors; } else if ("object" == typeof type) { var priorErrors = errors; errors = [], checkProp(value, type, path); var theseErrors = errors; return errors = priorErrors, theseErrors; } } return []; } if (_changing && schema.readonly && addError("is a readonly field, it can not be changed"), schema.extends && checkProp(value, schema.extends, path, i), void 0 === value) schema.required && addError("is missing and it is required"); else if (errors = errors.concat(checkType(getType(schema), value)), schema.disallow && !checkType(schema.disallow, value).length && addError(" disallowed value was matched"), null !== value) { if (value instanceof Array) { if (schema.items) { var itemsIsArray = schema.items instanceof Array, propDef = schema.items; for (i = 0, l = value.length; i < l; i += 1) itemsIsArray && (propDef = schema.items[i]), options.coerce && (value[i] = options.coerce(value[i], propDef)), errors.concat(checkProp(value[i], propDef, path, i)); } schema.minItems && value.length < schema.minItems && addError("There must be a minimum of " + schema.minItems + " in the array"), schema.maxItems && value.length > schema.maxItems && addError("There must be a maximum of " + schema.maxItems + " in the array"); } else (schema.properties || schema.additionalProperties) && errors.concat((function(instance, objTypeDef, path, additionalProp) { if ("object" == typeof objTypeDef) for (var i in ("object" != typeof instance || instance instanceof Array) && errors.push({ property: path, message: "an object is required" }), objTypeDef) if (objTypeDef.hasOwnProperty(i)) { var value = instance[i]; if (void 0 === value && options.existingOnly) continue; var propDef = objTypeDef[i]; void 0 === value && propDef.default && (value = instance[i] = propDef.default), options.coerce && i in instance && (value = instance[i] = options.coerce(value, propDef)), checkProp(value, propDef, path, i); } for (i in instance) { if (instance.hasOwnProperty(i) && ("_" != i.charAt(0) || "_" != i.charAt(1)) && objTypeDef && !objTypeDef[i] && !1 === additionalProp) { if (options.filter) { delete instance[i]; continue; } errors.push({ property: path, message: typeof value + "The property " + i + " is not defined in the schema and the schema does not allow additional properties" }); } var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; requires && !(requires in instance) && errors.push({ property: path, message: "the presence of the property " + i + " requires that " + requires + " also be present" }), value = instance[i], !additionalProp || objTypeDef && "object" == typeof objTypeDef && i in objTypeDef || (options.coerce && (value = instance[i] = options.coerce(value, additionalProp)), checkProp(value, additionalProp, path, i)), !_changing && value && value.$schema && (errors = errors.concat(checkProp(value, value.$schema, path, i))); } return errors; })(value, schema.properties, path, schema.additionalProperties)); if (schema.pattern && "string" == typeof value && !value.match(schema.pattern) && addError("does not match the regex pattern " + schema.pattern), schema.maxLength && "string" == typeof value && value.length > schema.maxLength && addError("may only be " + schema.maxLength + " characters long"), schema.minLength && "string" == typeof value && value.length < schema.minLength && addError("must be at least " + schema.minLength + " characters long"), void 0 !== typeof schema.minimum && typeof value == typeof schema.minimum && schema.minimum > value && addError("must have a minimum value of " + schema.minimum), void 0 !== typeof schema.maximum && typeof value == typeof schema.maximum && schema.maximum < value && addError("must have a maximum value of " + schema.maximum), schema.enum) { var found, enumer = schema.enum; l = enumer.length; for (var j = 0; j < l; j++) if (enumer[j] === value) { found = 1; break; } found || addError("does not have a value in the enumeration " + enumer.join(", ")); } "number" == typeof schema.maxDecimal && value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")) && addError("may only have " + schema.maxDecimal + " digits of decimal places"); } return null; } return schema && checkProp(instance, schema, "", _changing || ""), !_changing && instance && instance.$schema && checkProp(instance, instance.$schema, "", ""), { valid: !errors.length, errors: errors }; }; return exports.mustBeValid = function(result) { if (!result.valid) throw new TypeError(result.errors.map((function(error) { return "for property " + error.property + ": " + error.message; })).join(", \n")); }, exports; })(); }.apply(exports, []), void 0 === __WEBPACK_AMD_DEFINE_RESULT__ || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); }, function(module, exports, __webpack_require__) { var assert = __webpack_require__(15), crypto = __webpack_require__(6), sshpk = __webpack_require__(261), utils = __webpack_require__(163), validateAlgorithm = (utils.HASH_ALGOS, utils.PK_ALGOS, utils.InvalidAlgorithmError, utils.HttpSignatureError, utils.validateAlgorithm); module.exports = { verifySignature: function(parsedSignature, pubkey) { assert.object(parsedSignature, "parsedSignature"), ("string" == typeof pubkey || Buffer.isBuffer(pubkey)) && (pubkey = sshpk.parseKey(pubkey)), assert.ok(sshpk.Key.isKey(pubkey, [ 1, 1 ]), "pubkey must be a sshpk.Key"); var alg = validateAlgorithm(parsedSignature.algorithm); if ("hmac" === alg[0] || alg[0] !== pubkey.type) return !1; var v = pubkey.createVerify(alg[1]); return v.update(parsedSignature.signingString), v.verify(parsedSignature.params.signature, "base64"); }, verifyHMAC: function(parsedSignature, secret) { assert.object(parsedSignature, "parsedHMAC"), assert.string(secret, "secret"); var alg = validateAlgorithm(parsedSignature.algorithm); if ("hmac" !== alg[0]) return !1; var hashAlg = alg[1].toUpperCase(), hmac = crypto.createHmac(hashAlg, secret); hmac.update(parsedSignature.signingString); var h1 = crypto.createHmac(hashAlg, secret); h1.update(hmac.digest()), h1 = h1.digest(); var h2 = crypto.createHmac(hashAlg, secret); return h2.update(new Buffer(parsedSignature.params.signature, "base64")), h2 = h2.digest(), "string" == typeof h1 ? h1 === h2 : Buffer.isBuffer(h1) && !h1.equals ? h1.toString("binary") === h2.toString("binary") : h1.equals(h2); } }; }, function(module, exports, __webpack_require__) { module.exports = ForeverAgent, ForeverAgent.SSL = ForeverAgentSSL; var util = __webpack_require__(0), Agent = __webpack_require__(11).Agent, net = __webpack_require__(39), tls = __webpack_require__(70), AgentSSL = __webpack_require__(21).Agent; function getConnectionName(host, port) { return "string" == typeof host ? host + ":" + port : host.host + ":" + host.port + ":" + (host.localAddress ? host.localAddress + ":" : ":"); } function ForeverAgent(options) { var self = this; self.options = options || {}, self.requests = {}, self.sockets = {}, self.freeSockets = {}, self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets, self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets, self.on("free", (function(socket, host, port) { var name = getConnectionName(host, port); if (self.requests[name] && self.requests[name].length) self.requests[name].shift().onSocket(socket); else if (self.sockets[name].length < self.minSockets) { self.freeSockets[name] || (self.freeSockets[name] = []), self.freeSockets[name].push(socket); var onIdleError = function() { socket.destroy(); }; socket._onIdleError = onIdleError, socket.on("error", onIdleError); } else socket.destroy(); })); } function ForeverAgentSSL(options) { ForeverAgent.call(this, options); } util.inherits(ForeverAgent, Agent), ForeverAgent.defaultMinSockets = 5, ForeverAgent.prototype.createConnection = net.createConnection, ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest, ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port); if ("string" != typeof host) { var options = host; port = options.port, host = options.host; } if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { var idleSocket = this.freeSockets[name].pop(); idleSocket.removeListener("error", idleSocket._onIdleError), delete idleSocket._onIdleError, req._reusedSocket = !0, req.onSocket(idleSocket); } else this.addRequestNoreuse(req, host, port); }, ForeverAgent.prototype.removeSocket = function(s, name, host, port) { var index; this.sockets[name] ? -1 !== (index = this.sockets[name].indexOf(s)) && this.sockets[name].splice(index, 1) : this.sockets[name] && 0 === this.sockets[name].length && (delete this.sockets[name], delete this.requests[name]), this.freeSockets[name] && -1 !== (index = this.freeSockets[name].indexOf(s)) && (this.freeSockets[name].splice(index, 1), 0 === this.freeSockets[name].length && delete this.freeSockets[name]), this.requests[name] && this.requests[name].length && this.createSocket(name, host, port).emit("free"); }, util.inherits(ForeverAgentSSL, ForeverAgent), ForeverAgentSSL.prototype.createConnection = function(port, host, options) { return "object" == typeof port ? options = port : "object" == typeof host ? options = host : "object" == typeof options || (options = {}), "number" == typeof port && (options.port = port), "string" == typeof host && (options.host = host), tls.connect(options); }, ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest; }, function(module, exports, __webpack_require__) { var CombinedStream = __webpack_require__(527), util = __webpack_require__(0), path = __webpack_require__(5), http = __webpack_require__(11), https = __webpack_require__(21), parseUrl = __webpack_require__(7).parse, fs = __webpack_require__(2), mime = __webpack_require__(78), asynckit = __webpack_require__(1156), populate = __webpack_require__(1160); function FormData(options) { if (!(this instanceof FormData)) return new FormData; for (var option in this._overheadLength = 0, this._valueLength = 0, this._valuesToMeasure = [], CombinedStream.call(this), options = options || {}) this[option] = options[option]; } module.exports = FormData, util.inherits(FormData, CombinedStream), FormData.LINE_BREAK = "\r\n", FormData.DEFAULT_CONTENT_TYPE = "application/octet-stream", FormData.prototype.append = function(field, value, options) { "string" == typeof (options = options || {}) && (options = { filename: options }); var append = CombinedStream.prototype.append.bind(this); if ("number" == typeof value && (value = "" + value), util.isArray(value)) this._error(new Error("Arrays are not supported.")); else { var header = this._multiPartHeader(field, value, options), footer = this._multiPartFooter(); append(header), append(value), append(footer), this._trackLength(header, value, options); } }, FormData.prototype._trackLength = function(header, value, options) { var valueLength = 0; null != options.knownLength ? valueLength += +options.knownLength : Buffer.isBuffer(value) ? valueLength = value.length : "string" == typeof value && (valueLength = Buffer.byteLength(value)), this._valueLength += valueLength, this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length, value && (value.path || value.readable && value.hasOwnProperty("httpVersion")) && (options.knownLength || this._valuesToMeasure.push(value)); }, FormData.prototype._lengthRetriever = function(value, callback) { value.hasOwnProperty("fd") ? null != value.end && value.end != 1 / 0 && null != value.start ? callback(null, value.end + 1 - (value.start ? value.start : 0)) : fs.stat(value.path, (function(err, stat) { var fileSize; err ? callback(err) : (fileSize = stat.size - (value.start ? value.start : 0), callback(null, fileSize)); })) : value.hasOwnProperty("httpVersion") ? callback(null, +value.headers["content-length"]) : value.hasOwnProperty("httpModule") ? (value.on("response", (function(response) { value.pause(), callback(null, +response.headers["content-length"]); })), value.resume()) : callback("Unknown stream"); }, FormData.prototype._multiPartHeader = function(field, value, options) { if ("string" == typeof options.header) return options.header; var header, contentDisposition = this._getContentDisposition(value, options), contentType = this._getContentType(value, options), contents = "", headers = { "Content-Disposition": [ "form-data", 'name="' + field + '"' ].concat(contentDisposition || []), "Content-Type": [].concat(contentType || []) }; for (var prop in "object" == typeof options.header && populate(headers, options.header), headers) headers.hasOwnProperty(prop) && null != (header = headers[prop]) && (Array.isArray(header) || (header = [ header ]), header.length && (contents += prop + ": " + header.join("; ") + FormData.LINE_BREAK)); return "--" + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; }, FormData.prototype._getContentDisposition = function(value, options) { var filename, contentDisposition; return "string" == typeof options.filepath ? filename = path.normalize(options.filepath).replace(/\\/g, "/") : options.filename || value.name || value.path ? filename = path.basename(options.filename || value.name || value.path) : value.readable && value.hasOwnProperty("httpVersion") && (filename = path.basename(value.client._httpMessage.path)), filename && (contentDisposition = 'filename="' + filename + '"'), contentDisposition; }, FormData.prototype._getContentType = function(value, options) { var contentType = options.contentType; return !contentType && value.name && (contentType = mime.lookup(value.name)), !contentType && value.path && (contentType = mime.lookup(value.path)), !contentType && value.readable && value.hasOwnProperty("httpVersion") && (contentType = value.headers["content-type"]), contentType || !options.filepath && !options.filename || (contentType = mime.lookup(options.filepath || options.filename)), contentType || "object" != typeof value || (contentType = FormData.DEFAULT_CONTENT_TYPE), contentType; }, FormData.prototype._multiPartFooter = function() { return function(next) { var footer = FormData.LINE_BREAK; 0 === this._streams.length && (footer += this._lastBoundary()), next(footer); }.bind(this); }, FormData.prototype._lastBoundary = function() { return "--" + this.getBoundary() + "--" + FormData.LINE_BREAK; }, FormData.prototype.getHeaders = function(userHeaders) { var header, formHeaders = { "content-type": "multipart/form-data; boundary=" + this.getBoundary() }; for (header in userHeaders) userHeaders.hasOwnProperty(header) && (formHeaders[header.toLowerCase()] = userHeaders[header]); return formHeaders; }, FormData.prototype.getBoundary = function() { return this._boundary || this._generateBoundary(), this._boundary; }, FormData.prototype._generateBoundary = function() { for (var boundary = "--------------------------", i = 0; i < 24; i++) boundary += Math.floor(10 * Math.random()).toString(16); this._boundary = boundary; }, FormData.prototype.getLengthSync = function() { var knownLength = this._overheadLength + this._valueLength; return this._streams.length && (knownLength += this._lastBoundary().length), this.hasKnownLength() || this._error(new Error("Cannot calculate proper length in synchronous way.")), knownLength; }, FormData.prototype.hasKnownLength = function() { var hasKnownLength = !0; return this._valuesToMeasure.length && (hasKnownLength = !1), hasKnownLength; }, FormData.prototype.getLength = function(cb) { var knownLength = this._overheadLength + this._valueLength; this._streams.length && (knownLength += this._lastBoundary().length), this._valuesToMeasure.length ? asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, (function(err, values) { err ? cb(err) : (values.forEach((function(length) { knownLength += length; })), cb(null, knownLength)); })) : process.nextTick(cb.bind(this, null, knownLength)); }, FormData.prototype.submit = function(params, cb) { var request, options, defaults = { method: "post" }; return "string" == typeof params ? (params = parseUrl(params), options = populate({ port: params.port, path: params.pathname, host: params.hostname, protocol: params.protocol }, defaults)) : (options = populate(params, defaults)).port || (options.port = "https:" == options.protocol ? 443 : 80), options.headers = this.getHeaders(params.headers), request = "https:" == options.protocol ? https.request(options) : http.request(options), this.getLength(function(err, length) { err ? this._error(err) : (request.setHeader("Content-Length", length), this.pipe(request), cb && (request.on("error", cb), request.on("response", cb.bind(this, null)))); }.bind(this)), request; }, FormData.prototype._error = function(err) { this.error || (this.error = err, this.pause(), this.emit("error", err)); }, FormData.prototype.toString = function() { return "[object FormData]"; }; }, function(module, exports, __webpack_require__) { var Stream = __webpack_require__(3).Stream, util = __webpack_require__(0); function DelayedStream() { this.source = null, this.dataSize = 0, this.maxDataSize = 1048576, this.pauseStream = !0, this._maxDataSizeExceeded = !1, this._released = !1, this._bufferedEvents = []; } module.exports = DelayedStream, util.inherits(DelayedStream, Stream), DelayedStream.create = function(source, options) { var delayedStream = new this; for (var option in options = options || {}) delayedStream[option] = options[option]; delayedStream.source = source; var realEmit = source.emit; return source.emit = function() { return delayedStream._handleEmit(arguments), realEmit.apply(source, arguments); }, source.on("error", (function() {})), delayedStream.pauseStream && source.pause(), delayedStream; }, Object.defineProperty(DelayedStream.prototype, "readable", { configurable: !0, enumerable: !0, get: function() { return this.source.readable; } }), DelayedStream.prototype.setEncoding = function() { return this.source.setEncoding.apply(this.source, arguments); }, DelayedStream.prototype.resume = function() { this._released || this.release(), this.source.resume(); }, DelayedStream.prototype.pause = function() { this.source.pause(); }, DelayedStream.prototype.release = function() { this._released = !0, this._bufferedEvents.forEach(function(args) { this.emit.apply(this, args); }.bind(this)), this._bufferedEvents = []; }, DelayedStream.prototype.pipe = function() { var r = Stream.prototype.pipe.apply(this, arguments); return this.resume(), r; }, DelayedStream.prototype._handleEmit = function(args) { this._released ? this.emit.apply(this, args) : ("data" === args[0] && (this.dataSize += args[1].length, this._checkIfMaxDataSizeExceeded()), this._bufferedEvents.push(args)); }, DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { if (!(this._maxDataSizeExceeded || this.dataSize <= this.maxDataSize)) { this._maxDataSizeExceeded = !0; var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; this.emit("error", new Error(message)); } }; }, function(module, exports, __webpack_require__) { module.exports = { parallel: __webpack_require__(1157), serial: __webpack_require__(1159), serialOrdered: __webpack_require__(533) }; }, function(module, exports, __webpack_require__) { var iterate = __webpack_require__(528), initState = __webpack_require__(531), terminator = __webpack_require__(532); module.exports = function(list, iterator, callback) { for (var state = initState(list); state.index < (state.keyedList || list).length; ) iterate(list, iterator, state, (function(error, result) { error ? callback(error, result) : 0 !== Object.keys(state.jobs).length || callback(null, state.results); })), state.index++; return terminator.bind(state, callback); }; }, function(module, exports) { module.exports = function(fn) { var nextTick = "function" == typeof setImmediate ? setImmediate : "object" == typeof process && "function" == typeof process.nextTick ? process.nextTick : null; nextTick ? nextTick(fn) : setTimeout(fn, 0); }; }, function(module, exports, __webpack_require__) { var serialOrdered = __webpack_require__(533); module.exports = function(list, iterator, callback) { return serialOrdered(list, iterator, null, callback); }; }, function(module, exports) { module.exports = function(dst, src) { return Object.keys(src).forEach((function(prop) { dst[prop] = dst[prop] || src[prop]; })), dst; }; }, function(module, exports, __webpack_require__) { "use strict"; function formatHostname(hostname) { return hostname.replace(/^\.*/, ".").toLowerCase(); } function parseNoProxyZone(zone) { var zoneParts = (zone = zone.trim().toLowerCase()).split(":", 2); return { hostname: formatHostname(zoneParts[0]), port: zoneParts[1], hasPort: zone.indexOf(":") > -1 }; } module.exports = function(uri) { var noProxy = process.env.NO_PROXY || process.env.no_proxy || ""; return "*" === noProxy || "" !== noProxy && (function(uri, noProxy) { var port = uri.port || ("https:" === uri.protocol ? "443" : "80"), hostname = formatHostname(uri.hostname); return noProxy.split(",").map(parseNoProxyZone).some((function(noProxyZone) { var isMatchedAt = hostname.indexOf(noProxyZone.hostname), hostnameMatched = isMatchedAt > -1 && isMatchedAt === hostname.length - noProxyZone.hostname.length; return noProxyZone.hasPort ? port === noProxyZone.port && hostnameMatched : hostnameMatched; })); })(uri, noProxy) ? null : "http:" === uri.protocol ? process.env.HTTP_PROXY || process.env.http_proxy || null : "https:" === uri.protocol && (process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy) || null; }; }, function(module, exports, __webpack_require__) { "use strict"; var qs = __webpack_require__(535), querystring = __webpack_require__(24); function Querystring(request) { this.request = request, this.lib = null, this.useQuerystring = null, this.parseOptions = null, this.stringifyOptions = null; } Querystring.prototype.init = function(options) { this.lib || (this.useQuerystring = options.useQuerystring, this.lib = this.useQuerystring ? querystring : qs, this.parseOptions = options.qsParseOptions || {}, this.stringifyOptions = options.qsStringifyOptions || {}); }, Querystring.prototype.stringify = function(obj) { return this.useQuerystring ? this.rfc3986(this.lib.stringify(obj, this.stringifyOptions.sep || null, this.stringifyOptions.eq || null, this.stringifyOptions)) : this.lib.stringify(obj, this.stringifyOptions); }, Querystring.prototype.parse = function(str) { return this.useQuerystring ? this.lib.parse(str, this.parseOptions.sep || null, this.parseOptions.eq || null, this.parseOptions) : this.lib.parse(str, this.parseOptions); }, Querystring.prototype.rfc3986 = function(str) { return str.replace(/[!'()*]/g, (function(c) { return "%" + c.charCodeAt(0).toString(16).toUpperCase(); })); }, Querystring.prototype.unescape = querystring.unescape, exports.Querystring = Querystring; }, function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(536), formats = __webpack_require__(537), arrayPrefixGenerators = { brackets: function(prefix) { return prefix + "[]"; }, indices: function(prefix, key) { return prefix + "[" + key + "]"; }, repeat: function(prefix) { return prefix; } }, toISO = Date.prototype.toISOString, defaults = { delimiter: "&", encode: !0, encoder: utils.encode, encodeValuesOnly: !1, serializeDate: function(date) { return toISO.call(date); }, skipNulls: !1, strictNullHandling: !1 }, stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly) { var obj = object; if ("function" == typeof filter) obj = filter(prefix, obj); else if (obj instanceof Date) obj = serializeDate(obj); else if (null === obj) { if (strictNullHandling) return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; obj = ""; } if ("string" == typeof obj || "number" == typeof obj || "boolean" == typeof obj || utils.isBuffer(obj)) return encoder ? [ formatter(encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder)) + "=" + formatter(encoder(obj, defaults.encoder)) ] : [ formatter(prefix) + "=" + formatter(String(obj)) ]; var objKeys, values = []; if (void 0 === obj) return values; if (Array.isArray(filter)) objKeys = filter; else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; skipNulls && null === obj[key] || (values = Array.isArray(obj) ? values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly)) : values.concat(stringify(obj[key], prefix + (allowDots ? "." + key : "[" + key + "]"), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly))); } return values; }; module.exports = function(object, opts) { var obj = object, options = opts ? utils.assign({}, opts) : {}; if (null !== options.encoder && void 0 !== options.encoder && "function" != typeof options.encoder) throw new TypeError("Encoder has to be a function."); var delimiter = void 0 === options.delimiter ? defaults.delimiter : options.delimiter, strictNullHandling = "boolean" == typeof options.strictNullHandling ? options.strictNullHandling : defaults.strictNullHandling, skipNulls = "boolean" == typeof options.skipNulls ? options.skipNulls : defaults.skipNulls, encode = "boolean" == typeof options.encode ? options.encode : defaults.encode, encoder = "function" == typeof options.encoder ? options.encoder : defaults.encoder, sort = "function" == typeof options.sort ? options.sort : null, allowDots = void 0 !== options.allowDots && options.allowDots, serializeDate = "function" == typeof options.serializeDate ? options.serializeDate : defaults.serializeDate, encodeValuesOnly = "boolean" == typeof options.encodeValuesOnly ? options.encodeValuesOnly : defaults.encodeValuesOnly; if (void 0 === options.format) options.format = formats.default; else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) throw new TypeError("Unknown format option provided."); var objKeys, filter, formatter = formats.formatters[options.format]; "function" == typeof options.filter ? obj = (filter = options.filter)("", obj) : Array.isArray(options.filter) && (objKeys = filter = options.filter); var arrayFormat, keys = []; if ("object" != typeof obj || null === obj) return ""; arrayFormat = options.arrayFormat in arrayPrefixGenerators ? options.arrayFormat : "indices" in options ? options.indices ? "indices" : "repeat" : "indices"; var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; objKeys || (objKeys = Object.keys(obj)), sort && objKeys.sort(sort); for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; skipNulls && null === obj[key] || (keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode ? encoder : null, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly))); } var joined = keys.join(delimiter), prefix = !0 === options.addQueryPrefix ? "?" : ""; return joined.length > 0 ? prefix + joined : ""; }; }, function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(536), has = Object.prototype.hasOwnProperty, defaults = { allowDots: !1, allowPrototypes: !1, arrayLimit: 20, decoder: utils.decode, delimiter: "&", depth: 5, parameterLimit: 1e3, plainObjects: !1, strictNullHandling: !1 }, parseKeys = function(givenKey, val, options) { if (givenKey) { var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey, child = /(\[[^[\]]*])/g, segment = /(\[[^[\]]*])/.exec(key), parent = segment ? key.slice(0, segment.index) : key, keys = []; if (parent) { if (!options.plainObjects && has.call(Object.prototype, parent) && !options.allowPrototypes) return; keys.push(parent); } for (var i = 0; null !== (segment = child.exec(key)) && i < options.depth; ) { if (i += 1, !options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1)) && !options.allowPrototypes) return; keys.push(segment[1]); } return segment && keys.push("[" + key.slice(segment.index) + "]"), (function(chain, val, options) { for (var leaf = val, i = chain.length - 1; i >= 0; --i) { var obj, root = chain[i]; if ("[]" === root) obj = (obj = []).concat(leaf); else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = "[" === root.charAt(0) && "]" === root.charAt(root.length - 1) ? root.slice(1, -1) : root, index = parseInt(cleanRoot, 10); !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit ? (obj = [])[index] = leaf : obj[cleanRoot] = leaf; } leaf = obj; } return leaf; })(keys, val, options); } }; module.exports = function(str, opts) { var options = opts ? utils.assign({}, opts) : {}; if (null !== options.decoder && void 0 !== options.decoder && "function" != typeof options.decoder) throw new TypeError("Decoder has to be a function."); if (options.ignoreQueryPrefix = !0 === options.ignoreQueryPrefix, options.delimiter = "string" == typeof options.delimiter || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter, options.depth = "number" == typeof options.depth ? options.depth : defaults.depth, options.arrayLimit = "number" == typeof options.arrayLimit ? options.arrayLimit : defaults.arrayLimit, options.parseArrays = !1 !== options.parseArrays, options.decoder = "function" == typeof options.decoder ? options.decoder : defaults.decoder, options.allowDots = "boolean" == typeof options.allowDots ? options.allowDots : defaults.allowDots, options.plainObjects = "boolean" == typeof options.plainObjects ? options.plainObjects : defaults.plainObjects, options.allowPrototypes = "boolean" == typeof options.allowPrototypes ? options.allowPrototypes : defaults.allowPrototypes, options.parameterLimit = "number" == typeof options.parameterLimit ? options.parameterLimit : defaults.parameterLimit, options.strictNullHandling = "boolean" == typeof options.strictNullHandling ? options.strictNullHandling : defaults.strictNullHandling, "" === str || null == str) return options.plainObjects ? Object.create(null) : {}; for (var tempObj = "string" == typeof str ? (function(str, options) { for (var obj = {}, cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str, limit = options.parameterLimit === 1 / 0 ? void 0 : options.parameterLimit, parts = cleanStr.split(options.delimiter, limit), i = 0; i < parts.length; ++i) { var key, val, part = parts[i], bracketEqualsPos = part.indexOf("]="), pos = -1 === bracketEqualsPos ? part.indexOf("=") : bracketEqualsPos + 1; -1 === pos ? (key = options.decoder(part, defaults.decoder), val = options.strictNullHandling ? null : "") : (key = options.decoder(part.slice(0, pos), defaults.decoder), val = options.decoder(part.slice(pos + 1), defaults.decoder)), has.call(obj, key) ? obj[key] = [].concat(obj[key]).concat(val) : obj[key] = val; } return obj; })(str, options) : str, obj = options.plainObjects ? Object.create(null) : {}, keys = Object.keys(tempObj), i = 0; i < keys.length; ++i) { var key = keys[i], newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; }, function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(2), qs = __webpack_require__(24), validate = __webpack_require__(1166), extend = __webpack_require__(157); function Har(request) { this.request = request; } Har.prototype.reducer = function(obj, pair) { if (void 0 === obj[pair.name]) return obj[pair.name] = pair.value, obj; var arr = [ obj[pair.name], pair.value ]; return obj[pair.name] = arr, obj; }, Har.prototype.prep = function(data) { if (data.queryObj = {}, data.headersObj = {}, data.postData.jsonObj = !1, data.postData.paramsObj = !1, data.queryString && data.queryString.length && (data.queryObj = data.queryString.reduce(this.reducer, {})), data.headers && data.headers.length && (data.headersObj = data.headers.reduceRight((function(headers, header) { return headers[header.name] = header.value, headers; }), {})), data.cookies && data.cookies.length) { var cookies = data.cookies.map((function(cookie) { return cookie.name + "=" + cookie.value; })); cookies.length && (data.headersObj.cookie = cookies.join("; ")); } function some(arr) { return arr.some((function(type) { return 0 === data.postData.mimeType.indexOf(type); })); } if (some([ "multipart/mixed", "multipart/related", "multipart/form-data", "multipart/alternative" ])) data.postData.mimeType = "multipart/form-data"; else if (some([ "application/x-www-form-urlencoded" ])) data.postData.params ? (data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}), data.postData.text = qs.stringify(data.postData.paramsObj)) : data.postData.text = ""; else if (some([ "text/json", "text/x-json", "application/json", "application/x-json" ]) && (data.postData.mimeType = "application/json", data.postData.text)) try { data.postData.jsonObj = JSON.parse(data.postData.text); } catch (e) { this.request.debug(e), data.postData.mimeType = "text/plain"; } return data; }, Har.prototype.options = function(options) { if (!options.har) return options; var har = {}; if (extend(har, options.har), har.log && har.log.entries && (har = har.log.entries[0]), har.url = har.url || options.url || options.uri || options.baseUrl || "/", har.httpVersion = har.httpVersion || "HTTP/1.1", har.queryString = har.queryString || [], har.headers = har.headers || [], har.cookies = har.cookies || [], har.postData = har.postData || {}, har.postData.mimeType = har.postData.mimeType || "application/octet-stream", har.bodySize = 0, har.headersSize = 0, har.postData.size = 0, !validate.request(har)) return options; var req = this.prep(har); function test(type) { return 0 === req.postData.mimeType.indexOf(type); } return req.url && (options.url = req.url), req.method && (options.method = req.method), Object.keys(req.queryObj).length && (options.qs = req.queryObj), Object.keys(req.headersObj).length && (options.headers = req.headersObj), test("application/x-www-form-urlencoded") ? options.form = req.postData.paramsObj : test("application/json") ? req.postData.jsonObj && (options.body = req.postData.jsonObj, options.json = !0) : test("multipart/form-data") ? (options.formData = {}, req.postData.params.forEach((function(param) { var attachment = {}; param.fileName || param.fileName || param.contentType ? (param.fileName && !param.value ? attachment.value = fs.createReadStream(param.fileName) : param.value && (attachment.value = param.value), param.fileName && (attachment.options = { filename: param.fileName, contentType: param.contentType ? param.contentType : null }), options.formData[param.name] = attachment) : options.formData[param.name] = param.value; }))) : req.postData.text && (options.body = req.postData.text), options; }, exports.Har = Har; }, function(module, exports, __webpack_require__) { var ajv, Ajv = __webpack_require__(1167), HARError = __webpack_require__(1200), schemas = __webpack_require__(1201); function validate(name, data) { data = data || {}; var validate = (ajv = ajv || (function() { var ajv = new Ajv({ allErrors: !0 }); return ajv.addMetaSchema(__webpack_require__(1220)), ajv.addSchema(schemas), ajv; })()).getSchema(name + ".json"); return new Promise((function(resolve, reject) { validate(data) ? resolve(data) : reject(new HARError(validate.errors)); })); } exports.afterRequest = function(data) { return validate("afterRequest", data); }, exports.beforeRequest = function(data) { return validate("beforeRequest", data); }, exports.browser = function(data) { return validate("browser", data); }, exports.cache = function(data) { return validate("cache", data); }, exports.content = function(data) { return validate("content", data); }, exports.cookie = function(data) { return validate("cookie", data); }, exports.creator = function(data) { return validate("creator", data); }, exports.entry = function(data) { return validate("entry", data); }, exports.har = function(data) { return validate("har", data); }, exports.header = function(data) { return validate("header", data); }, exports.log = function(data) { return validate("log", data); }, exports.page = function(data) { return validate("page", data); }, exports.pageTimings = function(data) { return validate("pageTimings", data); }, exports.postData = function(data) { return validate("postData", data); }, exports.query = function(data) { return validate("query", data); }, exports.request = function(data) { return validate("request", data); }, exports.response = function(data) { return validate("response", data); }, exports.timings = function(data) { return validate("timings", data); }; }, function(module, exports, __webpack_require__) { "use strict"; var compileSchema = __webpack_require__(1168), resolve = __webpack_require__(268), Cache = __webpack_require__(1172), SchemaObject = __webpack_require__(538), stableStringify = __webpack_require__(539), formats = __webpack_require__(1173), rules = __webpack_require__(1174), $dataMetaSchema = __webpack_require__(1195), util = __webpack_require__(91); module.exports = Ajv, Ajv.prototype.validate = function(schemaKeyRef, data) { var v; if ("string" == typeof schemaKeyRef) { if (!(v = this.getSchema(schemaKeyRef))) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); } else { var schemaObj = this._addSchema(schemaKeyRef); v = schemaObj.validate || this._compile(schemaObj); } var valid = v(data); return !0 !== v.$async && (this.errors = v.errors), valid; }, Ajv.prototype.compile = function(schema, _meta) { var schemaObj = this._addSchema(schema, void 0, _meta); return schemaObj.validate || this._compile(schemaObj); }, Ajv.prototype.addSchema = function(schema, key, _skipValidation, _meta) { if (Array.isArray(schema)) { for (var i = 0; i < schema.length; i++) this.addSchema(schema[i], void 0, _skipValidation, _meta); return this; } var id = this._getId(schema); if (void 0 !== id && "string" != typeof id) throw new Error("schema id must be string"); return checkUnique(this, key = resolve.normalizeId(key || id)), this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, !0), this; }, Ajv.prototype.addMetaSchema = function(schema, key, skipValidation) { return this.addSchema(schema, key, skipValidation, !0), this; }, Ajv.prototype.validateSchema = function(schema, throwOrLogError) { var $schema = schema.$schema; if (void 0 !== $schema && "string" != typeof $schema) throw new Error("$schema must be a string"); if (!($schema = $schema || this._opts.defaultMeta || (function(self) { var meta = self._opts.meta; return self._opts.defaultMeta = "object" == typeof meta ? self._getId(meta) || meta : self.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0, self._opts.defaultMeta; })(this))) return this.logger.warn("meta-schema not available"), this.errors = null, !0; var valid = this.validate($schema, schema); if (!valid && throwOrLogError) { var message = "schema is invalid: " + this.errorsText(); if ("log" != this._opts.validateSchema) throw new Error(message); this.logger.error(message); } return valid; }, Ajv.prototype.getSchema = function(keyRef) { var schemaObj = _getSchemaObj(this, keyRef); switch (typeof schemaObj) { case "object": return schemaObj.validate || this._compile(schemaObj); case "string": return this.getSchema(schemaObj); case "undefined": return (function(self, ref) { var res = resolve.schema.call(self, { schema: {} }, ref); if (res) { var schema = res.schema, root = res.root, baseId = res.baseId, v = compileSchema.call(self, schema, root, void 0, baseId); return self._fragments[ref] = new SchemaObject({ ref: ref, fragment: !0, schema: schema, root: root, baseId: baseId, validate: v }), v; } })(this, keyRef); } }, Ajv.prototype.removeSchema = function(schemaKeyRef) { if (schemaKeyRef instanceof RegExp) return _removeAllSchemas(this, this._schemas, schemaKeyRef), _removeAllSchemas(this, this._refs, schemaKeyRef), this; switch (typeof schemaKeyRef) { case "undefined": return _removeAllSchemas(this, this._schemas), _removeAllSchemas(this, this._refs), this._cache.clear(), this; case "string": var schemaObj = _getSchemaObj(this, schemaKeyRef); return schemaObj && this._cache.del(schemaObj.cacheKey), delete this._schemas[schemaKeyRef], delete this._refs[schemaKeyRef], this; case "object": var serialize = this._opts.serialize, cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef; this._cache.del(cacheKey); var id = this._getId(schemaKeyRef); id && (id = resolve.normalizeId(id), delete this._schemas[id], delete this._refs[id]); } return this; }, Ajv.prototype.addFormat = function(name, format) { return "string" == typeof format && (format = new RegExp(format)), this._formats[name] = format, this; }, Ajv.prototype.errorsText = function(errors, options) { if (!(errors = errors || this.errors)) return "No errors"; for (var separator = void 0 === (options = options || {}).separator ? ", " : options.separator, dataVar = void 0 === options.dataVar ? "data" : options.dataVar, text = "", i = 0; i < errors.length; i++) { var e = errors[i]; e && (text += dataVar + e.dataPath + " " + e.message + separator); } return text.slice(0, -separator.length); }, Ajv.prototype._addSchema = function(schema, skipValidation, meta, shouldAddSchema) { if ("object" != typeof schema && "boolean" != typeof schema) throw new Error("schema should be object or boolean"); var serialize = this._opts.serialize, cacheKey = serialize ? serialize(schema) : schema, cached = this._cache.get(cacheKey); if (cached) return cached; shouldAddSchema = shouldAddSchema || !1 !== this._opts.addUsedSchema; var id = resolve.normalizeId(this._getId(schema)); id && shouldAddSchema && checkUnique(this, id); var recursiveMeta, willValidate = !1 !== this._opts.validateSchema && !skipValidation; willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)) && this.validateSchema(schema, !0); var localRefs = resolve.ids.call(this, schema), schemaObj = new SchemaObject({ id: id, schema: schema, localRefs: localRefs, cacheKey: cacheKey, meta: meta }); return "#" != id[0] && shouldAddSchema && (this._refs[id] = schemaObj), this._cache.put(cacheKey, schemaObj), willValidate && recursiveMeta && this.validateSchema(schema, !0), schemaObj; }, Ajv.prototype._compile = function(schemaObj, root) { if (schemaObj.compiling) return schemaObj.validate = callValidate, callValidate.schema = schemaObj.schema, callValidate.errors = null, callValidate.root = root || callValidate, !0 === schemaObj.schema.$async && (callValidate.$async = !0), callValidate; var currentOpts, v; schemaObj.compiling = !0, schemaObj.meta && (currentOpts = this._opts, this._opts = this._metaOpts); try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); } catch (e) { throw delete schemaObj.validate, e; } finally { schemaObj.compiling = !1, schemaObj.meta && (this._opts = currentOpts); } return schemaObj.validate = v, schemaObj.refs = v.refs, schemaObj.refVal = v.refVal, schemaObj.root = v.root, v; function callValidate() { var _validate = schemaObj.validate, result = _validate.apply(this, arguments); return callValidate.errors = _validate.errors, result; } }, Ajv.prototype.compileAsync = __webpack_require__(1196); var customKeyword = __webpack_require__(1197); Ajv.prototype.addKeyword = customKeyword.add, Ajv.prototype.getKeyword = customKeyword.get, Ajv.prototype.removeKeyword = customKeyword.remove, Ajv.prototype.validateKeyword = customKeyword.validate; var errorClasses = __webpack_require__(270); Ajv.ValidationError = errorClasses.Validation, Ajv.MissingRefError = errorClasses.MissingRef, Ajv.$dataMetaSchema = $dataMetaSchema; var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema", META_IGNORE_OPTIONS = [ "removeAdditional", "useDefaults", "coerceTypes", "strictDefaults" ], META_SUPPORT_DATA = [ "/properties" ]; function Ajv(opts) { if (!(this instanceof Ajv)) return new Ajv(opts); opts = this._opts = util.copy(opts) || {}, (function(self) { var logger = self._opts.logger; if (!1 === logger) self.logger = { log: noop, warn: noop, error: noop }; else { if (void 0 === logger && (logger = console), !("object" == typeof logger && logger.log && logger.warn && logger.error)) throw new Error("logger must implement log, warn and error methods"); self.logger = logger; } })(this), this._schemas = {}, this._refs = {}, this._fragments = {}, this._formats = formats(opts.format), this._cache = opts.cache || new Cache, this._loadingSchemas = {}, this._compilations = [], this.RULES = rules(), this._getId = (function(opts) { switch (opts.schemaId) { case "auto": return _get$IdOrId; case "id": return _getId; default: return _get$Id; } })(opts), opts.loopRequired = opts.loopRequired || 1 / 0, "property" == opts.errorDataPath && (opts._errorDataPathProperty = !0), void 0 === opts.serialize && (opts.serialize = stableStringify), this._metaOpts = (function(self) { for (var metaOpts = util.copy(self._opts), i = 0; i < META_IGNORE_OPTIONS.length; i++) delete metaOpts[META_IGNORE_OPTIONS[i]]; return metaOpts; })(this), opts.formats && (function(self) { for (var name in self._opts.formats) { var format = self._opts.formats[name]; self.addFormat(name, format); } })(this), (function(self) { var $dataSchema; if (self._opts.$data && ($dataSchema = __webpack_require__(1199), self.addMetaSchema($dataSchema, $dataSchema.$id, !0)), !1 !== self._opts.meta) { var metaSchema = __webpack_require__(545); self._opts.$data && (metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA)), self.addMetaSchema(metaSchema, META_SCHEMA_ID, !0), self._refs["http://json-schema.org/schema"] = META_SCHEMA_ID; } })(this), "object" == typeof opts.meta && this.addMetaSchema(opts.meta), opts.nullable && this.addKeyword("nullable", { metaSchema: { type: "boolean" } }), (function(self) { var optsSchemas = self._opts.schemas; if (optsSchemas) if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas); else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key); })(this); } function _getSchemaObj(self, keyRef) { return keyRef = resolve.normalizeId(keyRef), self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef]; } function _removeAllSchemas(self, schemas, regex) { for (var keyRef in schemas) { var schemaObj = schemas[keyRef]; schemaObj.meta || regex && !regex.test(keyRef) || (self._cache.del(schemaObj.cacheKey), delete schemas[keyRef]); } } function _getId(schema) { return schema.$id && this.logger.warn("schema $id ignored", schema.$id), schema.id; } function _get$Id(schema) { return schema.id && this.logger.warn("schema id ignored", schema.id), schema.$id; } function _get$IdOrId(schema) { if (schema.$id && schema.id && schema.$id != schema.id) throw new Error("schema $id is different from id"); return schema.$id || schema.id; } function checkUnique(self, id) { if (self._schemas[id] || self._refs[id]) throw new Error('schema with key or id "' + id + '" already exists'); } function noop() {} }, function(module, exports, __webpack_require__) { "use strict"; var resolve = __webpack_require__(268), util = __webpack_require__(91), errorClasses = __webpack_require__(270), stableStringify = __webpack_require__(539), validateGenerator = __webpack_require__(540), ucs2length = util.ucs2length, equal = __webpack_require__(269), ValidationError = errorClasses.Validation; function checkCompiling(schema, root, baseId) { var index = compIndex.call(this, schema, root, baseId); return index >= 0 ? { index: index, compiling: !0 } : (index = this._compilations.length, this._compilations[index] = { schema: schema, root: root, baseId: baseId }, { index: index, compiling: !1 }); } function endCompiling(schema, root, baseId) { var i = compIndex.call(this, schema, root, baseId); i >= 0 && this._compilations.splice(i, 1); } function compIndex(schema, root, baseId) { for (var i = 0; i < this._compilations.length; i++) { var c = this._compilations[i]; if (c.schema == schema && c.root == root && c.baseId == baseId) return i; } return -1; } function patternCode(i, patterns) { return "var pattern" + i + " = new RegExp(" + util.toQuotedString(patterns[i]) + ");"; } function defaultCode(i) { return "var default" + i + " = defaults[" + i + "];"; } function refValCode(i, refVal) { return void 0 === refVal[i] ? "" : "var refVal" + i + " = refVal[" + i + "];"; } function customRuleCode(i) { return "var customRule" + i + " = customRules[" + i + "];"; } function vars(arr, statement) { if (!arr.length) return ""; for (var code = "", i = 0; i < arr.length; i++) code += statement(i, arr); return code; } module.exports = function compile(schema, root, localRefs, baseId) { var self = this, opts = this._opts, refVal = [ void 0 ], refs = {}, patterns = [], patternsHash = {}, defaults = [], defaultsHash = {}, customRules = []; root = root || { schema: schema, refVal: refVal, refs: refs }; var c = checkCompiling.call(this, schema, root, baseId), compilation = this._compilations[c.index]; if (c.compiling) return compilation.callValidate = function callValidate() { var validate = compilation.validate, result = validate.apply(this, arguments); return callValidate.errors = validate.errors, result; }; var formats = this._formats, RULES = this.RULES; try { var v = localCompile(schema, root, localRefs, baseId); compilation.validate = v; var cv = compilation.callValidate; return cv && (cv.schema = v.schema, cv.errors = null, cv.refs = v.refs, cv.refVal = v.refVal, cv.root = v.root, cv.$async = v.$async, opts.sourceCode && (cv.source = v.source)), v; } finally { endCompiling.call(this, schema, root, baseId); } function localCompile(_schema, _root, localRefs, baseId) { var isRoot = !_root || _root && _root.schema == _schema; if (_root.schema != root.schema) return compile.call(self, _schema, _root, localRefs, baseId); var validate, $async = !0 === _schema.$async, sourceCode = validateGenerator({ isTop: !0, schema: _schema, isRoot: isRoot, baseId: baseId, root: _root, schemaPath: "", errSchemaPath: "#", errorPath: '""', MissingRefError: errorClasses.MissingRef, RULES: RULES, validate: validateGenerator, util: util, resolve: resolve, resolveRef: resolveRef, usePattern: usePattern, useDefault: useDefault, useCustomRule: useCustomRule, opts: opts, formats: formats, logger: self.logger, self: self }); sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + sourceCode, opts.processCode && (sourceCode = opts.processCode(sourceCode)); try { validate = new Function("self", "RULES", "formats", "root", "refVal", "defaults", "customRules", "equal", "ucs2length", "ValidationError", sourceCode)(self, RULES, formats, root, refVal, defaults, customRules, equal, ucs2length, ValidationError), refVal[0] = validate; } catch (e) { throw self.logger.error("Error compiling schema, function code:", sourceCode), e; } return validate.schema = _schema, validate.errors = null, validate.refs = refs, validate.refVal = refVal, validate.root = isRoot ? validate : _root, $async && (validate.$async = !0), !0 === opts.sourceCode && (validate.source = { code: sourceCode, patterns: patterns, defaults: defaults }), validate; } function resolveRef(baseId, ref, isRoot) { ref = resolve.url(baseId, ref); var _refVal, refCode, refIndex = refs[ref]; if (void 0 !== refIndex) return resolvedRef(_refVal = refVal[refIndex], refCode = "refVal[" + refIndex + "]"); if (!isRoot && root.refs) { var rootRefId = root.refs[ref]; if (void 0 !== rootRefId) return resolvedRef(_refVal = root.refVal[rootRefId], refCode = addLocalRef(ref, _refVal)); } refCode = addLocalRef(ref); var v = resolve.call(self, localCompile, root, ref); if (void 0 === v) { var localSchema = localRefs && localRefs[ref]; localSchema && (v = resolve.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId)); } if (void 0 !== v) return (function(ref, v) { var refId = refs[ref]; refVal[refId] = v; })(ref, v), resolvedRef(v, refCode); !(function(ref) { delete refs[ref]; })(ref); } function addLocalRef(ref, v) { var refId = refVal.length; return refVal[refId] = v, refs[ref] = refId, "refVal" + refId; } function resolvedRef(refVal, code) { return "object" == typeof refVal || "boolean" == typeof refVal ? { code: code, schema: refVal, inline: !0 } : { code: code, $async: refVal && !!refVal.$async }; } function usePattern(regexStr) { var index = patternsHash[regexStr]; return void 0 === index && (index = patternsHash[regexStr] = patterns.length, patterns[index] = regexStr), "pattern" + index; } function useDefault(value) { switch (typeof value) { case "boolean": case "number": return "" + value; case "string": return util.toQuotedString(value); case "object": if (null === value) return "null"; var valueStr = stableStringify(value), index = defaultsHash[valueStr]; return void 0 === index && (index = defaultsHash[valueStr] = defaults.length, defaults[index] = value), "default" + index; } } function useCustomRule(rule, schema, parentSchema, it) { if (!1 !== self._opts.validateSchema) { var deps = rule.definition.dependencies; if (deps && !deps.every((function(keyword) { return Object.prototype.hasOwnProperty.call(parentSchema, keyword); }))) throw new Error("parent schema must have all required keywords: " + deps.join(",")); var validateSchema = rule.definition.validateSchema; if (validateSchema && !validateSchema(schema)) { var message = "keyword schema is invalid: " + self.errorsText(validateSchema.errors); if ("log" != self._opts.validateSchema) throw new Error(message); self.logger.error(message); } } var validate, compile = rule.definition.compile, inline = rule.definition.inline, macro = rule.definition.macro; if (compile) validate = compile.call(self, schema, parentSchema, it); else if (macro) validate = macro.call(self, schema, parentSchema, it), !1 !== opts.validateSchema && self.validateSchema(validate, !0); else if (inline) validate = inline.call(self, it, rule.keyword, schema, parentSchema); else if (!(validate = rule.definition.validate)) return; if (void 0 === validate) throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); var index = customRules.length; return customRules[index] = validate, { code: "customRule" + index, validate: validate }; } }; }, function(module, exports, __webpack_require__) { !(function(exports) { "use strict"; function merge() { for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) sets[_key] = arguments[_key]; if (sets.length > 1) { sets[0] = sets[0].slice(0, -1); for (var xl = sets.length - 1, x = 1; x < xl; ++x) sets[x] = sets[x].slice(1, -1); return sets[xl] = sets[xl].slice(1), sets.join(""); } return sets[0]; } function subexp(str) { return "(?:" + str + ")"; } function typeOf(o) { return void 0 === o ? "undefined" : null === o ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); } function toUpperCase(str) { return str.toUpperCase(); } function buildExps(isIRI) { var HEXDIG$$ = merge("[0-9]", "[A-Fa-f]"), PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge("[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$), IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$ = merge("[A-Za-z]", "[0-9]", "[\\-\\.\\_\\~]", isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]"), SCHEME$ = subexp("[A-Za-z]" + merge("[A-Za-z]", "[0-9]", "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET_RELAXED$ = (subexp(subexp("25[0-5]") + "|" + subexp("2[0-4][0-9]") + "|" + subexp("1[0-9][0-9]") + "|" + subexp("[1-9][0-9]") + "|[0-9]"), subexp(subexp("25[0-5]") + "|" + subexp("2[0-4][0-9]") + "|" + subexp("1[0-9][0-9]") + "|" + subexp("0?[1-9][0-9]") + "|0?0?[0-9]")), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([ IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$ ].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), IPV6ADDRZ_RELAXED$ = (subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$)), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")|" + REG_NAME$), PORT$ = subexp("[0-9]*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", QUERY$ = (subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*")), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"); return subexp(URI$ + "|" + RELATIVE$), subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")"), subexp("\\?(" + QUERY$ + ")"), subexp("\\#(" + FRAGMENT$ + ")"), subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")"), subexp("\\?(" + QUERY$ + ")"), subexp("\\#(" + FRAGMENT$ + ")"), subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")"), subexp("\\?(" + QUERY$ + ")"), subexp("\\#(" + FRAGMENT$ + ")"), subexp("(" + USERINFO$ + ")@"), subexp("\\:(" + PORT$ + ")"), { NOT_SCHEME: new RegExp(merge("[^]", "[A-Za-z]", "[0-9]", "[\\+\\-\\.]"), "g"), NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), UNRESERVED: new RegExp(UNRESERVED$$, "g"), OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") }; } var URI_PROTOCOL = buildExps(!1), IRI_PROTOCOL = buildExps(!0), slicedToArray = function(arr, i) { if (Array.isArray(arr)) return arr; if (Symbol.iterator in Object(arr)) return (function(arr, i) { var _arr = [], _n = !0, _d = !1, _e = void 0; try { for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !i || _arr.length !== i); _n = !0) ; } catch (err) { _d = !0, _e = err; } finally { try { !_n && _i.return && _i.return(); } finally { if (_d) throw _e; } } return _arr; })(arr, i); throw new TypeError("Invalid attempt to destructure non-iterable instance"); }, maxInt = 2147483647, regexPunycode = /^xn--/, regexNonASCII = /[^\0-\x7E]/, regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, errors = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, floor = Math.floor, stringFromCharCode = String.fromCharCode; function error$1(type) { throw new RangeError(errors[type]); } function mapDomain(string, fn) { var parts = string.split("@"), result = ""; return parts.length > 1 && (result = parts[0] + "@", string = parts[1]), result + (function(array, fn) { for (var result = [], length = array.length; length--; ) result[length] = fn(array[length]); return result; })((string = string.replace(regexSeparators, ".")).split("."), fn).join("."); } function ucs2decode(string) { for (var output = [], counter = 0, length = string.length; counter < length; ) { var value = string.charCodeAt(counter++); if (value >= 55296 && value <= 56319 && counter < length) { var extra = string.charCodeAt(counter++); 56320 == (64512 & extra) ? output.push(((1023 & value) << 10) + (1023 & extra) + 65536) : (output.push(value), counter--); } else output.push(value); } return output; } var digitToBasic = function(digit, flag) { return digit + 22 + 75 * (digit < 26) - ((0 != flag) << 5); }, adapt = function(delta, numPoints, firstTime) { var k = 0; for (delta = firstTime ? floor(delta / 700) : delta >> 1, delta += floor(delta / numPoints); delta > 455; k += 36) delta = floor(delta / 35); return floor(k + 36 * delta / (delta + 38)); }, decode = function(input) { var codePoint, output = [], inputLength = input.length, i = 0, n = 128, bias = 72, basic = input.lastIndexOf("-"); basic < 0 && (basic = 0); for (var j = 0; j < basic; ++j) input.charCodeAt(j) >= 128 && error$1("not-basic"), output.push(input.charCodeAt(j)); for (var index = basic > 0 ? basic + 1 : 0; index < inputLength; ) { for (var oldi = i, w = 1, k = 36; ;k += 36) { index >= inputLength && error$1("invalid-input"); var digit = (codePoint = input.charCodeAt(index++)) - 48 < 10 ? codePoint - 22 : codePoint - 65 < 26 ? codePoint - 65 : codePoint - 97 < 26 ? codePoint - 97 : 36; (digit >= 36 || digit > floor((maxInt - i) / w)) && error$1("overflow"), i += digit * w; var t = k <= bias ? 1 : k >= bias + 26 ? 26 : k - bias; if (digit < t) break; var baseMinusT = 36 - t; w > floor(maxInt / baseMinusT) && error$1("overflow"), w *= baseMinusT; } var out = output.length + 1; bias = adapt(i - oldi, out, 0 == oldi), floor(i / out) > maxInt - n && error$1("overflow"), n += floor(i / out), i %= out, output.splice(i++, 0, n); } return String.fromCodePoint.apply(String, output); }, encode = function(input) { var output = [], inputLength = (input = ucs2decode(input)).length, n = 128, delta = 0, bias = 72, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for (var _step, _iterator = input[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) { var _currentValue2 = _step.value; _currentValue2 < 128 && output.push(stringFromCharCode(_currentValue2)); } } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally { try { !_iteratorNormalCompletion && _iterator.return && _iterator.return(); } finally { if (_didIteratorError) throw _iteratorError; } } var basicLength = output.length, handledCPCount = basicLength; for (basicLength && output.push("-"); handledCPCount < inputLength; ) { var m = maxInt, _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0; try { for (var _step2, _iterator2 = input[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) { var currentValue = _step2.value; currentValue >= n && currentValue < m && (m = currentValue); } } catch (err) { _didIteratorError2 = !0, _iteratorError2 = err; } finally { try { !_iteratorNormalCompletion2 && _iterator2.return && _iterator2.return(); } finally { if (_didIteratorError2) throw _iteratorError2; } } var handledCPCountPlusOne = handledCPCount + 1; m - n > floor((maxInt - delta) / handledCPCountPlusOne) && error$1("overflow"), delta += (m - n) * handledCPCountPlusOne, n = m; var _iteratorNormalCompletion3 = !0, _didIteratorError3 = !1, _iteratorError3 = void 0; try { for (var _step3, _iterator3 = input[Symbol.iterator](); !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0) { var _currentValue = _step3.value; if (_currentValue < n && ++delta > maxInt && error$1("overflow"), _currentValue == n) { for (var q = delta, k = 36; ;k += 36) { var t = k <= bias ? 1 : k >= bias + 26 ? 26 : k - bias; if (q < t) break; var qMinusT = q - t, baseMinusT = 36 - t; output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))), q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))), bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength), delta = 0, ++handledCPCount; } } } catch (err) { _didIteratorError3 = !0, _iteratorError3 = err; } finally { try { !_iteratorNormalCompletion3 && _iterator3.return && _iterator3.return(); } finally { if (_didIteratorError3) throw _iteratorError3; } } ++delta, ++n; } return output.join(""); }, punycode_toASCII = function(input) { return mapDomain(input, (function(string) { return regexNonASCII.test(string) ? "xn--" + encode(string) : string; })); }, punycode_toUnicode = function(input) { return mapDomain(input, (function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; })); }, SCHEMES = {}; function pctEncChar(chr) { var c = chr.charCodeAt(0); return c < 16 ? "%0" + c.toString(16).toUpperCase() : c < 128 ? "%" + c.toString(16).toUpperCase() : c < 2048 ? "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (63 & c | 128).toString(16).toUpperCase() : "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (63 & c | 128).toString(16).toUpperCase(); } function pctDecChars(str) { for (var newStr = "", i = 0, il = str.length; i < il; ) { var c = parseInt(str.substr(i + 1, 2), 16); if (c < 128) newStr += String.fromCharCode(c), i += 3; else if (c >= 194 && c < 224) { if (il - i >= 6) { var c2 = parseInt(str.substr(i + 4, 2), 16); newStr += String.fromCharCode((31 & c) << 6 | 63 & c2); } else newStr += str.substr(i, 6); i += 6; } else if (c >= 224) { if (il - i >= 9) { var _c = parseInt(str.substr(i + 4, 2), 16), c3 = parseInt(str.substr(i + 7, 2), 16); newStr += String.fromCharCode((15 & c) << 12 | (63 & _c) << 6 | 63 & c3); } else newStr += str.substr(i, 9); i += 9; } else newStr += str.substr(i, 3), i += 3; } return newStr; } function _normalizeComponentEncoding(components, protocol) { function decodeUnreserved(str) { var decStr = pctDecChars(str); return decStr.match(protocol.UNRESERVED) ? decStr : str; } return components.scheme && (components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "")), void 0 !== components.userinfo && (components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase)), void 0 !== components.host && (components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase)), void 0 !== components.path && (components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase)), void 0 !== components.query && (components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase)), void 0 !== components.fragment && (components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase)), components; } function _stripLeadingZeros(str) { return str.replace(/^0*(.*)/, "$1") || "0"; } function _normalizeIPv4(host, protocol) { var matches = host.match(protocol.IPV4ADDRESS) || [], address = slicedToArray(matches, 2)[1]; return address ? address.split(".").map(_stripLeadingZeros).join(".") : host; } function _normalizeIPv6(host, protocol) { var matches = host.match(protocol.IPV6ADDRESS) || [], _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2]; if (address) { for (var _address$toLowerCase$ = address.toLowerCase().split("::").reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1], firstFields = first ? first.split(":").map(_stripLeadingZeros) : [], lastFields = last.split(":").map(_stripLeadingZeros), isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]), fieldCount = isLastFieldIPv4Address ? 7 : 8, lastFieldsStart = lastFields.length - fieldCount, fields = Array(fieldCount), x = 0; x < fieldCount; ++x) fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ""; isLastFieldIPv4Address && (fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol)); var longestZeroFields = fields.reduce((function(acc, field, index) { if (!field || "0" === field) { var lastLongest = acc[acc.length - 1]; lastLongest && lastLongest.index + lastLongest.length === index ? lastLongest.length++ : acc.push({ index: index, length: 1 }); } return acc; }), []).sort((function(a, b) { return b.length - a.length; }))[0], newHost = void 0; if (longestZeroFields && longestZeroFields.length > 1) { var newFirst = fields.slice(0, longestZeroFields.index), newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); newHost = newFirst.join(":") + "::" + newLast.join(":"); } else newHost = fields.join(":"); return zone && (newHost += "%" + zone), newHost; } return host; } var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, NO_MATCH_IS_UNDEFINED = void 0 === "".match(/(){0}/)[1]; function parse(uriString) { var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, components = {}, protocol = !1 !== options.iri ? IRI_PROTOCOL : URI_PROTOCOL; "suffix" === options.reference && (uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString); var matches = uriString.match(URI_PARSE); if (matches) { NO_MATCH_IS_UNDEFINED ? (components.scheme = matches[1], components.userinfo = matches[3], components.host = matches[4], components.port = parseInt(matches[5], 10), components.path = matches[6] || "", components.query = matches[7], components.fragment = matches[8], isNaN(components.port) && (components.port = matches[5])) : (components.scheme = matches[1] || void 0, components.userinfo = -1 !== uriString.indexOf("@") ? matches[3] : void 0, components.host = -1 !== uriString.indexOf("//") ? matches[4] : void 0, components.port = parseInt(matches[5], 10), components.path = matches[6] || "", components.query = -1 !== uriString.indexOf("?") ? matches[7] : void 0, components.fragment = -1 !== uriString.indexOf("#") ? matches[8] : void 0, isNaN(components.port) && (components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : void 0)), components.host && (components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol)), void 0 !== components.scheme || void 0 !== components.userinfo || void 0 !== components.host || void 0 !== components.port || components.path || void 0 !== components.query ? void 0 === components.scheme ? components.reference = "relative" : void 0 === components.fragment ? components.reference = "absolute" : components.reference = "uri" : components.reference = "same-document", options.reference && "suffix" !== options.reference && options.reference !== components.reference && (components.error = components.error || "URI is not a " + options.reference + " reference."); var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; if (options.unicodeSupport || schemeHandler && schemeHandler.unicodeSupport) _normalizeComponentEncoding(components, protocol); else { if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) try { components.host = punycode_toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); } catch (e) { components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; } _normalizeComponentEncoding(components, URI_PROTOCOL); } schemeHandler && schemeHandler.parse && schemeHandler.parse(components, options); } else components.error = components.error || "URI can not be parsed."; return components; } function _recomposeAuthority(components, options) { var protocol = !1 !== options.iri ? IRI_PROTOCOL : URI_PROTOCOL, uriTokens = []; return void 0 !== components.userinfo && (uriTokens.push(components.userinfo), uriTokens.push("@")), void 0 !== components.host && uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (function(_, $1, $2) { return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; }))), "number" == typeof components.port && (uriTokens.push(":"), uriTokens.push(components.port.toString(10))), uriTokens.length ? uriTokens.join("") : void 0; } var RDS1 = /^\.\.?\//, RDS2 = /^\/\.(\/|$)/, RDS3 = /^\/\.\.(\/|$)/, RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; function removeDotSegments(input) { for (var output = []; input.length; ) if (input.match(RDS1)) input = input.replace(RDS1, ""); else if (input.match(RDS2)) input = input.replace(RDS2, "/"); else if (input.match(RDS3)) input = input.replace(RDS3, "/"), output.pop(); else if ("." === input || ".." === input) input = ""; else { var im = input.match(RDS5); if (!im) throw new Error("Unexpected dot segment condition"); var s = im[0]; input = input.slice(s.length), output.push(s); } return output.join(""); } function serialize(components) { var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL, uriTokens = [], schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; if (schemeHandler && schemeHandler.serialize && schemeHandler.serialize(components, options), components.host) if (protocol.IPV6ADDRESS.test(components.host)) ; else if (options.domainHost || schemeHandler && schemeHandler.domainHost) try { components.host = options.iri ? punycode_toUnicode(components.host) : punycode_toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); } catch (e) { components.error = components.error || "Host's domain name can not be converted to " + (options.iri ? "Unicode" : "ASCII") + " via punycode: " + e; } _normalizeComponentEncoding(components, protocol), "suffix" !== options.reference && components.scheme && (uriTokens.push(components.scheme), uriTokens.push(":")); var authority = _recomposeAuthority(components, options); if (void 0 !== authority && ("suffix" !== options.reference && uriTokens.push("//"), uriTokens.push(authority), components.path && "/" !== components.path.charAt(0) && uriTokens.push("/")), void 0 !== components.path) { var s = components.path; options.absolutePath || schemeHandler && schemeHandler.absolutePath || (s = removeDotSegments(s)), void 0 === authority && (s = s.replace(/^\/\//, "/%2F")), uriTokens.push(s); } return void 0 !== components.query && (uriTokens.push("?"), uriTokens.push(components.query)), void 0 !== components.fragment && (uriTokens.push("#"), uriTokens.push(components.fragment)), uriTokens.join(""); } function resolveComponents(base, relative) { var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, target = {}; return arguments[3] || (base = parse(serialize(base, options), options), relative = parse(serialize(relative, options), options)), !(options = options || {}).tolerant && relative.scheme ? (target.scheme = relative.scheme, target.userinfo = relative.userinfo, target.host = relative.host, target.port = relative.port, target.path = removeDotSegments(relative.path || ""), target.query = relative.query) : (void 0 !== relative.userinfo || void 0 !== relative.host || void 0 !== relative.port ? (target.userinfo = relative.userinfo, target.host = relative.host, target.port = relative.port, target.path = removeDotSegments(relative.path || ""), target.query = relative.query) : (relative.path ? ("/" === relative.path.charAt(0) ? target.path = removeDotSegments(relative.path) : (void 0 === base.userinfo && void 0 === base.host && void 0 === base.port || base.path ? base.path ? target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path : target.path = relative.path : target.path = "/" + relative.path, target.path = removeDotSegments(target.path)), target.query = relative.query) : (target.path = base.path, void 0 !== relative.query ? target.query = relative.query : target.query = base.query), target.userinfo = base.userinfo, target.host = base.host, target.port = base.port), target.scheme = base.scheme), target.fragment = relative.fragment, target; } function unescapeComponent(str, options) { return str && str.toString().replace(options && options.iri ? IRI_PROTOCOL.PCT_ENCODED : URI_PROTOCOL.PCT_ENCODED, pctDecChars); } var handler = { scheme: "http", domainHost: !0, parse: function(components, options) { return components.host || (components.error = components.error || "HTTP URIs must have a host."), components; }, serialize: function(components, options) { return components.port !== ("https" !== String(components.scheme).toLowerCase() ? 80 : 443) && "" !== components.port || (components.port = void 0), components.path || (components.path = "/"), components; } }, handler$1 = { scheme: "https", domainHost: handler.domainHost, parse: handler.parse, serialize: handler.serialize }, O = {}, UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", HEXDIG$$ = "[0-9A-Fa-f]", PCT_ENCODED$ = subexp(subexp("%[EFef][0-9A-Fa-f]%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f][0-9A-Fa-f]%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), VCHAR$$ = merge("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", '[\\"\\\\]'), UNRESERVED = new RegExp(UNRESERVED$$, "g"), PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"), NOT_LOCAL_PART = new RegExp(merge("[^]", "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", "[\\.]", '[\\"]', VCHAR$$), "g"), NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"), "g"), NOT_HFVALUE = NOT_HFNAME; function decodeUnreserved(str) { var decStr = pctDecChars(str); return decStr.match(UNRESERVED) ? decStr : str; } var handler$2 = { scheme: "mailto", parse: function(components, options) { var mailtoComponents = components, to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; if (mailtoComponents.path = void 0, mailtoComponents.query) { for (var unknownHeaders = !1, headers = {}, hfields = mailtoComponents.query.split("&"), x = 0, xl = hfields.length; x < xl; ++x) { var hfield = hfields[x].split("="); switch (hfield[0]) { case "to": for (var toAddrs = hfield[1].split(","), _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) to.push(toAddrs[_x]); break; case "subject": mailtoComponents.subject = unescapeComponent(hfield[1], options); break; case "body": mailtoComponents.body = unescapeComponent(hfield[1], options); break; default: unknownHeaders = !0, headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); } } unknownHeaders && (mailtoComponents.headers = headers); } mailtoComponents.query = void 0; for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { var addr = to[_x2].split("@"); if (addr[0] = unescapeComponent(addr[0]), options.unicodeSupport) addr[1] = unescapeComponent(addr[1], options).toLowerCase(); else try { addr[1] = punycode_toASCII(unescapeComponent(addr[1], options).toLowerCase()); } catch (e) { mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; } to[_x2] = addr.join("@"); } return mailtoComponents; }, serialize: function(mailtoComponents, options) { var obj, components = mailtoComponents, to = null != (obj = mailtoComponents.to) ? obj instanceof Array ? obj : "number" != typeof obj.length || obj.split || obj.setInterval || obj.call ? [ obj ] : Array.prototype.slice.call(obj) : []; if (to) { for (var x = 0, xl = to.length; x < xl; ++x) { var toAddr = String(to[x]), atIdx = toAddr.lastIndexOf("@"), localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar), domain = toAddr.slice(atIdx + 1); try { domain = options.iri ? punycode_toUnicode(domain) : punycode_toASCII(unescapeComponent(domain, options).toLowerCase()); } catch (e) { components.error = components.error || "Email address's domain name can not be converted to " + (options.iri ? "Unicode" : "ASCII") + " via punycode: " + e; } to[x] = localPart + "@" + domain; } components.path = to.join(","); } var headers = mailtoComponents.headers = mailtoComponents.headers || {}; mailtoComponents.subject && (headers.subject = mailtoComponents.subject), mailtoComponents.body && (headers.body = mailtoComponents.body); var fields = []; for (var name in headers) headers[name] !== O[name] && fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); return fields.length && (components.query = fields.join("&")), components; } }, URN_PARSE = /^([^\:]+)\:(.*)/, handler$3 = { scheme: "urn", parse: function(components, options) { var matches = components.path && components.path.match(URN_PARSE), urnComponents = components; if (matches) { var scheme = options.scheme || urnComponents.scheme || "urn", nid = matches[1].toLowerCase(), nss = matches[2], urnScheme = scheme + ":" + (options.nid || nid), schemeHandler = SCHEMES[urnScheme]; urnComponents.nid = nid, urnComponents.nss = nss, urnComponents.path = void 0, schemeHandler && (urnComponents = schemeHandler.parse(urnComponents, options)); } else urnComponents.error = urnComponents.error || "URN can not be parsed."; return urnComponents; }, serialize: function(urnComponents, options) { var scheme = options.scheme || urnComponents.scheme || "urn", nid = urnComponents.nid, urnScheme = scheme + ":" + (options.nid || nid), schemeHandler = SCHEMES[urnScheme]; schemeHandler && (urnComponents = schemeHandler.serialize(urnComponents, options)); var uriComponents = urnComponents, nss = urnComponents.nss; return uriComponents.path = (nid || options.nid) + ":" + nss, uriComponents; } }, UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, handler$4 = { scheme: "urn:uuid", parse: function(urnComponents, options) { var uuidComponents = urnComponents; return uuidComponents.uuid = uuidComponents.nss, uuidComponents.nss = void 0, options.tolerant || uuidComponents.uuid && uuidComponents.uuid.match(UUID) || (uuidComponents.error = uuidComponents.error || "UUID is not valid."), uuidComponents; }, serialize: function(uuidComponents, options) { var urnComponents = uuidComponents; return urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(), urnComponents; } }; SCHEMES[handler.scheme] = handler, SCHEMES[handler$1.scheme] = handler$1, SCHEMES[handler$2.scheme] = handler$2, SCHEMES[handler$3.scheme] = handler$3, SCHEMES[handler$4.scheme] = handler$4, exports.SCHEMES = SCHEMES, exports.pctEncChar = pctEncChar, exports.pctDecChars = pctDecChars, exports.parse = parse, exports.removeDotSegments = removeDotSegments, exports.serialize = serialize, exports.resolveComponents = resolveComponents, exports.resolve = function(baseURI, relativeURI, options) { var schemelessOptions = (function(target, source) { var obj = target; if (source) for (var key in source) obj[key] = source[key]; return obj; })({ scheme: "null" }, options); return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, !0), schemelessOptions); }, exports.normalize = function(uri, options) { return "string" == typeof uri ? uri = serialize(parse(uri, options), options) : "object" === typeOf(uri) && (uri = parse(serialize(uri, options), options)), uri; }, exports.equal = function(uriA, uriB, options) { return "string" == typeof uriA ? uriA = serialize(parse(uriA, options), options) : "object" === typeOf(uriA) && (uriA = serialize(uriA, options)), "string" == typeof uriB ? uriB = serialize(parse(uriB, options), options) : "object" === typeOf(uriB) && (uriB = serialize(uriB, options)), uriA === uriB; }, exports.escapeComponent = function(str, options) { return str && str.toString().replace(options && options.iri ? IRI_PROTOCOL.ESCAPE : URI_PROTOCOL.ESCAPE, pctEncChar); }, exports.unescapeComponent = unescapeComponent, Object.defineProperty(exports, "__esModule", { value: !0 }); })(exports); }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(str) { for (var value, length = 0, len = str.length, pos = 0; pos < len; ) length++, (value = str.charCodeAt(pos++)) >= 55296 && value <= 56319 && pos < len && 56320 == (64512 & (value = str.charCodeAt(pos))) && pos++; return length; }; }, function(module, exports, __webpack_require__) { "use strict"; var traverse = module.exports = function(schema, opts, cb) { "function" == typeof opts && (cb = opts, opts = {}), _traverse(opts, "function" == typeof (cb = opts.cb || cb) ? cb : cb.pre || function() {}, cb.post || function() {}, schema, "", schema); }; function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (schema && "object" == typeof schema && !Array.isArray(schema)) { for (var key in pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex), schema) { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) for (var i = 0; i < sch.length; i++) _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i); } else if (key in traverse.propsKeywords) { if (sch && "object" == typeof sch) for (var prop in sch) _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + prop.replace(/~/g, "~0").replace(/\//g, "~1"), rootSchema, jsonPtr, key, schema, prop); } else (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) && _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema); } post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); } } traverse.keywords = { additionalItems: !0, items: !0, contains: !0, additionalProperties: !0, propertyNames: !0, not: !0 }, traverse.arrayKeywords = { items: !0, allOf: !0, anyOf: !0, oneOf: !0 }, traverse.propsKeywords = { definitions: !0, properties: !0, patternProperties: !0, dependencies: !0 }, traverse.skipKeywords = { default: !0, enum: !0, const: !0, required: !0, maximum: !0, minimum: !0, exclusiveMaximum: !0, exclusiveMinimum: !0, multipleOf: !0, maxLength: !0, minLength: !0, pattern: !0, format: !0, maxItems: !0, minItems: !0, uniqueItems: !0, maxProperties: !0, minProperties: !0 }; }, function(module, exports, __webpack_require__) { "use strict"; var Cache = module.exports = function() { this._cache = {}; }; Cache.prototype.put = function(key, value) { this._cache[key] = value; }, Cache.prototype.get = function(key) { return this._cache[key]; }, Cache.prototype.del = function(key) { delete this._cache[key]; }, Cache.prototype.clear = function() { this._cache = {}; }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(91), DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, DAYS = [ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ], TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i, HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i, URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i, UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/, JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; function formats(mode) { return mode = "full" == mode ? "full" : "fast", util.copy(formats[mode]); } function date(str) { var matches = str.match(DATE); if (!matches) return !1; var year = +matches[1], month = +matches[2], day = +matches[3]; return month >= 1 && month <= 12 && day >= 1 && day <= (2 == month && (function(year) { return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); })(year) ? 29 : DAYS[month]); } function time(str, full) { var matches = str.match(TIME); if (!matches) return !1; var hour = matches[1], minute = matches[2], second = matches[3], timeZone = matches[5]; return (hour <= 23 && minute <= 59 && second <= 59 || 23 == hour && 59 == minute && 60 == second) && (!full || timeZone); } module.exports = formats, formats.fast = { date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, "date-time": /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i, "uri-reference": /^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, "uri-template": URITEMPLATE, url: URL, email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, hostname: HOSTNAME, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, uuid: UUID, "json-pointer": JSON_POINTER, "json-pointer-uri-fragment": JSON_POINTER_URI_FRAGMENT, "relative-json-pointer": RELATIVE_JSON_POINTER }, formats.full = { date: date, time: time, "date-time": function(str) { var dateTime = str.split(DATE_TIME_SEPARATOR); return 2 == dateTime.length && date(dateTime[0]) && time(dateTime[1], !0); }, uri: function(str) { return NOT_URI_FRAGMENT.test(str) && URI.test(str); }, "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, "uri-template": URITEMPLATE, url: URL, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: function(str) { return str.length <= 255 && HOSTNAME.test(str); }, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, uuid: UUID, "json-pointer": JSON_POINTER, "json-pointer-uri-fragment": JSON_POINTER_URI_FRAGMENT, "relative-json-pointer": RELATIVE_JSON_POINTER }; var DATE_TIME_SEPARATOR = /t|\s/i, NOT_URI_FRAGMENT = /\/|:/, Z_ANCHOR = /[^\\]\\Z/; function regex(str) { if (Z_ANCHOR.test(str)) return !1; try { return new RegExp(str), !0; } catch (e) { return !1; } } }, function(module, exports, __webpack_require__) { "use strict"; var ruleModules = __webpack_require__(1175), toHash = __webpack_require__(91).toHash; module.exports = function() { var RULES = [ { type: "number", rules: [ { maximum: [ "exclusiveMaximum" ] }, { minimum: [ "exclusiveMinimum" ] }, "multipleOf", "format" ] }, { type: "string", rules: [ "maxLength", "minLength", "pattern", "format" ] }, { type: "array", rules: [ "maxItems", "minItems", "items", "contains", "uniqueItems" ] }, { type: "object", rules: [ "maxProperties", "minProperties", "required", "dependencies", "propertyNames", { properties: [ "additionalProperties", "patternProperties" ] } ] }, { rules: [ "$ref", "const", "enum", "not", "anyOf", "oneOf", "allOf", "if" ] } ], ALL = [ "type", "$comment" ]; return RULES.all = toHash(ALL), RULES.types = toHash([ "number", "integer", "string", "array", "object", "boolean", "null" ]), RULES.forEach((function(group) { group.rules = group.rules.map((function(keyword) { var implKeywords; if ("object" == typeof keyword) { var key = Object.keys(keyword)[0]; implKeywords = keyword[key], keyword = key, implKeywords.forEach((function(k) { ALL.push(k), RULES.all[k] = !0; })); } return ALL.push(keyword), RULES.all[keyword] = { keyword: keyword, code: ruleModules[keyword], implements: implKeywords }; })), RULES.all.$comment = { keyword: "$comment", code: ruleModules.$comment }, group.type && (RULES.types[group.type] = group); })), RULES.keywords = toHash(ALL.concat([ "$schema", "$id", "id", "$data", "$async", "title", "description", "default", "definitions", "examples", "readOnly", "writeOnly", "contentMediaType", "contentEncoding", "additionalItems", "then", "else" ])), RULES.custom = {}, RULES; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = { $ref: __webpack_require__(1176), allOf: __webpack_require__(1177), anyOf: __webpack_require__(1178), $comment: __webpack_require__(1179), const: __webpack_require__(1180), contains: __webpack_require__(1181), dependencies: __webpack_require__(1182), enum: __webpack_require__(1183), format: __webpack_require__(1184), if: __webpack_require__(1185), items: __webpack_require__(1186), maximum: __webpack_require__(541), minimum: __webpack_require__(541), maxItems: __webpack_require__(542), minItems: __webpack_require__(542), maxLength: __webpack_require__(543), minLength: __webpack_require__(543), maxProperties: __webpack_require__(544), minProperties: __webpack_require__(544), multipleOf: __webpack_require__(1187), not: __webpack_require__(1188), oneOf: __webpack_require__(1189), pattern: __webpack_require__(1190), properties: __webpack_require__(1191), propertyNames: __webpack_require__(1192), required: __webpack_require__(1193), uniqueItems: __webpack_require__(1194), validate: __webpack_require__(540) }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $async, $refCode, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl; if ("#" == $schema || "#/" == $schema) it.isRoot ? ($async = it.async, $refCode = "validate") : ($async = !0 === it.root.schema.$async, $refCode = "root.refVal[0]"); else { var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); if (void 0 === $refVal) { var $message = it.MissingRefError.message(it.baseId, $schema); if ("fail" == it.opts.missingRefs) { it.logger.error($message), ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: '$ref' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { ref: '" + it.util.escapeQuotes($schema) + "' } ", !1 !== it.opts.messages && (out += " , message: 'can\\'t resolve reference " + it.util.escapeQuotes($schema) + "' "), it.opts.verbose && (out += " , schema: " + it.util.toQuotedString($schema) + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", $breakOnError && (out += " if (false) { "); } else { if ("ignore" != it.opts.missingRefs) throw new it.MissingRefError(it.baseId, $schema, $message); it.logger.warn($message), $breakOnError && (out += " if (true) { "); } } else if ($refVal.inline) { var $it = it.util.copy(it); $it.level++; var $nextValid = "valid" + $it.level; $it.schema = $refVal.schema, $it.schemaPath = "", $it.errSchemaPath = $schema, out += " " + it.validate($it).replace(/validate\.schema/g, $refVal.code) + " ", $breakOnError && (out += " if (" + $nextValid + ") { "); } else $async = !0 === $refVal.$async || it.async && !1 !== $refVal.$async, $refCode = $refVal.code; } if ($refCode) { var $$outStack; ($$outStack = $$outStack || []).push(out), out = "", it.opts.passContext ? out += " " + $refCode + ".call(this, " : out += " " + $refCode + "( ", out += " " + $data + ", (dataPath || '')", '""' != it.errorPath && (out += " + " + it.errorPath); var __callValidate = out += " , " + ($dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData") + " , " + ($dataLvl ? it.dataPathArr[$dataLvl] : "parentDataProperty") + ", rootData) "; if (out = $$outStack.pop(), $async) { if (!it.async) throw new Error("async schema referenced by sync schema"); $breakOnError && (out += " var " + $valid + "; "), out += " try { await " + __callValidate + "; ", $breakOnError && (out += " " + $valid + " = true; "), out += " } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ", $breakOnError && (out += " " + $valid + " = false; "), out += " } ", $breakOnError && (out += " if (" + $valid + ") { "); } else out += " if (!" + __callValidate + ") { if (vErrors === null) vErrors = " + $refCode + ".errors; else vErrors = vErrors.concat(" + $refCode + ".errors); errors = vErrors.length; } ", $breakOnError && (out += " else { "); } return out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $it = it.util.copy(it), $closingBraces = ""; $it.level++; var $nextValid = "valid" + $it.level, $currentBaseId = $it.baseId, $allSchemasEmpty = !0, arr1 = $schema; if (arr1) for (var $sch, $i = -1, l1 = arr1.length - 1; $i < l1; ) $sch = arr1[$i += 1], it.util.schemaHasRules($sch, it.RULES.all) && ($allSchemasEmpty = !1, $it.schema = $sch, $it.schemaPath = $schemaPath + "[" + $i + "]", $it.errSchemaPath = $errSchemaPath + "/" + $i, out += " " + it.validate($it) + " ", $it.baseId = $currentBaseId, $breakOnError && (out += " if (" + $nextValid + ") { ", $closingBraces += "}")); return $breakOnError && (out += $allSchemasEmpty ? " if (true) { " : " " + $closingBraces.slice(0, -1) + " "), it.util.cleanUpCode(out); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $errs = "errs__" + $lvl, $it = it.util.copy(it), $closingBraces = ""; $it.level++; var $nextValid = "valid" + $it.level, $noEmptySchema = $schema.every((function($sch) { return it.util.schemaHasRules($sch, it.RULES.all); })); if ($noEmptySchema) { var $currentBaseId = $it.baseId; out += " var " + $errs + " = errors; var " + $valid + " = false; "; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = !0; var arr1 = $schema; if (arr1) for (var $sch, $i = -1, l1 = arr1.length - 1; $i < l1; ) $sch = arr1[$i += 1], $it.schema = $sch, $it.schemaPath = $schemaPath + "[" + $i + "]", $it.errSchemaPath = $errSchemaPath + "/" + $i, out += " " + it.validate($it) + " ", $it.baseId = $currentBaseId, out += " " + $valid + " = " + $valid + " || " + $nextValid + "; if (!" + $valid + ") { ", $closingBraces += "}"; it.compositeRule = $it.compositeRule = $wasComposite, out += " " + $closingBraces + " if (!" + $valid + ") { var err = ", !1 !== it.createErrors ? (out += " { keyword: 'anyOf' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ", !1 !== it.opts.messages && (out += " , message: 'should match some schema in anyOf' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !it.compositeRule && $breakOnError && (it.async ? out += " throw new ValidationError(vErrors); " : out += " validate.errors = vErrors; return false; "), out += " } else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } ", it.opts.allErrors && (out += " } "), out = it.util.cleanUpCode(out); } else $breakOnError && (out += " if (true) { "); return out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $schema = it.schema[$keyword], $errSchemaPath = it.errSchemaPath + "/" + $keyword, $comment = (it.opts.allErrors, it.util.toQuotedString($schema)); return !0 === it.opts.$comment ? out += " console.log(" + $comment + ");" : "function" == typeof it.opts.$comment && (out += " self._opts.$comment(" + $comment + ", " + it.util.toQuotedString($errSchemaPath) + ", validate.root.schema);"), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $isData = it.opts.$data && $schema && $schema.$data; $isData && (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; "), $isData || (out += " var schema" + $lvl + " = validate.schema" + $schemaPath + ";"), out += "var " + $valid + " = equal(" + $data + ", schema" + $lvl + "); if (!" + $valid + ") { "; var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'const' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { allowedValue: schema" + $lvl + " } ", !1 !== it.opts.messages && (out += " , message: 'should be equal to constant' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " }", $breakOnError && (out += " else { "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $errs = "errs__" + $lvl, $it = it.util.copy(it); $it.level++; var $nextValid = "valid" + $it.level, $idx = "i" + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = "data" + $dataNxt, $currentBaseId = it.baseId, $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all); if (out += "var " + $errs + " = errors;var " + $valid + ";", $nonEmptySchema) { var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = !0, $it.schema = $schema, $it.schemaPath = $schemaPath, $it.errSchemaPath = $errSchemaPath, out += " var " + $nextValid + " = false; for (var " + $idx + " = 0; " + $idx + " < " + $data + ".length; " + $idx + "++) { ", $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, !0); var $passData = $data + "[" + $idx + "]"; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2 ? out += " " + it.util.varReplace($code, $nextData, $passData) + " " : out += " var " + $nextData + " = " + $passData + "; " + $code + " ", out += " if (" + $nextValid + ") break; } ", it.compositeRule = $it.compositeRule = $wasComposite, out += " if (!" + $nextValid + ") {"; } else out += " if (" + $data + ".length == 0) {"; var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'contains' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ", !1 !== it.opts.messages && (out += " , message: 'should contain a valid item' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } else { ", $nonEmptySchema && (out += " errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } "), it.opts.allErrors && (out += " } "), it.util.cleanUpCode(out); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $errs = "errs__" + $lvl, $it = it.util.copy(it), $closingBraces = ""; $it.level++; var $nextValid = "valid" + $it.level, $schemaDeps = {}, $propertyDeps = {}, $ownProperties = it.opts.ownProperties; for ($property in $schema) { var $sch = $schema[$property], $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; $deps[$property] = $sch; } out += "var " + $errs + " = errors;"; var $currentErrorPath = it.errorPath; for (var $property in out += "var missing" + $lvl + ";", $propertyDeps) if (($deps = $propertyDeps[$property]).length) { if (out += " if ( " + $data + it.util.getProperty($property) + " !== undefined ", $ownProperties && (out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($property) + "') "), $breakOnError) { out += " && ( "; var arr1 = $deps; if (arr1) for (var $i = -1, l1 = arr1.length - 1; $i < l1; ) $propertyKey = arr1[$i += 1], $i && (out += " || "), out += " ( ( " + ($useData = $data + ($prop = it.util.getProperty($propertyKey))) + " === undefined ", $ownProperties && (out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') "), out += ") && (missing" + $lvl + " = " + it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) + ") ) "; out += ")) { "; var $propertyPath = "missing" + $lvl, $missingProperty = "' + " + $propertyPath + " + '"; it.opts._errorDataPathProperty && (it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, !0) : $currentErrorPath + " + " + $propertyPath); var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { property: '" + it.util.escapeQuotes($property) + "', missingProperty: '" + $missingProperty + "', depsCount: " + $deps.length + ", deps: '" + it.util.escapeQuotes(1 == $deps.length ? $deps[0] : $deps.join(", ")) + "' } ", !1 !== it.opts.messages && (out += " , message: 'should have ", 1 == $deps.length ? out += "property " + it.util.escapeQuotes($deps[0]) : out += "properties " + it.util.escapeQuotes($deps.join(", ")), out += " when property " + it.util.escapeQuotes($property) + " is present' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; } else { out += " ) { "; var arr2 = $deps; if (arr2) for (var $propertyKey, i2 = -1, l2 = arr2.length - 1; i2 < l2; ) { $propertyKey = arr2[i2 += 1]; var $prop = it.util.getProperty($propertyKey), $useData = ($missingProperty = it.util.escapeQuotes($propertyKey), $data + $prop); it.opts._errorDataPathProperty && (it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers)), out += " if ( " + $useData + " === undefined ", $ownProperties && (out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') "), out += ") { var err = ", !1 !== it.createErrors ? (out += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { property: '" + it.util.escapeQuotes($property) + "', missingProperty: '" + $missingProperty + "', depsCount: " + $deps.length + ", deps: '" + it.util.escapeQuotes(1 == $deps.length ? $deps[0] : $deps.join(", ")) + "' } ", !1 !== it.opts.messages && (out += " , message: 'should have ", 1 == $deps.length ? out += "property " + it.util.escapeQuotes($deps[0]) : out += "properties " + it.util.escapeQuotes($deps.join(", ")), out += " when property " + it.util.escapeQuotes($property) + " is present' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "; } } out += " } ", $breakOnError && ($closingBraces += "}", out += " else { "); } it.errorPath = $currentErrorPath; var $currentBaseId = $it.baseId; for (var $property in $schemaDeps) $sch = $schemaDeps[$property], it.util.schemaHasRules($sch, it.RULES.all) && (out += " " + $nextValid + " = true; if ( " + $data + it.util.getProperty($property) + " !== undefined ", $ownProperties && (out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($property) + "') "), out += ") { ", $it.schema = $sch, $it.schemaPath = $schemaPath + it.util.getProperty($property), $it.errSchemaPath = $errSchemaPath + "/" + it.util.escapeFragment($property), out += " " + it.validate($it) + " ", $it.baseId = $currentBaseId, out += " } ", $breakOnError && (out += " if (" + $nextValid + ") { ", $closingBraces += "}")); return $breakOnError && (out += " " + $closingBraces + " if (" + $errs + " == errors) {"), it.util.cleanUpCode(out); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $isData = it.opts.$data && $schema && $schema.$data; $isData && (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; "); var $i = "i" + $lvl, $vSchema = "schema" + $lvl; $isData || (out += " var " + $vSchema + " = validate.schema" + $schemaPath + ";"), out += "var " + $valid + ";", $isData && (out += " if (schema" + $lvl + " === undefined) " + $valid + " = true; else if (!Array.isArray(schema" + $lvl + ")) " + $valid + " = false; else {"), out += $valid + " = false;for (var " + $i + "=0; " + $i + "<" + $vSchema + ".length; " + $i + "++) if (equal(" + $data + ", " + $vSchema + "[" + $i + "])) { " + $valid + " = true; break; }", $isData && (out += " } "), out += " if (!" + $valid + ") { "; var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'enum' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { allowedValues: schema" + $lvl + " } ", !1 !== it.opts.messages && (out += " , message: 'should be equal to one of the allowed values' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " }", $breakOnError && (out += " else { "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""); if (!1 === it.opts.format) return $breakOnError && (out += " if (true) { "), out; var $schemaValue, $isData = it.opts.$data && $schema && $schema.$data; $isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema; var $unknownFormats = it.opts.unknownFormats, $allowUnknown = Array.isArray($unknownFormats); if ($isData) out += " var " + ($format = "format" + $lvl) + " = formats[" + $schemaValue + "]; var " + ($isObject = "isObject" + $lvl) + " = typeof " + $format + " == 'object' && !(" + $format + " instanceof RegExp) && " + $format + ".validate; var " + ($formatType = "formatType" + $lvl) + " = " + $isObject + " && " + $format + ".type || 'string'; if (" + $isObject + ") { ", it.async && (out += " var async" + $lvl + " = " + $format + ".async; "), out += " " + $format + " = " + $format + ".validate; } if ( ", $isData && (out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'string') || "), out += " (", "ignore" != $unknownFormats && (out += " (" + $schemaValue + " && !" + $format + " ", $allowUnknown && (out += " && self._opts.unknownFormats.indexOf(" + $schemaValue + ") == -1 "), out += ") || "), out += " (" + $format + " && " + $formatType + " == '" + $ruleType + "' && !(typeof " + $format + " == 'function' ? ", it.async ? out += " (async" + $lvl + " ? await " + $format + "(" + $data + ") : " + $format + "(" + $data + ")) " : out += " " + $format + "(" + $data + ") ", out += " : " + $format + ".test(" + $data + "))))) {"; else { var $format; if (!($format = it.formats[$schema])) { if ("ignore" == $unknownFormats) return it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'), $breakOnError && (out += " if (true) { "), out; if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) return $breakOnError && (out += " if (true) { "), out; throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); } var $isObject, $formatType = ($isObject = "object" == typeof $format && !($format instanceof RegExp) && $format.validate) && $format.type || "string"; if ($isObject) { var $async = !0 === $format.async; $format = $format.validate; } if ($formatType != $ruleType) return $breakOnError && (out += " if (true) { "), out; if ($async) { if (!it.async) throw new Error("async format in sync schema"); out += " if (!(await " + ($formatRef = "formats" + it.util.getProperty($schema) + ".validate") + "(" + $data + "))) { "; } else { out += " if (! "; var $formatRef = "formats" + it.util.getProperty($schema); $isObject && ($formatRef += ".validate"), out += "function" == typeof $format ? " " + $formatRef + "(" + $data + ") " : " " + $formatRef + ".test(" + $data + ") ", out += ") { "; } } var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'format' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { format: ", out += $isData ? "" + $schemaValue : "" + it.util.toQuotedString($schema), out += " } ", !1 !== it.opts.messages && (out += " , message: 'should match format \"", out += $isData ? "' + " + $schemaValue + " + '" : "" + it.util.escapeQuotes($schema), out += "\"' "), it.opts.verbose && (out += " , schema: ", out += $isData ? "validate.schema" + $schemaPath : "" + it.util.toQuotedString($schema), out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } ", $breakOnError && (out += " else { "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $errs = "errs__" + $lvl, $it = it.util.copy(it); $it.level++; var $nextValid = "valid" + $it.level, $thenSch = it.schema.then, $elseSch = it.schema.else, $thenPresent = void 0 !== $thenSch && it.util.schemaHasRules($thenSch, it.RULES.all), $elsePresent = void 0 !== $elseSch && it.util.schemaHasRules($elseSch, it.RULES.all), $currentBaseId = $it.baseId; if ($thenPresent || $elsePresent) { var $ifClause; $it.createErrors = !1, $it.schema = $schema, $it.schemaPath = $schemaPath, $it.errSchemaPath = $errSchemaPath, out += " var " + $errs + " = errors; var " + $valid + " = true; "; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = !0, out += " " + it.validate($it) + " ", $it.baseId = $currentBaseId, $it.createErrors = !0, out += " errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } ", it.compositeRule = $it.compositeRule = $wasComposite, $thenPresent ? (out += " if (" + $nextValid + ") { ", $it.schema = it.schema.then, $it.schemaPath = it.schemaPath + ".then", $it.errSchemaPath = it.errSchemaPath + "/then", out += " " + it.validate($it) + " ", $it.baseId = $currentBaseId, out += " " + $valid + " = " + $nextValid + "; ", $thenPresent && $elsePresent ? out += " var " + ($ifClause = "ifClause" + $lvl) + " = 'then'; " : $ifClause = "'then'", out += " } ", $elsePresent && (out += " else { ")) : out += " if (!" + $nextValid + ") { ", $elsePresent && ($it.schema = it.schema.else, $it.schemaPath = it.schemaPath + ".else", $it.errSchemaPath = it.errSchemaPath + "/else", out += " " + it.validate($it) + " ", $it.baseId = $currentBaseId, out += " " + $valid + " = " + $nextValid + "; ", $thenPresent && $elsePresent ? out += " var " + ($ifClause = "ifClause" + $lvl) + " = 'else'; " : $ifClause = "'else'", out += " } "), out += " if (!" + $valid + ") { var err = ", !1 !== it.createErrors ? (out += " { keyword: 'if' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { failingKeyword: " + $ifClause + " } ", !1 !== it.opts.messages && (out += " , message: 'should match \"' + " + $ifClause + " + '\" schema' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !it.compositeRule && $breakOnError && (it.async ? out += " throw new ValidationError(vErrors); " : out += " validate.errors = vErrors; return false; "), out += " } ", $breakOnError && (out += " else { "), out = it.util.cleanUpCode(out); } else $breakOnError && (out += " if (true) { "); return out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $errs = "errs__" + $lvl, $it = it.util.copy(it), $closingBraces = ""; $it.level++; var $nextValid = "valid" + $it.level, $idx = "i" + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = "data" + $dataNxt, $currentBaseId = it.baseId; if (out += "var " + $errs + " = errors;var " + $valid + ";", Array.isArray($schema)) { var $additionalItems = it.schema.additionalItems; if (!1 === $additionalItems) { out += " " + $valid + " = " + $data + ".length <= " + $schema.length + "; "; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + "/additionalItems", out += " if (!" + $valid + ") { "; var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'additionalItems' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schema.length + " } ", !1 !== it.opts.messages && (out += " , message: 'should NOT have more than " + $schema.length + " items' "), it.opts.verbose && (out += " , schema: false , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } ", $errSchemaPath = $currErrSchemaPath, $breakOnError && ($closingBraces += "}", out += " else { "); } var arr1 = $schema; if (arr1) for (var $sch, $i = -1, l1 = arr1.length - 1; $i < l1; ) if ($sch = arr1[$i += 1], it.util.schemaHasRules($sch, it.RULES.all)) { out += " " + $nextValid + " = true; if (" + $data + ".length > " + $i + ") { "; var $passData = $data + "[" + $i + "]"; $it.schema = $sch, $it.schemaPath = $schemaPath + "[" + $i + "]", $it.errSchemaPath = $errSchemaPath + "/" + $i, $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, !0), $it.dataPathArr[$dataNxt] = $i; var $code = it.validate($it); $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2 ? out += " " + it.util.varReplace($code, $nextData, $passData) + " " : out += " var " + $nextData + " = " + $passData + "; " + $code + " ", out += " } ", $breakOnError && (out += " if (" + $nextValid + ") { ", $closingBraces += "}"); } "object" == typeof $additionalItems && it.util.schemaHasRules($additionalItems, it.RULES.all) && ($it.schema = $additionalItems, $it.schemaPath = it.schemaPath + ".additionalItems", $it.errSchemaPath = it.errSchemaPath + "/additionalItems", out += " " + $nextValid + " = true; if (" + $data + ".length > " + $schema.length + ") { for (var " + $idx + " = " + $schema.length + "; " + $idx + " < " + $data + ".length; " + $idx + "++) { ", $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, !0), $passData = $data + "[" + $idx + "]", $it.dataPathArr[$dataNxt] = $idx, $code = it.validate($it), $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2 ? out += " " + it.util.varReplace($code, $nextData, $passData) + " " : out += " var " + $nextData + " = " + $passData + "; " + $code + " ", $breakOnError && (out += " if (!" + $nextValid + ") break; "), out += " } } ", $breakOnError && (out += " if (" + $nextValid + ") { ", $closingBraces += "}")); } else it.util.schemaHasRules($schema, it.RULES.all) && ($it.schema = $schema, $it.schemaPath = $schemaPath, $it.errSchemaPath = $errSchemaPath, out += " for (var " + $idx + " = 0; " + $idx + " < " + $data + ".length; " + $idx + "++) { ", $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, !0), $passData = $data + "[" + $idx + "]", $it.dataPathArr[$dataNxt] = $idx, $code = it.validate($it), $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2 ? out += " " + it.util.varReplace($code, $nextData, $passData) + " " : out += " var " + $nextData + " = " + $passData + "; " + $code + " ", $breakOnError && (out += " if (!" + $nextValid + ") break; "), out += " }"); return $breakOnError && (out += " " + $closingBraces + " if (" + $errs + " == errors) {"), it.util.cleanUpCode(out); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $schemaValue, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $isData = it.opts.$data && $schema && $schema.$data; $isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema, out += "var division" + $lvl + ";if (", $isData && (out += " " + $schemaValue + " !== undefined && ( typeof " + $schemaValue + " != 'number' || "), out += " (division" + $lvl + " = " + $data + " / " + $schemaValue + ", ", it.opts.multipleOfPrecision ? out += " Math.abs(Math.round(division" + $lvl + ") - division" + $lvl + ") > 1e-" + it.opts.multipleOfPrecision + " " : out += " division" + $lvl + " !== parseInt(division" + $lvl + ") ", out += " ) ", $isData && (out += " ) "), out += " ) { "; var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'multipleOf' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { multipleOf: " + $schemaValue + " } ", !1 !== it.opts.messages && (out += " , message: 'should be multiple of ", out += $isData ? "' + " + $schemaValue : $schemaValue + "'"), it.opts.verbose && (out += " , schema: ", out += $isData ? "validate.schema" + $schemaPath : "" + $schema, out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += "} ", $breakOnError && (out += " else { "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $errs = "errs__" + $lvl, $it = it.util.copy(it); $it.level++; var $nextValid = "valid" + $it.level; if (it.util.schemaHasRules($schema, it.RULES.all)) { $it.schema = $schema, $it.schemaPath = $schemaPath, $it.errSchemaPath = $errSchemaPath, out += " var " + $errs + " = errors; "; var $allErrorsOption, $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = !0, $it.createErrors = !1, $it.opts.allErrors && ($allErrorsOption = $it.opts.allErrors, $it.opts.allErrors = !1), out += " " + it.validate($it) + " ", $it.createErrors = !0, $allErrorsOption && ($it.opts.allErrors = $allErrorsOption), it.compositeRule = $it.compositeRule = $wasComposite, out += " if (" + $nextValid + ") { "; var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'not' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ", !1 !== it.opts.messages && (out += " , message: 'should NOT be valid' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } ", it.opts.allErrors && (out += " } "); } else out += " var err = ", !1 !== it.createErrors ? (out += " { keyword: 'not' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ", !1 !== it.opts.messages && (out += " , message: 'should NOT be valid' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", $breakOnError && (out += " if (false) { "); return out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $errs = "errs__" + $lvl, $it = it.util.copy(it), $closingBraces = ""; $it.level++; var $nextValid = "valid" + $it.level, $currentBaseId = $it.baseId, $prevValid = "prevValid" + $lvl, $passingSchemas = "passingSchemas" + $lvl; out += "var " + $errs + " = errors , " + $prevValid + " = false , " + $valid + " = false , " + $passingSchemas + " = null; "; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = !0; var arr1 = $schema; if (arr1) for (var $sch, $i = -1, l1 = arr1.length - 1; $i < l1; ) $sch = arr1[$i += 1], it.util.schemaHasRules($sch, it.RULES.all) ? ($it.schema = $sch, $it.schemaPath = $schemaPath + "[" + $i + "]", $it.errSchemaPath = $errSchemaPath + "/" + $i, out += " " + it.validate($it) + " ", $it.baseId = $currentBaseId) : out += " var " + $nextValid + " = true; ", $i && (out += " if (" + $nextValid + " && " + $prevValid + ") { " + $valid + " = false; " + $passingSchemas + " = [" + $passingSchemas + ", " + $i + "]; } else { ", $closingBraces += "}"), out += " if (" + $nextValid + ") { " + $valid + " = " + $prevValid + " = true; " + $passingSchemas + " = " + $i + "; }"; return it.compositeRule = $it.compositeRule = $wasComposite, out += $closingBraces + "if (!" + $valid + ") { var err = ", !1 !== it.createErrors ? (out += " { keyword: 'oneOf' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { passingSchemas: " + $passingSchemas + " } ", !1 !== it.opts.messages && (out += " , message: 'should match exactly one schema in oneOf' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !it.compositeRule && $breakOnError && (it.async ? out += " throw new ValidationError(vErrors); " : out += " validate.errors = vErrors; return false; "), out += "} else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; }", it.opts.allErrors && (out += " } "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $schemaValue, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $isData = it.opts.$data && $schema && $schema.$data; $isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema, out += "if ( ", $isData && (out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'string') || "), out += " !" + ($isData ? "(new RegExp(" + $schemaValue + "))" : it.usePattern($schema)) + ".test(" + $data + ") ) { "; var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'pattern' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { pattern: ", out += $isData ? "" + $schemaValue : "" + it.util.toQuotedString($schema), out += " } ", !1 !== it.opts.messages && (out += " , message: 'should match pattern \"", out += $isData ? "' + " + $schemaValue + " + '" : "" + it.util.escapeQuotes($schema), out += "\"' "), it.opts.verbose && (out += " , schema: ", out += $isData ? "validate.schema" + $schemaPath : "" + it.util.toQuotedString($schema), out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; return out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += "} ", $breakOnError && (out += " else { "), out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $errs = "errs__" + $lvl, $it = it.util.copy(it), $closingBraces = ""; $it.level++; var $nextValid = "valid" + $it.level, $key = "key" + $lvl, $idx = "idx" + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = "data" + $dataNxt, $dataProperties = "dataProperties" + $lvl, $schemaKeys = Object.keys($schema || {}), $pProperties = it.schema.patternProperties || {}, $pPropertyKeys = Object.keys($pProperties), $aProperties = it.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = !1 === $aProperties, $additionalIsSchema = "object" == typeof $aProperties && Object.keys($aProperties).length, $removeAdditional = it.opts.removeAdditional, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId, $required = it.schema.required; if ($required && (!it.opts.$data || !$required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); if (out += "var " + $errs + " = errors;var " + $nextValid + " = true;", $ownProperties && (out += " var " + $dataProperties + " = undefined;"), $checkAdditional) { if (out += $ownProperties ? " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; " : " for (var " + $key + " in " + $data + ") { ", $someProperties) { if (out += " var isAdditional" + $lvl + " = !(false ", $schemaKeys.length) if ($schemaKeys.length > 8) out += " || validate.schema" + $schemaPath + ".hasOwnProperty(" + $key + ") "; else { var arr1 = $schemaKeys; if (arr1) for (var i1 = -1, l1 = arr1.length - 1; i1 < l1; ) $propertyKey = arr1[i1 += 1], out += " || " + $key + " == " + it.util.toQuotedString($propertyKey) + " "; } if ($pPropertyKeys.length) { var arr2 = $pPropertyKeys; if (arr2) for (var $i = -1, l2 = arr2.length - 1; $i < l2; ) $pProperty = arr2[$i += 1], out += " || " + it.usePattern($pProperty) + ".test(" + $key + ") "; } out += " ); if (isAdditional" + $lvl + ") { "; } if ("all" == $removeAdditional) out += " delete " + $data + "[" + $key + "]; "; else { var $currentErrorPath = it.errorPath, $additionalProperty = "' + " + $key + " + '"; if (it.opts._errorDataPathProperty && (it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers)), $noAdditional) if ($removeAdditional) out += " delete " + $data + "[" + $key + "]; "; else { out += " " + $nextValid + " = false; "; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + "/additionalProperties", ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'additionalProperties' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { additionalProperty: '" + $additionalProperty + "' } ", !1 !== it.opts.messages && (out += " , message: '", it.opts._errorDataPathProperty ? out += "is an invalid additional property" : out += "should NOT have additional properties", out += "' "), it.opts.verbose && (out += " , schema: false , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", $errSchemaPath = $currErrSchemaPath, $breakOnError && (out += " break; "); } else if ($additionalIsSchema) if ("failing" == $removeAdditional) { out += " var " + $errs + " = errors; "; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = !0, $it.schema = $aProperties, $it.schemaPath = it.schemaPath + ".additionalProperties", $it.errSchemaPath = it.errSchemaPath + "/additionalProperties", $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + "[" + $key + "]"; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2 ? out += " " + it.util.varReplace($code, $nextData, $passData) + " " : out += " var " + $nextData + " = " + $passData + "; " + $code + " ", out += " if (!" + $nextValid + ") { errors = " + $errs + "; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete " + $data + "[" + $key + "]; } ", it.compositeRule = $it.compositeRule = $wasComposite; } else $it.schema = $aProperties, $it.schemaPath = it.schemaPath + ".additionalProperties", $it.errSchemaPath = it.errSchemaPath + "/additionalProperties", $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers), $passData = $data + "[" + $key + "]", $it.dataPathArr[$dataNxt] = $key, $code = it.validate($it), $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2 ? out += " " + it.util.varReplace($code, $nextData, $passData) + " " : out += " var " + $nextData + " = " + $passData + "; " + $code + " ", $breakOnError && (out += " if (!" + $nextValid + ") break; "); it.errorPath = $currentErrorPath; } $someProperties && (out += " } "), out += " } ", $breakOnError && (out += " if (" + $nextValid + ") { ", $closingBraces += "}"); } var $useDefaults = it.opts.useDefaults && !it.compositeRule; if ($schemaKeys.length) { var arr3 = $schemaKeys; if (arr3) for (var $propertyKey, i3 = -1, l3 = arr3.length - 1; i3 < l3; ) { var $sch = $schema[$propertyKey = arr3[i3 += 1]]; if (it.util.schemaHasRules($sch, it.RULES.all)) { var $prop = it.util.getProperty($propertyKey), $hasDefault = ($passData = $data + $prop, $useDefaults && void 0 !== $sch.default); if ($it.schema = $sch, $it.schemaPath = $schemaPath + $prop, $it.errSchemaPath = $errSchemaPath + "/" + it.util.escapeFragment($propertyKey), $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers), $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey), $code = it.validate($it), $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2) { $code = it.util.varReplace($code, $nextData, $passData); var $useData = $passData; } else $useData = $nextData, out += " var " + $nextData + " = " + $passData + "; "; if ($hasDefault) out += " " + $code + " "; else { if ($requiredHash && $requiredHash[$propertyKey]) { out += " if ( " + $useData + " === undefined ", $ownProperties && (out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') "), out += ") { " + $nextValid + " = false; ", $currentErrorPath = it.errorPath, $currErrSchemaPath = $errSchemaPath; var $$outStack, $missingProperty = it.util.escapeQuotes($propertyKey); it.opts._errorDataPathProperty && (it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers)), $errSchemaPath = it.errSchemaPath + "/required", ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ", !1 !== it.opts.messages && (out += " , message: '", it.opts._errorDataPathProperty ? out += "is a required property" : out += "should have required property \\'" + $missingProperty + "\\'", out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", __err = out, out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", $errSchemaPath = $currErrSchemaPath, it.errorPath = $currentErrorPath, out += " } else { "; } else $breakOnError ? (out += " if ( " + $useData + " === undefined ", $ownProperties && (out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') "), out += ") { " + $nextValid + " = true; } else { ") : (out += " if (" + $useData + " !== undefined ", $ownProperties && (out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') "), out += " ) { "); out += " " + $code + " } "; } } $breakOnError && (out += " if (" + $nextValid + ") { ", $closingBraces += "}"); } } if ($pPropertyKeys.length) { var arr4 = $pPropertyKeys; if (arr4) for (var $pProperty, i4 = -1, l4 = arr4.length - 1; i4 < l4; ) $sch = $pProperties[$pProperty = arr4[i4 += 1]], it.util.schemaHasRules($sch, it.RULES.all) && ($it.schema = $sch, $it.schemaPath = it.schemaPath + ".patternProperties" + it.util.getProperty($pProperty), $it.errSchemaPath = it.errSchemaPath + "/patternProperties/" + it.util.escapeFragment($pProperty), out += $ownProperties ? " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; " : " for (var " + $key + " in " + $data + ") { ", out += " if (" + it.usePattern($pProperty) + ".test(" + $key + ")) { ", $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers), $passData = $data + "[" + $key + "]", $it.dataPathArr[$dataNxt] = $key, $code = it.validate($it), $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2 ? out += " " + it.util.varReplace($code, $nextData, $passData) + " " : out += " var " + $nextData + " = " + $passData + "; " + $code + " ", $breakOnError && (out += " if (!" + $nextValid + ") break; "), out += " } ", $breakOnError && (out += " else " + $nextValid + " = true; "), out += " } ", $breakOnError && (out += " if (" + $nextValid + ") { ", $closingBraces += "}")); } return $breakOnError && (out += " " + $closingBraces + " if (" + $errs + " == errors) {"), it.util.cleanUpCode(out); }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $errs = "errs__" + $lvl, $it = it.util.copy(it); $it.level++; var $nextValid = "valid" + $it.level; if (out += "var " + $errs + " = errors;", it.util.schemaHasRules($schema, it.RULES.all)) { $it.schema = $schema, $it.schemaPath = $schemaPath, $it.errSchemaPath = $errSchemaPath; var $key = "key" + $lvl, $idx = "idx" + $lvl, $i = "i" + $lvl, $invalidName = "' + " + $key + " + '", $nextData = "data" + ($it.dataLevel = it.dataLevel + 1), $dataProperties = "dataProperties" + $lvl, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; $ownProperties && (out += " var " + $dataProperties + " = undefined; "), out += $ownProperties ? " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; " : " for (var " + $key + " in " + $data + ") { ", out += " var startErrs" + $lvl + " = errors; "; var $passData = $key, $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = !0; var $code = it.validate($it); $it.baseId = $currentBaseId, it.util.varOccurences($code, $nextData) < 2 ? out += " " + it.util.varReplace($code, $nextData, $passData) + " " : out += " var " + $nextData + " = " + $passData + "; " + $code + " ", it.compositeRule = $it.compositeRule = $wasComposite, out += " if (!" + $nextValid + ") { for (var " + $i + "=startErrs" + $lvl + "; " + $i + "= it.opts.loopRequired, $ownProperties = it.opts.ownProperties; if ($breakOnError) if (out += " var missing" + $lvl + "; ", $loopRequired) { $isData || (out += " var " + $vSchema + " = validate.schema" + $schemaPath + "; "); var $missingProperty = "' + " + ($propertyPath = "schema" + $lvl + "[" + ($i = "i" + $lvl) + "]") + " + '"; it.opts._errorDataPathProperty && (it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers)), out += " var " + $valid + " = true; ", $isData && (out += " if (schema" + $lvl + " === undefined) " + $valid + " = true; else if (!Array.isArray(schema" + $lvl + ")) " + $valid + " = false; else {"), out += " for (var " + $i + " = 0; " + $i + " < " + $vSchema + ".length; " + $i + "++) { " + $valid + " = " + $data + "[" + $vSchema + "[" + $i + "]] !== undefined ", $ownProperties && (out += " && Object.prototype.hasOwnProperty.call(" + $data + ", " + $vSchema + "[" + $i + "]) "), out += "; if (!" + $valid + ") break; } ", $isData && (out += " } "), out += " if (!" + $valid + ") { ", ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ", !1 !== it.opts.messages && (out += " , message: '", it.opts._errorDataPathProperty ? out += "is a required property" : out += "should have required property \\'" + $missingProperty + "\\'", out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } else { "; } else { out += " if ( "; var $$outStack, arr2 = $required; if (arr2) for (var $i = -1, l2 = arr2.length - 1; $i < l2; ) $propertyKey = arr2[$i += 1], $i && (out += " || "), out += " ( ( " + ($useData = $data + ($prop = it.util.getProperty($propertyKey))) + " === undefined ", $ownProperties && (out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') "), out += ") && (missing" + $lvl + " = " + it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) + ") ) "; out += ") { ", $missingProperty = "' + " + ($propertyPath = "missing" + $lvl) + " + '", it.opts._errorDataPathProperty && (it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, !0) : $currentErrorPath + " + " + $propertyPath), ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ", !1 !== it.opts.messages && (out += " , message: '", it.opts._errorDataPathProperty ? out += "is a required property" : out += "should have required property \\'" + $missingProperty + "\\'", out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", __err = out, out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } else { "; } else if ($loopRequired) { var $propertyPath; $isData || (out += " var " + $vSchema + " = validate.schema" + $schemaPath + "; "), $missingProperty = "' + " + ($propertyPath = "schema" + $lvl + "[" + ($i = "i" + $lvl) + "]") + " + '", it.opts._errorDataPathProperty && (it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers)), $isData && (out += " if (" + $vSchema + " && !Array.isArray(" + $vSchema + ")) { var err = ", !1 !== it.createErrors ? (out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ", !1 !== it.opts.messages && (out += " , message: '", it.opts._errorDataPathProperty ? out += "is a required property" : out += "should have required property \\'" + $missingProperty + "\\'", out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (" + $vSchema + " !== undefined) { "), out += " for (var " + $i + " = 0; " + $i + " < " + $vSchema + ".length; " + $i + "++) { if (" + $data + "[" + $vSchema + "[" + $i + "]] === undefined ", $ownProperties && (out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", " + $vSchema + "[" + $i + "]) "), out += ") { var err = ", !1 !== it.createErrors ? (out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ", !1 !== it.opts.messages && (out += " , message: '", it.opts._errorDataPathProperty ? out += "is a required property" : out += "should have required property \\'" + $missingProperty + "\\'", out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ", $isData && (out += " } "); } else { var arr3 = $required; if (arr3) for (var $propertyKey, i3 = -1, l3 = arr3.length - 1; i3 < l3; ) { $propertyKey = arr3[i3 += 1]; var $prop = it.util.getProperty($propertyKey), $useData = ($missingProperty = it.util.escapeQuotes($propertyKey), $data + $prop); it.opts._errorDataPathProperty && (it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers)), out += " if ( " + $useData + " === undefined ", $ownProperties && (out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') "), out += ") { var err = ", !1 !== it.createErrors ? (out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ", !1 !== it.opts.messages && (out += " , message: '", it.opts._errorDataPathProperty ? out += "is a required property" : out += "should have required property \\'" + $missingProperty + "\\'", out += "' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} ", out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "; } } it.errorPath = $currentErrorPath; } else $breakOnError && (out += " if (true) {"); return out; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $schemaValue, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $isData = it.opts.$data && $schema && $schema.$data; if ($isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema, ($schema || $isData) && !1 !== it.opts.uniqueItems) { $isData && (out += " var " + $valid + "; if (" + $schemaValue + " === false || " + $schemaValue + " === undefined) " + $valid + " = true; else if (typeof " + $schemaValue + " != 'boolean') " + $valid + " = false; else { "), out += " var i = " + $data + ".length , " + $valid + " = true , j; if (i > 1) { "; var $itemType = it.schema.items && it.schema.items.type, $typeIsArray = Array.isArray($itemType); if (!$itemType || "object" == $itemType || "array" == $itemType || $typeIsArray && ($itemType.indexOf("object") >= 0 || $itemType.indexOf("array") >= 0)) out += " outer: for (;i--;) { for (j = i; j--;) { if (equal(" + $data + "[i], " + $data + "[j])) { " + $valid + " = false; break outer; } } } "; else { out += " var itemIndices = {}, item; for (;i--;) { var item = " + $data + "[i]; "; var $method = "checkDataType" + ($typeIsArray ? "s" : ""); out += " if (" + it.util[$method]($itemType, "item", !0) + ") continue; ", $typeIsArray && (out += " if (typeof item == 'string') item = '\"' + item; "), out += " if (typeof itemIndices[item] == 'number') { " + $valid + " = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "; } out += " } ", $isData && (out += " } "), out += " if (!" + $valid + ") { "; var $$outStack = $$outStack || []; $$outStack.push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: 'uniqueItems' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { i: i, j: j } ", !1 !== it.opts.messages && (out += " , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "), it.opts.verbose && (out += " , schema: ", out += $isData ? "validate.schema" + $schemaPath : "" + $schema, out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", out += " } ", $breakOnError && (out += " else { "); } else $breakOnError && (out += " if (true) { "); return out; }; }, function(module, exports, __webpack_require__) { "use strict"; var KEYWORDS = [ "multipleOf", "maximum", "exclusiveMaximum", "minimum", "exclusiveMinimum", "maxLength", "minLength", "pattern", "additionalItems", "maxItems", "minItems", "uniqueItems", "maxProperties", "minProperties", "required", "additionalProperties", "enum", "format", "const" ]; module.exports = function(metaSchema, keywordsJsonPointers) { for (var i = 0; i < keywordsJsonPointers.length; i++) { metaSchema = JSON.parse(JSON.stringify(metaSchema)); var j, segments = keywordsJsonPointers[i].split("/"), keywords = metaSchema; for (j = 1; j < segments.length; j++) keywords = keywords[segments[j]]; for (j = 0; j < KEYWORDS.length; j++) { var key = KEYWORDS[j], schema = keywords[key]; schema && (keywords[key] = { anyOf: [ schema, { $ref: "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#" } ] }); } } return metaSchema; }; }, function(module, exports, __webpack_require__) { "use strict"; var MissingRefError = __webpack_require__(270).MissingRef; module.exports = function compileAsync(schema, meta, callback) { var self = this; if ("function" != typeof this._opts.loadSchema) throw new Error("options.loadSchema should be a function"); "function" == typeof meta && (callback = meta, meta = void 0); var p = loadMetaSchemaOf(schema).then((function() { var schemaObj = self._addSchema(schema, void 0, meta); return schemaObj.validate || _compileAsync(schemaObj); })); return callback && p.then((function(v) { callback(null, v); }), callback), p; function loadMetaSchemaOf(sch) { var $schema = sch.$schema; return $schema && !self.getSchema($schema) ? compileAsync.call(self, { $ref: $schema }, !0) : Promise.resolve(); } function _compileAsync(schemaObj) { try { return self._compile(schemaObj); } catch (e) { if (e instanceof MissingRefError) return (function(e) { var ref = e.missingSchema; if (added(ref)) throw new Error("Schema " + ref + " is loaded but " + e.missingRef + " cannot be resolved"); var schemaPromise = self._loadingSchemas[ref]; return schemaPromise || (schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref)).then(removePromise, removePromise), schemaPromise.then((function(sch) { if (!added(ref)) return loadMetaSchemaOf(sch).then((function() { added(ref) || self.addSchema(sch, ref, void 0, meta); })); })).then((function() { return _compileAsync(schemaObj); })); function removePromise() { delete self._loadingSchemas[ref]; } function added(ref) { return self._refs[ref] || self._schemas[ref]; } })(e); throw e; } } }; }, function(module, exports, __webpack_require__) { "use strict"; var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i, customRuleCode = __webpack_require__(1198), metaSchema = __webpack_require__(545); module.exports = { add: function(keyword, definition) { var RULES = this.RULES; if (RULES.keywords[keyword]) throw new Error("Keyword " + keyword + " is already defined"); if (!IDENTIFIER.test(keyword)) throw new Error("Keyword " + keyword + " is not a valid identifier"); if (definition) { this.validateKeyword(definition, !0); var dataType = definition.type; if (Array.isArray(dataType)) for (var i = 0; i < dataType.length; i++) _addRule(keyword, dataType[i], definition); else _addRule(keyword, dataType, definition); var metaSchema = definition.metaSchema; metaSchema && (definition.$data && this._opts.$data && (metaSchema = { anyOf: [ metaSchema, { $ref: "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#" } ] }), definition.validateSchema = this.compile(metaSchema, !0)); } function _addRule(keyword, dataType, definition) { for (var ruleGroup, i = 0; i < RULES.length; i++) { var rg = RULES[i]; if (rg.type == dataType) { ruleGroup = rg; break; } } ruleGroup || (ruleGroup = { type: dataType, rules: [] }, RULES.push(ruleGroup)); var rule = { keyword: keyword, definition: definition, custom: !0, code: customRuleCode, implements: definition.implements }; ruleGroup.rules.push(rule), RULES.custom[keyword] = rule; } return RULES.keywords[keyword] = RULES.all[keyword] = !0, this; }, get: function(keyword) { var rule = this.RULES.custom[keyword]; return rule ? rule.definition : this.RULES.keywords[keyword] || !1; }, remove: function(keyword) { var RULES = this.RULES; delete RULES.keywords[keyword], delete RULES.all[keyword], delete RULES.custom[keyword]; for (var i = 0; i < RULES.length; i++) for (var rules = RULES[i].rules, j = 0; j < rules.length; j++) if (rules[j].keyword == keyword) { rules.splice(j, 1); break; } return this; }, validate: function validateKeyword(definition, throwError) { validateKeyword.errors = null; var v = this._validateKeyword = this._validateKeyword || this.compile(definitionSchema, !0); if (v(definition)) return !0; if (validateKeyword.errors = v.errors, throwError) throw new Error("custom keyword definition is invalid: " + this.errorsText(v.errors)); return !1; } }; var definitionSchema = { definitions: { simpleTypes: metaSchema.definitions.simpleTypes }, type: "object", dependencies: { schema: [ "validate" ], $data: [ "validate" ], statements: [ "inline" ], valid: { not: { required: [ "macro" ] } } }, properties: { type: metaSchema.properties.type, schema: { type: "boolean" }, statements: { type: "boolean" }, dependencies: { type: "array", items: { type: "string" } }, metaSchema: { type: "object" }, modifying: { type: "boolean" }, valid: { type: "boolean" }, $data: { type: "boolean" }, async: { type: "boolean" }, errors: { anyOf: [ { type: "boolean" }, { const: "full" } ] } } }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(it, $keyword, $ruleType) { var $errorKeyword, $schemaValue, out = " ", $lvl = it.level, $dataLvl = it.dataLevel, $schema = it.schema[$keyword], $schemaPath = it.schemaPath + it.util.getProperty($keyword), $errSchemaPath = it.errSchemaPath + "/" + $keyword, $breakOnError = !it.opts.allErrors, $data = "data" + ($dataLvl || ""), $valid = "valid" + $lvl, $errs = "errs__" + $lvl, $isData = it.opts.$data && $schema && $schema.$data; $isData ? (out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ", $schemaValue = "schema" + $lvl) : $schemaValue = $schema; var $compile, $inline, $macro, $ruleValidate, $validateCode, $definition = "definition" + $lvl, $rDef = this.definition, $closingBraces = ""; if ($isData && $rDef.$data) { $validateCode = "keywordValidate" + $lvl; var $validateSchema = $rDef.validateSchema; out += " var " + $definition + " = RULES.custom['" + $keyword + "'].definition; var " + $validateCode + " = " + $definition + ".validate;"; } else { if (!($ruleValidate = it.useCustomRule(this, $schema, it.schema, it))) return; $schemaValue = "validate.schema" + $schemaPath, $validateCode = $ruleValidate.code, $compile = $rDef.compile, $inline = $rDef.inline, $macro = $rDef.macro; } var $ruleErrs = $validateCode + ".errors", $i = "i" + $lvl, $ruleErr = "ruleErr" + $lvl, $asyncKeyword = $rDef.async; if ($asyncKeyword && !it.async) throw new Error("async keyword in sync schema"); if ($inline || $macro || (out += $ruleErrs + " = null;"), out += "var " + $errs + " = errors;var " + $valid + ";", $isData && $rDef.$data && ($closingBraces += "}", out += " if (" + $schemaValue + " === undefined) { " + $valid + " = true; } else { ", $validateSchema && ($closingBraces += "}", out += " " + $valid + " = " + $definition + ".validateSchema(" + $schemaValue + "); if (" + $valid + ") { ")), $inline) $rDef.statements ? out += " " + $ruleValidate.validate + " " : out += " " + $valid + " = " + $ruleValidate.validate + "; "; else if ($macro) { var $it = it.util.copy(it); $closingBraces = "", $it.level++; var $nextValid = "valid" + $it.level; $it.schema = $ruleValidate.validate, $it.schemaPath = ""; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = !0; var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); it.compositeRule = $it.compositeRule = $wasComposite, out += " " + $code; } else { ($$outStack = $$outStack || []).push(out), out = "", out += " " + $validateCode + ".call( ", it.opts.passContext ? out += "this" : out += "self", $compile || !1 === $rDef.schema ? out += " , " + $data + " " : out += " , " + $schemaValue + " , " + $data + " , validate.schema" + it.schemaPath + " ", out += " , (dataPath || '')", '""' != it.errorPath && (out += " + " + it.errorPath); var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : "parentDataProperty", def_callRuleValidate = out += " , " + $parentData + " , " + $parentDataProperty + " , rootData ) "; out = $$outStack.pop(), !1 === $rDef.errors ? (out += " " + $valid + " = ", $asyncKeyword && (out += "await "), out += def_callRuleValidate + "; ") : out += $asyncKeyword ? " var " + ($ruleErrs = "customErrors" + $lvl) + " = null; try { " + $valid + " = await " + def_callRuleValidate + "; } catch (e) { " + $valid + " = false; if (e instanceof ValidationError) " + $ruleErrs + " = e.errors; else throw e; } " : " " + $ruleErrs + " = null; " + $valid + " = " + def_callRuleValidate + "; "; } if ($rDef.modifying && (out += " if (" + $parentData + ") " + $data + " = " + $parentData + "[" + $parentDataProperty + "];"), out += "" + $closingBraces, $rDef.valid) $breakOnError && (out += " if (true) { "); else { var $$outStack; out += " if ( ", void 0 === $rDef.valid ? (out += " !", out += $macro ? "" + $nextValid : "" + $valid) : out += " " + !$rDef.valid + " ", out += ") { ", $errorKeyword = this.keyword, ($$outStack = $$outStack || []).push(out), out = "", ($$outStack = $$outStack || []).push(out), out = "", !1 !== it.createErrors ? (out += " { keyword: '" + ($errorKeyword || "custom") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { keyword: '" + this.keyword + "' } ", !1 !== it.opts.messages && (out += " , message: 'should pass \"" + this.keyword + "\" keyword validation' "), it.opts.verbose && (out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " "), out += " } ") : out += " {} "; var __err = out; out = $$outStack.pop(), !it.compositeRule && $breakOnError ? it.async ? out += " throw new ValidationError([" + __err + "]); " : out += " validate.errors = [" + __err + "]; return false; " : out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; var def_customError = out; out = $$outStack.pop(), $inline ? $rDef.errors ? "full" != $rDef.errors && (out += " for (var " + $i + "=" + $errs + "; " + $i + " b ? 1 : a < b ? -1 : 0; } function generateBase(httpMethod, base_uri, params) { var normalized = (function(obj) { var key, val, arr = []; for (key in obj) if (val = obj[key], Array.isArray(val)) for (var i = 0; i < val.length; i++) arr.push([ key, val[i] ]); else if ("object" == typeof val) for (var prop in val) arr.push([ key + "[" + prop + "]", val[prop] ]); else arr.push([ key, val ]); return arr; })(params).map((function(p) { return [ rfc3986(p[0]), rfc3986(p[1] || "") ]; })).sort((function(a, b) { return compare(a[0], b[0]) || compare(a[1], b[1]); })).map((function(p) { return p.join("="); })).join("&"); return [ rfc3986(httpMethod ? httpMethod.toUpperCase() : "GET"), rfc3986(base_uri), rfc3986(normalized) ].join("&"); } function hmacsign(httpMethod, base_uri, params, consumer_secret, token_secret) { var base = generateBase(httpMethod, base_uri, params); return sha([ consumer_secret || "", token_secret || "" ].map(rfc3986).join("&"), base, "sha1"); } function hmacsign256(httpMethod, base_uri, params, consumer_secret, token_secret) { var base = generateBase(httpMethod, base_uri, params); return sha([ consumer_secret || "", token_secret || "" ].map(rfc3986).join("&"), base, "sha256"); } function rsasign(httpMethod, base_uri, params, private_key, token_secret) { return key = private_key || "", body = generateBase(httpMethod, base_uri, params), crypto.createSign("RSA-SHA1").update(body).sign(key, "base64"); var key, body; } function plaintext(consumer_secret, token_secret) { return [ consumer_secret || "", token_secret || "" ].map(rfc3986).join("&"); } exports.hmacsign = hmacsign, exports.hmacsign256 = hmacsign256, exports.rsasign = rsasign, exports.plaintext = plaintext, exports.sign = function(signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) { var method, skipArgs = 1; switch (signMethod) { case "RSA-SHA1": method = rsasign; break; case "HMAC-SHA1": method = hmacsign; break; case "HMAC-SHA256": method = hmacsign256; break; case "PLAINTEXT": method = plaintext, skipArgs = 4; break; default: throw new Error("Signature method not supported: " + signMethod); } return method.apply(null, [].slice.call(arguments, skipArgs)); }, exports.rfc3986 = rfc3986, exports.generateBase = generateBase; }, function(module, exports, __webpack_require__) { "use strict"; var crypto = __webpack_require__(6); exports.calculateMac = function(credentials, opts) { var normalized = "hawk.1.header\n" + opts.ts + "\n" + opts.nonce + "\n" + (opts.method || "").toUpperCase() + "\n" + opts.resource + "\n" + opts.host.toLowerCase() + "\n" + opts.port + "\n" + (opts.hash || "") + "\n"; return opts.ext && (normalized += opts.ext.replace("\\", "\\\\").replace("\n", "\\n")), normalized += "\n", opts.app && (normalized = normalized + opts.app + "\n" + (opts.dlg || "") + "\n"), crypto.createHmac(credentials.algorithm, credentials.key).update(normalized).digest("base64"); }, exports.header = function(uri, method, opts) { var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1e3), credentials = opts.credentials; if (!(credentials && credentials.id && credentials.key && credentials.algorithm)) return ""; if (-1 === [ "sha1", "sha256" ].indexOf(credentials.algorithm)) return ""; var payload, algorithm, contentType, hash, artifacts = { ts: timestamp, nonce: opts.nonce || (6, 42, crypto.randomBytes(Math.ceil(5.25)).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "").slice(0, 6)), method: method, resource: uri.pathname + (uri.search || ""), host: uri.hostname, port: uri.port || ("http:" === uri.protocol ? 80 : 443), hash: opts.hash, ext: opts.ext, app: opts.app, dlg: opts.dlg }; artifacts.hash || !opts.payload && "" !== opts.payload || (artifacts.hash = (payload = opts.payload, algorithm = credentials.algorithm, contentType = opts.contentType, (hash = crypto.createHash(algorithm)).update("hawk.1.payload\n"), hash.update((contentType ? contentType.split(";")[0].trim().toLowerCase() : "") + "\n"), hash.update(payload || ""), hash.update("\n"), hash.digest("base64"))); var mac = exports.calculateMac(credentials, artifacts), hasExt = null !== artifacts.ext && void 0 !== artifacts.ext && "" !== artifacts.ext, header = 'Hawk id="' + credentials.id + '", ts="' + artifacts.ts + '", nonce="' + artifacts.nonce + (artifacts.hash ? '", hash="' + artifacts.hash : "") + (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, "\\\\").replace(/"/g, '\\"') : "") + '", mac="' + mac + '"'; return artifacts.app && (header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : "") + '"'), header; }; }, function(module, exports, __webpack_require__) { "use strict"; var uuid = __webpack_require__(158), CombinedStream = __webpack_require__(527), isstream = __webpack_require__(534), Buffer = __webpack_require__(26).Buffer; function Multipart(request) { this.request = request, this.boundary = uuid(), this.chunked = !1, this.body = null; } Multipart.prototype.isChunked = function(options) { var self = this, chunked = !1, parts = options.data || options; return parts.forEach || self.request.emit("error", new Error("Argument error, options.multipart.")), void 0 !== options.chunked && (chunked = options.chunked), "chunked" === self.request.getHeader("transfer-encoding") && (chunked = !0), chunked || parts.forEach((function(part) { void 0 === part.body && self.request.emit("error", new Error("Body attribute missing in multipart.")), isstream(part.body) && (chunked = !0); })), chunked; }, Multipart.prototype.setHeaders = function(chunked) { chunked && !this.request.hasHeader("transfer-encoding") && this.request.setHeader("transfer-encoding", "chunked"); var header = this.request.getHeader("content-type"); header && -1 !== header.indexOf("multipart") ? -1 !== header.indexOf("boundary") ? this.boundary = header.replace(/.*boundary=([^\s;]+).*/, "$1") : this.request.setHeader("content-type", header + "; boundary=" + this.boundary) : this.request.setHeader("content-type", "multipart/related; boundary=" + this.boundary); }, Multipart.prototype.build = function(parts, chunked) { var self = this, body = chunked ? new CombinedStream : []; function add(part) { return "number" == typeof part && (part = part.toString()), chunked ? body.append(part) : body.push(Buffer.from(part)); } return self.request.preambleCRLF && add("\r\n"), parts.forEach((function(part) { var preamble = "--" + self.boundary + "\r\n"; Object.keys(part).forEach((function(key) { "body" !== key && (preamble += key + ": " + part[key] + "\r\n"); })), add(preamble += "\r\n"), add(part.body), add("\r\n"); })), add("--" + self.boundary + "--"), self.request.postambleCRLF && add("\r\n"), body; }, Multipart.prototype.onRequest = function(options) { var chunked = this.isChunked(options), parts = options.data || options; this.setHeaders(chunked), this.chunked = chunked, this.body = this.build(parts, chunked); }, exports.Multipart = Multipart; }, function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(7), isUrl = /^https?:/; function Redirect(request) { this.request = request, this.followRedirect = !0, this.followRedirects = !0, this.followAllRedirects = !1, this.followOriginalHttpMethod = !1, this.allowRedirect = function() { return !0; }, this.maxRedirects = 10, this.redirects = [], this.redirectsFollowed = 0, this.removeRefererHeader = !1; } Redirect.prototype.onRequest = function(options) { void 0 !== options.maxRedirects && (this.maxRedirects = options.maxRedirects), "function" == typeof options.followRedirect && (this.allowRedirect = options.followRedirect), void 0 !== options.followRedirect && (this.followRedirects = !!options.followRedirect), void 0 !== options.followAllRedirects && (this.followAllRedirects = options.followAllRedirects), (this.followRedirects || this.followAllRedirects) && (this.redirects = this.redirects || []), void 0 !== options.removeRefererHeader && (this.removeRefererHeader = options.removeRefererHeader), void 0 !== options.followOriginalHttpMethod && (this.followOriginalHttpMethod = options.followOriginalHttpMethod); }, Redirect.prototype.redirectTo = function(response) { var request = this.request, redirectTo = null; if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has("location")) { var location = response.caseless.get("location"); if (request.debug("redirect", location), this.followAllRedirects) redirectTo = location; else if (this.followRedirects) switch (request.method) { case "PATCH": case "PUT": case "POST": case "DELETE": break; default: redirectTo = location; } } else if (401 === response.statusCode) { var authHeader = request._auth.onResponse(response); authHeader && (request.setHeader("authorization", authHeader), redirectTo = request.uri); } return redirectTo; }, Redirect.prototype.onResponse = function(response) { var request = this.request, redirectTo = this.redirectTo(response); if (!redirectTo || !this.allowRedirect.call(request, response)) return !1; if (request.debug("redirect to", redirectTo), response.resume && response.resume(), this.redirectsFollowed >= this.maxRedirects) return request.emit("error", new Error("Exceeded maxRedirects. Probably stuck in a redirect loop " + request.uri.href)), !1; this.redirectsFollowed += 1, isUrl.test(redirectTo) || (redirectTo = url.resolve(request.uri.href, redirectTo)); var uriPrev = request.uri; return request.uri = url.parse(redirectTo), request.uri.protocol !== uriPrev.protocol && delete request.agent, this.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo }), this.followAllRedirects && "HEAD" !== request.method && 401 !== response.statusCode && 307 !== response.statusCode && (request.method = this.followOriginalHttpMethod ? request.method : "GET"), delete request.src, delete request.req, delete request._started, 401 !== response.statusCode && 307 !== response.statusCode && (delete request.body, delete request._form, request.headers && (request.removeHeader("host"), request.removeHeader("content-type"), request.removeHeader("content-length"), request.uri.hostname !== request.originalHost.split(":")[0] && request.removeHeader("authorization"))), this.removeRefererHeader || request.setHeader("referer", uriPrev.href), request.emit("redirect"), request.init(), !0; }, exports.Redirect = Redirect; }, function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(7), tunnel = __webpack_require__(1228), defaultProxyHeaderWhiteList = [ "accept", "accept-charset", "accept-encoding", "accept-language", "accept-ranges", "cache-control", "content-encoding", "content-language", "content-location", "content-md5", "content-range", "content-type", "connection", "date", "expect", "max-forwards", "pragma", "referer", "te", "user-agent", "via" ], defaultProxyHeaderExclusiveList = [ "proxy-authorization" ]; function Tunnel(request) { this.request = request, this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList, this.proxyHeaderExclusiveList = [], void 0 !== request.tunnel && (this.tunnelOverride = request.tunnel); } Tunnel.prototype.isEnabled = function() { var request = this.request; return void 0 !== this.tunnelOverride ? this.tunnelOverride : "https:" === request.uri.protocol; }, Tunnel.prototype.setup = function(options) { var request = this.request; if (options = options || {}, "string" == typeof request.proxy && (request.proxy = url.parse(request.proxy)), !request.proxy || !request.tunnel) return !1; options.proxyHeaderWhiteList && (this.proxyHeaderWhiteList = options.proxyHeaderWhiteList), options.proxyHeaderExclusiveList && (this.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList); var uriObject, port, protocol, proxyHeaderExclusiveList = this.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList), proxyHeaderWhiteList = this.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList), proxyHeaders = (function(headers, proxyHeaderWhiteList) { var whiteList = proxyHeaderWhiteList.reduce((function(set, header) { return set[header.toLowerCase()] = !0, set; }), {}); return Object.keys(headers).filter((function(header) { return whiteList[header.toLowerCase()]; })).reduce((function(set, header) { return set[header] = headers[header], set; }), {}); })(request.headers, proxyHeaderWhiteList); proxyHeaders.host = (port = (uriObject = request.uri).port, protocol = uriObject.protocol, uriObject.hostname + ":" + (port || ("https:" === protocol ? "443" : "80"))), proxyHeaderExclusiveList.forEach(request.removeHeader, request); var tunnelFn = (function(request) { var uri, proxy, tunnelFnName = (uri = request.uri, proxy = request.proxy, [ "https:" === uri.protocol ? "https" : "http", "https:" === proxy.protocol ? "Https" : "Http" ].join("Over")); return tunnel[tunnelFnName]; })(request), tunnelOptions = (function(request, proxyHeaders) { var proxy = request.proxy; return { proxy: { host: proxy.hostname, port: +proxy.port, proxyAuth: proxy.auth, headers: proxyHeaders }, headers: request.headers, ca: request.ca, cert: request.cert, key: request.key, passphrase: request.passphrase, pfx: request.pfx, ciphers: request.ciphers, rejectUnauthorized: request.rejectUnauthorized, secureOptions: request.secureOptions, secureProtocol: request.secureProtocol }; })(request, proxyHeaders); return request.agent = tunnelFn(tunnelOptions), !0; }, Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList, Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList, exports.Tunnel = Tunnel; }, function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(39); var debug, tls = __webpack_require__(70), http = __webpack_require__(11), https = __webpack_require__(21), events = __webpack_require__(4), assert = __webpack_require__(25), util = __webpack_require__(0), Buffer = __webpack_require__(26).Buffer; function TunnelingAgent(options) { var self = this; self.options = options || {}, self.proxyOptions = self.options.proxy || {}, self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets, self.requests = [], self.sockets = [], self.on("free", (function(socket, host, port) { for (var i = 0, len = self.requests.length; i < len; ++i) { var pending = self.requests[i]; if (pending.host === host && pending.port === port) return self.requests.splice(i, 1), void pending.request.onSocket(socket); } socket.destroy(), self.removeSocket(socket); })); } function createSecureSocket(options, cb) { var self = this; TunnelingAgent.prototype.createSocket.call(self, options, (function(socket) { var secureSocket = tls.connect(0, mergeOptions({}, self.options, { servername: options.host, socket: socket })); self.sockets[self.sockets.indexOf(socket)] = secureSocket, cb(secureSocket); })); } function mergeOptions(target) { for (var i = 1, len = arguments.length; i < len; ++i) { var overrides = arguments[i]; if ("object" == typeof overrides) for (var keys = Object.keys(overrides), j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j]; void 0 !== overrides[k] && (target[k] = overrides[k]); } } return target; } exports.httpOverHttp = function(options) { var agent = new TunnelingAgent(options); return agent.request = http.request, agent; }, exports.httpsOverHttp = function(options) { var agent = new TunnelingAgent(options); return agent.request = http.request, agent.createSocket = createSecureSocket, agent.defaultPort = 443, agent; }, exports.httpOverHttps = function(options) { var agent = new TunnelingAgent(options); return agent.request = https.request, agent; }, exports.httpsOverHttps = function(options) { var agent = new TunnelingAgent(options); return agent.request = https.request, agent.createSocket = createSecureSocket, agent.defaultPort = 443, agent; }, util.inherits(TunnelingAgent, events.EventEmitter), TunnelingAgent.prototype.addRequest = function(req, options) { var self = this; "string" == typeof options && (options = { host: options, port: arguments[2], path: arguments[3] }), self.sockets.length >= this.maxSockets ? self.requests.push({ host: options.host, port: options.port, request: req }) : self.createConnection({ host: options.host, port: options.port, request: req }); }, TunnelingAgent.prototype.createConnection = function(pending) { var self = this; self.createSocket(pending, (function(socket) { function onFree() { self.emit("free", socket, pending.host, pending.port); } function onCloseOrRemove(err) { self.removeSocket(socket), socket.removeListener("free", onFree), socket.removeListener("close", onCloseOrRemove), socket.removeListener("agentRemove", onCloseOrRemove); } socket.on("free", onFree), socket.on("close", onCloseOrRemove), socket.on("agentRemove", onCloseOrRemove), pending.request.onSocket(socket); })); }, TunnelingAgent.prototype.createSocket = function(options, cb) { var self = this, placeholder = {}; self.sockets.push(placeholder); var connectOptions = mergeOptions({}, self.proxyOptions, { method: "CONNECT", path: options.host + ":" + options.port, agent: !1 }); connectOptions.proxyAuth && (connectOptions.headers = connectOptions.headers || {}, connectOptions.headers["Proxy-Authorization"] = "Basic " + Buffer.from(connectOptions.proxyAuth).toString("base64")), debug("making CONNECT request"); var connectReq = self.request(connectOptions); function onConnect(res, socket, head) { if (connectReq.removeAllListeners(), socket.removeAllListeners(), 200 === res.statusCode) assert.equal(head.length, 0), debug("tunneling connection has established"), self.sockets[self.sockets.indexOf(placeholder)] = socket, cb(socket); else { debug("tunneling socket could not be established, statusCode=%d", res.statusCode); var error = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); error.code = "ECONNRESET", options.request.emit("error", error), self.removeSocket(placeholder); } } connectReq.useChunkedEncodingByDefault = !1, connectReq.once("response", (function(res) { res.upgrade = !0; })), connectReq.once("upgrade", (function(res, socket, head) { process.nextTick((function() { onConnect(res, socket, head); })); })), connectReq.once("connect", onConnect), connectReq.once("error", (function(cause) { connectReq.removeAllListeners(), debug("tunneling socket could not be established, cause=%s\n", cause.message, cause.stack); var error = new Error("tunneling socket could not be established, cause=" + cause.message); error.code = "ECONNRESET", options.request.emit("error", error), self.removeSocket(placeholder); })), connectReq.end(); }, TunnelingAgent.prototype.removeSocket = function(socket) { var pos = this.sockets.indexOf(socket); if (-1 !== pos) { this.sockets.splice(pos, 1); var pending = this.requests.shift(); pending && this.createConnection(pending); } }, debug = process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG) ? function() { var args = Array.prototype.slice.call(arguments); "string" == typeof args[0] ? args[0] = "TUNNEL: " + args[0] : args.unshift("TUNNEL:"), console.error.apply(console, args); } : function() {}, exports.debug = debug; }, function(module, exports) { (function() { var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; "undefined" != typeof performance && null !== performance && performance.now ? module.exports = function() { return performance.now(); } : "undefined" != typeof process && null !== process && process.hrtime ? (module.exports = function() { return (getNanoSeconds() - nodeLoadTime) / 1e6; }, hrtime = process.hrtime, moduleLoadTime = (getNanoSeconds = function() { var hr; return 1e9 * (hr = hrtime())[0] + hr[1]; })(), upTime = 1e9 * process.uptime(), nodeLoadTime = moduleLoadTime - upTime) : Date.now ? (module.exports = function() { return Date.now() - loadTime; }, loadTime = Date.now()) : (module.exports = function() { return (new Date).getTime() - loadTime; }, loadTime = (new Date).getTime()); }).call(this); }, function(module, exports, __webpack_require__) { const mime = __webpack_require__(45); module.exports = function(rarInnerFile) { return mime.lookup(rarInnerFile.name) || "application/octet-stream"; }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(162), parseQuery = __webpack_require__(271), cryptojs = __webpack_require__(6), ee = __webpack_require__(4), lzDecompress = __webpack_require__(77).decompressFromEncodedURIComponent, initEmitter = new ee; module.exports = { createKey: function(archiveType, orderRegex, orderDefault, req, res) { function storeDataToKey(arr, newKey) { if (newKey && null !== store.get(newKey)) return newKey; arr = arr.map((el => Array.isArray(el) ? !!el[0] && (el[1] ? { url: el[0], bytes: el[1] } : { url: el[0] }) : el)).filter((el => !!el)), orderRegex && (arr = arr.sort(((first, second) => { const firstMatch = ((first || {}).url || first || "").split("?")[0].match(orderRegex), secondMatch = ((second || {}).url || second || "").split("?")[0].match(orderRegex); return +(firstMatch && firstMatch[1] || orderDefault || 0) - +(secondMatch && secondMatch[1] || orderDefault || 0); }))); const key = store.set(arr, newKey); return initEmitter.emit(key), key; } if ("POST" === req.method) { if (!Array.isArray(req.body)) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 1"); const key = storeDataToKey(req.body, req.params.createKey); res.setHeader("Content-Length", JSON.stringify({ key: key }).length + ""), res.setHeader("Content-Type", "application/json"), res.end(JSON.stringify({ key: key })); } else { if (!req.query.lz) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 2"); let lzData = !1; try { lzData = JSON.parse(lzDecompress(req.query.lz)); } catch (e) {} if (!lzData || !lzData.urls || !lzData.urls.length) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 3"); const hashKey = (txt = req.query.lz, cryptojs.createHash("sha256").update(txt).digest("hex")); storeDataToKey(lzData.urls, hashKey), opts = (function(lzData) { let opts = {}; return lzData.fileMustInclude && (opts.fileMustInclude = lzData.fileMustInclude), lzData.maxFiles && lzData.maxFiles > 0 && (opts.maxFiles = lzData.maxFiles), lzData.fileIdx && lzData.fileIdx > -1 && (opts.fileIdx = lzData.fileIdx), !!Object.keys(opts).length && opts; })(lzData), res.statusCode = 302, res.setHeader("Location", `/${archiveType}/stream?key=${hashKey}` + (opts ? "&o=" + encodeURIComponent(JSON.stringify(opts)) : "")), res.end(); } var txt; }, waitForKey: function(req) { return new Promise(((resolve, reject) => { const key = parseQuery(req).query.key; key ? null === store.get(key) ? initEmitter.addListener(key, (function gotData() { initEmitter.removeListener(key, gotData), resolve(); })) : resolve() : reject(Error("No stream key provided")); })); } }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(166), getRouter = __webpack_require__(1233), getZipStream = __webpack_require__(546); module.exports = { router: getRouter, create: zipUrls => { if (!zipUrls || !Array.isArray(zipUrls)) throw Error('"zipUrls" is undefined or not an array'); return store.set(zipUrls); }, file: async (key, opts) => { if (!key) throw Error('Missing "key"'); const file = await getZipStream({ url: key, query: { o: JSON.stringify(opts || {}), key: key } }); return file.createReadStream = () => file.stream(), file; } }; }, function(module, exports, __webpack_require__) { const getContentType = __webpack_require__(1234), getZipStream = __webpack_require__(546), bodyParser = __webpack_require__(50), Router = __webpack_require__(108), store = __webpack_require__(166), parseQuery = __webpack_require__(275), keyHandler = (new (__webpack_require__(4)), __webpack_require__(1282)), orderRegex = /\.Z(\d\d?\d?\d?\d?)$/i; module.exports = function() { const router = Router(); router.use(bodyParser.json()), router.post("/create/:createKey", keyHandler.createKey.bind(null, "zip", orderRegex, 99999)), router.all("/create", keyHandler.createKey.bind(null, "zip", orderRegex, 99999)); const fileVars = {}; return router.get("/stream", (async (req, res) => { try { await keyHandler.waitForKey(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } let file, contentLength; const parsed = parseQuery(req), key = parsed.query.key; if (!fileVars[key]) { try { file = await getZipStream(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } if (!file) { const errMsg = "There was an error with the zip parser."; return console.error(Error(errMsg)), res.statusCode = 500, void res.end(errMsg); } if (contentLength = file.uncompressedSize, 0 === file.compressionMethod) { let entryVars = null; try { entryVars = await file.entryVars(); } catch (e) { return console.error(e), res.statusCode = 500, void res.end((e || {}).message || "Unknown error with zip parser"); } fileVars[key] = { offset: file.offsetToLocalFileHeader + 30 + entryVars.fileNameLength + entryVars.extraFieldLength + (1 & file.flags ? 12 : 0), size: file.uncompressedSize || entryVars.uncompressedSize, filename: entryVars.fileName, innerFile: file.inner }; } } if (fileVars[key]) { const offset = fileVars[key].offset, size = fileVars[key].size, filename = fileVars[key].filename; let url = !1; const zipUrls = store.get(key); if (zipUrls) url = zipUrls[0]; else { if (!parsed.query.r) return res.statusCode = 500, void res.end(); url = parsed.query.r; } if ("OPTIONS" === req.method && req.headers["access-control-request-headers"]) return res.writeHead(200, { "Access-Control-Allow-Origin": req.headers.origin, "Access-Control-Allow-Methods": "POST, GET, OPTIONS", "Access-Control-Allow-Headers": req.headers["access-control-request-headers"], "Access-Control-Max-Age": "1728000" }), res.end(); const range = req.headers.range || null, mimeType = getContentType({ name: filename }); let start = null, end = null; if (range) { let parts = range.replace(/bytes=/, "").split("-"); if (start = parts[0], end = parts[1], start = parseInt(start, 10), end = end ? parseInt(end, 10) : size - 1, !isNaN(start) && isNaN(end) && (end = size - 1), isNaN(start) && !isNaN(end) && (start = size - end, end = size - 1), start >= size || end >= size || start < 0 || end < 0) return res.writeHead(416, { "Content-Range": `bytes */${size}` }), res.end(); if (res.writeHead(206, { "Access-Control-Allow-Origin": req.headers.origin || "*", "Content-Range": `bytes ${start}-${end}/${size}`, "Accept-Ranges": "bytes", "Content-Length": end - start + 1 + "", "Content-Type": mimeType, "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" }), "HEAD" === req.method) return res.end(); } else if (res.writeHead(200, { "Access-Control-Allow-Origin": req.headers.origin || "*", "Content-Length": size + "", "Content-Type": mimeType, "Accept-Ranges": "bytes", "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" }), "HEAD" === req.method) return res.end(); url.url; let rangeStart = 0, rangeEnd = size; start || end ? (rangeStart = start + offset, rangeEnd = end + offset) : (rangeStart = offset, rangeEnd = size + offset); let stream = null; try { stream = await fileVars[key].innerFile.createReadStream({ start: rangeStart, end: rangeEnd }); } catch (e) { return console.error(e), res.statusCode = 500, void res.end((e || {}).message || "Unknown error with zip parser"); } stream.pipe(res); } else { if (((req || {}).headers || {}).range && "bytes=0-" !== req.headers.range && req.headers.range !== "bytes=0-" + (contentLength - 1)) return res.statusCode = 405, void res.end(); if ("HEAD" === req.method) return res.statusCode = 204, res.setHeader("Content-Length", contentLength + ""), res.setHeader("Content-Type", getContentType({ name: file.path })), void res.end(); res.statusCode = 200, res.setHeader("Content-Type", getContentType({ name: file.path })), res.setHeader("Content-Length", contentLength); let fileStream = null; try { fileStream = await file.stream(); } catch (e) { return console.error(e), res.statusCode = 500, void res.end((e || {}).message || "Unknown error with zip parser"); } req.on("close", (function() { fileStream.destroy ? fileStream.destroy() : fileStream.unpipe && fileStream.unpipe(); })), fileStream.pipe(res); } })), router; }; }, function(module, exports, __webpack_require__) { const mime = __webpack_require__(45); module.exports = function(rarInnerFile) { return mime.lookup(rarInnerFile.name) || "application/octet-stream"; }; }, function(module, exports, __webpack_require__) { "use strict"; exports.Open = __webpack_require__(1236); }, function(module, exports, __webpack_require__) { var directory = __webpack_require__(1237), Stream = __webpack_require__(3); Stream.Writable && Stream.Writable.prototype.destroy || (Stream = __webpack_require__(88)), module.exports = { url: function(innerFile, params, options) { if ("string" == typeof params && (params = { url: params }), !params.url) throw "URL missing"; return params.headers = params.headers || {}, directory({ stream: function(offset, length) { return innerFile.createReadStream({ start: offset, end: length ? offset + length : innerFile.length - 1 }); }, size: function() { return Promise.resolve(innerFile.length); }, opts: function() { return options; } }, options); } }; }, function(module, exports, __webpack_require__) { var PullStream = __webpack_require__(547), unzip = __webpack_require__(1238), Promise = __webpack_require__(1241), BufferStream = __webpack_require__(1273), parseExtraField = __webpack_require__(549), Buffer = __webpack_require__(167), path = __webpack_require__(5), Writer = __webpack_require__(1274).Writer, parseDateTime = __webpack_require__(550), entryVars = __webpack_require__(548), parseBuffer = __webpack_require__(272), signature = Buffer.alloc(4); signature.writeUInt32LE(101010256, 0), module.exports = async function(source, options) { var sourceSize, crxHeader, startOffset, vars, endDir = PullStream(), records = PullStream(), tailSize = options && options.tailSize || 80; return options && options.crx && (crxHeader = await (async function(source) { var sourceStream = (await source.stream(0)).pipe(PullStream()); return sourceStream.pull(4).then((function(data) { var crxHeader; if (875721283 === data.readUInt32LE(0)) return sourceStream.pull(12).then((function(data) { crxHeader = parseBuffer.parse(data, [ [ "version", 4 ], [ "pubKeyLength", 4 ], [ "signatureLength", 4 ] ]); })).then((function() { return sourceStream.pull(crxHeader.pubKeyLength + crxHeader.signatureLength); })).then((function(data) { return crxHeader.publicKey = data.slice(0, crxHeader.pubKeyLength), crxHeader.signature = data.slice(crxHeader.pubKeyLength), crxHeader.size = 16 + crxHeader.pubKeyLength + crxHeader.signatureLength, crxHeader; })); })); })(source)), source.size().then((async function(size) { return sourceSize = size, (await source.stream(Math.max(0, size - tailSize))).on("error", (function(error) { endDir.emit("error", error); })).pipe(endDir), endDir.pull(signature); })).then((function() { return Promise.props({ directory: endDir.pull(22), crxHeader: crxHeader }); })).then((async function(d) { var data = d.directory; if (startOffset = d.crxHeader && d.crxHeader.size || 0, 65535 == (vars = parseBuffer.parse(data, [ [ "signature", 4 ], [ "diskNumber", 2 ], [ "diskStart", 2 ], [ "numberOfRecordsOnDisk", 2 ], [ "numberOfRecords", 2 ], [ "sizeOfCentralDirectory", 4 ], [ "offsetToStartOfCentralDirectory", 4 ], [ "commentLength", 2 ] ])).diskNumber || 65535 == vars.numberOfRecords || 4294967295 == vars.offsetToStartOfCentralDirectory) { const zip64CDLSize = 20, zip64CDLOffset = sourceSize - (tailSize - endDir.match + zip64CDLSize), zip64CDLStream = PullStream(); let scStream = !1; const opts = source.opts(); if (opts.multiVolume) { const fullFileSize = await source.size(); scStream = await source.stream(fullFileSize - opts.lastVolumeSize + zip64CDLOffset + opts.volumesCount); } else scStream = await source.stream(zip64CDLOffset); return scStream.pipe(zip64CDLStream), zip64CDLStream.pull(zip64CDLSize).then((function(d) { return (async function(source, zip64CDL) { var d64loc = parseBuffer.parse(zip64CDL, [ [ "signature", 4 ], [ "diskNumber", 4 ], [ "offsetToStartOfCentralDirectory", 8 ], [ "numberOfDisks", 4 ] ]); if (117853008 != d64loc.signature) throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x" + d64loc.signature.toString(16)); var dir64 = PullStream(), opts = source.opts(), scStream = !1; if (opts.multiVolume) { const fullFileSize = await source.size(); scStream = await source.stream(fullFileSize - opts.lastVolumeSize + d64loc.offsetToStartOfCentralDirectory + opts.volumesCount); } else scStream = await source.stream(d64loc.offsetToStartOfCentralDirectory); return scStream.pipe(dir64), dir64.pull(56); })(source, d); })).then((function(dir64record) { vars = (function(dir64record) { var vars = parseBuffer.parse(dir64record, [ [ "signature", 4 ], [ "sizeOfCentralDirectory", 8 ], [ "version", 2 ], [ "versionsNeededToExtract", 2 ], [ "diskNumber", 4 ], [ "diskStart", 4 ], [ "numberOfRecordsOnDisk", 8 ], [ "numberOfRecords", 8 ], [ "sizeOfCentralDirectory", 8 ], [ "offsetToStartOfCentralDirectory", 8 ] ]); if (101075792 != vars.signature) throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0" + vars.signature.toString(16)); return vars; })(dir64record); })); } vars.offsetToStartOfCentralDirectory += startOffset; })).then((function() { if (vars.commentLength) return endDir.pull(vars.commentLength).then((function(comment) { vars.comment = comment.toString("utf8"); })); })).then((async function() { let scStream = !1; const opts = source.opts(); if (opts.multiVolume) { const fullFileSize = await source.size(); scStream = await source.stream(fullFileSize - opts.lastVolumeSize + vars.offsetToStartOfCentralDirectory + opts.volumesCount); } else scStream = await source.stream(vars.offsetToStartOfCentralDirectory); return scStream.pipe(records), vars.extract = function(opts) { if (!opts || !opts.path) throw new Error("PATH_MISSING"); return opts.path = path.resolve(path.normalize(opts.path)), vars.files.then((function(files) { return Promise.map(files, (function(entry) { if ("Directory" != entry.type) { var extractPath = path.join(opts.path, entry.path); if (0 == extractPath.indexOf(opts.path)) { var writer = opts.getWriter ? opts.getWriter({ path: extractPath }) : Writer({ path: extractPath }); return new Promise((async function(resolve, reject) { (await entry.stream(opts.password)).on("error", reject).pipe(writer).on("close", resolve).on("error", reject); })); } } }), { concurrency: opts.concurrency > 1 ? opts.concurrency : 1 }); })); }, vars.files = Promise.mapSeries(Array(vars.numberOfRecords), (function() { return records.pull(46).then((function(data) { var vars = vars = parseBuffer.parse(data, [ [ "signature", 4 ], [ "versionMadeBy", 2 ], [ "versionsNeededToExtract", 2 ], [ "flags", 2 ], [ "compressionMethod", 2 ], [ "lastModifiedTime", 2 ], [ "lastModifiedDate", 2 ], [ "crc32", 4 ], [ "compressedSize", 4 ], [ "uncompressedSize", 4 ], [ "fileNameLength", 2 ], [ "extraFieldLength", 2 ], [ "fileCommentLength", 2 ], [ "diskNumber", 2 ], [ "internalFileAttributes", 2 ], [ "externalFileAttributes", 4 ], [ "offsetToLocalFileHeader", 4 ] ]); return vars.offsetToLocalFileHeader += startOffset, vars.lastModifiedDateTime = parseDateTime(vars.lastModifiedDate, vars.lastModifiedTime), records.pull(vars.fileNameLength).then((function(fileNameBuffer) { return vars.pathBuffer = fileNameBuffer, vars.path = fileNameBuffer.toString("utf8"), vars.isUnicode = 0 != (2048 & vars.flags), records.pull(vars.extraFieldLength); })).then((function(extraField) { return vars.extra = parseExtraField(extraField, vars), records.pull(vars.fileCommentLength); })).then((function(comment) { return vars.comment = comment, vars.type = 0 === vars.uncompressedSize && /[\/\\]$/.test(vars.path) ? "Directory" : "File", vars.entryVars = async function() { var file = PullStream(); return (await source.stream(vars.offsetToLocalFileHeader, null, vars)).pipe(file).on("error", (function(e) { entry.emit("error", e); })), entryVars(file); }, vars.stream = async function(_password) { return unzip(source, vars.offsetToLocalFileHeader, _password, vars); }, vars.buffer = function(_password) { return BufferStream(vars.stream(_password)); }, vars; })); })); })), Promise.props(vars); })); }; }, function(module, exports, __webpack_require__) { __webpack_require__(1239); var PullStream = __webpack_require__(547), Stream = __webpack_require__(3), zlib = __webpack_require__(43), Buffer = __webpack_require__(167), entryVars = __webpack_require__(548); Stream.Writable && Stream.Writable.prototype.destroy || (Stream = __webpack_require__(88)), module.exports = async function(source, offset, _password, directoryVars) { var file = PullStream(), entry = Stream.PassThrough(), req = await source.stream(offset); return req.pipe(file).on("error", (function(e) { entry.emit("error", e); })), entry.vars = entryVars(file, entry, directoryVars), entry.vars.then((async function(vars) { var eof, fileSizeKnown = !(8 & vars.flags) || vars.compressedSize > 0, inflater = vars.compressionMethod ? zlib.createInflateRaw() : Stream.PassThrough(); fileSizeKnown ? (entry.size = vars.uncompressedSize, eof = vars.compressedSize) : (eof = Buffer.alloc(4)).writeUInt32LE(134695760, 0); var stream = await file.stream(eof); vars.decrypt && (stream = stream.pipe(vars.decrypt.stream())), stream.pipe(inflater).on("error", (function(err) { entry.emit("error", err); })).pipe(entry).on("finish", (function() { req.destroy ? req.destroy() : req.abort ? req.abort() : req.close ? req.close() : req.push ? req.push() : console.log("warning - unable to close stream"); })); })).catch((function(e) { entry.emit("error", e); })), entry; }; }, function(module, exports, __webpack_require__) { var table, bigInt = __webpack_require__(1240), Stream = __webpack_require__(3); function crc(ch, crc) { return table || (function() { var c, n, k; for (table = [], n = 0; n < 256; n++) { for (c = n, k = 0; k < 8; k++) c = 1 & c ? 3988292384 ^ c >>> 1 : c >>>= 1; table[n] = c >>> 0; } })(), ch.charCodeAt && (ch = ch.charCodeAt(0)), bigInt(crc).shiftRight(8).and(16777215).xor(table[bigInt(crc).xor(ch).and(255)]).value; } function Decrypt() { if (!(this instanceof Decrypt)) return new Decrypt; this.key0 = 305419896, this.key1 = 591751049, this.key2 = 878082192; } Stream.Writable && Stream.Writable.prototype.destroy || (Stream = __webpack_require__(88)), Decrypt.prototype.update = function(h) { this.key0 = crc(h, this.key0), this.key1 = bigInt(this.key0).and(255).and(4294967295).add(this.key1), this.key1 = bigInt(this.key1).multiply(134775813).add(1).and(4294967295).value, this.key2 = crc(bigInt(this.key1).shiftRight(24).and(255), this.key2); }, Decrypt.prototype.decryptByte = function(c) { var k = bigInt(this.key2).or(2); return c ^= bigInt(k).multiply(bigInt(1 ^ k)).shiftRight(8).and(255), this.update(c), c; }, Decrypt.prototype.stream = function() { var stream = Stream.Transform(), self = this; return stream._transform = function(d, e, cb) { for (var i = 0; i < d.length; i++) d[i] = self.decryptByte(d[i]); this.push(d), cb(); }, stream; }, module.exports = Decrypt; }, function(module, exports, __webpack_require__) { (function(module) { var __WEBPACK_AMD_DEFINE_RESULT__, bigInt = (function(undefined) { "use strict"; var BASE = 1e7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT), supportsNativeBigInt = "function" == typeof BigInt; function Integer(v, radix, alphabet, caseSensitive) { return void 0 === v ? Integer[0] : void 0 === radix || 10 == +radix && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive); } function BigInteger(value, sign) { this.value = value, this.sign = sign, this.isSmall = !1; } function SmallInteger(value) { this.value = value, this.sign = value < 0, this.isSmall = !0; } function NativeBigInt(value) { this.value = value; } function isPrecise(n) { return -MAX_INT < n && n < MAX_INT; } function smallToArray(n) { return n < 1e7 ? [ n ] : n < 1e14 ? [ n % 1e7, Math.floor(n / 1e7) ] : [ n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14) ]; } function arrayToSmall(arr) { trim(arr); var length = arr.length; if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) switch (length) { case 0: return 0; case 1: return arr[0]; case 2: return arr[0] + arr[1] * BASE; default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE; } return arr; } function trim(v) { for (var i = v.length; 0 === v[--i]; ) ; v.length = i + 1; } function createArray(length) { for (var x = new Array(length), i = -1; ++i < length; ) x[i] = 0; return x; } function truncate(n) { return n > 0 ? Math.floor(n) : Math.ceil(n); } function add(a, b) { var sum, i, l_a = a.length, l_b = b.length, r = new Array(l_a), carry = 0, base = BASE; for (i = 0; i < l_b; i++) carry = (sum = a[i] + b[i] + carry) >= base ? 1 : 0, r[i] = sum - carry * base; for (;i < l_a; ) carry = (sum = a[i] + carry) === base ? 1 : 0, r[i++] = sum - carry * base; return carry > 0 && r.push(carry), r; } function addAny(a, b) { return a.length >= b.length ? add(a, b) : add(b, a); } function addSmall(a, carry) { var sum, i, l = a.length, r = new Array(l), base = BASE; for (i = 0; i < l; i++) sum = a[i] - base + carry, carry = Math.floor(sum / base), r[i] = sum - carry * base, carry += 1; for (;carry > 0; ) r[i++] = carry % base, carry = Math.floor(carry / base); return r; } function subtract(a, b) { var i, difference, a_l = a.length, b_l = b.length, r = new Array(a_l), borrow = 0; for (i = 0; i < b_l; i++) (difference = a[i] - borrow - b[i]) < 0 ? (difference += 1e7, borrow = 1) : borrow = 0, r[i] = difference; for (i = b_l; i < a_l; i++) { if (!((difference = a[i] - borrow) < 0)) { r[i++] = difference; break; } difference += 1e7, r[i] = difference; } for (;i < a_l; i++) r[i] = a[i]; return trim(r), r; } function subtractSmall(a, b, sign) { var i, difference, l = a.length, r = new Array(l), carry = -b; for (i = 0; i < l; i++) difference = a[i] + carry, carry = Math.floor(difference / 1e7), difference %= 1e7, r[i] = difference < 0 ? difference + 1e7 : difference; return "number" == typeof (r = arrayToSmall(r)) ? (sign && (r = -r), new SmallInteger(r)) : new BigInteger(r, sign); } function multiplyLong(a, b) { var product, carry, i, a_i, a_l = a.length, b_l = b.length, r = createArray(a_l + b_l); for (i = 0; i < a_l; ++i) { a_i = a[i]; for (var j = 0; j < b_l; ++j) product = a_i * b[j] + r[i + j], carry = Math.floor(product / 1e7), r[i + j] = product - 1e7 * carry, r[i + j + 1] += carry; } return trim(r), r; } function multiplySmall(a, b) { var product, i, l = a.length, r = new Array(l), base = BASE, carry = 0; for (i = 0; i < l; i++) product = a[i] * b + carry, carry = Math.floor(product / base), r[i] = product - carry * base; for (;carry > 0; ) r[i++] = carry % base, carry = Math.floor(carry / base); return r; } function shiftLeft(x, n) { for (var r = []; n-- > 0; ) r.push(0); return r.concat(x); } function multiplyKaratsuba(x, y) { var n = Math.max(x.length, y.length); if (n <= 30) return multiplyLong(x, y); n = Math.ceil(n / 2); var b = x.slice(n), a = x.slice(0, n), d = y.slice(n), c = y.slice(0, n), ac = multiplyKaratsuba(a, c), bd = multiplyKaratsuba(b, d), abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d)), product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n)); return trim(product), product; } function multiplySmallAndArray(a, b, sign) { return new BigInteger(a < BASE ? multiplySmall(b, a) : multiplyLong(b, smallToArray(a)), sign); } function square(a) { var product, carry, i, a_i, l = a.length, r = createArray(l + l); for (i = 0; i < l; i++) { carry = 0 - (a_i = a[i]) * a_i; for (var j = i; j < l; j++) product = a_i * a[j] * 2 + r[i + j] + carry, carry = Math.floor(product / 1e7), r[i + j] = product - 1e7 * carry; r[i + l] = carry; } return trim(r), r; } function divModSmall(value, lambda) { var i, q, remainder, divisor, length = value.length, quotient = createArray(length); for (remainder = 0, i = length - 1; i >= 0; --i) remainder = (divisor = 1e7 * remainder + value[i]) - (q = truncate(divisor / lambda)) * lambda, quotient[i] = 0 | q; return [ quotient, 0 | remainder ]; } function divModAny(self, v) { var value, n = parseValue(v); if (supportsNativeBigInt) return [ new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value) ]; var quotient, a = self.value, b = n.value; if (0 === b) throw new Error("Cannot divide by zero"); if (self.isSmall) return n.isSmall ? [ new SmallInteger(truncate(a / b)), new SmallInteger(a % b) ] : [ Integer[0], self ]; if (n.isSmall) { if (1 === b) return [ self, Integer[0] ]; if (-1 == b) return [ self.negate(), Integer[0] ]; var abs = Math.abs(b); if (abs < BASE) { quotient = arrayToSmall((value = divModSmall(a, abs))[0]); var remainder = value[1]; return self.sign && (remainder = -remainder), "number" == typeof quotient ? (self.sign !== n.sign && (quotient = -quotient), [ new SmallInteger(quotient), new SmallInteger(remainder) ]) : [ new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder) ]; } b = smallToArray(abs); } var comparison = compareAbs(a, b); if (-1 === comparison) return [ Integer[0], self ]; if (0 === comparison) return [ Integer[self.sign === n.sign ? 1 : -1], Integer[0] ]; value = a.length + b.length <= 200 ? (function(a, b) { var quotientDigit, shift, carry, borrow, i, l, q, a_l = a.length, b_l = b.length, base = BASE, result = createArray(b.length), divisorMostSignificantDigit = b[b_l - 1], lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), remainder = multiplySmall(a, lambda), divisor = multiplySmall(b, lambda); for (remainder.length <= a_l && remainder.push(0), divisor.push(0), divisorMostSignificantDigit = divisor[b_l - 1], shift = a_l - b_l; shift >= 0; shift--) { for (quotientDigit = base - 1, remainder[shift + b_l] !== divisorMostSignificantDigit && (quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit)), carry = 0, borrow = 0, l = divisor.length, i = 0; i < l; i++) carry += quotientDigit * divisor[i], q = Math.floor(carry / base), borrow += remainder[shift + i] - (carry - q * base), carry = q, borrow < 0 ? (remainder[shift + i] = borrow + base, borrow = -1) : (remainder[shift + i] = borrow, borrow = 0); for (;0 !== borrow; ) { for (quotientDigit -= 1, carry = 0, i = 0; i < l; i++) (carry += remainder[shift + i] - base + divisor[i]) < 0 ? (remainder[shift + i] = carry + base, carry = 0) : (remainder[shift + i] = carry, carry = 1); borrow += carry; } result[shift] = quotientDigit; } return remainder = divModSmall(remainder, lambda)[0], [ arrayToSmall(result), arrayToSmall(remainder) ]; })(a, b) : (function(a, b) { for (var guess, xlen, highx, highy, check, a_l = a.length, b_l = b.length, result = [], part = []; a_l; ) if (part.unshift(a[--a_l]), trim(part), compareAbs(part, b) < 0) result.push(0); else { highx = 1e7 * part[(xlen = part.length) - 1] + part[xlen - 2], highy = 1e7 * b[b_l - 1] + b[b_l - 2], xlen > b_l && (highx = 1e7 * (highx + 1)), guess = Math.ceil(highx / highy); do { if (compareAbs(check = multiplySmall(b, guess), part) <= 0) break; guess--; } while (guess); result.push(guess), part = subtract(part, check); } return result.reverse(), [ arrayToSmall(result), arrayToSmall(part) ]; })(a, b), quotient = value[0]; var qSign = self.sign !== n.sign, mod = value[1], mSign = self.sign; return "number" == typeof quotient ? (qSign && (quotient = -quotient), quotient = new SmallInteger(quotient)) : quotient = new BigInteger(quotient, qSign), "number" == typeof mod ? (mSign && (mod = -mod), mod = new SmallInteger(mod)) : mod = new BigInteger(mod, mSign), [ quotient, mod ]; } function compareAbs(a, b) { if (a.length !== b.length) return a.length > b.length ? 1 : -1; for (var i = a.length - 1; i >= 0; i--) if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1; return 0; } function isBasicPrime(v) { var n = v.abs(); return !n.isUnit() && (!!(n.equals(2) || n.equals(3) || n.equals(5)) || !(n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) && (!!n.lesser(49) || void 0)); } function millerRabinTest(n, a) { for (var d, i, x, nPrev = n.prev(), b = nPrev, r = 0; b.isEven(); ) b = b.divide(2), r++; next: for (i = 0; i < a.length; i++) if (!n.lesser(a[i]) && !(x = bigInt(a[i]).modPow(b, n)).isUnit() && !x.equals(nPrev)) { for (d = r - 1; 0 != d; d--) { if ((x = x.square().mod(n)).isUnit()) return !1; if (x.equals(nPrev)) continue next; } return !1; } return !0; } BigInteger.prototype = Object.create(Integer.prototype), SmallInteger.prototype = Object.create(Integer.prototype), NativeBigInt.prototype = Object.create(Integer.prototype), BigInteger.prototype.add = function(v) { var n = parseValue(v); if (this.sign !== n.sign) return this.subtract(n.negate()); var a = this.value, b = n.value; return n.isSmall ? new BigInteger(addSmall(a, Math.abs(b)), this.sign) : new BigInteger(addAny(a, b), this.sign); }, BigInteger.prototype.plus = BigInteger.prototype.add, SmallInteger.prototype.add = function(v) { var n = parseValue(v), a = this.value; if (a < 0 !== n.sign) return this.subtract(n.negate()); var b = n.value; if (n.isSmall) { if (isPrecise(a + b)) return new SmallInteger(a + b); b = smallToArray(Math.abs(b)); } return new BigInteger(addSmall(b, Math.abs(a)), a < 0); }, SmallInteger.prototype.plus = SmallInteger.prototype.add, NativeBigInt.prototype.add = function(v) { return new NativeBigInt(this.value + parseValue(v).value); }, NativeBigInt.prototype.plus = NativeBigInt.prototype.add, BigInteger.prototype.subtract = function(v) { var n = parseValue(v); if (this.sign !== n.sign) return this.add(n.negate()); var a = this.value, b = n.value; return n.isSmall ? subtractSmall(a, Math.abs(b), this.sign) : (function(a, b, sign) { var value; return compareAbs(a, b) >= 0 ? value = subtract(a, b) : (value = subtract(b, a), sign = !sign), "number" == typeof (value = arrayToSmall(value)) ? (sign && (value = -value), new SmallInteger(value)) : new BigInteger(value, sign); })(a, b, this.sign); }, BigInteger.prototype.minus = BigInteger.prototype.subtract, SmallInteger.prototype.subtract = function(v) { var n = parseValue(v), a = this.value; if (a < 0 !== n.sign) return this.add(n.negate()); var b = n.value; return n.isSmall ? new SmallInteger(a - b) : subtractSmall(b, Math.abs(a), a >= 0); }, SmallInteger.prototype.minus = SmallInteger.prototype.subtract, NativeBigInt.prototype.subtract = function(v) { return new NativeBigInt(this.value - parseValue(v).value); }, NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract, BigInteger.prototype.negate = function() { return new BigInteger(this.value, !this.sign); }, SmallInteger.prototype.negate = function() { var sign = this.sign, small = new SmallInteger(-this.value); return small.sign = !sign, small; }, NativeBigInt.prototype.negate = function() { return new NativeBigInt(-this.value); }, BigInteger.prototype.abs = function() { return new BigInteger(this.value, !1); }, SmallInteger.prototype.abs = function() { return new SmallInteger(Math.abs(this.value)); }, NativeBigInt.prototype.abs = function() { return new NativeBigInt(this.value >= 0 ? this.value : -this.value); }, BigInteger.prototype.multiply = function(v) { var abs, l1, l2, n = parseValue(v), a = this.value, b = n.value, sign = this.sign !== n.sign; if (n.isSmall) { if (0 === b) return Integer[0]; if (1 === b) return this; if (-1 === b) return this.negate(); if ((abs = Math.abs(b)) < BASE) return new BigInteger(multiplySmall(a, abs), sign); b = smallToArray(abs); } return new BigInteger(-.012 * (l1 = a.length) - .012 * (l2 = b.length) + 15e-6 * l1 * l2 > 0 ? multiplyKaratsuba(a, b) : multiplyLong(a, b), sign); }, BigInteger.prototype.times = BigInteger.prototype.multiply, SmallInteger.prototype._multiplyBySmall = function(a) { return isPrecise(a.value * this.value) ? new SmallInteger(a.value * this.value) : multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign); }, BigInteger.prototype._multiplyBySmall = function(a) { return 0 === a.value ? Integer[0] : 1 === a.value ? this : -1 === a.value ? this.negate() : multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign); }, SmallInteger.prototype.multiply = function(v) { return parseValue(v)._multiplyBySmall(this); }, SmallInteger.prototype.times = SmallInteger.prototype.multiply, NativeBigInt.prototype.multiply = function(v) { return new NativeBigInt(this.value * parseValue(v).value); }, NativeBigInt.prototype.times = NativeBigInt.prototype.multiply, BigInteger.prototype.square = function() { return new BigInteger(square(this.value), !1); }, SmallInteger.prototype.square = function() { var value = this.value * this.value; return isPrecise(value) ? new SmallInteger(value) : new BigInteger(square(smallToArray(Math.abs(this.value))), !1); }, NativeBigInt.prototype.square = function(v) { return new NativeBigInt(this.value * this.value); }, BigInteger.prototype.divmod = function(v) { var result = divModAny(this, v); return { quotient: result[0], remainder: result[1] }; }, NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod, BigInteger.prototype.divide = function(v) { return divModAny(this, v)[0]; }, NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function(v) { return new NativeBigInt(this.value / parseValue(v).value); }, SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide, BigInteger.prototype.mod = function(v) { return divModAny(this, v)[1]; }, NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function(v) { return new NativeBigInt(this.value % parseValue(v).value); }, SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod, BigInteger.prototype.pow = function(v) { var value, x, y, n = parseValue(v), a = this.value, b = n.value; if (0 === b) return Integer[1]; if (0 === a) return Integer[0]; if (1 === a) return Integer[1]; if (-1 === a) return n.isEven() ? Integer[1] : Integer[-1]; if (n.sign) return Integer[0]; if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large."); if (this.isSmall && isPrecise(value = Math.pow(a, b))) return new SmallInteger(truncate(value)); for (x = this, y = Integer[1]; !0 & b && (y = y.times(x), --b), 0 !== b; ) b /= 2, x = x.square(); return y; }, SmallInteger.prototype.pow = BigInteger.prototype.pow, NativeBigInt.prototype.pow = function(v) { var n = parseValue(v), a = this.value, b = n.value, _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2); if (b === _0) return Integer[1]; if (a === _0) return Integer[0]; if (a === _1) return Integer[1]; if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1]; if (n.isNegative()) return new NativeBigInt(_0); for (var x = this, y = Integer[1]; (b & _1) === _1 && (y = y.times(x), --b), b !== _0; ) b /= _2, x = x.square(); return y; }, BigInteger.prototype.modPow = function(exp, mod) { if (exp = parseValue(exp), (mod = parseValue(mod)).isZero()) throw new Error("Cannot take modPow with modulus 0"); var r = Integer[1], base = this.mod(mod); for (exp.isNegative() && (exp = exp.multiply(Integer[-1]), base = base.modInv(mod)); exp.isPositive(); ) { if (base.isZero()) return Integer[0]; exp.isOdd() && (r = r.multiply(base).mod(mod)), exp = exp.divide(2), base = base.square().mod(mod); } return r; }, NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow, BigInteger.prototype.compareAbs = function(v) { var n = parseValue(v), a = this.value, b = n.value; return n.isSmall ? 1 : compareAbs(a, b); }, SmallInteger.prototype.compareAbs = function(v) { var n = parseValue(v), a = Math.abs(this.value), b = n.value; return n.isSmall ? a === (b = Math.abs(b)) ? 0 : a > b ? 1 : -1 : -1; }, NativeBigInt.prototype.compareAbs = function(v) { var a = this.value, b = parseValue(v).value; return (a = a >= 0 ? a : -a) === (b = b >= 0 ? b : -b) ? 0 : a > b ? 1 : -1; }, BigInteger.prototype.compare = function(v) { if (v === 1 / 0) return -1; if (v === -1 / 0) return 1; var n = parseValue(v), a = this.value, b = n.value; return this.sign !== n.sign ? n.sign ? 1 : -1 : n.isSmall ? this.sign ? -1 : 1 : compareAbs(a, b) * (this.sign ? -1 : 1); }, BigInteger.prototype.compareTo = BigInteger.prototype.compare, SmallInteger.prototype.compare = function(v) { if (v === 1 / 0) return -1; if (v === -1 / 0) return 1; var n = parseValue(v), a = this.value, b = n.value; return n.isSmall ? a == b ? 0 : a > b ? 1 : -1 : a < 0 !== n.sign ? a < 0 ? -1 : 1 : a < 0 ? 1 : -1; }, SmallInteger.prototype.compareTo = SmallInteger.prototype.compare, NativeBigInt.prototype.compare = function(v) { if (v === 1 / 0) return -1; if (v === -1 / 0) return 1; var a = this.value, b = parseValue(v).value; return a === b ? 0 : a > b ? 1 : -1; }, NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare, BigInteger.prototype.equals = function(v) { return 0 === this.compare(v); }, NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals, BigInteger.prototype.notEquals = function(v) { return 0 !== this.compare(v); }, NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals, BigInteger.prototype.greater = function(v) { return this.compare(v) > 0; }, NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater, BigInteger.prototype.lesser = function(v) { return this.compare(v) < 0; }, NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser, BigInteger.prototype.greaterOrEquals = function(v) { return this.compare(v) >= 0; }, NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals, BigInteger.prototype.lesserOrEquals = function(v) { return this.compare(v) <= 0; }, NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals, BigInteger.prototype.isEven = function() { return 0 == (1 & this.value[0]); }, SmallInteger.prototype.isEven = function() { return 0 == (1 & this.value); }, NativeBigInt.prototype.isEven = function() { return (this.value & BigInt(1)) === BigInt(0); }, BigInteger.prototype.isOdd = function() { return 1 == (1 & this.value[0]); }, SmallInteger.prototype.isOdd = function() { return 1 == (1 & this.value); }, NativeBigInt.prototype.isOdd = function() { return (this.value & BigInt(1)) === BigInt(1); }, BigInteger.prototype.isPositive = function() { return !this.sign; }, SmallInteger.prototype.isPositive = function() { return this.value > 0; }, NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive, BigInteger.prototype.isNegative = function() { return this.sign; }, SmallInteger.prototype.isNegative = function() { return this.value < 0; }, NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative, BigInteger.prototype.isUnit = function() { return !1; }, SmallInteger.prototype.isUnit = function() { return 1 === Math.abs(this.value); }, NativeBigInt.prototype.isUnit = function() { return this.abs().value === BigInt(1); }, BigInteger.prototype.isZero = function() { return !1; }, SmallInteger.prototype.isZero = function() { return 0 === this.value; }, NativeBigInt.prototype.isZero = function() { return this.value === BigInt(0); }, BigInteger.prototype.isDivisibleBy = function(v) { var n = parseValue(v); return !n.isZero() && (!!n.isUnit() || (0 === n.compareAbs(2) ? this.isEven() : this.mod(n).isZero())); }, NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy, BigInteger.prototype.isPrime = function(strict) { var isPrime = isBasicPrime(this); if (undefined !== isPrime) return isPrime; var n = this.abs(), bits = n.bitLength(); if (bits <= 64) return millerRabinTest(n, [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37 ]); for (var logN = Math.log(2) * bits.toJSNumber(), t = Math.ceil(!0 === strict ? 2 * Math.pow(logN, 2) : logN), a = [], i = 0; i < t; i++) a.push(bigInt(i + 2)); return millerRabinTest(n, a); }, NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime, BigInteger.prototype.isProbablePrime = function(iterations, rng) { var isPrime = isBasicPrime(this); if (undefined !== isPrime) return isPrime; for (var n = this.abs(), t = undefined === iterations ? 5 : iterations, a = [], i = 0; i < t; i++) a.push(bigInt.randBetween(2, n.minus(2), rng)); return millerRabinTest(n, a); }, NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime, BigInteger.prototype.modInv = function(n) { for (var q, lastT, lastR, t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(); !newR.isZero(); ) q = r.divide(newR), lastT = t, lastR = r, t = newT, r = newR, newT = lastT.subtract(q.multiply(newT)), newR = lastR.subtract(q.multiply(newR)); if (!r.isUnit()) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime"); return -1 === t.compare(0) && (t = t.add(n)), this.isNegative() ? t.negate() : t; }, NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv, BigInteger.prototype.next = function() { var value = this.value; return this.sign ? subtractSmall(value, 1, this.sign) : new BigInteger(addSmall(value, 1), this.sign); }, SmallInteger.prototype.next = function() { var value = this.value; return value + 1 < MAX_INT ? new SmallInteger(value + 1) : new BigInteger(MAX_INT_ARR, !1); }, NativeBigInt.prototype.next = function() { return new NativeBigInt(this.value + BigInt(1)); }, BigInteger.prototype.prev = function() { var value = this.value; return this.sign ? new BigInteger(addSmall(value, 1), !0) : subtractSmall(value, 1, this.sign); }, SmallInteger.prototype.prev = function() { var value = this.value; return value - 1 > -MAX_INT ? new SmallInteger(value - 1) : new BigInteger(MAX_INT_ARR, !0); }, NativeBigInt.prototype.prev = function() { return new NativeBigInt(this.value - BigInt(1)); }; for (var powersOfTwo = [ 1 ]; 2 * powersOfTwo[powersOfTwo.length - 1] <= BASE; ) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1]; function shift_isSmall(n) { return Math.abs(n) <= BASE; } function bitwise(x, y, fn) { y = parseValue(y); for (var xSign = x.isNegative(), ySign = y.isNegative(), xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y, xDigit = 0, yDigit = 0, xDivMod = null, yDivMod = null, result = []; !xRem.isZero() || !yRem.isZero(); ) xDigit = (xDivMod = divModAny(xRem, highestPower2))[1].toJSNumber(), xSign && (xDigit = highestPower2 - 1 - xDigit), yDigit = (yDivMod = divModAny(yRem, highestPower2))[1].toJSNumber(), ySign && (yDigit = highestPower2 - 1 - yDigit), xRem = xDivMod[0], yRem = yDivMod[0], result.push(fn(xDigit, yDigit)); for (var sum = 0 !== fn(xSign ? 1 : 0, ySign ? 1 : 0) ? bigInt(-1) : bigInt(0), i = result.length - 1; i >= 0; i -= 1) sum = sum.multiply(highestPower2).add(bigInt(result[i])); return sum; } function roughLOB(n) { var v = n.value, x = "number" == typeof v ? 1073741824 | v : "bigint" == typeof v ? v | BigInt(1073741824) : v[0] + v[1] * BASE | 1073758208; return x & -x; } function integerLogarithm(value, base) { if (base.compareTo(value) <= 0) { var tmp = integerLogarithm(value, base.square(base)), p = tmp.p, e = tmp.e, t = p.multiply(base); return t.compareTo(value) <= 0 ? { p: t, e: 2 * e + 1 } : { p: p, e: 2 * e }; } return { p: bigInt(1), e: 0 }; } function max(a, b) { return a = parseValue(a), b = parseValue(b), a.greater(b) ? a : b; } function min(a, b) { return a = parseValue(a), b = parseValue(b), a.lesser(b) ? a : b; } function gcd(a, b) { if (a = parseValue(a).abs(), b = parseValue(b).abs(), a.equals(b)) return a; if (a.isZero()) return b; if (b.isZero()) return a; for (var d, t, c = Integer[1]; a.isEven() && b.isEven(); ) d = min(roughLOB(a), roughLOB(b)), a = a.divide(d), b = b.divide(d), c = c.multiply(d); for (;a.isEven(); ) a = a.divide(roughLOB(a)); do { for (;b.isEven(); ) b = b.divide(roughLOB(b)); a.greater(b) && (t = b, b = a, a = t), b = b.subtract(a); } while (!b.isZero()); return c.isUnit() ? a : a.multiply(c); } BigInteger.prototype.shiftLeft = function(v) { var n = parseValue(v).toJSNumber(); if (!shift_isSmall(n)) throw new Error(String(n) + " is too large for shifting."); if (n < 0) return this.shiftRight(-n); var result = this; if (result.isZero()) return result; for (;n >= powers2Length; ) result = result.multiply(highestPower2), n -= powers2Length - 1; return result.multiply(powersOfTwo[n]); }, NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft, BigInteger.prototype.shiftRight = function(v) { var remQuo, n = parseValue(v).toJSNumber(); if (!shift_isSmall(n)) throw new Error(String(n) + " is too large for shifting."); if (n < 0) return this.shiftLeft(-n); for (var result = this; n >= powers2Length; ) { if (result.isZero() || result.isNegative() && result.isUnit()) return result; result = (remQuo = divModAny(result, highestPower2))[1].isNegative() ? remQuo[0].prev() : remQuo[0], n -= powers2Length - 1; } return (remQuo = divModAny(result, powersOfTwo[n]))[1].isNegative() ? remQuo[0].prev() : remQuo[0]; }, NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight, BigInteger.prototype.not = function() { return this.negate().prev(); }, NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not, BigInteger.prototype.and = function(n) { return bitwise(this, n, (function(a, b) { return a & b; })); }, NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and, BigInteger.prototype.or = function(n) { return bitwise(this, n, (function(a, b) { return a | b; })); }, NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or, BigInteger.prototype.xor = function(n) { return bitwise(this, n, (function(a, b) { return a ^ b; })); }, NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor, BigInteger.prototype.bitLength = function() { var n = this; return n.compareTo(bigInt(0)) < 0 && (n = n.negate().subtract(bigInt(1))), 0 === n.compareTo(bigInt(0)) ? bigInt(0) : bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1)); }, NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength; var parseBase = function(text, base, alphabet, caseSensitive) { alphabet = alphabet || "0123456789abcdefghijklmnopqrstuvwxyz", text = String(text), caseSensitive || (text = text.toLowerCase(), alphabet = alphabet.toLowerCase()); var i, length = text.length, absBase = Math.abs(base), alphabetValues = {}; for (i = 0; i < alphabet.length; i++) alphabetValues[alphabet[i]] = i; for (i = 0; i < length; i++) if ("-" !== (c = text[i]) && c in alphabetValues && alphabetValues[c] >= absBase) { if ("1" === c && 1 === absBase) continue; throw new Error(c + " is not a valid digit in base " + base + "."); } base = parseValue(base); var digits = [], isNegative = "-" === text[0]; for (i = isNegative ? 1 : 0; i < text.length; i++) { var c; if ((c = text[i]) in alphabetValues) digits.push(parseValue(alphabetValues[c])); else { if ("<" !== c) throw new Error(c + " is not a valid character"); var start = i; do { i++; } while (">" !== text[i] && i < text.length); digits.push(parseValue(text.slice(start + 1, i))); } } return parseBaseFromArray(digits, base, isNegative); }; function parseBaseFromArray(digits, base, isNegative) { var i, val = Integer[0], pow = Integer[1]; for (i = digits.length - 1; i >= 0; i--) val = val.add(digits[i].times(pow)), pow = pow.times(base); return isNegative ? val.negate() : val; } function toBase(n, base) { if ((base = bigInt(base)).isZero()) { if (n.isZero()) return { value: [ 0 ], isNegative: !1 }; throw new Error("Cannot convert nonzero numbers to base 0."); } if (base.equals(-1)) { if (n.isZero()) return { value: [ 0 ], isNegative: !1 }; if (n.isNegative()) return { value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber())).map(Array.prototype.valueOf, [ 1, 0 ])), isNegative: !1 }; var arr = Array.apply(null, Array(n.toJSNumber() - 1)).map(Array.prototype.valueOf, [ 0, 1 ]); return arr.unshift([ 1 ]), { value: [].concat.apply([], arr), isNegative: !1 }; } var neg = !1; if (n.isNegative() && base.isPositive() && (neg = !0, n = n.abs()), base.isUnit()) return n.isZero() ? { value: [ 0 ], isNegative: !1 } : { value: Array.apply(null, Array(n.toJSNumber())).map(Number.prototype.valueOf, 1), isNegative: neg }; for (var divmod, out = [], left = n; left.isNegative() || left.compareAbs(base) >= 0; ) { divmod = left.divmod(base), left = divmod.quotient; var digit = divmod.remainder; digit.isNegative() && (digit = base.minus(digit).abs(), left = left.next()), out.push(digit.toJSNumber()); } return out.push(left.toJSNumber()), { value: out.reverse(), isNegative: neg }; } function toBaseString(n, base, alphabet) { var arr = toBase(n, base); return (arr.isNegative ? "-" : "") + arr.value.map((function(x) { return (function(digit, alphabet) { return digit < (alphabet = alphabet || "0123456789abcdefghijklmnopqrstuvwxyz").length ? alphabet[digit] : "<" + digit + ">"; })(x, alphabet); })).join(""); } function parseStringValue(v) { if (isPrecise(+v)) { var x = +v; if (x === truncate(x)) return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x); throw new Error("Invalid integer: " + v); } var sign = "-" === v[0]; sign && (v = v.slice(1)); var split = v.split(/e/i); if (split.length > 2) throw new Error("Invalid integer: " + split.join("e")); if (2 === split.length) { var exp = split[1]; if ("+" === exp[0] && (exp = exp.slice(1)), (exp = +exp) !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent."); var text = split[0], decimalPlace = text.indexOf("."); if (decimalPlace >= 0 && (exp -= text.length - decimalPlace - 1, text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1)), exp < 0) throw new Error("Cannot include negative exponent part for integers"); v = text += new Array(exp + 1).join("0"); } if (!/^([0-9][0-9]*)$/.test(v)) throw new Error("Invalid integer: " + v); if (supportsNativeBigInt) return new NativeBigInt(BigInt(sign ? "-" + v : v)); for (var r = [], max = v.length, min = max - 7; max > 0; ) r.push(+v.slice(min, max)), (min -= 7) < 0 && (min = 0), max -= 7; return trim(r), new BigInteger(r, sign); } function parseValue(v) { return "number" == typeof v ? (function(v) { if (supportsNativeBigInt) return new NativeBigInt(BigInt(v)); if (isPrecise(v)) { if (v !== truncate(v)) throw new Error(v + " is not an integer."); return new SmallInteger(v); } return parseStringValue(v.toString()); })(v) : "string" == typeof v ? parseStringValue(v) : "bigint" == typeof v ? new NativeBigInt(v) : v; } BigInteger.prototype.toArray = function(radix) { return toBase(this, radix); }, SmallInteger.prototype.toArray = function(radix) { return toBase(this, radix); }, NativeBigInt.prototype.toArray = function(radix) { return toBase(this, radix); }, BigInteger.prototype.toString = function(radix, alphabet) { if (undefined === radix && (radix = 10), 10 !== radix || alphabet) return toBaseString(this, radix, alphabet); for (var digit, v = this.value, l = v.length, str = String(v[--l]); --l >= 0; ) digit = String(v[l]), str += "0000000".slice(digit.length) + digit; return (this.sign ? "-" : "") + str; }, SmallInteger.prototype.toString = function(radix, alphabet) { return undefined === radix && (radix = 10), 10 != radix || alphabet ? toBaseString(this, radix, alphabet) : String(this.value); }, NativeBigInt.prototype.toString = SmallInteger.prototype.toString, NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function() { return this.toString(); }, BigInteger.prototype.valueOf = function() { return parseInt(this.toString(), 10); }, BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf, SmallInteger.prototype.valueOf = function() { return this.value; }, SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf, NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function() { return parseInt(this.toString(), 10); }; for (var i = 0; i < 1e3; i++) Integer[i] = parseValue(i), i > 0 && (Integer[-i] = parseValue(-i)); return Integer.one = Integer[1], Integer.zero = Integer[0], Integer.minusOne = Integer[-1], Integer.max = max, Integer.min = min, Integer.gcd = gcd, Integer.lcm = function(a, b) { return a = parseValue(a).abs(), b = parseValue(b).abs(), a.divide(gcd(a, b)).multiply(b); }, Integer.isInstance = function(x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; }, Integer.randBetween = function(a, b, rng) { a = parseValue(a), b = parseValue(b); var usedRNG = rng || Math.random, low = min(a, b), range = max(a, b).subtract(low).add(1); if (range.isSmall) return low.add(Math.floor(usedRNG() * range)); for (var digits = toBase(range, BASE).value, result = [], restricted = !0, i = 0; i < digits.length; i++) { var top = restricted ? digits[i] + (i + 1 < digits.length ? digits[i + 1] / BASE : 0) : BASE, digit = truncate(usedRNG() * top); result.push(digit), digit < digits[i] && (restricted = !1); } return low.add(Integer.fromArray(result, BASE, !1)); }, Integer.fromArray = function(digits, base, isNegative) { return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative); }, Integer; })(); module.hasOwnProperty("exports") && (module.exports = bigInt), void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return bigInt; }.call(exports, __webpack_require__, exports, module)) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); }).call(this, __webpack_require__(69)(module)); }, function(module, exports, __webpack_require__) { "use strict"; var old; "undefined" != typeof Promise && (old = Promise); var bluebird = __webpack_require__(1242)(); bluebird.noConflict = function() { try { Promise === bluebird && (Promise = old); } catch (e) {} return bluebird; }, module.exports = bluebird; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function() { var makeSelfResolutionError = function() { return new TypeError("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n"); }, reflectHandler = function() { return new Promise.PromiseInspection(this._target()); }, apiRejection = function(msg) { return Promise.reject(new TypeError(msg)); }; function Proxyable() {} var getDomain, UNDEFINED_BINDING = {}, util = __webpack_require__(17); getDomain = util.isNode ? function() { var ret = process.domain; return void 0 === ret && (ret = null), ret; } : function() { return null; }, util.notEnumerableProp(Promise, "_getDomain", getDomain); var es5 = __webpack_require__(92), Async = __webpack_require__(1243), async = new Async; es5.defineProperty(Promise, "_async", { value: async }); var errors = __webpack_require__(64), TypeError = Promise.TypeError = errors.TypeError; Promise.RangeError = errors.RangeError; var CancellationError = Promise.CancellationError = errors.CancellationError; Promise.TimeoutError = errors.TimeoutError, Promise.OperationalError = errors.OperationalError, Promise.RejectionError = errors.OperationalError, Promise.AggregateError = errors.AggregateError; var INTERNAL = function() {}, APPLY = {}, NEXT_FILTER = {}, tryConvertToPromise = __webpack_require__(1246)(Promise, INTERNAL), PromiseArray = __webpack_require__(1247)(Promise, INTERNAL, tryConvertToPromise, apiRejection, Proxyable), Context = __webpack_require__(1248)(Promise), createContext = Context.create, debug = __webpack_require__(1249)(Promise, Context), PassThroughHandlerContext = (debug.CapturedTrace, __webpack_require__(1250)(Promise, tryConvertToPromise)), catchFilter = __webpack_require__(1251)(NEXT_FILTER), nodebackForPromise = __webpack_require__(551), errorObj = util.errorObj, tryCatch = util.tryCatch; function Promise(executor) { this._bitField = 0, this._fulfillmentHandler0 = void 0, this._rejectionHandler0 = void 0, this._promise0 = void 0, this._receiver0 = void 0, executor !== INTERNAL && ((function(self, executor) { if ("function" != typeof executor) throw new TypeError("expecting a function but got " + util.classString(executor)); if (self.constructor !== Promise) throw new TypeError("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n"); })(this, executor), this._resolveFromExecutor(executor)), this._promiseCreated(), this._fireEvent("promiseCreated", this); } function deferResolve(v) { this.promise._resolveCallback(v); } function deferReject(v) { this.promise._rejectCallback(v, !1); } function fillTypes(value) { var p = new Promise(INTERNAL); p._fulfillmentHandler0 = value, p._rejectionHandler0 = value, p._promise0 = value, p._receiver0 = value; } return Promise.prototype.toString = function() { return "[object Promise]"; }, Promise.prototype.caught = Promise.prototype.catch = function(fn) { var len = arguments.length; if (len > 1) { var i, catchInstances = new Array(len - 1), j = 0; for (i = 0; i < len - 1; ++i) { var item = arguments[i]; if (!util.isObject(item)) return apiRejection("expecting an object but got A catch statement predicate " + util.classString(item)); catchInstances[j++] = item; } return catchInstances.length = j, fn = arguments[i], this.then(void 0, catchFilter(catchInstances, fn, this)); } return this.then(void 0, fn); }, Promise.prototype.reflect = function() { return this._then(reflectHandler, reflectHandler, void 0, this, void 0); }, Promise.prototype.then = function(didFulfill, didReject) { if (debug.warnings() && arguments.length > 0 && "function" != typeof didFulfill && "function" != typeof didReject) { var msg = ".then() only accepts functions but was passed: " + util.classString(didFulfill); arguments.length > 1 && (msg += ", " + util.classString(didReject)), this._warn(msg); } return this._then(didFulfill, didReject, void 0, void 0, void 0); }, Promise.prototype.done = function(didFulfill, didReject) { this._then(didFulfill, didReject, void 0, void 0, void 0)._setIsFinal(); }, Promise.prototype.spread = function(fn) { return "function" != typeof fn ? apiRejection("expecting a function but got " + util.classString(fn)) : this.all()._then(fn, void 0, void 0, APPLY, void 0); }, Promise.prototype.toJSON = function() { var ret = { isFulfilled: !1, isRejected: !1, fulfillmentValue: void 0, rejectionReason: void 0 }; return this.isFulfilled() ? (ret.fulfillmentValue = this.value(), ret.isFulfilled = !0) : this.isRejected() && (ret.rejectionReason = this.reason(), ret.isRejected = !0), ret; }, Promise.prototype.all = function() { return arguments.length > 0 && this._warn(".all() was passed arguments but it does not take any"), new PromiseArray(this).promise(); }, Promise.prototype.error = function(fn) { return this.caught(util.originatesFromRejection, fn); }, Promise.getNewLibraryCopy = module.exports, Promise.is = function(val) { return val instanceof Promise; }, Promise.fromNode = Promise.fromCallback = function(fn) { var ret = new Promise(INTERNAL); ret._captureStackTrace(); var multiArgs = arguments.length > 1 && !!Object(arguments[1]).multiArgs, result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); return result === errorObj && ret._rejectCallback(result.e, !0), ret._isFateSealed() || ret._setAsyncGuaranteed(), ret; }, Promise.all = function(promises) { return new PromiseArray(promises).promise(); }, Promise.cast = function(obj) { var ret = tryConvertToPromise(obj); return ret instanceof Promise || ((ret = new Promise(INTERNAL))._captureStackTrace(), ret._setFulfilled(), ret._rejectionHandler0 = obj), ret; }, Promise.resolve = Promise.fulfilled = Promise.cast, Promise.reject = Promise.rejected = function(reason) { var ret = new Promise(INTERNAL); return ret._captureStackTrace(), ret._rejectCallback(reason, !0), ret; }, Promise.setScheduler = function(fn) { if ("function" != typeof fn) throw new TypeError("expecting a function but got " + util.classString(fn)); return async.setScheduler(fn); }, Promise.prototype._then = function(didFulfill, didReject, _, receiver, internalData) { var haveInternalData = void 0 !== internalData, promise = haveInternalData ? internalData : new Promise(INTERNAL), target = this._target(), bitField = target._bitField; haveInternalData || (promise._propagateFrom(this, 3), promise._captureStackTrace(), void 0 === receiver && 0 != (2097152 & this._bitField) && (receiver = 0 != (50397184 & bitField) ? this._boundValue() : target === this ? void 0 : this._boundTo), this._fireEvent("promiseChained", this, promise)); var domain = getDomain(); if (0 != (50397184 & bitField)) { var handler, value, settler = target._settlePromiseCtx; 0 != (33554432 & bitField) ? (value = target._rejectionHandler0, handler = didFulfill) : 0 != (16777216 & bitField) ? (value = target._fulfillmentHandler0, handler = didReject, target._unsetRejectionIsUnhandled()) : (settler = target._settlePromiseLateCancellationObserver, value = new CancellationError("late cancellation observer"), target._attachExtraTrace(value), handler = didReject), async.invoke(settler, target, { handler: null === domain ? handler : "function" == typeof handler && util.domainBind(domain, handler), promise: promise, receiver: receiver, value: value }); } else target._addCallbacks(didFulfill, didReject, promise, receiver, domain); return promise; }, Promise.prototype._length = function() { return 65535 & this._bitField; }, Promise.prototype._isFateSealed = function() { return 0 != (117506048 & this._bitField); }, Promise.prototype._isFollowing = function() { return 67108864 == (67108864 & this._bitField); }, Promise.prototype._setLength = function(len) { this._bitField = -65536 & this._bitField | 65535 & len; }, Promise.prototype._setFulfilled = function() { this._bitField = 33554432 | this._bitField, this._fireEvent("promiseFulfilled", this); }, Promise.prototype._setRejected = function() { this._bitField = 16777216 | this._bitField, this._fireEvent("promiseRejected", this); }, Promise.prototype._setFollowing = function() { this._bitField = 67108864 | this._bitField, this._fireEvent("promiseResolved", this); }, Promise.prototype._setIsFinal = function() { this._bitField = 4194304 | this._bitField; }, Promise.prototype._isFinal = function() { return (4194304 & this._bitField) > 0; }, Promise.prototype._unsetCancelled = function() { this._bitField = -65537 & this._bitField; }, Promise.prototype._setCancelled = function() { this._bitField = 65536 | this._bitField, this._fireEvent("promiseCancelled", this); }, Promise.prototype._setWillBeCancelled = function() { this._bitField = 8388608 | this._bitField; }, Promise.prototype._setAsyncGuaranteed = function() { async.hasCustomScheduler() || (this._bitField = 134217728 | this._bitField); }, Promise.prototype._receiverAt = function(index) { var ret = 0 === index ? this._receiver0 : this[4 * index - 4 + 3]; if (ret !== UNDEFINED_BINDING) return void 0 === ret && this._isBound() ? this._boundValue() : ret; }, Promise.prototype._promiseAt = function(index) { return this[4 * index - 4 + 2]; }, Promise.prototype._fulfillmentHandlerAt = function(index) { return this[4 * index - 4 + 0]; }, Promise.prototype._rejectionHandlerAt = function(index) { return this[4 * index - 4 + 1]; }, Promise.prototype._boundValue = function() {}, Promise.prototype._migrateCallback0 = function(follower) { follower._bitField; var fulfill = follower._fulfillmentHandler0, reject = follower._rejectionHandler0, promise = follower._promise0, receiver = follower._receiverAt(0); void 0 === receiver && (receiver = UNDEFINED_BINDING), this._addCallbacks(fulfill, reject, promise, receiver, null); }, Promise.prototype._migrateCallbackAt = function(follower, index) { var fulfill = follower._fulfillmentHandlerAt(index), reject = follower._rejectionHandlerAt(index), promise = follower._promiseAt(index), receiver = follower._receiverAt(index); void 0 === receiver && (receiver = UNDEFINED_BINDING), this._addCallbacks(fulfill, reject, promise, receiver, null); }, Promise.prototype._addCallbacks = function(fulfill, reject, promise, receiver, domain) { var index = this._length(); if (index >= 65531 && (index = 0, this._setLength(0)), 0 === index) this._promise0 = promise, this._receiver0 = receiver, "function" == typeof fulfill && (this._fulfillmentHandler0 = null === domain ? fulfill : util.domainBind(domain, fulfill)), "function" == typeof reject && (this._rejectionHandler0 = null === domain ? reject : util.domainBind(domain, reject)); else { var base = 4 * index - 4; this[base + 2] = promise, this[base + 3] = receiver, "function" == typeof fulfill && (this[base + 0] = null === domain ? fulfill : util.domainBind(domain, fulfill)), "function" == typeof reject && (this[base + 1] = null === domain ? reject : util.domainBind(domain, reject)); } return this._setLength(index + 1), index; }, Promise.prototype._proxy = function(proxyable, arg) { this._addCallbacks(void 0, void 0, arg, proxyable, null); }, Promise.prototype._resolveCallback = function(value, shouldBind) { if (0 == (117506048 & this._bitField)) { if (value === this) return this._rejectCallback(makeSelfResolutionError(), !1); var maybePromise = tryConvertToPromise(value, this); if (!(maybePromise instanceof Promise)) return this._fulfill(value); shouldBind && this._propagateFrom(maybePromise, 2); var promise = maybePromise._target(); if (promise !== this) { var bitField = promise._bitField; if (0 == (50397184 & bitField)) { var len = this._length(); len > 0 && promise._migrateCallback0(this); for (var i = 1; i < len; ++i) promise._migrateCallbackAt(this, i); this._setFollowing(), this._setLength(0), this._setFollowee(promise); } else if (0 != (33554432 & bitField)) this._fulfill(promise._value()); else if (0 != (16777216 & bitField)) this._reject(promise._reason()); else { var reason = new CancellationError("late cancellation observer"); promise._attachExtraTrace(reason), this._reject(reason); } } else this._reject(makeSelfResolutionError()); } }, Promise.prototype._rejectCallback = function(reason, synchronous, ignoreNonErrorWarnings) { var trace = util.ensureErrorObject(reason), hasStack = trace === reason; if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { var message = "a promise was rejected with a non-error: " + util.classString(reason); this._warn(message, !0); } this._attachExtraTrace(trace, !!synchronous && hasStack), this._reject(reason); }, Promise.prototype._resolveFromExecutor = function(executor) { var promise = this; this._captureStackTrace(), this._pushContext(); var synchronous = !0, r = this._execute(executor, (function(value) { promise._resolveCallback(value); }), (function(reason) { promise._rejectCallback(reason, synchronous); })); synchronous = !1, this._popContext(), void 0 !== r && promise._rejectCallback(r, !0); }, Promise.prototype._settlePromiseFromHandler = function(handler, receiver, value, promise) { var bitField = promise._bitField; if (0 == (65536 & bitField)) { var x; promise._pushContext(), receiver === APPLY ? value && "number" == typeof value.length ? x = tryCatch(handler).apply(this._boundValue(), value) : (x = errorObj).e = new TypeError("cannot .spread() a non-array: " + util.classString(value)) : x = tryCatch(handler).call(receiver, value); var promiseCreated = promise._popContext(); 0 == (65536 & (bitField = promise._bitField)) && (x === NEXT_FILTER ? promise._reject(value) : x === errorObj ? promise._rejectCallback(x.e, !1) : (debug.checkForgottenReturns(x, promiseCreated, "", promise, this), promise._resolveCallback(x))); } }, Promise.prototype._target = function() { for (var ret = this; ret._isFollowing(); ) ret = ret._followee(); return ret; }, Promise.prototype._followee = function() { return this._rejectionHandler0; }, Promise.prototype._setFollowee = function(promise) { this._rejectionHandler0 = promise; }, Promise.prototype._settlePromise = function(promise, handler, receiver, value) { var isPromise = promise instanceof Promise, bitField = this._bitField, asyncGuaranteed = 0 != (134217728 & bitField); 0 != (65536 & bitField) ? (isPromise && promise._invokeInternalOnCancel(), receiver instanceof PassThroughHandlerContext && receiver.isFinallyHandler() ? (receiver.cancelPromise = promise, tryCatch(handler).call(receiver, value) === errorObj && promise._reject(errorObj.e)) : handler === reflectHandler ? promise._fulfill(reflectHandler.call(receiver)) : receiver instanceof Proxyable ? receiver._promiseCancelled(promise) : isPromise || promise instanceof PromiseArray ? promise._cancel() : receiver.cancel()) : "function" == typeof handler ? isPromise ? (asyncGuaranteed && promise._setAsyncGuaranteed(), this._settlePromiseFromHandler(handler, receiver, value, promise)) : handler.call(receiver, value, promise) : receiver instanceof Proxyable ? receiver._isResolved() || (0 != (33554432 & bitField) ? receiver._promiseFulfilled(value, promise) : receiver._promiseRejected(value, promise)) : isPromise && (asyncGuaranteed && promise._setAsyncGuaranteed(), 0 != (33554432 & bitField) ? promise._fulfill(value) : promise._reject(value)); }, Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { var handler = ctx.handler, promise = ctx.promise, receiver = ctx.receiver, value = ctx.value; "function" == typeof handler ? promise instanceof Promise ? this._settlePromiseFromHandler(handler, receiver, value, promise) : handler.call(receiver, value, promise) : promise instanceof Promise && promise._reject(value); }, Promise.prototype._settlePromiseCtx = function(ctx) { this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); }, Promise.prototype._settlePromise0 = function(handler, value, bitField) { var promise = this._promise0, receiver = this._receiverAt(0); this._promise0 = void 0, this._receiver0 = void 0, this._settlePromise(promise, handler, receiver, value); }, Promise.prototype._clearCallbackDataAtIndex = function(index) { var base = 4 * index - 4; this[base + 2] = this[base + 3] = this[base + 0] = this[base + 1] = void 0; }, Promise.prototype._fulfill = function(value) { var bitField = this._bitField; if (!((117506048 & bitField) >>> 16)) { if (value === this) { var err = makeSelfResolutionError(); return this._attachExtraTrace(err), this._reject(err); } this._setFulfilled(), this._rejectionHandler0 = value, (65535 & bitField) > 0 && (0 != (134217728 & bitField) ? this._settlePromises() : async.settlePromises(this)); } }, Promise.prototype._reject = function(reason) { var bitField = this._bitField; if (!((117506048 & bitField) >>> 16)) { if (this._setRejected(), this._fulfillmentHandler0 = reason, this._isFinal()) return async.fatalError(reason, util.isNode); (65535 & bitField) > 0 ? async.settlePromises(this) : this._ensurePossibleRejectionHandled(); } }, Promise.prototype._fulfillPromises = function(len, value) { for (var i = 1; i < len; i++) { var handler = this._fulfillmentHandlerAt(i), promise = this._promiseAt(i), receiver = this._receiverAt(i); this._clearCallbackDataAtIndex(i), this._settlePromise(promise, handler, receiver, value); } }, Promise.prototype._rejectPromises = function(len, reason) { for (var i = 1; i < len; i++) { var handler = this._rejectionHandlerAt(i), promise = this._promiseAt(i), receiver = this._receiverAt(i); this._clearCallbackDataAtIndex(i), this._settlePromise(promise, handler, receiver, reason); } }, Promise.prototype._settlePromises = function() { var bitField = this._bitField, len = 65535 & bitField; if (len > 0) { if (0 != (16842752 & bitField)) { var reason = this._fulfillmentHandler0; this._settlePromise0(this._rejectionHandler0, reason, bitField), this._rejectPromises(len, reason); } else { var value = this._rejectionHandler0; this._settlePromise0(this._fulfillmentHandler0, value, bitField), this._fulfillPromises(len, value); } this._setLength(0); } this._clearCancellationData(); }, Promise.prototype._settledValue = function() { var bitField = this._bitField; return 0 != (33554432 & bitField) ? this._rejectionHandler0 : 0 != (16777216 & bitField) ? this._fulfillmentHandler0 : void 0; }, Promise.defer = Promise.pending = function() { return debug.deprecated("Promise.defer", "new Promise"), { promise: new Promise(INTERNAL), resolve: deferResolve, reject: deferReject }; }, util.notEnumerableProp(Promise, "_makeSelfResolutionError", makeSelfResolutionError), __webpack_require__(1252)(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug), __webpack_require__(1253)(Promise, INTERNAL, tryConvertToPromise, debug), __webpack_require__(1254)(Promise, PromiseArray, apiRejection, debug), __webpack_require__(1255)(Promise), __webpack_require__(1256)(Promise), __webpack_require__(1257)(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain), Promise.Promise = Promise, Promise.version = "3.4.7", __webpack_require__(1258)(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug), __webpack_require__(1259)(Promise), __webpack_require__(1260)(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug), __webpack_require__(1261)(Promise, INTERNAL, debug), __webpack_require__(1262)(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug), __webpack_require__(1263)(Promise), __webpack_require__(1264)(Promise, INTERNAL), __webpack_require__(1265)(Promise, PromiseArray, tryConvertToPromise, apiRejection), __webpack_require__(1266)(Promise, INTERNAL, tryConvertToPromise, apiRejection), __webpack_require__(1267)(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug), __webpack_require__(1268)(Promise, PromiseArray, debug), __webpack_require__(1269)(Promise, PromiseArray, apiRejection), __webpack_require__(1270)(Promise, INTERNAL), __webpack_require__(1271)(Promise, INTERNAL), __webpack_require__(1272)(Promise), util.toFastProperties(Promise), util.toFastProperties(Promise.prototype), fillTypes({ a: 1 }), fillTypes({ b: 2 }), fillTypes({ c: 3 }), fillTypes(1), fillTypes((function() {})), fillTypes(void 0), fillTypes(!1), fillTypes(new Promise(INTERNAL)), debug.setBounds(Async.firstLineError, util.lastLineError), Promise; }; }, function(module, exports, __webpack_require__) { "use strict"; var firstLineError; try { throw new Error; } catch (e) { firstLineError = e; } var schedule = __webpack_require__(1244), Queue = __webpack_require__(1245), util = __webpack_require__(17); function Async() { this._customScheduler = !1, this._isTickUsed = !1, this._lateQueue = new Queue(16), this._normalQueue = new Queue(16), this._haveDrainedQueues = !1, this._trampolineEnabled = !0; var self = this; this.drainQueues = function() { self._drainQueues(); }, this._schedule = schedule; } function AsyncInvokeLater(fn, receiver, arg) { this._lateQueue.push(fn, receiver, arg), this._queueTick(); } function AsyncInvoke(fn, receiver, arg) { this._normalQueue.push(fn, receiver, arg), this._queueTick(); } function AsyncSettlePromises(promise) { this._normalQueue._pushOne(promise), this._queueTick(); } Async.prototype.setScheduler = function(fn) { var prev = this._schedule; return this._schedule = fn, this._customScheduler = !0, prev; }, Async.prototype.hasCustomScheduler = function() { return this._customScheduler; }, Async.prototype.enableTrampoline = function() { this._trampolineEnabled = !0; }, Async.prototype.disableTrampolineIfNecessary = function() { util.hasDevTools && (this._trampolineEnabled = !1); }, Async.prototype.haveItemsQueued = function() { return this._isTickUsed || this._haveDrainedQueues; }, Async.prototype.fatalError = function(e, isNode) { isNode ? (process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + "\n"), process.exit(2)) : this.throwLater(e); }, Async.prototype.throwLater = function(fn, arg) { if (1 === arguments.length && (arg = fn, fn = function() { throw arg; }), "undefined" != typeof setTimeout) setTimeout((function() { fn(arg); }), 0); else try { this._schedule((function() { fn(arg); })); } catch (e) { throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n"); } }, util.hasDevTools ? (Async.prototype.invokeLater = function(fn, receiver, arg) { this._trampolineEnabled ? AsyncInvokeLater.call(this, fn, receiver, arg) : this._schedule((function() { setTimeout((function() { fn.call(receiver, arg); }), 100); })); }, Async.prototype.invoke = function(fn, receiver, arg) { this._trampolineEnabled ? AsyncInvoke.call(this, fn, receiver, arg) : this._schedule((function() { fn.call(receiver, arg); })); }, Async.prototype.settlePromises = function(promise) { this._trampolineEnabled ? AsyncSettlePromises.call(this, promise) : this._schedule((function() { promise._settlePromises(); })); }) : (Async.prototype.invokeLater = AsyncInvokeLater, Async.prototype.invoke = AsyncInvoke, Async.prototype.settlePromises = AsyncSettlePromises), Async.prototype._drainQueue = function(queue) { for (;queue.length() > 0; ) { var fn = queue.shift(); if ("function" == typeof fn) { var receiver = queue.shift(), arg = queue.shift(); fn.call(receiver, arg); } else fn._settlePromises(); } }, Async.prototype._drainQueues = function() { this._drainQueue(this._normalQueue), this._reset(), this._haveDrainedQueues = !0, this._drainQueue(this._lateQueue); }, Async.prototype._queueTick = function() { this._isTickUsed || (this._isTickUsed = !0, this._schedule(this.drainQueues)); }, Async.prototype._reset = function() { this._isTickUsed = !1; }, module.exports = Async, module.exports.firstLineError = firstLineError; }, function(module, exports, __webpack_require__) { "use strict"; var schedule, util = __webpack_require__(17), NativePromise = util.getNativePromise(); if (util.isNode && "undefined" == typeof MutationObserver) { var GlobalSetImmediate = global.setImmediate, ProcessNextTick = process.nextTick; schedule = util.isRecentNode ? function(fn) { GlobalSetImmediate.call(global, fn); } : function(fn) { ProcessNextTick.call(process, fn); }; } else if ("function" == typeof NativePromise && "function" == typeof NativePromise.resolve) { var nativePromise = NativePromise.resolve(); schedule = function(fn) { nativePromise.then(fn); }; } else schedule = "undefined" == typeof MutationObserver || "undefined" != typeof window && window.navigator && (window.navigator.standalone || window.cordova) ? "undefined" != typeof setImmediate ? function(fn) { setImmediate(fn); } : "undefined" != typeof setTimeout ? function(fn) { setTimeout(fn, 0); } : function() { throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n"); } : (function() { var div = document.createElement("div"), opts = { attributes: !0 }, toggleScheduled = !1, div2 = document.createElement("div"); return new MutationObserver((function() { div.classList.toggle("foo"), toggleScheduled = !1; })).observe(div2, opts), function(fn) { var o = new MutationObserver((function() { o.disconnect(), fn(); })); o.observe(div, opts), toggleScheduled || (toggleScheduled = !0, div2.classList.toggle("foo")); }; })(); module.exports = schedule; }, function(module, exports, __webpack_require__) { "use strict"; function Queue(capacity) { this._capacity = capacity, this._length = 0, this._front = 0; } Queue.prototype._willBeOverCapacity = function(size) { return this._capacity < size; }, Queue.prototype._pushOne = function(arg) { var length = this.length(); this._checkCapacity(length + 1), this[this._front + length & this._capacity - 1] = arg, this._length = length + 1; }, Queue.prototype.push = function(fn, receiver, arg) { var length = this.length() + 3; if (this._willBeOverCapacity(length)) return this._pushOne(fn), this._pushOne(receiver), void this._pushOne(arg); var j = this._front + length - 3; this._checkCapacity(length); var wrapMask = this._capacity - 1; this[j + 0 & wrapMask] = fn, this[j + 1 & wrapMask] = receiver, this[j + 2 & wrapMask] = arg, this._length = length; }, Queue.prototype.shift = function() { var front = this._front, ret = this[front]; return this[front] = void 0, this._front = front + 1 & this._capacity - 1, this._length--, ret; }, Queue.prototype.length = function() { return this._length; }, Queue.prototype._checkCapacity = function(size) { this._capacity < size && this._resizeTo(this._capacity << 1); }, Queue.prototype._resizeTo = function(capacity) { var oldCapacity = this._capacity; this._capacity = capacity, (function(src, srcIndex, dst, dstIndex, len) { for (var j = 0; j < len; ++j) dst[j + dstIndex] = src[j + 0], src[j + 0] = void 0; })(this, 0, this, oldCapacity, this._front + this._length & oldCapacity - 1); }, module.exports = Queue; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var util = __webpack_require__(17), errorObj = util.errorObj, isObject = util.isObject, hasProp = {}.hasOwnProperty; return function(obj, context) { if (isObject(obj)) { if (obj instanceof Promise) return obj; var then = (function(obj) { try { return (function(obj) { return obj.then; })(obj); } catch (e) { return errorObj.e = e, errorObj; } })(obj); if (then === errorObj) { context && context._pushContext(); var ret = Promise.reject(then.e); return context && context._popContext(), ret; } if ("function" == typeof then) return (function(obj) { try { return hasProp.call(obj, "_promise0"); } catch (e) { return !1; } })(obj) ? (ret = new Promise(INTERNAL), obj._then(ret._fulfill, ret._reject, void 0, ret, null), ret) : (function(x, then, context) { var promise = new Promise(INTERNAL), ret = promise; context && context._pushContext(), promise._captureStackTrace(), context && context._popContext(); var result = util.tryCatch(then).call(x, (function(value) { promise && (promise._resolveCallback(value), promise = null); }), (function(reason) { promise && (promise._rejectCallback(reason, false, !0), promise = null); })); return !1, promise && result === errorObj && (promise._rejectCallback(result.e, !0, !0), promise = null), ret; })(obj, then, context); } return obj; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection, Proxyable) { var util = __webpack_require__(17); function PromiseArray(values) { var promise = this._promise = new Promise(INTERNAL); values instanceof Promise && promise._propagateFrom(values, 3), promise._setOnCancel(this), this._values = values, this._length = 0, this._totalResolved = 0, this._init(void 0, -2); } return util.isArray, util.inherits(PromiseArray, Proxyable), PromiseArray.prototype.length = function() { return this._length; }, PromiseArray.prototype.promise = function() { return this._promise; }, PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { var values = tryConvertToPromise(this._values, this._promise); if (values instanceof Promise) { var bitField = (values = values._target())._bitField; if (this._values = values, 0 == (50397184 & bitField)) return this._promise._setAsyncGuaranteed(), values._then(init, this._reject, void 0, this, resolveValueIfEmpty); if (0 == (33554432 & bitField)) return 0 != (16777216 & bitField) ? this._reject(values._reason()) : this._cancel(); values = values._value(); } if (null !== (values = util.asArray(values))) 0 !== values.length ? this._iterate(values) : -5 === resolveValueIfEmpty ? this._resolveEmptyArray() : this._resolve((function(val) { switch (val) { case -2: return []; case -3: return {}; } })(resolveValueIfEmpty)); else { var err = apiRejection("expecting an array or an iterable object but got " + util.classString(values)).reason(); this._promise._rejectCallback(err, !1); } }, PromiseArray.prototype._iterate = function(values) { var len = this.getActualLength(values.length); this._length = len, this._values = this.shouldCopyValues() ? new Array(len) : this._values; for (var result = this._promise, isResolved = !1, bitField = null, i = 0; i < len; ++i) { var maybePromise = tryConvertToPromise(values[i], result); bitField = maybePromise instanceof Promise ? (maybePromise = maybePromise._target())._bitField : null, isResolved ? null !== bitField && maybePromise.suppressUnhandledRejections() : null !== bitField ? 0 == (50397184 & bitField) ? (maybePromise._proxy(this, i), this._values[i] = maybePromise) : isResolved = 0 != (33554432 & bitField) ? this._promiseFulfilled(maybePromise._value(), i) : 0 != (16777216 & bitField) ? this._promiseRejected(maybePromise._reason(), i) : this._promiseCancelled(i) : isResolved = this._promiseFulfilled(maybePromise, i); } isResolved || result._setAsyncGuaranteed(); }, PromiseArray.prototype._isResolved = function() { return null === this._values; }, PromiseArray.prototype._resolve = function(value) { this._values = null, this._promise._fulfill(value); }, PromiseArray.prototype._cancel = function() { !this._isResolved() && this._promise._isCancellable() && (this._values = null, this._promise._cancel()); }, PromiseArray.prototype._reject = function(reason) { this._values = null, this._promise._rejectCallback(reason, !1); }, PromiseArray.prototype._promiseFulfilled = function(value, index) { return this._values[index] = value, ++this._totalResolved >= this._length && (this._resolve(this._values), !0); }, PromiseArray.prototype._promiseCancelled = function() { return this._cancel(), !0; }, PromiseArray.prototype._promiseRejected = function(reason) { return this._totalResolved++, this._reject(reason), !0; }, PromiseArray.prototype._resultCancelled = function() { if (!this._isResolved()) { var values = this._values; if (this._cancel(), values instanceof Promise) values.cancel(); else for (var i = 0; i < values.length; ++i) values[i] instanceof Promise && values[i].cancel(); } }, PromiseArray.prototype.shouldCopyValues = function() { return !0; }, PromiseArray.prototype.getActualLength = function(len) { return len; }, PromiseArray; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var longStackTraces = !1, contextStack = []; function Context() { this._trace = new Context.CapturedTrace(peekContext()); } function peekContext() { var lastIndex = contextStack.length - 1; if (lastIndex >= 0) return contextStack[lastIndex]; } return Promise.prototype._promiseCreated = function() {}, Promise.prototype._pushContext = function() {}, Promise.prototype._popContext = function() { return null; }, Promise._peekContext = Promise.prototype._peekContext = function() {}, Context.prototype._pushContext = function() { void 0 !== this._trace && (this._trace._promiseCreated = null, contextStack.push(this._trace)); }, Context.prototype._popContext = function() { if (void 0 !== this._trace) { var trace = contextStack.pop(), ret = trace._promiseCreated; return trace._promiseCreated = null, ret; } return null; }, Context.CapturedTrace = null, Context.create = function() { if (longStackTraces) return new Context; }, Context.deactivateLongStackTraces = function() {}, Context.activateLongStackTraces = function() { var Promise_pushContext = Promise.prototype._pushContext, Promise_popContext = Promise.prototype._popContext, Promise_PeekContext = Promise._peekContext, Promise_peekContext = Promise.prototype._peekContext, Promise_promiseCreated = Promise.prototype._promiseCreated; Context.deactivateLongStackTraces = function() { Promise.prototype._pushContext = Promise_pushContext, Promise.prototype._popContext = Promise_popContext, Promise._peekContext = Promise_PeekContext, Promise.prototype._peekContext = Promise_peekContext, Promise.prototype._promiseCreated = Promise_promiseCreated, longStackTraces = !1; }, longStackTraces = !0, Promise.prototype._pushContext = Context.prototype._pushContext, Promise.prototype._popContext = Context.prototype._popContext, Promise._peekContext = Promise.prototype._peekContext = peekContext, Promise.prototype._promiseCreated = function() { var ctx = this._peekContext(); ctx && null == ctx._promiseCreated && (ctx._promiseCreated = this); }; }, Context; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, Context) { var unhandledRejectionHandled, possiblyUnhandledRejection, printWarning, getDomain = Promise._getDomain, async = Promise._async, Warning = __webpack_require__(64).Warning, util = __webpack_require__(17), canAttachTrace = util.canAttachTrace, bluebirdFramePattern = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/, nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/, parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/, stackFramePattern = null, formatStack = null, indentStackFrames = !1, debugging = !(0 == util.env("BLUEBIRD_DEBUG") || !util.env("BLUEBIRD_DEBUG") && "development" !== util.env("NODE_ENV")), warnings = !(0 == util.env("BLUEBIRD_WARNINGS") || !debugging && !util.env("BLUEBIRD_WARNINGS")), longStackTraces = !(0 == util.env("BLUEBIRD_LONG_STACK_TRACES") || !debugging && !util.env("BLUEBIRD_LONG_STACK_TRACES")), wForgottenReturn = 0 != util.env("BLUEBIRD_W_FORGOTTEN_RETURN") && (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); Promise.prototype.suppressUnhandledRejections = function() { var target = this._target(); target._bitField = -1048577 & target._bitField | 524288; }, Promise.prototype._ensurePossibleRejectionHandled = function() { 0 == (524288 & this._bitField) && (this._setRejectionIsUnhandled(), async.invokeLater(this._notifyUnhandledRejection, this, void 0)); }, Promise.prototype._notifyUnhandledRejectionIsHandled = function() { fireRejectionEvent("rejectionHandled", unhandledRejectionHandled, void 0, this); }, Promise.prototype._setReturnedNonUndefined = function() { this._bitField = 268435456 | this._bitField; }, Promise.prototype._returnedNonUndefined = function() { return 0 != (268435456 & this._bitField); }, Promise.prototype._notifyUnhandledRejection = function() { if (this._isRejectionUnhandled()) { var reason = this._settledValue(); this._setUnhandledRejectionIsNotified(), fireRejectionEvent("unhandledRejection", possiblyUnhandledRejection, reason, this); } }, Promise.prototype._setUnhandledRejectionIsNotified = function() { this._bitField = 262144 | this._bitField; }, Promise.prototype._unsetUnhandledRejectionIsNotified = function() { this._bitField = -262145 & this._bitField; }, Promise.prototype._isUnhandledRejectionNotified = function() { return (262144 & this._bitField) > 0; }, Promise.prototype._setRejectionIsUnhandled = function() { this._bitField = 1048576 | this._bitField; }, Promise.prototype._unsetRejectionIsUnhandled = function() { this._bitField = -1048577 & this._bitField, this._isUnhandledRejectionNotified() && (this._unsetUnhandledRejectionIsNotified(), this._notifyUnhandledRejectionIsHandled()); }, Promise.prototype._isRejectionUnhandled = function() { return (1048576 & this._bitField) > 0; }, Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { return warn(message, shouldUseOwnTrace, promise || this); }, Promise.onPossiblyUnhandledRejection = function(fn) { var domain = getDomain(); possiblyUnhandledRejection = "function" == typeof fn ? null === domain ? fn : util.domainBind(domain, fn) : void 0; }, Promise.onUnhandledRejectionHandled = function(fn) { var domain = getDomain(); unhandledRejectionHandled = "function" == typeof fn ? null === domain ? fn : util.domainBind(domain, fn) : void 0; }; var disableLongStackTraces = function() {}; Promise.longStackTraces = function() { if (async.haveItemsQueued() && !config.longStackTraces) throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"); if (!config.longStackTraces && longStackTracesIsSupported()) { var Promise_captureStackTrace = Promise.prototype._captureStackTrace, Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; config.longStackTraces = !0, disableLongStackTraces = function() { if (async.haveItemsQueued() && !config.longStackTraces) throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"); Promise.prototype._captureStackTrace = Promise_captureStackTrace, Promise.prototype._attachExtraTrace = Promise_attachExtraTrace, Context.deactivateLongStackTraces(), async.enableTrampoline(), config.longStackTraces = !1; }, Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace, Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace, Context.activateLongStackTraces(), async.disableTrampolineIfNecessary(); } }, Promise.hasLongStackTraces = function() { return config.longStackTraces && longStackTracesIsSupported(); }; var fireDomEvent = (function() { try { if ("function" == typeof CustomEvent) { var event = new CustomEvent("CustomEvent"); return util.global.dispatchEvent(event), function(name, event) { var domEvent = new CustomEvent(name.toLowerCase(), { detail: event, cancelable: !0 }); return !util.global.dispatchEvent(domEvent); }; } return "function" == typeof Event ? (event = new Event("CustomEvent"), util.global.dispatchEvent(event), function(name, event) { var domEvent = new Event(name.toLowerCase(), { cancelable: !0 }); return domEvent.detail = event, !util.global.dispatchEvent(domEvent); }) : ((event = document.createEvent("CustomEvent")).initCustomEvent("testingtheevent", !1, !0, {}), util.global.dispatchEvent(event), function(name, event) { var domEvent = document.createEvent("CustomEvent"); return domEvent.initCustomEvent(name.toLowerCase(), !1, !0, event), !util.global.dispatchEvent(domEvent); }); } catch (e) {} return function() { return !1; }; })(), fireGlobalEvent = util.isNode ? function() { return process.emit.apply(process, arguments); } : util.global ? function(name) { var methodName = "on" + name.toLowerCase(), method = util.global[methodName]; return !!method && (method.apply(util.global, [].slice.call(arguments, 1)), !0); } : function() { return !1; }; function generatePromiseLifecycleEventObject(name, promise) { return { promise: promise }; } var eventToObjectGenerator = { promiseCreated: generatePromiseLifecycleEventObject, promiseFulfilled: generatePromiseLifecycleEventObject, promiseRejected: generatePromiseLifecycleEventObject, promiseResolved: generatePromiseLifecycleEventObject, promiseCancelled: generatePromiseLifecycleEventObject, promiseChained: function(name, promise, child) { return { promise: promise, child: child }; }, warning: function(name, warning) { return { warning: warning }; }, unhandledRejection: function(name, reason, promise) { return { reason: reason, promise: promise }; }, rejectionHandled: generatePromiseLifecycleEventObject }, activeFireEvent = function(name) { var globalEventFired = !1; try { globalEventFired = fireGlobalEvent.apply(null, arguments); } catch (e) { async.throwLater(e), globalEventFired = !0; } var domEventFired = !1; try { domEventFired = fireDomEvent(name, eventToObjectGenerator[name].apply(null, arguments)); } catch (e) { async.throwLater(e), domEventFired = !0; } return domEventFired || globalEventFired; }; function defaultFireEvent() { return !1; } function cancellationExecute(executor, resolve, reject) { var promise = this; try { executor(resolve, reject, (function(onCancel) { if ("function" != typeof onCancel) throw new TypeError("onCancel must be a function, got: " + util.toString(onCancel)); promise._attachCancellationCallback(onCancel); })); } catch (e) { return e; } } function cancellationAttachCancellationCallback(onCancel) { if (!this._isCancellable()) return this; var previousOnCancel = this._onCancel(); void 0 !== previousOnCancel ? util.isArray(previousOnCancel) ? previousOnCancel.push(onCancel) : this._setOnCancel([ previousOnCancel, onCancel ]) : this._setOnCancel(onCancel); } function cancellationOnCancel() { return this._onCancelField; } function cancellationSetOnCancel(onCancel) { this._onCancelField = onCancel; } function cancellationClearCancellationData() { this._cancellationParent = void 0, this._onCancelField = void 0; } function cancellationPropagateFrom(parent, flags) { if (0 != (1 & flags)) { this._cancellationParent = parent; var branchesRemainingToCancel = parent._branchesRemainingToCancel; void 0 === branchesRemainingToCancel && (branchesRemainingToCancel = 0), parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; } 0 != (2 & flags) && parent._isBound() && this._setBoundTo(parent._boundTo); } Promise.config = function(opts) { if ("longStackTraces" in (opts = Object(opts)) && (opts.longStackTraces ? Promise.longStackTraces() : !opts.longStackTraces && Promise.hasLongStackTraces() && disableLongStackTraces()), "warnings" in opts) { var warningsOption = opts.warnings; config.warnings = !!warningsOption, wForgottenReturn = config.warnings, util.isObject(warningsOption) && "wForgottenReturn" in warningsOption && (wForgottenReturn = !!warningsOption.wForgottenReturn); } if ("cancellation" in opts && opts.cancellation && !config.cancellation) { if (async.haveItemsQueued()) throw new Error("cannot enable cancellation after promises are in use"); Promise.prototype._clearCancellationData = cancellationClearCancellationData, Promise.prototype._propagateFrom = cancellationPropagateFrom, Promise.prototype._onCancel = cancellationOnCancel, Promise.prototype._setOnCancel = cancellationSetOnCancel, Promise.prototype._attachCancellationCallback = cancellationAttachCancellationCallback, Promise.prototype._execute = cancellationExecute, propagateFromFunction = cancellationPropagateFrom, config.cancellation = !0; } return "monitoring" in opts && (opts.monitoring && !config.monitoring ? (config.monitoring = !0, Promise.prototype._fireEvent = activeFireEvent) : !opts.monitoring && config.monitoring && (config.monitoring = !1, Promise.prototype._fireEvent = defaultFireEvent)), Promise; }, Promise.prototype._fireEvent = defaultFireEvent, Promise.prototype._execute = function(executor, resolve, reject) { try { executor(resolve, reject); } catch (e) { return e; } }, Promise.prototype._onCancel = function() {}, Promise.prototype._setOnCancel = function(handler) {}, Promise.prototype._attachCancellationCallback = function(onCancel) {}, Promise.prototype._captureStackTrace = function() {}, Promise.prototype._attachExtraTrace = function() {}, Promise.prototype._clearCancellationData = function() {}, Promise.prototype._propagateFrom = function(parent, flags) {}; var propagateFromFunction = function(parent, flags) { 0 != (2 & flags) && parent._isBound() && this._setBoundTo(parent._boundTo); }; function boundValueFunction() { var ret = this._boundTo; return void 0 !== ret && ret instanceof Promise ? ret.isFulfilled() ? ret.value() : void 0 : ret; } function longStackTracesCaptureStackTrace() { this._trace = new CapturedTrace(this._peekContext()); } function longStackTracesAttachExtraTrace(error, ignoreSelf) { if (canAttachTrace(error)) { var trace = this._trace; if (void 0 !== trace && ignoreSelf && (trace = trace._parent), void 0 !== trace) trace.attachExtraTrace(error); else if (!error.__stackCleaned__) { var parsed = parseStackAndMessage(error); util.notEnumerableProp(error, "stack", parsed.message + "\n" + parsed.stack.join("\n")), util.notEnumerableProp(error, "__stackCleaned__", !0); } } } function warn(message, shouldUseOwnTrace, promise) { if (config.warnings) { var ctx, warning = new Warning(message); if (shouldUseOwnTrace) promise._attachExtraTrace(warning); else if (config.longStackTraces && (ctx = Promise._peekContext())) ctx.attachExtraTrace(warning); else { var parsed = parseStackAndMessage(warning); warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); } activeFireEvent("warning", warning) || formatAndLogError(warning, "", !0); } } function cleanStack(stack) { for (var ret = [], i = 0; i < stack.length; ++i) { var line = stack[i], isTraceLine = " (No stack trace)" === line || stackFramePattern.test(line), isInternalFrame = isTraceLine && shouldIgnore(line); isTraceLine && !isInternalFrame && (indentStackFrames && " " !== line.charAt(0) && (line = " " + line), ret.push(line)); } return ret; } function parseStackAndMessage(error) { var stack = error.stack, message = error.toString(); return stack = "string" == typeof stack && stack.length > 0 ? (function(error) { for (var stack = error.stack.replace(/\s+$/g, "").split("\n"), i = 0; i < stack.length; ++i) { var line = stack[i]; if (" (No stack trace)" === line || stackFramePattern.test(line)) break; } return i > 0 && "SyntaxError" != error.name && (stack = stack.slice(i)), stack; })(error) : [ " (No stack trace)" ], { message: message, stack: "SyntaxError" == error.name ? stack : cleanStack(stack) }; } function formatAndLogError(error, title, isSoft) { if ("undefined" != typeof console) { var message; if (util.isObject(error)) { var stack = error.stack; message = title + formatStack(stack, error); } else message = title + String(error); "function" == typeof printWarning ? printWarning(message, isSoft) : "function" != typeof console.log && "object" != typeof console.log || console.log(message); } } function fireRejectionEvent(name, localHandler, reason, promise) { var localEventFired = !1; try { "function" == typeof localHandler && (localEventFired = !0, "rejectionHandled" === name ? localHandler(promise) : localHandler(reason, promise)); } catch (e) { async.throwLater(e); } "unhandledRejection" === name ? activeFireEvent(name, reason, promise) || localEventFired || formatAndLogError(reason, "Unhandled rejection ") : activeFireEvent(name, promise); } function formatNonError(obj) { var str; if ("function" == typeof obj) str = "[function " + (obj.name || "anonymous") + "]"; else { if (str = obj && "function" == typeof obj.toString ? obj.toString() : util.toString(obj), /\[object [a-zA-Z0-9$_]+\]/.test(str)) try { str = JSON.stringify(obj); } catch (e) {} 0 === str.length && (str = "(empty array)"); } return "(<" + (function(str) { return str.length < 41 ? str : str.substr(0, 38) + "..."; })(str) + ">, no stack trace)"; } function longStackTracesIsSupported() { return "function" == typeof captureStackTrace; } var shouldIgnore = function() { return !1; }, parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; function parseLineInfo(line) { var matches = line.match(parseLineInfoRegex); if (matches) return { fileName: matches[1], line: parseInt(matches[2], 10) }; } function CapturedTrace(parent) { this._parent = parent, this._promisesCreated = 0; var length = this._length = 1 + (void 0 === parent ? 0 : parent._length); captureStackTrace(this, CapturedTrace), length > 32 && this.uncycle(); } util.inherits(CapturedTrace, Error), Context.CapturedTrace = CapturedTrace, CapturedTrace.prototype.uncycle = function() { var length = this._length; if (!(length < 2)) { for (var nodes = [], stackToIndex = {}, i = 0, node = this; void 0 !== node; ++i) nodes.push(node), node = node._parent; for (i = (length = this._length = i) - 1; i >= 0; --i) { var stack = nodes[i].stack; void 0 === stackToIndex[stack] && (stackToIndex[stack] = i); } for (i = 0; i < length; ++i) { var index = stackToIndex[nodes[i].stack]; if (void 0 !== index && index !== i) { index > 0 && (nodes[index - 1]._parent = void 0, nodes[index - 1]._length = 1), nodes[i]._parent = void 0, nodes[i]._length = 1; var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; index < length - 1 ? (cycleEdgeNode._parent = nodes[index + 1], cycleEdgeNode._parent.uncycle(), cycleEdgeNode._length = cycleEdgeNode._parent._length + 1) : (cycleEdgeNode._parent = void 0, cycleEdgeNode._length = 1); for (var currentChildLength = cycleEdgeNode._length + 1, j = i - 2; j >= 0; --j) nodes[j]._length = currentChildLength, currentChildLength++; return; } } } }, CapturedTrace.prototype.attachExtraTrace = function(error) { if (!error.__stackCleaned__) { this.uncycle(); for (var parsed = parseStackAndMessage(error), message = parsed.message, stacks = [ parsed.stack ], trace = this; void 0 !== trace; ) stacks.push(cleanStack(trace.stack.split("\n"))), trace = trace._parent; !(function(stacks) { for (var current = stacks[0], i = 1; i < stacks.length; ++i) { for (var prev = stacks[i], currentLastIndex = current.length - 1, currentLastLine = current[currentLastIndex], commonRootMeetPoint = -1, j = prev.length - 1; j >= 0; --j) if (prev[j] === currentLastLine) { commonRootMeetPoint = j; break; } for (j = commonRootMeetPoint; j >= 0; --j) { var line = prev[j]; if (current[currentLastIndex] !== line) break; current.pop(), currentLastIndex--; } current = prev; } })(stacks), (function(stacks) { for (var i = 0; i < stacks.length; ++i) (0 === stacks[i].length || i + 1 < stacks.length && stacks[i][0] === stacks[i + 1][0]) && (stacks.splice(i, 1), i--); })(stacks), util.notEnumerableProp(error, "stack", (function(message, stacks) { for (var i = 0; i < stacks.length - 1; ++i) stacks[i].push("From previous event:"), stacks[i] = stacks[i].join("\n"); return i < stacks.length && (stacks[i] = stacks[i].join("\n")), message + "\n" + stacks.join("\n"); })(message, stacks)), util.notEnumerableProp(error, "__stackCleaned__", !0); } }; var captureStackTrace = (function() { var v8stackFramePattern = /^\s*at\s*/, v8stackFormatter = function(stack, error) { return "string" == typeof stack ? stack : void 0 !== error.name && void 0 !== error.message ? error.toString() : formatNonError(error); }; if ("number" == typeof Error.stackTraceLimit && "function" == typeof Error.captureStackTrace) { Error.stackTraceLimit += 6, stackFramePattern = v8stackFramePattern, formatStack = v8stackFormatter; var captureStackTrace = Error.captureStackTrace; return shouldIgnore = function(line) { return bluebirdFramePattern.test(line); }, function(receiver, ignoreUntil) { Error.stackTraceLimit += 6, captureStackTrace(receiver, ignoreUntil), Error.stackTraceLimit -= 6; }; } var hasStackAfterThrow, err = new Error; if ("string" == typeof err.stack && err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) return stackFramePattern = /@/, formatStack = v8stackFormatter, indentStackFrames = !0, function(o) { o.stack = (new Error).stack; }; try { throw new Error; } catch (e) { hasStackAfterThrow = "stack" in e; } return !("stack" in err) && hasStackAfterThrow && "number" == typeof Error.stackTraceLimit ? (stackFramePattern = v8stackFramePattern, formatStack = v8stackFormatter, function(o) { Error.stackTraceLimit += 6; try { throw new Error; } catch (e) { o.stack = e.stack; } Error.stackTraceLimit -= 6; }) : (formatStack = function(stack, error) { return "string" == typeof stack ? stack : "object" != typeof error && "function" != typeof error || void 0 === error.name || void 0 === error.message ? formatNonError(error) : error.toString(); }, null); })(); "undefined" != typeof console && void 0 !== console.warn && (printWarning = function(message) { console.warn(message); }, util.isNode && process.stderr.isTTY ? printWarning = function(message, isSoft) { var color = isSoft ? "" : ""; console.warn(color + message + "\n"); } : util.isNode || "string" != typeof (new Error).stack || (printWarning = function(message, isSoft) { console.warn("%c" + message, isSoft ? "color: darkorange" : "color: red"); })); var config = { warnings: warnings, longStackTraces: !1, cancellation: !1, monitoring: !1 }; return longStackTraces && Promise.longStackTraces(), { longStackTraces: function() { return config.longStackTraces; }, warnings: function() { return config.warnings; }, cancellation: function() { return config.cancellation; }, monitoring: function() { return config.monitoring; }, propagateFromFunction: function() { return propagateFromFunction; }, boundValueFunction: function() { return boundValueFunction; }, checkForgottenReturns: function(returnValue, promiseCreated, name, promise, parent) { if (void 0 === returnValue && null !== promiseCreated && wForgottenReturn) { if (void 0 !== parent && parent._returnedNonUndefined()) return; if (0 == (65535 & promise._bitField)) return; name && (name += " "); var handlerLine = "", creatorLine = ""; if (promiseCreated._trace) { for (var traceLines = promiseCreated._trace.stack.split("\n"), stack = cleanStack(traceLines), i = stack.length - 1; i >= 0; --i) { var line = stack[i]; if (!nodeFramePattern.test(line)) { var lineMatches = line.match(parseLinePattern); lineMatches && (handlerLine = "at " + lineMatches[1] + ":" + lineMatches[2] + ":" + lineMatches[3] + " "); break; } } if (stack.length > 0) { var firstUserLine = stack[0]; for (i = 0; i < traceLines.length; ++i) if (traceLines[i] === firstUserLine) { i > 0 && (creatorLine = "\n" + traceLines[i - 1]); break; } } } var msg = "a promise was created in a " + name + "handler " + handlerLine + "but was not returned from it, see http://goo.gl/rRqMUw" + creatorLine; promise._warn(msg, !0, promiseCreated); } }, setBounds: function(firstLineError, lastLineError) { if (longStackTracesIsSupported()) { for (var firstFileName, lastFileName, firstStackLines = firstLineError.stack.split("\n"), lastStackLines = lastLineError.stack.split("\n"), firstIndex = -1, lastIndex = -1, i = 0; i < firstStackLines.length; ++i) if (result = parseLineInfo(firstStackLines[i])) { firstFileName = result.fileName, firstIndex = result.line; break; } for (i = 0; i < lastStackLines.length; ++i) { var result; if (result = parseLineInfo(lastStackLines[i])) { lastFileName = result.fileName, lastIndex = result.line; break; } } firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex || (shouldIgnore = function(line) { if (bluebirdFramePattern.test(line)) return !0; var info = parseLineInfo(line); return !!(info && info.fileName === firstFileName && firstIndex <= info.line && info.line <= lastIndex); }); } }, warn: warn, deprecated: function(name, replacement) { var message = name + " is deprecated and will be removed in a future version."; return replacement && (message += " Use " + replacement + " instead."), warn(message); }, CapturedTrace: CapturedTrace, fireDomEvent: fireDomEvent, fireGlobalEvent: fireGlobalEvent }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, tryConvertToPromise) { var util = __webpack_require__(17), CancellationError = Promise.CancellationError, errorObj = util.errorObj; function PassThroughHandlerContext(promise, type, handler) { this.promise = promise, this.type = type, this.handler = handler, this.called = !1, this.cancelPromise = null; } function FinallyHandlerCancelReaction(finallyHandler) { this.finallyHandler = finallyHandler; } function checkCancel(ctx, reason) { return null != ctx.cancelPromise && (arguments.length > 1 ? ctx.cancelPromise._reject(reason) : ctx.cancelPromise._cancel(), ctx.cancelPromise = null, !0); } function succeed() { return finallyHandler.call(this, this.promise._target()._settledValue()); } function fail(reason) { if (!checkCancel(this, reason)) return errorObj.e = reason, errorObj; } function finallyHandler(reasonOrValue) { var promise = this.promise, handler = this.handler; if (!this.called) { this.called = !0; var ret = this.isFinallyHandler() ? handler.call(promise._boundValue()) : handler.call(promise._boundValue(), reasonOrValue); if (void 0 !== ret) { promise._setReturnedNonUndefined(); var maybePromise = tryConvertToPromise(ret, promise); if (maybePromise instanceof Promise) { if (null != this.cancelPromise) { if (maybePromise._isCancelled()) { var reason = new CancellationError("late cancellation observer"); return promise._attachExtraTrace(reason), errorObj.e = reason, errorObj; } maybePromise.isPending() && maybePromise._attachCancellationCallback(new FinallyHandlerCancelReaction(this)); } return maybePromise._then(succeed, fail, void 0, this, void 0); } } } return promise.isRejected() ? (checkCancel(this), errorObj.e = reasonOrValue, errorObj) : (checkCancel(this), reasonOrValue); } return PassThroughHandlerContext.prototype.isFinallyHandler = function() { return 0 === this.type; }, FinallyHandlerCancelReaction.prototype._resultCancelled = function() { checkCancel(this.finallyHandler); }, Promise.prototype._passThrough = function(handler, type, success, fail) { return "function" != typeof handler ? this.then() : this._then(success, fail, void 0, new PassThroughHandlerContext(this, type, handler), void 0); }, Promise.prototype.lastly = Promise.prototype.finally = function(handler) { return this._passThrough(handler, 0, finallyHandler, finallyHandler); }, Promise.prototype.tap = function(handler) { return this._passThrough(handler, 1, finallyHandler); }, PassThroughHandlerContext; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(NEXT_FILTER) { var util = __webpack_require__(17), getKeys = __webpack_require__(92).keys, tryCatch = util.tryCatch, errorObj = util.errorObj; return function(instances, cb, promise) { return function(e) { var boundTo = promise._boundValue(); predicateLoop: for (var i = 0; i < instances.length; ++i) { var item = instances[i]; if (item === Error || null != item && item.prototype instanceof Error) { if (e instanceof item) return tryCatch(cb).call(boundTo, e); } else if ("function" == typeof item) { var matchesPredicate = tryCatch(item).call(boundTo, e); if (matchesPredicate === errorObj) return matchesPredicate; if (matchesPredicate) return tryCatch(cb).call(boundTo, e); } else if (util.isObject(e)) { for (var keys = getKeys(item), j = 0; j < keys.length; ++j) { var key = keys[j]; if (item[key] != e[key]) continue predicateLoop; } return tryCatch(cb).call(boundTo, e); } } return NEXT_FILTER; }; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { var util = __webpack_require__(17), tryCatch = util.tryCatch; Promise.method = function(fn) { if ("function" != typeof fn) throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); return function() { var ret = new Promise(INTERNAL); ret._captureStackTrace(), ret._pushContext(); var value = tryCatch(fn).apply(this, arguments), promiseCreated = ret._popContext(); return debug.checkForgottenReturns(value, promiseCreated, "Promise.method", ret), ret._resolveFromSyncValue(value), ret; }; }, Promise.attempt = Promise.try = function(fn) { if ("function" != typeof fn) return apiRejection("expecting a function but got " + util.classString(fn)); var value, ret = new Promise(INTERNAL); if (ret._captureStackTrace(), ret._pushContext(), arguments.length > 1) { debug.deprecated("calling Promise.try with more than 1 argument"); var arg = arguments[1], ctx = arguments[2]; value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) : tryCatch(fn).call(ctx, arg); } else value = tryCatch(fn)(); var promiseCreated = ret._popContext(); return debug.checkForgottenReturns(value, promiseCreated, "Promise.try", ret), ret._resolveFromSyncValue(value), ret; }, Promise.prototype._resolveFromSyncValue = function(value) { value === util.errorObj ? this._rejectCallback(value.e, !1) : this._resolveCallback(value, !0); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { var calledBind = !1, rejectThis = function(_, e) { this._reject(e); }, targetRejected = function(e, context) { context.promiseRejectionQueued = !0, context.bindingPromise._then(rejectThis, rejectThis, null, this, e); }, bindingResolved = function(thisArg, context) { 0 == (50397184 & this._bitField) && this._resolveCallback(context.target); }, bindingRejected = function(e, context) { context.promiseRejectionQueued || this._reject(e); }; Promise.prototype.bind = function(thisArg) { calledBind || (calledBind = !0, Promise.prototype._propagateFrom = debug.propagateFromFunction(), Promise.prototype._boundValue = debug.boundValueFunction()); var maybePromise = tryConvertToPromise(thisArg), ret = new Promise(INTERNAL); ret._propagateFrom(this, 1); var target = this._target(); if (ret._setBoundTo(maybePromise), maybePromise instanceof Promise) { var context = { promiseRejectionQueued: !1, promise: ret, target: target, bindingPromise: maybePromise }; target._then(INTERNAL, targetRejected, void 0, ret, context), maybePromise._then(bindingResolved, bindingRejected, void 0, ret, context), ret._setOnCancel(maybePromise); } else ret._resolveCallback(target); return ret; }, Promise.prototype._setBoundTo = function(obj) { void 0 !== obj ? (this._bitField = 2097152 | this._bitField, this._boundTo = obj) : this._bitField = -2097153 & this._bitField; }, Promise.prototype._isBound = function() { return 2097152 == (2097152 & this._bitField); }, Promise.bind = function(thisArg, value) { return Promise.resolve(value).bind(thisArg); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, debug) { var util = __webpack_require__(17), tryCatch = util.tryCatch, errorObj = util.errorObj, async = Promise._async; Promise.prototype.break = Promise.prototype.cancel = function() { if (!debug.cancellation()) return this._warn("cancellation is disabled"); for (var promise = this, child = promise; promise._isCancellable(); ) { if (!promise._cancelBy(child)) { child._isFollowing() ? child._followee().cancel() : child._cancelBranched(); break; } var parent = promise._cancellationParent; if (null == parent || !parent._isCancellable()) { promise._isFollowing() ? promise._followee().cancel() : promise._cancelBranched(); break; } promise._isFollowing() && promise._followee().cancel(), promise._setWillBeCancelled(), child = promise, promise = parent; } }, Promise.prototype._branchHasCancelled = function() { this._branchesRemainingToCancel--; }, Promise.prototype._enoughBranchesHaveCancelled = function() { return void 0 === this._branchesRemainingToCancel || this._branchesRemainingToCancel <= 0; }, Promise.prototype._cancelBy = function(canceller) { return canceller === this ? (this._branchesRemainingToCancel = 0, this._invokeOnCancel(), !0) : (this._branchHasCancelled(), !!this._enoughBranchesHaveCancelled() && (this._invokeOnCancel(), !0)); }, Promise.prototype._cancelBranched = function() { this._enoughBranchesHaveCancelled() && this._cancel(); }, Promise.prototype._cancel = function() { this._isCancellable() && (this._setCancelled(), async.invoke(this._cancelPromises, this, void 0)); }, Promise.prototype._cancelPromises = function() { this._length() > 0 && this._settlePromises(); }, Promise.prototype._unsetOnCancel = function() { this._onCancelField = void 0; }, Promise.prototype._isCancellable = function() { return this.isPending() && !this._isCancelled(); }, Promise.prototype.isCancellable = function() { return this.isPending() && !this.isCancelled(); }, Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { if (util.isArray(onCancelCallback)) for (var i = 0; i < onCancelCallback.length; ++i) this._doInvokeOnCancel(onCancelCallback[i], internalOnly); else if (void 0 !== onCancelCallback) if ("function" == typeof onCancelCallback) { if (!internalOnly) { var e = tryCatch(onCancelCallback).call(this._boundValue()); e === errorObj && (this._attachExtraTrace(e.e), async.throwLater(e.e)); } } else onCancelCallback._resultCancelled(this); }, Promise.prototype._invokeOnCancel = function() { var onCancelCallback = this._onCancel(); this._unsetOnCancel(), async.invoke(this._doInvokeOnCancel, this, onCancelCallback); }, Promise.prototype._invokeInternalOnCancel = function() { this._isCancellable() && (this._doInvokeOnCancel(this._onCancel(), !0), this._unsetOnCancel()); }, Promise.prototype._resultCancelled = function() { this.cancel(); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { function returner() { return this.value; } function thrower() { throw this.reason; } Promise.prototype.return = Promise.prototype.thenReturn = function(value) { return value instanceof Promise && value.suppressUnhandledRejections(), this._then(returner, void 0, void 0, { value: value }, void 0); }, Promise.prototype.throw = Promise.prototype.thenThrow = function(reason) { return this._then(thrower, void 0, void 0, { reason: reason }, void 0); }, Promise.prototype.catchThrow = function(reason) { if (arguments.length <= 1) return this._then(void 0, thrower, void 0, { reason: reason }, void 0); var _reason = arguments[1], handler = function() { throw _reason; }; return this.caught(reason, handler); }, Promise.prototype.catchReturn = function(value) { if (arguments.length <= 1) return value instanceof Promise && value.suppressUnhandledRejections(), this._then(void 0, returner, void 0, { value: value }, void 0); var _value = arguments[1]; _value instanceof Promise && _value.suppressUnhandledRejections(); var handler = function() { return _value; }; return this.caught(value, handler); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { function PromiseInspection(promise) { void 0 !== promise ? (promise = promise._target(), this._bitField = promise._bitField, this._settledValueField = promise._isFateSealed() ? promise._settledValue() : void 0) : (this._bitField = 0, this._settledValueField = void 0); } PromiseInspection.prototype._settledValue = function() { return this._settledValueField; }; var value = PromiseInspection.prototype.value = function() { if (!this.isFulfilled()) throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n"); return this._settledValue(); }, reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function() { if (!this.isRejected()) throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n"); return this._settledValue(); }, isFulfilled = PromiseInspection.prototype.isFulfilled = function() { return 0 != (33554432 & this._bitField); }, isRejected = PromiseInspection.prototype.isRejected = function() { return 0 != (16777216 & this._bitField); }, isPending = PromiseInspection.prototype.isPending = function() { return 0 == (50397184 & this._bitField); }, isResolved = PromiseInspection.prototype.isResolved = function() { return 0 != (50331648 & this._bitField); }; PromiseInspection.prototype.isCancelled = function() { return 0 != (8454144 & this._bitField); }, Promise.prototype.__isCancelled = function() { return 65536 == (65536 & this._bitField); }, Promise.prototype._isCancelled = function() { return this._target().__isCancelled(); }, Promise.prototype.isCancelled = function() { return 0 != (8454144 & this._target()._bitField); }, Promise.prototype.isPending = function() { return isPending.call(this._target()); }, Promise.prototype.isRejected = function() { return isRejected.call(this._target()); }, Promise.prototype.isFulfilled = function() { return isFulfilled.call(this._target()); }, Promise.prototype.isResolved = function() { return isResolved.call(this._target()); }, Promise.prototype.value = function() { return value.call(this._target()); }, Promise.prototype.reason = function() { var target = this._target(); return target._unsetRejectionIsUnhandled(), reason.call(target); }, Promise.prototype._value = function() { return this._settledValue(); }, Promise.prototype._reason = function() { return this._unsetRejectionIsUnhandled(), this._settledValue(); }, Promise.PromiseInspection = PromiseInspection; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain) { var reject, util = __webpack_require__(17), canEvaluate = util.canEvaluate, tryCatch = util.tryCatch, errorObj = util.errorObj; if (canEvaluate) { for (var thenCallback = function(i) { return new Function("value", "holder", " \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g, i)); }, promiseSetter = function(i) { return new Function("promise", "holder", " \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g, i)); }, generateHolderClass = function(total) { for (var props = new Array(total), i = 0; i < props.length; ++i) props[i] = "this.p" + (i + 1); var assignment = props.join(" = ") + " = null;", cancellationCode = "var promise;\n" + props.map((function(prop) { return " \n promise = " + prop + "; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "; })).join("\n"), passedArguments = props.join(", "), name = "Holder$" + total, code = "return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n "; return code = code.replace(/\[TheName\]/g, name).replace(/\[TheTotal\]/g, total).replace(/\[ThePassedArguments\]/g, passedArguments).replace(/\[TheProperties\]/g, assignment).replace(/\[CancellationCode\]/g, cancellationCode), new Function("tryCatch", "errorObj", "Promise", "async", code)(tryCatch, errorObj, Promise, async); }, holderClasses = [], thenCallbacks = [], promiseSetters = [], i = 0; i < 8; ++i) holderClasses.push(generateHolderClass(i + 1)), thenCallbacks.push(thenCallback(i + 1)), promiseSetters.push(promiseSetter(i + 1)); reject = function(reason) { this._reject(reason); }; } Promise.join = function() { var fn, last = arguments.length - 1; if (last > 0 && "function" == typeof arguments[last] && (fn = arguments[last], last <= 8 && canEvaluate)) { (ret = new Promise(INTERNAL))._captureStackTrace(); for (var HolderClass = holderClasses[last - 1], holder = new HolderClass(fn), callbacks = thenCallbacks, i = 0; i < last; ++i) { var maybePromise = tryConvertToPromise(arguments[i], ret); if (maybePromise instanceof Promise) { var bitField = (maybePromise = maybePromise._target())._bitField; 0 == (50397184 & bitField) ? (maybePromise._then(callbacks[i], reject, void 0, ret, holder), promiseSetters[i](maybePromise, holder), holder.asyncNeeded = !1) : 0 != (33554432 & bitField) ? callbacks[i].call(ret, maybePromise._value(), holder) : 0 != (16777216 & bitField) ? ret._reject(maybePromise._reason()) : ret._cancel(); } else callbacks[i].call(ret, maybePromise, holder); } if (!ret._isFateSealed()) { if (holder.asyncNeeded) { var domain = getDomain(); null !== domain && (holder.fn = util.domainBind(domain, holder.fn)); } ret._setAsyncGuaranteed(), ret._setOnCancel(holder); } return ret; } for (var $_len = arguments.length, args = new Array($_len), $_i = 0; $_i < $_len; ++$_i) args[$_i] = arguments[$_i]; fn && args.pop(); var ret = new PromiseArray(args).promise(); return void 0 !== fn ? ret.spread(fn) : ret; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { var getDomain = Promise._getDomain, util = __webpack_require__(17), tryCatch = util.tryCatch, errorObj = util.errorObj, async = Promise._async; function MappingPromiseArray(promises, fn, limit, _filter) { this.constructor$(promises), this._promise._captureStackTrace(); var domain = getDomain(); this._callback = null === domain ? fn : util.domainBind(domain, fn), this._preservedValues = _filter === INTERNAL ? new Array(this.length()) : null, this._limit = limit, this._inFlight = 0, this._queue = [], async.invoke(this._asyncInit, this, void 0); } function map(promises, fn, options, _filter) { if ("function" != typeof fn) return apiRejection("expecting a function but got " + util.classString(fn)); var limit = 0; if (void 0 !== options) { if ("object" != typeof options || null === options) return Promise.reject(new TypeError("options argument must be an object but it is " + util.classString(options))); if ("number" != typeof options.concurrency) return Promise.reject(new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency))); limit = options.concurrency; } return new MappingPromiseArray(promises, fn, limit = "number" == typeof limit && isFinite(limit) && limit >= 1 ? limit : 0, _filter).promise(); } util.inherits(MappingPromiseArray, PromiseArray), MappingPromiseArray.prototype._asyncInit = function() { this._init$(void 0, -2); }, MappingPromiseArray.prototype._init = function() {}, MappingPromiseArray.prototype._promiseFulfilled = function(value, index) { var values = this._values, length = this.length(), preservedValues = this._preservedValues, limit = this._limit; if (index < 0) { if (values[index = -1 * index - 1] = value, limit >= 1 && (this._inFlight--, this._drainQueue(), this._isResolved())) return !0; } else { if (limit >= 1 && this._inFlight >= limit) return values[index] = value, this._queue.push(index), !1; null !== preservedValues && (preservedValues[index] = value); var promise = this._promise, callback = this._callback, receiver = promise._boundValue(); promise._pushContext(); var ret = tryCatch(callback).call(receiver, value, index, length), promiseCreated = promise._popContext(); if (debug.checkForgottenReturns(ret, promiseCreated, null !== preservedValues ? "Promise.filter" : "Promise.map", promise), ret === errorObj) return this._reject(ret.e), !0; var maybePromise = tryConvertToPromise(ret, this._promise); if (maybePromise instanceof Promise) { var bitField = (maybePromise = maybePromise._target())._bitField; if (0 == (50397184 & bitField)) return limit >= 1 && this._inFlight++, values[index] = maybePromise, maybePromise._proxy(this, -1 * (index + 1)), !1; if (0 == (33554432 & bitField)) return 0 != (16777216 & bitField) ? (this._reject(maybePromise._reason()), !0) : (this._cancel(), !0); ret = maybePromise._value(); } values[index] = ret; } return ++this._totalResolved >= length && (null !== preservedValues ? this._filter(values, preservedValues) : this._resolve(values), !0); }, MappingPromiseArray.prototype._drainQueue = function() { for (var queue = this._queue, limit = this._limit, values = this._values; queue.length > 0 && this._inFlight < limit; ) { if (this._isResolved()) return; var index = queue.pop(); this._promiseFulfilled(values[index], index); } }, MappingPromiseArray.prototype._filter = function(booleans, values) { for (var len = values.length, ret = new Array(len), j = 0, i = 0; i < len; ++i) booleans[i] && (ret[j++] = values[i]); ret.length = j, this._resolve(ret); }, MappingPromiseArray.prototype.preservedValues = function() { return this._preservedValues; }, Promise.prototype.map = function(fn, options) { return map(this, fn, options, null); }, Promise.map = function(promises, fn, options, _filter) { return map(promises, fn, options, _filter); }; }; }, function(module, exports, __webpack_require__) { "use strict"; var cr = Object.create; if (cr) { var callerCache = cr(null), getterCache = cr(null); callerCache[" size"] = getterCache[" size"] = 0; } module.exports = function(Promise) { var getMethodCaller, getGetter, util = __webpack_require__(17), canEvaluate = util.canEvaluate, isIdentifier = util.isIdentifier, makeMethodCaller = function(methodName) { return new Function("ensureMethod", " \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g, methodName))(ensureMethod); }, makeGetter = function(propertyName) { return new Function("obj", " \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName", propertyName)); }, getCompiled = function(name, compiler, cache) { var ret = cache[name]; if ("function" != typeof ret) { if (!isIdentifier(name)) return null; if (ret = compiler(name), cache[name] = ret, cache[" size"]++, cache[" size"] > 512) { for (var keys = Object.keys(cache), i = 0; i < 256; ++i) delete cache[keys[i]]; cache[" size"] = keys.length - 256; } } return ret; }; function ensureMethod(obj, methodName) { var fn; if (null != obj && (fn = obj[methodName]), "function" != typeof fn) { var message = "Object " + util.classString(obj) + " has no method '" + util.toString(methodName) + "'"; throw new Promise.TypeError(message); } return fn; } function caller(obj) { return ensureMethod(obj, this.pop()).apply(obj, this); } function namedGetter(obj) { return obj[this]; } function indexedGetter(obj) { var index = +this; return index < 0 && (index = Math.max(0, index + obj.length)), obj[index]; } getMethodCaller = function(name) { return getCompiled(name, makeMethodCaller, callerCache); }, getGetter = function(name) { return getCompiled(name, makeGetter, getterCache); }, Promise.prototype.call = function(methodName) { for (var $_len = arguments.length, args = new Array(Math.max($_len - 1, 0)), $_i = 1; $_i < $_len; ++$_i) args[$_i - 1] = arguments[$_i]; if (canEvaluate) { var maybeCaller = getMethodCaller(methodName); if (null !== maybeCaller) return this._then(maybeCaller, void 0, void 0, args, void 0); } return args.push(methodName), this._then(caller, void 0, void 0, args, void 0); }, Promise.prototype.get = function(propertyName) { var getter; if ("number" == typeof propertyName) getter = indexedGetter; else if (canEvaluate) { var maybeGetter = getGetter(propertyName); getter = null !== maybeGetter ? maybeGetter : namedGetter; } else getter = namedGetter; return this._then(getter, void 0, void 0, propertyName, void 0); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug) { var util = __webpack_require__(17), TypeError = __webpack_require__(64).TypeError, inherits = __webpack_require__(17).inherits, errorObj = util.errorObj, tryCatch = util.tryCatch, NULL = {}; function thrower(e) { setTimeout((function() { throw e; }), 0); } function dispose(resources, inspection) { var i = 0, len = resources.length, ret = new Promise(INTERNAL); return (function iterator() { if (i >= len) return ret._fulfill(); var maybePromise = (function(thenable) { var maybePromise = tryConvertToPromise(thenable); return maybePromise !== thenable && "function" == typeof thenable._isDisposable && "function" == typeof thenable._getDisposer && thenable._isDisposable() && maybePromise._setDisposable(thenable._getDisposer()), maybePromise; })(resources[i++]); if (maybePromise instanceof Promise && maybePromise._isDisposable()) { try { maybePromise = tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection), resources.promise); } catch (e) { return thrower(e); } if (maybePromise instanceof Promise) return maybePromise._then(iterator, thrower, null, null, null); } iterator(); })(), ret; } function Disposer(data, promise, context) { this._data = data, this._promise = promise, this._context = context; } function FunctionDisposer(fn, promise, context) { this.constructor$(fn, promise, context); } function maybeUnwrapDisposer(value) { return Disposer.isDisposer(value) ? (this.resources[this.index]._setDisposable(value), value.promise()) : value; } function ResourceList(length) { this.length = length, this.promise = null, this[length - 1] = null; } Disposer.prototype.data = function() { return this._data; }, Disposer.prototype.promise = function() { return this._promise; }, Disposer.prototype.resource = function() { return this.promise().isFulfilled() ? this.promise().value() : NULL; }, Disposer.prototype.tryDispose = function(inspection) { var resource = this.resource(), context = this._context; void 0 !== context && context._pushContext(); var ret = resource !== NULL ? this.doDispose(resource, inspection) : null; return void 0 !== context && context._popContext(), this._promise._unsetDisposable(), this._data = null, ret; }, Disposer.isDisposer = function(d) { return null != d && "function" == typeof d.resource && "function" == typeof d.tryDispose; }, inherits(FunctionDisposer, Disposer), FunctionDisposer.prototype.doDispose = function(resource, inspection) { return this.data().call(resource, resource, inspection); }, ResourceList.prototype._resultCancelled = function() { for (var len = this.length, i = 0; i < len; ++i) { var item = this[i]; item instanceof Promise && item.cancel(); } }, Promise.using = function() { var len = arguments.length; if (len < 2) return apiRejection("you must pass at least 2 arguments to Promise.using"); var input, fn = arguments[len - 1]; if ("function" != typeof fn) return apiRejection("expecting a function but got " + util.classString(fn)); var spreadArgs = !0; 2 === len && Array.isArray(arguments[0]) ? (len = (input = arguments[0]).length, spreadArgs = !1) : (input = arguments, len--); for (var resources = new ResourceList(len), i = 0; i < len; ++i) { var resource = input[i]; if (Disposer.isDisposer(resource)) { var disposer = resource; (resource = resource.promise())._setDisposable(disposer); } else { var maybePromise = tryConvertToPromise(resource); maybePromise instanceof Promise && (resource = maybePromise._then(maybeUnwrapDisposer, null, null, { resources: resources, index: i }, void 0)); } resources[i] = resource; } var reflectedResources = new Array(resources.length); for (i = 0; i < reflectedResources.length; ++i) reflectedResources[i] = Promise.resolve(resources[i]).reflect(); var resultPromise = Promise.all(reflectedResources).then((function(inspections) { for (var i = 0; i < inspections.length; ++i) { var inspection = inspections[i]; if (inspection.isRejected()) return errorObj.e = inspection.error(), errorObj; if (!inspection.isFulfilled()) return void resultPromise.cancel(); inspections[i] = inspection.value(); } promise._pushContext(), fn = tryCatch(fn); var ret = spreadArgs ? fn.apply(void 0, inspections) : fn(inspections), promiseCreated = promise._popContext(); return debug.checkForgottenReturns(ret, promiseCreated, "Promise.using", promise), ret; })), promise = resultPromise.lastly((function() { var inspection = new Promise.PromiseInspection(resultPromise); return dispose(resources, inspection); })); return resources.promise = promise, promise._setOnCancel(resources), promise; }, Promise.prototype._setDisposable = function(disposer) { this._bitField = 131072 | this._bitField, this._disposer = disposer; }, Promise.prototype._isDisposable = function() { return (131072 & this._bitField) > 0; }, Promise.prototype._getDisposer = function() { return this._disposer; }, Promise.prototype._unsetDisposable = function() { this._bitField = -131073 & this._bitField, this._disposer = void 0; }, Promise.prototype.disposer = function(fn) { if ("function" == typeof fn) return new FunctionDisposer(fn, this, createContext()); throw new TypeError; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, debug) { var util = __webpack_require__(17), TimeoutError = Promise.TimeoutError; function HandleWrapper(handle) { this.handle = handle; } HandleWrapper.prototype._resultCancelled = function() { clearTimeout(this.handle); }; var afterValue = function(value) { return delay(+this).thenReturn(value); }, delay = Promise.delay = function(ms, value) { var ret, handle; return void 0 !== value ? (ret = Promise.resolve(value)._then(afterValue, null, null, ms, void 0), debug.cancellation() && value instanceof Promise && ret._setOnCancel(value)) : (ret = new Promise(INTERNAL), handle = setTimeout((function() { ret._fulfill(); }), +ms), debug.cancellation() && ret._setOnCancel(new HandleWrapper(handle)), ret._captureStackTrace()), ret._setAsyncGuaranteed(), ret; }; function successClear(value) { return clearTimeout(this.handle), value; } function failureClear(reason) { throw clearTimeout(this.handle), reason; } Promise.prototype.delay = function(ms) { return delay(ms, this); }, Promise.prototype.timeout = function(ms, message) { var ret, parent; ms = +ms; var handleWrapper = new HandleWrapper(setTimeout((function() { ret.isPending() && (function(promise, message, parent) { var err; err = "string" != typeof message ? message instanceof Error ? message : new TimeoutError("operation timed out") : new TimeoutError(message), util.markAsOriginatingFromRejection(err), promise._attachExtraTrace(err), promise._reject(err), null != parent && parent.cancel(); })(ret, message, parent); }), ms)); return debug.cancellation() ? (parent = this.then(), (ret = parent._then(successClear, failureClear, void 0, handleWrapper, void 0))._setOnCancel(handleWrapper)) : ret = this._then(successClear, failureClear, void 0, handleWrapper, void 0), ret; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug) { var TypeError = __webpack_require__(64).TypeError, util = __webpack_require__(17), errorObj = util.errorObj, tryCatch = util.tryCatch, yieldHandlers = []; function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { if (debug.cancellation()) { var internal = new Promise(INTERNAL), _finallyPromise = this._finallyPromise = new Promise(INTERNAL); this._promise = internal.lastly((function() { return _finallyPromise; })), internal._captureStackTrace(), internal._setOnCancel(this); } else (this._promise = new Promise(INTERNAL))._captureStackTrace(); this._stack = stack, this._generatorFunction = generatorFunction, this._receiver = receiver, this._generator = void 0, this._yieldHandlers = "function" == typeof yieldHandler ? [ yieldHandler ].concat(yieldHandlers) : yieldHandlers, this._yieldedPromise = null, this._cancellationPhase = !1; } util.inherits(PromiseSpawn, Proxyable), PromiseSpawn.prototype._isResolved = function() { return null === this._promise; }, PromiseSpawn.prototype._cleanup = function() { this._promise = this._generator = null, debug.cancellation() && null !== this._finallyPromise && (this._finallyPromise._fulfill(), this._finallyPromise = null); }, PromiseSpawn.prototype._promiseCancelled = function() { if (!this._isResolved()) { var result; if (void 0 !== this._generator.return) this._promise._pushContext(), result = tryCatch(this._generator.return).call(this._generator, void 0), this._promise._popContext(); else { var reason = new Promise.CancellationError("generator .return() sentinel"); Promise.coroutine.returnSentinel = reason, this._promise._attachExtraTrace(reason), this._promise._pushContext(), result = tryCatch(this._generator.throw).call(this._generator, reason), this._promise._popContext(); } this._cancellationPhase = !0, this._yieldedPromise = null, this._continue(result); } }, PromiseSpawn.prototype._promiseFulfilled = function(value) { this._yieldedPromise = null, this._promise._pushContext(); var result = tryCatch(this._generator.next).call(this._generator, value); this._promise._popContext(), this._continue(result); }, PromiseSpawn.prototype._promiseRejected = function(reason) { this._yieldedPromise = null, this._promise._attachExtraTrace(reason), this._promise._pushContext(); var result = tryCatch(this._generator.throw).call(this._generator, reason); this._promise._popContext(), this._continue(result); }, PromiseSpawn.prototype._resultCancelled = function() { if (this._yieldedPromise instanceof Promise) { var promise = this._yieldedPromise; this._yieldedPromise = null, promise.cancel(); } }, PromiseSpawn.prototype.promise = function() { return this._promise; }, PromiseSpawn.prototype._run = function() { this._generator = this._generatorFunction.call(this._receiver), this._receiver = this._generatorFunction = void 0, this._promiseFulfilled(void 0); }, PromiseSpawn.prototype._continue = function(result) { var promise = this._promise; if (result === errorObj) return this._cleanup(), this._cancellationPhase ? promise.cancel() : promise._rejectCallback(result.e, !1); var value = result.value; if (!0 === result.done) return this._cleanup(), this._cancellationPhase ? promise.cancel() : promise._resolveCallback(value); var maybePromise = tryConvertToPromise(value, this._promise); if (maybePromise instanceof Promise || (maybePromise = (function(value, yieldHandlers, traceParent) { for (var i = 0; i < yieldHandlers.length; ++i) { traceParent._pushContext(); var result = tryCatch(yieldHandlers[i])(value); if (traceParent._popContext(), result === errorObj) { traceParent._pushContext(); var ret = Promise.reject(errorObj.e); return traceParent._popContext(), ret; } var maybePromise = tryConvertToPromise(result, traceParent); if (maybePromise instanceof Promise) return maybePromise; } return null; })(maybePromise, this._yieldHandlers, this._promise), null !== maybePromise)) { var bitField = (maybePromise = maybePromise._target())._bitField; 0 == (50397184 & bitField) ? (this._yieldedPromise = maybePromise, maybePromise._proxy(this, null)) : 0 != (33554432 & bitField) ? Promise._async.invoke(this._promiseFulfilled, this, maybePromise._value()) : 0 != (16777216 & bitField) ? Promise._async.invoke(this._promiseRejected, this, maybePromise._reason()) : this._promiseCancelled(); } else this._promiseRejected(new TypeError("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s", value) + "From coroutine:\n" + this._stack.split("\n").slice(1, -7).join("\n"))); }, Promise.coroutine = function(generatorFunction, options) { if ("function" != typeof generatorFunction) throw new TypeError("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n"); var yieldHandler = Object(options).yieldHandler, PromiseSpawn$ = PromiseSpawn, stack = (new Error).stack; return function() { var generator = generatorFunction.apply(this, arguments), spawn = new PromiseSpawn$(void 0, void 0, yieldHandler, stack), ret = spawn.promise(); return spawn._generator = generator, spawn._promiseFulfilled(void 0), ret; }; }, Promise.coroutine.addYieldHandler = function(fn) { if ("function" != typeof fn) throw new TypeError("expecting a function but got " + util.classString(fn)); yieldHandlers.push(fn); }, Promise.spawn = function(generatorFunction) { if (debug.deprecated("Promise.spawn()", "Promise.coroutine()"), "function" != typeof generatorFunction) return apiRejection("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n"); var spawn = new PromiseSpawn(generatorFunction, this), ret = spawn.promise(); return spawn._run(Promise.spawn), ret; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var util = __webpack_require__(17), async = Promise._async, tryCatch = util.tryCatch, errorObj = util.errorObj; function spreadAdapter(val, nodeback) { if (!util.isArray(val)) return successAdapter.call(this, val, nodeback); var ret = tryCatch(nodeback).apply(this._boundValue(), [ null ].concat(val)); ret === errorObj && async.throwLater(ret.e); } function successAdapter(val, nodeback) { var receiver = this._boundValue(), ret = void 0 === val ? tryCatch(nodeback).call(receiver, null) : tryCatch(nodeback).call(receiver, null, val); ret === errorObj && async.throwLater(ret.e); } function errorAdapter(reason, nodeback) { if (!reason) { var newReason = new Error(reason + ""); newReason.cause = reason, reason = newReason; } var ret = tryCatch(nodeback).call(this._boundValue(), reason); ret === errorObj && async.throwLater(ret.e); } Promise.prototype.asCallback = Promise.prototype.nodeify = function(nodeback, options) { if ("function" == typeof nodeback) { var adapter = successAdapter; void 0 !== options && Object(options).spread && (adapter = spreadAdapter), this._then(adapter, errorAdapter, void 0, this, nodeback); } return this; }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var THIS = {}, util = __webpack_require__(17), nodebackForPromise = __webpack_require__(551), withAppended = util.withAppended, maybeWrapAsError = util.maybeWrapAsError, canEvaluate = util.canEvaluate, TypeError = __webpack_require__(64).TypeError, defaultPromisified = { __isPromisified__: !0 }, noCopyPropsPattern = new RegExp("^(?:" + [ "arity", "length", "name", "arguments", "caller", "callee", "prototype", "__isPromisified__" ].join("|") + ")$"), defaultFilter = function(name) { return util.isIdentifier(name) && "_" !== name.charAt(0) && "constructor" !== name; }; function propsFilter(key) { return !noCopyPropsPattern.test(key); } function isPromisified(fn) { try { return !0 === fn.__isPromisified__; } catch (e) { return !1; } } function hasPromisified(obj, key, suffix) { var val = util.getDataPropertyOrDefault(obj, key + suffix, defaultPromisified); return !!val && isPromisified(val); } var makeNodePromisified = canEvaluate ? function(callback, receiver, originalName, fn, _, multiArgs) { var newParameterCount = Math.max(0, (function(fn) { return "number" == typeof fn.length ? Math.max(Math.min(fn.length, 1024), 0) : 0; })(fn) - 1), argumentOrder = (function(likelyArgumentCount) { for (var ret = [ likelyArgumentCount ], min = Math.max(0, likelyArgumentCount - 1 - 3), i = likelyArgumentCount - 1; i >= min; --i) ret.push(i); for (i = likelyArgumentCount + 1; i <= 3; ++i) ret.push(i); return ret; })(newParameterCount), shouldProxyThis = "string" == typeof callback || receiver === THIS; var parameterCount, getFunctionCode = "string" == typeof callback ? "this != null ? this['" + callback + "'] : fn" : "fn", body = "'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]", (function() { for (var ret = "", i = 0; i < argumentOrder.length; ++i) ret += "case " + argumentOrder[i] + ":" + (count = argumentOrder[i], argumentCount = void 0, args = void 0, comma = void 0, args = (argumentCount = count, util.filledRange(argumentCount, "_arg", "")).join(", "), comma = count > 0 ? ", " : "", (shouldProxyThis ? "ret = callback.call(this, {{args}}, nodeback); break;\n" : void 0 === receiver ? "ret = callback({{args}}, nodeback); break;\n" : "ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}", args).replace(", ", comma)); var count, argumentCount, args, comma; return ret + " \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]", shouldProxyThis ? "ret = callback.apply(this, args);\n" : "ret = callback.apply(receiver, args);\n"); })()).replace("[GetFunctionCode]", getFunctionCode); return body = body.replace("Parameters", (parameterCount = newParameterCount, util.filledRange(Math.max(parameterCount, 3), "_arg", ""))), new Function("Promise", "fn", "receiver", "withAppended", "maybeWrapAsError", "nodebackForPromise", "tryCatch", "errorObj", "notEnumerableProp", "INTERNAL", body)(Promise, fn, receiver, withAppended, maybeWrapAsError, nodebackForPromise, util.tryCatch, util.errorObj, util.notEnumerableProp, INTERNAL); } : function(callback, receiver, _, fn, __, multiArgs) { var defaultThis = (function() { return this; })(), method = callback; function promisified() { var _receiver = receiver; receiver === THIS && (_receiver = this); var promise = new Promise(INTERNAL); promise._captureStackTrace(); var cb = "string" == typeof method && this !== defaultThis ? this[method] : callback, fn = nodebackForPromise(promise, multiArgs); try { cb.apply(_receiver, withAppended(arguments, fn)); } catch (e) { promise._rejectCallback(maybeWrapAsError(e), !0, !0); } return promise._isFateSealed() || promise._setAsyncGuaranteed(), promise; } return "string" == typeof method && (callback = fn), util.notEnumerableProp(promisified, "__isPromisified__", !0), promisified; }; function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { for (var suffixRegexp = new RegExp(suffix.replace(/([$])/, "\\$") + "$"), methods = (function(obj, suffix, suffixRegexp, filter) { for (var keys = util.inheritedDataKeys(obj), ret = [], i = 0; i < keys.length; ++i) { var key = keys[i], value = obj[key], passesDefaultFilter = filter === defaultFilter || defaultFilter(key); "function" != typeof value || isPromisified(value) || hasPromisified(obj, key, suffix) || !filter(key, value, obj, passesDefaultFilter) || ret.push(key, value); } return (function(ret, suffix, suffixRegexp) { for (var i = 0; i < ret.length; i += 2) { var key = ret[i]; if (suffixRegexp.test(key)) for (var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""), j = 0; j < ret.length; j += 2) if (ret[j] === keyWithoutAsyncSuffix) throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s", suffix)); } })(ret, suffix, suffixRegexp), ret; })(obj, suffix, suffixRegexp, filter), i = 0, len = methods.length; i < len; i += 2) { var key = methods[i], fn = methods[i + 1], promisifiedKey = key + suffix; if (promisifier === makeNodePromisified) obj[promisifiedKey] = makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); else { var promisified = promisifier(fn, (function() { return makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); })); util.notEnumerableProp(promisified, "__isPromisified__", !0), obj[promisifiedKey] = promisified; } } return util.toFastProperties(obj), obj; } Promise.promisify = function(fn, options) { if ("function" != typeof fn) throw new TypeError("expecting a function but got " + util.classString(fn)); if (isPromisified(fn)) return fn; var callback, receiver, multiArgs, ret = (callback = fn, receiver = void 0 === (options = Object(options)).context ? THIS : options.context, multiArgs = !!options.multiArgs, makeNodePromisified(callback, receiver, void 0, callback, null, multiArgs)); return util.copyDescriptors(fn, ret, propsFilter), ret; }, Promise.promisifyAll = function(target, options) { if ("function" != typeof target && "object" != typeof target) throw new TypeError("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n"); var multiArgs = !!(options = Object(options)).multiArgs, suffix = options.suffix; "string" != typeof suffix && (suffix = "Async"); var filter = options.filter; "function" != typeof filter && (filter = defaultFilter); var promisifier = options.promisifier; if ("function" != typeof promisifier && (promisifier = makeNodePromisified), !util.isIdentifier(suffix)) throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n"); for (var keys = util.inheritedDataKeys(target), i = 0; i < keys.length; ++i) { var value = target[keys[i]]; "constructor" !== keys[i] && util.isClass(value) && (promisifyAll(value.prototype, suffix, filter, promisifier, multiArgs), promisifyAll(value, suffix, filter, promisifier, multiArgs)); } return promisifyAll(target, suffix, filter, promisifier, multiArgs); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, tryConvertToPromise, apiRejection) { var Es6Map, util = __webpack_require__(17), isObject = util.isObject, es5 = __webpack_require__(92); "function" == typeof Map && (Es6Map = Map); var mapToEntries = (function() { var index = 0, size = 0; function extractEntry(value, key) { this[index] = value, this[index + size] = key, index++; } return function(map) { size = map.size, index = 0; var ret = new Array(2 * map.size); return map.forEach(extractEntry, ret), ret; }; })(); function PropertiesPromiseArray(obj) { var entries, isMap = !1; if (void 0 !== Es6Map && obj instanceof Es6Map) entries = mapToEntries(obj), isMap = !0; else { var keys = es5.keys(obj), len = keys.length; entries = new Array(2 * len); for (var i = 0; i < len; ++i) { var key = keys[i]; entries[i] = obj[key], entries[i + len] = key; } } this.constructor$(entries), this._isMap = isMap, this._init$(void 0, -3); } function props(promises) { var ret, castValue = tryConvertToPromise(promises); return isObject(castValue) ? (ret = castValue instanceof Promise ? castValue._then(Promise.props, void 0, void 0, void 0, void 0) : new PropertiesPromiseArray(castValue).promise(), castValue instanceof Promise && ret._propagateFrom(castValue, 2), ret) : apiRejection("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n"); } util.inherits(PropertiesPromiseArray, PromiseArray), PropertiesPromiseArray.prototype._init = function() {}, PropertiesPromiseArray.prototype._promiseFulfilled = function(value, index) { if (this._values[index] = value, ++this._totalResolved >= this._length) { var val; if (this._isMap) val = (function(entries) { for (var ret = new Es6Map, length = entries.length / 2 | 0, i = 0; i < length; ++i) { var key = entries[length + i], value = entries[i]; ret.set(key, value); } return ret; })(this._values); else { val = {}; for (var keyOffset = this.length(), i = 0, len = this.length(); i < len; ++i) val[this._values[i + keyOffset]] = this._values[i]; } return this._resolve(val), !0; } return !1; }, PropertiesPromiseArray.prototype.shouldCopyValues = function() { return !1; }, PropertiesPromiseArray.prototype.getActualLength = function(len) { return len >> 1; }, Promise.prototype.props = function() { return props(this); }, Promise.props = function(promises) { return props(promises); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection) { var util = __webpack_require__(17); function race(promises, parent) { var promise, maybePromise = tryConvertToPromise(promises); if (maybePromise instanceof Promise) return (promise = maybePromise).then((function(array) { return race(array, promise); })); if (null === (promises = util.asArray(promises))) return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); var ret = new Promise(INTERNAL); void 0 !== parent && ret._propagateFrom(parent, 3); for (var fulfill = ret._fulfill, reject = ret._reject, i = 0, len = promises.length; i < len; ++i) { var val = promises[i]; (void 0 !== val || i in promises) && Promise.cast(val)._then(fulfill, reject, void 0, ret, null); } return ret; } Promise.race = function(promises) { return race(promises, void 0); }, Promise.prototype.race = function() { return race(this, void 0); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { var getDomain = Promise._getDomain, util = __webpack_require__(17), tryCatch = util.tryCatch; function ReductionPromiseArray(promises, fn, initialValue, _each) { this.constructor$(promises); var domain = getDomain(); this._fn = null === domain ? fn : util.domainBind(domain, fn), void 0 !== initialValue && (initialValue = Promise.resolve(initialValue))._attachCancellationCallback(this), this._initialValue = initialValue, this._currentCancellable = null, this._eachValues = _each === INTERNAL ? Array(this._length) : 0 === _each ? null : void 0, this._promise._captureStackTrace(), this._init$(void 0, -5); } function completed(valueOrReason, array) { this.isFulfilled() ? array._resolve(valueOrReason) : array._reject(valueOrReason); } function reduce(promises, fn, initialValue, _each) { return "function" != typeof fn ? apiRejection("expecting a function but got " + util.classString(fn)) : new ReductionPromiseArray(promises, fn, initialValue, _each).promise(); } function gotAccum(accum) { this.accum = accum, this.array._gotAccum(accum); var value = tryConvertToPromise(this.value, this.array._promise); return value instanceof Promise ? (this.array._currentCancellable = value, value._then(gotValue, void 0, void 0, this, void 0)) : gotValue.call(this, value); } function gotValue(value) { var ret, array = this.array, promise = array._promise, fn = tryCatch(array._fn); promise._pushContext(), (ret = void 0 !== array._eachValues ? fn.call(promise._boundValue(), value, this.index, this.length) : fn.call(promise._boundValue(), this.accum, value, this.index, this.length)) instanceof Promise && (array._currentCancellable = ret); var promiseCreated = promise._popContext(); return debug.checkForgottenReturns(ret, promiseCreated, void 0 !== array._eachValues ? "Promise.each" : "Promise.reduce", promise), ret; } util.inherits(ReductionPromiseArray, PromiseArray), ReductionPromiseArray.prototype._gotAccum = function(accum) { void 0 !== this._eachValues && null !== this._eachValues && accum !== INTERNAL && this._eachValues.push(accum); }, ReductionPromiseArray.prototype._eachComplete = function(value) { return null !== this._eachValues && this._eachValues.push(value), this._eachValues; }, ReductionPromiseArray.prototype._init = function() {}, ReductionPromiseArray.prototype._resolveEmptyArray = function() { this._resolve(void 0 !== this._eachValues ? this._eachValues : this._initialValue); }, ReductionPromiseArray.prototype.shouldCopyValues = function() { return !1; }, ReductionPromiseArray.prototype._resolve = function(value) { this._promise._resolveCallback(value), this._values = null; }, ReductionPromiseArray.prototype._resultCancelled = function(sender) { if (sender === this._initialValue) return this._cancel(); this._isResolved() || (this._resultCancelled$(), this._currentCancellable instanceof Promise && this._currentCancellable.cancel(), this._initialValue instanceof Promise && this._initialValue.cancel()); }, ReductionPromiseArray.prototype._iterate = function(values) { var value, i; this._values = values; var length = values.length; if (void 0 !== this._initialValue ? (value = this._initialValue, i = 0) : (value = Promise.resolve(values[0]), i = 1), this._currentCancellable = value, !value.isRejected()) for (;i < length; ++i) { var ctx = { accum: null, value: values[i], index: i, length: length, array: this }; value = value._then(gotAccum, void 0, void 0, ctx, void 0); } void 0 !== this._eachValues && (value = value._then(this._eachComplete, void 0, void 0, this, void 0)), value._then(completed, completed, void 0, value, this); }, Promise.prototype.reduce = function(fn, initialValue) { return reduce(this, fn, initialValue, null); }, Promise.reduce = function(promises, fn, initialValue, _each) { return reduce(promises, fn, initialValue, _each); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, debug) { var PromiseInspection = Promise.PromiseInspection; function SettledPromiseArray(values) { this.constructor$(values); } __webpack_require__(17).inherits(SettledPromiseArray, PromiseArray), SettledPromiseArray.prototype._promiseResolved = function(index, inspection) { return this._values[index] = inspection, ++this._totalResolved >= this._length && (this._resolve(this._values), !0); }, SettledPromiseArray.prototype._promiseFulfilled = function(value, index) { var ret = new PromiseInspection; return ret._bitField = 33554432, ret._settledValueField = value, this._promiseResolved(index, ret); }, SettledPromiseArray.prototype._promiseRejected = function(reason, index) { var ret = new PromiseInspection; return ret._bitField = 16777216, ret._settledValueField = reason, this._promiseResolved(index, ret); }, Promise.settle = function(promises) { return debug.deprecated(".settle()", ".reflect()"), new SettledPromiseArray(promises).promise(); }, Promise.prototype.settle = function() { return Promise.settle(this); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection) { var util = __webpack_require__(17), RangeError = __webpack_require__(64).RangeError, AggregateError = __webpack_require__(64).AggregateError, isArray = util.isArray, CANCELLATION = {}; function SomePromiseArray(values) { this.constructor$(values), this._howMany = 0, this._unwrap = !1, this._initialized = !1; } function some(promises, howMany) { if ((0 | howMany) !== howMany || howMany < 0) return apiRejection("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n"); var ret = new SomePromiseArray(promises), promise = ret.promise(); return ret.setHowMany(howMany), ret.init(), promise; } util.inherits(SomePromiseArray, PromiseArray), SomePromiseArray.prototype._init = function() { if (this._initialized) if (0 !== this._howMany) { this._init$(void 0, -5); var isArrayResolved = isArray(this._values); !this._isResolved() && isArrayResolved && this._howMany > this._canPossiblyFulfill() && this._reject(this._getRangeError(this.length())); } else this._resolve([]); }, SomePromiseArray.prototype.init = function() { this._initialized = !0, this._init(); }, SomePromiseArray.prototype.setUnwrap = function() { this._unwrap = !0; }, SomePromiseArray.prototype.howMany = function() { return this._howMany; }, SomePromiseArray.prototype.setHowMany = function(count) { this._howMany = count; }, SomePromiseArray.prototype._promiseFulfilled = function(value) { return this._addFulfilled(value), this._fulfilled() === this.howMany() && (this._values.length = this.howMany(), 1 === this.howMany() && this._unwrap ? this._resolve(this._values[0]) : this._resolve(this._values), !0); }, SomePromiseArray.prototype._promiseRejected = function(reason) { return this._addRejected(reason), this._checkOutcome(); }, SomePromiseArray.prototype._promiseCancelled = function() { return this._values instanceof Promise || null == this._values ? this._cancel() : (this._addRejected(CANCELLATION), this._checkOutcome()); }, SomePromiseArray.prototype._checkOutcome = function() { if (this.howMany() > this._canPossiblyFulfill()) { for (var e = new AggregateError, i = this.length(); i < this._values.length; ++i) this._values[i] !== CANCELLATION && e.push(this._values[i]); return e.length > 0 ? this._reject(e) : this._cancel(), !0; } return !1; }, SomePromiseArray.prototype._fulfilled = function() { return this._totalResolved; }, SomePromiseArray.prototype._rejected = function() { return this._values.length - this.length(); }, SomePromiseArray.prototype._addRejected = function(reason) { this._values.push(reason); }, SomePromiseArray.prototype._addFulfilled = function(value) { this._values[this._totalResolved++] = value; }, SomePromiseArray.prototype._canPossiblyFulfill = function() { return this.length() - this._rejected(); }, SomePromiseArray.prototype._getRangeError = function(count) { var message = "Input array must contain at least " + this._howMany + " items but contains only " + count + " items"; return new RangeError(message); }, SomePromiseArray.prototype._resolveEmptyArray = function() { this._reject(this._getRangeError(0)); }, Promise.some = function(promises, howMany) { return some(promises, howMany); }, Promise.prototype.some = function(howMany) { return some(this, howMany); }, Promise._SomePromiseArray = SomePromiseArray; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var PromiseMap = Promise.map; Promise.prototype.filter = function(fn, options) { return PromiseMap(this, fn, options, INTERNAL); }, Promise.filter = function(promises, fn, options) { return PromiseMap(promises, fn, options, INTERNAL); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var PromiseReduce = Promise.reduce, PromiseAll = Promise.all; function promiseAllThis() { return PromiseAll(this); } Promise.prototype.each = function(fn) { return PromiseReduce(this, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, this, void 0); }, Promise.prototype.mapSeries = function(fn) { return PromiseReduce(this, fn, INTERNAL, INTERNAL); }, Promise.each = function(promises, fn) { return PromiseReduce(promises, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, promises, void 0); }, Promise.mapSeries = function(promises, fn) { return PromiseReduce(promises, fn, INTERNAL, INTERNAL); }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var SomePromiseArray = Promise._SomePromiseArray; function any(promises) { var ret = new SomePromiseArray(promises), promise = ret.promise(); return ret.setHowMany(1), ret.setUnwrap(), ret.init(), promise; } Promise.any = function(promises) { return any(promises); }, Promise.prototype.any = function() { return any(this); }; }; }, function(module, exports, __webpack_require__) { var Stream = __webpack_require__(3), Buffer = __webpack_require__(167); Stream.Writable && Stream.Writable.prototype.destroy || (Stream = __webpack_require__(88)), module.exports = function(entry) { return new Promise((function(resolve, reject) { var chunks = [], bufferStream = Stream.Transform().on("finish", (function() { resolve(Buffer.concat(chunks)); })).on("error", reject); bufferStream._transform = function(d, e, cb) { chunks.push(d), cb(); }, entry.on("error", reject).pipe(bufferStream); })); }; }, function(module, exports, __webpack_require__) { exports.Abstract = __webpack_require__(273), exports.Reader = __webpack_require__(93), exports.Writer = __webpack_require__(116), exports.File = { Reader: __webpack_require__(554), Writer: __webpack_require__(559) }, exports.Dir = { Reader: __webpack_require__(553), Writer: __webpack_require__(557) }, exports.Link = { Reader: __webpack_require__(552), Writer: __webpack_require__(558) }, exports.Proxy = { Reader: __webpack_require__(555), Writer: __webpack_require__(560) }, exports.Reader.Dir = exports.DirReader = exports.Dir.Reader, exports.Reader.File = exports.FileReader = exports.File.Reader, exports.Reader.Link = exports.LinkReader = exports.Link.Reader, exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader, exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer, exports.Writer.File = exports.FileWriter = exports.File.Writer, exports.Writer.Link = exports.LinkWriter = exports.Link.Writer, exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer, exports.collect = __webpack_require__(274); }, function(module, exports, __webpack_require__) { var constants = __webpack_require__(1276), origCwd = process.cwd, cwd = null, platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; process.cwd = function() { return cwd || (cwd = origCwd.call(process)), cwd; }; try { process.cwd(); } catch (er) {} var chdir = process.chdir; process.chdir = function(d) { cwd = null, chdir.call(process, d); }, module.exports = function(fs) { var fs$rename, fs$readSync, fs$read; function chmodFix(orig) { return orig ? function(target, mode, cb) { return orig.call(fs, target, mode, (function(er) { chownErOk(er) && (er = null), cb && cb.apply(this, arguments); })); } : orig; } function chmodFixSync(orig) { return orig ? function(target, mode) { try { return orig.call(fs, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } } : orig; } function chownFix(orig) { return orig ? function(target, uid, gid, cb) { return orig.call(fs, target, uid, gid, (function(er) { chownErOk(er) && (er = null), cb && cb.apply(this, arguments); })); } : orig; } function chownFixSync(orig) { return orig ? function(target, uid, gid) { try { return orig.call(fs, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } } : orig; } function statFix(orig) { return orig ? function(target, cb) { return orig.call(fs, target, (function(er, stats) { if (!stats) return cb.apply(this, arguments); stats.uid < 0 && (stats.uid += 4294967296), stats.gid < 0 && (stats.gid += 4294967296), cb && cb.apply(this, arguments); })); } : orig; } function statFixSync(orig) { return orig ? function(target) { var stats = orig.call(fs, target); return stats.uid < 0 && (stats.uid += 4294967296), stats.gid < 0 && (stats.gid += 4294967296), stats; } : orig; } function chownErOk(er) { return !er || "ENOSYS" === er.code || !(process.getuid && 0 === process.getuid() || "EINVAL" !== er.code && "EPERM" !== er.code); } constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && (function(fs) { fs.lchmod = function(path, mode, callback) { fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, (function(err, fd) { err ? callback && callback(err) : fs.fchmod(fd, mode, (function(err) { fs.close(fd, (function(err2) { callback && callback(err || err2); })); })); })); }, fs.lchmodSync = function(path, mode) { var ret, fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode), threw = !0; try { ret = fs.fchmodSync(fd, mode), threw = !1; } finally { if (threw) try { fs.closeSync(fd); } catch (er) {} else fs.closeSync(fd); } return ret; }; })(fs), fs.lutimes || (function(fs) { constants.hasOwnProperty("O_SYMLINK") ? (fs.lutimes = function(path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, (function(er, fd) { er ? cb && cb(er) : fs.futimes(fd, at, mt, (function(er) { fs.close(fd, (function(er2) { cb && cb(er || er2); })); })); })); }, fs.lutimesSync = function(path, at, mt) { var ret, fd = fs.openSync(path, constants.O_SYMLINK), threw = !0; try { ret = fs.futimesSync(fd, at, mt), threw = !1; } finally { if (threw) try { fs.closeSync(fd); } catch (er) {} else fs.closeSync(fd); } return ret; }) : (fs.lutimes = function(_a, _b, _c, cb) { cb && process.nextTick(cb); }, fs.lutimesSync = function() {}); })(fs), fs.chown = chownFix(fs.chown), fs.fchown = chownFix(fs.fchown), fs.lchown = chownFix(fs.lchown), fs.chmod = chmodFix(fs.chmod), fs.fchmod = chmodFix(fs.fchmod), fs.lchmod = chmodFix(fs.lchmod), fs.chownSync = chownFixSync(fs.chownSync), fs.fchownSync = chownFixSync(fs.fchownSync), fs.lchownSync = chownFixSync(fs.lchownSync), fs.chmodSync = chmodFixSync(fs.chmodSync), fs.fchmodSync = chmodFixSync(fs.fchmodSync), fs.lchmodSync = chmodFixSync(fs.lchmodSync), fs.stat = statFix(fs.stat), fs.fstat = statFix(fs.fstat), fs.lstat = statFix(fs.lstat), fs.statSync = statFixSync(fs.statSync), fs.fstatSync = statFixSync(fs.fstatSync), fs.lstatSync = statFixSync(fs.lstatSync), fs.lchmod || (fs.lchmod = function(path, mode, cb) { cb && process.nextTick(cb); }, fs.lchmodSync = function() {}), fs.lchown || (fs.lchown = function(path, uid, gid, cb) { cb && process.nextTick(cb); }, fs.lchownSync = function() {}), "win32" === platform && (fs.rename = (fs$rename = fs.rename, function(from, to, cb) { var start = Date.now(), backoff = 0; fs$rename(from, to, (function CB(er) { if (er && ("EACCES" === er.code || "EPERM" === er.code) && Date.now() - start < 6e4) return setTimeout((function() { fs.stat(to, (function(stater, st) { stater && "ENOENT" === stater.code ? fs$rename(from, to, CB) : cb(er); })); }), backoff), void (backoff < 100 && (backoff += 10)); cb && cb(er); })); })), fs.read = (fs$read = fs.read, function(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && "function" == typeof callback_) { var eagCounter = 0; callback = function(er, _, __) { if (er && "EAGAIN" === er.code && eagCounter < 10) return eagCounter++, fs$read.call(fs, fd, buffer, offset, length, position, callback); callback_.apply(this, arguments); }; } return fs$read.call(fs, fd, buffer, offset, length, position, callback); }), fs.readSync = (fs$readSync = fs.readSync, function(fd, buffer, offset, length, position) { for (var eagCounter = 0; ;) try { return fs$readSync.call(fs, fd, buffer, offset, length, position); } catch (er) { if ("EAGAIN" === er.code && eagCounter < 10) { eagCounter++; continue; } throw er; } }); }; }, function(module, exports) { module.exports = require("constants"); }, function(module, exports, __webpack_require__) { var Stream = __webpack_require__(3).Stream; module.exports = function(fs) { return { ReadStream: function ReadStream(path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self = this; this.path = path, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 65536, options = options || {}; for (var keys = Object.keys(options), index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding && this.setEncoding(this.encoding), void 0 !== this.start) { if ("number" != typeof this.start) throw TypeError("start must be a Number"); if (void 0 === this.end) this.end = 1 / 0; else if ("number" != typeof this.end) throw TypeError("end must be a Number"); if (this.start > this.end) throw new Error("start must be <= end"); this.pos = this.start; } null === this.fd ? fs.open(this.path, this.flags, this.mode, (function(err, fd) { if (err) return self.emit("error", err), void (self.readable = !1); self.fd = fd, self.emit("open", fd), self._read(); })) : process.nextTick((function() { self._read(); })); }, WriteStream: function WriteStream(path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this), this.path = path, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, options = options || {}; for (var keys = Object.keys(options), index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (void 0 !== this.start) { if ("number" != typeof this.start) throw TypeError("start must be a Number"); if (this.start < 0) throw new Error("start must be >= zero"); this.pos = this.start; } this.busy = !1, this._queue = [], null === this.fd && (this._open = fs.open, this._queue.push([ this._open, this.path, this.flags, this.mode, void 0 ]), this.flush()); } }; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = function(obj) { if (null === obj || "object" != typeof obj) return obj; if (obj instanceof Object) var copy = { __proto__: obj.__proto__ }; else copy = Object.create(null); return Object.getOwnPropertyNames(obj).forEach((function(key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); })), copy; }; }, function(module, exports, __webpack_require__) { module.exports = SocketReader; var inherits = __webpack_require__(8), Reader = __webpack_require__(93); function SocketReader(props) { if (!(this instanceof SocketReader)) throw new Error("SocketReader must be called as constructor."); if ("Socket" !== props.type || !props.Socket) throw new Error("Non-socket type " + props.type); Reader.call(this, props); } inherits(SocketReader, Reader), SocketReader.prototype._read = function() { this._paused || this._ended || (this.emit("end"), this.emit("close"), this._ended = !0); }; }, function(module, exports, __webpack_require__) { const needle = __webpack_require__(73), getContentLength = __webpack_require__(1281); module.exports = async function(url, lengths) { return new Promise((async (resolve, reject) => { let contentLength = !1; "object" == typeof url && (contentLength = url.bytes, url = url.url); let fileName = url.split("/").pop(); if ((fileName || "").includes(".") ? (fileName = decodeURIComponent(fileName), fileName.includes("?") && (fileName = fileName.split("?")[0])) : fileName = "archive.zip", !contentLength) if (lengths.length > 1 && !fileName.match(/\.zip$/i) && lengths[0] === lengths[1]) contentLength = lengths[0]; else try { contentLength = await getContentLength(url), contentLength = parseInt(contentLength); } catch (e) { return console.error(e), void reject(e); } resolve({ length: contentLength, name: fileName, createReadStream: range => { const opts = { follow_max: 5, rejectUnauthorized: !1 }; return Object.values(range).length && (range.start = range.start || 0, range.end = range.end || 0, (range.end > contentLength - 1 || 0 === range.end) && (range.end = ""), opts.headers = { range: `bytes=${range.start}-${range.end}` }), needle.get(url, opts); } }); })); }; }, function(module, exports, __webpack_require__) { const request = __webpack_require__(61); module.exports = async function(url) { return new Promise(((resolve, reject) => { const req = request({ url: url, followRedirect: !0, maxRedirects: 5, strictSSL: !1 }); req.on("response", (function(d) { req.abort(), d.headers["content-length"] ? resolve(d.headers["content-length"]) : reject("Could not retrieve content-length from ranged request"); })).on("error", reject); })); }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(166), parseQuery = __webpack_require__(275), cryptojs = __webpack_require__(6), ee = __webpack_require__(4), lzDecompress = __webpack_require__(77).decompressFromEncodedURIComponent, initEmitter = new ee; module.exports = { createKey: function(archiveType, orderRegex, orderDefault, req, res) { function storeDataToKey(arr, newKey) { if (newKey && null !== store.get(newKey)) return newKey; arr = arr.map((el => Array.isArray(el) ? !!el[0] && (el[1] ? { url: el[0], bytes: el[1] } : { url: el[0] }) : el)).filter((el => !!el)), orderRegex && (arr = arr.sort(((first, second) => { const firstMatch = ((first || {}).url || first || "").split("?")[0].match(orderRegex), secondMatch = ((second || {}).url || second || "").split("?")[0].match(orderRegex); return +(firstMatch && firstMatch[1] || orderDefault || 0) - +(secondMatch && secondMatch[1] || orderDefault || 0); }))); const key = store.set(arr, newKey); return initEmitter.emit(key), key; } if ("POST" === req.method) { if (!Array.isArray(req.body)) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 1"); const key = storeDataToKey(req.body, req.params.createKey); res.setHeader("Content-Length", JSON.stringify({ key: key }).length + ""), res.setHeader("Content-Type", "application/json"), res.end(JSON.stringify({ key: key })); } else { if (!req.query.lz) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 2"); let lzData = !1; try { lzData = JSON.parse(lzDecompress(req.query.lz)); } catch (e) {} if (!lzData || !lzData.urls || !lzData.urls.length) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 3"); const hashKey = (txt = req.query.lz, cryptojs.createHash("sha256").update(txt).digest("hex")); storeDataToKey(lzData.urls, hashKey), opts = (function(lzData) { let opts = {}; return lzData.fileMustInclude && (opts.fileMustInclude = lzData.fileMustInclude), lzData.maxFiles && lzData.maxFiles > 0 && (opts.maxFiles = lzData.maxFiles), lzData.fileIdx && lzData.fileIdx > -1 && (opts.fileIdx = lzData.fileIdx), !!Object.keys(opts).length && opts; })(lzData), res.statusCode = 302, res.setHeader("Location", `/${archiveType}/stream?key=${hashKey}` + (opts ? "&o=" + encodeURIComponent(JSON.stringify(opts)) : "")), res.end(); } var txt; }, waitForKey: function(req) { return new Promise(((resolve, reject) => { const key = parseQuery(req).query.key; key ? null === store.get(key) ? initEmitter.addListener(key, (function gotData() { initEmitter.removeListener(key, gotData), resolve(); })) : resolve() : reject(Error("No stream key provided")); })); } }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(169), getRouter = __webpack_require__(1284), getRarStream = __webpack_require__(561); module.exports = { router: getRouter, create: rarUrls => { if (!rarUrls || !Array.isArray(rarUrls)) throw Error('"rarUrls" is undefined or not an array'); return store.set(rarUrls); }, file: async (key, opts) => { if (!key) throw Error('Missing "key"'); return await getRarStream({ url: key, query: { o: JSON.stringify(opts || {}), key: key } }); } }; }, function(module, exports, __webpack_require__) { const Router = __webpack_require__(108), bodyParser = __webpack_require__(50), getRarStream = __webpack_require__(561), getContentType = __webpack_require__(1289), keyHandler = (__webpack_require__(169), __webpack_require__(277), new (__webpack_require__(4)), __webpack_require__(1290)), orderRegex = /\.7Z\.(\d\d?\d?\d?\d?)$/i; module.exports = function() { const router = Router(); return router.use(bodyParser.json()), router.post("/create/:createKey", keyHandler.createKey.bind(null, "7zip", orderRegex, 0)), router.all("/create", keyHandler.createKey.bind(null, "7zip", orderRegex, 0)), router.get("/stream", (async (req, res) => { try { await keyHandler.waitForKey(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } let rarInnerFile; try { rarInnerFile = await getRarStream(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } if (!rarInnerFile) { const errMsg = "There was an error with the 7zip parser."; return console.error(Error(errMsg)), res.statusCode = 500, void res.end(errMsg); } if ("HEAD" === req.method) return res.statusCode = 204, res.setHeader("Accept-Ranges", "bytes"), res.setHeader("Content-Length", rarInnerFile.length + ""), res.setHeader("Content-Type", getContentType(rarInnerFile)), void res.end(); const fileSize = rarInnerFile.length, range = req.headers.range; let start = 0, end = fileSize - 1; if (res.setHeader("Accept-Ranges", "bytes"), res.setHeader("Content-Type", getContentType(rarInnerFile)), Object.values(range || {}).length) { const parts = range.replace(/bytes=/, "").split("-"); start = parseInt(parts[0], 10) || 0, end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1, res.statusCode = 206, res.setHeader("Content-Range", `bytes ${start}-${end}/${fileSize}`); const chunksize = end - start + 1; res.setHeader("Content-Length", chunksize + ""); } else res.statusCode = 200, res.setHeader("Content-Length", fileSize + ""); const readable = await rarInnerFile.createReadStream({ start: start, end: end }); req.on("close", (function() { readable.stream.request.abort(); })), readable.pipe(res); })), router; }; }, function(module, exports, __webpack_require__) { "use strict"; function _optionalChain(ops) { let lastAccessLHS, value = ops[0], i = 1; for (;i < ops.length; ) { const op = ops[i], fn = ops[i + 1]; if (i += 2, ("optionalAccess" === op || "optionalCall" === op) && null == value) return; "access" === op || "optionalAccess" === op ? (lastAccessLHS = value, value = fn(value)) : "call" !== op && "optionalCall" !== op || (value = fn(((...args) => value.call(lastAccessLHS, ...args))), lastAccessLHS = void 0); } return value; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _events = __webpack_require__(4), ZXX_EXTENSION = /\.7Z\.(\d\d?\d?\d?\d?)$|\.7Z$/i, A7Z_EXTENSION = /\.7Z$/i, PARTXX_A7Z_EXTENSION = /\.PART(\d\d?\d?\d?\d?)\.7Z$/i, makeRarFileBundle = (fileMedias = []) => ((fileMedias = []) => fileMedias.filter((file => file.name && file.name.match(PARTXX_A7Z_EXTENSION))).length > 0)(fileMedias) ? new class { constructor(fileMedias = []) { this.fileMedias = fileMedias, this.fileMedias.length > 0 && (this.filter(), this.sort()); } filter() { this.fileMedias = this.fileMedias.filter((file => file.name.match(PARTXX_A7Z_EXTENSION))); } sort() { this.fileMedias.sort(((first, second) => { const firstMatch = first.name.match(PARTXX_A7Z_EXTENSION), secondMatch = second.name.match(PARTXX_A7Z_EXTENSION); return +(firstMatch && firstMatch[1] || 0) - +(secondMatch && secondMatch[1] || 0); })); } get length() { return this.fileMedias.length; } get fileNames() { return this.fileMedias.map((file => file.name)); } get files() { return this.fileMedias; } }(fileMedias) : new class { constructor(fileMedias = []) { this.fileMedias = fileMedias, this.fileMedias.length > 0 && (this.filter(), this.sort()); } filter() { this.fileMedias = this.fileMedias.filter((file => file.name && file.name.match(ZXX_EXTENSION))); } sort() { this.fileMedias.sort(((first, second) => { if (first.name.match(A7Z_EXTENSION)) return -1; if (second.name.match(A7Z_EXTENSION)) return 1; { const firstMatch = first.name.match(ZXX_EXTENSION), secondMatch = second.name.match(ZXX_EXTENSION); return +(firstMatch && firstMatch[1] || 0) - +(secondMatch && secondMatch[1] || 0); } })); } get length() { return this.fileMedias.length; } get fileNames() { return this.fileMedias.map((file => file.name)); } get files() { return this.fileMedias; } }(fileMedias), RarFileChunk = class _RarFileChunk { constructor(fileMedia, startOffset, endOffset) { this.fileMedia = fileMedia, this.startOffset = startOffset, this.endOffset = endOffset; } padEnd(endPadding) { return new _RarFileChunk(this.fileMedia, this.startOffset, this.endOffset - endPadding); } padStart(startPadding) { return new _RarFileChunk(this.fileMedia, this.startOffset + startPadding, this.endOffset); } get length() { return Math.max(0, this.endOffset - this.startOffset); } getStream() { return this.fileMedia.createReadStream({ start: this.startOffset, end: this.endOffset }); } }, _stream = __webpack_require__(3), InnerFileStream = class extends _stream.Readable { constructor(rarFileChunks, options) { super(options), this.rarFileChunks = rarFileChunks; } pushData(data) { this.push(data) || _optionalChain([ this, "access", _ => _.stream, "optionalAccess", _2 => _2.pause, "call", _3 => _3() ]); } get isStarted() { return !!this.stream; } async next() { const chunk = this.rarFileChunks.shift(); chunk ? (this.stream = await chunk.getStream(), _optionalChain([ this, "access", _4 => _4.stream, "optionalAccess", _5 => _5.on, "call", _6 => _6("data", (data => this.pushData(data))) ]), _optionalChain([ this, "access", _7 => _7.stream, "optionalAccess", _8 => _8.on, "call", _9 => _9("end", (() => this.next())) ])) : this.push(null); } _read() { this.isStarted ? _optionalChain([ this, "access", _10 => _10.stream, "optionalAccess", _11 => _11.resume, "call", _12 => _12() ]) : this.next(); } }, streamToBuffer = async stream => new Promise(((resolve, reject) => { const buffers = []; stream.on("error", reject), stream.on("data", (data => buffers.push(data))), stream.on("end", (() => resolve(Buffer.concat(buffers)))); })), lzma = (function(obj) { if (obj && obj.__esModule) return obj; var newObj = {}; if (null != obj) for (var key in obj) Object.prototype.hasOwnProperty.call(obj, key) && (newObj[key] = obj[key]); return newObj.default = obj, newObj; })(__webpack_require__(1286)), nodeMajorVersion = parseInt((((process || {}).version || "").split(".")[0] || "").substring(1)); function subarray(buff, start, end) { return buff[nodeMajorVersion < 16 ? "slice" : "subarray"](start, end); } function readBigUInt64LE(buffer, offset) { return buffer.readUInt32LE(offset) + 4294967296 * buffer.readUInt32LE(offset + 4); } var CompressionMethods_COPY = [ 0 ], CompressionMethods_LZMA = [ 3, 1, 1 ], CompressionMethods_LZMA2 = [ 33 ]; function isCompressionMethod(methodId, expectedMethod) { if (!methodId || !expectedMethod) return !1; if (methodId.length !== expectedMethod.length) return !1; for (let i = 0; i < methodId.length; i++) if (methodId[i] !== expectedMethod[i]) return !1; return !0; } var RarFilesPackage = class extends _events.EventEmitter { constructor(fileMedias) { super(), this.rarFileBundle = makeRarFileBundle(fileMedias); } async parseFiles(rarFiles, opts) { let _files = []; try { _files = await (async function(a7zFiles) { let _files = []; const parserState = { _pointer: 0, _buffer: null }; async function readFromVolumes(absoluteOffset, length) { const target = (function(a7zFiles, targetAbsoluteOffset) { let totalBytesScanned = 0; for (let i = 0; i < a7zFiles.length; i++) { const currentVolume = a7zFiles[i], currentVolumeSize = currentVolume.length; if (targetAbsoluteOffset < totalBytesScanned + currentVolumeSize) { const relativeOffsetInVolume = targetAbsoluteOffset - totalBytesScanned; return console.log(`Offset ${targetAbsoluteOffset} is in volume ${i} (${currentVolume.name}) at position ${relativeOffsetInVolume}.`), { volumeIndex: i, volumeFile: currentVolume, offset: relativeOffsetInVolume }; } totalBytesScanned += currentVolumeSize; } return console.error("Error: The target offset is outside the bounds of the archive."), null; })(a7zFiles, absoluteOffset); if (!target) throw new Error(`Offset ${absoluteOffset} is out of bounds.`); const stream = await target.volumeFile.createReadStream({ start: target.offset, end: target.offset + length }); return streamToBuffer(stream); } class MyBuffer { constructor(buffer) { this.buffer = buffer, this.offset = 0; } readByte() { return this.buffer[this.offset++]; } read(length) { const result = this.buffer.slice(this.offset, this.offset + length); return this.offset += length, result; } } function readByte() { return parserState._buffer[parserState._pointer++]; } function read(bytes) { const toReturn = subarray(parserState._buffer, parserState._pointer, parserState._pointer + bytes); return parserState._pointer += bytes, toReturn; } function readUint64() { const buff = parserState._buffer; let firstByte = buff[parserState._pointer], mask = 128, value = 0; parserState._pointer++; for (let i = 0; i < 8; i++) { if (0 == (firstByte & mask)) return value += (firstByte & mask - 1) * Math.pow(256, i), value; const nextByte = buff[parserState._pointer]; parserState._pointer++, value += nextByte * Math.pow(256, i), mask >>>= 1; } return value; } function _parseFolder() { const folder = { totalInputStreams: 0, totalOutputStreams: 0, coders: [] }, NumCoders = readUint64(); for (let i = 0; i < NumCoders; i++) { const magicbyte = readByte(), isComplex = 0 != (16 & magicbyte), hasAttributes = 0 != (32 & magicbyte), coder = { decompressionMethodId: read(15 & magicbyte), NumInStreams: 1, NumOutStreams: 1 }; if (isComplex && (coder.NumInStreams = readUint64(), coder.NumOutStreams = readUint64()), folder.totalInputStreams += coder.NumInStreams, folder.totalOutputStreams += coder.NumOutStreams, hasAttributes) { const property_size = readUint64(); coder.properties = read(property_size); } folder.coders[i] = coder; } const NumBindPairs = folder.totalOutputStreams - 1; folder.bindPairs = []; for (let k = 0; k < NumBindPairs; k++) folder.bindPairs[k] = { inIndex: readUint64(), outIndex: readUint64() }; const NumPackedStreams = folder.totalInputStreams - NumBindPairs; if (folder.packedStreams = [], 1 === NumPackedStreams) { let last = 0; for (let i = 0; i < folder.totalInputStreams; i++) { let found = !1; for (let j = 0; j < folder.bindPairs.length; j++) folder.bindPairs[j].inIndex === i && (found = !0); found || (last = i); } folder.packedStreams[0] = last; } else for (let i = 0; i < NumPackedStreams; i++) folder.packedStreams[i] = readUint64(); return folder; } function _parseDigest(num) { const digest = []; if (0 === readByte()) throw new Error("CRC digest all undefined not implemented"); for (let i = 0; i < num; i++) digest[i] = read(4); return digest; } function _parseStreamInfo() { const stream = {}; let prop = readByte(); if (6 === prop && (stream.PackInfo = (function() { const packet = { PackPos: readUint64(), NumPackStreams: readUint64(), size: [], CRC: [] }; let pack_property = readByte(); if (9 === pack_property) { for (let i = 0; i < packet.NumPackStreams; i++) packet.size[i] = readUint64(); pack_property = readByte(); } if (10 === pack_property && (packet.CRC = _parseDigest(packet.NumPackStreams), pack_property = readByte()), 0 !== pack_property) throw new Error("ERROR Parsing Pack Info"); return packet; })(), prop = readByte()), 7 === prop && (stream.UnPackInfo = (function() { if (11 !== readByte()) throw new Error("No folder property found in UnPackInfo"); const unpack = { NumFolders: readUint64() }; if (0 === readByte()) { unpack.folders = []; for (let i = 0; i < unpack.NumFolders; i++) unpack.folders[i] = _parseFolder(); } else unpack.DataStreamIndex = readUint64(); if (12 !== readByte()) throw new Error("No kCodersUnPackSize property found"); for (let i = 0; i < unpack.NumFolders; i++) { unpack.folders[i].UnPackSize = []; for (let j = 0; j < unpack.folders[i].totalOutputStreams; j++) unpack.folders[i].UnPackSize[j] = readUint64(); } let next = readByte(); if (10 === next && (unpack.CRC = _parseDigest(unpack.NumFolders), next = readByte()), 0 !== next) throw new Error("No kEnd property found at end of UnPackInfo"); return unpack; })(), prop = readByte()), 8 === prop && (stream.SubStreamInfo = (function(stream) { const substream = {}, num = stream.UnPackInfo.NumFolders; let prop = readByte(); if (13 === prop) { substream.NumUnPackStream = []; for (let i = 0; i < num; i++) substream.NumUnPackStream[i] = readUint64(); prop = readByte(); } else { substream.NumUnPackStream = []; for (let i = 0; i < num; i++) substream.NumUnPackStream[i] = 1; } let totalSubstreams = 0; for (let i = 0; i < substream.NumUnPackStream.length; i++) totalSubstreams += substream.NumUnPackStream[i]; if (9 === prop) { substream.size = []; for (let i = 0; i < num; i++) { const numStreams = substream.NumUnPackStream[i]; if (0 !== numStreams) if (1 === numStreams) substream.size.push(stream.UnPackInfo.folders[i].UnPackSize[0]); else { let sum2 = 0; for (let j = 0; j < numStreams - 1; j++) { const size = readUint64(); substream.size.push(size), sum2 += size; } const lastSize = stream.UnPackInfo.folders[i].UnPackSize[0] - sum2; substream.size.push(lastSize); } } prop = readByte(); } else { substream.size = []; for (let i = 0; i < num; i++) { const numStreams = substream.NumUnPackStream[i], folderSize = stream.UnPackInfo.folders[i].UnPackSize[0]; if (1 === numStreams) substream.size.push(folderSize); else if (numStreams > 1) for (let j = 0; j < numStreams; j++) substream.size.push(Math.floor(folderSize / numStreams)); } } if (10 === prop && (substream.CRC = _parseDigest(totalSubstreams), prop = readByte()), 0 !== prop) throw new Error("No kEnd found in SubStreamInfo"); return substream; })(stream), prop = readByte()), 0 !== prop) throw new Error("No kEnd found in StreamInfo"); return stream; } function _parseFilesInfo() { const numFiles = readUint64(), files = []; for (let i = 0; i < numFiles; i++) files[i] = { name: "" }; let prop; for (;0 !== (prop = readByte()); ) { const size = readUint64(); switch (prop) { case 17: if (0 !== readByte()) throw new Error("External file names not supported"); const names = read(size - 1).toString("utf16le").split("\0"); for (let j = 0; j < files.length; j++) files[j].name = names[j] || ""; break; case 14: const emptyStreamData = read(size); for (let i = 0; i < numFiles; i++) files[i].isEmptyStream = 0 != (emptyStreamData[Math.floor(i / 8)] >>> 7 - i % 8 & 1); break; default: read(size); } } return files; } const signatureHeader = await readFromVolumes(0, 32), expectedSig = Buffer.from ? Buffer.from([ 55, 122, 188, 175, 39, 28 ]) : new Buffer([ 55, 122, 188, 175, 39, 28 ]); if (!subarray(signatureHeader, 0, 6).equals(expectedSig)) throw new Error("Invalid 7-Zip signature."); const _NextHeaderOffset = signatureHeader.readBigUInt64LE ? signatureHeader.readBigUInt64LE(12) : readBigUInt64LE(signatureHeader, 12), _NextHeaderSize = signatureHeader.readBigUInt64LE ? signatureHeader.readBigUInt64LE(20) : readBigUInt64LE(signatureHeader, 20), absoluteHeaderPosition = 32 + Number(_NextHeaderOffset); let mainHeaderBlock = await readFromVolumes(absoluteHeaderPosition, Number(_NextHeaderSize)); parserState._buffer = mainHeaderBlock, parserState._pointer = 0; let header_Type = readByte(); if (23 === header_Type) { const encodedHeaderStreamInfo = _parseStreamInfo(), folder = encodedHeaderStreamInfo.UnPackInfo.folders[0], packPos = encodedHeaderStreamInfo.PackInfo.PackPos, packSize = encodedHeaderStreamInfo.PackInfo.size[0], compressedHeaderData = await readFromVolumes(32 + packPos, packSize), methodId = folder.coders[0].decompressionMethodId; let decompressedHeader; if (isCompressionMethod(methodId, CompressionMethods_LZMA)) { const propertiesStream = { data: folder.coders[0].properties, offset: 0, readByte: function() { return this.data[this.offset++]; } }, inStream = { data: compressedHeaderData, offset: 0, readByte: function() { return this.data[this.offset++]; } }, outStream = { data: [], offset: 0, writeByte: function(value) { this.data[this.offset++] = value; } }, outSize = Number(folder.UnPackSize[0]); decompressedHeader = await new Promise(((resolve, reject) => { try { lzma.decompress(propertiesStream, inStream, outStream, outSize), resolve(Buffer.from ? Buffer.from(outStream.data) : new Buffer(outStream.data)); } catch (e) { reject(e); } })); } else if (isCompressionMethod(methodId, CompressionMethods_LZMA2)) decompressedHeader = (function(properties, compressedData) { const p = 63 & properties[0], dictSize = 40 === p ? 4294967295 : (2 | 1 & p) << p / 2 + 11 >>> 0, outBuffers = [], buffer = new MyBuffer(compressedData); let control; for (;0 !== (control = buffer.readByte()); ) if (1 === control) { const length = buffer.read(2).readUInt16BE(0) + 1; outBuffers.push(buffer.read(length)); } else { if (!(control >= 128)) throw new Error(`LZMA2 control byte ${control} is unsupported!`); { const uncompressedLength = buffer.read(2).readUInt16BE(0) + 1 | (31 & control) << 16, compressedLength = buffer.read(2).readUInt16BE(0) + 1, lclppb = buffer.readByte(), lzmaStream = buffer.read(compressedLength), packetBuffer = Buffer.alloc ? Buffer.alloc(13 + compressedLength) : new Buffer(13 + compressedLength); Buffer.alloc || packetBuffer.fill(0), packetBuffer.writeUInt8(lclppb, 0), packetBuffer.writeUInt32LE(dictSize, 1), packetBuffer.writeUInt32LE(4294967295 & uncompressedLength, 5), packetBuffer.writeUInt32LE(uncompressedLength / 4294967296 >>> 0, 9), (Buffer.from ? Buffer.from(lzmaStream) : lzmaStream).copy(packetBuffer, 13); const propertiesStream = { data: packetBuffer.slice(0, 5), offset: 0, readByte: function() { return this.data[this.offset++]; } }, inStream = { data: packetBuffer.slice(13), offset: 0, readByte: function() { return this.data[this.offset++]; } }, outStream = { data: [], offset: 0, writeByte: function(value) { this.data[this.offset++] = value; } }; lzma.decompress(propertiesStream, inStream, outStream, uncompressedLength), outBuffers.push(Buffer.from ? Buffer.from(outStream.data) : new Buffer(outStream.data)); } } return Buffer.concat(outBuffers); })(folder.coders[0].properties, compressedHeaderData); else { if (!isCompressionMethod(methodId, CompressionMethods_COPY)) { const methodStr = methodId.reduce(((str, byte, index) => { const hexStr = byte.toString(16); return str + "0x" + (hexStr.padStart ? hexStr.padStart(2, "0") : ("0" + hexStr).slice(-2)) + (index < methodId.length - 1 ? " " : ""); }), ""); throw new Error(`Unsupported header compression method: ${methodStr}`); } decompressedHeader = compressedHeaderData; } parserState._buffer = decompressedHeader, parserState._pointer = 0, header_Type = readByte(); } if (1 !== header_Type) throw new Error(`Could not find a valid Header block. Expected 0x01 but found 0x${header_Type.toString(16)}`); return await (async function() { const header = { FilesInfo: [] }; for (;;) { const prop = readByte(); if (0 === prop) break; switch (prop) { case 4: header.MainStreamInfo = _parseStreamInfo(); break; case 5: header.FilesInfo = _parseFilesInfo(); break; case 2: case 3: console.log(`[DEBUG] Skipping property 0x${prop.toString(16)}`), read(readUint64()); break; default: throw new Error(`Unsupported header property ID: 0x${prop.toString(16)}`); } } if (!header.MainStreamInfo || !header.FilesInfo || 0 === header.FilesInfo.length) return header; if (!header.MainStreamInfo.SubStreamInfo) { header.MainStreamInfo.SubStreamInfo = { size: [], NumUnPackStream: [] }; for (let i = 0; i < header.MainStreamInfo.UnPackInfo.NumFolders; i++) header.MainStreamInfo.SubStreamInfo.NumUnPackStream[i] = 1, header.MainStreamInfo.SubStreamInfo.size.push(header.MainStreamInfo.UnPackInfo.folders[i].UnPackSize[0]); } const fileSizes = header.MainStreamInfo.SubStreamInfo.size || []; let nonEmptyIndex = 0, folderIndex = 0, filesInCurrentFolder = 0, maxFilesInFolder = header.MainStreamInfo.SubStreamInfo.NumUnPackStream[folderIndex] || 1, currentOffsetInFolder = 0; for (let i = 0; i < header.FilesInfo.length; i++) { const fileInfo = header.FilesInfo[i]; if (fileInfo.isEmptyStream) _files.push({ name: fileInfo.name, data: { folder: { coders: [ { decompressionMethodId: Buffer.from ? Buffer.from([ 0 ]) : new Buffer([ 0 ]) } ] }, offset: 0, length: 0, folderIndex: -1, packOffset: 0, packSize: 0 } }); else { filesInCurrentFolder >= maxFilesInFolder && folderIndex < header.MainStreamInfo.UnPackInfo.NumFolders - 1 && (folderIndex++, filesInCurrentFolder = 0, currentOffsetInFolder = 0, maxFilesInFolder = header.MainStreamInfo.SubStreamInfo.NumUnPackStream[folderIndex] || 1); const folder = header.MainStreamInfo.UnPackInfo.folders[folderIndex], fileSize = fileSizes[nonEmptyIndex] || 0; let packOffsetForFolder = 32 + header.MainStreamInfo.PackInfo.PackPos; for (let j = 0; j < folderIndex; j++) packOffsetForFolder += header.MainStreamInfo.PackInfo.size[j] || 0; _files.push({ name: fileInfo.name, data: { folder: folder, offset: currentOffsetInFolder, length: fileSize, folderIndex: folderIndex, packOffset: packOffsetForFolder, packSize: header.MainStreamInfo.PackInfo.size[folderIndex] || 0 } }), currentOffsetInFolder += fileSize, nonEmptyIndex++, filesInCurrentFolder++; } } return header; })(), _files; })(rarFiles); } catch (e) { throw e; } function getFileChunks(file) { if (console.log(file.name, "file.name"), console.log(file.data.folder.coders[0].decompressionMethodId, "decompressionMethodId"), 0 !== file.data.folder.coders[0].decompressionMethodId[0]) throw new Error("Decompression is not implemented"); let fileByteCount = 0, k = 0; if (0 === file.data.packOffset) k = 1; else for (;file.data.packOffset > fileByteCount; ) fileByteCount += rarFiles[k].length, k++; let fileChunksBytes = 0; const chunks = []; let leftFromFile = file.data.length; for (let o = k - 1; fileChunksBytes < file.data.length && rarFiles[o]; o++) { if (o === k - 1) { const offBy = file.data.packOffset - (k - 1) * rarFiles[0].length, tillThis = offBy + file.data.length > rarFiles[o].length ? rarFiles[o].length : offBy + file.data.length; leftFromFile -= rarFiles[o].length, chunks.push({ name: file.name, compression: ((((file.data || {}).folder || {}).coders || [])[0] || {}).decompressionMethodId || [], fileHead: file, chunk: new RarFileChunk(rarFiles[o], offBy, tillThis - 1) }), rarFiles[0].length; } else { const offBy = 0, tillThis = leftFromFile < rarFiles[o].length ? leftFromFile : rarFiles[o].length; leftFromFile -= rarFiles[o].length, chunks.push({ name: file.name, compression: ((((file.data || {}).folder || {}).coders || [])[0] || {}).decompressionMethodId || [], fileHead: file, chunk: new RarFileChunk(rarFiles[o], offBy, tillThis - 1) }); } fileChunksBytes += rarFiles[o].length; } return chunks; } console.log(_files, "_files"); const countAllFiles = _files.length; let filteredFiles = [], countFiles = 0, retrievedFiles = 0; for (let i = 0; _files[i]; i++) { if (opts.filter) { if (opts.filter(_files[i].name, countFiles) && (filteredFiles.push(_files[i]), retrievedFiles++, opts.hasOwnProperty("maxFiles") && retrievedFiles === opts.maxFiles)) break; } else filteredFiles.push(_files[i]); countFiles++; } return this.emit("file-parsed", rarFiles[0]), console.log(filteredFiles, "filteredFiles"), console.log({ chunks: filteredFiles.map((el => getFileChunks(el))).flat(), count: countAllFiles }), { chunks: filteredFiles.map((el => getFileChunks(el))).flat(), count: countAllFiles }; } async parse(opts) { opts = opts || {}, this.emit("parsing-start", this.rarFileBundle); const {files: files} = this.rarFileBundle, {chunks: chunks, count: count} = await this.parseFiles(files, opts), grouped = (fn = f => f.name, object = chunks.reduce(((prev, curr) => { const groupKey = fn(curr), group = prev[groupKey] || []; return group.push(curr), { ...prev, [groupKey]: group }; }), {}), mapper = value => value.map((v => [ v.chunk, v.compression ])), Object.fromEntries(Object.entries(object).map((([key, value]) => [ key, mapper(value) ])))); var object, mapper, fn; const innerFiles = Object.entries(grouped).map((([name, data]) => new class { constructor(name, rarFileChunks, compression) { this.name = name, this.rarFileChunks = rarFileChunks, this.length = rarFileChunks.map((c => c.length)).reduce(((s, n) => s + n)), this.compression = compression, this.chunkMap = this.calculateChunkMap(rarFileChunks), this.name = name; } async readToEnd() { const stream = await this.createReadStream({ start: 0, end: this.length - 1 }); return streamToBuffer(stream); } getChunksToStream(fileStart, fileEnd) { const {index: startIndex, start: startOffset} = this.findMappedChunk(fileStart); let {index: endIndex, end: endOffset} = this.findMappedChunk(fileEnd); const chunksToStream = this.rarFileChunks.slice(startIndex, endIndex + 1), last = chunksToStream.length - 1; chunksToStream[0] = chunksToStream[0].padStart(Math.abs(startOffset - fileStart)); let diff = Math.abs(endOffset - fileEnd); return diff === this.rarFileChunks.length && (diff = 0), 0 !== diff && (chunksToStream[last] = chunksToStream[last].padEnd(diff)), chunksToStream; } createReadStream(interval) { interval || (interval = { start: 0, end: this.length - 1 }); let {start: start, end: end} = interval; if (start < 0 || end >= this.length) throw Error("Illegal start/end offset"); return Promise.resolve(new InnerFileStream(this.getChunksToStream(start, end))); } calculateChunkMap(rarFileChunks) { const chunkMap = []; let index = 0, fileOffset = 0; for (const chunk of rarFileChunks) { const start = fileOffset, end = fileOffset + chunk.length; fileOffset = end + 1, chunkMap.push({ index: index, start: start, end: end, chunk: chunk }), index++; } return chunkMap; } findMappedChunk(offset) { let selectedMap = this.chunkMap[0]; for (const chunkMapping of this.chunkMap) if (offset >= chunkMapping.start && offset <= chunkMapping.end) { selectedMap = chunkMapping; break; } return selectedMap; } }(name, data.map((data2 => data2[0])), data[0][1]))); return this.emit("parsing-complete", innerFiles), innerFiles; } }, _path = __webpack_require__(5), _fs = __webpack_require__(2); exports.LocalFileMedia = class { constructor(path) { this.path = path, this.name = _path.basename.call(void 0, path), this.length = _fs.statSync.call(void 0, path).size; } createReadStream(interval) { return Promise.resolve(_fs.createReadStream.call(void 0, this.path, interval)); } }, exports.RarFilesPackage = RarFilesPackage; }, function(module, exports) { var LZMA = LZMA || {}; LZMA.OutWindow = function() { this._windowSize = 0; }, LZMA.OutWindow.prototype.create = function(windowSize) { this._buffer && this._windowSize === windowSize || (this._buffer = []), this._windowSize = windowSize, this._pos = 0, this._streamPos = 0; }, LZMA.OutWindow.prototype.flush = function() { var size = this._pos - this._streamPos; if (0 !== size) { for (;size--; ) this._stream.writeByte(this._buffer[this._streamPos++]); this._pos >= this._windowSize && (this._pos = 0), this._streamPos = this._pos; } }, LZMA.OutWindow.prototype.releaseStream = function() { this.flush(), this._stream = null; }, LZMA.OutWindow.prototype.setStream = function(stream) { this.releaseStream(), this._stream = stream; }, LZMA.OutWindow.prototype.init = function(solid) { solid || (this._streamPos = 0, this._pos = 0); }, LZMA.OutWindow.prototype.copyBlock = function(distance, len) { var pos = this._pos - distance - 1; for (pos < 0 && (pos += this._windowSize); len--; ) pos >= this._windowSize && (pos = 0), this._buffer[this._pos++] = this._buffer[pos++], this._pos >= this._windowSize && this.flush(); }, LZMA.OutWindow.prototype.putByte = function(b) { this._buffer[this._pos++] = b, this._pos >= this._windowSize && this.flush(); }, LZMA.OutWindow.prototype.getByte = function(distance) { var pos = this._pos - distance - 1; return pos < 0 && (pos += this._windowSize), this._buffer[pos]; }, LZMA.RangeDecoder = function() {}, LZMA.RangeDecoder.prototype.setStream = function(stream) { this._stream = stream; }, LZMA.RangeDecoder.prototype.releaseStream = function() { this._stream = null; }, LZMA.RangeDecoder.prototype.init = function() { var i = 5; for (this._code = 0, this._range = -1; i--; ) this._code = this._code << 8 | this._stream.readByte(); }, LZMA.RangeDecoder.prototype.decodeDirectBits = function(numTotalBits) { for (var t, result = 0, i = numTotalBits; i--; ) this._range >>>= 1, t = this._code - this._range >>> 31, this._code -= this._range & t - 1, result = result << 1 | 1 - t, 0 == (4278190080 & this._range) && (this._code = this._code << 8 | this._stream.readByte(), this._range <<= 8); return result; }, LZMA.RangeDecoder.prototype.decodeBit = function(probs, index) { var prob = probs[index], newBound = (this._range >>> 11) * prob; return (2147483648 ^ this._code) < (2147483648 ^ newBound) ? (this._range = newBound, probs[index] += 2048 - prob >>> 5, 0 == (4278190080 & this._range) && (this._code = this._code << 8 | this._stream.readByte(), this._range <<= 8), 0) : (this._range -= newBound, this._code -= newBound, probs[index] -= prob >>> 5, 0 == (4278190080 & this._range) && (this._code = this._code << 8 | this._stream.readByte(), this._range <<= 8), 1); }, LZMA.initBitModels = function(probs, len) { for (;len--; ) probs[len] = 1024; }, LZMA.BitTreeDecoder = function(numBitLevels) { this._models = [], this._numBitLevels = numBitLevels; }, LZMA.BitTreeDecoder.prototype.init = function() { LZMA.initBitModels(this._models, 1 << this._numBitLevels); }, LZMA.BitTreeDecoder.prototype.decode = function(rangeDecoder) { for (var m = 1, i = this._numBitLevels; i--; ) m = m << 1 | rangeDecoder.decodeBit(this._models, m); return m - (1 << this._numBitLevels); }, LZMA.BitTreeDecoder.prototype.reverseDecode = function(rangeDecoder) { for (var bit, m = 1, symbol = 0, i = 0; i < this._numBitLevels; ++i) m = m << 1 | (bit = rangeDecoder.decodeBit(this._models, m)), symbol |= bit << i; return symbol; }, LZMA.reverseDecode2 = function(models, startIndex, rangeDecoder, numBitLevels) { for (var bit, m = 1, symbol = 0, i = 0; i < numBitLevels; ++i) m = m << 1 | (bit = rangeDecoder.decodeBit(models, startIndex + m)), symbol |= bit << i; return symbol; }, LZMA.LenDecoder = function() { this._choice = [], this._lowCoder = [], this._midCoder = [], this._highCoder = new LZMA.BitTreeDecoder(8), this._numPosStates = 0; }, LZMA.LenDecoder.prototype.create = function(numPosStates) { for (;this._numPosStates < numPosStates; ++this._numPosStates) this._lowCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3), this._midCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3); }, LZMA.LenDecoder.prototype.init = function() { var i = this._numPosStates; for (LZMA.initBitModels(this._choice, 2); i--; ) this._lowCoder[i].init(), this._midCoder[i].init(); this._highCoder.init(); }, LZMA.LenDecoder.prototype.decode = function(rangeDecoder, posState) { return 0 === rangeDecoder.decodeBit(this._choice, 0) ? this._lowCoder[posState].decode(rangeDecoder) : 0 === rangeDecoder.decodeBit(this._choice, 1) ? 8 + this._midCoder[posState].decode(rangeDecoder) : 16 + this._highCoder.decode(rangeDecoder); }, LZMA.Decoder2 = function() { this._decoders = []; }, LZMA.Decoder2.prototype.init = function() { LZMA.initBitModels(this._decoders, 768); }, LZMA.Decoder2.prototype.decodeNormal = function(rangeDecoder) { var symbol = 1; do { symbol = symbol << 1 | rangeDecoder.decodeBit(this._decoders, symbol); } while (symbol < 256); return 255 & symbol; }, LZMA.Decoder2.prototype.decodeWithMatchByte = function(rangeDecoder, matchByte) { var matchBit, bit, symbol = 1; do { if (matchBit = matchByte >> 7 & 1, matchByte <<= 1, symbol = symbol << 1 | (bit = rangeDecoder.decodeBit(this._decoders, (1 + matchBit << 8) + symbol)), matchBit !== bit) { for (;symbol < 256; ) symbol = symbol << 1 | rangeDecoder.decodeBit(this._decoders, symbol); break; } } while (symbol < 256); return 255 & symbol; }, LZMA.LiteralDecoder = function() {}, LZMA.LiteralDecoder.prototype.create = function(numPosBits, numPrevBits) { var i; if (!this._coders || this._numPrevBits !== numPrevBits || this._numPosBits !== numPosBits) for (this._numPosBits = numPosBits, this._posMask = (1 << numPosBits) - 1, this._numPrevBits = numPrevBits, this._coders = [], i = 1 << this._numPrevBits + this._numPosBits; i--; ) this._coders[i] = new LZMA.Decoder2; }, LZMA.LiteralDecoder.prototype.init = function() { for (var i = 1 << this._numPrevBits + this._numPosBits; i--; ) this._coders[i].init(); }, LZMA.LiteralDecoder.prototype.getDecoder = function(pos, prevByte) { return this._coders[((pos & this._posMask) << this._numPrevBits) + ((255 & prevByte) >>> 8 - this._numPrevBits)]; }, LZMA.Decoder = function() { this._outWindow = new LZMA.OutWindow, this._rangeDecoder = new LZMA.RangeDecoder, this._isMatchDecoders = [], this._isRepDecoders = [], this._isRepG0Decoders = [], this._isRepG1Decoders = [], this._isRepG2Decoders = [], this._isRep0LongDecoders = [], this._posSlotDecoder = [], this._posDecoders = [], this._posAlignDecoder = new LZMA.BitTreeDecoder(4), this._lenDecoder = new LZMA.LenDecoder, this._repLenDecoder = new LZMA.LenDecoder, this._literalDecoder = new LZMA.LiteralDecoder, this._dictionarySize = -1, this._dictionarySizeCheck = -1, this._posSlotDecoder[0] = new LZMA.BitTreeDecoder(6), this._posSlotDecoder[1] = new LZMA.BitTreeDecoder(6), this._posSlotDecoder[2] = new LZMA.BitTreeDecoder(6), this._posSlotDecoder[3] = new LZMA.BitTreeDecoder(6); }, LZMA.Decoder.prototype.setDictionarySize = function(dictionarySize) { return !(dictionarySize < 0 || (this._dictionarySize !== dictionarySize && (this._dictionarySize = dictionarySize, this._dictionarySizeCheck = Math.max(this._dictionarySize, 1), this._outWindow.create(Math.max(this._dictionarySizeCheck, 4096))), 0)); }, LZMA.Decoder.prototype.setLcLpPb = function(lc, lp, pb) { var numPosStates = 1 << pb; return !(lc > 8 || lp > 4 || pb > 4 || (this._literalDecoder.create(lp, lc), this._lenDecoder.create(numPosStates), this._repLenDecoder.create(numPosStates), this._posStateMask = numPosStates - 1, 0)); }, LZMA.Decoder.prototype.init = function() { var i = 4; for (this._outWindow.init(!1), LZMA.initBitModels(this._isMatchDecoders, 192), LZMA.initBitModels(this._isRep0LongDecoders, 192), LZMA.initBitModels(this._isRepDecoders, 12), LZMA.initBitModels(this._isRepG0Decoders, 12), LZMA.initBitModels(this._isRepG1Decoders, 12), LZMA.initBitModels(this._isRepG2Decoders, 12), LZMA.initBitModels(this._posDecoders, 114), this._literalDecoder.init(); i--; ) this._posSlotDecoder[i].init(); this._lenDecoder.init(), this._repLenDecoder.init(), this._posAlignDecoder.init(), this._rangeDecoder.init(); }, LZMA.Decoder.prototype.decode = function(inStream, outStream, outSize) { var posState, decoder2, len, distance, posSlot, numDirectBits, state = 0, rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0, nowPos64 = 0, prevByte = 0; for (this._rangeDecoder.setStream(inStream), this._outWindow.setStream(outStream), this.init(); outSize < 0 || nowPos64 < outSize; ) if (posState = nowPos64 & this._posStateMask, 0 === this._rangeDecoder.decodeBit(this._isMatchDecoders, (state << 4) + posState)) decoder2 = this._literalDecoder.getDecoder(nowPos64++, prevByte), prevByte = state >= 7 ? decoder2.decodeWithMatchByte(this._rangeDecoder, this._outWindow.getByte(rep0)) : decoder2.decodeNormal(this._rangeDecoder), this._outWindow.putByte(prevByte), state = state < 4 ? 0 : state - (state < 10 ? 3 : 6); else { if (1 === this._rangeDecoder.decodeBit(this._isRepDecoders, state)) len = 0, 0 === this._rangeDecoder.decodeBit(this._isRepG0Decoders, state) ? 0 === this._rangeDecoder.decodeBit(this._isRep0LongDecoders, (state << 4) + posState) && (state = state < 7 ? 9 : 11, len = 1) : (0 === this._rangeDecoder.decodeBit(this._isRepG1Decoders, state) ? distance = rep1 : (0 === this._rangeDecoder.decodeBit(this._isRepG2Decoders, state) ? distance = rep2 : (distance = rep3, rep3 = rep2), rep2 = rep1), rep1 = rep0, rep0 = distance), 0 === len && (len = 2 + this._repLenDecoder.decode(this._rangeDecoder, posState), state = state < 7 ? 8 : 11); else if (rep3 = rep2, rep2 = rep1, rep1 = rep0, len = 2 + this._lenDecoder.decode(this._rangeDecoder, posState), state = state < 7 ? 7 : 10, (posSlot = this._posSlotDecoder[len <= 5 ? len - 2 : 3].decode(this._rangeDecoder)) >= 4) { if (rep0 = (2 | 1 & posSlot) << (numDirectBits = (posSlot >> 1) - 1), posSlot < 14) rep0 += LZMA.reverseDecode2(this._posDecoders, rep0 - posSlot - 1, this._rangeDecoder, numDirectBits); else if (rep0 += this._rangeDecoder.decodeDirectBits(numDirectBits - 4) << 4, (rep0 += this._posAlignDecoder.reverseDecode(this._rangeDecoder)) < 0) { if (-1 === rep0) break; return !1; } } else rep0 = posSlot; if (rep0 >= nowPos64 || rep0 >= this._dictionarySizeCheck) return !1; this._outWindow.copyBlock(rep0, len), nowPos64 += len, prevByte = this._outWindow.getByte(0); } return this._outWindow.flush(), this._outWindow.releaseStream(), this._rangeDecoder.releaseStream(), !0; }, LZMA.Decoder.prototype.setDecoderProperties = function(properties) { var value, lc, lp, pb, dictionarySize; return !(properties.size < 5) && (lc = (value = properties.readByte()) % 9, lp = (value = ~~(value / 9)) % 5, pb = ~~(value / 5), !!this.setLcLpPb(lc, lp, pb) && (dictionarySize = properties.readByte(), dictionarySize |= properties.readByte() << 8, dictionarySize |= properties.readByte() << 16, dictionarySize += 16777216 * properties.readByte(), this.setDictionarySize(dictionarySize))); }, LZMA.decompress = function(properties, inStream, outStream, outSize) { var decoder = new LZMA.Decoder; if (!decoder.setDecoderProperties(properties)) throw "Incorrect stream properties"; if (!decoder.decode(inStream, outStream, outSize)) throw "Error in data stream"; return !0; }, LZMA.decompressFile = function(inStream, outStream) { var outSize, decoder = new LZMA.Decoder; if (!decoder.setDecoderProperties(inStream)) throw "Incorrect stream properties"; if (outSize = inStream.readByte(), outSize |= inStream.readByte() << 8, outSize |= inStream.readByte() << 16, outSize += 16777216 * inStream.readByte(), inStream.readByte(), inStream.readByte(), inStream.readByte(), inStream.readByte(), !decoder.decode(inStream, outStream, outSize)) throw "Error in data stream"; return !0; }, module.exports = LZMA; }, function(module, exports, __webpack_require__) { const needle = __webpack_require__(73), getContentLength = __webpack_require__(1288); module.exports = async function(url, lengths, isLast) { return new Promise((async (resolve, reject) => { let contentLength = !1; "object" == typeof url && (contentLength = url.bytes, url = url.url); let fileName = url.split("/").pop(); if ((fileName || "").includes(".") ? (fileName = decodeURIComponent(fileName), fileName.includes("?") && (fileName = fileName.split("?")[0])) : fileName = "archive.7z", !contentLength) if (lengths.length > 1 && lengths[0] === lengths[1] && !isLast) contentLength = lengths[0]; else try { contentLength = await getContentLength(url); } catch (e) { return console.error(e), void reject(e); } resolve({ length: parseInt(contentLength), name: fileName, createReadStream: range => { const opts = { follow_max: 5, rejectUnauthorized: !1 }; return Object.values(range).length && (range.start = range.start || 0, range.end = range.end || 0, (range.end > contentLength - 1 || 0 === range.end) && (range.end = ""), opts.headers = { range: `bytes=${range.start}-${range.end}` }), needle.get(url, opts); } }); })); }; }, function(module, exports, __webpack_require__) { const request = __webpack_require__(61); module.exports = async function(url) { return new Promise(((resolve, reject) => { const req = request({ url: url, followRedirect: !0, maxRedirects: 5, strictSSL: !1 }); req.on("response", (function(d) { req.abort(), d.headers["content-length"] ? resolve(d.headers["content-length"]) : reject("Could not retrieve content-length from ranged request"); })).on("error", reject); })); }; }, function(module, exports, __webpack_require__) { const mime = __webpack_require__(45); module.exports = function(rarInnerFile) { return mime.lookup(rarInnerFile.name) || "application/octet-stream"; }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(169), parseQuery = __webpack_require__(277), cryptojs = __webpack_require__(6), ee = __webpack_require__(4), lzDecompress = __webpack_require__(77).decompressFromEncodedURIComponent, initEmitter = new ee; module.exports = { createKey: function(archiveType, orderRegex, orderDefault, req, res) { function storeDataToKey(arr, newKey) { if (newKey && null !== store.get(newKey)) return newKey; arr = arr.map((el => Array.isArray(el) ? !!el[0] && (el[1] ? { url: el[0], bytes: el[1] } : { url: el[0] }) : el)).filter((el => !!el)), orderRegex && (arr = arr.sort(((first, second) => { const firstMatch = ((first || {}).url || first || "").split("?")[0].match(orderRegex), secondMatch = ((second || {}).url || second || "").split("?")[0].match(orderRegex); return +(firstMatch && firstMatch[1] || orderDefault || 0) - +(secondMatch && secondMatch[1] || orderDefault || 0); }))); const key = store.set(arr, newKey); return initEmitter.emit(key), key; } if ("POST" === req.method) { if (!Array.isArray(req.body)) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 1"); const key = storeDataToKey(req.body, req.params.createKey); res.setHeader("Content-Length", JSON.stringify({ key: key }).length + ""), res.setHeader("Content-Type", "application/json"), res.end(JSON.stringify({ key: key })); } else { if (!req.query.lz) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 2"); let lzData = !1; try { lzData = JSON.parse(lzDecompress(req.query.lz)); } catch (e) {} if (!lzData || !lzData.urls || !lzData.urls.length) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 3"); const hashKey = (txt = req.query.lz, cryptojs.createHash("sha256").update(txt).digest("hex")); storeDataToKey(lzData.urls, hashKey), opts = (function(lzData) { let opts = {}; return lzData.fileMustInclude && (opts.fileMustInclude = lzData.fileMustInclude), lzData.maxFiles && lzData.maxFiles > 0 && (opts.maxFiles = lzData.maxFiles), lzData.fileIdx && lzData.fileIdx > -1 && (opts.fileIdx = lzData.fileIdx), !!Object.keys(opts).length && opts; })(lzData), res.statusCode = 302, res.setHeader("Location", `/${archiveType}/stream?key=${hashKey}` + (opts ? "&o=" + encodeURIComponent(JSON.stringify(opts)) : "")), res.end(); } var txt; }, waitForKey: function(req) { return new Promise(((resolve, reject) => { const key = parseQuery(req).query.key; key ? null === store.get(key) ? initEmitter.addListener(key, (function gotData() { initEmitter.removeListener(key, gotData), resolve(); })) : resolve() : reject(Error("No stream key provided")); })); } }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(170), getRouter = __webpack_require__(1292), getTarStream = __webpack_require__(562); module.exports = { router: getRouter, create: tarUrls => { if (!tarUrls || !Array.isArray(tarUrls)) throw Error('"tarUrls" is undefined or not an array'); return store.set(tarUrls); }, file: async (key, opts) => { if (!key) throw Error('Missing "key"'); const file = await getTarStream({ url: key, query: { o: JSON.stringify(opts || {}), key: key } }); return file.createReadStream = () => file.stream(), file; } }; }, function(module, exports, __webpack_require__) { const getContentType = __webpack_require__(1293), getTarStream = __webpack_require__(562), bodyParser = __webpack_require__(50), Router = __webpack_require__(108), store = __webpack_require__(170), parseQuery = __webpack_require__(278), keyHandler = (new (__webpack_require__(4)), __webpack_require__(1297)), orderRegex = /\.TAR\.(\d\d?\d?\d?\d?)$/i; module.exports = function() { const router = Router(); router.use(bodyParser.json()), router.post("/create/:createKey", keyHandler.createKey.bind(null, "tar", orderRegex, 0)), router.all("/create", keyHandler.createKey.bind(null, "tar", orderRegex, 0)); const fileVars = {}; return router.get("/stream", (async (req, res) => { try { await keyHandler.waitForKey(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } let file, contentLength; const parsed = parseQuery(req), key = parsed.query.key; if (!fileVars[key]) { try { file = await getTarStream(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } if (!file) { const errMsg = "There was an error with the tar parser."; return console.error(Error(errMsg)), res.statusCode = 500, void res.end(errMsg); } contentLength = file.header.size, fileVars[key] = { offset: file.header.dataOffset, size: file.header.size, filename: file.header.name, innerFile: file._source }; } const offset = fileVars[key].offset, size = fileVars[key].size, filename = fileVars[key].filename; let url = !1; const tarUrls = store.get(key); if (tarUrls) url = tarUrls[0]; else { if (!parsed.query.r) return res.statusCode = 500, void res.end(); url = parsed.query.r; } if ("OPTIONS" === req.method && req.headers["access-control-request-headers"]) return res.writeHead(200, { "Access-Control-Allow-Origin": req.headers.origin, "Access-Control-Allow-Methods": "POST, GET, OPTIONS", "Access-Control-Allow-Headers": req.headers["access-control-request-headers"], "Access-Control-Max-Age": "1728000" }), res.end(); const range = req.headers.range || null, mimeType = getContentType({ name: filename }); let start = null, end = null; if (range) { let parts = range.replace(/bytes=/, "").split("-"); if (start = parts[0], end = parts[1], start = parseInt(start, 10), end = end ? parseInt(end, 10) : size - 1, !isNaN(start) && isNaN(end) && (end = size - 1), isNaN(start) && !isNaN(end) && (start = size - end, end = size - 1), start >= size || end >= size || start < 0 || end < 0) return res.writeHead(416, { "Content-Range": `bytes */${size}` }), res.end(); if (res.writeHead(206, { "Access-Control-Allow-Origin": req.headers.origin || "*", "Content-Range": `bytes ${start}-${end}/${size}`, "Accept-Ranges": "bytes", "Content-Length": end - start + 1 + "", "Content-Type": mimeType, "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" }), "HEAD" === req.method) return res.end(); } else if (res.writeHead(200, { "Access-Control-Allow-Origin": req.headers.origin || "*", "Content-Length": size + "", "Content-Type": mimeType, "Accept-Ranges": "bytes", "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" }), "HEAD" === req.method) return res.end(); url.url; let rangeStart = 0, rangeEnd = size; start || end ? (rangeStart = start + offset, rangeEnd = end + offset) : (rangeStart = offset, rangeEnd = size + offset); let stream = null; try { stream = await fileVars[key].innerFile.createReadStream({ start: rangeStart, end: rangeEnd }); } catch (e) { return console.error(e), res.statusCode = 500, void res.end((e || {}).message || "Unknown error with tar parser"); } stream.pipe(res); })), router; }; }, function(module, exports, __webpack_require__) { const mime = __webpack_require__(45); module.exports = function(rarInnerFile) { return mime.lookup(rarInnerFile.name) || "application/octet-stream"; }; }, function(module, exports, __webpack_require__) { "use strict"; const util = __webpack_require__(0), events = __webpack_require__(4), stream = __webpack_require__(3); function overflow(size) { return (size &= 511) && 512 - size; } function safeAdd(a, b) { var res = a + b; if (res > Number.MAX_SAFE_INTEGER) throw new Error("Integer overflow in tar stream"); return res; } function BufferList() { this.buffered = 0, this.shifted = 0, this.buffers = [], this._offset = 0; } function createRangeStream(source, opts) { opts || (opts = {}); var start = opts.start || 0, end = "number" == typeof opts.end ? opts.end : source.length - 1, readable = new stream.Readable({ objectMode: !1, highWaterMark: 524288 }), position = start, currentStream = null, pendingChunks = [], isReading = !1, isDestroyed = !1; async function startReading() { if (!(isReading || position >= end)) { isReading = !0; var remaining, readSize = (remaining = end - position) <= 0 ? 0 : remaining < 65536 ? remaining : Math.min(remaining, 524288); if (0 === readSize) return isReading = !1, void readable.push(null); var readEnd = safeAdd(position, readSize), readOpts = { start: position, end: readEnd }; currentStream && currentStream.removeAllListeners(), (currentStream = await source.createReadStream(readOpts)).on("data", (function(chunk) { position = safeAdd(position, chunk.length), pendingChunks.push(chunk); })).on("end", (function() { currentStream = null, isReading = !1, processPendingChunks(), position < end && !1 !== readable._readableState.flowing ? process.nextTick(startReading) : position >= end && 0 === pendingChunks.length && readable.push(null); })).on("error", (function(err) { currentStream = null, isReading = !1, readable.emit("error", err); })); } } function processPendingChunks() { for (;pendingChunks.length > 0; ) { var chunk = pendingChunks.shift(); if (!readable.push(chunk)) break; } } return readable.isPaused = function() { return !1 === this._readableState.flowing; }, readable.destroy = function(err) { if (!isDestroyed) return isDestroyed = !0, currentStream && ("function" == typeof currentStream.destroy && currentStream.destroy(), currentStream.removeAllListeners(), currentStream = null), pendingChunks = [], err && this.emit("error", err), this.emit("close"), this; }, readable._read = function() { processPendingChunks(), 0 !== pendingChunks.length || isReading || startReading(); }, readable; } function Entry(header, offset, source) { stream.Readable.call(this, { objectMode: !1 }), this.header = header, this.offset = offset, this.dataOffset = header.dataOffset, this._source = source; } function TarReader(source) { if (!(this instanceof TarReader)) return new TarReader(source); if (events.EventEmitter.call(this), !source || "function" != typeof source.createReadStream) throw new Error("Source must have a createReadStream method"); this._source = source, this._position = 0, this._buffer = new BufferList, this._currentHeader = null, this._currentEntry = null, this._missing = 0, this._longHeader = !1, this._locked = !1, this._finished = !1, this._pax = null, this._paxGlobal = null, this._gnuLongPath = null, this._gnuLongLinkPath = null, this._filenameEncoding = "utf8", this._allowUnknownFormat = !1, this._stream = null, this._reading = !1, this._ended = !1; var self = this; process.nextTick((async function() { await self._start(); })); } BufferList.prototype.push = function(buffer) { this.buffered = safeAdd(this.buffered, buffer.length), this.buffers.push(buffer); }, BufferList.prototype.shiftFirst = function(size) { return 0 === this.buffered ? null : this._next(size); }, BufferList.prototype.shift = function(size) { if (size > this.buffered) return null; if (0 === size) return Buffer.alloc(0); var chunk = this._next(size); if (size === chunk.length) return chunk; for (var chunks = [ chunk ], totalSize = chunk.length; (size -= chunk.length) > 0; ) totalSize = safeAdd(totalSize, (chunk = this._next(size)).length), chunks.push(chunk); return Buffer.concat(chunks, totalSize); }, BufferList.prototype._next = function(size) { var buf = this.buffers[0], rem = buf.length - this._offset; if (size >= rem) { var sub = this._offset ? buf.slice(this._offset) : buf; return this.buffers.shift(), this._offset = 0, this.buffered -= rem, this.shifted = safeAdd(this.shifted, rem), sub; } this.buffered -= size, this.shifted = safeAdd(this.shifted, size); var result = buf.slice(this._offset, this._offset + size); return this._offset += size, result; }, util.inherits(Entry, stream.Readable), Entry.prototype._read = async function() { if (this._readStream) this._readStream.resume(); else { if (0 === this.header.size) return void this.push(null); var dataOffset = this.dataOffset, dataEnd = safeAdd(dataOffset, this.header.size); this._readStream = await createRangeStream(this._source, { start: dataOffset, end: dataEnd }); var self = this; this._readStream.on("data", (function(chunk) { self.push(chunk) || self._readStream.pause(); })), this._readStream.on("end", (function() { self.push(null); })), this._readStream.on("error", (function(err) { self.emit("error", err); })); } }, Entry.prototype.createReadStream = function(file, opts) { opts || (opts = {}); var relativeStart = opts.start || 0, relativeEnd = "number" == typeof opts.end ? opts.end : file.header.size; relativeStart < 0 && (relativeStart = 0), relativeEnd > file.header.size && (relativeEnd = file.header.size); var absoluteStart = safeAdd(file.dataOffset, relativeStart), absoluteEnd = safeAdd(file.dataOffset, relativeEnd); return createRangeStream(file._source, { start: absoluteStart, end: absoluteEnd }); }, util.inherits(TarReader, events.EventEmitter), TarReader.prototype._destroy = function() { this._stream && (this._stream.destroy(), this._stream = null), this._buffer = new BufferList, this._currentHeader = null, this._currentEntry = null, this._missing = 0, this._longHeader = !1, this._locked = !1, this._finished = !0, this._ended = !0; }, TarReader.prototype._initStream = async function(startPosition) { var self = this; self._stream = await createRangeStream(self._source, { start: startPosition }), self._stream.on("data", (function(chunk) { self._buffer.push(chunk), self._position = safeAdd(self._position, chunk.length), self._locked ? self._stream.pause() : self._update(); })), self._stream.on("end", (function() { self._ended = !0, self._checkEnd(); })), self._stream.on("error", (function(err) { self.emit("error", err); })); }, TarReader.prototype._start = async function() { await this._initStream(0); }, TarReader.prototype._checkEnd = function() { if (this._ended && !this._reading && 0 === this._buffer.buffered) { if (this._locked) return; this.emit("finish"); } }, TarReader.prototype._unlock = function(err) { if (this._locked = !1, err) this.emit("error", err); else { var self = this; process.nextTick((function() { if (self._currentHeader && self._currentHeader.size > 0) { var headerOffset = self._currentHeader.offset, entrySize = self._currentHeader.size, remainder = entrySize % 512, padding = remainder > 0 ? 512 - remainder : 0, nextHeaderPosition = headerOffset + 512 + entrySize; padding > 0 && (nextHeaderPosition += padding), nextHeaderPosition % 512 != 0 && (nextHeaderPosition = 512 * Math.ceil(nextHeaderPosition / 512)), self._buffer = new BufferList, self._missing = 0, self._position = nextHeaderPosition, self._currentHeader = null, self._currentEntry = null, self._stream && (self._stream.removeAllListeners("data"), self._stream.removeAllListeners("end"), self._stream.removeAllListeners("error"), "function" == typeof self._stream.destroy && self._stream.destroy(), self._stream = null), self._initStream(nextHeaderPosition); } else self._stream && self._stream.isPaused && self._stream.isPaused() && self._stream.resume(), self._update(); self._checkEnd(); })); } }, TarReader.prototype._update = function() { if (!this._reading) { this._reading = !0; for (var continueReading = !0; continueReading && this._buffer.buffered > 0; ) if (this._missing > 0) { if (null !== this._currentEntry) { continueReading = this._consumeEntryData(); continue; } if (!0 === this._longHeader) { if (this._missing > this._buffer.buffered) break; continueReading = this._consumeLongHeader(); continue; } var ignore = this._buffer.shiftFirst(Math.min(this._missing, this._buffer.buffered)); null !== ignore && (this._missing -= ignore.length); } else { if (this._buffer.buffered < 512) break; null === this._currentEntry && !1 !== this._consumeHeader() || (continueReading = !1); } this._reading = !1, this._checkEnd(); } }, TarReader.prototype._getAbsolutePosition = function() { return this._position - this._buffer.buffered + this._buffer.shifted; }, TarReader.prototype._consumeHeader = function() { if (this._locked) return !1; var headerBuf = this._buffer.shift(512); if (!headerBuf) return !1; for (var currentHeaderPosition = this._buffer.shifted - 512, absolutePosition = this._getAbsolutePosition() - 512, empty = !0, i = 0; i < 512; i++) if (0 !== headerBuf[i]) { empty = !1; break; } if (empty) return this._missing = 0, !0; try { this._currentHeader = (function(buf, filenameEncoding, allowUnknownFormat) { var typeflag = 0 === buf[156] ? 0 : buf[156] - ZERO_OFFSET, name = decodeStr(buf, 0, 100, filenameEncoding), mode = decodeOct(buf, 100, 8), uid = decodeOct(buf, 108, 8), gid = decodeOct(buf, 116, 8), size = decodeOct(buf, 124, 12), mtime = decodeOct(buf, 136, 12), type = (function(flag) { switch (flag) { case 0: return "file"; case 1: return "link"; case 2: return "symlink"; case 3: return "character-device"; case 4: return "block-device"; case 5: return "directory"; case 6: return "fifo"; case 7: return "contiguous-file"; case 72: return "pax-header"; case 55: return "pax-global-header"; case 27: return "gnu-long-link-path"; case 28: case 30: return "gnu-long-path"; } return null; })(typeflag), linkname = 0 === buf[157] ? null : decodeStr(buf, 157, 100, filenameEncoding), uname = decodeStr(buf, 265, 32), gname = decodeStr(buf, 297, 32), devmajor = decodeOct(buf, 329, 8), devminor = decodeOct(buf, 337, 8), c = (function(block) { for (var sum = 256, i = 0; i < 148; i++) sum += block[i]; for (var j = 156; j < 512; j++) sum += block[j]; return sum; })(buf); if (256 === c) return null; if (c !== decodeOct(buf, 148, 8)) throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?"); if ((function(buf) { for (var i = 0; i < 6; i++) if (buf[257 + i] !== USTAR_MAGIC[i]) return !1; return !0; })(buf)) buf[345] && (name = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name); else if ((function(buf) { for (var i = 0; i < 6; i++) if (buf[257 + i] !== GNU_MAGIC[i]) return !1; for (var j = 0; j < 2; j++) if (buf[263 + j] !== GNU_VER[j]) return !1; return !0; })(buf)) ; else if (!allowUnknownFormat) throw new Error("Invalid tar header: unknown format."); return 0 === typeflag && name && "/" === name[name.length - 1] && (typeflag = 5), { name: name, mode: mode, uid: uid, gid: gid, size: size, mtime: new Date(1e3 * mtime), type: type, linkname: linkname, uname: uname, gname: gname, devmajor: devmajor, devminor: devminor, pax: null }; })(headerBuf, this._filenameEncoding, this._allowUnknownFormat); } catch (err) { return this.emit("error", err), !1; } if (!this._currentHeader) return !0; switch (this._currentHeader.type) { case "gnu-long-path": case "gnu-long-link-path": case "pax-global-header": case "pax-header": return this._longHeader = !0, this._missing = this._currentHeader.size, !0; } this._locked = !0, this._applyLongHeaders(); var entryPosition = currentHeaderPosition; if (safeAdd(entryPosition, 512), this._currentHeader.offset = entryPosition, this._currentHeader.dataOffset = absolutePosition, 0 === this._currentHeader.size || "directory" === this._currentHeader.type) { var entry = new Entry(this._currentHeader, entryPosition, this._source); this._currentEntry = null; var self = this; return this._stream && this._stream.pause(), this.emit("entry", this._currentHeader, entry, (function(err) { self._unlock(err); })), !0; } return this._currentEntry = new Entry(this._currentHeader, entryPosition, this._source), this._missing = this._currentHeader.size, self = this, this._stream && this._stream.pause(), this.emit("entry", this._currentHeader, this._currentEntry, (function(err) { self._unlock(err); })), !1; }, TarReader.prototype._consumeEntryData = function() { var skipSize = Math.min(this._missing, this._buffer.buffered); if (this._buffer.shift(skipSize), this._missing -= skipSize, 0 === this._missing) { var padding = overflow(this._currentHeader.size); if (padding > 0) { var paddingToSkip = Math.min(padding, this._buffer.buffered); this._buffer.shift(paddingToSkip), this._missing = padding - paddingToSkip; } if (0 === this._missing) return this._currentEntry = null, !0; } return this._buffer.buffered > 0; }, TarReader.prototype._consumeLongHeader = function() { this._longHeader = !1, this._missing = overflow(this._currentHeader.size); var buf = this._buffer.shift(this._currentHeader.size); try { this._decodeLongHeader(buf); } catch (err) { return this.emit("error", err), !1; } return !0; }, TarReader.prototype._applyLongHeaders = function() { this._gnuLongPath && (this._currentHeader.name = this._gnuLongPath, this._gnuLongPath = null), this._gnuLongLinkPath && (this._currentHeader.linkname = this._gnuLongLinkPath, this._gnuLongLinkPath = null), this._pax && (this._pax.path && (this._currentHeader.name = this._pax.path), this._pax.linkpath && (this._currentHeader.linkname = this._pax.linkpath), this._pax.size && (this._currentHeader.size = parseInt(this._pax.size, 10)), this._currentHeader.pax = this._pax, this._pax = null); }, TarReader.prototype._decodeLongHeader = function(buf) { switch (this._currentHeader.type) { case "gnu-long-path": this._gnuLongPath = decodeLongPath(buf, this._filenameEncoding); break; case "gnu-long-link-path": this._gnuLongLinkPath = decodeLongPath(buf, this._filenameEncoding); break; case "pax-global-header": this._paxGlobal = decodePax(buf); break; case "pax-header": this._pax = null === this._paxGlobal ? decodePax(buf) : Object.assign({}, this._paxGlobal, decodePax(buf)); } }; const ZERO_OFFSET = "0".charCodeAt(0), USTAR_MAGIC = new Buffer([ 117, 115, 116, 97, 114, 0 ]), GNU_MAGIC = (new Buffer([ ZERO_OFFSET, ZERO_OFFSET ]), new Buffer([ 117, 115, 116, 97, 114, 32 ])), GNU_VER = new Buffer([ 32, 0 ]); function decodeLongPath(buf, encoding) { return decodeStr(buf, 0, buf.length, encoding); } function decodePax(buf) { for (var result = {}, i = 0; i < buf.length; ) { for (var start = i; i < buf.length && 32 !== buf[i]; ) i++; var len = parseInt(buf.slice(start, i).toString(), 10); if (!len) return result; i++; var pair = buf.slice(i, start + len - 1).toString(), keyIndex = pair.indexOf("="); if (-1 === keyIndex) return result; result[pair.slice(0, keyIndex)] = pair.slice(keyIndex + 1), i = start + len; } return result; } function indexOf(block, num, offset, end) { for (;offset < end; offset++) if (block[offset] === num) return offset; return end; } function decodeOct(val, offset, length) { if (128 & (val = val.slice(offset, offset + length))[offset = 0]) return (function(buf) { var positive; if (128 === buf[0]) positive = !0; else { if (255 !== buf[0]) return null; positive = !1; } var i, tuple = []; for (i = buf.length - 1; i > 0; i--) { var byte = buf[i]; positive ? tuple.push(byte) : tuple.push(255 - byte); } var sum = 0, l = tuple.length; for (i = 0; i < l; i++) { var power = Math.pow(256, i); if (isFinite(power)) sum += tuple[i] * power; else { for (var curr = tuple[i], j = 0; j < i; j++) if (curr *= 256, !isFinite(curr)) return positive ? Number.MAX_SAFE_INTEGER : -Number.MAX_SAFE_INTEGER; sum += curr; } if (!isFinite(sum)) return positive ? Number.MAX_SAFE_INTEGER : -Number.MAX_SAFE_INTEGER; } return positive ? sum : -1 * sum; })(val); for (;offset < val.length && 32 === val[offset]; ) offset++; for (var end = (index = indexOf(val, 32, offset, val.length), len = val.length, defaultValue = val.length, "number" != typeof index ? defaultValue : (index = ~~index) >= len ? len : index >= 0 || (index += len) >= 0 ? index : 0); offset < end && 0 === val[offset]; ) offset++; return end === offset ? 0 : parseInt(val.slice(offset, end).toString(), 8); var index, len, defaultValue; } function decodeStr(val, offset, length, encoding) { return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding); } module.exports = TarReader; }, function(module, exports, __webpack_require__) { const needle = __webpack_require__(73), getContentLength = __webpack_require__(1296); module.exports = async function(url, lengths) { return new Promise((async (resolve, reject) => { let contentLength = !1; "object" == typeof url && (contentLength = url.bytes, url = url.url); let fileName = url.split("/").pop(); if ((fileName || "").includes(".") ? (fileName = decodeURIComponent(fileName), fileName.includes("?") && (fileName = fileName.split("?")[0])) : fileName = "archive.tar", !contentLength) if (lengths.length > 1 && !fileName.match(/\.tar$/i) && lengths[0] === lengths[1]) contentLength = lengths[0]; else try { contentLength = await getContentLength(url), contentLength = parseInt(contentLength); } catch (e) { return console.error(e), void reject(e); } resolve({ length: contentLength, name: fileName, createReadStream: range => { const opts = { follow_max: 5, rejectUnauthorized: !1 }; return Object.values(range).length && (range.start = range.start || 0, range.end = range.end || 0, (range.end > contentLength - 1 || 0 === range.end) && (range.end = ""), opts.headers = { range: `bytes=${range.start}-${range.end}` }), needle.get(url, opts); } }); })); }; }, function(module, exports, __webpack_require__) { const request = __webpack_require__(61); module.exports = async function(url) { return new Promise(((resolve, reject) => { const req = request({ url: url, followRedirect: !0, maxRedirects: 5, strictSSL: !1 }); req.on("response", (function(d) { req.abort(), d.headers["content-length"] ? resolve(d.headers["content-length"]) : reject("Could not retrieve content-length from ranged request"); })).on("error", reject); })); }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(170), parseQuery = __webpack_require__(278), cryptojs = __webpack_require__(6), ee = __webpack_require__(4), lzDecompress = __webpack_require__(77).decompressFromEncodedURIComponent, initEmitter = new ee; module.exports = { createKey: function(archiveType, orderRegex, orderDefault, req, res) { function storeDataToKey(arr, newKey) { if (newKey && null !== store.get(newKey)) return newKey; arr = arr.map((el => Array.isArray(el) ? !!el[0] && (el[1] ? { url: el[0], bytes: el[1] } : { url: el[0] }) : el)).filter((el => !!el)), orderRegex && (arr = arr.sort(((first, second) => { const firstMatch = ((first || {}).url || first || "").split("?")[0].match(orderRegex), secondMatch = ((second || {}).url || second || "").split("?")[0].match(orderRegex); return +(firstMatch && firstMatch[1] || orderDefault || 0) - +(secondMatch && secondMatch[1] || orderDefault || 0); }))); const key = store.set(arr, newKey); return initEmitter.emit(key), key; } if ("POST" === req.method) { if (!Array.isArray(req.body)) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 1"); const key = storeDataToKey(req.body, req.params.createKey); res.setHeader("Content-Length", JSON.stringify({ key: key }).length + ""), res.setHeader("Content-Type", "application/json"), res.end(JSON.stringify({ key: key })); } else { if (!req.query.lz) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 2"); let lzData = !1; try { lzData = JSON.parse(lzDecompress(req.query.lz)); } catch (e) {} if (!lzData || !lzData.urls || !lzData.urls.length) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 3"); const hashKey = (txt = req.query.lz, cryptojs.createHash("sha256").update(txt).digest("hex")); storeDataToKey(lzData.urls, hashKey), opts = (function(lzData) { let opts = {}; return lzData.fileMustInclude && (opts.fileMustInclude = lzData.fileMustInclude), lzData.maxFiles && lzData.maxFiles > 0 && (opts.maxFiles = lzData.maxFiles), lzData.fileIdx && lzData.fileIdx > -1 && (opts.fileIdx = lzData.fileIdx), !!Object.keys(opts).length && opts; })(lzData), res.statusCode = 302, res.setHeader("Location", `/${archiveType}/stream?key=${hashKey}` + (opts ? "&o=" + encodeURIComponent(JSON.stringify(opts)) : "")), res.end(); } var txt; }, waitForKey: function(req) { return new Promise(((resolve, reject) => { const key = parseQuery(req).query.key; key ? null === store.get(key) ? initEmitter.addListener(key, (function gotData() { initEmitter.removeListener(key, gotData), resolve(); })) : resolve() : reject(Error("No stream key provided")); })); } }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(171), getRouter = __webpack_require__(1299), getTarStream = __webpack_require__(563); module.exports = { router: getRouter, create: tarUrls => { if (!tarUrls || !Array.isArray(tarUrls)) throw Error('"tarUrls" is undefined or not an array'); return store.set(tarUrls); }, file: async (key, opts) => { if (!key) throw Error('Missing "key"'); const file = await getTarStream({ url: key, query: { o: JSON.stringify(opts || {}), key: key } }); return file.createReadStream = () => file.stream(), file; } }; }, function(module, exports, __webpack_require__) { const getContentType = __webpack_require__(1300), getTarStream = __webpack_require__(563), bodyParser = __webpack_require__(50), Router = __webpack_require__(108), parseQuery = (__webpack_require__(171), __webpack_require__(279)), stream = __webpack_require__(3), ee = __webpack_require__(4), keyHandler = __webpack_require__(1304), orderRegex = /\.(\d\d?\d?\d?\d?)$/i; module.exports = function() { const router = Router(); return router.use(bodyParser.json()), router.post("/create/:createKey", keyHandler.createKey.bind(null, "tgz", orderRegex, 0)), router.all("/create", keyHandler.createKey.bind(null, "tgz", orderRegex, 0)), router.get("/stream", (async (req, res) => { try { await keyHandler.waitForKey(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } let file; parseQuery(req).query.key; try { file = await getTarStream(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } if (!file) { const errMsg = "There was an error with the gzip parser."; return console.error(Error(errMsg)), res.statusCode = 500, void res.end(errMsg); } const contentLength = file._fileSize || 0, filename = file._filename || "video"; if (((req || {}).headers || {}).range) if (contentLength) { if ("bytes=0-" !== req.headers.range && req.headers.range !== "bytes=0-" + (contentLength - 1)) return res.statusCode = 405, void res.end(); } else if ("bytes=0-" !== req.headers.range) return res.statusCode = 405, void res.end(); if ("HEAD" === req.method) return res.statusCode = 204, contentLength && res.setHeader("Content-Length", contentLength + ""), res.setHeader("Content-Type", "video" !== filename ? getContentType({ name: filename }) : "application/octet-stream"), res.setHeader("Accept-Ranges", "none"), void res.end(); if (res.statusCode = 200, res.setHeader("Content-Type", "video" !== filename ? getContentType({ name: filename }) : "application/octet-stream"), contentLength && res.setHeader("Content-Length", contentLength), res.setHeader("Accept-Ranges", "none"), req.on("close", (function() { file.destroy ? file.destroy() : file.unpipe && file.unpipe(); })), file.unlockStream) { const evEmitter = new ee; let chunkBuffer = Buffer.alloc(0), bufferSize = 0; file.on("data", (function(chunk) { bufferSize += chunk.length, chunkBuffer = Buffer.concat([ chunkBuffer, chunk ], bufferSize), evEmitter.emit("chunk"), 31457280 > bufferSize && file.lockStream(); })); let stopped = !1; const readable = new stream.Readable; readable._read = async () => { if (stopped) readable.push(null); else { let data = null; try { data = await (async function() { return new Promise(((resolve, reject) => { function answerBuffer(chkBuffer) { resolve(chkBuffer), chunkBuffer = Buffer.alloc(0), bufferSize = 0, file.unlockStream(); } bufferSize ? answerBuffer(chunkBuffer) : (file.unlockStream(), evEmitter.addListener("chunk", (function chunked() { answerBuffer(chunkBuffer), evEmitter.removeListener("chunk", chunked); }))); })); })(); } catch (e) { return console.error(e), void (readable.destroy ? readable.destroy() : (readable.unpipe && readable.unpipe(), readable._destroy && readable._destroy())); } readable.push(data); } }, readable._destroy = () => { stopped = !0; }, readable.pipe(res).on("error", (err => { console.log("pipeline error", err), readable.destroy ? readable.destroy() : (readable.unpipe && readable.unpipe(), readable._destroy && readable._destroy()); })), file.unlockStream(); } else file.pipe(res); })), router; }; }, function(module, exports, __webpack_require__) { const mime = __webpack_require__(45); module.exports = function(rarInnerFile) { return mime.lookup(rarInnerFile.name) || "application/octet-stream"; }; }, function(module, exports, __webpack_require__) { "use strict"; const util = __webpack_require__(0), events = __webpack_require__(4), stream = __webpack_require__(3); function overflow(size) { return (size &= 511) && 512 - size; } function safeAdd(a, b) { var res = a + b; if (res > Number.MAX_SAFE_INTEGER) throw new Error("Integer overflow in tar stream"); return res; } function BufferList() { this.buffered = 0, this.shifted = 0, this.buffers = [], this._offset = 0; } function EntryStream(entry) { stream.Readable.call(this, { objectMode: !1 }), this._entry = entry, this._buffer = new BufferList, this._needBytes = entry.header.size, this._destroyed = !1, this._finished = !1, this._onData = chunk => { this.write(chunk); }, this._onEnd = () => { this.end(); }, this._entry.on("data", this._onData), this._entry.on("end", this._onEnd); } function Entry(header) { stream.PassThrough.call(this, { objectMode: !1 }), this.header = header, this._needBytes = this.header.size, this._destroyed = !1; } function TarReader(inputStream) { if (!(this instanceof TarReader)) return new TarReader(inputStream); if (events.EventEmitter.call(this), !inputStream || "function" != typeof inputStream.on || "function" != typeof inputStream.pause || "function" != typeof inputStream.resume) throw new Error("Input must be a readable stream"); this._stream = inputStream, this._position = 0, this._buffer = new BufferList, this._currentHeader = null, this._currentEntry = null, this._missing = 0, this._longHeader = !1, this._locked = !1, this._finished = !1, this._pax = null, this._paxGlobal = null, this._gnuLongPath = null, this._gnuLongLinkPath = null, this._filenameEncoding = "utf8", this._allowUnknownFormat = !1, this._paused = !1, this._reading = !1, this._ended = !1, this._destroyed = !1; var self = this; process.nextTick((function() { self._start(); })); } BufferList.prototype.push = function(buffer) { this.buffered = safeAdd(this.buffered, buffer.length), this.buffers.push(buffer); }, BufferList.prototype.shiftFirst = function(size) { return 0 === this.buffered ? null : this._next(size); }, BufferList.prototype.shift = function(size) { if (size > this.buffered) return null; if (0 === size) return Buffer.alloc(0); var chunk = this._next(size); if (size === chunk.length) return chunk; for (var chunks = [ chunk ], totalSize = chunk.length; (size -= chunk.length) > 0; ) totalSize = safeAdd(totalSize, (chunk = this._next(size)).length), chunks.push(chunk); return Buffer.concat(chunks, totalSize); }, BufferList.prototype._next = function(size) { var buf = this.buffers[0], rem = buf.length - this._offset; if (size >= rem) { var sub = this._offset ? buf.slice(this._offset) : buf; return this.buffers.shift(), this._offset = 0, this.buffered -= rem, this.shifted = safeAdd(this.shifted, rem), sub; } this.buffered -= size, this.shifted = safeAdd(this.shifted, size); var result = buf.slice(this._offset, this._offset + size); return this._offset += size, result; }, util.inherits(EntryStream, stream.Readable), EntryStream.prototype._read = function(size) { if (!this._destroyed) { if (this._buffer.buffered > 0) { const readSize = Math.min(size, this._buffer.buffered), chunk = this._buffer.shift(readSize); if (!this.push(chunk)) return; } 0 !== this._needBytes || this._finished || (this._finished = !0, this.push(null)), this.emit("drain"); } }, EntryStream.prototype.write = function(data) { if (this._destroyed) return !1; const remaining = Math.min(data.length, this._needBytes); if (remaining > 0) { const chunk = data.slice(0, remaining); return this._buffer.push(chunk), this._needBytes -= chunk.length, !0; } return !0; }, EntryStream.prototype.end = function() { this._destroyed || (this._needBytes > 0 && this.emit("error", new Error("Premature end of stream")), this._finished || (this._finished = !0, this.push(null))); }, EntryStream.prototype.destroy = function() { this._destroyed || (this._destroyed = !0, this._buffer = new BufferList, this._entry.removeListener("data", this._onData), this._entry.removeListener("end", this._onEnd), this.emit("close")); }, Entry.prototype.digestMissing = function(data) { if (this._destroyed) return !1; const remaining = Math.min(data.length, this._needBytes); if (remaining > 0) { const chunk = data.slice(0, remaining); return this._needBytes -= chunk.length, !0; } return !0; }, util.inherits(Entry, stream.PassThrough), Entry.prototype.createReadStream = function() { return new EntryStream(this); }, util.inherits(TarReader, events.EventEmitter), TarReader.prototype._start = function() { if (!this._destroyed) { var self = this; this._stream.on("data", (function(chunk) { self._destroyed || (self._buffer.push(chunk), self._position = safeAdd(self._position, chunk.length), self._locked || self._paused ? self._stream.pause() : self._update()); })), this._stream.on("end", (function() { self._destroyed || (self._ended = !0, self._checkEnd()); })), this._stream.on("error", (function(err) { self._destroyed || self.emit("error", err); })); } }, TarReader.prototype.pause = function() { this._paused = !0, this._stream.pause(); }, TarReader.prototype.resume = function() { this._paused = !1, this._locked || (this._stream.resume(), this._update()); }, TarReader.prototype.destroy = function() { this._destroyed || (this._destroyed = !0, this._currentEntry && (this._currentEntry.destroy(), this._currentEntry = null), this._stream && "function" == typeof this._stream.destroy && this._stream.destroy(), this._buffer = new BufferList, this.emit("close")); }, TarReader.prototype._checkEnd = function() { if (!this._destroyed && this._ended && !this._reading && 0 === this._buffer.buffered) { if (this._locked) return; this._finished || (this._finished = !0, this.emit("finish")); } }, TarReader.prototype._unlock = function(err) { this._destroyed || (this._locked = !1, err ? this.emit("error", err) : this._paused || (this._stream.resume(), process.nextTick(function() { this._destroyed || (this._update(), this._checkEnd()); }.bind(this)))); }, TarReader.prototype._update = function() { if (!this._destroyed && !this._reading && !this._paused) { this._reading = !0; for (var continueReading = !0; continueReading && this._buffer.buffered > 0; ) if (null === this._currentEntry) if (this._missing > 0) { if (!0 === this._longHeader) { if (this._missing > this._buffer.buffered) break; continueReading = this._consumeLongHeader(); continue; } var ignore = this._buffer.shiftFirst(Math.min(this._missing, this._buffer.buffered)); null !== ignore && (this._missing -= ignore.length); } else { if (this._buffer.buffered < 512) break; !1 === this._consumeHeader() && (continueReading = !1); } else continueReading = this._feedEntryData(); this._reading = !1, this._checkEnd(); } }, TarReader.prototype._getAbsolutePosition = function() { return this._position - this._buffer.buffered + this._buffer.shifted; }, TarReader.prototype._consumeHeader = function() { if (this._destroyed) return !1; if (this._locked) return !1; var headerBuf = this._buffer.shift(512); if (!headerBuf) return !1; for (var currentHeaderPosition = this._buffer.shifted - 512, absolutePosition = this._getAbsolutePosition() - 512, empty = !0, i = 0; i < 512; i++) if (0 !== headerBuf[i]) { empty = !1; break; } if (empty) return this._missing = 0, !0; try { this._currentHeader = (function(buf, filenameEncoding, allowUnknownFormat) { var typeflag = 0 === buf[156] ? 0 : buf[156] - ZERO_OFFSET, name = decodeStr(buf, 0, 100, filenameEncoding), mode = decodeOct(buf, 100, 8), uid = decodeOct(buf, 108, 8), gid = decodeOct(buf, 116, 8), size = decodeOct(buf, 124, 12), mtime = decodeOct(buf, 136, 12), type = (function(flag) { switch (flag) { case 0: return "file"; case 1: return "link"; case 2: return "symlink"; case 3: return "character-device"; case 4: return "block-device"; case 5: return "directory"; case 6: return "fifo"; case 7: return "contiguous-file"; case 72: return "pax-header"; case 55: return "pax-global-header"; case 27: return "gnu-long-link-path"; case 28: case 30: return "gnu-long-path"; } return null; })(typeflag), linkname = 0 === buf[157] ? null : decodeStr(buf, 157, 100, filenameEncoding), uname = decodeStr(buf, 265, 32), gname = decodeStr(buf, 297, 32), devmajor = decodeOct(buf, 329, 8), devminor = decodeOct(buf, 337, 8), c = (function(block) { for (var sum = 256, i = 0; i < 148; i++) sum += block[i]; for (var j = 156; j < 512; j++) sum += block[j]; return sum; })(buf); if (256 === c) return null; if (c !== decodeOct(buf, 148, 8)) throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?"); if ((function(buf) { for (var i = 0; i < 6; i++) if (buf[257 + i] !== USTAR_MAGIC[i]) return !1; return !0; })(buf)) buf[345] && (name = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name); else if ((function(buf) { for (var i = 0; i < 6; i++) if (buf[257 + i] !== GNU_MAGIC[i]) return !1; for (var j = 0; j < 2; j++) if (buf[263 + j] !== GNU_VER[j]) return !1; return !0; })(buf)) ; else if (!allowUnknownFormat) throw new Error("Invalid tar header: unknown format."); return 0 === typeflag && name && "/" === name[name.length - 1] && (typeflag = 5), { name: name, mode: mode, uid: uid, gid: gid, size: size, mtime: new Date(1e3 * mtime), type: type, linkname: linkname, uname: uname, gname: gname, devmajor: devmajor, devminor: devminor, pax: null }; })(headerBuf, this._filenameEncoding, this._allowUnknownFormat); } catch (err) { return this.emit("error", err), !1; } if (!this._currentHeader) return !0; switch (this._currentHeader.type) { case "gnu-long-path": case "gnu-long-link-path": case "pax-global-header": case "pax-header": return this._longHeader = !0, this._missing = this._currentHeader.size, !0; } this._locked = !0, this._applyLongHeaders(); var entryPosition = currentHeaderPosition; if (safeAdd(entryPosition, 512), this._currentHeader.offset = entryPosition, this._currentHeader.dataOffset = absolutePosition, this._interestedAfter = absolutePosition + this._currentHeader.size, 0 === this._currentHeader.size || "directory" === this._currentHeader.type) { var entry = new Entry(this._currentHeader); entry.end(), this._currentEntry = null; var self = this; return this._stream.pause(), this._skipping = !1, this.emit("entry", this._currentHeader, entry, (function(err) { self._skipping = !0, self._unlock(err); })), !0; } return this._currentEntry = new Entry(this._currentHeader), self = this, this._currentEntry.on("drain", (function() { self._update(); })), this._stream.pause(), this._currentEntry.unlockStream = function() { self._interestedAfter = !1, self._locked = !1, self._stream.resume(); }, this._currentEntry.lockStream = function() { self._locked = !0, self._stream.pause(); }, this._skipping = !1, this.emit("entry", this._currentHeader, this._currentEntry, (function(err) { self._skipping = !0, self._unlock(err); })), !1; }, TarReader.prototype._feedEntryData = function() { if (!this._currentEntry || this._destroyed) return !1; const entrySize = this._currentHeader.size, bytesNeeded = this._currentEntry._needBytes; if (0 === bytesNeeded) { const padding = overflow(entrySize); if (padding > 0) { const paddingToSkip = Math.min(padding, this._buffer.buffered); if (this._buffer.shift(paddingToSkip), this._missing = padding - paddingToSkip, this._missing > 0) return this._buffer.buffered > 0; } return this._currentEntry = null, !0; } const available = Math.min(bytesNeeded, this._buffer.buffered); if (0 === available) return !1; const chunk = this._buffer.shift(available); if (this._skipping) { if (!this._currentEntry.digestMissing(chunk)) return !1; } else if (!this._currentEntry.write(chunk)) return !1; return this._buffer.buffered > 0; }, TarReader.prototype._consumeLongHeader = function() { if (this._destroyed) return !1; this._longHeader = !1; var size = this._missing; this._missing = overflow(size); var buf = this._buffer.shift(size); try { this._decodeLongHeader(buf); } catch (err) { return this.emit("error", err), !1; } return !0; }, TarReader.prototype._applyLongHeaders = function() { this._gnuLongPath && (this._currentHeader.name = this._gnuLongPath, this._gnuLongPath = null), this._gnuLongLinkPath && (this._currentHeader.linkname = this._gnuLongLinkPath, this._gnuLongLinkPath = null), this._pax && (this._pax.path && (this._currentHeader.name = this._pax.path), this._pax.linkpath && (this._currentHeader.linkname = this._pax.linkpath), this._pax.size && (this._currentHeader.size = parseInt(this._pax.size, 10)), this._currentHeader.pax = this._pax, this._pax = null); }, TarReader.prototype._decodeLongHeader = function(buf) { switch (this._currentHeader.type) { case "gnu-long-path": this._gnuLongPath = decodeLongPath(buf, this._filenameEncoding); break; case "gnu-long-link-path": this._gnuLongLinkPath = decodeLongPath(buf, this._filenameEncoding); break; case "pax-global-header": this._paxGlobal = decodePax(buf); break; case "pax-header": this._pax = null === this._paxGlobal ? decodePax(buf) : Object.assign({}, this._paxGlobal, decodePax(buf)); } }; const ZERO_OFFSET = "0".charCodeAt(0), USTAR_MAGIC = new Buffer([ 117, 115, 116, 97, 114, 0 ]), GNU_MAGIC = (new Buffer([ ZERO_OFFSET, ZERO_OFFSET ]), new Buffer([ 117, 115, 116, 97, 114, 32 ])), GNU_VER = new Buffer([ 32, 0 ]); function decodeLongPath(buf, encoding) { return decodeStr(buf, 0, buf.length, encoding); } function decodePax(buf) { for (var result = {}, i = 0; i < buf.length; ) { for (var start = i; i < buf.length && 32 !== buf[i]; ) i++; var len = parseInt(buf.slice(start, i).toString(), 10); if (!len) return result; i++; var pair = buf.slice(i, start + len - 1).toString(), keyIndex = pair.indexOf("="); if (-1 === keyIndex) return result; result[pair.slice(0, keyIndex)] = pair.slice(keyIndex + 1), i = start + len; } return result; } function indexOf(block, num, offset, end) { for (;offset < end; offset++) if (block[offset] === num) return offset; return end; } function decodeOct(val, offset, length) { if (128 & (val = val.slice(offset, offset + length))[offset = 0]) return (function(buf) { var positive; if (128 === buf[0]) positive = !0; else { if (255 !== buf[0]) return null; positive = !1; } var i, tuple = []; for (i = buf.length - 1; i > 0; i--) { var byte = buf[i]; positive ? tuple.push(byte) : tuple.push(255 - byte); } var sum = 0, l = tuple.length; for (i = 0; i < l; i++) { var power = Math.pow(256, i); if (isFinite(power)) sum += tuple[i] * power; else { for (var curr = tuple[i], j = 0; j < i; j++) if (curr *= 256, !isFinite(curr)) return positive ? Number.MAX_SAFE_INTEGER : -Number.MAX_SAFE_INTEGER; sum += curr; } if (!isFinite(sum)) return positive ? Number.MAX_SAFE_INTEGER : -Number.MAX_SAFE_INTEGER; } return positive ? sum : -1 * sum; })(val); for (;offset < val.length && 32 === val[offset]; ) offset++; for (var end = (index = indexOf(val, 32, offset, val.length), len = val.length, defaultValue = val.length, "number" != typeof index ? defaultValue : (index = ~~index) >= len ? len : index >= 0 || (index += len) >= 0 ? index : 0); offset < end && 0 === val[offset]; ) offset++; return end === offset ? 0 : parseInt(val.slice(offset, end).toString(), 8); var index, len, defaultValue; } function decodeStr(val, offset, length, encoding) { return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding); } module.exports = TarReader; }, function(module, exports, __webpack_require__) { const needle = __webpack_require__(73), getContentLength = __webpack_require__(1303); module.exports = async function(url, lengths) { return new Promise((async (resolve, reject) => { let contentLength = !1; "object" == typeof url && (contentLength = url.bytes, url = url.url); let fileName = url.split("/").pop(); if ((fileName || "").includes(".") ? (fileName = decodeURIComponent(fileName), fileName.includes("?") && (fileName = fileName.split("?")[0])) : fileName = "archive.gz", !contentLength) if (lengths.length > 1 && !fileName.match(/\.t?gz$/i) && lengths[0] === lengths[1]) contentLength = lengths[0]; else try { contentLength = await getContentLength(url), contentLength = parseInt(contentLength); } catch (e) { return console.error(e), void reject(e); } resolve({ length: contentLength, name: fileName, createReadStream: range => { const opts = { follow_max: 5, rejectUnauthorized: !1 }; return Object.values(range).length && (range.start = range.start || 0, range.end = range.end || 0, (range.end > contentLength - 1 || 0 === range.end) && (range.end = ""), opts.headers = { range: `bytes=${range.start}-${range.end}` }), needle.get(url, opts); } }); })); }; }, function(module, exports, __webpack_require__) { const request = __webpack_require__(61); module.exports = async function(url) { return new Promise(((resolve, reject) => { const req = request({ url: url, followRedirect: !0, maxRedirects: 5, strictSSL: !1 }); req.on("response", (function(d) { req.abort(), d.headers["content-length"] ? resolve(d.headers["content-length"]) : reject("Could not retrieve content-length from ranged request"); })).on("error", reject); })); }; }, function(module, exports, __webpack_require__) { const store = __webpack_require__(171), parseQuery = __webpack_require__(279), cryptojs = __webpack_require__(6), ee = __webpack_require__(4), lzDecompress = __webpack_require__(77).decompressFromEncodedURIComponent, initEmitter = new ee; module.exports = { createKey: function(archiveType, orderRegex, orderDefault, req, res) { function storeDataToKey(arr, newKey) { if (newKey && null !== store.get(newKey)) return newKey; arr = arr.map((el => Array.isArray(el) ? !!el[0] && (el[1] ? { url: el[0], bytes: el[1] } : { url: el[0] }) : el)).filter((el => !!el)), orderRegex && (arr = arr.sort(((first, second) => { const firstMatch = ((first || {}).url || first || "").split("?")[0].match(orderRegex), secondMatch = ((second || {}).url || second || "").split("?")[0].match(orderRegex); return +(firstMatch && firstMatch[1] || orderDefault || 0) - +(secondMatch && secondMatch[1] || orderDefault || 0); }))); const key = store.set(arr, newKey); return initEmitter.emit(key), key; } if ("POST" === req.method) { if (!Array.isArray(req.body)) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 1"); const key = storeDataToKey(req.body, req.params.createKey); res.setHeader("Content-Length", JSON.stringify({ key: key }).length + ""), res.setHeader("Content-Type", "application/json"), res.end(JSON.stringify({ key: key })); } else { if (!req.query.lz) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 2"); let lzData = !1; try { lzData = JSON.parse(lzDecompress(req.query.lz)); } catch (e) {} if (!lzData || !lzData.urls || !lzData.urls.length) return res.statusCode = 500, res.setHeader("Content-Type", "text/plain"), void res.end("Cannot parse JSON data, err 3"); const hashKey = (txt = req.query.lz, cryptojs.createHash("sha256").update(txt).digest("hex")); storeDataToKey(lzData.urls, hashKey), opts = (function(lzData) { let opts = {}; return lzData.fileMustInclude && (opts.fileMustInclude = lzData.fileMustInclude), lzData.maxFiles && lzData.maxFiles > 0 && (opts.maxFiles = lzData.maxFiles), lzData.fileIdx && lzData.fileIdx > -1 && (opts.fileIdx = lzData.fileIdx), !!Object.keys(opts).length && opts; })(lzData), res.statusCode = 302, res.setHeader("Location", `/${archiveType}/stream?key=${hashKey}` + (opts ? "&o=" + encodeURIComponent(JSON.stringify(opts)) : "")), res.end(); } var txt; }, waitForKey: function(req) { return new Promise(((resolve, reject) => { const key = parseQuery(req).query.key; key ? null === store.get(key) ? initEmitter.addListener(key, (function gotData() { initEmitter.removeListener(key, gotData), resolve(); })) : resolve() : reject(Error("No stream key provided")); })); } }; }, function(module, exports, __webpack_require__) { const {Client: Client, AccessOptions: AccessOptions} = __webpack_require__(1306), {PassThrough: PassThrough, Readable: Readable} = __webpack_require__(3), {basename: basename, dirname: dirname} = __webpack_require__(5), getContentType = __webpack_require__(1307), router = (__webpack_require__(50), __webpack_require__(240)()), initEmitter = new (__webpack_require__(4)), lzDecompress = __webpack_require__(77).decompressFromEncodedURIComponent, cryptojs = __webpack_require__(6), shimURL = __webpack_require__(1308).URL, streams = {}, creatingKey = {}, initKeys = {}; async function prepare(url, opts = {}) { const filepath = decodeURIComponent(url.pathname); if (!filepath) throw new TypeError('No "pathname"!'); const client = new Client(0); try { const {host: host, port: port, user: user, password: password} = (function(url) { return { host: url.hostname || url.host || "localhost", port: parseInt(url.port || "0", 10) || 21, user: url.username ? decodeURIComponent(url.username) : void 0, password: url.password ? decodeURIComponent(url.password) : void 0 }; })(url); return await client.access({ host: host, port: port, user: user, password: password, ...opts }), { client: client, filepath: filepath }; } catch (err) { throw client.close(), err; } } module.exports = { router: function() { function getUniqueId() { const idStr = "" + Math.random().toString(16).slice(2); return streams[idStr] ? getUniqueId() : idStr; } function waitForKeyData(req, forceKey) { return new Promise(((resolve, reject) => { const key = `init-${forceKey || req.query.key}`; key ? initKeys[key] ? resolve(key) : initEmitter.addListener(key, (function gotData() { initEmitter.removeListener(key, gotData), resolve(key); })) : reject(Error("No stream key provided")); })); } async function createKeyHandler(req, res) { let ftpUrl = !1, lzKey = !1; if ("POST" === req.method) { if (!req.body || !req.body.ftpUrl) return void res.status(500).send("Cannot parse JSON data, err 1"); ftpUrl = req.body.ftpUrl; } else { if (!req.query.lz) return void res.status(500).send("Cannot parse JSON data, err 2"); let lzData = !1; try { lzData = JSON.parse(lzDecompress(req.query.lz)); } catch (e) {} if (!lzData) return void res.status(500).send("Cannot parse JSON data, err 3"); if (txt = req.query.lz, lzKey = cryptojs.createHash("sha256").update(txt).digest("hex"), (streams[lzKey] || {}).missingInitPieces) return res.statusCode = 500, void res.end(); if (creatingKey[lzKey]) { try { await waitForKeyData(req, lzKey); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } return (streams[lzKey] || {}).missingInitPieces ? (res.statusCode = 500, void res.end()) : void res.redirect(initKeys[`init-${lzKey}`].serverPath); } creatingKey[lzKey] = !0, ftpUrl = lzData.ftpUrl; } var txt; const key = lzKey || req.params.createKey || getUniqueId(), ftpConnOpts = (function(uri, opts = {}) { const url = "string" == typeof uri ? new shimURL(uri) : uri, protocol = url.protocol.replace(/:$/, ""); if ("ftp" === protocol) return { url: url, opts: opts }; if ("ftps" === protocol) return opts.secure = !0, opts.secureOptions = { rejectUnauthorized: !1 }, { url: url, opts: opts }; throw Error("unknown protocol"); })(ftpUrl); try { streams[key] = await (async function(url, opts = {}) { const {cache: cache} = opts; let lastModified; try { const {client: client, filepath: filepath} = await prepare(url, opts); if (!client) throw Error("no client"); try { lastModified = await client.lastMod(filepath); } catch (err) { if (550 === (err || {}).code) throw Error("not found"); } if (!lastModified) { const list = await client.list(dirname(filepath)), name = basename(filepath), entry = list.find((e => e.name === name)); entry && (lastModified = entry.modifiedAt); } if (!lastModified) throw Error("not found"); if ((cache || {}).lastModified && lastModified && +cache.lastModified == +lastModified) throw Error("not modified"); const size = await client.size(filepath), features = await client.features(); return { client: client, filepath: filepath, size: size, mime: getContentType({ name: filepath }) || "application/octet-stream", features: features, lastModified: lastModified, supportsSeek: !!Object.fromEntries(features || []).REST }; } catch (err) { throw err; } })(ftpConnOpts.url, ftpConnOpts.opts); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } streams[key].ftpOpts = ftpConnOpts, await streams[key].client.close(), delete streams[key].client; const filename = basename(streams[key].filepath); streams[key].streamUrl = `/ftp/stream/${key}/${filename}`, initKeys[`init-${key}`] = { serverPath: streams[key].streamUrl }, "POST" === req.method ? (res.setHeader("Content-Length", JSON.stringify({ key: key }).length + ""), res.setHeader("Content-Type", "application/json"), res.end(JSON.stringify({ key: key }))) : (delete creatingKey[key], res.redirect(streams[key].streamUrl)); } return router.post("/create/:createKey", createKeyHandler), router.all("/create", createKeyHandler), router.all("/:fileName", createKeyHandler), router.get("/stream/:key/:fileName", (async (req, res) => { const key = ((req || {}).params || {}).key; if (!key) return console.error(Error("ftp stream key missing")), res.statusCode = 500, void res.end(); const {size: size, mime: mime, filepath: filepath, lastModified: lastModified, supportsSeek: supportsSeek} = streams[key], range = ((req || {}).headers || {}).range || null, origin = ((req || {}).headers || {}).origin || "*"; let start = null, end = null, diff = null; if (!supportsSeek && range && "bytes=0-" !== range && range !== "bytes=0-" + (size - 1)) return res.statusCode = 405, void res.end(); if (range) { let parts = range.replace(/bytes=/, "").split("-"); parts[0] && (start = parseInt(parts[0], 10)), (parts[1] || "").split("/")[0] && (end = parseInt(parts[1], 10)), end || (end = size - 1), null !== start && null !== end && (diff = end - start), res.writeHead(206, { "Access-Control-Allow-Origin": origin, "Content-Range": `bytes ${start}-${end || ""}/${size}`, "Accept-Ranges": "bytes", "Content-Length": end - start + 1 + "", "Content-Type": mime, "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" }); } else res.writeHead(200, { "Access-Control-Allow-Origin": origin, "Content-Length": size + "", "Content-Type": mime, "Accept-Ranges": supportsSeek ? "bytes" : "none", "transferMode.dlna.org": "Streaming", "contentFeatures.dlna.org": "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" }); if ("HEAD" === req.method) return res.end(); const ftpConn = await prepare(streams[key].ftpOpts.url, streams[key].ftpOpts.opts); ftpConn.stream = (function(client, filepath, lastModified, startAt) { const stream = new PassThrough, rs = stream; return client.downloadTo(stream, filepath, startAt).then((result => { client.close(); })).catch((e => {})), rs.lastModified = lastModified, rs; })(ftpConn.client, filepath, lastModified, start), ftpConn.stream.pipe(res).on("error", (err => { console.log("pipeline error", err), ftpConn.client.close(); })), req.on("close", (async () => { ftpConn.client.close(); })); })), router.get("/stream", (async (req, res) => { try { await waitForKeyData(req); } catch (e) { return console.error(e), res.statusCode = 500, void res.end(); } res.redirect(initKeys[`init-${req.query.key}`].serverPath); })), router; } }; }, function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(0), fs = __webpack_require__(2), path = __webpack_require__(5), net = __webpack_require__(39), tls = __webpack_require__(70), stream = __webpack_require__(3), _promisify = util.promisify || function(fn) { return function() { var args = Array.prototype.slice.call(arguments), self = this; return new Promise((function(resolve, reject) { args.push((function(err, result) { err ? reject(err) : resolve(result); })), fn.apply(self, args); })); }; }; Object.assign || (Object.assign = function(target) { if (null == target) throw new TypeError("Cannot convert undefined or null to object"); for (var to = Object(target), index = 1; index < arguments.length; index++) { var nextSource = arguments[index]; if (null != nextSource) for (var nextKey in nextSource) Object.prototype.hasOwnProperty.call(nextSource, nextKey) && (to[nextKey] = nextSource[nextKey]); } return to; }); var fsReadDir = _promisify(fs.readdir), fsMkDir = _promisify(fs.mkdir), fsStat = _promisify(fs.stat), fsOpen = _promisify(fs.open), fsClose = _promisify(fs.close), fsUnlink = _promisify(fs.unlink), FileType = { Unknown: 0, File: 1, Directory: 2, SymbolicLink: 3 }; function FileInfo(name) { this.name = name, this.type = FileType.Unknown, this.size = 0, this.rawModifiedAt = "", this.modifiedAt = void 0, this.permissions = void 0, this.hardLinkCount = void 0, this.link = void 0, this.group = void 0, this.user = void 0, this.uniqueID = void 0; } function FTPError(res) { Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.message = res.message, this.code = res.code; } function positiveCompletion(code) { return code >= 200 && code < 300; } function positiveIntermediate(code) { return code >= 300 && code < 400; } function describeTLS(socket) { return socket instanceof tls.TLSSocket ? socket.getProtocol() || "Server socket or disconnected client socket" : "No encryption"; } function describeAddress(socket) { return "IPv6" === socket.remoteFamily ? "[" + socket.remoteAddress + "]:" + socket.remotePort : socket.remoteAddress + ":" + socket.remotePort; } function ipIsPrivateV4Address(ip) { ip || (ip = ""), 0 === ip.indexOf("::ffff:") && (ip = ip.substr(7)); var octets = ip.split(".").map((function(o) { return parseInt(o, 10); })); return 10 === octets[0] || 172 === octets[0] && octets[1] >= 16 && octets[1] <= 31 || 192 === octets[0] && 168 === octets[1] || "127.0.0.1" === ip; } function StringWriter() { stream.Writable.call(this), this.buf = Buffer.alloc ? Buffer.alloc(0) : new Buffer(0); } function ProgressTracker() { this.bytesOverall = 0, this.intervalMs = 500, this.onStop = noop, this.onHandle = noop; } function noop() {} function FTPContext(timeout, encoding) { this.timeout = timeout || 0, this.verbose = !1, this.ipFamily = void 0, this.tlsOptions = {}, this._partialResponse = "", this._encoding = encoding || "utf8", this._socket = this.socket = this._newSocket(), this._dataSocket = void 0, this._closingError = void 0, this._task = void 0; } FileInfo.prototype.isDirectory = function() { return this.type === FileType.Directory; }, FileInfo.prototype.isSymbolicLink = function() { return this.type === FileType.SymbolicLink; }, FileInfo.prototype.isFile = function() { return this.type === FileType.File; }, Object.defineProperty(FileInfo.prototype, "date", { get: function() { return this.rawModifiedAt; }, set: function(value) { this.rawModifiedAt = value; } }), FileInfo.UnixPermission = { Read: 4, Write: 2, Execute: 1 }, FTPError.prototype = Object.create(Error.prototype), FTPError.prototype.constructor = FTPError, util.inherits(StringWriter, stream.Writable), StringWriter.prototype._write = function(chunk, encoding, callback) { chunk instanceof Buffer ? (this.buf = Buffer.concat([ this.buf, chunk ]), callback(null)) : callback(new Error("StringWriter expects chunks of type 'Buffer'.")); }, StringWriter.prototype.getText = function(encoding) { return this.buf.toString(encoding); }, ProgressTracker.prototype.reportTo = function(onHandle) { this.onHandle = onHandle || noop; }, ProgressTracker.prototype.start = function(socket, name, type) { var self = this, lastBytes = 0; function updateFunc() { var bytes = socket.bytesRead + socket.bytesWritten; self.bytesOverall += bytes - lastBytes, lastBytes = bytes, self.onHandle({ name: name, type: type, bytes: bytes, bytesOverall: self.bytesOverall }); } var id = setInterval(updateFunc, this.intervalMs); this.onStop = function(stopWithUpdate) { clearInterval(id), stopWithUpdate && updateFunc(), updateFunc = noop; }, updateFunc(); }, ProgressTracker.prototype.stop = function() { this.onStop(!1); }, ProgressTracker.prototype.updateAndStop = function() { this.onStop(!0); }, FTPContext.prototype.close = function() { var message = this._task ? "User closed client during task" : "User closed client"; this.closeWithError(new Error(message)); }, FTPContext.prototype.closeWithError = function(err) { this._closingError || (this._closingError = err, this._closeControlSocket(), this._closeSocket(this._dataSocket), this._passToHandler(err), this._stopTrackingTask()); }, Object.defineProperty(FTPContext.prototype, "closed", { get: function() { return void 0 === this.socket.remoteAddress || void 0 !== this._closingError; } }), FTPContext.prototype.reset = function() { this.socket = this._newSocket(); }, Object.defineProperty(FTPContext.prototype, "socket", { get: function() { return this._socket; }, set: function(socket) { var self = this; this.dataSocket = void 0, this.tlsOptions = {}, this._partialResponse = "", this._socket && (socket && socket.localPort === this._socket.localPort ? this._removeSocketListeners(this.socket) : this._closeControlSocket()), socket && (this._closingError = void 0, socket.setTimeout(0), socket.setEncoding(this._encoding), socket.setKeepAlive(!0), socket.on("data", (function(data) { self._onControlSocketData(data); })), socket.on("end", (function() { self.closeWithError(new Error("Server sent FIN packet unexpectedly, closing connection.")); })), socket.on("close", (function(hadError) { hadError || self.closeWithError(new Error("Server closed connection unexpectedly.")); })), this._setupDefaultErrorHandlers(socket, "control socket")), this._socket = socket; } }), Object.defineProperty(FTPContext.prototype, "dataSocket", { get: function() { return this._dataSocket; }, set: function(socket) { this._closeSocket(this._dataSocket), socket && (socket.setTimeout(0), this._setupDefaultErrorHandlers(socket, "data socket")), this._dataSocket = socket; } }), Object.defineProperty(FTPContext.prototype, "encoding", { get: function() { return this._encoding; }, set: function(encoding) { this._encoding = encoding, this.socket && this.socket.setEncoding(encoding); } }), Object.defineProperty(FTPContext.prototype, "hasTLS", { get: function() { return "encrypted" in this._socket; } }), FTPContext.prototype.send = function(command) { var message = 0 === command.indexOf("PASS") ? "> PASS ###" : "> " + command; this.log(message), this._socket.write(command + "\r\n", this.encoding); }, FTPContext.prototype.request = function(command) { return this.handle(command, (function(res, task) { res instanceof Error ? task.reject(res) : task.resolve(res); })); }, FTPContext.prototype.handle = function(command, responseHandler) { var self = this; if (this._task) { var err = new Error("User launched a task while another one is still running. Forgot to use 'await' or '.then()'?"); err.stack += "\nRunning task launched at: " + this._task.stack, this.closeWithError(err); } return new Promise((function(resolveTask, rejectTask) { if (self._task = { stack: (new Error).stack || "Unknown call stack", responseHandler: responseHandler, resolver: { resolve: function(arg) { self._stopTrackingTask(), resolveTask(arg); }, reject: function(err) { self._stopTrackingTask(), rejectTask(err); } } }, self._closingError) { var err = new Error("Client is closed because " + self._closingError.message); return err.stack += "\nClosing reason: " + self._closingError.stack, err.code = void 0 !== self._closingError.code ? self._closingError.code : "0", void self._passToHandler(err); } self.socket.setTimeout(self.timeout), command && self.send(command); })); }, FTPContext.prototype.log = function(message) { this.verbose && console.log(message); }, FTPContext.prototype._stopTrackingTask = function() { this.socket.setTimeout(0), this._task = void 0; }, FTPContext.prototype._onControlSocketData = function(chunk) { this.log("< " + chunk); var parsed = (function(text) { for (var tokenRegex, lines = text.split(/\r?\n/).filter((function(str) { return "" !== str.trim(); })), messages = [], startAt = 0, i = 0; i < lines.length; i++) { var line = lines[i]; if (tokenRegex) tokenRegex.test(line) && (tokenRegex = void 0, messages.push(lines.slice(startAt, i + 1).join("\n"))); else if (/^\d\d\d-/.test(line)) { var token = line.substr(0, 3); tokenRegex = new RegExp("^" + token + "(?:$| )"), startAt = i; } else /^\d\d\d(?:$| )/.test(line) && messages.push(line); } return { messages: messages, rest: tokenRegex ? lines.slice(startAt).join("\n") + "\n" : "" }; })(this._partialResponse + chunk); this._partialResponse = parsed.rest; for (var i = 0; i < parsed.messages.length; i++) { var message = parsed.messages[i], code = parseInt(message.substr(0, 3), 10), response = { code: code, message: message }, err = code >= 400 ? new FTPError(response) : void 0; this._passToHandler(err || response); } }, FTPContext.prototype._passToHandler = function(response) { this._task && this._task.responseHandler(response, this._task.resolver); }, FTPContext.prototype._setupDefaultErrorHandlers = function(socket, identifier) { var self = this; socket.once("error", (function(error) { error.message += " (" + identifier + ")", self.closeWithError(error); })), socket.once("close", (function(hadError) { hadError && self.closeWithError(new Error("Socket closed due to transmission error (" + identifier + ")")); })), socket.once("timeout", (function() { socket.destroy(), self.closeWithError(new Error("Timeout (" + identifier + ")")); })); }, FTPContext.prototype._closeControlSocket = function() { this._removeSocketListeners(this._socket), this._socket.on("error", (function() {})), this.send("QUIT"), this._closeSocket(this._socket); }, FTPContext.prototype._closeSocket = function(socket) { socket && (this._removeSocketListeners(socket), socket.on("error", (function() {})), socket.destroy()); }, FTPContext.prototype._removeSocketListeners = function(socket) { socket.removeAllListeners(), socket.removeAllListeners("timeout"), socket.removeAllListeners("data"), socket.removeAllListeners("end"), socket.removeAllListeners("error"), socket.removeAllListeners("close"), socket.removeAllListeners("connect"); }, FTPContext.prototype._newSocket = function() { return new net.Socket; }; var RE_LINE_DOS = new RegExp("(\\S+)\\s+(\\S+)\\s+(?:()|([0-9]+))\\s+(\\S.*)"); function parseLineDOS(line) { var groups = line.match(RE_LINE_DOS); if (groups) { var name = groups[5]; if ("." !== name && ".." !== name) { var file = new FileInfo(name); return "" === groups[3] ? (file.type = FileType.Directory, file.size = 0) : (file.type = FileType.File, file.size = parseInt(groups[4], 10)), file.rawModifiedAt = groups[1] + " " + groups[2], file; } } } var RE_LINE_UNIX = new RegExp("([bcdelfmpSs-])(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]?)))\\+?\\s*(\\d+)\\s+(?:(\\S+(?:\\s\\S+)*?)\\s+)?(?:(\\S+(?:\\s\\S+)*)\\s+)?(\\d+(?:,\\s*\\d+)?)\\s+((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3})|(?:\\d{1,2}月\\s+\\d{1,2}日))\\s+((?:\\d+(?::\\d+)?)|(?:\\d{4}年))\\s(.*)"); function parseLineUnix(line) { var groups = line.match(RE_LINE_UNIX); if (groups) { var name = groups[21]; if ("." !== name && ".." !== name) { var file = new FileInfo(name); switch (file.size = parseInt(groups[18], 10), file.user = groups[16], file.group = groups[17], file.hardLinkCount = parseInt(groups[15], 10), file.rawModifiedAt = groups[19] + " " + groups[20], file.permissions = { user: parseMode(groups[4], groups[5], groups[6]), group: parseMode(groups[8], groups[9], groups[10]), world: parseMode(groups[12], groups[13], groups[14]) }, groups[1].charAt(0)) { case "d": file.type = FileType.Directory; break; case "e": case "l": file.type = FileType.SymbolicLink; break; case "b": case "c": case "f": case "-": file.type = FileType.File; break; default: file.type = FileType.Unknown; } if (file.isSymbolicLink()) { var end = name.indexOf(" -> "); -1 !== end && (file.name = name.substring(0, end), file.link = name.substring(end + 4)); } return file; } } function parseMode(r, w, x) { var value = 0; "-" !== r && (value += FileInfo.UnixPermission.Read), "-" !== w && (value += FileInfo.UnixPermission.Write); var execToken = x.charAt(0); return "-" !== execToken && execToken.toUpperCase() !== execToken && (value += FileInfo.UnixPermission.Execute), value; } } function parseMLSxDate(fact) { return new Date(Date.UTC(+fact.slice(0, 4), +fact.slice(4, 6) - 1, +fact.slice(6, 8), +fact.slice(8, 10), +fact.slice(10, 12), +fact.slice(12, 14), +fact.slice(15, 18))); } function parseLineMLSD(line) { var pos = line.indexOf(" "), packedFacts = line.substr(0, pos), name = line.substr(pos + 1); if ("" !== name && "." !== name && ".." !== name) { var info = new FileInfo(name), facts = packedFacts.split(";"), factHandlers = { size: function(v) { info.size = parseInt(v, 10); }, sizd: function(v) { info.size = parseInt(v, 10); }, unique: function(v) { info.uniqueID = v; }, modify: function(v) { info.modifiedAt = parseMLSxDate(v), info.rawModifiedAt = info.modifiedAt.toISOString(); }, type: function(v) { if (0 === v.indexOf("OS.unix=slink")) return info.type = FileType.SymbolicLink, info.link = v.substr(v.indexOf(":") + 1), 1; switch (v) { case "file": info.type = FileType.File; break; case "dir": info.type = FileType.Directory; break; case "OS.unix=symlink": info.type = FileType.SymbolicLink; break; case "cdir": case "pdir": return 2; default: info.type = FileType.Unknown; } return 1; }, "unix.mode": function(v) { var digits = v.substr(-3); info.permissions = { user: parseInt(digits[0], 10), group: parseInt(digits[1], 10), world: parseInt(digits[2], 10) }; }, "unix.ownername": function(v) { info.user = v; }, "unix.owner": function(v) { info.user || (info.user = v); }, "unix.groupname": function(v) { info.group = v; }, "unix.group": function(v) { info.group || (info.group = v); } }; factHandlers["unix.uid"] = factHandlers["unix.owner"], factHandlers["unix.gid"] = factHandlers["unix.group"]; for (var i = 0; i < facts.length; i++) { var factPos = facts[i].indexOf("="); if (-1 !== factPos) { var factName = facts[i].substr(0, factPos).toLowerCase(), factValue = facts[i].substr(factPos + 1), handler = factHandlers[factName]; if (handler && 2 === handler(factValue)) return; } } return info; } } function transformListMLSD(files) { for (var nonLinksByID = {}, i = 0; i < files.length; i++) { var file = files[i]; !file.isSymbolicLink() && file.uniqueID && (nonLinksByID[file.uniqueID] = file); } for (var resolved = [], j = 0; j < files.length; j++) { var f = files[j]; if (f.isSymbolicLink() && f.uniqueID && !f.link) { var target = nonLinksByID[f.uniqueID]; target && (f.link = target.name); } -1 === f.name.indexOf("/") && resolved.push(f); } return resolved; } function parseList(rawList) { var lines = rawList.split(/\r?\n/).filter((function(s) { return "" !== s.trim() && 0 !== s.indexOf("total"); })); if (0 === lines.length) return []; var parser, line, testLine = lines[lines.length - 1]; if (/^\d{2}/.test(line = testLine) && RE_LINE_DOS.test(line)) parser = { parse: parseLineDOS, transform: function(f) { return f; } }; else if ((function(line) { return RE_LINE_UNIX.test(line); })(testLine)) parser = { parse: parseLineUnix, transform: function(f) { return f; } }; else { if (!(function(line) { return /^\S+=\S+;/.test(line) || 0 === line.indexOf(" "); })(testLine)) throw new Error("This library only supports MLSD, Unix- or DOS-style directory listing."); parser = { parse: parseLineMLSD, transform: transformListMLSD }; } for (var files = [], i = 0; i < lines.length; i++) { var info = parser.parse(lines[i]); info && files.push(info); } return parser.transform(files); } function TransferResolver(ftp, progress) { this.ftp = ftp, this.progress = progress, this.response = void 0, this.dataTransferDone = !1; } function pipeline(source, destination, callback) { function cleanup() { source.removeListener("error", onError), destination.removeListener("error", onError), destination.removeListener("finish", onFinish); } function onError(err) { cleanup(), callback(err); } function onFinish() { cleanup(), callback(); } source.pipe(destination), source.once("error", onError), destination.once("error", onError), destination.once("finish", onFinish); } function enterPassiveModeIPv6(ftp) { return ftp.request("EPSV").then((function(res) { var groups = res.message.match(/[|!]{3}(.+)[|!]/); if (!groups || !groups[1]) throw new Error("Can't parse EPSV response: " + res.message); var port = parseInt(groups[1], 10); if (isNaN(port)) throw new Error("Can't parse EPSV port: " + res.message); var host = ftp.socket.remoteAddress; if (!host) throw new Error("Control socket is disconnected."); return connectForPassiveTransfer(host, port, ftp).then((function() { return res; })); })); } function enterPassiveModeIPv4(ftp) { return ftp.request("PASV").then((function(res) { var groups = res.message.match(/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/); if (!groups || 4 !== groups.length) throw new Error("Can't parse PASV response: " + res.message); var host = groups[1].replace(/,/g, "."), port = 256 * (255 & parseInt(groups[2], 10)) + (255 & parseInt(groups[3], 10)), controlHost = ftp.socket.remoteAddress; return ipIsPrivateV4Address(host) && controlHost && !ipIsPrivateV4Address(controlHost) && (host = controlHost), connectForPassiveTransfer(host, port, ftp).then((function() { return res; })); })); } function connectForPassiveTransfer(host, port, ftp) { return new Promise((function(resolve, reject) { var socket = ftp._newSocket(), handleConnErr = function(err) { err.message = "Can't open data connection in passive mode: " + err.message, reject(err); }, handleTimeout = function() { socket.destroy(), reject(new Error("Timeout when trying to open data connection to " + host + ":" + port)); }; socket.setTimeout(ftp.timeout), socket.on("error", handleConnErr), socket.on("timeout", handleTimeout), socket.connect({ port: port, host: host, family: ftp.ipFamily }, (function() { ftp.socket instanceof tls.TLSSocket && (socket = tls.connect(Object.assign({}, ftp.tlsOptions, { socket: socket, session: ftp.socket.getSession() }))), socket.removeListener("error", handleConnErr), socket.removeListener("timeout", handleTimeout), ftp.dataSocket = socket, resolve(); })); })); } function downloadTo(destination, config) { if (!config.ftp.dataSocket) throw new Error("Download will be initiated but no data connection is available."); var resolver = new TransferResolver(config.ftp, config.tracker); return config.ftp.handle(config.command, (function(res, task) { if (res instanceof Error) resolver.onError(task, res); else if (150 === res.code || 125 === res.code) { var dataSocket = config.ftp.dataSocket; if (!dataSocket) return void resolver.onError(task, new Error("Download should begin but no data connection is available.")); config.ftp.log("Downloading from " + describeAddress(dataSocket) + " (" + describeTLS(dataSocket) + ")"), resolver.onDataStart(config.remotePath, config.type), pipeline(dataSocket, destination, (function(err) { err ? resolver.onError(task, err) : resolver.onDataDone(task); })); } else 350 === res.code ? config.ftp.send("RETR " + config.remotePath) : positiveCompletion(res.code) ? resolver.onControlDone(task, res) : positiveIntermediate(res.code) && resolver.onUnexpectedRequest(res); })); } function Client(timeout) { this.availableListCommands = [ "LIST -a", "LIST" ], this.ftp = new FTPContext(timeout || 3e4), this.prepareTransfer = this._enterFirstCompatibleMode([ enterPassiveModeIPv6, enterPassiveModeIPv4 ]), this.parseList = parseList, this._progressTracker = new ProgressTracker; } function ignoreError(func) { return Promise.resolve().then(func).catch((function() {})); } function promiseAllSequential(items, iterator) { return items.reduce((function(promise, item) { return promise.then((function() { return iterator(item); })); }), Promise.resolve()); } TransferResolver.prototype.onDataStart = function(name, type) { if (!this.ftp.dataSocket) throw new Error("Data transfer should start but there is no data connection."); this.ftp.socket.setTimeout(0), this.ftp.dataSocket.setTimeout(this.ftp.timeout), this.progress.start(this.ftp.dataSocket, name, type); }, TransferResolver.prototype.onDataDone = function(task) { this.progress.updateAndStop(), this.ftp.socket.setTimeout(this.ftp.timeout), this.ftp.dataSocket && this.ftp.dataSocket.setTimeout(0), this.dataTransferDone = !0, this.tryResolve(task); }, TransferResolver.prototype.onControlDone = function(task, response) { this.response = response, this.tryResolve(task); }, TransferResolver.prototype.onError = function(task, err) { this.progress.updateAndStop(), this.ftp.socket.setTimeout(this.ftp.timeout), this.ftp.dataSocket = void 0, task.reject(err); }, TransferResolver.prototype.onUnexpectedRequest = function(response) { this.ftp.closeWithError(new Error("Unexpected FTP response: " + response.message)); }, TransferResolver.prototype.tryResolve = function(task) { this.dataTransferDone && this.response && (this.ftp.dataSocket = void 0, task.resolve(this.response)); }, Client.prototype.close = function() { this.ftp.close(), this._progressTracker.stop(); }, Object.defineProperty(Client.prototype, "closed", { get: function() { return this.ftp.closed; } }), Client.prototype.connect = function(host, port) { var self = this; return host = host || "localhost", port = port || 21, this.ftp.reset(), this.ftp.socket.connect({ host: host, port: port, family: this.ftp.ipFamily }, (function() { self.ftp.log("Connected to " + describeAddress(self.ftp.socket) + " (" + describeTLS(self.ftp.socket) + ")"); })), this._handleConnectResponse(); }, Client.prototype.connectImplicitTLS = function(host, port, tlsOptions) { var self = this; return host = host || "localhost", port = port || 21, tlsOptions = tlsOptions || {}, this.ftp.reset(), this.ftp.socket = tls.connect(port, host, tlsOptions, (function() { self.ftp.log("Connected to " + describeAddress(self.ftp.socket) + " (" + describeTLS(self.ftp.socket) + ")"); })), this.ftp.tlsOptions = tlsOptions, this._handleConnectResponse(); }, Client.prototype._handleConnectResponse = function() { return this.ftp.handle(void 0, (function(res, task) { res instanceof Error ? task.reject(res) : positiveCompletion(res.code) ? task.resolve(res) : task.reject(new FTPError(res)); })); }, Client.prototype.send = function(command, ignoreErrorCodesDEPRECATED) { return ignoreErrorCodesDEPRECATED ? (this.ftp.log("Deprecated: use sendIgnoringError instead"), this.sendIgnoringError(command)) : this.ftp.request(command); }, Client.prototype.sendIgnoringError = function(command) { return this.ftp.handle(command, (function(res, task) { res instanceof FTPError ? task.resolve({ code: res.code, message: res.message }) : res instanceof Error ? task.reject(res) : task.resolve(res); })); }, Client.prototype.useTLS = function(options, command) { var self = this; return options = options || {}, command = command || "AUTH TLS", this.send(command).then((function(ret) { return (function(socket, options) { return new Promise((function(resolve, reject) { var tlsOptions = Object.assign({}, options, { socket: socket }), tlsSocket = tls.connect(tlsOptions, (function() { !1 === tlsOptions.rejectUnauthorized || tlsSocket.authorized ? (tlsSocket.removeAllListeners("error"), resolve(tlsSocket)) : reject(tlsSocket.authorizationError); })).once("error", (function(error) { reject(error); })); })); })(self.ftp.socket, options).then((function(tlsSocket) { return self.ftp.socket = tlsSocket, self.ftp.tlsOptions = options, self.ftp.log("Control socket is using: " + describeTLS(self.ftp.socket)), ret; })); })); }, Client.prototype.login = function(user, password) { var self = this; return user = user || "anonymous", password = password || "guest", this.ftp.log("Login security: " + describeTLS(this.ftp.socket)), this.ftp.handle("USER " + user, (function(res, task) { res instanceof Error ? task.reject(res) : positiveCompletion(res.code) ? task.resolve(res) : 331 === res.code ? self.ftp.send("PASS " + password) : task.reject(new FTPError(res)); })); }, Client.prototype.useDefaultSettings = function() { var self = this; return this.features().then((function(features) { var supportsMLSD = features.has("MLST"); return self.availableListCommands = supportsMLSD ? [ "MLSD", "LIST -a", "LIST" ] : [ "LIST -a", "LIST" ], self.send("TYPE I").then((function() { return self.sendIgnoringError("STRU F"); })).then((function() { return self.sendIgnoringError("OPTS UTF8 ON"); })).then((function() { if (supportsMLSD) return self.sendIgnoringError("OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;"); })).then((function() { if (self.ftp.hasTLS) return self.sendIgnoringError("PBSZ 0").then((function() { return self.sendIgnoringError("PROT P"); })); })); })); }, Client.prototype.access = function(options) { var self = this, useExplicitTLS = !0 === (options = options || {}).secure; return ("implicit" === options.secure ? this.connectImplicitTLS(options.host, options.port, options.secureOptions) : this.connect(options.host, options.port)).then((function(welcome) { if (useExplicitTLS) { var secureOptions = options.secureOptions || {}; return secureOptions.host = secureOptions.host || options.host, self.useTLS(secureOptions).then((function() { return welcome; })); } return welcome; })).then((function(welcome) { return self.sendIgnoringError("OPTS UTF8 ON").then((function() { return welcome; })); })).then((function(welcome) { return self.login(options.user, options.password).then((function() { return welcome; })); })).then((function(welcome) { return self.useDefaultSettings().then((function() { return welcome; })); })); }, Client.prototype.pwd = function() { return this.send("PWD").then((function(res) { var parsed = res.message.match(/"(.+)"/); if (!parsed || !parsed[1]) throw new Error("Can't parse response to command 'PWD': " + res.message); return parsed[1]; })); }, Client.prototype.features = function() { return this.sendIgnoringError("FEAT").then((function(res) { var line, features = new Map; if (res.code < 400 && (line = res.message, /^\d\d\d-/.test(line))) for (var lines = res.message.split("\n").slice(1, -1), i = 0; i < lines.length; i++) { var entry = lines[i].trim().split(" "); features.set(entry[0], entry[1] || ""); } return features; })); }, Client.prototype.cd = function(path) { var self = this; return this.protectWhitespace(path).then((function(validPath) { return self.send("CWD " + validPath); })); }, Client.prototype.cdup = function() { return this.send("CDUP"); }, Client.prototype.lastMod = function(path) { var self = this; return this.protectWhitespace(path).then((function(validPath) { return self.send("MDTM " + validPath); })).then((function(res) { return parseMLSxDate(res.message.slice(4)); })); }, Client.prototype.size = function(path) { var self = this; return this.protectWhitespace(path).then((function(validPath) { var command = "SIZE " + validPath; return self.send(command).then((function(res) { var size = parseInt(res.message.slice(4), 10); if (isNaN(size)) throw new Error("Can't parse response to command '" + command + "': " + res.message); return size; })); })); }, Client.prototype.rename = function(srcPath, destPath) { var self = this; return Promise.all([ this.protectWhitespace(srcPath), this.protectWhitespace(destPath) ]).then((function(paths) { return self.send("RNFR " + paths[0]).then((function() { return self.send("RNTO " + paths[1]); })); })); }, Client.prototype.remove = function(path, ignoreErrorCodes) { var self = this; return this.protectWhitespace(path).then((function(validPath) { return ignoreErrorCodes ? self.sendIgnoringError("DELE " + validPath) : self.send("DELE " + validPath); })); }, Client.prototype.trackProgress = function(handler) { this._progressTracker.bytesOverall = 0, this._progressTracker.reportTo(handler); }, Client.prototype.uploadFrom = function(source, toRemotePath, options) { return this._uploadWithCommand(source, toRemotePath, "STOR", options || {}); }, Client.prototype.appendFrom = function(source, toRemotePath, options) { return this._uploadWithCommand(source, toRemotePath, "APPE", options || {}); }, Client.prototype._uploadWithCommand = function(source, remotePath, command, options) { return "string" == typeof source ? this._uploadLocalFile(source, remotePath, command, options) : this._uploadFromStream(source, remotePath, command); }, Client.prototype._uploadLocalFile = function(localPath, remotePath, command, options) { var fd, self = this; return fsOpen(localPath, "r").then((function(openedFd) { fd = openedFd; var source = fs.createReadStream("", { fd: fd, start: options.localStart, end: options.localEndInclusive, autoClose: !1 }); return self._uploadFromStream(source, remotePath, command).then((function(result) { return ignoreError((function() { return fsClose(fd); })).then((function() { return result; })); })).catch((function(err) { return ignoreError((function() { return fsClose(fd); })).then((function() { throw err; })); })); })); }, Client.prototype._uploadFromStream = function(source, remotePath, command) { var self = this, onError = function(err) { self.ftp.closeWithError(err); }; return source.once("error", onError), this.protectWhitespace(remotePath).then((function(validPath) { return self.prepareTransfer(self.ftp).then((function() { return (function(source, config) { var resolver = new TransferResolver(config.ftp, config.tracker), fullCommand = config.command + " " + config.remotePath; return config.ftp.handle(fullCommand, (function(res, task) { if (res instanceof Error) resolver.onError(task, res); else if (150 === res.code || 125 === res.code) { var dataSocket = config.ftp.dataSocket; if (!dataSocket) return void resolver.onError(task, new Error("Upload should begin but no data connection is available.")); function startUpload() { config.ftp.log("Uploading to " + describeAddress(dataSocket) + " (" + describeTLS(dataSocket) + ")"), resolver.onDataStart(config.remotePath, config.type), pipeline(source, dataSocket, (function(err) { err ? resolver.onError(task, err) : resolver.onDataDone(task); })); } "getCipher" in dataSocket && !dataSocket.getCipher() ? dataSocket.once("secureConnect", startUpload) : startUpload(); } else positiveCompletion(res.code) ? resolver.onControlDone(task, res) : positiveIntermediate(res.code) && resolver.onUnexpectedRequest(res); })); })(source, { ftp: self.ftp, tracker: self._progressTracker, command: command, remotePath: validPath, type: "upload" }); })); })).then((function(result) { return source.removeListener("error", onError), result; })).catch((function(err) { throw source.removeListener("error", onError), err; })); }, Client.prototype.downloadTo = function(destination, fromRemotePath, startAt) { return startAt = startAt || 0, "string" == typeof destination ? this._downloadToFile(destination, fromRemotePath, startAt) : this._downloadToStream(destination, fromRemotePath, startAt); }, Client.prototype._downloadToFile = function(localPath, remotePath, startAt) { var fd, self = this, appendingToLocalFile = startAt > 0; return fsOpen(localPath, appendingToLocalFile ? "r+" : "w").then((function(openedFd) { fd = openedFd; var destination = fs.createWriteStream("", { fd: fd, start: startAt, autoClose: !1 }); return self._downloadToStream(destination, remotePath, startAt).then((function(result) { return ignoreError((function() { return fsClose(fd); })).then((function() { return result; })); })).catch((function(err) { return ignoreError((function() { return fsStat(localPath); })).then((function(stats) { var hasData = stats && stats.size > 0; if (!appendingToLocalFile && !hasData) return ignoreError((function() { return fsUnlink(localPath); })); })).then((function() { return ignoreError((function() { return fsClose(fd); })); })).then((function() { throw err; })); })); })); }, Client.prototype._downloadToStream = function(destination, remotePath, startAt) { var self = this, onError = function(err) { self.ftp.closeWithError(err); }; return destination.once("error", onError), this.protectWhitespace(remotePath).then((function(validPath) { return self.prepareTransfer(self.ftp).then((function() { var command = startAt > 0 ? "REST " + startAt : "RETR " + validPath; return downloadTo(destination, { ftp: self.ftp, tracker: self._progressTracker, command: command, remotePath: validPath, type: "download" }); })); })).then((function(result) { return destination.removeListener("error", onError), destination.end(), result; })).catch((function(err) { throw destination.removeListener("error", onError), destination.end(), err; })); }, Client.prototype.list = function(path) { var self = this; return path = path || "", this.protectWhitespace(path).then((function(validPath) { var lastError, candidates = self.availableListCommands; return (function tryNext(index) { if (index >= candidates.length) throw lastError; var candidate = candidates[index], command = "" === validPath ? candidate : candidate + " " + validPath; return self.prepareTransfer(self.ftp).then((function() { return self._requestListWithCommand(command); })).then((function(parsedList) { return self.availableListCommands = [ candidate ], parsedList; })).catch((function(err) { if (!(err instanceof FTPError)) throw err; return lastError = err, tryNext(index + 1); })); })(0); })); }, Client.prototype._requestListWithCommand = function(command) { var self = this, buffer = new StringWriter; return downloadTo(buffer, { ftp: this.ftp, tracker: this._progressTracker, command: command, remotePath: "", type: "list" }).then((function() { var text = buffer.getText(self.ftp.encoding); return self.ftp.log(text), self.parseList(text); })); }, Client.prototype.removeDir = function(remoteDirPath) { var self = this; return this._exitAtCurrentDirectory((function() { return self.cd(remoteDirPath).then((function() { return self.pwd(); })).then((function(absoluteDirPath) { return self.clearWorkingDir().then((function() { if ("/" !== absoluteDirPath) return self.cdup().then((function() { return self.removeEmptyDir(absoluteDirPath); })); })); })); })); }, Client.prototype.clearWorkingDir = function() { var self = this; return this.list().then((function(files) { return promiseAllSequential(files, (function(file) { return file.isDirectory() ? self.cd(file.name).then((function() { return self.clearWorkingDir(); })).then((function() { return self.cdup(); })).then((function() { return self.removeEmptyDir(file.name); })) : self.remove(file.name); })); })); }, Client.prototype.uploadFromDir = function(localDirPath, remoteDirPath) { var self = this; return this._exitAtCurrentDirectory((function() { return remoteDirPath ? self.ensureDir(remoteDirPath).then((function() { return self._uploadToWorkingDir(localDirPath); })) : self._uploadToWorkingDir(localDirPath); })); }, Client.prototype._uploadToWorkingDir = function(localDirPath) { var self = this; return fsReadDir(localDirPath).then((function(files) { return promiseAllSequential(files, (function(file) { var fullPath = path.join(localDirPath, file); return fsStat(fullPath).then((function(stats) { return stats.isFile() ? self.uploadFrom(fullPath, file) : stats.isDirectory() ? self._openDir(file).then((function() { return self._uploadToWorkingDir(fullPath); })).then((function() { return self.cdup(); })) : void 0; })); })); })); }, Client.prototype.downloadToDir = function(localDirPath, remoteDirPath) { var self = this; return this._exitAtCurrentDirectory((function() { return (remoteDirPath ? self.cd(remoteDirPath) : Promise.resolve()).then((function() { return self._downloadFromWorkingDir(localDirPath); })); })); }, Client.prototype._downloadFromWorkingDir = function(localDirPath) { var dirPath, self = this; return (dirPath = localDirPath, fsStat(dirPath).catch((function() { return targetDir = dirPath, sep = path.sep, initDir = path.isAbsolute(targetDir) ? sep : "", targetDir.split(sep).reduce((function(parentDir, childDir) { var curDir = path.resolve(parentDir, childDir); return fsStat(curDir).catch((function(err) { if ("ENOENT" === err.code) return fsMkDir(curDir); if ("EEXIST" === err.code) return Promise.resolve(); throw err; })).then((function() { return curDir; })); }), initDir); var targetDir, sep, initDir; }))).then((function() { return self.list(); })).then((function(files) { return promiseAllSequential(files, (function(file) { var localPath = path.join(localDirPath, file.name); return file.isDirectory() ? self.cd(file.name).then((function() { return self._downloadFromWorkingDir(localPath); })).then((function() { return self.cdup(); })) : file.isFile() ? self.downloadTo(localPath, file.name) : void 0; })); })); }, Client.prototype.ensureDir = function(remoteDirPath) { var self = this, promise = Promise.resolve(); 0 === remoteDirPath.indexOf("/") && (promise = this.cd("/")); var names = remoteDirPath.split("/").filter((function(name) { return "" !== name; })); return promise.then((function() { return promiseAllSequential(names, (function(name) { return self._openDir(name); })); })); }, Client.prototype._openDir = function(dirName) { var self = this; return this.sendIgnoringError("MKD " + dirName).then((function() { return self.cd(dirName); })); }, Client.prototype.removeEmptyDir = function(path) { var self = this; return this.protectWhitespace(path).then((function(validPath) { return self.send("RMD " + validPath); })); }, Client.prototype.protectWhitespace = function(path) { return 0 !== path.indexOf(" ") ? Promise.resolve(path) : this.pwd().then((function(pwd) { return ("/" === pwd.charAt(pwd.length - 1) ? pwd : pwd + "/") + path; })); }, Client.prototype._exitAtCurrentDirectory = function(func) { var userDir, self = this; return this.pwd().then((function(dir) { return userDir = dir, func(); })).then((function(result) { return self.closed ? result : ignoreError((function() { return self.cd(userDir); })).then((function() { return result; })); })).catch((function(err) { if (!self.closed) return ignoreError((function() { return self.cd(userDir); })).then((function() { throw err; })); throw err; })); }, Client.prototype._enterFirstCompatibleMode = function(strategies) { var self = this; return function(ftp) { var lastError; return ftp.log("Trying to find optimal transfer strategy..."), (function tryStrategy(index) { if (index >= strategies.length) throw new Error("None of the available transfer strategies work. Last error: " + lastError); return strategies[index](ftp).then((function(res) { return ftp.log("Optimal transfer strategy found."), self.prepareTransfer = strategies[index], res; })).catch((function(err) { return lastError = err, tryStrategy(index + 1); })); })(0); }; }, Client.prototype.upload = function(source, toRemotePath, options) { return this.ftp.log("Warning: upload() has been deprecated, use uploadFrom()."), this.uploadFrom(source, toRemotePath, options); }, Client.prototype.append = function(source, toRemotePath, options) { return this.ftp.log("Warning: append() has been deprecated, use appendFrom()."), this.appendFrom(source, toRemotePath, options); }, Client.prototype.download = function(destination, fromRemotePath, startAt) { return this.ftp.log("Warning: download() has been deprecated, use downloadTo()."), this.downloadTo(destination, fromRemotePath, startAt); }, Client.prototype.uploadDir = function(localDirPath, remoteDirPath) { return this.ftp.log("Warning: uploadDir() has been deprecated, use uploadFromDir()."), this.uploadFromDir(localDirPath, remoteDirPath); }, Client.prototype.downloadDir = function(localDirPath) { return this.ftp.log("Warning: downloadDir() has been deprecated, use downloadToDir()."), this.downloadToDir(localDirPath); }, exports.Client = Client, exports.FTPContext = FTPContext, exports.FTPError = FTPError, exports.FileInfo = FileInfo, exports.FileType = FileType, exports.parseList = parseList, exports.enterPassiveModeIPv4 = enterPassiveModeIPv4, exports.enterPassiveModeIPv6 = enterPassiveModeIPv6, exports.default = { Client: Client, FTPContext: FTPContext, FTPError: FTPError, FileInfo: FileInfo, FileType: FileType, parseList: parseList, enterPassiveModeIPv4: enterPassiveModeIPv4, enterPassiveModeIPv6: enterPassiveModeIPv6 }; }, function(module, exports, __webpack_require__) { const mime = __webpack_require__(45); module.exports = function(obj) { return mime.lookup(obj.name) || "application/octet-stream"; }; }, function(module, exports, __webpack_require__) { "use strict"; function URLSearchParams(init) { if (this._params = [], init) if ("string" == typeof init) { 0 === init.indexOf("?") && (init = init.slice(1)); for (var pairs = init.split("&"), i = 0; i < pairs.length; i++) { var pair = pairs[i]; if ("" !== pair) { var key, value, separatorIndex = pair.indexOf("="); -1 === separatorIndex ? (key = pair, value = "") : (key = pair.slice(0, separatorIndex), value = pair.slice(separatorIndex + 1)), key = decodeURIComponent(key.replace(/\+/g, " ")), value = decodeURIComponent(value.replace(/\+/g, " ")), this._params.push([ key, value ]); } } } else if ("object" == typeof init && null !== init) for (var prop in init) Object.prototype.hasOwnProperty.call(init, prop) && this._params.push([ prop, String(init[prop]) ]); } function URL(urlString, base) { if (!(this instanceof URL)) throw new TypeError("Failed to construct 'URL': Please use the 'new' operator."); if (base) throw new Error("Base URL is not fully supported in this shim."); var match = /^(?:([a-z][a-z0-9+.-]*):)?(?:\/\/)?(?:([^:@]*)?(?::([^:@]*))?@)?((?:[a-z0-9\u00a1-\uffff-.]*)*)(?::(\d*))?((?:\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?$/i.exec(urlString); if (!match) throw new TypeError("Invalid URL: " + urlString); var self = this; self._protocol = match[1] ? match[1].toLowerCase() + ":" : "", self._username = match[2] ? decodeURIComponent(match[2]) : "", self._password = match[3] ? decodeURIComponent(match[3]) : "", self._hostname = match[4] ? match[4].toLowerCase() : "", self._port = match[5] || "", self._pathname = match[6] || (match[4] ? "/" : ""), self._search = match[8] ? "?" + match[8] : "", self._hash = match[9] ? "#" + match[9] : "", self._searchParams = new URLSearchParams(self._search), Object.defineProperty(this, "search", { get: function() { var s = self._searchParams.toString(); return s ? "?" + s : ""; }, set: function(value) { self._searchParams = new URLSearchParams(value); } }), Object.defineProperty(this, "href", { get: function() { var href = self.protocol + "//"; return (self.username || self.password) && (href += self.username, self.password && (href += ":" + self.password), href += "@"), href += self.hostname, self.port && (href += ":" + self.port), href + (self.pathname + self.search + self.hash); }, set: function(value) { var newUrl = new URL(value); self._protocol = newUrl._protocol, self._username = newUrl._username, self._password = newUrl._password, self._hostname = newUrl._hostname, self._port = newUrl._port, self._pathname = newUrl._pathname, self.search = newUrl._search, self._hash = newUrl._hash; } }); } URLSearchParams.prototype.append = function(name, value) { this._params.push([ name, value ]); }, URLSearchParams.prototype.delete = function(name) { this._params = this._params.filter((function(pair) { return pair[0] !== name; })); }, URLSearchParams.prototype.get = function(name) { for (var i = 0; i < this._params.length; i++) if (this._params[i][0] === name) return this._params[i][1]; return null; }, URLSearchParams.prototype.getAll = function(name) { for (var result = [], i = 0; i < this._params.length; i++) this._params[i][0] === name && result.push(this._params[i][1]); return result; }, URLSearchParams.prototype.has = function(name) { for (var i = 0; i < this._params.length; i++) if (this._params[i][0] === name) return !0; return !1; }, URLSearchParams.prototype.set = function(name, value) { for (var found = !1, i = 0; i < this._params.length; i++) this._params[i][0] === name && (found ? (this._params.splice(i, 1), i--) : (this._params[i][1] = value, found = !0)); found || this.append(name, value); }, URLSearchParams.prototype.toString = function() { return this._params.map((function(pair) { return encodeURIComponent(pair[0]).replace(/%20/g, "+") + "=" + encodeURIComponent(pair[1]).replace(/%20/g, "+"); })).join("&"); }; for (var readonly_props = [ "protocol", "hostname", "port", "pathname", "hash", "searchParams", "username", "password" ], j = 0; j < readonly_props.length; j++) !(function(prop) { Object.defineProperty(URL.prototype, prop, { get: function() { return this["_" + prop]; }, enumerable: !0 }); })(readonly_props[j]); Object.defineProperty(URL.prototype, "host", { get: function() { return this._hostname + (this._port ? ":" + this._port : ""); }, enumerable: !0 }), Object.defineProperty(URL.prototype, "origin", { get: function() { return this._protocol + "//" + this.host; }, enumerable: !0 }), URL.prototype.toString = function() { return this.href; }, URL.prototype.toJSON = function() { return this.href; }, module.exports = { URL: URL, URLSearchParams: URLSearchParams }; } ]);