wp/wp-includes/js/dist/vendor/moment.js
changeset 22 8c2e4d02f4ef
parent 19 3d72ae0968f4
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
     1 //! moment.js
     1 //! moment.js
     2 //! version : 2.29.4
     2 //! version : 2.30.1
     3 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
     3 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
     4 //! license : MIT
     4 //! license : MIT
     5 //! momentjs.com
     5 //! momentjs.com
     6 
     6 
     7 ;(function (global, factory) {
     7 ;(function (global, factory) {
   153             return false;
   153             return false;
   154         };
   154         };
   155     }
   155     }
   156 
   156 
   157     function isValid(m) {
   157     function isValid(m) {
   158         if (m._isValid == null) {
   158         var flags = null,
   159             var flags = getParsingFlags(m),
   159             parsedParts = false,
   160                 parsedParts = some.call(flags.parsedDateParts, function (i) {
   160             isNowValid = m._d && !isNaN(m._d.getTime());
   161                     return i != null;
   161         if (isNowValid) {
   162                 }),
   162             flags = getParsingFlags(m);
   163                 isNowValid =
   163             parsedParts = some.call(flags.parsedDateParts, function (i) {
   164                     !isNaN(m._d.getTime()) &&
   164                 return i != null;
   165                     flags.overflow < 0 &&
   165             });
   166                     !flags.empty &&
   166             isNowValid =
   167                     !flags.invalidEra &&
   167                 flags.overflow < 0 &&
   168                     !flags.invalidMonth &&
   168                 !flags.empty &&
   169                     !flags.invalidWeekday &&
   169                 !flags.invalidEra &&
   170                     !flags.weekdayMismatch &&
   170                 !flags.invalidMonth &&
   171                     !flags.nullInput &&
   171                 !flags.invalidWeekday &&
   172                     !flags.invalidFormat &&
   172                 !flags.weekdayMismatch &&
   173                     !flags.userInvalidated &&
   173                 !flags.nullInput &&
   174                     (!flags.meridiem || (flags.meridiem && parsedParts));
   174                 !flags.invalidFormat &&
   175 
   175                 !flags.userInvalidated &&
       
   176                 (!flags.meridiem || (flags.meridiem && parsedParts));
   176             if (m._strict) {
   177             if (m._strict) {
   177                 isNowValid =
   178                 isNowValid =
   178                     isNowValid &&
   179                     isNowValid &&
   179                     flags.charsLeftOver === 0 &&
   180                     flags.charsLeftOver === 0 &&
   180                     flags.unusedTokens.length === 0 &&
   181                     flags.unusedTokens.length === 0 &&
   181                     flags.bigHour === undefined;
   182                     flags.bigHour === undefined;
   182             }
   183             }
   183 
   184         }
   184             if (Object.isFrozen == null || !Object.isFrozen(m)) {
   185         if (Object.isFrozen == null || !Object.isFrozen(m)) {
   185                 m._isValid = isNowValid;
   186             m._isValid = isNowValid;
   186             } else {
   187         } else {
   187                 return isNowValid;
   188             return isNowValid;
   188             }
       
   189         }
   189         }
   190         return m._isValid;
   190         return m._isValid;
   191     }
   191     }
   192 
   192 
   193     function createInvalid(flags) {
   193     function createInvalid(flags) {
   628     function pastFuture(diff, output) {
   628     function pastFuture(diff, output) {
   629         var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
   629         var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
   630         return isFunction(format) ? format(output) : format.replace(/%s/i, output);
   630         return isFunction(format) ? format(output) : format.replace(/%s/i, output);
   631     }
   631     }
   632 
   632 
   633     var aliases = {};
   633     var aliases = {
   634 
   634         D: 'date',
   635     function addUnitAlias(unit, shorthand) {
   635         dates: 'date',
   636         var lowerCase = unit.toLowerCase();
   636         date: 'date',
   637         aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
   637         d: 'day',
   638     }
   638         days: 'day',
       
   639         day: 'day',
       
   640         e: 'weekday',
       
   641         weekdays: 'weekday',
       
   642         weekday: 'weekday',
       
   643         E: 'isoWeekday',
       
   644         isoweekdays: 'isoWeekday',
       
   645         isoweekday: 'isoWeekday',
       
   646         DDD: 'dayOfYear',
       
   647         dayofyears: 'dayOfYear',
       
   648         dayofyear: 'dayOfYear',
       
   649         h: 'hour',
       
   650         hours: 'hour',
       
   651         hour: 'hour',
       
   652         ms: 'millisecond',
       
   653         milliseconds: 'millisecond',
       
   654         millisecond: 'millisecond',
       
   655         m: 'minute',
       
   656         minutes: 'minute',
       
   657         minute: 'minute',
       
   658         M: 'month',
       
   659         months: 'month',
       
   660         month: 'month',
       
   661         Q: 'quarter',
       
   662         quarters: 'quarter',
       
   663         quarter: 'quarter',
       
   664         s: 'second',
       
   665         seconds: 'second',
       
   666         second: 'second',
       
   667         gg: 'weekYear',
       
   668         weekyears: 'weekYear',
       
   669         weekyear: 'weekYear',
       
   670         GG: 'isoWeekYear',
       
   671         isoweekyears: 'isoWeekYear',
       
   672         isoweekyear: 'isoWeekYear',
       
   673         w: 'week',
       
   674         weeks: 'week',
       
   675         week: 'week',
       
   676         W: 'isoWeek',
       
   677         isoweeks: 'isoWeek',
       
   678         isoweek: 'isoWeek',
       
   679         y: 'year',
       
   680         years: 'year',
       
   681         year: 'year',
       
   682     };
   639 
   683 
   640     function normalizeUnits(units) {
   684     function normalizeUnits(units) {
   641         return typeof units === 'string'
   685         return typeof units === 'string'
   642             ? aliases[units] || aliases[units.toLowerCase()]
   686             ? aliases[units] || aliases[units.toLowerCase()]
   643             : undefined;
   687             : undefined;
   658         }
   702         }
   659 
   703 
   660         return normalizedInput;
   704         return normalizedInput;
   661     }
   705     }
   662 
   706 
   663     var priorities = {};
   707     var priorities = {
   664 
   708         date: 9,
   665     function addUnitPriority(unit, priority) {
   709         day: 11,
   666         priorities[unit] = priority;
   710         weekday: 11,
   667     }
   711         isoWeekday: 11,
       
   712         dayOfYear: 4,
       
   713         hour: 13,
       
   714         millisecond: 16,
       
   715         minute: 14,
       
   716         month: 8,
       
   717         quarter: 7,
       
   718         second: 15,
       
   719         weekYear: 1,
       
   720         isoWeekYear: 1,
       
   721         week: 5,
       
   722         isoWeek: 5,
       
   723         year: 1,
       
   724     };
   668 
   725 
   669     function getPrioritizedUnits(unitsObj) {
   726     function getPrioritizedUnits(unitsObj) {
   670         var units = [],
   727         var units = [],
   671             u;
   728             u;
   672         for (u in unitsObj) {
   729         for (u in unitsObj) {
   676         }
   733         }
   677         units.sort(function (a, b) {
   734         units.sort(function (a, b) {
   678             return a.priority - b.priority;
   735             return a.priority - b.priority;
   679         });
   736         });
   680         return units;
   737         return units;
   681     }
       
   682 
       
   683     function isLeapYear(year) {
       
   684         return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
       
   685     }
       
   686 
       
   687     function absFloor(number) {
       
   688         if (number < 0) {
       
   689             // -0 -> 0
       
   690             return Math.ceil(number) || 0;
       
   691         } else {
       
   692             return Math.floor(number);
       
   693         }
       
   694     }
       
   695 
       
   696     function toInt(argumentForCoercion) {
       
   697         var coercedNumber = +argumentForCoercion,
       
   698             value = 0;
       
   699 
       
   700         if (coercedNumber !== 0 && isFinite(coercedNumber)) {
       
   701             value = absFloor(coercedNumber);
       
   702         }
       
   703 
       
   704         return value;
       
   705     }
       
   706 
       
   707     function makeGetSet(unit, keepTime) {
       
   708         return function (value) {
       
   709             if (value != null) {
       
   710                 set$1(this, unit, value);
       
   711                 hooks.updateOffset(this, keepTime);
       
   712                 return this;
       
   713             } else {
       
   714                 return get(this, unit);
       
   715             }
       
   716         };
       
   717     }
       
   718 
       
   719     function get(mom, unit) {
       
   720         return mom.isValid()
       
   721             ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
       
   722             : NaN;
       
   723     }
       
   724 
       
   725     function set$1(mom, unit, value) {
       
   726         if (mom.isValid() && !isNaN(value)) {
       
   727             if (
       
   728                 unit === 'FullYear' &&
       
   729                 isLeapYear(mom.year()) &&
       
   730                 mom.month() === 1 &&
       
   731                 mom.date() === 29
       
   732             ) {
       
   733                 value = toInt(value);
       
   734                 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
       
   735                     value,
       
   736                     mom.month(),
       
   737                     daysInMonth(value, mom.month())
       
   738                 );
       
   739             } else {
       
   740                 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
       
   741             }
       
   742         }
       
   743     }
       
   744 
       
   745     // MOMENTS
       
   746 
       
   747     function stringGet(units) {
       
   748         units = normalizeUnits(units);
       
   749         if (isFunction(this[units])) {
       
   750             return this[units]();
       
   751         }
       
   752         return this;
       
   753     }
       
   754 
       
   755     function stringSet(units, value) {
       
   756         if (typeof units === 'object') {
       
   757             units = normalizeObjectUnits(units);
       
   758             var prioritized = getPrioritizedUnits(units),
       
   759                 i,
       
   760                 prioritizedLen = prioritized.length;
       
   761             for (i = 0; i < prioritizedLen; i++) {
       
   762                 this[prioritized[i].unit](units[prioritized[i].unit]);
       
   763             }
       
   764         } else {
       
   765             units = normalizeUnits(units);
       
   766             if (isFunction(this[units])) {
       
   767                 return this[units](value);
       
   768             }
       
   769         }
       
   770         return this;
       
   771     }
   738     }
   772 
   739 
   773     var match1 = /\d/, //       0 - 9
   740     var match1 = /\d/, //       0 - 9
   774         match2 = /\d\d/, //      00 - 99
   741         match2 = /\d\d/, //      00 - 99
   775         match3 = /\d{3}/, //     000 - 999
   742         match3 = /\d{3}/, //     000 - 999
   788         matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
   755         matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
   789         // any word (or two) characters or numbers including two/three word month in arabic.
   756         // any word (or two) characters or numbers including two/three word month in arabic.
   790         // includes scottish gaelic two word and hyphenated months
   757         // includes scottish gaelic two word and hyphenated months
   791         matchWord =
   758         matchWord =
   792             /[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,
   759             /[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,
       
   760         match1to2NoLeadingZero = /^[1-9]\d?/, //         1-99
       
   761         match1to2HasZero = /^([1-9]\d|\d)/, //           0-99
   793         regexes;
   762         regexes;
   794 
   763 
   795     regexes = {};
   764     regexes = {};
   796 
   765 
   797     function addRegexToken(token, regex, strictRegex) {
   766     function addRegexToken(token, regex, strictRegex) {
   826 
   795 
   827     function regexEscape(s) {
   796     function regexEscape(s) {
   828         return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
   797         return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
   829     }
   798     }
   830 
   799 
       
   800     function absFloor(number) {
       
   801         if (number < 0) {
       
   802             // -0 -> 0
       
   803             return Math.ceil(number) || 0;
       
   804         } else {
       
   805             return Math.floor(number);
       
   806         }
       
   807     }
       
   808 
       
   809     function toInt(argumentForCoercion) {
       
   810         var coercedNumber = +argumentForCoercion,
       
   811             value = 0;
       
   812 
       
   813         if (coercedNumber !== 0 && isFinite(coercedNumber)) {
       
   814             value = absFloor(coercedNumber);
       
   815         }
       
   816 
       
   817         return value;
       
   818     }
       
   819 
   831     var tokens = {};
   820     var tokens = {};
   832 
   821 
   833     function addParseToken(token, callback) {
   822     function addParseToken(token, callback) {
   834         var i,
   823         var i,
   835             func = callback,
   824             func = callback,
   857 
   846 
   858     function addTimeToArrayFromToken(token, input, config) {
   847     function addTimeToArrayFromToken(token, input, config) {
   859         if (input != null && hasOwnProp(tokens, token)) {
   848         if (input != null && hasOwnProp(tokens, token)) {
   860             tokens[token](input, config._a, config, token);
   849             tokens[token](input, config._a, config, token);
   861         }
   850         }
       
   851     }
       
   852 
       
   853     function isLeapYear(year) {
       
   854         return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
   862     }
   855     }
   863 
   856 
   864     var YEAR = 0,
   857     var YEAR = 0,
   865         MONTH = 1,
   858         MONTH = 1,
   866         DATE = 2,
   859         DATE = 2,
   868         MINUTE = 4,
   861         MINUTE = 4,
   869         SECOND = 5,
   862         SECOND = 5,
   870         MILLISECOND = 6,
   863         MILLISECOND = 6,
   871         WEEK = 7,
   864         WEEK = 7,
   872         WEEKDAY = 8;
   865         WEEKDAY = 8;
       
   866 
       
   867     // FORMATTING
       
   868 
       
   869     addFormatToken('Y', 0, 0, function () {
       
   870         var y = this.year();
       
   871         return y <= 9999 ? zeroFill(y, 4) : '+' + y;
       
   872     });
       
   873 
       
   874     addFormatToken(0, ['YY', 2], 0, function () {
       
   875         return this.year() % 100;
       
   876     });
       
   877 
       
   878     addFormatToken(0, ['YYYY', 4], 0, 'year');
       
   879     addFormatToken(0, ['YYYYY', 5], 0, 'year');
       
   880     addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
       
   881 
       
   882     // PARSING
       
   883 
       
   884     addRegexToken('Y', matchSigned);
       
   885     addRegexToken('YY', match1to2, match2);
       
   886     addRegexToken('YYYY', match1to4, match4);
       
   887     addRegexToken('YYYYY', match1to6, match6);
       
   888     addRegexToken('YYYYYY', match1to6, match6);
       
   889 
       
   890     addParseToken(['YYYYY', 'YYYYYY'], YEAR);
       
   891     addParseToken('YYYY', function (input, array) {
       
   892         array[YEAR] =
       
   893             input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
       
   894     });
       
   895     addParseToken('YY', function (input, array) {
       
   896         array[YEAR] = hooks.parseTwoDigitYear(input);
       
   897     });
       
   898     addParseToken('Y', function (input, array) {
       
   899         array[YEAR] = parseInt(input, 10);
       
   900     });
       
   901 
       
   902     // HELPERS
       
   903 
       
   904     function daysInYear(year) {
       
   905         return isLeapYear(year) ? 366 : 365;
       
   906     }
       
   907 
       
   908     // HOOKS
       
   909 
       
   910     hooks.parseTwoDigitYear = function (input) {
       
   911         return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
       
   912     };
       
   913 
       
   914     // MOMENTS
       
   915 
       
   916     var getSetYear = makeGetSet('FullYear', true);
       
   917 
       
   918     function getIsLeapYear() {
       
   919         return isLeapYear(this.year());
       
   920     }
       
   921 
       
   922     function makeGetSet(unit, keepTime) {
       
   923         return function (value) {
       
   924             if (value != null) {
       
   925                 set$1(this, unit, value);
       
   926                 hooks.updateOffset(this, keepTime);
       
   927                 return this;
       
   928             } else {
       
   929                 return get(this, unit);
       
   930             }
       
   931         };
       
   932     }
       
   933 
       
   934     function get(mom, unit) {
       
   935         if (!mom.isValid()) {
       
   936             return NaN;
       
   937         }
       
   938 
       
   939         var d = mom._d,
       
   940             isUTC = mom._isUTC;
       
   941 
       
   942         switch (unit) {
       
   943             case 'Milliseconds':
       
   944                 return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
       
   945             case 'Seconds':
       
   946                 return isUTC ? d.getUTCSeconds() : d.getSeconds();
       
   947             case 'Minutes':
       
   948                 return isUTC ? d.getUTCMinutes() : d.getMinutes();
       
   949             case 'Hours':
       
   950                 return isUTC ? d.getUTCHours() : d.getHours();
       
   951             case 'Date':
       
   952                 return isUTC ? d.getUTCDate() : d.getDate();
       
   953             case 'Day':
       
   954                 return isUTC ? d.getUTCDay() : d.getDay();
       
   955             case 'Month':
       
   956                 return isUTC ? d.getUTCMonth() : d.getMonth();
       
   957             case 'FullYear':
       
   958                 return isUTC ? d.getUTCFullYear() : d.getFullYear();
       
   959             default:
       
   960                 return NaN; // Just in case
       
   961         }
       
   962     }
       
   963 
       
   964     function set$1(mom, unit, value) {
       
   965         var d, isUTC, year, month, date;
       
   966 
       
   967         if (!mom.isValid() || isNaN(value)) {
       
   968             return;
       
   969         }
       
   970 
       
   971         d = mom._d;
       
   972         isUTC = mom._isUTC;
       
   973 
       
   974         switch (unit) {
       
   975             case 'Milliseconds':
       
   976                 return void (isUTC
       
   977                     ? d.setUTCMilliseconds(value)
       
   978                     : d.setMilliseconds(value));
       
   979             case 'Seconds':
       
   980                 return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
       
   981             case 'Minutes':
       
   982                 return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
       
   983             case 'Hours':
       
   984                 return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
       
   985             case 'Date':
       
   986                 return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
       
   987             // case 'Day': // Not real
       
   988             //    return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
       
   989             // case 'Month': // Not used because we need to pass two variables
       
   990             //     return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
       
   991             case 'FullYear':
       
   992                 break; // See below ...
       
   993             default:
       
   994                 return; // Just in case
       
   995         }
       
   996 
       
   997         year = value;
       
   998         month = mom.month();
       
   999         date = mom.date();
       
  1000         date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
       
  1001         void (isUTC
       
  1002             ? d.setUTCFullYear(year, month, date)
       
  1003             : d.setFullYear(year, month, date));
       
  1004     }
       
  1005 
       
  1006     // MOMENTS
       
  1007 
       
  1008     function stringGet(units) {
       
  1009         units = normalizeUnits(units);
       
  1010         if (isFunction(this[units])) {
       
  1011             return this[units]();
       
  1012         }
       
  1013         return this;
       
  1014     }
       
  1015 
       
  1016     function stringSet(units, value) {
       
  1017         if (typeof units === 'object') {
       
  1018             units = normalizeObjectUnits(units);
       
  1019             var prioritized = getPrioritizedUnits(units),
       
  1020                 i,
       
  1021                 prioritizedLen = prioritized.length;
       
  1022             for (i = 0; i < prioritizedLen; i++) {
       
  1023                 this[prioritized[i].unit](units[prioritized[i].unit]);
       
  1024             }
       
  1025         } else {
       
  1026             units = normalizeUnits(units);
       
  1027             if (isFunction(this[units])) {
       
  1028                 return this[units](value);
       
  1029             }
       
  1030         }
       
  1031         return this;
       
  1032     }
   873 
  1033 
   874     function mod(n, x) {
  1034     function mod(n, x) {
   875         return ((n % x) + x) % x;
  1035         return ((n % x) + x) % x;
   876     }
  1036     }
   877 
  1037 
   917 
  1077 
   918     addFormatToken('MMMM', 0, 0, function (format) {
  1078     addFormatToken('MMMM', 0, 0, function (format) {
   919         return this.localeData().months(this, format);
  1079         return this.localeData().months(this, format);
   920     });
  1080     });
   921 
  1081 
   922     // ALIASES
       
   923 
       
   924     addUnitAlias('month', 'M');
       
   925 
       
   926     // PRIORITY
       
   927 
       
   928     addUnitPriority('month', 8);
       
   929 
       
   930     // PARSING
  1082     // PARSING
   931 
  1083 
   932     addRegexToken('M', match1to2);
  1084     addRegexToken('M', match1to2, match1to2NoLeadingZero);
   933     addRegexToken('MM', match1to2, match2);
  1085     addRegexToken('MM', match1to2, match2);
   934     addRegexToken('MMM', function (isStrict, locale) {
  1086     addRegexToken('MMM', function (isStrict, locale) {
   935         return locale.monthsShortRegex(isStrict);
  1087         return locale.monthsShortRegex(isStrict);
   936     });
  1088     });
   937     addRegexToken('MMMM', function (isStrict, locale) {
  1089     addRegexToken('MMMM', function (isStrict, locale) {
  1093     }
  1245     }
  1094 
  1246 
  1095     // MOMENTS
  1247     // MOMENTS
  1096 
  1248 
  1097     function setMonth(mom, value) {
  1249     function setMonth(mom, value) {
  1098         var dayOfMonth;
       
  1099 
       
  1100         if (!mom.isValid()) {
  1250         if (!mom.isValid()) {
  1101             // No op
  1251             // No op
  1102             return mom;
  1252             return mom;
  1103         }
  1253         }
  1104 
  1254 
  1112                     return mom;
  1262                     return mom;
  1113                 }
  1263                 }
  1114             }
  1264             }
  1115         }
  1265         }
  1116 
  1266 
  1117         dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  1267         var month = value,
  1118         mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  1268             date = mom.date();
       
  1269 
       
  1270         date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
       
  1271         void (mom._isUTC
       
  1272             ? mom._d.setUTCMonth(month, date)
       
  1273             : mom._d.setMonth(month, date));
  1119         return mom;
  1274         return mom;
  1120     }
  1275     }
  1121 
  1276 
  1122     function getSetMonth(value) {
  1277     function getSetMonth(value) {
  1123         if (value != null) {
  1278         if (value != null) {
  1180 
  1335 
  1181         var shortPieces = [],
  1336         var shortPieces = [],
  1182             longPieces = [],
  1337             longPieces = [],
  1183             mixedPieces = [],
  1338             mixedPieces = [],
  1184             i,
  1339             i,
  1185             mom;
  1340             mom,
       
  1341             shortP,
       
  1342             longP;
  1186         for (i = 0; i < 12; i++) {
  1343         for (i = 0; i < 12; i++) {
  1187             // make the regex if we don't have it already
  1344             // make the regex if we don't have it already
  1188             mom = createUTC([2000, i]);
  1345             mom = createUTC([2000, i]);
  1189             shortPieces.push(this.monthsShort(mom, ''));
  1346             shortP = regexEscape(this.monthsShort(mom, ''));
  1190             longPieces.push(this.months(mom, ''));
  1347             longP = regexEscape(this.months(mom, ''));
  1191             mixedPieces.push(this.months(mom, ''));
  1348             shortPieces.push(shortP);
  1192             mixedPieces.push(this.monthsShort(mom, ''));
  1349             longPieces.push(longP);
       
  1350             mixedPieces.push(longP);
       
  1351             mixedPieces.push(shortP);
  1193         }
  1352         }
  1194         // Sorting makes sure if one month (or abbr) is a prefix of another it
  1353         // Sorting makes sure if one month (or abbr) is a prefix of another it
  1195         // will match the longer piece.
  1354         // will match the longer piece.
  1196         shortPieces.sort(cmpLenRev);
  1355         shortPieces.sort(cmpLenRev);
  1197         longPieces.sort(cmpLenRev);
  1356         longPieces.sort(cmpLenRev);
  1198         mixedPieces.sort(cmpLenRev);
  1357         mixedPieces.sort(cmpLenRev);
  1199         for (i = 0; i < 12; i++) {
       
  1200             shortPieces[i] = regexEscape(shortPieces[i]);
       
  1201             longPieces[i] = regexEscape(longPieces[i]);
       
  1202         }
       
  1203         for (i = 0; i < 24; i++) {
       
  1204             mixedPieces[i] = regexEscape(mixedPieces[i]);
       
  1205         }
       
  1206 
  1358 
  1207         this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  1359         this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  1208         this._monthsShortRegex = this._monthsRegex;
  1360         this._monthsShortRegex = this._monthsRegex;
  1209         this._monthsStrictRegex = new RegExp(
  1361         this._monthsStrictRegex = new RegExp(
  1210             '^(' + longPieces.join('|') + ')',
  1362             '^(' + longPieces.join('|') + ')',
  1214             '^(' + shortPieces.join('|') + ')',
  1366             '^(' + shortPieces.join('|') + ')',
  1215             'i'
  1367             'i'
  1216         );
  1368         );
  1217     }
  1369     }
  1218 
  1370 
  1219     // FORMATTING
       
  1220 
       
  1221     addFormatToken('Y', 0, 0, function () {
       
  1222         var y = this.year();
       
  1223         return y <= 9999 ? zeroFill(y, 4) : '+' + y;
       
  1224     });
       
  1225 
       
  1226     addFormatToken(0, ['YY', 2], 0, function () {
       
  1227         return this.year() % 100;
       
  1228     });
       
  1229 
       
  1230     addFormatToken(0, ['YYYY', 4], 0, 'year');
       
  1231     addFormatToken(0, ['YYYYY', 5], 0, 'year');
       
  1232     addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
       
  1233 
       
  1234     // ALIASES
       
  1235 
       
  1236     addUnitAlias('year', 'y');
       
  1237 
       
  1238     // PRIORITIES
       
  1239 
       
  1240     addUnitPriority('year', 1);
       
  1241 
       
  1242     // PARSING
       
  1243 
       
  1244     addRegexToken('Y', matchSigned);
       
  1245     addRegexToken('YY', match1to2, match2);
       
  1246     addRegexToken('YYYY', match1to4, match4);
       
  1247     addRegexToken('YYYYY', match1to6, match6);
       
  1248     addRegexToken('YYYYYY', match1to6, match6);
       
  1249 
       
  1250     addParseToken(['YYYYY', 'YYYYYY'], YEAR);
       
  1251     addParseToken('YYYY', function (input, array) {
       
  1252         array[YEAR] =
       
  1253             input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
       
  1254     });
       
  1255     addParseToken('YY', function (input, array) {
       
  1256         array[YEAR] = hooks.parseTwoDigitYear(input);
       
  1257     });
       
  1258     addParseToken('Y', function (input, array) {
       
  1259         array[YEAR] = parseInt(input, 10);
       
  1260     });
       
  1261 
       
  1262     // HELPERS
       
  1263 
       
  1264     function daysInYear(year) {
       
  1265         return isLeapYear(year) ? 366 : 365;
       
  1266     }
       
  1267 
       
  1268     // HOOKS
       
  1269 
       
  1270     hooks.parseTwoDigitYear = function (input) {
       
  1271         return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
       
  1272     };
       
  1273 
       
  1274     // MOMENTS
       
  1275 
       
  1276     var getSetYear = makeGetSet('FullYear', true);
       
  1277 
       
  1278     function getIsLeapYear() {
       
  1279         return isLeapYear(this.year());
       
  1280     }
       
  1281 
       
  1282     function createDate(y, m, d, h, M, s, ms) {
  1371     function createDate(y, m, d, h, M, s, ms) {
  1283         // can't just apply() to create a date:
  1372         // can't just apply() to create a date:
  1284         // https://stackoverflow.com/q/181348
  1373         // https://stackoverflow.com/q/181348
  1285         var date;
  1374         var date;
  1286         // the date constructor remaps years 0-99 to 1900-1999
  1375         // the date constructor remaps years 0-99 to 1900-1999
  1382     // FORMATTING
  1471     // FORMATTING
  1383 
  1472 
  1384     addFormatToken('w', ['ww', 2], 'wo', 'week');
  1473     addFormatToken('w', ['ww', 2], 'wo', 'week');
  1385     addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  1474     addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  1386 
  1475 
  1387     // ALIASES
       
  1388 
       
  1389     addUnitAlias('week', 'w');
       
  1390     addUnitAlias('isoWeek', 'W');
       
  1391 
       
  1392     // PRIORITIES
       
  1393 
       
  1394     addUnitPriority('week', 5);
       
  1395     addUnitPriority('isoWeek', 5);
       
  1396 
       
  1397     // PARSING
  1476     // PARSING
  1398 
  1477 
  1399     addRegexToken('w', match1to2);
  1478     addRegexToken('w', match1to2, match1to2NoLeadingZero);
  1400     addRegexToken('ww', match1to2, match2);
  1479     addRegexToken('ww', match1to2, match2);
  1401     addRegexToken('W', match1to2);
  1480     addRegexToken('W', match1to2, match1to2NoLeadingZero);
  1402     addRegexToken('WW', match1to2, match2);
  1481     addRegexToken('WW', match1to2, match2);
  1403 
  1482 
  1404     addWeekParseToken(
  1483     addWeekParseToken(
  1405         ['w', 'ww', 'W', 'WW'],
  1484         ['w', 'ww', 'W', 'WW'],
  1406         function (input, week, config, token) {
  1485         function (input, week, config, token) {
  1457         return this.localeData().weekdays(this, format);
  1536         return this.localeData().weekdays(this, format);
  1458     });
  1537     });
  1459 
  1538 
  1460     addFormatToken('e', 0, 0, 'weekday');
  1539     addFormatToken('e', 0, 0, 'weekday');
  1461     addFormatToken('E', 0, 0, 'isoWeekday');
  1540     addFormatToken('E', 0, 0, 'isoWeekday');
  1462 
       
  1463     // ALIASES
       
  1464 
       
  1465     addUnitAlias('day', 'd');
       
  1466     addUnitAlias('weekday', 'e');
       
  1467     addUnitAlias('isoWeekday', 'E');
       
  1468 
       
  1469     // PRIORITY
       
  1470     addUnitPriority('day', 11);
       
  1471     addUnitPriority('weekday', 11);
       
  1472     addUnitPriority('isoWeekday', 11);
       
  1473 
  1541 
  1474     // PARSING
  1542     // PARSING
  1475 
  1543 
  1476     addRegexToken('d', match1to2);
  1544     addRegexToken('d', match1to2);
  1477     addRegexToken('e', match1to2);
  1545     addRegexToken('e', match1to2);
  1548                       : 'standalone'
  1616                       : 'standalone'
  1549               ];
  1617               ];
  1550         return m === true
  1618         return m === true
  1551             ? shiftWeekdays(weekdays, this._week.dow)
  1619             ? shiftWeekdays(weekdays, this._week.dow)
  1552             : m
  1620             : m
  1553             ? weekdays[m.day()]
  1621               ? weekdays[m.day()]
  1554             : weekdays;
  1622               : weekdays;
  1555     }
  1623     }
  1556 
  1624 
  1557     function localeWeekdaysShort(m) {
  1625     function localeWeekdaysShort(m) {
  1558         return m === true
  1626         return m === true
  1559             ? shiftWeekdays(this._weekdaysShort, this._week.dow)
  1627             ? shiftWeekdays(this._weekdaysShort, this._week.dow)
  1560             : m
  1628             : m
  1561             ? this._weekdaysShort[m.day()]
  1629               ? this._weekdaysShort[m.day()]
  1562             : this._weekdaysShort;
  1630               : this._weekdaysShort;
  1563     }
  1631     }
  1564 
  1632 
  1565     function localeWeekdaysMin(m) {
  1633     function localeWeekdaysMin(m) {
  1566         return m === true
  1634         return m === true
  1567             ? shiftWeekdays(this._weekdaysMin, this._week.dow)
  1635             ? shiftWeekdays(this._weekdaysMin, this._week.dow)
  1568             : m
  1636             : m
  1569             ? this._weekdaysMin[m.day()]
  1637               ? this._weekdaysMin[m.day()]
  1570             : this._weekdaysMin;
  1638               : this._weekdaysMin;
  1571     }
  1639     }
  1572 
  1640 
  1573     function handleStrictParse$1(weekdayName, format, strict) {
  1641     function handleStrictParse$1(weekdayName, format, strict) {
  1574         var i,
  1642         var i,
  1575             ii,
  1643             ii,
  1714 
  1782 
  1715     function getSetDayOfWeek(input) {
  1783     function getSetDayOfWeek(input) {
  1716         if (!this.isValid()) {
  1784         if (!this.isValid()) {
  1717             return input != null ? this : NaN;
  1785             return input != null ? this : NaN;
  1718         }
  1786         }
  1719         var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  1787 
       
  1788         var day = get(this, 'Day');
  1720         if (input != null) {
  1789         if (input != null) {
  1721             input = parseWeekday(input, this.localeData());
  1790             input = parseWeekday(input, this.localeData());
  1722             return this.add(input - day, 'd');
  1791             return this.add(input - day, 'd');
  1723         } else {
  1792         } else {
  1724             return day;
  1793             return day;
  1913     }
  1982     }
  1914 
  1983 
  1915     meridiem('a', true);
  1984     meridiem('a', true);
  1916     meridiem('A', false);
  1985     meridiem('A', false);
  1917 
  1986 
  1918     // ALIASES
       
  1919 
       
  1920     addUnitAlias('hour', 'h');
       
  1921 
       
  1922     // PRIORITY
       
  1923     addUnitPriority('hour', 13);
       
  1924 
       
  1925     // PARSING
  1987     // PARSING
  1926 
  1988 
  1927     function matchMeridiem(isStrict, locale) {
  1989     function matchMeridiem(isStrict, locale) {
  1928         return locale._meridiemParse;
  1990         return locale._meridiemParse;
  1929     }
  1991     }
  1930 
  1992 
  1931     addRegexToken('a', matchMeridiem);
  1993     addRegexToken('a', matchMeridiem);
  1932     addRegexToken('A', matchMeridiem);
  1994     addRegexToken('A', matchMeridiem);
  1933     addRegexToken('H', match1to2);
  1995     addRegexToken('H', match1to2, match1to2HasZero);
  1934     addRegexToken('h', match1to2);
  1996     addRegexToken('h', match1to2, match1to2NoLeadingZero);
  1935     addRegexToken('k', match1to2);
  1997     addRegexToken('k', match1to2, match1to2NoLeadingZero);
  1936     addRegexToken('HH', match1to2, match2);
  1998     addRegexToken('HH', match1to2, match2);
  1937     addRegexToken('hh', match1to2, match2);
  1999     addRegexToken('hh', match1to2, match2);
  1938     addRegexToken('kk', match1to2, match2);
  2000     addRegexToken('kk', match1to2, match2);
  1939 
  2001 
  1940     addRegexToken('hmm', match3to4);
  2002     addRegexToken('hmm', match3to4);
  2080         return globalLocale;
  2142         return globalLocale;
  2081     }
  2143     }
  2082 
  2144 
  2083     function isLocaleNameSane(name) {
  2145     function isLocaleNameSane(name) {
  2084         // Prevent names that look like filesystem paths, i.e contain '/' or '\'
  2146         // Prevent names that look like filesystem paths, i.e contain '/' or '\'
  2085         return name.match('^[^/\\\\]*$') != null;
  2147         // Ensure name is available and function returns boolean
       
  2148         return !!(name && name.match('^[^/\\\\]*$'));
  2086     }
  2149     }
  2087 
  2150 
  2088     function loadLocale(name) {
  2151     function loadLocale(name) {
  2089         var oldLocale = null,
  2152         var oldLocale = null,
  2090             aliasedRequire;
  2153             aliasedRequire;
  2272         if (a && getParsingFlags(m).overflow === -2) {
  2335         if (a && getParsingFlags(m).overflow === -2) {
  2273             overflow =
  2336             overflow =
  2274                 a[MONTH] < 0 || a[MONTH] > 11
  2337                 a[MONTH] < 0 || a[MONTH] > 11
  2275                     ? MONTH
  2338                     ? MONTH
  2276                     : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
  2339                     : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
  2277                     ? DATE
  2340                       ? DATE
  2278                     : a[HOUR] < 0 ||
  2341                       : a[HOUR] < 0 ||
  2279                       a[HOUR] > 24 ||
  2342                           a[HOUR] > 24 ||
  2280                       (a[HOUR] === 24 &&
  2343                           (a[HOUR] === 24 &&
  2281                           (a[MINUTE] !== 0 ||
  2344                               (a[MINUTE] !== 0 ||
  2282                               a[SECOND] !== 0 ||
  2345                                   a[SECOND] !== 0 ||
  2283                               a[MILLISECOND] !== 0))
  2346                                   a[MILLISECOND] !== 0))
  2284                     ? HOUR
  2347                         ? HOUR
  2285                     : a[MINUTE] < 0 || a[MINUTE] > 59
  2348                         : a[MINUTE] < 0 || a[MINUTE] > 59
  2286                     ? MINUTE
  2349                           ? MINUTE
  2287                     : a[SECOND] < 0 || a[SECOND] > 59
  2350                           : a[SECOND] < 0 || a[SECOND] > 59
  2288                     ? SECOND
  2351                             ? SECOND
  2289                     : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
  2352                             : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
  2290                     ? MILLISECOND
  2353                               ? MILLISECOND
  2291                     : -1;
  2354                               : -1;
  2292 
  2355 
  2293             if (
  2356             if (
  2294                 getParsingFlags(m)._overflowDayOfYear &&
  2357                 getParsingFlags(m)._overflowDayOfYear &&
  2295                 (overflow < YEAR || overflow > DATE)
  2358                 (overflow < YEAR || overflow > DATE)
  2296             ) {
  2359             ) {
  3727     function getCalendarFormat(myMoment, now) {
  3790     function getCalendarFormat(myMoment, now) {
  3728         var diff = myMoment.diff(now, 'days', true);
  3791         var diff = myMoment.diff(now, 'days', true);
  3729         return diff < -6
  3792         return diff < -6
  3730             ? 'sameElse'
  3793             ? 'sameElse'
  3731             : diff < -1
  3794             : diff < -1
  3732             ? 'lastWeek'
  3795               ? 'lastWeek'
  3733             : diff < 0
  3796               : diff < 0
  3734             ? 'lastDay'
  3797                 ? 'lastDay'
  3735             : diff < 1
  3798                 : diff < 1
  3736             ? 'sameDay'
  3799                   ? 'sameDay'
  3737             : diff < 2
  3800                   : diff < 2
  3738             ? 'nextDay'
  3801                     ? 'nextDay'
  3739             : diff < 7
  3802                     : diff < 7
  3740             ? 'nextWeek'
  3803                       ? 'nextWeek'
  3741             : 'sameElse';
  3804                       : 'sameElse';
  3742     }
  3805     }
  3743 
  3806 
  3744     function calendar$1(time, formats) {
  3807     function calendar$1(time, formats) {
  3745         // Support for single parameter, formats only overload to the calendar function
  3808         // Support for single parameter, formats only overload to the calendar function
  3746         if (arguments.length === 1) {
  3809         if (arguments.length === 1) {
  4544             namePieces = [],
  4607             namePieces = [],
  4545             narrowPieces = [],
  4608             narrowPieces = [],
  4546             mixedPieces = [],
  4609             mixedPieces = [],
  4547             i,
  4610             i,
  4548             l,
  4611             l,
       
  4612             erasName,
       
  4613             erasAbbr,
       
  4614             erasNarrow,
  4549             eras = this.eras();
  4615             eras = this.eras();
  4550 
  4616 
  4551         for (i = 0, l = eras.length; i < l; ++i) {
  4617         for (i = 0, l = eras.length; i < l; ++i) {
  4552             namePieces.push(regexEscape(eras[i].name));
  4618             erasName = regexEscape(eras[i].name);
  4553             abbrPieces.push(regexEscape(eras[i].abbr));
  4619             erasAbbr = regexEscape(eras[i].abbr);
  4554             narrowPieces.push(regexEscape(eras[i].narrow));
  4620             erasNarrow = regexEscape(eras[i].narrow);
  4555 
  4621 
  4556             mixedPieces.push(regexEscape(eras[i].name));
  4622             namePieces.push(erasName);
  4557             mixedPieces.push(regexEscape(eras[i].abbr));
  4623             abbrPieces.push(erasAbbr);
  4558             mixedPieces.push(regexEscape(eras[i].narrow));
  4624             narrowPieces.push(erasNarrow);
       
  4625             mixedPieces.push(erasName);
       
  4626             mixedPieces.push(erasAbbr);
       
  4627             mixedPieces.push(erasNarrow);
  4559         }
  4628         }
  4560 
  4629 
  4561         this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  4630         this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  4562         this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
  4631         this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
  4563         this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
  4632         this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
  4585     addWeekYearFormatToken('ggggg', 'weekYear');
  4654     addWeekYearFormatToken('ggggg', 'weekYear');
  4586     addWeekYearFormatToken('GGGG', 'isoWeekYear');
  4655     addWeekYearFormatToken('GGGG', 'isoWeekYear');
  4587     addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  4656     addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  4588 
  4657 
  4589     // ALIASES
  4658     // ALIASES
  4590 
       
  4591     addUnitAlias('weekYear', 'gg');
       
  4592     addUnitAlias('isoWeekYear', 'GG');
       
  4593 
       
  4594     // PRIORITY
       
  4595 
       
  4596     addUnitPriority('weekYear', 1);
       
  4597     addUnitPriority('isoWeekYear', 1);
       
  4598 
  4659 
  4599     // PARSING
  4660     // PARSING
  4600 
  4661 
  4601     addRegexToken('G', matchSigned);
  4662     addRegexToken('G', matchSigned);
  4602     addRegexToken('g', matchSigned);
  4663     addRegexToken('g', matchSigned);
  4623     function getSetWeekYear(input) {
  4684     function getSetWeekYear(input) {
  4624         return getSetWeekYearHelper.call(
  4685         return getSetWeekYearHelper.call(
  4625             this,
  4686             this,
  4626             input,
  4687             input,
  4627             this.week(),
  4688             this.week(),
  4628             this.weekday(),
  4689             this.weekday() + this.localeData()._week.dow,
  4629             this.localeData()._week.dow,
  4690             this.localeData()._week.dow,
  4630             this.localeData()._week.doy
  4691             this.localeData()._week.doy
  4631         );
  4692         );
  4632     }
  4693     }
  4633 
  4694 
  4685 
  4746 
  4686     // FORMATTING
  4747     // FORMATTING
  4687 
  4748 
  4688     addFormatToken('Q', 0, 'Qo', 'quarter');
  4749     addFormatToken('Q', 0, 'Qo', 'quarter');
  4689 
  4750 
  4690     // ALIASES
       
  4691 
       
  4692     addUnitAlias('quarter', 'Q');
       
  4693 
       
  4694     // PRIORITY
       
  4695 
       
  4696     addUnitPriority('quarter', 7);
       
  4697 
       
  4698     // PARSING
  4751     // PARSING
  4699 
  4752 
  4700     addRegexToken('Q', match1);
  4753     addRegexToken('Q', match1);
  4701     addParseToken('Q', function (input, array) {
  4754     addParseToken('Q', function (input, array) {
  4702         array[MONTH] = (toInt(input) - 1) * 3;
  4755         array[MONTH] = (toInt(input) - 1) * 3;
  4712 
  4765 
  4713     // FORMATTING
  4766     // FORMATTING
  4714 
  4767 
  4715     addFormatToken('D', ['DD', 2], 'Do', 'date');
  4768     addFormatToken('D', ['DD', 2], 'Do', 'date');
  4716 
  4769 
  4717     // ALIASES
       
  4718 
       
  4719     addUnitAlias('date', 'D');
       
  4720 
       
  4721     // PRIORITY
       
  4722     addUnitPriority('date', 9);
       
  4723 
       
  4724     // PARSING
  4770     // PARSING
  4725 
  4771 
  4726     addRegexToken('D', match1to2);
  4772     addRegexToken('D', match1to2, match1to2NoLeadingZero);
  4727     addRegexToken('DD', match1to2, match2);
  4773     addRegexToken('DD', match1to2, match2);
  4728     addRegexToken('Do', function (isStrict, locale) {
  4774     addRegexToken('Do', function (isStrict, locale) {
  4729         // TODO: Remove "ordinalParse" fallback in next major release.
  4775         // TODO: Remove "ordinalParse" fallback in next major release.
  4730         return isStrict
  4776         return isStrict
  4731             ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
  4777             ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
  4743 
  4789 
  4744     // FORMATTING
  4790     // FORMATTING
  4745 
  4791 
  4746     addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  4792     addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  4747 
  4793 
  4748     // ALIASES
       
  4749 
       
  4750     addUnitAlias('dayOfYear', 'DDD');
       
  4751 
       
  4752     // PRIORITY
       
  4753     addUnitPriority('dayOfYear', 4);
       
  4754 
       
  4755     // PARSING
  4794     // PARSING
  4756 
  4795 
  4757     addRegexToken('DDD', match1to3);
  4796     addRegexToken('DDD', match1to3);
  4758     addRegexToken('DDDD', match3);
  4797     addRegexToken('DDDD', match3);
  4759     addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  4798     addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  4774 
  4813 
  4775     // FORMATTING
  4814     // FORMATTING
  4776 
  4815 
  4777     addFormatToken('m', ['mm', 2], 0, 'minute');
  4816     addFormatToken('m', ['mm', 2], 0, 'minute');
  4778 
  4817 
  4779     // ALIASES
       
  4780 
       
  4781     addUnitAlias('minute', 'm');
       
  4782 
       
  4783     // PRIORITY
       
  4784 
       
  4785     addUnitPriority('minute', 14);
       
  4786 
       
  4787     // PARSING
  4818     // PARSING
  4788 
  4819 
  4789     addRegexToken('m', match1to2);
  4820     addRegexToken('m', match1to2, match1to2HasZero);
  4790     addRegexToken('mm', match1to2, match2);
  4821     addRegexToken('mm', match1to2, match2);
  4791     addParseToken(['m', 'mm'], MINUTE);
  4822     addParseToken(['m', 'mm'], MINUTE);
  4792 
  4823 
  4793     // MOMENTS
  4824     // MOMENTS
  4794 
  4825 
  4796 
  4827 
  4797     // FORMATTING
  4828     // FORMATTING
  4798 
  4829 
  4799     addFormatToken('s', ['ss', 2], 0, 'second');
  4830     addFormatToken('s', ['ss', 2], 0, 'second');
  4800 
  4831 
  4801     // ALIASES
       
  4802 
       
  4803     addUnitAlias('second', 's');
       
  4804 
       
  4805     // PRIORITY
       
  4806 
       
  4807     addUnitPriority('second', 15);
       
  4808 
       
  4809     // PARSING
  4832     // PARSING
  4810 
  4833 
  4811     addRegexToken('s', match1to2);
  4834     addRegexToken('s', match1to2, match1to2HasZero);
  4812     addRegexToken('ss', match1to2, match2);
  4835     addRegexToken('ss', match1to2, match2);
  4813     addParseToken(['s', 'ss'], SECOND);
  4836     addParseToken(['s', 'ss'], SECOND);
  4814 
  4837 
  4815     // MOMENTS
  4838     // MOMENTS
  4816 
  4839 
  4843         return this.millisecond() * 100000;
  4866         return this.millisecond() * 100000;
  4844     });
  4867     });
  4845     addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  4868     addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  4846         return this.millisecond() * 1000000;
  4869         return this.millisecond() * 1000000;
  4847     });
  4870     });
  4848 
       
  4849     // ALIASES
       
  4850 
       
  4851     addUnitAlias('millisecond', 'ms');
       
  4852 
       
  4853     // PRIORITY
       
  4854 
       
  4855     addUnitPriority('millisecond', 16);
       
  4856 
  4871 
  4857     // PARSING
  4872     // PARSING
  4858 
  4873 
  4859     addRegexToken('S', match1to3, match1);
  4874     addRegexToken('S', match1to3, match1);
  4860     addRegexToken('SS', match1to3, match2);
  4875     addRegexToken('SS', match1to3, match2);
  5159             var b = number % 10,
  5174             var b = number % 10,
  5160                 output =
  5175                 output =
  5161                     toInt((number % 100) / 10) === 1
  5176                     toInt((number % 100) / 10) === 1
  5162                         ? 'th'
  5177                         ? 'th'
  5163                         : b === 1
  5178                         : b === 1
  5164                         ? 'st'
  5179                           ? 'st'
  5165                         : b === 2
  5180                           : b === 2
  5166                         ? 'nd'
  5181                             ? 'nd'
  5167                         : b === 3
  5182                             : b === 3
  5168                         ? 'rd'
  5183                               ? 'rd'
  5169                         : 'th';
  5184                               : 'th';
  5170             return number + output;
  5185             return number + output;
  5171         },
  5186         },
  5172     });
  5187     });
  5173 
  5188 
  5174     // Side effect imports
  5189     // Side effect imports
  5337                     throw new Error('Unknown unit ' + units);
  5352                     throw new Error('Unknown unit ' + units);
  5338             }
  5353             }
  5339         }
  5354         }
  5340     }
  5355     }
  5341 
  5356 
  5342     // TODO: Use this.as('ms')?
       
  5343     function valueOf$1() {
       
  5344         if (!this.isValid()) {
       
  5345             return NaN;
       
  5346         }
       
  5347         return (
       
  5348             this._milliseconds +
       
  5349             this._days * 864e5 +
       
  5350             (this._months % 12) * 2592e6 +
       
  5351             toInt(this._months / 12) * 31536e6
       
  5352         );
       
  5353     }
       
  5354 
       
  5355     function makeAs(alias) {
  5357     function makeAs(alias) {
  5356         return function () {
  5358         return function () {
  5357             return this.as(alias);
  5359             return this.as(alias);
  5358         };
  5360         };
  5359     }
  5361     }
  5364         asHours = makeAs('h'),
  5366         asHours = makeAs('h'),
  5365         asDays = makeAs('d'),
  5367         asDays = makeAs('d'),
  5366         asWeeks = makeAs('w'),
  5368         asWeeks = makeAs('w'),
  5367         asMonths = makeAs('M'),
  5369         asMonths = makeAs('M'),
  5368         asQuarters = makeAs('Q'),
  5370         asQuarters = makeAs('Q'),
  5369         asYears = makeAs('y');
  5371         asYears = makeAs('y'),
       
  5372         valueOf$1 = asMilliseconds;
  5370 
  5373 
  5371     function clone$1() {
  5374     function clone$1() {
  5372         return createDuration(this);
  5375         return createDuration(this);
  5373     }
  5376     }
  5374 
  5377 
  5633         config._d = new Date(toInt(input));
  5636         config._d = new Date(toInt(input));
  5634     });
  5637     });
  5635 
  5638 
  5636     //! moment.js
  5639     //! moment.js
  5637 
  5640 
  5638     hooks.version = '2.29.4';
  5641     hooks.version = '2.30.1';
  5639 
  5642 
  5640     setHookCallback(createLocal);
  5643     setHookCallback(createLocal);
  5641 
  5644 
  5642     hooks.fn = proto;
  5645     hooks.fn = proto;
  5643     hooks.min = min;
  5646     hooks.min = min;