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