@avenue-ticketing/ui 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/react/avatar.d.ts +42 -0
  2. package/dist/react/avatar.js +159 -0
  3. package/dist/react/avatar.js.map +1 -0
  4. package/dist/react/badge.d.ts +12 -0
  5. package/dist/react/badge.js +35 -1
  6. package/dist/react/badge.js.map +1 -1
  7. package/dist/react/button.d.ts +1 -1
  8. package/dist/react/button.js +3 -3
  9. package/dist/react/button.js.map +1 -1
  10. package/dist/react/calendar.d.ts +13 -0
  11. package/dist/react/calendar.js +4639 -0
  12. package/dist/react/calendar.js.map +1 -0
  13. package/dist/react/card.d.ts +11 -0
  14. package/dist/react/card.js +113 -0
  15. package/dist/react/card.js.map +1 -0
  16. package/dist/react/checkbox.d.ts +11 -0
  17. package/dist/react/checkbox.js +131 -0
  18. package/dist/react/checkbox.js.map +1 -0
  19. package/dist/react/datetime-picker.d.ts +21 -0
  20. package/dist/react/datetime-picker.js +6124 -0
  21. package/dist/react/datetime-picker.js.map +1 -0
  22. package/dist/react/dialog.d.ts +7 -0
  23. package/dist/react/dialog.js +211 -90
  24. package/dist/react/dialog.js.map +1 -1
  25. package/dist/react/dropdown.d.ts +126 -0
  26. package/dist/react/dropdown.js +1269 -0
  27. package/dist/react/dropdown.js.map +1 -0
  28. package/dist/react/input.d.ts +7 -0
  29. package/dist/react/input.js +15 -2
  30. package/dist/react/input.js.map +1 -1
  31. package/dist/react/pagination.d.ts +28 -0
  32. package/dist/react/pagination.js +262 -0
  33. package/dist/react/pagination.js.map +1 -0
  34. package/dist/react/popover.d.ts +76 -0
  35. package/dist/react/popover.js +564 -0
  36. package/dist/react/popover.js.map +1 -0
  37. package/dist/react/scroll-header.js +13 -1
  38. package/dist/react/scroll-header.js.map +1 -1
  39. package/dist/react/scroll-wheel.d.ts +45 -0
  40. package/dist/react/scroll-wheel.js +557 -0
  41. package/dist/react/scroll-wheel.js.map +1 -0
  42. package/dist/react/select.d.ts +62 -0
  43. package/dist/react/select.js +889 -0
  44. package/dist/react/select.js.map +1 -0
  45. package/dist/react/sheet.js +1 -1
  46. package/dist/react/sheet.js.map +1 -1
  47. package/dist/react/switch.d.ts +38 -0
  48. package/dist/react/switch.js +117 -0
  49. package/dist/react/switch.js.map +1 -0
  50. package/dist/react/table-pagination.d.ts +15 -0
  51. package/dist/react/table-pagination.js +1153 -0
  52. package/dist/react/table-pagination.js.map +1 -0
  53. package/dist/react/table-view/column-menu.d.ts +15 -0
  54. package/dist/react/table-view/column-menu.js +918 -0
  55. package/dist/react/table-view/column-menu.js.map +1 -0
  56. package/dist/react/table-view/index.d.ts +70 -0
  57. package/dist/react/table-view/index.js +2155 -0
  58. package/dist/react/table-view/index.js.map +1 -0
  59. package/dist/react/table.d.ts +86 -0
  60. package/dist/react/table.js +414 -0
  61. package/dist/react/table.js.map +1 -0
  62. package/dist/react/tabs.d.ts +9 -3
  63. package/dist/react/tabs.js +217 -57
  64. package/dist/react/tabs.js.map +1 -1
  65. package/dist/react/textarea.d.ts +6 -0
  66. package/dist/react/textarea.js +33 -0
  67. package/dist/react/textarea.js.map +1 -0
  68. package/dist/react/time-picker.d.ts +22 -0
  69. package/dist/react/time-picker.js +856 -0
  70. package/dist/react/time-picker.js.map +1 -0
  71. package/dist/react/tooltip.d.ts +45 -0
  72. package/dist/react/tooltip.js +540 -0
  73. package/dist/react/tooltip.js.map +1 -0
  74. package/package.json +1 -1
@@ -0,0 +1,4639 @@
1
+ import * as React26 from 'react';
2
+ import React26__default, { createContext, useContext, useCallback, useMemo, useRef, useEffect, useState, useLayoutEffect } from 'react';
3
+ import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from 'lucide-react';
4
+ import { clsx } from 'clsx';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+
14
+ // ../../node_modules/@date-fns/tz/tzName/index.js
15
+ function tzName(timeZone, date, format2 = "long") {
16
+ return new Intl.DateTimeFormat("en-US", {
17
+ // Enforces engine to render the time. Without the option JavaScriptCore omits it.
18
+ hour: "numeric",
19
+ timeZone,
20
+ timeZoneName: format2
21
+ }).format(date).split(/\s/g).slice(2).join(" ");
22
+ }
23
+
24
+ // ../../node_modules/@date-fns/tz/tzOffset/index.js
25
+ var offsetFormatCache = {};
26
+ var offsetCache = {};
27
+ function tzOffset(timeZone, date) {
28
+ try {
29
+ const format2 = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat("en-US", {
30
+ timeZone,
31
+ timeZoneName: "longOffset"
32
+ }).format;
33
+ const offsetStr = format2(date).split("GMT")[1];
34
+ if (offsetStr in offsetCache) return offsetCache[offsetStr];
35
+ return calcOffset(offsetStr, offsetStr.split(":"));
36
+ } catch {
37
+ if (timeZone in offsetCache) return offsetCache[timeZone];
38
+ const captures = timeZone?.match(offsetRe);
39
+ if (captures) return calcOffset(timeZone, captures.slice(1));
40
+ return NaN;
41
+ }
42
+ }
43
+ var offsetRe = /([+-]\d\d):?(\d\d)?/;
44
+ function calcOffset(cacheStr, values) {
45
+ const hours = +(values[0] || 0);
46
+ const minutes = +(values[1] || 0);
47
+ const seconds = +(values[2] || 0) / 60;
48
+ return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
49
+ }
50
+
51
+ // ../../node_modules/@date-fns/tz/date/mini.js
52
+ var TZDateMini = class _TZDateMini extends Date {
53
+ //#region static
54
+ constructor(...args) {
55
+ super();
56
+ if (args.length > 1 && typeof args[args.length - 1] === "string") {
57
+ this.timeZone = args.pop();
58
+ }
59
+ this.internal = /* @__PURE__ */ new Date();
60
+ if (isNaN(tzOffset(this.timeZone, this))) {
61
+ this.setTime(NaN);
62
+ } else {
63
+ if (!args.length) {
64
+ this.setTime(Date.now());
65
+ } else if (typeof args[0] === "number" && (args.length === 1 || args.length === 2 && typeof args[1] !== "number")) {
66
+ this.setTime(args[0]);
67
+ } else if (typeof args[0] === "string") {
68
+ this.setTime(+new Date(args[0]));
69
+ } else if (args[0] instanceof Date) {
70
+ this.setTime(+args[0]);
71
+ } else {
72
+ this.setTime(+new Date(...args));
73
+ adjustToSystemTZ(this);
74
+ syncToInternal(this);
75
+ }
76
+ }
77
+ }
78
+ static tz(tz, ...args) {
79
+ return args.length ? new _TZDateMini(...args, tz) : new _TZDateMini(Date.now(), tz);
80
+ }
81
+ //#endregion
82
+ //#region time zone
83
+ withTimeZone(timeZone) {
84
+ return new _TZDateMini(+this, timeZone);
85
+ }
86
+ getTimezoneOffset() {
87
+ const offset = -tzOffset(this.timeZone, this);
88
+ return offset > 0 ? Math.floor(offset) : Math.ceil(offset);
89
+ }
90
+ //#endregion
91
+ //#region time
92
+ setTime(time) {
93
+ Date.prototype.setTime.apply(this, arguments);
94
+ syncToInternal(this);
95
+ return +this;
96
+ }
97
+ //#endregion
98
+ //#region date-fns integration
99
+ [/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
100
+ return new _TZDateMini(+new Date(date), this.timeZone);
101
+ }
102
+ //#endregion
103
+ };
104
+ var re = /^(get|set)(?!UTC)/;
105
+ Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
106
+ if (!re.test(method)) return;
107
+ const utcMethod = method.replace(re, "$1UTC");
108
+ if (!TZDateMini.prototype[utcMethod]) return;
109
+ if (method.startsWith("get")) {
110
+ TZDateMini.prototype[method] = function() {
111
+ return this.internal[utcMethod]();
112
+ };
113
+ } else {
114
+ TZDateMini.prototype[method] = function() {
115
+ Date.prototype[utcMethod].apply(this.internal, arguments);
116
+ syncFromInternal(this);
117
+ return +this;
118
+ };
119
+ TZDateMini.prototype[utcMethod] = function() {
120
+ Date.prototype[utcMethod].apply(this, arguments);
121
+ syncToInternal(this);
122
+ return +this;
123
+ };
124
+ }
125
+ });
126
+ function syncToInternal(date) {
127
+ date.internal.setTime(+date);
128
+ date.internal.setUTCSeconds(date.internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, date) * 60));
129
+ }
130
+ function syncFromInternal(date) {
131
+ Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());
132
+ Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());
133
+ adjustToSystemTZ(date);
134
+ }
135
+ function adjustToSystemTZ(date) {
136
+ const baseOffset = tzOffset(date.timeZone, date);
137
+ const offset = baseOffset > 0 ? Math.floor(baseOffset) : Math.ceil(baseOffset);
138
+ const prevHour = /* @__PURE__ */ new Date(+date);
139
+ prevHour.setUTCHours(prevHour.getUTCHours() - 1);
140
+ const systemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
141
+ const prevHourSystemOffset = -(/* @__PURE__ */ new Date(+prevHour)).getTimezoneOffset();
142
+ const systemDSTChange = systemOffset - prevHourSystemOffset;
143
+ const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();
144
+ if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);
145
+ const offsetDiff = systemOffset - offset;
146
+ if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);
147
+ const systemDate = /* @__PURE__ */ new Date(+date);
148
+ systemDate.setUTCSeconds(0);
149
+ const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
150
+ const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;
151
+ if (secondsOffset || systemSecondsOffset) {
152
+ date.internal.setUTCSeconds(date.internal.getUTCSeconds() + secondsOffset);
153
+ Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
154
+ }
155
+ const postBaseOffset = tzOffset(date.timeZone, date);
156
+ const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);
157
+ const postSystemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
158
+ const postOffsetDiff = postSystemOffset - postOffset;
159
+ const offsetChanged = postOffset !== offset;
160
+ const postDiff = postOffsetDiff - offsetDiff;
161
+ if (offsetChanged && postDiff) {
162
+ Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);
163
+ const newBaseOffset = tzOffset(date.timeZone, date);
164
+ const newOffset = newBaseOffset > 0 ? Math.floor(newBaseOffset) : Math.ceil(newBaseOffset);
165
+ const offsetChange = postOffset - newOffset;
166
+ if (offsetChange) {
167
+ date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);
168
+ Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);
169
+ }
170
+ }
171
+ }
172
+
173
+ // ../../node_modules/@date-fns/tz/date/index.js
174
+ var TZDate = class _TZDate extends TZDateMini {
175
+ //#region static
176
+ static tz(tz, ...args) {
177
+ return args.length ? new _TZDate(...args, tz) : new _TZDate(Date.now(), tz);
178
+ }
179
+ //#endregion
180
+ //#region representation
181
+ toISOString() {
182
+ const [sign, hours, minutes] = this.tzComponents();
183
+ const tz = `${sign}${hours}:${minutes}`;
184
+ return this.internal.toISOString().slice(0, -1) + tz;
185
+ }
186
+ toString() {
187
+ return `${this.toDateString()} ${this.toTimeString()}`;
188
+ }
189
+ toDateString() {
190
+ const [day, date, month, year] = this.internal.toUTCString().split(" ");
191
+ return `${day?.slice(0, -1)} ${month} ${date} ${year}`;
192
+ }
193
+ toTimeString() {
194
+ const time = this.internal.toUTCString().split(" ")[4];
195
+ const [sign, hours, minutes] = this.tzComponents();
196
+ return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;
197
+ }
198
+ toLocaleString(locales, options) {
199
+ return Date.prototype.toLocaleString.call(this, locales, {
200
+ ...options,
201
+ timeZone: options?.timeZone || this.timeZone
202
+ });
203
+ }
204
+ toLocaleDateString(locales, options) {
205
+ return Date.prototype.toLocaleDateString.call(this, locales, {
206
+ ...options,
207
+ timeZone: options?.timeZone || this.timeZone
208
+ });
209
+ }
210
+ toLocaleTimeString(locales, options) {
211
+ return Date.prototype.toLocaleTimeString.call(this, locales, {
212
+ ...options,
213
+ timeZone: options?.timeZone || this.timeZone
214
+ });
215
+ }
216
+ //#endregion
217
+ //#region private
218
+ tzComponents() {
219
+ const offset = this.getTimezoneOffset();
220
+ const sign = offset > 0 ? "-" : "+";
221
+ const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, "0");
222
+ const minutes = String(Math.abs(offset) % 60).padStart(2, "0");
223
+ return [sign, hours, minutes];
224
+ }
225
+ //#endregion
226
+ withTimeZone(timeZone) {
227
+ return new _TZDate(+this, timeZone);
228
+ }
229
+ //#region date-fns integration
230
+ [/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
231
+ return new _TZDate(+new Date(date), this.timeZone);
232
+ }
233
+ //#endregion
234
+ };
235
+ var millisecondsInWeek = 6048e5;
236
+ var millisecondsInDay = 864e5;
237
+ var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");
238
+
239
+ // ../../node_modules/date-fns/constructFrom.js
240
+ function constructFrom(date, value) {
241
+ if (typeof date === "function") return date(value);
242
+ if (date && typeof date === "object" && constructFromSymbol in date)
243
+ return date[constructFromSymbol](value);
244
+ if (date instanceof Date) return new date.constructor(value);
245
+ return new Date(value);
246
+ }
247
+
248
+ // ../../node_modules/date-fns/toDate.js
249
+ function toDate(argument, context) {
250
+ return constructFrom(context || argument, argument);
251
+ }
252
+
253
+ // ../../node_modules/date-fns/addDays.js
254
+ function addDays(date, amount, options) {
255
+ const _date = toDate(date, options?.in);
256
+ if (isNaN(amount)) return constructFrom(date, NaN);
257
+ if (!amount) return _date;
258
+ _date.setDate(_date.getDate() + amount);
259
+ return _date;
260
+ }
261
+
262
+ // ../../node_modules/date-fns/addMonths.js
263
+ function addMonths(date, amount, options) {
264
+ const _date = toDate(date, options?.in);
265
+ if (isNaN(amount)) return constructFrom(date, NaN);
266
+ if (!amount) {
267
+ return _date;
268
+ }
269
+ const dayOfMonth = _date.getDate();
270
+ const endOfDesiredMonth = constructFrom(date, _date.getTime());
271
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
272
+ const daysInMonth = endOfDesiredMonth.getDate();
273
+ if (dayOfMonth >= daysInMonth) {
274
+ return endOfDesiredMonth;
275
+ } else {
276
+ _date.setFullYear(
277
+ endOfDesiredMonth.getFullYear(),
278
+ endOfDesiredMonth.getMonth(),
279
+ dayOfMonth
280
+ );
281
+ return _date;
282
+ }
283
+ }
284
+
285
+ // ../../node_modules/date-fns/_lib/defaultOptions.js
286
+ var defaultOptions = {};
287
+ function getDefaultOptions() {
288
+ return defaultOptions;
289
+ }
290
+
291
+ // ../../node_modules/date-fns/startOfWeek.js
292
+ function startOfWeek(date, options) {
293
+ const defaultOptions2 = getDefaultOptions();
294
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
295
+ const _date = toDate(date, options?.in);
296
+ const day = _date.getDay();
297
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
298
+ _date.setDate(_date.getDate() - diff);
299
+ _date.setHours(0, 0, 0, 0);
300
+ return _date;
301
+ }
302
+
303
+ // ../../node_modules/date-fns/startOfISOWeek.js
304
+ function startOfISOWeek(date, options) {
305
+ return startOfWeek(date, { ...options, weekStartsOn: 1 });
306
+ }
307
+
308
+ // ../../node_modules/date-fns/getISOWeekYear.js
309
+ function getISOWeekYear(date, options) {
310
+ const _date = toDate(date, options?.in);
311
+ const year = _date.getFullYear();
312
+ const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
313
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
314
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
315
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
316
+ const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
317
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
318
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
319
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
320
+ if (_date.getTime() >= startOfNextYear.getTime()) {
321
+ return year + 1;
322
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
323
+ return year;
324
+ } else {
325
+ return year - 1;
326
+ }
327
+ }
328
+
329
+ // ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
330
+ function getTimezoneOffsetInMilliseconds(date) {
331
+ const _date = toDate(date);
332
+ const utcDate = new Date(
333
+ Date.UTC(
334
+ _date.getFullYear(),
335
+ _date.getMonth(),
336
+ _date.getDate(),
337
+ _date.getHours(),
338
+ _date.getMinutes(),
339
+ _date.getSeconds(),
340
+ _date.getMilliseconds()
341
+ )
342
+ );
343
+ utcDate.setUTCFullYear(_date.getFullYear());
344
+ return +date - +utcDate;
345
+ }
346
+
347
+ // ../../node_modules/date-fns/_lib/normalizeDates.js
348
+ function normalizeDates(context, ...dates) {
349
+ const normalize = constructFrom.bind(
350
+ null,
351
+ dates.find((date) => typeof date === "object")
352
+ );
353
+ return dates.map(normalize);
354
+ }
355
+
356
+ // ../../node_modules/date-fns/startOfDay.js
357
+ function startOfDay(date, options) {
358
+ const _date = toDate(date, options?.in);
359
+ _date.setHours(0, 0, 0, 0);
360
+ return _date;
361
+ }
362
+
363
+ // ../../node_modules/date-fns/differenceInCalendarDays.js
364
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
365
+ const [laterDate_, earlierDate_] = normalizeDates(
366
+ options?.in,
367
+ laterDate,
368
+ earlierDate
369
+ );
370
+ const laterStartOfDay = startOfDay(laterDate_);
371
+ const earlierStartOfDay = startOfDay(earlierDate_);
372
+ const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
373
+ const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
374
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
375
+ }
376
+
377
+ // ../../node_modules/date-fns/startOfISOWeekYear.js
378
+ function startOfISOWeekYear(date, options) {
379
+ const year = getISOWeekYear(date, options);
380
+ const fourthOfJanuary = constructFrom(date, 0);
381
+ fourthOfJanuary.setFullYear(year, 0, 4);
382
+ fourthOfJanuary.setHours(0, 0, 0, 0);
383
+ return startOfISOWeek(fourthOfJanuary);
384
+ }
385
+
386
+ // ../../node_modules/date-fns/addWeeks.js
387
+ function addWeeks(date, amount, options) {
388
+ return addDays(date, amount * 7, options);
389
+ }
390
+
391
+ // ../../node_modules/date-fns/addYears.js
392
+ function addYears(date, amount, options) {
393
+ return addMonths(date, amount * 12, options);
394
+ }
395
+
396
+ // ../../node_modules/date-fns/max.js
397
+ function max(dates, options) {
398
+ let result;
399
+ let context = options?.in;
400
+ dates.forEach((date) => {
401
+ if (!context && typeof date === "object")
402
+ context = constructFrom.bind(null, date);
403
+ const date_ = toDate(date, context);
404
+ if (!result || result < date_ || isNaN(+date_)) result = date_;
405
+ });
406
+ return constructFrom(context, result || NaN);
407
+ }
408
+
409
+ // ../../node_modules/date-fns/min.js
410
+ function min(dates, options) {
411
+ let result;
412
+ let context = options?.in;
413
+ dates.forEach((date) => {
414
+ if (!context && typeof date === "object")
415
+ context = constructFrom.bind(null, date);
416
+ const date_ = toDate(date, context);
417
+ if (!result || result > date_ || isNaN(+date_)) result = date_;
418
+ });
419
+ return constructFrom(context, result || NaN);
420
+ }
421
+
422
+ // ../../node_modules/date-fns/isSameDay.js
423
+ function isSameDay(laterDate, earlierDate, options) {
424
+ const [dateLeft_, dateRight_] = normalizeDates(
425
+ options?.in,
426
+ laterDate,
427
+ earlierDate
428
+ );
429
+ return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
430
+ }
431
+
432
+ // ../../node_modules/date-fns/isDate.js
433
+ function isDate(value) {
434
+ return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
435
+ }
436
+
437
+ // ../../node_modules/date-fns/isValid.js
438
+ function isValid(date) {
439
+ return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
440
+ }
441
+
442
+ // ../../node_modules/date-fns/differenceInCalendarMonths.js
443
+ function differenceInCalendarMonths(laterDate, earlierDate, options) {
444
+ const [laterDate_, earlierDate_] = normalizeDates(
445
+ options?.in,
446
+ laterDate,
447
+ earlierDate
448
+ );
449
+ const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
450
+ const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
451
+ return yearsDiff * 12 + monthsDiff;
452
+ }
453
+
454
+ // ../../node_modules/date-fns/endOfMonth.js
455
+ function endOfMonth(date, options) {
456
+ const _date = toDate(date, options?.in);
457
+ const month = _date.getMonth();
458
+ _date.setFullYear(_date.getFullYear(), month + 1, 0);
459
+ _date.setHours(23, 59, 59, 999);
460
+ return _date;
461
+ }
462
+
463
+ // ../../node_modules/date-fns/_lib/normalizeInterval.js
464
+ function normalizeInterval(context, interval) {
465
+ const [start, end] = normalizeDates(context, interval.start, interval.end);
466
+ return { start, end };
467
+ }
468
+
469
+ // ../../node_modules/date-fns/eachMonthOfInterval.js
470
+ function eachMonthOfInterval(interval, options) {
471
+ const { start, end } = normalizeInterval(options?.in, interval);
472
+ let reversed = +start > +end;
473
+ const endTime = reversed ? +start : +end;
474
+ const date = reversed ? end : start;
475
+ date.setHours(0, 0, 0, 0);
476
+ date.setDate(1);
477
+ let step = 1;
478
+ const dates = [];
479
+ while (+date <= endTime) {
480
+ dates.push(constructFrom(start, date));
481
+ date.setMonth(date.getMonth() + step);
482
+ }
483
+ return reversed ? dates.reverse() : dates;
484
+ }
485
+
486
+ // ../../node_modules/date-fns/startOfMonth.js
487
+ function startOfMonth(date, options) {
488
+ const _date = toDate(date, options?.in);
489
+ _date.setDate(1);
490
+ _date.setHours(0, 0, 0, 0);
491
+ return _date;
492
+ }
493
+
494
+ // ../../node_modules/date-fns/endOfYear.js
495
+ function endOfYear(date, options) {
496
+ const _date = toDate(date, options?.in);
497
+ const year = _date.getFullYear();
498
+ _date.setFullYear(year + 1, 0, 0);
499
+ _date.setHours(23, 59, 59, 999);
500
+ return _date;
501
+ }
502
+
503
+ // ../../node_modules/date-fns/startOfYear.js
504
+ function startOfYear(date, options) {
505
+ const date_ = toDate(date, options?.in);
506
+ date_.setFullYear(date_.getFullYear(), 0, 1);
507
+ date_.setHours(0, 0, 0, 0);
508
+ return date_;
509
+ }
510
+
511
+ // ../../node_modules/date-fns/eachYearOfInterval.js
512
+ function eachYearOfInterval(interval, options) {
513
+ const { start, end } = normalizeInterval(options?.in, interval);
514
+ let reversed = +start > +end;
515
+ const endTime = reversed ? +start : +end;
516
+ const date = reversed ? end : start;
517
+ date.setHours(0, 0, 0, 0);
518
+ date.setMonth(0, 1);
519
+ let step = 1;
520
+ const dates = [];
521
+ while (+date <= endTime) {
522
+ dates.push(constructFrom(start, date));
523
+ date.setFullYear(date.getFullYear() + step);
524
+ }
525
+ return reversed ? dates.reverse() : dates;
526
+ }
527
+
528
+ // ../../node_modules/date-fns/endOfWeek.js
529
+ function endOfWeek(date, options) {
530
+ const defaultOptions2 = getDefaultOptions();
531
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
532
+ const _date = toDate(date, options?.in);
533
+ const day = _date.getDay();
534
+ const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
535
+ _date.setDate(_date.getDate() + diff);
536
+ _date.setHours(23, 59, 59, 999);
537
+ return _date;
538
+ }
539
+
540
+ // ../../node_modules/date-fns/endOfISOWeek.js
541
+ function endOfISOWeek(date, options) {
542
+ return endOfWeek(date, { ...options, weekStartsOn: 1 });
543
+ }
544
+
545
+ // ../../node_modules/date-fns/locale/en-US/_lib/formatDistance.js
546
+ var formatDistanceLocale = {
547
+ lessThanXSeconds: {
548
+ one: "less than a second",
549
+ other: "less than {{count}} seconds"
550
+ },
551
+ xSeconds: {
552
+ one: "1 second",
553
+ other: "{{count}} seconds"
554
+ },
555
+ halfAMinute: "half a minute",
556
+ lessThanXMinutes: {
557
+ one: "less than a minute",
558
+ other: "less than {{count}} minutes"
559
+ },
560
+ xMinutes: {
561
+ one: "1 minute",
562
+ other: "{{count}} minutes"
563
+ },
564
+ aboutXHours: {
565
+ one: "about 1 hour",
566
+ other: "about {{count}} hours"
567
+ },
568
+ xHours: {
569
+ one: "1 hour",
570
+ other: "{{count}} hours"
571
+ },
572
+ xDays: {
573
+ one: "1 day",
574
+ other: "{{count}} days"
575
+ },
576
+ aboutXWeeks: {
577
+ one: "about 1 week",
578
+ other: "about {{count}} weeks"
579
+ },
580
+ xWeeks: {
581
+ one: "1 week",
582
+ other: "{{count}} weeks"
583
+ },
584
+ aboutXMonths: {
585
+ one: "about 1 month",
586
+ other: "about {{count}} months"
587
+ },
588
+ xMonths: {
589
+ one: "1 month",
590
+ other: "{{count}} months"
591
+ },
592
+ aboutXYears: {
593
+ one: "about 1 year",
594
+ other: "about {{count}} years"
595
+ },
596
+ xYears: {
597
+ one: "1 year",
598
+ other: "{{count}} years"
599
+ },
600
+ overXYears: {
601
+ one: "over 1 year",
602
+ other: "over {{count}} years"
603
+ },
604
+ almostXYears: {
605
+ one: "almost 1 year",
606
+ other: "almost {{count}} years"
607
+ }
608
+ };
609
+ var formatDistance = (token, count, options) => {
610
+ let result;
611
+ const tokenValue = formatDistanceLocale[token];
612
+ if (typeof tokenValue === "string") {
613
+ result = tokenValue;
614
+ } else if (count === 1) {
615
+ result = tokenValue.one;
616
+ } else {
617
+ result = tokenValue.other.replace("{{count}}", count.toString());
618
+ }
619
+ if (options?.addSuffix) {
620
+ if (options.comparison && options.comparison > 0) {
621
+ return "in " + result;
622
+ } else {
623
+ return result + " ago";
624
+ }
625
+ }
626
+ return result;
627
+ };
628
+
629
+ // ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js
630
+ function buildFormatLongFn(args) {
631
+ return (options = {}) => {
632
+ const width = options.width ? String(options.width) : args.defaultWidth;
633
+ const format2 = args.formats[width] || args.formats[args.defaultWidth];
634
+ return format2;
635
+ };
636
+ }
637
+
638
+ // ../../node_modules/date-fns/locale/en-US/_lib/formatLong.js
639
+ var dateFormats = {
640
+ full: "EEEE, MMMM do, y",
641
+ long: "MMMM do, y",
642
+ medium: "MMM d, y",
643
+ short: "MM/dd/yyyy"
644
+ };
645
+ var timeFormats = {
646
+ full: "h:mm:ss a zzzz",
647
+ long: "h:mm:ss a z",
648
+ medium: "h:mm:ss a",
649
+ short: "h:mm a"
650
+ };
651
+ var dateTimeFormats = {
652
+ full: "{{date}} 'at' {{time}}",
653
+ long: "{{date}} 'at' {{time}}",
654
+ medium: "{{date}}, {{time}}",
655
+ short: "{{date}}, {{time}}"
656
+ };
657
+ var formatLong = {
658
+ date: buildFormatLongFn({
659
+ formats: dateFormats,
660
+ defaultWidth: "full"
661
+ }),
662
+ time: buildFormatLongFn({
663
+ formats: timeFormats,
664
+ defaultWidth: "full"
665
+ }),
666
+ dateTime: buildFormatLongFn({
667
+ formats: dateTimeFormats,
668
+ defaultWidth: "full"
669
+ })
670
+ };
671
+
672
+ // ../../node_modules/date-fns/locale/en-US/_lib/formatRelative.js
673
+ var formatRelativeLocale = {
674
+ lastWeek: "'last' eeee 'at' p",
675
+ yesterday: "'yesterday at' p",
676
+ today: "'today at' p",
677
+ tomorrow: "'tomorrow at' p",
678
+ nextWeek: "eeee 'at' p",
679
+ other: "P"
680
+ };
681
+ var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
682
+
683
+ // ../../node_modules/date-fns/locale/_lib/buildLocalizeFn.js
684
+ function buildLocalizeFn(args) {
685
+ return (value, options) => {
686
+ const context = options?.context ? String(options.context) : "standalone";
687
+ let valuesArray;
688
+ if (context === "formatting" && args.formattingValues) {
689
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
690
+ const width = options?.width ? String(options.width) : defaultWidth;
691
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
692
+ } else {
693
+ const defaultWidth = args.defaultWidth;
694
+ const width = options?.width ? String(options.width) : args.defaultWidth;
695
+ valuesArray = args.values[width] || args.values[defaultWidth];
696
+ }
697
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
698
+ return valuesArray[index];
699
+ };
700
+ }
701
+
702
+ // ../../node_modules/date-fns/locale/en-US/_lib/localize.js
703
+ var eraValues = {
704
+ narrow: ["B", "A"],
705
+ abbreviated: ["BC", "AD"],
706
+ wide: ["Before Christ", "Anno Domini"]
707
+ };
708
+ var quarterValues = {
709
+ narrow: ["1", "2", "3", "4"],
710
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
711
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
712
+ };
713
+ var monthValues = {
714
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
715
+ abbreviated: [
716
+ "Jan",
717
+ "Feb",
718
+ "Mar",
719
+ "Apr",
720
+ "May",
721
+ "Jun",
722
+ "Jul",
723
+ "Aug",
724
+ "Sep",
725
+ "Oct",
726
+ "Nov",
727
+ "Dec"
728
+ ],
729
+ wide: [
730
+ "January",
731
+ "February",
732
+ "March",
733
+ "April",
734
+ "May",
735
+ "June",
736
+ "July",
737
+ "August",
738
+ "September",
739
+ "October",
740
+ "November",
741
+ "December"
742
+ ]
743
+ };
744
+ var dayValues = {
745
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
746
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
747
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
748
+ wide: [
749
+ "Sunday",
750
+ "Monday",
751
+ "Tuesday",
752
+ "Wednesday",
753
+ "Thursday",
754
+ "Friday",
755
+ "Saturday"
756
+ ]
757
+ };
758
+ var dayPeriodValues = {
759
+ narrow: {
760
+ am: "a",
761
+ pm: "p",
762
+ midnight: "mi",
763
+ noon: "n",
764
+ morning: "morning",
765
+ afternoon: "afternoon",
766
+ evening: "evening",
767
+ night: "night"
768
+ },
769
+ abbreviated: {
770
+ am: "AM",
771
+ pm: "PM",
772
+ midnight: "midnight",
773
+ noon: "noon",
774
+ morning: "morning",
775
+ afternoon: "afternoon",
776
+ evening: "evening",
777
+ night: "night"
778
+ },
779
+ wide: {
780
+ am: "a.m.",
781
+ pm: "p.m.",
782
+ midnight: "midnight",
783
+ noon: "noon",
784
+ morning: "morning",
785
+ afternoon: "afternoon",
786
+ evening: "evening",
787
+ night: "night"
788
+ }
789
+ };
790
+ var formattingDayPeriodValues = {
791
+ narrow: {
792
+ am: "a",
793
+ pm: "p",
794
+ midnight: "mi",
795
+ noon: "n",
796
+ morning: "in the morning",
797
+ afternoon: "in the afternoon",
798
+ evening: "in the evening",
799
+ night: "at night"
800
+ },
801
+ abbreviated: {
802
+ am: "AM",
803
+ pm: "PM",
804
+ midnight: "midnight",
805
+ noon: "noon",
806
+ morning: "in the morning",
807
+ afternoon: "in the afternoon",
808
+ evening: "in the evening",
809
+ night: "at night"
810
+ },
811
+ wide: {
812
+ am: "a.m.",
813
+ pm: "p.m.",
814
+ midnight: "midnight",
815
+ noon: "noon",
816
+ morning: "in the morning",
817
+ afternoon: "in the afternoon",
818
+ evening: "in the evening",
819
+ night: "at night"
820
+ }
821
+ };
822
+ var ordinalNumber = (dirtyNumber, _options) => {
823
+ const number = Number(dirtyNumber);
824
+ const rem100 = number % 100;
825
+ if (rem100 > 20 || rem100 < 10) {
826
+ switch (rem100 % 10) {
827
+ case 1:
828
+ return number + "st";
829
+ case 2:
830
+ return number + "nd";
831
+ case 3:
832
+ return number + "rd";
833
+ }
834
+ }
835
+ return number + "th";
836
+ };
837
+ var localize = {
838
+ ordinalNumber,
839
+ era: buildLocalizeFn({
840
+ values: eraValues,
841
+ defaultWidth: "wide"
842
+ }),
843
+ quarter: buildLocalizeFn({
844
+ values: quarterValues,
845
+ defaultWidth: "wide",
846
+ argumentCallback: (quarter) => quarter - 1
847
+ }),
848
+ month: buildLocalizeFn({
849
+ values: monthValues,
850
+ defaultWidth: "wide"
851
+ }),
852
+ day: buildLocalizeFn({
853
+ values: dayValues,
854
+ defaultWidth: "wide"
855
+ }),
856
+ dayPeriod: buildLocalizeFn({
857
+ values: dayPeriodValues,
858
+ defaultWidth: "wide",
859
+ formattingValues: formattingDayPeriodValues,
860
+ defaultFormattingWidth: "wide"
861
+ })
862
+ };
863
+
864
+ // ../../node_modules/date-fns/locale/_lib/buildMatchFn.js
865
+ function buildMatchFn(args) {
866
+ return (string, options = {}) => {
867
+ const width = options.width;
868
+ const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
869
+ const matchResult = string.match(matchPattern);
870
+ if (!matchResult) {
871
+ return null;
872
+ }
873
+ const matchedString = matchResult[0];
874
+ const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
875
+ const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
876
+ // [TODO] -- I challenge you to fix the type
877
+ findKey(parsePatterns, (pattern) => pattern.test(matchedString))
878
+ );
879
+ let value;
880
+ value = args.valueCallback ? args.valueCallback(key) : key;
881
+ value = options.valueCallback ? (
882
+ // [TODO] -- I challenge you to fix the type
883
+ options.valueCallback(value)
884
+ ) : value;
885
+ const rest = string.slice(matchedString.length);
886
+ return { value, rest };
887
+ };
888
+ }
889
+ function findKey(object, predicate) {
890
+ for (const key in object) {
891
+ if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
892
+ return key;
893
+ }
894
+ }
895
+ return void 0;
896
+ }
897
+ function findIndex(array, predicate) {
898
+ for (let key = 0; key < array.length; key++) {
899
+ if (predicate(array[key])) {
900
+ return key;
901
+ }
902
+ }
903
+ return void 0;
904
+ }
905
+
906
+ // ../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
907
+ function buildMatchPatternFn(args) {
908
+ return (string, options = {}) => {
909
+ const matchResult = string.match(args.matchPattern);
910
+ if (!matchResult) return null;
911
+ const matchedString = matchResult[0];
912
+ const parseResult = string.match(args.parsePattern);
913
+ if (!parseResult) return null;
914
+ let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
915
+ value = options.valueCallback ? options.valueCallback(value) : value;
916
+ const rest = string.slice(matchedString.length);
917
+ return { value, rest };
918
+ };
919
+ }
920
+
921
+ // ../../node_modules/date-fns/locale/en-US/_lib/match.js
922
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
923
+ var parseOrdinalNumberPattern = /\d+/i;
924
+ var matchEraPatterns = {
925
+ narrow: /^(b|a)/i,
926
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
927
+ wide: /^(before christ|before common era|anno domini|common era)/i
928
+ };
929
+ var parseEraPatterns = {
930
+ any: [/^b/i, /^(a|c)/i]
931
+ };
932
+ var matchQuarterPatterns = {
933
+ narrow: /^[1234]/i,
934
+ abbreviated: /^q[1234]/i,
935
+ wide: /^[1234](th|st|nd|rd)? quarter/i
936
+ };
937
+ var parseQuarterPatterns = {
938
+ any: [/1/i, /2/i, /3/i, /4/i]
939
+ };
940
+ var matchMonthPatterns = {
941
+ narrow: /^[jfmasond]/i,
942
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
943
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
944
+ };
945
+ var parseMonthPatterns = {
946
+ narrow: [
947
+ /^j/i,
948
+ /^f/i,
949
+ /^m/i,
950
+ /^a/i,
951
+ /^m/i,
952
+ /^j/i,
953
+ /^j/i,
954
+ /^a/i,
955
+ /^s/i,
956
+ /^o/i,
957
+ /^n/i,
958
+ /^d/i
959
+ ],
960
+ any: [
961
+ /^ja/i,
962
+ /^f/i,
963
+ /^mar/i,
964
+ /^ap/i,
965
+ /^may/i,
966
+ /^jun/i,
967
+ /^jul/i,
968
+ /^au/i,
969
+ /^s/i,
970
+ /^o/i,
971
+ /^n/i,
972
+ /^d/i
973
+ ]
974
+ };
975
+ var matchDayPatterns = {
976
+ narrow: /^[smtwf]/i,
977
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
978
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
979
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
980
+ };
981
+ var parseDayPatterns = {
982
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
983
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
984
+ };
985
+ var matchDayPeriodPatterns = {
986
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
987
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
988
+ };
989
+ var parseDayPeriodPatterns = {
990
+ any: {
991
+ am: /^a/i,
992
+ pm: /^p/i,
993
+ midnight: /^mi/i,
994
+ noon: /^no/i,
995
+ morning: /morning/i,
996
+ afternoon: /afternoon/i,
997
+ evening: /evening/i,
998
+ night: /night/i
999
+ }
1000
+ };
1001
+ var match = {
1002
+ ordinalNumber: buildMatchPatternFn({
1003
+ matchPattern: matchOrdinalNumberPattern,
1004
+ parsePattern: parseOrdinalNumberPattern,
1005
+ valueCallback: (value) => parseInt(value, 10)
1006
+ }),
1007
+ era: buildMatchFn({
1008
+ matchPatterns: matchEraPatterns,
1009
+ defaultMatchWidth: "wide",
1010
+ parsePatterns: parseEraPatterns,
1011
+ defaultParseWidth: "any"
1012
+ }),
1013
+ quarter: buildMatchFn({
1014
+ matchPatterns: matchQuarterPatterns,
1015
+ defaultMatchWidth: "wide",
1016
+ parsePatterns: parseQuarterPatterns,
1017
+ defaultParseWidth: "any",
1018
+ valueCallback: (index) => index + 1
1019
+ }),
1020
+ month: buildMatchFn({
1021
+ matchPatterns: matchMonthPatterns,
1022
+ defaultMatchWidth: "wide",
1023
+ parsePatterns: parseMonthPatterns,
1024
+ defaultParseWidth: "any"
1025
+ }),
1026
+ day: buildMatchFn({
1027
+ matchPatterns: matchDayPatterns,
1028
+ defaultMatchWidth: "wide",
1029
+ parsePatterns: parseDayPatterns,
1030
+ defaultParseWidth: "any"
1031
+ }),
1032
+ dayPeriod: buildMatchFn({
1033
+ matchPatterns: matchDayPeriodPatterns,
1034
+ defaultMatchWidth: "any",
1035
+ parsePatterns: parseDayPeriodPatterns,
1036
+ defaultParseWidth: "any"
1037
+ })
1038
+ };
1039
+
1040
+ // ../../node_modules/date-fns/locale/en-US.js
1041
+ var enUS = {
1042
+ code: "en-US",
1043
+ formatDistance,
1044
+ formatLong,
1045
+ formatRelative,
1046
+ localize,
1047
+ match,
1048
+ options: {
1049
+ weekStartsOn: 0,
1050
+ firstWeekContainsDate: 1
1051
+ }
1052
+ };
1053
+
1054
+ // ../../node_modules/date-fns/getDayOfYear.js
1055
+ function getDayOfYear(date, options) {
1056
+ const _date = toDate(date, options?.in);
1057
+ const diff = differenceInCalendarDays(_date, startOfYear(_date));
1058
+ const dayOfYear = diff + 1;
1059
+ return dayOfYear;
1060
+ }
1061
+
1062
+ // ../../node_modules/date-fns/getISOWeek.js
1063
+ function getISOWeek(date, options) {
1064
+ const _date = toDate(date, options?.in);
1065
+ const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
1066
+ return Math.round(diff / millisecondsInWeek) + 1;
1067
+ }
1068
+
1069
+ // ../../node_modules/date-fns/getWeekYear.js
1070
+ function getWeekYear(date, options) {
1071
+ const _date = toDate(date, options?.in);
1072
+ const year = _date.getFullYear();
1073
+ const defaultOptions2 = getDefaultOptions();
1074
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
1075
+ const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
1076
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
1077
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
1078
+ const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
1079
+ const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
1080
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
1081
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
1082
+ const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
1083
+ if (+_date >= +startOfNextYear) {
1084
+ return year + 1;
1085
+ } else if (+_date >= +startOfThisYear) {
1086
+ return year;
1087
+ } else {
1088
+ return year - 1;
1089
+ }
1090
+ }
1091
+
1092
+ // ../../node_modules/date-fns/startOfWeekYear.js
1093
+ function startOfWeekYear(date, options) {
1094
+ const defaultOptions2 = getDefaultOptions();
1095
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
1096
+ const year = getWeekYear(date, options);
1097
+ const firstWeek = constructFrom(options?.in || date, 0);
1098
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
1099
+ firstWeek.setHours(0, 0, 0, 0);
1100
+ const _date = startOfWeek(firstWeek, options);
1101
+ return _date;
1102
+ }
1103
+
1104
+ // ../../node_modules/date-fns/getWeek.js
1105
+ function getWeek(date, options) {
1106
+ const _date = toDate(date, options?.in);
1107
+ const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
1108
+ return Math.round(diff / millisecondsInWeek) + 1;
1109
+ }
1110
+
1111
+ // ../../node_modules/date-fns/_lib/addLeadingZeros.js
1112
+ function addLeadingZeros(number, targetLength) {
1113
+ const sign = number < 0 ? "-" : "";
1114
+ const output = Math.abs(number).toString().padStart(targetLength, "0");
1115
+ return sign + output;
1116
+ }
1117
+
1118
+ // ../../node_modules/date-fns/_lib/format/lightFormatters.js
1119
+ var lightFormatters = {
1120
+ // Year
1121
+ y(date, token) {
1122
+ const signedYear = date.getFullYear();
1123
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1124
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
1125
+ },
1126
+ // Month
1127
+ M(date, token) {
1128
+ const month = date.getMonth();
1129
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
1130
+ },
1131
+ // Day of the month
1132
+ d(date, token) {
1133
+ return addLeadingZeros(date.getDate(), token.length);
1134
+ },
1135
+ // AM or PM
1136
+ a(date, token) {
1137
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1138
+ switch (token) {
1139
+ case "a":
1140
+ case "aa":
1141
+ return dayPeriodEnumValue.toUpperCase();
1142
+ case "aaa":
1143
+ return dayPeriodEnumValue;
1144
+ case "aaaaa":
1145
+ return dayPeriodEnumValue[0];
1146
+ case "aaaa":
1147
+ default:
1148
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
1149
+ }
1150
+ },
1151
+ // Hour [1-12]
1152
+ h(date, token) {
1153
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
1154
+ },
1155
+ // Hour [0-23]
1156
+ H(date, token) {
1157
+ return addLeadingZeros(date.getHours(), token.length);
1158
+ },
1159
+ // Minute
1160
+ m(date, token) {
1161
+ return addLeadingZeros(date.getMinutes(), token.length);
1162
+ },
1163
+ // Second
1164
+ s(date, token) {
1165
+ return addLeadingZeros(date.getSeconds(), token.length);
1166
+ },
1167
+ // Fraction of second
1168
+ S(date, token) {
1169
+ const numberOfDigits = token.length;
1170
+ const milliseconds = date.getMilliseconds();
1171
+ const fractionalSeconds = Math.trunc(
1172
+ milliseconds * Math.pow(10, numberOfDigits - 3)
1173
+ );
1174
+ return addLeadingZeros(fractionalSeconds, token.length);
1175
+ }
1176
+ };
1177
+
1178
+ // ../../node_modules/date-fns/_lib/format/formatters.js
1179
+ var dayPeriodEnum = {
1180
+ midnight: "midnight",
1181
+ noon: "noon",
1182
+ morning: "morning",
1183
+ afternoon: "afternoon",
1184
+ evening: "evening",
1185
+ night: "night"
1186
+ };
1187
+ var formatters = {
1188
+ // Era
1189
+ G: function(date, token, localize2) {
1190
+ const era = date.getFullYear() > 0 ? 1 : 0;
1191
+ switch (token) {
1192
+ // AD, BC
1193
+ case "G":
1194
+ case "GG":
1195
+ case "GGG":
1196
+ return localize2.era(era, { width: "abbreviated" });
1197
+ // A, B
1198
+ case "GGGGG":
1199
+ return localize2.era(era, { width: "narrow" });
1200
+ // Anno Domini, Before Christ
1201
+ case "GGGG":
1202
+ default:
1203
+ return localize2.era(era, { width: "wide" });
1204
+ }
1205
+ },
1206
+ // Year
1207
+ y: function(date, token, localize2) {
1208
+ if (token === "yo") {
1209
+ const signedYear = date.getFullYear();
1210
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1211
+ return localize2.ordinalNumber(year, { unit: "year" });
1212
+ }
1213
+ return lightFormatters.y(date, token);
1214
+ },
1215
+ // Local week-numbering year
1216
+ Y: function(date, token, localize2, options) {
1217
+ const signedWeekYear = getWeekYear(date, options);
1218
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1219
+ if (token === "YY") {
1220
+ const twoDigitYear = weekYear % 100;
1221
+ return addLeadingZeros(twoDigitYear, 2);
1222
+ }
1223
+ if (token === "Yo") {
1224
+ return localize2.ordinalNumber(weekYear, { unit: "year" });
1225
+ }
1226
+ return addLeadingZeros(weekYear, token.length);
1227
+ },
1228
+ // ISO week-numbering year
1229
+ R: function(date, token) {
1230
+ const isoWeekYear = getISOWeekYear(date);
1231
+ return addLeadingZeros(isoWeekYear, token.length);
1232
+ },
1233
+ // Extended year. This is a single number designating the year of this calendar system.
1234
+ // The main difference between `y` and `u` localizers are B.C. years:
1235
+ // | Year | `y` | `u` |
1236
+ // |------|-----|-----|
1237
+ // | AC 1 | 1 | 1 |
1238
+ // | BC 1 | 1 | 0 |
1239
+ // | BC 2 | 2 | -1 |
1240
+ // Also `yy` always returns the last two digits of a year,
1241
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1242
+ u: function(date, token) {
1243
+ const year = date.getFullYear();
1244
+ return addLeadingZeros(year, token.length);
1245
+ },
1246
+ // Quarter
1247
+ Q: function(date, token, localize2) {
1248
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1249
+ switch (token) {
1250
+ // 1, 2, 3, 4
1251
+ case "Q":
1252
+ return String(quarter);
1253
+ // 01, 02, 03, 04
1254
+ case "QQ":
1255
+ return addLeadingZeros(quarter, 2);
1256
+ // 1st, 2nd, 3rd, 4th
1257
+ case "Qo":
1258
+ return localize2.ordinalNumber(quarter, { unit: "quarter" });
1259
+ // Q1, Q2, Q3, Q4
1260
+ case "QQQ":
1261
+ return localize2.quarter(quarter, {
1262
+ width: "abbreviated",
1263
+ context: "formatting"
1264
+ });
1265
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1266
+ case "QQQQQ":
1267
+ return localize2.quarter(quarter, {
1268
+ width: "narrow",
1269
+ context: "formatting"
1270
+ });
1271
+ // 1st quarter, 2nd quarter, ...
1272
+ case "QQQQ":
1273
+ default:
1274
+ return localize2.quarter(quarter, {
1275
+ width: "wide",
1276
+ context: "formatting"
1277
+ });
1278
+ }
1279
+ },
1280
+ // Stand-alone quarter
1281
+ q: function(date, token, localize2) {
1282
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1283
+ switch (token) {
1284
+ // 1, 2, 3, 4
1285
+ case "q":
1286
+ return String(quarter);
1287
+ // 01, 02, 03, 04
1288
+ case "qq":
1289
+ return addLeadingZeros(quarter, 2);
1290
+ // 1st, 2nd, 3rd, 4th
1291
+ case "qo":
1292
+ return localize2.ordinalNumber(quarter, { unit: "quarter" });
1293
+ // Q1, Q2, Q3, Q4
1294
+ case "qqq":
1295
+ return localize2.quarter(quarter, {
1296
+ width: "abbreviated",
1297
+ context: "standalone"
1298
+ });
1299
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1300
+ case "qqqqq":
1301
+ return localize2.quarter(quarter, {
1302
+ width: "narrow",
1303
+ context: "standalone"
1304
+ });
1305
+ // 1st quarter, 2nd quarter, ...
1306
+ case "qqqq":
1307
+ default:
1308
+ return localize2.quarter(quarter, {
1309
+ width: "wide",
1310
+ context: "standalone"
1311
+ });
1312
+ }
1313
+ },
1314
+ // Month
1315
+ M: function(date, token, localize2) {
1316
+ const month = date.getMonth();
1317
+ switch (token) {
1318
+ case "M":
1319
+ case "MM":
1320
+ return lightFormatters.M(date, token);
1321
+ // 1st, 2nd, ..., 12th
1322
+ case "Mo":
1323
+ return localize2.ordinalNumber(month + 1, { unit: "month" });
1324
+ // Jan, Feb, ..., Dec
1325
+ case "MMM":
1326
+ return localize2.month(month, {
1327
+ width: "abbreviated",
1328
+ context: "formatting"
1329
+ });
1330
+ // J, F, ..., D
1331
+ case "MMMMM":
1332
+ return localize2.month(month, {
1333
+ width: "narrow",
1334
+ context: "formatting"
1335
+ });
1336
+ // January, February, ..., December
1337
+ case "MMMM":
1338
+ default:
1339
+ return localize2.month(month, { width: "wide", context: "formatting" });
1340
+ }
1341
+ },
1342
+ // Stand-alone month
1343
+ L: function(date, token, localize2) {
1344
+ const month = date.getMonth();
1345
+ switch (token) {
1346
+ // 1, 2, ..., 12
1347
+ case "L":
1348
+ return String(month + 1);
1349
+ // 01, 02, ..., 12
1350
+ case "LL":
1351
+ return addLeadingZeros(month + 1, 2);
1352
+ // 1st, 2nd, ..., 12th
1353
+ case "Lo":
1354
+ return localize2.ordinalNumber(month + 1, { unit: "month" });
1355
+ // Jan, Feb, ..., Dec
1356
+ case "LLL":
1357
+ return localize2.month(month, {
1358
+ width: "abbreviated",
1359
+ context: "standalone"
1360
+ });
1361
+ // J, F, ..., D
1362
+ case "LLLLL":
1363
+ return localize2.month(month, {
1364
+ width: "narrow",
1365
+ context: "standalone"
1366
+ });
1367
+ // January, February, ..., December
1368
+ case "LLLL":
1369
+ default:
1370
+ return localize2.month(month, { width: "wide", context: "standalone" });
1371
+ }
1372
+ },
1373
+ // Local week of year
1374
+ w: function(date, token, localize2, options) {
1375
+ const week = getWeek(date, options);
1376
+ if (token === "wo") {
1377
+ return localize2.ordinalNumber(week, { unit: "week" });
1378
+ }
1379
+ return addLeadingZeros(week, token.length);
1380
+ },
1381
+ // ISO week of year
1382
+ I: function(date, token, localize2) {
1383
+ const isoWeek = getISOWeek(date);
1384
+ if (token === "Io") {
1385
+ return localize2.ordinalNumber(isoWeek, { unit: "week" });
1386
+ }
1387
+ return addLeadingZeros(isoWeek, token.length);
1388
+ },
1389
+ // Day of the month
1390
+ d: function(date, token, localize2) {
1391
+ if (token === "do") {
1392
+ return localize2.ordinalNumber(date.getDate(), { unit: "date" });
1393
+ }
1394
+ return lightFormatters.d(date, token);
1395
+ },
1396
+ // Day of year
1397
+ D: function(date, token, localize2) {
1398
+ const dayOfYear = getDayOfYear(date);
1399
+ if (token === "Do") {
1400
+ return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
1401
+ }
1402
+ return addLeadingZeros(dayOfYear, token.length);
1403
+ },
1404
+ // Day of week
1405
+ E: function(date, token, localize2) {
1406
+ const dayOfWeek = date.getDay();
1407
+ switch (token) {
1408
+ // Tue
1409
+ case "E":
1410
+ case "EE":
1411
+ case "EEE":
1412
+ return localize2.day(dayOfWeek, {
1413
+ width: "abbreviated",
1414
+ context: "formatting"
1415
+ });
1416
+ // T
1417
+ case "EEEEE":
1418
+ return localize2.day(dayOfWeek, {
1419
+ width: "narrow",
1420
+ context: "formatting"
1421
+ });
1422
+ // Tu
1423
+ case "EEEEEE":
1424
+ return localize2.day(dayOfWeek, {
1425
+ width: "short",
1426
+ context: "formatting"
1427
+ });
1428
+ // Tuesday
1429
+ case "EEEE":
1430
+ default:
1431
+ return localize2.day(dayOfWeek, {
1432
+ width: "wide",
1433
+ context: "formatting"
1434
+ });
1435
+ }
1436
+ },
1437
+ // Local day of week
1438
+ e: function(date, token, localize2, options) {
1439
+ const dayOfWeek = date.getDay();
1440
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1441
+ switch (token) {
1442
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1443
+ case "e":
1444
+ return String(localDayOfWeek);
1445
+ // Padded numerical value
1446
+ case "ee":
1447
+ return addLeadingZeros(localDayOfWeek, 2);
1448
+ // 1st, 2nd, ..., 7th
1449
+ case "eo":
1450
+ return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
1451
+ case "eee":
1452
+ return localize2.day(dayOfWeek, {
1453
+ width: "abbreviated",
1454
+ context: "formatting"
1455
+ });
1456
+ // T
1457
+ case "eeeee":
1458
+ return localize2.day(dayOfWeek, {
1459
+ width: "narrow",
1460
+ context: "formatting"
1461
+ });
1462
+ // Tu
1463
+ case "eeeeee":
1464
+ return localize2.day(dayOfWeek, {
1465
+ width: "short",
1466
+ context: "formatting"
1467
+ });
1468
+ // Tuesday
1469
+ case "eeee":
1470
+ default:
1471
+ return localize2.day(dayOfWeek, {
1472
+ width: "wide",
1473
+ context: "formatting"
1474
+ });
1475
+ }
1476
+ },
1477
+ // Stand-alone local day of week
1478
+ c: function(date, token, localize2, options) {
1479
+ const dayOfWeek = date.getDay();
1480
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1481
+ switch (token) {
1482
+ // Numerical value (same as in `e`)
1483
+ case "c":
1484
+ return String(localDayOfWeek);
1485
+ // Padded numerical value
1486
+ case "cc":
1487
+ return addLeadingZeros(localDayOfWeek, token.length);
1488
+ // 1st, 2nd, ..., 7th
1489
+ case "co":
1490
+ return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
1491
+ case "ccc":
1492
+ return localize2.day(dayOfWeek, {
1493
+ width: "abbreviated",
1494
+ context: "standalone"
1495
+ });
1496
+ // T
1497
+ case "ccccc":
1498
+ return localize2.day(dayOfWeek, {
1499
+ width: "narrow",
1500
+ context: "standalone"
1501
+ });
1502
+ // Tu
1503
+ case "cccccc":
1504
+ return localize2.day(dayOfWeek, {
1505
+ width: "short",
1506
+ context: "standalone"
1507
+ });
1508
+ // Tuesday
1509
+ case "cccc":
1510
+ default:
1511
+ return localize2.day(dayOfWeek, {
1512
+ width: "wide",
1513
+ context: "standalone"
1514
+ });
1515
+ }
1516
+ },
1517
+ // ISO day of week
1518
+ i: function(date, token, localize2) {
1519
+ const dayOfWeek = date.getDay();
1520
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1521
+ switch (token) {
1522
+ // 2
1523
+ case "i":
1524
+ return String(isoDayOfWeek);
1525
+ // 02
1526
+ case "ii":
1527
+ return addLeadingZeros(isoDayOfWeek, token.length);
1528
+ // 2nd
1529
+ case "io":
1530
+ return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
1531
+ // Tue
1532
+ case "iii":
1533
+ return localize2.day(dayOfWeek, {
1534
+ width: "abbreviated",
1535
+ context: "formatting"
1536
+ });
1537
+ // T
1538
+ case "iiiii":
1539
+ return localize2.day(dayOfWeek, {
1540
+ width: "narrow",
1541
+ context: "formatting"
1542
+ });
1543
+ // Tu
1544
+ case "iiiiii":
1545
+ return localize2.day(dayOfWeek, {
1546
+ width: "short",
1547
+ context: "formatting"
1548
+ });
1549
+ // Tuesday
1550
+ case "iiii":
1551
+ default:
1552
+ return localize2.day(dayOfWeek, {
1553
+ width: "wide",
1554
+ context: "formatting"
1555
+ });
1556
+ }
1557
+ },
1558
+ // AM or PM
1559
+ a: function(date, token, localize2) {
1560
+ const hours = date.getHours();
1561
+ const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1562
+ switch (token) {
1563
+ case "a":
1564
+ case "aa":
1565
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1566
+ width: "abbreviated",
1567
+ context: "formatting"
1568
+ });
1569
+ case "aaa":
1570
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1571
+ width: "abbreviated",
1572
+ context: "formatting"
1573
+ }).toLowerCase();
1574
+ case "aaaaa":
1575
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1576
+ width: "narrow",
1577
+ context: "formatting"
1578
+ });
1579
+ case "aaaa":
1580
+ default:
1581
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1582
+ width: "wide",
1583
+ context: "formatting"
1584
+ });
1585
+ }
1586
+ },
1587
+ // AM, PM, midnight, noon
1588
+ b: function(date, token, localize2) {
1589
+ const hours = date.getHours();
1590
+ let dayPeriodEnumValue;
1591
+ if (hours === 12) {
1592
+ dayPeriodEnumValue = dayPeriodEnum.noon;
1593
+ } else if (hours === 0) {
1594
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
1595
+ } else {
1596
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1597
+ }
1598
+ switch (token) {
1599
+ case "b":
1600
+ case "bb":
1601
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1602
+ width: "abbreviated",
1603
+ context: "formatting"
1604
+ });
1605
+ case "bbb":
1606
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1607
+ width: "abbreviated",
1608
+ context: "formatting"
1609
+ }).toLowerCase();
1610
+ case "bbbbb":
1611
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1612
+ width: "narrow",
1613
+ context: "formatting"
1614
+ });
1615
+ case "bbbb":
1616
+ default:
1617
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1618
+ width: "wide",
1619
+ context: "formatting"
1620
+ });
1621
+ }
1622
+ },
1623
+ // in the morning, in the afternoon, in the evening, at night
1624
+ B: function(date, token, localize2) {
1625
+ const hours = date.getHours();
1626
+ let dayPeriodEnumValue;
1627
+ if (hours >= 17) {
1628
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1629
+ } else if (hours >= 12) {
1630
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1631
+ } else if (hours >= 4) {
1632
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1633
+ } else {
1634
+ dayPeriodEnumValue = dayPeriodEnum.night;
1635
+ }
1636
+ switch (token) {
1637
+ case "B":
1638
+ case "BB":
1639
+ case "BBB":
1640
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1641
+ width: "abbreviated",
1642
+ context: "formatting"
1643
+ });
1644
+ case "BBBBB":
1645
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1646
+ width: "narrow",
1647
+ context: "formatting"
1648
+ });
1649
+ case "BBBB":
1650
+ default:
1651
+ return localize2.dayPeriod(dayPeriodEnumValue, {
1652
+ width: "wide",
1653
+ context: "formatting"
1654
+ });
1655
+ }
1656
+ },
1657
+ // Hour [1-12]
1658
+ h: function(date, token, localize2) {
1659
+ if (token === "ho") {
1660
+ let hours = date.getHours() % 12;
1661
+ if (hours === 0) hours = 12;
1662
+ return localize2.ordinalNumber(hours, { unit: "hour" });
1663
+ }
1664
+ return lightFormatters.h(date, token);
1665
+ },
1666
+ // Hour [0-23]
1667
+ H: function(date, token, localize2) {
1668
+ if (token === "Ho") {
1669
+ return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
1670
+ }
1671
+ return lightFormatters.H(date, token);
1672
+ },
1673
+ // Hour [0-11]
1674
+ K: function(date, token, localize2) {
1675
+ const hours = date.getHours() % 12;
1676
+ if (token === "Ko") {
1677
+ return localize2.ordinalNumber(hours, { unit: "hour" });
1678
+ }
1679
+ return addLeadingZeros(hours, token.length);
1680
+ },
1681
+ // Hour [1-24]
1682
+ k: function(date, token, localize2) {
1683
+ let hours = date.getHours();
1684
+ if (hours === 0) hours = 24;
1685
+ if (token === "ko") {
1686
+ return localize2.ordinalNumber(hours, { unit: "hour" });
1687
+ }
1688
+ return addLeadingZeros(hours, token.length);
1689
+ },
1690
+ // Minute
1691
+ m: function(date, token, localize2) {
1692
+ if (token === "mo") {
1693
+ return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
1694
+ }
1695
+ return lightFormatters.m(date, token);
1696
+ },
1697
+ // Second
1698
+ s: function(date, token, localize2) {
1699
+ if (token === "so") {
1700
+ return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
1701
+ }
1702
+ return lightFormatters.s(date, token);
1703
+ },
1704
+ // Fraction of second
1705
+ S: function(date, token) {
1706
+ return lightFormatters.S(date, token);
1707
+ },
1708
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1709
+ X: function(date, token, _localize) {
1710
+ const timezoneOffset = date.getTimezoneOffset();
1711
+ if (timezoneOffset === 0) {
1712
+ return "Z";
1713
+ }
1714
+ switch (token) {
1715
+ // Hours and optional minutes
1716
+ case "X":
1717
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1718
+ // Hours, minutes and optional seconds without `:` delimiter
1719
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1720
+ // so this token always has the same output as `XX`
1721
+ case "XXXX":
1722
+ case "XX":
1723
+ return formatTimezone(timezoneOffset);
1724
+ // Hours, minutes and optional seconds with `:` delimiter
1725
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1726
+ // so this token always has the same output as `XXX`
1727
+ case "XXXXX":
1728
+ case "XXX":
1729
+ // Hours and minutes with `:` delimiter
1730
+ default:
1731
+ return formatTimezone(timezoneOffset, ":");
1732
+ }
1733
+ },
1734
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1735
+ x: function(date, token, _localize) {
1736
+ const timezoneOffset = date.getTimezoneOffset();
1737
+ switch (token) {
1738
+ // Hours and optional minutes
1739
+ case "x":
1740
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1741
+ // Hours, minutes and optional seconds without `:` delimiter
1742
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1743
+ // so this token always has the same output as `xx`
1744
+ case "xxxx":
1745
+ case "xx":
1746
+ return formatTimezone(timezoneOffset);
1747
+ // Hours, minutes and optional seconds with `:` delimiter
1748
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1749
+ // so this token always has the same output as `xxx`
1750
+ case "xxxxx":
1751
+ case "xxx":
1752
+ // Hours and minutes with `:` delimiter
1753
+ default:
1754
+ return formatTimezone(timezoneOffset, ":");
1755
+ }
1756
+ },
1757
+ // Timezone (GMT)
1758
+ O: function(date, token, _localize) {
1759
+ const timezoneOffset = date.getTimezoneOffset();
1760
+ switch (token) {
1761
+ // Short
1762
+ case "O":
1763
+ case "OO":
1764
+ case "OOO":
1765
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1766
+ // Long
1767
+ case "OOOO":
1768
+ default:
1769
+ return "GMT" + formatTimezone(timezoneOffset, ":");
1770
+ }
1771
+ },
1772
+ // Timezone (specific non-location)
1773
+ z: function(date, token, _localize) {
1774
+ const timezoneOffset = date.getTimezoneOffset();
1775
+ switch (token) {
1776
+ // Short
1777
+ case "z":
1778
+ case "zz":
1779
+ case "zzz":
1780
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1781
+ // Long
1782
+ case "zzzz":
1783
+ default:
1784
+ return "GMT" + formatTimezone(timezoneOffset, ":");
1785
+ }
1786
+ },
1787
+ // Seconds timestamp
1788
+ t: function(date, token, _localize) {
1789
+ const timestamp = Math.trunc(+date / 1e3);
1790
+ return addLeadingZeros(timestamp, token.length);
1791
+ },
1792
+ // Milliseconds timestamp
1793
+ T: function(date, token, _localize) {
1794
+ return addLeadingZeros(+date, token.length);
1795
+ }
1796
+ };
1797
+ function formatTimezoneShort(offset, delimiter = "") {
1798
+ const sign = offset > 0 ? "-" : "+";
1799
+ const absOffset = Math.abs(offset);
1800
+ const hours = Math.trunc(absOffset / 60);
1801
+ const minutes = absOffset % 60;
1802
+ if (minutes === 0) {
1803
+ return sign + String(hours);
1804
+ }
1805
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1806
+ }
1807
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
1808
+ if (offset % 60 === 0) {
1809
+ const sign = offset > 0 ? "-" : "+";
1810
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1811
+ }
1812
+ return formatTimezone(offset, delimiter);
1813
+ }
1814
+ function formatTimezone(offset, delimiter = "") {
1815
+ const sign = offset > 0 ? "-" : "+";
1816
+ const absOffset = Math.abs(offset);
1817
+ const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
1818
+ const minutes = addLeadingZeros(absOffset % 60, 2);
1819
+ return sign + hours + delimiter + minutes;
1820
+ }
1821
+
1822
+ // ../../node_modules/date-fns/_lib/format/longFormatters.js
1823
+ var dateLongFormatter = (pattern, formatLong2) => {
1824
+ switch (pattern) {
1825
+ case "P":
1826
+ return formatLong2.date({ width: "short" });
1827
+ case "PP":
1828
+ return formatLong2.date({ width: "medium" });
1829
+ case "PPP":
1830
+ return formatLong2.date({ width: "long" });
1831
+ case "PPPP":
1832
+ default:
1833
+ return formatLong2.date({ width: "full" });
1834
+ }
1835
+ };
1836
+ var timeLongFormatter = (pattern, formatLong2) => {
1837
+ switch (pattern) {
1838
+ case "p":
1839
+ return formatLong2.time({ width: "short" });
1840
+ case "pp":
1841
+ return formatLong2.time({ width: "medium" });
1842
+ case "ppp":
1843
+ return formatLong2.time({ width: "long" });
1844
+ case "pppp":
1845
+ default:
1846
+ return formatLong2.time({ width: "full" });
1847
+ }
1848
+ };
1849
+ var dateTimeLongFormatter = (pattern, formatLong2) => {
1850
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
1851
+ const datePattern = matchResult[1];
1852
+ const timePattern = matchResult[2];
1853
+ if (!timePattern) {
1854
+ return dateLongFormatter(pattern, formatLong2);
1855
+ }
1856
+ let dateTimeFormat;
1857
+ switch (datePattern) {
1858
+ case "P":
1859
+ dateTimeFormat = formatLong2.dateTime({ width: "short" });
1860
+ break;
1861
+ case "PP":
1862
+ dateTimeFormat = formatLong2.dateTime({ width: "medium" });
1863
+ break;
1864
+ case "PPP":
1865
+ dateTimeFormat = formatLong2.dateTime({ width: "long" });
1866
+ break;
1867
+ case "PPPP":
1868
+ default:
1869
+ dateTimeFormat = formatLong2.dateTime({ width: "full" });
1870
+ break;
1871
+ }
1872
+ return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
1873
+ };
1874
+ var longFormatters = {
1875
+ p: timeLongFormatter,
1876
+ P: dateTimeLongFormatter
1877
+ };
1878
+
1879
+ // ../../node_modules/date-fns/_lib/protectedTokens.js
1880
+ var dayOfYearTokenRE = /^D+$/;
1881
+ var weekYearTokenRE = /^Y+$/;
1882
+ var throwTokens = ["D", "DD", "YY", "YYYY"];
1883
+ function isProtectedDayOfYearToken(token) {
1884
+ return dayOfYearTokenRE.test(token);
1885
+ }
1886
+ function isProtectedWeekYearToken(token) {
1887
+ return weekYearTokenRE.test(token);
1888
+ }
1889
+ function warnOrThrowProtectedError(token, format2, input) {
1890
+ const _message = message(token, format2, input);
1891
+ console.warn(_message);
1892
+ if (throwTokens.includes(token)) throw new RangeError(_message);
1893
+ }
1894
+ function message(token, format2, input) {
1895
+ const subject = token[0] === "Y" ? "years" : "days of the month";
1896
+ 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`;
1897
+ }
1898
+
1899
+ // ../../node_modules/date-fns/format.js
1900
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1901
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1902
+ var escapedStringRegExp = /^'([^]*?)'?$/;
1903
+ var doubleQuoteRegExp = /''/g;
1904
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1905
+ function format(date, formatStr, options) {
1906
+ const defaultOptions2 = getDefaultOptions();
1907
+ const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
1908
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
1909
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
1910
+ const originalDate = toDate(date, options?.in);
1911
+ if (!isValid(originalDate)) {
1912
+ throw new RangeError("Invalid time value");
1913
+ }
1914
+ let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
1915
+ const firstCharacter = substring[0];
1916
+ if (firstCharacter === "p" || firstCharacter === "P") {
1917
+ const longFormatter = longFormatters[firstCharacter];
1918
+ return longFormatter(substring, locale.formatLong);
1919
+ }
1920
+ return substring;
1921
+ }).join("").match(formattingTokensRegExp).map((substring) => {
1922
+ if (substring === "''") {
1923
+ return { isToken: false, value: "'" };
1924
+ }
1925
+ const firstCharacter = substring[0];
1926
+ if (firstCharacter === "'") {
1927
+ return { isToken: false, value: cleanEscapedString(substring) };
1928
+ }
1929
+ if (formatters[firstCharacter]) {
1930
+ return { isToken: true, value: substring };
1931
+ }
1932
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
1933
+ throw new RangeError(
1934
+ "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
1935
+ );
1936
+ }
1937
+ return { isToken: false, value: substring };
1938
+ });
1939
+ if (locale.localize.preprocessor) {
1940
+ parts = locale.localize.preprocessor(originalDate, parts);
1941
+ }
1942
+ const formatterOptions = {
1943
+ firstWeekContainsDate,
1944
+ weekStartsOn,
1945
+ locale
1946
+ };
1947
+ return parts.map((part) => {
1948
+ if (!part.isToken) return part.value;
1949
+ const token = part.value;
1950
+ if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
1951
+ warnOrThrowProtectedError(token, formatStr, String(date));
1952
+ }
1953
+ const formatter = formatters[token[0]];
1954
+ return formatter(originalDate, token, locale.localize, formatterOptions);
1955
+ }).join("");
1956
+ }
1957
+ function cleanEscapedString(input) {
1958
+ const matched = input.match(escapedStringRegExp);
1959
+ if (!matched) {
1960
+ return input;
1961
+ }
1962
+ return matched[1].replace(doubleQuoteRegExp, "'");
1963
+ }
1964
+
1965
+ // ../../node_modules/date-fns/getDaysInMonth.js
1966
+ function getDaysInMonth(date, options) {
1967
+ const _date = toDate(date, options?.in);
1968
+ const year = _date.getFullYear();
1969
+ const monthIndex = _date.getMonth();
1970
+ const lastDayOfMonth = constructFrom(_date, 0);
1971
+ lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
1972
+ lastDayOfMonth.setHours(0, 0, 0, 0);
1973
+ return lastDayOfMonth.getDate();
1974
+ }
1975
+
1976
+ // ../../node_modules/date-fns/getMonth.js
1977
+ function getMonth(date, options) {
1978
+ return toDate(date, options?.in).getMonth();
1979
+ }
1980
+
1981
+ // ../../node_modules/date-fns/getYear.js
1982
+ function getYear(date, options) {
1983
+ return toDate(date, options?.in).getFullYear();
1984
+ }
1985
+
1986
+ // ../../node_modules/date-fns/isAfter.js
1987
+ function isAfter(date, dateToCompare) {
1988
+ return +toDate(date) > +toDate(dateToCompare);
1989
+ }
1990
+
1991
+ // ../../node_modules/date-fns/isBefore.js
1992
+ function isBefore(date, dateToCompare) {
1993
+ return +toDate(date) < +toDate(dateToCompare);
1994
+ }
1995
+
1996
+ // ../../node_modules/date-fns/isSameMonth.js
1997
+ function isSameMonth(laterDate, earlierDate, options) {
1998
+ const [laterDate_, earlierDate_] = normalizeDates(
1999
+ options?.in,
2000
+ laterDate,
2001
+ earlierDate
2002
+ );
2003
+ return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth();
2004
+ }
2005
+
2006
+ // ../../node_modules/date-fns/isSameYear.js
2007
+ function isSameYear(laterDate, earlierDate, options) {
2008
+ const [laterDate_, earlierDate_] = normalizeDates(
2009
+ options?.in,
2010
+ laterDate,
2011
+ earlierDate
2012
+ );
2013
+ return laterDate_.getFullYear() === earlierDate_.getFullYear();
2014
+ }
2015
+
2016
+ // ../../node_modules/date-fns/setMonth.js
2017
+ function setMonth(date, month, options) {
2018
+ const _date = toDate(date, options?.in);
2019
+ const year = _date.getFullYear();
2020
+ const day = _date.getDate();
2021
+ const midMonth = constructFrom(date, 0);
2022
+ midMonth.setFullYear(year, month, 15);
2023
+ midMonth.setHours(0, 0, 0, 0);
2024
+ const daysInMonth = getDaysInMonth(midMonth);
2025
+ _date.setMonth(month, Math.min(day, daysInMonth));
2026
+ return _date;
2027
+ }
2028
+
2029
+ // ../../node_modules/date-fns/setYear.js
2030
+ function setYear(date, year, options) {
2031
+ const date_ = toDate(date, options?.in);
2032
+ if (isNaN(+date_)) return constructFrom(date, NaN);
2033
+ date_.setFullYear(year);
2034
+ return date_;
2035
+ }
2036
+
2037
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js
2038
+ var FIVE_WEEKS = 5;
2039
+ var FOUR_WEEKS = 4;
2040
+ function getBroadcastWeeksInMonth(month, dateLib) {
2041
+ const firstDayOfMonth = dateLib.startOfMonth(month);
2042
+ const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;
2043
+ const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);
2044
+ const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);
2045
+ const numberOfWeeks = dateLib.getMonth(month) === dateLib.getMonth(lastDateOfLastWeek) ? FIVE_WEEKS : FOUR_WEEKS;
2046
+ return numberOfWeeks;
2047
+ }
2048
+
2049
+ // ../../node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js
2050
+ function startOfBroadcastWeek(date, dateLib) {
2051
+ const firstOfMonth = dateLib.startOfMonth(date);
2052
+ const dayOfWeek = firstOfMonth.getDay();
2053
+ if (dayOfWeek === 1) {
2054
+ return firstOfMonth;
2055
+ } else if (dayOfWeek === 0) {
2056
+ return dateLib.addDays(firstOfMonth, -1 * 6);
2057
+ } else {
2058
+ return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));
2059
+ }
2060
+ }
2061
+
2062
+ // ../../node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js
2063
+ function endOfBroadcastWeek(date, dateLib) {
2064
+ const startDate = startOfBroadcastWeek(date, dateLib);
2065
+ const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);
2066
+ const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
2067
+ return endDate;
2068
+ }
2069
+
2070
+ // ../../node_modules/react-day-picker/dist/esm/locale/en-US.js
2071
+ var enUS2 = {
2072
+ ...enUS,
2073
+ labels: {
2074
+ labelDayButton: (date, modifiers, options, dateLib) => {
2075
+ let formatDate;
2076
+ if (dateLib && typeof dateLib.format === "function") {
2077
+ formatDate = dateLib.format.bind(dateLib);
2078
+ } else {
2079
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
2080
+ }
2081
+ let label = formatDate(date, "PPPP");
2082
+ if (modifiers.today)
2083
+ label = `Today, ${label}`;
2084
+ if (modifiers.selected)
2085
+ label = `${label}, selected`;
2086
+ return label;
2087
+ },
2088
+ labelMonthDropdown: "Choose the Month",
2089
+ labelNext: "Go to the Next Month",
2090
+ labelPrevious: "Go to the Previous Month",
2091
+ labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
2092
+ labelYearDropdown: "Choose the Year",
2093
+ labelGrid: (date, options, dateLib) => {
2094
+ let formatDate;
2095
+ if (dateLib && typeof dateLib.format === "function") {
2096
+ formatDate = dateLib.format.bind(dateLib);
2097
+ } else {
2098
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
2099
+ }
2100
+ return formatDate(date, "LLLL yyyy");
2101
+ },
2102
+ labelGridcell: (date, modifiers, options, dateLib) => {
2103
+ let formatDate;
2104
+ if (dateLib && typeof dateLib.format === "function") {
2105
+ formatDate = dateLib.format.bind(dateLib);
2106
+ } else {
2107
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
2108
+ }
2109
+ let label = formatDate(date, "PPPP");
2110
+ if (modifiers?.today) {
2111
+ label = `Today, ${label}`;
2112
+ }
2113
+ return label;
2114
+ },
2115
+ labelNav: "Navigation bar",
2116
+ labelWeekNumberHeader: "Week Number",
2117
+ labelWeekday: (date, options, dateLib) => {
2118
+ let formatDate;
2119
+ if (dateLib && typeof dateLib.format === "function") {
2120
+ formatDate = dateLib.format.bind(dateLib);
2121
+ } else {
2122
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
2123
+ }
2124
+ return formatDate(date, "cccc");
2125
+ }
2126
+ }
2127
+ };
2128
+
2129
+ // ../../node_modules/react-day-picker/dist/esm/classes/DateLib.js
2130
+ var DateLib = class _DateLib {
2131
+ /**
2132
+ * Creates an instance of `DateLib`.
2133
+ *
2134
+ * @param options Configuration options for the date library.
2135
+ * @param overrides Custom overrides for the date library functions.
2136
+ */
2137
+ constructor(options, overrides) {
2138
+ this.today = () => {
2139
+ if (this.overrides?.today) {
2140
+ return this.overrides.today();
2141
+ }
2142
+ if (this.options.timeZone) {
2143
+ return TZDate.tz(this.options.timeZone);
2144
+ }
2145
+ const DateCtor = this.options.Date ?? Date;
2146
+ return new DateCtor();
2147
+ };
2148
+ this.newDate = (year, monthIndex, date) => {
2149
+ if (this.overrides?.newDate) {
2150
+ return this.overrides.newDate(year, monthIndex, date);
2151
+ }
2152
+ if (this.options.timeZone) {
2153
+ return new TZDate(year, monthIndex, date, this.options.timeZone);
2154
+ }
2155
+ return new Date(year, monthIndex, date);
2156
+ };
2157
+ this.addDays = (date, amount) => {
2158
+ return this.overrides?.addDays ? this.overrides.addDays(date, amount) : addDays(date, amount);
2159
+ };
2160
+ this.addMonths = (date, amount) => {
2161
+ return this.overrides?.addMonths ? this.overrides.addMonths(date, amount) : addMonths(date, amount);
2162
+ };
2163
+ this.addWeeks = (date, amount) => {
2164
+ return this.overrides?.addWeeks ? this.overrides.addWeeks(date, amount) : addWeeks(date, amount);
2165
+ };
2166
+ this.addYears = (date, amount) => {
2167
+ return this.overrides?.addYears ? this.overrides.addYears(date, amount) : addYears(date, amount);
2168
+ };
2169
+ this.differenceInCalendarDays = (dateLeft, dateRight) => {
2170
+ return this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(dateLeft, dateRight) : differenceInCalendarDays(dateLeft, dateRight);
2171
+ };
2172
+ this.differenceInCalendarMonths = (dateLeft, dateRight) => {
2173
+ return this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(dateLeft, dateRight) : differenceInCalendarMonths(dateLeft, dateRight);
2174
+ };
2175
+ this.eachMonthOfInterval = (interval) => {
2176
+ return this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(interval) : eachMonthOfInterval(interval);
2177
+ };
2178
+ this.eachYearOfInterval = (interval) => {
2179
+ const years = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(interval) : eachYearOfInterval(interval);
2180
+ const uniqueYears = new Set(years.map((d) => this.getYear(d)));
2181
+ if (uniqueYears.size === years.length) {
2182
+ return years;
2183
+ }
2184
+ const yearsArray = [];
2185
+ uniqueYears.forEach((y) => {
2186
+ yearsArray.push(new Date(y, 0, 1));
2187
+ });
2188
+ return yearsArray;
2189
+ };
2190
+ this.endOfBroadcastWeek = (date) => {
2191
+ return this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(date) : endOfBroadcastWeek(date, this);
2192
+ };
2193
+ this.endOfISOWeek = (date) => {
2194
+ return this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(date) : endOfISOWeek(date);
2195
+ };
2196
+ this.endOfMonth = (date) => {
2197
+ return this.overrides?.endOfMonth ? this.overrides.endOfMonth(date) : endOfMonth(date);
2198
+ };
2199
+ this.endOfWeek = (date, options2) => {
2200
+ return this.overrides?.endOfWeek ? this.overrides.endOfWeek(date, options2) : endOfWeek(date, this.options);
2201
+ };
2202
+ this.endOfYear = (date) => {
2203
+ return this.overrides?.endOfYear ? this.overrides.endOfYear(date) : endOfYear(date);
2204
+ };
2205
+ this.format = (date, formatStr, _options) => {
2206
+ const formatted = this.overrides?.format ? this.overrides.format(date, formatStr, this.options) : format(date, formatStr, this.options);
2207
+ if (this.options.numerals && this.options.numerals !== "latn") {
2208
+ return this.replaceDigits(formatted);
2209
+ }
2210
+ return formatted;
2211
+ };
2212
+ this.getISOWeek = (date) => {
2213
+ return this.overrides?.getISOWeek ? this.overrides.getISOWeek(date) : getISOWeek(date);
2214
+ };
2215
+ this.getMonth = (date, _options) => {
2216
+ return this.overrides?.getMonth ? this.overrides.getMonth(date, this.options) : getMonth(date, this.options);
2217
+ };
2218
+ this.getYear = (date, _options) => {
2219
+ return this.overrides?.getYear ? this.overrides.getYear(date, this.options) : getYear(date, this.options);
2220
+ };
2221
+ this.getWeek = (date, _options) => {
2222
+ return this.overrides?.getWeek ? this.overrides.getWeek(date, this.options) : getWeek(date, this.options);
2223
+ };
2224
+ this.isAfter = (date, dateToCompare) => {
2225
+ return this.overrides?.isAfter ? this.overrides.isAfter(date, dateToCompare) : isAfter(date, dateToCompare);
2226
+ };
2227
+ this.isBefore = (date, dateToCompare) => {
2228
+ return this.overrides?.isBefore ? this.overrides.isBefore(date, dateToCompare) : isBefore(date, dateToCompare);
2229
+ };
2230
+ this.isDate = (value) => {
2231
+ return this.overrides?.isDate ? this.overrides.isDate(value) : isDate(value);
2232
+ };
2233
+ this.isSameDay = (dateLeft, dateRight) => {
2234
+ return this.overrides?.isSameDay ? this.overrides.isSameDay(dateLeft, dateRight) : isSameDay(dateLeft, dateRight);
2235
+ };
2236
+ this.isSameMonth = (dateLeft, dateRight) => {
2237
+ return this.overrides?.isSameMonth ? this.overrides.isSameMonth(dateLeft, dateRight) : isSameMonth(dateLeft, dateRight);
2238
+ };
2239
+ this.isSameYear = (dateLeft, dateRight) => {
2240
+ return this.overrides?.isSameYear ? this.overrides.isSameYear(dateLeft, dateRight) : isSameYear(dateLeft, dateRight);
2241
+ };
2242
+ this.max = (dates) => {
2243
+ return this.overrides?.max ? this.overrides.max(dates) : max(dates);
2244
+ };
2245
+ this.min = (dates) => {
2246
+ return this.overrides?.min ? this.overrides.min(dates) : min(dates);
2247
+ };
2248
+ this.setMonth = (date, month) => {
2249
+ return this.overrides?.setMonth ? this.overrides.setMonth(date, month) : setMonth(date, month);
2250
+ };
2251
+ this.setYear = (date, year) => {
2252
+ return this.overrides?.setYear ? this.overrides.setYear(date, year) : setYear(date, year);
2253
+ };
2254
+ this.startOfBroadcastWeek = (date, _dateLib) => {
2255
+ return this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(date, this) : startOfBroadcastWeek(date, this);
2256
+ };
2257
+ this.startOfDay = (date) => {
2258
+ return this.overrides?.startOfDay ? this.overrides.startOfDay(date) : startOfDay(date);
2259
+ };
2260
+ this.startOfISOWeek = (date) => {
2261
+ return this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(date) : startOfISOWeek(date);
2262
+ };
2263
+ this.startOfMonth = (date) => {
2264
+ return this.overrides?.startOfMonth ? this.overrides.startOfMonth(date) : startOfMonth(date);
2265
+ };
2266
+ this.startOfWeek = (date, _options) => {
2267
+ return this.overrides?.startOfWeek ? this.overrides.startOfWeek(date, this.options) : startOfWeek(date, this.options);
2268
+ };
2269
+ this.startOfYear = (date) => {
2270
+ return this.overrides?.startOfYear ? this.overrides.startOfYear(date) : startOfYear(date);
2271
+ };
2272
+ this.options = { locale: enUS2, ...options };
2273
+ this.overrides = overrides;
2274
+ }
2275
+ /**
2276
+ * Generates a mapping of Arabic digits (0-9) to the target numbering system
2277
+ * digits.
2278
+ *
2279
+ * @since 9.5.0
2280
+ * @returns A record mapping Arabic digits to the target numerals.
2281
+ */
2282
+ getDigitMap() {
2283
+ const { numerals = "latn" } = this.options;
2284
+ const formatter = new Intl.NumberFormat("en-US", {
2285
+ numberingSystem: numerals
2286
+ });
2287
+ const digitMap = {};
2288
+ for (let i = 0; i < 10; i++) {
2289
+ digitMap[i.toString()] = formatter.format(i);
2290
+ }
2291
+ return digitMap;
2292
+ }
2293
+ /**
2294
+ * Replaces Arabic digits in a string with the target numbering system digits.
2295
+ *
2296
+ * @since 9.5.0
2297
+ * @param input The string containing Arabic digits.
2298
+ * @returns The string with digits replaced.
2299
+ */
2300
+ replaceDigits(input) {
2301
+ const digitMap = this.getDigitMap();
2302
+ return input.replace(/\d/g, (digit) => digitMap[digit] || digit);
2303
+ }
2304
+ /**
2305
+ * Formats a number using the configured numbering system.
2306
+ *
2307
+ * @since 9.5.0
2308
+ * @param value The number to format.
2309
+ * @returns The formatted number as a string.
2310
+ */
2311
+ formatNumber(value) {
2312
+ return this.replaceDigits(value.toString());
2313
+ }
2314
+ /**
2315
+ * Returns the preferred ordering for month and year labels for the current
2316
+ * locale.
2317
+ */
2318
+ getMonthYearOrder() {
2319
+ const code = this.options.locale?.code;
2320
+ if (!code) {
2321
+ return "month-first";
2322
+ }
2323
+ return _DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
2324
+ }
2325
+ /**
2326
+ * Formats the month/year pair respecting locale conventions.
2327
+ *
2328
+ * @since 9.11.0
2329
+ */
2330
+ formatMonthYear(date) {
2331
+ const { locale, timeZone, numerals } = this.options;
2332
+ const localeCode = locale?.code;
2333
+ if (localeCode && _DateLib.yearFirstLocales.has(localeCode)) {
2334
+ try {
2335
+ const intl = new Intl.DateTimeFormat(localeCode, {
2336
+ month: "long",
2337
+ year: "numeric",
2338
+ timeZone,
2339
+ numberingSystem: numerals
2340
+ });
2341
+ const formatted = intl.format(date);
2342
+ return formatted;
2343
+ } catch {
2344
+ }
2345
+ }
2346
+ const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
2347
+ return this.format(date, pattern);
2348
+ }
2349
+ };
2350
+ DateLib.yearFirstLocales = /* @__PURE__ */ new Set([
2351
+ "eu",
2352
+ "hu",
2353
+ "ja",
2354
+ "ja-Hira",
2355
+ "ja-JP",
2356
+ "ko",
2357
+ "ko-KR",
2358
+ "lt",
2359
+ "lt-LT",
2360
+ "lv",
2361
+ "lv-LV",
2362
+ "mn",
2363
+ "mn-MN",
2364
+ "zh",
2365
+ "zh-CN",
2366
+ "zh-HK",
2367
+ "zh-TW"
2368
+ ]);
2369
+ var defaultDateLib = new DateLib();
2370
+
2371
+ // ../../node_modules/react-day-picker/dist/esm/classes/CalendarDay.js
2372
+ var CalendarDay = class {
2373
+ constructor(date, displayMonth, dateLib = defaultDateLib) {
2374
+ this.date = date;
2375
+ this.displayMonth = displayMonth;
2376
+ this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
2377
+ this.dateLib = dateLib;
2378
+ this.isoDate = dateLib.format(date, "yyyy-MM-dd");
2379
+ this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
2380
+ this.dateMonthId = dateLib.format(date, "yyyy-MM");
2381
+ }
2382
+ /**
2383
+ * Checks if this day is equal to another `CalendarDay`, considering both the
2384
+ * date and the displayed month.
2385
+ *
2386
+ * @param day The `CalendarDay` to compare with.
2387
+ * @returns `true` if the days are equal, otherwise `false`.
2388
+ */
2389
+ isEqualTo(day) {
2390
+ return this.dateLib.isSameDay(day.date, this.date) && this.dateLib.isSameMonth(day.displayMonth, this.displayMonth);
2391
+ }
2392
+ };
2393
+
2394
+ // ../../node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js
2395
+ var CalendarMonth = class {
2396
+ constructor(month, weeks) {
2397
+ this.date = month;
2398
+ this.weeks = weeks;
2399
+ }
2400
+ };
2401
+
2402
+ // ../../node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js
2403
+ var CalendarWeek = class {
2404
+ constructor(weekNumber, days) {
2405
+ this.days = days;
2406
+ this.weekNumber = weekNumber;
2407
+ }
2408
+ };
2409
+
2410
+ // ../../node_modules/react-day-picker/dist/esm/components/custom-components.js
2411
+ var custom_components_exports = {};
2412
+ __export(custom_components_exports, {
2413
+ CaptionLabel: () => CaptionLabel,
2414
+ Chevron: () => Chevron,
2415
+ Day: () => Day,
2416
+ DayButton: () => DayButton,
2417
+ Dropdown: () => Dropdown,
2418
+ DropdownNav: () => DropdownNav,
2419
+ Footer: () => Footer,
2420
+ Month: () => Month,
2421
+ MonthCaption: () => MonthCaption,
2422
+ MonthGrid: () => MonthGrid,
2423
+ Months: () => Months,
2424
+ MonthsDropdown: () => MonthsDropdown,
2425
+ Nav: () => Nav,
2426
+ NextMonthButton: () => NextMonthButton,
2427
+ Option: () => Option,
2428
+ PreviousMonthButton: () => PreviousMonthButton,
2429
+ Root: () => Root,
2430
+ Select: () => Select,
2431
+ Week: () => Week,
2432
+ WeekNumber: () => WeekNumber,
2433
+ WeekNumberHeader: () => WeekNumberHeader,
2434
+ Weekday: () => Weekday,
2435
+ Weekdays: () => Weekdays,
2436
+ Weeks: () => Weeks,
2437
+ YearsDropdown: () => YearsDropdown
2438
+ });
2439
+ function CaptionLabel(props) {
2440
+ return React26__default.createElement("span", { ...props });
2441
+ }
2442
+ function Chevron(props) {
2443
+ const { size = 24, orientation = "left", className } = props;
2444
+ return React26__default.createElement(
2445
+ "svg",
2446
+ { className, width: size, height: size, viewBox: "0 0 24 24" },
2447
+ orientation === "up" && React26__default.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
2448
+ orientation === "down" && React26__default.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
2449
+ orientation === "left" && React26__default.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
2450
+ orientation === "right" && React26__default.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
2451
+ );
2452
+ }
2453
+ function Day(props) {
2454
+ const { day, modifiers, ...tdProps } = props;
2455
+ return React26__default.createElement("td", { ...tdProps });
2456
+ }
2457
+ function DayButton(props) {
2458
+ const { day, modifiers, ...buttonProps } = props;
2459
+ const ref = React26__default.useRef(null);
2460
+ React26__default.useEffect(() => {
2461
+ if (modifiers.focused)
2462
+ ref.current?.focus();
2463
+ }, [modifiers.focused]);
2464
+ return React26__default.createElement("button", { ref, ...buttonProps });
2465
+ }
2466
+
2467
+ // ../../node_modules/react-day-picker/dist/esm/UI.js
2468
+ var UI;
2469
+ (function(UI2) {
2470
+ UI2["Root"] = "root";
2471
+ UI2["Chevron"] = "chevron";
2472
+ UI2["Day"] = "day";
2473
+ UI2["DayButton"] = "day_button";
2474
+ UI2["CaptionLabel"] = "caption_label";
2475
+ UI2["Dropdowns"] = "dropdowns";
2476
+ UI2["Dropdown"] = "dropdown";
2477
+ UI2["DropdownRoot"] = "dropdown_root";
2478
+ UI2["Footer"] = "footer";
2479
+ UI2["MonthGrid"] = "month_grid";
2480
+ UI2["MonthCaption"] = "month_caption";
2481
+ UI2["MonthsDropdown"] = "months_dropdown";
2482
+ UI2["Month"] = "month";
2483
+ UI2["Months"] = "months";
2484
+ UI2["Nav"] = "nav";
2485
+ UI2["NextMonthButton"] = "button_next";
2486
+ UI2["PreviousMonthButton"] = "button_previous";
2487
+ UI2["Week"] = "week";
2488
+ UI2["Weeks"] = "weeks";
2489
+ UI2["Weekday"] = "weekday";
2490
+ UI2["Weekdays"] = "weekdays";
2491
+ UI2["WeekNumber"] = "week_number";
2492
+ UI2["WeekNumberHeader"] = "week_number_header";
2493
+ UI2["YearsDropdown"] = "years_dropdown";
2494
+ })(UI || (UI = {}));
2495
+ var DayFlag;
2496
+ (function(DayFlag2) {
2497
+ DayFlag2["disabled"] = "disabled";
2498
+ DayFlag2["hidden"] = "hidden";
2499
+ DayFlag2["outside"] = "outside";
2500
+ DayFlag2["focused"] = "focused";
2501
+ DayFlag2["today"] = "today";
2502
+ })(DayFlag || (DayFlag = {}));
2503
+ var SelectionState;
2504
+ (function(SelectionState2) {
2505
+ SelectionState2["range_end"] = "range_end";
2506
+ SelectionState2["range_middle"] = "range_middle";
2507
+ SelectionState2["range_start"] = "range_start";
2508
+ SelectionState2["selected"] = "selected";
2509
+ })(SelectionState || (SelectionState = {}));
2510
+ var Animation;
2511
+ (function(Animation2) {
2512
+ Animation2["weeks_before_enter"] = "weeks_before_enter";
2513
+ Animation2["weeks_before_exit"] = "weeks_before_exit";
2514
+ Animation2["weeks_after_enter"] = "weeks_after_enter";
2515
+ Animation2["weeks_after_exit"] = "weeks_after_exit";
2516
+ Animation2["caption_after_enter"] = "caption_after_enter";
2517
+ Animation2["caption_after_exit"] = "caption_after_exit";
2518
+ Animation2["caption_before_enter"] = "caption_before_enter";
2519
+ Animation2["caption_before_exit"] = "caption_before_exit";
2520
+ })(Animation || (Animation = {}));
2521
+ var dayPickerContext = createContext(void 0);
2522
+ function useDayPicker() {
2523
+ const context = useContext(dayPickerContext);
2524
+ if (context === void 0) {
2525
+ throw new Error("useDayPicker() must be used within a custom component.");
2526
+ }
2527
+ return context;
2528
+ }
2529
+
2530
+ // ../../node_modules/react-day-picker/dist/esm/components/Dropdown.js
2531
+ function Dropdown(props) {
2532
+ const { options, className, ...selectProps } = props;
2533
+ const { classNames, components } = useDayPicker();
2534
+ const cssClassSelect = [classNames[UI.Dropdown], className].join(" ");
2535
+ const selectedOption = options?.find(({ value }) => value === selectProps.value);
2536
+ return React26__default.createElement(
2537
+ "span",
2538
+ { "data-disabled": selectProps.disabled, className: classNames[UI.DropdownRoot] },
2539
+ React26__default.createElement(components.Select, { className: cssClassSelect, ...selectProps }, options?.map(({ value, label, disabled }) => React26__default.createElement(components.Option, { key: value, value, disabled }, label))),
2540
+ React26__default.createElement(
2541
+ "span",
2542
+ { className: classNames[UI.CaptionLabel], "aria-hidden": true },
2543
+ selectedOption?.label,
2544
+ React26__default.createElement(components.Chevron, { orientation: "down", size: 18, className: classNames[UI.Chevron] })
2545
+ )
2546
+ );
2547
+ }
2548
+ function DropdownNav(props) {
2549
+ return React26__default.createElement("div", { ...props });
2550
+ }
2551
+ function Footer(props) {
2552
+ return React26__default.createElement("div", { ...props });
2553
+ }
2554
+ function Month(props) {
2555
+ const { calendarMonth, displayIndex, ...divProps } = props;
2556
+ return React26__default.createElement("div", { ...divProps }, props.children);
2557
+ }
2558
+ function MonthCaption(props) {
2559
+ const { calendarMonth, displayIndex, ...divProps } = props;
2560
+ return React26__default.createElement("div", { ...divProps });
2561
+ }
2562
+ function MonthGrid(props) {
2563
+ return React26__default.createElement("table", { ...props });
2564
+ }
2565
+ function Months(props) {
2566
+ return React26__default.createElement("div", { ...props });
2567
+ }
2568
+ function MonthsDropdown(props) {
2569
+ const { components } = useDayPicker();
2570
+ return React26__default.createElement(components.Dropdown, { ...props });
2571
+ }
2572
+ function Nav(props) {
2573
+ const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;
2574
+ const { components, classNames, labels: { labelPrevious: labelPrevious2, labelNext: labelNext2 } } = useDayPicker();
2575
+ const handleNextClick = useCallback((e) => {
2576
+ if (nextMonth) {
2577
+ onNextClick?.(e);
2578
+ }
2579
+ }, [nextMonth, onNextClick]);
2580
+ const handlePreviousClick = useCallback((e) => {
2581
+ if (previousMonth) {
2582
+ onPreviousClick?.(e);
2583
+ }
2584
+ }, [previousMonth, onPreviousClick]);
2585
+ return React26__default.createElement(
2586
+ "nav",
2587
+ { ...navProps },
2588
+ React26__default.createElement(
2589
+ components.PreviousMonthButton,
2590
+ { type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick },
2591
+ React26__default.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: "left" })
2592
+ ),
2593
+ React26__default.createElement(
2594
+ components.NextMonthButton,
2595
+ { type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick },
2596
+ React26__default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, orientation: "right", className: classNames[UI.Chevron] })
2597
+ )
2598
+ );
2599
+ }
2600
+ function NextMonthButton(props) {
2601
+ return React26__default.createElement("button", { ...props });
2602
+ }
2603
+ function Option(props) {
2604
+ return React26__default.createElement("option", { ...props });
2605
+ }
2606
+ function PreviousMonthButton(props) {
2607
+ return React26__default.createElement("button", { ...props });
2608
+ }
2609
+ function Root(props) {
2610
+ const { rootRef, ...rest } = props;
2611
+ return React26__default.createElement("div", { ...rest, ref: rootRef });
2612
+ }
2613
+ function Select(props) {
2614
+ return React26__default.createElement("select", { ...props });
2615
+ }
2616
+ function Week(props) {
2617
+ const { week, ...trProps } = props;
2618
+ return React26__default.createElement("tr", { ...trProps });
2619
+ }
2620
+ function Weekday(props) {
2621
+ return React26__default.createElement("th", { ...props });
2622
+ }
2623
+ function Weekdays(props) {
2624
+ return React26__default.createElement(
2625
+ "thead",
2626
+ { "aria-hidden": true },
2627
+ React26__default.createElement("tr", { ...props })
2628
+ );
2629
+ }
2630
+ function WeekNumber(props) {
2631
+ const { week, ...thProps } = props;
2632
+ return React26__default.createElement("th", { ...thProps });
2633
+ }
2634
+ function WeekNumberHeader(props) {
2635
+ return React26__default.createElement("th", { ...props });
2636
+ }
2637
+ function Weeks(props) {
2638
+ return React26__default.createElement("tbody", { ...props });
2639
+ }
2640
+ function YearsDropdown(props) {
2641
+ const { components } = useDayPicker();
2642
+ return React26__default.createElement(components.Dropdown, { ...props });
2643
+ }
2644
+
2645
+ // ../../node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js
2646
+ function rangeIncludesDate(range, date, excludeEnds = false, dateLib = defaultDateLib) {
2647
+ let { from, to } = range;
2648
+ const { differenceInCalendarDays: differenceInCalendarDays2, isSameDay: isSameDay2 } = dateLib;
2649
+ if (from && to) {
2650
+ const isRangeInverted = differenceInCalendarDays2(to, from) < 0;
2651
+ if (isRangeInverted) {
2652
+ [from, to] = [to, from];
2653
+ }
2654
+ const isInRange = differenceInCalendarDays2(date, from) >= (excludeEnds ? 1 : 0) && differenceInCalendarDays2(to, date) >= (excludeEnds ? 1 : 0);
2655
+ return isInRange;
2656
+ }
2657
+ if (!excludeEnds && to) {
2658
+ return isSameDay2(to, date);
2659
+ }
2660
+ if (!excludeEnds && from) {
2661
+ return isSameDay2(from, date);
2662
+ }
2663
+ return false;
2664
+ }
2665
+
2666
+ // ../../node_modules/react-day-picker/dist/esm/utils/typeguards.js
2667
+ function isDateInterval(matcher) {
2668
+ return Boolean(matcher && typeof matcher === "object" && "before" in matcher && "after" in matcher);
2669
+ }
2670
+ function isDateRange(value) {
2671
+ return Boolean(value && typeof value === "object" && "from" in value);
2672
+ }
2673
+ function isDateAfterType(value) {
2674
+ return Boolean(value && typeof value === "object" && "after" in value);
2675
+ }
2676
+ function isDateBeforeType(value) {
2677
+ return Boolean(value && typeof value === "object" && "before" in value);
2678
+ }
2679
+ function isDayOfWeekType(value) {
2680
+ return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
2681
+ }
2682
+ function isDatesArray(value, dateLib) {
2683
+ return Array.isArray(value) && value.every(dateLib.isDate);
2684
+ }
2685
+
2686
+ // ../../node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js
2687
+ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
2688
+ const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;
2689
+ const { isSameDay: isSameDay2, differenceInCalendarDays: differenceInCalendarDays2, isAfter: isAfter2 } = dateLib;
2690
+ return matchersArr.some((matcher) => {
2691
+ if (typeof matcher === "boolean") {
2692
+ return matcher;
2693
+ }
2694
+ if (dateLib.isDate(matcher)) {
2695
+ return isSameDay2(date, matcher);
2696
+ }
2697
+ if (isDatesArray(matcher, dateLib)) {
2698
+ return matcher.some((matcherDate) => isSameDay2(date, matcherDate));
2699
+ }
2700
+ if (isDateRange(matcher)) {
2701
+ return rangeIncludesDate(matcher, date, false, dateLib);
2702
+ }
2703
+ if (isDayOfWeekType(matcher)) {
2704
+ if (!Array.isArray(matcher.dayOfWeek)) {
2705
+ return matcher.dayOfWeek === date.getDay();
2706
+ }
2707
+ return matcher.dayOfWeek.includes(date.getDay());
2708
+ }
2709
+ if (isDateInterval(matcher)) {
2710
+ const diffBefore = differenceInCalendarDays2(matcher.before, date);
2711
+ const diffAfter = differenceInCalendarDays2(matcher.after, date);
2712
+ const isDayBefore = diffBefore > 0;
2713
+ const isDayAfter = diffAfter < 0;
2714
+ const isClosedInterval = isAfter2(matcher.before, matcher.after);
2715
+ if (isClosedInterval) {
2716
+ return isDayAfter && isDayBefore;
2717
+ } else {
2718
+ return isDayBefore || isDayAfter;
2719
+ }
2720
+ }
2721
+ if (isDateAfterType(matcher)) {
2722
+ return differenceInCalendarDays2(date, matcher.after) > 0;
2723
+ }
2724
+ if (isDateBeforeType(matcher)) {
2725
+ return differenceInCalendarDays2(matcher.before, date) > 0;
2726
+ }
2727
+ if (typeof matcher === "function") {
2728
+ return matcher(date);
2729
+ }
2730
+ return false;
2731
+ });
2732
+ }
2733
+
2734
+ // ../../node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js
2735
+ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
2736
+ const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today() } = props;
2737
+ const { isSameDay: isSameDay2, isSameMonth: isSameMonth2, startOfMonth: startOfMonth2, isBefore: isBefore2, endOfMonth: endOfMonth2, isAfter: isAfter2 } = dateLib;
2738
+ const computedNavStart = navStart && startOfMonth2(navStart);
2739
+ const computedNavEnd = navEnd && endOfMonth2(navEnd);
2740
+ const internalModifiersMap = {
2741
+ [DayFlag.focused]: [],
2742
+ [DayFlag.outside]: [],
2743
+ [DayFlag.disabled]: [],
2744
+ [DayFlag.hidden]: [],
2745
+ [DayFlag.today]: []
2746
+ };
2747
+ const customModifiersMap = {};
2748
+ for (const day of days) {
2749
+ const { date, displayMonth } = day;
2750
+ const isOutside = Boolean(displayMonth && !isSameMonth2(date, displayMonth));
2751
+ const isBeforeNavStart = Boolean(computedNavStart && isBefore2(date, computedNavStart));
2752
+ const isAfterNavEnd = Boolean(computedNavEnd && isAfter2(date, computedNavEnd));
2753
+ const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
2754
+ const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) || isBeforeNavStart || isAfterNavEnd || // Broadcast calendar will show outside days as default
2755
+ !broadcastCalendar && !showOutsideDays && isOutside || broadcastCalendar && showOutsideDays === false && isOutside;
2756
+ const isToday = isSameDay2(date, today);
2757
+ if (isOutside)
2758
+ internalModifiersMap.outside.push(day);
2759
+ if (isDisabled)
2760
+ internalModifiersMap.disabled.push(day);
2761
+ if (isHidden)
2762
+ internalModifiersMap.hidden.push(day);
2763
+ if (isToday)
2764
+ internalModifiersMap.today.push(day);
2765
+ if (modifiers) {
2766
+ Object.keys(modifiers).forEach((name) => {
2767
+ const modifierValue = modifiers?.[name];
2768
+ const isMatch = modifierValue ? dateMatchModifiers(date, modifierValue, dateLib) : false;
2769
+ if (!isMatch)
2770
+ return;
2771
+ if (customModifiersMap[name]) {
2772
+ customModifiersMap[name].push(day);
2773
+ } else {
2774
+ customModifiersMap[name] = [day];
2775
+ }
2776
+ });
2777
+ }
2778
+ }
2779
+ return (day) => {
2780
+ const dayFlags = {
2781
+ [DayFlag.focused]: false,
2782
+ [DayFlag.disabled]: false,
2783
+ [DayFlag.hidden]: false,
2784
+ [DayFlag.outside]: false,
2785
+ [DayFlag.today]: false
2786
+ };
2787
+ const customModifiers = {};
2788
+ for (const name in internalModifiersMap) {
2789
+ const days2 = internalModifiersMap[name];
2790
+ dayFlags[name] = days2.some((d) => d === day);
2791
+ }
2792
+ for (const name in customModifiersMap) {
2793
+ customModifiers[name] = customModifiersMap[name].some((d) => d === day);
2794
+ }
2795
+ return {
2796
+ ...dayFlags,
2797
+ // custom modifiers should override all the previous ones
2798
+ ...customModifiers
2799
+ };
2800
+ };
2801
+ }
2802
+
2803
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js
2804
+ function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {
2805
+ const modifierClassNames = Object.entries(modifiers).filter(([, active]) => active === true).reduce((previousValue, [key]) => {
2806
+ if (modifiersClassNames[key]) {
2807
+ previousValue.push(modifiersClassNames[key]);
2808
+ } else if (classNames[DayFlag[key]]) {
2809
+ previousValue.push(classNames[DayFlag[key]]);
2810
+ } else if (classNames[SelectionState[key]]) {
2811
+ previousValue.push(classNames[SelectionState[key]]);
2812
+ }
2813
+ return previousValue;
2814
+ }, [classNames[UI.Day]]);
2815
+ return modifierClassNames;
2816
+ }
2817
+
2818
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getComponents.js
2819
+ function getComponents(customComponents) {
2820
+ return {
2821
+ ...custom_components_exports,
2822
+ ...customComponents
2823
+ };
2824
+ }
2825
+
2826
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js
2827
+ function getDataAttributes(props) {
2828
+ const dataAttributes = {
2829
+ "data-mode": props.mode ?? void 0,
2830
+ "data-required": "required" in props ? props.required : void 0,
2831
+ "data-multiple-months": props.numberOfMonths && props.numberOfMonths > 1 || void 0,
2832
+ "data-week-numbers": props.showWeekNumber || void 0,
2833
+ "data-broadcast-calendar": props.broadcastCalendar || void 0,
2834
+ "data-nav-layout": props.navLayout || void 0
2835
+ };
2836
+ Object.entries(props).forEach(([key, val]) => {
2837
+ if (key.startsWith("data-")) {
2838
+ dataAttributes[key] = val;
2839
+ }
2840
+ });
2841
+ return dataAttributes;
2842
+ }
2843
+
2844
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js
2845
+ function getDefaultClassNames() {
2846
+ const classNames = {};
2847
+ for (const key in UI) {
2848
+ classNames[UI[key]] = `rdp-${UI[key]}`;
2849
+ }
2850
+ for (const key in DayFlag) {
2851
+ classNames[DayFlag[key]] = `rdp-${DayFlag[key]}`;
2852
+ }
2853
+ for (const key in SelectionState) {
2854
+ classNames[SelectionState[key]] = `rdp-${SelectionState[key]}`;
2855
+ }
2856
+ for (const key in Animation) {
2857
+ classNames[Animation[key]] = `rdp-${Animation[key]}`;
2858
+ }
2859
+ return classNames;
2860
+ }
2861
+
2862
+ // ../../node_modules/react-day-picker/dist/esm/formatters/index.js
2863
+ var formatters_exports = {};
2864
+ __export(formatters_exports, {
2865
+ formatCaption: () => formatCaption,
2866
+ formatDay: () => formatDay,
2867
+ formatMonthDropdown: () => formatMonthDropdown,
2868
+ formatWeekNumber: () => formatWeekNumber,
2869
+ formatWeekNumberHeader: () => formatWeekNumberHeader,
2870
+ formatWeekdayName: () => formatWeekdayName,
2871
+ formatYearDropdown: () => formatYearDropdown
2872
+ });
2873
+
2874
+ // ../../node_modules/react-day-picker/dist/esm/formatters/formatCaption.js
2875
+ function formatCaption(month, options, dateLib) {
2876
+ const lib = dateLib ?? new DateLib(options);
2877
+ return lib.formatMonthYear(month);
2878
+ }
2879
+
2880
+ // ../../node_modules/react-day-picker/dist/esm/formatters/formatDay.js
2881
+ function formatDay(date, options, dateLib) {
2882
+ return (dateLib ?? new DateLib(options)).format(date, "d");
2883
+ }
2884
+
2885
+ // ../../node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js
2886
+ function formatMonthDropdown(month, dateLib = defaultDateLib) {
2887
+ return dateLib.format(month, "LLLL");
2888
+ }
2889
+
2890
+ // ../../node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js
2891
+ function formatWeekdayName(weekday, options, dateLib) {
2892
+ return (dateLib ?? new DateLib(options)).format(weekday, "cccccc");
2893
+ }
2894
+
2895
+ // ../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js
2896
+ function formatWeekNumber(weekNumber, dateLib = defaultDateLib) {
2897
+ if (weekNumber < 10) {
2898
+ return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);
2899
+ }
2900
+ return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);
2901
+ }
2902
+
2903
+ // ../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js
2904
+ function formatWeekNumberHeader() {
2905
+ return ``;
2906
+ }
2907
+
2908
+ // ../../node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js
2909
+ function formatYearDropdown(year, dateLib = defaultDateLib) {
2910
+ return dateLib.format(year, "yyyy");
2911
+ }
2912
+
2913
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getFormatters.js
2914
+ function getFormatters(customFormatters) {
2915
+ return {
2916
+ ...formatters_exports,
2917
+ ...customFormatters
2918
+ };
2919
+ }
2920
+
2921
+ // ../../node_modules/react-day-picker/dist/esm/labels/index.js
2922
+ var labels_exports = {};
2923
+ __export(labels_exports, {
2924
+ labelDayButton: () => labelDayButton,
2925
+ labelGrid: () => labelGrid,
2926
+ labelGridcell: () => labelGridcell,
2927
+ labelMonthDropdown: () => labelMonthDropdown,
2928
+ labelNav: () => labelNav,
2929
+ labelNext: () => labelNext,
2930
+ labelPrevious: () => labelPrevious,
2931
+ labelWeekNumber: () => labelWeekNumber,
2932
+ labelWeekNumberHeader: () => labelWeekNumberHeader,
2933
+ labelWeekday: () => labelWeekday,
2934
+ labelYearDropdown: () => labelYearDropdown
2935
+ });
2936
+
2937
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelDayButton.js
2938
+ function labelDayButton(date, modifiers, options, dateLib) {
2939
+ let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
2940
+ if (modifiers.today)
2941
+ label = `Today, ${label}`;
2942
+ if (modifiers.selected)
2943
+ label = `${label}, selected`;
2944
+ return label;
2945
+ }
2946
+
2947
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelGrid.js
2948
+ function labelGrid(date, options, dateLib) {
2949
+ const lib = dateLib ?? new DateLib(options);
2950
+ return lib.formatMonthYear(date);
2951
+ }
2952
+
2953
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelGridcell.js
2954
+ function labelGridcell(date, modifiers, options, dateLib) {
2955
+ let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
2956
+ if (modifiers?.today) {
2957
+ label = `Today, ${label}`;
2958
+ }
2959
+ return label;
2960
+ }
2961
+
2962
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js
2963
+ function labelMonthDropdown(_options) {
2964
+ return "Choose the Month";
2965
+ }
2966
+
2967
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelNav.js
2968
+ function labelNav() {
2969
+ return "";
2970
+ }
2971
+
2972
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelNext.js
2973
+ var defaultLabel = "Go to the Next Month";
2974
+ function labelNext(_month, _options) {
2975
+ return defaultLabel;
2976
+ }
2977
+
2978
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelPrevious.js
2979
+ function labelPrevious(_month) {
2980
+ return "Go to the Previous Month";
2981
+ }
2982
+
2983
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelWeekday.js
2984
+ function labelWeekday(date, options, dateLib) {
2985
+ return (dateLib ?? new DateLib(options)).format(date, "cccc");
2986
+ }
2987
+
2988
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js
2989
+ function labelWeekNumber(weekNumber, _options) {
2990
+ return `Week ${weekNumber}`;
2991
+ }
2992
+
2993
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js
2994
+ function labelWeekNumberHeader(_options) {
2995
+ return "Week Number";
2996
+ }
2997
+
2998
+ // ../../node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js
2999
+ function labelYearDropdown(_options) {
3000
+ return "Choose the Year";
3001
+ }
3002
+
3003
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getLabels.js
3004
+ var resolveLabel = (defaultLabel2, customLabel, localeLabel) => {
3005
+ if (customLabel)
3006
+ return customLabel;
3007
+ if (localeLabel) {
3008
+ return typeof localeLabel === "function" ? localeLabel : (..._args) => localeLabel;
3009
+ }
3010
+ return defaultLabel2;
3011
+ };
3012
+ function getLabels(customLabels, options) {
3013
+ const localeLabels = options.locale?.labels ?? {};
3014
+ return {
3015
+ ...labels_exports,
3016
+ ...customLabels ?? {},
3017
+ labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
3018
+ labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
3019
+ labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
3020
+ labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
3021
+ labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
3022
+ labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
3023
+ labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
3024
+ labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
3025
+ labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
3026
+ labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
3027
+ labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday)
3028
+ };
3029
+ }
3030
+
3031
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js
3032
+ function getMonthOptions(displayMonth, navStart, navEnd, formatters2, dateLib) {
3033
+ const { startOfMonth: startOfMonth2, startOfYear: startOfYear2, endOfYear: endOfYear2, eachMonthOfInterval: eachMonthOfInterval2, getMonth: getMonth2 } = dateLib;
3034
+ const months = eachMonthOfInterval2({
3035
+ start: startOfYear2(displayMonth),
3036
+ end: endOfYear2(displayMonth)
3037
+ });
3038
+ const options = months.map((month) => {
3039
+ const label = formatters2.formatMonthDropdown(month, dateLib);
3040
+ const value = getMonth2(month);
3041
+ const disabled = navStart && month < startOfMonth2(navStart) || navEnd && month > startOfMonth2(navEnd) || false;
3042
+ return { value, label, disabled };
3043
+ });
3044
+ return options;
3045
+ }
3046
+
3047
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js
3048
+ function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
3049
+ let style = { ...styles?.[UI.Day] };
3050
+ Object.entries(dayModifiers).filter(([, active]) => active === true).forEach(([modifier]) => {
3051
+ style = {
3052
+ ...style,
3053
+ ...modifiersStyles?.[modifier]
3054
+ };
3055
+ });
3056
+ return style;
3057
+ }
3058
+
3059
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js
3060
+ function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
3061
+ const referenceToday = today ?? dateLib.today();
3062
+ const start = broadcastCalendar ? dateLib.startOfBroadcastWeek(referenceToday, dateLib) : ISOWeek ? dateLib.startOfISOWeek(referenceToday) : dateLib.startOfWeek(referenceToday);
3063
+ const days = [];
3064
+ for (let i = 0; i < 7; i++) {
3065
+ const day = dateLib.addDays(start, i);
3066
+ days.push(day);
3067
+ }
3068
+ return days;
3069
+ }
3070
+
3071
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js
3072
+ function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false) {
3073
+ if (!navStart)
3074
+ return void 0;
3075
+ if (!navEnd)
3076
+ return void 0;
3077
+ const { startOfYear: startOfYear2, endOfYear: endOfYear2, eachYearOfInterval: eachYearOfInterval2, getYear: getYear2 } = dateLib;
3078
+ const firstNavYear = startOfYear2(navStart);
3079
+ const lastNavYear = endOfYear2(navEnd);
3080
+ const years = eachYearOfInterval2({ start: firstNavYear, end: lastNavYear });
3081
+ if (reverse)
3082
+ years.reverse();
3083
+ return years.map((year) => {
3084
+ const label = formatters2.formatYearDropdown(year, dateLib);
3085
+ return {
3086
+ value: getYear2(year),
3087
+ label,
3088
+ disabled: false
3089
+ };
3090
+ });
3091
+ }
3092
+
3093
+ // ../../node_modules/react-day-picker/dist/esm/noonDateLib.js
3094
+ function createNoonOverrides(timeZone, options = {}) {
3095
+ const { weekStartsOn, locale } = options;
3096
+ const fallbackWeekStartsOn = weekStartsOn ?? locale?.options?.weekStartsOn ?? 0;
3097
+ const toNoonTZDate = (date) => {
3098
+ const normalizedDate = typeof date === "number" || typeof date === "string" ? new Date(date) : date;
3099
+ return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
3100
+ };
3101
+ const toCalendarDate = (date) => {
3102
+ const zoned = toNoonTZDate(date);
3103
+ return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
3104
+ };
3105
+ return {
3106
+ today: () => {
3107
+ return toNoonTZDate(TZDate.tz(timeZone));
3108
+ },
3109
+ newDate: (year, monthIndex, date) => {
3110
+ return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
3111
+ },
3112
+ startOfDay: (date) => {
3113
+ return toNoonTZDate(date);
3114
+ },
3115
+ startOfWeek: (date, options2) => {
3116
+ const base = toNoonTZDate(date);
3117
+ const weekStartsOnValue = options2?.weekStartsOn ?? fallbackWeekStartsOn;
3118
+ const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
3119
+ base.setDate(base.getDate() - diff);
3120
+ return base;
3121
+ },
3122
+ startOfISOWeek: (date) => {
3123
+ const base = toNoonTZDate(date);
3124
+ const diff = (base.getDay() - 1 + 7) % 7;
3125
+ base.setDate(base.getDate() - diff);
3126
+ return base;
3127
+ },
3128
+ startOfMonth: (date) => {
3129
+ const base = toNoonTZDate(date);
3130
+ base.setDate(1);
3131
+ return base;
3132
+ },
3133
+ startOfYear: (date) => {
3134
+ const base = toNoonTZDate(date);
3135
+ base.setMonth(0, 1);
3136
+ return base;
3137
+ },
3138
+ endOfWeek: (date, options2) => {
3139
+ const base = toNoonTZDate(date);
3140
+ const weekStartsOnValue = options2?.weekStartsOn ?? fallbackWeekStartsOn;
3141
+ const endDow = (weekStartsOnValue + 6) % 7;
3142
+ const diff = (endDow - base.getDay() + 7) % 7;
3143
+ base.setDate(base.getDate() + diff);
3144
+ return base;
3145
+ },
3146
+ endOfISOWeek: (date) => {
3147
+ const base = toNoonTZDate(date);
3148
+ const diff = (7 - base.getDay()) % 7;
3149
+ base.setDate(base.getDate() + diff);
3150
+ return base;
3151
+ },
3152
+ endOfMonth: (date) => {
3153
+ const base = toNoonTZDate(date);
3154
+ base.setMonth(base.getMonth() + 1, 0);
3155
+ return base;
3156
+ },
3157
+ endOfYear: (date) => {
3158
+ const base = toNoonTZDate(date);
3159
+ base.setMonth(11, 31);
3160
+ return base;
3161
+ },
3162
+ eachMonthOfInterval: (interval) => {
3163
+ const start = toNoonTZDate(interval.start);
3164
+ const end = toNoonTZDate(interval.end);
3165
+ const result = [];
3166
+ const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
3167
+ const endKey = end.getFullYear() * 12 + end.getMonth();
3168
+ while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
3169
+ result.push(new TZDate(cursor, timeZone));
3170
+ cursor.setMonth(cursor.getMonth() + 1, 1);
3171
+ }
3172
+ return result;
3173
+ },
3174
+ // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
3175
+ // mutate the same TZDate, and return it.
3176
+ addDays: (date, amount) => {
3177
+ const base = toNoonTZDate(date);
3178
+ base.setDate(base.getDate() + amount);
3179
+ return base;
3180
+ },
3181
+ addWeeks: (date, amount) => {
3182
+ const base = toNoonTZDate(date);
3183
+ base.setDate(base.getDate() + amount * 7);
3184
+ return base;
3185
+ },
3186
+ addMonths: (date, amount) => {
3187
+ const base = toNoonTZDate(date);
3188
+ base.setMonth(base.getMonth() + amount);
3189
+ return base;
3190
+ },
3191
+ addYears: (date, amount) => {
3192
+ const base = toNoonTZDate(date);
3193
+ base.setFullYear(base.getFullYear() + amount);
3194
+ return base;
3195
+ },
3196
+ eachYearOfInterval: (interval) => {
3197
+ const start = toNoonTZDate(interval.start);
3198
+ const end = toNoonTZDate(interval.end);
3199
+ const years = [];
3200
+ const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
3201
+ while (cursor.getFullYear() <= end.getFullYear()) {
3202
+ years.push(new TZDate(cursor, timeZone));
3203
+ cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
3204
+ }
3205
+ return years;
3206
+ },
3207
+ getWeek: (date, options2) => {
3208
+ const base = toCalendarDate(date);
3209
+ return getWeek(base, {
3210
+ weekStartsOn: options2?.weekStartsOn ?? fallbackWeekStartsOn,
3211
+ firstWeekContainsDate: options2?.firstWeekContainsDate ?? locale?.options?.firstWeekContainsDate ?? 1
3212
+ });
3213
+ },
3214
+ getISOWeek: (date) => {
3215
+ const base = toCalendarDate(date);
3216
+ return getISOWeek(base);
3217
+ },
3218
+ differenceInCalendarDays: (dateLeft, dateRight) => {
3219
+ const left = toCalendarDate(dateLeft);
3220
+ const right = toCalendarDate(dateRight);
3221
+ return differenceInCalendarDays(left, right);
3222
+ },
3223
+ differenceInCalendarMonths: (dateLeft, dateRight) => {
3224
+ const left = toCalendarDate(dateLeft);
3225
+ const right = toCalendarDate(dateRight);
3226
+ return differenceInCalendarMonths(left, right);
3227
+ }
3228
+ };
3229
+ }
3230
+ var asHtmlElement = (element) => {
3231
+ if (element instanceof HTMLElement)
3232
+ return element;
3233
+ return null;
3234
+ };
3235
+ var queryMonthEls = (element) => [
3236
+ ...element.querySelectorAll("[data-animated-month]") ?? []
3237
+ ];
3238
+ var queryMonthEl = (element) => asHtmlElement(element.querySelector("[data-animated-month]"));
3239
+ var queryCaptionEl = (element) => asHtmlElement(element.querySelector("[data-animated-caption]"));
3240
+ var queryWeeksEl = (element) => asHtmlElement(element.querySelector("[data-animated-weeks]"));
3241
+ var queryNavEl = (element) => asHtmlElement(element.querySelector("[data-animated-nav]"));
3242
+ var queryWeekdaysEl = (element) => asHtmlElement(element.querySelector("[data-animated-weekdays]"));
3243
+ function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib }) {
3244
+ const previousRootElSnapshotRef = useRef(null);
3245
+ const previousMonthsRef = useRef(months);
3246
+ const animatingRef = useRef(false);
3247
+ useLayoutEffect(() => {
3248
+ const previousMonths = previousMonthsRef.current;
3249
+ previousMonthsRef.current = months;
3250
+ if (!enabled || !rootElRef.current || // safety check because the ref can be set to anything by consumers
3251
+ !(rootElRef.current instanceof HTMLElement) || // validation required for the animation to work as expected
3252
+ months.length === 0 || previousMonths.length === 0 || months.length !== previousMonths.length) {
3253
+ return;
3254
+ }
3255
+ const isSameMonth2 = dateLib.isSameMonth(months[0].date, previousMonths[0].date);
3256
+ const isAfterPreviousMonth = dateLib.isAfter(months[0].date, previousMonths[0].date);
3257
+ const captionAnimationClass = isAfterPreviousMonth ? classNames[Animation.caption_after_enter] : classNames[Animation.caption_before_enter];
3258
+ const weeksAnimationClass = isAfterPreviousMonth ? classNames[Animation.weeks_after_enter] : classNames[Animation.weeks_before_enter];
3259
+ const previousRootElSnapshot = previousRootElSnapshotRef.current;
3260
+ const rootElSnapshot = rootElRef.current.cloneNode(true);
3261
+ if (rootElSnapshot instanceof HTMLElement) {
3262
+ const currentMonthElsSnapshot = queryMonthEls(rootElSnapshot);
3263
+ currentMonthElsSnapshot.forEach((currentMonthElSnapshot) => {
3264
+ if (!(currentMonthElSnapshot instanceof HTMLElement))
3265
+ return;
3266
+ const previousMonthElSnapshot = queryMonthEl(currentMonthElSnapshot);
3267
+ if (previousMonthElSnapshot && currentMonthElSnapshot.contains(previousMonthElSnapshot)) {
3268
+ currentMonthElSnapshot.removeChild(previousMonthElSnapshot);
3269
+ }
3270
+ const captionEl = queryCaptionEl(currentMonthElSnapshot);
3271
+ if (captionEl) {
3272
+ captionEl.classList.remove(captionAnimationClass);
3273
+ }
3274
+ const weeksEl = queryWeeksEl(currentMonthElSnapshot);
3275
+ if (weeksEl) {
3276
+ weeksEl.classList.remove(weeksAnimationClass);
3277
+ }
3278
+ });
3279
+ previousRootElSnapshotRef.current = rootElSnapshot;
3280
+ } else {
3281
+ previousRootElSnapshotRef.current = null;
3282
+ }
3283
+ if (animatingRef.current || isSameMonth2 || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
3284
+ focused) {
3285
+ return;
3286
+ }
3287
+ const previousMonthEls = previousRootElSnapshot instanceof HTMLElement ? queryMonthEls(previousRootElSnapshot) : [];
3288
+ const currentMonthEls = queryMonthEls(rootElRef.current);
3289
+ if (currentMonthEls?.every((el) => el instanceof HTMLElement) && previousMonthEls?.every((el) => el instanceof HTMLElement)) {
3290
+ animatingRef.current = true;
3291
+ rootElRef.current.style.isolation = "isolate";
3292
+ const navEl = queryNavEl(rootElRef.current);
3293
+ if (navEl) {
3294
+ navEl.style.zIndex = "1";
3295
+ }
3296
+ currentMonthEls.forEach((currentMonthEl, index) => {
3297
+ const previousMonthEl = previousMonthEls[index];
3298
+ if (!previousMonthEl) {
3299
+ return;
3300
+ }
3301
+ currentMonthEl.style.position = "relative";
3302
+ currentMonthEl.style.overflow = "hidden";
3303
+ const captionEl = queryCaptionEl(currentMonthEl);
3304
+ if (captionEl) {
3305
+ captionEl.classList.add(captionAnimationClass);
3306
+ }
3307
+ const weeksEl = queryWeeksEl(currentMonthEl);
3308
+ if (weeksEl) {
3309
+ weeksEl.classList.add(weeksAnimationClass);
3310
+ }
3311
+ const cleanUp = () => {
3312
+ animatingRef.current = false;
3313
+ if (rootElRef.current) {
3314
+ rootElRef.current.style.isolation = "";
3315
+ }
3316
+ if (navEl) {
3317
+ navEl.style.zIndex = "";
3318
+ }
3319
+ if (captionEl) {
3320
+ captionEl.classList.remove(captionAnimationClass);
3321
+ }
3322
+ if (weeksEl) {
3323
+ weeksEl.classList.remove(weeksAnimationClass);
3324
+ }
3325
+ currentMonthEl.style.position = "";
3326
+ currentMonthEl.style.overflow = "";
3327
+ if (currentMonthEl.contains(previousMonthEl)) {
3328
+ currentMonthEl.removeChild(previousMonthEl);
3329
+ }
3330
+ };
3331
+ previousMonthEl.style.pointerEvents = "none";
3332
+ previousMonthEl.style.position = "absolute";
3333
+ previousMonthEl.style.overflow = "hidden";
3334
+ previousMonthEl.setAttribute("aria-hidden", "true");
3335
+ const previousWeekdaysEl = queryWeekdaysEl(previousMonthEl);
3336
+ if (previousWeekdaysEl) {
3337
+ previousWeekdaysEl.style.opacity = "0";
3338
+ }
3339
+ const previousCaptionEl = queryCaptionEl(previousMonthEl);
3340
+ if (previousCaptionEl) {
3341
+ previousCaptionEl.classList.add(isAfterPreviousMonth ? classNames[Animation.caption_before_exit] : classNames[Animation.caption_after_exit]);
3342
+ previousCaptionEl.addEventListener("animationend", cleanUp);
3343
+ }
3344
+ const previousWeeksEl = queryWeeksEl(previousMonthEl);
3345
+ if (previousWeeksEl) {
3346
+ previousWeeksEl.classList.add(isAfterPreviousMonth ? classNames[Animation.weeks_before_exit] : classNames[Animation.weeks_after_exit]);
3347
+ }
3348
+ currentMonthEl.insertBefore(previousMonthEl, currentMonthEl.firstChild);
3349
+ });
3350
+ }
3351
+ });
3352
+ }
3353
+
3354
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getDates.js
3355
+ function getDates(displayMonths, maxDate, props, dateLib) {
3356
+ const firstMonth = displayMonths[0];
3357
+ const lastMonth = displayMonths[displayMonths.length - 1];
3358
+ const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};
3359
+ const { addDays: addDays2, differenceInCalendarDays: differenceInCalendarDays2, differenceInCalendarMonths: differenceInCalendarMonths2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfMonth: endOfMonth2, endOfWeek: endOfWeek2, isAfter: isAfter2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
3360
+ const startWeekFirstDate = broadcastCalendar ? startOfBroadcastWeek2(firstMonth, dateLib) : ISOWeek ? startOfISOWeek2(firstMonth) : startOfWeek2(firstMonth);
3361
+ const displayMonthsWeekEnd = broadcastCalendar ? endOfBroadcastWeek2(lastMonth) : ISOWeek ? endOfISOWeek2(endOfMonth2(lastMonth)) : endOfWeek2(endOfMonth2(lastMonth));
3362
+ const constraintWeekEnd = maxDate && (broadcastCalendar ? endOfBroadcastWeek2(maxDate) : ISOWeek ? endOfISOWeek2(maxDate) : endOfWeek2(maxDate));
3363
+ const gridEndDate = constraintWeekEnd && isAfter2(displayMonthsWeekEnd, constraintWeekEnd) ? constraintWeekEnd : displayMonthsWeekEnd;
3364
+ const nOfDays = differenceInCalendarDays2(gridEndDate, startWeekFirstDate);
3365
+ const nOfMonths = differenceInCalendarMonths2(lastMonth, firstMonth) + 1;
3366
+ const dates = [];
3367
+ for (let i = 0; i <= nOfDays; i++) {
3368
+ const date = addDays2(startWeekFirstDate, i);
3369
+ dates.push(date);
3370
+ }
3371
+ const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;
3372
+ const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;
3373
+ if (fixedWeeks && dates.length < extraDates) {
3374
+ const daysToAdd = extraDates - dates.length;
3375
+ for (let i = 0; i < daysToAdd; i++) {
3376
+ const date = addDays2(dates[dates.length - 1], 1);
3377
+ dates.push(date);
3378
+ }
3379
+ }
3380
+ return dates;
3381
+ }
3382
+
3383
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getDays.js
3384
+ function getDays(calendarMonths) {
3385
+ const initialDays = [];
3386
+ return calendarMonths.reduce((days, month) => {
3387
+ const weekDays = month.weeks.reduce((weekDays2, week) => {
3388
+ return weekDays2.concat(week.days.slice());
3389
+ }, initialDays.slice());
3390
+ return days.concat(weekDays.slice());
3391
+ }, initialDays.slice());
3392
+ }
3393
+
3394
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js
3395
+ function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {
3396
+ const { numberOfMonths = 1 } = props;
3397
+ const months = [];
3398
+ for (let i = 0; i < numberOfMonths; i++) {
3399
+ const month = dateLib.addMonths(firstDisplayedMonth, i);
3400
+ if (calendarEndMonth && month > calendarEndMonth) {
3401
+ break;
3402
+ }
3403
+ months.push(month);
3404
+ }
3405
+ return months;
3406
+ }
3407
+
3408
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js
3409
+ function getInitialMonth(props, navStart, navEnd, dateLib) {
3410
+ const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1 } = props;
3411
+ let initialMonth = month || defaultMonth || today;
3412
+ const { differenceInCalendarMonths: differenceInCalendarMonths2, addMonths: addMonths2, startOfMonth: startOfMonth2 } = dateLib;
3413
+ if (navEnd && differenceInCalendarMonths2(navEnd, initialMonth) < numberOfMonths - 1) {
3414
+ const offset = -1 * (numberOfMonths - 1);
3415
+ initialMonth = addMonths2(navEnd, offset);
3416
+ }
3417
+ if (navStart && differenceInCalendarMonths2(initialMonth, navStart) < 0) {
3418
+ initialMonth = navStart;
3419
+ }
3420
+ return startOfMonth2(initialMonth);
3421
+ }
3422
+
3423
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getMonths.js
3424
+ function getMonths(displayMonths, dates, props, dateLib) {
3425
+ const { addDays: addDays2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfMonth: endOfMonth2, endOfWeek: endOfWeek2, getISOWeek: getISOWeek2, getWeek: getWeek2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
3426
+ const dayPickerMonths = displayMonths.reduce((months, month) => {
3427
+ const firstDateOfFirstWeek = props.broadcastCalendar ? startOfBroadcastWeek2(month, dateLib) : props.ISOWeek ? startOfISOWeek2(month) : startOfWeek2(month);
3428
+ const lastDateOfLastWeek = props.broadcastCalendar ? endOfBroadcastWeek2(month) : props.ISOWeek ? endOfISOWeek2(endOfMonth2(month)) : endOfWeek2(endOfMonth2(month));
3429
+ const monthDates = dates.filter((date) => {
3430
+ return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;
3431
+ });
3432
+ const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;
3433
+ if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {
3434
+ const extraDates = dates.filter((date) => {
3435
+ const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;
3436
+ return date > lastDateOfLastWeek && date <= addDays2(lastDateOfLastWeek, daysToAdd);
3437
+ });
3438
+ monthDates.push(...extraDates);
3439
+ }
3440
+ const weeks = monthDates.reduce((weeks2, date) => {
3441
+ const weekNumber = props.ISOWeek ? getISOWeek2(date) : getWeek2(date);
3442
+ const week = weeks2.find((week2) => week2.weekNumber === weekNumber);
3443
+ const day = new CalendarDay(date, month, dateLib);
3444
+ if (!week) {
3445
+ weeks2.push(new CalendarWeek(weekNumber, [day]));
3446
+ } else {
3447
+ week.days.push(day);
3448
+ }
3449
+ return weeks2;
3450
+ }, []);
3451
+ const dayPickerMonth = new CalendarMonth(month, weeks);
3452
+ months.push(dayPickerMonth);
3453
+ return months;
3454
+ }, []);
3455
+ if (!props.reverseMonths) {
3456
+ return dayPickerMonths;
3457
+ } else {
3458
+ return dayPickerMonths.reverse();
3459
+ }
3460
+ }
3461
+
3462
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js
3463
+ function getNavMonths(props, dateLib) {
3464
+ let { startMonth, endMonth } = props;
3465
+ const { startOfYear: startOfYear2, startOfDay: startOfDay2, startOfMonth: startOfMonth2, endOfMonth: endOfMonth2, addYears: addYears2, endOfYear: endOfYear2, today } = dateLib;
3466
+ const hasYearDropdown = props.captionLayout === "dropdown" || props.captionLayout === "dropdown-years";
3467
+ if (startMonth) {
3468
+ startMonth = startOfMonth2(startMonth);
3469
+ } else if (!startMonth && hasYearDropdown) {
3470
+ startMonth = startOfYear2(addYears2(props.today ?? today(), -100));
3471
+ }
3472
+ if (endMonth) {
3473
+ endMonth = endOfMonth2(endMonth);
3474
+ } else if (!endMonth && hasYearDropdown) {
3475
+ endMonth = endOfYear2(props.today ?? today());
3476
+ }
3477
+ return [
3478
+ startMonth ? startOfDay2(startMonth) : startMonth,
3479
+ endMonth ? startOfDay2(endMonth) : endMonth
3480
+ ];
3481
+ }
3482
+
3483
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js
3484
+ function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {
3485
+ if (options.disableNavigation) {
3486
+ return void 0;
3487
+ }
3488
+ const { pagedNavigation, numberOfMonths = 1 } = options;
3489
+ const { startOfMonth: startOfMonth2, addMonths: addMonths2, differenceInCalendarMonths: differenceInCalendarMonths2 } = dateLib;
3490
+ const offset = pagedNavigation ? numberOfMonths : 1;
3491
+ const month = startOfMonth2(firstDisplayedMonth);
3492
+ if (!calendarEndMonth) {
3493
+ return addMonths2(month, offset);
3494
+ }
3495
+ const monthsDiff = differenceInCalendarMonths2(calendarEndMonth, firstDisplayedMonth);
3496
+ if (monthsDiff < numberOfMonths) {
3497
+ return void 0;
3498
+ }
3499
+ return addMonths2(month, offset);
3500
+ }
3501
+
3502
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js
3503
+ function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, dateLib) {
3504
+ if (options.disableNavigation) {
3505
+ return void 0;
3506
+ }
3507
+ const { pagedNavigation, numberOfMonths } = options;
3508
+ const { startOfMonth: startOfMonth2, addMonths: addMonths2, differenceInCalendarMonths: differenceInCalendarMonths2 } = dateLib;
3509
+ const offset = pagedNavigation ? numberOfMonths ?? 1 : 1;
3510
+ const month = startOfMonth2(firstDisplayedMonth);
3511
+ if (!calendarStartMonth) {
3512
+ return addMonths2(month, -offset);
3513
+ }
3514
+ const monthsDiff = differenceInCalendarMonths2(month, calendarStartMonth);
3515
+ if (monthsDiff <= 0) {
3516
+ return void 0;
3517
+ }
3518
+ return addMonths2(month, -offset);
3519
+ }
3520
+
3521
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getWeeks.js
3522
+ function getWeeks(months) {
3523
+ const initialWeeks = [];
3524
+ return months.reduce((weeks, month) => {
3525
+ return weeks.concat(month.weeks.slice());
3526
+ }, initialWeeks.slice());
3527
+ }
3528
+ function useControlledValue(defaultValue, controlledValue) {
3529
+ const [uncontrolledValue, setValue] = useState(defaultValue);
3530
+ const value = controlledValue === void 0 ? uncontrolledValue : controlledValue;
3531
+ return [value, setValue];
3532
+ }
3533
+
3534
+ // ../../node_modules/react-day-picker/dist/esm/useCalendar.js
3535
+ function useCalendar(props, dateLib) {
3536
+ const [navStart, navEnd] = getNavMonths(props, dateLib);
3537
+ const { startOfMonth: startOfMonth2, endOfMonth: endOfMonth2 } = dateLib;
3538
+ const initialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
3539
+ const [firstMonth, setFirstMonth] = useControlledValue(
3540
+ initialMonth,
3541
+ // initialMonth is always computed from props.month if provided
3542
+ props.month ? initialMonth : void 0
3543
+ );
3544
+ useEffect(() => {
3545
+ const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
3546
+ setFirstMonth(newInitialMonth);
3547
+ }, [props.timeZone]);
3548
+ const { months, weeks, days, previousMonth, nextMonth } = useMemo(() => {
3549
+ const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
3550
+ const dates = getDates(displayMonths, props.endMonth ? endOfMonth2(props.endMonth) : void 0, {
3551
+ ISOWeek: props.ISOWeek,
3552
+ fixedWeeks: props.fixedWeeks,
3553
+ broadcastCalendar: props.broadcastCalendar
3554
+ }, dateLib);
3555
+ const months2 = getMonths(displayMonths, dates, {
3556
+ broadcastCalendar: props.broadcastCalendar,
3557
+ fixedWeeks: props.fixedWeeks,
3558
+ ISOWeek: props.ISOWeek,
3559
+ reverseMonths: props.reverseMonths
3560
+ }, dateLib);
3561
+ const weeks2 = getWeeks(months2);
3562
+ const days2 = getDays(months2);
3563
+ const previousMonth2 = getPreviousMonth(firstMonth, navStart, props, dateLib);
3564
+ const nextMonth2 = getNextMonth(firstMonth, navEnd, props, dateLib);
3565
+ return {
3566
+ months: months2,
3567
+ weeks: weeks2,
3568
+ days: days2,
3569
+ previousMonth: previousMonth2,
3570
+ nextMonth: nextMonth2
3571
+ };
3572
+ }, [
3573
+ dateLib,
3574
+ firstMonth.getTime(),
3575
+ navEnd?.getTime(),
3576
+ navStart?.getTime(),
3577
+ props.disableNavigation,
3578
+ props.broadcastCalendar,
3579
+ props.endMonth?.getTime(),
3580
+ props.fixedWeeks,
3581
+ props.ISOWeek,
3582
+ props.numberOfMonths,
3583
+ props.pagedNavigation,
3584
+ props.reverseMonths
3585
+ ]);
3586
+ const { disableNavigation, onMonthChange } = props;
3587
+ const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
3588
+ const goToMonth = (date) => {
3589
+ if (disableNavigation) {
3590
+ return;
3591
+ }
3592
+ let newMonth = startOfMonth2(date);
3593
+ if (navStart && newMonth < startOfMonth2(navStart)) {
3594
+ newMonth = startOfMonth2(navStart);
3595
+ }
3596
+ if (navEnd && newMonth > startOfMonth2(navEnd)) {
3597
+ newMonth = startOfMonth2(navEnd);
3598
+ }
3599
+ setFirstMonth(newMonth);
3600
+ onMonthChange?.(newMonth);
3601
+ };
3602
+ const goToDay = (day) => {
3603
+ if (isDayInCalendar(day)) {
3604
+ return;
3605
+ }
3606
+ goToMonth(day.date);
3607
+ };
3608
+ const calendar = {
3609
+ months,
3610
+ weeks,
3611
+ days,
3612
+ navStart,
3613
+ navEnd,
3614
+ previousMonth,
3615
+ nextMonth,
3616
+ goToMonth,
3617
+ goToDay
3618
+ };
3619
+ return calendar;
3620
+ }
3621
+
3622
+ // ../../node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js
3623
+ var FocusTargetPriority;
3624
+ (function(FocusTargetPriority2) {
3625
+ FocusTargetPriority2[FocusTargetPriority2["Today"] = 0] = "Today";
3626
+ FocusTargetPriority2[FocusTargetPriority2["Selected"] = 1] = "Selected";
3627
+ FocusTargetPriority2[FocusTargetPriority2["LastFocused"] = 2] = "LastFocused";
3628
+ FocusTargetPriority2[FocusTargetPriority2["FocusedModifier"] = 3] = "FocusedModifier";
3629
+ })(FocusTargetPriority || (FocusTargetPriority = {}));
3630
+ function isFocusableDay(modifiers) {
3631
+ return !modifiers[DayFlag.disabled] && !modifiers[DayFlag.hidden] && !modifiers[DayFlag.outside];
3632
+ }
3633
+ function calculateFocusTarget(days, getModifiers, isSelected, lastFocused) {
3634
+ let focusTarget;
3635
+ let foundFocusTargetPriority = -1;
3636
+ for (const day of days) {
3637
+ const modifiers = getModifiers(day);
3638
+ if (isFocusableDay(modifiers)) {
3639
+ if (modifiers[DayFlag.focused] && foundFocusTargetPriority < FocusTargetPriority.FocusedModifier) {
3640
+ focusTarget = day;
3641
+ foundFocusTargetPriority = FocusTargetPriority.FocusedModifier;
3642
+ } else if (lastFocused?.isEqualTo(day) && foundFocusTargetPriority < FocusTargetPriority.LastFocused) {
3643
+ focusTarget = day;
3644
+ foundFocusTargetPriority = FocusTargetPriority.LastFocused;
3645
+ } else if (isSelected(day.date) && foundFocusTargetPriority < FocusTargetPriority.Selected) {
3646
+ focusTarget = day;
3647
+ foundFocusTargetPriority = FocusTargetPriority.Selected;
3648
+ } else if (modifiers[DayFlag.today] && foundFocusTargetPriority < FocusTargetPriority.Today) {
3649
+ focusTarget = day;
3650
+ foundFocusTargetPriority = FocusTargetPriority.Today;
3651
+ }
3652
+ }
3653
+ }
3654
+ if (!focusTarget) {
3655
+ focusTarget = days.find((day) => isFocusableDay(getModifiers(day)));
3656
+ }
3657
+ return focusTarget;
3658
+ }
3659
+
3660
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js
3661
+ function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {
3662
+ const { ISOWeek, broadcastCalendar } = props;
3663
+ const { addDays: addDays2, addMonths: addMonths2, addWeeks: addWeeks2, addYears: addYears2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfWeek: endOfWeek2, max: max2, min: min2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
3664
+ const moveFns = {
3665
+ day: addDays2,
3666
+ week: addWeeks2,
3667
+ month: addMonths2,
3668
+ year: addYears2,
3669
+ startOfWeek: (date) => broadcastCalendar ? startOfBroadcastWeek2(date, dateLib) : ISOWeek ? startOfISOWeek2(date) : startOfWeek2(date),
3670
+ endOfWeek: (date) => broadcastCalendar ? endOfBroadcastWeek2(date) : ISOWeek ? endOfISOWeek2(date) : endOfWeek2(date)
3671
+ };
3672
+ let focusableDate = moveFns[moveBy](refDate, moveDir === "after" ? 1 : -1);
3673
+ if (moveDir === "before" && navStart) {
3674
+ focusableDate = max2([navStart, focusableDate]);
3675
+ } else if (moveDir === "after" && navEnd) {
3676
+ focusableDate = min2([navEnd, focusableDate]);
3677
+ }
3678
+ return focusableDate;
3679
+ }
3680
+
3681
+ // ../../node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js
3682
+ function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt = 0) {
3683
+ if (attempt > 365) {
3684
+ return void 0;
3685
+ }
3686
+ const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, calendarStartMonth, calendarEndMonth, props, dateLib);
3687
+ const isDisabled = Boolean(props.disabled && dateMatchModifiers(focusableDate, props.disabled, dateLib));
3688
+ const isHidden = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));
3689
+ const targetMonth = focusableDate;
3690
+ const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);
3691
+ if (!isDisabled && !isHidden) {
3692
+ return focusDay;
3693
+ }
3694
+ return getNextFocus(moveBy, moveDir, focusDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt + 1);
3695
+ }
3696
+
3697
+ // ../../node_modules/react-day-picker/dist/esm/useFocus.js
3698
+ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
3699
+ const { autoFocus } = props;
3700
+ const [lastFocused, setLastFocused] = useState();
3701
+ const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);
3702
+ const [focusedDay, setFocused] = useState(autoFocus ? focusTarget : void 0);
3703
+ const blur = () => {
3704
+ setLastFocused(focusedDay);
3705
+ setFocused(void 0);
3706
+ };
3707
+ const moveFocus = (moveBy, moveDir) => {
3708
+ if (!focusedDay)
3709
+ return;
3710
+ const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
3711
+ if (!nextFocus)
3712
+ return;
3713
+ if (props.disableNavigation) {
3714
+ const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
3715
+ if (!isNextInCalendar) {
3716
+ return;
3717
+ }
3718
+ }
3719
+ calendar.goToDay(nextFocus);
3720
+ setFocused(nextFocus);
3721
+ };
3722
+ const isFocusTarget = (day) => {
3723
+ return Boolean(focusTarget?.isEqualTo(day));
3724
+ };
3725
+ const useFocus2 = {
3726
+ isFocusTarget,
3727
+ setFocused,
3728
+ focused: focusedDay,
3729
+ blur,
3730
+ moveFocus
3731
+ };
3732
+ return useFocus2;
3733
+ }
3734
+
3735
+ // ../../node_modules/react-day-picker/dist/esm/selection/useMulti.js
3736
+ function useMulti(props, dateLib) {
3737
+ const { selected: initiallySelected, required, onSelect } = props;
3738
+ const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
3739
+ const selected = !onSelect ? internallySelected : initiallySelected;
3740
+ const { isSameDay: isSameDay2 } = dateLib;
3741
+ const isSelected = (date) => {
3742
+ return selected?.some((d) => isSameDay2(d, date)) ?? false;
3743
+ };
3744
+ const { min: min2, max: max2 } = props;
3745
+ const select = (triggerDate, modifiers, e) => {
3746
+ let newDates = [...selected ?? []];
3747
+ if (isSelected(triggerDate)) {
3748
+ if (selected?.length === min2) {
3749
+ return;
3750
+ }
3751
+ if (required && selected?.length === 1) {
3752
+ return;
3753
+ }
3754
+ newDates = selected?.filter((d) => !isSameDay2(d, triggerDate));
3755
+ } else {
3756
+ if (selected?.length === max2) {
3757
+ newDates = [triggerDate];
3758
+ } else {
3759
+ newDates = [...newDates, triggerDate];
3760
+ }
3761
+ }
3762
+ if (!onSelect) {
3763
+ setSelected(newDates);
3764
+ }
3765
+ onSelect?.(newDates, triggerDate, modifiers, e);
3766
+ return newDates;
3767
+ };
3768
+ return {
3769
+ selected,
3770
+ select,
3771
+ isSelected
3772
+ };
3773
+ }
3774
+
3775
+ // ../../node_modules/react-day-picker/dist/esm/utils/addToRange.js
3776
+ function addToRange(date, initialRange, min2 = 0, max2 = 0, required = false, dateLib = defaultDateLib) {
3777
+ const { from, to } = initialRange || {};
3778
+ const { isSameDay: isSameDay2, isAfter: isAfter2, isBefore: isBefore2 } = dateLib;
3779
+ let range;
3780
+ if (!from && !to) {
3781
+ range = { from: date, to: min2 > 0 ? void 0 : date };
3782
+ } else if (from && !to) {
3783
+ if (isSameDay2(from, date)) {
3784
+ if (min2 === 0) {
3785
+ range = { from, to: date };
3786
+ } else if (required) {
3787
+ range = { from, to: void 0 };
3788
+ } else {
3789
+ range = void 0;
3790
+ }
3791
+ } else if (isBefore2(date, from)) {
3792
+ range = { from: date, to: from };
3793
+ } else {
3794
+ range = { from, to: date };
3795
+ }
3796
+ } else if (from && to) {
3797
+ if (isSameDay2(from, date) && isSameDay2(to, date)) {
3798
+ if (required) {
3799
+ range = { from, to };
3800
+ } else {
3801
+ range = void 0;
3802
+ }
3803
+ } else if (isSameDay2(from, date)) {
3804
+ range = { from, to: min2 > 0 ? void 0 : date };
3805
+ } else if (isSameDay2(to, date)) {
3806
+ range = { from: date, to: min2 > 0 ? void 0 : date };
3807
+ } else if (isBefore2(date, from)) {
3808
+ range = { from: date, to };
3809
+ } else if (isAfter2(date, from)) {
3810
+ range = { from, to: date };
3811
+ } else if (isAfter2(date, to)) {
3812
+ range = { from, to: date };
3813
+ } else {
3814
+ throw new Error("Invalid range");
3815
+ }
3816
+ }
3817
+ if (range?.from && range?.to) {
3818
+ const diff = dateLib.differenceInCalendarDays(range.to, range.from);
3819
+ if (max2 > 0 && diff > max2) {
3820
+ range = { from: date, to: void 0 };
3821
+ } else if (min2 > 1 && diff < min2) {
3822
+ range = { from: date, to: void 0 };
3823
+ }
3824
+ }
3825
+ return range;
3826
+ }
3827
+
3828
+ // ../../node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js
3829
+ function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = defaultDateLib) {
3830
+ const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;
3831
+ let date = range.from;
3832
+ const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
3833
+ const totalDaysLimit = Math.min(totalDays, 6);
3834
+ for (let i = 0; i <= totalDaysLimit; i++) {
3835
+ if (dayOfWeekArr.includes(date.getDay())) {
3836
+ return true;
3837
+ }
3838
+ date = dateLib.addDays(date, 1);
3839
+ }
3840
+ return false;
3841
+ }
3842
+
3843
+ // ../../node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js
3844
+ function rangeOverlaps(rangeLeft, rangeRight, dateLib = defaultDateLib) {
3845
+ return rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) || rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) || rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) || rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib);
3846
+ }
3847
+
3848
+ // ../../node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js
3849
+ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
3850
+ const matchers = Array.isArray(modifiers) ? modifiers : [modifiers];
3851
+ const nonFunctionMatchers = matchers.filter((matcher) => typeof matcher !== "function");
3852
+ const nonFunctionMatchersResult = nonFunctionMatchers.some((matcher) => {
3853
+ if (typeof matcher === "boolean")
3854
+ return matcher;
3855
+ if (dateLib.isDate(matcher)) {
3856
+ return rangeIncludesDate(range, matcher, false, dateLib);
3857
+ }
3858
+ if (isDatesArray(matcher, dateLib)) {
3859
+ return matcher.some((date) => rangeIncludesDate(range, date, false, dateLib));
3860
+ }
3861
+ if (isDateRange(matcher)) {
3862
+ if (matcher.from && matcher.to) {
3863
+ return rangeOverlaps(range, { from: matcher.from, to: matcher.to }, dateLib);
3864
+ }
3865
+ return false;
3866
+ }
3867
+ if (isDayOfWeekType(matcher)) {
3868
+ return rangeContainsDayOfWeek(range, matcher.dayOfWeek, dateLib);
3869
+ }
3870
+ if (isDateInterval(matcher)) {
3871
+ const isClosedInterval = dateLib.isAfter(matcher.before, matcher.after);
3872
+ if (isClosedInterval) {
3873
+ return rangeOverlaps(range, {
3874
+ from: dateLib.addDays(matcher.after, 1),
3875
+ to: dateLib.addDays(matcher.before, -1)
3876
+ }, dateLib);
3877
+ }
3878
+ return dateMatchModifiers(range.from, matcher, dateLib) || dateMatchModifiers(range.to, matcher, dateLib);
3879
+ }
3880
+ if (isDateAfterType(matcher) || isDateBeforeType(matcher)) {
3881
+ return dateMatchModifiers(range.from, matcher, dateLib) || dateMatchModifiers(range.to, matcher, dateLib);
3882
+ }
3883
+ return false;
3884
+ });
3885
+ if (nonFunctionMatchersResult) {
3886
+ return true;
3887
+ }
3888
+ const functionMatchers = matchers.filter((matcher) => typeof matcher === "function");
3889
+ if (functionMatchers.length) {
3890
+ let date = range.from;
3891
+ const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
3892
+ for (let i = 0; i <= totalDays; i++) {
3893
+ if (functionMatchers.some((matcher) => matcher(date))) {
3894
+ return true;
3895
+ }
3896
+ date = dateLib.addDays(date, 1);
3897
+ }
3898
+ }
3899
+ return false;
3900
+ }
3901
+
3902
+ // ../../node_modules/react-day-picker/dist/esm/selection/useRange.js
3903
+ function useRange(props, dateLib) {
3904
+ const { disabled, excludeDisabled, resetOnSelect, selected: initiallySelected, required, onSelect } = props;
3905
+ const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
3906
+ const selected = !onSelect ? internallySelected : initiallySelected;
3907
+ const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
3908
+ const select = (triggerDate, modifiers, e) => {
3909
+ const { min: min2, max: max2 } = props;
3910
+ let newRange;
3911
+ if (triggerDate) {
3912
+ const selectedFrom = selected?.from;
3913
+ const selectedTo = selected?.to;
3914
+ const hasFullRange = !!selectedFrom && !!selectedTo;
3915
+ const isClickingSingleDayRange = !!selectedFrom && !!selectedTo && dateLib.isSameDay(selectedFrom, selectedTo) && dateLib.isSameDay(triggerDate, selectedFrom);
3916
+ if (resetOnSelect && (hasFullRange || !selected?.from)) {
3917
+ if (!required && isClickingSingleDayRange) {
3918
+ newRange = void 0;
3919
+ } else {
3920
+ newRange = { from: triggerDate, to: void 0 };
3921
+ }
3922
+ } else {
3923
+ newRange = addToRange(triggerDate, selected, min2, max2, required, dateLib);
3924
+ }
3925
+ }
3926
+ if (excludeDisabled && disabled && newRange?.from && newRange.to) {
3927
+ if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
3928
+ newRange.from = triggerDate;
3929
+ newRange.to = void 0;
3930
+ }
3931
+ }
3932
+ if (!onSelect) {
3933
+ setSelected(newRange);
3934
+ }
3935
+ onSelect?.(newRange, triggerDate, modifiers, e);
3936
+ return newRange;
3937
+ };
3938
+ return {
3939
+ selected,
3940
+ select,
3941
+ isSelected
3942
+ };
3943
+ }
3944
+
3945
+ // ../../node_modules/react-day-picker/dist/esm/selection/useSingle.js
3946
+ function useSingle(props, dateLib) {
3947
+ const { selected: initiallySelected, required, onSelect } = props;
3948
+ const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
3949
+ const selected = !onSelect ? internallySelected : initiallySelected;
3950
+ const { isSameDay: isSameDay2 } = dateLib;
3951
+ const isSelected = (compareDate) => {
3952
+ return selected ? isSameDay2(selected, compareDate) : false;
3953
+ };
3954
+ const select = (triggerDate, modifiers, e) => {
3955
+ let newDate = triggerDate;
3956
+ if (!required && selected && selected && isSameDay2(triggerDate, selected)) {
3957
+ newDate = void 0;
3958
+ }
3959
+ if (!onSelect) {
3960
+ setSelected(newDate);
3961
+ }
3962
+ if (required) {
3963
+ onSelect?.(newDate, triggerDate, modifiers, e);
3964
+ } else {
3965
+ onSelect?.(newDate, triggerDate, modifiers, e);
3966
+ }
3967
+ return newDate;
3968
+ };
3969
+ return {
3970
+ selected,
3971
+ select,
3972
+ isSelected
3973
+ };
3974
+ }
3975
+
3976
+ // ../../node_modules/react-day-picker/dist/esm/useSelection.js
3977
+ function useSelection(props, dateLib) {
3978
+ const single = useSingle(props, dateLib);
3979
+ const multi = useMulti(props, dateLib);
3980
+ const range = useRange(props, dateLib);
3981
+ switch (props.mode) {
3982
+ case "single":
3983
+ return single;
3984
+ case "multiple":
3985
+ return multi;
3986
+ case "range":
3987
+ return range;
3988
+ default:
3989
+ return void 0;
3990
+ }
3991
+ }
3992
+
3993
+ // ../../node_modules/react-day-picker/dist/esm/utils/toTimeZone.js
3994
+ function toTimeZone(date, timeZone) {
3995
+ if (date instanceof TZDate && date.timeZone === timeZone) {
3996
+ return date;
3997
+ }
3998
+ return new TZDate(date, timeZone);
3999
+ }
4000
+
4001
+ // ../../node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js
4002
+ function toZoneNoon(date, timeZone, noonSafe) {
4003
+ return toTimeZone(date, timeZone);
4004
+ }
4005
+ function convertMatcher(matcher, timeZone, noonSafe) {
4006
+ if (typeof matcher === "boolean" || typeof matcher === "function") {
4007
+ return matcher;
4008
+ }
4009
+ if (matcher instanceof Date) {
4010
+ return toZoneNoon(matcher, timeZone);
4011
+ }
4012
+ if (Array.isArray(matcher)) {
4013
+ return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone) : value);
4014
+ }
4015
+ if (isDateRange(matcher)) {
4016
+ return {
4017
+ ...matcher,
4018
+ from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
4019
+ to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to
4020
+ };
4021
+ }
4022
+ if (isDateInterval(matcher)) {
4023
+ return {
4024
+ before: toZoneNoon(matcher.before, timeZone),
4025
+ after: toZoneNoon(matcher.after, timeZone)
4026
+ };
4027
+ }
4028
+ if (isDateAfterType(matcher)) {
4029
+ return {
4030
+ after: toZoneNoon(matcher.after, timeZone)
4031
+ };
4032
+ }
4033
+ if (isDateBeforeType(matcher)) {
4034
+ return {
4035
+ before: toZoneNoon(matcher.before, timeZone)
4036
+ };
4037
+ }
4038
+ return matcher;
4039
+ }
4040
+ function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
4041
+ if (!matchers) {
4042
+ return matchers;
4043
+ }
4044
+ if (Array.isArray(matchers)) {
4045
+ return matchers.map((matcher) => convertMatcher(matcher, timeZone));
4046
+ }
4047
+ return convertMatcher(matchers, timeZone);
4048
+ }
4049
+
4050
+ // ../../node_modules/react-day-picker/dist/esm/DayPicker.js
4051
+ function DayPicker(initialProps) {
4052
+ let props = initialProps;
4053
+ const timeZone = props.timeZone;
4054
+ if (timeZone) {
4055
+ props = {
4056
+ ...initialProps,
4057
+ timeZone
4058
+ };
4059
+ if (props.today) {
4060
+ props.today = toTimeZone(props.today, timeZone);
4061
+ }
4062
+ if (props.month) {
4063
+ props.month = toTimeZone(props.month, timeZone);
4064
+ }
4065
+ if (props.defaultMonth) {
4066
+ props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
4067
+ }
4068
+ if (props.startMonth) {
4069
+ props.startMonth = toTimeZone(props.startMonth, timeZone);
4070
+ }
4071
+ if (props.endMonth) {
4072
+ props.endMonth = toTimeZone(props.endMonth, timeZone);
4073
+ }
4074
+ if (props.mode === "single" && props.selected) {
4075
+ props.selected = toTimeZone(props.selected, timeZone);
4076
+ } else if (props.mode === "multiple" && props.selected) {
4077
+ props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
4078
+ } else if (props.mode === "range" && props.selected) {
4079
+ props.selected = {
4080
+ from: props.selected.from ? toTimeZone(props.selected.from, timeZone) : props.selected.from,
4081
+ to: props.selected.to ? toTimeZone(props.selected.to, timeZone) : props.selected.to
4082
+ };
4083
+ }
4084
+ if (props.disabled !== void 0) {
4085
+ props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
4086
+ }
4087
+ if (props.hidden !== void 0) {
4088
+ props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
4089
+ }
4090
+ if (props.modifiers) {
4091
+ const nextModifiers = {};
4092
+ Object.keys(props.modifiers).forEach((key) => {
4093
+ nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
4094
+ });
4095
+ props.modifiers = nextModifiers;
4096
+ }
4097
+ }
4098
+ const { components, formatters: formatters2, labels, dateLib, locale, classNames } = useMemo(() => {
4099
+ const locale2 = { ...enUS2, ...props.locale };
4100
+ const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
4101
+ const noonOverrides = props.noonSafe && props.timeZone ? createNoonOverrides(props.timeZone, {
4102
+ weekStartsOn,
4103
+ locale: locale2
4104
+ }) : void 0;
4105
+ const overrides = props.dateLib && noonOverrides ? { ...noonOverrides, ...props.dateLib } : props.dateLib ?? noonOverrides;
4106
+ const dateLib2 = new DateLib({
4107
+ locale: locale2,
4108
+ weekStartsOn,
4109
+ firstWeekContainsDate: props.firstWeekContainsDate,
4110
+ useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
4111
+ useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
4112
+ timeZone: props.timeZone,
4113
+ numerals: props.numerals
4114
+ }, overrides);
4115
+ return {
4116
+ dateLib: dateLib2,
4117
+ components: getComponents(props.components),
4118
+ formatters: getFormatters(props.formatters),
4119
+ labels: getLabels(props.labels, dateLib2.options),
4120
+ locale: locale2,
4121
+ classNames: { ...getDefaultClassNames(), ...props.classNames }
4122
+ };
4123
+ }, [
4124
+ props.locale,
4125
+ props.broadcastCalendar,
4126
+ props.weekStartsOn,
4127
+ props.firstWeekContainsDate,
4128
+ props.useAdditionalWeekYearTokens,
4129
+ props.useAdditionalDayOfYearTokens,
4130
+ props.timeZone,
4131
+ props.numerals,
4132
+ props.dateLib,
4133
+ props.noonSafe,
4134
+ props.components,
4135
+ props.formatters,
4136
+ props.labels,
4137
+ props.classNames
4138
+ ]);
4139
+ if (!props.today) {
4140
+ props = { ...props, today: dateLib.today() };
4141
+ }
4142
+ const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles } = props;
4143
+ const { formatCaption: formatCaption2, formatDay: formatDay2, formatMonthDropdown: formatMonthDropdown2, formatWeekNumber: formatWeekNumber2, formatWeekNumberHeader: formatWeekNumberHeader2, formatWeekdayName: formatWeekdayName2, formatYearDropdown: formatYearDropdown2 } = formatters2;
4144
+ const calendar = useCalendar(props, dateLib);
4145
+ const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth } = calendar;
4146
+ const getModifiers = createGetModifiers(days, props, navStart, navEnd, dateLib);
4147
+ const { isSelected, select, selected: selectedValue } = useSelection(props, dateLib) ?? {};
4148
+ const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
4149
+ const { labelDayButton: labelDayButton2, labelGridcell: labelGridcell2, labelGrid: labelGrid2, labelMonthDropdown: labelMonthDropdown2, labelNav: labelNav2, labelPrevious: labelPrevious2, labelNext: labelNext2, labelWeekday: labelWeekday2, labelWeekNumber: labelWeekNumber2, labelWeekNumberHeader: labelWeekNumberHeader2, labelYearDropdown: labelYearDropdown2 } = labels;
4150
+ const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
4151
+ const isInteractive = mode !== void 0 || onDayClick !== void 0;
4152
+ const handlePreviousClick = useCallback(() => {
4153
+ if (!previousMonth)
4154
+ return;
4155
+ goToMonth(previousMonth);
4156
+ onPrevClick?.(previousMonth);
4157
+ }, [previousMonth, goToMonth, onPrevClick]);
4158
+ const handleNextClick = useCallback(() => {
4159
+ if (!nextMonth)
4160
+ return;
4161
+ goToMonth(nextMonth);
4162
+ onNextClick?.(nextMonth);
4163
+ }, [goToMonth, nextMonth, onNextClick]);
4164
+ const handleDayClick = useCallback((day, m) => (e) => {
4165
+ e.preventDefault();
4166
+ e.stopPropagation();
4167
+ setFocused(day);
4168
+ if (m.disabled) {
4169
+ return;
4170
+ }
4171
+ select?.(day.date, m, e);
4172
+ onDayClick?.(day.date, m, e);
4173
+ }, [select, onDayClick, setFocused]);
4174
+ const handleDayFocus = useCallback((day, m) => (e) => {
4175
+ setFocused(day);
4176
+ onDayFocus?.(day.date, m, e);
4177
+ }, [onDayFocus, setFocused]);
4178
+ const handleDayBlur = useCallback((day, m) => (e) => {
4179
+ blur();
4180
+ onDayBlur?.(day.date, m, e);
4181
+ }, [blur, onDayBlur]);
4182
+ const handleDayKeyDown = useCallback((day, modifiers) => (e) => {
4183
+ const keyMap = {
4184
+ ArrowLeft: [
4185
+ e.shiftKey ? "month" : "day",
4186
+ props.dir === "rtl" ? "after" : "before"
4187
+ ],
4188
+ ArrowRight: [
4189
+ e.shiftKey ? "month" : "day",
4190
+ props.dir === "rtl" ? "before" : "after"
4191
+ ],
4192
+ ArrowDown: [e.shiftKey ? "year" : "week", "after"],
4193
+ ArrowUp: [e.shiftKey ? "year" : "week", "before"],
4194
+ PageUp: [e.shiftKey ? "year" : "month", "before"],
4195
+ PageDown: [e.shiftKey ? "year" : "month", "after"],
4196
+ Home: ["startOfWeek", "before"],
4197
+ End: ["endOfWeek", "after"]
4198
+ };
4199
+ if (keyMap[e.key]) {
4200
+ e.preventDefault();
4201
+ e.stopPropagation();
4202
+ const [moveBy, moveDir] = keyMap[e.key];
4203
+ moveFocus(moveBy, moveDir);
4204
+ }
4205
+ onDayKeyDown?.(day.date, modifiers, e);
4206
+ }, [moveFocus, onDayKeyDown, props.dir]);
4207
+ const handleDayMouseEnter = useCallback((day, modifiers) => (e) => {
4208
+ onDayMouseEnter?.(day.date, modifiers, e);
4209
+ }, [onDayMouseEnter]);
4210
+ const handleDayMouseLeave = useCallback((day, modifiers) => (e) => {
4211
+ onDayMouseLeave?.(day.date, modifiers, e);
4212
+ }, [onDayMouseLeave]);
4213
+ const handleMonthChange = useCallback((date, monthOffset) => (e) => {
4214
+ const selectedMonth = Number(e.target.value);
4215
+ const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
4216
+ goToMonth(dateLib.addMonths(month, -monthOffset));
4217
+ }, [dateLib, goToMonth]);
4218
+ const handleYearChange = useCallback((date, monthOffset) => (e) => {
4219
+ const selectedYear = Number(e.target.value);
4220
+ const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
4221
+ goToMonth(dateLib.addMonths(month, -monthOffset));
4222
+ }, [dateLib, goToMonth]);
4223
+ const { className, style } = useMemo(() => ({
4224
+ className: [classNames[UI.Root], props.className].filter(Boolean).join(" "),
4225
+ style: { ...styles?.[UI.Root], ...props.style }
4226
+ }), [classNames, props.className, props.style, styles]);
4227
+ const dataAttributes = getDataAttributes(props);
4228
+ const rootElRef = useRef(null);
4229
+ useAnimation(rootElRef, Boolean(props.animate), {
4230
+ classNames,
4231
+ months,
4232
+ focused,
4233
+ dateLib
4234
+ });
4235
+ const contextValue = {
4236
+ dayPickerProps: props,
4237
+ selected: selectedValue,
4238
+ select,
4239
+ isSelected,
4240
+ months,
4241
+ nextMonth,
4242
+ previousMonth,
4243
+ goToMonth,
4244
+ getModifiers,
4245
+ components,
4246
+ classNames,
4247
+ styles,
4248
+ labels,
4249
+ formatters: formatters2
4250
+ };
4251
+ return React26__default.createElement(
4252
+ dayPickerContext.Provider,
4253
+ { value: contextValue },
4254
+ React26__default.createElement(
4255
+ components.Root,
4256
+ { rootRef: props.animate ? rootElRef : void 0, className, style, dir: props.dir, id: props.id, lang: props.lang ?? locale.code, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
4257
+ React26__default.createElement(
4258
+ components.Months,
4259
+ { className: classNames[UI.Months], style: styles?.[UI.Months] },
4260
+ !props.hideNavigation && !navLayout && React26__default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
4261
+ months.map((calendarMonth, displayIndex) => {
4262
+ const monthOffset = props.reverseMonths ? months.length - 1 - displayIndex : displayIndex;
4263
+ return React26__default.createElement(
4264
+ components.Month,
4265
+ {
4266
+ "data-animated-month": props.animate ? "true" : void 0,
4267
+ className: classNames[UI.Month],
4268
+ style: styles?.[UI.Month],
4269
+ // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
4270
+ key: displayIndex,
4271
+ displayIndex,
4272
+ calendarMonth
4273
+ },
4274
+ navLayout === "around" && !props.hideNavigation && displayIndex === 0 && React26__default.createElement(
4275
+ components.PreviousMonthButton,
4276
+ { type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : void 0 },
4277
+ React26__default.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" })
4278
+ ),
4279
+ React26__default.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : void 0, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth, displayIndex }, captionLayout?.startsWith("dropdown") ? React26__default.createElement(
4280
+ components.DropdownNav,
4281
+ { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
4282
+ (() => {
4283
+ const monthControl = captionLayout === "dropdown" || captionLayout === "dropdown-months" ? React26__default.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown2(), disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date, monthOffset), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters2, dateLib), style: styles?.[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) }) : React26__default.createElement("span", { key: "month" }, formatMonthDropdown2(calendarMonth.date, dateLib));
4284
+ const yearControl = captionLayout === "dropdown" || captionLayout === "dropdown-years" ? React26__default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown2(dateLib.options), disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date, monthOffset), options: getYearOptions(navStart, navEnd, formatters2, dateLib, Boolean(props.reverseYears)), style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) }) : React26__default.createElement("span", { key: "year" }, formatYearDropdown2(calendarMonth.date, dateLib));
4285
+ const controls = dateLib.getMonthYearOrder() === "year-first" ? [yearControl, monthControl] : [monthControl, yearControl];
4286
+ return controls;
4287
+ })(),
4288
+ React26__default.createElement("span", { role: "status", "aria-live": "polite", style: {
4289
+ border: 0,
4290
+ clip: "rect(0 0 0 0)",
4291
+ height: "1px",
4292
+ margin: "-1px",
4293
+ overflow: "hidden",
4294
+ padding: 0,
4295
+ position: "absolute",
4296
+ width: "1px",
4297
+ whiteSpace: "nowrap",
4298
+ wordWrap: "normal"
4299
+ } }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
4300
+ ) : React26__default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))),
4301
+ navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 && React26__default.createElement(
4302
+ components.NextMonthButton,
4303
+ { type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : void 0 },
4304
+ React26__default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" })
4305
+ ),
4306
+ displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation && React26__default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
4307
+ React26__default.createElement(
4308
+ components.MonthGrid,
4309
+ { role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid2(calendarMonth.date, dateLib.options, dateLib) || void 0, className: classNames[UI.MonthGrid], style: styles?.[UI.MonthGrid] },
4310
+ !props.hideWeekdays && React26__default.createElement(
4311
+ components.Weekdays,
4312
+ { "data-animated-weekdays": props.animate ? "true" : void 0, className: classNames[UI.Weekdays], style: styles?.[UI.Weekdays] },
4313
+ showWeekNumber && React26__default.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader2(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles?.[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader2()),
4314
+ weekdays.map((weekday) => React26__default.createElement(components.Weekday, { "aria-label": labelWeekday2(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName2(weekday, dateLib.options, dateLib)))
4315
+ ),
4316
+ React26__default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : void 0, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
4317
+ return React26__default.createElement(
4318
+ components.Week,
4319
+ { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week },
4320
+ showWeekNumber && React26__default.createElement(components.WeekNumber, { week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
4321
+ locale
4322
+ }), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber2(week.weekNumber, dateLib)),
4323
+ week.days.map((day) => {
4324
+ const { date } = day;
4325
+ const modifiers = getModifiers(day);
4326
+ modifiers[DayFlag.focused] = !modifiers.hidden && Boolean(focused?.isEqualTo(day));
4327
+ modifiers[SelectionState.selected] = isSelected?.(date) || modifiers.selected;
4328
+ if (isDateRange(selectedValue)) {
4329
+ const { from, to } = selectedValue;
4330
+ modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));
4331
+ modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));
4332
+ modifiers[SelectionState.range_middle] = rangeIncludesDate(selectedValue, date, true, dateLib);
4333
+ }
4334
+ const style2 = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
4335
+ const className2 = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
4336
+ const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell2(date, modifiers, dateLib.options, dateLib) : void 0;
4337
+ return React26__default.createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day, modifiers, className: className2.join(" "), style: style2, role: "gridcell", "aria-selected": modifiers.selected || void 0, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : void 0, "data-selected": modifiers.selected || void 0, "data-disabled": modifiers.disabled || void 0, "data-hidden": modifiers.hidden || void 0, "data-outside": day.outside || void 0, "data-focused": modifiers.focused || void 0, "data-today": modifiers.today || void 0 }, !modifiers.hidden && isInteractive ? React26__default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day, modifiers, disabled: !modifiers.focused && modifiers.disabled || void 0, "aria-disabled": modifiers.focused && modifiers.disabled || void 0, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton2(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay2(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay2(day.date, dateLib.options, dateLib));
4338
+ })
4339
+ );
4340
+ }))
4341
+ )
4342
+ );
4343
+ })
4344
+ ),
4345
+ props.footer && React26__default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
4346
+ )
4347
+ );
4348
+ }
4349
+ function cn(...inputs) {
4350
+ return twMerge(clsx(inputs));
4351
+ }
4352
+ var sizeClass = {
4353
+ xs: "h-8 min-h-8 gap-2 px-4 text-sm has-[>svg]:px-3 [&_svg:not([class*='size-'])]:size-3",
4354
+ default: "h-10 min-h-10 gap-2 px-5 text-sm has-[>svg]:px-4 [&_svg:not([class*='size-'])]:size-4",
4355
+ lg: "h-11 min-h-11 gap-2 px-6 text-base has-[>svg]:px-5 [&_svg:not([class*='size-'])]:size-5"
4356
+ };
4357
+ var iconOnlySizeClass = {
4358
+ xs: "size-8 min-h-8 min-w-8 gap-0 p-0 [&_svg:not([class*='size-'])]:size-3",
4359
+ default: "size-10 min-h-10 min-w-10 gap-0 p-0 [&_svg:not([class*='size-'])]:size-4",
4360
+ lg: "size-11 min-h-11 min-w-11 gap-0 p-0 [&_svg:not([class*='size-'])]:size-5"
4361
+ };
4362
+ var roundedClass = {
4363
+ full: "rounded-full",
4364
+ lg: "rounded-lg",
4365
+ md: "rounded-md"
4366
+ };
4367
+ var variantClass = {
4368
+ primary: "bg-primary text-background border border-transparent hover:bg-primary/90 active:bg-primary/85",
4369
+ secondary: "bg-background text-primary border border-primary/10 hover:bg-primary/5",
4370
+ destructive: "bg-background text-red-500 border border-red-500/25 hover:bg-red-500/5",
4371
+ success: "bg-background text-green-500 border border-green-500/25 hover:bg-green-500/5"
4372
+ };
4373
+ var Button = React26.forwardRef(
4374
+ ({
4375
+ className,
4376
+ type = "button",
4377
+ variant = "secondary",
4378
+ rounded: roundedProp,
4379
+ size = "default",
4380
+ iconOnly = false,
4381
+ disabled,
4382
+ ...props
4383
+ }, ref) => {
4384
+ const rounded = roundedProp ?? (iconOnly ? "md" : "full");
4385
+ return /* @__PURE__ */ jsx(
4386
+ "button",
4387
+ {
4388
+ type,
4389
+ disabled,
4390
+ "data-slot": "button",
4391
+ "data-icon-only": iconOnly ? "" : void 0,
4392
+ className: cn(
4393
+ "inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap outline-none scale-100 transition-[color,background-color,box-shadow,transform] duration-150 ease-out active:scale-[0.98] active:duration-100 active:ease-linear [&_svg]:pointer-events-none [&_svg]:shrink-0",
4394
+ "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
4395
+ "focus-visible:border-ring font-medium lg:tracking-wide focus-visible:ring-ring/50 focus-visible:ring-[3px]",
4396
+ iconOnly ? iconOnlySizeClass[size] : sizeClass[size],
4397
+ roundedClass[rounded],
4398
+ variantClass[variant],
4399
+ className
4400
+ ),
4401
+ ref,
4402
+ ...props
4403
+ }
4404
+ );
4405
+ }
4406
+ );
4407
+ Button.displayName = "Button";
4408
+ function CalendarPickerRoot({
4409
+ className,
4410
+ rootRef,
4411
+ ...props
4412
+ }) {
4413
+ return /* @__PURE__ */ jsx(
4414
+ "div",
4415
+ {
4416
+ "data-slot": "calendar",
4417
+ ref: rootRef,
4418
+ className: cn(className),
4419
+ ...props
4420
+ }
4421
+ );
4422
+ }
4423
+ function CalendarPickerChevron({
4424
+ className,
4425
+ orientation,
4426
+ ...props
4427
+ }) {
4428
+ if (orientation === "left") {
4429
+ return /* @__PURE__ */ jsx(ChevronLeftIcon, { className: cn("size-5 mr-0.5", className), ...props });
4430
+ }
4431
+ if (orientation === "right") {
4432
+ return /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn("size-5 ml-0.5", className), ...props });
4433
+ }
4434
+ return /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-5", className), ...props });
4435
+ }
4436
+ function CalendarWeekNumberCell({
4437
+ children,
4438
+ ...props
4439
+ }) {
4440
+ return /* @__PURE__ */ jsx("td", { ...props, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
4441
+ }
4442
+ function CalendarNavMonthButton({
4443
+ className,
4444
+ ...props
4445
+ }) {
4446
+ return /* @__PURE__ */ jsx(
4447
+ Button,
4448
+ {
4449
+ iconOnly: true,
4450
+ rounded: "full",
4451
+ size: "lg",
4452
+ className: cn(
4453
+ "border-0 -mt-1 focus-visible:ring-0 focus-visible:border-transparent",
4454
+ className
4455
+ ),
4456
+ ...props
4457
+ }
4458
+ );
4459
+ }
4460
+ function mergeRefs(a, b) {
4461
+ return (node) => {
4462
+ a.current = node;
4463
+ if (typeof b === "function") {
4464
+ b(node);
4465
+ } else if (b && typeof b === "object" && "current" in b) {
4466
+ b.current = node;
4467
+ }
4468
+ };
4469
+ }
4470
+ var CalendarDayButton = React26.forwardRef(function CalendarDayButton2({ className, day, modifiers, ...props }, forwardedRef) {
4471
+ const defaultClassNames = getDefaultClassNames();
4472
+ const innerRef = React26.useRef(null);
4473
+ const ref = mergeRefs(innerRef, forwardedRef);
4474
+ React26.useEffect(() => {
4475
+ if (modifiers.focused) innerRef.current?.focus();
4476
+ }, [modifiers.focused]);
4477
+ const { months } = useDayPicker();
4478
+ const displayPaneIndex = months.findIndex(
4479
+ (m) => day.dateLib.isSameMonth(m.date, day.displayMonth)
4480
+ );
4481
+ const overlappingOutsideLaterPane = Boolean(
4482
+ modifiers.outside && displayPaneIndex > 0
4483
+ );
4484
+ const todayInRangeMiddle = Boolean(modifiers.today && modifiers.range_middle);
4485
+ const todayOnPrimaryLikeFill = Boolean(
4486
+ modifiers.today && (modifiers.range_start || modifiers.range_end || modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle)
4487
+ );
4488
+ return /* @__PURE__ */ jsx(
4489
+ Button,
4490
+ {
4491
+ ref,
4492
+ variant: "secondary",
4493
+ rounded: "full",
4494
+ className: cn(
4495
+ "box-border flex h-full w-full max-h-full max-w-full min-h-0 min-w-0 flex-1 flex-col justify-center border-0 p-3.5 text-base font-normal tracking-normal shadow-none",
4496
+ "gap-0 leading-none [&>span]:text-sm [&>span]:opacity-70",
4497
+ overlappingOutsideLaterPane && "text-primary/30 [&>span]:text-primary/30 [&>span]:opacity-100",
4498
+ "focus-visible:ring-0 focus-visible:border-transparent",
4499
+ "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-background",
4500
+ "data-[range-middle=true]:bg-transparent data-[range-middle=true]:text-accent-foreground data-[range-middle=true]:hover:bg-accent/40",
4501
+ todayInRangeMiddle && "bg-accent! text-accent-foreground! hover:bg-accent/90! data-[range-middle=true]:hover:bg-accent/90!",
4502
+ "data-[range-start=true]:bg-primary data-[range-start=true]:text-background",
4503
+ "data-[range-end=true]:bg-primary data-[range-end=true]:text-background",
4504
+ defaultClassNames.day,
4505
+ className,
4506
+ modifiers.today && cn(
4507
+ "z-1 border border-primary/20",
4508
+ todayOnPrimaryLikeFill && "border-primary/20"
4509
+ )
4510
+ ),
4511
+ "data-day": day.date.toLocaleDateString(),
4512
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
4513
+ "data-range-start": modifiers.range_start,
4514
+ "data-range-end": modifiers.range_end,
4515
+ "data-range-middle": modifiers.range_middle,
4516
+ ...props
4517
+ }
4518
+ );
4519
+ });
4520
+ CalendarDayButton.displayName = "CalendarDayButton";
4521
+ function Calendar({
4522
+ className,
4523
+ classNames,
4524
+ showOutsideDays = false,
4525
+ captionLayout = "label",
4526
+ formatters: formatters2,
4527
+ components,
4528
+ ...props
4529
+ }) {
4530
+ const defaultClassNames = React26.useMemo(() => getDefaultClassNames(), []);
4531
+ return /* @__PURE__ */ jsx(
4532
+ DayPicker,
4533
+ {
4534
+ showOutsideDays,
4535
+ className: cn(
4536
+ "group/calendar p-3 pt-5 [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
4537
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
4538
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
4539
+ className
4540
+ ),
4541
+ captionLayout,
4542
+ formatters: {
4543
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
4544
+ /** Default `cccccc` is two letters (e.g. Mo); use three-letter abbreviations. */
4545
+ formatWeekdayName: (weekday) => weekday.toLocaleDateString(void 0, { weekday: "long" }).slice(0, 3),
4546
+ ...formatters2
4547
+ },
4548
+ classNames: {
4549
+ root: cn("w-fit", defaultClassNames.root),
4550
+ months: cn(
4551
+ "relative flex flex-col gap-4 md:flex-row",
4552
+ defaultClassNames.months
4553
+ ),
4554
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
4555
+ nav: cn(
4556
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
4557
+ defaultClassNames.nav
4558
+ ),
4559
+ button_previous: cn(defaultClassNames.button_previous),
4560
+ button_next: cn(defaultClassNames.button_next),
4561
+ month_caption: cn(
4562
+ "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
4563
+ defaultClassNames.month_caption
4564
+ ),
4565
+ dropdowns: cn(
4566
+ "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-base font-semibold",
4567
+ defaultClassNames.dropdowns
4568
+ ),
4569
+ dropdown_root: cn(
4570
+ "border-input relative rounded-full border shadow-xs has-focus:border-transparent has-focus:ring-0",
4571
+ defaultClassNames.dropdown_root
4572
+ ),
4573
+ dropdown: cn("absolute inset-0 opacity-0", defaultClassNames.dropdown),
4574
+ caption_label: cn(
4575
+ "font-semibold select-none",
4576
+ captionLayout === "label" ? "text-base" : "flex h-8 items-center gap-1 rounded-full pr-1 pl-2 text-base [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
4577
+ defaultClassNames.caption_label
4578
+ ),
4579
+ month_grid: cn(
4580
+ "w-full border-collapse",
4581
+ defaultClassNames.month_grid
4582
+ ),
4583
+ weekdays: cn("flex gap-0 pb-4", defaultClassNames.weekdays),
4584
+ weekday: cn(
4585
+ "text-muted-foreground flex-1 rounded-full text-sm font-normal select-none",
4586
+ defaultClassNames.weekday
4587
+ ),
4588
+ week: cn("mt-1 flex w-full gap-0 first:mt-0", defaultClassNames.week),
4589
+ week_number_header: cn(
4590
+ "w-(--cell-size) select-none",
4591
+ defaultClassNames.week_number_header
4592
+ ),
4593
+ week_number: cn(
4594
+ "text-muted-foreground text-sm select-none",
4595
+ defaultClassNames.week_number
4596
+ ),
4597
+ day: cn(
4598
+ "group/day relative flex aspect-square h-full w-full items-center justify-center overflow-hidden p-0 text-center align-middle leading-none select-none",
4599
+ defaultClassNames.day
4600
+ ),
4601
+ range_start: cn(
4602
+ "rounded-l-full bg-accent",
4603
+ defaultClassNames.range_start
4604
+ ),
4605
+ range_middle: cn(
4606
+ "rounded-none bg-accent",
4607
+ defaultClassNames.range_middle
4608
+ ),
4609
+ range_end: cn("rounded-r-full bg-accent", defaultClassNames.range_end),
4610
+ /** Today outline is drawn on `CalendarDayButton` (border, all modes). */
4611
+ today: cn(defaultClassNames.today, "text-inherit shadow-none"),
4612
+ outside: cn(
4613
+ "text-muted-foreground aria-selected:text-muted-foreground",
4614
+ defaultClassNames.outside
4615
+ ),
4616
+ disabled: cn(
4617
+ "text-muted-foreground opacity-50",
4618
+ defaultClassNames.disabled
4619
+ ),
4620
+ hidden: cn("invisible", defaultClassNames.hidden),
4621
+ ...classNames
4622
+ },
4623
+ components: {
4624
+ Root: CalendarPickerRoot,
4625
+ Chevron: CalendarPickerChevron,
4626
+ PreviousMonthButton: CalendarNavMonthButton,
4627
+ NextMonthButton: CalendarNavMonthButton,
4628
+ DayButton: (dayButtonProps) => /* @__PURE__ */ jsx(CalendarDayButton, { ...dayButtonProps }),
4629
+ WeekNumber: CalendarWeekNumberCell,
4630
+ ...components
4631
+ },
4632
+ ...props
4633
+ }
4634
+ );
4635
+ }
4636
+
4637
+ export { Calendar, CalendarDayButton };
4638
+ //# sourceMappingURL=calendar.js.map
4639
+ //# sourceMappingURL=calendar.js.map