welcome-ui
Version:
Customizable design system with react, typescript, tailwindcss and ariakit.
6,325 lines • 225 kB
JavaScript
"use client";
var sn = Object.defineProperty;
var cn = (a, n, t) => n in a ? sn(a, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[n] = t;
var w = (a, n, t) => cn(a, typeof n != "symbol" ? n + "" : n, t);
import * as S from "react";
import f, { useLayoutEffect as Er, cloneElement as Or, createRef as xe, Component as z, useRef as Lt, useCallback as ln, useEffect as un, createElement as dn } from "react";
import { jsxs as pn, jsx as je } from "react/jsx-runtime";
import * as fn from "react-dom";
import hn from "react-dom";
import { A as mn, L as vn, g as Gt, N as gn, B as Dn } from "./floating-ui.dom.browser.min-Bza9K_UR.js";
function Tr(a) {
var n, t, e = "";
if (typeof a == "string" || typeof a == "number") e += a;
else if (typeof a == "object") if (Array.isArray(a)) {
var r = a.length;
for (n = 0; n < r; n++) a[n] && (t = Tr(a[n])) && (e && (e += " "), e += t);
} else for (t in a) a[t] && (e && (e += " "), e += t);
return e;
}
function J() {
for (var a, n, t = 0, e = "", r = arguments.length; t < r; t++) (a = arguments[t]) && (n = Tr(a)) && (e && (e += " "), e += n);
return e;
}
const Nr = 6048e5, wn = 864e5, _t = 6e4, Mt = 36e5, yn = 1e3, zt = Symbol.for("constructDateFrom");
function H(a, n) {
return typeof a == "function" ? a(n) : a && typeof a == "object" && zt in a ? a[zt](n) : a instanceof Date ? new a.constructor(n) : new Date(n);
}
function k(a, n) {
return H(n || a, a);
}
function se(a, n, t) {
const e = k(a, t == null ? void 0 : t.in);
return isNaN(n) ? H((t == null ? void 0 : t.in) || a, NaN) : (n && e.setDate(e.getDate() + n), e);
}
function ce(a, n, t) {
const e = k(a, t == null ? void 0 : t.in);
if (isNaN(n)) return H(a, NaN);
if (!n)
return e;
const r = e.getDate(), o = H(a, e.getTime());
o.setMonth(e.getMonth() + n + 1, 0);
const i = o.getDate();
return r >= i ? o : (e.setFullYear(
o.getFullYear(),
o.getMonth(),
r
), e);
}
function Yr(a, n, t) {
return H(a, +k(a) + n);
}
function bn(a, n, t) {
return Yr(a, n * Mt);
}
let kn = {};
function Ie() {
return kn;
}
function be(a, n) {
var s, c, u, l;
const t = Ie(), e = (n == null ? void 0 : n.weekStartsOn) ?? ((c = (s = n == null ? void 0 : n.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? t.weekStartsOn ?? ((l = (u = t.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, r = k(a, n == null ? void 0 : n.in), o = r.getDay(), i = (o < e ? 7 : 0) + o - e;
return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r;
}
function Ae(a, n) {
return be(a, { ...n, weekStartsOn: 1 });
}
function Rr(a, n) {
const t = k(a, n == null ? void 0 : n.in), e = t.getFullYear(), r = H(t, 0);
r.setFullYear(e + 1, 0, 4), r.setHours(0, 0, 0, 0);
const o = Ae(r), i = H(t, 0);
i.setFullYear(e, 0, 4), i.setHours(0, 0, 0, 0);
const s = Ae(i);
return t.getTime() >= o.getTime() ? e + 1 : t.getTime() >= s.getTime() ? e : e - 1;
}
function ft(a) {
const n = k(a), t = new Date(
Date.UTC(
n.getFullYear(),
n.getMonth(),
n.getDate(),
n.getHours(),
n.getMinutes(),
n.getSeconds(),
n.getMilliseconds()
)
);
return t.setUTCFullYear(n.getFullYear()), +a - +t;
}
function ke(a, ...n) {
const t = H.bind(
null,
n.find((e) => typeof e == "object")
);
return n.map(t);
}
function Ye(a, n) {
const t = k(a, n == null ? void 0 : n.in);
return t.setHours(0, 0, 0, 0), t;
}
function He(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
), o = Ye(e), i = Ye(r), s = +o - ft(o), c = +i - ft(i);
return Math.round((s - c) / wn);
}
function _n(a, n) {
const t = Rr(a, n), e = H(a, 0);
return e.setFullYear(t, 0, 4), e.setHours(0, 0, 0, 0), Ae(e);
}
function Ft(a, n, t) {
const e = k(a, t == null ? void 0 : t.in);
return e.setTime(e.getTime() + n * _t), e;
}
function Bt(a, n, t) {
return ce(a, n * 3, t);
}
function Mn(a, n, t) {
return Yr(a, n * 1e3);
}
function ht(a, n, t) {
return se(a, n * 7, t);
}
function ve(a, n, t) {
return ce(a, n * 12, t);
}
function Zt(a, n) {
let t, e = n == null ? void 0 : n.in;
return a.forEach((r) => {
!e && typeof r == "object" && (e = H.bind(null, r));
const o = k(r, e);
(!t || t < o || isNaN(+o)) && (t = o);
}), H(e, t || NaN);
}
function Jt(a, n) {
let t, e = n == null ? void 0 : n.in;
return a.forEach((r) => {
!e && typeof r == "object" && (e = H.bind(null, r));
const o = k(r, e);
(!t || t > o || isNaN(+o)) && (t = o);
}), H(e, t || NaN);
}
function Cn(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
);
return +Ye(e) == +Ye(r);
}
function ge(a) {
return a instanceof Date || typeof a == "object" && Object.prototype.toString.call(a) === "[object Date]";
}
function mt(a) {
return !(!ge(a) && typeof a != "number" || isNaN(+k(a)));
}
function vt(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
), o = e.getFullYear() - r.getFullYear(), i = e.getMonth() - r.getMonth();
return o * 12 + i;
}
function Te(a, n) {
const t = k(a, n == null ? void 0 : n.in);
return Math.trunc(t.getMonth() / 3) + 1;
}
function gt(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
), o = e.getFullYear() - r.getFullYear(), i = Te(e) - Te(r);
return o * 4 + i;
}
function Dt(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
);
return e.getFullYear() - r.getFullYear();
}
function Sn(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
), o = er(e, r), i = Math.abs(
He(e, r)
);
e.setDate(e.getDate() - o * i);
const s = +(er(e, r) === -o), c = o * (i - s);
return c === 0 ? 0 : c;
}
function er(a, n) {
const t = a.getFullYear() - n.getFullYear() || a.getMonth() - n.getMonth() || a.getDate() - n.getDate() || a.getHours() - n.getHours() || a.getMinutes() - n.getMinutes() || a.getSeconds() - n.getSeconds() || a.getMilliseconds() - n.getMilliseconds();
return t < 0 ? -1 : t > 0 ? 1 : t;
}
function Ir(a, n) {
const t = k(a, n == null ? void 0 : n.in);
return t.setHours(23, 59, 59, 999), t;
}
function Lr(a, n) {
const t = k(a, n == null ? void 0 : n.in), e = t.getMonth();
return t.setFullYear(t.getFullYear(), e + 1, 0), t.setHours(23, 59, 59, 999), t;
}
function Wt(a, n) {
const t = k(a, n == null ? void 0 : n.in), e = t.getMonth(), r = e - e % 3;
return t.setMonth(r, 1), t.setHours(0, 0, 0, 0), t;
}
function Fr(a, n) {
const t = k(a, n == null ? void 0 : n.in);
return t.setDate(1), t.setHours(0, 0, 0, 0), t;
}
function Wr(a, n) {
const t = k(a, n == null ? void 0 : n.in), e = t.getFullYear();
return t.setFullYear(e + 1, 0, 0), t.setHours(23, 59, 59, 999), t;
}
function Ct(a, n) {
const t = k(a, n == null ? void 0 : n.in);
return t.setFullYear(t.getFullYear(), 0, 1), t.setHours(0, 0, 0, 0), t;
}
function xn(a, n) {
var s, c;
const t = Ie(), e = t.weekStartsOn ?? ((c = (s = t.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? 0, r = k(a, n == null ? void 0 : n.in), o = r.getDay(), i = (o < e ? -7 : 0) + 6 - (o - e);
return r.setDate(r.getDate() + i), r.setHours(23, 59, 59, 999), r;
}
const Pn = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
}, En = (a, n, t) => {
let e;
const r = Pn[a];
return typeof r == "string" ? e = r : n === 1 ? e = r.one : e = r.other.replace("{{count}}", n.toString()), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "in " + e : e + " ago" : e;
};
function Pt(a) {
return (n = {}) => {
const t = n.width ? String(n.width) : a.defaultWidth;
return a.formats[t] || a.formats[a.defaultWidth];
};
}
const On = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
}, Tn = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
}, Nn = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
}, Yn = {
date: Pt({
formats: On,
defaultWidth: "full"
}),
time: Pt({
formats: Tn,
defaultWidth: "full"
}),
dateTime: Pt({
formats: Nn,
defaultWidth: "full"
})
}, Rn = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
}, In = (a, n, t, e) => Rn[a];
function Ke(a) {
return (n, t) => {
const e = t != null && t.context ? String(t.context) : "standalone";
let r;
if (e === "formatting" && a.formattingValues) {
const i = a.defaultFormattingWidth || a.defaultWidth, s = t != null && t.width ? String(t.width) : i;
r = a.formattingValues[s] || a.formattingValues[i];
} else {
const i = a.defaultWidth, s = t != null && t.width ? String(t.width) : a.defaultWidth;
r = a.values[s] || a.values[i];
}
const o = a.argumentCallback ? a.argumentCallback(n) : n;
return r[o];
};
}
const Ln = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
}, Fn = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, Wn = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
]
}, An = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
]
}, Hn = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
}, Qn = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
}, Bn = (a, n) => {
const t = Number(a), e = t % 100;
if (e > 20 || e < 10)
switch (e % 10) {
case 1:
return t + "st";
case 2:
return t + "nd";
case 3:
return t + "rd";
}
return t + "th";
}, Kn = {
ordinalNumber: Bn,
era: Ke({
values: Ln,
defaultWidth: "wide"
}),
quarter: Ke({
values: Fn,
defaultWidth: "wide",
argumentCallback: (a) => a - 1
}),
month: Ke({
values: Wn,
defaultWidth: "wide"
}),
day: Ke({
values: An,
defaultWidth: "wide"
}),
dayPeriod: Ke({
values: Hn,
defaultWidth: "wide",
formattingValues: Qn,
defaultFormattingWidth: "wide"
})
};
function qe(a) {
return (n, t = {}) => {
const e = t.width, r = e && a.matchPatterns[e] || a.matchPatterns[a.defaultMatchWidth], o = n.match(r);
if (!o)
return null;
const i = o[0], s = e && a.parsePatterns[e] || a.parsePatterns[a.defaultParseWidth], c = Array.isArray(s) ? Vn(s, (d) => d.test(i)) : (
// [TODO] -- I challenge you to fix the type
qn(s, (d) => d.test(i))
);
let u;
u = a.valueCallback ? a.valueCallback(c) : c, u = t.valueCallback ? (
// [TODO] -- I challenge you to fix the type
t.valueCallback(u)
) : u;
const l = n.slice(i.length);
return { value: u, rest: l };
};
}
function qn(a, n) {
for (const t in a)
if (Object.prototype.hasOwnProperty.call(a, t) && n(a[t]))
return t;
}
function Vn(a, n) {
for (let t = 0; t < a.length; t++)
if (n(a[t]))
return t;
}
function Un(a) {
return (n, t = {}) => {
const e = n.match(a.matchPattern);
if (!e) return null;
const r = e[0], o = n.match(a.parsePattern);
if (!o) return null;
let i = a.valueCallback ? a.valueCallback(o[0]) : o[0];
i = t.valueCallback ? t.valueCallback(i) : i;
const s = n.slice(r.length);
return { value: i, rest: s };
};
}
const jn = /^(\d+)(th|st|nd|rd)?/i, $n = /\d+/i, Xn = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
}, Gn = {
any: [/^b/i, /^(a|c)/i]
}, zn = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
}, Zn = {
any: [/1/i, /2/i, /3/i, /4/i]
}, Jn = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, ea = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i
],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i
]
}, ta = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, ra = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}, na = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, aa = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
}, oa = {
ordinalNumber: Un({
matchPattern: jn,
parsePattern: $n,
valueCallback: (a) => parseInt(a, 10)
}),
era: qe({
matchPatterns: Xn,
defaultMatchWidth: "wide",
parsePatterns: Gn,
defaultParseWidth: "any"
}),
quarter: qe({
matchPatterns: zn,
defaultMatchWidth: "wide",
parsePatterns: Zn,
defaultParseWidth: "any",
valueCallback: (a) => a + 1
}),
month: qe({
matchPatterns: Jn,
defaultMatchWidth: "wide",
parsePatterns: ea,
defaultParseWidth: "any"
}),
day: qe({
matchPatterns: ta,
defaultMatchWidth: "wide",
parsePatterns: ra,
defaultParseWidth: "any"
}),
dayPeriod: qe({
matchPatterns: na,
defaultMatchWidth: "any",
parsePatterns: aa,
defaultParseWidth: "any"
})
}, Ar = {
code: "en-US",
formatDistance: En,
formatLong: Yn,
formatRelative: In,
localize: Kn,
match: oa,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
function ia(a, n) {
const t = k(a, n == null ? void 0 : n.in);
return He(t, Ct(t)) + 1;
}
function Kt(a, n) {
const t = k(a, n == null ? void 0 : n.in), e = +Ae(t) - +_n(t);
return Math.round(e / Nr) + 1;
}
function qt(a, n) {
var l, d, p, h;
const t = k(a, n == null ? void 0 : n.in), e = t.getFullYear(), r = Ie(), o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((d = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (p = r.locale) == null ? void 0 : p.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, i = H((n == null ? void 0 : n.in) || a, 0);
i.setFullYear(e + 1, 0, o), i.setHours(0, 0, 0, 0);
const s = be(i, n), c = H((n == null ? void 0 : n.in) || a, 0);
c.setFullYear(e, 0, o), c.setHours(0, 0, 0, 0);
const u = be(c, n);
return +t >= +s ? e + 1 : +t >= +u ? e : e - 1;
}
function sa(a, n) {
var s, c, u, l;
const t = Ie(), e = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((c = (s = n == null ? void 0 : n.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? t.firstWeekContainsDate ?? ((l = (u = t.locale) == null ? void 0 : u.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, r = qt(a, n), o = H((n == null ? void 0 : n.in) || a, 0);
return o.setFullYear(r, 0, e), o.setHours(0, 0, 0, 0), be(o, n);
}
function Hr(a, n) {
const t = k(a, n == null ? void 0 : n.in), e = +be(t, n) - +sa(t, n);
return Math.round(e / Nr) + 1;
}
function A(a, n) {
const t = a < 0 ? "-" : "", e = Math.abs(a).toString().padStart(n, "0");
return t + e;
}
const _e = {
// Year
y(a, n) {
const t = a.getFullYear(), e = t > 0 ? t : 1 - t;
return A(n === "yy" ? e % 100 : e, n.length);
},
// Month
M(a, n) {
const t = a.getMonth();
return n === "M" ? String(t + 1) : A(t + 1, 2);
},
// Day of the month
d(a, n) {
return A(a.getDate(), n.length);
},
// AM or PM
a(a, n) {
const t = a.getHours() / 12 >= 1 ? "pm" : "am";
switch (n) {
case "a":
case "aa":
return t.toUpperCase();
case "aaa":
return t;
case "aaaaa":
return t[0];
case "aaaa":
default:
return t === "am" ? "a.m." : "p.m.";
}
},
// Hour [1-12]
h(a, n) {
return A(a.getHours() % 12 || 12, n.length);
},
// Hour [0-23]
H(a, n) {
return A(a.getHours(), n.length);
},
// Minute
m(a, n) {
return A(a.getMinutes(), n.length);
},
// Second
s(a, n) {
return A(a.getSeconds(), n.length);
},
// Fraction of second
S(a, n) {
const t = n.length, e = a.getMilliseconds(), r = Math.trunc(
e * Math.pow(10, t - 3)
);
return A(r, n.length);
}
}, Le = {
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}, tr = {
// Era
G: function(a, n, t) {
const e = a.getFullYear() > 0 ? 1 : 0;
switch (n) {
// AD, BC
case "G":
case "GG":
case "GGG":
return t.era(e, { width: "abbreviated" });
// A, B
case "GGGGG":
return t.era(e, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return t.era(e, { width: "wide" });
}
},
// Year
y: function(a, n, t) {
if (n === "yo") {
const e = a.getFullYear(), r = e > 0 ? e : 1 - e;
return t.ordinalNumber(r, { unit: "year" });
}
return _e.y(a, n);
},
// Local week-numbering year
Y: function(a, n, t, e) {
const r = qt(a, e), o = r > 0 ? r : 1 - r;
if (n === "YY") {
const i = o % 100;
return A(i, 2);
}
return n === "Yo" ? t.ordinalNumber(o, { unit: "year" }) : A(o, n.length);
},
// ISO week-numbering year
R: function(a, n) {
const t = Rr(a);
return A(t, n.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function(a, n) {
const t = a.getFullYear();
return A(t, n.length);
},
// Quarter
Q: function(a, n, t) {
const e = Math.ceil((a.getMonth() + 1) / 3);
switch (n) {
// 1, 2, 3, 4
case "Q":
return String(e);
// 01, 02, 03, 04
case "QQ":
return A(e, 2);
// 1st, 2nd, 3rd, 4th
case "Qo":
return t.ordinalNumber(e, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return t.quarter(e, {
width: "abbreviated",
context: "formatting"
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return t.quarter(e, {
width: "narrow",
context: "formatting"
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return t.quarter(e, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone quarter
q: function(a, n, t) {
const e = Math.ceil((a.getMonth() + 1) / 3);
switch (n) {
// 1, 2, 3, 4
case "q":
return String(e);
// 01, 02, 03, 04
case "qq":
return A(e, 2);
// 1st, 2nd, 3rd, 4th
case "qo":
return t.ordinalNumber(e, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return t.quarter(e, {
width: "abbreviated",
context: "standalone"
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return t.quarter(e, {
width: "narrow",
context: "standalone"
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return t.quarter(e, {
width: "wide",
context: "standalone"
});
}
},
// Month
M: function(a, n, t) {
const e = a.getMonth();
switch (n) {
case "M":
case "MM":
return _e.M(a, n);
// 1st, 2nd, ..., 12th
case "Mo":
return t.ordinalNumber(e + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "MMM":
return t.month(e, {
width: "abbreviated",
context: "formatting"
});
// J, F, ..., D
case "MMMMM":
return t.month(e, {
width: "narrow",
context: "formatting"
});
// January, February, ..., December
case "MMMM":
default:
return t.month(e, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function(a, n, t) {
const e = a.getMonth();
switch (n) {
// 1, 2, ..., 12
case "L":
return String(e + 1);
// 01, 02, ..., 12
case "LL":
return A(e + 1, 2);
// 1st, 2nd, ..., 12th
case "Lo":
return t.ordinalNumber(e + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "LLL":
return t.month(e, {
width: "abbreviated",
context: "standalone"
});
// J, F, ..., D
case "LLLLL":
return t.month(e, {
width: "narrow",
context: "standalone"
});
// January, February, ..., December
case "LLLL":
default:
return t.month(e, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function(a, n, t, e) {
const r = Hr(a, e);
return n === "wo" ? t.ordinalNumber(r, { unit: "week" }) : A(r, n.length);
},
// ISO week of year
I: function(a, n, t) {
const e = Kt(a);
return n === "Io" ? t.ordinalNumber(e, { unit: "week" }) : A(e, n.length);
},
// Day of the month
d: function(a, n, t) {
return n === "do" ? t.ordinalNumber(a.getDate(), { unit: "date" }) : _e.d(a, n);
},
// Day of year
D: function(a, n, t) {
const e = ia(a);
return n === "Do" ? t.ordinalNumber(e, { unit: "dayOfYear" }) : A(e, n.length);
},
// Day of week
E: function(a, n, t) {
const e = a.getDay();
switch (n) {
// Tue
case "E":
case "EE":
case "EEE":
return t.day(e, {
width: "abbreviated",
context: "formatting"
});
// T
case "EEEEE":
return t.day(e, {
width: "narrow",
context: "formatting"
});
// Tu
case "EEEEEE":
return t.day(e, {
width: "short",
context: "formatting"
});
// Tuesday
case "EEEE":
default:
return t.day(e, {
width: "wide",
context: "formatting"
});
}
},
// Local day of week
e: function(a, n, t, e) {
const r = a.getDay(), o = (r - e.weekStartsOn + 8) % 7 || 7;
switch (n) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case "e":
return String(o);
// Padded numerical value
case "ee":
return A(o, 2);
// 1st, 2nd, ..., 7th
case "eo":
return t.ordinalNumber(o, { unit: "day" });
case "eee":
return t.day(r, {
width: "abbreviated",
context: "formatting"
});
// T
case "eeeee":
return t.day(r, {
width: "narrow",
context: "formatting"
});
// Tu
case "eeeeee":
return t.day(r, {
width: "short",
context: "formatting"
});
// Tuesday
case "eeee":
default:
return t.day(r, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone local day of week
c: function(a, n, t, e) {
const r = a.getDay(), o = (r - e.weekStartsOn + 8) % 7 || 7;
switch (n) {
// Numerical value (same as in `e`)
case "c":
return String(o);
// Padded numerical value
case "cc":
return A(o, n.length);
// 1st, 2nd, ..., 7th
case "co":
return t.ordinalNumber(o, { unit: "day" });
case "ccc":
return t.day(r, {
width: "abbreviated",
context: "standalone"
});
// T
case "ccccc":
return t.day(r, {
width: "narrow",
context: "standalone"
});
// Tu
case "cccccc":
return t.day(r, {
width: "short",
context: "standalone"
});
// Tuesday
case "cccc":
default:
return t.day(r, {
width: "wide",
context: "standalone"
});
}
},
// ISO day of week
i: function(a, n, t) {
const e = a.getDay(), r = e === 0 ? 7 : e;
switch (n) {
// 2
case "i":
return String(r);
// 02
case "ii":
return A(r, n.length);
// 2nd
case "io":
return t.ordinalNumber(r, { unit: "day" });
// Tue
case "iii":
return t.day(e, {
width: "abbreviated",
context: "formatting"
});
// T
case "iiiii":
return t.day(e, {
width: "narrow",
context: "formatting"
});
// Tu
case "iiiiii":
return t.day(e, {
width: "short",
context: "formatting"
});
// Tuesday
case "iiii":
default:
return t.day(e, {
width: "wide",
context: "formatting"
});
}
},
// AM or PM
a: function(a, n, t) {
const r = a.getHours() / 12 >= 1 ? "pm" : "am";
switch (n) {
case "a":
case "aa":
return t.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return t.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return t.dayPeriod(r, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return t.dayPeriod(r, {
width: "wide",
context: "formatting"
});
}
},
// AM, PM, midnight, noon
b: function(a, n, t) {
const e = a.getHours();
let r;
switch (e === 12 ? r = Le.noon : e === 0 ? r = Le.midnight : r = e / 12 >= 1 ? "pm" : "am", n) {
case "b":
case "bb":
return t.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return t.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return t.dayPeriod(r, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return t.dayPeriod(r, {
width: "wide",
context: "formatting"
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function(a, n, t) {
const e = a.getHours();
let r;
switch (e >= 17 ? r = Le.evening : e >= 12 ? r = Le.afternoon : e >= 4 ? r = Le.morning : r = Le.night, n) {
case "B":
case "BB":
case "BBB":
return t.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return t.dayPeriod(r, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return t.dayPeriod(r, {
width: "wide",
context: "formatting"
});
}
},
// Hour [1-12]
h: function(a, n, t) {
if (n === "ho") {
let e = a.getHours() % 12;
return e === 0 && (e = 12), t.ordinalNumber(e, { unit: "hour" });
}
return _e.h(a, n);
},
// Hour [0-23]
H: function(a, n, t) {
return n === "Ho" ? t.ordinalNumber(a.getHours(), { unit: "hour" }) : _e.H(a, n);
},
// Hour [0-11]
K: function(a, n, t) {
const e = a.getHours() % 12;
return n === "Ko" ? t.ordinalNumber(e, { unit: "hour" }) : A(e, n.length);
},
// Hour [1-24]
k: function(a, n, t) {
let e = a.getHours();
return e === 0 && (e = 24), n === "ko" ? t.ordinalNumber(e, { unit: "hour" }) : A(e, n.length);
},
// Minute
m: function(a, n, t) {
return n === "mo" ? t.ordinalNumber(a.getMinutes(), { unit: "minute" }) : _e.m(a, n);
},
// Second
s: function(a, n, t) {
return n === "so" ? t.ordinalNumber(a.getSeconds(), { unit: "second" }) : _e.s(a, n);
},
// Fraction of second
S: function(a, n) {
return _e.S(a, n);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function(a, n, t) {
const e = a.getTimezoneOffset();
if (e === 0)
return "Z";
switch (n) {
// Hours and optional minutes
case "X":
return nr(e);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XXXX":
case "XX":
return Ee(e);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXXXX":
case "XXX":
// Hours and minutes with `:` delimiter
default:
return Ee(e, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function(a, n, t) {
const e = a.getTimezoneOffset();
switch (n) {
// Hours and optional minutes
case "x":
return nr(e);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xxxx":
case "xx":
return Ee(e);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxxxx":
case "xxx":
// Hours and minutes with `:` delimiter
default:
return Ee(e, ":");
}
},
// Timezone (GMT)
O: function(a, n, t) {
const e = a.getTimezoneOffset();
switch (n) {
// Short
case "O":
case "OO":
case "OOO":
return "GMT" + rr(e, ":");
// Long
case "OOOO":
default:
return "GMT" + Ee(e, ":");
}
},
// Timezone (specific non-location)
z: function(a, n, t) {
const e = a.getTimezoneOffset();
switch (n) {
// Short
case "z":
case "zz":
case "zzz":
return "GMT" + rr(e, ":");
// Long
case "zzzz":
default:
return "GMT" + Ee(e, ":");
}
},
// Seconds timestamp
t: function(a, n, t) {
const e = Math.trunc(+a / 1e3);
return A(e, n.length);
},
// Milliseconds timestamp
T: function(a, n, t) {
return A(+a, n.length);
}
};
function rr(a, n = "") {
const t = a > 0 ? "-" : "+", e = Math.abs(a), r = Math.trunc(e / 60), o = e % 60;
return o === 0 ? t + String(r) : t + String(r) + n + A(o, 2);
}
function nr(a, n) {
return a % 60 === 0 ? (a > 0 ? "-" : "+") + A(Math.abs(a) / 60, 2) : Ee(a, n);
}
function Ee(a, n = "") {
const t = a > 0 ? "-" : "+", e = Math.abs(a), r = A(Math.trunc(e / 60), 2), o = A(e % 60, 2);
return t + r + n + o;
}
const ar = (a, n) => {
switch (a) {
case "P":
return n.date({ width: "short" });
case "PP":
return n.date({ width: "medium" });
case "PPP":
return n.date({ width: "long" });
case "PPPP":
default:
return n.date({ width: "full" });
}
}, Qr = (a, n) => {
switch (a) {
case "p":
return n.time({ width: "short" });
case "pp":
return n.time({ width: "medium" });
case "ppp":
return n.time({ width: "long" });
case "pppp":
default:
return n.time({ width: "full" });
}
}, ca = (a, n) => {
const t = a.match(/(P+)(p+)?/) || [], e = t[1], r = t[2];
if (!r)
return ar(a, n);
let o;
switch (e) {
case "P":
o = n.dateTime({ width: "short" });
break;
case "PP":
o = n.dateTime({ width: "medium" });
break;
case "PPP":
o = n.dateTime({ width: "long" });
break;
case "PPPP":
default:
o = n.dateTime({ width: "full" });
break;
}
return o.replace("{{date}}", ar(e, n)).replace("{{time}}", Qr(r, n));
}, At = {
p: Qr,
P: ca
}, la = /^D+$/, ua = /^Y+$/, da = ["D", "DD", "YY", "YYYY"];
function pa(a) {
return la.test(a);
}
function fa(a) {
return ua.test(a);
}
function ha(a, n, t) {
const e = ma(a, n, t);
if (console.warn(e), da.includes(a)) throw new RangeError(e);
}
function ma(a, n, t) {
const e = a[0] === "Y" ? "years" : "days of the month";
return `Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${n}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
const va = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ga = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Da = /^'([^]*?)'?$/, wa = /''/g, ya = /[a-zA-Z]/;
function or(a, n, t) {
var l, d, p, h, m, g, v, b;
const e = Ie(), r = (t == null ? void 0 : t.locale) ?? e.locale ?? Ar, o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : d.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((h = (p = e.locale) == null ? void 0 : p.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, i = (t == null ? void 0 : t.weekStartsOn) ?? ((g = (m = t == null ? void 0 : t.locale) == null ? void 0 : m.options) == null ? void 0 : g.weekStartsOn) ?? e.weekStartsOn ?? ((b = (v = e.locale) == null ? void 0 : v.options) == null ? void 0 : b.weekStartsOn) ?? 0, s = k(a, t == null ? void 0 : t.in);
if (!mt(s))
throw new RangeError("Invalid time value");
let c = n.match(ga).map((C) => {
const _ = C[0];
if (_ === "p" || _ === "P") {
const x = At[_];
return x(C, r.formatLong);
}
return C;
}).join("").match(va).map((C) => {
if (C === "''")
return { isToken: !1, value: "'" };
const _ = C[0];
if (_ === "'")
return { isToken: !1, value: ba(C) };
if (tr[_])
return { isToken: !0, value: C };
if (_.match(ya))
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" + _ + "`"
);
return { isToken: !1, value: C };
});
r.localize.preprocessor && (c = r.localize.preprocessor(s, c));
const u = {
firstWeekContainsDate: o,
weekStartsOn: i,
locale: r
};
return c.map((C) => {
if (!C.isToken) return C.value;
const _ = C.value;
(!(t != null && t.useAdditionalWeekYearTokens) && fa(_) || !(t != null && t.useAdditionalDayOfYearTokens) && pa(_)) && ha(_, n, String(a));
const x = tr[_[0]];
return x(s, _, r.localize, u);
}).join("");
}
function ba(a) {
const n = a.match(Da);
return n ? n[1].replace(wa, "'") : a;
}
function ir(a, n) {
return k(a, n == null ? void 0 : n.in).getDate();
}
function ka(a, n) {
return k(a, n == null ? void 0 : n.in).getDay();
}
function _a(a, n) {
const t = k(a, n == null ? void 0 : n.in), e = t.getFullYear(), r = t.getMonth(), o = H(t, 0);
return o.setFullYear(e, r + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
}
function Ma() {
return Object.assign({}, Ie());
}
function De(a, n) {
return k(a, n == null ? void 0 : n.in).getHours();
}
function Ca(a, n) {
const t = k(a, n == null ? void 0 : n.in).getDay();
return t === 0 ? 7 : t;
}
function we(a, n) {
return k(a, n == null ? void 0 : n.in).getMinutes();
}
function ee(a, n) {
return k(a, n == null ? void 0 : n.in).getMonth();
}
function Ce(a) {
return k(a).getSeconds();
}
function Ht(a) {
return +k(a);
}
function P(a, n) {
return k(a, n == null ? void 0 : n.in).getFullYear();
}
function Pe(a, n) {
return +k(a) > +k(n);
}
function Re(a, n) {
return +k(a) < +k(n);
}
function Sa(a, n) {
return +k(a) == +k(n);
}
function xa(a, n) {
const t = Pa(n) ? new n(0) : H(n, 0);
return t.setFullYear(a.getFullYear(), a.getMonth(), a.getDate()), t.setHours(
a.getHours(),
a.getMinutes(),
a.getSeconds(),
a.getMilliseconds()
), t;
}
function Pa(a) {
var n;
return typeof a == "function" && ((n = a.prototype) == null ? void 0 : n.constructor) === a;
}
const Ea = 10;
class Br {
constructor() {
w(this, "subPriority", 0);
}
validate(n, t) {
return !0;
}
}
class Oa extends Br {
constructor(n, t, e, r, o) {
super(), this.value = n, this.validateValue = t, this.setValue = e, this.priority = r, o && (this.subPriority = o);
}
validate(n, t) {
return this.validateValue(n, this.value, t);
}
set(n, t, e) {
return this.setValue(n, t, this.value, e);
}
}
class Ta extends Br {
constructor(t, e) {
super();
w(this, "priority", Ea);
w(this, "subPriority", -1);
this.context = t || ((r) => H(e, r));
}
set(t, e) {
return e.timestampIsSet ? t : H(t, xa(t, this.context));
}
}
class R {
run(n, t, e, r) {
const o = this.parse(n, t, e, r);
return o ? {
setter: new Oa(
o.value,
this.validate,
this.set,
this.priority,
this.subPriority
),
rest: o.rest
} : null;
}
validate(n, t, e) {
return !0;
}
}
class Na extends R {
constructor() {
super(...arguments);
w(this, "priority", 140);
w(this, "incompatibleTokens", ["R", "u", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
// AD, BC
case "G":
case "GG":
case "GGG":
return r.era(t, { width: "abbreviated" }) || r.era(t, { width: "narrow" });
// A, B
case "GGGGG":
return r.era(t, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return r.era(t, { width: "wide" }) || r.era(t, { width: "abbreviated" }) || r.era(t, { width: "narrow" });
}
}
set(t, e, r) {
return e.era = r, t.setFullYear(r, 0, 1), t.setHours(0, 0, 0, 0), t;
}
}
const X = {
month: /^(1[0-2]|0?\d)/,
// 0 to 12
date: /^(3[0-1]|[0-2]?\d)/,
// 0 to 31
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
// 0 to 366
week: /^(5[0-3]|[0-4]?\d)/,
// 0 to 53
hour23h: /^(2[0-3]|[0-1]?\d)/,
// 0 to 23
hour24h: /^(2[0-4]|[0-1]?\d)/,
// 0 to 24
hour11h: /^(1[0-1]|0?\d)/,
// 0 to 11
hour12h: /^(1[0-2]|0?\d)/,
// 0 to 12
minute: /^[0-5]?\d/,
// 0 to 59
second: /^[0-5]?\d/,
// 0 to 59
singleDigit: /^\d/,
// 0 to 9
twoDigits: /^\d{1,2}/,
// 0 to 99
threeDigits: /^\d{1,3}/,
// 0 to 999
fourDigits: /^\d{1,4}/,
// 0 to 9999
anyDigitsSigned: /^-?\d+/,
singleDigitSigned: /^-?\d/,
// 0 to 9, -0 to -9
twoDigitsSigned: /^-?\d{1,2}/,
// 0 to 99, -0 to -99
threeDigitsSigned: /^-?\d{1,3}/,
// 0 to 999, -0 to -999
fourDigitsSigned: /^-?\d{1,4}/
// 0 to 9999, -0 to -9999
}, pe = {
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
basic: /^([+-])(\d{2})(\d{2})|Z/,
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
extended: /^([+-])(\d{2}):(\d{2})|Z/,
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
};
function G(a, n) {
return a && {
value: n(a.value),
rest: a.rest
};
}
function V(a, n) {
const t = n.match(a);
return t ? {
value: parseInt(t[0], 10),
rest: n.slice(t[0].length)
} : null;
}
function fe(a, n) {
const t = n.match(a);
if (!t)
return null;
if (t[0] === "Z")
return {
value: 0,
rest: n.slice(1)
};
const e = t[1] === "+" ? 1 : -1, r = t[2] ? parseInt(t[2], 10) : 0, o = t[3] ? parseInt(t[3], 10) : 0, i = t[5] ? parseInt(t[5], 10) : 0;
return {
value: e * (r * Mt + o * _t + i * yn),
rest: n.slice(t[0].length)
};
}
function Kr(a) {
return V(X.anyDigitsSigned, a);
}
function U(a, n) {
switch (a) {
case 1:
return V(X.singleDigit, n);
case 2:
return V(X.twoDigits, n);
case 3:
return V(X.threeDigits, n);
case 4:
return V(X.fourDigits, n);
default:
return V(new RegExp("^\\d{1," + a + "}"), n);
}
}
function wt(a, n) {
switch (a) {
case 1:
return V(X.singleDigitSigned, n);
case 2:
return V(X.twoDigitsSigned, n);
case 3:
return V(X.threeDigitsSigned, n);
case 4:
return V(X.fourDigitsSigned, n);
default:
return V(new RegExp("^-?\\d{1," + a + "}"), n);
}
}
function Vt(a) {
switch (a) {
case "morning":
return 4;
case "evening":
return 17;
case "pm":
case "noon":
case "afternoon":
return 12;
case "am":
case "midnight":
case "night":
default:
return 0;
}
}
function qr(a, n) {
const t = n > 0, e = t ? n : 1 - n;
let r;
if (e <= 50)
r = a || 100;
else {
const o = e + 50, i = Math.trunc(o / 100) * 100, s = a >= o % 100;
r = a + i - (s ? 100 : 0);
}
return t ? r : 1 - r;
}
function Vr(a) {
return a % 400 === 0 || a % 4 === 0 && a % 100 !== 0;
}
class Ya extends R {
constructor() {
super(...arguments);
w(this, "priority", 130);
w(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
}
parse(t, e, r) {
const o = (i) => ({
year: i,
isTwoDigitYear: e === "yy"
});
switch (e) {
case "y":
return G(U(4, t), o);
case "yo":
return G(
r.ordinalNumber(t, {
unit: "year"
}),
o
);
default:
return G(U(e.length, t), o);
}
}
validate(t, e) {
return e.isTwoDigitYear || e.year > 0;
}
set(t, e, r) {
const o = t.getFullYear();
if (r.isTwoDigitYear) {
const s = qr(
r.year,
o
);
return t.setFullYear(s, 0, 1), t.setHours(0, 0, 0, 0), t;
}
const i = !("era" in e) || e.era === 1 ? r.year : 1 - r.year;
return t.setFullYear(i, 0, 1), t.setHours(0, 0, 0, 0), t;
}
}
class Ra extends R {
constructor() {
super(...arguments);
w(this, "priority", 130);
w(this, "incompatibleTokens", [
"y",
"R",
"u",
"Q",
"q",
"M",
"L",
"I",
"d",
"D",
"i",
"t",
"T"
]);
}
parse(t, e, r) {
const o = (i) => ({
year: i,
isTwoDigitYear: e === "YY"
});
switch (e) {
case "Y":
return G(U(4, t), o);
case "Yo":
return G(
r.ordinalNumber(t, {
unit: "year"
}),
o
);
default:
return G(U(e.length, t), o);
}
}
validate(t, e) {
return e.isTwoDigitYear || e.year > 0;
}
set(t, e, r, o) {
const i = qt(t, o);
if (r.isTwoDigitYear) {
const c = qr(
r.year,
i
);
return t.setFullYear(
c,
0,
o.firstWeekContainsDate
), t.setHours(0, 0, 0, 0), be(t, o);
}
const s = !("era" in e) || e.era === 1 ? r.year : 1 - r.year;
return t.setFullYear(s, 0, o.firstWeekContainsDate), t.setHours(0, 0, 0, 0), be(t, o);
}
}
class Ia extends R {
constructor() {
super(...arguments);
w(this, "priority", 130);
w(this, "incompatibleTokens", [
"G",
"y",
"Y",
"u",
"Q",
"q",
"M",
"L",
"w",
"d",
"D",
"e",
"c",
"t",
"T"
]);
}
parse(t, e) {
return wt(e === "R" ? 4 : e.length, t);
}
set(t, e, r) {
const o = H(t, 0);
return o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0), Ae(o);
}
}
class La extends R {
constructor() {
super(...arguments);
w(this, "priority", 130);
w(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
}
parse(t, e) {
return wt(e === "u" ? 4 : e.length, t);
}
set(t, e, r) {
return t.setFullYear(r, 0, 1), t.setHours(0, 0, 0, 0), t;
}
}
class Fa extends R {
constructor() {
super(...arguments);
w(this, "priority", 120);
w(this, "incompatibleTokens", [
"Y",
"R",
"q",
"M",
"L",
"w",
"I",
"d",
"D",
"i",
"e",
"c",
"t",
"T"
]);
}
parse(t, e, r) {
switch (e) {
// 1, 2, 3, 4
case "Q":
case "QQ":
return U(e.length, t);
// 1st, 2nd, 3rd, 4th
case "Qo":
return r.ordinalNumber(t, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return r.quarter(t, {
width: "abbreviated",
context: "formatting"
}) || r.quarter(t, {
width: "narrow",
context: "formatting"
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return r.quarter(t, {
width: "narrow",
context: "formatting"
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return r.quarter(t, {
width: "wide",
context: "formatting"
}) || r.quarter(t, {
width: "abbreviated",
context: "formatting"
}) || r.quarter(t, {
width: "narrow",
context: "formatting"
});
}
}
validate(t, e) {
return e >= 1 && e <= 4;
}
set(t, e, r) {
return t.setMonth((r - 1) * 3, 1), t.setHours(0, 0, 0, 0), t;
}
}
class Wa extends R {
constructor() {
super(...arguments);
w(this, "priority", 120);
w(this, "incompatibleTokens", [
"Y",
"R",
"Q",
"M",
"L",
"w",
"I",
"d",
"D",
"i",
"e",
"c",
"t",
"T"
]);
}
parse(t, e, r) {
switch (e) {
// 1, 2, 3, 4
case "q":
case "qq":
return U(e.length, t);
// 1st, 2nd, 3rd, 4th
case "qo":
return r.ordinalNumber(t, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return r.quarter(t, {
width: "abbreviated",
context: "standalone"
}) || r.quarter(t, {
width: "narrow",
context: "standalone"
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return r.quarter(t, {
width: "narrow",
context: "standalone"
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return r.quarter(t, {
width: "wide",
context: "standalone"
}) || r.quarter(t, {
width: "abbreviated",
context: "standalone"
}) || r.quarter(t, {
width: "narrow",
context: "standalone"
});
}
}
validate(t, e) {
return e >= 1 && e <= 4;
}
set(t, e, r) {
return t.setMonth((r - 1) * 3, 1), t.setHours(0, 0, 0, 0), t;
}
}
class Aa extends R {
constructor() {
super(...arguments);
w(this, "incompatibleTokens", [
"Y",
"R",
"q",
"Q",
"L",
"w",
"I",
"D",
"i",
"e",
"c",
"t",
"T"
]);
w(this, "priority", 110);
}
parse(t, e, r) {
const o = (i) => i - 1;
switch (e) {
// 1, 2, ..., 12
case "M":
return G(
V(X.month, t),
o
);
// 01, 02, ..., 12
case "MM":
return G(U(2, t), o);
// 1st, 2nd, ..., 12th
case "Mo":
return G(
r.ordinalNumber(t, {
unit: "month"
}),
o
);
// Jan, Feb, ..., Dec
case "MMM":
return r.month(t, {
width: "abbreviated",
context: "formatting"
}) || r.month(t, { width: "narrow", context: "formatting" });
// J, F, ..., D
case "MMMMM":
return r.month(t, {
width: "narrow",
context: "formatting"
});
// January, February, ..., December
case "MMMM":
default:
return r.month(t, { width: "wide", context: "formatting" }) || r.month(t, {
width: "abbreviated",
context: "formatting"
}) || r.month(t, { width: "narrow", context: "formatting" });
}
}
validate(t, e) {
return e >= 0 && e <= 11;
}
set(t, e, r) {
return t.setMonth(r, 1), t.setHours(0, 0, 0, 0), t;
}
}
class Ha extends R {
constructor() {
super(...arguments);
w(this, "priority", 110);
w(this, "incompatibleTokens", [
"Y",
"R",
"q",
"Q",
"M",
"w",
"I",
"D",
"i",
"e",
"c",
"t",
"T"
]);
}
parse(t, e, r) {
const o = (i) => i - 1;
switch (e) {
// 1, 2, ..., 12
case "L":
return G(
V(X.month, t),
o
);
// 01, 02, ..., 12
case "LL":
return G(U(2, t), o);
// 1st, 2nd, ..., 12th
case "Lo":
return G(
r.ordinalNumber(t, {
unit: "month"
}),
o
);
// Jan, Feb, ..., Dec
case "LLL":
return r.month(t, {
width: "abbreviated",
context: "standalone"
}) || r.month(t, { width: "narrow", context: "standalone" });
// J, F, ..., D
case "LLLLL":
return r.month(t, {
width: "narrow",
context: "standalone"
});
// January, February, ..., December
case "LLLL":
default:
return r.month(t, { width: "wide", context: "standalone" }) || r.month(t, {
width: "abbreviated",
context: "standalone"
}) || r.month(t, { width: "narrow", context: "standalone" });
}
}
validate(t, e) {
return e >= 0 && e <= 11;
}
set(t, e, r) {
return t.setMonth(r, 1), t.setHours(0, 0, 0, 0), t;
}
}
function Qa(a, n, t) {
const e = k(a, t == null ? void 0 : t.in), r = Hr(e, t) - n;
return e.setDate(e.getDate() - r * 7), k(e, t == null ? void 0 : t.in);
}
class Ba extends R {
constructor() {
super(...arguments);
w(this, "priority", 100);
w(this, "incompatibleTokens", [
"y",
"R",
"u",
"q",
"Q",
"M",
"L",
"I",
"d",
"D",
"i",
"t",
"T"
]);
}
parse(t, e, r) {
switch (e) {
case "w":
return V(X.week, t);
case "wo":
return r.ordinalNumber(t, { unit: "week" });
default:
return U(e.length, t);
}
}
validate(t, e) {
return e >= 1 && e <= 53;
}
set(t, e, r, o) {
return be(Qa(t, r, o), o);
}
}
function Ka(a, n, t) {
const e = k(a, t == null ? void 0 : t.in), r = Kt(e, t) - n;
return e.setDate(e.getDate() - r * 7), e;
}
class qa extends R {
constructor() {
super(...arguments);
w(this, "priority", 100);
w(this, "incompatibleTokens", [
"y",
"Y",
"u",
"q",
"Q",
"M",
"L",
"w",
"d",
"D",
"e",
"c",
"t",
"T"
]);
}
parse(t, e, r) {
switch (e) {
case "I":
return V(X.week, t);
case "Io":
return r.ordinalNumber(t, { unit: "week" });
default:
return U(e.length, t);
}
}
validate(t, e) {
return e >= 1 && e <= 53;
}
set(t, e, r) {
return Ae(Ka(t, r));
}
}
const Va = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Ua = [
31,
29,
31,
30,
31,
30,
31,
31,
30,
31,
30,
31
];
class ja extends R {
constructor() {
super(...arguments);
w(this, "priority", 90);
w(this, "subPriority", 1);
w(this, "incompatibleTokens", [
"Y",
"R",
"q",
"Q",
"w",
"I",
"D",
"i",
"e",
"c",
"t",
"T"
]);
}
parse(t, e, r) {
switch (e) {
case "d":
return V(X.date, t);
case "do":
return r.ordinalNumber(t, { unit: "date" });
default:
return U(e.length, t);
}
}
validate(t, e) {
const r = t.getFullYear(), o = Vr(r), i = t.getMonth();
return o ? e >= 1 && e <= Ua[i] : e >= 1 && e <= Va[i];
}
set(t, e, r) {
return t.setDate(r), t.setHours(0, 0, 0, 0), t;
}
}
class $a extends R {
constructor() {
super(...arguments);
w(this, "priority", 90);
w(this, "subpriority", 1);
w(this, "incompatibleTokens", [
"Y",
"R",
"q",
"Q",
"M",
"L",
"w",
"I",
"d",
"E",
"i",
"e",
"c",
"t",
"T"
]);
}
parse(t, e, r) {
switch (e) {
case "D":
case "DD":
return V(X.dayOfYear, t);
case "Do":
return r.ordinalNumber(t, { unit: "date" });
default:
return U(e.length, t);
}
}
validate(t, e) {
const r = t.getFullYear();
return Vr(r) ? e >= 1 && e <= 366 : e >= 1 && e <= 365;
}
set(t, e, r) {
return t.setMonth(0, r), t.setHours(0, 0, 0, 0), t;
}
}
function Ut(a, n, t) {
var d, p, h, m;
const e = Ie(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((p = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : p.weekStartsOn) ?? e.weekStartsOn ?? ((m = (h = e.locale) == null ? void 0 : h.options) == null ? void 0 : m.weekStartsOn) ?? 0, o = k(a, t == null ? void 0 : t.in), i = o.getDay(), c = (n % 7 + 7) % 7, u = 7 - r, l = n < 0 || n > 6 ? n - (i + u) % 7 : (c + u) % 7 - (i + u) % 7;
return se(o, l, t);
}
class Xa extends R {
constructor() {
super(...arguments);
w(this, "priority", 90);
w(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
// Tue
case "E":
case "EE":
case "EEE":
return r.day(t, {
width: "abbreviated",
context: "formatting"
}) || r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
// T
case "EEEEE":
return r.day(t, {
width: "narrow",
context: "formatting"
});
// Tu
case "EEEEEE":
return r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
// Tuesday
case "EEEE":
default:
return r.day(t, { width: "wide", context: "formatting" }) || r.day(t, {
width: "abbreviated",
context: "formatting"
}) || r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
}
}
validate(t, e) {
return e >= 0 && e <= 6;
}
set(t, e, r, o) {
return t = Ut(t, r, o), t.setHours(0, 0, 0, 0), t;
}
}
class Ga extends R {
constructor() {
super(...arguments);
w(this, "priority", 90);
w(this, "incompatibleTokens", [
"y",
"R",
"u",
"q",
"Q",
"M",
"L",
"I",
"d",
"D",
"E",
"i",
"c",
"t",
"T"
]);
}
parse(t, e, r, o) {
const i = (s) => {
const c = Math.floor((s - 1) / 7) * 7;
return (s + o.weekStartsOn + 6) % 7 + c;
};
switch (e) {
// 3
case "e":
case "ee":
return G(U(e.length, t), i);
// 3rd
case "eo":
return G(
r.ordinalNumber(t, {
unit: "day"
}),
i
);
// Tue
case "eee":
return r.day(t, {
width: "abbreviated",
context: "formatting"
}) || r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
// T
case "eeeee":
return r.day(t, {
width: "narrow",
context: "formatting"
});
// Tu
case "eeeeee":
return r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
// Tuesday
case "eeee":
default:
return r.day(t, { width: "wide", context: "formatting" }) || r.day(t, {
width: "abbreviated",
context: "formatting"
}) || r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
}
}
validate(t, e) {
return e >= 0 && e <= 6;
}
set(t, e, r, o) {
return t = Ut(t, r, o), t.setHours(0, 0, 0, 0), t;
}
}
class za extends R {
constructor() {
super(...arguments);
w(this, "priority", 90);
w(this, "incompatibleTokens", [
"y",
"R",
"u",
"q",
"Q",
"M",
"L",
"I",
"d",
"D",
"E",
"i",
"e",
"t",
"T"
]);
}
parse(t, e, r, o) {
const i = (s) => {
const c = Math.floor((s - 1) / 7) * 7;
return (s + o.weekStartsOn + 6) % 7 + c;
};
switch (e) {
// 3
case "c":
case "cc":
return G(U(e.length, t), i);
// 3rd
case "co":
return G(
r.ordinalNumber(t, {
unit: "day"
}),
i
);
// Tue
case "ccc":
return r.day(t, {
width: "abbreviated",
context: "standalone"
}) || r.day(t, { width: "short", context: "standalone" }) || r.day(t, { width: "narrow", context: "standalone" });
// T
case "ccccc":
return r.day(t, {
width: "narrow",
context: "standalone"
});
// Tu
case "cccccc":
return r.day(t, { width: "short", context: "standalone" }) || r.day(t, { width: "narrow", context: "standalone" });
// Tuesday
case "cccc":
default:
return r.day(t, { width: "wide", context: "standalone" }) || r.day(t, {
width: "abbreviated",
context: "standalone"
}) || r.day(t, { width: "short", context: "standalone" }) || r.day(t, { width: "narrow", context: "standalone" });
}
}
validate(t, e) {
return e >= 0 && e <= 6;
}
set(t, e, r, o) {
return t = Ut(t, r, o), t.setHours(0, 0, 0, 0), t;
}
}
function Za(a, n, t) {
const e = k(a, t == null ? void 0 : t.in), r = Ca(e, t), o = n - r;
return se(e, o, t);
}
class Ja extends R {
constructor() {
super(...arguments);
w(this, "priority", 90);
w(this, "incompatibleTokens", [
"y",
"Y",
"u",
"q",
"Q",
"M",
"L",
"w",
"d",
"D",
"E",
"e",
"c",
"t",
"T"
]);
}
parse(t, e, r) {
const o = (i) => i === 0 ? 7 : i;
switch (e) {
// 2
case "i":
case "ii":
return U(e.length, t);
// 2nd
case "io":
return r.ordinalNumber(t, { unit: "day" });
// Tue
case "iii":
return G(
r.day(t, {
width: "abbreviated",
context: "formatting"
}) || r.day(t, {
width: "short",
context: "formatting"
}) || r.day(t, {
width: "narrow",
context: "formatting"
}),
o
);
// T
case "iiiii":
return G(
r.day(t, {
width: "narrow",
context: "formatting"
}),
o
);
// Tu
case "iiiiii":
return G(
r.day(t, {
width: "short",
context: "formatting"
}) || r.day(t, {
width: "narrow",
context: "formatting"
}),
o
);
// Tuesday
case "iiii":
default:
return G(
r.day(t, {
width: "wide",
context: "formatting"
}) || r.day(t, {
width: "abbreviated",
context: "formatting"
}) || r.day(t, {
width: "short",
context: "formatting"
}) || r.day(t, {
width: "narrow",
context: "formatting"
}),
o
);
}
}
validate(t, e) {
return e >= 1 && e <= 7;
}
set(t, e, r) {
return t = Za(t, r), t.setHours(0, 0, 0, 0), t;
}
}
class eo extends R {
constructor() {
super(...arguments);
w(this, "priority", 80);
w(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "a":
case "aa":
case "aaa":
return r.dayPeriod(t, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
case "aaaaa":
return r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return r.dayPeriod(t, {
width: "wide",
context: "formatting"
}) || r.dayPeriod(t, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
}
}
set(t, e, r) {
return t.setHours(Vt(r), 0, 0, 0), t;
}
}
class to extends R {
constructor() {
super(...arguments);
w(this, "priority", 80);
w(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "b":
case "bb":
case "bbb":
return r.dayPeriod(t, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
case "bbbbb":
return r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return r.dayPeriod(t, {
width: "wide",
context: "formatting"
}) || r.dayPeriod(t, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
}
}
set(t, e, r) {
return t.setHours(Vt(r), 0, 0, 0), t;
}
}
class ro extends R {
constructor() {
super(...arguments);
w(this, "priority", 80);
w(this, "incompatibleTokens", ["a", "b", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "B":
case "BB":
case "BBB":
return r.dayPeriod(t, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
case "BBBBB":
return r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return r.dayPeriod(t, {
width: "wide",
context: "formatting"
}) || r.dayPeriod(t, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(t, {
width: "narrow",
context: "formatting"
});
}
}
set(t, e, r) {
return t.setHours(Vt(r), 0, 0, 0), t;
}
}
class no extends R {
constructor() {
super(...arguments);
w(this, "priority", 70);
w(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "h":
return V(X.hour12h, t);
case "ho":
return r.ordinalNumber(t, { unit: "hour" });
default:
return U(e.length, t);
}
}
validate(t, e) {
return e >= 1 && e <= 12;
}
set(t, e, r) {
const o = t.getHours() >= 12;
return o && r < 12 ? t.setHours(r + 12, 0, 0, 0) : !o && r === 12 ? t.setHours(0, 0, 0, 0) : t.setHours(r, 0, 0, 0), t;
}
}
class ao extends R {
constructor() {
super(...arguments);
w(this, "priority", 70);
w(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "H":
return V(X.hour23h, t);
case "Ho":
return r.ordinalNumber(t, { unit: "hour" });
default:
return U(e.length, t);
}
}
validate(t, e) {
return e >= 0 && e <= 23;
}
set(t, e, r) {
return t.setHours(r, 0, 0, 0), t;
}
}
class oo extends R {
constructor() {
super(...arguments);
w(this, "priority", 70);
w(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "K":
return V(X.hour11h, t);
case "Ko":
return r.ordinalNumber(t, { unit: "hour" });
default:
return U(e.length, t);
}
}
validate(t, e) {
return e >= 0 && e <= 11;
}
set(t, e, r) {
return t.getHours() >= 12 && r < 12 ? t.setHours(r + 12, 0, 0, 0) : t.setHours(r, 0, 0, 0), t;
}
}
class io extends R {
constructor() {
super(...arguments);
w(this, "priority", 70);
w(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "k":
return V(X.hour24h, t);
case "ko":
return r.ordinalNumber(t, { unit: "hour" });
default:
return U(e.length, t);
}
}
validate(t, e) {
return e >= 1 && e <= 24;
}
set(t, e, r) {
const o = r <= 24 ? r % 24 : r;
return t.setHours(o, 0, 0, 0), t;
}
}
class so extends R {
constructor() {
super(...arguments);
w(this, "priority", 60);
w(this, "incompatibleTokens", ["t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "m":
return V(X.minute, t);
case "mo":
return r.ordinalNumber(t, { unit: "minute" });
default:
return U(e.length, t);
}
}
validate(t, e) {
return e >= 0 && e <= 59;
}
set(t, e, r) {
return t.setMinutes(r, 0, 0), t;
}
}
class co extends R {
constructor() {
super(...arguments);
w(this, "priority", 50);
w(this, "incompatibleTokens", ["t", "T"]);
}
parse(t, e, r) {
switch (e) {
case "s":
return V(X.second, t);
case "so":
return r.ordinalNumber(t, { unit: "second" });
default:
return U(e.length, t);
}
}
validate(t, e) {
return e >= 0 && e <= 59;
}
set(t, e, r) {
return t.setSeconds(r, 0), t;
}
}
class lo extends R {
constructor() {
super(...arguments);
w(this, "priority", 30);
w(this, "incompatibleTokens", ["t", "T"]);
}
parse(t, e) {
const r = (o) => Math.trunc(o * Math.pow(10, -e.length + 3));
return G(U(e.length, t), r);
}
set(t, e, r) {
return t.setMilliseconds(r), t;
}
}
class uo extends R {
constructor() {
super(...arguments);
w(this, "priority", 10);
w(this, "incompatibleTokens", ["t", "T", "x"]);
}
parse(t, e) {
switch (e) {
case "X":
return fe(
pe.basicOptionalMinutes,
t
);
case "XX":
return fe(pe.basic, t);
case "XXXX":
return fe(
pe.basicOptionalSeconds,
t
);
case "XXXXX":
return fe(
pe.extendedOptionalSeconds,
t
);
case "XXX":
default:
return fe(pe.extended, t);
}
}
set(t, e, r) {
return e.timestampIsSet ? t : H(
t,
t.getTime() - ft(t) - r
);
}
}
class po extends R {
constructor() {
super(...arguments);
w(this, "priority", 10);
w(this, "incompatibleTokens", ["t", "T", "X"]);
}
parse(t, e) {
switch (e) {
case "x":
return fe(
pe.basicOptionalMinutes,
t
);
case "xx":
return fe(pe.basic, t);
case "xxxx":
return fe(
pe.basicOptionalSeconds,
t
);
case "xxxxx":
return fe(
pe.extendedOptionalSeconds,
t
);
case "xxx":
default:
return fe(pe.extended, t);
}
}
set(t, e, r) {
return e.timestampIsSet ? t : H(
t,
t.getTime() - ft(t) - r
);
}
}
class fo extends R {
constructor() {
super(...arguments);
w(this, "priority", 40);
w(this, "incompatibleTokens", "*");
}
parse(t) {
return Kr(t);
}
set(t, e, r) {
return [H(t, r * 1e3), { timestampIsSet: !0 }];
}
}
class ho extends R {
constructor() {
super(...arguments);
w(this, "priority", 20);
w(this, "incompatibleTokens", "*");
}
parse(t) {
return Kr(t);
}
set(t, e, r) {
return [H(t, r), { timestampIsSet: !0 }];
}
}
const mo = {
G: new Na(),
y: new Ya(),
Y: new Ra(),
R: new Ia(),
u: new La(),
Q: new Fa(),
q: new Wa(),
M: new Aa(),
L: new Ha(),
w: new Ba(),
I: new qa(),
d: new ja(),
D: new $a(),
E: new Xa(),
e: new Ga(),
c: new za(),
i: new Ja(),
a: new eo(),
b: new to(),
B: new ro(),
h: new no(),
H: new ao(),
K: new oo(),
k: new io(),
m: new so(),
s: new co(),
S: new lo(),
X: new uo(),
x: new po(),
t: new fo(),
T: new ho()
}, vo = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, go = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Do = /^'([^]*?)'?$/, wo = /''/g, yo = /\S/, bo = /[a-zA-Z]/;
function ko(a, n, t, e) {
var v, b, C, _, x, I, L, E;
const r = () => H((e == null ? void 0 : e.in) || t, NaN), o = Ma(), i = (e == null ? void 0 : e.locale) ?? o.locale ?? Ar, s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((b = (v = e == null ? void 0 : e.locale) == null ? void 0 : v.options) == null ? void 0 : b.firstWeekContainsDate) ?? o.firstWeekContainsDate ?? ((_ = (C = o.locale) == null ? void 0 : C.options) == null ? void 0 : _.firstWeekContainsDate) ?? 1, c = (e == null ? void 0 : e.weekStartsOn) ?? ((I = (x = e == null ? void 0 : e.locale) == null ? void 0 : x.options) == null ? void 0 : I.weekStartsOn) ?? o.weekStartsOn ?? ((E = (L = o.locale) == null ? void 0 : L.options) == null ? void 0 : E.weekStartsOn) ?? 0;
if (!n)
return a ? r() : k(t, e == null ? void 0 : e.in);
const u = {
firstWeekContainsDate: s,
weekStartsOn: c,
locale: i
}, l = [new Ta(e == null ? void 0 : e.in, t)], d = n.match(go).map((y) => {
const M = y[0];
if (M in At) {
const T = At[M];
return T(y, i.formatLong);
}
return y;
}).join("").match(vo), p = [];
for (let y of d) {
const M = y[0], T = mo[M];
if (T) {
const { incompatibleTokens: K } = T;
if (Array.isArray(K)) {
const j = p.find(
(re) => K.includes(re.token) || re.token === M
);
if (j)
throw new RangeError(
`The format string mustn't contain \`${j.fullToken}\` and \`${y}\` at the same time`
);
} else if (T.incompatibleTokens === "*" && p.length > 0)
throw new RangeError(
`The format string mustn't contain \`${y}\` and any other token at the same time`
);
p.push({ token: M, fullToken: y });
const B = T.run(
a,
y,
i.match,
u
);
if (!B)
return r();
l.push(B.setter), a = B.rest;
} else {
if (M.match(bo))
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" + M + "`"
);
if (y === "''" ? y = "'" : M === "'" && (y = _o(y)), a.indexOf(y) === 0)
a = a.slice(y.length);
else
return r();
}
}
if (a.length > 0 && yo.test(a))
return r();
const h = l.map((y) => y.priority).sort((y, M) => M - y).filter((y, M, T) => T.indexOf(y) === M).map(
(y) => l.filter((M) => M.priority === y).sort((M, T) => T.subPriority - M.subPriority)
).map((y) => y[0]);
let m = k(t, e == null ? void 0 : e.in);
if (isNaN(+m)) return r();
const g = {};
for (const y of h) {
if (!y.validate(m, u))
return r();
const M = y.set(m, g, u);
Array.isArray(M) ? (m = M[0], Object.assign(g, M[1])) : m = M;
}
return m;
}
function _o(a) {
return a.match(Do)[1].replace(wo, "'");
}
function Mo(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
);
return e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth();
}
function Co(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
);
return +Wt(e) == +Wt(r);
}
function So(a, n, t) {
const [e, r] = ke(
t == null ? void 0 : t.in,
a,
n
);
return e.getFullYear() === r.getFullYear();
}
function ze(a, n, t) {
const e = +k(a, t == null ? void 0 : t.in), [r, o] = [
+k(n.start, t == null ? void 0 : t.in),
+k(n.end, t == null ? void 0 : t.in)
].sort((i, s) => i - s);
return e >= r && e <= o;
}
function xo(a, n, t) {
return se(a, -1, t);
}
function Po(a, n) {
const t = () => H(n == null ? void 0 : n.in, NaN), r = No(a);
let o;
if (r.date) {
const u = Yo(r.date, 2);
o = Ro(u.restDateString, u.year);
}
if (!o || isNaN(+o)) return t();
const i = +o;
let s = 0, c;
if (r.time && (s = Io(r.time), isNaN(s)))
return t();
if (r.timezone) {
if (c = Lo(r.timezone), isNaN(c)) return t();
} else {
const u = new Date(i + s), l = k(0, n == null ? void 0 : n.in);
return l.setFullYear(
u.getUTCFullYear(),
u.getUTCMonth(),
u.getUTCDate()
), l.setHours(
u.getUTCHours(),
u.getUTCMinutes(),
u.getUTCSeconds(),
u.getUTCMilliseconds()
), l;
}
return k(i + s + c, n == null ? void 0 : n.in);
}
const tt = {
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
timezone: /([Z+-].*)$/
}, Eo = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Oo = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, To = /^([+-])(\d{2})(?::?(\d{2}))?$/;
function No(a) {
const n = {}, t = a.split(tt.dateTimeDelimiter);
let e;
if (t.length > 2)
return n;
if (/:/.test(t[0]) ? e = t[0] : (n.date = t[0], e = t[1], tt.timeZoneDelimiter.test(n.date) && (n.date = a.split(tt.timeZoneDelimiter)[0], e = a.substr(
n.date.length,
a.length
))), e) {
const r = tt.timezone.exec(e);
r ? (n.time = e.replace(r[1], ""), n.timezone = r[1]) : n.time = e;
}
return n;
}
function Yo(a, n) {
const t = new RegExp(
"^(?:(\\d{4}|[+-]\\d{" + (4 + n) + "})|(\\d{2}|[+-]\\d{" + (2 + n) + "})$)"
), e = a.match(t);
if (!e) return { year: NaN, restDateString: "" };
const r = e[1] ? parseInt(e[1]) : null, o = e[2] ? parseInt(e[2]) : null;
return {
year: o === null ? r : o * 100,
restDateString: a.slice((e[1] || e[2]).length)
};
}
function Ro(a, n) {
if (n === null) return /* @__PURE__ */ new Date(NaN);
const t = a.match(Eo);
if (!t) return /* @__PURE__ */ new Date(NaN);
const e = !!t[4], r = Ve(t[1]), o = Ve(t[2]) - 1, i = Ve(t[3]), s = Ve(t[4]), c = Ve(t[5]) - 1;
if (e)
return Qo(n, s, c) ? Fo(n, s, c) : /* @__PURE__ */ new Date(NaN);
{
const u = /* @__PURE__ */ new Date(0);
return !Ao(n, o, i) || !Ho(n, r) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(n, o, Math.max(r, i)), u);
}
}
function Ve(a) {
return a ? parseInt(a) : 1;
}
function Io(a) {
const n = a.match(Oo);
if (!n) return NaN;
const t = Et(n[1]), e = Et(n[2]), r = Et(n[3]);
return Bo(t, e, r) ? t * Mt + e * _t + r * 1e3 : NaN;
}
function Et(a) {
return a && parseFloat(a.replace(",", ".")) || 0;
}
function Lo(a) {
if (a === "Z") return 0;
const n = a.match(To);
if (!n) return 0;
const t = n[1] === "+" ? -1 : 1, e = parseInt(n[2]), r = n[3] && parseInt(n[3]) || 0;
return Ko(e, r) ? t * (e * Mt + r * _t) : NaN;
}
function Fo(a, n, t) {
const e = /* @__PURE__ */ new Date(0);
e.setUTCFullYear(a, 0, 4);
const r = e.getUTCDay() || 7, o = (n - 1) * 7 + t + 1 - r;
return e.setUTCDate(e.getUTCDate() + o), e;
}
const Wo = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function Ur(a) {
return a % 400 === 0 || a % 4 === 0 && a % 100 !== 0;
}
function Ao(a, n, t) {
return n >= 0 && n <= 11 && t >= 1 && t <= (Wo[n] || (Ur(a) ? 29 : 28));
}
function Ho(a, n) {
return n >= 1 && n <= (Ur(a) ? 366 : 365);
}
function Qo(a, n, t) {
return n >= 1 && n <= 53 && t >= 0 && t <= 6;
}
function Bo(a, n, t) {
return a === 24 ? n === 0 && t === 0 : t >= 0 && t < 60 && n >= 0 && n < 60 && a >= 0 && a < 25;
}
function Ko(a, n) {
return n >= 0 && n <= 59;
}
function ae(a, n, t) {
const e = k(a, t == null ? void 0 : t.in), r = e.getFullYear(), o = e.getDate(), i = H(a, 0);
i.setFullYear(r, n, 15), i.setHours(0, 0, 0, 0);
const s = _a(i);
return e.setMonth(n, Math.min(o, s)), e;
}
function st(a, n, t) {
const e = k(a, t == null ? void 0 : t.in);
return e.setHours(n), e;
}
function ct(a, n, t) {
const e = k(a, t == null ? void 0 : t.in);
return e.setMinutes(n), e;
}
function Fe(a, n, t) {
const e = k(a, t == null ? void 0 : t.in), r = Math.trunc(e.getMonth() / 3) + 1, o = n - r;
return ae(e, e.getMonth() + o * 3);
}
function lt(a, n, t) {
const e = k(a, t == null ? void 0 : t.in);
return e.setSeconds(n), e;
}
function ue(a, n, t) {
const e = k(a, t == null ? void 0 : t.in);
return isNaN(+e) ? H(a, NaN) : (e.setFullYear(n), e);
}
function Ne(a, n, t) {
return ce(a, -n, t);
}
function jr(a, n, t) {
return Bt(a, -1, t);
}
function sr(a, n, t) {
return ht(a, -1, t);
}
function Qe(a, n, t) {
return ve(a, -n, t);
}
function qo() {
return typeof window < "u";
}
function $r(a) {
var n;
return (a == null || (n = a.ownerDocument) == null ? void 0 : n.defaultView) || window;
}
function $e(a) {
return qo() ? a instanceof Element || a instanceof $r(a).Element : !1;
}
function Vo(a) {
return $r(a).getComputedStyle(a);
}
var Uo = typeof document < "u", jo = function() {
}, yt = Uo ? Er : jo;
const $o = {
...S
}, Xo = $o.useInsertionEffect, Go = Xo || ((a) => a());
function zo(a) {
const n = S.useRef(() => {
if (process.env.NODE_ENV !== "production")
throw new Error("Cannot call an event handler while rendering.");
});
return Go(() => {
n.current = a;
}), S.useCallback(function() {
for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)
e[r] = arguments[r];
return n.current == null ? void 0 : n.current(...e);
}, []);
}
var Zo = typeof document < "u", Jo = function() {
}, ut = Zo ? Er : Jo;
function bt(a, n) {
if (a === n)
return !0;
if (typeof a != typeof n)
return !1;
if (typeof a == "function" && a.toString() === n.toString())
return !0;
let t, e, r;
if (a && n && typeof a == "object") {
if (Array.isArray(a)) {
if (t = a.length, t !== n.length) return !1;
for (e = t; e-- !== 0; )
if (!bt(a[e], n[e]))
return !1;
return !0;
}
if (r = Object.keys(a), t = r.length, t !== Object.keys(n).length)
return !1;
for (e = t; e-- !== 0; )
if (!{}.hasOwnProperty.call(n, r[e]))
return !1;
for (e = t; e-- !== 0; ) {
const o = r[e];
if (!(o === "_owner" && a.$$typeof) && !bt(a[o], n[o]))
return !1;
}
return !0;
}
return a !== a && n !== n;
}
function Xr(a) {
return typeof window > "u" ? 1 : (a.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function cr(a, n) {
const t = Xr(a);
return Math.round(n * t) / t;
}
function Ot(a) {
const n = S.useRef(a);
return ut(() => {
n.current = a;
}), n;
}
function ei(a) {
a === void 0 && (a = {});
const {
placement: n = "bottom",
strategy: t = "absolute",
middleware: e = [],
platform: r,
elements: {
reference: o,
floating: i
} = {},
transform: s = !0,
whileElementsMounted: c,
open: u
} = a, [l, d] = S.useState({
x: 0,
y: 0,
strategy: t,
placement: n,
middlewareData: {},
isPositioned: !1
}), [p, h] = S.useState(e);
bt(p, e) || h(e);
const [m, g] = S.useState(null), [v, b] = S.useState(null), C = S.useCallback((W) => {
W !== L.current && (L.current = W, g(W));
}, []), _ = S.useCallback((W) => {
W !== E.current && (E.current = W, b(W));
}, []), x = o || m, I = i || v, L = S.useRef(null), E = S.useRef(null), y = S.useRef(l), M = c != null, T = Ot(c), K = Ot(r), B = Ot(u), j = S.useCallback(() => {
if (!L.current || !E.current)
return;
const W = {
placement: n,
strategy: t,
middleware: p
};
K.current && (W.platform = K.current), gn(L.current, E.current, W).then((le) => {
const me = {
...le,
// The floating element's position may be recomputed while it's closed
// but still mounted (such as when transitioning out). To ensure
// `isPositioned` will be `false` initially on the next open, avoid
// setting it to `true` when `open === false` (must be specified).
isPositioned: B.current !== !1
};
re.current && !bt(y.current, me) && (y.current = me, fn.flushSync(() => {
d(me);
}));
});
}, [p, n, t, K, B]);
ut(() => {
u === !1 && y.current.isPositioned && (y.current.isPositioned = !1, d((W) => ({
...W,
isPositioned: !1
})));
}, [u]);
const re = S.useRef(!1);
ut(() => (re.current = !0, () => {
re.current = !1;
}), []), ut(() => {
if (x && (L.current = x), I && (E.current = I), x && I) {
if (T.current)
return T.current(x, I, j);
j();
}
}, [x, I, j, T, M]);
const $ = S.useMemo(() => ({
reference: L,
floating: E,
setReference: C,
setFloating: _
}), [C, _]), O = S.useMemo(() => ({
reference: x,
floating: I
}), [x, I]), Q = S.useMemo(() => {
const W = {
position: t,
left: 0,
top: 0
};
if (!O.floating)
return W;
const le = cr(O.floating, l.x), me = cr(O.floating, l.y);
return s ? {
...W,
transform: "translate(" + le + "px, " + me + "px)",
...Xr(O.floating) >= 1.5 && {
willChange: "transform"
}
} : {
position: t,
left: le,
top: me
};
}, [t, s, O.floating, l.x, l.y]);
return S.useMemo(() => ({
...l,
update: j,
refs: $,
elements: O,
floatingStyles: Q
}), [l, j, $, O, Q]);
}
const ti = (a) => {
function n(t) {
return {}.hasOwnProperty.call(t, "current");
}
return {
name: "arrow",
options: a,
fn(t) {
const {
element: e,
padding: r
} = typeof a == "function" ? a(t) : a;
return e && n(e) ? e.current != null ? Gt({
element: e.current,
padding: r
}).fn(t) : {} : e ? Gt({
element: e,
padding: r
}).fn(t) : {};
}
};
}, ri = (a, n) => ({
...vn(a),
options: [a, n]
}), ni = (a, n) => ({
...mn(a),
options: [a, n]
}), ai = (a, n) => ({
...ti(a),
options: [a, n]
}), oi = {
...S
};
let lr = !1, ii = 0;
const ur = () => (
// Ensure the id is unique with multiple independent versions of Floating UI
// on <React 18
"floating-ui-" + Math.random().toString(36).slice(2, 6) + ii++
);
function si() {
const [a, n] = S.useState(() => lr ? ur() : void 0);
return yt(() => {
a == null && n(ur());
}, []), S.useEffect(() => {
lr = !0;
}, []), a;
}
const ci = oi.useId, Gr = ci || si;
let Ze;
process.env.NODE_ENV !== "production" && (Ze = /* @__PURE__ */ new Set());
function li() {
for (var a, n = arguments.length, t = new Array(n), e = 0; e < n; e++)
t[e] = arguments[e];
const r = "Floating UI: " + t.join(" ");
if (!((a = Ze) != null && a.has(r))) {
var o;
(o = Ze) == null || o.add(r), console.warn(r);
}
}
function ui() {
for (var a, n = arguments.length, t = new Array(n), e = 0; e < n; e++)
t[e] = arguments[e];
const r = "Floating UI: " + t.join(" ");
if (!((a = Ze) != null && a.has(r))) {
var o;
(o = Ze) == null || o.add(r), console.error(r);
}
}
const di = /* @__PURE__ */ S.forwardRef(function(n, t) {
const {
context: {
placement: e,
elements: {
floating: r
},
middlewareData: {
arrow: o,
shift: i
}
},
width: s = 14,
height: c = 7,
tipRadius: u = 0,
strokeWidth: l = 0,
staticOffset: d,
stroke: p,
d: h,
style: {
transform: m,
...g
} = {},
...v
} = n;
process.env.NODE_ENV !== "production" && (t || li("The `ref` prop is required for `FloatingArrow`."));
const b = Gr(), [C, _] = S.useState(!1);
if (yt(() => {
if (!r) return;
Vo(r).direction === "rtl" && _(!0);
}, [r]), !r)
return null;
const [x, I] = e.split("-"), L = x === "top" || x === "bottom";
let E = d;
(L && i != null && i.x || !L && i != null && i.y) && (E = null);
const y = l * 2, M = y / 2, T = s / 2 * (u / -8 + 1), K = c / 2 * u / 4, B = !!h, j = E && I === "end" ? "bottom" : "top";
let re = E && I === "end" ? "right" : "left";
E && C && (re = I === "end" ? "left" : "right");
const $ = (o == null ? void 0 : o.x) != null ? E || o.x : "", O = (o == null ? void 0 : o.y) != null ? E || o.y : "", Q = h || "M0,0" + (" H" + s) + (" L" + (s - T) + "," + (c - K)) + (" Q" + s / 2 + "," + c + " " + T + "," + (c - K)) + " Z", W = {
top: B ? "rotate(180deg)" : "",
left: B ? "rotate(90deg)" : "rotate(-90deg)",
bottom: B ? "" : "rotate(180deg)",
right: B ? "rotate(-90deg)" : "rotate(90deg)"
}[x];
return /* @__PURE__ */ pn("svg", {
...v,
"aria-hidden": !0,
ref: t,
width: B ? s : s + y,
height: s,
viewBox: "0 0 " + s + " " + (c > s ? c : s),
style: {
position: "absolute",
pointerEvents: "none",
[re]: $,
[j]: O,
[x]: L || B ? "100%" : "calc(100% - " + y / 2 + "px)",
transform: [W, m].filter((le) => !!le).join(" "),
...g
},
children: [y > 0 && /* @__PURE__ */ je("path", {
clipPath: "url(#" + b + ")",
fill: "none",
stroke: p,
strokeWidth: y + (h ? 0 : 1),
d: Q
}), /* @__PURE__ */ je("path", {
stroke: y && !h ? v.fill : "none",
d: Q
}), /* @__PURE__ */ je("clipPath", {
id: b,
children: /* @__PURE__ */ je("rect", {
x: -M,
y: M * (B ? -1 : 1),
width: s + y,
height: s
})
})]
});
});
function pi() {
const a = /* @__PURE__ */ new Map();
return {
emit(n, t) {
var e;
(e = a.get(n)) == null || e.forEach((r) => r(t));
},
on(n, t) {
a.has(n) || a.set(n, /* @__PURE__ */ new Set()), a.get(n).add(t);
},
off(n, t) {
var e;
(e = a.get(n)) == null || e.delete(t);
}
};
}
const fi = /* @__PURE__ */ S.createContext(null), hi = /* @__PURE__ */ S.createContext(null), mi = () => {
var a;
return ((a = S.useContext(fi)) == null ? void 0 : a.id) || null;
}, vi = () => S.useContext(hi);
function gi(a) {
const {
open: n = !1,
onOpenChange: t,
elements: e
} = a, r = Gr(), o = S.useRef({}), [i] = S.useState(() => pi()), s = mi() != null;
if (process.env.NODE_ENV !== "production") {
const h = e.reference;
h && !$e(h) && ui("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
}
const [c, u] = S.useState(e.reference), l = zo((h, m, g) => {
o.current.openEvent = h ? m : void 0, i.emit("openchange", {
open: h,
event: m,
reason: g,
nested: s
}), t == null || t(h, m, g);
}), d = S.useMemo(() => ({
setPositionReference: u
}), []), p = S.useMemo(() => ({
reference: c || e.reference || null,
floating: e.floating || null,
domReference: e.reference
}), [c, e.reference, e.floating]);
return S.useMemo(() => ({
dataRef: o,
open: n,
onOpenChange: l,
elements: p,
events: i,
floatingId: r,
refs: d
}), [n, l, p, i, r, d]);
}
function Di(a) {
a === void 0 && (a = {});
const {
nodeId: n
} = a, t = gi({
...a,
elements: {
reference: null,
floating: null,
...a.elements
}
}), e = a.rootContext || t, r = e.elements, [o, i] = S.useState(null), [s, c] = S.useState(null), l = (r == null ? void 0 : r.domReference) || o, d = S.useRef(null), p = vi();
yt(() => {
l && (d.current = l);
}, [l]);
const h = ei({
...a,
elements: {
...r,
...s && {
reference: s
}
}
}), m = S.useCallback((_) => {
const x = $e(_) ? {
getBoundingClientRect: () => _.getBoundingClientRect(),
getClientRects: () => _.getClientRects(),
contextElement: _
} : _;
c(x), h.refs.setReference(x);
}, [h.refs]), g = S.useCallback((_) => {
($e(_) || _ === null) && (d.current = _, i(_)), ($e(h.refs.reference.current) || h.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
// `null` to support `positionReference` + an unstable `reference`
// callback ref.
_ !== null && !$e(_)) && h.refs.setReference(_);
}, [h.refs]), v = S.useMemo(() => ({
...h.refs,
setReference: g,
setPositionReference: m,
domReference: d
}), [h.refs, g, m]), b = S.useMemo(() => ({
...h.elements,
domReference: l
}), [h.elements, l]), C = S.useMemo(() => ({
...h,
...e,
refs: v,
elements: b,
nodeId: n
}), [h, v, b, n, e]);
return yt(() => {
e.dataRef.current.floatingContext = C;
const _ = p == null ? void 0 : p.nodesRef.current.find((x) => x.id === n);
_ && (_.context = C);
}), S.useMemo(() => ({
...h,
context: C,
refs: v,
elements: b
}), [h, v, b, C]);
}
var Qt = function(n, t) {
return Qt = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(e, r) {
e.__proto__ = r;
} || function(e, r) {
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (e[o] = r[o]);
}, Qt(n, t);
};
function Z(a, n) {
if (typeof n != "function" && n !== null) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
Qt(a, n);
function t() {
this.constructor = a;
}
a.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
}
var Y = function() {
return Y = Object.assign || function(t) {
for (var e, r = 1, o = arguments.length; r < o; r++) {
e = arguments[r];
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Y.apply(this, arguments);
};
function he(a, n, t) {
if (t || arguments.length === 2) for (var e = 0, r = n.length, o; e < r; e++)
(o || !(e in n)) && (o || (o = Array.prototype.slice.call(n, 0, e)), o[e] = n[e]);
return a.concat(o || Array.prototype.slice.call(n));
}
var wi = function(a) {
var n = a.showTimeSelectOnly, t = n === void 0 ? !1 : n, e = a.showTime, r = e === void 0 ? !1 : e, o = a.className, i = a.children, s = t ? "Choose Time" : "Choose Date".concat(r ? " and Time" : "");
return f.createElement("div", { className: o, role: "dialog", "aria-label": s, "aria-modal": "true" }, i);
}, yi = function(a, n) {
var t = Lt(null), e = Lt(a);
e.current = a;
var r = ln(function(o) {
var i, s = o.composed && o.composedPath && o.composedPath().find(function(c) {
return c instanceof Node;
}) || o.target;
t.current && !t.current.contains(s) && (n && s instanceof HTMLElement && s.classList.contains(n) || (i = e.current) === null || i === void 0 || i.call(e, o));
}, [n]);
return un(function() {
return document.addEventListener("mousedown", r), function() {
document.removeEventListener("mousedown", r);
};
}, [r]), t;
}, St = function(a) {
var n = a.children, t = a.onClickOutside, e = a.className, r = a.containerRef, o = a.style, i = a.ignoreClass, s = yi(t, i);
return f.createElement("div", { className: e, style: o, ref: function(c) {
s.current = c, r && (r.current = c);
} }, n);
}, D;
(function(a) {
a.ArrowUp = "ArrowUp", a.ArrowDown = "ArrowDown", a.ArrowLeft = "ArrowLeft", a.ArrowRight = "ArrowRight", a.PageUp = "PageUp", a.PageDown = "PageDown", a.Home = "Home", a.End = "End", a.Enter = "Enter", a.Space = " ", a.Tab = "Tab", a.Escape = "Escape", a.Backspace = "Backspace", a.X = "x";
})(D || (D = {}));
function zr() {
var a = typeof window < "u" ? window : globalThis;
return a;
}
var Je = 12;
function F(a) {
if (a == null)
return /* @__PURE__ */ new Date();
var n = typeof a == "string" ? Po(a) : k(a);
return xt(n) ? n : /* @__PURE__ */ new Date();
}
function Tt(a, n, t, e, r) {
r === void 0 && (r = F());
for (var o = Be(t) || Be(jt()), i = Array.isArray(n) ? n : [n], s = 0, c = i; s < c.length; s++) {
var u = c[s], l = ko(a, u, r, {
locale: o
});
if (xt(l) && (!e || a === q(l, u, t)))
return l;
}
return null;
}
function xt(a, n) {
return mt(a) && !Re(a, /* @__PURE__ */ new Date("1/1/1800"));
}
function q(a, n, t) {
if (t === "en")
return or(a, n, {
useAdditionalWeekYearTokens: !0,
useAdditionalDayOfYearTokens: !0
});
var e = t ? Be(t) : void 0;
return t && !e && console.warn('A locale object was not found for the provided string ["'.concat(t, '"].')), e = e || Be(jt()), or(a, n, {
locale: e,
useAdditionalWeekYearTokens: !0,
useAdditionalDayOfYearTokens: !0
});
}
function ne(a, n) {
var t = n.dateFormat, e = n.locale, r = Array.isArray(t) && t.length > 0 ? t[0] : t;
return a && q(a, r, e) || "";
}
var Zr = " - ";
function bi(a, n, t) {
if (!a)
return "";
var e = ne(a, t), r = n ? ne(n, t) : "";
return "".concat(e).concat(Zr).concat(r);
}
function ki(a, n) {
if (!(a != null && a.length))
return "";
var t = a[0] ? ne(a[0], n) : "";
if (a.length === 1)
return t;
if (a.length === 2 && a[1]) {
var e = ne(a[1], n);
return "".concat(t, ", ").concat(e);
}
var r = a.length - 1;
return "".concat(t, " (+").concat(r, ")");
}
function Nt(a, n) {
var t = n.hour, e = t === void 0 ? 0 : t, r = n.minute, o = r === void 0 ? 0 : r, i = n.second, s = i === void 0 ? 0 : i;
return st(ct(lt(a, s), o), e);
}
function _i(a) {
return Kt(a);
}
function Mi(a, n) {
return q(a, "ddd", n);
}
function dt(a) {
return Ye(a);
}
function Se(a, n, t) {
var e = Be(n || jt());
return be(a, {
locale: e,
weekStartsOn: t
});
}
function ye(a) {
return Fr(a);
}
function Xe(a) {
return Ct(a);
}
function dr(a) {
return Wt(a);
}
function pr() {
return Ye(F());
}
function fr(a) {
return Ir(a);
}
function Ci(a) {
return xn(a);
}
function Si(a) {
return Lr(a);
}
function de(a, n) {
return a && n ? So(a, n) : !a && !n;
}
function te(a, n) {
return a && n ? Mo(a, n) : !a && !n;
}
function kt(a, n) {
return a && n ? Co(a, n) : !a && !n;
}
function N(a, n) {
return a && n ? Cn(a, n) : !a && !n;
}
function Oe(a, n) {
return a && n ? Sa(a, n) : !a && !n;
}
function Ge(a, n, t) {
var e, r = Ye(n), o = Ir(t);
try {
e = ze(a, { start: r, end: o });
} catch {
e = !1;
}
return e;
}
function jt() {
var a = zr();
return a.__localeId__;
}
function Be(a) {
if (typeof a == "string") {
var n = zr();
return n.__localeData__ ? n.__localeData__[a] : void 0;
} else
return a;
}
function xi(a, n, t) {
return n(q(a, "EEEE", t));
}
function Pi(a, n) {
return q(a, "EEEEEE", n);
}
function Ei(a, n) {
return q(a, "EEE", n);
}
function $t(a, n) {
return q(ae(F(), a), "LLLL", n);
}
function Jr(a, n) {
return q(ae(F(), a), "LLL", n);
}
function Oi(a, n) {
return q(Fe(F(), a), "QQQ", n);
}
function oe(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.maxDate, o = t.excludeDates, i = t.excludeDateIntervals, s = t.includeDates, c = t.includeDateIntervals, u = t.filterDate;
return et(a, { minDate: e, maxDate: r }) || o && o.some(function(l) {
return l instanceof Date ? N(a, l) : N(a, l.date);
}) || i && i.some(function(l) {
var d = l.start, p = l.end;
return ze(a, { start: d, end: p });
}) || s && !s.some(function(l) {
return N(a, l);
}) || c && !c.some(function(l) {
var d = l.start, p = l.end;
return ze(a, { start: d, end: p });
}) || u && !u(F(a)) || !1;
}
function Xt(a, n) {
var t = n === void 0 ? {} : n, e = t.excludeDates, r = t.excludeDateIntervals;
return r && r.length > 0 ? r.some(function(o) {
var i = o.start, s = o.end;
return ze(a, { start: i, end: s });
}) : e && e.some(function(o) {
var i;
return o instanceof Date ? N(a, o) : N(a, (i = o.date) !== null && i !== void 0 ? i : /* @__PURE__ */ new Date());
}) || !1;
}
function en(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.maxDate, o = t.excludeDates, i = t.includeDates, s = t.filterDate;
return et(a, {
minDate: e ? Fr(e) : void 0,
maxDate: r ? Lr(r) : void 0
}) || (o == null ? void 0 : o.some(function(c) {
return te(a, c instanceof Date ? c : c.date);
})) || i && !i.some(function(c) {
return te(a, c);
}) || s && !s(F(a)) || !1;
}
function rt(a, n, t, e) {
var r = P(a), o = ee(a), i = P(n), s = ee(n), c = P(e);
return r === i && r === c ? o <= t && t <= s : r < i ? c === r && o <= t || c === i && s >= t || c < i && c > r : !1;
}
function Ti(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.maxDate, o = t.excludeDates, i = t.includeDates;
return et(a, { minDate: e, maxDate: r }) || o && o.some(function(s) {
return te(s instanceof Date ? s : s.date, a);
}) || i && !i.some(function(s) {
return te(s, a);
}) || !1;
}
function nt(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.maxDate, o = t.excludeDates, i = t.includeDates, s = t.filterDate;
return et(a, { minDate: e, maxDate: r }) || (o == null ? void 0 : o.some(function(c) {
return kt(a, c instanceof Date ? c : c.date);
})) || i && !i.some(function(c) {
return kt(a, c);
}) || s && !s(F(a)) || !1;
}
function at(a, n, t) {
if (!n || !t || !mt(n) || !mt(t))
return !1;
var e = P(n), r = P(t);
return e <= a && r >= a;
}
function pt(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.maxDate, o = t.excludeDates, i = t.includeDates, s = t.filterDate, c = new Date(a, 0, 1);
return et(c, {
minDate: e ? Ct(e) : void 0,
maxDate: r ? Wr(r) : void 0
}) || (o == null ? void 0 : o.some(function(u) {
return de(c, u instanceof Date ? u : u.date);
})) || i && !i.some(function(u) {
return de(c, u);
}) || s && !s(F(c)) || !1;
}
function ot(a, n, t, e) {
var r = P(a), o = Te(a), i = P(n), s = Te(n), c = P(e);
return r === i && r === c ? o <= t && t <= s : r < i ? c === r && o <= t || c === i && s >= t || c < i && c > r : !1;
}
function et(a, n) {
var t, e = n === void 0 ? {} : n, r = e.minDate, o = e.maxDate;
return (t = r && He(a, r) < 0 || o && He(a, o) > 0) !== null && t !== void 0 ? t : !1;
}
function hr(a, n) {
return n.some(function(t) {
return De(t) === De(a) && we(t) === we(a) && Ce(t) === Ce(a);
});
}
function mr(a, n) {
var t = n === void 0 ? {} : n, e = t.excludeTimes, r = t.includeTimes, o = t.filterTime;
return e && hr(a, e) || r && !hr(a, r) || o && !o(a) || !1;
}
function vr(a, n) {
var t = n.minTime, e = n.maxTime;
if (!t || !e)
throw new Error("Both minTime and maxTime props required");
var r = F();
r = st(r, De(a)), r = ct(r, we(a)), r = lt(r, Ce(a));
var o = F();
o = st(o, De(t)), o = ct(o, we(t)), o = lt(o, Ce(t));
var i = F();
i = st(i, De(e)), i = ct(i, we(e)), i = lt(i, Ce(e));
var s;
try {
s = !ze(r, { start: o, end: i });
} catch {
s = !1;
}
return s;
}
function gr(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.includeDates, o = Ne(a, 1);
return e && vt(e, o) > 0 || r && r.every(function(i) {
return vt(i, o) > 0;
}) || !1;
}
function Dr(a, n) {
var t = n === void 0 ? {} : n, e = t.maxDate, r = t.includeDates, o = ce(a, 1);
return e && vt(o, e) > 0 || r && r.every(function(i) {
return vt(o, i) > 0;
}) || !1;
}
function Ni(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.includeDates, o = Ct(a), i = jr(o);
return e && gt(e, i) > 0 || r && r.every(function(s) {
return gt(s, i) > 0;
}) || !1;
}
function Yi(a, n) {
var t = n === void 0 ? {} : n, e = t.maxDate, r = t.includeDates, o = Wr(a), i = Bt(o, 1);
return e && gt(i, e) > 0 || r && r.every(function(s) {
return gt(i, s) > 0;
}) || !1;
}
function wr(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.includeDates, o = Qe(a, 1);
return e && Dt(e, o) > 0 || r && r.every(function(i) {
return Dt(i, o) > 0;
}) || !1;
}
function Ri(a, n) {
var t = n === void 0 ? {} : n, e = t.minDate, r = t.yearItemNumber, o = r === void 0 ? Je : r, i = Xe(Qe(a, o)), s = Me(i, o).endPeriod, c = e && P(e);
return c && c > s || !1;
}
function yr(a, n) {
var t = n === void 0 ? {} : n, e = t.maxDate, r = t.includeDates, o = ve(a, 1);
return e && Dt(o, e) > 0 || r && r.every(function(i) {
return Dt(o, i) > 0;
}) || !1;
}
function Ii(a, n) {
var t = n === void 0 ? {} : n, e = t.maxDate, r = t.yearItemNumber, o = r === void 0 ? Je : r, i = ve(a, o), s = Me(i, o).startPeriod, c = e && P(e);
return c && c < s || !1;
}
function tn(a) {
var n = a.minDate, t = a.includeDates;
if (t && n) {
var e = t.filter(function(r) {
return He(r, n) >= 0;
});
return Jt(e);
} else return t ? Jt(t) : n;
}
function rn(a) {
var n = a.maxDate, t = a.includeDates;
if (t && n) {
var e = t.filter(function(r) {
return He(r, n) <= 0;
});
return Zt(e);
} else return t ? Zt(t) : n;
}
function br(a, n) {
var t;
a === void 0 && (a = []), n === void 0 && (n = "react-datepicker__day--highlighted");
for (var e = /* @__PURE__ */ new Map(), r = 0, o = a.length; r < o; r++) {
var i = a[r];
if (ge(i)) {
var s = q(i, "MM.dd.yyyy"), c = e.get(s) || [];
c.includes(n) || (c.push(n), e.set(s, c));
} else if (typeof i == "object") {
var u = Object.keys(i), l = (t = u[0]) !== null && t !== void 0 ? t : "", d = i[l];
if (typeof l == "string" && Array.isArray(d))
for (var p = 0, h = d.length; p < h; p++) {
var m = d[p];
if (m) {
var s = q(m, "MM.dd.yyyy"), c = e.get(s) || [];
c.includes(l) || (c.push(l), e.set(s, c));
}
}
}
}
return e;
}
function Li(a, n) {
return a.length !== n.length ? !1 : a.every(function(t, e) {
return t === n[e];
});
}
function Fi(a, n) {
a === void 0 && (a = []), n === void 0 && (n = "react-datepicker__day--holidays");
var t = /* @__PURE__ */ new Map();
return a.forEach(function(e) {
var r = e.date, o = e.holidayName;
if (ge(r)) {
var i = q(r, "MM.dd.yyyy"), s = t.get(i) || {
className: "",
holidayNames: []
};
if (!("className" in s && s.className === n && Li(s.holidayNames, [o]))) {
s.className = n;
var c = s.holidayNames;
s.holidayNames = c ? he(he([], c, !0), [o], !1) : [o], t.set(i, s);
}
}
}), t;
}
function Wi(a, n, t, e, r) {
for (var o = r.length, i = [], s = 0; s < o; s++) {
var c = a, u = r[s];
u && (c = bn(c, De(u)), c = Ft(c, we(u)), c = Mn(c, Ce(u)));
var l = Ft(a, (t + 1) * e);
Pe(c, n) && Re(c, l) && u != null && i.push(u);
}
return i;
}
function kr(a) {
return a < 10 ? "0".concat(a) : "".concat(a);
}
function Me(a, n) {
n === void 0 && (n = Je);
var t = Math.ceil(P(a) / n) * n, e = t - (n - 1);
return { startPeriod: e, endPeriod: t };
}
function Ai(a) {
var n = new Date(a.getFullYear(), a.getMonth(), a.getDate()), t = new Date(a.getFullYear(), a.getMonth(), a.getDate(), 24);
return Math.round((+t - +n) / 36e5);
}
function _r(a) {
var n = a.getSeconds(), t = a.getMilliseconds();
return k(a.getTime() - n * 1e3 - t);
}
function Hi(a, n) {
return _r(a).getTime() === _r(n).getTime();
}
function Mr(a) {
if (!ge(a))
throw new Error("Invalid date");
var n = new Date(a);
return n.setHours(0, 0, 0, 0), n;
}
function Cr(a, n) {
if (!ge(a) || !ge(n))
throw new Error("Invalid date received");
var t = Mr(a), e = Mr(n);
return Re(t, e);
}
function nn(a) {
return a.key === D.Space;
}
var Qi = (
/** @class */
function(a) {
Z(n, a);
function n(t) {
var e = a.call(this, t) || this;
return e.inputRef = f.createRef(), e.onTimeChange = function(r) {
var o, i;
e.setState({ time: r });
var s = e.props.date, c = s instanceof Date && !isNaN(+s), u = c ? s : /* @__PURE__ */ new Date();
if (r != null && r.includes(":")) {
var l = r.split(":"), d = l[0], p = l[1];
u.setHours(Number(d)), u.setMinutes(Number(p));
}
(i = (o = e.props).onChange) === null || i === void 0 || i.call(o, u);
}, e.renderTimeInput = function() {
var r = e.state.time, o = e.props, i = o.date, s = o.timeString, c = o.customTimeInput;
return c ? Or(c, {
date: i,
value: r,
onChange: e.onTimeChange
}) : f.createElement("input", { type: "time", className: "react-datepicker-time__input", placeholder: "Time", name: "time-input", ref: e.inputRef, onClick: function() {
var u;
(u = e.inputRef.current) === null || u === void 0 || u.focus();
}, required: !0, value: r, onChange: function(u) {
e.onTimeChange(u.target.value || s);
} });
}, e.state = {
time: e.props.timeString
}, e;
}
return n.getDerivedStateFromProps = function(t, e) {
return t.timeString !== e.time ? {
time: t.timeString
} : null;
}, n.prototype.render = function() {
return f.createElement(
"div",
{ className: "react-datepicker__input-time-container" },
f.createElement("div", { className: "react-datepicker-time__caption" }, this.props.timeInputLabel),
f.createElement(
"div",
{ className: "react-datepicker-time__input-container" },
f.createElement("div", { className: "react-datepicker-time__input" }, this.renderTimeInput())
)
);
}, n;
}(z)
), Bi = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.dayEl = xe(), t.handleClick = function(e) {
!t.isDisabled() && t.props.onClick && t.props.onClick(e);
}, t.handleMouseEnter = function(e) {
!t.isDisabled() && t.props.onMouseEnter && t.props.onMouseEnter(e);
}, t.handleOnKeyDown = function(e) {
var r, o, i = e.key;
i === D.Space && (e.preventDefault(), e.key = D.Enter), (o = (r = t.props).handleOnKeyDown) === null || o === void 0 || o.call(r, e);
}, t.isSameDay = function(e) {
return N(t.props.day, e);
}, t.isKeyboardSelected = function() {
var e;
if (t.props.disabledKeyboardNavigation)
return !1;
var r = t.props.selectsMultiple ? (e = t.props.selectedDates) === null || e === void 0 ? void 0 : e.some(function(i) {
return t.isSameDayOrWeek(i);
}) : t.isSameDayOrWeek(t.props.selected), o = t.props.preSelection && t.isDisabled(t.props.preSelection);
return !r && t.isSameDayOrWeek(t.props.preSelection) && !o;
}, t.isDisabled = function(e) {
return e === void 0 && (e = t.props.day), oe(e, {
minDate: t.props.minDate,
maxDate: t.props.maxDate,
excludeDates: t.props.excludeDates,
excludeDateIntervals: t.props.excludeDateIntervals,
includeDateIntervals: t.props.includeDateIntervals,
includeDates: t.props.includeDates,
filterDate: t.props.filterDate
});
}, t.isExcluded = function() {
return Xt(t.props.day, {
excludeDates: t.props.excludeDates,
excludeDateIntervals: t.props.excludeDateIntervals
});
}, t.isStartOfWeek = function() {
return N(t.props.day, Se(t.props.day, t.props.locale, t.props.calendarStartDay));
}, t.isSameWeek = function(e) {
return t.props.showWeekPicker && N(e, Se(t.props.day, t.props.locale, t.props.calendarStartDay));
}, t.isSameDayOrWeek = function(e) {
return t.isSameDay(e) || t.isSameWeek(e);
}, t.getHighLightedClass = function() {
var e = t.props, r = e.day, o = e.highlightDates;
if (!o)
return !1;
var i = q(r, "MM.dd.yyyy");
return o.get(i);
}, t.getHolidaysClass = function() {
var e, r = t.props, o = r.day, i = r.holidays;
if (!i)
return [void 0];
var s = q(o, "MM.dd.yyyy");
return i.has(s) ? [(e = i.get(s)) === null || e === void 0 ? void 0 : e.className] : [void 0];
}, t.isInRange = function() {
var e = t.props, r = e.day, o = e.startDate, i = e.endDate;
return !o || !i ? !1 : Ge(r, o, i);
}, t.isInSelectingRange = function() {
var e, r = t.props, o = r.day, i = r.selectsStart, s = r.selectsEnd, c = r.selectsRange, u = r.selectsDisabledDaysInRange, l = r.startDate, d = r.endDate, p = (e = t.props.selectingDate) !== null && e !== void 0 ? e : t.props.preSelection;
return !(i || s || c) || !p || !u && t.isDisabled() ? !1 : i && d && (Re(p, d) || Oe(p, d)) ? Ge(o, p, d) : s && l && (Pe(p, l) || Oe(p, l)) || c && l && !d && (Pe(p, l) || Oe(p, l)) ? Ge(o, l, p) : !1;
}, t.isSelectingRangeStart = function() {
var e;
if (!t.isInSelectingRange())
return !1;
var r = t.props, o = r.day, i = r.startDate, s = r.selectsStart, c = (e = t.props.selectingDate) !== null && e !== void 0 ? e : t.props.preSelection;
return s ? N(o, c) : N(o, i);
}, t.isSelectingRangeEnd = function() {
var e;
if (!t.isInSelectingRange())
return !1;
var r = t.props, o = r.day, i = r.endDate, s = r.selectsEnd, c = r.selectsRange, u = (e = t.props.selectingDate) !== null && e !== void 0 ? e : t.props.preSelection;
return s || c ? N(o, u) : N(o, i);
}, t.isRangeStart = function() {
var e = t.props, r = e.day, o = e.startDate, i = e.endDate;
return !o || !i ? !1 : N(o, r);
}, t.isRangeEnd = function() {
var e = t.props, r = e.day, o = e.startDate, i = e.endDate;
return !o || !i ? !1 : N(i, r);
}, t.isWeekend = function() {
var e = ka(t.props.day);
return e === 0 || e === 6;
}, t.isAfterMonth = function() {
return t.props.month !== void 0 && (t.props.month + 1) % 12 === ee(t.props.day);
}, t.isBeforeMonth = function() {
return t.props.month !== void 0 && (ee(t.props.day) + 1) % 12 === t.props.month;
}, t.isCurrentDay = function() {
return t.isSameDay(F());
}, t.isSelected = function() {
var e;
return t.props.selectsMultiple ? (e = t.props.selectedDates) === null || e === void 0 ? void 0 : e.some(function(r) {
return t.isSameDayOrWeek(r);
}) : t.isSameDayOrWeek(t.props.selected);
}, t.getClassNames = function(e) {
var r = t.props.dayClassName ? t.props.dayClassName(e) : void 0;
return J("react-datepicker__day", r, "react-datepicker__day--" + Mi(t.props.day), {
"react-datepicker__day--disabled": t.isDisabled(),
"react-datepicker__day--excluded": t.isExcluded(),
"react-datepicker__day--selected": t.isSelected(),
"react-datepicker__day--keyboard-selected": t.isKeyboardSelected(),
"react-datepicker__day--range-start": t.isRangeStart(),
"react-datepicker__day--range-end": t.isRangeEnd(),
"react-datepicker__day--in-range": t.isInRange(),
"react-datepicker__day--in-selecting-range": t.isInSelectingRange(),
"react-datepicker__day--selecting-range-start": t.isSelectingRangeStart(),
"react-datepicker__day--selecting-range-end": t.isSelectingRangeEnd(),
"react-datepicker__day--today": t.isCurrentDay(),
"react-datepicker__day--weekend": t.isWeekend(),
"react-datepicker__day--outside-month": t.isAfterMonth() || t.isBeforeMonth()
}, t.getHighLightedClass(), t.getHolidaysClass());
}, t.getAriaLabel = function() {
var e = t.props, r = e.day, o = e.ariaLabelPrefixWhenEnabled, i = o === void 0 ? "Choose" : o, s = e.ariaLabelPrefixWhenDisabled, c = s === void 0 ? "Not available" : s, u = t.isDisabled() || t.isExcluded() ? c : i;
return "".concat(u, " ").concat(q(r, "PPPP", t.props.locale));
}, t.getTitle = function() {
var e = t.props, r = e.day, o = e.holidays, i = o === void 0 ? /* @__PURE__ */ new Map() : o, s = e.excludeDates, c = q(r, "MM.dd.yyyy"), u = [];
return i.has(c) && u.push.apply(u, i.get(c).holidayNames), t.isExcluded() && u.push(s == null ? void 0 : s.filter(function(l) {
return l instanceof Date ? N(l, r) : N(l == null ? void 0 : l.date, r);
}).map(function(l) {
if (!(l instanceof Date))
return l == null ? void 0 : l.message;
})), u.join(", ");
}, t.getTabIndex = function() {
var e = t.props.selected, r = t.props.preSelection, o = !(t.props.showWeekPicker && (t.props.showWeekNumber || !t.isStartOfWeek())) && (t.isKeyboardSelected() || t.isSameDay(e) && N(r, e)) ? 0 : -1;
return o;
}, t.handleFocusDay = function() {
var e;
t.shouldFocusDay() && ((e = t.dayEl.current) === null || e === void 0 || e.focus({ preventScroll: !0 }));
}, t.renderDayContents = function() {
return t.props.monthShowsDuplicateDaysEnd && t.isAfterMonth() || t.props.monthShowsDuplicateDaysStart && t.isBeforeMonth() ? null : t.props.renderDayContents ? t.props.renderDayContents(ir(t.props.day), t.props.day) : ir(t.props.day);
}, t.render = function() {
return (
// TODO: Use <option> instead of the "option" role to ensure accessibility across all devices.
f.createElement(
"div",
{ ref: t.dayEl, className: t.getClassNames(t.props.day), onKeyDown: t.handleOnKeyDown, onClick: t.handleClick, onMouseEnter: t.props.usePointerEvent ? void 0 : t.handleMouseEnter, onPointerEnter: t.props.usePointerEvent ? t.handleMouseEnter : void 0, tabIndex: t.getTabIndex(), "aria-label": t.getAriaLabel(), role: "option", title: t.getTitle(), "aria-disabled": t.isDisabled(), "aria-current": t.isCurrentDay() ? "date" : void 0, "aria-selected": t.isSelected() || t.isInRange() },
t.renderDayContents(),
t.getTitle() !== "" && f.createElement("span", { className: "overlay" }, t.getTitle())
)
);
}, t;
}
return n.prototype.componentDidMount = function() {
this.handleFocusDay();
}, n.prototype.componentDidUpdate = function() {
this.handleFocusDay();
}, n.prototype.shouldFocusDay = function() {
var t = !1;
return this.getTabIndex() === 0 && this.isSameDay(this.props.preSelection) && ((!document.activeElement || document.activeElement === document.body) && (t = !0), this.props.inline && !this.props.shouldFocusDayInline && (t = !1), this.isDayActiveElement() && (t = !0), this.isDuplicateDay() && (t = !1)), t;
}, n.prototype.isDayActiveElement = function() {
var t, e, r;
return ((e = (t = this.props.containerRef) === null || t === void 0 ? void 0 : t.current) === null || e === void 0 ? void 0 : e.contains(document.activeElement)) && ((r = document.activeElement) === null || r === void 0 ? void 0 : r.classList.contains("react-datepicker__day"));
}, n.prototype.isDuplicateDay = function() {
return (
//day is one of the non rendered duplicate days
this.props.monthShowsDuplicateDaysEnd && this.isAfterMonth() || this.props.monthShowsDuplicateDaysStart && this.isBeforeMonth()
);
}, n;
}(z)
), Ki = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.weekNumberEl = xe(), t.handleClick = function(e) {
t.props.onClick && t.props.onClick(e);
}, t.handleOnKeyDown = function(e) {
var r, o, i = e.key;
i === D.Space && (e.preventDefault(), e.key = D.Enter), (o = (r = t.props).handleOnKeyDown) === null || o === void 0 || o.call(r, e);
}, t.isKeyboardSelected = function() {
return !t.props.disabledKeyboardNavigation && !N(t.props.date, t.props.selected) && N(t.props.date, t.props.preSelection);
}, t.getTabIndex = function() {
return t.props.showWeekPicker && t.props.showWeekNumber && (t.isKeyboardSelected() || N(t.props.date, t.props.selected) && N(t.props.preSelection, t.props.selected)) ? 0 : -1;
}, t.handleFocusWeekNumber = function(e) {
var r = !1;
t.getTabIndex() === 0 && !(e != null && e.isInputFocused) && N(t.props.date, t.props.preSelection) && ((!document.activeElement || document.activeElement === document.body) && (r = !0), t.props.inline && !t.props.shouldFocusDayInline && (r = !1), t.props.containerRef && t.props.containerRef.current && t.props.containerRef.current.contains(document.activeElement) && document.activeElement && document.activeElement.classList.contains("react-datepicker__week-number") && (r = !0)), r && t.weekNumberEl.current && t.weekNumberEl.current.focus({ preventScroll: !0 });
}, t;
}
return Object.defineProperty(n, "defaultProps", {
get: function() {
return {
ariaLabelPrefix: "week "
};
},
enumerable: !1,
configurable: !0
}), n.prototype.componentDidMount = function() {
this.handleFocusWeekNumber();
}, n.prototype.componentDidUpdate = function(t) {
this.handleFocusWeekNumber(t);
}, n.prototype.render = function() {
var t = this.props, e = t.weekNumber, r = t.isWeekDisabled, o = t.ariaLabelPrefix, i = o === void 0 ? n.defaultProps.ariaLabelPrefix : o, s = t.onClick, c = {
"react-datepicker__week-number": !0,
"react-datepicker__week-number--clickable": !!s && !r,
"react-datepicker__week-number--selected": !!s && N(this.props.date, this.props.selected)
};
return f.createElement("div", { ref: this.weekNumberEl, className: J(c), "aria-label": "".concat(i, " ").concat(this.props.weekNumber), onClick: this.handleClick, onKeyDown: this.handleOnKeyDown, tabIndex: this.getTabIndex() }, e);
}, n;
}(z)
), qi = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.isDisabled = function(e) {
return oe(e, {
minDate: t.props.minDate,
maxDate: t.props.maxDate,
excludeDates: t.props.excludeDates,
excludeDateIntervals: t.props.excludeDateIntervals,
includeDateIntervals: t.props.includeDateIntervals,
includeDates: t.props.includeDates,
filterDate: t.props.filterDate
});
}, t.handleDayClick = function(e, r) {
t.props.onDayClick && t.props.onDayClick(e, r);
}, t.handleDayMouseEnter = function(e) {
t.props.onDayMouseEnter && t.props.onDayMouseEnter(e);
}, t.handleWeekClick = function(e, r, o) {
for (var i, s, c, u = new Date(e), l = 0; l < 7; l++) {
var d = new Date(e);
d.setDate(d.getDate() + l);
var p = !t.isDisabled(d);
if (p) {
u = d;
break;
}
}
typeof t.props.onWeekSelect == "function" && t.props.onWeekSelect(u, r, o), t.props.showWeekPicker && t.handleDayClick(u, o), ((i = t.props.shouldCloseOnSelect) !== null && i !== void 0 ? i : n.defaultProps.shouldCloseOnSelect) && ((c = (s = t.props).setOpen) === null || c === void 0 || c.call(s, !1));
}, t.formatWeekNumber = function(e) {
return t.props.formatWeekNumber ? t.props.formatWeekNumber(e) : _i(e);
}, t.isWeekDisabled = function() {
for (var e = t.startOfWeek(), r = se(e, 6), o = new Date(e); o <= r; ) {
if (!t.isDisabled(o))
return !1;
o = se(o, 1);
}
return !0;
}, t.renderDays = function() {
var e = t.startOfWeek(), r = [], o = t.formatWeekNumber(e);
if (t.props.showWeekNumber) {
var i = t.props.onWeekSelect || t.props.showWeekPicker ? t.handleWeekClick.bind(t, e, o) : void 0;
r.push(f.createElement(Ki, Y({ key: "W" }, n.defaultProps, t.props, { weekNumber: o, isWeekDisabled: t.isWeekDisabled(), date: e, onClick: i })));
}
return r.concat([0, 1, 2, 3, 4, 5, 6].map(function(s) {
var c = se(e, s);
return f.createElement(Bi, Y({}, n.defaultProps, t.props, { ariaLabelPrefixWhenEnabled: t.props.chooseDayAriaLabelPrefix, ariaLabelPrefixWhenDisabled: t.props.disabledDayAriaLabelPrefix, key: c.valueOf(), day: c, onClick: t.handleDayClick.bind(t, c), onMouseEnter: t.handleDayMouseEnter.bind(t, c) }));
}));
}, t.startOfWeek = function() {
return Se(t.props.day, t.props.locale, t.props.calendarStartDay);
}, t.isKeyboardSelected = function() {
return !t.props.disabledKeyboardNavigation && !N(t.startOfWeek(), t.props.selected) && N(t.startOfWeek(), t.props.preSelection);
}, t;
}
return Object.defineProperty(n, "defaultProps", {
get: function() {
return {
shouldCloseOnSelect: !0
};
},
enumerable: !1,
configurable: !0
}), n.prototype.render = function() {
var t = {
"react-datepicker__week": !0,
"react-datepicker__week--selected": N(this.startOfWeek(), this.props.selected),
"react-datepicker__week--keyboard-selected": this.isKeyboardSelected()
};
return f.createElement("div", { className: J(t) }, this.renderDays());
}, n;
}(z)
), Ue, Vi = 6, We = {
TWO_COLUMNS: "two_columns",
THREE_COLUMNS: "three_columns",
FOUR_COLUMNS: "four_columns"
}, Yt = (Ue = {}, Ue[We.TWO_COLUMNS] = {
grid: [
[0, 1],
[2, 3],
[4, 5],
[6, 7],
[8, 9],
[10, 11]
],
verticalNavigationOffset: 2
}, Ue[We.THREE_COLUMNS] = {
grid: [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[9, 10, 11]
],
verticalNavigationOffset: 3
}, Ue[We.FOUR_COLUMNS] = {
grid: [
[0, 1, 2, 3],
[4, 5, 6, 7],
[8, 9, 10, 11]
],
verticalNavigationOffset: 4
}, Ue), it = 1;
function Sr(a, n) {
return a ? We.FOUR_COLUMNS : n ? We.TWO_COLUMNS : We.THREE_COLUMNS;
}
var Ui = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.MONTH_REFS = he([], Array(12), !0).map(function() {
return xe();
}), t.QUARTER_REFS = he([], Array(4), !0).map(function() {
return xe();
}), t.isDisabled = function(e) {
return oe(e, {
minDate: t.props.minDate,
maxDate: t.props.maxDate,
excludeDates: t.props.excludeDates,
excludeDateIntervals: t.props.excludeDateIntervals,
includeDateIntervals: t.props.includeDateIntervals,
includeDates: t.props.includeDates,
filterDate: t.props.filterDate
});
}, t.isExcluded = function(e) {
return Xt(e, {
excludeDates: t.props.excludeDates,
excludeDateIntervals: t.props.excludeDateIntervals
});
}, t.handleDayClick = function(e, r) {
var o, i;
(i = (o = t.props).onDayClick) === null || i === void 0 || i.call(o, e, r, t.props.orderInDisplay);
}, t.handleDayMouseEnter = function(e) {
var r, o;
(o = (r = t.props).onDayMouseEnter) === null || o === void 0 || o.call(r, e);
}, t.handleMouseLeave = function() {
var e, r;
(r = (e = t.props).onMouseLeave) === null || r === void 0 || r.call(e);
}, t.isRangeStartMonth = function(e) {
var r = t.props, o = r.day, i = r.startDate, s = r.endDate;
return !i || !s ? !1 : te(ae(o, e), i);
}, t.isRangeStartQuarter = function(e) {
var r = t.props, o = r.day, i = r.startDate, s = r.endDate;
return !i || !s ? !1 : kt(Fe(o, e), i);
}, t.isRangeEndMonth = function(e) {
var r = t.props, o = r.day, i = r.startDate, s = r.endDate;
return !i || !s ? !1 : te(ae(o, e), s);
}, t.isRangeEndQuarter = function(e) {
var r = t.props, o = r.day, i = r.startDate, s = r.endDate;
return !i || !s ? !1 : kt(Fe(o, e), s);
}, t.isInSelectingRangeMonth = function(e) {
var r, o = t.props, i = o.day, s = o.selectsStart, c = o.selectsEnd, u = o.selectsRange, l = o.startDate, d = o.endDate, p = (r = t.props.selectingDate) !== null && r !== void 0 ? r : t.props.preSelection;
return !(s || c || u) || !p ? !1 : s && d ? rt(p, d, e, i) : c && l || u && l && !d ? rt(l, p, e, i) : !1;
}, t.isSelectingMonthRangeStart = function(e) {
var r;
if (!t.isInSelectingRangeMonth(e))
return !1;
var o = t.props, i = o.day, s = o.startDate, c = o.selectsStart, u = ae(i, e), l = (r = t.props.selectingDate) !== null && r !== void 0 ? r : t.props.preSelection;
return c ? te(u, l) : te(u, s);
}, t.isSelectingMonthRangeEnd = function(e) {
var r;
if (!t.isInSelectingRangeMonth(e))
return !1;
var o = t.props, i = o.day, s = o.endDate, c = o.selectsEnd, u = o.selectsRange, l = ae(i, e), d = (r = t.props.selectingDate) !== null && r !== void 0 ? r : t.props.preSelection;
return c || u ? te(l, d) : te(l, s);
}, t.isInSelectingRangeQuarter = function(e) {
var r, o = t.props, i = o.day, s = o.selectsStart, c = o.selectsEnd, u = o.selectsRange, l = o.startDate, d = o.endDate, p = (r = t.props.selectingDate) !== null && r !== void 0 ? r : t.props.preSelection;
return !(s || c || u) || !p ? !1 : s && d ? ot(p, d, e, i) : c && l || u && l && !d ? ot(l, p, e, i) : !1;
}, t.isWeekInMonth = function(e) {
var r = t.props.day, o = se(e, 6);
return te(e, r) || te(o, r);
}, t.isCurrentMonth = function(e, r) {
return P(e) === P(F()) && r === ee(F());
}, t.isCurrentQuarter = function(e, r) {
return P(e) === P(F()) && r === Te(F());
}, t.isSelectedMonth = function(e, r, o) {
return ee(o) === r && P(e) === P(o);
}, t.isSelectMonthInList = function(e, r, o) {
return o.some(function(i) {
return t.isSelectedMonth(e, r, i);
});
}, t.isSelectedQuarter = function(e, r, o) {
return Te(e) === r && P(e) === P(o);
}, t.isMonthSelected = function() {
var e = t.props, r = e.day, o = e.selected, i = e.selectedDates, s = e.selectsMultiple, c = ee(r);
return s ? i == null ? void 0 : i.some(function(u) {
return t.isSelectedMonth(r, c, u);
}) : !!o && t.isSelectedMonth(r, c, o);
}, t.renderWeeks = function() {
for (var e = [], r = t.props.fixedHeight, o = 0, i = !1, s = Se(ye(t.props.day), t.props.locale, t.props.calendarStartDay), c = function(m) {
return t.props.showWeekPicker ? Se(m, t.props.locale, t.props.calendarStartDay) : t.props.preSelection;
}, u = function(m) {
return t.props.showWeekPicker ? Se(m, t.props.locale, t.props.calendarStartDay) : t.props.selected;
}, l = t.props.selected ? u(t.props.selected) : void 0, d = t.props.preSelection ? c(t.props.preSelection) : void 0; e.push(f.createElement(qi, Y({}, t.props, { ariaLabelPrefix: t.props.weekAriaLabelPrefix, key: o, day: s, month: ee(t.props.day), onDayClick: t.handleDayClick, onDayMouseEnter: t.handleDayMouseEnter, selected: l, preSelection: d, showWeekNumber: t.props.showWeekNumbers }))), !i; ) {
o++, s = ht(s, 1);
var p = r && o >= Vi, h = !r && !t.isWeekInMonth(s);
if (p || h)
if (t.props.peekNextMonth)
i = !0;
else
break;
}
return e;
}, t.onMonthClick = function(e, r) {
var o = t.isMonthDisabledForLabelDate(r), i = o.isDisabled, s = o.labelDate;
i || t.handleDayClick(ye(s), e);
}, t.onMonthMouseEnter = function(e) {
var r = t.isMonthDisabledForLabelDate(e), o = r.isDisabled, i = r.labelDate;
o || t.handleDayMouseEnter(ye(i));
}, t.handleMonthNavigation = function(e, r) {
var o, i, s, c;
(i = (o = t.props).setPreSelection) === null || i === void 0 || i.call(o, r), (c = (s = t.MONTH_REFS[e]) === null || s === void 0 ? void 0 : s.current) === null || c === void 0 || c.focus();
}, t.handleKeyboardNavigation = function(e, r, o) {
var i, s = t.props, c = s.selected, u = s.preSelection, l = s.setPreSelection, d = s.minDate, p = s.maxDate, h = s.showFourColumnMonthYearPicker, m = s.showTwoColumnMonthYearPicker;
if (u) {
var g = Sr(h, m), v = t.getVerticalOffset(g), b = (i = Yt[g]) === null || i === void 0 ? void 0 : i.grid, C = function(E, y, M) {
var T, K, B = y, j = M;
switch (E) {
case D.ArrowRight:
B = ce(y, it), j = M === 11 ? 0 : M + it;
break;
case D.ArrowLeft:
B = Ne(y, it), j = M === 0 ? 11 : M - it;
break;
case D.ArrowUp:
B = Ne(y, v), j = !((T = b == null ? void 0 : b[0]) === null || T === void 0) && T.includes(M) ? M + 12 - v : M - v;
break;
case D.ArrowDown:
B = ce(y, v), j = !((K = b == null ? void 0 : b[b.length - 1]) === null || K === void 0) && K.includes(M) ? M - 12 + v : M + v;
break;
}
return { newCalculatedDate: B, newCalculatedMonth: j };
}, _ = function(E, y, M) {
for (var T = 40, K = E, B = !1, j = 0, re = C(K, y, M), $ = re.newCalculatedDate, O = re.newCalculatedMonth; !B; ) {
if (j >= T) {
$ = y, O = M;
break;
}
if (d && $ < d) {
K = D.ArrowRight;
var Q = C(K, $, O);
$ = Q.newCalculatedDate, O = Q.newCalculatedMonth;
}
if (p && $ > p) {
K = D.ArrowLeft;
var Q = C(K, $, O);
$ = Q.newCalculatedDate, O = Q.newCalculatedMonth;
}
if (Ti($, t.props)) {
var Q = C(K, $, O);
$ = Q.newCalculatedDate, O = Q.newCalculatedMonth;
} else
B = !0;
j++;
}
return { newCalculatedDate: $, newCalculatedMonth: O };
};
if (r === D.Enter) {
t.isMonthDisabled(o) || (t.onMonthClick(e, o), l == null || l(c));
return;
}
var x = _(r, u, o), I = x.newCalculatedDate, L = x.newCalculatedMonth;
switch (r) {
case D.ArrowRight:
case D.ArrowLeft:
case D.ArrowUp:
case D.ArrowDown:
t.handleMonthNavigation(L, I);
break;
}
}
}, t.getVerticalOffset = function(e) {
var r, o;
return (o = (r = Yt[e]) === null || r === void 0 ? void 0 : r.verticalNavigationOffset) !== null && o !== void 0 ? o : 0;
}, t.onMonthKeyDown = function(e, r) {
var o = t.props, i = o.disabledKeyboardNavigation, s = o.handleOnMonthKeyDown, c = e.key;
c !== D.Tab && e.preventDefault(), i || t.handleKeyboardNavigation(e, c, r), s && s(e);
}, t.onQuarterClick = function(e, r) {
var o = Fe(t.props.day, r);
nt(o, t.props) || t.handleDayClick(dr(o), e);
}, t.onQuarterMouseEnter = function(e) {
var r = Fe(t.props.day, e);
nt(r, t.props) || t.handleDayMouseEnter(dr(r));
}, t.handleQuarterNavigation = function(e, r) {
var o, i, s, c;
t.isDisabled(r) || t.isExcluded(r) || ((i = (o = t.props).setPreSelection) === null || i === void 0 || i.call(o, r), (c = (s = t.QUARTER_REFS[e - 1]) === null || s === void 0 ? void 0 : s.current) === null || c === void 0 || c.focus());
}, t.onQuarterKeyDown = function(e, r) {
var o, i, s = e.key;
if (!t.props.disabledKeyboardNavigation)
switch (s) {
case D.Enter:
t.onQuarterClick(e, r), (i = (o = t.props).setPreSelection) === null || i === void 0 || i.call(o, t.props.selected);
break;
case D.ArrowRight:
if (!t.props.preSelection)
break;
t.handleQuarterNavigation(r === 4 ? 1 : r + 1, Bt(t.props.preSelection, 1));
break;
case D.ArrowLeft:
if (!t.props.preSelection)
break;
t.handleQuarterNavigation(r === 1 ? 4 : r - 1, jr(t.props.preSelection));
break;
}
}, t.isMonthDisabledForLabelDate = function(e) {
var r, o = t.props, i = o.day, s = o.minDate, c = o.maxDate, u = o.excludeDates, l = o.includeDates, d = ae(i, e);
return {
isDisabled: (r = (s || c || u || l) && en(d, t.props)) !== null && r !== void 0 ? r : !1,
labelDate: d
};
}, t.isMonthDisabled = function(e) {
var r = t.isMonthDisabledForLabelDate(e).isDisabled;
return r;
}, t.getMonthClassNames = function(e) {
var r = t.props, o = r.day, i = r.startDate, s = r.endDate, c = r.preSelection, u = r.monthClassName, l = u ? u(ae(o, e)) : void 0, d = t.getSelection();
return J("react-datepicker__month-text", "react-datepicker__month-".concat(e), l, {
"react-datepicker__month-text--disabled": t.isMonthDisabled(e),
"react-datepicker__month-text--selected": d ? t.isSelectMonthInList(o, e, d) : void 0,
"react-datepicker__month-text--keyboard-selected": !t.props.disabledKeyboardNavigation && c && t.isSelectedMonth(o, e, c) && !t.isMonthSelected() && !t.isMonthDisabled(e),
"react-datepicker__month-text--in-selecting-range": t.isInSelectingRangeMonth(e),
"react-datepicker__month-text--in-range": i && s ? rt(i, s, e, o) : void 0,
"react-datepicker__month-text--range-start": t.isRangeStartMonth(e),
"react-datepicker__month-text--range-end": t.isRangeEndMonth(e),
"react-datepicker__month-text--selecting-range-start": t.isSelectingMonthRangeStart(e),
"react-datepicker__month-text--selecting-range-end": t.isSelectingMonthRangeEnd(e),
"react-datepicker__month-text--today": t.isCurrentMonth(o, e)
});
}, t.getTabIndex = function(e) {
if (t.props.preSelection == null)
return "-1";
var r = ee(t.props.preSelection), o = t.isMonthDisabledForLabelDate(r).isDisabled, i = e === r && !(o || t.props.disabledKeyboardNavigation) ? "0" : "-1";
return i;
}, t.getQuarterTabIndex = function(e) {
if (t.props.preSelection == null)
return "-1";
var r = Te(t.props.preSelection), o = nt(t.props.day, t.props), i = e === r && !(o || t.props.disabledKeyboardNavigation) ? "0" : "-1";
return i;
}, t.getAriaLabel = function(e) {
var r = t.props, o = r.chooseDayAriaLabelPrefix, i = o === void 0 ? "Choose" : o, s = r.disabledDayAriaLabelPrefix, c = s === void 0 ? "Not available" : s, u = r.day, l = r.locale, d = ae(u, e), p = t.isDisabled(d) || t.isExcluded(d) ? c : i;
return "".concat(p, " ").concat(q(d, "MMMM yyyy", l));
}, t.getQuarterClassNames = function(e) {
var r = t.props, o = r.day, i = r.startDate, s = r.endDate, c = r.selected, u = r.minDate, l = r.maxDate, d = r.excludeDates, p = r.includeDates, h = r.filterDate, m = r.preSelection, g = r.disabledKeyboardNavigation, v = (u || l || d || p || h) && nt(Fe(o, e), t.props);
return J("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(e), {
"react-datepicker__quarter-text--disabled": v,
"react-datepicker__quarter-text--selected": c ? t.isSelectedQuarter(o, e, c) : void 0,
"react-datepicker__quarter-text--keyboard-selected": !g && m && t.isSelectedQuarter(o, e, m) && !v,
"react-datepicker__quarter-text--in-selecting-range": t.isInSelectingRangeQuarter(e),
"react-datepicker__quarter-text--in-range": i && s ? ot(i, s, e, o) : void 0,
"react-datepicker__quarter-text--range-start": t.isRangeStartQuarter(e),
"react-datepicker__quarter-text--range-end": t.isRangeEndQuarter(e),
"react-datepicker__quarter-text--today": t.isCurrentQuarter(o, e)
});
}, t.getMonthContent = function(e) {
var r = t.props, o = r.showFullMonthYearPicker, i = r.renderMonthContent, s = r.locale, c = r.day, u = Jr(e, s), l = $t(e, s);
return i ? i(e, u, l, c) : o ? l : u;
}, t.getQuarterContent = function(e) {
var r, o = t.props, i = o.renderQuarterContent, s = o.locale, c = Oi(e, s);
return (r = i == null ? void 0 : i(e, c)) !== null && r !== void 0 ? r : c;
}, t.renderMonths = function() {
var e, r = t.props, o = r.showTwoColumnMonthYearPicker, i = r.showFourColumnMonthYearPicker, s = r.day, c = r.selected, u = (e = Yt[Sr(i, o)]) === null || e === void 0 ? void 0 : e.grid;
return u == null ? void 0 : u.map(function(l, d) {
return f.createElement("div", { className: "react-datepicker__month-wrapper", key: d }, l.map(function(p, h) {
return f.createElement("div", { ref: t.MONTH_REFS[p], key: h, onClick: function(m) {
t.onMonthClick(m, p);
}, onKeyDown: function(m) {
nn(m) && (m.preventDefault(), m.key = D.Enter), t.onMonthKeyDown(m, p);
}, onMouseEnter: t.props.usePointerEvent ? void 0 : function() {
return t.onMonthMouseEnter(p);
}, onPointerEnter: t.props.usePointerEvent ? function() {
return t.onMonthMouseEnter(p);
} : void 0, tabIndex: Number(t.getTabIndex(p)), className: t.getMonthClassNames(p), "aria-disabled": t.isMonthDisabled(p), role: "option", "aria-label": t.getAriaLabel(p), "aria-current": t.isCurrentMonth(s, p) ? "date" : void 0, "aria-selected": c ? t.isSelectedMonth(s, p, c) : void 0 }, t.getMonthContent(p));
}));
});
}, t.renderQuarters = function() {
var e = t.props, r = e.day, o = e.selected, i = [1, 2, 3, 4];
return f.createElement("div", { className: "react-datepicker__quarter-wrapper" }, i.map(function(s, c) {
return f.createElement("div", { key: c, ref: t.QUARTER_REFS[c], role: "option", onClick: function(u) {
t.onQuarterClick(u, s);
}, onKeyDown: function(u) {
t.onQuarterKeyDown(u, s);
}, onMouseEnter: t.props.usePointerEvent ? void 0 : function() {
return t.onQuarterMouseEnter(s);
}, onPointerEnter: t.props.usePointerEvent ? function() {
return t.onQuarterMouseEnter(s);
} : void 0, className: t.getQuarterClassNames(s), "aria-selected": o ? t.isSelectedQuarter(r, s, o) : void 0, tabIndex: Number(t.getQuarterTabIndex(s)), "aria-current": t.isCurrentQuarter(r, s) ? "date" : void 0 }, t.getQuarterContent(s));
}));
}, t.getClassNames = function() {
var e = t.props, r = e.selectingDate, o = e.selectsStart, i = e.selectsEnd, s = e.showMonthYearPicker, c = e.showQuarterYearPicker, u = e.showWeekPicker;
return J("react-datepicker__month", {
"react-datepicker__month--selecting-range": r && (o || i)
}, { "react-datepicker__monthPicker": s }, { "react-datepicker__quarterPicker": c }, { "react-datepicker__weekPicker": u });
}, t;
}
return n.prototype.getSelection = function() {
var t = this.props, e = t.selected, r = t.selectedDates, o = t.selectsMultiple;
if (o)
return r;
if (e)
return [e];
}, n.prototype.render = function() {
var t = this.props, e = t.showMonthYearPicker, r = t.showQuarterYearPicker, o = t.day, i = t.ariaLabelPrefix, s = i === void 0 ? "Month " : i, c = s ? s.trim() + " " : "";
return f.createElement("div", { className: this.getClassNames(), onMouseLeave: this.props.usePointerEvent ? void 0 : this.handleMouseLeave, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : void 0, "aria-label": "".concat(c).concat(q(o, "MMMM, yyyy", this.props.locale)), role: "listbox" }, e ? this.renderMonths() : r ? this.renderQuarters() : this.renderWeeks());
}, n;
}(z)
), ji = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.isSelectedMonth = function(e) {
return t.props.month === e;
}, t.renderOptions = function() {
return t.props.monthNames.map(function(e, r) {
return f.createElement(
"div",
{ className: t.isSelectedMonth(r) ? "react-datepicker__month-option react-datepicker__month-option--selected_month" : "react-datepicker__month-option", key: e, onClick: t.onChange.bind(t, r), "aria-selected": t.isSelectedMonth(r) ? "true" : void 0 },
t.isSelectedMonth(r) ? f.createElement("span", { className: "react-datepicker__month-option--selected" }, "✓") : "",
e
);
});
}, t.onChange = function(e) {
return t.props.onChange(e);
}, t.handleClickOutside = function() {
return t.props.onCancel();
}, t;
}
return n.prototype.render = function() {
return f.createElement(St, { className: "react-datepicker__month-dropdown", onClickOutside: this.handleClickOutside }, this.renderOptions());
}, n;
}(z)
), $i = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.state = {
dropdownVisible: !1
}, t.renderSelectOptions = function(e) {
return e.map(function(r, o) {
return f.createElement("option", { key: r, value: o }, r);
});
}, t.renderSelectMode = function(e) {
return f.createElement("select", { value: t.props.month, className: "react-datepicker__month-select", onChange: function(r) {
return t.onChange(parseInt(r.target.value));
} }, t.renderSelectOptions(e));
}, t.renderReadView = function(e, r) {
return f.createElement(
"div",
{ key: "read", style: { visibility: e ? "visible" : "hidden" }, className: "react-datepicker__month-read-view", onClick: t.toggleDropdown },
f.createElement("span", { className: "react-datepicker__month-read-view--down-arrow" }),
f.createElement("span", { className: "react-datepicker__month-read-view--selected-month" }, r[t.props.month])
);
}, t.renderDropdown = function(e) {
return f.createElement(ji, Y({ key: "dropdown" }, t.props, { monthNames: e, onChange: t.onChange, onCancel: t.toggleDropdown }));
}, t.renderScrollMode = function(e) {
var r = t.state.dropdownVisible, o = [t.renderReadView(!r, e)];
return r && o.unshift(t.renderDropdown(e)), o;
}, t.onChange = function(e) {
t.toggleDropdown(), e !== t.props.month && t.props.onChange(e);
}, t.toggleDropdown = function() {
return t.setState({
dropdownVisible: !t.state.dropdownVisible
});
}, t;
}
return n.prototype.render = function() {
var t = this, e = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(this.props.useShortMonthInDropdown ? function(o) {
return Jr(o, t.props.locale);
} : function(o) {
return $t(o, t.props.locale);
}), r;
switch (this.props.dropdownMode) {
case "scroll":
r = this.renderScrollMode(e);
break;
case "select":
r = this.renderSelectMode(e);
break;
}
return f.createElement("div", { className: "react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode) }, r);
}, n;
}(z)
);
function Xi(a, n) {
for (var t = [], e = ye(a), r = ye(n); !Pe(e, r); )
t.push(F(e)), e = ce(e, 1);
return t;
}
var Gi = (
/** @class */
function(a) {
Z(n, a);
function n(t) {
var e = a.call(this, t) || this;
return e.renderOptions = function() {
return e.state.monthYearsList.map(function(r) {
var o = Ht(r), i = de(e.props.date, r) && te(e.props.date, r);
return f.createElement(
"div",
{ className: i ? "react-datepicker__month-year-option--selected_month-year" : "react-datepicker__month-year-option", key: o, onClick: e.onChange.bind(e, o), "aria-selected": i ? "true" : void 0 },
i ? f.createElement("span", { className: "react-datepicker__month-year-option--selected" }, "✓") : "",
q(r, e.props.dateFormat, e.props.locale)
);
});
}, e.onChange = function(r) {
return e.props.onChange(r);
}, e.handleClickOutside = function() {
e.props.onCancel();
}, e.state = {
monthYearsList: Xi(e.props.minDate, e.props.maxDate)
}, e;
}
return n.prototype.render = function() {
var t = J({
"react-datepicker__month-year-dropdown": !0,
"react-datepicker__month-year-dropdown--scrollable": this.props.scrollableMonthYearDropdown
});
return f.createElement(St, { className: t, onClickOutside: this.handleClickOutside }, this.renderOptions());
}, n;
}(z)
), zi = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.state = {
dropdownVisible: !1
}, t.renderSelectOptions = function() {
for (var e = ye(t.props.minDate), r = ye(t.props.maxDate), o = []; !Pe(e, r); ) {
var i = Ht(e);
o.push(f.createElement("option", { key: i, value: i }, q(e, t.props.dateFormat, t.props.locale))), e = ce(e, 1);
}
return o;
}, t.onSelectChange = function(e) {
t.onChange(parseInt(e.target.value));
}, t.renderSelectMode = function() {
return f.createElement("select", { value: Ht(ye(t.props.date)), className: "react-datepicker__month-year-select", onChange: t.onSelectChange }, t.renderSelectOptions());
}, t.renderReadView = function(e) {
var r = q(t.props.date, t.props.dateFormat, t.props.locale);
return f.createElement(
"div",
{ key: "read", style: { visibility: e ? "visible" : "hidden" }, className: "react-datepicker__month-year-read-view", onClick: t.toggleDropdown },
f.createElement("span", { className: "react-datepicker__month-year-read-view--down-arrow" }),
f.createElement("span", { className: "react-datepicker__month-year-read-view--selected-month-year" }, r)
);
}, t.renderDropdown = function() {
return f.createElement(Gi, Y({ key: "dropdown" }, t.props, { onChange: t.onChange, onCancel: t.toggleDropdown }));
}, t.renderScrollMode = function() {
var e = t.state.dropdownVisible, r = [t.renderReadView(!e)];
return e && r.unshift(t.renderDropdown()), r;
}, t.onChange = function(e) {
t.toggleDropdown();
var r = F(e);
de(t.props.date, r) && te(t.props.date, r) || t.props.onChange(r);
}, t.toggleDropdown = function() {
return t.setState({
dropdownVisible: !t.state.dropdownVisible
});
}, t;
}
return n.prototype.render = function() {
var t;
switch (this.props.dropdownMode) {
case "scroll":
t = this.renderScrollMode();
break;
case "select":
t = this.renderSelectMode();
break;
}
return f.createElement("div", { className: "react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode) }, t);
}, n;
}(z)
), Zi = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.state = {
height: null
}, t.scrollToTheSelectedTime = function() {
requestAnimationFrame(function() {
var e, r, o;
t.list && (t.list.scrollTop = (o = t.centerLi && n.calcCenterPosition(t.props.monthRef ? t.props.monthRef.clientHeight - ((r = (e = t.header) === null || e === void 0 ? void 0 : e.clientHeight) !== null && r !== void 0 ? r : 0) : t.list.clientHeight, t.centerLi)) !== null && o !== void 0 ? o : 0);
});
}, t.handleClick = function(e) {
var r, o;
(t.props.minTime || t.props.maxTime) && vr(e, t.props) || (t.props.excludeTimes || t.props.includeTimes || t.props.filterTime) && mr(e, t.props) || (o = (r = t.props).onChange) === null || o === void 0 || o.call(r, e);
}, t.isSelectedTime = function(e) {
return t.props.selected && Hi(t.props.selected, e);
}, t.isDisabledTime = function(e) {
return (t.props.minTime || t.props.maxTime) && vr(e, t.props) || (t.props.excludeTimes || t.props.includeTimes || t.props.filterTime) && mr(e, t.props);
}, t.liClasses = function(e) {
var r, o = [
"react-datepicker__time-list-item",
t.props.timeClassName ? t.props.timeClassName(e) : void 0
];
return t.isSelectedTime(e) && o.push("react-datepicker__time-list-item--selected"), t.isDisabledTime(e) && o.push("react-datepicker__time-list-item--disabled"), t.props.injectTimes && (De(e) * 3600 + we(e) * 60 + Ce(e)) % (((r = t.props.intervals) !== null && r !== void 0 ? r : n.defaultProps.intervals) * 60) !== 0 && o.push("react-datepicker__time-list-item--injected"), o.join(" ");
}, t.handleOnKeyDown = function(e, r) {
var o, i;
e.key === D.Space && (e.preventDefault(), e.key = D.Enter), (e.key === D.ArrowUp || e.key === D.ArrowLeft) && e.target instanceof HTMLElement && e.target.previousSibling && (e.preventDefault(), e.target.previousSibling instanceof HTMLElement && e.target.previousSibling.focus()), (e.key === D.ArrowDown || e.key === D.ArrowRight) && e.target instanceof HTMLElement && e.target.nextSibling && (e.preventDefault(), e.target.nextSibling instanceof HTMLElement && e.target.nextSibling.focus()), e.key === D.Enter && t.handleClick(r), (i = (o = t.props).handleOnKeyDown) === null || i === void 0 || i.call(o, e);
}, t.renderTimes = function() {
for (var e, r = [], o = typeof t.props.format == "string" ? t.props.format : "p", i = (e = t.props.intervals) !== null && e !== void 0 ? e : n.defaultProps.intervals, s = t.props.selected || t.props.openToDate || F(), c = dt(s), u = t.props.injectTimes && t.props.injectTimes.sort(function(v, b) {
return v.getTime() - b.getTime();
}), l = 60 * Ai(s), d = l / i, p = 0; p < d; p++) {
var h = Ft(c, p * i);
if (r.push(h), u) {
var m = Wi(c, h, p, i, u);
r = r.concat(m);
}
}
var g = r.reduce(function(v, b) {
return b.getTime() <= s.getTime() ? b : v;
}, r[0]);
return r.map(function(v) {
return f.createElement("li", { key: v.valueOf(), onClick: t.handleClick.bind(t, v), className: t.liClasses(v), ref: function(b) {
v === g && (t.centerLi = b);
}, onKeyDown: function(b) {
t.handleOnKeyDown(b, v);
}, tabIndex: v === g ? 0 : -1, role: "option", "aria-selected": t.isSelectedTime(v) ? "true" : void 0, "aria-disabled": t.isDisabledTime(v) ? "true" : void 0 }, q(v, o, t.props.locale));
});
}, t.renderTimeCaption = function() {
return t.props.showTimeCaption === !1 ? f.createElement(f.Fragment, null) : f.createElement(
"div",
{ className: "react-datepicker__header react-datepicker__header--time ".concat(t.props.showTimeSelectOnly ? "react-datepicker__header--time--only" : ""), ref: function(e) {
t.header = e;
} },
f.createElement("div", { className: "react-datepicker-time__header" }, t.props.timeCaption)
);
}, t;
}
return Object.defineProperty(n, "defaultProps", {
get: function() {
return {
intervals: 30,
todayButton: null,
timeCaption: "Time",
showTimeCaption: !0
};
},
enumerable: !1,
configurable: !0
}), n.prototype.componentDidMount = function() {
this.scrollToTheSelectedTime(), this.observeDatePickerHeightChanges();
}, n.prototype.componentWillUnmount = function() {
var t;
(t = this.resizeObserver) === null || t === void 0 || t.disconnect();
}, n.prototype.observeDatePickerHeightChanges = function() {
var t = this, e = this.props.monthRef;
this.updateContainerHeight(), e && (this.resizeObserver = new ResizeObserver(function() {
t.updateContainerHeight();
}), this.resizeObserver.observe(e));
}, n.prototype.updateContainerHeight = function() {
this.props.monthRef && this.header && this.setState({
height: this.props.monthRef.clientHeight - this.header.clientHeight
});
}, n.prototype.render = function() {
var t = this, e, r = this.state.height;
return f.createElement(
"div",
{ className: "react-datepicker__time-container ".concat(((e = this.props.todayButton) !== null && e !== void 0 ? e : n.defaultProps.todayButton) ? "react-datepicker__time-container--with-today-button" : "") },
this.renderTimeCaption(),
f.createElement(
"div",
{ className: "react-datepicker__time" },
f.createElement(
"div",
{ className: "react-datepicker__time-box" },
f.createElement("ul", { className: "react-datepicker__time-list", ref: function(o) {
t.list = o;
}, style: r ? { height: r } : {}, role: "listbox", "aria-label": this.props.timeCaption }, this.renderTimes())
)
)
);
}, n.calcCenterPosition = function(t, e) {
return e.offsetTop - (t / 2 - e.clientHeight / 2);
}, n;
}(z)
), xr = 3, Ji = (
/** @class */
function(a) {
Z(n, a);
function n(t) {
var e = a.call(this, t) || this;
return e.YEAR_REFS = he([], Array(e.props.yearItemNumber), !0).map(function() {
return xe();
}), e.isDisabled = function(r) {
return oe(r, {
minDate: e.props.minDate,
maxDate: e.props.maxDate,
excludeDates: e.props.excludeDates,
includeDates: e.props.includeDates,
filterDate: e.props.filterDate
});
}, e.isExcluded = function(r) {
return Xt(r, {
excludeDates: e.props.excludeDates
});
}, e.selectingDate = function() {
var r;
return (r = e.props.selectingDate) !== null && r !== void 0 ? r : e.props.preSelection;
}, e.updateFocusOnPaginate = function(r) {
var o = function() {
var i, s;
(s = (i = e.YEAR_REFS[r]) === null || i === void 0 ? void 0 : i.current) === null || s === void 0 || s.focus();
};
window.requestAnimationFrame(o);
}, e.handleYearClick = function(r, o) {
e.props.onDayClick && e.props.onDayClick(r, o);
}, e.handleYearNavigation = function(r, o) {
var i, s, c, u, l = e.props, d = l.date, p = l.yearItemNumber;
if (!(d === void 0 || p === void 0)) {
var h = Me(d, p).startPeriod;
e.isDisabled(o) || e.isExcluded(o) || ((s = (i = e.props).setPreSelection) === null || s === void 0 || s.call(i, o), r - h < 0 ? e.updateFocusOnPaginate(p - (h - r)) : r - h >= p ? e.updateFocusOnPaginate(Math.abs(p - (r - h))) : (u = (c = e.YEAR_REFS[r - h]) === null || c === void 0 ? void 0 : c.current) === null || u === void 0 || u.focus());
}
}, e.isSameDay = function(r, o) {
return N(r, o);
}, e.isCurrentYear = function(r) {
return r === P(F());
}, e.isRangeStart = function(r) {
return e.props.startDate && e.props.endDate && de(ue(F(), r), e.props.startDate);
}, e.isRangeEnd = function(r) {
return e.props.startDate && e.props.endDate && de(ue(F(), r), e.props.endDate);
}, e.isInRange = function(r) {
return at(r, e.props.startDate, e.props.endDate);
}, e.isInSelectingRange = function(r) {
var o = e.props, i = o.selectsStart, s = o.selectsEnd, c = o.selectsRange, u = o.startDate, l = o.endDate;
return !(i || s || c) || !e.selectingDate() ? !1 : i && l ? at(r, e.selectingDate(), l) : s && u || c && u && !l ? at(r, u, e.selectingDate()) : !1;
}, e.isSelectingRangeStart = function(r) {
var o;
if (!e.isInSelectingRange(r))
return !1;
var i = e.props, s = i.startDate, c = i.selectsStart, u = ue(F(), r);
return c ? de(u, (o = e.selectingDate()) !== null && o !== void 0 ? o : null) : de(u, s ?? null);
}, e.isSelectingRangeEnd = function(r) {
var o;
if (!e.isInSelectingRange(r))
return !1;
var i = e.props, s = i.endDate, c = i.selectsEnd, u = i.selectsRange, l = ue(F(), r);
return c || u ? de(l, (o = e.selectingDate()) !== null && o !== void 0 ? o : null) : de(l, s ?? null);
}, e.isKeyboardSelected = function(r) {
if (!(e.props.date === void 0 || e.props.selected == null || e.props.preSelection == null)) {
var o = e.props, i = o.minDate, s = o.maxDate, c = o.excludeDates, u = o.includeDates, l = o.filterDate, d = Xe(ue(e.props.date, r)), p = (i || s || c || u || l) && pt(r, e.props);
return !e.props.disabledKeyboardNavigation && !e.props.inline && !N(d, Xe(e.props.selected)) && N(d, Xe(e.props.preSelection)) && !p;
}
}, e.isSelectedYear = function(r) {
var o = e.props, i = o.selectsMultiple, s = o.selected, c = o.selectedDates;
return i ? c == null ? void 0 : c.some(function(u) {
return r === P(u);
}) : !!s && r === P(s);
}, e.onYearClick = function(r, o) {
var i = e.props.date;
i !== void 0 && e.handleYearClick(Xe(ue(i, o)), r);
}, e.onYearKeyDown = function(r, o) {
var i, s, c = r.key, u = e.props, l = u.date, d = u.yearItemNumber, p = u.handleOnKeyDown;
if (c !== D.Tab && r.preventDefault(), !e.props.disabledKeyboardNavigation)
switch (c) {
case D.Enter:
if (e.props.selected == null)
break;
e.onYearClick(r, o), (s = (i = e.props).setPreSelection) === null || s === void 0 || s.call(i, e.props.selected);
break;
case D.ArrowRight:
if (e.props.preSelection == null)
break;
e.handleYearNavigation(o + 1, ve(e.props.preSelection, 1));
break;
case D.ArrowLeft:
if (e.props.preSelection == null)
break;
e.handleYearNavigation(o - 1, Qe(e.props.preSelection, 1));
break;
case D.ArrowUp: {
if (l === void 0 || d === void 0 || e.props.preSelection == null)
break;
var h = Me(l, d).startPeriod, m = xr, g = o - m;
if (g < h) {
var v = d % m;
o >= h && o < h + v ? m = v : m += v, g = o - m;
}
e.handleYearNavigation(g, Qe(e.props.preSelection, m));
break;
}
case D.ArrowDown: {
if (l === void 0 || d === void 0 || e.props.preSelection == null)
break;
var b = Me(l, d).endPeriod, m = xr, g = o + m;
if (g > b) {
var v = d % m;
o <= b && o > b - v ? m = v : m += v, g = o + m;
}
e.handleYearNavigation(g, ve(e.props.preSelection, m));
break;
}
}
p && p(r);
}, e.getYearClassNames = function(r) {
var o = e.props, i = o.date, s = o.minDate, c = o.maxDate, u = o.excludeDates, l = o.includeDates, d = o.filterDate, p = o.yearClassName;
return J("react-datepicker__year-text", "react-datepicker__year-".concat(r), i ? p == null ? void 0 : p(ue(i, r)) : void 0, {
"react-datepicker__year-text--selected": e.isSelectedYear(r),
"react-datepicker__year-text--disabled": (s || c || u || l || d) && pt(r, e.props),
"react-datepicker__year-text--keyboard-selected": e.isKeyboardSelected(r),
"react-datepicker__year-text--range-start": e.isRangeStart(r),
"react-datepicker__year-text--range-end": e.isRangeEnd(r),
"react-datepicker__year-text--in-range": e.isInRange(r),
"react-datepicker__year-text--in-selecting-range": e.isInSelectingRange(r),
"react-datepicker__year-text--selecting-range-start": e.isSelectingRangeStart(r),
"react-datepicker__year-text--selecting-range-end": e.isSelectingRangeEnd(r),
"react-datepicker__year-text--today": e.isCurrentYear(r)
});
}, e.getYearTabIndex = function(r) {
if (e.props.disabledKeyboardNavigation || e.props.preSelection == null)
return "-1";
var o = P(e.props.preSelection), i = pt(r, e.props);
return r === o && !i ? "0" : "-1";
}, e.getYearContent = function(r) {
return e.props.renderYearContent ? e.props.renderYearContent(r) : r;
}, e;
}
return n.prototype.render = function() {
var t = this, e = [], r = this.props, o = r.date, i = r.yearItemNumber, s = r.onYearMouseEnter, c = r.onYearMouseLeave;
if (o === void 0)
return null;
for (var u = Me(o, i), l = u.startPeriod, d = u.endPeriod, p = function(g) {
e.push(f.createElement("div", { ref: h.YEAR_REFS[g - l], onClick: function(v) {
t.onYearClick(v, g);
}, onKeyDown: function(v) {
nn(v) && (v.preventDefault(), v.key = D.Enter), t.onYearKeyDown(v, g);
}, tabIndex: Number(h.getYearTabIndex(g)), className: h.getYearClassNames(g), onMouseEnter: h.props.usePointerEvent ? void 0 : function(v) {
return s(v, g);
}, onPointerEnter: h.props.usePointerEvent ? function(v) {
return s(v, g);
} : void 0, onMouseLeave: h.props.usePointerEvent ? void 0 : function(v) {
return c(v, g);
}, onPointerLeave: h.props.usePointerEvent ? function(v) {
return c(v, g);
} : void 0, key: g, "aria-current": h.isCurrentYear(g) ? "date" : void 0 }, h.getYearContent(g)));
}, h = this, m = l; m <= d; m++)
p(m);
return f.createElement(
"div",
{ className: "react-datepicker__year" },
f.createElement("div", { className: "react-datepicker__year-wrapper", onMouseLeave: this.props.usePointerEvent ? void 0 : this.props.clearSelectingDate, onPointerLeave: this.props.usePointerEvent ? this.props.clearSelectingDate : void 0 }, e)
);
}, n;
}(z)
);
function es(a, n, t, e) {
for (var r = [], o = 0; o < 2 * n + 1; o++) {
var i = a + n - o, s = !0;
t && (s = P(t) <= i), e && s && (s = P(e) >= i), s && r.push(i);
}
return r;
}
var ts = (
/** @class */
function(a) {
Z(n, a);
function n(t) {
var e = a.call(this, t) || this;
e.renderOptions = function() {
var s = e.props.year, c = e.state.yearsList.map(function(d) {
return f.createElement(
"div",
{ className: s === d ? "react-datepicker__year-option react-datepicker__year-option--selected_year" : "react-datepicker__year-option", key: d, onClick: e.onChange.bind(e, d), "aria-selected": s === d ? "true" : void 0 },
s === d ? f.createElement("span", { className: "react-datepicker__year-option--selected" }, "✓") : "",
d
);
}), u = e.props.minDate ? P(e.props.minDate) : null, l = e.props.maxDate ? P(e.props.maxDate) : null;
return (!l || !e.state.yearsList.find(function(d) {
return d === l;
})) && c.unshift(f.createElement(
"div",
{ className: "react-datepicker__year-option", key: "upcoming", onClick: e.incrementYears },
f.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming" })
)), (!u || !e.state.yearsList.find(function(d) {
return d === u;
})) && c.push(f.createElement(
"div",
{ className: "react-datepicker__year-option", key: "previous", onClick: e.decrementYears },
f.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous" })
)), c;
}, e.onChange = function(s) {
e.props.onChange(s);
}, e.handleClickOutside = function() {
e.props.onCancel();
}, e.shiftYears = function(s) {
var c = e.state.yearsList.map(function(u) {
return u + s;
});
e.setState({
yearsList: c
});
}, e.incrementYears = function() {
return e.shiftYears(1);
}, e.decrementYears = function() {
return e.shiftYears(-1);
};
var r = t.yearDropdownItemNumber, o = t.scrollableYearDropdown, i = r || (o ? 10 : 5);
return e.state = {
yearsList: es(e.props.year, i, e.props.minDate, e.props.maxDate)
}, e.dropdownRef = xe(), e;
}
return n.prototype.componentDidMount = function() {
var t = this.dropdownRef.current;
if (t) {
var e = t.children ? Array.from(t.children) : null, r = e ? e.find(function(o) {
return o.ariaSelected;
}) : null;
t.scrollTop = r && r instanceof HTMLElement ? r.offsetTop + (r.clientHeight - t.clientHeight) / 2 : (t.scrollHeight - t.clientHeight) / 2;
}
}, n.prototype.render = function() {
var t = J({
"react-datepicker__year-dropdown": !0,
"react-datepicker__year-dropdown--scrollable": this.props.scrollableYearDropdown
});
return f.createElement(St, { className: t, containerRef: this.dropdownRef, onClickOutside: this.handleClickOutside }, this.renderOptions());
}, n;
}(z)
), rs = (
/** @class */
function(a) {
Z(n, a);
function n() {
var t = a !== null && a.apply(this, arguments) || this;
return t.state = {
dropdownVisible: !1
}, t.renderSelectOptions = function() {
for (var e = t.props.minDate ? P(t.props.minDate) : 1900, r = t.props.maxDate ? P(t.props.maxDate) : 2100, o = [], i = e; i <= r; i++)
o.push(f.createElement("option", { key: i, value: i }, i));
return o;
}, t.onSelectChange = function(e) {
t.onChange(parseInt(e.target.value));
}, t.renderSelectMode = function() {
return f.createElement("select", { value: t.props.year, className: "react-datepicker__year-select", onChange: t.onSelectChange }, t.renderSelectOptions());
}, t.renderReadView = function(e) {
return f.createElement(
"div",
{ key: "read", style: { visibility: e ? "visible" : "hidden" }, className: "react-datepicker__year-read-view", onClick: function(r) {
return t.toggleDropdown(r);
} },
f.createElement("span", { className: "react-datepicker__year-read-view--down-arrow" }),
f.createElement("span", { className: "react-datepicker__year-read-view--selected-year" }, t.props.year)
);
}, t.renderDropdown = function() {
return f.createElement(ts, Y({ key: "dropdown" }, t.props, { onChange: t.onChange, onCancel: t.toggleDropdown }));
}, t.renderScrollMode = function() {
var e = t.state.dropdownVisible, r = [t.renderReadView(!e)];
return e && r.unshift(t.renderDropdown()), r;
}, t.onChange = function(e) {
t.toggleDropdown(), e !== t.props.year && t.props.onChange(e);
}, t.toggleDropdown = function(e) {
t.setState({
dropdownVisible: !t.state.dropdownVisible
}, function() {
t.props.adjustDateOnChange && t.handleYearChange(t.props.date, e);
});
}, t.handleYearChange = function(e, r) {
var o;
(o = t.onSelect) === null || o === void 0 || o.call(t, e, r), t.setOpen();
}, t.onSelect = function(e, r) {
var o, i;
(i = (o = t.props).onSelect) === null || i === void 0 || i.call(o, e, r);
}, t.setOpen = function() {
var e, r;
(r = (e = t.props).setOpen) === null || r === void 0 || r.call(e, !0);
}, t;
}
return n.prototype.render = function() {
var t;
switch (this.props.dropdownMode) {
case "scroll":
t = this.renderScrollMode();
break;
case "select":
t = this.renderSelectMode();
break;
}
return f.createElement("div", { className: "react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode) }, t);
}, n;
}(z)
), ns = [
"react-datepicker__year-select",
"react-datepicker__month-select",
"react-datepicker__month-year-select"
], as = function(a) {
var n = (a.className || "").split(/\s+/);
return ns.some(function(t) {
return n.indexOf(t) >= 0;
});
}, os = (
/** @class */
function(a) {
Z(n, a);
function n(t) {
var e = a.call(this, t) || this;
return e.monthContainer = void 0, e.handleClickOutside = function(r) {
e.props.onClickOutside(r);
}, e.setClickOutsideRef = function() {
return e.containerRef.current;
}, e.handleDropdownFocus = function(r) {
var o, i;
as(r.target) && ((i = (o = e.props).onDropdownFocus) === null || i === void 0 || i.call(o, r));
}, e.getDateInView = function() {
var r = e.props, o = r.preSelection, i = r.selected, s = r.openToDate, c = tn(e.props), u = rn(e.props), l = F(), d = s || i || o;
return d || (c && Re(l, c) ? c : u && Pe(l, u) ? u : l);
}, e.increaseMonth = function() {
e.setState(function(r) {
var o = r.date;
return {
date: ce(o, 1)
};
}, function() {
return e.handleMonthChange(e.state.date);
});
}, e.decreaseMonth = function() {
e.setState(function(r) {
var o = r.date;
return {
date: Ne(o, 1)
};
}, function() {
return e.handleMonthChange(e.state.date);
});
}, e.handleDayClick = function(r, o, i) {
e.props.onSelect(r, o, i), e.props.setPreSelection && e.props.setPreSelection(r);
}, e.handleDayMouseEnter = function(r) {
e.setState({ selectingDate: r }), e.props.onDayMouseEnter && e.props.onDayMouseEnter(r);
}, e.handleMonthMouseLeave = function() {
e.setState({ selectingDate: void 0 }), e.props.onMonthMouseLeave && e.props.onMonthMouseLeave();
}, e.handleYearMouseEnter = function(r, o) {
e.setState({ selectingDate: ue(F(), o) }), e.props.onYearMouseEnter && e.props.onYearMouseEnter(r, o);
}, e.handleYearMouseLeave = function(r, o) {
e.props.onYearMouseLeave && e.props.onYearMouseLeave(r, o);
}, e.handleYearChange = function(r) {
var o, i, s, c;
(i = (o = e.props).onYearChange) === null || i === void 0 || i.call(o, r), e.setState({ isRenderAriaLiveMessage: !0 }), e.props.adjustDateOnChange && (e.props.onSelect(r), (c = (s = e.props).setOpen) === null || c === void 0 || c.call(s, !0)), e.props.setPreSelection && e.props.setPreSelection(r);
}, e.getEnabledPreSelectionDateForMonth = function(r) {
if (!oe(r, e.props))
return r;
for (var o = ye(r), i = Si(r), s = Sn(i, o), c = null, u = 0; u <= s; u++) {
var l = se(o, u);
if (!oe(l, e.props)) {
c = l;
break;
}
}
return c;
}, e.handleMonthChange = function(r) {
var o, i, s, c = (o = e.getEnabledPreSelectionDateForMonth(r)) !== null && o !== void 0 ? o : r;
e.handleCustomMonthChange(c), e.props.adjustDateOnChange && (e.props.onSelect(c), (s = (i = e.props).setOpen) === null || s === void 0 || s.call(i, !0)), e.props.setPreSelection && e.props.setPreSelection(c);
}, e.handleCustomMonthChange = function(r) {
var o, i;
(i = (o = e.props).onMonthChange) === null || i === void 0 || i.call(o, r), e.setState({ isRenderAriaLiveMessage: !0 });
}, e.handleMonthYearChange = function(r) {
e.handleYearChange(r), e.handleMonthChange(r);
}, e.changeYear = function(r) {
e.setState(function(o) {
var i = o.date;
return {
date: ue(i, Number(r))
};
}, function() {
return e.handleYearChange(e.state.date);
});
}, e.changeMonth = function(r) {
e.setState(function(o) {
var i = o.date;
return {
date: ae(i, Number(r))
};
}, function() {
return e.handleMonthChange(e.state.date);
});
}, e.changeMonthYear = function(r) {
e.setState(function(o) {
var i = o.date;
return {
date: ue(ae(i, ee(r)), P(r))
};
}, function() {
return e.handleMonthYearChange(e.state.date);
});
}, e.header = function(r) {
r === void 0 && (r = e.state.date);
var o = Se(r, e.props.locale, e.props.calendarStartDay), i = [];
return e.props.showWeekNumbers && i.push(f.createElement("div", { key: "W", className: "react-datepicker__day-name" }, e.props.weekLabel || "#")), i.concat([0, 1, 2, 3, 4, 5, 6].map(function(s) {
var c = se(o, s), u = e.formatWeekday(c, e.props.locale), l = e.props.weekDayClassName ? e.props.weekDayClassName(c) : void 0;
return f.createElement("div", { key: s, "aria-label": q(c, "EEEE", e.props.locale), className: J("react-datepicker__day-name", l) }, u);
}));
}, e.formatWeekday = function(r, o) {
return e.props.formatWeekDay ? xi(r, e.props.formatWeekDay, o) : e.props.useWeekdaysShort ? Ei(r, o) : Pi(r, o);
}, e.decreaseYear = function() {
e.setState(function(r) {
var o, i = r.date;
return {
date: Qe(i, e.props.showYearPicker ? (o = e.props.yearItemNumber) !== null && o !== void 0 ? o : n.defaultProps.yearItemNumber : 1)
};
}, function() {
return e.handleYearChange(e.state.date);
});
}, e.clearSelectingDate = function() {
e.setState({ selectingDate: void 0 });
}, e.renderPreviousButton = function() {
var r, o, i;
if (!e.props.renderCustomHeader) {
var s = (r = e.props.monthsShown) !== null && r !== void 0 ? r : n.defaultProps.monthsShown, c = e.props.showPreviousMonths ? s - 1 : 0, u = (o = e.props.monthSelectedIn) !== null && o !== void 0 ? o : c, l = Ne(e.state.date, u), d;
switch (!0) {
case e.props.showMonthYearPicker:
d = wr(e.state.date, e.props);
break;
case e.props.showYearPicker:
d = Ri(e.state.date, e.props);
break;
case e.props.showQuarterYearPicker:
d = Ni(e.state.date, e.props);
break;
default:
d = gr(l, e.props);
break;
}
if (!(!((i = e.props.forceShowMonthNavigation) !== null && i !== void 0 ? i : n.defaultProps.forceShowMonthNavigation) && !e.props.showDisabledMonthNavigation && d || e.props.showTimeSelectOnly)) {
var p = [
"react-datepicker__navigation-icon",
"react-datepicker__navigation-icon--previous"
], h = [
"react-datepicker__navigation",
"react-datepicker__navigation--previous"
], m = e.decreaseMonth;
(e.props.showMonthYearPicker || e.props.showQuarterYearPicker || e.props.showYearPicker) && (m = e.decreaseYear), d && e.props.showDisabledMonthNavigation && (h.push("react-datepicker__navigation--previous--disabled"), m = void 0);
var g = e.props.showMonthYearPicker || e.props.showQuarterYearPicker || e.props.showYearPicker, v = e.props, b = v.previousMonthButtonLabel, C = b === void 0 ? n.defaultProps.previousMonthButtonLabel : b, _ = v.previousYearButtonLabel, x = _ === void 0 ? n.defaultProps.previousYearButtonLabel : _, I = e.props, L = I.previousMonthAriaLabel, E = L === void 0 ? typeof C == "string" ? C : "Previous Month" : L, y = I.previousYearAriaLabel, M = y === void 0 ? typeof x == "string" ? x : "Previous Year" : y;
return f.createElement(
"button",
{ type: "button", className: h.join(" "), onClick: m, onKeyDown: e.props.handleOnKeyDown, "aria-label": g ? M : E },
f.createElement("span", { className: p.join(" ") }, g ? x : C)
);
}
}
}, e.increaseYear = function() {
e.setState(function(r) {
var o, i = r.date;
return {
date: ve(i, e.props.showYearPicker ? (o = e.props.yearItemNumber) !== null && o !== void 0 ? o : n.defaultProps.yearItemNumber : 1)
};
}, function() {
return e.handleYearChange(e.state.date);
});
}, e.renderNextButton = function() {
var r;
if (!e.props.renderCustomHeader) {
var o;
switch (!0) {
case e.props.showMonthYearPicker:
o = yr(e.state.date, e.props);
break;
case e.props.showYearPicker:
o = Ii(e.state.date, e.props);
break;
case e.props.showQuarterYearPicker:
o = Yi(e.state.date, e.props);
break;
default:
o = Dr(e.state.date, e.props);
break;
}
if (!(!((r = e.props.forceShowMonthNavigation) !== null && r !== void 0 ? r : n.defaultProps.forceShowMonthNavigation) && !e.props.showDisabledMonthNavigation && o || e.props.showTimeSelectOnly)) {
var i = [
"react-datepicker__navigation",
"react-datepicker__navigation--next"
], s = [
"react-datepicker__navigation-icon",
"react-datepicker__navigation-icon--next"
];
e.props.showTimeSelect && i.push("react-datepicker__navigation--next--with-time"), e.props.todayButton && i.push("react-datepicker__navigation--next--with-today-button");
var c = e.increaseMonth;
(e.props.showMonthYearPicker || e.props.showQuarterYearPicker || e.props.showYearPicker) && (c = e.increaseYear), o && e.props.showDisabledMonthNavigation && (i.push("react-datepicker__navigation--next--disabled"), c = void 0);
var u = e.props.showMonthYearPicker || e.props.showQuarterYearPicker || e.props.showYearPicker, l = e.props, d = l.nextMonthButtonLabel, p = d === void 0 ? n.defaultProps.nextMonthButtonLabel : d, h = l.nextYearButtonLabel, m = h === void 0 ? n.defaultProps.nextYearButtonLabel : h, g = e.props, v = g.nextMonthAriaLabel, b = v === void 0 ? typeof p == "string" ? p : "Next Month" : v, C = g.nextYearAriaLabel, _ = C === void 0 ? typeof m == "string" ? m : "Next Year" : C;
return f.createElement(
"button",
{ type: "button", className: i.join(" "), onClick: c, onKeyDown: e.props.handleOnKeyDown, "aria-label": u ? _ : b },
f.createElement("span", { className: s.join(" ") }, u ? m : p)
);
}
}
}, e.renderCurrentMonth = function(r) {
r === void 0 && (r = e.state.date);
var o = ["react-datepicker__current-month"];
return e.props.showYearDropdown && o.push("react-datepicker__current-month--hasYearDropdown"), e.props.showMonthDropdown && o.push("react-datepicker__current-month--hasMonthDropdown"), e.props.showMonthYearDropdown && o.push("react-datepicker__current-month--hasMonthYearDropdown"), f.createElement("h2", { className: o.join(" ") }, q(r, e.props.dateFormat, e.props.locale));
}, e.renderYearDropdown = function(r) {
if (r === void 0 && (r = !1), !(!e.props.showYearDropdown || r))
return f.createElement(rs, Y({}, n.defaultProps, e.props, { date: e.state.date, onChange: e.changeYear, year: P(e.state.date) }));
}, e.renderMonthDropdown = function(r) {
if (r === void 0 && (r = !1), !(!e.props.showMonthDropdown || r))
return f.createElement($i, Y({}, n.defaultProps, e.props, { month: ee(e.state.date), onChange: e.changeMonth }));
}, e.renderMonthYearDropdown = function(r) {
if (r === void 0 && (r = !1), !(!e.props.showMonthYearDropdown || r))
return f.createElement(zi, Y({}, n.defaultProps, e.props, { date: e.state.date, onChange: e.changeMonthYear }));
}, e.handleTodayButtonClick = function(r) {
e.props.onSelect(pr(), r), e.props.setPreSelection && e.props.setPreSelection(pr());
}, e.renderTodayButton = function() {
if (!(!e.props.todayButton || e.props.showTimeSelectOnly))
return f.createElement("div", { className: "react-datepicker__today-button", onClick: e.handleTodayButtonClick }, e.props.todayButton);
}, e.renderDefaultHeader = function(r) {
var o = r.monthDate, i = r.i;
return f.createElement(
"div",
{ className: "react-datepicker__header ".concat(e.props.showTimeSelect ? "react-datepicker__header--has-time-select" : "") },
e.renderCurrentMonth(o),
f.createElement(
"div",
{ className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(e.props.dropdownMode), onFocus: e.handleDropdownFocus },
e.renderMonthDropdown(i !== 0),
e.renderMonthYearDropdown(i !== 0),
e.renderYearDropdown(i !== 0)
),
f.createElement("div", { className: "react-datepicker__day-names" }, e.header(o))
);
}, e.renderCustomHeader = function(r) {
var o, i, s = r.monthDate, c = r.i;
if (e.props.showTimeSelect && !e.state.monthContainer || e.props.showTimeSelectOnly)
return null;
var u = gr(e.state.date, e.props), l = Dr(e.state.date, e.props), d = wr(e.state.date, e.props), p = yr(e.state.date, e.props), h = !e.props.showMonthYearPicker && !e.props.showQuarterYearPicker && !e.props.showYearPicker;
return f.createElement(
"div",
{ className: "react-datepicker__header react-datepicker__header--custom", onFocus: e.props.onDropdownFocus },
(i = (o = e.props).renderCustomHeader) === null || i === void 0 ? void 0 : i.call(o, Y(Y({}, e.state), { customHeaderCount: c, monthDate: s, changeMonth: e.changeMonth, changeYear: e.changeYear, decreaseMonth: e.decreaseMonth, increaseMonth: e.increaseMonth, decreaseYear: e.decreaseYear, increaseYear: e.increaseYear, prevMonthButtonDisabled: u, nextMonthButtonDisabled: l, prevYearButtonDisabled: d, nextYearButtonDisabled: p })),
h && f.createElement("div", { className: "react-datepicker__day-names" }, e.header(s))
);
}, e.renderYearHeader = function(r) {
var o = r.monthDate, i = e.props, s = i.showYearPicker, c = i.yearItemNumber, u = c === void 0 ? n.defaultProps.yearItemNumber : c, l = Me(o, u), d = l.startPeriod, p = l.endPeriod;
return f.createElement("div", { className: "react-datepicker__header react-datepicker-year-header" }, s ? "".concat(d, " - ").concat(p) : P(o));
}, e.renderHeader = function(r) {
var o = r.monthDate, i = r.i, s = i === void 0 ? 0 : i, c = { monthDate: o, i: s };
switch (!0) {
case e.props.renderCustomHeader !== void 0:
return e.renderCustomHeader(c);
case (e.props.showMonthYearPicker || e.props.showQuarterYearPicker || e.props.showYearPicker):
return e.renderYearHeader(c);
default:
return e.renderDefaultHeader(c);
}
}, e.renderMonths = function() {
var r, o;
if (!(e.props.showTimeSelectOnly || e.props.showYearPicker)) {
for (var i = [], s = (r = e.props.monthsShown) !== null && r !== void 0 ? r : n.defaultProps.monthsShown, c = e.props.showPreviousMonths ? s - 1 : 0, u = e.props.showMonthYearPicker || e.props.showQuarterYearPicker ? ve(e.state.date, c) : Ne(e.state.date, c), l = (o = e.props.monthSelectedIn) !== null && o !== void 0 ? o : c, d = 0; d < s; ++d) {
var p = d - l + c, h = e.props.showMonthYearPicker || e.props.showQuarterYearPicker ? ve(u, p) : ce(u, p), m = "month-".concat(d), g = d < s - 1, v = d > 0;
i.push(f.createElement(
"div",
{ key: m, ref: function(b) {
e.monthContainer = b ?? void 0;
}, className: "react-datepicker__month-container" },
e.renderHeader({ monthDate: h, i: d }),
f.createElement(Ui, Y({}, n.defaultProps, e.props, { containerRef: e.containerRef, ariaLabelPrefix: e.props.monthAriaLabelPrefix, day: h, onDayClick: e.handleDayClick, handleOnKeyDown: e.props.handleOnDayKeyDown, handleOnMonthKeyDown: e.props.handleOnKeyDown, onDayMouseEnter: e.handleDayMouseEnter, onMouseLeave: e.handleMonthMouseLeave, orderInDisplay: d, selectingDate: e.state.selectingDate, monthShowsDuplicateDaysEnd: g, monthShowsDuplicateDaysStart: v }))
));
}
return i;
}
}, e.renderYears = function() {
if (!e.props.showTimeSelectOnly && e.props.showYearPicker)
return f.createElement(
"div",
{ className: "react-datepicker__year--container" },
e.renderHeader({ monthDate: e.state.date }),
f.createElement(Ji, Y({}, n.defaultProps, e.props, { selectingDate: e.state.selectingDate, date: e.state.date, onDayClick: e.handleDayClick, clearSelectingDate: e.clearSelectingDate, onYearMouseEnter: e.handleYearMouseEnter, onYearMouseLeave: e.handleYearMouseLeave }))
);
}, e.renderTimeSection = function() {
if (e.props.showTimeSelect && (e.state.monthContainer || e.props.showTimeSelectOnly))
return f.createElement(Zi, Y({}, n.defaultProps, e.props, { onChange: e.props.onTimeChange, format: e.props.timeFormat, intervals: e.props.timeIntervals, monthRef: e.state.monthContainer }));
}, e.renderInputTimeSection = function() {
var r = e.props.selected ? new Date(e.props.selected) : void 0, o = r && xt(r) && !!e.props.selected, i = o ? "".concat(kr(r.getHours()), ":").concat(kr(r.getMinutes())) : "";
if (e.props.showTimeInput)
return f.createElement(Qi, Y({}, n.defaultProps, e.props, { date: r, timeString: i, onChange: e.props.onTimeChange }));
}, e.renderAriaLiveRegion = function() {
var r, o = Me(e.state.date, (r = e.props.yearItemNumber) !== null && r !== void 0 ? r : n.defaultProps.yearItemNumber), i = o.startPeriod, s = o.endPeriod, c;
return e.props.showYearPicker ? c = "".concat(i, " - ").concat(s) : e.props.showMonthYearPicker || e.props.showQuarterYearPicker ? c = P(e.state.date) : c = "".concat($t(ee(e.state.date), e.props.locale), " ").concat(P(e.state.date)), f.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }, e.state.isRenderAriaLiveMessage && c);
}, e.renderChildren = function() {
if (e.props.children)
return f.createElement("div", { className: "react-datepicker__children-container" }, e.props.children);
}, e.containerRef = xe(), e.state = {
date: e.getDateInView(),
selectingDate: void 0,
monthContainer: void 0,
isRenderAriaLiveMessage: !1
}, e;
}
return Object.defineProperty(n, "defaultProps", {
get: function() {
return {
monthsShown: 1,
forceShowMonthNavigation: !1,
timeCaption: "Time",
previousYearButtonLabel: "Previous Year",
nextYearButtonLabel: "Next Year",
previousMonthButtonLabel: "Previous Month",
nextMonthButtonLabel: "Next Month",
yearItemNumber: Je
};
},
enumerable: !1,
configurable: !0
}), n.prototype.componentDidMount = function() {
var t = this;
this.props.showTimeSelect && (this.assignMonthContainer = function() {
t.setState({ monthContainer: t.monthContainer });
}());
}, n.prototype.componentDidUpdate = function(t) {
var e = this;
if (this.props.preSelection && (!N(this.props.preSelection, t.preSelection) || this.props.monthSelectedIn !== t.monthSelectedIn)) {
var r = !te(this.state.date, this.props.preSelection);
this.setState({
date: this.props.preSelection
}, function() {
return r && e.handleCustomMonthChange(e.state.date);
});
} else this.props.openToDate && !N(this.props.openToDate, t.openToDate) && this.setState({
date: this.props.openToDate
});
}, n.prototype.render = function() {
var t = this.props.container || wi;
return f.createElement(
St,
{ onClickOutside: this.handleClickOutside, style: { display: "contents" }, ignoreClass: this.props.outsideClickIgnoreClass },
f.createElement(
"div",
{ style: { display: "contents" }, ref: this.containerRef },
f.createElement(
t,
{ className: J("react-datepicker", this.props.className, {
"react-datepicker--time-only": this.props.showTimeSelectOnly
}), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly },
this.renderAriaLiveRegion(),
this.renderPreviousButton(),
this.renderNextButton(),
this.renderMonths(),
this.renderYears(),
this.renderTodayButton(),
this.renderTimeSection(),
this.renderInputTimeSection(),
this.renderChildren()
)
)
);
}, n;
}(z)
), is = function(a) {
var n = a.icon, t = a.className, e = t === void 0 ? "" : t, r = a.onClick, o = "react-datepicker__calendar-icon";
if (typeof n == "string")
return f.createElement("i", { className: "".concat(o, " ").concat(n, " ").concat(e), "aria-hidden": "true", onClick: r });
if (f.isValidElement(n)) {
var i = n;
return f.cloneElement(i, {
className: "".concat(i.props.className || "", " ").concat(o, " ").concat(e),
onClick: function(s) {
typeof i.props.onClick == "function" && i.props.onClick(s), typeof r == "function" && r(s);
}
});
}
return f.createElement(
"svg",
{ className: "".concat(o, " ").concat(e), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", onClick: r },
f.createElement("path", { d: "M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z" })
);
}, an = (
/** @class */
function(a) {
Z(n, a);
function n(t) {
var e = a.call(this, t) || this;
return e.portalRoot = null, e.el = document.createElement("div"), e;
}
return n.prototype.componentDidMount = function() {
this.portalRoot = (this.props.portalHost || document).getElementById(this.props.portalId), this.portalRoot || (this.portalRoot = document.createElement("div"), this.portalRoot.setAttribute("id", this.props.portalId), (this.props.portalHost || document.body).appendChild(this.portalRoot)), this.portalRoot.appendChild(this.el);
}, n.prototype.componentWillUnmount = function() {
this.portalRoot && this.portalRoot.removeChild(this.el);
}, n.prototype.render = function() {
return hn.createPortal(this.props.children, this.el);
}, n;
}(z)
), ss = "[tabindex], a, button, input, select, textarea", cs = function(a) {
return (a instanceof HTMLAnchorElement || !a.disabled) && a.tabIndex !== -1;
}, on = (
/** @class */
function(a) {
Z(n, a);
function n(t) {
var e = a.call(this, t) || this;
return e.getTabChildren = function() {
var r;
return Array.prototype.slice.call((r = e.tabLoopRef.current) === null || r === void 0 ? void 0 : r.querySelectorAll(ss), 1, -1).filter(cs);
}, e.handleFocusStart = function() {
var r = e.getTabChildren();
r && r.length > 1 && r[r.length - 1].focus();
}, e.handleFocusEnd = function() {
var r = e.getTabChildren();
r && r.length > 1 && r[0].focus();
}, e.tabLoopRef = xe(), e;
}
return n.prototype.render = function() {
var t;
return ((t = this.props.enableTabLoop) !== null && t !== void 0 ? t : n.defaultProps.enableTabLoop) ? f.createElement(
"div",
{ className: "react-datepicker__tab-loop", ref: this.tabLoopRef },
f.createElement("div", { className: "react-datepicker__tab-loop__start", tabIndex: 0, onFocus: this.handleFocusStart }),
this.props.children,
f.createElement("div", { className: "react-datepicker__tab-loop__end", tabIndex: 0, onFocus: this.handleFocusEnd })
) : this.props.children;
}, n.defaultProps = {
enableTabLoop: !0
}, n;
}(z)
);
function ls(a) {
var n = function(t) {
var e, r = typeof t.hidePopper == "boolean" ? t.hidePopper : !0, o = Lt(null), i = Di(Y({ open: !r, whileElementsMounted: Dn, placement: t.popperPlacement, middleware: he([
ni({ padding: 15 }),
ri(10),
ai({ element: o })
], (e = t.popperModifiers) !== null && e !== void 0 ? e : [], !0) }, t.popperProps)), s = Y(Y({}, t), { hidePopper: r, popperProps: Y(Y({}, i), { arrowRef: o }) });
return f.createElement(a, Y({}, s));
};
return n;
}
var us = (
/** @class */
function(a) {
Z(n, a);
function n() {
return a !== null && a.apply(this, arguments) || this;
}
return Object.defineProperty(n, "defaultProps", {
get: function() {
return {
hidePopper: !0
};
},
enumerable: !1,
configurable: !0
}), n.prototype.render = function() {
var t = this.props, e = t.className, r = t.wrapperClassName, o = t.hidePopper, i = o === void 0 ? n.defaultProps.hidePopper : o, s = t.popperComponent, c = t.targetComponent, u = t.enableTabLoop, l = t.popperOnKeyDown, d = t.portalId, p = t.portalHost, h = t.popperProps, m = t.showArrow, g = void 0;
if (!i) {
var v = J("react-datepicker-popper", e);
g = f.createElement(
on,
{ enableTabLoop: u },
f.createElement(
"div",
{ ref: h.refs.setFloating, style: h.floatingStyles, className: v, "data-placement": h.placement, onKeyDown: l },
s,
m && f.createElement(di, { ref: h.arrowRef, context: h.context, fill: "currentColor", strokeWidth: 1, height: 8, width: 16, style: { transform: "translateY(-1px)" }, className: "react-datepicker__triangle" })
)
);
}
this.props.popperContainer && (g = dn(this.props.popperContainer, {}, g)), d && !i && (g = f.createElement(an, { portalId: d, portalHost: p }, g));
var b = J("react-datepicker-wrapper", r);
return f.createElement(
f.Fragment,
null,
f.createElement("div", { ref: h.refs.setReference, className: b }, c),
g
);
}, n;
}(z)
), ds = ls(us), Pr = "react-datepicker-ignore-onclickoutside";
function ps(a, n) {
return a && n ? ee(a) !== ee(n) || P(a) !== P(n) : a !== n;
}
var Rt = "Date input not valid.", ws = (
/** @class */
function(a) {
Z(n, a);
function n(t) {
var e = a.call(this, t) || this;
return e.calendar = null, e.input = null, e.getPreSelection = function() {
return e.props.openToDate ? e.props.openToDate : e.props.selectsEnd && e.props.startDate ? e.props.startDate : e.props.selectsStart && e.props.endDate ? e.props.endDate : F();
}, e.modifyHolidays = function() {
var r;
return (r = e.props.holidays) === null || r === void 0 ? void 0 : r.reduce(function(o, i) {
var s = new Date(i.date);
return xt(s) ? he(he([], o, !0), [Y(Y({}, i), { date: s })], !1) : o;
}, []);
}, e.calcInitialState = function() {
var r, o = e.getPreSelection(), i = tn(e.props), s = rn(e.props), c = i && Re(o, dt(i)) ? i : s && Pe(o, fr(s)) ? s : o;
return {
open: e.props.startOpen || !1,
preventFocus: !1,
inputValue: null,
preSelection: (r = e.props.selectsRange ? e.props.startDate : e.props.selected) !== null && r !== void 0 ? r : c,
// transforming highlighted days (perhaps nested array)
// to flat Map for faster access in day.jsx
highlightDates: br(e.props.highlightDates),
focused: !1,
// used to focus day in inline version after month has changed, but not on
// initial render
shouldFocusDayInline: !1,
isRenderAriaLiveMessage: !1,
wasHidden: !1
};
}, e.resetHiddenStatus = function() {
e.setState(Y(Y({}, e.state), { wasHidden: !1 }));
}, e.setHiddenStatus = function() {
e.setState(Y(Y({}, e.state), { wasHidden: !0 }));
}, e.setHiddenStateOnVisibilityHidden = function() {
document.visibilityState === "hidden" && e.setHiddenStatus();
}, e.clearPreventFocusTimeout = function() {
e.preventFocusTimeout && clearTimeout(e.preventFocusTimeout);
}, e.setFocus = function() {
var r, o;
(o = (r = e.input) === null || r === void 0 ? void 0 : r.focus) === null || o === void 0 || o.call(r, { preventScroll: !0 });
}, e.setBlur = function() {
var r, o;
(o = (r = e.input) === null || r === void 0 ? void 0 : r.blur) === null || o === void 0 || o.call(r), e.cancelFocusInput();
}, e.deferBlur = function() {
requestAnimationFrame(function() {
e.setBlur();
});
}, e.setOpen = function(r, o) {
o === void 0 && (o = !1), e.setState({
open: r,
preSelection: r && e.state.open ? e.state.preSelection : e.calcInitialState().preSelection,
lastPreSelectChange: It
}, function() {
r || e.setState(function(i) {
return {
focused: o ? i.focused : !1
};
}, function() {
!o && e.deferBlur(), e.setState({ inputValue: null });
});
});
}, e.inputOk = function() {
return ge(e.state.preSelection);
}, e.isCalendarOpen = function() {
return e.props.open === void 0 ? e.state.open && !e.props.disabled && !e.props.readOnly : e.props.open;
}, e.handleFocus = function(r) {
var o, i, s = e.state.wasHidden, c = s ? e.state.open : !0;
s && e.resetHiddenStatus(), e.state.preventFocus || ((i = (o = e.props).onFocus) === null || i === void 0 || i.call(o, r), c && !e.props.preventOpenOnFocus && !e.props.readOnly && e.setOpen(!0)), e.setState({ focused: !0 });
}, e.sendFocusBackToInput = function() {
e.preventFocusTimeout && e.clearPreventFocusTimeout(), e.setState({ preventFocus: !0 }, function() {
e.preventFocusTimeout = setTimeout(function() {
e.setFocus(), e.setState({ preventFocus: !1 });
});
});
}, e.cancelFocusInput = function() {
clearTimeout(e.inputFocusTimeout), e.inputFocusTimeout = void 0;
}, e.deferFocusInput = function() {
e.cancelFocusInput(), e.inputFocusTimeout = setTimeout(function() {
return e.setFocus();
}, 1);
}, e.handleDropdownFocus = function() {
e.cancelFocusInput();
}, e.handleBlur = function(r) {
var o, i;
(!e.state.open || e.props.withPortal || e.props.showTimeInput) && ((i = (o = e.props).onBlur) === null || i === void 0 || i.call(o, r)), e.state.open && e.props.open === !1 && e.setOpen(!1), e.setState({ focused: !1 });
}, e.handleCalendarClickOutside = function(r) {
var o, i;
e.props.inline || e.setOpen(!1), (i = (o = e.props).onClickOutside) === null || i === void 0 || i.call(o, r), e.props.withPortal && r.preventDefault();
}, e.handleChange = function() {
for (var r, o, i, s, c, u = [], l = 0; l < arguments.length; l++)
u[l] = arguments[l];
var d = u[0];
if (!(e.props.onChangeRaw && (e.props.onChangeRaw.apply(e, u), !d || typeof d.isDefaultPrevented != "function" || d.isDefaultPrevented()))) {
e.setState({
inputValue: (d == null ? void 0 : d.target) instanceof HTMLInputElement ? d.target.value : null,
lastPreSelectChange: fs
});
var p = e.props, h = p.selectsRange, m = p.startDate, g = p.endDate, v = (r = e.props.dateFormat) !== null && r !== void 0 ? r : n.defaultProps.dateFormat, b = (o = e.props.strictParsing) !== null && o !== void 0 ? o : n.defaultProps.strictParsing, C = (d == null ? void 0 : d.target) instanceof HTMLInputElement ? d.target.value : "";
if (h) {
var _ = C.split(v.includes("-") ? Zr : "-", 2).map(function(K) {
return K.trim();
}), x = _[0], I = _[1], L = Tt(x ?? "", v, e.props.locale, b), E = Tt(I ?? "", v, e.props.locale, b), y = (m == null ? void 0 : m.getTime()) !== (L == null ? void 0 : L.getTime()), M = (g == null ? void 0 : g.getTime()) !== (E == null ? void 0 : E.getTime());
if (!y && !M || L && oe(L, e.props) || E && oe(E, e.props))
return;
(s = (i = e.props).onChange) === null || s === void 0 || s.call(i, [L, E], d);
} else {
var T = Tt(C, v, e.props.locale, b, (c = e.props.selected) !== null && c !== void 0 ? c : void 0);
(T || !C) && e.setSelected(T, d, !0);
}
}
}, e.handleSelect = function(r, o, i) {
if (!e.props.readOnly) {
if (e.props.shouldCloseOnSelect && !e.props.showTimeSelect && e.sendFocusBackToInput(), e.props.onChangeRaw && e.props.onChangeRaw(o), e.setSelected(r, o, !1, i), e.props.showDateSelect && e.setState({ isRenderAriaLiveMessage: !0 }), !e.props.shouldCloseOnSelect || e.props.showTimeSelect)
e.setPreSelection(r);
else if (!e.props.inline) {
e.props.selectsRange || e.setOpen(!1);
var s = e.props, c = s.startDate, u = s.endDate;
c && !u && (e.props.swapRange || !Cr(r, c)) && e.setOpen(!1);
}
}
}, e.setSelected = function(r, o, i, s) {
var c, u, l = r;
if (e.props.showYearPicker) {
if (l !== null && pt(P(l), e.props))
return;
} else if (e.props.showMonthYearPicker) {
if (l !== null && en(l, e.props))
return;
} else if (l !== null && oe(l, e.props))
return;
var d = e.props, p = d.onChange, h = d.selectsRange, m = d.startDate, g = d.endDate, v = d.selectsMultiple, b = d.selectedDates, C = d.minTime, _ = d.swapRange;
if (!Oe(e.props.selected, l) || e.props.allowSameDay || h || v)
if (l !== null && (e.props.selected && (!i || !e.props.showTimeSelect && !e.props.showTimeSelectOnly && !e.props.showTimeInput) && (l = Nt(l, {
hour: De(e.props.selected),
minute: we(e.props.selected),
second: Ce(e.props.selected)
})), !i && (e.props.showTimeSelect || e.props.showTimeSelectOnly) && C && (l = Nt(l, {
hour: C.getHours(),
minute: C.getMinutes(),
second: C.getSeconds()
})), e.props.inline || e.setState({
preSelection: l
}), e.props.focusSelectedMonth || e.setState({ monthSelectedIn: s })), h) {
var x = !m && !g, I = m && !g, L = m && g;
x ? p == null || p([l, null], o) : I && (l === null ? p == null || p([null, null], o) : Cr(l, m) ? _ ? p == null || p([l, m], o) : p == null || p([l, null], o) : p == null || p([m, l], o)), L && (p == null || p([l, null], o));
} else if (v) {
if (l !== null)
if (!(b != null && b.length))
p == null || p([l], o);
else {
var E = b.some(function(M) {
return N(M, l);
});
if (E) {
var y = b.filter(function(M) {
return !N(M, l);
});
p == null || p(y, o);
} else
p == null || p(he(he([], b, !0), [l], !1), o);
}
} else
p == null || p(l, o);
i || ((u = (c = e.props).onSelect) === null || u === void 0 || u.call(c, l, o), e.setState({ inputValue: null }));
}, e.setPreSelection = function(r) {
if (!e.props.readOnly) {
var o = ge(e.props.minDate), i = ge(e.props.maxDate), s = !0;
if (r) {
var c = dt(r);
if (o && i)
s = Ge(r, e.props.minDate, e.props.maxDate);
else if (o) {
var u = dt(e.props.minDate);
s = Pe(r, u) || Oe(c, u);
} else if (i) {
var l = fr(e.props.maxDate);
s = Re(r, l) || Oe(c, l);
}
}
s && e.setState({
preSelection: r
});
}
}, e.toggleCalendar = function() {
e.setOpen(!e.state.open);
}, e.handleTimeChange = function(r) {
var o, i;
if (!(e.props.selectsRange || e.props.selectsMultiple)) {
var s = e.props.selected ? e.props.selected : e.getPreSelection(), c = e.props.selected ? r : Nt(s, {
hour: De(r),
minute: we(r)
});
e.setState({
preSelection: c
}), (i = (o = e.props).onChange) === null || i === void 0 || i.call(o, c), e.props.shouldCloseOnSelect && !e.props.showTimeInput && (e.sendFocusBackToInput(), e.setOpen(!1)), e.props.showTimeInput && e.setOpen(!0), (e.props.showTimeSelectOnly || e.props.showTimeSelect) && e.setState({ isRenderAriaLiveMessage: !0 }), e.setState({ inputValue: null });
}
}, e.onInputClick = function() {
var r, o;
!e.props.disabled && !e.props.readOnly && e.setOpen(!0), (o = (r = e.props).onInputClick) === null || o === void 0 || o.call(r);
}, e.onInputKeyDown = function(r) {
var o, i, s, c, u, l;
(i = (o = e.props).onKeyDown) === null || i === void 0 || i.call(o, r);
var d = r.key;
if (!e.state.open && !e.props.inline && !e.props.preventOpenOnFocus) {
(d === D.ArrowDown || d === D.ArrowUp || d === D.Enter) && ((s = e.onInputClick) === null || s === void 0 || s.call(e));
return;
}
if (e.state.open) {
if (d === D.ArrowDown || d === D.ArrowUp) {
r.preventDefault();
var p = e.props.showTimeSelectOnly ? ".react-datepicker__time-list-item[tabindex='0']" : e.props.showWeekPicker && e.props.showWeekNumbers ? '.react-datepicker__week-number[tabindex="0"]' : e.props.showFullMonthYearPicker || e.props.showMonthYearPicker ? '.react-datepicker__month-text[tabindex="0"]' : '.react-datepicker__day[tabindex="0"]', h = ((c = e.calendar) === null || c === void 0 ? void 0 : c.containerRef.current) instanceof Element && e.calendar.containerRef.current.querySelector(p);
h instanceof HTMLElement && h.focus({ preventScroll: !0 });
return;
}
var m = F(e.state.preSelection);
d === D.Enter ? (r.preventDefault(), r.target.blur(), e.inputOk() && e.state.lastPreSelectChange === It ? (e.handleSelect(m, r), !e.props.shouldCloseOnSelect && e.setPreSelection(m)) : e.setOpen(!1)) : d === D.Escape ? (r.preventDefault(), r.target.blur(), e.sendFocusBackToInput(), e.setOpen(!1)) : d === D.Tab && e.setOpen(!1), e.inputOk() || (l = (u = e.props).onInputError) === null || l === void 0 || l.call(u, { code: 1, msg: Rt });
}
}, e.onPortalKeyDown = function(r) {
var o = r.key;
o === D.Escape && (r.preventDefault(), e.setState({
preventFocus: !0
}, function() {
e.setOpen(!1), setTimeout(function() {
e.setFocus(), e.setState({ preventFocus: !1 });
});
}));
}, e.onDayKeyDown = function(r) {
var o, i, s, c, u, l, d = e.props, p = d.minDate, h = d.maxDate, m = d.disabledKeyboardNavigation, g = d.showWeekPicker, v = d.shouldCloseOnSelect, b = d.locale, C = d.calendarStartDay, _ = d.adjustDateOnChange, x = d.inline;
if ((i = (o = e.props).onKeyDown) === null || i === void 0 || i.call(o, r), !m) {
var I = r.key, L = r.shiftKey, E = F(e.state.preSelection), y = function($, O) {
var Q = O;
switch ($) {
case D.ArrowRight:
Q = g ? ht(O, 1) : se(O, 1);
break;
case D.ArrowLeft:
Q = g ? sr(O) : xo(O);
break;
case D.ArrowUp:
Q = sr(O);
break;
case D.ArrowDown:
Q = ht(O, 1);
break;
case D.PageUp:
Q = L ? Qe(O, 1) : Ne(O, 1);
break;
case D.PageDown:
Q = L ? ve(O, 1) : ce(O, 1);
break;
case D.Home:
Q = Se(O, b, C);
break;
case D.End:
Q = Ci(O);
break;
}
return Q;
}, M = function($, O) {
for (var Q = 40, W = $, le = !1, me = 0, ie = y($, O); !le; ) {
if (me >= Q) {
ie = O;
break;
}
p && ie < p && (W = D.ArrowRight, ie = oe(p, e.props) ? y(W, ie) : p), h && ie > h && (W = D.ArrowLeft, ie = oe(h, e.props) ? y(W, ie) : h), oe(ie, e.props) ? ((W === D.PageUp || W === D.Home) && (W = D.ArrowRight), (W === D.PageDown || W === D.End) && (W = D.ArrowLeft), ie = y(W, ie)) : le = !0, me++;
}
return ie;
};
if (I === D.Enter) {
r.preventDefault(), e.handleSelect(E, r), !v && e.setPreSelection(E);
return;
} else if (I === D.Escape) {
r.preventDefault(), e.setOpen(!1), e.inputOk() || (c = (s = e.props).onInputError) === null || c === void 0 || c.call(s, { code: 1, msg: Rt });
return;
}
var T = null;
switch (I) {
case D.ArrowLeft:
case D.ArrowRight:
case D.ArrowUp:
case D.ArrowDown:
case D.PageUp:
case D.PageDown:
case D.Home:
case D.End:
T = M(I, E);
break;
}
if (!T) {
(l = (u = e.props).onInputError) === null || l === void 0 || l.call(u, { code: 1, msg: Rt });
return;
}
if (r.preventDefault(), e.setState({ lastPreSelectChange: It }), _ && e.setSelected(T), e.setPreSelection(T), x) {
var K = ee(E), B = ee(T), j = P(E), re = P(T);
K !== B || j !== re ? e.setState({ shouldFocusDayInline: !0 }) : e.setState({ shouldFocusDayInline: !1 });
}
}
}, e.onPopperKeyDown = function(r) {
var o = r.key;
o === D.Escape && (r.preventDefault(), e.sendFocusBackToInput(), e.setOpen(!1));
}, e.onClearClick = function(r) {
r && r.preventDefault && r.preventDefault(), e.sendFocusBackToInput();
var o = e.props, i = o.selectsRange, s = o.onChange;
i ? s == null || s([null, null], r) : s == null || s(null, r), e.setState({ inputValue: null });
}, e.clear = function() {
e.onClearClick();
}, e.onScroll = function(r) {
typeof e.props.closeOnScroll == "boolean" && e.props.closeOnScroll ? (r.target === document || r.target === document.documentElement || r.target === document.body) && e.setOpen(!1) : typeof e.props.closeOnScroll == "function" && e.props.closeOnScroll(r) && e.setOpen(!1);
}, e.renderCalendar = function() {
var r, o;
return !e.props.inline && !e.isCalendarOpen() ? null : f.createElement(os, Y({ showMonthYearDropdown: void 0, ref: function(i) {
e.calendar = i;
} }, e.props, e.state, { setOpen: e.setOpen, dateFormat: (r = e.props.dateFormatCalendar) !== null && r !== void 0 ? r : n.defaultProps.dateFormatCalendar, onSelect: e.handleSelect, onClickOutside: e.handleCalendarClickOutside, holidays: Fi(e.modifyHolidays()), outsideClickIgnoreClass: Pr, onDropdownFocus: e.handleDropdownFocus, onTimeChange: e.handleTimeChange, className: e.props.calendarClassName, container: e.props.calendarContainer, handleOnKeyDown: e.props.onKeyDown, handleOnDayKeyDown: e.onDayKeyDown, setPreSelection: e.setPreSelection, dropdownMode: (o = e.props.dropdownMode) !== null && o !== void 0 ? o : n.defaultProps.dropdownMode }), e.props.children);
}, e.renderAriaLiveRegion = function() {
var r = e.props, o = r.dateFormat, i = o === void 0 ? n.defaultProps.dateFormat : o, s = r.locale, c = e.props.showTimeInput || e.props.showTimeSelect, u = c ? "PPPPp" : "PPPP", l;
return e.props.selectsRange ? l = "Selected start date: ".concat(ne(e.props.startDate, {
dateFormat: u,
locale: s
}), ". ").concat(e.props.endDate ? "End date: " + ne(e.props.endDate, {
dateFormat: u,
locale: s
}) : "") : e.props.showTimeSelectOnly ? l = "Selected time: ".concat(ne(e.props.selected, { dateFormat: i, locale: s })) : e.props.showYearPicker ? l = "Selected year: ".concat(ne(e.props.selected, { dateFormat: "yyyy", locale: s })) : e.props.showMonthYearPicker ? l = "Selected month: ".concat(ne(e.props.selected, { dateFormat: "MMMM yyyy", locale: s })) : e.props.showQuarterYearPicker ? l = "Selected quarter: ".concat(ne(e.props.selected, {
dateFormat: "yyyy, QQQ",
locale: s
})) : l = "Selected date: ".concat(ne(e.props.selected, {
dateFormat: u,
locale: s
})), f.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }, l);
}, e.renderDateInput = function() {
var r, o, i, s = J(e.props.className, (r = {}, r[Pr] = e.state.open, r)), c = e.props.customInput || f.createElement("input", { type: "text" }), u = e.props.customInputRef || "ref", l = e.props, d = l.dateFormat, p = d === void 0 ? n.defaultProps.dateFormat : d, h = l.locale, m = typeof e.props.value == "string" ? e.props.value : typeof e.state.inputValue == "string" ? e.state.inputValue : e.props.selectsRange ? bi(e.props.startDate, e.props.endDate, {
dateFormat: p,
locale: h
}) : e.props.selectsMultiple ? ki((i = e.props.selectedDates) !== null && i !== void 0 ? i : [], {
dateFormat: p,
locale: h
}) : ne(e.props.selected, {
dateFormat: p,
locale: h
});
return Or(c, (o = {}, o[u] = function(g) {
e.input = g;
}, o.value = m, o.onBlur = e.handleBlur, o.onChange = e.handleChange, o.onClick = e.onInputClick, o.onFocus = e.handleFocus, o.onKeyDown = e.onInputKeyDown, o.id = e.props.id, o.name = e.props.name, o.form = e.props.form, o.autoFocus = e.props.autoFocus, o.placeholder = e.props.placeholderText, o.disabled = e.props.disabled, o.autoComplete = e.props.autoComplete, o.className = J(c.props.className, s), o.title = e.props.title, o.readOnly = e.props.readOnly, o.required = e.props.required, o.tabIndex = e.props.tabIndex, o["aria-describedby"] = e.props.ariaDescribedBy, o["aria-invalid"] = e.props.ariaInvalid, o["aria-labelledby"] = e.props.ariaLabelledBy, o["aria-required"] = e.props.ariaRequired, o));
}, e.renderClearButton = function() {
var r = e.props, o = r.isClearable, i = r.disabled, s = r.selected, c = r.startDate, u = r.endDate, l = r.clearButtonTitle, d = r.clearButtonClassName, p = d === void 0 ? "" : d, h = r.ariaLabelClose, m = h === void 0 ? "Close" : h, g = r.selectedDates, v = r.readOnly;
return o && !v && (s != null || c != null || u != null || g != null && g.length) ? f.createElement("button", { type: "button", className: J("react-datepicker__close-icon", p, { "react-datepicker__close-icon--disabled": i }), disabled: i, "aria-label": m, onClick: e.onClearClick, title: l, tabIndex: -1 }) : null;
}, e.state = e.calcInitialState(), e.preventFocusTimeout = void 0, e;
}
return Object.defineProperty(n, "defaultProps", {
get: function() {
return {
allowSameDay: !1,
dateFormat: "MM/dd/yyyy",
dateFormatCalendar: "LLLL yyyy",
disabled: !1,
disabledKeyboardNavigation: !1,
dropdownMode: "scroll",
preventOpenOnFocus: !1,
monthsShown: 1,
readOnly: !1,
withPortal: !1,
selectsDisabledDaysInRange: !1,
shouldCloseOnSelect: !0,
showTimeSelect: !1,
showTimeInput: !1,
showPreviousMonths: !1,
showMonthYearPicker: !1,
showFullMonthYearPicker: !1,
showTwoColumnMonthYearPicker: !1,
showFourColumnMonthYearPicker: !1,
showYearPicker: !1,
showQuarterYearPicker: !1,
showWeekPicker: !1,
strictParsing: !1,
swapRange: !1,
timeIntervals: 30,
timeCaption: "Time",
previousMonthAriaLabel: "Previous Month",
previousMonthButtonLabel: "Previous Month",
nextMonthAriaLabel: "Next Month",
nextMonthButtonLabel: "Next Month",
previousYearAriaLabel: "Previous Year",
previousYearButtonLabel: "Previous Year",
nextYearAriaLabel: "Next Year",
nextYearButtonLabel: "Next Year",
timeInputLabel: "Time",
enableTabLoop: !0,
yearItemNumber: Je,
focusSelectedMonth: !1,
showPopperArrow: !0,
excludeScrollbar: !0,
customTimeInput: null,
calendarStartDay: void 0,
toggleCalendarOnIconClick: !1,
usePointerEvent: !1
};
},
enumerable: !1,
configurable: !0
}), n.prototype.componentDidMount = function() {
window.addEventListener("scroll", this.onScroll, !0), document.addEventListener("visibilitychange", this.setHiddenStateOnVisibilityHidden);
}, n.prototype.componentDidUpdate = function(t, e) {
var r, o, i, s;
t.inline && ps(t.selected, this.props.selected) && this.setPreSelection(this.props.selected), this.state.monthSelectedIn !== void 0 && t.monthsShown !== this.props.monthsShown && this.setState({ monthSelectedIn: 0 }), t.highlightDates !== this.props.highlightDates && this.setState({
highlightDates: br(this.props.highlightDates)
}), !e.focused && !Oe(t.selected, this.props.selected) && this.setState({ inputValue: null }), e.open !== this.state.open && (e.open === !1 && this.state.open === !0 && ((o = (r = this.props).onCalendarOpen) === null || o === void 0 || o.call(r)), e.open === !0 && this.state.open === !1 && ((s = (i = this.props).onCalendarClose) === null || s === void 0 || s.call(i)));
}, n.prototype.componentWillUnmount = function() {
this.clearPreventFocusTimeout(), window.removeEventListener("scroll", this.onScroll, !0), document.removeEventListener("visibilitychange", this.setHiddenStateOnVisibilityHidden);
}, n.prototype.renderInputContainer = function() {
var t = this.props, e = t.showIcon, r = t.icon, o = t.calendarIconClassname, i = t.calendarIconClassName, s = t.toggleCalendarOnIconClick, c = this.state.open;
return o && console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."), f.createElement(
"div",
{ className: "react-datepicker__input-container".concat(e ? " react-datepicker__view-calendar-icon" : "") },
e && f.createElement(is, Y({ icon: r, className: J(i, !i && o, c && "react-datepicker-ignore-onclickoutside") }, s ? {
onClick: this.toggleCalendar
} : null)),
this.state.isRenderAriaLiveMessage && this.renderAriaLiveRegion(),
this.renderDateInput(),
this.renderClearButton()
);
}, n.prototype.render = function() {
var t = this.renderCalendar();
if (this.props.inline)
return t;
if (this.props.withPortal) {
var e = this.state.open ? f.createElement(
on,
{ enableTabLoop: this.props.enableTabLoop },
f.createElement("div", { className: "react-datepicker__portal", tabIndex: -1, onKeyDown: this.onPortalKeyDown }, t)
) : null;
return this.state.open && this.props.portalId && (e = f.createElement(an, Y({ portalId: this.props.portalId }, this.props), e)), f.createElement(
"div",
null,
this.renderInputContainer(),
e
);
}
return f.createElement(ds, Y({}, this.props, { className: this.props.popperClassName, hidePopper: !this.isCalendarOpen(), targetComponent: this.renderInputContainer(), popperComponent: t, popperOnKeyDown: this.onPopperKeyDown, showArrow: this.props.showPopperArrow }));
}, n;
}(z)
), fs = "input", It = "navigate";
const ys = ({ children: a }) => {
if (!a)
return null;
const { children: n, className: t, modifiers: e, placement: r, ...o } = a.props;
return /* @__PURE__ */ je("div", { style: o, children: a });
};
export {
ys as C,
ws as D
};