UNPKG

@webwriter/timeline

Version:

Create/learn with a digital timeline and test your knowledge.

1,352 lines (1,351 loc) 897 kB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, { get: (a5, b4) => (typeof require !== "undefined" ? require : a5)[b4] }) : x3)(function(x3) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x3 + '" is not supported'); }); var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __decorateClass = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; for (var i8 = decorators.length - 1, decorator; i8 >= 0; i8--) if (decorator = decorators[i8]) result = (kind ? decorator(target, key, result) : decorator(result)) || result; if (kind && result) __defProp(target, key, result); return result; }; // node_modules/moment/moment.js var require_moment = __commonJS({ "node_modules/moment/moment.js"(exports, module) { (function(global, factory) { typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global.moment = factory(); })(exports, function() { "use strict"; var hookCallback; function hooks() { return hookCallback.apply(null, arguments); } function setHookCallback(callback) { hookCallback = callback; } function isArray(input) { return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]"; } function isObject(input) { return input != null && Object.prototype.toString.call(input) === "[object Object]"; } function hasOwnProp(a5, b4) { return Object.prototype.hasOwnProperty.call(a5, b4); } function isObjectEmpty(obj) { if (Object.getOwnPropertyNames) { return Object.getOwnPropertyNames(obj).length === 0; } else { var k3; for (k3 in obj) { if (hasOwnProp(obj, k3)) { return false; } } return true; } } function isUndefined(input) { return input === void 0; } function isNumber(input) { return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]"; } function isDate(input) { return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]"; } function map(arr, fn) { var res = [], i8, arrLen = arr.length; for (i8 = 0; i8 < arrLen; ++i8) { res.push(fn(arr[i8], i8)); } return res; } function extend(a5, b4) { for (var i8 in b4) { if (hasOwnProp(b4, i8)) { a5[i8] = b4[i8]; } } if (hasOwnProp(b4, "toString")) { a5.toString = b4.toString; } if (hasOwnProp(b4, "valueOf")) { a5.valueOf = b4.valueOf; } return a5; } function createUTC(input, format2, locale2, strict) { return createLocalOrUTC(input, format2, locale2, strict, true).utc(); } function defaultParsingFlags() { return { empty: false, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: false, invalidEra: null, invalidMonth: null, invalidFormat: false, userInvalidated: false, iso: false, parsedDateParts: [], era: null, meridiem: null, rfc2822: false, weekdayMismatch: false }; } function getParsingFlags(m4) { if (m4._pf == null) { m4._pf = defaultParsingFlags(); } return m4._pf; } var some; if (Array.prototype.some) { some = Array.prototype.some; } else { some = function(fun) { var t8 = Object(this), len = t8.length >>> 0, i8; for (i8 = 0; i8 < len; i8++) { if (i8 in t8 && fun.call(this, t8[i8], i8, t8)) { return true; } } return false; }; } function isValid(m4) { var flags = null, parsedParts = false, isNowValid = m4._d && !isNaN(m4._d.getTime()); if (isNowValid) { flags = getParsingFlags(m4); parsedParts = some.call(flags.parsedDateParts, function(i8) { return i8 != null; }); isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts); if (m4._strict) { isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0; } } if (Object.isFrozen == null || !Object.isFrozen(m4)) { m4._isValid = isNowValid; } else { return isNowValid; } return m4._isValid; } function createInvalid(flags) { var m4 = createUTC(NaN); if (flags != null) { extend(getParsingFlags(m4), flags); } else { getParsingFlags(m4).userInvalidated = true; } return m4; } var momentProperties = hooks.momentProperties = [], updateInProgress = false; function copyConfig(to2, from2) { var i8, prop, val, momentPropertiesLen = momentProperties.length; if (!isUndefined(from2._isAMomentObject)) { to2._isAMomentObject = from2._isAMomentObject; } if (!isUndefined(from2._i)) { to2._i = from2._i; } if (!isUndefined(from2._f)) { to2._f = from2._f; } if (!isUndefined(from2._l)) { to2._l = from2._l; } if (!isUndefined(from2._strict)) { to2._strict = from2._strict; } if (!isUndefined(from2._tzm)) { to2._tzm = from2._tzm; } if (!isUndefined(from2._isUTC)) { to2._isUTC = from2._isUTC; } if (!isUndefined(from2._offset)) { to2._offset = from2._offset; } if (!isUndefined(from2._pf)) { to2._pf = getParsingFlags(from2); } if (!isUndefined(from2._locale)) { to2._locale = from2._locale; } if (momentPropertiesLen > 0) { for (i8 = 0; i8 < momentPropertiesLen; i8++) { prop = momentProperties[i8]; val = from2[prop]; if (!isUndefined(val)) { to2[prop] = val; } } } return to2; } function Moment2(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); if (!this.isValid()) { this._d = /* @__PURE__ */ new Date(NaN); } if (updateInProgress === false) { updateInProgress = true; hooks.updateOffset(this); updateInProgress = false; } } function isMoment(obj) { return obj instanceof Moment2 || obj != null && obj._isAMomentObject != null; } function warn(msg) { if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) { console.warn("Deprecation warning: " + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function() { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(null, msg); } if (firstTime) { var args = [], arg, i8, key, argLen = arguments.length; for (i8 = 0; i8 < argLen; i8++) { arg = ""; if (typeof arguments[i8] === "object") { arg += "\n[" + i8 + "] "; for (key in arguments[0]) { if (hasOwnProp(arguments[0], key)) { arg += key + ": " + arguments[0][key] + ", "; } } arg = arg.slice(0, -2); } else { arg = arguments[i8]; } args.push(arg); } warn( msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack ); firstTime = false; } return fn.apply(this, arguments); }, fn); } var deprecations = {}; function deprecateSimple(name, msg) { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(name, msg); } if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } hooks.suppressDeprecationWarnings = false; hooks.deprecationHandler = null; function isFunction(input) { return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]"; } function set(config) { var prop, i8; for (i8 in config) { if (hasOwnProp(config, i8)) { prop = config[i8]; if (isFunction(prop)) { this[i8] = prop; } else { this["_" + i8] = prop; } } } this._config = config; this._dayOfMonthOrdinalParseLenient = new RegExp( (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source ); } function mergeConfigs(parentConfig, childConfig) { var res = extend({}, parentConfig), prop; for (prop in childConfig) { if (hasOwnProp(childConfig, prop)) { if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { res[prop] = {}; extend(res[prop], parentConfig[prop]); extend(res[prop], childConfig[prop]); } else if (childConfig[prop] != null) { res[prop] = childConfig[prop]; } else { delete res[prop]; } } } for (prop in parentConfig) { if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) { res[prop] = extend({}, res[prop]); } } return res; } function Locale(config) { if (config != null) { this.set(config); } } var keys; if (Object.keys) { keys = Object.keys; } else { keys = function(obj) { var i8, res = []; for (i8 in obj) { if (hasOwnProp(obj, i8)) { res.push(i8); } } return res; }; } var defaultCalendar = { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }; function calendar(key, mom, now2) { var output = this._calendar[key] || this._calendar["sameElse"]; return isFunction(output) ? output.call(mom, now2) : output; } function zeroFill(number, targetLength, forceSign) { var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign2 = number >= 0; return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; function addFormatToken(token2, padded, ordinal2, callback) { var func = callback; if (typeof callback === "string") { func = function() { return this[callback](); }; } if (token2) { formatTokenFunctions[token2] = func; } if (padded) { formatTokenFunctions[padded[0]] = function() { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal2) { formatTokenFunctions[ordinal2] = function() { return this.localeData().ordinal( func.apply(this, arguments), token2 ); }; } } function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ""); } return input.replace(/\\/g, ""); } function makeFormatFunction(format2) { var array = format2.match(formattingTokens), i8, length; for (i8 = 0, length = array.length; i8 < length; i8++) { if (formatTokenFunctions[array[i8]]) { array[i8] = formatTokenFunctions[array[i8]]; } else { array[i8] = removeFormattingTokens(array[i8]); } } return function(mom) { var output = "", i9; for (i9 = 0; i9 < length; i9++) { output += isFunction(array[i9]) ? array[i9].call(mom, format2) : array[i9]; } return output; }; } function formatMoment(m4, format2) { if (!m4.isValid()) { return m4.localeData().invalidDate(); } format2 = expandFormat(format2, m4.localeData()); formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2); return formatFunctions[format2](m4); } function expandFormat(format2, locale2) { var i8 = 5; function replaceLongDateFormatTokens(input) { return locale2.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i8 >= 0 && localFormattingTokens.test(format2)) { format2 = format2.replace( localFormattingTokens, replaceLongDateFormatTokens ); localFormattingTokens.lastIndex = 0; i8 -= 1; } return format2; } var defaultLongDateFormat = { 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" }; function longDateFormat(key) { var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format2 || !formatUpper) { return format2; } this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) { if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") { return tok.slice(1); } return tok; }).join(""); return this._longDateFormat[key]; } var defaultInvalidDate = "Invalid date"; function invalidDate() { return this._invalidDate; } var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/; function ordinal(number) { return this._ordinal.replace("%d", number); } var defaultRelativeTime = { future: "in %s", past: "%s ago", s: "a few seconds", ss: "%d seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", w: "a week", ww: "%d weeks", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }; function relativeTime(number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture(diff2, output) { var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"]; return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output); } var aliases = { D: "date", dates: "date", date: "date", d: "day", days: "day", day: "day", e: "weekday", weekdays: "weekday", weekday: "weekday", E: "isoWeekday", isoweekdays: "isoWeekday", isoweekday: "isoWeekday", DDD: "dayOfYear", dayofyears: "dayOfYear", dayofyear: "dayOfYear", h: "hour", hours: "hour", hour: "hour", ms: "millisecond", milliseconds: "millisecond", millisecond: "millisecond", m: "minute", minutes: "minute", minute: "minute", M: "month", months: "month", month: "month", Q: "quarter", quarters: "quarter", quarter: "quarter", s: "second", seconds: "second", second: "second", gg: "weekYear", weekyears: "weekYear", weekyear: "weekYear", GG: "isoWeekYear", isoweekyears: "isoWeekYear", isoweekyear: "isoWeekYear", w: "week", weeks: "week", week: "week", W: "isoWeek", isoweeks: "isoWeek", isoweek: "isoWeek", y: "year", years: "year", year: "year" }; function normalizeUnits(units) { return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } var priorities = { date: 9, day: 11, weekday: 11, isoWeekday: 11, dayOfYear: 4, hour: 13, millisecond: 16, minute: 14, month: 8, quarter: 7, second: 15, weekYear: 1, isoWeekYear: 1, week: 5, isoWeek: 5, year: 1 }; function getPrioritizedUnits(unitsObj) { var units = [], u6; for (u6 in unitsObj) { if (hasOwnProp(unitsObj, u6)) { units.push({ unit: u6, priority: priorities[u6] }); } } units.sort(function(a5, b4) { return a5.priority - b4.priority; }); return units; } var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\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, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, match1to2HasZero = /^([1-9]\d|\d)/, regexes; regexes = {}; function addRegexToken(token2, regex, strictRegex) { regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) { return isStrict && strictRegex ? strictRegex : regex; }; } function getParseRegexForToken(token2, config) { if (!hasOwnProp(regexes, token2)) { return new RegExp(unescapeFormat(token2)); } return regexes[token2](config._strict, config._locale); } function unescapeFormat(s5) { return regexEscape( s5.replace("\\", "").replace( /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p22, p32, p4) { return p1 || p22 || p32 || p4; } ) ); } function regexEscape(s5) { return s5.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); } function absFloor(number) { if (number < 0) { return Math.ceil(number) || 0; } else { return Math.floor(number); } } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } var tokens = {}; function addParseToken(token2, callback) { var i8, func = callback, tokenLen; if (typeof token2 === "string") { token2 = [token2]; } if (isNumber(callback)) { func = function(input, array) { array[callback] = toInt(input); }; } tokenLen = token2.length; for (i8 = 0; i8 < tokenLen; i8++) { tokens[token2[i8]] = func; } } function addWeekParseToken(token2, callback) { addParseToken(token2, function(input, array, config, token3) { config._w = config._w || {}; callback(input, config._w, config, token3); }); } function addTimeToArrayFromToken(token2, input, config) { if (input != null && hasOwnProp(tokens, token2)) { tokens[token2](input, config._a, config, token2); } } function isLeapYear(year) { return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; } var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8; addFormatToken("Y", 0, 0, function() { var y4 = this.year(); return y4 <= 9999 ? zeroFill(y4, 4) : "+" + y4; }); 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, true], 0, "year"); addRegexToken("Y", matchSigned); addRegexToken("YY", match1to2, match2); addRegexToken("YYYY", match1to4, match4); addRegexToken("YYYYY", match1to6, match6); addRegexToken("YYYYYY", match1to6, match6); addParseToken(["YYYYY", "YYYYYY"], YEAR); addParseToken("YYYY", function(input, array) { array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken("YY", function(input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); addParseToken("Y", function(input, array) { array[YEAR] = parseInt(input, 10); }); function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } hooks.parseTwoDigitYear = function(input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3); }; var getSetYear = makeGetSet("FullYear", true); function getIsLeapYear() { return isLeapYear(this.year()); } function makeGetSet(unit, keepTime) { return function(value) { if (value != null) { set$1(this, unit, value); hooks.updateOffset(this, keepTime); return this; } else { return get(this, unit); } }; } function get(mom, unit) { if (!mom.isValid()) { return NaN; } var d4 = mom._d, isUTC = mom._isUTC; switch (unit) { case "Milliseconds": return isUTC ? d4.getUTCMilliseconds() : d4.getMilliseconds(); case "Seconds": return isUTC ? d4.getUTCSeconds() : d4.getSeconds(); case "Minutes": return isUTC ? d4.getUTCMinutes() : d4.getMinutes(); case "Hours": return isUTC ? d4.getUTCHours() : d4.getHours(); case "Date": return isUTC ? d4.getUTCDate() : d4.getDate(); case "Day": return isUTC ? d4.getUTCDay() : d4.getDay(); case "Month": return isUTC ? d4.getUTCMonth() : d4.getMonth(); case "FullYear": return isUTC ? d4.getUTCFullYear() : d4.getFullYear(); default: return NaN; } } function set$1(mom, unit, value) { var d4, isUTC, year, month, date; if (!mom.isValid() || isNaN(value)) { return; } d4 = mom._d; isUTC = mom._isUTC; switch (unit) { case "Milliseconds": return void (isUTC ? d4.setUTCMilliseconds(value) : d4.setMilliseconds(value)); case "Seconds": return void (isUTC ? d4.setUTCSeconds(value) : d4.setSeconds(value)); case "Minutes": return void (isUTC ? d4.setUTCMinutes(value) : d4.setMinutes(value)); case "Hours": return void (isUTC ? d4.setUTCHours(value) : d4.setHours(value)); case "Date": return void (isUTC ? d4.setUTCDate(value) : d4.setDate(value)); // case 'Day': // Not real // return void (isUTC ? d.setUTCDay(value) : d.setDay(value)); // case 'Month': // Not used because we need to pass two variables // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value)); case "FullYear": break; // See below ... default: return; } year = value; month = mom.month(); date = mom.date(); date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date; void (isUTC ? d4.setUTCFullYear(year, month, date) : d4.setFullYear(year, month, date)); } function stringGet(units) { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](); } return this; } function stringSet(units, value) { if (typeof units === "object") { units = normalizeObjectUnits(units); var prioritized = getPrioritizedUnits(units), i8, prioritizedLen = prioritized.length; for (i8 = 0; i8 < prioritizedLen; i8++) { this[prioritized[i8].unit](units[prioritized[i8].unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; } function mod(n11, x3) { return (n11 % x3 + x3) % x3; } var indexOf; if (Array.prototype.indexOf) { indexOf = Array.prototype.indexOf; } else { indexOf = function(o15) { var i8; for (i8 = 0; i8 < this.length; ++i8) { if (this[i8] === o15) { return i8; } } return -1; }; } function daysInMonth(year, month) { if (isNaN(year) || isNaN(month)) { return NaN; } var modMonth = mod(month, 12); year += (month - modMonth) / 12; return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2; } addFormatToken("M", ["MM", 2], "Mo", function() { return this.month() + 1; }); addFormatToken("MMM", 0, 0, function(format2) { return this.localeData().monthsShort(this, format2); }); addFormatToken("MMMM", 0, 0, function(format2) { return this.localeData().months(this, format2); }); addRegexToken("M", match1to2, match1to2NoLeadingZero); addRegexToken("MM", match1to2, match2); addRegexToken("MMM", function(isStrict, locale2) { return locale2.monthsShortRegex(isStrict); }); addRegexToken("MMMM", function(isStrict, locale2) { return locale2.monthsRegex(isStrict); }); addParseToken(["M", "MM"], function(input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(["MMM", "MMMM"], function(input, array, config, token2) { var month = config._locale.monthsParse(input, token2, config._strict); if (month != null) { array[MONTH] = month; } else { getParsingFlags(config).invalidMonth = input; } }); var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split( "_" ), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord; function localeMonths(m4, format2) { if (!m4) { return isArray(this._months) ? this._months : this._months["standalone"]; } return isArray(this._months) ? this._months[m4.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m4.month()]; } function localeMonthsShort(m4, format2) { if (!m4) { return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"]; } return isArray(this._monthsShort) ? this._monthsShort[m4.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m4.month()]; } function handleStrictParse(monthName, format2, strict) { var i8, ii, mom, llc = monthName.toLocaleLowerCase(); if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; for (i8 = 0; i8 < 12; ++i8) { mom = createUTC([2e3, i8]); this._shortMonthsParse[i8] = this.monthsShort( mom, "" ).toLocaleLowerCase(); this._longMonthsParse[i8] = this.months(mom, "").toLocaleLowerCase(); } } if (strict) { if (format2 === "MMM") { ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } } else { if (format2 === "MMM") { ii = indexOf.call(this._shortMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } } } function localeMonthsParse(monthName, format2, strict) { var i8, mom, regex; if (this._monthsParseExact) { return handleStrictParse.call(this, monthName, format2, strict); } if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } for (i8 = 0; i8 < 12; i8++) { mom = createUTC([2e3, i8]); if (strict && !this._longMonthsParse[i8]) { this._longMonthsParse[i8] = new RegExp( "^" + this.months(mom, "").replace(".", "") + "$", "i" ); this._shortMonthsParse[i8] = new RegExp( "^" + this.monthsShort(mom, "").replace(".", "") + "$", "i" ); } if (!strict && !this._monthsParse[i8]) { regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, ""); this._monthsParse[i8] = new RegExp(regex.replace(".", ""), "i"); } if (strict && format2 === "MMMM" && this._longMonthsParse[i8].test(monthName)) { return i8; } else if (strict && format2 === "MMM" && this._shortMonthsParse[i8].test(monthName)) { return i8; } else if (!strict && this._monthsParse[i8].test(monthName)) { return i8; } } } function setMonth(mom, value) { if (!mom.isValid()) { return mom; } if (typeof value === "string") { if (/^\d+$/.test(value)) { value = toInt(value); } else { value = mom.localeData().monthsParse(value); if (!isNumber(value)) { return mom; } } } var month = value, date = mom.date(); date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month)); void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date)); return mom; } function getSetMonth(value) { if (value != null) { setMonth(this, value); hooks.updateOffset(this, true); return this; } else { return get(this, "Month"); } } function getDaysInMonth() { return daysInMonth(this.year(), this.month()); } function monthsShortRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, "_monthsRegex")) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsShortStrictRegex; } else { return this._monthsShortRegex; } } else { if (!hasOwnProp(this, "_monthsShortRegex")) { this._monthsShortRegex = defaultMonthsShortRegex; } return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; } } function monthsRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, "_monthsRegex")) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsStrictRegex; } else { return this._monthsRegex; } } else { if (!hasOwnProp(this, "_monthsRegex")) { this._monthsRegex = defaultMonthsRegex; } return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; } } function computeMonthsParse() { function cmpLenRev(a5, b4) { return b4.length - a5.length; } var shortPieces = [], longPieces = [], mixedPieces = [], i8, mom, shortP, longP; for (i8 = 0; i8 < 12; i8++) { mom = createUTC([2e3, i8]); shortP = regexEscape(this.monthsShort(mom, "")); longP = regexEscape(this.months(mom, "")); shortPieces.push(shortP); longPieces.push(longP); mixedPieces.push(longP); mixedPieces.push(shortP); } shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i"); this._monthsShortRegex = this._monthsRegex; this._monthsStrictRegex = new RegExp( "^(" + longPieces.join("|") + ")", "i" ); this._monthsShortStrictRegex = new RegExp( "^(" + shortPieces.join("|") + ")", "i" ); } function createDate(y4, m4, d4, h6, M3, s5, ms) { var date; if (y4 < 100 && y4 >= 0) { date = new Date(y4 + 400, m4, d4, h6, M3, s5, ms); if (isFinite(date.getFullYear())) { date.setFullYear(y4); } } else { date = new Date(y4, m4, d4, h6, M3, s5, ms); } return date; } function createUTCDate(y4) { var date, args; if (y4 < 100 && y4 >= 0) { args = Array.prototype.slice.call(arguments); args[0] = y4 + 400; date = new Date(Date.UTC.apply(null, args)); if (isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y4); } } else { date = new Date(Date.UTC.apply(null, arguments)); } return date; } function firstWeekOffset(year, dow, doy) { var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } function dayOfYearFromWeeks(year, week, weekday, dow, doy) { var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; if (dayOfYear <= 0) { resYear = year - 1; resDayOfYear = daysInYear(resYear) + dayOfYear; } else if (dayOfYear > daysInYear(year)) { resYear = year + 1; resDayOfYear = dayOfYear - daysInYear(year); } else { resYear = year; resDayOfYear = dayOfYear; } return { year: resYear, dayOfYear: resDayOfYear }; } function weekOfYear(mom, dow, doy) { var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; if (week < 1) { resYear = mom.year() - 1; resWeek = week + weeksInYear(resYear, dow, doy); } else if (week > weeksInYear(mom.year(), dow, doy)) { resWeek = week - weeksInYear(mom.year(), dow, doy); resYear = mom.year() + 1; } else { resYear = mom.year(); resWeek = week; } return { week: resWeek, year: resYear }; } function weeksInYear(year, dow, doy) { var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } addFormatToken("w", ["ww", 2], "wo", "week"); addFormatToken("W", ["WW", 2], "Wo", "isoWeek"); addRegexToken("w", match1to2, match1to2NoLeadingZero); addRegexToken("ww", match1to2, match2); addRegexToken("W", match1to2, match1to2NoLeadingZero); addRegexToken("WW", match1to2, match2); addWeekParseToken( ["w", "ww", "W", "WW"], function(input, week, config, token2) { week[token2.substr(0, 1)] = toInt(input); } ); function localeWeek(mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } var defaultLocaleWeek = { dow: 0, // Sunday is the first day of the week. doy: 6 // The week that contains Jan 6th is the first week of the year. }; function localeFirstDayOfWeek() { return this._week.dow; } function localeFirstDayOfYear() { return this._week.doy; } function getSetWeek(input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, "d"); } function getSetISOWeek(input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, "d"); } addFormatToken("d", 0, "do", "day"); addFormatToken("dd", 0, 0, function(format2) { return this.localeData().weekdaysMin(this, format2); }); addFormatToken("ddd", 0, 0, function(format2) { return this.localeData().weekdaysShort(this, format2); }); addFormatToken("dddd", 0, 0, function(format2) { return this.localeData().weekdays(this, format2); }); addFormatToken("e", 0, 0, "weekday"); addFormatToken("E", 0, 0, "isoWeekday"); addRegexToken("d", match1to2); addRegexToken("e", match1to2); addRegexToken("E", match1to2); addRegexToken("dd", function(isStrict, locale2) { return locale2.weekdaysMinRegex(isStrict); }); addRegexToken("ddd", function(isStrict, locale2) { return locale2.weekdaysShortRegex(isStrict); }); addRegexToken("dddd", function(isStrict, locale2) { return locale2.weekdaysRegex(isStrict); }); addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token2) { var weekday = config._locale.weekdaysParse(input, token2, config._strict); if (weekday != null) { week.d = weekday; } else { getParsingFlags(config).invalidWeekday = input; } }); addWeekParseToken(["d", "e", "E"], function(input, week, config, token2) { week[token2] = toInt(input); }); function parseWeekday(input, locale2) { if (typeof input !== "string") { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale2.weekdaysParse(input); if (typeof input === "number") { return input; } return null; } function parseIsoWeekday(input, locale2) { if (typeof input === "string") { return locale2.weekdaysParse(input) % 7 || 7; } return isNaN(input) ? null : input; } function shiftWeekdays(ws, n11) { return ws.slice(n11, 7).concat(ws.slice(0, n11)); } var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord; function localeWeekdays(m4, format2) { var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m4 && m4 !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"]; return m4 === true ? shiftWeekdays(weekdays, this._week.dow) : m4 ? weekdays[m4.day()] : weekdays; } function localeWeekdaysShort(m4) { return m4 === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m4 ? this._weekdaysShort[m4.day()] : this._weekdaysShort; } function localeWeekdaysMin(m4) { return m4 === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m4 ? this._weekdaysMin[m4.day()] : this._weekdaysMin; } function handleStrictParse$1(weekdayName, format2, strict) { var i8, ii, mom, llc = weekdayName.toLocaleLowerCase(); if (!this._weekdaysParse) { this._weekdaysParse = []; this._shortWeekdaysParse = []; this._minWeekdaysParse = []; for (i8 = 0; i8 < 7; ++i8) { mom = createUTC([2e3, 1]).day(i8); this._minWeekdaysParse[i8] = this.weekdaysMin( mom, "" ).toLocaleLowerCase(); this._shortWeekdaysParse[i8] = this.weekdaysShort( mom, "" ).toLocaleLowerCase(); this._weekdaysParse[i8] = this.weekdays(mom, "").toLocaleLowerCase(); } } if (strict) { if (format2 === "dddd") { ii = indexOf.call(this._weekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format2 === "ddd") { ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } } else { if (format2 === "dddd") { ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format2 === "ddd") { ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } } } function localeWeekdaysParse(weekdayName, format2, strict) { var i8, mom, regex; if (this._weekdaysParseExact) { return handleStrictParse$1.call(this, weekdayName, format2, strict); } if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; this._shortWeekdaysParse = []; this._fullWeekdaysParse = []; } for (i8 = 0; i8 < 7; i8++) { mom = createUTC([2e3, 1]).day(i8); if (strict && !this._fullWeekdaysParse[i8]) { this._fullWeekdaysParse[i8] = new RegExp( "^" + this.weekdays(mom, "").replace(".", "\\.?") + "$", "i" ); this._shortWeekdaysParse[i8] = new RegExp( "^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$", "i" ); this._minWeekdaysParse[i8] = new RegExp( "^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$", "i" ); } if (!this._weekdaysParse[i8]) { regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, ""); this._weekdaysParse[i8] = new RegExp(regex.replace(".", ""), "i"); } if (strict && format2 === "dddd" && this._fullWeekdaysParse[i8].test(weekdayName)) { return i8; } else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i8].test(weekdayName)) { return i8; } else if (strict && format2 === "dd" && this._minWeekdaysParse[i8].test(weekdayName)) { return i8; } else if (!strict && this._weekdaysParse[i8].test(weekdayName)) { return i8; } } } function getSetDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var day = get(this, "Day"); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, "d"); } else { return day; } } function getSetLocaleDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, "d"); } function getSetISODayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { var weekday = parseIsoWeekday(input, this.localeData()); return this.day(this.day() % 7 ? weekday : weekday - 7); } else { return this.day() || 7; } } function weekdaysRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, "_weekdaysRegex")) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysStrictRegex; } else { return this._weekdaysRegex; } } else { if (!hasOwnProp(this, "_weekdaysRegex")) { this._weekdaysRegex = defaultWeekdaysRegex; } return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; } } function weekdaysShortRegex(isStrict) { if (this._weekd