@everymatrix/player-elevate-points-history-jojogroup 1.80.2

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.
Files changed (100) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/bonus-pagination-limits_6.cjs.entry.js +6293 -0
  3. package/dist/cjs/index-7eb04064.js +1637 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +15 -0
  6. package/dist/cjs/locale.utils-6b4c0dbd.js +230 -0
  7. package/dist/cjs/player-elevate-card-items-30bf53bc.js +2334 -0
  8. package/dist/cjs/player-elevate-card.cjs.entry.js +76 -0
  9. package/dist/cjs/player-elevate-loyaltycard.cjs.entry.js +89 -0
  10. package/dist/cjs/player-elevate-points-history-jojogroup.cjs.js +25 -0
  11. package/dist/cjs/player-rakeback-card.cjs.entry.js +163 -0
  12. package/dist/collection/collection-manifest.json +41 -0
  13. package/dist/collection/components/player-elevate-points-history-jojogroup/index.js +1 -0
  14. package/dist/collection/components/player-elevate-points-history-jojogroup/player-elevate-points-history-jojogroup.css +185 -0
  15. package/dist/collection/components/player-elevate-points-history-jojogroup/player-elevate-points-history-jojogroup.js +479 -0
  16. package/dist/collection/index.js +1 -0
  17. package/dist/collection/renders/renderTabs.js +9 -0
  18. package/dist/collection/renders/renderTopBar.js +4 -0
  19. package/dist/collection/renders/renderWallets.js +43 -0
  20. package/dist/collection/static/back.svg +3 -0
  21. package/dist/collection/static/menu.svg +5 -0
  22. package/dist/collection/utils/business.js +17 -0
  23. package/dist/collection/utils/fetch.js +17 -0
  24. package/dist/collection/utils/translation.js +62 -0
  25. package/dist/collection/utils/types.js +7 -0
  26. package/dist/collection/utils/util.js +16 -0
  27. package/dist/collection/utils/utils.js +3 -0
  28. package/dist/esm/app-globals-0f993ce5.js +3 -0
  29. package/dist/esm/bonus-pagination-limits_6.entry.js +6284 -0
  30. package/dist/esm/index-028fbb06.js +1607 -0
  31. package/dist/esm/index.js +1 -0
  32. package/dist/esm/loader.js +11 -0
  33. package/dist/esm/locale.utils-34e6f004.js +226 -0
  34. package/dist/esm/player-elevate-card-items-fa32ea6b.js +2323 -0
  35. package/dist/esm/player-elevate-card.entry.js +72 -0
  36. package/dist/esm/player-elevate-loyaltycard.entry.js +85 -0
  37. package/dist/esm/player-elevate-points-history-jojogroup.js +20 -0
  38. package/dist/esm/player-rakeback-card.entry.js +159 -0
  39. package/dist/index.cjs.js +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/player-elevate-points-history-jojogroup/app-globals-0f993ce5.js +1 -0
  42. package/dist/player-elevate-points-history-jojogroup/bonus-pagination-limits_6.entry.js +9 -0
  43. package/dist/player-elevate-points-history-jojogroup/index-028fbb06.js +2 -0
  44. package/dist/player-elevate-points-history-jojogroup/index.esm.js +0 -0
  45. package/dist/player-elevate-points-history-jojogroup/locale.utils-34e6f004.js +1 -0
  46. package/dist/player-elevate-points-history-jojogroup/player-elevate-card-items-fa32ea6b.js +1 -0
  47. package/dist/player-elevate-points-history-jojogroup/player-elevate-card.entry.js +1 -0
  48. package/dist/player-elevate-points-history-jojogroup/player-elevate-loyaltycard.entry.js +1 -0
  49. package/dist/player-elevate-points-history-jojogroup/player-elevate-points-history-jojogroup.esm.js +1 -0
  50. package/dist/player-elevate-points-history-jojogroup/player-rakeback-card.entry.js +1 -0
  51. package/dist/static/button-default.svg +42 -0
  52. package/dist/static/button-disabled.svg +4 -0
  53. package/dist/static/button-hover.svg +4 -0
  54. package/dist/static/button-level.svg +27 -0
  55. package/dist/static/button-pressed.svg +18 -0
  56. package/dist/static/button-redeem.svg +36 -0
  57. package/dist/static/card-ground-over.png +0 -0
  58. package/dist/static/card-ground-over.svg +903 -0
  59. package/dist/static/card-ground.png +0 -0
  60. package/dist/static/card-ground.svg +34 -0
  61. package/dist/static/info.svg +4 -0
  62. package/dist/static/level-badge.png +0 -0
  63. package/dist/static/level-percent.svg +80 -0
  64. package/dist/static/tips-info.svg +21 -0
  65. package/dist/static/user.svg +3 -0
  66. package/dist/stencil.config.dev.js +18 -0
  67. package/dist/stencil.config.js +20 -0
  68. package/dist/storybook/main.js +47 -0
  69. package/dist/storybook/preview.js +9 -0
  70. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  71. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/packages/stencil/player-elevate-points-history-jojogroup/stencil.config.d.ts +2 -0
  72. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/packages/stencil/player-elevate-points-history-jojogroup/stencil.config.dev.d.ts +2 -0
  73. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/packages/stencil/player-elevate-points-history-jojogroup/storybook/main.d.ts +3 -0
  74. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/packages/stencil/player-elevate-points-history-jojogroup/storybook/preview.d.ts +70 -0
  75. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/tools/plugins/index.d.ts +4 -0
  76. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  77. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  78. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  79. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-points-history-jojogroup/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  80. package/dist/types/components/player-elevate-points-history-jojogroup/index.d.ts +1 -0
  81. package/dist/types/components/player-elevate-points-history-jojogroup/player-elevate-points-history-jojogroup.d.ts +80 -0
  82. package/dist/types/components.d.ts +165 -0
  83. package/dist/types/index.d.ts +1 -0
  84. package/dist/types/renders/renderTabs.d.ts +3 -0
  85. package/dist/types/renders/renderTopBar.d.ts +3 -0
  86. package/dist/types/renders/renderWallets.d.ts +12 -0
  87. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  88. package/dist/types/utils/business.d.ts +2 -0
  89. package/dist/types/utils/fetch.d.ts +2 -0
  90. package/dist/types/utils/translation.d.ts +63 -0
  91. package/dist/types/utils/types.d.ts +50 -0
  92. package/dist/types/utils/util.d.ts +1 -0
  93. package/dist/types/utils/utils.d.ts +1 -0
  94. package/loader/cdn.js +1 -0
  95. package/loader/index.cjs.js +1 -0
  96. package/loader/index.d.ts +24 -0
  97. package/loader/index.es2017.js +1 -0
  98. package/loader/index.js +2 -0
  99. package/loader/package.json +11 -0
  100. package/package.json +26 -0
@@ -0,0 +1,2334 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-7eb04064.js');
4
+ const locale_utils = require('./locale.utils-6b4c0dbd.js');
5
+
6
+ function _typeof(o) {
7
+ "@babel/helpers - typeof";
8
+
9
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
10
+ return typeof o;
11
+ } : function (o) {
12
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
13
+ }, _typeof(o);
14
+ }
15
+
16
+ function toInteger(dirtyNumber) {
17
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
18
+ return NaN;
19
+ }
20
+ var number = Number(dirtyNumber);
21
+ if (isNaN(number)) {
22
+ return number;
23
+ }
24
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
25
+ }
26
+
27
+ function requiredArgs(required, args) {
28
+ if (args.length < required) {
29
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
30
+ }
31
+ }
32
+
33
+ /**
34
+ * @name toDate
35
+ * @category Common Helpers
36
+ * @summary Convert the given argument to an instance of Date.
37
+ *
38
+ * @description
39
+ * Convert the given argument to an instance of Date.
40
+ *
41
+ * If the argument is an instance of Date, the function returns its clone.
42
+ *
43
+ * If the argument is a number, it is treated as a timestamp.
44
+ *
45
+ * If the argument is none of the above, the function returns Invalid Date.
46
+ *
47
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
48
+ *
49
+ * @param {Date|Number} argument - the value to convert
50
+ * @returns {Date} the parsed date in the local time zone
51
+ * @throws {TypeError} 1 argument required
52
+ *
53
+ * @example
54
+ * // Clone the date:
55
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
56
+ * //=> Tue Feb 11 2014 11:30:30
57
+ *
58
+ * @example
59
+ * // Convert the timestamp to date:
60
+ * const result = toDate(1392098430000)
61
+ * //=> Tue Feb 11 2014 11:30:30
62
+ */
63
+ function toDate(argument) {
64
+ requiredArgs(1, arguments);
65
+ var argStr = Object.prototype.toString.call(argument);
66
+
67
+ // Clone the date
68
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
69
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
70
+ return new Date(argument.getTime());
71
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
72
+ return new Date(argument);
73
+ } else {
74
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
75
+ // eslint-disable-next-line no-console
76
+ 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");
77
+ // eslint-disable-next-line no-console
78
+ console.warn(new Error().stack);
79
+ }
80
+ return new Date(NaN);
81
+ }
82
+ }
83
+
84
+ /**
85
+ * @name addMilliseconds
86
+ * @category Millisecond Helpers
87
+ * @summary Add the specified number of milliseconds to the given date.
88
+ *
89
+ * @description
90
+ * Add the specified number of milliseconds to the given date.
91
+ *
92
+ * @param {Date|Number} date - the date to be changed
93
+ * @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`.
94
+ * @returns {Date} the new date with the milliseconds added
95
+ * @throws {TypeError} 2 arguments required
96
+ *
97
+ * @example
98
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
99
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
100
+ * //=> Thu Jul 10 2014 12:45:30.750
101
+ */
102
+ function addMilliseconds(dirtyDate, dirtyAmount) {
103
+ requiredArgs(2, arguments);
104
+ var timestamp = toDate(dirtyDate).getTime();
105
+ var amount = toInteger(dirtyAmount);
106
+ return new Date(timestamp + amount);
107
+ }
108
+
109
+ var defaultOptions = {};
110
+ function getDefaultOptions() {
111
+ return defaultOptions;
112
+ }
113
+
114
+ /**
115
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
116
+ * They usually appear for dates that denote time before the timezones were introduced
117
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
118
+ * and GMT+01:00:00 after that date)
119
+ *
120
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
121
+ * which would lead to incorrect calculations.
122
+ *
123
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
124
+ */
125
+ function getTimezoneOffsetInMilliseconds(date) {
126
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
127
+ utcDate.setUTCFullYear(date.getFullYear());
128
+ return date.getTime() - utcDate.getTime();
129
+ }
130
+
131
+ /**
132
+ * @name isDate
133
+ * @category Common Helpers
134
+ * @summary Is the given value a date?
135
+ *
136
+ * @description
137
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
138
+ *
139
+ * @param {*} value - the value to check
140
+ * @returns {boolean} true if the given value is a date
141
+ * @throws {TypeError} 1 arguments required
142
+ *
143
+ * @example
144
+ * // For a valid date:
145
+ * const result = isDate(new Date())
146
+ * //=> true
147
+ *
148
+ * @example
149
+ * // For an invalid date:
150
+ * const result = isDate(new Date(NaN))
151
+ * //=> true
152
+ *
153
+ * @example
154
+ * // For some value:
155
+ * const result = isDate('2014-02-31')
156
+ * //=> false
157
+ *
158
+ * @example
159
+ * // For an object:
160
+ * const result = isDate({})
161
+ * //=> false
162
+ */
163
+ function isDate(value) {
164
+ requiredArgs(1, arguments);
165
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
166
+ }
167
+
168
+ /**
169
+ * @name isValid
170
+ * @category Common Helpers
171
+ * @summary Is the given date valid?
172
+ *
173
+ * @description
174
+ * Returns false if argument is Invalid Date and true otherwise.
175
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
176
+ * Invalid Date is a Date, whose time value is NaN.
177
+ *
178
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
179
+ *
180
+ * @param {*} date - the date to check
181
+ * @returns {Boolean} the date is valid
182
+ * @throws {TypeError} 1 argument required
183
+ *
184
+ * @example
185
+ * // For the valid date:
186
+ * const result = isValid(new Date(2014, 1, 31))
187
+ * //=> true
188
+ *
189
+ * @example
190
+ * // For the value, convertable into a date:
191
+ * const result = isValid(1393804800000)
192
+ * //=> true
193
+ *
194
+ * @example
195
+ * // For the invalid date:
196
+ * const result = isValid(new Date(''))
197
+ * //=> false
198
+ */
199
+ function isValid(dirtyDate) {
200
+ requiredArgs(1, arguments);
201
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
202
+ return false;
203
+ }
204
+ var date = toDate(dirtyDate);
205
+ return !isNaN(Number(date));
206
+ }
207
+
208
+ /**
209
+ * @name subMilliseconds
210
+ * @category Millisecond Helpers
211
+ * @summary Subtract the specified number of milliseconds from the given date.
212
+ *
213
+ * @description
214
+ * Subtract the specified number of milliseconds from the given date.
215
+ *
216
+ * @param {Date|Number} date - the date to be changed
217
+ * @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`.
218
+ * @returns {Date} the new date with the milliseconds subtracted
219
+ * @throws {TypeError} 2 arguments required
220
+ *
221
+ * @example
222
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
223
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
224
+ * //=> Thu Jul 10 2014 12:45:29.250
225
+ */
226
+ function subMilliseconds(dirtyDate, dirtyAmount) {
227
+ requiredArgs(2, arguments);
228
+ var amount = toInteger(dirtyAmount);
229
+ return addMilliseconds(dirtyDate, -amount);
230
+ }
231
+
232
+ var MILLISECONDS_IN_DAY = 86400000;
233
+ function getUTCDayOfYear(dirtyDate) {
234
+ requiredArgs(1, arguments);
235
+ var date = toDate(dirtyDate);
236
+ var timestamp = date.getTime();
237
+ date.setUTCMonth(0, 1);
238
+ date.setUTCHours(0, 0, 0, 0);
239
+ var startOfYearTimestamp = date.getTime();
240
+ var difference = timestamp - startOfYearTimestamp;
241
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
242
+ }
243
+
244
+ function startOfUTCISOWeek(dirtyDate) {
245
+ requiredArgs(1, arguments);
246
+ var weekStartsOn = 1;
247
+ var date = toDate(dirtyDate);
248
+ var day = date.getUTCDay();
249
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
250
+ date.setUTCDate(date.getUTCDate() - diff);
251
+ date.setUTCHours(0, 0, 0, 0);
252
+ return date;
253
+ }
254
+
255
+ function getUTCISOWeekYear(dirtyDate) {
256
+ requiredArgs(1, arguments);
257
+ var date = toDate(dirtyDate);
258
+ var year = date.getUTCFullYear();
259
+ var fourthOfJanuaryOfNextYear = new Date(0);
260
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
261
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
262
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
263
+ var fourthOfJanuaryOfThisYear = new Date(0);
264
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
265
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
266
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
267
+ if (date.getTime() >= startOfNextYear.getTime()) {
268
+ return year + 1;
269
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
270
+ return year;
271
+ } else {
272
+ return year - 1;
273
+ }
274
+ }
275
+
276
+ function startOfUTCISOWeekYear(dirtyDate) {
277
+ requiredArgs(1, arguments);
278
+ var year = getUTCISOWeekYear(dirtyDate);
279
+ var fourthOfJanuary = new Date(0);
280
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
281
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
282
+ var date = startOfUTCISOWeek(fourthOfJanuary);
283
+ return date;
284
+ }
285
+
286
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
287
+ function getUTCISOWeek(dirtyDate) {
288
+ requiredArgs(1, arguments);
289
+ var date = toDate(dirtyDate);
290
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
291
+
292
+ // Round the number of days to the nearest integer
293
+ // because the number of milliseconds in a week is not constant
294
+ // (e.g. it's different in the week of the daylight saving time clock shift)
295
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
296
+ }
297
+
298
+ function startOfUTCWeek(dirtyDate, options) {
299
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
300
+ requiredArgs(1, arguments);
301
+ var defaultOptions = getDefaultOptions();
302
+ 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);
303
+
304
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
305
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
306
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
307
+ }
308
+ var date = toDate(dirtyDate);
309
+ var day = date.getUTCDay();
310
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
311
+ date.setUTCDate(date.getUTCDate() - diff);
312
+ date.setUTCHours(0, 0, 0, 0);
313
+ return date;
314
+ }
315
+
316
+ function getUTCWeekYear(dirtyDate, options) {
317
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
318
+ requiredArgs(1, arguments);
319
+ var date = toDate(dirtyDate);
320
+ var year = date.getUTCFullYear();
321
+ var defaultOptions = getDefaultOptions();
322
+ 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);
323
+
324
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
325
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
326
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
327
+ }
328
+ var firstWeekOfNextYear = new Date(0);
329
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
330
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
331
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
332
+ var firstWeekOfThisYear = new Date(0);
333
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
334
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
335
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
336
+ if (date.getTime() >= startOfNextYear.getTime()) {
337
+ return year + 1;
338
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
339
+ return year;
340
+ } else {
341
+ return year - 1;
342
+ }
343
+ }
344
+
345
+ function startOfUTCWeekYear(dirtyDate, options) {
346
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
347
+ requiredArgs(1, arguments);
348
+ var defaultOptions = getDefaultOptions();
349
+ 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);
350
+ var year = getUTCWeekYear(dirtyDate, options);
351
+ var firstWeek = new Date(0);
352
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
353
+ firstWeek.setUTCHours(0, 0, 0, 0);
354
+ var date = startOfUTCWeek(firstWeek, options);
355
+ return date;
356
+ }
357
+
358
+ var MILLISECONDS_IN_WEEK = 604800000;
359
+ function getUTCWeek(dirtyDate, options) {
360
+ requiredArgs(1, arguments);
361
+ var date = toDate(dirtyDate);
362
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
363
+
364
+ // Round the number of days to the nearest integer
365
+ // because the number of milliseconds in a week is not constant
366
+ // (e.g. it's different in the week of the daylight saving time clock shift)
367
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
368
+ }
369
+
370
+ function addLeadingZeros(number, targetLength) {
371
+ var sign = number < 0 ? '-' : '';
372
+ var output = Math.abs(number).toString();
373
+ while (output.length < targetLength) {
374
+ output = '0' + output;
375
+ }
376
+ return sign + output;
377
+ }
378
+
379
+ /*
380
+ * | | Unit | | Unit |
381
+ * |-----|--------------------------------|-----|--------------------------------|
382
+ * | a | AM, PM | A* | |
383
+ * | d | Day of month | D | |
384
+ * | h | Hour [1-12] | H | Hour [0-23] |
385
+ * | m | Minute | M | Month |
386
+ * | s | Second | S | Fraction of second |
387
+ * | y | Year (abs) | Y | |
388
+ *
389
+ * Letters marked by * are not implemented but reserved by Unicode standard.
390
+ */
391
+ var formatters$2 = {
392
+ // Year
393
+ y: function y(date, token) {
394
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
395
+ // | Year | y | yy | yyy | yyyy | yyyyy |
396
+ // |----------|-------|----|-------|-------|-------|
397
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
398
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
399
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
400
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
401
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
402
+
403
+ var signedYear = date.getUTCFullYear();
404
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
405
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
406
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
407
+ },
408
+ // Month
409
+ M: function M(date, token) {
410
+ var month = date.getUTCMonth();
411
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
412
+ },
413
+ // Day of the month
414
+ d: function d(date, token) {
415
+ return addLeadingZeros(date.getUTCDate(), token.length);
416
+ },
417
+ // AM or PM
418
+ a: function a(date, token) {
419
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
420
+ switch (token) {
421
+ case 'a':
422
+ case 'aa':
423
+ return dayPeriodEnumValue.toUpperCase();
424
+ case 'aaa':
425
+ return dayPeriodEnumValue;
426
+ case 'aaaaa':
427
+ return dayPeriodEnumValue[0];
428
+ case 'aaaa':
429
+ default:
430
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
431
+ }
432
+ },
433
+ // Hour [1-12]
434
+ h: function h(date, token) {
435
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
436
+ },
437
+ // Hour [0-23]
438
+ H: function H(date, token) {
439
+ return addLeadingZeros(date.getUTCHours(), token.length);
440
+ },
441
+ // Minute
442
+ m: function m(date, token) {
443
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
444
+ },
445
+ // Second
446
+ s: function s(date, token) {
447
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
448
+ },
449
+ // Fraction of second
450
+ S: function S(date, token) {
451
+ var numberOfDigits = token.length;
452
+ var milliseconds = date.getUTCMilliseconds();
453
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
454
+ return addLeadingZeros(fractionalSeconds, token.length);
455
+ }
456
+ };
457
+ const formatters$3 = formatters$2;
458
+
459
+ var dayPeriodEnum = {
460
+ am: 'am',
461
+ pm: 'pm',
462
+ midnight: 'midnight',
463
+ noon: 'noon',
464
+ morning: 'morning',
465
+ afternoon: 'afternoon',
466
+ evening: 'evening',
467
+ night: 'night'
468
+ };
469
+ /*
470
+ * | | Unit | | Unit |
471
+ * |-----|--------------------------------|-----|--------------------------------|
472
+ * | a | AM, PM | A* | Milliseconds in day |
473
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
474
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
475
+ * | d | Day of month | D | Day of year |
476
+ * | e | Local day of week | E | Day of week |
477
+ * | f | | F* | Day of week in month |
478
+ * | g* | Modified Julian day | G | Era |
479
+ * | h | Hour [1-12] | H | Hour [0-23] |
480
+ * | i! | ISO day of week | I! | ISO week of year |
481
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
482
+ * | k | Hour [1-24] | K | Hour [0-11] |
483
+ * | l* | (deprecated) | L | Stand-alone month |
484
+ * | m | Minute | M | Month |
485
+ * | n | | N | |
486
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
487
+ * | p! | Long localized time | P! | Long localized date |
488
+ * | q | Stand-alone quarter | Q | Quarter |
489
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
490
+ * | s | Second | S | Fraction of second |
491
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
492
+ * | u | Extended year | U* | Cyclic year |
493
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
494
+ * | w | Local week of year | W* | Week of month |
495
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
496
+ * | y | Year (abs) | Y | Local week-numbering year |
497
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
498
+ *
499
+ * Letters marked by * are not implemented but reserved by Unicode standard.
500
+ *
501
+ * Letters marked by ! are non-standard, but implemented by date-fns:
502
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
503
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
504
+ * i.e. 7 for Sunday, 1 for Monday, etc.
505
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
506
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
507
+ * `R` is supposed to be used in conjunction with `I` and `i`
508
+ * for universal ISO week-numbering date, whereas
509
+ * `Y` is supposed to be used in conjunction with `w` and `e`
510
+ * for week-numbering date specific to the locale.
511
+ * - `P` is long localized date format
512
+ * - `p` is long localized time format
513
+ */
514
+
515
+ var formatters = {
516
+ // Era
517
+ G: function G(date, token, localize) {
518
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
519
+ switch (token) {
520
+ // AD, BC
521
+ case 'G':
522
+ case 'GG':
523
+ case 'GGG':
524
+ return localize.era(era, {
525
+ width: 'abbreviated'
526
+ });
527
+ // A, B
528
+ case 'GGGGG':
529
+ return localize.era(era, {
530
+ width: 'narrow'
531
+ });
532
+ // Anno Domini, Before Christ
533
+ case 'GGGG':
534
+ default:
535
+ return localize.era(era, {
536
+ width: 'wide'
537
+ });
538
+ }
539
+ },
540
+ // Year
541
+ y: function y(date, token, localize) {
542
+ // Ordinal number
543
+ if (token === 'yo') {
544
+ var signedYear = date.getUTCFullYear();
545
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
546
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
547
+ return localize.ordinalNumber(year, {
548
+ unit: 'year'
549
+ });
550
+ }
551
+ return formatters$3.y(date, token);
552
+ },
553
+ // Local week-numbering year
554
+ Y: function Y(date, token, localize, options) {
555
+ var signedWeekYear = getUTCWeekYear(date, options);
556
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
557
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
558
+
559
+ // Two digit year
560
+ if (token === 'YY') {
561
+ var twoDigitYear = weekYear % 100;
562
+ return addLeadingZeros(twoDigitYear, 2);
563
+ }
564
+
565
+ // Ordinal number
566
+ if (token === 'Yo') {
567
+ return localize.ordinalNumber(weekYear, {
568
+ unit: 'year'
569
+ });
570
+ }
571
+
572
+ // Padding
573
+ return addLeadingZeros(weekYear, token.length);
574
+ },
575
+ // ISO week-numbering year
576
+ R: function R(date, token) {
577
+ var isoWeekYear = getUTCISOWeekYear(date);
578
+
579
+ // Padding
580
+ return addLeadingZeros(isoWeekYear, token.length);
581
+ },
582
+ // Extended year. This is a single number designating the year of this calendar system.
583
+ // The main difference between `y` and `u` localizers are B.C. years:
584
+ // | Year | `y` | `u` |
585
+ // |------|-----|-----|
586
+ // | AC 1 | 1 | 1 |
587
+ // | BC 1 | 1 | 0 |
588
+ // | BC 2 | 2 | -1 |
589
+ // Also `yy` always returns the last two digits of a year,
590
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
591
+ u: function u(date, token) {
592
+ var year = date.getUTCFullYear();
593
+ return addLeadingZeros(year, token.length);
594
+ },
595
+ // Quarter
596
+ Q: function Q(date, token, localize) {
597
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
598
+ switch (token) {
599
+ // 1, 2, 3, 4
600
+ case 'Q':
601
+ return String(quarter);
602
+ // 01, 02, 03, 04
603
+ case 'QQ':
604
+ return addLeadingZeros(quarter, 2);
605
+ // 1st, 2nd, 3rd, 4th
606
+ case 'Qo':
607
+ return localize.ordinalNumber(quarter, {
608
+ unit: 'quarter'
609
+ });
610
+ // Q1, Q2, Q3, Q4
611
+ case 'QQQ':
612
+ return localize.quarter(quarter, {
613
+ width: 'abbreviated',
614
+ context: 'formatting'
615
+ });
616
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
617
+ case 'QQQQQ':
618
+ return localize.quarter(quarter, {
619
+ width: 'narrow',
620
+ context: 'formatting'
621
+ });
622
+ // 1st quarter, 2nd quarter, ...
623
+ case 'QQQQ':
624
+ default:
625
+ return localize.quarter(quarter, {
626
+ width: 'wide',
627
+ context: 'formatting'
628
+ });
629
+ }
630
+ },
631
+ // Stand-alone quarter
632
+ q: function q(date, token, localize) {
633
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
634
+ switch (token) {
635
+ // 1, 2, 3, 4
636
+ case 'q':
637
+ return String(quarter);
638
+ // 01, 02, 03, 04
639
+ case 'qq':
640
+ return addLeadingZeros(quarter, 2);
641
+ // 1st, 2nd, 3rd, 4th
642
+ case 'qo':
643
+ return localize.ordinalNumber(quarter, {
644
+ unit: 'quarter'
645
+ });
646
+ // Q1, Q2, Q3, Q4
647
+ case 'qqq':
648
+ return localize.quarter(quarter, {
649
+ width: 'abbreviated',
650
+ context: 'standalone'
651
+ });
652
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
653
+ case 'qqqqq':
654
+ return localize.quarter(quarter, {
655
+ width: 'narrow',
656
+ context: 'standalone'
657
+ });
658
+ // 1st quarter, 2nd quarter, ...
659
+ case 'qqqq':
660
+ default:
661
+ return localize.quarter(quarter, {
662
+ width: 'wide',
663
+ context: 'standalone'
664
+ });
665
+ }
666
+ },
667
+ // Month
668
+ M: function M(date, token, localize) {
669
+ var month = date.getUTCMonth();
670
+ switch (token) {
671
+ case 'M':
672
+ case 'MM':
673
+ return formatters$3.M(date, token);
674
+ // 1st, 2nd, ..., 12th
675
+ case 'Mo':
676
+ return localize.ordinalNumber(month + 1, {
677
+ unit: 'month'
678
+ });
679
+ // Jan, Feb, ..., Dec
680
+ case 'MMM':
681
+ return localize.month(month, {
682
+ width: 'abbreviated',
683
+ context: 'formatting'
684
+ });
685
+ // J, F, ..., D
686
+ case 'MMMMM':
687
+ return localize.month(month, {
688
+ width: 'narrow',
689
+ context: 'formatting'
690
+ });
691
+ // January, February, ..., December
692
+ case 'MMMM':
693
+ default:
694
+ return localize.month(month, {
695
+ width: 'wide',
696
+ context: 'formatting'
697
+ });
698
+ }
699
+ },
700
+ // Stand-alone month
701
+ L: function L(date, token, localize) {
702
+ var month = date.getUTCMonth();
703
+ switch (token) {
704
+ // 1, 2, ..., 12
705
+ case 'L':
706
+ return String(month + 1);
707
+ // 01, 02, ..., 12
708
+ case 'LL':
709
+ return addLeadingZeros(month + 1, 2);
710
+ // 1st, 2nd, ..., 12th
711
+ case 'Lo':
712
+ return localize.ordinalNumber(month + 1, {
713
+ unit: 'month'
714
+ });
715
+ // Jan, Feb, ..., Dec
716
+ case 'LLL':
717
+ return localize.month(month, {
718
+ width: 'abbreviated',
719
+ context: 'standalone'
720
+ });
721
+ // J, F, ..., D
722
+ case 'LLLLL':
723
+ return localize.month(month, {
724
+ width: 'narrow',
725
+ context: 'standalone'
726
+ });
727
+ // January, February, ..., December
728
+ case 'LLLL':
729
+ default:
730
+ return localize.month(month, {
731
+ width: 'wide',
732
+ context: 'standalone'
733
+ });
734
+ }
735
+ },
736
+ // Local week of year
737
+ w: function w(date, token, localize, options) {
738
+ var week = getUTCWeek(date, options);
739
+ if (token === 'wo') {
740
+ return localize.ordinalNumber(week, {
741
+ unit: 'week'
742
+ });
743
+ }
744
+ return addLeadingZeros(week, token.length);
745
+ },
746
+ // ISO week of year
747
+ I: function I(date, token, localize) {
748
+ var isoWeek = getUTCISOWeek(date);
749
+ if (token === 'Io') {
750
+ return localize.ordinalNumber(isoWeek, {
751
+ unit: 'week'
752
+ });
753
+ }
754
+ return addLeadingZeros(isoWeek, token.length);
755
+ },
756
+ // Day of the month
757
+ d: function d(date, token, localize) {
758
+ if (token === 'do') {
759
+ return localize.ordinalNumber(date.getUTCDate(), {
760
+ unit: 'date'
761
+ });
762
+ }
763
+ return formatters$3.d(date, token);
764
+ },
765
+ // Day of year
766
+ D: function D(date, token, localize) {
767
+ var dayOfYear = getUTCDayOfYear(date);
768
+ if (token === 'Do') {
769
+ return localize.ordinalNumber(dayOfYear, {
770
+ unit: 'dayOfYear'
771
+ });
772
+ }
773
+ return addLeadingZeros(dayOfYear, token.length);
774
+ },
775
+ // Day of week
776
+ E: function E(date, token, localize) {
777
+ var dayOfWeek = date.getUTCDay();
778
+ switch (token) {
779
+ // Tue
780
+ case 'E':
781
+ case 'EE':
782
+ case 'EEE':
783
+ return localize.day(dayOfWeek, {
784
+ width: 'abbreviated',
785
+ context: 'formatting'
786
+ });
787
+ // T
788
+ case 'EEEEE':
789
+ return localize.day(dayOfWeek, {
790
+ width: 'narrow',
791
+ context: 'formatting'
792
+ });
793
+ // Tu
794
+ case 'EEEEEE':
795
+ return localize.day(dayOfWeek, {
796
+ width: 'short',
797
+ context: 'formatting'
798
+ });
799
+ // Tuesday
800
+ case 'EEEE':
801
+ default:
802
+ return localize.day(dayOfWeek, {
803
+ width: 'wide',
804
+ context: 'formatting'
805
+ });
806
+ }
807
+ },
808
+ // Local day of week
809
+ e: function e(date, token, localize, options) {
810
+ var dayOfWeek = date.getUTCDay();
811
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
812
+ switch (token) {
813
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
814
+ case 'e':
815
+ return String(localDayOfWeek);
816
+ // Padded numerical value
817
+ case 'ee':
818
+ return addLeadingZeros(localDayOfWeek, 2);
819
+ // 1st, 2nd, ..., 7th
820
+ case 'eo':
821
+ return localize.ordinalNumber(localDayOfWeek, {
822
+ unit: 'day'
823
+ });
824
+ case 'eee':
825
+ return localize.day(dayOfWeek, {
826
+ width: 'abbreviated',
827
+ context: 'formatting'
828
+ });
829
+ // T
830
+ case 'eeeee':
831
+ return localize.day(dayOfWeek, {
832
+ width: 'narrow',
833
+ context: 'formatting'
834
+ });
835
+ // Tu
836
+ case 'eeeeee':
837
+ return localize.day(dayOfWeek, {
838
+ width: 'short',
839
+ context: 'formatting'
840
+ });
841
+ // Tuesday
842
+ case 'eeee':
843
+ default:
844
+ return localize.day(dayOfWeek, {
845
+ width: 'wide',
846
+ context: 'formatting'
847
+ });
848
+ }
849
+ },
850
+ // Stand-alone local day of week
851
+ c: function c(date, token, localize, options) {
852
+ var dayOfWeek = date.getUTCDay();
853
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
854
+ switch (token) {
855
+ // Numerical value (same as in `e`)
856
+ case 'c':
857
+ return String(localDayOfWeek);
858
+ // Padded numerical value
859
+ case 'cc':
860
+ return addLeadingZeros(localDayOfWeek, token.length);
861
+ // 1st, 2nd, ..., 7th
862
+ case 'co':
863
+ return localize.ordinalNumber(localDayOfWeek, {
864
+ unit: 'day'
865
+ });
866
+ case 'ccc':
867
+ return localize.day(dayOfWeek, {
868
+ width: 'abbreviated',
869
+ context: 'standalone'
870
+ });
871
+ // T
872
+ case 'ccccc':
873
+ return localize.day(dayOfWeek, {
874
+ width: 'narrow',
875
+ context: 'standalone'
876
+ });
877
+ // Tu
878
+ case 'cccccc':
879
+ return localize.day(dayOfWeek, {
880
+ width: 'short',
881
+ context: 'standalone'
882
+ });
883
+ // Tuesday
884
+ case 'cccc':
885
+ default:
886
+ return localize.day(dayOfWeek, {
887
+ width: 'wide',
888
+ context: 'standalone'
889
+ });
890
+ }
891
+ },
892
+ // ISO day of week
893
+ i: function i(date, token, localize) {
894
+ var dayOfWeek = date.getUTCDay();
895
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
896
+ switch (token) {
897
+ // 2
898
+ case 'i':
899
+ return String(isoDayOfWeek);
900
+ // 02
901
+ case 'ii':
902
+ return addLeadingZeros(isoDayOfWeek, token.length);
903
+ // 2nd
904
+ case 'io':
905
+ return localize.ordinalNumber(isoDayOfWeek, {
906
+ unit: 'day'
907
+ });
908
+ // Tue
909
+ case 'iii':
910
+ return localize.day(dayOfWeek, {
911
+ width: 'abbreviated',
912
+ context: 'formatting'
913
+ });
914
+ // T
915
+ case 'iiiii':
916
+ return localize.day(dayOfWeek, {
917
+ width: 'narrow',
918
+ context: 'formatting'
919
+ });
920
+ // Tu
921
+ case 'iiiiii':
922
+ return localize.day(dayOfWeek, {
923
+ width: 'short',
924
+ context: 'formatting'
925
+ });
926
+ // Tuesday
927
+ case 'iiii':
928
+ default:
929
+ return localize.day(dayOfWeek, {
930
+ width: 'wide',
931
+ context: 'formatting'
932
+ });
933
+ }
934
+ },
935
+ // AM or PM
936
+ a: function a(date, token, localize) {
937
+ var hours = date.getUTCHours();
938
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
939
+ switch (token) {
940
+ case 'a':
941
+ case 'aa':
942
+ return localize.dayPeriod(dayPeriodEnumValue, {
943
+ width: 'abbreviated',
944
+ context: 'formatting'
945
+ });
946
+ case 'aaa':
947
+ return localize.dayPeriod(dayPeriodEnumValue, {
948
+ width: 'abbreviated',
949
+ context: 'formatting'
950
+ }).toLowerCase();
951
+ case 'aaaaa':
952
+ return localize.dayPeriod(dayPeriodEnumValue, {
953
+ width: 'narrow',
954
+ context: 'formatting'
955
+ });
956
+ case 'aaaa':
957
+ default:
958
+ return localize.dayPeriod(dayPeriodEnumValue, {
959
+ width: 'wide',
960
+ context: 'formatting'
961
+ });
962
+ }
963
+ },
964
+ // AM, PM, midnight, noon
965
+ b: function b(date, token, localize) {
966
+ var hours = date.getUTCHours();
967
+ var dayPeriodEnumValue;
968
+ if (hours === 12) {
969
+ dayPeriodEnumValue = dayPeriodEnum.noon;
970
+ } else if (hours === 0) {
971
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
972
+ } else {
973
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
974
+ }
975
+ switch (token) {
976
+ case 'b':
977
+ case 'bb':
978
+ return localize.dayPeriod(dayPeriodEnumValue, {
979
+ width: 'abbreviated',
980
+ context: 'formatting'
981
+ });
982
+ case 'bbb':
983
+ return localize.dayPeriod(dayPeriodEnumValue, {
984
+ width: 'abbreviated',
985
+ context: 'formatting'
986
+ }).toLowerCase();
987
+ case 'bbbbb':
988
+ return localize.dayPeriod(dayPeriodEnumValue, {
989
+ width: 'narrow',
990
+ context: 'formatting'
991
+ });
992
+ case 'bbbb':
993
+ default:
994
+ return localize.dayPeriod(dayPeriodEnumValue, {
995
+ width: 'wide',
996
+ context: 'formatting'
997
+ });
998
+ }
999
+ },
1000
+ // in the morning, in the afternoon, in the evening, at night
1001
+ B: function B(date, token, localize) {
1002
+ var hours = date.getUTCHours();
1003
+ var dayPeriodEnumValue;
1004
+ if (hours >= 17) {
1005
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1006
+ } else if (hours >= 12) {
1007
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1008
+ } else if (hours >= 4) {
1009
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1010
+ } else {
1011
+ dayPeriodEnumValue = dayPeriodEnum.night;
1012
+ }
1013
+ switch (token) {
1014
+ case 'B':
1015
+ case 'BB':
1016
+ case 'BBB':
1017
+ return localize.dayPeriod(dayPeriodEnumValue, {
1018
+ width: 'abbreviated',
1019
+ context: 'formatting'
1020
+ });
1021
+ case 'BBBBB':
1022
+ return localize.dayPeriod(dayPeriodEnumValue, {
1023
+ width: 'narrow',
1024
+ context: 'formatting'
1025
+ });
1026
+ case 'BBBB':
1027
+ default:
1028
+ return localize.dayPeriod(dayPeriodEnumValue, {
1029
+ width: 'wide',
1030
+ context: 'formatting'
1031
+ });
1032
+ }
1033
+ },
1034
+ // Hour [1-12]
1035
+ h: function h(date, token, localize) {
1036
+ if (token === 'ho') {
1037
+ var hours = date.getUTCHours() % 12;
1038
+ if (hours === 0) hours = 12;
1039
+ return localize.ordinalNumber(hours, {
1040
+ unit: 'hour'
1041
+ });
1042
+ }
1043
+ return formatters$3.h(date, token);
1044
+ },
1045
+ // Hour [0-23]
1046
+ H: function H(date, token, localize) {
1047
+ if (token === 'Ho') {
1048
+ return localize.ordinalNumber(date.getUTCHours(), {
1049
+ unit: 'hour'
1050
+ });
1051
+ }
1052
+ return formatters$3.H(date, token);
1053
+ },
1054
+ // Hour [0-11]
1055
+ K: function K(date, token, localize) {
1056
+ var hours = date.getUTCHours() % 12;
1057
+ if (token === 'Ko') {
1058
+ return localize.ordinalNumber(hours, {
1059
+ unit: 'hour'
1060
+ });
1061
+ }
1062
+ return addLeadingZeros(hours, token.length);
1063
+ },
1064
+ // Hour [1-24]
1065
+ k: function k(date, token, localize) {
1066
+ var hours = date.getUTCHours();
1067
+ if (hours === 0) hours = 24;
1068
+ if (token === 'ko') {
1069
+ return localize.ordinalNumber(hours, {
1070
+ unit: 'hour'
1071
+ });
1072
+ }
1073
+ return addLeadingZeros(hours, token.length);
1074
+ },
1075
+ // Minute
1076
+ m: function m(date, token, localize) {
1077
+ if (token === 'mo') {
1078
+ return localize.ordinalNumber(date.getUTCMinutes(), {
1079
+ unit: 'minute'
1080
+ });
1081
+ }
1082
+ return formatters$3.m(date, token);
1083
+ },
1084
+ // Second
1085
+ s: function s(date, token, localize) {
1086
+ if (token === 'so') {
1087
+ return localize.ordinalNumber(date.getUTCSeconds(), {
1088
+ unit: 'second'
1089
+ });
1090
+ }
1091
+ return formatters$3.s(date, token);
1092
+ },
1093
+ // Fraction of second
1094
+ S: function S(date, token) {
1095
+ return formatters$3.S(date, token);
1096
+ },
1097
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1098
+ X: function X(date, token, _localize, options) {
1099
+ var originalDate = options._originalDate || date;
1100
+ var timezoneOffset = originalDate.getTimezoneOffset();
1101
+ if (timezoneOffset === 0) {
1102
+ return 'Z';
1103
+ }
1104
+ switch (token) {
1105
+ // Hours and optional minutes
1106
+ case 'X':
1107
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1108
+
1109
+ // Hours, minutes and optional seconds without `:` delimiter
1110
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1111
+ // so this token always has the same output as `XX`
1112
+ case 'XXXX':
1113
+ case 'XX':
1114
+ // Hours and minutes without `:` delimiter
1115
+ return formatTimezone(timezoneOffset);
1116
+
1117
+ // Hours, minutes and optional seconds with `:` delimiter
1118
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1119
+ // so this token always has the same output as `XXX`
1120
+ case 'XXXXX':
1121
+ case 'XXX': // Hours and minutes with `:` delimiter
1122
+ default:
1123
+ return formatTimezone(timezoneOffset, ':');
1124
+ }
1125
+ },
1126
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1127
+ x: function x(date, token, _localize, options) {
1128
+ var originalDate = options._originalDate || date;
1129
+ var timezoneOffset = originalDate.getTimezoneOffset();
1130
+ switch (token) {
1131
+ // Hours and optional minutes
1132
+ case 'x':
1133
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1134
+
1135
+ // Hours, minutes and optional seconds without `:` delimiter
1136
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1137
+ // so this token always has the same output as `xx`
1138
+ case 'xxxx':
1139
+ case 'xx':
1140
+ // Hours and minutes without `:` delimiter
1141
+ return formatTimezone(timezoneOffset);
1142
+
1143
+ // Hours, minutes and optional seconds with `:` delimiter
1144
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1145
+ // so this token always has the same output as `xxx`
1146
+ case 'xxxxx':
1147
+ case 'xxx': // Hours and minutes with `:` delimiter
1148
+ default:
1149
+ return formatTimezone(timezoneOffset, ':');
1150
+ }
1151
+ },
1152
+ // Timezone (GMT)
1153
+ O: function O(date, token, _localize, options) {
1154
+ var originalDate = options._originalDate || date;
1155
+ var timezoneOffset = originalDate.getTimezoneOffset();
1156
+ switch (token) {
1157
+ // Short
1158
+ case 'O':
1159
+ case 'OO':
1160
+ case 'OOO':
1161
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1162
+ // Long
1163
+ case 'OOOO':
1164
+ default:
1165
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1166
+ }
1167
+ },
1168
+ // Timezone (specific non-location)
1169
+ z: function z(date, token, _localize, options) {
1170
+ var originalDate = options._originalDate || date;
1171
+ var timezoneOffset = originalDate.getTimezoneOffset();
1172
+ switch (token) {
1173
+ // Short
1174
+ case 'z':
1175
+ case 'zz':
1176
+ case 'zzz':
1177
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1178
+ // Long
1179
+ case 'zzzz':
1180
+ default:
1181
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1182
+ }
1183
+ },
1184
+ // Seconds timestamp
1185
+ t: function t(date, token, _localize, options) {
1186
+ var originalDate = options._originalDate || date;
1187
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
1188
+ return addLeadingZeros(timestamp, token.length);
1189
+ },
1190
+ // Milliseconds timestamp
1191
+ T: function T(date, token, _localize, options) {
1192
+ var originalDate = options._originalDate || date;
1193
+ var timestamp = originalDate.getTime();
1194
+ return addLeadingZeros(timestamp, token.length);
1195
+ }
1196
+ };
1197
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1198
+ var sign = offset > 0 ? '-' : '+';
1199
+ var absOffset = Math.abs(offset);
1200
+ var hours = Math.floor(absOffset / 60);
1201
+ var minutes = absOffset % 60;
1202
+ if (minutes === 0) {
1203
+ return sign + String(hours);
1204
+ }
1205
+ var delimiter = dirtyDelimiter || '';
1206
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1207
+ }
1208
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1209
+ if (offset % 60 === 0) {
1210
+ var sign = offset > 0 ? '-' : '+';
1211
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1212
+ }
1213
+ return formatTimezone(offset, dirtyDelimiter);
1214
+ }
1215
+ function formatTimezone(offset, dirtyDelimiter) {
1216
+ var delimiter = dirtyDelimiter || '';
1217
+ var sign = offset > 0 ? '-' : '+';
1218
+ var absOffset = Math.abs(offset);
1219
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1220
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1221
+ return sign + hours + delimiter + minutes;
1222
+ }
1223
+ const formatters$1 = formatters;
1224
+
1225
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1226
+ switch (pattern) {
1227
+ case 'P':
1228
+ return formatLong.date({
1229
+ width: 'short'
1230
+ });
1231
+ case 'PP':
1232
+ return formatLong.date({
1233
+ width: 'medium'
1234
+ });
1235
+ case 'PPP':
1236
+ return formatLong.date({
1237
+ width: 'long'
1238
+ });
1239
+ case 'PPPP':
1240
+ default:
1241
+ return formatLong.date({
1242
+ width: 'full'
1243
+ });
1244
+ }
1245
+ };
1246
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1247
+ switch (pattern) {
1248
+ case 'p':
1249
+ return formatLong.time({
1250
+ width: 'short'
1251
+ });
1252
+ case 'pp':
1253
+ return formatLong.time({
1254
+ width: 'medium'
1255
+ });
1256
+ case 'ppp':
1257
+ return formatLong.time({
1258
+ width: 'long'
1259
+ });
1260
+ case 'pppp':
1261
+ default:
1262
+ return formatLong.time({
1263
+ width: 'full'
1264
+ });
1265
+ }
1266
+ };
1267
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1268
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1269
+ var datePattern = matchResult[1];
1270
+ var timePattern = matchResult[2];
1271
+ if (!timePattern) {
1272
+ return dateLongFormatter(pattern, formatLong);
1273
+ }
1274
+ var dateTimeFormat;
1275
+ switch (datePattern) {
1276
+ case 'P':
1277
+ dateTimeFormat = formatLong.dateTime({
1278
+ width: 'short'
1279
+ });
1280
+ break;
1281
+ case 'PP':
1282
+ dateTimeFormat = formatLong.dateTime({
1283
+ width: 'medium'
1284
+ });
1285
+ break;
1286
+ case 'PPP':
1287
+ dateTimeFormat = formatLong.dateTime({
1288
+ width: 'long'
1289
+ });
1290
+ break;
1291
+ case 'PPPP':
1292
+ default:
1293
+ dateTimeFormat = formatLong.dateTime({
1294
+ width: 'full'
1295
+ });
1296
+ break;
1297
+ }
1298
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1299
+ };
1300
+ var longFormatters = {
1301
+ p: timeLongFormatter,
1302
+ P: dateTimeLongFormatter
1303
+ };
1304
+ const longFormatters$1 = longFormatters;
1305
+
1306
+ var protectedDayOfYearTokens = ['D', 'DD'];
1307
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1308
+ function isProtectedDayOfYearToken(token) {
1309
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1310
+ }
1311
+ function isProtectedWeekYearToken(token) {
1312
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1313
+ }
1314
+ function throwProtectedError(token, format, input) {
1315
+ if (token === 'YYYY') {
1316
+ 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"));
1317
+ } else if (token === 'YY') {
1318
+ 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"));
1319
+ } else if (token === 'D') {
1320
+ 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"));
1321
+ } else if (token === 'DD') {
1322
+ 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"));
1323
+ }
1324
+ }
1325
+
1326
+ var formatDistanceLocale = {
1327
+ lessThanXSeconds: {
1328
+ one: 'less than a second',
1329
+ other: 'less than {{count}} seconds'
1330
+ },
1331
+ xSeconds: {
1332
+ one: '1 second',
1333
+ other: '{{count}} seconds'
1334
+ },
1335
+ halfAMinute: 'half a minute',
1336
+ lessThanXMinutes: {
1337
+ one: 'less than a minute',
1338
+ other: 'less than {{count}} minutes'
1339
+ },
1340
+ xMinutes: {
1341
+ one: '1 minute',
1342
+ other: '{{count}} minutes'
1343
+ },
1344
+ aboutXHours: {
1345
+ one: 'about 1 hour',
1346
+ other: 'about {{count}} hours'
1347
+ },
1348
+ xHours: {
1349
+ one: '1 hour',
1350
+ other: '{{count}} hours'
1351
+ },
1352
+ xDays: {
1353
+ one: '1 day',
1354
+ other: '{{count}} days'
1355
+ },
1356
+ aboutXWeeks: {
1357
+ one: 'about 1 week',
1358
+ other: 'about {{count}} weeks'
1359
+ },
1360
+ xWeeks: {
1361
+ one: '1 week',
1362
+ other: '{{count}} weeks'
1363
+ },
1364
+ aboutXMonths: {
1365
+ one: 'about 1 month',
1366
+ other: 'about {{count}} months'
1367
+ },
1368
+ xMonths: {
1369
+ one: '1 month',
1370
+ other: '{{count}} months'
1371
+ },
1372
+ aboutXYears: {
1373
+ one: 'about 1 year',
1374
+ other: 'about {{count}} years'
1375
+ },
1376
+ xYears: {
1377
+ one: '1 year',
1378
+ other: '{{count}} years'
1379
+ },
1380
+ overXYears: {
1381
+ one: 'over 1 year',
1382
+ other: 'over {{count}} years'
1383
+ },
1384
+ almostXYears: {
1385
+ one: 'almost 1 year',
1386
+ other: 'almost {{count}} years'
1387
+ }
1388
+ };
1389
+ var formatDistance = function formatDistance(token, count, options) {
1390
+ var result;
1391
+ var tokenValue = formatDistanceLocale[token];
1392
+ if (typeof tokenValue === 'string') {
1393
+ result = tokenValue;
1394
+ } else if (count === 1) {
1395
+ result = tokenValue.one;
1396
+ } else {
1397
+ result = tokenValue.other.replace('{{count}}', count.toString());
1398
+ }
1399
+ if (options !== null && options !== void 0 && options.addSuffix) {
1400
+ if (options.comparison && options.comparison > 0) {
1401
+ return 'in ' + result;
1402
+ } else {
1403
+ return result + ' ago';
1404
+ }
1405
+ }
1406
+ return result;
1407
+ };
1408
+ const formatDistance$1 = formatDistance;
1409
+
1410
+ function buildFormatLongFn(args) {
1411
+ return function () {
1412
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1413
+ // TODO: Remove String()
1414
+ var width = options.width ? String(options.width) : args.defaultWidth;
1415
+ var format = args.formats[width] || args.formats[args.defaultWidth];
1416
+ return format;
1417
+ };
1418
+ }
1419
+
1420
+ var dateFormats = {
1421
+ full: 'EEEE, MMMM do, y',
1422
+ long: 'MMMM do, y',
1423
+ medium: 'MMM d, y',
1424
+ short: 'MM/dd/yyyy'
1425
+ };
1426
+ var timeFormats = {
1427
+ full: 'h:mm:ss a zzzz',
1428
+ long: 'h:mm:ss a z',
1429
+ medium: 'h:mm:ss a',
1430
+ short: 'h:mm a'
1431
+ };
1432
+ var dateTimeFormats = {
1433
+ full: "{{date}} 'at' {{time}}",
1434
+ long: "{{date}} 'at' {{time}}",
1435
+ medium: '{{date}}, {{time}}',
1436
+ short: '{{date}}, {{time}}'
1437
+ };
1438
+ var formatLong = {
1439
+ date: buildFormatLongFn({
1440
+ formats: dateFormats,
1441
+ defaultWidth: 'full'
1442
+ }),
1443
+ time: buildFormatLongFn({
1444
+ formats: timeFormats,
1445
+ defaultWidth: 'full'
1446
+ }),
1447
+ dateTime: buildFormatLongFn({
1448
+ formats: dateTimeFormats,
1449
+ defaultWidth: 'full'
1450
+ })
1451
+ };
1452
+ const formatLong$1 = formatLong;
1453
+
1454
+ var formatRelativeLocale = {
1455
+ lastWeek: "'last' eeee 'at' p",
1456
+ yesterday: "'yesterday at' p",
1457
+ today: "'today at' p",
1458
+ tomorrow: "'tomorrow at' p",
1459
+ nextWeek: "eeee 'at' p",
1460
+ other: 'P'
1461
+ };
1462
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1463
+ return formatRelativeLocale[token];
1464
+ };
1465
+ const formatRelative$1 = formatRelative;
1466
+
1467
+ function buildLocalizeFn(args) {
1468
+ return function (dirtyIndex, options) {
1469
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1470
+ var valuesArray;
1471
+ if (context === 'formatting' && args.formattingValues) {
1472
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1473
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1474
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1475
+ } else {
1476
+ var _defaultWidth = args.defaultWidth;
1477
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1478
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
1479
+ }
1480
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1481
+ // @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!
1482
+ return valuesArray[index];
1483
+ };
1484
+ }
1485
+
1486
+ var eraValues = {
1487
+ narrow: ['B', 'A'],
1488
+ abbreviated: ['BC', 'AD'],
1489
+ wide: ['Before Christ', 'Anno Domini']
1490
+ };
1491
+ var quarterValues = {
1492
+ narrow: ['1', '2', '3', '4'],
1493
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1494
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1495
+ };
1496
+
1497
+ // Note: in English, the names of days of the week and months are capitalized.
1498
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1499
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1500
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1501
+ var monthValues = {
1502
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1503
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1504
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1505
+ };
1506
+ var dayValues = {
1507
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1508
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1509
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1510
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1511
+ };
1512
+ var dayPeriodValues = {
1513
+ narrow: {
1514
+ am: 'a',
1515
+ pm: 'p',
1516
+ midnight: 'mi',
1517
+ noon: 'n',
1518
+ morning: 'morning',
1519
+ afternoon: 'afternoon',
1520
+ evening: 'evening',
1521
+ night: 'night'
1522
+ },
1523
+ abbreviated: {
1524
+ am: 'AM',
1525
+ pm: 'PM',
1526
+ midnight: 'midnight',
1527
+ noon: 'noon',
1528
+ morning: 'morning',
1529
+ afternoon: 'afternoon',
1530
+ evening: 'evening',
1531
+ night: 'night'
1532
+ },
1533
+ wide: {
1534
+ am: 'a.m.',
1535
+ pm: 'p.m.',
1536
+ midnight: 'midnight',
1537
+ noon: 'noon',
1538
+ morning: 'morning',
1539
+ afternoon: 'afternoon',
1540
+ evening: 'evening',
1541
+ night: 'night'
1542
+ }
1543
+ };
1544
+ var formattingDayPeriodValues = {
1545
+ narrow: {
1546
+ am: 'a',
1547
+ pm: 'p',
1548
+ midnight: 'mi',
1549
+ noon: 'n',
1550
+ morning: 'in the morning',
1551
+ afternoon: 'in the afternoon',
1552
+ evening: 'in the evening',
1553
+ night: 'at night'
1554
+ },
1555
+ abbreviated: {
1556
+ am: 'AM',
1557
+ pm: 'PM',
1558
+ midnight: 'midnight',
1559
+ noon: 'noon',
1560
+ morning: 'in the morning',
1561
+ afternoon: 'in the afternoon',
1562
+ evening: 'in the evening',
1563
+ night: 'at night'
1564
+ },
1565
+ wide: {
1566
+ am: 'a.m.',
1567
+ pm: 'p.m.',
1568
+ midnight: 'midnight',
1569
+ noon: 'noon',
1570
+ morning: 'in the morning',
1571
+ afternoon: 'in the afternoon',
1572
+ evening: 'in the evening',
1573
+ night: 'at night'
1574
+ }
1575
+ };
1576
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1577
+ var number = Number(dirtyNumber);
1578
+
1579
+ // If ordinal numbers depend on context, for example,
1580
+ // if they are different for different grammatical genders,
1581
+ // use `options.unit`.
1582
+ //
1583
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1584
+ // 'day', 'hour', 'minute', 'second'.
1585
+
1586
+ var rem100 = number % 100;
1587
+ if (rem100 > 20 || rem100 < 10) {
1588
+ switch (rem100 % 10) {
1589
+ case 1:
1590
+ return number + 'st';
1591
+ case 2:
1592
+ return number + 'nd';
1593
+ case 3:
1594
+ return number + 'rd';
1595
+ }
1596
+ }
1597
+ return number + 'th';
1598
+ };
1599
+ var localize = {
1600
+ ordinalNumber: ordinalNumber,
1601
+ era: buildLocalizeFn({
1602
+ values: eraValues,
1603
+ defaultWidth: 'wide'
1604
+ }),
1605
+ quarter: buildLocalizeFn({
1606
+ values: quarterValues,
1607
+ defaultWidth: 'wide',
1608
+ argumentCallback: function argumentCallback(quarter) {
1609
+ return quarter - 1;
1610
+ }
1611
+ }),
1612
+ month: buildLocalizeFn({
1613
+ values: monthValues,
1614
+ defaultWidth: 'wide'
1615
+ }),
1616
+ day: buildLocalizeFn({
1617
+ values: dayValues,
1618
+ defaultWidth: 'wide'
1619
+ }),
1620
+ dayPeriod: buildLocalizeFn({
1621
+ values: dayPeriodValues,
1622
+ defaultWidth: 'wide',
1623
+ formattingValues: formattingDayPeriodValues,
1624
+ defaultFormattingWidth: 'wide'
1625
+ })
1626
+ };
1627
+ const localize$1 = localize;
1628
+
1629
+ function buildMatchFn(args) {
1630
+ return function (string) {
1631
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1632
+ var width = options.width;
1633
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1634
+ var matchResult = string.match(matchPattern);
1635
+ if (!matchResult) {
1636
+ return null;
1637
+ }
1638
+ var matchedString = matchResult[0];
1639
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1640
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
1641
+ return pattern.test(matchedString);
1642
+ }) : findKey(parsePatterns, function (pattern) {
1643
+ return pattern.test(matchedString);
1644
+ });
1645
+ var value;
1646
+ value = args.valueCallback ? args.valueCallback(key) : key;
1647
+ value = options.valueCallback ? options.valueCallback(value) : value;
1648
+ var rest = string.slice(matchedString.length);
1649
+ return {
1650
+ value: value,
1651
+ rest: rest
1652
+ };
1653
+ };
1654
+ }
1655
+ function findKey(object, predicate) {
1656
+ for (var key in object) {
1657
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
1658
+ return key;
1659
+ }
1660
+ }
1661
+ return undefined;
1662
+ }
1663
+ function findIndex(array, predicate) {
1664
+ for (var key = 0; key < array.length; key++) {
1665
+ if (predicate(array[key])) {
1666
+ return key;
1667
+ }
1668
+ }
1669
+ return undefined;
1670
+ }
1671
+
1672
+ function buildMatchPatternFn(args) {
1673
+ return function (string) {
1674
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1675
+ var matchResult = string.match(args.matchPattern);
1676
+ if (!matchResult) return null;
1677
+ var matchedString = matchResult[0];
1678
+ var parseResult = string.match(args.parsePattern);
1679
+ if (!parseResult) return null;
1680
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1681
+ value = options.valueCallback ? options.valueCallback(value) : value;
1682
+ var rest = string.slice(matchedString.length);
1683
+ return {
1684
+ value: value,
1685
+ rest: rest
1686
+ };
1687
+ };
1688
+ }
1689
+
1690
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1691
+ var parseOrdinalNumberPattern = /\d+/i;
1692
+ var matchEraPatterns = {
1693
+ narrow: /^(b|a)/i,
1694
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1695
+ wide: /^(before christ|before common era|anno domini|common era)/i
1696
+ };
1697
+ var parseEraPatterns = {
1698
+ any: [/^b/i, /^(a|c)/i]
1699
+ };
1700
+ var matchQuarterPatterns = {
1701
+ narrow: /^[1234]/i,
1702
+ abbreviated: /^q[1234]/i,
1703
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1704
+ };
1705
+ var parseQuarterPatterns = {
1706
+ any: [/1/i, /2/i, /3/i, /4/i]
1707
+ };
1708
+ var matchMonthPatterns = {
1709
+ narrow: /^[jfmasond]/i,
1710
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1711
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1712
+ };
1713
+ var parseMonthPatterns = {
1714
+ 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],
1715
+ 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]
1716
+ };
1717
+ var matchDayPatterns = {
1718
+ narrow: /^[smtwf]/i,
1719
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1720
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1721
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1722
+ };
1723
+ var parseDayPatterns = {
1724
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1725
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1726
+ };
1727
+ var matchDayPeriodPatterns = {
1728
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1729
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1730
+ };
1731
+ var parseDayPeriodPatterns = {
1732
+ any: {
1733
+ am: /^a/i,
1734
+ pm: /^p/i,
1735
+ midnight: /^mi/i,
1736
+ noon: /^no/i,
1737
+ morning: /morning/i,
1738
+ afternoon: /afternoon/i,
1739
+ evening: /evening/i,
1740
+ night: /night/i
1741
+ }
1742
+ };
1743
+ var match = {
1744
+ ordinalNumber: buildMatchPatternFn({
1745
+ matchPattern: matchOrdinalNumberPattern,
1746
+ parsePattern: parseOrdinalNumberPattern,
1747
+ valueCallback: function valueCallback(value) {
1748
+ return parseInt(value, 10);
1749
+ }
1750
+ }),
1751
+ era: buildMatchFn({
1752
+ matchPatterns: matchEraPatterns,
1753
+ defaultMatchWidth: 'wide',
1754
+ parsePatterns: parseEraPatterns,
1755
+ defaultParseWidth: 'any'
1756
+ }),
1757
+ quarter: buildMatchFn({
1758
+ matchPatterns: matchQuarterPatterns,
1759
+ defaultMatchWidth: 'wide',
1760
+ parsePatterns: parseQuarterPatterns,
1761
+ defaultParseWidth: 'any',
1762
+ valueCallback: function valueCallback(index) {
1763
+ return index + 1;
1764
+ }
1765
+ }),
1766
+ month: buildMatchFn({
1767
+ matchPatterns: matchMonthPatterns,
1768
+ defaultMatchWidth: 'wide',
1769
+ parsePatterns: parseMonthPatterns,
1770
+ defaultParseWidth: 'any'
1771
+ }),
1772
+ day: buildMatchFn({
1773
+ matchPatterns: matchDayPatterns,
1774
+ defaultMatchWidth: 'wide',
1775
+ parsePatterns: parseDayPatterns,
1776
+ defaultParseWidth: 'any'
1777
+ }),
1778
+ dayPeriod: buildMatchFn({
1779
+ matchPatterns: matchDayPeriodPatterns,
1780
+ defaultMatchWidth: 'any',
1781
+ parsePatterns: parseDayPeriodPatterns,
1782
+ defaultParseWidth: 'any'
1783
+ })
1784
+ };
1785
+ const match$1 = match;
1786
+
1787
+ /**
1788
+ * @type {Locale}
1789
+ * @category Locales
1790
+ * @summary English locale (United States).
1791
+ * @language English
1792
+ * @iso-639-2 eng
1793
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
1794
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
1795
+ */
1796
+ var locale = {
1797
+ code: 'en-US',
1798
+ formatDistance: formatDistance$1,
1799
+ formatLong: formatLong$1,
1800
+ formatRelative: formatRelative$1,
1801
+ localize: localize$1,
1802
+ match: match$1,
1803
+ options: {
1804
+ weekStartsOn: 0 /* Sunday */,
1805
+ firstWeekContainsDate: 1
1806
+ }
1807
+ };
1808
+ const defaultLocale = locale;
1809
+
1810
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
1811
+ // (one of the certain letters followed by `o`)
1812
+ // - (\w)\1* matches any sequences of the same letter
1813
+ // - '' matches two quote characters in a row
1814
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
1815
+ // except a single quote symbol, which ends the sequence.
1816
+ // Two quote characters do not end the sequence.
1817
+ // If there is no matching single quote
1818
+ // then the sequence will continue until the end of the string.
1819
+ // - . matches any single character unmatched by previous parts of the RegExps
1820
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1821
+
1822
+ // This RegExp catches symbols escaped by quotes, and also
1823
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
1824
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1825
+ var escapedStringRegExp = /^'([^]*?)'?$/;
1826
+ var doubleQuoteRegExp = /''/g;
1827
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1828
+
1829
+ /**
1830
+ * @name format
1831
+ * @category Common Helpers
1832
+ * @summary Format the date.
1833
+ *
1834
+ * @description
1835
+ * Return the formatted date string in the given format. The result may vary by locale.
1836
+ *
1837
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1838
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
1839
+ *
1840
+ * The characters wrapped between two single quotes characters (') are escaped.
1841
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1842
+ * (see the last example)
1843
+ *
1844
+ * Format of the string is based on Unicode Technical Standard #35:
1845
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1846
+ * with a few additions (see note 7 below the table).
1847
+ *
1848
+ * Accepted patterns:
1849
+ * | Unit | Pattern | Result examples | Notes |
1850
+ * |---------------------------------|---------|-----------------------------------|-------|
1851
+ * | Era | G..GGG | AD, BC | |
1852
+ * | | GGGG | Anno Domini, Before Christ | 2 |
1853
+ * | | GGGGG | A, B | |
1854
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
1855
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
1856
+ * | | yy | 44, 01, 00, 17 | 5 |
1857
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
1858
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
1859
+ * | | yyyyy | ... | 3,5 |
1860
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
1861
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
1862
+ * | | YY | 44, 01, 00, 17 | 5,8 |
1863
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
1864
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
1865
+ * | | YYYYY | ... | 3,5 |
1866
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
1867
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
1868
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
1869
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
1870
+ * | | RRRRR | ... | 3,5,7 |
1871
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
1872
+ * | | uu | -43, 01, 1900, 2017 | 5 |
1873
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
1874
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
1875
+ * | | uuuuu | ... | 3,5 |
1876
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
1877
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
1878
+ * | | QQ | 01, 02, 03, 04 | |
1879
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
1880
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
1881
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
1882
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
1883
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
1884
+ * | | qq | 01, 02, 03, 04 | |
1885
+ * | | qqq | Q1, Q2, Q3, Q4 | |
1886
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
1887
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
1888
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
1889
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
1890
+ * | | MM | 01, 02, ..., 12 | |
1891
+ * | | MMM | Jan, Feb, ..., Dec | |
1892
+ * | | MMMM | January, February, ..., December | 2 |
1893
+ * | | MMMMM | J, F, ..., D | |
1894
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
1895
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
1896
+ * | | LL | 01, 02, ..., 12 | |
1897
+ * | | LLL | Jan, Feb, ..., Dec | |
1898
+ * | | LLLL | January, February, ..., December | 2 |
1899
+ * | | LLLLL | J, F, ..., D | |
1900
+ * | Local week of year | w | 1, 2, ..., 53 | |
1901
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
1902
+ * | | ww | 01, 02, ..., 53 | |
1903
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
1904
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
1905
+ * | | II | 01, 02, ..., 53 | 7 |
1906
+ * | Day of month | d | 1, 2, ..., 31 | |
1907
+ * | | do | 1st, 2nd, ..., 31st | 7 |
1908
+ * | | dd | 01, 02, ..., 31 | |
1909
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
1910
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
1911
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
1912
+ * | | DDD | 001, 002, ..., 365, 366 | |
1913
+ * | | DDDD | ... | 3 |
1914
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
1915
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
1916
+ * | | EEEEE | M, T, W, T, F, S, S | |
1917
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
1918
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
1919
+ * | | io | 1st, 2nd, ..., 7th | 7 |
1920
+ * | | ii | 01, 02, ..., 07 | 7 |
1921
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
1922
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
1923
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
1924
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
1925
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
1926
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
1927
+ * | | ee | 02, 03, ..., 01 | |
1928
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
1929
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
1930
+ * | | eeeee | M, T, W, T, F, S, S | |
1931
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
1932
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
1933
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
1934
+ * | | cc | 02, 03, ..., 01 | |
1935
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
1936
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
1937
+ * | | ccccc | M, T, W, T, F, S, S | |
1938
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
1939
+ * | AM, PM | a..aa | AM, PM | |
1940
+ * | | aaa | am, pm | |
1941
+ * | | aaaa | a.m., p.m. | 2 |
1942
+ * | | aaaaa | a, p | |
1943
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
1944
+ * | | bbb | am, pm, noon, midnight | |
1945
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
1946
+ * | | bbbbb | a, p, n, mi | |
1947
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
1948
+ * | | BBBB | at night, in the morning, ... | 2 |
1949
+ * | | BBBBB | at night, in the morning, ... | |
1950
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
1951
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
1952
+ * | | hh | 01, 02, ..., 11, 12 | |
1953
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
1954
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
1955
+ * | | HH | 00, 01, 02, ..., 23 | |
1956
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
1957
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
1958
+ * | | KK | 01, 02, ..., 11, 00 | |
1959
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
1960
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
1961
+ * | | kk | 24, 01, 02, ..., 23 | |
1962
+ * | Minute | m | 0, 1, ..., 59 | |
1963
+ * | | mo | 0th, 1st, ..., 59th | 7 |
1964
+ * | | mm | 00, 01, ..., 59 | |
1965
+ * | Second | s | 0, 1, ..., 59 | |
1966
+ * | | so | 0th, 1st, ..., 59th | 7 |
1967
+ * | | ss | 00, 01, ..., 59 | |
1968
+ * | Fraction of second | S | 0, 1, ..., 9 | |
1969
+ * | | SS | 00, 01, ..., 99 | |
1970
+ * | | SSS | 000, 001, ..., 999 | |
1971
+ * | | SSSS | ... | 3 |
1972
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
1973
+ * | | XX | -0800, +0530, Z | |
1974
+ * | | XXX | -08:00, +05:30, Z | |
1975
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
1976
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
1977
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
1978
+ * | | xx | -0800, +0530, +0000 | |
1979
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
1980
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
1981
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
1982
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
1983
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
1984
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
1985
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
1986
+ * | Seconds timestamp | t | 512969520 | 7 |
1987
+ * | | tt | ... | 3,7 |
1988
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
1989
+ * | | TT | ... | 3,7 |
1990
+ * | Long localized date | P | 04/29/1453 | 7 |
1991
+ * | | PP | Apr 29, 1453 | 7 |
1992
+ * | | PPP | April 29th, 1453 | 7 |
1993
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
1994
+ * | Long localized time | p | 12:00 AM | 7 |
1995
+ * | | pp | 12:00:00 AM | 7 |
1996
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
1997
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
1998
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
1999
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2000
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2001
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2002
+ * Notes:
2003
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2004
+ * are the same as "stand-alone" units, but are different in some languages.
2005
+ * "Formatting" units are declined according to the rules of the language
2006
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2007
+ *
2008
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2009
+ *
2010
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2011
+ *
2012
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2013
+ * the single quote characters (see below).
2014
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2015
+ * the output will be the same as default pattern for this unit, usually
2016
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2017
+ * are marked with "2" in the last column of the table.
2018
+ *
2019
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2020
+ *
2021
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2022
+ *
2023
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2024
+ *
2025
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2026
+ *
2027
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2028
+ *
2029
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2030
+ * The output will be padded with zeros to match the length of the pattern.
2031
+ *
2032
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2033
+ *
2034
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2035
+ * These tokens represent the shortest form of the quarter.
2036
+ *
2037
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2038
+ *
2039
+ * | Year | `y` | `u` |
2040
+ * |------|-----|-----|
2041
+ * | AC 1 | 1 | 1 |
2042
+ * | BC 1 | 1 | 0 |
2043
+ * | BC 2 | 2 | -1 |
2044
+ *
2045
+ * Also `yy` always returns the last two digits of a year,
2046
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2047
+ *
2048
+ * | Year | `yy` | `uu` |
2049
+ * |------|------|------|
2050
+ * | 1 | 01 | 01 |
2051
+ * | 14 | 14 | 14 |
2052
+ * | 376 | 76 | 376 |
2053
+ * | 1453 | 53 | 1453 |
2054
+ *
2055
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2056
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2057
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2058
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2059
+ *
2060
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2061
+ * so right now these tokens fall back to GMT timezones.
2062
+ *
2063
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2064
+ * - `i`: ISO day of week
2065
+ * - `I`: ISO week of year
2066
+ * - `R`: ISO week-numbering year
2067
+ * - `t`: seconds timestamp
2068
+ * - `T`: milliseconds timestamp
2069
+ * - `o`: ordinal number modifier
2070
+ * - `P`: long localized date
2071
+ * - `p`: long localized time
2072
+ *
2073
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2074
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2075
+ *
2076
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2077
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2078
+ *
2079
+ * @param {Date|Number} date - the original date
2080
+ * @param {String} format - the string of tokens
2081
+ * @param {Object} [options] - an object with options.
2082
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2083
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2084
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2085
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2086
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2087
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2088
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2089
+ * @returns {String} the formatted date string
2090
+ * @throws {TypeError} 2 arguments required
2091
+ * @throws {RangeError} `date` must not be Invalid Date
2092
+ * @throws {RangeError} `options.locale` must contain `localize` property
2093
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2094
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2095
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2096
+ * @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
2097
+ * @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
2098
+ * @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
2099
+ * @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
2100
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2101
+ *
2102
+ * @example
2103
+ * // Represent 11 February 2014 in middle-endian format:
2104
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2105
+ * //=> '02/11/2014'
2106
+ *
2107
+ * @example
2108
+ * // Represent 2 July 2014 in Esperanto:
2109
+ * import { eoLocale } from 'date-fns/locale/eo'
2110
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2111
+ * locale: eoLocale
2112
+ * })
2113
+ * //=> '2-a de julio 2014'
2114
+ *
2115
+ * @example
2116
+ * // Escape string by single quote characters:
2117
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2118
+ * //=> "3 o'clock"
2119
+ */
2120
+
2121
+ function format(dirtyDate, dirtyFormatStr, options) {
2122
+ 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;
2123
+ requiredArgs(2, arguments);
2124
+ var formatStr = String(dirtyFormatStr);
2125
+ var defaultOptions = getDefaultOptions();
2126
+ var locale = (_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 : defaultLocale;
2127
+ 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);
2128
+
2129
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2130
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2131
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2132
+ }
2133
+ 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);
2134
+
2135
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2136
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2137
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2138
+ }
2139
+ if (!locale.localize) {
2140
+ throw new RangeError('locale must contain localize property');
2141
+ }
2142
+ if (!locale.formatLong) {
2143
+ throw new RangeError('locale must contain formatLong property');
2144
+ }
2145
+ var originalDate = toDate(dirtyDate);
2146
+ if (!isValid(originalDate)) {
2147
+ throw new RangeError('Invalid time value');
2148
+ }
2149
+
2150
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2151
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2152
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2153
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2154
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2155
+ var formatterOptions = {
2156
+ firstWeekContainsDate: firstWeekContainsDate,
2157
+ weekStartsOn: weekStartsOn,
2158
+ locale: locale,
2159
+ _originalDate: originalDate
2160
+ };
2161
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2162
+ var firstCharacter = substring[0];
2163
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2164
+ var longFormatter = longFormatters$1[firstCharacter];
2165
+ return longFormatter(substring, locale.formatLong);
2166
+ }
2167
+ return substring;
2168
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2169
+ // Replace two single quote characters with one single quote character
2170
+ if (substring === "''") {
2171
+ return "'";
2172
+ }
2173
+ var firstCharacter = substring[0];
2174
+ if (firstCharacter === "'") {
2175
+ return cleanEscapedString(substring);
2176
+ }
2177
+ var formatter = formatters$1[firstCharacter];
2178
+ if (formatter) {
2179
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2180
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2181
+ }
2182
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2183
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2184
+ }
2185
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2186
+ }
2187
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2188
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2189
+ }
2190
+ return substring;
2191
+ }).join('');
2192
+ return result;
2193
+ }
2194
+ function cleanEscapedString(input) {
2195
+ var matched = input.match(escapedStringRegExp);
2196
+ if (!matched) {
2197
+ return input;
2198
+ }
2199
+ return matched[1].replace(doubleQuoteRegExp, "'");
2200
+ }
2201
+
2202
+ const LoyaltyProgress = `<svg width="100%" height="28" style="opacity: 0" fill="none" xmlns="http://www.w3.org/2000/svg">
2203
+ <rect y="12" x="2" width="100%" id="total_level" height="5" rx="2.5" fill="white" fill-opacity="0.5"/>
2204
+ <rect y="12" x="2" id="current_level" width="64" height="5" rx="2.5" fill="white"/>
2205
+ <g filter="url(#filter_current_level)">
2206
+ <circle id="circle_current_level" cx="74.5" cy="14.5" r="6.5" fill="white"/>
2207
+ </g>
2208
+ <g filter="url(#filter_heart_ball)">
2209
+ <g filter="url(#filter_ball)">
2210
+ <circle cx="169" cy="14" r="10" id="lock" fill="url(#paint0_linear_ball)"/>
2211
+ </g>
2212
+ <g filter="url(#filter_heart)">
2213
+ <svg x="0" y="4" id="lock_box">
2214
+ <path d="M10.217 6.42442c-0.713,-0.574,-1.304,-1.083,-1.928,-1.622c-0.348,-0.299,-0.707,-0.611,-1.101,-0.943l-0.013,-0.01c0,0,-0.023,-0.017,-0.04,-0.027l-0.167,-0.095l-0.15,0.12c0,0,-0.015,0.012,-0.024,0.02c-0.391,0.33,-0.749,0.64,-1.094,0.939c-0.622,0.539,-1.211,1.048,-1.924,1.624c-1.816,1.463,-3.598,3.263,-3.033,5.506c0.404,1.601,2.104,2.905,3.789,2.905c0.211,0,0.423,-0.02,0.626,-0.061c0.286,-0.058,0.572,-0.145,0.864,-0.265c-0.079,0.962,-0.413,1.864,-0.881,2.369l-0.423,0.459h0.633c0.633,0,1.018,-0.007,1.356,-0.013c0.248,-0.004,0.462,-0.008,0.72,-0.008c0.335,0,0.709,0.006,1.215,0.021l0.686,0.02l-0.474,-0.483c-0.504,-0.514,-0.847,-1.403,-0.923,-2.385c0.311,0.132,0.616,0.227,0.916,0.287c0.204,0.039,0.411,0.059,0.623,0.059c1.687,0,3.386,-1.304,3.789,-2.909c0.56,-2.243,-1.224,-4.041,-3.042,-5.504v-0.004z" fill="#933CBF"/>
2215
+ <path d="M9.727,6.98459c-1.004,-0.83,-1.741,-1.515,-2.723,-2.365c-0.002,0,-0.004,-0.004,-0.007,-0.006c-0.002,0,-0.004,0.004,-0.006,0.006c-0.98,0.85,-1.715,1.537,-2.721,2.367c-1.455,1.202,-3.126,2.821,-2.638,4.81c0.37,1.511,2.091,2.751,3.665,2.43c0.389,-0.08,0.75,-0.224,1.094,-0.402c0,0.116,-0.004,0.233,-0.012,0.353c-0.064,0.991,-0.398,1.892,-0.86,2.401c1.481,0,1.481,-0.043,2.961,0c-0.481,-0.503,-0.834,-1.382,-0.9,-2.401c-0.008,-0.127,-0.012,-0.253,-0.012,-0.378c0.357,0.19,0.733,0.342,1.14,0.425c1.574,0.319,3.292,-0.922,3.661,-2.433c0.486,-1.992,-1.189,-3.609,-2.644,
2216
+ -4.809l0.002,0.002z" fill="url(#paint1_linear_lock)"/>
2217
+ <path d="M9.255,7.551c-0.844,-0.716,-1.462,-1.309,-2.286,-2.045c-0.002,0,-0.004,-0.004,-0.006,-0.006c0,0,-0.004,0.004,-0.006,0.006c-0.824,0.736,-1.44,1.329,-2.284,2.047c-0.919,0.782,-1.94,1.769,-2.214,2.943c-0.115,0.021,-0.914,0.044,-0.914,0.044l0.887,0.083c-0.039,0.206,-0.055,0.418,-0.041,0.638c0.087,-1.371,1.25,-2.507,2.282,-3.384c0.844,-0.718,1.462,-1.313,2.284,-2.047c0.002,-0.002,0.004,-0.004,0.006,-0.006c0.002,0,0.004,0.004,0.006,0.004c0.824,0.734,1.442,1.329,2.286,2.045c1.034,0.879,2.198,2.013,2.286,3.386c0.093,-1.517,-1.173,-2.761,-2.286,-3.708z" fill="#9040C9"/>
2218
+ </svg>
2219
+ </g>
2220
+ </g>
2221
+ <g filter="url(#filter_lock)">
2222
+ <svg x="100%" y="9" id="heart_box">
2223
+ <path d="M7,6c-0.19,-0.002,-0.377,0.052,-0.534,0.154c-0.158,0.103,-0.278,0.25,-0.346,0.42c-0.069,0.171,-0.081,0.357,-0.035,0.535c0.046,0.177,0.147,0.337,0.29,0.457v0.834c0,0.159,0.066,0.312,0.183,0.424c0.117,0.113,0.276,0.176,0.442,0.176c0.166,0,0.325,-0.063,0.442,-0.176c0.117,-0.112,0.183,-0.265,0.183,-0.424v-0.834c0.143,-0.12,0.244,-0.28,0.29,-0.457c0.046,-0.178,0.034,-0.364,-0.035,-0.535c-0.068,-0.17,-0.188,-0.317,-0.346,-0.42c-0.157,-0.102,-0.344,-0.156,-0.534,-0.154zm3.125,-2.4v-1.2c0,-0.796,-0.329,-1.559,-0.915,-2.121c-0.586,-0.563,-1.381,-0.879,-2.21,-0.879c-0.829,0,-1.624,0.316,-2.21,0.879c-0.586,0.562,-0.915,1.325,-0.915,2.121v1.2c-0.497,0,-0.974,0.19,-1.326,0.527c-0.351,0.338,-0.549,0.796,-0.549,1.273v4.2c0,0.477,0.198,0.935,0.549,1.273c0.352,0.337,0.829,0.527,1.326,0.527h6.25c0.497,0,0.974,-0.19,1.326,-0.527c0.351,-0.338,0.549,-0.796,0.549,-1.273v-4.2c0,-0.477,-0.198,-0.935,-0.549,-1.273c-0.352,-0.337,-0.829,-0.527,-1.326,-0.527zm-5,-1.2c0,-0.477,0.198,-0.935,0.549,-1.273c0.352,-0.337,0.829,-0.527,1.326,-0.527c0.497,0,0.974,0.19,1.326,0.527c0.351,0.338,0.549,0.796,0.549,1.273v1.2h-3.75v-1.2zm5.625,7.2c0,0.159,-0.066,0.312,-0.183,0.424c-0.117,0.113,-0.276,0.176,-0.442,0.176h-6.25c-0.166,0,-0.325,-0.063,-0.442,-0.176c-0.117,-0.112,-0.183,-0.265,-0.183,-0.424v-4.2c0,-0.159,0.066,-0.312,0.183,-0.424c0.117,-0.113,0.276,-0.176,0.442,-0.176h6.25c0.166,0,0.325,0.063,0.442,0.176c0.117,0.112,0.183,0.265,0.183,0.424v4.2z" fill="white"/>
2224
+ </svg>
2225
+ </g>
2226
+ <defs>
2227
+ <filter id="filter_current_level" x="64" y="4" width="21" height="21" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
2228
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2229
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
2230
+ <feGaussianBlur stdDeviation="2" result="effect1_foregroundBlur_305_23"/>
2231
+ </filter>
2232
+ <filter id="filter_heart_ball" x="155" y="0" width="28" height="28" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
2233
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2234
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
2235
+ <feOffset/>
2236
+ <feGaussianBlur stdDeviation="2"/>
2237
+ <feComposite in2="hardAlpha" operator="out"/>
2238
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
2239
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_305_23"/>
2240
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_305_23" result="shape"/>
2241
+ </filter>
2242
+ <filter id="filter_ball" x="159" y="4" width="20" height="21" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
2243
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2244
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
2245
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
2246
+ <feOffset dy="1"/>
2247
+ <feGaussianBlur stdDeviation="1"/>
2248
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
2249
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0"/>
2250
+ <feBlend mode="normal" in2="shape" result="effect1_innerShadow_305_23"/>
2251
+ </filter>
2252
+ <filter id="filter_heart" x="161.636" y="5.72727" width="14.7271" height="15.6364" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
2253
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2254
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
2255
+ <feOffset/>
2256
+ <feGaussianBlur stdDeviation="0.5"/>
2257
+ <feComposite in2="hardAlpha" operator="out"/>
2258
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
2259
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_305_23"/>
2260
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_305_23" result="shape"/>
2261
+ </filter>
2262
+ <filter id="filter_lock" x="50" y="7" width="12" height="14" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
2263
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2264
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
2265
+ <feOffset/>
2266
+ <feGaussianBlur stdDeviation="0.5"/>
2267
+ <feComposite in2="hardAlpha" operator="out"/>
2268
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
2269
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_305_23"/>
2270
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_305_23" result="shape"/>
2271
+ </filter>
2272
+ <linearGradient id="paint0_linear_ball" x1="163" y1="6" x2="174.2" y2="22.6" gradientUnits="userSpaceOnUse">
2273
+ <stop stop-color="#946AD7"/>
2274
+ <stop offset="1" stop-color="#EFABEB"/>
2275
+ </linearGradient>
2276
+ <linearGradient id="paint1_linear_lock" x1="100%" y1="18.4056" x2="169.002" y2="10.2845" gradientUnits="userSpaceOnUse">
2277
+ <stop stop-color="#814FD6"/>
2278
+ <stop offset="1" stop-color="#D679D8"/>
2279
+ </linearGradient>
2280
+ </defs>
2281
+ </svg>
2282
+ `;
2283
+
2284
+ const TipsInfo = `<svg width="126" height="92" viewBox="0 0 126 92" fill="none" xmlns="http://www.w3.org/2000/svg">
2285
+ <g filter="url(#filter0_d_242_4231)">
2286
+ <rect x="24" y="20" width="78" height="36" rx="4" fill="white"/>
2287
+ <path d="M24 24C24 21.7909 25.7909 20 28 20H64V56H28C25.7909 56 24 54.2091 24 52V24Z" fill="#464646"/>
2288
+ <path d="M51 56H37L43.2474 63.1399C43.6458 63.5952 44.3542 63.5952 44.7526 63.1399L51 56Z" fill="#464646"/>
2289
+ <circle cx="44" cy="38" r="7" fill="white"/>
2290
+ <path d="M43.9405 34C44.5456 34 45.0362 34.4906 45.0362 35.0957C45.0362 35.7009 44.5456 36.1915 43.9405 36.1915C43.3353 36.1915 42.8447 35.7009 42.8447 35.0957C42.8447 34.4906 43.3353 34 43.9405 34Z" fill="#464646"/>
2291
+ <path d="M45.8801 41.3737C45.8801 41.7617 45.5626 42.0791 45.1746 42.0791H44.3233H43.551H42.7055C42.3175 42.0791 42 41.7617 42 41.3737V41.3575C42 40.9695 42.3175 40.6521 42.7055 40.6521H42.8455V37.8714H42.3528C42.1588 37.8714 42 37.7127 42 37.5187V37.4936C42 37.2996 42.1588 37.1409 42.3528 37.1409H43.551H44.031H44.3233C44.7113 37.1409 45.0287 37.4583 45.0287 37.8463V40.6521H45.1746C45.5626 40.6521 45.8801 40.9696 45.8801 41.3576V41.3737Z" fill="#464646"/>
2292
+ </g>
2293
+ <defs>
2294
+ <filter id="filter0_d_242_4231" x="0" y="0" width="126" height="91.4814" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
2295
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2296
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
2297
+ <feOffset dy="4"/>
2298
+ <feGaussianBlur stdDeviation="12"/>
2299
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
2300
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_242_4231"/>
2301
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_242_4231" result="shape"/>
2302
+ </filter>
2303
+ </defs>
2304
+ </svg>
2305
+ `;
2306
+
2307
+ const PlayerLoyaltyProcess = () => (index.h("span", { class: "LevelProgress", id: 'LevelProgress', innerHTML: LoyaltyProgress }));
2308
+ const PlayerPoints = ({ loyaltyPoints, spendablePoints, pointExpireString, language, }) => (index.h("div", { class: "PointsInfo" }, (loyaltyPoints && loyaltyPoints >= 0) &&
2309
+ index.h("div", { class: 'Points' }, loyaltyPoints, " ", index.h("sub", { class: "XP" }, locale_utils.translate('xp', language))), spendablePoints &&
2310
+ index.h("div", { class: 'Points' }, spendablePoints, " ", index.h("sub", { class: "XP" }, locale_utils.translate('sp', language))), pointExpireString && (index.h("div", { class: 'ExpirationPoints' }, pointExpireString, " "))));
2311
+ const PlayerElevateCardRedeem = ({ language, onRedeemClick }) => (index.h("div", { class: "CardCell Redeem" }, index.h("div", { class: "RedeemButton", onClick: () => {
2312
+ onRedeemClick();
2313
+ } }, index.h("span", null, locale_utils.translate('redeem', language)))));
2314
+ const PlayerNameDiv = (props) => (index.h("div", { class: 'CardCell PlayerName Txt' }, props.playerName));
2315
+ const PlayerElevateLoyaltyLevel = (props) => (index.h("div", { class: 'CardCell ElevateLevel' }, index.h("span", { class: "LevelName", title: props.level }, props.level), props.expireTime && (index.h("div", { class: "CardCell ExpirationDate Txt" }, locale_utils.translate('expireOn', props.language), index.h("span", { class: "ExpireTime" }, format(new Date(props.expireTime), props.dateFormat || 'yyyy-MM-dd')), !props.hideInfo && (index.h("span", { class: "fa Info", style: { 'background': `url(${index.getAssetPath('../static/info.svg')})` } }, index.h("span", { class: "InfoTips", innerHTML: TipsInfo })))))));
2316
+ const LoyaltyLevelExpireDay = (props) => (index.h("div", { class: 'CardCell ElevateLevel Expire' }, index.h("div", { class: "CardCell ExpirationDate Txt" }, locale_utils.translate('expireOn', props.language), index.h("span", { class: "ExpireTime" }, format(new Date(props.expireTime), props.dateFormat || 'yyyy-MM-dd')))));
2317
+ const PlayerAvatar = (props) => {
2318
+ const badge = props.loyaltyIconUrl
2319
+ ? index.h("img", { class: "Badge", src: props.loyaltyIconUrl })
2320
+ : props.hideIfNull ? '' : index.h("div", { class: "Badge" });
2321
+ const avatarSrc = props.playerAvatarUrl || index.getAssetPath('../static/user.svg');
2322
+ return index.h("div", { class: "PlayerAvatar", style: { 'position': `${props.onlyBadge ? '' : 'relative'}` } }, !props.onlyBadge && index.h("img", { class: "Avatar", src: avatarSrc }), badge);
2323
+ };
2324
+
2325
+ exports.LoyaltyLevelExpireDay = LoyaltyLevelExpireDay;
2326
+ exports.PlayerAvatar = PlayerAvatar;
2327
+ exports.PlayerElevateCardRedeem = PlayerElevateCardRedeem;
2328
+ exports.PlayerElevateLoyaltyLevel = PlayerElevateLoyaltyLevel;
2329
+ exports.PlayerLoyaltyProcess = PlayerLoyaltyProcess;
2330
+ exports.PlayerNameDiv = PlayerNameDiv;
2331
+ exports.PlayerPoints = PlayerPoints;
2332
+ exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
2333
+ exports.requiredArgs = requiredArgs;
2334
+ exports.toDate = toDate;