@stenajs-webui/calendar 20.11.6 → 20.13.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 (34) hide show
  1. package/dist/components/calendar-types/travel-date-calendar/TravelDateCalendar.d.ts +15 -0
  2. package/dist/components/calendar-types/travel-date-range-calendar/TravelDateRangeCalendar.d.ts +17 -0
  3. package/dist/components/input-types/travel-date-input/TravelDateInput.d.ts +23 -0
  4. package/dist/components/input-types/travel-date-range-input/TravelDateRangeInput.d.ts +25 -0
  5. package/dist/features/localize-date-format/InputMaskProvider.d.ts +4 -0
  6. package/dist/features/localize-date-format/LocaleMapper.d.ts +1 -0
  7. package/dist/features/localize-date-format/LocalizedDateParser.d.ts +1 -1
  8. package/dist/features/localize-date-format/LocalizedDateReformatter.d.ts +1 -0
  9. package/dist/features/month-picker/MonthPicker.d.ts +2 -7
  10. package/dist/features/month-picker/MonthPickerCell.d.ts +7 -3
  11. package/dist/features/month-picker/MonthPickerDataFactory.d.ts +21 -0
  12. package/dist/features/month-picker/MonthPickerKeyboardNavigation.d.ts +4 -0
  13. package/dist/features/month-picker/Position.d.ts +8 -0
  14. package/dist/features/travel-calendar/components/MonthHeader.d.ts +15 -0
  15. package/dist/features/travel-calendar/components/TravelCalendar.d.ts +19 -0
  16. package/dist/features/travel-calendar/components/TravelDateCell.d.ts +19 -0
  17. package/dist/features/travel-calendar/components/TravelDateSingleTextInputField.d.ts +9 -0
  18. package/dist/features/travel-calendar/components/TravelDateTextInput.d.ts +12 -0
  19. package/dist/features/travel-calendar/components/TravelDateTextInputFields.d.ts +11 -0
  20. package/dist/features/travel-calendar/hooks/UseTravelDateInput.d.ts +21 -0
  21. package/dist/features/travel-calendar/hooks/UseTravelDateRangeInput.d.ts +23 -0
  22. package/dist/features/travel-calendar/types.d.ts +5 -0
  23. package/dist/features/travel-calendar/util/CellBgColors.d.ts +4 -0
  24. package/dist/features/travel-calendar/util/DayIdGenerator.d.ts +1 -0
  25. package/dist/features/travel-calendar/util/KeyboardNavigation.d.ts +1 -0
  26. package/dist/features/travel-calendar/util/UseToday.d.ts +1 -0
  27. package/dist/index.d.ts +6 -0
  28. package/dist/index.es.js +2479 -1412
  29. package/dist/index.es.js.map +1 -1
  30. package/dist/index.js +2 -2
  31. package/dist/index.js.map +1 -1
  32. package/dist/types/CalendarTypes.d.ts +2 -3
  33. package/dist/util/calendar/CalendarDataFactory.d.ts +1 -0
  34. package/package.json +8 -7
package/dist/index.es.js CHANGED
@@ -1,18 +1,19 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._calendar_1b766_1{--swui-calendar-day-width: 48px;--swui-calendar-day-height: 48px;--swui-calendar-day-border-radius: var(--swui-max-border-radius);--swui-calendar-week-number-bg-color: transparent;--swui-calendar-week-number-text-color: var(--lhds-color-ui-500);--swui-calendar-week-number-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-wrapper-selected-border: var(--modern-red);--swui-calendar-wrapper-selected-background: var(--modern-red);--swui-calendar-wrapper-range-border: var(--lhds-color-red-100);--swui-calendar-wrapper-range-background: var(--lhds-color-red-100);--swui-calendar-wrapper-today-border: var(--lhds-color-ui-200);--swui-calendar-wrapper-today-background: var(--lhds-color-ui-50);--swui-calendar-text-selected-color: #fff;--swui-calendar-text-disabled-color: var(--swui-text-disabled-color);--swui-calendar-text-in-other-month-color: var(--swui-text-disabled-color)}._calendar_1b766_1 table{border-spacing:0 4px}._calendar_1b766_1 tr td:last-child{border-top-right-radius:var(--swui-calendar-day-border-radius);border-bottom-right-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_1._weekNumberVisible_1b766_41 tr td:nth-child(2),._calendar_1b766_1:not(._weekNumberVisible_1b766_41) tr td:first-child{border-top-left-radius:var(--swui-calendar-day-border-radius);border-bottom-left-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_1 td{padding:0;width:var(--swui-calendar-day-width);height:var(--swui-calendar-day-height)}._timePicker_1w05d_1{overflow:hidden;width:180px}._timePickerColumn_1w05d_6{overflow-y:hidden;flex:1}._timePickerColumn_1w05d_6:hover{overflow-y:scroll}")),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { jsx as c, jsxs as T, Fragment as ht } from "react/jsx-runtime";
3
- import { Box as x, Text as yt, Clickable as Qt, Row as R, Spacing as be, Column as $, Heading as ke, Space as ct, Indent as Dt, SeparatorLine as Se, parseIntElseUndefined as jt, useBoolean as Ht, useDelayedFalse as Pt } from "@stenajs-webui/core";
4
- import { FlatButton as W, stenaAngleDown as Xt, PrimaryButton as ot, stenaAngleLeft as Me, stenaAngleRight as Te, SecondaryButton as it, stenaAngleLeftDouble as Ee, stenaArrowLeft as Wt, stenaArrowRight as xt, stenaAngleRightDouble as Re, TextInputButton as Ae, stenaCalendar as gt, Icon as Zt, stenaArrowWideRight as xe, stenaClock as vt } from "@stenajs-webui/elements";
5
- import { isAfter as v, eachDayOfInterval as Vt, isSameDay as K, endOfMonth as te, startOfMonth as ee, min as Ce, addDays as _, max as Ne, subDays as ft, format as Y, getISOWeek as Ot, getDate as Ct, startOfWeek as re, addWeeks as Ie, getMonth as Z, getWeek as ne, getYear as mt, getISODay as Le, addHours as Ye, isBefore as He, parse as V, addMonths as Pe, addYears as Ue, subMonths as $e, subYears as We, setWeek as Oe, isValid as Be } from "date-fns";
6
- import { enGB as Nt, enUS as ze, deAT as je, de as _t, fr as _e, es as Je, sv as Ke, pl as Ge, da as Fe, nl as qe, nb as Qe } from "date-fns/locale";
7
- import { last as Xe, startCase as se, chunk as ie, debounce as Ze, padStart as ve, range as Bt } from "lodash-es";
8
- import * as Ve from "react";
9
- import { useMemo as A, useState as S, useCallback as g, useRef as B, useEffect as J } from "react";
10
- import tr from "classnames";
11
- import Lt from "@emotion/styled";
12
- import { TextInput as tt, TextInputBox as er } from "@stenajs-webui/forms";
13
- import { useTippyInstance as rr, Popover as pt } from "@stenajs-webui/tooltip";
14
- import { cssColor as ce } from "@stenajs-webui/theme";
15
- const q = {
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._calendar_1b766_1{--swui-calendar-day-width: 48px;--swui-calendar-day-height: 48px;--swui-calendar-day-border-radius: var(--swui-max-border-radius);--swui-calendar-week-number-bg-color: transparent;--swui-calendar-week-number-text-color: var(--lhds-color-ui-500);--swui-calendar-week-number-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-wrapper-selected-border: var(--modern-red);--swui-calendar-wrapper-selected-background: var(--modern-red);--swui-calendar-wrapper-range-border: var(--lhds-color-red-100);--swui-calendar-wrapper-range-background: var(--lhds-color-red-100);--swui-calendar-wrapper-today-border: var(--lhds-color-ui-200);--swui-calendar-wrapper-today-background: var(--lhds-color-ui-50);--swui-calendar-text-selected-color: #fff;--swui-calendar-text-disabled-color: var(--swui-text-disabled-color);--swui-calendar-text-in-other-month-color: var(--swui-text-disabled-color)}._calendar_1b766_1 table{border-spacing:0 4px}._calendar_1b766_1 tr td:last-child{border-top-right-radius:var(--swui-calendar-day-border-radius);border-bottom-right-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_1._weekNumberVisible_1b766_41 tr td:nth-child(2),._calendar_1b766_1:not(._weekNumberVisible_1b766_41) tr td:first-child{border-top-left-radius:var(--swui-calendar-day-border-radius);border-bottom-left-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_1 td{padding:0;width:var(--swui-calendar-day-width);height:var(--swui-calendar-day-height)}._timePicker_1w05d_1{overflow:hidden;width:180px}._timePickerColumn_1w05d_6{overflow-y:hidden;flex:1}._timePickerColumn_1w05d_6:hover{overflow-y:scroll}._travelDateCell_1g60o_1{position:relative;width:48px;height:48px;border-radius:var(--swui-max-border-radius)}._travelDateCell_1g60o_1:focus{outline:none}._travelDateCell_1g60o_1:focus-visible ._outline_1g60o_13{outline:var(--swui-focus-outline);outline-width:var(--swui-focus-outline-width);background:transparent;position:absolute;border-radius:var(--swui-max-border-radius);top:0;bottom:0;left:0;right:0;z-index:10}._travelDateCell_1g60o_1:focus-visible ._contentWrapper_1g60o_26._contentWrapper_1g60o_26._contentWrapper_1g60o_26{border-color:transparent}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26{cursor:pointer;border-radius:var(--swui-max-border-radius);border-width:2px;border-style:solid;border-color:transparent;background:transparent;position:absolute;display:flex;align-items:center;justify-content:center;left:0;right:0;top:0;bottom:0}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._disabled_1g60o_47{cursor:not-allowed}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._isToday_1g60o_50{border-color:var(--lhds-color-ui-400)}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._isSelectionStart_1g60o_54,._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._isSelectionEnd_1g60o_55{border-color:var(--modern-red)}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._isSelectionStart_1g60o_54{background:var(--modern-red)}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._isSelectionStart_1g60o_54 span{color:#fff}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._isSelectionEnd_1g60o_55:not(._isSelectionStart_1g60o_54){background:#fff}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._hover_1g60o_70{border-color:var(--modern-red)}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._hover_1g60o_70._startSelected_1g60o_73:not(._endSelected_1g60o_73):not(._isSelectionStart_1g60o_54){background:#fff}._travelDateCell_1g60o_1 ._contentWrapper_1g60o_26._hover_1g60o_70._startSelected_1g60o_73:not(._endSelected_1g60o_73):not(._isSelectionStart_1g60o_54) span{color:var(--swui-text-primary-color)}._travelCalendar_18pjj_1{border-spacing:0 4px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._travelCalendar_18pjj_1 td{padding:0}._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2{transition:opacity var(--swui-animation-time-fast) ease-in-out;opacity:1}._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2:not(._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2._calendarVisible_1j7rp_6){opacity:0}._travelDateInput_hmfbf_1 ._overlay_hmfbf_2{transition:opacity var(--swui-animation-time-fast) ease-in-out;opacity:1}._travelDateInput_hmfbf_1 ._overlay_hmfbf_2:not(._travelDateInput_hmfbf_1 ._overlay_hmfbf_2._calendarVisible_hmfbf_6){opacity:0}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ import { jsx as o, jsxs as x, Fragment as Ht } from "react/jsx-runtime";
3
+ import { Box as L, Text as pt, Clickable as ke, Row as B, Spacing as Xe, Column as C, Heading as Rt, Space as Dt, Indent as Mt, SeparatorLine as Ze, parseIntElseUndefined as ge, useBoolean as ne, useDelayedFalse as re, useOnClickOutside as Se } from "@stenajs-webui/core";
4
+ import { FlatButton as q, stenaAngleDown as ae, PrimaryButton as bt, stenaAngleLeft as Ve, stenaAngleRight as tn, SecondaryButton as ct, stenaAngleLeftDouble as en, stenaArrowLeft as vt, stenaArrowRight as Et, stenaAngleRightDouble as nn, TextInputButton as rn, stenaCalendar as kt, Icon as Te, stenaArrowWideRight as sn, stenaClock as Ie, stenaAngleUp as on, CardBody as Re } from "@stenajs-webui/elements";
5
+ import { isAfter as G, eachDayOfInterval as Ee, isSameDay as P, endOfMonth as xe, startOfMonth as Ae, min as cn, addDays as J, max as an, subDays as lt, format as W, getISOWeek as le, getDate as zt, startOfWeek as $t, addWeeks as ln, getMonth as dt, getWeek as Ne, getYear as St, getISODay as dn, addHours as Le, isBefore as nt, parse as ft, addMonths as xt, isSameMonth as rt, addYears as un, subMonths as de, subYears as fn, setWeek as hn, isValid as pn } from "date-fns";
6
+ import { enGB as Ft, enUS as mn, deAT as gn, de as De, fr as Dn, es as bn, sv as wn, pl as yn, da as Mn, nl as kn, nb as Sn } from "date-fns/locale";
7
+ import { last as Tn, startCase as Tt, chunk as _e, debounce as In, padStart as Rn, range as ue } from "lodash-es";
8
+ import * as fe from "react";
9
+ import { useMemo as R, useRef as $, useEffect as X, useCallback as D, useId as he, useState as T, useLayoutEffect as Pe } from "react";
10
+ import jt from "classnames";
11
+ import Xt from "@emotion/styled";
12
+ import { TextInput as ht, TextInputBox as En, LabelledTextInput as xn } from "@stenajs-webui/forms";
13
+ import { useTippyInstance as An, Popover as At } from "@stenajs-webui/tooltip";
14
+ import { cssColor as Ct } from "@stenajs-webui/theme";
15
+ import { useMaskedInput as Nn } from "@stenajs-webui/input-mask";
16
+ const st = {
16
17
  yearAndMonth: "yyyy-MM",
17
18
  fullDate: "yyyy-MM-dd",
18
19
  fullMonthName: "LLLL",
@@ -26,190 +27,193 @@ const q = {
26
27
  // 2 Jan
27
28
  monthAndDate: "MMM do"
28
29
  // Jan 2nd
29
- }, wt = (t = {}, e, r) => {
30
- if (e && r && v(r, e))
31
- return Vt({ start: e, end: r }).reduce(
30
+ }, It = (t = {}, e, n) => {
31
+ if (e && n && G(n, e))
32
+ return Ee({ start: e, end: n }).reduce(
32
33
  (s, i) => {
33
- const a = K(i, e), o = K(i, r);
34
- return F(s, i, a ? ["selected", "selectedStart", "range"] : o ? ["selected", "selectedEnd", "range"] : ["range"]);
34
+ const c = P(i, e), a = P(i, n);
35
+ return at(s, i, c ? ["selected", "selectedStart", "range"] : a ? ["selected", "selectedEnd", "range"] : ["range"]);
35
36
  },
36
37
  t
37
38
  );
38
- let n = t;
39
- return e && (n = F(n, e, ["selected", "singleSelected"])), r && (n = F(n, r, ["selected", "singleSelected"])), n;
40
- }, nr = (t = {}, e, r, n) => sr(
39
+ let r = t;
40
+ return e && (r = at(r, e, ["selected", "singleSelected"])), n && (r = at(r, n, ["selected", "singleSelected"])), r;
41
+ }, Ln = (t = {}, e, n, r) => _n(
41
42
  t,
42
43
  e,
43
- r,
44
- ee(n),
45
- te(n)
46
- ), sr = (t = {}, e, r, n, s) => e && r ? wt(
44
+ n,
45
+ Ae(r),
46
+ xe(r)
47
+ ), _n = (t = {}, e, n, r, s) => e && n ? It(
47
48
  t,
48
- Ne([e, ft(n, 1)]),
49
- Ce([r, _(s, 1)])
50
- ) : wt(t, e, r), En = (t, e, r) => {
51
- const n = Y(e, q.yearAndMonth), s = Ot(e), i = Ct(e);
49
+ an([e, lt(r, 1)]),
50
+ cn([n, J(s, 1)])
51
+ ) : It(t, e, n), Es = (t, e, n) => {
52
+ const r = W(e, st.yearAndMonth), s = le(e), i = zt(e);
52
53
  return {
53
54
  ...t,
54
- [n]: {
55
- ...t && t[n],
55
+ [r]: {
56
+ ...t && t[r],
56
57
  [s]: {
57
- ...t && t[n] && t[n][s],
58
+ ...t && t[r] && t[r][s],
58
59
  [i]: {
59
- ...t && t[n] && t[n][s] && t[n][s][i],
60
- ...r
60
+ ...t && t[r] && t[r][s] && t[r][s][i],
61
+ ...n
61
62
  }
62
63
  }
63
64
  }
64
65
  };
65
- }, Rn = (t, e, r) => {
66
- const n = Y(e, q.yearAndMonth), s = Ot(e), i = Ct(e);
66
+ }, xs = (t, e, n) => {
67
+ const r = W(e, st.yearAndMonth), s = le(e), i = zt(e);
67
68
  return {
68
69
  ...t,
69
- [n]: {
70
- ...t && t[n],
70
+ [r]: {
71
+ ...t && t[r],
71
72
  [s]: {
72
- ...t && t[n] && t[n][s],
73
+ ...t && t[r] && t[r][s],
73
74
  [i]: {
74
- ...t && t[n] && t[n][s] && t[n][s][i],
75
- ...r(
76
- t && t[n] && t[n][s] && t[n][s][i]
75
+ ...t && t[r] && t[r][s] && t[r][s][i],
76
+ ...n(
77
+ t && t[r] && t[r][s] && t[r][s][i]
77
78
  )
78
79
  }
79
80
  }
80
81
  }
81
82
  };
82
- }, F = (t, e, r) => {
83
- const n = e.getMonth() + 1, s = `${e.getFullYear()}-${n < 10 ? "0" : ""}${n}`, i = Ot(e), a = Ct(e), o = t && t[s] && t[s][i] && t[s][i][a];
83
+ }, at = (t, e, n) => {
84
+ const r = e.getMonth() + 1, s = `${e.getFullYear()}-${r < 10 ? "0" : ""}${r}`, i = le(e), c = zt(e), a = t && t[s] && t[s][i] && t[s][i][c];
84
85
  return {
85
86
  ...t,
86
87
  [s]: {
87
88
  ...t && t[s],
88
89
  [i]: {
89
90
  ...t && t[s] && t[s][i],
90
- [a]: oe(o, r)
91
+ [c]: Ye(a, n)
91
92
  }
92
93
  }
93
94
  };
94
- }, oe = (t, e) => ({
95
+ }, Ye = (t, e) => ({
95
96
  ...t,
96
97
  highlights: [...(t == null ? void 0 : t.highlights) ?? [], ...e]
97
- }), An = (t, e, r) => {
98
- const n = e.days[0].date, s = n.getMonth() + 1, i = `${n.getFullYear()}-${s < 10 ? "0" : ""}${s}`, a = e.weekNumber;
99
- let o = t;
100
- e.days.forEach((D) => {
101
- o = F(o, D.date, r);
98
+ }), As = (t, e, n) => {
99
+ const r = e.days[0].date, s = r.getMonth() + 1, i = `${r.getFullYear()}-${s < 10 ? "0" : ""}${s}`, c = e.weekNumber;
100
+ let a = t;
101
+ e.days.forEach((p) => {
102
+ a = at(a, p.date, n);
102
103
  });
103
- const d = o && o[i] ? o[i][a] : void 0, l = d && d.highlights ? [...d.highlights, ...r] : r, u = {
104
- ...d,
105
- highlights: l
104
+ const l = a && a[i] ? a[i][c] : void 0, d = l && l.highlights ? [...l.highlights, ...n] : n, u = {
105
+ ...l,
106
+ highlights: d
106
107
  };
107
108
  return {
108
- ...o,
109
+ ...a,
109
110
  [i]: {
110
111
  ...t && t[i],
111
- [a]: u
112
+ [c]: u
112
113
  }
113
114
  };
114
- }, ir = (t, e) => {
115
+ }, Pn = (t, e) => {
115
116
  var s;
116
117
  if (!e.days.length)
117
118
  return { ...t };
118
- const r = e.days[0].date, n = (s = Xe(e.days)) == null ? void 0 : s.date;
119
+ const n = e.days[0].date, r = (s = Tn(e.days)) == null ? void 0 : s.date;
119
120
  return {
120
- ...wt(t, r, n)
121
+ ...It(t, n, r)
121
122
  };
122
- }, cr = (t, e) => A(() => t ? F(e, /* @__PURE__ */ new Date(), ["today"]) : e, [t, e]);
123
- var ae = /* @__PURE__ */ ((t) => (t[t.JANUARY = 0] = "JANUARY", t[t.FEBRUARY = 1] = "FEBRUARY", t[t.MARCH = 2] = "MARCH", t[t.APRIL = 3] = "APRIL", t[t.MAY = 4] = "MAY", t[t.JUNE = 5] = "JUNE", t[t.JULY = 6] = "JULY", t[t.AUGUST = 7] = "AUGUST", t[t.SEPTEMBER = 8] = "SEPTEMBER", t[t.OCTOBER = 9] = "OCTOBER", t[t.NOVEMBER = 10] = "NOVEMBER", t[t.DECEMBER = 11] = "DECEMBER", t))(ae || {}), or = /* @__PURE__ */ ((t) => (t[t.SUNDAY = 0] = "SUNDAY", t[t.MONDAY = 1] = "MONDAY", t[t.TUESDAY = 2] = "TUESDAY", t[t.WEDNESDAY = 3] = "WEDNESDAY", t[t.THURSDAY = 4] = "THURSDAY", t[t.FRIDAY = 5] = "FRIDAY", t[t.SATURDAY = 6] = "SATURDAY", t))(or || {});
124
- const Jt = (t, e, r, n) => {
123
+ }, Yn = (t, e) => R(() => t ? at(e, /* @__PURE__ */ new Date(), ["today"]) : e, [t, e]);
124
+ var Bn = /* @__PURE__ */ ((t) => (t[t.JANUARY = 0] = "JANUARY", t[t.FEBRUARY = 1] = "FEBRUARY", t[t.MARCH = 2] = "MARCH", t[t.APRIL = 3] = "APRIL", t[t.MAY = 4] = "MAY", t[t.JUNE = 5] = "JUNE", t[t.JULY = 6] = "JULY", t[t.AUGUST = 7] = "AUGUST", t[t.SEPTEMBER = 8] = "SEPTEMBER", t[t.OCTOBER = 9] = "OCTOBER", t[t.NOVEMBER = 10] = "NOVEMBER", t[t.DECEMBER = 11] = "DECEMBER", t))(Bn || {}), On = /* @__PURE__ */ ((t) => (t[t.SUNDAY = 0] = "SUNDAY", t[t.MONDAY = 1] = "MONDAY", t[t.TUESDAY = 2] = "TUESDAY", t[t.WEDNESDAY = 3] = "WEDNESDAY", t[t.THURSDAY = 4] = "THURSDAY", t[t.FRIDAY = 5] = "FRIDAY", t[t.SATURDAY = 6] = "SATURDAY", t))(On || {});
125
+ const be = (t, e, n, r) => {
125
126
  const s = [];
126
- for (let i = 0; i < r; i++)
127
- s.push(de(t, e + i, n));
127
+ for (let i = 0; i < n; i++)
128
+ s.push(Kt(t, e + i, r));
128
129
  return s;
129
- }, de = (t, e, r) => {
130
- const n = t + Math.floor(e / 12), s = e % 12, i = new Date(n, s, 1);
130
+ }, Kt = (t, e, n) => {
131
+ if (isNaN(t) || isNaN(e))
132
+ throw new Error("getMonthInYear() received NaN.");
133
+ const r = t + Math.floor(e / 12), s = e % 12, i = new Date(r, s, 1);
131
134
  return {
132
- monthString: Y(i, q.yearAndMonth),
133
- name: se(
134
- Y(i, q.fullMonthName, { locale: r })
135
+ monthString: W(i, st.yearAndMonth),
136
+ name: Tt(
137
+ W(i, st.fullMonthName, { locale: n })
135
138
  ),
136
- year: n,
139
+ year: r,
137
140
  monthInYear: s,
138
- weeks: ar(n, s, r)
141
+ weeks: Hn(r, s, n)
139
142
  };
140
- }, ar = (t, e, r, n = !0) => {
141
- const s = new Date(t, e, 1), i = re(s, { locale: r }), a = [];
142
- for (let o = 0; o < 6; o++) {
143
- const d = zt(Ie(i, o), r);
144
- if (o > 0 && d.startMonth !== e && !n)
145
- return a;
146
- a.push(d);
143
+ }, Hn = (t, e, n, r = !0) => {
144
+ const s = new Date(t, e, 1), i = $t(s, { locale: n }), c = [];
145
+ for (let a = 0; a < 6; a++) {
146
+ const l = pe(ln(i, a), n);
147
+ if (a > 0 && l.startMonth !== e && !r)
148
+ return c;
149
+ c.push(l);
147
150
  }
148
- return a;
149
- }, zt = (t, e) => {
150
- const r = Z(_(t, 7)) !== Z(t);
151
+ return c;
152
+ }, pe = (t, e) => {
153
+ const n = dt(J(t, 7)) !== dt(t);
151
154
  return {
152
- weekNumber: ne(t, { locale: e }),
153
- startMonth: Z(t),
154
- startYear: mt(t),
155
- endMonth: Z(_(t, 6)),
156
- endYear: mt(_(t, 6)),
157
- days: lr(t, e),
158
- isLastWeekOfMonth: r
155
+ weekNumber: Ne(t, { locale: e }),
156
+ startMonth: dt(t),
157
+ startYear: St(t),
158
+ endMonth: dt(J(t, 6)),
159
+ endYear: St(J(t, 6)),
160
+ days: Un(t, e),
161
+ isLastWeekOfMonth: n
159
162
  };
160
- }, dr = (t, e) => {
161
- const r = Le(t);
163
+ }, $n = (t, e) => {
164
+ const n = dn(t);
162
165
  return {
163
166
  date: t,
164
- name: Y(t, "EEE", e ? { locale: e } : void 0),
165
- dateString: Y(Ye(t, 12), q.fullDate),
166
- weekNumber: ne(t, { locale: e }),
167
- year: mt(t),
168
- month: Z(t),
169
- dayOfMonth: Ct(t),
170
- dayOfWeek: r,
171
- isFirstDayOfWeek: r === 1,
172
- isLastDayOfWeek: r === 7,
173
- isFirstDayOfMonth: K(ee(t), t),
174
- isLastDayOfMonth: K(te(t), t)
167
+ name: W(t, "EEE", e ? { locale: e } : void 0),
168
+ fullName: W(t, "EEEE", e ? { locale: e } : void 0),
169
+ dateString: W(Le(t, 12), st.fullDate),
170
+ weekNumber: Ne(t, { locale: e }),
171
+ year: St(t),
172
+ month: dt(t),
173
+ dayOfMonth: zt(t),
174
+ dayOfWeek: n,
175
+ isFirstDayOfWeek: n === 1,
176
+ isLastDayOfWeek: n === 7,
177
+ isFirstDayOfMonth: P(Ae(t), t),
178
+ isLastDayOfMonth: P(xe(t), t)
175
179
  };
176
- }, lr = (t, e) => Vt({
180
+ }, Un = (t, e) => Ee({
177
181
  start: t,
178
- end: _(t, 6)
179
- }).map((r) => dr(r, e)), ur = (t, e) => e > 11 ? { year: t + Math.floor(e / 12), month: e % 12 } : e < 0 ? { year: t + Math.floor(e / 12), month: 12 + e % 12 } : { year: t, month: e }, fr = "_calendar_1b766_1", hr = "_weekNumberVisible_1b766_41", Kt = {
180
- calendar: fr,
181
- weekNumberVisible: hr
182
- }, Dr = (t, e, r) => !!(e && e.indexOf(r) >= 0 || t && t.highlights && t.highlights.indexOf(r) >= 0), G = (t, e, r, n, s) => {
183
- if (r.length !== n.length)
182
+ end: J(t, 6)
183
+ }).map((n) => $n(n, e)), Wn = (t, e) => e > 11 ? { year: t + Math.floor(e / 12), month: e % 12 } : e < 0 ? { year: t + Math.floor(e / 12), month: 12 + e % 12 } : { year: t, month: e }, vn = "_calendar_1b766_1", zn = "_weekNumberVisible_1b766_41", we = {
184
+ calendar: vn,
185
+ weekNumberVisible: zn
186
+ }, Fn = (t, e, n) => !!(e && e.indexOf(n) >= 0 || t && t.highlights && t.highlights.indexOf(n) >= 0), ot = (t, e, n, r, s) => {
187
+ if (n.length !== r.length)
184
188
  throw new Error(
185
189
  "Select highlight failed, number of values do not equal number of highlights."
186
190
  );
187
- if (r.length === 0)
191
+ if (n.length === 0)
188
192
  return s;
189
- for (let i = 0; i < r.length; i++)
190
- if (typeof r[i] == "boolean" && r[i] || typeof r[i] == "string" && Dr(
193
+ for (let i = 0; i < n.length; i++)
194
+ if (typeof n[i] == "boolean" && n[i] || typeof n[i] == "string" && Fn(
191
195
  t,
192
196
  e,
193
- r[i]
197
+ n[i]
194
198
  ))
195
- return n[i];
199
+ return r[i];
196
200
  return s;
197
- }, gr = ({
201
+ }, jn = ({
198
202
  selectedBackground: t,
199
203
  todayBackground: e,
200
- rangeBackground: r,
201
- borderColor: n = "transparent"
202
- }) => (s, i, a, o, d) => ({
203
- backgroundColor: G(
204
+ rangeBackground: n,
205
+ borderColor: r = "transparent"
206
+ }) => (s, i, c, a, l) => ({
207
+ backgroundColor: ot(
204
208
  i,
205
209
  s,
206
- ["selected", "range", "today", a.month === d.monthInYear],
207
- [t, r, e, "#fff"],
210
+ ["selected", "range", "today", c.month === l.monthInYear],
211
+ [t, n, e, "#fff"],
208
212
  "transparent"
209
213
  ),
210
214
  borderWidth: "1px",
211
215
  borderStyle: "solid",
212
- borderColor: G(
216
+ borderColor: ot(
213
217
  i,
214
218
  s,
215
219
  ["selectedStart", "selectedEnd", "singleSelected", "range", "today"],
@@ -220,9 +224,9 @@ const Jt = (t, e, r, n) => {
220
224
  "var(--swui-calendar-wrapper-range-border)",
221
225
  "var(--lhds-color-ui-500)"
222
226
  ],
223
- n
227
+ r
224
228
  ),
225
- borderTopLeftRadius: G(
229
+ borderTopLeftRadius: ot(
226
230
  i,
227
231
  s,
228
232
  ["selectedStart", "singleSelected", "today"],
@@ -233,7 +237,7 @@ const Jt = (t, e, r, n) => {
233
237
  ],
234
238
  "unset"
235
239
  ),
236
- borderBottomLeftRadius: G(
240
+ borderBottomLeftRadius: ot(
237
241
  i,
238
242
  s,
239
243
  ["selectedStart", "singleSelected", "today"],
@@ -244,7 +248,7 @@ const Jt = (t, e, r, n) => {
244
248
  ],
245
249
  "unset"
246
250
  ),
247
- borderTopRightRadius: G(
251
+ borderTopRightRadius: ot(
248
252
  i,
249
253
  s,
250
254
  ["selectedEnd", "singleSelected", "today"],
@@ -255,7 +259,7 @@ const Jt = (t, e, r, n) => {
255
259
  ],
256
260
  "unset"
257
261
  ),
258
- borderBottomRightRadius: G(
262
+ borderBottomRightRadius: ot(
259
263
  i,
260
264
  s,
261
265
  ["selectedEnd", "singleSelected", "today"],
@@ -267,28 +271,28 @@ const Jt = (t, e, r, n) => {
267
271
  "unset"
268
272
  ),
269
273
  boxSizing: "border-box"
270
- }), mr = ({
274
+ }), Cn = ({
271
275
  selectedColor: t,
272
276
  disabledColor: e,
273
- inOtherMonthColor: r,
274
- rangeTextColor: n
275
- }) => (s, i, a, o, d) => {
276
- const l = a.month !== d.monthInYear;
277
+ inOtherMonthColor: n,
278
+ rangeTextColor: r
279
+ }) => (s, i, c, a, l) => {
280
+ const d = c.month !== l.monthInYear;
277
281
  return {
278
- color: G(
282
+ color: ot(
279
283
  i,
280
284
  s,
281
- [l, "selected", "range", "enabled", "disabled"],
285
+ [d, "selected", "range", "enabled", "disabled"],
282
286
  [
283
- r,
284
- t,
285
287
  n,
288
+ t,
289
+ r,
286
290
  void 0,
287
291
  e
288
292
  ]
289
293
  )
290
294
  };
291
- }, et = {
295
+ }, mt = {
292
296
  width: "var(--swui-calendar-day-width)",
293
297
  height: "var(--swui-calendar-day-height)",
294
298
  WeekNumber: {
@@ -301,12 +305,12 @@ const Jt = (t, e, r, n) => {
301
305
  clickableTextColor: "var(--swui-calendar-week-day-clickable-text-color)"
302
306
  },
303
307
  CalendarDay: {
304
- tdStyle: gr({
308
+ tdStyle: jn({
305
309
  selectedBackground: "var(--swui-calendar-wrapper-selected-background)",
306
310
  rangeBackground: "var(--swui-calendar-wrapper-range-background)",
307
311
  todayBackground: "var(--swui-calendar-wrapper-today-background)"
308
312
  }),
309
- textProps: mr({
313
+ textProps: Cn({
310
314
  selectedColor: "var(--swui-calendar-text-selected-color)",
311
315
  disabledColor: "var(--swui-calendar-text-disabled-color)",
312
316
  inOtherMonthColor: "var(--swui-calendar-text-in-other-month-color)"
@@ -315,120 +319,120 @@ const Jt = (t, e, r, n) => {
315
319
  CalendarMonth: {
316
320
  headerTextColor: "var(--swui-calendar-week-day-text-color)"
317
321
  }
318
- }, xn = {
319
- ...et,
322
+ }, Ns = {
323
+ ...mt,
320
324
  width: "37px",
321
325
  height: "37px"
322
- }, wr = ({
326
+ }, Kn = ({
323
327
  onClickWeekDay: t,
324
328
  day: e,
325
- theme: r
329
+ theme: n
326
330
  }) => {
327
- const n = /* @__PURE__ */ c(
328
- x,
331
+ const r = /* @__PURE__ */ o(
332
+ L,
329
333
  {
330
- width: r.width,
331
- height: r.height,
334
+ width: n.width,
335
+ height: n.height,
332
336
  justifyContent: "center",
333
337
  alignItems: "center",
334
- children: /* @__PURE__ */ c(
335
- yt,
338
+ children: /* @__PURE__ */ o(
339
+ pt,
336
340
  {
337
341
  size: "small",
338
- color: t ? r.WeekDay.clickableTextColor : r.WeekDay.textColor,
342
+ color: t ? n.WeekDay.clickableTextColor : n.WeekDay.textColor,
339
343
  children: e.name
340
344
  }
341
345
  )
342
346
  }
343
347
  );
344
- return t ? /* @__PURE__ */ c(
345
- Qt,
348
+ return t ? /* @__PURE__ */ o(
349
+ ke,
346
350
  {
347
351
  borderRadius: "var(--swui-calendar-day-border-radius)",
348
352
  onClick: (s) => t(e.dayOfWeek, s),
349
353
  disableFocusHighlight: !t,
350
- children: n
354
+ children: r
351
355
  }
352
- ) : n;
353
- }, le = function({
356
+ ) : r;
357
+ }, Be = function({
354
358
  day: e,
355
- week: r,
356
- month: n,
359
+ week: n,
360
+ month: r,
357
361
  dayState: s,
358
362
  userData: i,
359
- onClickDay: a,
360
- theme: o,
361
- extraDayContent: d,
362
- defaultHighlights: l
363
+ onClickDay: c,
364
+ theme: a,
365
+ extraDayContent: l,
366
+ defaultHighlights: d
363
367
  }) {
364
- const u = /* @__PURE__ */ c(
365
- x,
368
+ const u = /* @__PURE__ */ o(
369
+ L,
366
370
  {
367
371
  width: "100%",
368
372
  height: "100%",
369
373
  justifyContent: "center",
370
374
  alignItems: "center",
371
- children: /* @__PURE__ */ c(
372
- yt,
375
+ children: /* @__PURE__ */ o(
376
+ pt,
373
377
  {
374
- ...o.CalendarDay.textProps && o.CalendarDay.textProps(
375
- l,
378
+ ...a.CalendarDay.textProps && a.CalendarDay.textProps(
379
+ d,
376
380
  s,
377
381
  e,
378
- r,
379
382
  n,
383
+ r,
380
384
  i
381
385
  ),
382
386
  children: e.dayOfMonth
383
387
  }
384
388
  )
385
389
  }
386
- ), D = Lt.td({
387
- ...o.CalendarDay.tdStyle && o.CalendarDay.tdStyle(
388
- l,
390
+ ), p = Xt.td({
391
+ ...a.CalendarDay.tdStyle && a.CalendarDay.tdStyle(
392
+ d,
389
393
  s,
390
394
  e,
391
- r,
392
395
  n,
396
+ r,
393
397
  i
394
398
  )
395
- }), f = Lt.div({
396
- ...o.CalendarDay.innerWrapperStyle && o.CalendarDay.innerWrapperStyle(
397
- l,
399
+ }), h = Xt.div({
400
+ ...a.CalendarDay.innerWrapperStyle && a.CalendarDay.innerWrapperStyle(
401
+ d,
398
402
  s,
399
403
  e,
400
- r,
401
404
  n,
405
+ r,
402
406
  i
403
407
  ),
404
408
  width: "100%",
405
409
  height: "100%"
406
- }), h = Lt.div({
407
- ...o.CalendarDay.cellWrapperStyle && o.CalendarDay.cellWrapperStyle(
408
- l,
410
+ }), f = Xt.div({
411
+ ...a.CalendarDay.cellWrapperStyle && a.CalendarDay.cellWrapperStyle(
412
+ d,
409
413
  s,
410
414
  e,
411
- r,
412
415
  n,
416
+ r,
413
417
  i
414
418
  ),
415
419
  width: "100%",
416
420
  height: "100%",
417
421
  position: "relative"
418
- }), w = yr(l, s);
419
- return /* @__PURE__ */ c(
420
- D,
422
+ }), g = Jn(d, s);
423
+ return /* @__PURE__ */ o(
424
+ p,
421
425
  {
422
- onClick: w ? void 0 : (M) => a == null ? void 0 : a(e, i, M),
423
- children: /* @__PURE__ */ c(f, { children: /* @__PURE__ */ c(h, { children: e.month === n.monthInYear && /* @__PURE__ */ T(ht, { children: [
424
- d && /* @__PURE__ */ c(
425
- d,
426
+ onClick: g ? void 0 : (M) => c == null ? void 0 : c(e, i, M),
427
+ children: /* @__PURE__ */ o(h, { children: /* @__PURE__ */ o(f, { children: e.month === r.monthInYear && /* @__PURE__ */ x(Ht, { children: [
428
+ l && /* @__PURE__ */ o(
429
+ l,
426
430
  {
427
- week: r,
428
- month: n,
431
+ week: n,
432
+ month: r,
429
433
  day: e,
430
434
  dayState: s,
431
- theme: o,
435
+ theme: a,
432
436
  userData: i
433
437
  }
434
438
  ),
@@ -436,209 +440,209 @@ const Jt = (t, e, r, n) => {
436
440
  ] }) }) })
437
441
  }
438
442
  );
439
- }, yr = (t, e) => !!G(
443
+ }, Jn = (t, e) => !!ot(
440
444
  e,
441
445
  t,
442
446
  ["disabled"],
443
447
  [!0],
444
448
  !1
445
- ), pr = ({
449
+ ), Gn = ({
446
450
  onClickWeek: t,
447
451
  theme: e,
448
- week: r,
449
- background: n,
452
+ week: n,
453
+ background: r,
450
454
  backgroundColor: s,
451
455
  prefix: i
452
456
  }) => {
453
- const a = /* @__PURE__ */ T(
454
- x,
457
+ const c = /* @__PURE__ */ x(
458
+ L,
455
459
  {
456
460
  width: e.width,
457
461
  height: e.height,
458
462
  justifyContent: "center",
459
463
  alignItems: "center",
460
464
  children: [
461
- n && /* @__PURE__ */ c(x, { position: "absolute", children: n }),
462
- /* @__PURE__ */ c(x, { position: "absolute", children: /* @__PURE__ */ T(
463
- yt,
465
+ r && /* @__PURE__ */ o(L, { position: "absolute", children: r }),
466
+ /* @__PURE__ */ o(L, { position: "absolute", children: /* @__PURE__ */ x(
467
+ pt,
464
468
  {
465
469
  color: t ? e.WeekNumber.clickableTextColor : e.WeekNumber.textColor,
466
470
  children: [
467
471
  i,
468
- r.weekNumber
472
+ n.weekNumber
469
473
  ]
470
474
  }
471
475
  ) })
472
476
  ]
473
477
  }
474
478
  );
475
- return /* @__PURE__ */ c(
476
- x,
479
+ return /* @__PURE__ */ o(
480
+ L,
477
481
  {
478
482
  background: s || e.WeekNumber.backgroundColor,
479
483
  position: "relative",
480
- children: t ? /* @__PURE__ */ c(
481
- Qt,
484
+ children: t ? /* @__PURE__ */ o(
485
+ ke,
482
486
  {
483
487
  borderRadius: "var(--swui-calendar-day-border-radius)",
484
- onClick: (o) => t(r, o),
488
+ onClick: (a) => t(n, a),
485
489
  disableFocusHighlight: !t,
486
- children: a
490
+ children: c
487
491
  }
488
- ) : a
492
+ ) : c
489
493
  }
490
494
  );
491
- }, br = (t, e, r) => e && He(t, e) ? K(t, e) : r && v(t, r) ? K(t, r) : !0, kr = function({
495
+ }, qn = (t, e, n) => e && nt(t, e) ? P(t, e) : n && G(t, n) ? P(t, n) : !0, Qn = function({
492
496
  dayComponent: e,
493
- minDate: r,
494
- maxDate: n,
497
+ minDate: n,
498
+ maxDate: r,
495
499
  dayState: s,
496
500
  day: i,
497
- ...a
501
+ ...c
498
502
  }) {
499
- const o = A(
500
- () => br(i.date, r, n) ? s : oe(s, ["disabled"]),
501
- [i.date, s, n, r]
503
+ const a = R(
504
+ () => qn(i.date, n, r) ? s : Ye(s, ["disabled"]),
505
+ [i.date, s, r, n]
502
506
  );
503
- return /* @__PURE__ */ c(e, { day: i, ...a, dayState: o });
507
+ return /* @__PURE__ */ o(e, { day: i, ...c, dayState: a });
504
508
  };
505
- function Sr({
509
+ function Xn({
506
510
  month: t,
507
- dayComponent: e = le,
508
- statePerWeek: r,
509
- userDataPerWeek: n,
511
+ dayComponent: e = Be,
512
+ statePerWeek: n,
513
+ userDataPerWeek: r,
510
514
  minDate: s,
511
515
  maxDate: i,
512
- onClickDay: a,
513
- onClickWeek: o,
514
- onClickWeekDay: d,
515
- onClickMonth: l,
516
+ onClickDay: c,
517
+ onClickWeek: a,
518
+ onClickWeekDay: l,
519
+ onClickMonth: d,
516
520
  renderWeekNumber: u,
517
- renderWeekDay: D,
518
- headerRightContent: f,
519
- theme: h = et,
520
- extraDayContent: w,
521
+ renderWeekDay: p,
522
+ headerRightContent: h,
523
+ theme: f = mt,
524
+ extraDayContent: g,
521
525
  defaultHighlights: M,
522
- showWeekNumber: b
526
+ showWeekNumber: y
523
527
  }) {
524
- return /* @__PURE__ */ c(ht, { children: /* @__PURE__ */ T(x, { alignItems: "stretch", children: [
525
- /* @__PURE__ */ T(
526
- R,
528
+ return /* @__PURE__ */ o(Ht, { children: /* @__PURE__ */ x(L, { alignItems: "stretch", children: [
529
+ /* @__PURE__ */ x(
530
+ B,
527
531
  {
528
- justifyContent: f ? "space-between" : "center",
532
+ justifyContent: h ? "space-between" : "center",
529
533
  alignItems: "center",
530
534
  children: [
531
- /* @__PURE__ */ c(R, { justifyContent: "center", alignItems: "center", children: l ? /* @__PURE__ */ c(
532
- W,
535
+ /* @__PURE__ */ o(B, { justifyContent: "center", alignItems: "center", children: d ? /* @__PURE__ */ o(
536
+ q,
533
537
  {
534
- onClick: () => l(t),
538
+ onClick: () => d(t),
535
539
  label: t.name + " " + String(t.year),
536
- rightIcon: Xt
540
+ rightIcon: ae
537
541
  }
538
- ) : /* @__PURE__ */ T(yt, { whiteSpace: "nowrap", children: [
542
+ ) : /* @__PURE__ */ x(pt, { whiteSpace: "nowrap", children: [
539
543
  t.name,
540
544
  " ",
541
545
  t.year
542
546
  ] }) }),
543
- f && /* @__PURE__ */ c(x, { alignItems: "center", children: f })
547
+ h && /* @__PURE__ */ o(L, { alignItems: "center", children: h })
544
548
  ]
545
549
  }
546
550
  ),
547
- /* @__PURE__ */ c("table", { children: /* @__PURE__ */ T("tbody", { children: [
548
- /* @__PURE__ */ T("tr", { children: [
549
- b && /* @__PURE__ */ c("td", { children: /* @__PURE__ */ c(x, { width: h.width, height: h.height }) }),
550
- t.weeks[0].days.map((y) => /* @__PURE__ */ c("td", { children: D ? D(y.name, h, d) : /* @__PURE__ */ c(
551
- wr,
551
+ /* @__PURE__ */ o("table", { children: /* @__PURE__ */ x("tbody", { children: [
552
+ /* @__PURE__ */ x("tr", { children: [
553
+ y && /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(L, { width: f.width, height: f.height }) }),
554
+ t.weeks[0].days.map((b) => /* @__PURE__ */ o("td", { children: p ? p(b.name, f, l) : /* @__PURE__ */ o(
555
+ Kn,
552
556
  {
553
- day: y,
554
- onClickWeekDay: d,
555
- theme: h
557
+ day: b,
558
+ onClickWeekDay: l,
559
+ theme: f
556
560
  }
557
- ) }, y.name))
561
+ ) }, b.name))
558
562
  ] }),
559
- t.weeks.map((y) => /* @__PURE__ */ c(ht, { children: /* @__PURE__ */ T("tr", { children: [
560
- b && /* @__PURE__ */ c("td", { children: u ? u(y, h, o) : /* @__PURE__ */ c(
561
- pr,
563
+ t.weeks.map((b) => /* @__PURE__ */ o(Ht, { children: /* @__PURE__ */ x("tr", { children: [
564
+ y && /* @__PURE__ */ o("td", { children: u ? u(b, f, a) : /* @__PURE__ */ o(
565
+ Gn,
562
566
  {
563
- week: y,
564
- onClickWeek: o,
565
- theme: h
567
+ week: b,
568
+ onClickWeek: a,
569
+ theme: f
566
570
  }
567
571
  ) }),
568
- y.days.map((p) => /* @__PURE__ */ c(
569
- kr,
572
+ b.days.map((w) => /* @__PURE__ */ o(
573
+ Qn,
570
574
  {
571
575
  dayComponent: e,
572
- day: p,
573
- week: y,
576
+ day: w,
577
+ week: b,
574
578
  month: t,
575
- dayState: r && r[y.weekNumber] && r[y.weekNumber][p.dayOfMonth],
576
- userData: n && n[y.weekNumber] && n[y.weekNumber][p.dayOfMonth],
577
- onClickDay: a,
578
- theme: h,
579
- extraDayContent: w,
579
+ dayState: n && n[b.weekNumber] && n[b.weekNumber][w.dayOfMonth],
580
+ userData: r && r[b.weekNumber] && r[b.weekNumber][w.dayOfMonth],
581
+ onClickDay: c,
582
+ theme: f,
583
+ extraDayContent: g,
580
584
  defaultHighlights: M,
581
585
  minDate: s,
582
586
  maxDate: i
583
587
  },
584
- p.dateString
588
+ w.dateString
585
589
  ))
586
- ] }, y.weekNumber) }))
590
+ ] }, b.weekNumber) }))
587
591
  ] }) })
588
592
  ] }) });
589
593
  }
590
- function Mr({
594
+ function Zn({
591
595
  monthRows: t,
592
- dayComponent: e = le,
593
- userDataPerMonth: r,
594
- statePerMonth: n,
596
+ dayComponent: e = Be,
597
+ userDataPerMonth: n,
598
+ statePerMonth: r,
595
599
  minDate: s,
596
600
  maxDate: i,
597
- onClickDay: a,
598
- onClickWeekDay: o,
599
- onClickWeek: d,
600
- onClickMonth: l,
601
+ onClickDay: c,
602
+ onClickWeekDay: a,
603
+ onClickWeek: l,
604
+ onClickMonth: d,
601
605
  renderWeekDay: u,
602
- renderWeekNumber: D,
603
- headerRightContent: f,
604
- extraDayContent: h,
605
- defaultHighlights: w,
606
+ renderWeekNumber: p,
607
+ headerRightContent: h,
608
+ extraDayContent: f,
609
+ defaultHighlights: g,
606
610
  showWeekNumber: M,
607
- theme: b = et
611
+ theme: y = mt
608
612
  }) {
609
- const y = A(
610
- () => s ? V(s, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
613
+ const b = R(
614
+ () => s ? ft(s, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
611
615
  [s]
612
- ), p = A(
613
- () => i ? V(i, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
616
+ ), w = R(
617
+ () => i ? ft(i, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
614
618
  [i]
615
619
  );
616
- return /* @__PURE__ */ c(
620
+ return /* @__PURE__ */ o(
617
621
  "div",
618
622
  {
619
- className: tr(
620
- Kt.calendar,
621
- M && Kt.weekNumberVisible
623
+ className: jt(
624
+ we.calendar,
625
+ M && we.weekNumberVisible
622
626
  ),
623
- children: t.map((m, k) => /* @__PURE__ */ c(be, { children: /* @__PURE__ */ c(R, { gap: 2, children: m.map((E) => /* @__PURE__ */ c(
624
- Sr,
627
+ children: t.map((m, k) => /* @__PURE__ */ o(Xe, { children: /* @__PURE__ */ o(B, { gap: 2, children: m.map((E) => /* @__PURE__ */ o(
628
+ Xn,
625
629
  {
626
630
  month: E,
627
631
  dayComponent: e,
628
- userDataPerWeek: r && r[E.monthString],
629
- statePerWeek: n && n[E.monthString],
630
- onClickDay: a,
631
- onClickWeekDay: o,
632
- onClickWeek: d,
633
- onClickMonth: l,
634
- theme: b,
635
- renderWeekNumber: D,
632
+ userDataPerWeek: n && n[E.monthString],
633
+ statePerWeek: r && r[E.monthString],
634
+ onClickDay: c,
635
+ onClickWeekDay: a,
636
+ onClickWeek: l,
637
+ onClickMonth: d,
638
+ theme: y,
639
+ renderWeekNumber: p,
636
640
  renderWeekDay: u,
637
- headerRightContent: f,
638
- extraDayContent: h,
639
- defaultHighlights: w,
640
- minDate: y,
641
- maxDate: p,
641
+ headerRightContent: h,
642
+ extraDayContent: f,
643
+ defaultHighlights: g,
644
+ minDate: b,
645
+ maxDate: w,
642
646
  showWeekNumber: M ?? !1
643
647
  },
644
648
  E.name
@@ -646,385 +650,473 @@ function Mr({
646
650
  }
647
651
  );
648
652
  }
649
- function Ut(t) {
650
- const e = Tr(t.year, t.month, t.date), { year: r, month: n } = ur(
653
+ function se(t) {
654
+ const e = Vn(t.year, t.month, t.date), { year: n, month: r } = Wn(
651
655
  e.year,
652
656
  e.month
653
- ), s = Er(
654
- r,
657
+ ), s = tr(
655
658
  n,
656
- t.locale ?? Nt,
659
+ r,
660
+ t.locale ?? Ft,
657
661
  t.numMonths,
658
662
  t.monthsPerRow
659
- ), i = cr(
663
+ ), i = Yn(
660
664
  t.highlightToday,
661
665
  t.statePerMonth
662
666
  );
663
- return /* @__PURE__ */ c(
664
- Mr,
667
+ return /* @__PURE__ */ o(
668
+ Zn,
665
669
  {
666
- year: r,
667
- month: n,
670
+ year: n,
671
+ month: r,
668
672
  monthRows: s,
669
673
  ...t,
670
674
  statePerMonth: i
671
675
  }
672
676
  );
673
677
  }
674
- const Tr = (t, e, r) => {
678
+ const Vn = (t, e, n) => {
675
679
  if (e && t)
676
680
  return {
677
681
  month: e,
678
682
  year: t
679
683
  };
680
- if (r)
684
+ if (n)
681
685
  return {
682
- month: Z(r),
683
- year: mt(r)
686
+ month: dt(n),
687
+ year: St(n)
684
688
  };
685
- const n = /* @__PURE__ */ new Date();
689
+ const r = /* @__PURE__ */ new Date();
686
690
  return {
687
- month: Z(n),
688
- year: mt(n)
691
+ month: dt(r),
692
+ year: St(r)
693
+ };
694
+ }, tr = (t, e, n, r, s) => r == null ? [[Kt(t, e, n)]] : s == null ? [be(t, e, r, n)] : _e(be(t, e, r, n), s), Oe = (t, e) => `${t.row}-${t.column}-${e}`, er = (t, e, n, r) => {
695
+ let s = e;
696
+ for (let i = 0; i < r; i++) {
697
+ s = nr(s, t, r);
698
+ const c = Oe(s, n);
699
+ if (document.getElementById(c))
700
+ return c;
701
+ }
702
+ }, nr = (t, e, n) => {
703
+ let r = t.row, s = t.column;
704
+ return e === "ArrowLeft" ? s-- : e === "ArrowUp" ? r-- : e === "ArrowRight" ? s++ : e === "ArrowDown" && r++, s < 0 && (s = n - 1, r--), s > n - 1 && (s = 0, r++), {
705
+ column: s,
706
+ row: r
689
707
  };
690
- }, Er = (t, e, r, n, s) => n == null ? [[de(t, e, r)]] : s == null ? [Jt(t, e, n, r)] : ie(Jt(t, e, n, r), s), Rr = ({
708
+ }, rr = ({
691
709
  month: t,
692
- year: e,
693
- onClick: r,
710
+ onClick: e,
694
711
  selected: n,
695
- locale: s
712
+ locale: r,
713
+ autoFocus: s,
714
+ monthPickerId: i,
715
+ position: c
696
716
  }) => {
697
- const i = A(() => {
698
- const a = new Date(e, t, 1);
699
- return se(Y(a, "MMM", { locale: s }));
700
- }, [s, e, t]);
701
- return /* @__PURE__ */ c(R, { justifyContent: "center", children: n ? /* @__PURE__ */ c(ot, { label: i, onClick: r }) : /* @__PURE__ */ c(W, { label: i, onClick: r }) });
702
- }, Ar = ({
717
+ const a = R(
718
+ () => Tt(W(t, "MMM", { locale: r })),
719
+ [r, t]
720
+ ), l = R(
721
+ () => Tt(W(t, "MMMM", { locale: r })),
722
+ [r, t]
723
+ ), d = $(null), u = Oe(c, i);
724
+ X(() => {
725
+ var h;
726
+ (h = d.current) == null || h.focus();
727
+ }, []);
728
+ const p = D(
729
+ (h) => {
730
+ var g;
731
+ const f = er(
732
+ h.key,
733
+ c,
734
+ i,
735
+ 4
736
+ );
737
+ f && ((g = document.getElementById(f)) == null || g.focus());
738
+ },
739
+ [i, c]
740
+ );
741
+ return /* @__PURE__ */ o(B, { justifyContent: "center", onKeyDown: p, children: n ? /* @__PURE__ */ o(
742
+ bt,
743
+ {
744
+ id: u,
745
+ "aria-label": l,
746
+ label: a,
747
+ onClick: e,
748
+ "aria-selected": !0,
749
+ autoFocus: s,
750
+ ref: d
751
+ }
752
+ ) : /* @__PURE__ */ o(
753
+ q,
754
+ {
755
+ id: u,
756
+ label: a,
757
+ "aria-label": l,
758
+ onClick: e
759
+ }
760
+ ) });
761
+ }, sr = (t, e, n) => {
762
+ let r = t.getFullYear(), s = 0, i = 0, c = t;
763
+ const a = {
764
+ yearOrder: [],
765
+ rows: [],
766
+ years: {},
767
+ lastMonthColumn: -1,
768
+ lastMonthRow: -1
769
+ };
770
+ for (let l = 0; l < e; l++) {
771
+ if (a.years[r] == null && (a.yearOrder.push(r), a.years[r] = { year: r, rows: [] }), a.rows[s] = a.rows[s] ?? {
772
+ columns: [],
773
+ rowIndex: s
774
+ }, a.rows[s].columns[i] = {
775
+ position: {
776
+ column: i,
777
+ row: s
778
+ },
779
+ month: c
780
+ }, l === e - 1) {
781
+ a.years[r].rows.push(s);
782
+ break;
783
+ }
784
+ c = xt(c, 1), c.getFullYear() !== r ? (a.years[r].rows.push(s), r++, i = 0, s++) : (i++, i > n - 1 && (a.years[r].rows.push(s), i = 0, s++));
785
+ }
786
+ return a.lastMonthColumn = i, a.lastMonthRow = s, a;
787
+ }, me = () => R(() => /* @__PURE__ */ new Date(), []), Nt = ({
703
788
  value: t,
704
789
  onValueChange: e,
705
- locale: r = Nt,
706
- firstMonth: n,
707
- numMonths: s
790
+ locale: n = Ft,
791
+ firstMonth: r,
792
+ numMonths: s,
793
+ onCancel: i
708
794
  }) => {
709
- const i = xr(n, s);
710
- return /* @__PURE__ */ c($, { gap: 1, maxWidth: "336px", children: i.years.map(({ year: a, months: o }) => /* @__PURE__ */ T(ht, { children: [
711
- /* @__PURE__ */ c(ke, { variant: "h4", children: a }),
712
- /* @__PURE__ */ c(R, { gap: 1, flexWrap: "wrap", children: o.map((d) => /* @__PURE__ */ c(
713
- Rr,
714
- {
715
- month: d,
716
- year: a,
717
- locale: r,
718
- selected: (t == null ? void 0 : t.month) === d && (t == null ? void 0 : t.year) === a,
719
- onClick: () => e == null ? void 0 : e({ month: d, year: a })
720
- },
721
- d
722
- )) })
723
- ] })) });
724
- }, xr = (t, e) => {
725
- let r = t.getFullYear(), n = t.getMonth();
726
- const s = {
727
- years: [{ year: r, months: [n] }]
728
- };
729
- for (let i = 1; i < e; i++)
730
- n === ae.DECEMBER ? (r++, n = 0, s.years.push({ year: r, months: [n] })) : (n++, s.years[s.years.length - 1].months.push(n));
731
- return s;
732
- }, Gt = (t) => ({
733
- year: t.getFullYear(),
734
- month: t.getMonth()
735
- }), Cr = (t) => [
795
+ const c = he(), a = me(), l = s > 0 ? s : 12, [d, u] = T(!1), p = sr(r, l, 4), h = R(() => xt(r, l), [l, r]);
796
+ X(() => {
797
+ u(!0);
798
+ }, []);
799
+ const f = D(
800
+ (g) => {
801
+ g.key === "Escape" && (i == null || i(), g.preventDefault(), g.stopPropagation());
802
+ },
803
+ [i]
804
+ );
805
+ return /* @__PURE__ */ o(C, { gap: 1, maxWidth: "336px", onKeyDown: f, children: p.yearOrder.map((g, M) => {
806
+ const { rows: y } = p.years[g];
807
+ return /* @__PURE__ */ x(fe.Fragment, { children: [
808
+ (M !== 0 || g !== a.getFullYear()) && /* @__PURE__ */ o(Rt, { variant: "h4", children: g }),
809
+ y.map((b) => {
810
+ const { columns: w } = p.rows[b];
811
+ return /* @__PURE__ */ o(B, { gap: 1, children: w.map(({ month: m, position: k }) => /* @__PURE__ */ o(C, { width: "78px", children: /* @__PURE__ */ o(
812
+ rr,
813
+ {
814
+ month: m,
815
+ firstAvailableMonth: r,
816
+ lastAvailableMonth: h,
817
+ locale: n,
818
+ selected: t ? rt(t, m) : !1,
819
+ autoFocus: d,
820
+ onClick: () => e == null ? void 0 : e(m),
821
+ monthPickerId: c,
822
+ position: k
823
+ }
824
+ ) }, m.getMonth())) }, b);
825
+ })
826
+ ] }, g);
827
+ }) });
828
+ }, ir = (t) => [
736
829
  {
737
830
  label: "Past",
738
831
  presets: [
739
- { label: "Last 3 days", startDate: t, endDate: ft(t, 2) },
740
- { label: "Last 7 days", startDate: t, endDate: ft(t, 6) },
741
- { label: "Last 30 days", startDate: t, endDate: ft(t, 29) },
742
- { label: "Last 45 days", startDate: t, endDate: ft(t, 44) }
832
+ { label: "Last 3 days", startDate: t, endDate: lt(t, 2) },
833
+ { label: "Last 7 days", startDate: t, endDate: lt(t, 6) },
834
+ { label: "Last 30 days", startDate: t, endDate: lt(t, 29) },
835
+ { label: "Last 45 days", startDate: t, endDate: lt(t, 44) }
743
836
  ]
744
837
  },
745
838
  {
746
839
  label: "Future",
747
840
  presets: [
748
- { label: "Next 3 days", startDate: t, endDate: _(t, 2) },
749
- { label: "Next 7 days", startDate: t, endDate: _(t, 6) },
750
- { label: "Next 30 days", startDate: t, endDate: _(t, 29) },
751
- { label: "Next 45 days", startDate: t, endDate: _(t, 44) }
841
+ { label: "Next 3 days", startDate: t, endDate: J(t, 2) },
842
+ { label: "Next 7 days", startDate: t, endDate: J(t, 6) },
843
+ { label: "Next 30 days", startDate: t, endDate: J(t, 29) },
844
+ { label: "Next 45 days", startDate: t, endDate: J(t, 44) }
752
845
  ]
753
846
  }
754
- ], Nr = ({
847
+ ], or = ({
755
848
  onClickPreset: t
756
849
  }) => {
757
- const [e, r] = S(0), n = A(() => Cr(/* @__PURE__ */ new Date()), []), s = n[e] ?? n[0];
758
- return /* @__PURE__ */ T($, { children: [
759
- /* @__PURE__ */ T(
760
- R,
850
+ const [e, n] = T(0), r = R(() => ir(/* @__PURE__ */ new Date()), []), s = r[e] ?? r[0];
851
+ return /* @__PURE__ */ x(C, { children: [
852
+ /* @__PURE__ */ x(
853
+ B,
761
854
  {
762
855
  justifyContent: "space-between",
763
856
  alignItems: "center",
764
857
  width: "200px",
765
858
  children: [
766
- /* @__PURE__ */ c(
767
- W,
859
+ /* @__PURE__ */ o(
860
+ q,
768
861
  {
769
862
  size: "small",
770
- leftIcon: Me,
863
+ leftIcon: Ve,
771
864
  disabled: e === 0,
772
- onClick: () => r(e - 1)
865
+ onClick: () => n(e - 1)
773
866
  }
774
867
  ),
775
- /* @__PURE__ */ c(yt, { children: s.label }),
776
- /* @__PURE__ */ c(
777
- W,
868
+ /* @__PURE__ */ o(pt, { children: s.label }),
869
+ /* @__PURE__ */ o(
870
+ q,
778
871
  {
779
872
  size: "small",
780
- leftIcon: Te,
781
- disabled: e === n.length - 1,
782
- onClick: () => r(e + 1)
873
+ leftIcon: tn,
874
+ disabled: e === r.length - 1,
875
+ onClick: () => n(e + 1)
783
876
  }
784
877
  )
785
878
  ]
786
879
  }
787
880
  ),
788
- /* @__PURE__ */ c(ct, {}),
789
- /* @__PURE__ */ c($, { alignItems: "center", children: s.presets.map((i) => /* @__PURE__ */ T(Ve.Fragment, { children: [
790
- /* @__PURE__ */ c(
791
- ot,
881
+ /* @__PURE__ */ o(Dt, {}),
882
+ /* @__PURE__ */ o(C, { alignItems: "center", children: s.presets.map((i) => /* @__PURE__ */ x(fe.Fragment, { children: [
883
+ /* @__PURE__ */ o(
884
+ bt,
792
885
  {
793
886
  label: i.label,
794
887
  onClick: () => t(i)
795
888
  }
796
889
  ),
797
- /* @__PURE__ */ c(ct, {})
890
+ /* @__PURE__ */ o(Dt, {})
798
891
  ] }, i.label)) })
799
892
  ] });
800
- }, Ir = function({
893
+ }, cr = function({
801
894
  locale: e,
802
- dateInFocus: r,
803
- setDateInFocus: n,
895
+ dateInFocus: n,
896
+ setDateInFocus: r,
804
897
  currentPanel: s,
805
898
  setCurrentPanel: i,
806
- renderMonthPicker: a,
807
- ...o
899
+ renderMonthPicker: c,
900
+ ...a
808
901
  }) {
809
- const d = g(
902
+ const l = D(
810
903
  (u) => {
811
- const D = r ? new Date(r) : /* @__PURE__ */ new Date();
812
- D.setMonth(u.month), D.setFullYear(u.year), n && n(D), i("calendar");
904
+ r && r(u), i("calendar");
813
905
  },
814
- [r, n, i]
815
- ), l = g(() => {
906
+ [r, i]
907
+ ), d = D(() => {
816
908
  i("month");
817
909
  }, [i]);
818
910
  switch (s) {
819
911
  case "calendar":
820
- return /* @__PURE__ */ c(
821
- Ut,
912
+ return /* @__PURE__ */ o(
913
+ se,
822
914
  {
823
- ...o,
824
- date: r,
825
- onClickMonth: l,
915
+ ...a,
916
+ date: n,
917
+ onClickMonth: d,
826
918
  locale: e
827
919
  }
828
920
  );
829
921
  case "month":
830
- return a ? a({
831
- value: Gt(r),
832
- onValueChange: d,
922
+ return c ? c({
923
+ value: n,
924
+ onValueChange: l,
833
925
  locale: e,
834
926
  firstMonth: /* @__PURE__ */ new Date(),
835
927
  numMonths: 24,
836
- dateInFocus: r
837
- }) : /* @__PURE__ */ c(
838
- Ar,
928
+ dateInFocus: n
929
+ }) : /* @__PURE__ */ o(
930
+ Nt,
839
931
  {
840
- value: Gt(r),
841
- onValueChange: d,
932
+ value: n,
933
+ onValueChange: l,
842
934
  locale: e,
843
935
  firstMonth: /* @__PURE__ */ new Date(),
844
936
  numMonths: 24
845
937
  }
846
938
  );
847
939
  case "presets":
848
- return /* @__PURE__ */ c(Nr, { onClickPreset: () => {
940
+ return /* @__PURE__ */ o(or, { onClickPreset: () => {
849
941
  } });
850
942
  default:
851
- return /* @__PURE__ */ c(x, { children: /* @__PURE__ */ c(
852
- ot,
943
+ return /* @__PURE__ */ o(L, { children: /* @__PURE__ */ o(
944
+ bt,
853
945
  {
854
946
  label: "Show calendar",
855
947
  onClick: () => i("calendar")
856
948
  }
857
949
  ) });
858
950
  }
859
- }, Lr = (t, e, r, n) => {
860
- const s = g(() => {
861
- const d = Pe(t, r ?? n ?? 1);
862
- e == null || e(d);
863
- }, [e, t, r, n]), i = g(() => {
864
- const d = Ue(t, 1);
865
- e == null || e(d);
866
- }, [e, t]), a = g(() => {
867
- const d = $e(t, r ?? n ?? 1);
868
- e == null || e(d);
869
- }, [e, t, r, n]), o = g(() => {
870
- const d = We(t, 1);
871
- e == null || e(d);
951
+ }, ar = (t, e, n, r) => {
952
+ const s = D(() => {
953
+ const l = xt(t, n ?? r ?? 1);
954
+ e == null || e(l);
955
+ }, [e, t, n, r]), i = D(() => {
956
+ const l = un(t, 1);
957
+ e == null || e(l);
958
+ }, [e, t]), c = D(() => {
959
+ const l = de(t, n ?? r ?? 1);
960
+ e == null || e(l);
961
+ }, [e, t, n, r]), a = D(() => {
962
+ const l = fn(t, 1);
963
+ e == null || e(l);
872
964
  }, [e, t]);
873
965
  return {
874
966
  nextMonth: s,
875
- prevMonth: a,
967
+ prevMonth: c,
876
968
  nextYear: i,
877
- prevYear: o
969
+ prevYear: a
878
970
  };
879
- }, Yr = ({
971
+ }, lr = ({
880
972
  children: t,
881
973
  prevMonth: e,
882
- nextMonth: r,
883
- prevYear: n,
974
+ nextMonth: n,
975
+ prevYear: r,
884
976
  nextYear: s
885
- }) => /* @__PURE__ */ T("div", { children: [
977
+ }) => /* @__PURE__ */ x("div", { children: [
886
978
  t,
887
- /* @__PURE__ */ c(Dt, { children: /* @__PURE__ */ T(R, { gap: 1, children: [
888
- /* @__PURE__ */ c(it, { onClick: n, leftIcon: Ee }),
889
- /* @__PURE__ */ c(it, { onClick: e, leftIcon: Wt }),
890
- /* @__PURE__ */ c(Dt, { num: 2 }),
891
- /* @__PURE__ */ c(it, { onClick: r, leftIcon: xt }),
892
- /* @__PURE__ */ c(it, { onClick: s, leftIcon: Re })
979
+ /* @__PURE__ */ o(Mt, { children: /* @__PURE__ */ x(B, { gap: 1, children: [
980
+ /* @__PURE__ */ o(ct, { onClick: r, leftIcon: en }),
981
+ /* @__PURE__ */ o(ct, { onClick: e, leftIcon: vt }),
982
+ /* @__PURE__ */ o(Mt, { num: 2 }),
983
+ /* @__PURE__ */ o(ct, { onClick: n, leftIcon: Et }),
984
+ /* @__PURE__ */ o(ct, { onClick: s, leftIcon: nn })
893
985
  ] }) }),
894
- /* @__PURE__ */ c(ct, {})
895
- ] }), Hr = () => {
986
+ /* @__PURE__ */ o(Dt, {})
987
+ ] }), dr = () => {
896
988
  };
897
- function rt({
989
+ function gt({
898
990
  monthSwitcherPlacement: t,
899
- theme: e = et,
900
- dateInFocus: r,
901
- setDateInFocus: n,
991
+ theme: e = mt,
992
+ dateInFocus: n,
993
+ setDateInFocus: r,
902
994
  currentPanel: s,
903
995
  setCurrentPanel: i,
904
- onSelectPreset: a = Hr,
905
- renderMonthPicker: o,
906
- ...d
996
+ onSelectPreset: c = dr,
997
+ renderMonthPicker: a,
998
+ ...l
907
999
  }) {
908
- const { nextMonth: l, prevMonth: u, nextYear: D, prevYear: f } = Lr(
909
- r,
1000
+ const { nextMonth: d, prevMonth: u, nextYear: p, prevYear: h } = ar(
910
1001
  n,
911
- d.monthsPerRow,
912
- d.numMonths
1002
+ r,
1003
+ l.monthsPerRow,
1004
+ l.numMonths
913
1005
  );
914
- switch (Pr(
1006
+ switch (ur(
915
1007
  t,
916
- d.numMonths
1008
+ l.numMonths
917
1009
  )) {
918
1010
  case "below":
919
- return /* @__PURE__ */ c(
920
- Yr,
1011
+ return /* @__PURE__ */ o(
1012
+ lr,
921
1013
  {
922
1014
  theme: e,
923
- nextMonth: l,
1015
+ nextMonth: d,
924
1016
  prevMonth: u,
925
- nextYear: D,
926
- prevYear: f,
927
- children: /* @__PURE__ */ c(Ut, { ...d, theme: e, date: r })
1017
+ nextYear: p,
1018
+ prevYear: h,
1019
+ children: /* @__PURE__ */ o(se, { ...l, theme: e, date: n })
928
1020
  }
929
1021
  );
930
1022
  case "header":
931
- return /* @__PURE__ */ c($, { children: /* @__PURE__ */ c(
932
- Ir,
1023
+ return /* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(
1024
+ cr,
933
1025
  {
934
- ...d,
1026
+ ...l,
935
1027
  theme: e,
936
- renderMonthPicker: o,
937
- dateInFocus: r,
938
- setDateInFocus: n,
1028
+ renderMonthPicker: a,
1029
+ dateInFocus: n,
1030
+ setDateInFocus: r,
939
1031
  currentPanel: s,
940
1032
  setCurrentPanel: i,
941
- onSelectPreset: a,
942
- headerRightContent: /* @__PURE__ */ T(R, { alignItems: "center", gap: 1, children: [
943
- /* @__PURE__ */ c(
944
- it,
1033
+ onSelectPreset: c,
1034
+ headerRightContent: /* @__PURE__ */ x(B, { alignItems: "center", gap: 1, children: [
1035
+ /* @__PURE__ */ o(
1036
+ ct,
945
1037
  {
946
1038
  onClick: u,
947
- leftIcon: Wt
1039
+ leftIcon: vt
948
1040
  }
949
1041
  ),
950
- /* @__PURE__ */ c(
951
- it,
1042
+ /* @__PURE__ */ o(
1043
+ ct,
952
1044
  {
953
- onClick: l,
954
- leftIcon: xt
1045
+ onClick: d,
1046
+ leftIcon: Et
955
1047
  }
956
1048
  )
957
1049
  ] })
958
1050
  }
959
1051
  ) });
960
1052
  default:
961
- return /* @__PURE__ */ c(Ut, { ...d, theme: e, date: r });
1053
+ return /* @__PURE__ */ o(se, { ...l, theme: e, date: n });
962
1054
  }
963
1055
  }
964
- const Pr = (t, e) => t || (e || 1) > 1 ? "below" : "header", Ur = (t) => ({
965
- startDate: t.startDate ? Y(t.startDate, "yyyy-MM-dd") : void 0,
966
- endDate: t.endDate ? Y(t.endDate, "yyyy-MM-dd") : void 0
967
- }), $r = ({
1056
+ const ur = (t, e) => t || (e || 1) > 1 ? "below" : "header", fr = (t) => ({
1057
+ startDate: t.startDate ? W(t.startDate, "yyyy-MM-dd") : void 0,
1058
+ endDate: t.endDate ? W(t.endDate, "yyyy-MM-dd") : void 0
1059
+ }), hr = ({
968
1060
  startDate: t,
969
1061
  endDate: e
970
1062
  }) => {
971
- const r = /* @__PURE__ */ new Date();
1063
+ const n = /* @__PURE__ */ new Date();
972
1064
  return {
973
- startDate: t ? V(t, "yyyy-MM-dd", r) : void 0,
974
- endDate: e ? V(e, "yyyy-MM-dd", r) : void 0
1065
+ startDate: t ? ft(t, "yyyy-MM-dd", n) : void 0,
1066
+ endDate: e ? ft(e, "yyyy-MM-dd", n) : void 0
975
1067
  };
976
- }, ue = ({
1068
+ }, He = ({
977
1069
  startDate: t,
978
1070
  endDate: e
979
- }) => !!(t && e && !K(t, e) && v(t, e)), fe = (t) => ue(t) ? {
1071
+ }) => !!(t && e && !P(t, e) && G(t, e)), $e = (t) => He(t) ? {
980
1072
  startDate: t.endDate,
981
1073
  endDate: t.startDate
982
- } : t, Cn = (t) => t.startDate && t.endDate ? Ur(
983
- fe($r(t))
984
- ) : t, Wr = (t, e, r, n) => g(
1074
+ } : t, Ls = (t) => t.startDate && t.endDate ? fr(
1075
+ $e(hr(t))
1076
+ ) : t, pr = (t, e, n, r) => D(
985
1077
  (s) => {
986
1078
  const i = {
987
- startDate: r === "startDate" ? s.date : t == null ? void 0 : t.startDate,
988
- endDate: r === "endDate" ? s.date : t == null ? void 0 : t.endDate
1079
+ startDate: n === "startDate" ? s.date : t == null ? void 0 : t.startDate,
1080
+ endDate: n === "endDate" ? s.date : t == null ? void 0 : t.endDate
989
1081
  };
990
- ue(i) || n(r === "startDate" ? "endDate" : "startDate"), e == null || e(fe(i));
1082
+ He(i) || r(n === "startDate" ? "endDate" : "startDate"), e == null || e($e(i));
991
1083
  },
992
1084
  [
993
- r,
994
- e,
995
1085
  n,
1086
+ e,
1087
+ r,
996
1088
  t == null ? void 0 : t.endDate,
997
1089
  t == null ? void 0 : t.startDate
998
1090
  ]
999
- ), It = (t) => {
1000
- const [e, r] = S("calendar"), n = g(
1091
+ ), Jt = (t) => {
1092
+ const [e, n] = T("calendar"), r = D(
1001
1093
  (s) => {
1002
- r(s), t == null || t(s);
1094
+ n(s), t == null || t(s);
1003
1095
  },
1004
1096
  [t]
1005
1097
  );
1006
1098
  return {
1007
1099
  currentPanel: e,
1008
- setCurrentPanel: n
1100
+ setCurrentPanel: r
1009
1101
  };
1010
- }, Or = ({
1102
+ }, mr = ({
1011
1103
  focusedInput: t,
1012
1104
  value: e,
1013
- onValueChange: r,
1014
- setFocusedInput: n,
1105
+ onValueChange: n,
1106
+ setFocusedInput: r,
1015
1107
  statePerMonth: s,
1016
1108
  onChangePanel: i,
1017
- initialDateInFocus: a
1109
+ initialDateInFocus: c
1018
1110
  }) => {
1019
- const { currentPanel: o, setCurrentPanel: d } = It(i), [l, u] = S(
1020
- () => a ?? /* @__PURE__ */ new Date()
1021
- ), D = Wr(
1111
+ const { currentPanel: a, setCurrentPanel: l } = Jt(i), [d, u] = T(
1112
+ () => c ?? /* @__PURE__ */ new Date()
1113
+ ), p = pr(
1022
1114
  e,
1023
- r,
1115
+ n,
1024
1116
  t,
1025
- n
1026
- ), f = A(
1027
- () => wt(
1117
+ r
1118
+ ), h = R(
1119
+ () => It(
1028
1120
  s,
1029
1121
  e == null ? void 0 : e.startDate,
1030
1122
  e == null ? void 0 : e.endDate
@@ -1032,440 +1124,440 @@ const Pr = (t, e) => t || (e || 1) > 1 ? "below" : "header", Ur = (t) => ({
1032
1124
  [s, e == null ? void 0 : e.endDate, e == null ? void 0 : e.startDate]
1033
1125
  );
1034
1126
  return {
1035
- onClickDay: D,
1036
- statePerMonth: f,
1037
- currentPanel: o,
1038
- setCurrentPanel: d,
1127
+ onClickDay: p,
1128
+ statePerMonth: h,
1129
+ currentPanel: a,
1130
+ setCurrentPanel: l,
1039
1131
  setDateInFocus: u,
1040
- dateInFocus: l
1132
+ dateInFocus: d
1041
1133
  };
1042
1134
  };
1043
- function Nn(t) {
1044
- const e = Or(t);
1045
- return /* @__PURE__ */ c(rt, { ...t, ...e });
1135
+ function _s(t) {
1136
+ const e = mr(t);
1137
+ return /* @__PURE__ */ o(gt, { ...t, ...e });
1046
1138
  }
1047
- const In = () => {
1048
- const [t, e] = S(), [r, n] = S(), [s, i] = S("startDate");
1139
+ const Ps = () => {
1140
+ const [t, e] = T(), [n, r] = T(), [s, i] = T("startDate");
1049
1141
  return {
1050
1142
  startDate: t,
1051
1143
  setStartDate: e,
1052
- endDate: r,
1053
- setEndDate: n,
1144
+ endDate: n,
1145
+ setEndDate: r,
1054
1146
  focusedInput: s,
1055
1147
  setFocusedInput: i
1056
1148
  };
1057
- }, Br = ({
1149
+ }, gr = ({
1058
1150
  onChange: t,
1059
1151
  value: e,
1060
- statePerMonth: r,
1061
- onChangePanel: n
1152
+ statePerMonth: n,
1153
+ onChangePanel: r
1062
1154
  }) => {
1063
- const { currentPanel: s, setCurrentPanel: i } = It(n), [a, o] = S(() => e ?? /* @__PURE__ */ new Date()), d = g(
1155
+ const { currentPanel: s, setCurrentPanel: i } = Jt(r), [c, a] = T(() => e ?? /* @__PURE__ */ new Date()), l = D(
1064
1156
  (u) => {
1065
1157
  t && t(u.date);
1066
1158
  },
1067
1159
  [t]
1068
- ), l = A(
1069
- () => e ? F(r, e, [
1160
+ ), d = R(
1161
+ () => e ? at(n, e, [
1070
1162
  "selected",
1071
1163
  "singleSelected"
1072
- ]) : r,
1073
- [r, e]
1164
+ ]) : n,
1165
+ [n, e]
1074
1166
  );
1075
1167
  return {
1076
- onClickDay: d,
1077
- statePerMonth: l,
1168
+ onClickDay: l,
1169
+ statePerMonth: d,
1078
1170
  date: e,
1079
1171
  currentPanel: s,
1080
1172
  setCurrentPanel: i,
1081
- dateInFocus: a,
1082
- setDateInFocus: o
1173
+ dateInFocus: c,
1174
+ setDateInFocus: a
1083
1175
  };
1084
1176
  };
1085
- function he(t) {
1086
- const e = Br(t);
1087
- return /* @__PURE__ */ c(rt, { ...t, ...e });
1177
+ function Ue(t) {
1178
+ const e = gr(t);
1179
+ return /* @__PURE__ */ o(gt, { ...t, ...e });
1088
1180
  }
1089
- const zr = ({
1181
+ const Dr = ({
1090
1182
  onChange: t,
1091
1183
  value: e,
1092
- statePerMonth: r,
1093
- onChangePanel: n
1184
+ statePerMonth: n,
1185
+ onChangePanel: r
1094
1186
  }) => {
1095
- const { currentPanel: s, setCurrentPanel: i } = It(n), [a, o] = S(() => /* @__PURE__ */ new Date()), d = g(
1187
+ const { currentPanel: s, setCurrentPanel: i } = Jt(r), [c, a] = T(() => /* @__PURE__ */ new Date()), l = D(
1096
1188
  (u) => {
1097
1189
  if (!t)
1098
1190
  return;
1099
- const D = e && e.find((f) => K(f, u.date));
1100
- t(e && D ? e.filter((f) => !K(f, u.date)) : [...e || [], u.date]);
1191
+ const p = e && e.find((h) => P(h, u.date));
1192
+ t(e && p ? e.filter((h) => !P(h, u.date)) : [...e || [], u.date]);
1101
1193
  },
1102
1194
  [t, e]
1103
- ), l = A(() => e ? e.reduce(
1104
- (u, D) => F(u, D, ["selected"]),
1105
- r
1106
- ) : r, [r, e]);
1195
+ ), d = R(() => e ? e.reduce(
1196
+ (u, p) => at(u, p, ["selected"]),
1197
+ n
1198
+ ) : n, [n, e]);
1107
1199
  return {
1108
- onClickDay: d,
1109
- statePerMonth: l,
1200
+ onClickDay: l,
1201
+ statePerMonth: d,
1110
1202
  currentPanel: s,
1111
1203
  setCurrentPanel: i,
1112
- dateInFocus: a,
1113
- setDateInFocus: o
1204
+ dateInFocus: c,
1205
+ setDateInFocus: a
1114
1206
  };
1115
1207
  };
1116
- function Ln(t) {
1117
- const e = zr(t);
1118
- return /* @__PURE__ */ c(rt, { ...t, ...e });
1208
+ function Ys(t) {
1209
+ const e = Dr(t);
1210
+ return /* @__PURE__ */ o(gt, { ...t, ...e });
1119
1211
  }
1120
- const jr = ({
1212
+ const br = ({
1121
1213
  onChange: t,
1122
1214
  value: e,
1123
- statePerMonth: r,
1124
- onChangePanel: n,
1125
- locale: s = Nt
1215
+ statePerMonth: n,
1216
+ onChangePanel: r,
1217
+ locale: s = Ft
1126
1218
  }) => {
1127
- const [i, a] = S(() => {
1128
- const h = Yt(e, s);
1129
- return h ? h.days[0].date : /* @__PURE__ */ new Date();
1130
- }), { currentPanel: o, setCurrentPanel: d } = It(n), l = g(
1131
- (h) => {
1132
- t && t(Ft(zt(h.date, s)));
1219
+ const [i, c] = T(() => {
1220
+ const f = Zt(e, s);
1221
+ return f ? f.days[0].date : /* @__PURE__ */ new Date();
1222
+ }), { currentPanel: a, setCurrentPanel: l } = Jt(r), d = D(
1223
+ (f) => {
1224
+ t && t(ye(pe(f.date, s)));
1133
1225
  },
1134
1226
  [s, t]
1135
- ), u = g(
1136
- (h) => {
1137
- t && t(Ft(h));
1227
+ ), u = D(
1228
+ (f) => {
1229
+ t && t(ye(f));
1138
1230
  },
1139
1231
  [t]
1140
- ), D = A(() => {
1141
- const h = Yt(e, s);
1142
- return h ? ir(r, h) : r;
1143
- }, [e, s, r]), f = A(() => {
1144
- const h = Yt(e, s);
1145
- return h ? h.days[0].date : /* @__PURE__ */ new Date();
1232
+ ), p = R(() => {
1233
+ const f = Zt(e, s);
1234
+ return f ? Pn(n, f) : n;
1235
+ }, [e, s, n]), h = R(() => {
1236
+ const f = Zt(e, s);
1237
+ return f ? f.days[0].date : /* @__PURE__ */ new Date();
1146
1238
  }, [s, e]);
1147
1239
  return {
1148
- statePerMonth: D,
1149
- date: f,
1240
+ statePerMonth: p,
1241
+ date: h,
1150
1242
  dateInFocus: i,
1151
- setDateInFocus: a,
1152
- onClickDay: l,
1243
+ setDateInFocus: c,
1244
+ onClickDay: d,
1153
1245
  onClickWeek: u,
1154
- currentPanel: o,
1155
- setCurrentPanel: d
1246
+ currentPanel: a,
1247
+ setCurrentPanel: l
1156
1248
  };
1157
- }, Ft = (t) => {
1249
+ }, ye = (t) => {
1158
1250
  if (t)
1159
1251
  return `${t.endYear}-${t.weekNumber}`;
1160
- }, Yt = (t, e) => {
1252
+ }, Zt = (t, e) => {
1161
1253
  if (!t)
1162
1254
  return;
1163
- const r = t.split("-"), n = parseInt(r[1], 10), s = parseInt(r[0], 10), i = /* @__PURE__ */ new Date();
1255
+ const n = t.split("-"), r = parseInt(n[1], 10), s = parseInt(n[0], 10), i = /* @__PURE__ */ new Date();
1164
1256
  i.setFullYear(s);
1165
- const a = re(Oe(i, n), { locale: e });
1166
- return zt(a, e);
1257
+ const c = $t(hn(i, r), { locale: e });
1258
+ return pe(c, e);
1167
1259
  };
1168
- function Yn(t) {
1169
- const e = jr(t);
1170
- return /* @__PURE__ */ c(rt, { ...t, ...e });
1260
+ function Bs(t) {
1261
+ const e = br(t);
1262
+ return /* @__PURE__ */ o(gt, { ...t, ...e });
1171
1263
  }
1172
- const bt = "bottom", De = () => {
1173
- const [t, e] = rr();
1264
+ const Lt = "bottom", We = () => {
1265
+ const [t, e] = An();
1174
1266
  return {
1175
- onChangePanel: g(() => {
1176
- var n, s;
1177
- (s = (n = e.current) == null ? void 0 : n.popperInstance) == null || s.update();
1267
+ onChangePanel: D(() => {
1268
+ var r, s;
1269
+ (s = (r = e.current) == null ? void 0 : r.popperInstance) == null || s.update();
1178
1270
  }, [e]),
1179
1271
  tippyRef: t
1180
1272
  };
1181
- }, _r = (t, e, r) => {
1182
- const [n, s] = S(r || !1), i = g(() => (s(!0), !0), [s]), a = g(() => {
1273
+ }, wr = (t, e, n) => {
1274
+ const [r, s] = T(n || !1), i = D(() => (s(!0), !0), [s]), c = D(() => {
1183
1275
  s(!1), e && e();
1184
- }, [s, e]), o = g(
1185
- (d) => {
1186
- t && t(d), setTimeout(a, 150);
1276
+ }, [s, e]), a = D(
1277
+ (l) => {
1278
+ t && t(l), setTimeout(c, 150);
1187
1279
  },
1188
- [t, a]
1280
+ [t, c]
1189
1281
  );
1190
1282
  return {
1191
1283
  showCalendar: i,
1192
- hideCalendar: a,
1193
- showingCalendar: n,
1194
- onSelectDate: o
1284
+ hideCalendar: c,
1285
+ showingCalendar: r,
1286
+ onSelectDate: a
1195
1287
  };
1196
- }, kt = "2999-12-31", Hn = ({
1197
- displayFormat: t = q.fullDate,
1288
+ }, _t = "2999-12-31", Os = ({
1289
+ displayFormat: t = st.fullDate,
1198
1290
  placeholder: e = "Enter date",
1199
- value: r,
1200
- zIndex: n = 100,
1201
- calendarTheme: s = et,
1291
+ value: n,
1292
+ zIndex: r = 100,
1293
+ calendarTheme: s = mt,
1202
1294
  calendarProps: i,
1203
- openOnMount: a,
1204
- onClose: o,
1205
- onChange: d,
1206
- portalTarget: l,
1295
+ openOnMount: c,
1296
+ onClose: a,
1297
+ onChange: l,
1298
+ portalTarget: d,
1207
1299
  variant: u,
1208
- width: D,
1209
- minDate: f,
1210
- maxDate: h = kt,
1211
- disabled: w
1300
+ width: p,
1301
+ minDate: h,
1302
+ maxDate: f = _t,
1303
+ disabled: g
1212
1304
  }) => {
1213
- const { hideCalendar: M, showingCalendar: b, onSelectDate: y, showCalendar: p } = _r(d, o, a), { tippyRef: m, onChangePanel: k } = De();
1214
- return /* @__PURE__ */ c(x, { width: D, children: /* @__PURE__ */ c(
1215
- pt,
1305
+ const { hideCalendar: M, showingCalendar: y, onSelectDate: b, showCalendar: w } = wr(l, a, c), { tippyRef: m, onChangePanel: k } = We();
1306
+ return /* @__PURE__ */ o(L, { width: p, children: /* @__PURE__ */ o(
1307
+ At,
1216
1308
  {
1217
1309
  arrow: !1,
1218
1310
  lazy: !0,
1219
- visible: b,
1311
+ visible: y,
1220
1312
  onClickOutside: M,
1221
- placement: bt,
1222
- zIndex: n,
1223
- appendTo: l ?? "parent",
1313
+ placement: Lt,
1314
+ zIndex: r,
1315
+ appendTo: d ?? "parent",
1224
1316
  tippyRef: m,
1225
- disabled: w,
1226
- content: /* @__PURE__ */ c(
1227
- he,
1317
+ disabled: g,
1318
+ content: /* @__PURE__ */ o(
1319
+ Ue,
1228
1320
  {
1229
1321
  ...i,
1230
- onChange: y,
1231
- value: r,
1322
+ onChange: b,
1323
+ value: n,
1232
1324
  theme: s,
1233
1325
  onChangePanel: k,
1234
- minDate: f,
1235
- maxDate: h
1326
+ minDate: h,
1327
+ maxDate: f
1236
1328
  }
1237
1329
  ),
1238
- children: /* @__PURE__ */ c(
1239
- tt,
1330
+ children: /* @__PURE__ */ o(
1331
+ ht,
1240
1332
  {
1241
1333
  type: "date",
1242
- onFocus: p,
1243
- buttonRight: /* @__PURE__ */ c(Ae, { onClick: p, icon: gt }),
1244
- value: r ? Y(r, t) : "",
1334
+ onFocus: w,
1335
+ buttonRight: /* @__PURE__ */ o(rn, { onClick: w, icon: kt }),
1336
+ value: n ? W(n, t) : "",
1245
1337
  placeholder: e,
1246
1338
  size: 9,
1247
- disabled: w,
1248
- autoFocus: a,
1339
+ disabled: g,
1340
+ autoFocus: c,
1249
1341
  variant: u,
1250
- min: f,
1251
- max: h
1342
+ min: h,
1343
+ max: f
1252
1344
  }
1253
1345
  )
1254
1346
  }
1255
1347
  ) });
1256
- }, Jr = (t, e) => {
1257
- const r = B(null), n = B(null), [s, i] = S(!1), [a, o] = S(void 0), d = g(() => (o("startDate"), i(!0), !0), [o, i]), l = g(() => (o("endDate"), i(!0), !0), [o, i]), u = g(() => {
1348
+ }, yr = (t, e) => {
1349
+ const n = $(null), r = $(null), [s, i] = T(!1), [c, a] = T(void 0), l = D(() => (a("startDate"), i(!0), !0), [a, i]), d = D(() => (a("endDate"), i(!0), !0), [a, i]), u = D(() => {
1258
1350
  i(!1);
1259
- }, [i]), D = g(
1260
- (h) => {
1261
- a === "startDate" ? (e == null || e({
1262
- startDate: h.date,
1351
+ }, [i]), p = D(
1352
+ (f) => {
1353
+ c === "startDate" ? (e == null || e({
1354
+ startDate: f.date,
1263
1355
  endDate: t == null ? void 0 : t.endDate
1264
- }), t != null && t.endDate ? setTimeout(u, 150) : (o("endDate"), n.current && n.current.focus())) : a === "endDate" && (e == null || e({
1356
+ }), t != null && t.endDate ? setTimeout(u, 150) : (a("endDate"), r.current && r.current.focus())) : c === "endDate" && (e == null || e({
1265
1357
  startDate: t == null ? void 0 : t.startDate,
1266
- endDate: h.date
1267
- }), t != null && t.startDate ? setTimeout(u, 150) : (o("startDate"), r.current && r.current.focus()));
1358
+ endDate: f.date
1359
+ }), t != null && t.startDate ? setTimeout(u, 150) : (a("startDate"), n.current && n.current.focus()));
1268
1360
  },
1269
- [a, e, o, u, t]
1270
- ), f = A(
1271
- () => (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && v(t.startDate, t.endDate),
1361
+ [c, e, a, u, t]
1362
+ ), h = R(
1363
+ () => (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && G(t.startDate, t.endDate),
1272
1364
  [t == null ? void 0 : t.startDate, t == null ? void 0 : t.endDate]
1273
1365
  );
1274
1366
  return {
1275
1367
  showingCalendar: s,
1276
1368
  hideCalendar: u,
1277
- showCalendarEndDate: l,
1278
- showCalendarStartDate: d,
1279
- focusedInput: a,
1280
- setFocusedInput: o,
1281
- startDateInputRef: r,
1282
- endDateInputRef: n,
1283
- onClickDay: D,
1284
- startDateIsAfterEnd: f
1369
+ showCalendarEndDate: d,
1370
+ showCalendarStartDate: l,
1371
+ focusedInput: c,
1372
+ setFocusedInput: a,
1373
+ startDateInputRef: n,
1374
+ endDateInputRef: r,
1375
+ onClickDay: p,
1376
+ startDateIsAfterEnd: h
1285
1377
  };
1286
1378
  };
1287
- function Pn({
1288
- displayFormat: t = q.fullDate,
1379
+ function Hs({
1380
+ displayFormat: t = st.fullDate,
1289
1381
  placeholderStartDate: e = "Start date",
1290
- placeholderEndDate: r = "End date",
1291
- portalTarget: n,
1382
+ placeholderEndDate: n = "End date",
1383
+ portalTarget: r,
1292
1384
  value: s,
1293
1385
  onValueChange: i,
1294
- zIndex: a = 100,
1295
- width: o,
1296
- calendarTheme: d = et,
1297
- calendarProps: l,
1386
+ zIndex: c = 100,
1387
+ width: a,
1388
+ calendarTheme: l = mt,
1389
+ calendarProps: d,
1298
1390
  minDate: u,
1299
- maxDate: D = kt,
1300
- disabled: f
1391
+ maxDate: p = _t,
1392
+ disabled: h
1301
1393
  }) {
1302
- const [h, w] = S("calendar"), {
1394
+ const [f, g] = T("calendar"), {
1303
1395
  hideCalendar: M,
1304
- showCalendarEndDate: b,
1305
- showCalendarStartDate: y,
1306
- showingCalendar: p,
1396
+ showCalendarEndDate: y,
1397
+ showCalendarStartDate: b,
1398
+ showingCalendar: w,
1307
1399
  focusedInput: m,
1308
1400
  startDateInputRef: k,
1309
1401
  endDateInputRef: E,
1310
- onClickDay: N,
1311
- startDateIsAfterEnd: C
1312
- } = Jr(s, i), [H, I] = S(
1402
+ onClickDay: A,
1403
+ startDateIsAfterEnd: N
1404
+ } = yr(s, i), [I, Y] = T(
1313
1405
  () => (m && (s == null ? void 0 : s[m])) ?? /* @__PURE__ */ new Date()
1314
- ), O = A(
1315
- () => wt(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate),
1406
+ ), S = R(
1407
+ () => It(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate),
1316
1408
  [s]
1317
1409
  );
1318
- return /* @__PURE__ */ c(
1319
- pt,
1410
+ return /* @__PURE__ */ o(
1411
+ At,
1320
1412
  {
1321
1413
  arrow: !1,
1322
1414
  lazy: !0,
1323
- disabled: f,
1324
- visible: p,
1325
- zIndex: a,
1326
- placement: bt,
1327
- appendTo: n ?? "parent",
1415
+ disabled: h,
1416
+ visible: w,
1417
+ zIndex: c,
1418
+ placement: Lt,
1419
+ appendTo: r ?? "parent",
1328
1420
  onClickOutside: M,
1329
- content: /* @__PURE__ */ c(
1330
- rt,
1421
+ content: /* @__PURE__ */ o(
1422
+ gt,
1331
1423
  {
1332
- ...l,
1333
- dateInFocus: H,
1334
- setDateInFocus: I,
1335
- statePerMonth: O,
1336
- theme: d,
1337
- onClickDay: N,
1338
- currentPanel: h,
1339
- setCurrentPanel: w,
1424
+ ...d,
1425
+ dateInFocus: I,
1426
+ setDateInFocus: Y,
1427
+ statePerMonth: S,
1428
+ theme: l,
1429
+ onClickDay: A,
1430
+ currentPanel: f,
1431
+ setCurrentPanel: g,
1340
1432
  minDate: u,
1341
- maxDate: D
1433
+ maxDate: p
1342
1434
  }
1343
1435
  ),
1344
- children: /* @__PURE__ */ T(R, { alignItems: "center", children: [
1345
- /* @__PURE__ */ c(
1346
- tt,
1436
+ children: /* @__PURE__ */ x(B, { alignItems: "center", children: [
1437
+ /* @__PURE__ */ o(
1438
+ ht,
1347
1439
  {
1348
- iconLeft: gt,
1349
- onFocus: y,
1350
- value: s != null && s.startDate ? Y(s.startDate, t) : "",
1440
+ iconLeft: kt,
1441
+ onFocus: b,
1442
+ value: s != null && s.startDate ? W(s.startDate, t) : "",
1351
1443
  placeholder: e,
1352
- width: o,
1353
- disabled: f,
1444
+ width: a,
1445
+ disabled: h,
1354
1446
  inputRef: k,
1355
1447
  size: 9,
1356
- variant: C ? "error" : void 0
1448
+ variant: N ? "error" : void 0
1357
1449
  }
1358
1450
  ),
1359
- /* @__PURE__ */ c(ct, {}),
1360
- /* @__PURE__ */ c(
1361
- Zt,
1451
+ /* @__PURE__ */ o(Dt, {}),
1452
+ /* @__PURE__ */ o(
1453
+ Te,
1362
1454
  {
1363
- icon: xe,
1364
- color: ce("--lhds-color-ui-500"),
1455
+ icon: sn,
1456
+ color: Ct("--lhds-color-ui-500"),
1365
1457
  size: 14
1366
1458
  }
1367
1459
  ),
1368
- /* @__PURE__ */ c(ct, {}),
1369
- /* @__PURE__ */ c(
1370
- tt,
1460
+ /* @__PURE__ */ o(Dt, {}),
1461
+ /* @__PURE__ */ o(
1462
+ ht,
1371
1463
  {
1372
- iconLeft: gt,
1373
- onFocus: b,
1374
- value: s != null && s.endDate ? Y(s.endDate, t) : "",
1375
- placeholder: r,
1376
- width: o,
1377
- disabled: f,
1464
+ iconLeft: kt,
1465
+ onFocus: y,
1466
+ value: s != null && s.endDate ? W(s.endDate, t) : "",
1467
+ placeholder: n,
1468
+ width: a,
1469
+ disabled: h,
1378
1470
  inputRef: E,
1379
1471
  size: 9,
1380
- variant: C ? "error" : void 0
1472
+ variant: N ? "error" : void 0
1381
1473
  }
1382
1474
  )
1383
1475
  ] })
1384
1476
  }
1385
1477
  );
1386
1478
  }
1387
- const Un = ({
1479
+ const $s = ({
1388
1480
  calendarProps: t,
1389
1481
  closeOnCalendarSelectDate: e = !0,
1390
- dateFormat: r = q.fullDate,
1391
- disableCalender: n = !1,
1482
+ dateFormat: n = st.fullDate,
1483
+ disableCalender: r = !1,
1392
1484
  onValueChange: s,
1393
1485
  placeholder: i = "yyyy-mm-dd",
1394
- portalTarget: a,
1395
- value: o,
1396
- width: d = "130px",
1397
- zIndex: l = 100,
1398
- calendarTheme: u = et,
1399
- hideCalenderIcon: D = !1,
1400
- minDate: f,
1401
- maxDate: h = kt,
1402
- variant: w,
1486
+ portalTarget: c,
1487
+ value: a,
1488
+ width: l = "130px",
1489
+ zIndex: d = 100,
1490
+ calendarTheme: u = mt,
1491
+ hideCalenderIcon: p = !1,
1492
+ minDate: h,
1493
+ maxDate: f = _t,
1494
+ variant: g,
1403
1495
  ...M
1404
1496
  }) => {
1405
- const [b, y] = S(!1), { tippyRef: p, onChangePanel: m } = De(), k = g(() => {
1406
- y(!b);
1407
- }, [y, b]), E = g(() => {
1408
- y(!1);
1409
- }, [y]), N = g(
1410
- (P) => {
1411
- s && s(P);
1497
+ const [y, b] = T(!1), { tippyRef: w, onChangePanel: m } = We(), k = D(() => {
1498
+ b(!y);
1499
+ }, [b, y]), E = D(() => {
1500
+ b(!1);
1501
+ }, [b]), A = D(
1502
+ (U) => {
1503
+ s && s(U);
1412
1504
  },
1413
1505
  [s]
1414
- ), C = g(
1415
- (P) => {
1416
- P && (N(Y(P, r)), e && setTimeout(() => y(!b), 200));
1506
+ ), N = D(
1507
+ (U) => {
1508
+ U && (A(W(U, n)), e && setTimeout(() => b(!y), 200));
1417
1509
  },
1418
- [N, r, e, y, b]
1419
- ), H = !!o && !/^[-/\\.0-9]+$/.test(o), I = !!o && Be(V(o, r, /* @__PURE__ */ new Date())), Q = !!o && o.length >= r.length && !I || H;
1420
- return /* @__PURE__ */ c(x, { width: d, children: /* @__PURE__ */ c(
1421
- pt,
1510
+ [A, n, e, b, y]
1511
+ ), I = !!a && !/^[-/\\.0-9]+$/.test(a), Y = !!a && pn(ft(a, n, /* @__PURE__ */ new Date())), v = !!a && a.length >= n.length && !Y || I;
1512
+ return /* @__PURE__ */ o(L, { width: l, children: /* @__PURE__ */ o(
1513
+ At,
1422
1514
  {
1423
1515
  arrow: !1,
1424
1516
  lazy: !0,
1425
- visible: b,
1426
- zIndex: l,
1427
- appendTo: a ?? "parent",
1428
- placement: bt,
1517
+ visible: y,
1518
+ zIndex: d,
1519
+ appendTo: c ?? "parent",
1520
+ placement: Lt,
1429
1521
  onClickOutside: E,
1430
- tippyRef: p,
1431
- content: /* @__PURE__ */ c(
1432
- he,
1522
+ tippyRef: w,
1523
+ content: /* @__PURE__ */ o(
1524
+ Ue,
1433
1525
  {
1434
1526
  ...t,
1435
- onChange: C,
1527
+ onChange: N,
1436
1528
  onChangePanel: m,
1437
- value: o && I ? V(o, r, /* @__PURE__ */ new Date()) : void 0,
1438
- minDate: f,
1439
- maxDate: h,
1529
+ value: a && Y ? ft(a, n, /* @__PURE__ */ new Date()) : void 0,
1530
+ minDate: h,
1531
+ maxDate: f,
1440
1532
  theme: u
1441
1533
  }
1442
1534
  ),
1443
- children: /* @__PURE__ */ c(
1444
- tt,
1535
+ children: /* @__PURE__ */ o(
1536
+ ht,
1445
1537
  {
1446
1538
  ...M,
1447
- variant: Q ? "error" : w,
1539
+ variant: v ? "error" : g,
1448
1540
  disableContentPaddingRight: !0,
1449
- contentRight: D ? void 0 : /* @__PURE__ */ c(R, { alignItems: "center", indent: 0.5, children: /* @__PURE__ */ c(
1450
- W,
1541
+ contentRight: p ? void 0 : /* @__PURE__ */ o(B, { alignItems: "center", indent: 0.5, children: /* @__PURE__ */ o(
1542
+ q,
1451
1543
  {
1452
1544
  size: "small",
1453
- disabled: M.disabled || n,
1454
- leftIcon: gt,
1545
+ disabled: M.disabled || r,
1546
+ leftIcon: kt,
1455
1547
  onClick: k
1456
1548
  }
1457
1549
  ) }),
1458
- onValueChange: N,
1550
+ onValueChange: A,
1459
1551
  placeholder: i,
1460
- value: o || "",
1461
- min: f,
1462
- max: h,
1552
+ value: a || "",
1553
+ min: h,
1554
+ max: f,
1463
1555
  size: 10
1464
1556
  }
1465
1557
  )
1466
1558
  }
1467
1559
  ) });
1468
- }, Rt = (t) => {
1560
+ }, Ut = (t) => {
1469
1561
  if (t === "")
1470
1562
  return "00";
1471
1563
  const e = parseInt(t, 10);
@@ -1481,7 +1573,7 @@ const Un = ({
1481
1573
  default:
1482
1574
  throw new Error("Invalid hour string");
1483
1575
  }
1484
- }, At = (t) => {
1576
+ }, Wt = (t) => {
1485
1577
  if (t === "")
1486
1578
  return "00";
1487
1579
  const e = parseInt(t, 10);
@@ -1497,19 +1589,19 @@ const Un = ({
1497
1589
  default:
1498
1590
  throw new Error("Invalid minute string");
1499
1591
  }
1500
- }, Kr = (t) => {
1501
- if (!$t(t))
1592
+ }, Mr = (t) => {
1593
+ if (!ie(t))
1502
1594
  return { time: t, success: !1 };
1503
1595
  const e = t && t.split(/-|:|,|;|[/]|[.]| /);
1504
1596
  if (e && e.length === 2)
1505
1597
  try {
1506
- const r = Rt(e[0]), n = At(e[1]);
1507
- return { time: `${r}:${n}`, success: !0 };
1598
+ const n = Ut(e[0]), r = Wt(e[1]);
1599
+ return { time: `${n}:${r}`, success: !0 };
1508
1600
  } catch {
1509
1601
  return { time: t, success: !1 };
1510
1602
  }
1511
1603
  else if (e && e.length === 1) {
1512
- let r = 0, n = 0;
1604
+ let n = 0, r = 0;
1513
1605
  switch (t.length) {
1514
1606
  case 1:
1515
1607
  return { time: `0${t}:00`, success: !0 };
@@ -1518,12 +1610,12 @@ const Un = ({
1518
1610
  return s >= 0 && s < 24 ? { time: `${t}:00`, success: !0 } : s >= 24 && s < 59 ? { time: `00:${t}`, success: !0 } : { time: t, success: !1 };
1519
1611
  }
1520
1612
  case 3:
1521
- return n = parseInt(t.substring(1, 3), 10), n >= 0 && n <= 59 ? {
1613
+ return r = parseInt(t.substring(1, 3), 10), r >= 0 && r <= 59 ? {
1522
1614
  time: `0${t.substring(0, 1)}:${t.substring(1, 3)}`,
1523
1615
  success: !0
1524
1616
  } : { time: t, success: !1 };
1525
1617
  case 4:
1526
- return r = parseInt(t.substring(0, 2), 10), n = parseInt(t.substring(2, 4), 10), r < 0 || r > 23 ? { time: t, success: !1 } : n < 0 || n > 59 ? { time: t, success: !1 } : {
1618
+ return n = parseInt(t.substring(0, 2), 10), r = parseInt(t.substring(2, 4), 10), n < 0 || n > 23 ? { time: t, success: !1 } : r < 0 || r > 59 ? { time: t, success: !1 } : {
1527
1619
  time: `${t.substring(0, 2)}:${t.substring(2, 4)}`,
1528
1620
  success: !0
1529
1621
  };
@@ -1532,192 +1624,192 @@ const Un = ({
1532
1624
  }
1533
1625
  }
1534
1626
  return { time: t, success: !1 };
1535
- }, $t = (t) => t ? /^[-:.,/; 0-9]+$/.test(t) : !0, $n = ({
1627
+ }, ie = (t) => t ? /^[-:.,/; 0-9]+$/.test(t) : !0, Us = ({
1536
1628
  onValueChange: t,
1537
1629
  showPlaceholder: e = !0,
1538
- useIcon: r = !0,
1539
- value: n,
1630
+ useIcon: n = !0,
1631
+ value: r,
1540
1632
  width: s = "85px",
1541
1633
  variant: i,
1542
- ...a
1634
+ ...c
1543
1635
  }) => {
1544
- const [o, d] = S(() => $t(n)), l = "hh:mm", u = g(() => {
1545
- if (n) {
1546
- const f = Kr(n);
1547
- d(f.success), f.success && t && t(f.time);
1636
+ const [a, l] = T(() => ie(r)), d = "hh:mm", u = D(() => {
1637
+ if (r) {
1638
+ const h = Mr(r);
1639
+ l(h.success), h.success && t && t(h.time);
1548
1640
  }
1549
- }, [n, t, d]), D = g(
1550
- (f) => {
1551
- const h = f.target.value, w = $t(h);
1552
- d(w && h.length <= l.length), t && t(h);
1641
+ }, [r, t, l]), p = D(
1642
+ (h) => {
1643
+ const f = h.target.value, g = ie(f);
1644
+ l(g && f.length <= d.length), t && t(f);
1553
1645
  },
1554
- [t, d]
1646
+ [t, l]
1555
1647
  );
1556
- return /* @__PURE__ */ c(
1557
- tt,
1648
+ return /* @__PURE__ */ o(
1649
+ ht,
1558
1650
  {
1559
- ...a,
1651
+ ...c,
1560
1652
  type: "time",
1561
- variant: o ? i : "error",
1562
- iconLeft: r ? vt : void 0,
1563
- value: n,
1564
- placeholder: e ? l : void 0,
1565
- onChange: D,
1653
+ variant: a ? i : "error",
1654
+ iconLeft: n ? Ie : void 0,
1655
+ value: r,
1656
+ placeholder: e ? d : void 0,
1657
+ onChange: p,
1566
1658
  onBlur: u,
1567
1659
  width: s
1568
1660
  }
1569
1661
  );
1570
- }, ge = ({
1662
+ }, ve = ({
1571
1663
  autoFocusLeft: t,
1572
1664
  autoFocusRight: e,
1573
- onEsc: r,
1574
- onEnter: n,
1665
+ onEsc: n,
1666
+ onEnter: r,
1575
1667
  onValueChangeLeft: s,
1576
1668
  onValueChangeRight: i,
1577
- separatorIcon: a,
1578
- placeholderLeft: o,
1579
- placeholderRight: d,
1580
- typeLeft: l,
1669
+ separatorIcon: c,
1670
+ placeholderLeft: a,
1671
+ placeholderRight: l,
1672
+ typeLeft: d,
1581
1673
  typeRight: u,
1582
- onChangeLeft: D,
1583
- onChangeRight: f,
1584
- valueLeft: h,
1585
- valueRight: w,
1674
+ onChangeLeft: p,
1675
+ onChangeRight: h,
1676
+ valueLeft: f,
1677
+ valueRight: g,
1586
1678
  minLeft: M,
1587
- maxLeft: b,
1588
- minRight: y,
1589
- maxRight: p,
1679
+ maxLeft: y,
1680
+ minRight: b,
1681
+ maxRight: w,
1590
1682
  onClickLeft: m,
1591
1683
  onClickRight: k,
1592
1684
  onClickCalendar: E,
1593
- onClickArrowDown: N,
1594
- onBlurLeft: C,
1595
- onBlurRight: H,
1596
- onFocusLeft: I,
1597
- onFocusRight: O,
1598
- inputRefLeft: Q,
1599
- inputRefRight: P,
1600
- variant: nt,
1601
- variantLeft: at,
1602
- variantRight: st,
1603
- onBlur: z,
1604
- showPresets: dt,
1605
- widthLeft: lt,
1606
- widthRight: ut,
1607
- disabled: X
1685
+ onClickArrowDown: A,
1686
+ onBlurLeft: N,
1687
+ onBlurRight: I,
1688
+ onFocusLeft: Y,
1689
+ onFocusRight: S,
1690
+ inputRefLeft: v,
1691
+ inputRefRight: U,
1692
+ variant: K,
1693
+ variantLeft: j,
1694
+ variantRight: Z,
1695
+ onBlur: F,
1696
+ showPresets: Q,
1697
+ widthLeft: tt,
1698
+ widthRight: _,
1699
+ disabled: O
1608
1700
  }) => {
1609
- const L = B(0), U = A(
1610
- () => Ze((j) => {
1611
- j === 0 && (z == null || z());
1701
+ const H = $(0), z = R(
1702
+ () => In((et) => {
1703
+ et === 0 && (F == null || F());
1612
1704
  }, 10),
1613
- [z]
1614
- ), St = g(
1615
- (j) => {
1616
- L.current++, U(L.current), I && I(j);
1705
+ [F]
1706
+ ), Pt = D(
1707
+ (et) => {
1708
+ H.current++, z(H.current), Y && Y(et);
1617
1709
  },
1618
- [I, L, U]
1619
- ), Mt = g(
1620
- (j) => {
1621
- L.current++, U(L.current), O && O(j);
1710
+ [Y, H, z]
1711
+ ), Yt = D(
1712
+ (et) => {
1713
+ H.current++, z(H.current), S && S(et);
1622
1714
  },
1623
- [O, L, U]
1624
- ), Tt = g(
1625
- (j) => {
1626
- L.current--, U(L.current), C && C(j);
1715
+ [S, H, z]
1716
+ ), Bt = D(
1717
+ (et) => {
1718
+ H.current--, z(H.current), N && N(et);
1627
1719
  },
1628
- [C, L, U]
1629
- ), pe = g(
1630
- (j) => {
1631
- L.current--, U(L.current), H && H(j);
1720
+ [N, H, z]
1721
+ ), Qe = D(
1722
+ (et) => {
1723
+ H.current--, z(H.current), I && I(et);
1632
1724
  },
1633
- [H, L, U]
1725
+ [I, H, z]
1634
1726
  );
1635
- return /* @__PURE__ */ c(x, { children: /* @__PURE__ */ T(
1636
- er,
1727
+ return /* @__PURE__ */ o(L, { children: /* @__PURE__ */ x(
1728
+ En,
1637
1729
  {
1638
1730
  disableContentPaddingRight: !0,
1639
- disabled: X,
1640
- variant: nt,
1641
- contentRight: /* @__PURE__ */ T(R, { alignItems: "center", children: [
1642
- /* @__PURE__ */ c(Dt, { num: 0.5, children: /* @__PURE__ */ c(
1643
- W,
1731
+ disabled: O,
1732
+ variant: K,
1733
+ contentRight: /* @__PURE__ */ x(B, { alignItems: "center", children: [
1734
+ /* @__PURE__ */ o(Mt, { num: 0.5, children: /* @__PURE__ */ o(
1735
+ q,
1644
1736
  {
1645
- leftIcon: gt,
1737
+ leftIcon: kt,
1646
1738
  onClick: E,
1647
- disabled: X,
1739
+ disabled: O,
1648
1740
  size: "small"
1649
1741
  }
1650
1742
  ) }),
1651
- dt ? /* @__PURE__ */ T(ht, { children: [
1652
- /* @__PURE__ */ c(R, { height: "22px", children: /* @__PURE__ */ c(Se, { vertical: !0 }) }),
1653
- /* @__PURE__ */ c(Dt, { num: 0.5, children: /* @__PURE__ */ c(
1654
- W,
1743
+ Q ? /* @__PURE__ */ x(Ht, { children: [
1744
+ /* @__PURE__ */ o(B, { height: "22px", children: /* @__PURE__ */ o(Ze, { vertical: !0 }) }),
1745
+ /* @__PURE__ */ o(Mt, { num: 0.5, children: /* @__PURE__ */ o(
1746
+ q,
1655
1747
  {
1656
- leftIcon: Xt,
1657
- onClick: N,
1658
- disabled: X,
1748
+ leftIcon: ae,
1749
+ onClick: A,
1750
+ disabled: O,
1659
1751
  size: "small"
1660
1752
  }
1661
1753
  ) })
1662
1754
  ] }) : null
1663
1755
  ] }),
1664
1756
  children: [
1665
- /* @__PURE__ */ c(x, { width: lt, children: /* @__PURE__ */ c(
1666
- tt,
1757
+ /* @__PURE__ */ o(L, { width: tt, children: /* @__PURE__ */ o(
1758
+ ht,
1667
1759
  {
1668
- onEsc: r,
1669
- onEnter: n,
1760
+ onEsc: n,
1761
+ onEnter: r,
1670
1762
  onClick: m,
1671
- disabled: X,
1763
+ disabled: O,
1672
1764
  hideBorder: !0,
1673
- placeholder: o,
1674
- value: h,
1765
+ placeholder: a,
1766
+ value: f,
1675
1767
  onValueChange: s,
1676
- onChange: D,
1677
- onBlur: Tt,
1678
- onFocus: St,
1679
- inputRef: Q,
1680
- variant: at,
1681
- type: l,
1768
+ onChange: p,
1769
+ onBlur: Bt,
1770
+ onFocus: Pt,
1771
+ inputRef: v,
1772
+ variant: j,
1773
+ type: d,
1682
1774
  autoFocus: t,
1683
1775
  min: M,
1684
- max: b
1776
+ max: y
1685
1777
  }
1686
1778
  ) }),
1687
- /* @__PURE__ */ c(R, { indent: 0.5, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ c(
1688
- Zt,
1779
+ /* @__PURE__ */ o(B, { indent: 0.5, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ o(
1780
+ Te,
1689
1781
  {
1690
- icon: a,
1782
+ icon: c,
1691
1783
  size: 12,
1692
- color: ce("--lhds-color-ui-500")
1784
+ color: Ct("--lhds-color-ui-500")
1693
1785
  }
1694
1786
  ) }),
1695
- /* @__PURE__ */ c(x, { width: ut, children: /* @__PURE__ */ c(
1696
- tt,
1787
+ /* @__PURE__ */ o(L, { width: _, children: /* @__PURE__ */ o(
1788
+ ht,
1697
1789
  {
1698
- onEsc: r,
1699
- onEnter: n,
1790
+ onEsc: n,
1791
+ onEnter: r,
1700
1792
  onClick: k,
1701
- disabled: X,
1793
+ disabled: O,
1702
1794
  hideBorder: !0,
1703
- placeholder: d,
1704
- value: w,
1795
+ placeholder: l,
1796
+ value: g,
1705
1797
  onValueChange: i,
1706
- onChange: f,
1707
- onBlur: pe,
1708
- onFocus: Mt,
1709
- inputRef: P,
1710
- variant: st,
1798
+ onChange: h,
1799
+ onBlur: Qe,
1800
+ onFocus: Yt,
1801
+ inputRef: U,
1802
+ variant: Z,
1711
1803
  type: u,
1712
1804
  autoFocus: e,
1713
- min: y,
1714
- max: p
1805
+ min: b,
1806
+ max: w
1715
1807
  }
1716
1808
  ) })
1717
1809
  ]
1718
1810
  }
1719
1811
  ) });
1720
- }, Gr = (t) => {
1812
+ }, kr = (t) => {
1721
1813
  if (t == null)
1722
1814
  throw new Error("Time is not set.");
1723
1815
  if (t === "")
@@ -1729,71 +1821,71 @@ const Un = ({
1729
1821
  throw new Error("Invalid time.");
1730
1822
  if (e[0].length < 1 || e[0].length > 2)
1731
1823
  throw new Error("Invalid time.");
1732
- const r = parseInt(e[0], 10), n = parseInt(e[1], 10);
1733
- if (isNaN(r))
1734
- throw new Error("Invalid time.");
1824
+ const n = parseInt(e[0], 10), r = parseInt(e[1], 10);
1735
1825
  if (isNaN(n))
1736
1826
  throw new Error("Invalid time.");
1737
- if (r < 0 || r > 23)
1827
+ if (isNaN(r))
1828
+ throw new Error("Invalid time.");
1829
+ if (n < 0 || n > 23)
1738
1830
  throw new Error("Invalid time.");
1739
- if (n < 0 || n > 59)
1831
+ if (r < 0 || r > 59)
1740
1832
  throw new Error("Invalid time.");
1741
- return r * 100 + n;
1742
- }, Fr = (t) => {
1833
+ return n * 100 + r;
1834
+ }, Sr = (t) => {
1743
1835
  try {
1744
- return Gr(t), !0;
1836
+ return kr(t), !0;
1745
1837
  } catch {
1746
1838
  return !1;
1747
1839
  }
1748
- }, Et = (t) => {
1749
- if (t && Fr(t)) {
1840
+ }, Ot = (t) => {
1841
+ if (t && Sr(t)) {
1750
1842
  const e = t.split(":");
1751
1843
  return {
1752
- hour: jt(e[0]),
1753
- minute: jt(e[1])
1844
+ hour: ge(e[0]),
1845
+ minute: ge(e[1])
1754
1846
  };
1755
1847
  }
1756
1848
  return {
1757
1849
  hour: void 0,
1758
1850
  minute: void 0
1759
1851
  };
1760
- }, qr = (t) => `${Rt(String(t.getHours()))}:${At(
1852
+ }, Tr = (t) => `${Ut(String(t.getHours()))}:${Wt(
1761
1853
  String(t.getMinutes())
1762
- )}`, Qr = "_timePicker_1w05d_1", Xr = "_timePickerColumn_1w05d_6", me = {
1763
- timePicker: Qr,
1764
- timePickerColumn: Xr
1765
- }, Zr = ({
1854
+ )}`, Ir = "_timePicker_1w05d_1", Rr = "_timePickerColumn_1w05d_6", ze = {
1855
+ timePicker: Ir,
1856
+ timePickerColumn: Rr
1857
+ }, Er = ({
1766
1858
  onClick: t,
1767
1859
  item: e,
1768
- selected: r,
1769
- columnRef: n,
1860
+ selected: n,
1861
+ columnRef: r,
1770
1862
  canScrollRef: s
1771
1863
  }) => {
1772
- const i = B(null);
1773
- return J(
1864
+ const i = $(null);
1865
+ return X(
1774
1866
  function() {
1775
- if (r && n.current && i.current && s.current) {
1776
- const o = i.current.scrollHeight * Math.max(e - 2, 0);
1777
- n.current.scrollTo(0, o), s.current = !1;
1867
+ if (n && r.current && i.current && s.current) {
1868
+ const a = i.current.scrollHeight * Math.max(e - 2, 0);
1869
+ r.current.scrollTo(0, a), s.current = !1;
1778
1870
  }
1779
1871
  },
1780
- [n, e, r, s]
1781
- ), /* @__PURE__ */ c(
1782
- R,
1872
+ [r, e, n, s]
1873
+ ), /* @__PURE__ */ o(
1874
+ B,
1783
1875
  {
1784
1876
  width: "64px",
1785
1877
  justifyContent: "center",
1786
1878
  spacing: 0.5,
1787
1879
  indent: 0.5,
1788
1880
  ref: i,
1789
- children: r ? /* @__PURE__ */ c(
1790
- ot,
1881
+ children: n ? /* @__PURE__ */ o(
1882
+ bt,
1791
1883
  {
1792
- label: ve(String(e), 2, "0"),
1884
+ label: Rn(String(e), 2, "0"),
1793
1885
  onClick: () => t && t(e)
1794
1886
  }
1795
- ) : /* @__PURE__ */ c(
1796
- W,
1887
+ ) : /* @__PURE__ */ o(
1888
+ q,
1797
1889
  {
1798
1890
  label: String(e).padStart(2, "0"),
1799
1891
  onClick: () => t && t(e)
@@ -1801,411 +1893,411 @@ const Un = ({
1801
1893
  )
1802
1894
  }
1803
1895
  );
1804
- }, qt = ({
1896
+ }, Me = ({
1805
1897
  onClick: t,
1806
1898
  items: e,
1807
- selectedItem: r,
1808
- canScrollRef: n
1899
+ selectedItem: n,
1900
+ canScrollRef: r
1809
1901
  }) => {
1810
- const s = B(null);
1811
- return /* @__PURE__ */ c($, { className: me.timePickerColumn, ref: s, children: e.map((i) => /* @__PURE__ */ c(
1812
- Zr,
1902
+ const s = $(null);
1903
+ return /* @__PURE__ */ o(C, { className: ze.timePickerColumn, ref: s, children: e.map((i) => /* @__PURE__ */ o(
1904
+ Er,
1813
1905
  {
1814
1906
  item: i,
1815
1907
  onClick: t,
1816
- selected: i === r,
1908
+ selected: i === n,
1817
1909
  columnRef: s,
1818
- canScrollRef: n
1910
+ canScrollRef: r
1819
1911
  },
1820
1912
  i
1821
1913
  )) });
1822
- }, vr = Bt(0, 24), Vr = Bt(0, 60), tn = ({
1914
+ }, xr = ue(0, 24), Ar = ue(0, 60), Nr = ({
1823
1915
  value: t,
1824
1916
  onValueChange: e
1825
1917
  }) => {
1826
- const r = B(!0), [n, s] = S(void 0), [i, a] = S(void 0);
1827
- J(() => {
1918
+ const n = $(!0), [r, s] = T(void 0), [i, c] = T(void 0);
1919
+ X(() => {
1828
1920
  if (t) {
1829
- const { minute: l, hour: u } = Et(t);
1830
- s(u), a(l);
1921
+ const { minute: d, hour: u } = Ot(t);
1922
+ s(u), c(d);
1831
1923
  }
1832
1924
  }, [t]);
1833
- const o = g(
1834
- (l) => {
1835
- s(l), e == null || e(
1836
- `${Rt(String(l ?? 0))}:${At(String(i ?? 0))}`
1925
+ const a = D(
1926
+ (d) => {
1927
+ s(d), e == null || e(
1928
+ `${Ut(String(d ?? 0))}:${Wt(String(i ?? 0))}`
1837
1929
  );
1838
1930
  },
1839
1931
  [i, e]
1840
- ), d = g(
1841
- (l) => {
1842
- a(l), e == null || e(
1843
- `${Rt(String(n ?? 0))}:${At(String(l ?? 0))}`
1932
+ ), l = D(
1933
+ (d) => {
1934
+ c(d), e == null || e(
1935
+ `${Ut(String(r ?? 0))}:${Wt(String(d ?? 0))}`
1844
1936
  );
1845
1937
  },
1846
- [n, e]
1938
+ [r, e]
1847
1939
  );
1848
- return /* @__PURE__ */ T(R, { className: me.timePicker, children: [
1849
- /* @__PURE__ */ c(
1850
- qt,
1940
+ return /* @__PURE__ */ x(B, { className: ze.timePicker, children: [
1941
+ /* @__PURE__ */ o(
1942
+ Me,
1851
1943
  {
1852
- items: vr,
1853
- onClick: o,
1854
- selectedItem: n,
1855
- canScrollRef: r
1944
+ items: xr,
1945
+ onClick: a,
1946
+ selectedItem: r,
1947
+ canScrollRef: n
1856
1948
  }
1857
1949
  ),
1858
- /* @__PURE__ */ c(Dt, {}),
1859
- /* @__PURE__ */ c(
1860
- qt,
1950
+ /* @__PURE__ */ o(Mt, {}),
1951
+ /* @__PURE__ */ o(
1952
+ Me,
1861
1953
  {
1862
- items: Vr,
1863
- onClick: d,
1954
+ items: Ar,
1955
+ onClick: l,
1864
1956
  selectedItem: i,
1865
- canScrollRef: r
1957
+ canScrollRef: n
1866
1958
  }
1867
1959
  )
1868
1960
  ] });
1869
- }, en = (t, e, r) => {
1870
- J(
1961
+ }, Lr = (t, e, n) => {
1962
+ X(
1871
1963
  function() {
1872
1964
  t && e(t);
1873
1965
  },
1874
1966
  [t, e]
1875
- ), J(
1967
+ ), X(
1876
1968
  function() {
1877
- r.current && (t ? r.current.valueAsDate = new Date(
1969
+ n.current && (t ? n.current.valueAsDate = new Date(
1878
1970
  Date.UTC(t.getFullYear(), t.getMonth(), t.getDate())
1879
- ) : r.current.valueAsDate = null);
1971
+ ) : n.current.valueAsDate = null);
1880
1972
  },
1881
- [t, r]
1973
+ [t, n]
1882
1974
  );
1883
- }, rn = (t, e, {
1884
- setDateInFocus: r,
1885
- showCalendarInternal: n,
1975
+ }, _r = (t, e, {
1976
+ setDateInFocus: n,
1977
+ showCalendarInternal: r,
1886
1978
  hideCalendarInternal: s,
1887
1979
  setFirstFocusedInput: i,
1888
- setCurrentPanel: a,
1889
- localTime: o,
1890
- setLocalTime: d,
1891
- localDate: l,
1980
+ setCurrentPanel: c,
1981
+ localTime: a,
1982
+ setLocalTime: l,
1983
+ localDate: d,
1892
1984
  setLocalDate: u
1893
- }, D) => {
1894
- const f = g(
1895
- (p) => {
1896
- if (!p)
1985
+ }, p) => {
1986
+ const h = D(
1987
+ (w) => {
1988
+ if (!w)
1897
1989
  return;
1898
- const m = new Date(p);
1990
+ const m = new Date(w);
1899
1991
  if (t)
1900
1992
  m.setHours(t.getHours()), m.setMinutes(t.getMinutes()), e == null || e(m), u(void 0);
1901
- else if (o) {
1902
- const { minute: k, hour: E } = Et(o);
1993
+ else if (a) {
1994
+ const { minute: k, hour: E } = Ot(a);
1903
1995
  m.setHours(E ?? 0), m.setMinutes(k ?? 0), e == null || e(m), u(void 0);
1904
1996
  } else
1905
1997
  u(m);
1906
- r(m), D.current && (D.current.valueAsDate = new Date(
1998
+ n(m), p.current && (p.current.valueAsDate = new Date(
1907
1999
  Date.UTC(m.getFullYear(), m.getMonth(), m.getDate())
1908
2000
  ));
1909
2001
  },
1910
- [t, D, o, e, r, u]
1911
- ), h = g(
1912
- (p) => {
1913
- if (p)
2002
+ [t, p, a, e, n, u]
2003
+ ), f = D(
2004
+ (w) => {
2005
+ if (w)
1914
2006
  if (t) {
1915
- const m = Et(p), k = new Date(t);
1916
- k.setHours(m.hour || 0), k.setMinutes(m.minute || 0), e == null || e(k), d(void 0);
1917
- } else if (l) {
1918
- const m = Et(p), k = new Date(l);
1919
- k.setHours(m.hour || 0), k.setMinutes(m.minute || 0), e == null || e(k), d(void 0);
2007
+ const m = Ot(w), k = new Date(t);
2008
+ k.setHours(m.hour || 0), k.setMinutes(m.minute || 0), e == null || e(k), l(void 0);
2009
+ } else if (d) {
2010
+ const m = Ot(w), k = new Date(d);
2011
+ k.setHours(m.hour || 0), k.setMinutes(m.minute || 0), e == null || e(k), l(void 0);
1920
2012
  } else
1921
- d(p);
2013
+ l(w);
1922
2014
  },
1923
- [e, t, l, d]
1924
- ), w = g(
1925
- (p) => {
1926
- p.target.value[0] !== "0" && f(p.target.valueAsDate);
2015
+ [e, t, d, l]
2016
+ ), g = D(
2017
+ (w) => {
2018
+ w.target.value[0] !== "0" && h(w.target.valueAsDate);
1927
2019
  },
1928
- [f]
1929
- ), M = g(
1930
- (p) => h(p.target.value),
1931
2020
  [h]
1932
- ), b = g(() => {
1933
- r(t || /* @__PURE__ */ new Date()), a("calendar"), n();
1934
- }, [t, a, n, r]), y = g(() => {
2021
+ ), M = D(
2022
+ (w) => f(w.target.value),
2023
+ [f]
2024
+ ), y = D(() => {
2025
+ n(t || /* @__PURE__ */ new Date()), c("calendar"), r();
2026
+ }, [t, c, r, n]), b = D(() => {
1935
2027
  i(void 0), s();
1936
2028
  }, [i, s]);
1937
2029
  return {
1938
- inputLeftChangeHandler: w,
2030
+ inputLeftChangeHandler: g,
1939
2031
  inputRightChangeHandler: M,
1940
- hideCalendar: y,
1941
- showCalendar: b,
1942
- onChangeTime: h,
1943
- onChangeDate: f
2032
+ hideCalendar: b,
2033
+ showCalendar: y,
2034
+ onChangeTime: f,
2035
+ onChangeDate: h
1944
2036
  };
1945
- }, nn = (t) => {
1946
- const [e, r] = S(void 0), [n, s] = S(void 0), [i, a, o] = Ht(!1), [d, l, u] = Ht(!1), [D, f] = S(void 0), [h, w] = S(
2037
+ }, Pr = (t) => {
2038
+ const [e, n] = T(void 0), [r, s] = T(void 0), [i, c, a] = ne(!1), [l, d, u] = ne(!1), [p, h] = T(void 0), [f, g] = T(
1947
2039
  () => t ?? /* @__PURE__ */ new Date()
1948
- ), [M, b] = S("calendar");
2040
+ ), [M, y] = T("calendar");
1949
2041
  return {
1950
2042
  isCalendarVisible: i,
1951
- showCalendarInternal: a,
1952
- hideCalendarInternal: o,
1953
- firstFocusedInput: D,
1954
- setFirstFocusedInput: f,
1955
- dateInFocus: h,
1956
- setDateInFocus: w,
2043
+ showCalendarInternal: c,
2044
+ hideCalendarInternal: a,
2045
+ firstFocusedInput: p,
2046
+ setFirstFocusedInput: h,
2047
+ dateInFocus: f,
2048
+ setDateInFocus: g,
1957
2049
  currentPanel: M,
1958
- setCurrentPanel: b,
1959
- isTimePickerVisible: d,
1960
- showTimePicker: l,
2050
+ setCurrentPanel: y,
2051
+ isTimePickerVisible: l,
2052
+ showTimePicker: d,
1961
2053
  hideTimePicker: u,
1962
2054
  localDate: e,
1963
- setLocalDate: r,
1964
- localTime: n,
2055
+ setLocalDate: n,
2056
+ localTime: r,
1965
2057
  setLocalTime: s
1966
2058
  };
1967
- }, sn = (t, e, r, n, {
2059
+ }, Yr = (t, e, n, r, {
1968
2060
  isCalendarVisible: s,
1969
2061
  setCurrentPanel: i,
1970
- showTimePicker: a,
1971
- hideTimePicker: o
2062
+ showTimePicker: c,
2063
+ hideTimePicker: a
1972
2064
  }) => {
1973
- const d = g(() => {
1974
- s || r(), i("calendar"), o();
1975
- }, [o, s, i, r]), l = g(() => {
1976
- n(), a();
1977
- }, [n, a]), u = g(
1978
- (w) => {
1979
- t(w.date), n(), a();
2065
+ const l = D(() => {
2066
+ s || n(), i("calendar"), a();
2067
+ }, [a, s, i, n]), d = D(() => {
2068
+ r(), c();
2069
+ }, [r, c]), u = D(
2070
+ (g) => {
2071
+ t(g.date), r(), c();
1980
2072
  },
1981
- [t, n, a]
1982
- ), D = g(() => {
1983
- i("presets"), r();
1984
- }, [i, r]), f = g(() => {
1985
- var w;
1986
- s ? n() : ((w = e.current) == null || w.focus(), i("calendar"), r());
2073
+ [t, r, c]
2074
+ ), p = D(() => {
2075
+ i("presets"), n();
2076
+ }, [i, n]), h = D(() => {
2077
+ var g;
2078
+ s ? r() : ((g = e.current) == null || g.focus(), i("calendar"), n());
1987
2079
  }, [
1988
2080
  s,
1989
- n,
2081
+ r,
1990
2082
  e,
1991
2083
  i,
1992
- r
1993
- ]), h = g(
1994
- (w) => {
1995
- w.key === "Escape" && n();
2084
+ n
2085
+ ]), f = D(
2086
+ (g) => {
2087
+ g.key === "Escape" && r();
1996
2088
  },
1997
- [n]
2089
+ [r]
1998
2090
  );
1999
2091
  return {
2000
- onFocusLeft: d,
2001
- onFocusRight: l,
2092
+ onFocusLeft: l,
2093
+ onFocusRight: d,
2002
2094
  onClickDay: u,
2003
- onClickArrowButton: D,
2004
- onClickCalendarButton: f,
2005
- onKeyDownHandler: h
2095
+ onClickArrowButton: p,
2096
+ onClickCalendarButton: h,
2097
+ onKeyDownHandler: f
2006
2098
  };
2007
- }, Wn = ({
2099
+ }, Ws = ({
2008
2100
  value: t,
2009
2101
  onValueChange: e,
2010
- onEnter: r,
2011
- onEsc: n,
2102
+ onEnter: n,
2103
+ onEsc: r,
2012
2104
  onBlur: s,
2013
2105
  autoFocus: i,
2014
- minDate: a,
2015
- widthLeft: o = 128,
2016
- widthRight: d = 80,
2017
- maxDate: l = kt,
2106
+ minDate: c,
2107
+ widthLeft: a = 128,
2108
+ widthRight: l = 80,
2109
+ maxDate: d = _t,
2018
2110
  variant: u,
2019
- disabled: D
2111
+ disabled: p
2020
2112
  }) => {
2021
- const f = B(null), h = B(null), w = nn(t), {
2113
+ const h = $(null), f = $(null), g = Pr(t), {
2022
2114
  setCurrentPanel: M,
2023
- currentPanel: b,
2024
- isCalendarVisible: y,
2025
- dateInFocus: p,
2115
+ currentPanel: y,
2116
+ isCalendarVisible: b,
2117
+ dateInFocus: w,
2026
2118
  setDateInFocus: m,
2027
2119
  isTimePickerVisible: k,
2028
2120
  hideTimePicker: E,
2029
- localTime: N,
2030
- localDate: C
2031
- } = w, {
2032
- showCalendar: H,
2033
- hideCalendar: I,
2034
- inputLeftChangeHandler: O,
2035
- inputRightChangeHandler: Q,
2036
- onChangeTime: P,
2037
- onChangeDate: nt
2038
- } = rn(t, e, w, f), {
2039
- onKeyDownHandler: at,
2040
- onFocusRight: st,
2041
- onFocusLeft: z,
2042
- onClickDay: dt,
2043
- onClickCalendarButton: lt,
2044
- onClickArrowButton: ut
2045
- } = sn(
2046
- nt,
2047
- f,
2048
- H,
2121
+ localTime: A,
2122
+ localDate: N
2123
+ } = g, {
2124
+ showCalendar: I,
2125
+ hideCalendar: Y,
2126
+ inputLeftChangeHandler: S,
2127
+ inputRightChangeHandler: v,
2128
+ onChangeTime: U,
2129
+ onChangeDate: K
2130
+ } = _r(t, e, g, h), {
2131
+ onKeyDownHandler: j,
2132
+ onFocusRight: Z,
2133
+ onFocusLeft: F,
2134
+ onClickDay: Q,
2135
+ onClickCalendarButton: tt,
2136
+ onClickArrowButton: _
2137
+ } = Yr(
2138
+ K,
2139
+ h,
2049
2140
  I,
2050
- w
2141
+ Y,
2142
+ g
2051
2143
  );
2052
- en(t, m, f);
2053
- const X = A(() => {
2054
- const Tt = t || C;
2055
- return Tt ? F(void 0, Tt, [
2144
+ Lr(t, m, h);
2145
+ const O = R(() => {
2146
+ const Bt = t || N;
2147
+ return Bt ? at(void 0, Bt, [
2056
2148
  "singleSelected",
2057
2149
  "selected"
2058
2150
  ]) : {};
2059
- }, [C, t]), L = g(() => {
2060
- I(), E();
2061
- }, [I, E]), U = A(
2062
- () => t ? qr(t) : N,
2063
- [t, N]
2064
- ), St = Pt(y, 300), Mt = Pt(k, 300);
2065
- return /* @__PURE__ */ c(x, { onKeyDown: at, children: /* @__PURE__ */ c(
2066
- pt,
2151
+ }, [N, t]), H = D(() => {
2152
+ Y(), E();
2153
+ }, [Y, E]), z = R(
2154
+ () => t ? Tr(t) : A,
2155
+ [t, A]
2156
+ ), Pt = re(b, 300), Yt = re(k, 300);
2157
+ return /* @__PURE__ */ o(L, { onKeyDown: j, children: /* @__PURE__ */ o(
2158
+ At,
2067
2159
  {
2068
2160
  arrow: !1,
2069
2161
  lazy: !0,
2070
- disabled: D,
2071
- placement: bt,
2072
- visible: y || k,
2073
- onClickOutside: L,
2074
- content: (St || Mt) && /* @__PURE__ */ c($, { children: St ? /* @__PURE__ */ c(
2075
- rt,
2162
+ disabled: p,
2163
+ placement: Lt,
2164
+ visible: b || k,
2165
+ onClickOutside: H,
2166
+ content: (Pt || Yt) && /* @__PURE__ */ o(C, { children: Pt ? /* @__PURE__ */ o(
2167
+ gt,
2076
2168
  {
2077
- statePerMonth: X,
2078
- onClickDay: dt,
2079
- dateInFocus: p,
2169
+ statePerMonth: O,
2170
+ onClickDay: Q,
2171
+ dateInFocus: w,
2080
2172
  setDateInFocus: m,
2081
- currentPanel: b,
2173
+ currentPanel: y,
2082
2174
  setCurrentPanel: M,
2083
- minDate: a,
2084
- maxDate: l
2175
+ minDate: c,
2176
+ maxDate: d
2085
2177
  }
2086
- ) : Mt ? /* @__PURE__ */ T($, { children: [
2087
- /* @__PURE__ */ c($, { overflow: "hidden", height: "250px", children: /* @__PURE__ */ c(
2088
- tn,
2178
+ ) : Yt ? /* @__PURE__ */ x(C, { children: [
2179
+ /* @__PURE__ */ o(C, { overflow: "hidden", height: "250px", children: /* @__PURE__ */ o(
2180
+ Nr,
2089
2181
  {
2090
- value: U ?? "",
2091
- onValueChange: P
2182
+ value: z ?? "",
2183
+ onValueChange: U
2092
2184
  }
2093
2185
  ) }),
2094
- /* @__PURE__ */ c(ct, {}),
2095
- /* @__PURE__ */ c(R, { justifyContent: "flex-end", children: /* @__PURE__ */ c(ot, { label: "Done", onClick: E }) })
2186
+ /* @__PURE__ */ o(Dt, {}),
2187
+ /* @__PURE__ */ o(B, { justifyContent: "flex-end", children: /* @__PURE__ */ o(bt, { label: "Done", onClick: E }) })
2096
2188
  ] }) : null }),
2097
- children: /* @__PURE__ */ c(
2098
- ge,
2189
+ children: /* @__PURE__ */ o(
2190
+ ve,
2099
2191
  {
2100
2192
  autoFocusLeft: i,
2101
- onEsc: n,
2102
- onEnter: r,
2193
+ onEsc: r,
2194
+ onEnter: n,
2103
2195
  onBlur: s,
2104
- disabled: D,
2105
- separatorIcon: vt,
2196
+ disabled: p,
2197
+ separatorIcon: Ie,
2106
2198
  typeLeft: "date",
2107
2199
  typeRight: "time",
2108
2200
  placeholderLeft: "yyyy-mm-dd",
2109
2201
  placeholderRight: "hh:mm",
2110
- onChangeLeft: O,
2111
- onChangeRight: Q,
2112
- onClickArrowDown: ut,
2113
- onClickCalendar: lt,
2114
- onFocusLeft: z,
2115
- onFocusRight: st,
2116
- onClickLeft: z,
2117
- onClickRight: st,
2118
- inputRefLeft: f,
2119
- inputRefRight: h,
2120
- valueRight: U ?? "",
2121
- widthLeft: o,
2122
- widthRight: d,
2123
- minLeft: a,
2124
- maxLeft: l,
2202
+ onChangeLeft: S,
2203
+ onChangeRight: v,
2204
+ onClickArrowDown: _,
2205
+ onClickCalendar: tt,
2206
+ onFocusLeft: F,
2207
+ onFocusRight: Z,
2208
+ onClickLeft: F,
2209
+ onClickRight: Z,
2210
+ inputRefLeft: h,
2211
+ inputRefRight: f,
2212
+ valueRight: z ?? "",
2213
+ widthLeft: a,
2214
+ widthRight: l,
2215
+ minLeft: c,
2216
+ maxLeft: d,
2125
2217
  variant: u
2126
2218
  }
2127
2219
  )
2128
2220
  }
2129
2221
  ) });
2130
- }, cn = ({
2222
+ }, Br = ({
2131
2223
  value: t,
2132
2224
  onValueChange: e,
2133
- year: r
2225
+ year: n
2134
2226
  }) => {
2135
- const n = String(r);
2136
- return /* @__PURE__ */ c(R, { justifyContent: "center", children: t === r ? /* @__PURE__ */ c(ot, { label: n, onClick: () => e == null ? void 0 : e(r) }) : /* @__PURE__ */ c(W, { label: n, onClick: () => e == null ? void 0 : e(r) }) });
2137
- }, On = ({
2227
+ const r = String(n);
2228
+ return /* @__PURE__ */ o(B, { justifyContent: "center", children: t === n ? /* @__PURE__ */ o(bt, { label: r, onClick: () => e == null ? void 0 : e(n) }) : /* @__PURE__ */ o(q, { label: r, onClick: () => e == null ? void 0 : e(n) }) });
2229
+ }, vs = ({
2138
2230
  value: t,
2139
2231
  onValueChange: e,
2140
- initialLastYear: r
2232
+ initialLastYear: n
2141
2233
  }) => {
2142
- const [n, s] = S(() => t ? t + 4 : r ?? (/* @__PURE__ */ new Date()).getFullYear() + 4), i = A(() => {
2143
- const a = n - 11;
2144
- return ie(Bt(a, n + 1), 3);
2145
- }, [n]);
2146
- return J(() => {
2147
- s((a) => on(t, a));
2148
- }, [t]), /* @__PURE__ */ T(R, { children: [
2149
- /* @__PURE__ */ c($, { justifyContent: "center", children: /* @__PURE__ */ c(
2150
- W,
2234
+ const [r, s] = T(() => t ? t + 4 : n ?? (/* @__PURE__ */ new Date()).getFullYear() + 4), i = R(() => {
2235
+ const c = r - 11;
2236
+ return _e(ue(c, r + 1), 3);
2237
+ }, [r]);
2238
+ return X(() => {
2239
+ s((c) => Or(t, c));
2240
+ }, [t]), /* @__PURE__ */ x(B, { children: [
2241
+ /* @__PURE__ */ o(C, { justifyContent: "center", children: /* @__PURE__ */ o(
2242
+ q,
2151
2243
  {
2152
- leftIcon: Wt,
2153
- onClick: () => s(n - 3)
2244
+ leftIcon: vt,
2245
+ onClick: () => s(r - 3)
2154
2246
  }
2155
2247
  ) }),
2156
- /* @__PURE__ */ c($, { gap: 1, children: i.map((a) => /* @__PURE__ */ c(R, { gap: 1, children: a.map((o) => /* @__PURE__ */ c(
2157
- cn,
2248
+ /* @__PURE__ */ o(C, { gap: 1, children: i.map((c) => /* @__PURE__ */ o(B, { gap: 1, children: c.map((a) => /* @__PURE__ */ o(
2249
+ Br,
2158
2250
  {
2159
- year: o,
2251
+ year: a,
2160
2252
  onValueChange: e,
2161
2253
  value: t
2162
2254
  },
2163
- o
2164
- )) }, a[0])) }),
2165
- /* @__PURE__ */ c($, { justifyContent: "center", children: /* @__PURE__ */ c(
2166
- W,
2255
+ a
2256
+ )) }, c[0])) }),
2257
+ /* @__PURE__ */ o(C, { justifyContent: "center", children: /* @__PURE__ */ o(
2258
+ q,
2167
2259
  {
2168
- leftIcon: xt,
2169
- onClick: () => s(n + 3)
2260
+ leftIcon: Et,
2261
+ onClick: () => s(r + 3)
2170
2262
  }
2171
2263
  ) })
2172
2264
  ] });
2173
- }, on = (t, e) => {
2265
+ }, Or = (t, e) => {
2174
2266
  if (t == null)
2175
2267
  return e;
2176
2268
  if (t > e) {
2177
- const n = t - e, s = n % 3, i = n - s + 3;
2269
+ const r = t - e, s = r % 3, i = r - s + 3;
2178
2270
  return e + i;
2179
2271
  }
2180
- const r = e - 11;
2181
- if (t < r) {
2182
- const n = r - t, s = n % 3, i = n - s + 3;
2272
+ const n = e - 11;
2273
+ if (t < n) {
2274
+ const r = n - t, s = r % 3, i = r - s + 3;
2183
2275
  return e - i;
2184
2276
  }
2185
2277
  return e;
2186
- }, an = (t, e, r, n, s) => {
2187
- J(
2278
+ }, Hr = (t, e, n, r, s) => {
2279
+ X(
2188
2280
  function() {
2189
- t && r(t);
2281
+ t && n(t);
2190
2282
  },
2191
- [t, r]
2192
- ), J(
2283
+ [t, n]
2284
+ ), X(
2193
2285
  function() {
2194
- e && r(e);
2286
+ e && n(e);
2195
2287
  },
2196
- [e, r]
2197
- ), J(
2288
+ [e, n]
2289
+ ), X(
2198
2290
  function() {
2199
- n.current && (t ? n.current.valueAsDate = new Date(
2291
+ r.current && (t ? r.current.valueAsDate = new Date(
2200
2292
  Date.UTC(
2201
2293
  t.getFullYear(),
2202
2294
  t.getMonth(),
2203
2295
  t.getDate()
2204
2296
  )
2205
- ) : n.current.valueAsDate = null);
2297
+ ) : r.current.valueAsDate = null);
2206
2298
  },
2207
- [t, n]
2208
- ), J(
2299
+ [t, r]
2300
+ ), X(
2209
2301
  function() {
2210
2302
  s.current && (e ? s.current.valueAsDate = new Date(
2211
2303
  Date.UTC(
@@ -2217,347 +2309,1322 @@ const Un = ({
2217
2309
  },
2218
2310
  [e, s]
2219
2311
  );
2220
- }, dn = (t, e, r, {
2221
- setDateInFocus: n,
2312
+ }, $r = (t, e, n, {
2313
+ setDateInFocus: r,
2222
2314
  showCalendarInternal: s,
2223
2315
  hideCalendarInternal: i,
2224
- setFirstFocusedInput: a,
2225
- setCurrentPanel: o
2316
+ setFirstFocusedInput: c,
2317
+ setCurrentPanel: a
2226
2318
  }) => {
2227
- const d = g(
2228
- (f) => {
2229
- f.target.value[0] !== "0" && (r == null || r({
2230
- startDate: f.target.valueAsDate ?? void 0,
2319
+ const l = D(
2320
+ (h) => {
2321
+ h.target.value[0] !== "0" && (n == null || n({
2322
+ startDate: h.target.valueAsDate ?? void 0,
2231
2323
  endDate: e
2232
2324
  }));
2233
2325
  },
2234
- [r, e]
2235
- ), l = g(
2236
- (f) => {
2237
- f.target.value[0] !== "0" && (r == null || r({
2326
+ [n, e]
2327
+ ), d = D(
2328
+ (h) => {
2329
+ h.target.value[0] !== "0" && (n == null || n({
2238
2330
  startDate: t,
2239
- endDate: f.target.valueAsDate ?? void 0
2331
+ endDate: h.target.valueAsDate ?? void 0
2240
2332
  }));
2241
2333
  },
2242
- [r, t]
2243
- ), u = g(() => {
2244
- n(t || e || /* @__PURE__ */ new Date()), o("calendar"), s();
2334
+ [n, t]
2335
+ ), u = D(() => {
2336
+ r(t || e || /* @__PURE__ */ new Date()), a("calendar"), s();
2245
2337
  }, [
2246
2338
  t,
2247
2339
  e,
2248
- o,
2340
+ a,
2249
2341
  s,
2250
- n
2251
- ]), D = g(() => {
2252
- a(void 0), i();
2253
- }, [a, i]);
2342
+ r
2343
+ ]), p = D(() => {
2344
+ c(void 0), i();
2345
+ }, [c, i]);
2254
2346
  return {
2255
- inputLeftChangeHandler: d,
2256
- inputRightChangeHandler: l,
2257
- hideCalendar: D,
2258
- setDateInFocus: n,
2259
- setCurrentPanel: o,
2347
+ inputLeftChangeHandler: l,
2348
+ inputRightChangeHandler: d,
2349
+ hideCalendar: p,
2350
+ setDateInFocus: r,
2351
+ setCurrentPanel: a,
2260
2352
  showCalendar: u
2261
2353
  };
2262
- }, ln = (t, e) => {
2263
- const [r, n, s] = Ht(!1), [i, a] = S(void 0), [o, d] = S("startDate"), [l, u] = S(() => (o === "startDate" ? t : o === "endDate" ? e : void 0) ?? /* @__PURE__ */ new Date()), [D, f] = S("calendar");
2354
+ }, Ur = (t, e) => {
2355
+ const [n, r, s] = ne(!1), [i, c] = T(void 0), [a, l] = T("startDate"), [d, u] = T(() => (a === "startDate" ? t : a === "endDate" ? e : void 0) ?? /* @__PURE__ */ new Date()), [p, h] = T("calendar");
2264
2356
  return {
2265
- isCalendarVisible: r,
2266
- showCalendarInternal: n,
2357
+ isCalendarVisible: n,
2358
+ showCalendarInternal: r,
2267
2359
  hideCalendarInternal: s,
2268
2360
  firstFocusedInput: i,
2269
- setFirstFocusedInput: a,
2270
- focusedInput: o,
2271
- setFocusedInput: d,
2272
- dateInFocus: l,
2361
+ setFirstFocusedInput: c,
2362
+ focusedInput: a,
2363
+ setFocusedInput: l,
2364
+ dateInFocus: d,
2273
2365
  setDateInFocus: u,
2274
- currentPanel: D,
2275
- setCurrentPanel: f
2366
+ currentPanel: p,
2367
+ setCurrentPanel: h
2276
2368
  };
2277
- }, un = (t, e, r, n, s, i, a, {
2278
- firstFocusedInput: o,
2279
- setFirstFocusedInput: d,
2280
- isCalendarVisible: l,
2369
+ }, Wr = (t, e, n, r, s, i, c, {
2370
+ firstFocusedInput: a,
2371
+ setFirstFocusedInput: l,
2372
+ isCalendarVisible: d,
2281
2373
  setFocusedInput: u,
2282
- focusedInput: D,
2283
- setCurrentPanel: f
2374
+ focusedInput: p,
2375
+ setCurrentPanel: h
2284
2376
  }) => {
2285
- const h = g(() => {
2286
- o == null && d("startDate"), u("startDate"), l || i();
2377
+ const f = D(() => {
2378
+ a == null && l("startDate"), u("startDate"), d || i();
2287
2379
  }, [
2288
- l,
2380
+ d,
2289
2381
  u,
2290
2382
  i,
2291
- d,
2292
- o
2293
- ]), w = g(() => {
2294
- o == null && d("endDate"), u("endDate"), l || i();
2295
- }, [
2296
2383
  l,
2384
+ a
2385
+ ]), g = D(() => {
2386
+ a == null && l("endDate"), u("endDate"), d || i();
2387
+ }, [
2388
+ d,
2297
2389
  u,
2298
2390
  i,
2299
- d,
2300
- o
2301
- ]), M = g(
2391
+ l,
2392
+ a
2393
+ ]), M = D(
2302
2394
  (m) => {
2303
- var k, E, N, C;
2304
- D === "startDate" ? e != null && v(m.date, e) ? (r == null || r({
2395
+ var k, E, A, N;
2396
+ p === "startDate" ? e != null && G(m.date, e) ? (n == null || n({
2305
2397
  startDate: m.date,
2306
2398
  endDate: void 0
2307
- }), u("endDate"), (k = s.current) == null || k.focus()) : (r == null || r({
2399
+ }), u("endDate"), (k = s.current) == null || k.focus()) : (n == null || n({
2308
2400
  startDate: m.date,
2309
2401
  endDate: e
2310
- }), o === "startDate" ? (u("endDate"), (E = s.current) == null || E.focus()) : setTimeout(a, 50)) : D === "endDate" && (t ? v(t, m.date) ? (r == null || r({
2402
+ }), a === "startDate" ? (u("endDate"), (E = s.current) == null || E.focus()) : setTimeout(c, 50)) : p === "endDate" && (t ? G(t, m.date) ? (n == null || n({
2311
2403
  startDate: m.date,
2312
2404
  endDate: void 0
2313
- }), u("endDate"), (C = s.current) == null || C.focus()) : (r == null || r({
2405
+ }), u("endDate"), (N = s.current) == null || N.focus()) : (n == null || n({
2314
2406
  startDate: t,
2315
2407
  endDate: m.date
2316
- }), setTimeout(a, 50)) : (r == null || r({
2408
+ }), setTimeout(c, 50)) : (n == null || n({
2317
2409
  startDate: t,
2318
2410
  endDate: m.date
2319
- }), u("startDate"), (N = n.current) == null || N.focus()));
2411
+ }), u("startDate"), (A = r.current) == null || A.focus()));
2320
2412
  },
2321
2413
  [
2322
- D,
2323
- r,
2414
+ p,
2415
+ n,
2324
2416
  e,
2325
- o,
2417
+ a,
2326
2418
  u,
2327
2419
  s,
2328
- a,
2420
+ c,
2329
2421
  t,
2330
- n
2422
+ r
2331
2423
  ]
2332
- ), b = g(() => {
2333
- f("presets"), i();
2334
- }, [f, i]), y = g(() => {
2424
+ ), y = D(() => {
2425
+ h("presets"), i();
2426
+ }, [h, i]), b = D(() => {
2335
2427
  var m;
2336
- l ? a() : (u("startDate"), d("startDate"), (m = n.current) == null || m.focus(), f("calendar"), i());
2428
+ d ? c() : (u("startDate"), l("startDate"), (m = r.current) == null || m.focus(), h("calendar"), i());
2337
2429
  }, [
2338
- l,
2339
- a,
2340
- u,
2341
2430
  d,
2342
- n,
2343
- f,
2431
+ c,
2432
+ u,
2433
+ l,
2434
+ r,
2435
+ h,
2344
2436
  i
2345
- ]), p = g(
2437
+ ]), w = D(
2346
2438
  (m) => {
2347
- m.key === "Escape" && a();
2439
+ m.key === "Escape" && c();
2348
2440
  },
2349
- [a]
2441
+ [c]
2350
2442
  );
2351
2443
  return {
2352
- onFocusLeft: h,
2353
- onFocusRight: w,
2444
+ onFocusLeft: f,
2445
+ onFocusRight: g,
2354
2446
  onClickDay: M,
2355
- onClickArrowButton: b,
2356
- onClickCalendarButton: y,
2357
- onKeyDownHandler: p
2447
+ onClickArrowButton: y,
2448
+ onClickCalendarButton: b,
2449
+ onKeyDownHandler: w
2358
2450
  };
2359
2451
  };
2360
- function Bn({
2452
+ function zs({
2361
2453
  value: t,
2362
2454
  onValueChange: e,
2363
- autoFocus: r,
2364
- onBlur: n,
2455
+ autoFocus: n,
2456
+ onBlur: r,
2365
2457
  onEnter: s,
2366
2458
  onEsc: i,
2367
- minDate: a,
2368
- maxDate: o = kt,
2369
- calendarProps: d,
2370
- widthLeft: l = 128,
2459
+ minDate: c,
2460
+ maxDate: a = _t,
2461
+ calendarProps: l,
2462
+ widthLeft: d = 128,
2371
2463
  widthRight: u = 128,
2372
- variant: D,
2373
- disabled: f
2464
+ variant: p,
2465
+ disabled: h
2374
2466
  }) {
2375
- const { startDate: h, endDate: w } = t || {}, M = B(null), b = B(null), y = ln(h, w), {
2376
- dateInFocus: p,
2467
+ const { startDate: f, endDate: g } = t || {}, M = $(null), y = $(null), b = Ur(f, g), {
2468
+ dateInFocus: w,
2377
2469
  setDateInFocus: m,
2378
2470
  isCalendarVisible: k,
2379
2471
  currentPanel: E,
2380
- setCurrentPanel: N
2381
- } = y, {
2382
- showCalendar: C,
2383
- hideCalendar: H,
2384
- inputLeftChangeHandler: I,
2385
- inputRightChangeHandler: O
2386
- } = dn(h, w, e, y), {
2387
- onKeyDownHandler: Q,
2388
- onFocusRight: P,
2389
- onFocusLeft: nt,
2390
- onClickDay: at,
2391
- onClickCalendarButton: st,
2392
- onClickArrowButton: z
2393
- } = un(
2394
- h,
2395
- w,
2472
+ setCurrentPanel: A
2473
+ } = b, {
2474
+ showCalendar: N,
2475
+ hideCalendar: I,
2476
+ inputLeftChangeHandler: Y,
2477
+ inputRightChangeHandler: S
2478
+ } = $r(f, g, e, b), {
2479
+ onKeyDownHandler: v,
2480
+ onFocusRight: U,
2481
+ onFocusLeft: K,
2482
+ onClickDay: j,
2483
+ onClickCalendarButton: Z,
2484
+ onClickArrowButton: F
2485
+ } = Wr(
2486
+ f,
2487
+ g,
2396
2488
  e,
2397
2489
  M,
2398
- b,
2399
- C,
2400
- H,
2401
- y
2490
+ y,
2491
+ N,
2492
+ I,
2493
+ b
2402
2494
  );
2403
- an(
2404
- h,
2405
- w,
2495
+ Hr(
2496
+ f,
2497
+ g,
2406
2498
  m,
2407
2499
  M,
2408
- b
2500
+ y
2409
2501
  );
2410
- const dt = A(
2411
- () => h && w && v(h, w),
2412
- [h, w]
2413
- ), lt = A(
2414
- () => nr(
2415
- d == null ? void 0 : d.statePerMonth,
2416
- h,
2417
- w,
2418
- p
2502
+ const Q = R(
2503
+ () => f && g && G(f, g),
2504
+ [f, g]
2505
+ ), tt = R(
2506
+ () => Ln(
2507
+ l == null ? void 0 : l.statePerMonth,
2508
+ f,
2509
+ g,
2510
+ w
2419
2511
  ),
2420
- [d == null ? void 0 : d.statePerMonth, h, w, p]
2421
- ), ut = Pt(k, 300);
2422
- return /* @__PURE__ */ c(x, { onKeyDown: Q, children: /* @__PURE__ */ c(
2423
- pt,
2512
+ [l == null ? void 0 : l.statePerMonth, f, g, w]
2513
+ ), _ = re(k, 300);
2514
+ return /* @__PURE__ */ o(L, { onKeyDown: v, children: /* @__PURE__ */ o(
2515
+ At,
2424
2516
  {
2425
2517
  arrow: !1,
2426
2518
  lazy: !0,
2427
- disabled: f,
2428
- placement: bt,
2429
- onClickOutside: H,
2519
+ disabled: h,
2520
+ placement: Lt,
2521
+ onClickOutside: I,
2430
2522
  visible: k,
2431
- content: ut && /* @__PURE__ */ c(
2432
- rt,
2523
+ content: _ && /* @__PURE__ */ o(
2524
+ gt,
2433
2525
  {
2434
- onClickDay: at,
2435
- dateInFocus: p,
2526
+ onClickDay: j,
2527
+ dateInFocus: w,
2436
2528
  setDateInFocus: m,
2437
2529
  currentPanel: E,
2438
- setCurrentPanel: N,
2439
- minDate: a,
2440
- maxDate: o,
2441
- ...d,
2442
- statePerMonth: lt
2530
+ setCurrentPanel: A,
2531
+ minDate: c,
2532
+ maxDate: a,
2533
+ ...l,
2534
+ statePerMonth: tt
2443
2535
  }
2444
2536
  ),
2445
- children: /* @__PURE__ */ c(
2446
- ge,
2537
+ children: /* @__PURE__ */ o(
2538
+ ve,
2447
2539
  {
2448
- autoFocusLeft: r,
2540
+ autoFocusLeft: n,
2449
2541
  onEsc: i,
2450
2542
  onEnter: s,
2451
- onBlur: n,
2452
- disabled: f,
2453
- separatorIcon: xt,
2543
+ onBlur: r,
2544
+ disabled: h,
2545
+ separatorIcon: Et,
2454
2546
  typeLeft: "date",
2455
2547
  typeRight: "date",
2456
2548
  placeholderLeft: "Start date",
2457
2549
  placeholderRight: "End date",
2458
- onChangeLeft: I,
2459
- onChangeRight: O,
2460
- onClickArrowDown: z,
2461
- onClickCalendar: st,
2462
- onFocusLeft: nt,
2463
- onFocusRight: P,
2464
- onClickLeft: nt,
2465
- onClickRight: P,
2550
+ onChangeLeft: Y,
2551
+ onChangeRight: S,
2552
+ onClickArrowDown: F,
2553
+ onClickCalendar: Z,
2554
+ onFocusLeft: K,
2555
+ onFocusRight: U,
2556
+ onClickLeft: K,
2557
+ onClickRight: U,
2466
2558
  inputRefLeft: M,
2467
- inputRefRight: b,
2468
- variant: dt ? "error" : D,
2469
- widthLeft: l,
2559
+ inputRefRight: y,
2560
+ variant: Q ? "error" : p,
2561
+ widthLeft: d,
2470
2562
  widthRight: u,
2471
- minLeft: a,
2472
- maxLeft: o,
2473
- minRight: a,
2474
- maxRight: o
2563
+ minLeft: c,
2564
+ maxLeft: a,
2565
+ minRight: c,
2566
+ maxRight: a
2475
2567
  }
2476
2568
  )
2477
2569
  }
2478
2570
  ) });
2479
2571
  }
2480
- const we = (t) => {
2481
- const r = new Intl.DateTimeFormat(t, { dateStyle: "short" }).formatToParts(/* @__PURE__ */ new Date()), n = {
2572
+ const oe = ({
2573
+ onChange: t,
2574
+ onValueChange: e,
2575
+ mask: n,
2576
+ pipe: r,
2577
+ value: s,
2578
+ guide: i,
2579
+ keepCharPositions: c,
2580
+ placeholderChar: a,
2581
+ showMask: l,
2582
+ ...d
2583
+ }) => {
2584
+ const u = $(null), { onChange: p } = Nn(
2585
+ u,
2586
+ t,
2587
+ e,
2588
+ n,
2589
+ r,
2590
+ s,
2591
+ i,
2592
+ c,
2593
+ a,
2594
+ l
2595
+ );
2596
+ return /* @__PURE__ */ o(
2597
+ xn,
2598
+ {
2599
+ ...d,
2600
+ ref: u,
2601
+ onChange: p,
2602
+ width: "168px"
2603
+ }
2604
+ );
2605
+ }, vr = [/[1-2]/, /\d/, /\d/, /\d/], zr = [/[0-1]/, /\d/], Fr = [/[0-3]/, /\d/], Fe = (t) => Cr(t).flatMap(jr), jr = (t) => {
2606
+ switch (t) {
2607
+ case "yyyy":
2608
+ return vr;
2609
+ case "mm":
2610
+ case "MM":
2611
+ return zr;
2612
+ case "dd":
2613
+ case "DD":
2614
+ return Fr;
2615
+ default:
2616
+ return [t];
2617
+ }
2618
+ }, Cr = (t) => {
2619
+ if (t.length === 0)
2620
+ return [];
2621
+ const e = [];
2622
+ let n = t[0];
2623
+ for (let r = 1; r < t.length; r++)
2624
+ t[r] !== t[r - 1] ? (e.push(n), n = t[r]) : n += t[r];
2625
+ return e.push(n), e;
2626
+ }, wt = (t) => {
2627
+ const n = new Intl.DateTimeFormat(t, { dateStyle: "short" }).formatToParts(/* @__PURE__ */ new Date()), r = {
2482
2628
  year: "yyyy",
2483
2629
  month: "MM",
2484
2630
  day: "dd"
2485
2631
  };
2486
- return r.map((s) => n[s.type] || s.value).join("");
2487
- }, fn = {
2488
- "en-US": ze,
2489
- "en-GB": Nt,
2490
- "de-AT": je,
2491
- "de-DE": _t,
2492
- fr: _e,
2493
- de: _t,
2494
- es: Je,
2495
- sv: Ke,
2496
- pl: Ge,
2497
- da: Fe,
2498
- nl: qe,
2499
- nb: Qe
2500
- }, ye = (t) => fn[t], zn = (t, e) => Y(t, we(e), {
2501
- locale: ye(e)
2502
- }), jn = (t, e, r = /* @__PURE__ */ new Date()) => V(t, we(e), r, {
2503
- locale: ye(e)
2504
- });
2632
+ return n.map((s) => r[s.type] || s.value).join("");
2633
+ }, je = {
2634
+ "en-US": mn,
2635
+ "en-GB": Ft,
2636
+ "de-AT": gn,
2637
+ "de-DE": De,
2638
+ fr: Dn,
2639
+ de: De,
2640
+ es: bn,
2641
+ sv: wn,
2642
+ pl: yn,
2643
+ da: Mn,
2644
+ nl: kn,
2645
+ nb: Sn
2646
+ }, Gt = (t) => je[t], Ce = () => je.sv, ut = (t, e, n) => {
2647
+ const r = Gt(e);
2648
+ if (r == null)
2649
+ return;
2650
+ const s = ft(
2651
+ t,
2652
+ wt(e),
2653
+ n ?? /* @__PURE__ */ new Date(),
2654
+ {
2655
+ locale: r
2656
+ }
2657
+ );
2658
+ if (!isNaN(s.getTime()))
2659
+ return s;
2660
+ }, yt = (t, e) => W(t, wt(e), {
2661
+ locale: Gt(e)
2662
+ }), ce = (t, e) => {
2663
+ const n = ut(t, e);
2664
+ if (n != null)
2665
+ return yt(n, e);
2666
+ }, Ke = ({
2667
+ value: t,
2668
+ onValueChange: e,
2669
+ localeCode: n,
2670
+ startDateLabel: r = "From",
2671
+ endDateLabel: s = "To",
2672
+ onFocus: i
2673
+ }) => {
2674
+ const { mask: c, placeholder: a } = R(() => {
2675
+ const l = wt(n);
2676
+ return {
2677
+ mask: Fe(l),
2678
+ placeholder: l.toLowerCase()
2679
+ };
2680
+ }, [n]);
2681
+ return /* @__PURE__ */ x(B, { children: [
2682
+ /* @__PURE__ */ o(
2683
+ oe,
2684
+ {
2685
+ mask: c,
2686
+ value: t == null ? void 0 : t.startDate,
2687
+ onValueChange: (l) => {
2688
+ e == null || e({ startDate: l });
2689
+ },
2690
+ onBlur: (l) => {
2691
+ const d = ce(
2692
+ l.target.value,
2693
+ n
2694
+ );
2695
+ d && d !== (t == null ? void 0 : t.startDate) && (e == null || e({ startDate: d }));
2696
+ },
2697
+ onFocus: i,
2698
+ label: r,
2699
+ borderRadiusVariant: "onlyLeft",
2700
+ placeholder: a
2701
+ }
2702
+ ),
2703
+ /* @__PURE__ */ o(
2704
+ oe,
2705
+ {
2706
+ mask: c,
2707
+ value: t == null ? void 0 : t.endDate,
2708
+ onValueChange: (l) => e == null ? void 0 : e({ endDate: l }),
2709
+ onBlur: (l) => {
2710
+ const d = ce(
2711
+ l.target.value,
2712
+ n
2713
+ );
2714
+ d && d !== (t == null ? void 0 : t.endDate) && (e == null || e({ endDate: d }));
2715
+ },
2716
+ onFocus: i,
2717
+ label: s,
2718
+ borderRadiusVariant: "onlyRight",
2719
+ placeholder: a
2720
+ }
2721
+ )
2722
+ ] });
2723
+ }, Je = (t, e, n, r) => {
2724
+ const s = Gt(n) ?? Ce(), i = he(), c = me(), a = $(null), l = R(
2725
+ () => wt(n),
2726
+ [n]
2727
+ ), d = R(
2728
+ () => {
2729
+ var S;
2730
+ return ((S = t == null ? void 0 : t.startDate) == null ? void 0 : S.length) === l.length ? ut(t.startDate, n) : void 0;
2731
+ },
2732
+ [l.length, n, t == null ? void 0 : t.startDate]
2733
+ ), u = R(
2734
+ () => {
2735
+ var S;
2736
+ return ((S = t == null ? void 0 : t.endDate) == null ? void 0 : S.length) === l.length ? ut(t.endDate, n) : void 0;
2737
+ },
2738
+ [l.length, n, t == null ? void 0 : t.endDate]
2739
+ ), [p, h] = T(
2740
+ r ?? d ?? /* @__PURE__ */ new Date()
2741
+ ), f = D(
2742
+ (S) => {
2743
+ rt(S, c) || G(S, c) ? h(S) : h(c);
2744
+ },
2745
+ [c]
2746
+ ), g = R(
2747
+ () => Kt(
2748
+ p.getFullYear(),
2749
+ p.getMonth(),
2750
+ s
2751
+ ),
2752
+ [s, p]
2753
+ ), M = R(() => Tt(W(p, "MMMM yyyy", { locale: s })), [s, p]), y = R(() => rt(c, p), [c, p]), [b, w] = T(), [m, k] = T("calendar"), E = D(
2754
+ (S) => {
2755
+ var K, j;
2756
+ const v = ((K = S == null ? void 0 : S.startDate) == null ? void 0 : K.length) === l.length ? ut(S.startDate, n) : void 0, U = ((j = S == null ? void 0 : S.endDate) == null ? void 0 : j.length) === l.length ? ut(S.endDate, n) : void 0;
2757
+ v ? f(v) : U && f(U), e == null || e({
2758
+ ...t,
2759
+ ...S
2760
+ });
2761
+ },
2762
+ [
2763
+ l.length,
2764
+ n,
2765
+ e,
2766
+ f,
2767
+ t
2768
+ ]
2769
+ ), A = R(
2770
+ () => rt(c, p) || nt(p, c),
2771
+ [c, p]
2772
+ ), N = R(
2773
+ () => (d && u && (P(d, u) || nt(d, u))) ?? !1,
2774
+ [u, d]
2775
+ );
2776
+ return {
2777
+ isDateDisabled: D(
2778
+ (S) => !P(S, c) && nt(S, c),
2779
+ [c]
2780
+ ),
2781
+ onClickDate: (S) => {
2782
+ S.getFullYear() === p.getFullYear() && S.getMonth() === p.getMonth() && (d && u == null ? nt(S, d) ? e == null || e({
2783
+ startDate: yt(S, n),
2784
+ endDate: void 0
2785
+ }) : e == null || e({
2786
+ startDate: t == null ? void 0 : t.startDate,
2787
+ endDate: yt(S, n)
2788
+ }) : e == null || e({
2789
+ startDate: yt(S, n),
2790
+ endDate: void 0
2791
+ }));
2792
+ },
2793
+ onValueChangeByInputs: E,
2794
+ isValidDateRange: N,
2795
+ prevMonthDisabled: A,
2796
+ monthPickerButtonRef: a,
2797
+ calendarId: i,
2798
+ monthPickerButtonLabel: M,
2799
+ visiblePanel: m,
2800
+ setVisiblePanel: k,
2801
+ setVisibleMonth: h,
2802
+ visibleMonthData: g,
2803
+ todayIsInVisibleMonth: y,
2804
+ hoverDate: b,
2805
+ setHoverDate: w,
2806
+ selectedStartDate: d,
2807
+ selectedEndDate: u,
2808
+ today: c,
2809
+ visibleMonth: p
2810
+ };
2811
+ }, qt = ({
2812
+ previousMonthButtonAriaLabel: t,
2813
+ nextMonthButtonAriaLabel: e,
2814
+ monthPickerButtonLabel: n,
2815
+ visiblePanel: r,
2816
+ setVisiblePanel: s,
2817
+ monthPickerButtonRef: i,
2818
+ setVisibleMonth: c,
2819
+ visibleMonth: a,
2820
+ prevMonthDisabled: l
2821
+ }) => /* @__PURE__ */ x(B, { alignSelf: "center", justifyContent: "space-between", width: "100%", children: [
2822
+ /* @__PURE__ */ o(
2823
+ q,
2824
+ {
2825
+ "aria-live": "polite",
2826
+ label: n,
2827
+ rightIcon: r === "calendar" ? ae : on,
2828
+ onClick: () => s(
2829
+ r === "calendar" ? "month-picker" : "calendar"
2830
+ ),
2831
+ ref: i
2832
+ }
2833
+ ),
2834
+ /* @__PURE__ */ x(B, { alignItems: "center", gap: 2, children: [
2835
+ /* @__PURE__ */ o(
2836
+ ct,
2837
+ {
2838
+ leftIcon: vt,
2839
+ onClick: () => c(de(a, 1)),
2840
+ disabled: l,
2841
+ "aria-label": t
2842
+ }
2843
+ ),
2844
+ /* @__PURE__ */ o(
2845
+ ct,
2846
+ {
2847
+ leftIcon: Et,
2848
+ onClick: () => c(xt(a, 1)),
2849
+ "aria-label": e
2850
+ }
2851
+ )
2852
+ ] })
2853
+ ] }), Kr = "_travelDateCell_1g60o_1", Jr = "_outline_1g60o_13", Gr = "_contentWrapper_1g60o_26", qr = "_disabled_1g60o_47", Qr = "_isToday_1g60o_50", Xr = "_isSelectionStart_1g60o_54", Zr = "_isSelectionEnd_1g60o_55", Vr = "_hover_1g60o_70", ts = "_startSelected_1g60o_73", es = "_endSelected_1g60o_73", V = {
2854
+ travelDateCell: Kr,
2855
+ outline: Jr,
2856
+ contentWrapper: Gr,
2857
+ disabled: qr,
2858
+ isToday: Qr,
2859
+ isSelectionStart: Xr,
2860
+ isSelectionEnd: Zr,
2861
+ hover: Vr,
2862
+ startSelected: ts,
2863
+ endSelected: es
2864
+ }, it = Ct("--lhds-color-red-100"), ns = (t, e, n, r, s, i) => {
2865
+ if (!s)
2866
+ return {
2867
+ left: "transparent",
2868
+ right: "transparent"
2869
+ };
2870
+ if (e && n && P(e, n))
2871
+ return {
2872
+ left: "transparent",
2873
+ right: "transparent"
2874
+ };
2875
+ if (e && n && !i)
2876
+ return {
2877
+ left: "transparent",
2878
+ right: "transparent"
2879
+ };
2880
+ const c = e && n ? G(t, e) && nt(t, n) && !P(t, e) && !P(t, n) : !1, a = e && r ? G(t, e) && nt(t, r) && !P(t, e) && !P(t, r) : !1;
2881
+ if (c)
2882
+ return {
2883
+ left: it,
2884
+ right: it
2885
+ };
2886
+ if (e && n)
2887
+ return P(t, e) ? {
2888
+ left: "transparent",
2889
+ right: it
2890
+ } : P(t, n) ? {
2891
+ left: it,
2892
+ right: "transparent"
2893
+ } : {
2894
+ left: "transparent",
2895
+ right: "transparent"
2896
+ };
2897
+ if (e && r && G(r, e)) {
2898
+ if (P(t, e))
2899
+ return {
2900
+ left: "transparent",
2901
+ right: it
2902
+ };
2903
+ if (P(t, r))
2904
+ return {
2905
+ left: it,
2906
+ right: "transparent"
2907
+ };
2908
+ }
2909
+ return a ? {
2910
+ left: it,
2911
+ right: it
2912
+ } : {
2913
+ left: "transparent",
2914
+ right: "transparent"
2915
+ };
2916
+ }, rs = (t, e) => {
2917
+ switch (e) {
2918
+ case "PageUp":
2919
+ return de(t, 1);
2920
+ case "PageDown":
2921
+ return xt(t, 1);
2922
+ case "Home":
2923
+ return $t(t);
2924
+ case "End":
2925
+ return J($t(t), 6);
2926
+ case "ArrowLeft":
2927
+ return lt(t, 1);
2928
+ case "ArrowUp":
2929
+ return lt(t, 7);
2930
+ case "ArrowRight":
2931
+ return J(t, 1);
2932
+ case "ArrowDown":
2933
+ return J(t, 7);
2934
+ default:
2935
+ return;
2936
+ }
2937
+ }, Vt = (t, e) => W(Le(t, 12), st.fullDate) + e, ss = ({
2938
+ onClick: t,
2939
+ visibleMonth: e,
2940
+ onChangeVisibleMonth: n,
2941
+ day: r,
2942
+ isValidDateRange: s,
2943
+ selectedStartDate: i,
2944
+ selectedEndDate: c,
2945
+ onStartHover: a,
2946
+ onEndHover: l,
2947
+ hoverDate: d,
2948
+ today: u,
2949
+ todayIsInVisibleMonth: p,
2950
+ calendarId: h,
2951
+ isDateDisabled: f
2952
+ }) => {
2953
+ const g = D(
2954
+ async (E) => {
2955
+ var N;
2956
+ const A = rs(r.date, E.key);
2957
+ A && !f(A) && (a(A), rt(r.date, A) ? (N = document.getElementById(Vt(A, h))) == null || N.focus() : (n(A), setTimeout(() => {
2958
+ var I;
2959
+ (I = document.getElementById(Vt(A, h))) == null || I.focus();
2960
+ }, 10))), (E.key === "Enter" || E.code === "Space") && t(r.date);
2961
+ },
2962
+ [
2963
+ h,
2964
+ r.date,
2965
+ f,
2966
+ n,
2967
+ t,
2968
+ a
2969
+ ]
2970
+ ), M = r.month === e.getMonth(), y = f(r.date), b = i ? P(i, r.date) : !1, w = c ? P(c, r.date) : !1, m = P(r.date, u), k = ns(
2971
+ r.date,
2972
+ i,
2973
+ c,
2974
+ d,
2975
+ M,
2976
+ s
2977
+ );
2978
+ return /* @__PURE__ */ x(
2979
+ "td",
2980
+ {
2981
+ className: V.travelDateCell,
2982
+ onClick: y ? void 0 : () => t(r.date),
2983
+ onMouseOver: y ? void 0 : () => M && a(r.date),
2984
+ onMouseOut: y ? void 0 : () => M && l(r.date),
2985
+ tabIndex: y ? void 0 : is(
2986
+ r,
2987
+ i,
2988
+ m,
2989
+ e,
2990
+ p
2991
+ ),
2992
+ id: y ? void 0 : Vt(r.date, h),
2993
+ onKeyDown: y ? void 0 : g,
2994
+ "aria-selected": b || w,
2995
+ children: [
2996
+ /* @__PURE__ */ o("div", { className: V.outline }),
2997
+ /* @__PURE__ */ x(B, { children: [
2998
+ /* @__PURE__ */ o(L, { height: "48px", width: "24px", background: k.left }),
2999
+ /* @__PURE__ */ o(L, { height: "48px", width: "24px", background: k.right })
3000
+ ] }),
3001
+ M && /* @__PURE__ */ o(
3002
+ "div",
3003
+ {
3004
+ className: jt(
3005
+ V.contentWrapper,
3006
+ m ? V.isToday : void 0,
3007
+ i ? V.startSelected : void 0,
3008
+ c ? V.endSelected : void 0,
3009
+ d && P(d, r.date) ? V.hover : void 0,
3010
+ b && V.isSelectionStart,
3011
+ w && V.isSelectionEnd,
3012
+ y && V.disabled
3013
+ ),
3014
+ children: /* @__PURE__ */ o(
3015
+ pt,
3016
+ {
3017
+ variant: "bold",
3018
+ color: y ? Ct("--lhds-color-ui-500") : void 0,
3019
+ children: r.dayOfMonth
3020
+ }
3021
+ )
3022
+ }
3023
+ )
3024
+ ]
3025
+ }
3026
+ );
3027
+ }, is = (t, e, n, r, s) => {
3028
+ const i = e ? rt(e, r) : !1;
3029
+ return (e && i ? P(t.date, e) : n) || !i && !s && t.date.getDate() === 1 ? 0 : -1;
3030
+ }, os = "_travelCalendar_18pjj_1", cs = {
3031
+ travelCalendar: os
3032
+ }, Qt = ({
3033
+ visibleMonthData: t,
3034
+ onClickDate: e,
3035
+ setHoverDate: n,
3036
+ setVisibleMonth: r,
3037
+ visibleMonth: s,
3038
+ isValidDateRange: i,
3039
+ selectedStartDate: c,
3040
+ selectedEndDate: a,
3041
+ hoverDate: l,
3042
+ today: d,
3043
+ calendarId: u,
3044
+ isDateDisabled: p,
3045
+ todayIsInVisibleMonth: h
3046
+ }) => /* @__PURE__ */ o("table", { className: cs.travelCalendar, children: /* @__PURE__ */ x("tbody", { children: [
3047
+ /* @__PURE__ */ o("tr", { children: t.weeks[0].days.map((f) => /* @__PURE__ */ o("th", { abbr: f.fullName, children: /* @__PURE__ */ o(pt, { children: f.name }) }, f.name)) }),
3048
+ t.weeks.map((f) => /* @__PURE__ */ o(fe.Fragment, { children: /* @__PURE__ */ o("tr", { children: f.days.map((g) => /* @__PURE__ */ o(
3049
+ ss,
3050
+ {
3051
+ onClick: (M) => e(M),
3052
+ visibleMonth: s,
3053
+ onChangeVisibleMonth: r,
3054
+ isValidDateRange: i,
3055
+ day: g,
3056
+ onStartHover: (M) => n(M),
3057
+ onEndHover: (M) => n((y) => y && P(y, M) ? void 0 : y),
3058
+ selectedStartDate: c,
3059
+ selectedEndDate: a,
3060
+ hoverDate: l,
3061
+ today: d,
3062
+ todayIsInVisibleMonth: h,
3063
+ calendarId: u,
3064
+ isDateDisabled: p
3065
+ },
3066
+ g.dateString
3067
+ )) }, f.weekNumber) }, f.weekNumber))
3068
+ ] }) }), as = "_travelDateRangeInput_1j7rp_1", ls = "_overlay_1j7rp_2", ds = "_calendarVisible_1j7rp_6", te = {
3069
+ travelDateRangeInput: as,
3070
+ overlay: ls,
3071
+ calendarVisible: ds
3072
+ }, Fs = ({
3073
+ value: t,
3074
+ onValueChange: e,
3075
+ startDateLabel: n,
3076
+ endDateLabel: r,
3077
+ localeCode: s = "sv",
3078
+ initialMonthInFocus: i,
3079
+ previousMonthButtonAriaLabel: c = "Previous month",
3080
+ nextMonthButtonAriaLabel: a = "Next month",
3081
+ heading: l,
3082
+ headingLevel: d,
3083
+ numMonthsInMonthPicker: u = 12,
3084
+ firstMonthInMonthPicker: p = /* @__PURE__ */ new Date(),
3085
+ zIndex: h = 1e3,
3086
+ zIndexWhenClosed: f,
3087
+ onHideCalendar: g,
3088
+ renderBelowCalendar: M
3089
+ }) => {
3090
+ const [y, b] = T(!1), [w, m] = T(!1), [k, E] = T({
3091
+ // Sane defaults, this will be updated with actual data from DOM.
3092
+ width: 336,
3093
+ height: 66
3094
+ }), A = $(!1), N = D(() => {
3095
+ A.current = !0, m(!0), setTimeout(() => {
3096
+ b(!0);
3097
+ }, 10);
3098
+ }, []), I = D(() => {
3099
+ w && (b(!1), A.current = !1, g == null || g(), setTimeout(() => {
3100
+ A.current || m(!1);
3101
+ }, 120));
3102
+ }, [w, g]), Y = $(null), S = $(null);
3103
+ Se(Y, I), Pe(() => {
3104
+ var H, z;
3105
+ const _ = (H = S.current) == null ? void 0 : H.offsetWidth, O = (z = S.current) == null ? void 0 : z.offsetHeight;
3106
+ _ != null && O != null && (k.height !== O || k.width !== _) && E({ width: _, height: O });
3107
+ }, [k.height, k.width]);
3108
+ const v = Je(
3109
+ t,
3110
+ e,
3111
+ s,
3112
+ i
3113
+ ), {
3114
+ visiblePanel: U,
3115
+ visibleMonth: K,
3116
+ onValueChangeByInputs: j,
3117
+ setVisibleMonth: Z,
3118
+ setVisiblePanel: F,
3119
+ monthPickerButtonRef: Q
3120
+ } = v, tt = D(
3121
+ (_) => {
3122
+ _.key === "Escape" && I();
3123
+ },
3124
+ [I]
3125
+ );
3126
+ return /* @__PURE__ */ x(
3127
+ L,
3128
+ {
3129
+ position: "relative",
3130
+ className: te.travelDateRangeInput,
3131
+ ref: Y,
3132
+ onKeyDown: tt,
3133
+ height: k.height,
3134
+ width: k.width,
3135
+ children: [
3136
+ /* @__PURE__ */ o(
3137
+ L,
3138
+ {
3139
+ position: "absolute",
3140
+ ref: S,
3141
+ zIndex: w ? h : f,
3142
+ children: /* @__PURE__ */ o(
3143
+ Ke,
3144
+ {
3145
+ value: t,
3146
+ onValueChange: j,
3147
+ localeCode: s,
3148
+ startDateLabel: n,
3149
+ endDateLabel: r,
3150
+ onFocus: N
3151
+ }
3152
+ )
3153
+ }
3154
+ ),
3155
+ w && /* @__PURE__ */ o(
3156
+ L,
3157
+ {
3158
+ position: "absolute",
3159
+ zIndex: h - 1,
3160
+ left: "-2.4rem",
3161
+ top: l ? "-8.0rem" : "-2.4rem",
3162
+ className: jt(te.overlay, y && te.calendarVisible),
3163
+ children: /* @__PURE__ */ o(
3164
+ L,
3165
+ {
3166
+ background: "white",
3167
+ shadow: "popover",
3168
+ borderRadius: "var(--swui-border-radius-large)",
3169
+ children: /* @__PURE__ */ x(Re, { gap: 3, children: [
3170
+ l && /* @__PURE__ */ o(Rt, { variant: "h2", as: d, children: l }),
3171
+ /* @__PURE__ */ o(L, { height: "6.8rem" }),
3172
+ /* @__PURE__ */ o(
3173
+ qt,
3174
+ {
3175
+ ...v,
3176
+ previousMonthButtonAriaLabel: c,
3177
+ nextMonthButtonAriaLabel: a
3178
+ }
3179
+ ),
3180
+ U === "calendar" && /* @__PURE__ */ o(Qt, { ...v }),
3181
+ U === "month-picker" && /* @__PURE__ */ o(
3182
+ Nt,
3183
+ {
3184
+ firstMonth: p,
3185
+ numMonths: u,
3186
+ value: K,
3187
+ onValueChange: (_) => {
3188
+ var O;
3189
+ Z(_), F("calendar"), (O = Q.current) == null || O.focus();
3190
+ },
3191
+ onCancel: () => {
3192
+ var _;
3193
+ F("calendar"), (_ = Q.current) == null || _.focus();
3194
+ }
3195
+ }
3196
+ ),
3197
+ M == null ? void 0 : M({ hideCalendar: I })
3198
+ ] })
3199
+ }
3200
+ )
3201
+ }
3202
+ )
3203
+ ]
3204
+ }
3205
+ );
3206
+ }, us = "_travelDateInput_hmfbf_1", fs = "_overlay_hmfbf_2", hs = "_calendarVisible_hmfbf_6", ee = {
3207
+ travelDateInput: us,
3208
+ overlay: fs,
3209
+ calendarVisible: hs
3210
+ }, Ge = ({ value: t, onValueChange: e, label: n = "Date", localeCode: r, onFocus: s }) => {
3211
+ const { mask: i, placeholder: c } = R(() => {
3212
+ const a = wt(r);
3213
+ return {
3214
+ mask: Fe(a),
3215
+ placeholder: a.toLowerCase()
3216
+ };
3217
+ }, [r]);
3218
+ return /* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(
3219
+ oe,
3220
+ {
3221
+ mask: i,
3222
+ value: t,
3223
+ onValueChange: e,
3224
+ onBlur: (a) => {
3225
+ const l = ce(a.target.value, r);
3226
+ l && l !== t && (e == null || e(l));
3227
+ },
3228
+ onFocus: s,
3229
+ label: n,
3230
+ placeholder: c
3231
+ }
3232
+ ) });
3233
+ }, qe = (t, e, n, r) => {
3234
+ const s = Gt(n) ?? Ce(), i = he(), c = me(), a = $(null), l = R(
3235
+ () => wt(n),
3236
+ [n]
3237
+ ), d = R(
3238
+ () => (t == null ? void 0 : t.length) === l.length ? ut(t, n) : void 0,
3239
+ [l.length, n, t]
3240
+ ), [u, p] = T(
3241
+ r ?? d ?? /* @__PURE__ */ new Date()
3242
+ ), h = D(
3243
+ (I) => {
3244
+ rt(I, c) || G(I, c) ? p(I) : p(c);
3245
+ },
3246
+ [c]
3247
+ ), f = R(
3248
+ () => Kt(
3249
+ u.getFullYear(),
3250
+ u.getMonth(),
3251
+ s
3252
+ ),
3253
+ [s, u]
3254
+ ), g = R(() => Tt(W(u, "MMMM yyyy", { locale: s })), [s, u]), M = R(() => rt(c, u), [c, u]), [y, b] = T(), [w, m] = T("calendar"), k = D(
3255
+ (I) => {
3256
+ const Y = (I == null ? void 0 : I.length) === l.length ? ut(I, n) : void 0;
3257
+ Y && h(Y), e == null || e(I);
3258
+ },
3259
+ [l.length, n, e, h]
3260
+ ), E = R(
3261
+ () => rt(c, u) || nt(u, c),
3262
+ [c, u]
3263
+ );
3264
+ return {
3265
+ isDateDisabled: D(
3266
+ (I) => !P(I, c) && nt(I, c),
3267
+ [c]
3268
+ ),
3269
+ onClickDate: (I) => {
3270
+ e == null || e(yt(I, n));
3271
+ },
3272
+ onValueChangeByInputs: k,
3273
+ prevMonthDisabled: E,
3274
+ monthPickerButtonRef: a,
3275
+ calendarId: i,
3276
+ monthPickerButtonLabel: g,
3277
+ visiblePanel: w,
3278
+ setVisiblePanel: m,
3279
+ setVisibleMonth: p,
3280
+ visibleMonthData: f,
3281
+ todayIsInVisibleMonth: M,
3282
+ hoverDate: y,
3283
+ setHoverDate: b,
3284
+ selectedDate: d,
3285
+ today: c,
3286
+ visibleMonth: u
3287
+ };
3288
+ }, js = ({
3289
+ value: t,
3290
+ onValueChange: e,
3291
+ label: n,
3292
+ localeCode: r = "sv",
3293
+ initialMonthInFocus: s,
3294
+ previousMonthButtonAriaLabel: i = "Previous month",
3295
+ nextMonthButtonAriaLabel: c = "Next month",
3296
+ heading: a,
3297
+ headingLevel: l,
3298
+ numMonthsInMonthPicker: d = 12,
3299
+ firstMonthInMonthPicker: u = /* @__PURE__ */ new Date(),
3300
+ zIndex: p = 1e3,
3301
+ zIndexWhenClosed: h,
3302
+ onHideCalendar: f,
3303
+ renderBelowCalendar: g
3304
+ }) => {
3305
+ const [M, y] = T(!1), [b, w] = T(!1), [m, k] = T({
3306
+ // Sane defaults, this will be updated with actual data from DOM.
3307
+ width: 336,
3308
+ height: 66
3309
+ }), E = $(!1), A = D(() => {
3310
+ E.current = !0, w(!0), setTimeout(() => {
3311
+ y(!0);
3312
+ }, 10);
3313
+ }, []), N = D(() => {
3314
+ b && (y(!1), E.current = !1, f == null || f(), setTimeout(() => {
3315
+ E.current || w(!1);
3316
+ }, 120));
3317
+ }, [b, f]), I = $(null), Y = $(null);
3318
+ Se(I, N), Pe(() => {
3319
+ var H, z;
3320
+ const _ = (H = Y.current) == null ? void 0 : H.offsetWidth, O = (z = Y.current) == null ? void 0 : z.offsetHeight;
3321
+ _ != null && O != null && (m.height !== O || m.width !== _) && k({ width: _, height: O });
3322
+ }, [m.height, m.width]);
3323
+ const S = qe(
3324
+ t,
3325
+ e,
3326
+ r,
3327
+ s
3328
+ ), {
3329
+ visiblePanel: v,
3330
+ visibleMonth: U,
3331
+ onValueChangeByInputs: K,
3332
+ selectedDate: j,
3333
+ setVisibleMonth: Z,
3334
+ setVisiblePanel: F,
3335
+ monthPickerButtonRef: Q
3336
+ } = S, tt = D(
3337
+ (_) => {
3338
+ _.key === "Escape" && N();
3339
+ },
3340
+ [N]
3341
+ );
3342
+ return /* @__PURE__ */ x(
3343
+ L,
3344
+ {
3345
+ position: "relative",
3346
+ className: ee.travelDateInput,
3347
+ ref: I,
3348
+ onKeyDown: tt,
3349
+ height: m.height,
3350
+ width: m.width,
3351
+ children: [
3352
+ /* @__PURE__ */ o(
3353
+ L,
3354
+ {
3355
+ position: "absolute",
3356
+ ref: Y,
3357
+ zIndex: b ? p : h,
3358
+ children: /* @__PURE__ */ o(
3359
+ Ge,
3360
+ {
3361
+ value: t,
3362
+ onValueChange: K,
3363
+ localeCode: r,
3364
+ label: n,
3365
+ onFocus: A
3366
+ }
3367
+ )
3368
+ }
3369
+ ),
3370
+ b && /* @__PURE__ */ o(
3371
+ L,
3372
+ {
3373
+ position: "absolute",
3374
+ zIndex: p - 1,
3375
+ left: "-2.4rem",
3376
+ top: a ? "-8.0rem" : "-2.4rem",
3377
+ className: jt(ee.overlay, M && ee.calendarVisible),
3378
+ children: /* @__PURE__ */ o(
3379
+ L,
3380
+ {
3381
+ background: "white",
3382
+ shadow: "popover",
3383
+ borderRadius: "var(--swui-border-radius-large)",
3384
+ children: /* @__PURE__ */ x(Re, { gap: 3, children: [
3385
+ a && /* @__PURE__ */ o(Rt, { variant: "h2", as: l, children: a }),
3386
+ /* @__PURE__ */ o(L, { height: "6.8rem" }),
3387
+ /* @__PURE__ */ o(
3388
+ qt,
3389
+ {
3390
+ ...S,
3391
+ previousMonthButtonAriaLabel: i,
3392
+ nextMonthButtonAriaLabel: c
3393
+ }
3394
+ ),
3395
+ v === "calendar" && /* @__PURE__ */ o(
3396
+ Qt,
3397
+ {
3398
+ ...S,
3399
+ isValidDateRange: !!j,
3400
+ selectedStartDate: j,
3401
+ selectedEndDate: j
3402
+ }
3403
+ ),
3404
+ v === "month-picker" && /* @__PURE__ */ o(
3405
+ Nt,
3406
+ {
3407
+ firstMonth: u,
3408
+ numMonths: d,
3409
+ value: U,
3410
+ onValueChange: (_) => {
3411
+ var O;
3412
+ Z(_), F("calendar"), (O = Q.current) == null || O.focus();
3413
+ },
3414
+ onCancel: () => {
3415
+ var _;
3416
+ F("calendar"), (_ = Q.current) == null || _.focus();
3417
+ }
3418
+ }
3419
+ ),
3420
+ g == null ? void 0 : g({ hideCalendar: N })
3421
+ ] })
3422
+ }
3423
+ )
3424
+ }
3425
+ )
3426
+ ]
3427
+ }
3428
+ );
3429
+ }, Cs = ({
3430
+ value: t,
3431
+ onValueChange: e,
3432
+ label: n,
3433
+ localeCode: r = "sv",
3434
+ initialMonthInFocus: s,
3435
+ previousMonthButtonAriaLabel: i = "Previous month",
3436
+ nextMonthButtonAriaLabel: c = "Next month",
3437
+ heading: a,
3438
+ headingLevel: l,
3439
+ numMonthsInMonthPicker: d = 12,
3440
+ firstMonthInMonthPicker: u = /* @__PURE__ */ new Date()
3441
+ }) => {
3442
+ const p = qe(
3443
+ t,
3444
+ e,
3445
+ r,
3446
+ s
3447
+ ), {
3448
+ visiblePanel: h,
3449
+ visibleMonth: f,
3450
+ onValueChangeByInputs: g,
3451
+ setVisibleMonth: M,
3452
+ setVisiblePanel: y,
3453
+ monthPickerButtonRef: b,
3454
+ selectedDate: w
3455
+ } = p;
3456
+ return /* @__PURE__ */ x(C, { gap: 3, children: [
3457
+ a && /* @__PURE__ */ o(Rt, { variant: "h2", as: l, children: a }),
3458
+ /* @__PURE__ */ o(
3459
+ Ge,
3460
+ {
3461
+ value: t,
3462
+ onValueChange: g,
3463
+ localeCode: r,
3464
+ label: n
3465
+ }
3466
+ ),
3467
+ /* @__PURE__ */ o(
3468
+ qt,
3469
+ {
3470
+ ...p,
3471
+ previousMonthButtonAriaLabel: i,
3472
+ nextMonthButtonAriaLabel: c
3473
+ }
3474
+ ),
3475
+ h === "calendar" && /* @__PURE__ */ o(
3476
+ Qt,
3477
+ {
3478
+ ...p,
3479
+ selectedStartDate: w,
3480
+ selectedEndDate: w,
3481
+ isValidDateRange: !!w
3482
+ }
3483
+ ),
3484
+ h === "month-picker" && /* @__PURE__ */ o(
3485
+ Nt,
3486
+ {
3487
+ firstMonth: u,
3488
+ numMonths: d,
3489
+ value: f,
3490
+ onValueChange: (m) => {
3491
+ var k;
3492
+ M(m), y("calendar"), (k = b.current) == null || k.focus();
3493
+ },
3494
+ onCancel: () => {
3495
+ var m;
3496
+ y("calendar"), (m = b.current) == null || m.focus();
3497
+ }
3498
+ }
3499
+ )
3500
+ ] });
3501
+ }, Ks = ({
3502
+ value: t,
3503
+ onValueChange: e,
3504
+ startDateLabel: n,
3505
+ endDateLabel: r,
3506
+ localeCode: s = "sv",
3507
+ initialMonthInFocus: i,
3508
+ previousMonthButtonAriaLabel: c = "Previous month",
3509
+ nextMonthButtonAriaLabel: a = "Next month",
3510
+ heading: l,
3511
+ headingLevel: d,
3512
+ numMonthsInMonthPicker: u = 12,
3513
+ firstMonthInMonthPicker: p = /* @__PURE__ */ new Date()
3514
+ }) => {
3515
+ const h = Je(
3516
+ t,
3517
+ e,
3518
+ s,
3519
+ i
3520
+ ), {
3521
+ visiblePanel: f,
3522
+ visibleMonth: g,
3523
+ onValueChangeByInputs: M,
3524
+ setVisibleMonth: y,
3525
+ setVisiblePanel: b,
3526
+ monthPickerButtonRef: w
3527
+ } = h;
3528
+ return /* @__PURE__ */ x(C, { gap: 3, children: [
3529
+ l && /* @__PURE__ */ o(Rt, { variant: "h2", as: d, children: l }),
3530
+ /* @__PURE__ */ o(
3531
+ Ke,
3532
+ {
3533
+ value: t,
3534
+ onValueChange: M,
3535
+ localeCode: s,
3536
+ startDateLabel: n,
3537
+ endDateLabel: r
3538
+ }
3539
+ ),
3540
+ /* @__PURE__ */ o(
3541
+ qt,
3542
+ {
3543
+ ...h,
3544
+ previousMonthButtonAriaLabel: c,
3545
+ nextMonthButtonAriaLabel: a
3546
+ }
3547
+ ),
3548
+ f === "calendar" && /* @__PURE__ */ o(Qt, { ...h }),
3549
+ f === "month-picker" && /* @__PURE__ */ o(
3550
+ Nt,
3551
+ {
3552
+ firstMonth: p,
3553
+ numMonths: u,
3554
+ value: g,
3555
+ onValueChange: (m) => {
3556
+ var k;
3557
+ y(m), b("calendar"), (k = w.current) == null || k.focus();
3558
+ },
3559
+ onCancel: () => {
3560
+ var m;
3561
+ b("calendar"), (m = w.current) == null || m.focus();
3562
+ }
3563
+ }
3564
+ )
3565
+ ] });
3566
+ };
2505
3567
  export {
2506
- Ut as Calendar,
2507
- le as CalendarDay,
2508
- Hn as DateInput,
2509
- Nn as DateRangeCalendar,
2510
- Bn as DateRangeDualTextInput,
2511
- Pn as DateRangeInput,
2512
- Un as DateTextInput,
2513
- Wn as DateTimeInput,
2514
- ae as Month,
2515
- Ar as MonthPicker,
2516
- Ln as MultiDateCalendar,
2517
- Nr as PresetPicker,
2518
- he as SingleDateCalendar,
2519
- Yn as SingleWeekCalendar,
2520
- $n as TimeTextInput,
2521
- or as WeekDay,
2522
- wr as WeekDayCell,
2523
- pr as WeekNumberCell,
2524
- On as YearPicker,
2525
- F as addDayStateHighlights,
2526
- oe as addDayStateHighlightsOnSingleDay,
2527
- ir as addWeekRangeHighlights,
2528
- An as addWeekStateHighlights,
2529
- wt as buildDayStateForDateRange,
2530
- sr as buildDayStateForRange,
2531
- nr as buildDayStateForSingleMonth,
2532
- ur as calculateOverflowingMonth,
2533
- dr as createDay,
2534
- Gt as createFirstDate,
2535
- Ur as dateRangeToStrings,
2536
- Dr as dayHasHighlight,
2537
- G as dayHighlightSelect,
2538
- et as defaultCalendarTheme,
2539
- mr as defaultTextPropsProvider,
2540
- gr as defaultWrapperStyleProvider,
2541
- xn as extranetCalendarTheme,
2542
- zn as formatLocalizedDate,
2543
- we as getDateFormatForLocaleCode,
2544
- lr as getDaysForWeekForDate,
2545
- ye as getLocaleForLocaleCode,
2546
- de as getMonthInYear,
2547
- Jt as getMonthsInYear,
2548
- zt as getWeekForDate,
2549
- ar as getWeeksForMonth,
2550
- ue as isDateRangeInvalid,
2551
- jn as parseLocalizedDateString,
2552
- En as setDayStateValue,
2553
- Rn as setDayStateValueFunction,
2554
- $r as stringsToDateRange,
2555
- Cn as toggleDateStringsIfEndIsEarlierThanStart,
2556
- fe as toggleDatesIfEndIsEarlierThanStart,
2557
- In as useDateRangeCalendarState,
2558
- Or as useDateRangeSelection,
2559
- zr as useMultiDateSelection,
2560
- Br as useSingleDateSelection,
2561
- jr as useSingleWeekSelection
3568
+ se as Calendar,
3569
+ Be as CalendarDay,
3570
+ Os as DateInput,
3571
+ _s as DateRangeCalendar,
3572
+ zs as DateRangeDualTextInput,
3573
+ Hs as DateRangeInput,
3574
+ $s as DateTextInput,
3575
+ Ws as DateTimeInput,
3576
+ Bn as Month,
3577
+ Nt as MonthPicker,
3578
+ Ys as MultiDateCalendar,
3579
+ or as PresetPicker,
3580
+ Ue as SingleDateCalendar,
3581
+ Bs as SingleWeekCalendar,
3582
+ Us as TimeTextInput,
3583
+ Cs as TravelDateCalendar,
3584
+ js as TravelDateInput,
3585
+ Ks as TravelDateRangeCalendar,
3586
+ Fs as TravelDateRangeInput,
3587
+ On as WeekDay,
3588
+ Kn as WeekDayCell,
3589
+ Gn as WeekNumberCell,
3590
+ vs as YearPicker,
3591
+ at as addDayStateHighlights,
3592
+ Ye as addDayStateHighlightsOnSingleDay,
3593
+ Pn as addWeekRangeHighlights,
3594
+ As as addWeekStateHighlights,
3595
+ It as buildDayStateForDateRange,
3596
+ _n as buildDayStateForRange,
3597
+ Ln as buildDayStateForSingleMonth,
3598
+ Wn as calculateOverflowingMonth,
3599
+ $n as createDay,
3600
+ fr as dateRangeToStrings,
3601
+ Fn as dayHasHighlight,
3602
+ ot as dayHighlightSelect,
3603
+ mt as defaultCalendarTheme,
3604
+ Cn as defaultTextPropsProvider,
3605
+ jn as defaultWrapperStyleProvider,
3606
+ Ns as extranetCalendarTheme,
3607
+ yt as formatLocalizedDate,
3608
+ wt as getDateFormatForLocaleCode,
3609
+ Un as getDaysForWeekForDate,
3610
+ Ce as getDefaultLocaleForFormatting,
3611
+ Gt as getLocaleForLocaleCode,
3612
+ Kt as getMonthInYear,
3613
+ be as getMonthsInYear,
3614
+ pe as getWeekForDate,
3615
+ Hn as getWeeksForMonth,
3616
+ He as isDateRangeInvalid,
3617
+ ut as parseLocalizedDateString,
3618
+ ce as reformatLocalizedDateString,
3619
+ Es as setDayStateValue,
3620
+ xs as setDayStateValueFunction,
3621
+ hr as stringsToDateRange,
3622
+ Ls as toggleDateStringsIfEndIsEarlierThanStart,
3623
+ $e as toggleDatesIfEndIsEarlierThanStart,
3624
+ Ps as useDateRangeCalendarState,
3625
+ mr as useDateRangeSelection,
3626
+ Dr as useMultiDateSelection,
3627
+ gr as useSingleDateSelection,
3628
+ br as useSingleWeekSelection
2562
3629
  };
2563
3630
  //# sourceMappingURL=index.es.js.map