@hero-design/rn 8.88.0 → 8.89.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js CHANGED
@@ -363,14 +363,14 @@ function _regeneratorRuntime() {
363
363
  }
364
364
  }, e;
365
365
  }
366
- function _typeof(o) {
366
+ function _typeof$1(o) {
367
367
  "@babel/helpers - typeof";
368
368
 
369
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
369
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
370
370
  return typeof o;
371
371
  } : function (o) {
372
372
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
373
- }, _typeof(o);
373
+ }, _typeof$1(o);
374
374
  }
375
375
  function _classCallCheck(instance, Constructor) {
376
376
  if (!(instance instanceof Constructor)) {
@@ -2062,6 +2062,62 @@ var eBensBrandSystemPallete = {
2062
2062
  };
2063
2063
  var eBensSystemPalette = _objectSpread2(_objectSpread2({}, swagSystemPalette$1), eBensBrandSystemPallete);
2064
2064
 
2065
+ var ehWorkDarkPalette = _objectSpread2(_objectSpread2({}, swagLightGlobalPalette), {}, {
2066
+ // Surface
2067
+ defaultGlobalSurface: '#27272A',
2068
+ neutralGlobalSurface: '#121214',
2069
+ darkGlobalSurface: '#fcfbff',
2070
+ overlayGlobalSurface: '#ffffff',
2071
+ // On Surface
2072
+ onDefaultGlobalSurface: '#ffffff',
2073
+ mutedOnDefaultGlobalSurface: '#a9a9b2',
2074
+ inactiveOnDefaultGlobalSurface: '#71717a',
2075
+ disabledOnDefaultGlobalSurface: '#52525b',
2076
+ onOnDarkGlobalSurface: '#121214',
2077
+ // Outline:
2078
+ primaryOutline: '#a9a9b2',
2079
+ secondaryOutline: '#3f3f46',
2080
+ inactiveOutline: '#71717a',
2081
+ disabledOutline: '#52525b',
2082
+ // Archived:
2083
+ archivedSurface: '#52525b',
2084
+ mutedArchived: '#3f3f46',
2085
+ archived: '#71717a',
2086
+ onArchivedSurface: '#a9a9b2',
2087
+ // Error:
2088
+ errorSurface: '#7a1d06',
2089
+ mutedError: '#9b2508',
2090
+ error: '#bd2d09',
2091
+ onErrorSurface: '#fecfca',
2092
+ // Warming:
2093
+ warningSurface: '#963e03',
2094
+ mutedWarning: '#c35004',
2095
+ warning: '#dc6204',
2096
+ onWarningSurface: '#fff0d5',
2097
+ // Success:
2098
+ successSurface: '#00483e',
2099
+ mutedSuccess: '#016256',
2100
+ success: '#017d6d',
2101
+ onSuccessSurface: '#a7f3e9',
2102
+ // Info:
2103
+ infoSurface: '#004a61',
2104
+ mutedInfo: '#006585',
2105
+ info: '#007da3',
2106
+ onInfoSurface: '#a0e8ff',
2107
+ // Brand:
2108
+ primary: '#cdacfe',
2109
+ onPrimary: '#fdfbff',
2110
+ secondary: '#7622d7',
2111
+ onSecondary: '#ffffff',
2112
+ defaultSurface: '#fdfbff',
2113
+ highlightedSurface: '#280541',
2114
+ pressedSurface: '#9a58fc',
2115
+ decorativePrimary: '#fdfbff',
2116
+ decorativePrimarySurface: '#74409a',
2117
+ decorativeSecondary: '#fdfbff',
2118
+ decorativeSecondarySurface: '#f0e6ff'
2119
+ });
2120
+
2065
2121
  var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
2066
2122
  var horizontalScale = function horizontalScale(size) {
2067
2123
  if (Platform.OS === 'web') {
@@ -5895,7 +5951,7 @@ function requireCamelize() {
5895
5951
  return walk(obj);
5896
5952
  };
5897
5953
  function walk(obj) {
5898
- if (!obj || _typeof(obj) !== 'object') return obj;
5954
+ if (!obj || _typeof$1(obj) !== 'object') return obj;
5899
5955
  if (isDate(obj) || isRegex(obj)) return obj;
5900
5956
  if (isArray(obj)) return map(obj, walk);
5901
5957
  return reduce(objectKeys(obj), function (acc, key) {
@@ -6258,7 +6314,7 @@ function requireCssToReactNative() {
6258
6314
  value: true
6259
6315
  });
6260
6316
  function _interopDefault(ex) {
6261
- return ex && _typeof(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
6317
+ return ex && _typeof$1(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
6262
6318
  }
6263
6319
  var parse = requireLib$1();
6264
6320
  var parse__default = _interopDefault(parse);
@@ -6982,7 +7038,7 @@ var generated = {};
6982
7038
  var buffer = '';
6983
7039
  var lastType;
6984
7040
  function handleInterpolation(interpolation, i, arr) {
6985
- var type = _typeof(interpolation);
7041
+ var type = _typeof$1(interpolation);
6986
7042
  if (type === 'string') {
6987
7043
  // strip comments
6988
7044
  interpolation = interpolation.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
@@ -10517,12 +10573,59 @@ var BottomSheet$1 = Object.assign(BottomSheet, {
10517
10573
  ScrollView: BottomSheetScrollView
10518
10574
  });
10519
10575
 
10576
+ function _typeof(o) {
10577
+ "@babel/helpers - typeof";
10578
+
10579
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
10580
+ return typeof o;
10581
+ } : function (o) {
10582
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10583
+ }, _typeof(o);
10584
+ }
10585
+
10520
10586
  function requiredArgs(required, args) {
10521
10587
  if (args.length < required) {
10522
10588
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
10523
10589
  }
10524
10590
  }
10525
10591
 
10592
+ /**
10593
+ * @name isDate
10594
+ * @category Common Helpers
10595
+ * @summary Is the given value a date?
10596
+ *
10597
+ * @description
10598
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
10599
+ *
10600
+ * @param {*} value - the value to check
10601
+ * @returns {boolean} true if the given value is a date
10602
+ * @throws {TypeError} 1 arguments required
10603
+ *
10604
+ * @example
10605
+ * // For a valid date:
10606
+ * const result = isDate(new Date())
10607
+ * //=> true
10608
+ *
10609
+ * @example
10610
+ * // For an invalid date:
10611
+ * const result = isDate(new Date(NaN))
10612
+ * //=> true
10613
+ *
10614
+ * @example
10615
+ * // For some value:
10616
+ * const result = isDate('2014-02-31')
10617
+ * //=> false
10618
+ *
10619
+ * @example
10620
+ * // For an object:
10621
+ * const result = isDate({})
10622
+ * //=> false
10623
+ */
10624
+ function isDate(value) {
10625
+ requiredArgs(1, arguments);
10626
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
10627
+ }
10628
+
10526
10629
  /**
10527
10630
  * @name toDate
10528
10631
  * @category Common Helpers
@@ -10553,11 +10656,11 @@ function requiredArgs(required, args) {
10553
10656
  * const result = toDate(1392098430000)
10554
10657
  * //=> Tue Feb 11 2014 11:30:30
10555
10658
  */
10556
-
10557
10659
  function toDate(argument) {
10558
10660
  requiredArgs(1, arguments);
10559
- var argStr = Object.prototype.toString.call(argument); // Clone the date
10661
+ var argStr = Object.prototype.toString.call(argument);
10560
10662
 
10663
+ // Clone the date
10561
10664
  if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
10562
10665
  // Prevent the date to lose the milliseconds when passed to new Date() in IE10
10563
10666
  return new Date(argument.getTime());
@@ -10566,8 +10669,8 @@ function toDate(argument) {
10566
10669
  } else {
10567
10670
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
10568
10671
  // eslint-disable-next-line no-console
10569
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
10570
-
10672
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
10673
+ // eslint-disable-next-line no-console
10571
10674
  console.warn(new Error().stack);
10572
10675
  }
10573
10676
  return new Date(NaN);
@@ -10586,544 +10689,34 @@ function toDate(argument) {
10586
10689
  *
10587
10690
  * Time value of Date: http://es5.github.io/#x15.9.1.1
10588
10691
  *
10589
- * ### v2.0.0 breaking changes:
10590
- *
10591
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
10592
- *
10593
- * - Now `isValid` doesn't throw an exception
10594
- * if the first argument is not an instance of Date.
10595
- * Instead, argument is converted beforehand using `toDate`.
10596
- *
10597
- * Examples:
10598
- *
10599
- * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
10600
- * |---------------------------|---------------|---------------|
10601
- * | `new Date()` | `true` | `true` |
10602
- * | `new Date('2016-01-01')` | `true` | `true` |
10603
- * | `new Date('')` | `false` | `false` |
10604
- * | `new Date(1488370835081)` | `true` | `true` |
10605
- * | `new Date(NaN)` | `false` | `false` |
10606
- * | `'2016-01-01'` | `TypeError` | `false` |
10607
- * | `''` | `TypeError` | `false` |
10608
- * | `1488370835081` | `TypeError` | `true` |
10609
- * | `NaN` | `TypeError` | `false` |
10610
- *
10611
- * We introduce this change to make *date-fns* consistent with ECMAScript behavior
10612
- * that try to coerce arguments to the expected type
10613
- * (which is also the case with other *date-fns* functions).
10614
- *
10615
10692
  * @param {*} date - the date to check
10616
10693
  * @returns {Boolean} the date is valid
10617
10694
  * @throws {TypeError} 1 argument required
10618
10695
  *
10619
10696
  * @example
10620
10697
  * // For the valid date:
10621
- * var result = isValid(new Date(2014, 1, 31))
10698
+ * const result = isValid(new Date(2014, 1, 31))
10622
10699
  * //=> true
10623
10700
  *
10624
10701
  * @example
10625
10702
  * // For the value, convertable into a date:
10626
- * var result = isValid(1393804800000)
10703
+ * const result = isValid(1393804800000)
10627
10704
  * //=> true
10628
10705
  *
10629
10706
  * @example
10630
10707
  * // For the invalid date:
10631
- * var result = isValid(new Date(''))
10708
+ * const result = isValid(new Date(''))
10632
10709
  * //=> false
10633
10710
  */
10634
-
10635
10711
  function isValid(dirtyDate) {
10636
10712
  requiredArgs(1, arguments);
10637
- var date = toDate(dirtyDate);
10638
- return !isNaN(date);
10639
- }
10640
-
10641
- var formatDistanceLocale = {
10642
- lessThanXSeconds: {
10643
- one: 'less than a second',
10644
- other: 'less than {{count}} seconds'
10645
- },
10646
- xSeconds: {
10647
- one: '1 second',
10648
- other: '{{count}} seconds'
10649
- },
10650
- halfAMinute: 'half a minute',
10651
- lessThanXMinutes: {
10652
- one: 'less than a minute',
10653
- other: 'less than {{count}} minutes'
10654
- },
10655
- xMinutes: {
10656
- one: '1 minute',
10657
- other: '{{count}} minutes'
10658
- },
10659
- aboutXHours: {
10660
- one: 'about 1 hour',
10661
- other: 'about {{count}} hours'
10662
- },
10663
- xHours: {
10664
- one: '1 hour',
10665
- other: '{{count}} hours'
10666
- },
10667
- xDays: {
10668
- one: '1 day',
10669
- other: '{{count}} days'
10670
- },
10671
- aboutXWeeks: {
10672
- one: 'about 1 week',
10673
- other: 'about {{count}} weeks'
10674
- },
10675
- xWeeks: {
10676
- one: '1 week',
10677
- other: '{{count}} weeks'
10678
- },
10679
- aboutXMonths: {
10680
- one: 'about 1 month',
10681
- other: 'about {{count}} months'
10682
- },
10683
- xMonths: {
10684
- one: '1 month',
10685
- other: '{{count}} months'
10686
- },
10687
- aboutXYears: {
10688
- one: 'about 1 year',
10689
- other: 'about {{count}} years'
10690
- },
10691
- xYears: {
10692
- one: '1 year',
10693
- other: '{{count}} years'
10694
- },
10695
- overXYears: {
10696
- one: 'over 1 year',
10697
- other: 'over {{count}} years'
10698
- },
10699
- almostXYears: {
10700
- one: 'almost 1 year',
10701
- other: 'almost {{count}} years'
10702
- }
10703
- };
10704
- function formatDistance(token, count, options) {
10705
- options = options || {};
10706
- var result;
10707
- if (typeof formatDistanceLocale[token] === 'string') {
10708
- result = formatDistanceLocale[token];
10709
- } else if (count === 1) {
10710
- result = formatDistanceLocale[token].one;
10711
- } else {
10712
- result = formatDistanceLocale[token].other.replace('{{count}}', count);
10713
- }
10714
- if (options.addSuffix) {
10715
- if (options.comparison > 0) {
10716
- return 'in ' + result;
10717
- } else {
10718
- return result + ' ago';
10719
- }
10720
- }
10721
- return result;
10722
- }
10723
-
10724
- function buildFormatLongFn(args) {
10725
- return function (dirtyOptions) {
10726
- var options = dirtyOptions || {};
10727
- var width = options.width ? String(options.width) : args.defaultWidth;
10728
- var format = args.formats[width] || args.formats[args.defaultWidth];
10729
- return format;
10730
- };
10731
- }
10732
-
10733
- var dateFormats = {
10734
- full: 'EEEE, MMMM do, y',
10735
- "long": 'MMMM do, y',
10736
- medium: 'MMM d, y',
10737
- "short": 'MM/dd/yyyy'
10738
- };
10739
- var timeFormats = {
10740
- full: 'h:mm:ss a zzzz',
10741
- "long": 'h:mm:ss a z',
10742
- medium: 'h:mm:ss a',
10743
- "short": 'h:mm a'
10744
- };
10745
- var dateTimeFormats = {
10746
- full: "{{date}} 'at' {{time}}",
10747
- "long": "{{date}} 'at' {{time}}",
10748
- medium: '{{date}}, {{time}}',
10749
- "short": '{{date}}, {{time}}'
10750
- };
10751
- var formatLong = {
10752
- date: buildFormatLongFn({
10753
- formats: dateFormats,
10754
- defaultWidth: 'full'
10755
- }),
10756
- time: buildFormatLongFn({
10757
- formats: timeFormats,
10758
- defaultWidth: 'full'
10759
- }),
10760
- dateTime: buildFormatLongFn({
10761
- formats: dateTimeFormats,
10762
- defaultWidth: 'full'
10763
- })
10764
- };
10765
-
10766
- var formatRelativeLocale = {
10767
- lastWeek: "'last' eeee 'at' p",
10768
- yesterday: "'yesterday at' p",
10769
- today: "'today at' p",
10770
- tomorrow: "'tomorrow at' p",
10771
- nextWeek: "eeee 'at' p",
10772
- other: 'P'
10773
- };
10774
- function formatRelative(token, _date, _baseDate, _options) {
10775
- return formatRelativeLocale[token];
10776
- }
10777
-
10778
- function buildLocalizeFn(args) {
10779
- return function (dirtyIndex, dirtyOptions) {
10780
- var options = dirtyOptions || {};
10781
- var context = options.context ? String(options.context) : 'standalone';
10782
- var valuesArray;
10783
- if (context === 'formatting' && args.formattingValues) {
10784
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
10785
- var width = options.width ? String(options.width) : defaultWidth;
10786
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
10787
- } else {
10788
- var _defaultWidth = args.defaultWidth;
10789
- var _width = options.width ? String(options.width) : args.defaultWidth;
10790
- valuesArray = args.values[_width] || args.values[_defaultWidth];
10791
- }
10792
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
10793
- return valuesArray[index];
10794
- };
10795
- }
10796
-
10797
- var eraValues = {
10798
- narrow: ['B', 'A'],
10799
- abbreviated: ['BC', 'AD'],
10800
- wide: ['Before Christ', 'Anno Domini']
10801
- };
10802
- var quarterValues = {
10803
- narrow: ['1', '2', '3', '4'],
10804
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
10805
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.
10806
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
10807
- // Generally, formatted dates should look like they are in the middle of a sentence,
10808
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
10809
- };
10810
-
10811
- var monthValues = {
10812
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
10813
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
10814
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
10815
- };
10816
- var dayValues = {
10817
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
10818
- "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
10819
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
10820
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
10821
- };
10822
- var dayPeriodValues = {
10823
- narrow: {
10824
- am: 'a',
10825
- pm: 'p',
10826
- midnight: 'mi',
10827
- noon: 'n',
10828
- morning: 'morning',
10829
- afternoon: 'afternoon',
10830
- evening: 'evening',
10831
- night: 'night'
10832
- },
10833
- abbreviated: {
10834
- am: 'AM',
10835
- pm: 'PM',
10836
- midnight: 'midnight',
10837
- noon: 'noon',
10838
- morning: 'morning',
10839
- afternoon: 'afternoon',
10840
- evening: 'evening',
10841
- night: 'night'
10842
- },
10843
- wide: {
10844
- am: 'a.m.',
10845
- pm: 'p.m.',
10846
- midnight: 'midnight',
10847
- noon: 'noon',
10848
- morning: 'morning',
10849
- afternoon: 'afternoon',
10850
- evening: 'evening',
10851
- night: 'night'
10852
- }
10853
- };
10854
- var formattingDayPeriodValues = {
10855
- narrow: {
10856
- am: 'a',
10857
- pm: 'p',
10858
- midnight: 'mi',
10859
- noon: 'n',
10860
- morning: 'in the morning',
10861
- afternoon: 'in the afternoon',
10862
- evening: 'in the evening',
10863
- night: 'at night'
10864
- },
10865
- abbreviated: {
10866
- am: 'AM',
10867
- pm: 'PM',
10868
- midnight: 'midnight',
10869
- noon: 'noon',
10870
- morning: 'in the morning',
10871
- afternoon: 'in the afternoon',
10872
- evening: 'in the evening',
10873
- night: 'at night'
10874
- },
10875
- wide: {
10876
- am: 'a.m.',
10877
- pm: 'p.m.',
10878
- midnight: 'midnight',
10879
- noon: 'noon',
10880
- morning: 'in the morning',
10881
- afternoon: 'in the afternoon',
10882
- evening: 'in the evening',
10883
- night: 'at night'
10884
- }
10885
- };
10886
- function ordinalNumber(dirtyNumber, _dirtyOptions) {
10887
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
10888
- // if they are different for different grammatical genders,
10889
- // use `options.unit`:
10890
- //
10891
- // var options = dirtyOptions || {}
10892
- // var unit = String(options.unit)
10893
- //
10894
- // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
10895
- // 'day', 'hour', 'minute', 'second'
10896
-
10897
- var rem100 = number % 100;
10898
- if (rem100 > 20 || rem100 < 10) {
10899
- switch (rem100 % 10) {
10900
- case 1:
10901
- return number + 'st';
10902
- case 2:
10903
- return number + 'nd';
10904
- case 3:
10905
- return number + 'rd';
10906
- }
10907
- }
10908
- return number + 'th';
10909
- }
10910
- var localize = {
10911
- ordinalNumber: ordinalNumber,
10912
- era: buildLocalizeFn({
10913
- values: eraValues,
10914
- defaultWidth: 'wide'
10915
- }),
10916
- quarter: buildLocalizeFn({
10917
- values: quarterValues,
10918
- defaultWidth: 'wide',
10919
- argumentCallback: function argumentCallback(quarter) {
10920
- return Number(quarter) - 1;
10921
- }
10922
- }),
10923
- month: buildLocalizeFn({
10924
- values: monthValues,
10925
- defaultWidth: 'wide'
10926
- }),
10927
- day: buildLocalizeFn({
10928
- values: dayValues,
10929
- defaultWidth: 'wide'
10930
- }),
10931
- dayPeriod: buildLocalizeFn({
10932
- values: dayPeriodValues,
10933
- defaultWidth: 'wide',
10934
- formattingValues: formattingDayPeriodValues,
10935
- defaultFormattingWidth: 'wide'
10936
- })
10937
- };
10938
-
10939
- function buildMatchPatternFn(args) {
10940
- return function (dirtyString, dirtyOptions) {
10941
- var string = String(dirtyString);
10942
- var options = dirtyOptions || {};
10943
- var matchResult = string.match(args.matchPattern);
10944
- if (!matchResult) {
10945
- return null;
10946
- }
10947
- var matchedString = matchResult[0];
10948
- var parseResult = string.match(args.parsePattern);
10949
- if (!parseResult) {
10950
- return null;
10951
- }
10952
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
10953
- value = options.valueCallback ? options.valueCallback(value) : value;
10954
- return {
10955
- value: value,
10956
- rest: string.slice(matchedString.length)
10957
- };
10958
- };
10959
- }
10960
-
10961
- function buildMatchFn(args) {
10962
- return function (dirtyString, dirtyOptions) {
10963
- var string = String(dirtyString);
10964
- var options = dirtyOptions || {};
10965
- var width = options.width;
10966
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
10967
- var matchResult = string.match(matchPattern);
10968
- if (!matchResult) {
10969
- return null;
10970
- }
10971
- var matchedString = matchResult[0];
10972
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
10973
- var value;
10974
- if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
10975
- value = findIndex(parsePatterns, function (pattern) {
10976
- return pattern.test(matchedString);
10977
- });
10978
- } else {
10979
- value = findKey(parsePatterns, function (pattern) {
10980
- return pattern.test(matchedString);
10981
- });
10982
- }
10983
- value = args.valueCallback ? args.valueCallback(value) : value;
10984
- value = options.valueCallback ? options.valueCallback(value) : value;
10985
- return {
10986
- value: value,
10987
- rest: string.slice(matchedString.length)
10988
- };
10989
- };
10990
- }
10991
- function findKey(object, predicate) {
10992
- for (var key in object) {
10993
- if (object.hasOwnProperty(key) && predicate(object[key])) {
10994
- return key;
10995
- }
10996
- }
10997
- }
10998
- function findIndex(array, predicate) {
10999
- for (var key = 0; key < array.length; key++) {
11000
- if (predicate(array[key])) {
11001
- return key;
11002
- }
10713
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
10714
+ return false;
11003
10715
  }
10716
+ var date = toDate(dirtyDate);
10717
+ return !isNaN(Number(date));
11004
10718
  }
11005
10719
 
11006
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
11007
- var parseOrdinalNumberPattern = /\d+/i;
11008
- var matchEraPatterns = {
11009
- narrow: /^(b|a)/i,
11010
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
11011
- wide: /^(before christ|before common era|anno domini|common era)/i
11012
- };
11013
- var parseEraPatterns = {
11014
- any: [/^b/i, /^(a|c)/i]
11015
- };
11016
- var matchQuarterPatterns = {
11017
- narrow: /^[1234]/i,
11018
- abbreviated: /^q[1234]/i,
11019
- wide: /^[1234](th|st|nd|rd)? quarter/i
11020
- };
11021
- var parseQuarterPatterns = {
11022
- any: [/1/i, /2/i, /3/i, /4/i]
11023
- };
11024
- var matchMonthPatterns = {
11025
- narrow: /^[jfmasond]/i,
11026
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
11027
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
11028
- };
11029
- var parseMonthPatterns = {
11030
- narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
11031
- any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
11032
- };
11033
- var matchDayPatterns = {
11034
- narrow: /^[smtwf]/i,
11035
- "short": /^(su|mo|tu|we|th|fr|sa)/i,
11036
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
11037
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
11038
- };
11039
- var parseDayPatterns = {
11040
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
11041
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
11042
- };
11043
- var matchDayPeriodPatterns = {
11044
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
11045
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
11046
- };
11047
- var parseDayPeriodPatterns = {
11048
- any: {
11049
- am: /^a/i,
11050
- pm: /^p/i,
11051
- midnight: /^mi/i,
11052
- noon: /^no/i,
11053
- morning: /morning/i,
11054
- afternoon: /afternoon/i,
11055
- evening: /evening/i,
11056
- night: /night/i
11057
- }
11058
- };
11059
- var match = {
11060
- ordinalNumber: buildMatchPatternFn({
11061
- matchPattern: matchOrdinalNumberPattern,
11062
- parsePattern: parseOrdinalNumberPattern,
11063
- valueCallback: function valueCallback(value) {
11064
- return parseInt(value, 10);
11065
- }
11066
- }),
11067
- era: buildMatchFn({
11068
- matchPatterns: matchEraPatterns,
11069
- defaultMatchWidth: 'wide',
11070
- parsePatterns: parseEraPatterns,
11071
- defaultParseWidth: 'any'
11072
- }),
11073
- quarter: buildMatchFn({
11074
- matchPatterns: matchQuarterPatterns,
11075
- defaultMatchWidth: 'wide',
11076
- parsePatterns: parseQuarterPatterns,
11077
- defaultParseWidth: 'any',
11078
- valueCallback: function valueCallback(index) {
11079
- return index + 1;
11080
- }
11081
- }),
11082
- month: buildMatchFn({
11083
- matchPatterns: matchMonthPatterns,
11084
- defaultMatchWidth: 'wide',
11085
- parsePatterns: parseMonthPatterns,
11086
- defaultParseWidth: 'any'
11087
- }),
11088
- day: buildMatchFn({
11089
- matchPatterns: matchDayPatterns,
11090
- defaultMatchWidth: 'wide',
11091
- parsePatterns: parseDayPatterns,
11092
- defaultParseWidth: 'any'
11093
- }),
11094
- dayPeriod: buildMatchFn({
11095
- matchPatterns: matchDayPeriodPatterns,
11096
- defaultMatchWidth: 'any',
11097
- parsePatterns: parseDayPeriodPatterns,
11098
- defaultParseWidth: 'any'
11099
- })
11100
- };
11101
-
11102
- /**
11103
- * @type {Locale}
11104
- * @category Locales
11105
- * @summary English locale (United States).
11106
- * @language English
11107
- * @iso-639-2 eng
11108
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
11109
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
11110
- */
11111
-
11112
- var locale = {
11113
- code: 'en-US',
11114
- formatDistance: formatDistance,
11115
- formatLong: formatLong,
11116
- formatRelative: formatRelative,
11117
- localize: localize,
11118
- match: match,
11119
- options: {
11120
- weekStartsOn: 0
11121
- /* Sunday */,
11122
-
11123
- firstWeekContainsDate: 1
11124
- }
11125
- };
11126
-
11127
10720
  function toInteger(dirtyNumber) {
11128
10721
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
11129
10722
  return NaN;
@@ -11143,10 +10736,6 @@ function toInteger(dirtyNumber) {
11143
10736
  * @description
11144
10737
  * Add the specified number of milliseconds to the given date.
11145
10738
  *
11146
- * ### v2.0.0 breaking changes:
11147
- *
11148
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
11149
- *
11150
10739
  * @param {Date|Number} date - the date to be changed
11151
10740
  * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
11152
10741
  * @returns {Date} the new date with the milliseconds added
@@ -11154,10 +10743,9 @@ function toInteger(dirtyNumber) {
11154
10743
  *
11155
10744
  * @example
11156
10745
  * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
11157
- * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
10746
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
11158
10747
  * //=> Thu Jul 10 2014 12:45:30.750
11159
10748
  */
11160
-
11161
10749
  function addMilliseconds(dirtyDate, dirtyAmount) {
11162
10750
  requiredArgs(2, arguments);
11163
10751
  var timestamp = toDate(dirtyDate).getTime();
@@ -11173,10 +10761,6 @@ function addMilliseconds(dirtyDate, dirtyAmount) {
11173
10761
  * @description
11174
10762
  * Subtract the specified number of milliseconds from the given date.
11175
10763
  *
11176
- * ### v2.0.0 breaking changes:
11177
- *
11178
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
11179
- *
11180
10764
  * @param {Date|Number} date - the date to be changed
11181
10765
  * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
11182
10766
  * @returns {Date} the new date with the milliseconds subtracted
@@ -11184,106 +10768,16 @@ function addMilliseconds(dirtyDate, dirtyAmount) {
11184
10768
  *
11185
10769
  * @example
11186
10770
  * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
11187
- * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
10771
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
11188
10772
  * //=> Thu Jul 10 2014 12:45:29.250
11189
10773
  */
11190
-
11191
10774
  function subMilliseconds(dirtyDate, dirtyAmount) {
11192
10775
  requiredArgs(2, arguments);
11193
10776
  var amount = toInteger(dirtyAmount);
11194
10777
  return addMilliseconds(dirtyDate, -amount);
11195
10778
  }
11196
10779
 
11197
- function addLeadingZeros(number, targetLength) {
11198
- var sign = number < 0 ? '-' : '';
11199
- var output = Math.abs(number).toString();
11200
- while (output.length < targetLength) {
11201
- output = '0' + output;
11202
- }
11203
- return sign + output;
11204
- }
11205
-
11206
- /*
11207
- * | | Unit | | Unit |
11208
- * |-----|--------------------------------|-----|--------------------------------|
11209
- * | a | AM, PM | A* | |
11210
- * | d | Day of month | D | |
11211
- * | h | Hour [1-12] | H | Hour [0-23] |
11212
- * | m | Minute | M | Month |
11213
- * | s | Second | S | Fraction of second |
11214
- * | y | Year (abs) | Y | |
11215
- *
11216
- * Letters marked by * are not implemented but reserved by Unicode standard.
11217
- */
11218
-
11219
- var formatters$1 = {
11220
- // Year
11221
- y: function y(date, token) {
11222
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
11223
- // | Year | y | yy | yyy | yyyy | yyyyy |
11224
- // |----------|-------|----|-------|-------|-------|
11225
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
11226
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
11227
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
11228
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
11229
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
11230
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
11231
-
11232
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
11233
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
11234
- },
11235
- // Month
11236
- M: function M(date, token) {
11237
- var month = date.getUTCMonth();
11238
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
11239
- },
11240
- // Day of the month
11241
- d: function d(date, token) {
11242
- return addLeadingZeros(date.getUTCDate(), token.length);
11243
- },
11244
- // AM or PM
11245
- a: function a(date, token) {
11246
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
11247
- switch (token) {
11248
- case 'a':
11249
- case 'aa':
11250
- case 'aaa':
11251
- return dayPeriodEnumValue.toUpperCase();
11252
- case 'aaaaa':
11253
- return dayPeriodEnumValue[0];
11254
- case 'aaaa':
11255
- default:
11256
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
11257
- }
11258
- },
11259
- // Hour [1-12]
11260
- h: function h(date, token) {
11261
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
11262
- },
11263
- // Hour [0-23]
11264
- H: function H(date, token) {
11265
- return addLeadingZeros(date.getUTCHours(), token.length);
11266
- },
11267
- // Minute
11268
- m: function m(date, token) {
11269
- return addLeadingZeros(date.getUTCMinutes(), token.length);
11270
- },
11271
- // Second
11272
- s: function s(date, token) {
11273
- return addLeadingZeros(date.getUTCSeconds(), token.length);
11274
- },
11275
- // Fraction of second
11276
- S: function S(date, token) {
11277
- var numberOfDigits = token.length;
11278
- var milliseconds = date.getUTCMilliseconds();
11279
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
11280
- return addLeadingZeros(fractionalSeconds, token.length);
11281
- }
11282
- };
11283
-
11284
- var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
11285
- // See issue: https://github.com/date-fns/date-fns/issues/376
11286
-
10780
+ var MILLISECONDS_IN_DAY = 86400000;
11287
10781
  function getUTCDayOfYear(dirtyDate) {
11288
10782
  requiredArgs(1, arguments);
11289
10783
  var date = toDate(dirtyDate);
@@ -11295,8 +10789,6 @@ function getUTCDayOfYear(dirtyDate) {
11295
10789
  return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
11296
10790
  }
11297
10791
 
11298
- // See issue: https://github.com/date-fns/date-fns/issues/376
11299
-
11300
10792
  function startOfUTCISOWeek(dirtyDate) {
11301
10793
  requiredArgs(1, arguments);
11302
10794
  var weekStartsOn = 1;
@@ -11308,8 +10800,6 @@ function startOfUTCISOWeek(dirtyDate) {
11308
10800
  return date;
11309
10801
  }
11310
10802
 
11311
- // See issue: https://github.com/date-fns/date-fns/issues/376
11312
-
11313
10803
  function getUTCISOWeekYear(dirtyDate) {
11314
10804
  requiredArgs(1, arguments);
11315
10805
  var date = toDate(dirtyDate);
@@ -11331,8 +10821,6 @@ function getUTCISOWeekYear(dirtyDate) {
11331
10821
  }
11332
10822
  }
11333
10823
 
11334
- // See issue: https://github.com/date-fns/date-fns/issues/376
11335
-
11336
10824
  function startOfUTCISOWeekYear(dirtyDate) {
11337
10825
  requiredArgs(1, arguments);
11338
10826
  var year = getUTCISOWeekYear(dirtyDate);
@@ -11343,29 +10831,30 @@ function startOfUTCISOWeekYear(dirtyDate) {
11343
10831
  return date;
11344
10832
  }
11345
10833
 
11346
- var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
11347
- // See issue: https://github.com/date-fns/date-fns/issues/376
11348
-
10834
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
11349
10835
  function getUTCISOWeek(dirtyDate) {
11350
10836
  requiredArgs(1, arguments);
11351
10837
  var date = toDate(dirtyDate);
11352
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
10838
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
10839
+
10840
+ // Round the number of days to the nearest integer
11353
10841
  // because the number of milliseconds in a week is not constant
11354
10842
  // (e.g. it's different in the week of the daylight saving time clock shift)
11355
-
11356
10843
  return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
11357
10844
  }
11358
10845
 
11359
- // See issue: https://github.com/date-fns/date-fns/issues/376
10846
+ var defaultOptions = {};
10847
+ function getDefaultOptions() {
10848
+ return defaultOptions;
10849
+ }
11360
10850
 
11361
- function startOfUTCWeek(dirtyDate, dirtyOptions) {
10851
+ function startOfUTCWeek(dirtyDate, options) {
10852
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
11362
10853
  requiredArgs(1, arguments);
11363
- var options = dirtyOptions || {};
11364
- var locale = options.locale;
11365
- var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
11366
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
11367
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
10854
+ var defaultOptions = getDefaultOptions();
10855
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
11368
10856
 
10857
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11369
10858
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
11370
10859
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
11371
10860
  }
@@ -11377,29 +10866,26 @@ function startOfUTCWeek(dirtyDate, dirtyOptions) {
11377
10866
  return date;
11378
10867
  }
11379
10868
 
11380
- // See issue: https://github.com/date-fns/date-fns/issues/376
11381
-
11382
- function getUTCWeekYear(dirtyDate, dirtyOptions) {
10869
+ function getUTCWeekYear(dirtyDate, options) {
10870
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
11383
10871
  requiredArgs(1, arguments);
11384
- var date = toDate(dirtyDate, dirtyOptions);
10872
+ var date = toDate(dirtyDate);
11385
10873
  var year = date.getUTCFullYear();
11386
- var options = dirtyOptions || {};
11387
- var locale = options.locale;
11388
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
11389
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
11390
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
10874
+ var defaultOptions = getDefaultOptions();
10875
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
11391
10876
 
10877
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11392
10878
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
11393
10879
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
11394
10880
  }
11395
10881
  var firstWeekOfNextYear = new Date(0);
11396
10882
  firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
11397
10883
  firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
11398
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
10884
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
11399
10885
  var firstWeekOfThisYear = new Date(0);
11400
10886
  firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
11401
10887
  firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
11402
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
10888
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
11403
10889
  if (date.getTime() >= startOfNextYear.getTime()) {
11404
10890
  return year + 1;
11405
10891
  } else if (date.getTime() >= startOfThisYear.getTime()) {
@@ -11409,36 +10895,119 @@ function getUTCWeekYear(dirtyDate, dirtyOptions) {
11409
10895
  }
11410
10896
  }
11411
10897
 
11412
- // See issue: https://github.com/date-fns/date-fns/issues/376
11413
-
11414
- function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
10898
+ function startOfUTCWeekYear(dirtyDate, options) {
10899
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
11415
10900
  requiredArgs(1, arguments);
11416
- var options = dirtyOptions || {};
11417
- var locale = options.locale;
11418
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
11419
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
11420
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
11421
- var year = getUTCWeekYear(dirtyDate, dirtyOptions);
10901
+ var defaultOptions = getDefaultOptions();
10902
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
10903
+ var year = getUTCWeekYear(dirtyDate, options);
11422
10904
  var firstWeek = new Date(0);
11423
10905
  firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
11424
10906
  firstWeek.setUTCHours(0, 0, 0, 0);
11425
- var date = startOfUTCWeek(firstWeek, dirtyOptions);
10907
+ var date = startOfUTCWeek(firstWeek, options);
11426
10908
  return date;
11427
10909
  }
11428
10910
 
11429
- var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
11430
- // See issue: https://github.com/date-fns/date-fns/issues/376
11431
-
10911
+ var MILLISECONDS_IN_WEEK = 604800000;
11432
10912
  function getUTCWeek(dirtyDate, options) {
11433
10913
  requiredArgs(1, arguments);
11434
10914
  var date = toDate(dirtyDate);
11435
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
10915
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
10916
+
10917
+ // Round the number of days to the nearest integer
11436
10918
  // because the number of milliseconds in a week is not constant
11437
10919
  // (e.g. it's different in the week of the daylight saving time clock shift)
11438
-
11439
10920
  return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
11440
10921
  }
11441
10922
 
10923
+ function addLeadingZeros(number, targetLength) {
10924
+ var sign = number < 0 ? '-' : '';
10925
+ var output = Math.abs(number).toString();
10926
+ while (output.length < targetLength) {
10927
+ output = '0' + output;
10928
+ }
10929
+ return sign + output;
10930
+ }
10931
+
10932
+ /*
10933
+ * | | Unit | | Unit |
10934
+ * |-----|--------------------------------|-----|--------------------------------|
10935
+ * | a | AM, PM | A* | |
10936
+ * | d | Day of month | D | |
10937
+ * | h | Hour [1-12] | H | Hour [0-23] |
10938
+ * | m | Minute | M | Month |
10939
+ * | s | Second | S | Fraction of second |
10940
+ * | y | Year (abs) | Y | |
10941
+ *
10942
+ * Letters marked by * are not implemented but reserved by Unicode standard.
10943
+ */
10944
+ var formatters$1 = {
10945
+ // Year
10946
+ y: function y(date, token) {
10947
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
10948
+ // | Year | y | yy | yyy | yyyy | yyyyy |
10949
+ // |----------|-------|----|-------|-------|-------|
10950
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
10951
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
10952
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
10953
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
10954
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
10955
+
10956
+ var signedYear = date.getUTCFullYear();
10957
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
10958
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
10959
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
10960
+ },
10961
+ // Month
10962
+ M: function M(date, token) {
10963
+ var month = date.getUTCMonth();
10964
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
10965
+ },
10966
+ // Day of the month
10967
+ d: function d(date, token) {
10968
+ return addLeadingZeros(date.getUTCDate(), token.length);
10969
+ },
10970
+ // AM or PM
10971
+ a: function a(date, token) {
10972
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
10973
+ switch (token) {
10974
+ case 'a':
10975
+ case 'aa':
10976
+ return dayPeriodEnumValue.toUpperCase();
10977
+ case 'aaa':
10978
+ return dayPeriodEnumValue;
10979
+ case 'aaaaa':
10980
+ return dayPeriodEnumValue[0];
10981
+ case 'aaaa':
10982
+ default:
10983
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
10984
+ }
10985
+ },
10986
+ // Hour [1-12]
10987
+ h: function h(date, token) {
10988
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
10989
+ },
10990
+ // Hour [0-23]
10991
+ H: function H(date, token) {
10992
+ return addLeadingZeros(date.getUTCHours(), token.length);
10993
+ },
10994
+ // Minute
10995
+ m: function m(date, token) {
10996
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
10997
+ },
10998
+ // Second
10999
+ s: function s(date, token) {
11000
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
11001
+ },
11002
+ // Fraction of second
11003
+ S: function S(date, token) {
11004
+ var numberOfDigits = token.length;
11005
+ var milliseconds = date.getUTCMilliseconds();
11006
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
11007
+ return addLeadingZeros(fractionalSeconds, token.length);
11008
+ }
11009
+ };
11010
+
11442
11011
  var dayPeriodEnum = {
11443
11012
  am: 'am',
11444
11013
  pm: 'pm',
@@ -11448,52 +11017,52 @@ var dayPeriodEnum = {
11448
11017
  afternoon: 'afternoon',
11449
11018
  evening: 'evening',
11450
11019
  night: 'night'
11451
- /*
11452
- * | | Unit | | Unit |
11453
- * |-----|--------------------------------|-----|--------------------------------|
11454
- * | a | AM, PM | A* | Milliseconds in day |
11455
- * | b | AM, PM, noon, midnight | B | Flexible day period |
11456
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
11457
- * | d | Day of month | D | Day of year |
11458
- * | e | Local day of week | E | Day of week |
11459
- * | f | | F* | Day of week in month |
11460
- * | g* | Modified Julian day | G | Era |
11461
- * | h | Hour [1-12] | H | Hour [0-23] |
11462
- * | i! | ISO day of week | I! | ISO week of year |
11463
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
11464
- * | k | Hour [1-24] | K | Hour [0-11] |
11465
- * | l* | (deprecated) | L | Stand-alone month |
11466
- * | m | Minute | M | Month |
11467
- * | n | | N | |
11468
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
11469
- * | p! | Long localized time | P! | Long localized date |
11470
- * | q | Stand-alone quarter | Q | Quarter |
11471
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
11472
- * | s | Second | S | Fraction of second |
11473
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
11474
- * | u | Extended year | U* | Cyclic year |
11475
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
11476
- * | w | Local week of year | W* | Week of month |
11477
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
11478
- * | y | Year (abs) | Y | Local week-numbering year |
11479
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
11480
- *
11481
- * Letters marked by * are not implemented but reserved by Unicode standard.
11482
- *
11483
- * Letters marked by ! are non-standard, but implemented by date-fns:
11484
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
11485
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
11486
- * i.e. 7 for Sunday, 1 for Monday, etc.
11487
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
11488
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
11489
- * `R` is supposed to be used in conjunction with `I` and `i`
11490
- * for universal ISO week-numbering date, whereas
11491
- * `Y` is supposed to be used in conjunction with `w` and `e`
11492
- * for week-numbering date specific to the locale.
11493
- * - `P` is long localized date format
11494
- * - `p` is long localized time format
11495
- */
11496
11020
  };
11021
+ /*
11022
+ * | | Unit | | Unit |
11023
+ * |-----|--------------------------------|-----|--------------------------------|
11024
+ * | a | AM, PM | A* | Milliseconds in day |
11025
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
11026
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
11027
+ * | d | Day of month | D | Day of year |
11028
+ * | e | Local day of week | E | Day of week |
11029
+ * | f | | F* | Day of week in month |
11030
+ * | g* | Modified Julian day | G | Era |
11031
+ * | h | Hour [1-12] | H | Hour [0-23] |
11032
+ * | i! | ISO day of week | I! | ISO week of year |
11033
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
11034
+ * | k | Hour [1-24] | K | Hour [0-11] |
11035
+ * | l* | (deprecated) | L | Stand-alone month |
11036
+ * | m | Minute | M | Month |
11037
+ * | n | | N | |
11038
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
11039
+ * | p! | Long localized time | P! | Long localized date |
11040
+ * | q | Stand-alone quarter | Q | Quarter |
11041
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
11042
+ * | s | Second | S | Fraction of second |
11043
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
11044
+ * | u | Extended year | U* | Cyclic year |
11045
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
11046
+ * | w | Local week of year | W* | Week of month |
11047
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
11048
+ * | y | Year (abs) | Y | Local week-numbering year |
11049
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
11050
+ *
11051
+ * Letters marked by * are not implemented but reserved by Unicode standard.
11052
+ *
11053
+ * Letters marked by ! are non-standard, but implemented by date-fns:
11054
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
11055
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
11056
+ * i.e. 7 for Sunday, 1 for Monday, etc.
11057
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
11058
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
11059
+ * `R` is supposed to be used in conjunction with `I` and `i`
11060
+ * for universal ISO week-numbering date, whereas
11061
+ * `Y` is supposed to be used in conjunction with `w` and `e`
11062
+ * for week-numbering date specific to the locale.
11063
+ * - `P` is long localized date format
11064
+ * - `p` is long localized time format
11065
+ */
11497
11066
 
11498
11067
  var formatters = {
11499
11068
  // Era
@@ -11508,13 +11077,11 @@ var formatters = {
11508
11077
  width: 'abbreviated'
11509
11078
  });
11510
11079
  // A, B
11511
-
11512
11080
  case 'GGGGG':
11513
11081
  return localize.era(era, {
11514
11082
  width: 'narrow'
11515
11083
  });
11516
11084
  // Anno Domini, Before Christ
11517
-
11518
11085
  case 'GGGG':
11519
11086
  default:
11520
11087
  return localize.era(era, {
@@ -11526,8 +11093,8 @@ var formatters = {
11526
11093
  y: function y(date, token, localize) {
11527
11094
  // Ordinal number
11528
11095
  if (token === 'yo') {
11529
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
11530
-
11096
+ var signedYear = date.getUTCFullYear();
11097
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
11531
11098
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
11532
11099
  return localize.ordinalNumber(year, {
11533
11100
  unit: 'year'
@@ -11537,27 +11104,31 @@ var formatters = {
11537
11104
  },
11538
11105
  // Local week-numbering year
11539
11106
  Y: function Y(date, token, localize, options) {
11540
- var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
11541
-
11542
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
11107
+ var signedWeekYear = getUTCWeekYear(date, options);
11108
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
11109
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
11543
11110
 
11111
+ // Two digit year
11544
11112
  if (token === 'YY') {
11545
11113
  var twoDigitYear = weekYear % 100;
11546
11114
  return addLeadingZeros(twoDigitYear, 2);
11547
- } // Ordinal number
11115
+ }
11548
11116
 
11117
+ // Ordinal number
11549
11118
  if (token === 'Yo') {
11550
11119
  return localize.ordinalNumber(weekYear, {
11551
11120
  unit: 'year'
11552
11121
  });
11553
- } // Padding
11122
+ }
11554
11123
 
11124
+ // Padding
11555
11125
  return addLeadingZeros(weekYear, token.length);
11556
11126
  },
11557
11127
  // ISO week-numbering year
11558
11128
  R: function R(date, token) {
11559
- var isoWeekYear = getUTCISOWeekYear(date); // Padding
11129
+ var isoWeekYear = getUTCISOWeekYear(date);
11560
11130
 
11131
+ // Padding
11561
11132
  return addLeadingZeros(isoWeekYear, token.length);
11562
11133
  },
11563
11134
  // Extended year. This is a single number designating the year of this calendar system.
@@ -11581,31 +11152,26 @@ var formatters = {
11581
11152
  case 'Q':
11582
11153
  return String(quarter);
11583
11154
  // 01, 02, 03, 04
11584
-
11585
11155
  case 'QQ':
11586
11156
  return addLeadingZeros(quarter, 2);
11587
11157
  // 1st, 2nd, 3rd, 4th
11588
-
11589
11158
  case 'Qo':
11590
11159
  return localize.ordinalNumber(quarter, {
11591
11160
  unit: 'quarter'
11592
11161
  });
11593
11162
  // Q1, Q2, Q3, Q4
11594
-
11595
11163
  case 'QQQ':
11596
11164
  return localize.quarter(quarter, {
11597
11165
  width: 'abbreviated',
11598
11166
  context: 'formatting'
11599
11167
  });
11600
11168
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
11601
-
11602
11169
  case 'QQQQQ':
11603
11170
  return localize.quarter(quarter, {
11604
11171
  width: 'narrow',
11605
11172
  context: 'formatting'
11606
11173
  });
11607
11174
  // 1st quarter, 2nd quarter, ...
11608
-
11609
11175
  case 'QQQQ':
11610
11176
  default:
11611
11177
  return localize.quarter(quarter, {
@@ -11622,31 +11188,26 @@ var formatters = {
11622
11188
  case 'q':
11623
11189
  return String(quarter);
11624
11190
  // 01, 02, 03, 04
11625
-
11626
11191
  case 'qq':
11627
11192
  return addLeadingZeros(quarter, 2);
11628
11193
  // 1st, 2nd, 3rd, 4th
11629
-
11630
11194
  case 'qo':
11631
11195
  return localize.ordinalNumber(quarter, {
11632
11196
  unit: 'quarter'
11633
11197
  });
11634
11198
  // Q1, Q2, Q3, Q4
11635
-
11636
11199
  case 'qqq':
11637
11200
  return localize.quarter(quarter, {
11638
11201
  width: 'abbreviated',
11639
11202
  context: 'standalone'
11640
11203
  });
11641
11204
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
11642
-
11643
11205
  case 'qqqqq':
11644
11206
  return localize.quarter(quarter, {
11645
11207
  width: 'narrow',
11646
11208
  context: 'standalone'
11647
11209
  });
11648
11210
  // 1st quarter, 2nd quarter, ...
11649
-
11650
11211
  case 'qqqq':
11651
11212
  default:
11652
11213
  return localize.quarter(quarter, {
@@ -11663,27 +11224,23 @@ var formatters = {
11663
11224
  case 'MM':
11664
11225
  return formatters$1.M(date, token);
11665
11226
  // 1st, 2nd, ..., 12th
11666
-
11667
11227
  case 'Mo':
11668
11228
  return localize.ordinalNumber(month + 1, {
11669
11229
  unit: 'month'
11670
11230
  });
11671
11231
  // Jan, Feb, ..., Dec
11672
-
11673
11232
  case 'MMM':
11674
11233
  return localize.month(month, {
11675
11234
  width: 'abbreviated',
11676
11235
  context: 'formatting'
11677
11236
  });
11678
11237
  // J, F, ..., D
11679
-
11680
11238
  case 'MMMMM':
11681
11239
  return localize.month(month, {
11682
11240
  width: 'narrow',
11683
11241
  context: 'formatting'
11684
11242
  });
11685
11243
  // January, February, ..., December
11686
-
11687
11244
  case 'MMMM':
11688
11245
  default:
11689
11246
  return localize.month(month, {
@@ -11700,31 +11257,26 @@ var formatters = {
11700
11257
  case 'L':
11701
11258
  return String(month + 1);
11702
11259
  // 01, 02, ..., 12
11703
-
11704
11260
  case 'LL':
11705
11261
  return addLeadingZeros(month + 1, 2);
11706
11262
  // 1st, 2nd, ..., 12th
11707
-
11708
11263
  case 'Lo':
11709
11264
  return localize.ordinalNumber(month + 1, {
11710
11265
  unit: 'month'
11711
11266
  });
11712
11267
  // Jan, Feb, ..., Dec
11713
-
11714
11268
  case 'LLL':
11715
11269
  return localize.month(month, {
11716
11270
  width: 'abbreviated',
11717
11271
  context: 'standalone'
11718
11272
  });
11719
11273
  // J, F, ..., D
11720
-
11721
11274
  case 'LLLLL':
11722
11275
  return localize.month(month, {
11723
11276
  width: 'narrow',
11724
11277
  context: 'standalone'
11725
11278
  });
11726
11279
  // January, February, ..., December
11727
-
11728
11280
  case 'LLLL':
11729
11281
  default:
11730
11282
  return localize.month(month, {
@@ -11785,21 +11337,18 @@ var formatters = {
11785
11337
  context: 'formatting'
11786
11338
  });
11787
11339
  // T
11788
-
11789
11340
  case 'EEEEE':
11790
11341
  return localize.day(dayOfWeek, {
11791
11342
  width: 'narrow',
11792
11343
  context: 'formatting'
11793
11344
  });
11794
11345
  // Tu
11795
-
11796
11346
  case 'EEEEEE':
11797
11347
  return localize.day(dayOfWeek, {
11798
11348
  width: 'short',
11799
11349
  context: 'formatting'
11800
11350
  });
11801
11351
  // Tuesday
11802
-
11803
11352
  case 'EEEE':
11804
11353
  default:
11805
11354
  return localize.day(dayOfWeek, {
@@ -11817,11 +11366,9 @@ var formatters = {
11817
11366
  case 'e':
11818
11367
  return String(localDayOfWeek);
11819
11368
  // Padded numerical value
11820
-
11821
11369
  case 'ee':
11822
11370
  return addLeadingZeros(localDayOfWeek, 2);
11823
11371
  // 1st, 2nd, ..., 7th
11824
-
11825
11372
  case 'eo':
11826
11373
  return localize.ordinalNumber(localDayOfWeek, {
11827
11374
  unit: 'day'
@@ -11832,21 +11379,18 @@ var formatters = {
11832
11379
  context: 'formatting'
11833
11380
  });
11834
11381
  // T
11835
-
11836
11382
  case 'eeeee':
11837
11383
  return localize.day(dayOfWeek, {
11838
11384
  width: 'narrow',
11839
11385
  context: 'formatting'
11840
11386
  });
11841
11387
  // Tu
11842
-
11843
11388
  case 'eeeeee':
11844
11389
  return localize.day(dayOfWeek, {
11845
11390
  width: 'short',
11846
11391
  context: 'formatting'
11847
11392
  });
11848
11393
  // Tuesday
11849
-
11850
11394
  case 'eeee':
11851
11395
  default:
11852
11396
  return localize.day(dayOfWeek, {
@@ -11864,11 +11408,9 @@ var formatters = {
11864
11408
  case 'c':
11865
11409
  return String(localDayOfWeek);
11866
11410
  // Padded numerical value
11867
-
11868
11411
  case 'cc':
11869
11412
  return addLeadingZeros(localDayOfWeek, token.length);
11870
11413
  // 1st, 2nd, ..., 7th
11871
-
11872
11414
  case 'co':
11873
11415
  return localize.ordinalNumber(localDayOfWeek, {
11874
11416
  unit: 'day'
@@ -11879,21 +11421,18 @@ var formatters = {
11879
11421
  context: 'standalone'
11880
11422
  });
11881
11423
  // T
11882
-
11883
11424
  case 'ccccc':
11884
11425
  return localize.day(dayOfWeek, {
11885
11426
  width: 'narrow',
11886
11427
  context: 'standalone'
11887
11428
  });
11888
11429
  // Tu
11889
-
11890
11430
  case 'cccccc':
11891
11431
  return localize.day(dayOfWeek, {
11892
11432
  width: 'short',
11893
11433
  context: 'standalone'
11894
11434
  });
11895
11435
  // Tuesday
11896
-
11897
11436
  case 'cccc':
11898
11437
  default:
11899
11438
  return localize.day(dayOfWeek, {
@@ -11911,38 +11450,32 @@ var formatters = {
11911
11450
  case 'i':
11912
11451
  return String(isoDayOfWeek);
11913
11452
  // 02
11914
-
11915
11453
  case 'ii':
11916
11454
  return addLeadingZeros(isoDayOfWeek, token.length);
11917
11455
  // 2nd
11918
-
11919
11456
  case 'io':
11920
11457
  return localize.ordinalNumber(isoDayOfWeek, {
11921
11458
  unit: 'day'
11922
11459
  });
11923
11460
  // Tue
11924
-
11925
11461
  case 'iii':
11926
11462
  return localize.day(dayOfWeek, {
11927
11463
  width: 'abbreviated',
11928
11464
  context: 'formatting'
11929
11465
  });
11930
11466
  // T
11931
-
11932
11467
  case 'iiiii':
11933
11468
  return localize.day(dayOfWeek, {
11934
11469
  width: 'narrow',
11935
11470
  context: 'formatting'
11936
11471
  });
11937
11472
  // Tu
11938
-
11939
11473
  case 'iiiiii':
11940
11474
  return localize.day(dayOfWeek, {
11941
11475
  width: 'short',
11942
11476
  context: 'formatting'
11943
11477
  });
11944
11478
  // Tuesday
11945
-
11946
11479
  case 'iiii':
11947
11480
  default:
11948
11481
  return localize.day(dayOfWeek, {
@@ -11958,11 +11491,15 @@ var formatters = {
11958
11491
  switch (token) {
11959
11492
  case 'a':
11960
11493
  case 'aa':
11961
- case 'aaa':
11962
11494
  return localize.dayPeriod(dayPeriodEnumValue, {
11963
11495
  width: 'abbreviated',
11964
11496
  context: 'formatting'
11965
11497
  });
11498
+ case 'aaa':
11499
+ return localize.dayPeriod(dayPeriodEnumValue, {
11500
+ width: 'abbreviated',
11501
+ context: 'formatting'
11502
+ }).toLowerCase();
11966
11503
  case 'aaaaa':
11967
11504
  return localize.dayPeriod(dayPeriodEnumValue, {
11968
11505
  width: 'narrow',
@@ -11990,11 +11527,15 @@ var formatters = {
11990
11527
  switch (token) {
11991
11528
  case 'b':
11992
11529
  case 'bb':
11993
- case 'bbb':
11994
11530
  return localize.dayPeriod(dayPeriodEnumValue, {
11995
11531
  width: 'abbreviated',
11996
11532
  context: 'formatting'
11997
11533
  });
11534
+ case 'bbb':
11535
+ return localize.dayPeriod(dayPeriodEnumValue, {
11536
+ width: 'abbreviated',
11537
+ context: 'formatting'
11538
+ }).toLowerCase();
11998
11539
  case 'bbbbb':
11999
11540
  return localize.dayPeriod(dayPeriodEnumValue, {
12000
11541
  width: 'narrow',
@@ -12116,21 +11657,20 @@ var formatters = {
12116
11657
  // Hours and optional minutes
12117
11658
  case 'X':
12118
11659
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
11660
+
12119
11661
  // Hours, minutes and optional seconds without `:` delimiter
12120
11662
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
12121
11663
  // so this token always has the same output as `XX`
12122
-
12123
11664
  case 'XXXX':
12124
11665
  case 'XX':
12125
11666
  // Hours and minutes without `:` delimiter
12126
11667
  return formatTimezone(timezoneOffset);
11668
+
12127
11669
  // Hours, minutes and optional seconds with `:` delimiter
12128
11670
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
12129
11671
  // so this token always has the same output as `XXX`
12130
-
12131
11672
  case 'XXXXX':
12132
11673
  case 'XXX': // Hours and minutes with `:` delimiter
12133
-
12134
11674
  default:
12135
11675
  return formatTimezone(timezoneOffset, ':');
12136
11676
  }
@@ -12143,21 +11683,20 @@ var formatters = {
12143
11683
  // Hours and optional minutes
12144
11684
  case 'x':
12145
11685
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
11686
+
12146
11687
  // Hours, minutes and optional seconds without `:` delimiter
12147
11688
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
12148
11689
  // so this token always has the same output as `xx`
12149
-
12150
11690
  case 'xxxx':
12151
11691
  case 'xx':
12152
11692
  // Hours and minutes without `:` delimiter
12153
11693
  return formatTimezone(timezoneOffset);
11694
+
12154
11695
  // Hours, minutes and optional seconds with `:` delimiter
12155
11696
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
12156
11697
  // so this token always has the same output as `xxx`
12157
-
12158
11698
  case 'xxxxx':
12159
11699
  case 'xxx': // Hours and minutes with `:` delimiter
12160
-
12161
11700
  default:
12162
11701
  return formatTimezone(timezoneOffset, ':');
12163
11702
  }
@@ -12173,7 +11712,6 @@ var formatters = {
12173
11712
  case 'OOO':
12174
11713
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
12175
11714
  // Long
12176
-
12177
11715
  case 'OOOO':
12178
11716
  default:
12179
11717
  return 'GMT' + formatTimezone(timezoneOffset, ':');
@@ -12190,7 +11728,6 @@ var formatters = {
12190
11728
  case 'zzz':
12191
11729
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
12192
11730
  // Long
12193
-
12194
11731
  case 'zzzz':
12195
11732
  default:
12196
11733
  return 'GMT' + formatTimezone(timezoneOffset, ':');
@@ -12236,7 +11773,7 @@ function formatTimezone(offset, dirtyDelimiter) {
12236
11773
  return sign + hours + delimiter + minutes;
12237
11774
  }
12238
11775
 
12239
- function dateLongFormatter(pattern, formatLong) {
11776
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
12240
11777
  switch (pattern) {
12241
11778
  case 'P':
12242
11779
  return formatLong.date({
@@ -12256,8 +11793,8 @@ function dateLongFormatter(pattern, formatLong) {
12256
11793
  width: 'full'
12257
11794
  });
12258
11795
  }
12259
- }
12260
- function timeLongFormatter(pattern, formatLong) {
11796
+ };
11797
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
12261
11798
  switch (pattern) {
12262
11799
  case 'p':
12263
11800
  return formatLong.time({
@@ -12277,9 +11814,9 @@ function timeLongFormatter(pattern, formatLong) {
12277
11814
  width: 'full'
12278
11815
  });
12279
11816
  }
12280
- }
12281
- function dateTimeLongFormatter(pattern, formatLong) {
12282
- var matchResult = pattern.match(/(P+)(p+)?/);
11817
+ };
11818
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
11819
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
12283
11820
  var datePattern = matchResult[1];
12284
11821
  var timePattern = matchResult[2];
12285
11822
  if (!timePattern) {
@@ -12310,16 +11847,12 @@ function dateTimeLongFormatter(pattern, formatLong) {
12310
11847
  break;
12311
11848
  }
12312
11849
  return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
12313
- }
11850
+ };
12314
11851
  var longFormatters = {
12315
11852
  p: timeLongFormatter,
12316
11853
  P: dateTimeLongFormatter
12317
11854
  };
12318
11855
 
12319
- var MILLISECONDS_IN_MINUTE = 60000;
12320
- function getDateMillisecondsPart(date) {
12321
- return date.getTime() % MILLISECONDS_IN_MINUTE;
12322
- }
12323
11856
  /**
12324
11857
  * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
12325
11858
  * They usually appear for dates that denote time before the timezones were introduced
@@ -12331,14 +11864,10 @@ function getDateMillisecondsPart(date) {
12331
11864
  *
12332
11865
  * This function returns the timezone offset in milliseconds that takes seconds in account.
12333
11866
  */
12334
-
12335
- function getTimezoneOffsetInMilliseconds(dirtyDate) {
12336
- var date = new Date(dirtyDate.getTime());
12337
- var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());
12338
- date.setSeconds(0, 0);
12339
- var hasNegativeUTCOffset = baseTimezoneOffset > 0;
12340
- var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);
12341
- return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;
11867
+ function getTimezoneOffsetInMilliseconds(date) {
11868
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
11869
+ utcDate.setUTCFullYear(date.getFullYear());
11870
+ return date.getTime() - utcDate.getTime();
12342
11871
  }
12343
11872
 
12344
11873
  var protectedDayOfYearTokens = ['D', 'DD'];
@@ -12351,16 +11880,494 @@ function isProtectedWeekYearToken(token) {
12351
11880
  }
12352
11881
  function throwProtectedError(token, format, input) {
12353
11882
  if (token === 'YYYY') {
12354
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11883
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
12355
11884
  } else if (token === 'YY') {
12356
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11885
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
12357
11886
  } else if (token === 'D') {
12358
- throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11887
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
12359
11888
  } else if (token === 'DD') {
12360
- throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11889
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
11890
+ }
11891
+ }
11892
+
11893
+ var formatDistanceLocale = {
11894
+ lessThanXSeconds: {
11895
+ one: 'less than a second',
11896
+ other: 'less than {{count}} seconds'
11897
+ },
11898
+ xSeconds: {
11899
+ one: '1 second',
11900
+ other: '{{count}} seconds'
11901
+ },
11902
+ halfAMinute: 'half a minute',
11903
+ lessThanXMinutes: {
11904
+ one: 'less than a minute',
11905
+ other: 'less than {{count}} minutes'
11906
+ },
11907
+ xMinutes: {
11908
+ one: '1 minute',
11909
+ other: '{{count}} minutes'
11910
+ },
11911
+ aboutXHours: {
11912
+ one: 'about 1 hour',
11913
+ other: 'about {{count}} hours'
11914
+ },
11915
+ xHours: {
11916
+ one: '1 hour',
11917
+ other: '{{count}} hours'
11918
+ },
11919
+ xDays: {
11920
+ one: '1 day',
11921
+ other: '{{count}} days'
11922
+ },
11923
+ aboutXWeeks: {
11924
+ one: 'about 1 week',
11925
+ other: 'about {{count}} weeks'
11926
+ },
11927
+ xWeeks: {
11928
+ one: '1 week',
11929
+ other: '{{count}} weeks'
11930
+ },
11931
+ aboutXMonths: {
11932
+ one: 'about 1 month',
11933
+ other: 'about {{count}} months'
11934
+ },
11935
+ xMonths: {
11936
+ one: '1 month',
11937
+ other: '{{count}} months'
11938
+ },
11939
+ aboutXYears: {
11940
+ one: 'about 1 year',
11941
+ other: 'about {{count}} years'
11942
+ },
11943
+ xYears: {
11944
+ one: '1 year',
11945
+ other: '{{count}} years'
11946
+ },
11947
+ overXYears: {
11948
+ one: 'over 1 year',
11949
+ other: 'over {{count}} years'
11950
+ },
11951
+ almostXYears: {
11952
+ one: 'almost 1 year',
11953
+ other: 'almost {{count}} years'
11954
+ }
11955
+ };
11956
+ var formatDistance = function formatDistance(token, count, options) {
11957
+ var result;
11958
+ var tokenValue = formatDistanceLocale[token];
11959
+ if (typeof tokenValue === 'string') {
11960
+ result = tokenValue;
11961
+ } else if (count === 1) {
11962
+ result = tokenValue.one;
11963
+ } else {
11964
+ result = tokenValue.other.replace('{{count}}', count.toString());
11965
+ }
11966
+ if (options !== null && options !== void 0 && options.addSuffix) {
11967
+ if (options.comparison && options.comparison > 0) {
11968
+ return 'in ' + result;
11969
+ } else {
11970
+ return result + ' ago';
11971
+ }
11972
+ }
11973
+ return result;
11974
+ };
11975
+
11976
+ function buildFormatLongFn(args) {
11977
+ return function () {
11978
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11979
+ // TODO: Remove String()
11980
+ var width = options.width ? String(options.width) : args.defaultWidth;
11981
+ var format = args.formats[width] || args.formats[args.defaultWidth];
11982
+ return format;
11983
+ };
11984
+ }
11985
+
11986
+ var dateFormats = {
11987
+ full: 'EEEE, MMMM do, y',
11988
+ "long": 'MMMM do, y',
11989
+ medium: 'MMM d, y',
11990
+ "short": 'MM/dd/yyyy'
11991
+ };
11992
+ var timeFormats = {
11993
+ full: 'h:mm:ss a zzzz',
11994
+ "long": 'h:mm:ss a z',
11995
+ medium: 'h:mm:ss a',
11996
+ "short": 'h:mm a'
11997
+ };
11998
+ var dateTimeFormats = {
11999
+ full: "{{date}} 'at' {{time}}",
12000
+ "long": "{{date}} 'at' {{time}}",
12001
+ medium: '{{date}}, {{time}}',
12002
+ "short": '{{date}}, {{time}}'
12003
+ };
12004
+ var formatLong = {
12005
+ date: buildFormatLongFn({
12006
+ formats: dateFormats,
12007
+ defaultWidth: 'full'
12008
+ }),
12009
+ time: buildFormatLongFn({
12010
+ formats: timeFormats,
12011
+ defaultWidth: 'full'
12012
+ }),
12013
+ dateTime: buildFormatLongFn({
12014
+ formats: dateTimeFormats,
12015
+ defaultWidth: 'full'
12016
+ })
12017
+ };
12018
+
12019
+ var formatRelativeLocale = {
12020
+ lastWeek: "'last' eeee 'at' p",
12021
+ yesterday: "'yesterday at' p",
12022
+ today: "'today at' p",
12023
+ tomorrow: "'tomorrow at' p",
12024
+ nextWeek: "eeee 'at' p",
12025
+ other: 'P'
12026
+ };
12027
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
12028
+ return formatRelativeLocale[token];
12029
+ };
12030
+
12031
+ function buildLocalizeFn(args) {
12032
+ return function (dirtyIndex, options) {
12033
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
12034
+ var valuesArray;
12035
+ if (context === 'formatting' && args.formattingValues) {
12036
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
12037
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
12038
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
12039
+ } else {
12040
+ var _defaultWidth = args.defaultWidth;
12041
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
12042
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
12043
+ }
12044
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
12045
+ // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
12046
+ return valuesArray[index];
12047
+ };
12048
+ }
12049
+
12050
+ var eraValues = {
12051
+ narrow: ['B', 'A'],
12052
+ abbreviated: ['BC', 'AD'],
12053
+ wide: ['Before Christ', 'Anno Domini']
12054
+ };
12055
+ var quarterValues = {
12056
+ narrow: ['1', '2', '3', '4'],
12057
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
12058
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
12059
+ };
12060
+
12061
+ // Note: in English, the names of days of the week and months are capitalized.
12062
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
12063
+ // Generally, formatted dates should look like they are in the middle of a sentence,
12064
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
12065
+ var monthValues = {
12066
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
12067
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
12068
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
12069
+ };
12070
+ var dayValues = {
12071
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
12072
+ "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
12073
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
12074
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
12075
+ };
12076
+ var dayPeriodValues = {
12077
+ narrow: {
12078
+ am: 'a',
12079
+ pm: 'p',
12080
+ midnight: 'mi',
12081
+ noon: 'n',
12082
+ morning: 'morning',
12083
+ afternoon: 'afternoon',
12084
+ evening: 'evening',
12085
+ night: 'night'
12086
+ },
12087
+ abbreviated: {
12088
+ am: 'AM',
12089
+ pm: 'PM',
12090
+ midnight: 'midnight',
12091
+ noon: 'noon',
12092
+ morning: 'morning',
12093
+ afternoon: 'afternoon',
12094
+ evening: 'evening',
12095
+ night: 'night'
12096
+ },
12097
+ wide: {
12098
+ am: 'a.m.',
12099
+ pm: 'p.m.',
12100
+ midnight: 'midnight',
12101
+ noon: 'noon',
12102
+ morning: 'morning',
12103
+ afternoon: 'afternoon',
12104
+ evening: 'evening',
12105
+ night: 'night'
12106
+ }
12107
+ };
12108
+ var formattingDayPeriodValues = {
12109
+ narrow: {
12110
+ am: 'a',
12111
+ pm: 'p',
12112
+ midnight: 'mi',
12113
+ noon: 'n',
12114
+ morning: 'in the morning',
12115
+ afternoon: 'in the afternoon',
12116
+ evening: 'in the evening',
12117
+ night: 'at night'
12118
+ },
12119
+ abbreviated: {
12120
+ am: 'AM',
12121
+ pm: 'PM',
12122
+ midnight: 'midnight',
12123
+ noon: 'noon',
12124
+ morning: 'in the morning',
12125
+ afternoon: 'in the afternoon',
12126
+ evening: 'in the evening',
12127
+ night: 'at night'
12128
+ },
12129
+ wide: {
12130
+ am: 'a.m.',
12131
+ pm: 'p.m.',
12132
+ midnight: 'midnight',
12133
+ noon: 'noon',
12134
+ morning: 'in the morning',
12135
+ afternoon: 'in the afternoon',
12136
+ evening: 'in the evening',
12137
+ night: 'at night'
12138
+ }
12139
+ };
12140
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
12141
+ var number = Number(dirtyNumber);
12142
+
12143
+ // If ordinal numbers depend on context, for example,
12144
+ // if they are different for different grammatical genders,
12145
+ // use `options.unit`.
12146
+ //
12147
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
12148
+ // 'day', 'hour', 'minute', 'second'.
12149
+
12150
+ var rem100 = number % 100;
12151
+ if (rem100 > 20 || rem100 < 10) {
12152
+ switch (rem100 % 10) {
12153
+ case 1:
12154
+ return number + 'st';
12155
+ case 2:
12156
+ return number + 'nd';
12157
+ case 3:
12158
+ return number + 'rd';
12159
+ }
12160
+ }
12161
+ return number + 'th';
12162
+ };
12163
+ var localize = {
12164
+ ordinalNumber: ordinalNumber,
12165
+ era: buildLocalizeFn({
12166
+ values: eraValues,
12167
+ defaultWidth: 'wide'
12168
+ }),
12169
+ quarter: buildLocalizeFn({
12170
+ values: quarterValues,
12171
+ defaultWidth: 'wide',
12172
+ argumentCallback: function argumentCallback(quarter) {
12173
+ return quarter - 1;
12174
+ }
12175
+ }),
12176
+ month: buildLocalizeFn({
12177
+ values: monthValues,
12178
+ defaultWidth: 'wide'
12179
+ }),
12180
+ day: buildLocalizeFn({
12181
+ values: dayValues,
12182
+ defaultWidth: 'wide'
12183
+ }),
12184
+ dayPeriod: buildLocalizeFn({
12185
+ values: dayPeriodValues,
12186
+ defaultWidth: 'wide',
12187
+ formattingValues: formattingDayPeriodValues,
12188
+ defaultFormattingWidth: 'wide'
12189
+ })
12190
+ };
12191
+
12192
+ function buildMatchFn(args) {
12193
+ return function (string) {
12194
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12195
+ var width = options.width;
12196
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
12197
+ var matchResult = string.match(matchPattern);
12198
+ if (!matchResult) {
12199
+ return null;
12200
+ }
12201
+ var matchedString = matchResult[0];
12202
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
12203
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
12204
+ return pattern.test(matchedString);
12205
+ }) : findKey(parsePatterns, function (pattern) {
12206
+ return pattern.test(matchedString);
12207
+ });
12208
+ var value;
12209
+ value = args.valueCallback ? args.valueCallback(key) : key;
12210
+ value = options.valueCallback ? options.valueCallback(value) : value;
12211
+ var rest = string.slice(matchedString.length);
12212
+ return {
12213
+ value: value,
12214
+ rest: rest
12215
+ };
12216
+ };
12217
+ }
12218
+ function findKey(object, predicate) {
12219
+ for (var key in object) {
12220
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
12221
+ return key;
12222
+ }
12361
12223
  }
12224
+ return undefined;
12225
+ }
12226
+ function findIndex(array, predicate) {
12227
+ for (var key = 0; key < array.length; key++) {
12228
+ if (predicate(array[key])) {
12229
+ return key;
12230
+ }
12231
+ }
12232
+ return undefined;
12233
+ }
12234
+
12235
+ function buildMatchPatternFn(args) {
12236
+ return function (string) {
12237
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12238
+ var matchResult = string.match(args.matchPattern);
12239
+ if (!matchResult) return null;
12240
+ var matchedString = matchResult[0];
12241
+ var parseResult = string.match(args.parsePattern);
12242
+ if (!parseResult) return null;
12243
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
12244
+ value = options.valueCallback ? options.valueCallback(value) : value;
12245
+ var rest = string.slice(matchedString.length);
12246
+ return {
12247
+ value: value,
12248
+ rest: rest
12249
+ };
12250
+ };
12362
12251
  }
12363
12252
 
12253
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
12254
+ var parseOrdinalNumberPattern = /\d+/i;
12255
+ var matchEraPatterns = {
12256
+ narrow: /^(b|a)/i,
12257
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
12258
+ wide: /^(before christ|before common era|anno domini|common era)/i
12259
+ };
12260
+ var parseEraPatterns = {
12261
+ any: [/^b/i, /^(a|c)/i]
12262
+ };
12263
+ var matchQuarterPatterns = {
12264
+ narrow: /^[1234]/i,
12265
+ abbreviated: /^q[1234]/i,
12266
+ wide: /^[1234](th|st|nd|rd)? quarter/i
12267
+ };
12268
+ var parseQuarterPatterns = {
12269
+ any: [/1/i, /2/i, /3/i, /4/i]
12270
+ };
12271
+ var matchMonthPatterns = {
12272
+ narrow: /^[jfmasond]/i,
12273
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
12274
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
12275
+ };
12276
+ var parseMonthPatterns = {
12277
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
12278
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
12279
+ };
12280
+ var matchDayPatterns = {
12281
+ narrow: /^[smtwf]/i,
12282
+ "short": /^(su|mo|tu|we|th|fr|sa)/i,
12283
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
12284
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
12285
+ };
12286
+ var parseDayPatterns = {
12287
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
12288
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
12289
+ };
12290
+ var matchDayPeriodPatterns = {
12291
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
12292
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
12293
+ };
12294
+ var parseDayPeriodPatterns = {
12295
+ any: {
12296
+ am: /^a/i,
12297
+ pm: /^p/i,
12298
+ midnight: /^mi/i,
12299
+ noon: /^no/i,
12300
+ morning: /morning/i,
12301
+ afternoon: /afternoon/i,
12302
+ evening: /evening/i,
12303
+ night: /night/i
12304
+ }
12305
+ };
12306
+ var match = {
12307
+ ordinalNumber: buildMatchPatternFn({
12308
+ matchPattern: matchOrdinalNumberPattern,
12309
+ parsePattern: parseOrdinalNumberPattern,
12310
+ valueCallback: function valueCallback(value) {
12311
+ return parseInt(value, 10);
12312
+ }
12313
+ }),
12314
+ era: buildMatchFn({
12315
+ matchPatterns: matchEraPatterns,
12316
+ defaultMatchWidth: 'wide',
12317
+ parsePatterns: parseEraPatterns,
12318
+ defaultParseWidth: 'any'
12319
+ }),
12320
+ quarter: buildMatchFn({
12321
+ matchPatterns: matchQuarterPatterns,
12322
+ defaultMatchWidth: 'wide',
12323
+ parsePatterns: parseQuarterPatterns,
12324
+ defaultParseWidth: 'any',
12325
+ valueCallback: function valueCallback(index) {
12326
+ return index + 1;
12327
+ }
12328
+ }),
12329
+ month: buildMatchFn({
12330
+ matchPatterns: matchMonthPatterns,
12331
+ defaultMatchWidth: 'wide',
12332
+ parsePatterns: parseMonthPatterns,
12333
+ defaultParseWidth: 'any'
12334
+ }),
12335
+ day: buildMatchFn({
12336
+ matchPatterns: matchDayPatterns,
12337
+ defaultMatchWidth: 'wide',
12338
+ parsePatterns: parseDayPatterns,
12339
+ defaultParseWidth: 'any'
12340
+ }),
12341
+ dayPeriod: buildMatchFn({
12342
+ matchPatterns: matchDayPeriodPatterns,
12343
+ defaultMatchWidth: 'any',
12344
+ parsePatterns: parseDayPeriodPatterns,
12345
+ defaultParseWidth: 'any'
12346
+ })
12347
+ };
12348
+
12349
+ /**
12350
+ * @type {Locale}
12351
+ * @category Locales
12352
+ * @summary English locale (United States).
12353
+ * @language English
12354
+ * @iso-639-2 eng
12355
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
12356
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
12357
+ */
12358
+ var locale = {
12359
+ code: 'en-US',
12360
+ formatDistance: formatDistance,
12361
+ formatLong: formatLong,
12362
+ formatRelative: formatRelative,
12363
+ localize: localize,
12364
+ match: match,
12365
+ options: {
12366
+ weekStartsOn: 0 /* Sunday */,
12367
+ firstWeekContainsDate: 1
12368
+ }
12369
+ };
12370
+
12364
12371
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
12365
12372
  // (one of the certain letters followed by `o`)
12366
12373
  // - (\w)\1* matches any sequences of the same letter
@@ -12371,14 +12378,15 @@ function throwProtectedError(token, format, input) {
12371
12378
  // If there is no matching single quote
12372
12379
  // then the sequence will continue until the end of the string.
12373
12380
  // - . matches any single character unmatched by previous parts of the RegExps
12381
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
12374
12382
 
12375
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
12383
+ // This RegExp catches symbols escaped by quotes, and also
12376
12384
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
12377
-
12378
12385
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
12379
12386
  var escapedStringRegExp = /^'([^]*?)'?$/;
12380
12387
  var doubleQuoteRegExp = /''/g;
12381
12388
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
12389
+
12382
12390
  /**
12383
12391
  * @name format
12384
12392
  * @category Common Helpers
@@ -12388,7 +12396,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
12388
12396
  * Return the formatted date string in the given format. The result may vary by locale.
12389
12397
  *
12390
12398
  * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
12391
- * > See: https://git.io/fxCyr
12399
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12392
12400
  *
12393
12401
  * The characters wrapped between two single quotes characters (') are escaped.
12394
12402
  * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
@@ -12467,32 +12475,34 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
12467
12475
  * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
12468
12476
  * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
12469
12477
  * | | EEEEE | M, T, W, T, F, S, S | |
12470
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
12478
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
12471
12479
  * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
12472
12480
  * | | io | 1st, 2nd, ..., 7th | 7 |
12473
12481
  * | | ii | 01, 02, ..., 07 | 7 |
12474
12482
  * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
12475
12483
  * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
12476
12484
  * | | iiiii | M, T, W, T, F, S, S | 7 |
12477
- * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
12485
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
12478
12486
  * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
12479
12487
  * | | eo | 2nd, 3rd, ..., 1st | 7 |
12480
12488
  * | | ee | 02, 03, ..., 01 | |
12481
12489
  * | | eee | Mon, Tue, Wed, ..., Sun | |
12482
12490
  * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
12483
12491
  * | | eeeee | M, T, W, T, F, S, S | |
12484
- * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
12492
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
12485
12493
  * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
12486
12494
  * | | co | 2nd, 3rd, ..., 1st | 7 |
12487
12495
  * | | cc | 02, 03, ..., 01 | |
12488
12496
  * | | ccc | Mon, Tue, Wed, ..., Sun | |
12489
12497
  * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
12490
12498
  * | | ccccc | M, T, W, T, F, S, S | |
12491
- * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
12492
- * | AM, PM | a..aaa | AM, PM | |
12499
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
12500
+ * | AM, PM | a..aa | AM, PM | |
12501
+ * | | aaa | am, pm | |
12493
12502
  * | | aaaa | a.m., p.m. | 2 |
12494
12503
  * | | aaaaa | a, p | |
12495
- * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |
12504
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
12505
+ * | | bbb | am, pm, noon, midnight | |
12496
12506
  * | | bbbb | a.m., p.m., noon, midnight | 2 |
12497
12507
  * | | bbbbb | a, p, n, mi | |
12498
12508
  * | Flexible day period | B..BBB | at night, in the morning, ... | |
@@ -12518,7 +12528,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
12518
12528
  * | | ss | 00, 01, ..., 59 | |
12519
12529
  * | Fraction of second | S | 0, 1, ..., 9 | |
12520
12530
  * | | SS | 00, 01, ..., 99 | |
12521
- * | | SSS | 000, 0001, ..., 999 | |
12531
+ * | | SSS | 000, 001, ..., 999 | |
12522
12532
  * | | SSSS | ... | 3 |
12523
12533
  * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
12524
12534
  * | | XX | -0800, +0530, Z | |
@@ -12538,18 +12548,18 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
12538
12548
  * | | tt | ... | 3,7 |
12539
12549
  * | Milliseconds timestamp | T | 512969520900 | 7 |
12540
12550
  * | | TT | ... | 3,7 |
12541
- * | Long localized date | P | 05/29/1453 | 7 |
12542
- * | | PP | May 29, 1453 | 7 |
12543
- * | | PPP | May 29th, 1453 | 7 |
12544
- * | | PPPP | Sunday, May 29th, 1453 | 2,7 |
12551
+ * | Long localized date | P | 04/29/1453 | 7 |
12552
+ * | | PP | Apr 29, 1453 | 7 |
12553
+ * | | PPP | April 29th, 1453 | 7 |
12554
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
12545
12555
  * | Long localized time | p | 12:00 AM | 7 |
12546
12556
  * | | pp | 12:00:00 AM | 7 |
12547
12557
  * | | ppp | 12:00:00 AM GMT+2 | 7 |
12548
12558
  * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
12549
- * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |
12550
- * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |
12551
- * | | PPPppp | May 29th, 1453 at ... | 7 |
12552
- * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |
12559
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
12560
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
12561
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
12562
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
12553
12563
  * Notes:
12554
12564
  * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
12555
12565
  * are the same as "stand-alone" units, but are different in some languages.
@@ -12622,30 +12632,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
12622
12632
  * - `p`: long localized time
12623
12633
  *
12624
12634
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
12625
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
12626
- *
12627
- * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
12628
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
12629
- *
12630
- * ### v2.0.0 breaking changes:
12631
- *
12632
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
12635
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12633
12636
  *
12634
- * - The second argument is now required for the sake of explicitness.
12635
- *
12636
- * ```javascript
12637
- * // Before v2.0.0
12638
- * format(new Date(2016, 0, 1))
12639
- *
12640
- * // v2.0.0 onward
12641
- * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
12642
- * ```
12643
- *
12644
- * - New format string API for `format` function
12645
- * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
12646
- * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
12647
- *
12648
- * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
12637
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
12638
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12649
12639
  *
12650
12640
  * @param {Date|Number} date - the original date
12651
12641
  * @param {String} format - the string of tokens
@@ -12654,9 +12644,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
12654
12644
  * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
12655
12645
  * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
12656
12646
  * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
12657
- * see: https://git.io/fxCyr
12647
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12658
12648
  * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
12659
- * see: https://git.io/fxCyr
12649
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12660
12650
  * @returns {String} the formatted date string
12661
12651
  * @throws {TypeError} 2 arguments required
12662
12652
  * @throws {RangeError} `date` must not be Invalid Date
@@ -12664,47 +12654,46 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
12664
12654
  * @throws {RangeError} `options.locale` must contain `formatLong` property
12665
12655
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
12666
12656
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
12667
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
12668
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
12669
- * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
12670
- * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
12657
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12658
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12659
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12660
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
12671
12661
  * @throws {RangeError} format string contains an unescaped latin alphabet character
12672
12662
  *
12673
12663
  * @example
12674
12664
  * // Represent 11 February 2014 in middle-endian format:
12675
- * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
12665
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
12676
12666
  * //=> '02/11/2014'
12677
12667
  *
12678
12668
  * @example
12679
12669
  * // Represent 2 July 2014 in Esperanto:
12680
12670
  * import { eoLocale } from 'date-fns/locale/eo'
12681
- * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
12671
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
12682
12672
  * locale: eoLocale
12683
12673
  * })
12684
12674
  * //=> '2-a de julio 2014'
12685
12675
  *
12686
12676
  * @example
12687
12677
  * // Escape string by single quote characters:
12688
- * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
12678
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
12689
12679
  * //=> "3 o'clock"
12690
12680
  */
12691
12681
 
12692
- function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
12682
+ function format(dirtyDate, dirtyFormatStr, options) {
12683
+ var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
12693
12684
  requiredArgs(2, arguments);
12694
12685
  var formatStr = String(dirtyFormatStr);
12695
- var options = dirtyOptions || {};
12696
- var locale$1 = options.locale || locale;
12697
- var localeFirstWeekContainsDate = locale$1.options && locale$1.options.firstWeekContainsDate;
12698
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
12699
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
12686
+ var defaultOptions = getDefaultOptions();
12687
+ var locale$1 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : locale;
12688
+ var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
12700
12689
 
12690
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
12701
12691
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
12702
12692
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
12703
12693
  }
12704
- var localeWeekStartsOn = locale$1.options && locale$1.options.weekStartsOn;
12705
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
12706
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
12694
+ var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
12707
12695
 
12696
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
12708
12697
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
12709
12698
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
12710
12699
  }
@@ -12717,10 +12706,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
12717
12706
  var originalDate = toDate(dirtyDate);
12718
12707
  if (!isValid(originalDate)) {
12719
12708
  throw new RangeError('Invalid time value');
12720
- } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
12709
+ }
12710
+
12711
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
12721
12712
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
12722
12713
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
12723
-
12724
12714
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
12725
12715
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
12726
12716
  var formatterOptions = {
@@ -12733,7 +12723,7 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
12733
12723
  var firstCharacter = substring[0];
12734
12724
  if (firstCharacter === 'p' || firstCharacter === 'P') {
12735
12725
  var longFormatter = longFormatters[firstCharacter];
12736
- return longFormatter(substring, locale$1.formatLong, formatterOptions);
12726
+ return longFormatter(substring, locale$1.formatLong);
12737
12727
  }
12738
12728
  return substring;
12739
12729
  }).join('').match(formattingTokensRegExp).map(function (substring) {
@@ -12747,11 +12737,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
12747
12737
  }
12748
12738
  var formatter = formatters[firstCharacter];
12749
12739
  if (formatter) {
12750
- if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
12751
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
12740
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
12741
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
12752
12742
  }
12753
- if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
12754
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
12743
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
12744
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
12755
12745
  }
12756
12746
  return formatter(utcDate, substring, locale$1.localize, formatterOptions);
12757
12747
  }
@@ -12763,22 +12753,28 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
12763
12753
  return result;
12764
12754
  }
12765
12755
  function cleanEscapedString(input) {
12766
- return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
12756
+ var matched = input.match(escapedStringRegExp);
12757
+ if (!matched) {
12758
+ return input;
12759
+ }
12760
+ return matched[1].replace(doubleQuoteRegExp, "'");
12767
12761
  }
12768
12762
 
12769
- function convertToFP(fn, arity, a) {
12770
- a = a || [];
12763
+ function convertToFP(fn, arity) {
12764
+ var a = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
12771
12765
  if (a.length >= arity) {
12772
12766
  return fn.apply(null, a.slice(0, arity).reverse());
12773
12767
  }
12774
12768
  return function () {
12775
- var args = Array.prototype.slice.call(arguments);
12769
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
12770
+ args[_key] = arguments[_key];
12771
+ }
12776
12772
  return convertToFP(fn, arity, a.concat(args));
12777
12773
  };
12778
12774
  }
12779
12775
 
12780
- // This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
12781
- var format = convertToFP(format$1, 2);
12776
+ // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
12777
+ var formatTime = convertToFP(format, 2);
12782
12778
 
12783
12779
  var Wrapper = index$a(View)(function () {
12784
12780
  return {
@@ -13049,7 +13045,7 @@ var Calendar = function Calendar(_ref) {
13049
13045
  return /*#__PURE__*/React__default.createElement(StyledContainer$7, {
13050
13046
  testID: testID
13051
13047
  }, /*#__PURE__*/React__default.createElement(StyledCalendarHeader, null, /*#__PURE__*/React__default.createElement(ContentNavigator, {
13052
- value: !useMonthPicker ? format('MMMM yyyy', visibleDate) : /*#__PURE__*/React__default.createElement(TouchableOpacity, {
13048
+ value: !useMonthPicker ? formatTime('MMMM yyyy', visibleDate) : /*#__PURE__*/React__default.createElement(TouchableOpacity, {
13053
13049
  testID: "calendar-month-picker",
13054
13050
  onPress: function onPress() {
13055
13051
  onToggleMonthPicker === null || onToggleMonthPicker === void 0 || onToggleMonthPicker(!monthPickerVisible);
@@ -13065,7 +13061,7 @@ var Calendar = function Calendar(_ref) {
13065
13061
  textAlign: 'center',
13066
13062
  marginRight: theme.__hd__.calendar.space.headerMarginRight
13067
13063
  }
13068
- }, format('MMMM yyyy', visibleDate)), /*#__PURE__*/React__default.createElement(Icon, {
13064
+ }, formatTime('MMMM yyyy', visibleDate)), /*#__PURE__*/React__default.createElement(Icon, {
13069
13065
  icon: monthPickerVisible ? 'arrow-up' : 'arrow-down',
13070
13066
  size: "small"
13071
13067
  }))),
@@ -13578,7 +13574,7 @@ var StyledPageControlWrapper = index$a(View)(function (_ref7) {
13578
13574
  });
13579
13575
 
13580
13576
  function isCarouselImageProps(image) {
13581
- return _typeof(image) === 'object';
13577
+ return _typeof$1(image) === 'object';
13582
13578
  }
13583
13579
  var CarouselItem = function CarouselItem(_ref) {
13584
13580
  var width = _ref.width,
@@ -14513,7 +14509,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
14513
14509
  _useState2 = _slicedToArray(_useState, 2),
14514
14510
  open = _useState2[0],
14515
14511
  setOpen = _useState2[1];
14516
- var displayValue = value ? format(displayFormat, value) : '';
14512
+ var displayValue = value ? formatTime(displayFormat, value) : '';
14517
14513
  var pickerInitValue = value || new Date();
14518
14514
  useCalculateDate({
14519
14515
  minDate: minDate,
@@ -14644,7 +14640,7 @@ var DatePickerCalendar = function DatePickerCalendar(_ref2) {
14644
14640
  _useState10 = _slicedToArray(_useState9, 2),
14645
14641
  selectingDate = _useState10[0],
14646
14642
  setSelectingDate = _useState10[1];
14647
- var displayValue = value ? format(displayFormat, value) : '';
14643
+ var displayValue = value ? formatTime(displayFormat, value) : '';
14648
14644
  useCalculateDate({
14649
14645
  minDate: minDate,
14650
14646
  maxDate: maxDate,
@@ -14737,7 +14733,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
14737
14733
  _useState4 = _slicedToArray(_useState3, 2),
14738
14734
  open = _useState4[0],
14739
14735
  setOpen = _useState4[1];
14740
- var displayValue = value ? format(displayFormat, value) : '';
14736
+ var displayValue = value ? formatTime(displayFormat, value) : '';
14741
14737
  var theme = useTheme();
14742
14738
  useCalculateDate({
14743
14739
  minDate: minDate,
@@ -19909,7 +19905,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
19909
19905
  open = _useState2[0],
19910
19906
  setOpen = _useState2[1];
19911
19907
  var is12Hour = displayFormat.includes('hh');
19912
- var displayValue = value ? format(displayFormat, value) : '';
19908
+ var displayValue = value ? formatTime(displayFormat, value) : '';
19913
19909
  var pickerInitValue = value || new Date();
19914
19910
  return /*#__PURE__*/React__default.createElement(TouchableOpacity, {
19915
19911
  onPress: function onPress() {
@@ -19980,7 +19976,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
19980
19976
  open = _useState4[0],
19981
19977
  setOpen = _useState4[1];
19982
19978
  var is12Hour = displayFormat.includes('hh');
19983
- var displayValue = value ? format(displayFormat, value) : '';
19979
+ var displayValue = value ? formatTime(displayFormat, value) : '';
19984
19980
  var theme = useTheme();
19985
19981
  useEffect(function () {
19986
19982
  setSelectingDate(value || new Date());
@@ -20719,7 +20715,7 @@ function requireScheduler_production_min() {
20719
20715
  var c = a.sortIndex - b.sortIndex;
20720
20716
  return 0 !== c ? c : a.id - b.id;
20721
20717
  }
20722
- if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof(performance)) && "function" === typeof performance.now) {
20718
+ if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof$1(performance)) && "function" === typeof performance.now) {
20723
20719
  var l = performance;
20724
20720
  exports.unstable_now = function () {
20725
20721
  return l.now();
@@ -20890,7 +20886,7 @@ function requireScheduler_production_min() {
20890
20886
  };
20891
20887
  exports.unstable_scheduleCallback = function (a, b, c) {
20892
20888
  var d = exports.unstable_now();
20893
- "object" === _typeof(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
20889
+ "object" === _typeof$1(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
20894
20890
  switch (a) {
20895
20891
  case 1:
20896
20892
  var e = -1;
@@ -20980,7 +20976,7 @@ function requireReactDom_production_min() {
20980
20976
  }
20981
20977
  function pa(a, b, c, d) {
20982
20978
  if (null !== c && 0 === c.type) return !1;
20983
- switch (_typeof(b)) {
20979
+ switch (_typeof$1(b)) {
20984
20980
  case "function":
20985
20981
  case "symbol":
20986
20982
  return !0;
@@ -21090,7 +21086,7 @@ function requireReactDom_production_min() {
21090
21086
  var Ia = Symbol["for"]("react.offscreen");
21091
21087
  var Ja = Symbol.iterator;
21092
21088
  function Ka(a) {
21093
- if (null === a || "object" !== _typeof(a)) return null;
21089
+ if (null === a || "object" !== _typeof$1(a)) return null;
21094
21090
  a = Ja && a[Ja] || a["@@iterator"];
21095
21091
  return "function" === typeof a ? a : null;
21096
21092
  }
@@ -21119,7 +21115,7 @@ function requireReactDom_production_min() {
21119
21115
  set: function set() {
21120
21116
  throw Error();
21121
21117
  }
21122
- }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && Reflect.construct) {
21118
+ }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof$1(Reflect)) && Reflect.construct) {
21123
21119
  try {
21124
21120
  Reflect.construct(b, []);
21125
21121
  } catch (l) {
@@ -21201,7 +21197,7 @@ function requireReactDom_production_min() {
21201
21197
  case Fa:
21202
21198
  return "SuspenseList";
21203
21199
  }
21204
- if ("object" === _typeof(a)) switch (a.$$typeof) {
21200
+ if ("object" === _typeof$1(a)) switch (a.$$typeof) {
21205
21201
  case Ca:
21206
21202
  return (a.displayName || "Context") + ".Consumer";
21207
21203
  case Ba:
@@ -21273,7 +21269,7 @@ function requireReactDom_production_min() {
21273
21269
  return null;
21274
21270
  }
21275
21271
  function Sa(a) {
21276
- switch (_typeof(a)) {
21272
+ switch (_typeof$1(a)) {
21277
21273
  case "boolean":
21278
21274
  case "number":
21279
21275
  case "string":
@@ -21584,9 +21580,9 @@ function requireReactDom_production_min() {
21584
21580
  if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a));
21585
21581
  if (null != b.dangerouslySetInnerHTML) {
21586
21582
  if (null != b.children) throw Error(p(60));
21587
- if ("object" !== _typeof(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
21583
+ if ("object" !== _typeof$1(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
21588
21584
  }
21589
- if (null != b.style && "object" !== _typeof(b.style)) throw Error(p(62));
21585
+ if (null != b.style && "object" !== _typeof$1(b.style)) throw Error(p(62));
21590
21586
  }
21591
21587
  }
21592
21588
  function vb(a, b) {
@@ -21672,7 +21668,7 @@ function requireReactDom_production_min() {
21672
21668
  a = !1;
21673
21669
  }
21674
21670
  if (a) return null;
21675
- if (c && "function" !== typeof c) throw Error(p(231, b, _typeof(c)));
21671
+ if (c && "function" !== typeof c) throw Error(p(231, b, _typeof$1(c)));
21676
21672
  return c;
21677
21673
  }
21678
21674
  var Lb = !1;
@@ -22586,7 +22582,7 @@ function requireReactDom_production_min() {
22586
22582
  }
22587
22583
  function he(a) {
22588
22584
  a = a.detail;
22589
- return "object" === _typeof(a) && "data" in a ? a.data : null;
22585
+ return "object" === _typeof$1(a) && "data" in a ? a.data : null;
22590
22586
  }
22591
22587
  var ie = !1;
22592
22588
  function je(a, b) {
@@ -22703,7 +22699,7 @@ function requireReactDom_production_min() {
22703
22699
  var He = "function" === typeof Object.is ? Object.is : Ge;
22704
22700
  function Ie(a, b) {
22705
22701
  if (He(a, b)) return !0;
22706
- if ("object" !== _typeof(a) || null === a || "object" !== _typeof(b) || null === b) return !1;
22702
+ if ("object" !== _typeof$1(a) || null === a || "object" !== _typeof$1(b) || null === b) return !1;
22707
22703
  var c = Object.keys(a),
22708
22704
  d = Object.keys(b);
22709
22705
  if (c.length !== d.length) return !1;
@@ -23230,7 +23226,7 @@ function requireReactDom_production_min() {
23230
23226
  var Cf = null,
23231
23227
  Df = null;
23232
23228
  function Ef(a, b) {
23233
- return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
23229
+ return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof$1(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
23234
23230
  }
23235
23231
  var Ff = "function" === typeof setTimeout ? setTimeout : void 0,
23236
23232
  Gf = "function" === typeof clearTimeout ? clearTimeout : void 0,
@@ -23878,7 +23874,7 @@ function requireReactDom_production_min() {
23878
23874
  var d = !1,
23879
23875
  e = Vf;
23880
23876
  var f = b.contextType;
23881
- "object" === _typeof(f) && null !== f ? f = Vg(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf);
23877
+ "object" === _typeof$1(f) && null !== f ? f = Vg(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf);
23882
23878
  b = new b(c, f);
23883
23879
  a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
23884
23880
  b.updater = nh;
@@ -23900,7 +23896,7 @@ function requireReactDom_production_min() {
23900
23896
  e.refs = jh;
23901
23897
  ah(a);
23902
23898
  var f = b.contextType;
23903
- "object" === _typeof(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
23899
+ "object" === _typeof$1(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
23904
23900
  e.state = a.memoizedState;
23905
23901
  f = b.getDerivedStateFromProps;
23906
23902
  "function" === typeof f && (kh(a, b, f, c), e.state = a.memoizedState);
@@ -23909,7 +23905,7 @@ function requireReactDom_production_min() {
23909
23905
  }
23910
23906
  function sh(a, b, c) {
23911
23907
  a = c.ref;
23912
- if (null !== a && "function" !== typeof a && "object" !== _typeof(a)) {
23908
+ if (null !== a && "function" !== typeof a && "object" !== _typeof$1(a)) {
23913
23909
  if (c._owner) {
23914
23910
  c = c._owner;
23915
23911
  if (c) {
@@ -23984,7 +23980,7 @@ function requireReactDom_production_min() {
23984
23980
  function k(a, b, c, d) {
23985
23981
  var f = c.type;
23986
23982
  if (f === ya) return m(a, b, c.props.children, d, c.key);
23987
- if (null !== b && (b.elementType === f || "object" === _typeof(f) && null !== f && f.$$typeof === Ha && uh(f) === b.type)) return d = e(b, c.props), d.ref = sh(a, b, c), d["return"] = a, d;
23983
+ if (null !== b && (b.elementType === f || "object" === _typeof$1(f) && null !== f && f.$$typeof === Ha && uh(f) === b.type)) return d = e(b, c.props), d.ref = sh(a, b, c), d["return"] = a, d;
23988
23984
  d = yh(c.type, c.key, c.props, null, a.mode, d);
23989
23985
  d.ref = sh(a, b, c);
23990
23986
  d["return"] = a;
@@ -24004,7 +24000,7 @@ function requireReactDom_production_min() {
24004
24000
  }
24005
24001
  function q(a, b, c) {
24006
24002
  if ("string" === typeof b && "" !== b || "number" === typeof b) return b = xh("" + b, a.mode, c), b["return"] = a, b;
24007
- if ("object" === _typeof(b) && null !== b) {
24003
+ if ("object" === _typeof$1(b) && null !== b) {
24008
24004
  switch (b.$$typeof) {
24009
24005
  case va:
24010
24006
  return c = yh(b.type, b.key, b.props, null, a.mode, c), c.ref = sh(a, null, b), c["return"] = a, c;
@@ -24022,7 +24018,7 @@ function requireReactDom_production_min() {
24022
24018
  function r(a, b, c, d) {
24023
24019
  var e = null !== b ? b.key : null;
24024
24020
  if ("string" === typeof c && "" !== c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);
24025
- if ("object" === _typeof(c) && null !== c) {
24021
+ if ("object" === _typeof$1(c) && null !== c) {
24026
24022
  switch (c.$$typeof) {
24027
24023
  case va:
24028
24024
  return c.key === e ? k(a, b, c, d) : null;
@@ -24038,7 +24034,7 @@ function requireReactDom_production_min() {
24038
24034
  }
24039
24035
  function y(a, b, c, d, e) {
24040
24036
  if ("string" === typeof d && "" !== d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);
24041
- if ("object" === _typeof(d) && null !== d) {
24037
+ if ("object" === _typeof$1(d) && null !== d) {
24042
24038
  switch (d.$$typeof) {
24043
24039
  case va:
24044
24040
  return a = a.get(null === d.key ? c : d.key) || null, k(b, a, d, e);
@@ -24112,8 +24108,8 @@ function requireReactDom_production_min() {
24112
24108
  return l;
24113
24109
  }
24114
24110
  function J(a, d, f, h) {
24115
- "object" === _typeof(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
24116
- if ("object" === _typeof(f) && null !== f) {
24111
+ "object" === _typeof$1(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
24112
+ if ("object" === _typeof$1(f) && null !== f) {
24117
24113
  switch (f.$$typeof) {
24118
24114
  case va:
24119
24115
  a: {
@@ -24128,7 +24124,7 @@ function requireReactDom_production_min() {
24128
24124
  a = d;
24129
24125
  break a;
24130
24126
  }
24131
- } else if (l.elementType === k || "object" === _typeof(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
24127
+ } else if (l.elementType === k || "object" === _typeof$1(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
24132
24128
  c(a, l.sibling);
24133
24129
  d = e(l, f.props);
24134
24130
  d.ref = sh(a, l, f);
@@ -25013,7 +25009,7 @@ function requireReactDom_production_min() {
25013
25009
  g.props = h;
25014
25010
  var k = g.context,
25015
25011
  l = c.contextType;
25016
- "object" === _typeof(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
25012
+ "object" === _typeof$1(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
25017
25013
  var m = c.getDerivedStateFromProps,
25018
25014
  q = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
25019
25015
  q || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && qh(b, g, d, l);
@@ -25032,7 +25028,7 @@ function requireReactDom_production_min() {
25032
25028
  q = b.pendingProps;
25033
25029
  r = g.context;
25034
25030
  k = c.contextType;
25035
- "object" === _typeof(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
25031
+ "object" === _typeof$1(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
25036
25032
  var y = c.getDerivedStateFromProps;
25037
25033
  (m = "function" === typeof y || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== q || r !== k) && qh(b, g, d, k);
25038
25034
  $g = !1;
@@ -26945,7 +26941,7 @@ function requireReactDom_production_min() {
26945
26941
  k = b;
26946
26942
  b = Z;
26947
26943
  h.flags |= 32768;
26948
- if (null !== k && "object" === _typeof(k) && "function" === typeof k.then) {
26944
+ if (null !== k && "object" === _typeof$1(k) && "function" === typeof k.then) {
26949
26945
  var l = k,
26950
26946
  m = h,
26951
26947
  q = m.tag;
@@ -27366,7 +27362,7 @@ function requireReactDom_production_min() {
27366
27362
  e = Xh(null, b, d, a, e, c);
27367
27363
  var f = bi();
27368
27364
  b.flags |= 1;
27369
- "object" === _typeof(e) && null !== e && "function" === typeof e.render && void 0 === e.$$typeof ? (b.tag = 1, b.memoizedState = null, b.updateQueue = null, Zf(d) ? (f = !0, cg(b)) : f = !1, b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null, ah(b), e.updater = nh, b.stateNode = e, e._reactInternals = b, rh(b, d, a, c), b = kj(null, b, d, !0, f, c)) : (b.tag = 0, I && f && vg(b), Yi(null, b, e, c), b = b.child);
27365
+ "object" === _typeof$1(e) && null !== e && "function" === typeof e.render && void 0 === e.$$typeof ? (b.tag = 1, b.memoizedState = null, b.updateQueue = null, Zf(d) ? (f = !0, cg(b)) : f = !1, b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null, ah(b), e.updater = nh, b.stateNode = e, e._reactInternals = b, rh(b, d, a, c), b = kj(null, b, d, !0, f, c)) : (b.tag = 0, I && f && vg(b), Yi(null, b, e, c), b = b.child);
27370
27366
  return b;
27371
27367
  case 16:
27372
27368
  d = b.elementType;
@@ -27607,7 +27603,7 @@ function requireReactDom_production_min() {
27607
27603
  case Ia:
27608
27604
  return qj(c, e, f, b);
27609
27605
  default:
27610
- if ("object" === _typeof(a) && null !== a) switch (a.$$typeof) {
27606
+ if ("object" === _typeof$1(a) && null !== a) switch (a.$$typeof) {
27611
27607
  case Ba:
27612
27608
  g = 10;
27613
27609
  break a;
@@ -27625,7 +27621,7 @@ function requireReactDom_production_min() {
27625
27621
  d = null;
27626
27622
  break a;
27627
27623
  }
27628
- throw Error(p(130, null == a ? a : _typeof(a), ""));
27624
+ throw Error(p(130, null == a ? a : _typeof$1(a), ""));
27629
27625
  }
27630
27626
  b = Bg(g, c, b, e);
27631
27627
  b.elementType = a;
@@ -28273,7 +28269,7 @@ function requireLib() {
28273
28269
  };
28274
28270
  },
28275
28271
  380: function _(e, t, r) {
28276
- var n = "object" == _typeof(r.g) && r.g && r.g.Object === Object && r.g;
28272
+ var n = "object" == _typeof$1(r.g) && r.g && r.g.Object === Object && r.g;
28277
28273
  e.exports = n;
28278
28274
  },
28279
28275
  903: function _(e, t, r) {
@@ -28301,7 +28297,7 @@ function requireLib() {
28301
28297
  },
28302
28298
  433: function _(e, t, r) {
28303
28299
  var n = r(380),
28304
- u = "object" == (typeof self === "undefined" ? "undefined" : _typeof(self)) && self && self.Object === Object && self,
28300
+ u = "object" == (typeof self === "undefined" ? "undefined" : _typeof$1(self)) && self && self.Object === Object && self,
28305
28301
  o = n || u || Function("return this")();
28306
28302
  e.exports = o;
28307
28303
  },
@@ -28370,20 +28366,20 @@ function requireLib() {
28370
28366
  },
28371
28367
  953: function _(e) {
28372
28368
  e.exports = function (e) {
28373
- var t = _typeof(e);
28369
+ var t = _typeof$1(e);
28374
28370
  return null != e && ("object" == t || "function" == t);
28375
28371
  };
28376
28372
  },
28377
28373
  934: function _(e) {
28378
28374
  e.exports = function (e) {
28379
- return null != e && "object" == _typeof(e);
28375
+ return null != e && "object" == _typeof$1(e);
28380
28376
  };
28381
28377
  },
28382
28378
  414: function _(e, t, r) {
28383
28379
  var n = r(148),
28384
28380
  u = r(934);
28385
28381
  e.exports = function (e) {
28386
- return "symbol" == _typeof(e) || u(e) && "[object Symbol]" == n(e);
28382
+ return "symbol" == _typeof$1(e) || u(e) && "[object Symbol]" == n(e);
28387
28383
  };
28388
28384
  },
28389
28385
  664: function _(e, t, r) {
@@ -28460,11 +28456,11 @@ function requireLib() {
28460
28456
  get: t[r]
28461
28457
  });
28462
28458
  }, u.g = function () {
28463
- if ("object" == (typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis))) return globalThis;
28459
+ if ("object" == (typeof globalThis === "undefined" ? "undefined" : _typeof$1(globalThis))) return globalThis;
28464
28460
  try {
28465
28461
  return this || new Function("return this")();
28466
28462
  } catch (e) {
28467
- if ("object" == (typeof window === "undefined" ? "undefined" : _typeof(window))) return window;
28463
+ if ("object" == (typeof window === "undefined" ? "undefined" : _typeof$1(window))) return window;
28468
28464
  }
28469
28465
  }(), u.o = function (e, t) {
28470
28466
  return Object.prototype.hasOwnProperty.call(e, t);
@@ -28586,7 +28582,7 @@ function requireLib() {
28586
28582
  }
28587
28583
  var h = Object.prototype.constructor.toString();
28588
28584
  function p(e) {
28589
- if (!e || "object" != _typeof(e)) return !1;
28585
+ if (!e || "object" != _typeof$1(e)) return !1;
28590
28586
  var t = c(e);
28591
28587
  if (null === t) return !0;
28592
28588
  var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
@@ -28883,7 +28879,7 @@ function requireLib() {
28883
28879
  }
28884
28880
  return k(_u4, r), R(n, _u4);
28885
28881
  }
28886
- if (!e || "object" != _typeof(e)) {
28882
+ if (!e || "object" != _typeof$1(e)) {
28887
28883
  if (n = t(e), void 0 === n && (n = e), n === a && (n = void 0), _this.autoFreeze_ && E(n, !0), r) {
28888
28884
  var _t6 = [],
28889
28885
  _u5 = [];
@@ -29161,10 +29157,10 @@ function requireLib() {
29161
29157
  }
29162
29158
  };
29163
29159
  function se(e) {
29164
- return se = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
29165
- return _typeof(e);
29160
+ return se = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
29161
+ return _typeof$1(e);
29166
29162
  } : function (e) {
29167
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
29163
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
29168
29164
  }, se(e);
29169
29165
  }
29170
29166
  function le(e, t, r) {
@@ -33848,7 +33844,7 @@ function requireLib() {
33848
33844
  Jt = u(858),
33849
33845
  Yt = u.n(Jt);
33850
33846
  var Zt = function Zt(e) {
33851
- return "object" == _typeof(e) && null != e && 1 === e.nodeType;
33847
+ return "object" == _typeof$1(e) && null != e && 1 === e.nodeType;
33852
33848
  },
33853
33849
  Gt = function Gt(e, t) {
33854
33850
  return (!t || "hidden" !== e) && "visible" !== e && "clip" !== e;
@@ -34068,10 +34064,10 @@ function requireLib() {
34068
34064
  "undefined" != typeof navigator && /Safari/.test(navigator.userAgent) && /Version\/(\d+)/.test(navigator.userAgent) && null !== (nr = navigator.userAgent.match(/Version\/(\d+)/)) && void 0 !== nr && nr[1] && parseInt(null === (ur = navigator.userAgent.match(/Version\/(\d+)/)) || void 0 === ur ? void 0 : ur[1], 10);
34069
34065
  var Tr = (!Or || !xr) && !Ar && "undefined" != typeof globalThis && globalThis.InputEvent && "function" == typeof globalThis.InputEvent.prototype.getTargetRanges;
34070
34066
  function Mr(e) {
34071
- return Mr = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
34072
- return _typeof(e);
34067
+ return Mr = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
34068
+ return _typeof$1(e);
34073
34069
  } : function (e) {
34074
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
34070
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
34075
34071
  }, Mr(e);
34076
34072
  }
34077
34073
  function Rr(e, t, r) {
@@ -35144,10 +35140,10 @@ function requireLib() {
35144
35140
  return u;
35145
35141
  }
35146
35142
  function mu(e) {
35147
- return mu = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
35148
- return _typeof(e);
35143
+ return mu = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
35144
+ return _typeof$1(e);
35149
35145
  } : function (e) {
35150
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
35146
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
35151
35147
  }, mu(e);
35152
35148
  }
35153
35149
  function yu(e, t, r) {
@@ -36899,7 +36895,7 @@ function requireLib() {
36899
36895
  };
36900
36896
  }(e);
36901
36897
  if (function (e) {
36902
- return "object" == _typeof(e) && "function" == typeof e.behavior;
36898
+ return "object" == _typeof$1(e) && "function" == typeof e.behavior;
36903
36899
  }(t)) return t.behavior(rr(e, t));
36904
36900
  var n = "boolean" == typeof t || null == t ? void 0 : t.behavior;
36905
36901
  var _iterator47 = _createForOfIteratorHelper(rr(e, function (e) {
@@ -40033,4 +40029,4 @@ var FloatingIsland = function FloatingIsland(_ref2) {
40033
40029
  }));
40034
40030
  };
40035
40031
 
40036
- export { Accordion, Alert, AppCue, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, Card$1 as Card, index$8 as Carousel, Checkbox, Chip, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, ErrorComponent as Error, FAB, FlatListWithFAB, FloatingIsland, HeroDesignProvider, Icon, Image, List, index$6 as MapPin, PageControl, PinInput, Portal$1 as Portal, Progress, CompoundRadio as Radio, Rate, RefreshControl, index as RichTextEditor, ScrollViewWithFAB, Search, SectionHeading, SectionListWithFAB, index$4 as Select, Skeleton, Slider, Spinner, Success, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagDarkSystemPalette, swagLightJobsSystemPalette, swagSystemPalette as swagLightSystemPalette, swagSystemPalette$1 as swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };
40032
+ export { Accordion, Alert, AppCue, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, Card$1 as Card, index$8 as Carousel, Checkbox, Chip, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, ErrorComponent as Error, FAB, FlatListWithFAB, FloatingIsland, HeroDesignProvider, Icon, Image, List, index$6 as MapPin, PageControl, PinInput, Portal$1 as Portal, Progress, CompoundRadio as Radio, Rate, RefreshControl, index as RichTextEditor, ScrollViewWithFAB, Search, SectionHeading, SectionListWithFAB, index$4 as Select, Skeleton, Slider, Spinner, Success, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, ehWorkDarkPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagDarkSystemPalette, swagLightJobsSystemPalette, swagSystemPalette as swagLightSystemPalette, swagSystemPalette$1 as swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };