@abgov/react-components 6.10.0-next.1 → 6.11.0-dev.1

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 (84) hide show
  1. package/experimental/badge/badge.d.ts +33 -0
  2. package/experimental/button/button.d.ts +43 -0
  3. package/experimental/calendar/calendar.d.ts +30 -0
  4. package/experimental/callout/callout.d.ts +33 -0
  5. package/experimental/checkbox/checkbox.d.ts +52 -0
  6. package/experimental/date-picker/date-picker.d.ts +43 -0
  7. package/experimental/drawer/drawer.d.ts +31 -0
  8. package/experimental/dropdown/dropdown-item.d.ts +26 -0
  9. package/experimental/dropdown/dropdown.d.ts +62 -0
  10. package/experimental/file-upload-card/file-upload-card.d.ts +32 -0
  11. package/experimental/file-upload-input/file-upload-input.d.ts +27 -0
  12. package/experimental/filter-chip/filter-chip.d.ts +31 -0
  13. package/experimental/footer/footer.d.ts +24 -0
  14. package/experimental/footer-meta-section/footer-meta-section.d.ts +18 -0
  15. package/experimental/footer-nav-section/footer-nav-section.d.ts +22 -0
  16. package/experimental/form-item/form-item.d.ts +46 -0
  17. package/experimental/index.d.ts +30 -2
  18. package/experimental/input/input.d.ts +124 -0
  19. package/experimental/link/link.d.ts +32 -0
  20. package/experimental/modal/modal.d.ts +44 -0
  21. package/experimental/notification/notification.d.ts +31 -0
  22. package/experimental/pagination/pagination.d.ts +29 -0
  23. package/experimental/radio-group/radio-group.d.ts +40 -0
  24. package/experimental/radio-group/radio.d.ts +42 -0
  25. package/experimental/side-menu/side-menu.d.ts +19 -0
  26. package/experimental/side-menu-group/side-menu-group.d.ts +24 -0
  27. package/experimental/side-menu-heading/side-menu-heading.d.ts +23 -0
  28. package/experimental/table/table-sort-header.d.ts +20 -0
  29. package/experimental/table/table.d.ts +30 -0
  30. package/experimental/tabs/tabs.d.ts +27 -0
  31. package/experimental/textarea/textarea.d.ts +53 -0
  32. package/experimental/work-side-menu-group/work-side-menu-group.d.ts +22 -0
  33. package/experimental.js +1160 -64
  34. package/experimental.js.map +1 -1
  35. package/experimental.mjs +1163 -68
  36. package/experimental.mjs.map +1 -1
  37. package/index.js +139 -1753
  38. package/index.js.map +1 -1
  39. package/index.mjs +68 -1683
  40. package/index.mjs.map +1 -1
  41. package/lib/badge/badge.d.ts +0 -16
  42. package/lib/button/button.d.ts +0 -22
  43. package/lib/calendar/calendar.d.ts +0 -16
  44. package/lib/callout/callout.d.ts +0 -16
  45. package/lib/checkbox/checkbox.d.ts +0 -25
  46. package/lib/date-picker/date-picker.d.ts +0 -21
  47. package/lib/drawer/drawer.d.ts +0 -15
  48. package/lib/dropdown/dropdown-item.d.ts +0 -15
  49. package/lib/dropdown/dropdown.d.ts +0 -29
  50. package/lib/file-upload-card/file-upload-card.d.ts +0 -17
  51. package/lib/file-upload-input/file-upload-input.d.ts +0 -15
  52. package/lib/filter-chip/filter-chip.d.ts +0 -15
  53. package/lib/footer/footer.d.ts +0 -12
  54. package/lib/footer-meta-section/footer-meta-section.d.ts +0 -10
  55. package/lib/footer-nav-section/footer-nav-section.d.ts +0 -12
  56. package/lib/form-item/form-item.d.ts +0 -19
  57. package/lib/input/input.d.ts +0 -38
  58. package/lib/link/link.d.ts +0 -15
  59. package/lib/modal/modal.d.ts +1 -23
  60. package/lib/notification/notification.d.ts +0 -14
  61. package/lib/pagination/pagination.d.ts +0 -15
  62. package/lib/radio-group/radio-group.d.ts +0 -19
  63. package/lib/radio-group/radio.d.ts +0 -20
  64. package/lib/side-menu/side-menu.d.ts +0 -10
  65. package/lib/side-menu-group/side-menu-group.d.ts +0 -12
  66. package/lib/side-menu-heading/side-menu-heading.d.ts +0 -11
  67. package/lib/tab/tab.d.ts +3 -1
  68. package/lib/table/table-sort-header.d.ts +0 -11
  69. package/lib/table/table.d.ts +0 -14
  70. package/lib/tabs/tabs.d.ts +0 -14
  71. package/lib/textarea/textarea.d.ts +0 -25
  72. package/package.json +1 -1
  73. package/parseISO-BHUUf1QW.mjs +1693 -0
  74. package/parseISO-BHUUf1QW.mjs.map +1 -0
  75. package/parseISO-Dj57mwuH.js +1692 -0
  76. package/parseISO-Dj57mwuH.js.map +1 -0
  77. package/experimental/form/form-summary.d.ts +0 -10
  78. package/experimental/form/form.d.ts +0 -23
  79. package/experimental/resizable-panel/ResizablePanel.d.ts +0 -7
  80. package/icon-B3p90m2x.js +0 -75
  81. package/icon-B3p90m2x.js.map +0 -1
  82. package/icon-CCNDGfBO.mjs +0 -76
  83. package/icon-CCNDGfBO.mjs.map +0 -1
  84. package/style.css +0 -49
@@ -0,0 +1,1692 @@
1
+ "use strict";
2
+ const lowercase = (input) => input.toLowerCase();
3
+ const kebab = (input) => input.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
4
+ function transformProps(props, transform = lowercase) {
5
+ const result = {};
6
+ for (const [key, value] of Object.entries(props)) {
7
+ if (value === void 0) continue;
8
+ if (key.startsWith("data-")) {
9
+ result[key] = value;
10
+ } else {
11
+ result[transform(key)] = value;
12
+ }
13
+ }
14
+ return result;
15
+ }
16
+ function toDate(argument) {
17
+ const argStr = Object.prototype.toString.call(argument);
18
+ if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
19
+ return new argument.constructor(+argument);
20
+ } else if (typeof argument === "number" || argStr === "[object Number]" || typeof argument === "string" || argStr === "[object String]") {
21
+ return new Date(argument);
22
+ } else {
23
+ return /* @__PURE__ */ new Date(NaN);
24
+ }
25
+ }
26
+ function constructFrom(date, value) {
27
+ if (date instanceof Date) {
28
+ return new date.constructor(value);
29
+ } else {
30
+ return new Date(value);
31
+ }
32
+ }
33
+ const millisecondsInWeek = 6048e5;
34
+ const millisecondsInDay = 864e5;
35
+ const millisecondsInMinute = 6e4;
36
+ const millisecondsInHour = 36e5;
37
+ let defaultOptions = {};
38
+ function getDefaultOptions() {
39
+ return defaultOptions;
40
+ }
41
+ function startOfWeek(date, options) {
42
+ var _a, _b, _c, _d;
43
+ const defaultOptions2 = getDefaultOptions();
44
+ const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0;
45
+ const _date = toDate(date);
46
+ const day = _date.getDay();
47
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
48
+ _date.setDate(_date.getDate() - diff);
49
+ _date.setHours(0, 0, 0, 0);
50
+ return _date;
51
+ }
52
+ function startOfISOWeek(date) {
53
+ return startOfWeek(date, { weekStartsOn: 1 });
54
+ }
55
+ function getISOWeekYear(date) {
56
+ const _date = toDate(date);
57
+ const year = _date.getFullYear();
58
+ const fourthOfJanuaryOfNextYear = constructFrom(date, 0);
59
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
60
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
61
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
62
+ const fourthOfJanuaryOfThisYear = constructFrom(date, 0);
63
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
64
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
65
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
66
+ if (_date.getTime() >= startOfNextYear.getTime()) {
67
+ return year + 1;
68
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
69
+ return year;
70
+ } else {
71
+ return year - 1;
72
+ }
73
+ }
74
+ function startOfDay(date) {
75
+ const _date = toDate(date);
76
+ _date.setHours(0, 0, 0, 0);
77
+ return _date;
78
+ }
79
+ function getTimezoneOffsetInMilliseconds(date) {
80
+ const _date = toDate(date);
81
+ const utcDate = new Date(
82
+ Date.UTC(
83
+ _date.getFullYear(),
84
+ _date.getMonth(),
85
+ _date.getDate(),
86
+ _date.getHours(),
87
+ _date.getMinutes(),
88
+ _date.getSeconds(),
89
+ _date.getMilliseconds()
90
+ )
91
+ );
92
+ utcDate.setUTCFullYear(_date.getFullYear());
93
+ return +date - +utcDate;
94
+ }
95
+ function differenceInCalendarDays(dateLeft, dateRight) {
96
+ const startOfDayLeft = startOfDay(dateLeft);
97
+ const startOfDayRight = startOfDay(dateRight);
98
+ const timestampLeft = +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);
99
+ const timestampRight = +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);
100
+ return Math.round((timestampLeft - timestampRight) / millisecondsInDay);
101
+ }
102
+ function startOfISOWeekYear(date) {
103
+ const year = getISOWeekYear(date);
104
+ const fourthOfJanuary = constructFrom(date, 0);
105
+ fourthOfJanuary.setFullYear(year, 0, 4);
106
+ fourthOfJanuary.setHours(0, 0, 0, 0);
107
+ return startOfISOWeek(fourthOfJanuary);
108
+ }
109
+ function isDate(value) {
110
+ return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
111
+ }
112
+ function isValid(date) {
113
+ if (!isDate(date) && typeof date !== "number") {
114
+ return false;
115
+ }
116
+ const _date = toDate(date);
117
+ return !isNaN(Number(_date));
118
+ }
119
+ function startOfYear(date) {
120
+ const cleanDate = toDate(date);
121
+ const _date = constructFrom(date, 0);
122
+ _date.setFullYear(cleanDate.getFullYear(), 0, 1);
123
+ _date.setHours(0, 0, 0, 0);
124
+ return _date;
125
+ }
126
+ const formatDistanceLocale = {
127
+ lessThanXSeconds: {
128
+ one: "less than a second",
129
+ other: "less than {{count}} seconds"
130
+ },
131
+ xSeconds: {
132
+ one: "1 second",
133
+ other: "{{count}} seconds"
134
+ },
135
+ halfAMinute: "half a minute",
136
+ lessThanXMinutes: {
137
+ one: "less than a minute",
138
+ other: "less than {{count}} minutes"
139
+ },
140
+ xMinutes: {
141
+ one: "1 minute",
142
+ other: "{{count}} minutes"
143
+ },
144
+ aboutXHours: {
145
+ one: "about 1 hour",
146
+ other: "about {{count}} hours"
147
+ },
148
+ xHours: {
149
+ one: "1 hour",
150
+ other: "{{count}} hours"
151
+ },
152
+ xDays: {
153
+ one: "1 day",
154
+ other: "{{count}} days"
155
+ },
156
+ aboutXWeeks: {
157
+ one: "about 1 week",
158
+ other: "about {{count}} weeks"
159
+ },
160
+ xWeeks: {
161
+ one: "1 week",
162
+ other: "{{count}} weeks"
163
+ },
164
+ aboutXMonths: {
165
+ one: "about 1 month",
166
+ other: "about {{count}} months"
167
+ },
168
+ xMonths: {
169
+ one: "1 month",
170
+ other: "{{count}} months"
171
+ },
172
+ aboutXYears: {
173
+ one: "about 1 year",
174
+ other: "about {{count}} years"
175
+ },
176
+ xYears: {
177
+ one: "1 year",
178
+ other: "{{count}} years"
179
+ },
180
+ overXYears: {
181
+ one: "over 1 year",
182
+ other: "over {{count}} years"
183
+ },
184
+ almostXYears: {
185
+ one: "almost 1 year",
186
+ other: "almost {{count}} years"
187
+ }
188
+ };
189
+ const formatDistance = (token, count, options) => {
190
+ let result;
191
+ const tokenValue = formatDistanceLocale[token];
192
+ if (typeof tokenValue === "string") {
193
+ result = tokenValue;
194
+ } else if (count === 1) {
195
+ result = tokenValue.one;
196
+ } else {
197
+ result = tokenValue.other.replace("{{count}}", count.toString());
198
+ }
199
+ if (options == null ? void 0 : options.addSuffix) {
200
+ if (options.comparison && options.comparison > 0) {
201
+ return "in " + result;
202
+ } else {
203
+ return result + " ago";
204
+ }
205
+ }
206
+ return result;
207
+ };
208
+ function buildFormatLongFn(args) {
209
+ return (options = {}) => {
210
+ const width = options.width ? String(options.width) : args.defaultWidth;
211
+ const format2 = args.formats[width] || args.formats[args.defaultWidth];
212
+ return format2;
213
+ };
214
+ }
215
+ const dateFormats = {
216
+ full: "EEEE, MMMM do, y",
217
+ long: "MMMM do, y",
218
+ medium: "MMM d, y",
219
+ short: "MM/dd/yyyy"
220
+ };
221
+ const timeFormats = {
222
+ full: "h:mm:ss a zzzz",
223
+ long: "h:mm:ss a z",
224
+ medium: "h:mm:ss a",
225
+ short: "h:mm a"
226
+ };
227
+ const dateTimeFormats = {
228
+ full: "{{date}} 'at' {{time}}",
229
+ long: "{{date}} 'at' {{time}}",
230
+ medium: "{{date}}, {{time}}",
231
+ short: "{{date}}, {{time}}"
232
+ };
233
+ const formatLong = {
234
+ date: buildFormatLongFn({
235
+ formats: dateFormats,
236
+ defaultWidth: "full"
237
+ }),
238
+ time: buildFormatLongFn({
239
+ formats: timeFormats,
240
+ defaultWidth: "full"
241
+ }),
242
+ dateTime: buildFormatLongFn({
243
+ formats: dateTimeFormats,
244
+ defaultWidth: "full"
245
+ })
246
+ };
247
+ const formatRelativeLocale = {
248
+ lastWeek: "'last' eeee 'at' p",
249
+ yesterday: "'yesterday at' p",
250
+ today: "'today at' p",
251
+ tomorrow: "'tomorrow at' p",
252
+ nextWeek: "eeee 'at' p",
253
+ other: "P"
254
+ };
255
+ const formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
256
+ function buildLocalizeFn(args) {
257
+ return (value, options) => {
258
+ const context = (options == null ? void 0 : options.context) ? String(options.context) : "standalone";
259
+ let valuesArray;
260
+ if (context === "formatting" && args.formattingValues) {
261
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
262
+ const width = (options == null ? void 0 : options.width) ? String(options.width) : defaultWidth;
263
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
264
+ } else {
265
+ const defaultWidth = args.defaultWidth;
266
+ const width = (options == null ? void 0 : options.width) ? String(options.width) : args.defaultWidth;
267
+ valuesArray = args.values[width] || args.values[defaultWidth];
268
+ }
269
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
270
+ return valuesArray[index];
271
+ };
272
+ }
273
+ const eraValues = {
274
+ narrow: ["B", "A"],
275
+ abbreviated: ["BC", "AD"],
276
+ wide: ["Before Christ", "Anno Domini"]
277
+ };
278
+ const quarterValues = {
279
+ narrow: ["1", "2", "3", "4"],
280
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
281
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
282
+ };
283
+ const monthValues = {
284
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
285
+ abbreviated: [
286
+ "Jan",
287
+ "Feb",
288
+ "Mar",
289
+ "Apr",
290
+ "May",
291
+ "Jun",
292
+ "Jul",
293
+ "Aug",
294
+ "Sep",
295
+ "Oct",
296
+ "Nov",
297
+ "Dec"
298
+ ],
299
+ wide: [
300
+ "January",
301
+ "February",
302
+ "March",
303
+ "April",
304
+ "May",
305
+ "June",
306
+ "July",
307
+ "August",
308
+ "September",
309
+ "October",
310
+ "November",
311
+ "December"
312
+ ]
313
+ };
314
+ const dayValues = {
315
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
316
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
317
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
318
+ wide: [
319
+ "Sunday",
320
+ "Monday",
321
+ "Tuesday",
322
+ "Wednesday",
323
+ "Thursday",
324
+ "Friday",
325
+ "Saturday"
326
+ ]
327
+ };
328
+ const dayPeriodValues = {
329
+ narrow: {
330
+ am: "a",
331
+ pm: "p",
332
+ midnight: "mi",
333
+ noon: "n",
334
+ morning: "morning",
335
+ afternoon: "afternoon",
336
+ evening: "evening",
337
+ night: "night"
338
+ },
339
+ abbreviated: {
340
+ am: "AM",
341
+ pm: "PM",
342
+ midnight: "midnight",
343
+ noon: "noon",
344
+ morning: "morning",
345
+ afternoon: "afternoon",
346
+ evening: "evening",
347
+ night: "night"
348
+ },
349
+ wide: {
350
+ am: "a.m.",
351
+ pm: "p.m.",
352
+ midnight: "midnight",
353
+ noon: "noon",
354
+ morning: "morning",
355
+ afternoon: "afternoon",
356
+ evening: "evening",
357
+ night: "night"
358
+ }
359
+ };
360
+ const formattingDayPeriodValues = {
361
+ narrow: {
362
+ am: "a",
363
+ pm: "p",
364
+ midnight: "mi",
365
+ noon: "n",
366
+ morning: "in the morning",
367
+ afternoon: "in the afternoon",
368
+ evening: "in the evening",
369
+ night: "at night"
370
+ },
371
+ abbreviated: {
372
+ am: "AM",
373
+ pm: "PM",
374
+ midnight: "midnight",
375
+ noon: "noon",
376
+ morning: "in the morning",
377
+ afternoon: "in the afternoon",
378
+ evening: "in the evening",
379
+ night: "at night"
380
+ },
381
+ wide: {
382
+ am: "a.m.",
383
+ pm: "p.m.",
384
+ midnight: "midnight",
385
+ noon: "noon",
386
+ morning: "in the morning",
387
+ afternoon: "in the afternoon",
388
+ evening: "in the evening",
389
+ night: "at night"
390
+ }
391
+ };
392
+ const ordinalNumber = (dirtyNumber, _options) => {
393
+ const number = Number(dirtyNumber);
394
+ const rem100 = number % 100;
395
+ if (rem100 > 20 || rem100 < 10) {
396
+ switch (rem100 % 10) {
397
+ case 1:
398
+ return number + "st";
399
+ case 2:
400
+ return number + "nd";
401
+ case 3:
402
+ return number + "rd";
403
+ }
404
+ }
405
+ return number + "th";
406
+ };
407
+ const localize = {
408
+ ordinalNumber,
409
+ era: buildLocalizeFn({
410
+ values: eraValues,
411
+ defaultWidth: "wide"
412
+ }),
413
+ quarter: buildLocalizeFn({
414
+ values: quarterValues,
415
+ defaultWidth: "wide",
416
+ argumentCallback: (quarter) => quarter - 1
417
+ }),
418
+ month: buildLocalizeFn({
419
+ values: monthValues,
420
+ defaultWidth: "wide"
421
+ }),
422
+ day: buildLocalizeFn({
423
+ values: dayValues,
424
+ defaultWidth: "wide"
425
+ }),
426
+ dayPeriod: buildLocalizeFn({
427
+ values: dayPeriodValues,
428
+ defaultWidth: "wide",
429
+ formattingValues: formattingDayPeriodValues,
430
+ defaultFormattingWidth: "wide"
431
+ })
432
+ };
433
+ function buildMatchFn(args) {
434
+ return (string, options = {}) => {
435
+ const width = options.width;
436
+ const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
437
+ const matchResult = string.match(matchPattern);
438
+ if (!matchResult) {
439
+ return null;
440
+ }
441
+ const matchedString = matchResult[0];
442
+ const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
443
+ const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
444
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
445
+ findKey(parsePatterns, (pattern) => pattern.test(matchedString))
446
+ );
447
+ let value;
448
+ value = args.valueCallback ? args.valueCallback(key) : key;
449
+ value = options.valueCallback ? (
450
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
451
+ options.valueCallback(value)
452
+ ) : value;
453
+ const rest = string.slice(matchedString.length);
454
+ return { value, rest };
455
+ };
456
+ }
457
+ function findKey(object, predicate) {
458
+ for (const key in object) {
459
+ if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
460
+ return key;
461
+ }
462
+ }
463
+ return void 0;
464
+ }
465
+ function findIndex(array, predicate) {
466
+ for (let key = 0; key < array.length; key++) {
467
+ if (predicate(array[key])) {
468
+ return key;
469
+ }
470
+ }
471
+ return void 0;
472
+ }
473
+ function buildMatchPatternFn(args) {
474
+ return (string, options = {}) => {
475
+ const matchResult = string.match(args.matchPattern);
476
+ if (!matchResult) return null;
477
+ const matchedString = matchResult[0];
478
+ const parseResult = string.match(args.parsePattern);
479
+ if (!parseResult) return null;
480
+ let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
481
+ value = options.valueCallback ? options.valueCallback(value) : value;
482
+ const rest = string.slice(matchedString.length);
483
+ return { value, rest };
484
+ };
485
+ }
486
+ const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
487
+ const parseOrdinalNumberPattern = /\d+/i;
488
+ const matchEraPatterns = {
489
+ narrow: /^(b|a)/i,
490
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
491
+ wide: /^(before christ|before common era|anno domini|common era)/i
492
+ };
493
+ const parseEraPatterns = {
494
+ any: [/^b/i, /^(a|c)/i]
495
+ };
496
+ const matchQuarterPatterns = {
497
+ narrow: /^[1234]/i,
498
+ abbreviated: /^q[1234]/i,
499
+ wide: /^[1234](th|st|nd|rd)? quarter/i
500
+ };
501
+ const parseQuarterPatterns = {
502
+ any: [/1/i, /2/i, /3/i, /4/i]
503
+ };
504
+ const matchMonthPatterns = {
505
+ narrow: /^[jfmasond]/i,
506
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
507
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
508
+ };
509
+ const parseMonthPatterns = {
510
+ narrow: [
511
+ /^j/i,
512
+ /^f/i,
513
+ /^m/i,
514
+ /^a/i,
515
+ /^m/i,
516
+ /^j/i,
517
+ /^j/i,
518
+ /^a/i,
519
+ /^s/i,
520
+ /^o/i,
521
+ /^n/i,
522
+ /^d/i
523
+ ],
524
+ any: [
525
+ /^ja/i,
526
+ /^f/i,
527
+ /^mar/i,
528
+ /^ap/i,
529
+ /^may/i,
530
+ /^jun/i,
531
+ /^jul/i,
532
+ /^au/i,
533
+ /^s/i,
534
+ /^o/i,
535
+ /^n/i,
536
+ /^d/i
537
+ ]
538
+ };
539
+ const matchDayPatterns = {
540
+ narrow: /^[smtwf]/i,
541
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
542
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
543
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
544
+ };
545
+ const parseDayPatterns = {
546
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
547
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
548
+ };
549
+ const matchDayPeriodPatterns = {
550
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
551
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
552
+ };
553
+ const parseDayPeriodPatterns = {
554
+ any: {
555
+ am: /^a/i,
556
+ pm: /^p/i,
557
+ midnight: /^mi/i,
558
+ noon: /^no/i,
559
+ morning: /morning/i,
560
+ afternoon: /afternoon/i,
561
+ evening: /evening/i,
562
+ night: /night/i
563
+ }
564
+ };
565
+ const match = {
566
+ ordinalNumber: buildMatchPatternFn({
567
+ matchPattern: matchOrdinalNumberPattern,
568
+ parsePattern: parseOrdinalNumberPattern,
569
+ valueCallback: (value) => parseInt(value, 10)
570
+ }),
571
+ era: buildMatchFn({
572
+ matchPatterns: matchEraPatterns,
573
+ defaultMatchWidth: "wide",
574
+ parsePatterns: parseEraPatterns,
575
+ defaultParseWidth: "any"
576
+ }),
577
+ quarter: buildMatchFn({
578
+ matchPatterns: matchQuarterPatterns,
579
+ defaultMatchWidth: "wide",
580
+ parsePatterns: parseQuarterPatterns,
581
+ defaultParseWidth: "any",
582
+ valueCallback: (index) => index + 1
583
+ }),
584
+ month: buildMatchFn({
585
+ matchPatterns: matchMonthPatterns,
586
+ defaultMatchWidth: "wide",
587
+ parsePatterns: parseMonthPatterns,
588
+ defaultParseWidth: "any"
589
+ }),
590
+ day: buildMatchFn({
591
+ matchPatterns: matchDayPatterns,
592
+ defaultMatchWidth: "wide",
593
+ parsePatterns: parseDayPatterns,
594
+ defaultParseWidth: "any"
595
+ }),
596
+ dayPeriod: buildMatchFn({
597
+ matchPatterns: matchDayPeriodPatterns,
598
+ defaultMatchWidth: "any",
599
+ parsePatterns: parseDayPeriodPatterns,
600
+ defaultParseWidth: "any"
601
+ })
602
+ };
603
+ const enUS = {
604
+ code: "en-US",
605
+ formatDistance,
606
+ formatLong,
607
+ formatRelative,
608
+ localize,
609
+ match,
610
+ options: {
611
+ weekStartsOn: 0,
612
+ firstWeekContainsDate: 1
613
+ }
614
+ };
615
+ function getDayOfYear(date) {
616
+ const _date = toDate(date);
617
+ const diff = differenceInCalendarDays(_date, startOfYear(_date));
618
+ const dayOfYear = diff + 1;
619
+ return dayOfYear;
620
+ }
621
+ function getISOWeek(date) {
622
+ const _date = toDate(date);
623
+ const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
624
+ return Math.round(diff / millisecondsInWeek) + 1;
625
+ }
626
+ function getWeekYear(date, options) {
627
+ var _a, _b, _c, _d;
628
+ const _date = toDate(date);
629
+ const year = _date.getFullYear();
630
+ const defaultOptions2 = getDefaultOptions();
631
+ const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1;
632
+ const firstWeekOfNextYear = constructFrom(date, 0);
633
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
634
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
635
+ const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
636
+ const firstWeekOfThisYear = constructFrom(date, 0);
637
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
638
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
639
+ const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
640
+ if (_date.getTime() >= startOfNextYear.getTime()) {
641
+ return year + 1;
642
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
643
+ return year;
644
+ } else {
645
+ return year - 1;
646
+ }
647
+ }
648
+ function startOfWeekYear(date, options) {
649
+ var _a, _b, _c, _d;
650
+ const defaultOptions2 = getDefaultOptions();
651
+ const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1;
652
+ const year = getWeekYear(date, options);
653
+ const firstWeek = constructFrom(date, 0);
654
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
655
+ firstWeek.setHours(0, 0, 0, 0);
656
+ const _date = startOfWeek(firstWeek, options);
657
+ return _date;
658
+ }
659
+ function getWeek(date, options) {
660
+ const _date = toDate(date);
661
+ const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
662
+ return Math.round(diff / millisecondsInWeek) + 1;
663
+ }
664
+ function addLeadingZeros(number, targetLength) {
665
+ const sign = number < 0 ? "-" : "";
666
+ const output = Math.abs(number).toString().padStart(targetLength, "0");
667
+ return sign + output;
668
+ }
669
+ const lightFormatters = {
670
+ // Year
671
+ y(date, token) {
672
+ const signedYear = date.getFullYear();
673
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
674
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
675
+ },
676
+ // Month
677
+ M(date, token) {
678
+ const month = date.getMonth();
679
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
680
+ },
681
+ // Day of the month
682
+ d(date, token) {
683
+ return addLeadingZeros(date.getDate(), token.length);
684
+ },
685
+ // AM or PM
686
+ a(date, token) {
687
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
688
+ switch (token) {
689
+ case "a":
690
+ case "aa":
691
+ return dayPeriodEnumValue.toUpperCase();
692
+ case "aaa":
693
+ return dayPeriodEnumValue;
694
+ case "aaaaa":
695
+ return dayPeriodEnumValue[0];
696
+ case "aaaa":
697
+ default:
698
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
699
+ }
700
+ },
701
+ // Hour [1-12]
702
+ h(date, token) {
703
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
704
+ },
705
+ // Hour [0-23]
706
+ H(date, token) {
707
+ return addLeadingZeros(date.getHours(), token.length);
708
+ },
709
+ // Minute
710
+ m(date, token) {
711
+ return addLeadingZeros(date.getMinutes(), token.length);
712
+ },
713
+ // Second
714
+ s(date, token) {
715
+ return addLeadingZeros(date.getSeconds(), token.length);
716
+ },
717
+ // Fraction of second
718
+ S(date, token) {
719
+ const numberOfDigits = token.length;
720
+ const milliseconds = date.getMilliseconds();
721
+ const fractionalSeconds = Math.trunc(
722
+ milliseconds * Math.pow(10, numberOfDigits - 3)
723
+ );
724
+ return addLeadingZeros(fractionalSeconds, token.length);
725
+ }
726
+ };
727
+ const dayPeriodEnum = {
728
+ midnight: "midnight",
729
+ noon: "noon",
730
+ morning: "morning",
731
+ afternoon: "afternoon",
732
+ evening: "evening",
733
+ night: "night"
734
+ };
735
+ const formatters = {
736
+ // Era
737
+ G: function(date, token, localize2) {
738
+ const era = date.getFullYear() > 0 ? 1 : 0;
739
+ switch (token) {
740
+ // AD, BC
741
+ case "G":
742
+ case "GG":
743
+ case "GGG":
744
+ return localize2.era(era, { width: "abbreviated" });
745
+ // A, B
746
+ case "GGGGG":
747
+ return localize2.era(era, { width: "narrow" });
748
+ // Anno Domini, Before Christ
749
+ case "GGGG":
750
+ default:
751
+ return localize2.era(era, { width: "wide" });
752
+ }
753
+ },
754
+ // Year
755
+ y: function(date, token, localize2) {
756
+ if (token === "yo") {
757
+ const signedYear = date.getFullYear();
758
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
759
+ return localize2.ordinalNumber(year, { unit: "year" });
760
+ }
761
+ return lightFormatters.y(date, token);
762
+ },
763
+ // Local week-numbering year
764
+ Y: function(date, token, localize2, options) {
765
+ const signedWeekYear = getWeekYear(date, options);
766
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
767
+ if (token === "YY") {
768
+ const twoDigitYear = weekYear % 100;
769
+ return addLeadingZeros(twoDigitYear, 2);
770
+ }
771
+ if (token === "Yo") {
772
+ return localize2.ordinalNumber(weekYear, { unit: "year" });
773
+ }
774
+ return addLeadingZeros(weekYear, token.length);
775
+ },
776
+ // ISO week-numbering year
777
+ R: function(date, token) {
778
+ const isoWeekYear = getISOWeekYear(date);
779
+ return addLeadingZeros(isoWeekYear, token.length);
780
+ },
781
+ // Extended year. This is a single number designating the year of this calendar system.
782
+ // The main difference between `y` and `u` localizers are B.C. years:
783
+ // | Year | `y` | `u` |
784
+ // |------|-----|-----|
785
+ // | AC 1 | 1 | 1 |
786
+ // | BC 1 | 1 | 0 |
787
+ // | BC 2 | 2 | -1 |
788
+ // Also `yy` always returns the last two digits of a year,
789
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
790
+ u: function(date, token) {
791
+ const year = date.getFullYear();
792
+ return addLeadingZeros(year, token.length);
793
+ },
794
+ // Quarter
795
+ Q: function(date, token, localize2) {
796
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
797
+ switch (token) {
798
+ // 1, 2, 3, 4
799
+ case "Q":
800
+ return String(quarter);
801
+ // 01, 02, 03, 04
802
+ case "QQ":
803
+ return addLeadingZeros(quarter, 2);
804
+ // 1st, 2nd, 3rd, 4th
805
+ case "Qo":
806
+ return localize2.ordinalNumber(quarter, { unit: "quarter" });
807
+ // Q1, Q2, Q3, Q4
808
+ case "QQQ":
809
+ return localize2.quarter(quarter, {
810
+ width: "abbreviated",
811
+ context: "formatting"
812
+ });
813
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
814
+ case "QQQQQ":
815
+ return localize2.quarter(quarter, {
816
+ width: "narrow",
817
+ context: "formatting"
818
+ });
819
+ // 1st quarter, 2nd quarter, ...
820
+ case "QQQQ":
821
+ default:
822
+ return localize2.quarter(quarter, {
823
+ width: "wide",
824
+ context: "formatting"
825
+ });
826
+ }
827
+ },
828
+ // Stand-alone quarter
829
+ q: function(date, token, localize2) {
830
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
831
+ switch (token) {
832
+ // 1, 2, 3, 4
833
+ case "q":
834
+ return String(quarter);
835
+ // 01, 02, 03, 04
836
+ case "qq":
837
+ return addLeadingZeros(quarter, 2);
838
+ // 1st, 2nd, 3rd, 4th
839
+ case "qo":
840
+ return localize2.ordinalNumber(quarter, { unit: "quarter" });
841
+ // Q1, Q2, Q3, Q4
842
+ case "qqq":
843
+ return localize2.quarter(quarter, {
844
+ width: "abbreviated",
845
+ context: "standalone"
846
+ });
847
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
848
+ case "qqqqq":
849
+ return localize2.quarter(quarter, {
850
+ width: "narrow",
851
+ context: "standalone"
852
+ });
853
+ // 1st quarter, 2nd quarter, ...
854
+ case "qqqq":
855
+ default:
856
+ return localize2.quarter(quarter, {
857
+ width: "wide",
858
+ context: "standalone"
859
+ });
860
+ }
861
+ },
862
+ // Month
863
+ M: function(date, token, localize2) {
864
+ const month = date.getMonth();
865
+ switch (token) {
866
+ case "M":
867
+ case "MM":
868
+ return lightFormatters.M(date, token);
869
+ // 1st, 2nd, ..., 12th
870
+ case "Mo":
871
+ return localize2.ordinalNumber(month + 1, { unit: "month" });
872
+ // Jan, Feb, ..., Dec
873
+ case "MMM":
874
+ return localize2.month(month, {
875
+ width: "abbreviated",
876
+ context: "formatting"
877
+ });
878
+ // J, F, ..., D
879
+ case "MMMMM":
880
+ return localize2.month(month, {
881
+ width: "narrow",
882
+ context: "formatting"
883
+ });
884
+ // January, February, ..., December
885
+ case "MMMM":
886
+ default:
887
+ return localize2.month(month, { width: "wide", context: "formatting" });
888
+ }
889
+ },
890
+ // Stand-alone month
891
+ L: function(date, token, localize2) {
892
+ const month = date.getMonth();
893
+ switch (token) {
894
+ // 1, 2, ..., 12
895
+ case "L":
896
+ return String(month + 1);
897
+ // 01, 02, ..., 12
898
+ case "LL":
899
+ return addLeadingZeros(month + 1, 2);
900
+ // 1st, 2nd, ..., 12th
901
+ case "Lo":
902
+ return localize2.ordinalNumber(month + 1, { unit: "month" });
903
+ // Jan, Feb, ..., Dec
904
+ case "LLL":
905
+ return localize2.month(month, {
906
+ width: "abbreviated",
907
+ context: "standalone"
908
+ });
909
+ // J, F, ..., D
910
+ case "LLLLL":
911
+ return localize2.month(month, {
912
+ width: "narrow",
913
+ context: "standalone"
914
+ });
915
+ // January, February, ..., December
916
+ case "LLLL":
917
+ default:
918
+ return localize2.month(month, { width: "wide", context: "standalone" });
919
+ }
920
+ },
921
+ // Local week of year
922
+ w: function(date, token, localize2, options) {
923
+ const week = getWeek(date, options);
924
+ if (token === "wo") {
925
+ return localize2.ordinalNumber(week, { unit: "week" });
926
+ }
927
+ return addLeadingZeros(week, token.length);
928
+ },
929
+ // ISO week of year
930
+ I: function(date, token, localize2) {
931
+ const isoWeek = getISOWeek(date);
932
+ if (token === "Io") {
933
+ return localize2.ordinalNumber(isoWeek, { unit: "week" });
934
+ }
935
+ return addLeadingZeros(isoWeek, token.length);
936
+ },
937
+ // Day of the month
938
+ d: function(date, token, localize2) {
939
+ if (token === "do") {
940
+ return localize2.ordinalNumber(date.getDate(), { unit: "date" });
941
+ }
942
+ return lightFormatters.d(date, token);
943
+ },
944
+ // Day of year
945
+ D: function(date, token, localize2) {
946
+ const dayOfYear = getDayOfYear(date);
947
+ if (token === "Do") {
948
+ return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
949
+ }
950
+ return addLeadingZeros(dayOfYear, token.length);
951
+ },
952
+ // Day of week
953
+ E: function(date, token, localize2) {
954
+ const dayOfWeek = date.getDay();
955
+ switch (token) {
956
+ // Tue
957
+ case "E":
958
+ case "EE":
959
+ case "EEE":
960
+ return localize2.day(dayOfWeek, {
961
+ width: "abbreviated",
962
+ context: "formatting"
963
+ });
964
+ // T
965
+ case "EEEEE":
966
+ return localize2.day(dayOfWeek, {
967
+ width: "narrow",
968
+ context: "formatting"
969
+ });
970
+ // Tu
971
+ case "EEEEEE":
972
+ return localize2.day(dayOfWeek, {
973
+ width: "short",
974
+ context: "formatting"
975
+ });
976
+ // Tuesday
977
+ case "EEEE":
978
+ default:
979
+ return localize2.day(dayOfWeek, {
980
+ width: "wide",
981
+ context: "formatting"
982
+ });
983
+ }
984
+ },
985
+ // Local day of week
986
+ e: function(date, token, localize2, options) {
987
+ const dayOfWeek = date.getDay();
988
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
989
+ switch (token) {
990
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
991
+ case "e":
992
+ return String(localDayOfWeek);
993
+ // Padded numerical value
994
+ case "ee":
995
+ return addLeadingZeros(localDayOfWeek, 2);
996
+ // 1st, 2nd, ..., 7th
997
+ case "eo":
998
+ return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
999
+ case "eee":
1000
+ return localize2.day(dayOfWeek, {
1001
+ width: "abbreviated",
1002
+ context: "formatting"
1003
+ });
1004
+ // T
1005
+ case "eeeee":
1006
+ return localize2.day(dayOfWeek, {
1007
+ width: "narrow",
1008
+ context: "formatting"
1009
+ });
1010
+ // Tu
1011
+ case "eeeeee":
1012
+ return localize2.day(dayOfWeek, {
1013
+ width: "short",
1014
+ context: "formatting"
1015
+ });
1016
+ // Tuesday
1017
+ case "eeee":
1018
+ default:
1019
+ return localize2.day(dayOfWeek, {
1020
+ width: "wide",
1021
+ context: "formatting"
1022
+ });
1023
+ }
1024
+ },
1025
+ // Stand-alone local day of week
1026
+ c: function(date, token, localize2, options) {
1027
+ const dayOfWeek = date.getDay();
1028
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1029
+ switch (token) {
1030
+ // Numerical value (same as in `e`)
1031
+ case "c":
1032
+ return String(localDayOfWeek);
1033
+ // Padded numerical value
1034
+ case "cc":
1035
+ return addLeadingZeros(localDayOfWeek, token.length);
1036
+ // 1st, 2nd, ..., 7th
1037
+ case "co":
1038
+ return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
1039
+ case "ccc":
1040
+ return localize2.day(dayOfWeek, {
1041
+ width: "abbreviated",
1042
+ context: "standalone"
1043
+ });
1044
+ // T
1045
+ case "ccccc":
1046
+ return localize2.day(dayOfWeek, {
1047
+ width: "narrow",
1048
+ context: "standalone"
1049
+ });
1050
+ // Tu
1051
+ case "cccccc":
1052
+ return localize2.day(dayOfWeek, {
1053
+ width: "short",
1054
+ context: "standalone"
1055
+ });
1056
+ // Tuesday
1057
+ case "cccc":
1058
+ default:
1059
+ return localize2.day(dayOfWeek, {
1060
+ width: "wide",
1061
+ context: "standalone"
1062
+ });
1063
+ }
1064
+ },
1065
+ // ISO day of week
1066
+ i: function(date, token, localize2) {
1067
+ const dayOfWeek = date.getDay();
1068
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1069
+ switch (token) {
1070
+ // 2
1071
+ case "i":
1072
+ return String(isoDayOfWeek);
1073
+ // 02
1074
+ case "ii":
1075
+ return addLeadingZeros(isoDayOfWeek, token.length);
1076
+ // 2nd
1077
+ case "io":
1078
+ return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
1079
+ // Tue
1080
+ case "iii":
1081
+ return localize2.day(dayOfWeek, {
1082
+ width: "abbreviated",
1083
+ context: "formatting"
1084
+ });
1085
+ // T
1086
+ case "iiiii":
1087
+ return localize2.day(dayOfWeek, {
1088
+ width: "narrow",
1089
+ context: "formatting"
1090
+ });
1091
+ // Tu
1092
+ case "iiiiii":
1093
+ return localize2.day(dayOfWeek, {
1094
+ width: "short",
1095
+ context: "formatting"
1096
+ });
1097
+ // Tuesday
1098
+ case "iiii":
1099
+ default:
1100
+ return localize2.day(dayOfWeek, {
1101
+ width: "wide",
1102
+ context: "formatting"
1103
+ });
1104
+ }
1105
+ },
1106
+ // AM or PM
1107
+ a: function(date, token, localize2) {
1108
+ const hours = date.getHours();
1109
+ const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1110
+ switch (token) {
1111
+ case "a":
1112
+ case "aa":
1113
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1114
+ width: "abbreviated",
1115
+ context: "formatting"
1116
+ });
1117
+ case "aaa":
1118
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1119
+ width: "abbreviated",
1120
+ context: "formatting"
1121
+ }).toLowerCase();
1122
+ case "aaaaa":
1123
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1124
+ width: "narrow",
1125
+ context: "formatting"
1126
+ });
1127
+ case "aaaa":
1128
+ default:
1129
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1130
+ width: "wide",
1131
+ context: "formatting"
1132
+ });
1133
+ }
1134
+ },
1135
+ // AM, PM, midnight, noon
1136
+ b: function(date, token, localize2) {
1137
+ const hours = date.getHours();
1138
+ let dayPeriodEnumValue;
1139
+ if (hours === 12) {
1140
+ dayPeriodEnumValue = dayPeriodEnum.noon;
1141
+ } else if (hours === 0) {
1142
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
1143
+ } else {
1144
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1145
+ }
1146
+ switch (token) {
1147
+ case "b":
1148
+ case "bb":
1149
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1150
+ width: "abbreviated",
1151
+ context: "formatting"
1152
+ });
1153
+ case "bbb":
1154
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1155
+ width: "abbreviated",
1156
+ context: "formatting"
1157
+ }).toLowerCase();
1158
+ case "bbbbb":
1159
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1160
+ width: "narrow",
1161
+ context: "formatting"
1162
+ });
1163
+ case "bbbb":
1164
+ default:
1165
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1166
+ width: "wide",
1167
+ context: "formatting"
1168
+ });
1169
+ }
1170
+ },
1171
+ // in the morning, in the afternoon, in the evening, at night
1172
+ B: function(date, token, localize2) {
1173
+ const hours = date.getHours();
1174
+ let dayPeriodEnumValue;
1175
+ if (hours >= 17) {
1176
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1177
+ } else if (hours >= 12) {
1178
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1179
+ } else if (hours >= 4) {
1180
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1181
+ } else {
1182
+ dayPeriodEnumValue = dayPeriodEnum.night;
1183
+ }
1184
+ switch (token) {
1185
+ case "B":
1186
+ case "BB":
1187
+ case "BBB":
1188
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1189
+ width: "abbreviated",
1190
+ context: "formatting"
1191
+ });
1192
+ case "BBBBB":
1193
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1194
+ width: "narrow",
1195
+ context: "formatting"
1196
+ });
1197
+ case "BBBB":
1198
+ default:
1199
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1200
+ width: "wide",
1201
+ context: "formatting"
1202
+ });
1203
+ }
1204
+ },
1205
+ // Hour [1-12]
1206
+ h: function(date, token, localize2) {
1207
+ if (token === "ho") {
1208
+ let hours = date.getHours() % 12;
1209
+ if (hours === 0) hours = 12;
1210
+ return localize2.ordinalNumber(hours, { unit: "hour" });
1211
+ }
1212
+ return lightFormatters.h(date, token);
1213
+ },
1214
+ // Hour [0-23]
1215
+ H: function(date, token, localize2) {
1216
+ if (token === "Ho") {
1217
+ return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
1218
+ }
1219
+ return lightFormatters.H(date, token);
1220
+ },
1221
+ // Hour [0-11]
1222
+ K: function(date, token, localize2) {
1223
+ const hours = date.getHours() % 12;
1224
+ if (token === "Ko") {
1225
+ return localize2.ordinalNumber(hours, { unit: "hour" });
1226
+ }
1227
+ return addLeadingZeros(hours, token.length);
1228
+ },
1229
+ // Hour [1-24]
1230
+ k: function(date, token, localize2) {
1231
+ let hours = date.getHours();
1232
+ if (hours === 0) hours = 24;
1233
+ if (token === "ko") {
1234
+ return localize2.ordinalNumber(hours, { unit: "hour" });
1235
+ }
1236
+ return addLeadingZeros(hours, token.length);
1237
+ },
1238
+ // Minute
1239
+ m: function(date, token, localize2) {
1240
+ if (token === "mo") {
1241
+ return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
1242
+ }
1243
+ return lightFormatters.m(date, token);
1244
+ },
1245
+ // Second
1246
+ s: function(date, token, localize2) {
1247
+ if (token === "so") {
1248
+ return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
1249
+ }
1250
+ return lightFormatters.s(date, token);
1251
+ },
1252
+ // Fraction of second
1253
+ S: function(date, token) {
1254
+ return lightFormatters.S(date, token);
1255
+ },
1256
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1257
+ X: function(date, token, _localize) {
1258
+ const timezoneOffset = date.getTimezoneOffset();
1259
+ if (timezoneOffset === 0) {
1260
+ return "Z";
1261
+ }
1262
+ switch (token) {
1263
+ // Hours and optional minutes
1264
+ case "X":
1265
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1266
+ // Hours, minutes and optional seconds without `:` delimiter
1267
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1268
+ // so this token always has the same output as `XX`
1269
+ case "XXXX":
1270
+ case "XX":
1271
+ return formatTimezone(timezoneOffset);
1272
+ // Hours, minutes and optional seconds with `:` delimiter
1273
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1274
+ // so this token always has the same output as `XXX`
1275
+ case "XXXXX":
1276
+ case "XXX":
1277
+ // Hours and minutes with `:` delimiter
1278
+ default:
1279
+ return formatTimezone(timezoneOffset, ":");
1280
+ }
1281
+ },
1282
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1283
+ x: function(date, token, _localize) {
1284
+ const timezoneOffset = date.getTimezoneOffset();
1285
+ switch (token) {
1286
+ // Hours and optional minutes
1287
+ case "x":
1288
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1289
+ // Hours, minutes and optional seconds without `:` delimiter
1290
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1291
+ // so this token always has the same output as `xx`
1292
+ case "xxxx":
1293
+ case "xx":
1294
+ return formatTimezone(timezoneOffset);
1295
+ // Hours, minutes and optional seconds with `:` delimiter
1296
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1297
+ // so this token always has the same output as `xxx`
1298
+ case "xxxxx":
1299
+ case "xxx":
1300
+ // Hours and minutes with `:` delimiter
1301
+ default:
1302
+ return formatTimezone(timezoneOffset, ":");
1303
+ }
1304
+ },
1305
+ // Timezone (GMT)
1306
+ O: function(date, token, _localize) {
1307
+ const timezoneOffset = date.getTimezoneOffset();
1308
+ switch (token) {
1309
+ // Short
1310
+ case "O":
1311
+ case "OO":
1312
+ case "OOO":
1313
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1314
+ // Long
1315
+ case "OOOO":
1316
+ default:
1317
+ return "GMT" + formatTimezone(timezoneOffset, ":");
1318
+ }
1319
+ },
1320
+ // Timezone (specific non-location)
1321
+ z: function(date, token, _localize) {
1322
+ const timezoneOffset = date.getTimezoneOffset();
1323
+ switch (token) {
1324
+ // Short
1325
+ case "z":
1326
+ case "zz":
1327
+ case "zzz":
1328
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1329
+ // Long
1330
+ case "zzzz":
1331
+ default:
1332
+ return "GMT" + formatTimezone(timezoneOffset, ":");
1333
+ }
1334
+ },
1335
+ // Seconds timestamp
1336
+ t: function(date, token, _localize) {
1337
+ const timestamp = Math.trunc(date.getTime() / 1e3);
1338
+ return addLeadingZeros(timestamp, token.length);
1339
+ },
1340
+ // Milliseconds timestamp
1341
+ T: function(date, token, _localize) {
1342
+ const timestamp = date.getTime();
1343
+ return addLeadingZeros(timestamp, token.length);
1344
+ }
1345
+ };
1346
+ function formatTimezoneShort(offset, delimiter = "") {
1347
+ const sign = offset > 0 ? "-" : "+";
1348
+ const absOffset = Math.abs(offset);
1349
+ const hours = Math.trunc(absOffset / 60);
1350
+ const minutes = absOffset % 60;
1351
+ if (minutes === 0) {
1352
+ return sign + String(hours);
1353
+ }
1354
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1355
+ }
1356
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
1357
+ if (offset % 60 === 0) {
1358
+ const sign = offset > 0 ? "-" : "+";
1359
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1360
+ }
1361
+ return formatTimezone(offset, delimiter);
1362
+ }
1363
+ function formatTimezone(offset, delimiter = "") {
1364
+ const sign = offset > 0 ? "-" : "+";
1365
+ const absOffset = Math.abs(offset);
1366
+ const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
1367
+ const minutes = addLeadingZeros(absOffset % 60, 2);
1368
+ return sign + hours + delimiter + minutes;
1369
+ }
1370
+ const dateLongFormatter = (pattern, formatLong2) => {
1371
+ switch (pattern) {
1372
+ case "P":
1373
+ return formatLong2.date({ width: "short" });
1374
+ case "PP":
1375
+ return formatLong2.date({ width: "medium" });
1376
+ case "PPP":
1377
+ return formatLong2.date({ width: "long" });
1378
+ case "PPPP":
1379
+ default:
1380
+ return formatLong2.date({ width: "full" });
1381
+ }
1382
+ };
1383
+ const timeLongFormatter = (pattern, formatLong2) => {
1384
+ switch (pattern) {
1385
+ case "p":
1386
+ return formatLong2.time({ width: "short" });
1387
+ case "pp":
1388
+ return formatLong2.time({ width: "medium" });
1389
+ case "ppp":
1390
+ return formatLong2.time({ width: "long" });
1391
+ case "pppp":
1392
+ default:
1393
+ return formatLong2.time({ width: "full" });
1394
+ }
1395
+ };
1396
+ const dateTimeLongFormatter = (pattern, formatLong2) => {
1397
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
1398
+ const datePattern = matchResult[1];
1399
+ const timePattern = matchResult[2];
1400
+ if (!timePattern) {
1401
+ return dateLongFormatter(pattern, formatLong2);
1402
+ }
1403
+ let dateTimeFormat;
1404
+ switch (datePattern) {
1405
+ case "P":
1406
+ dateTimeFormat = formatLong2.dateTime({ width: "short" });
1407
+ break;
1408
+ case "PP":
1409
+ dateTimeFormat = formatLong2.dateTime({ width: "medium" });
1410
+ break;
1411
+ case "PPP":
1412
+ dateTimeFormat = formatLong2.dateTime({ width: "long" });
1413
+ break;
1414
+ case "PPPP":
1415
+ default:
1416
+ dateTimeFormat = formatLong2.dateTime({ width: "full" });
1417
+ break;
1418
+ }
1419
+ return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
1420
+ };
1421
+ const longFormatters = {
1422
+ p: timeLongFormatter,
1423
+ P: dateTimeLongFormatter
1424
+ };
1425
+ const dayOfYearTokenRE = /^D+$/;
1426
+ const weekYearTokenRE = /^Y+$/;
1427
+ const throwTokens = ["D", "DD", "YY", "YYYY"];
1428
+ function isProtectedDayOfYearToken(token) {
1429
+ return dayOfYearTokenRE.test(token);
1430
+ }
1431
+ function isProtectedWeekYearToken(token) {
1432
+ return weekYearTokenRE.test(token);
1433
+ }
1434
+ function warnOrThrowProtectedError(token, format2, input) {
1435
+ const _message = message(token, format2, input);
1436
+ console.warn(_message);
1437
+ if (throwTokens.includes(token)) throw new RangeError(_message);
1438
+ }
1439
+ function message(token, format2, input) {
1440
+ const subject = token[0] === "Y" ? "years" : "days of the month";
1441
+ return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format2}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1442
+ }
1443
+ const formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1444
+ const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1445
+ const escapedStringRegExp = /^'([^]*?)'?$/;
1446
+ const doubleQuoteRegExp = /''/g;
1447
+ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1448
+ function format(date, formatStr, options) {
1449
+ var _a, _b, _c, _d;
1450
+ const defaultOptions2 = getDefaultOptions();
1451
+ const locale = defaultOptions2.locale ?? enUS;
1452
+ const firstWeekContainsDate = defaultOptions2.firstWeekContainsDate ?? ((_b = (_a = defaultOptions2.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? 1;
1453
+ const weekStartsOn = defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0;
1454
+ const originalDate = toDate(date);
1455
+ if (!isValid(originalDate)) {
1456
+ throw new RangeError("Invalid time value");
1457
+ }
1458
+ let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
1459
+ const firstCharacter = substring[0];
1460
+ if (firstCharacter === "p" || firstCharacter === "P") {
1461
+ const longFormatter = longFormatters[firstCharacter];
1462
+ return longFormatter(substring, locale.formatLong);
1463
+ }
1464
+ return substring;
1465
+ }).join("").match(formattingTokensRegExp).map((substring) => {
1466
+ if (substring === "''") {
1467
+ return { isToken: false, value: "'" };
1468
+ }
1469
+ const firstCharacter = substring[0];
1470
+ if (firstCharacter === "'") {
1471
+ return { isToken: false, value: cleanEscapedString(substring) };
1472
+ }
1473
+ if (formatters[firstCharacter]) {
1474
+ return { isToken: true, value: substring };
1475
+ }
1476
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
1477
+ throw new RangeError(
1478
+ "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
1479
+ );
1480
+ }
1481
+ return { isToken: false, value: substring };
1482
+ });
1483
+ if (locale.localize.preprocessor) {
1484
+ parts = locale.localize.preprocessor(originalDate, parts);
1485
+ }
1486
+ const formatterOptions = {
1487
+ firstWeekContainsDate,
1488
+ weekStartsOn,
1489
+ locale
1490
+ };
1491
+ return parts.map((part) => {
1492
+ if (!part.isToken) return part.value;
1493
+ const token = part.value;
1494
+ if (isProtectedWeekYearToken(token) || isProtectedDayOfYearToken(token)) {
1495
+ warnOrThrowProtectedError(token, formatStr, String(date));
1496
+ }
1497
+ const formatter = formatters[token[0]];
1498
+ return formatter(originalDate, token, locale.localize, formatterOptions);
1499
+ }).join("");
1500
+ }
1501
+ function cleanEscapedString(input) {
1502
+ const matched = input.match(escapedStringRegExp);
1503
+ if (!matched) {
1504
+ return input;
1505
+ }
1506
+ return matched[1].replace(doubleQuoteRegExp, "'");
1507
+ }
1508
+ function parseISO(argument, options) {
1509
+ const additionalDigits = 2;
1510
+ const dateStrings = splitDateString(argument);
1511
+ let date;
1512
+ if (dateStrings.date) {
1513
+ const parseYearResult = parseYear(dateStrings.date, additionalDigits);
1514
+ date = parseDate(parseYearResult.restDateString, parseYearResult.year);
1515
+ }
1516
+ if (!date || isNaN(date.getTime())) {
1517
+ return /* @__PURE__ */ new Date(NaN);
1518
+ }
1519
+ const timestamp = date.getTime();
1520
+ let time = 0;
1521
+ let offset;
1522
+ if (dateStrings.time) {
1523
+ time = parseTime(dateStrings.time);
1524
+ if (isNaN(time)) {
1525
+ return /* @__PURE__ */ new Date(NaN);
1526
+ }
1527
+ }
1528
+ if (dateStrings.timezone) {
1529
+ offset = parseTimezone(dateStrings.timezone);
1530
+ if (isNaN(offset)) {
1531
+ return /* @__PURE__ */ new Date(NaN);
1532
+ }
1533
+ } else {
1534
+ const dirtyDate = new Date(timestamp + time);
1535
+ const result = /* @__PURE__ */ new Date(0);
1536
+ result.setFullYear(
1537
+ dirtyDate.getUTCFullYear(),
1538
+ dirtyDate.getUTCMonth(),
1539
+ dirtyDate.getUTCDate()
1540
+ );
1541
+ result.setHours(
1542
+ dirtyDate.getUTCHours(),
1543
+ dirtyDate.getUTCMinutes(),
1544
+ dirtyDate.getUTCSeconds(),
1545
+ dirtyDate.getUTCMilliseconds()
1546
+ );
1547
+ return result;
1548
+ }
1549
+ return new Date(timestamp + time + offset);
1550
+ }
1551
+ const patterns = {
1552
+ dateTimeDelimiter: /[T ]/,
1553
+ timeZoneDelimiter: /[Z ]/i,
1554
+ timezone: /([Z+-].*)$/
1555
+ };
1556
+ const dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
1557
+ const timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
1558
+ const timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
1559
+ function splitDateString(dateString) {
1560
+ const dateStrings = {};
1561
+ const array = dateString.split(patterns.dateTimeDelimiter);
1562
+ let timeString;
1563
+ if (array.length > 2) {
1564
+ return dateStrings;
1565
+ }
1566
+ if (/:/.test(array[0])) {
1567
+ timeString = array[0];
1568
+ } else {
1569
+ dateStrings.date = array[0];
1570
+ timeString = array[1];
1571
+ if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
1572
+ dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
1573
+ timeString = dateString.substr(
1574
+ dateStrings.date.length,
1575
+ dateString.length
1576
+ );
1577
+ }
1578
+ }
1579
+ if (timeString) {
1580
+ const token = patterns.timezone.exec(timeString);
1581
+ if (token) {
1582
+ dateStrings.time = timeString.replace(token[1], "");
1583
+ dateStrings.timezone = token[1];
1584
+ } else {
1585
+ dateStrings.time = timeString;
1586
+ }
1587
+ }
1588
+ return dateStrings;
1589
+ }
1590
+ function parseYear(dateString, additionalDigits) {
1591
+ const regex = new RegExp(
1592
+ "^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)"
1593
+ );
1594
+ const captures = dateString.match(regex);
1595
+ if (!captures) return { year: NaN, restDateString: "" };
1596
+ const year = captures[1] ? parseInt(captures[1]) : null;
1597
+ const century = captures[2] ? parseInt(captures[2]) : null;
1598
+ return {
1599
+ year: century === null ? year : century * 100,
1600
+ restDateString: dateString.slice((captures[1] || captures[2]).length)
1601
+ };
1602
+ }
1603
+ function parseDate(dateString, year) {
1604
+ if (year === null) return /* @__PURE__ */ new Date(NaN);
1605
+ const captures = dateString.match(dateRegex);
1606
+ if (!captures) return /* @__PURE__ */ new Date(NaN);
1607
+ const isWeekDate = !!captures[4];
1608
+ const dayOfYear = parseDateUnit(captures[1]);
1609
+ const month = parseDateUnit(captures[2]) - 1;
1610
+ const day = parseDateUnit(captures[3]);
1611
+ const week = parseDateUnit(captures[4]);
1612
+ const dayOfWeek = parseDateUnit(captures[5]) - 1;
1613
+ if (isWeekDate) {
1614
+ if (!validateWeekDate(year, week, dayOfWeek)) {
1615
+ return /* @__PURE__ */ new Date(NaN);
1616
+ }
1617
+ return dayOfISOWeekYear(year, week, dayOfWeek);
1618
+ } else {
1619
+ const date = /* @__PURE__ */ new Date(0);
1620
+ if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
1621
+ return /* @__PURE__ */ new Date(NaN);
1622
+ }
1623
+ date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
1624
+ return date;
1625
+ }
1626
+ }
1627
+ function parseDateUnit(value) {
1628
+ return value ? parseInt(value) : 1;
1629
+ }
1630
+ function parseTime(timeString) {
1631
+ const captures = timeString.match(timeRegex);
1632
+ if (!captures) return NaN;
1633
+ const hours = parseTimeUnit(captures[1]);
1634
+ const minutes = parseTimeUnit(captures[2]);
1635
+ const seconds = parseTimeUnit(captures[3]);
1636
+ if (!validateTime(hours, minutes, seconds)) {
1637
+ return NaN;
1638
+ }
1639
+ return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3;
1640
+ }
1641
+ function parseTimeUnit(value) {
1642
+ return value && parseFloat(value.replace(",", ".")) || 0;
1643
+ }
1644
+ function parseTimezone(timezoneString) {
1645
+ if (timezoneString === "Z") return 0;
1646
+ const captures = timezoneString.match(timezoneRegex);
1647
+ if (!captures) return 0;
1648
+ const sign = captures[1] === "+" ? -1 : 1;
1649
+ const hours = parseInt(captures[2]);
1650
+ const minutes = captures[3] && parseInt(captures[3]) || 0;
1651
+ if (!validateTimezone(hours, minutes)) {
1652
+ return NaN;
1653
+ }
1654
+ return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
1655
+ }
1656
+ function dayOfISOWeekYear(isoWeekYear, week, day) {
1657
+ const date = /* @__PURE__ */ new Date(0);
1658
+ date.setUTCFullYear(isoWeekYear, 0, 4);
1659
+ const fourthOfJanuaryDay = date.getUTCDay() || 7;
1660
+ const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
1661
+ date.setUTCDate(date.getUTCDate() + diff);
1662
+ return date;
1663
+ }
1664
+ const daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1665
+ function isLeapYearIndex(year) {
1666
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
1667
+ }
1668
+ function validateDate(year, month, date) {
1669
+ return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
1670
+ }
1671
+ function validateDayOfYearDate(year, dayOfYear) {
1672
+ return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
1673
+ }
1674
+ function validateWeekDate(_year, week, day) {
1675
+ return week >= 1 && week <= 53 && day >= 0 && day <= 6;
1676
+ }
1677
+ function validateTime(hours, minutes, seconds) {
1678
+ if (hours === 24) {
1679
+ return minutes === 0 && seconds === 0;
1680
+ }
1681
+ return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
1682
+ }
1683
+ function validateTimezone(_hours, minutes) {
1684
+ return minutes >= 0 && minutes <= 59;
1685
+ }
1686
+ exports.format = format;
1687
+ exports.isValid = isValid;
1688
+ exports.kebab = kebab;
1689
+ exports.lowercase = lowercase;
1690
+ exports.parseISO = parseISO;
1691
+ exports.transformProps = transformProps;
1692
+ //# sourceMappingURL=parseISO-Dj57mwuH.js.map