UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

1,685 lines 93.8 kB
import { jsx as Be } from "react/jsx-runtime"; import m, { createContext as dn, useContext as ln, useCallback as A, useRef as Se, useLayoutEffect as hn, useState as Ce, useEffect as mn, useMemo as Ie } from "react"; import { cn as le } from "../../utils/index.js"; import { datePickerVariants as yn } from "./DatePicker.variants.js"; import { c as ft } from "../../createLucideIcon-Ck_e4796.js"; import '../../DatePicker.css';/** * @license lucide-react v0.534.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const gn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], wn = ft("chevron-left", gn); /** * @license lucide-react v0.534.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const bn = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Mn = ft("chevron-right", bn), He = {}, ye = {}; function ge(t, e) { try { const r = (He[t] || (He[t] = new Intl.DateTimeFormat("en-GB", { timeZone: t, hour: "numeric", timeZoneName: "longOffset" }).format))(e).split("GMT")[1] || ""; return r in ye ? ye[r] : Ke(r, r.split(":")); } catch { if (t in ye) return ye[t]; const n = t == null ? void 0 : t.match(kn); return n ? Ke(t, n.slice(1)) : NaN; } } const kn = /([+-]\d\d):?(\d\d)?/; function Ke(t, e) { const n = +e[0], r = +(e[1] || 0); return ye[t] = n > 0 ? n * 60 + r : n * 60 - r; } class L extends Date { //#region static constructor(...e) { super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ge(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)), dt(this), Ge(this)) : this.setTime(Date.now()); } static tz(e, ...n) { return n.length ? new L(...n, e) : new L(Date.now(), e); } //#endregion //#region time zone withTimeZone(e) { return new L(+this, e); } getTimezoneOffset() { return -ge(this.timeZone, this); } //#endregion //#region time setTime(e) { return Date.prototype.setTime.apply(this, arguments), Ge(this), +this; } //#endregion //#region date-fns integration [Symbol.for("constructDateFrom")](e) { return new L(+new Date(e), this.timeZone); } //#endregion } const Je = /^(get|set)(?!UTC)/; Object.getOwnPropertyNames(Date.prototype).forEach((t) => { if (!Je.test(t)) return; const e = t.replace(Je, "$1UTC"); L.prototype[e] && (t.startsWith("get") ? L.prototype[t] = function() { return this.internal[e](); } : (L.prototype[t] = function() { return Date.prototype[e].apply(this.internal, arguments), Dn(this), +this; }, L.prototype[e] = function() { return Date.prototype[e].apply(this, arguments), Ge(this), +this; })); }); function Ge(t) { t.internal.setTime(+t), t.internal.setUTCMinutes(t.internal.getUTCMinutes() - t.getTimezoneOffset()); } function Dn(t) { Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), dt(t); } function dt(t) { const e = ge(t.timeZone, t), n = /* @__PURE__ */ new Date(+t); n.setUTCHours(n.getUTCHours() - 1); const r = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), o = r - a, i = Date.prototype.getHours.apply(t) !== t.internal.getUTCHours(); o && i && t.internal.setUTCMinutes(t.internal.getUTCMinutes() + o); const s = r - e; s && Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + s); const c = ge(t.timeZone, t), l = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset() - c, u = c !== e, h = l - s; if (u && h) { Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + h); const w = ge(t.timeZone, t), b = c - w; b && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + b), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + b)); } } class I extends L { //#region static static tz(e, ...n) { return n.length ? new I(...n, e) : new I(Date.now(), e); } //#endregion //#region representation toISOString() { const [e, n, r] = this.tzComponents(), a = `${e}${n}:${r}`; return this.internal.toISOString().slice(0, -1) + a; } toString() { return `${this.toDateString()} ${this.toTimeString()}`; } toDateString() { const [e, n, r, a] = this.internal.toUTCString().split(" "); return `${e == null ? void 0 : e.slice(0, -1)} ${r} ${n} ${a}`; } toTimeString() { const e = this.internal.toUTCString().split(" ")[4], [n, r, a] = this.tzComponents(); return `${e} GMT${n}${r}${a} (${vn(this.timeZone, this)})`; } toLocaleString(e, n) { return Date.prototype.toLocaleString.call(this, e, { ...n, timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone }); } toLocaleDateString(e, n) { return Date.prototype.toLocaleDateString.call(this, e, { ...n, timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone }); } toLocaleTimeString(e, n) { return Date.prototype.toLocaleTimeString.call(this, e, { ...n, timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone }); } //#endregion //#region private tzComponents() { const e = this.getTimezoneOffset(), n = e > 0 ? "-" : "+", r = String(Math.floor(Math.abs(e) / 60)).padStart(2, "0"), a = String(Math.abs(e) % 60).padStart(2, "0"); return [n, r, a]; } //#endregion withTimeZone(e) { return new I(+this, e); } //#region date-fns integration [Symbol.for("constructDateFrom")](e) { return new I(+new Date(e), this.timeZone); } //#endregion } function vn(t, e) { return new Intl.DateTimeFormat("en-GB", { timeZone: t, timeZoneName: "long" }).format(e).slice(12); } var g; (function(t) { t.Root = "root", t.Chevron = "chevron", t.Day = "day", t.DayButton = "day_button", t.CaptionLabel = "caption_label", t.Dropdowns = "dropdowns", t.Dropdown = "dropdown", t.DropdownRoot = "dropdown_root", t.Footer = "footer", t.MonthGrid = "month_grid", t.MonthCaption = "month_caption", t.MonthsDropdown = "months_dropdown", t.Month = "month", t.Months = "months", t.Nav = "nav", t.NextMonthButton = "button_next", t.PreviousMonthButton = "button_previous", t.Week = "week", t.Weeks = "weeks", t.Weekday = "weekday", t.Weekdays = "weekdays", t.WeekNumber = "week_number", t.WeekNumberHeader = "week_number_header", t.YearsDropdown = "years_dropdown"; })(g || (g = {})); var P; (function(t) { t.disabled = "disabled", t.hidden = "hidden", t.outside = "outside", t.focused = "focused", t.today = "today"; })(P || (P = {})); var Z; (function(t) { t.range_end = "range_end", t.range_middle = "range_middle", t.range_start = "range_start", t.selected = "selected"; })(Z || (Z = {})); var j; (function(t) { t.weeks_before_enter = "weeks_before_enter", t.weeks_before_exit = "weeks_before_exit", t.weeks_after_enter = "weeks_after_enter", t.weeks_after_exit = "weeks_after_exit", t.caption_after_enter = "caption_after_enter", t.caption_after_exit = "caption_after_exit", t.caption_before_enter = "caption_before_enter", t.caption_before_exit = "caption_before_exit"; })(j || (j = {})); const lt = 6048e5, On = 864e5, et = Symbol.for("constructDateFrom"); function _(t, e) { return typeof t == "function" ? t(e) : t && typeof t == "object" && et in t ? t[et](e) : t instanceof Date ? new t.constructor(e) : new Date(e); } function Y(t, e) { return _(e || t, t); } function ht(t, e, n) { const r = Y(t, n == null ? void 0 : n.in); return isNaN(e) ? _(t, NaN) : (e && r.setDate(r.getDate() + e), r); } function mt(t, e, n) { const r = Y(t, n == null ? void 0 : n.in); if (isNaN(e)) return _(t, NaN); if (!e) return r; const a = r.getDate(), o = _(t, r.getTime()); o.setMonth(r.getMonth() + e + 1, 0); const i = o.getDate(); return a >= i ? o : (r.setFullYear( o.getFullYear(), o.getMonth(), a ), r); } let Wn = {}; function Me() { return Wn; } function ce(t, e) { var s, c, d, l; const n = Me(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = Y(t, e == null ? void 0 : e.in), o = a.getDay(), i = (o < r ? 7 : 0) + o - r; return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a; } function we(t, e) { return ce(t, { ...e, weekStartsOn: 1 }); } function yt(t, e) { const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = _(n, 0); a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0); const o = we(a), i = _(n, 0); i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0); const s = we(i); return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1; } function tt(t) { const e = Y(t), n = new Date( Date.UTC( e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds() ) ); return n.setUTCFullYear(e.getFullYear()), +t - +n; } function ue(t, ...e) { const n = _.bind( null, e.find((r) => typeof r == "object") ); return e.map(n); } function be(t, e) { const n = Y(t, e == null ? void 0 : e.in); return n.setHours(0, 0, 0, 0), n; } function gt(t, e, n) { const [r, a] = ue( n == null ? void 0 : n.in, t, e ), o = be(r), i = be(a), s = +o - tt(o), c = +i - tt(i); return Math.round((s - c) / On); } function pn(t, e) { const n = yt(t, e), r = _(t, 0); return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), we(r); } function Nn(t, e, n) { return ht(t, e * 7, n); } function Sn(t, e, n) { return mt(t, e * 12, n); } function Cn(t, e) { let n, r = e == null ? void 0 : e.in; return t.forEach((a) => { !r && typeof a == "object" && (r = _.bind(null, a)); const o = Y(a, r); (!n || n < o || isNaN(+o)) && (n = o); }), _(r, n || NaN); } function xn(t, e) { let n, r = e == null ? void 0 : e.in; return t.forEach((a) => { !r && typeof a == "object" && (r = _.bind(null, a)); const o = Y(a, r); (!n || n > o || isNaN(+o)) && (n = o); }), _(r, n || NaN); } function Yn(t, e, n) { const [r, a] = ue( n == null ? void 0 : n.in, t, e ); return +be(r) == +be(a); } function wt(t) { return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]"; } function Tn(t) { return !(!wt(t) && typeof t != "number" || isNaN(+Y(t))); } function En(t, e, n) { const [r, a] = ue( n == null ? void 0 : n.in, t, e ), o = r.getFullYear() - a.getFullYear(), i = r.getMonth() - a.getMonth(); return o * 12 + i; } function Pn(t, e) { const n = Y(t, e == null ? void 0 : e.in), r = n.getMonth(); return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n; } function _n(t, e) { const [n, r] = ue(t, e.start, e.end); return { start: n, end: r }; } function Fn(t, e) { const { start: n, end: r } = _n(e == null ? void 0 : e.in, t); let a = +n > +r; const o = a ? +n : +r, i = a ? r : n; i.setHours(0, 0, 0, 0), i.setDate(1); let s = 1; const c = []; for (; +i <= o; ) c.push(_(n, i)), i.setMonth(i.getMonth() + s); return a ? c.reverse() : c; } function Bn(t, e) { const n = Y(t, e == null ? void 0 : e.in); return n.setDate(1), n.setHours(0, 0, 0, 0), n; } function In(t, e) { const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(); return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n; } function bt(t, e) { const n = Y(t, e == null ? void 0 : e.in); return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n; } function Mt(t, e) { var s, c, d, l; const n = Me(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = Y(t, e == null ? void 0 : e.in), o = a.getDay(), i = (o < r ? -7 : 0) + 6 - (o - r); return a.setDate(a.getDate() + i), a.setHours(23, 59, 59, 999), a; } function Hn(t, e) { return Mt(t, { ...e, weekStartsOn: 1 }); } const qn = { 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" } }, An = (t, e, n) => { let r; const a = qn[t]; return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r; }; function qe(t) { return (e = {}) => { const n = e.width ? String(e.width) : t.defaultWidth; return t.formats[n] || t.formats[t.defaultWidth]; }; } const jn = { full: "EEEE, MMMM do, y", long: "MMMM do, y", medium: "MMM d, y", short: "MM/dd/yyyy" }, $n = { full: "h:mm:ss a zzzz", long: "h:mm:ss a z", medium: "h:mm:ss a", short: "h:mm a" }, Gn = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: "{{date}}, {{time}}", short: "{{date}}, {{time}}" }, Rn = { date: qe({ formats: jn, defaultWidth: "full" }), time: qe({ formats: $n, defaultWidth: "full" }), dateTime: qe({ formats: Gn, defaultWidth: "full" }) }, zn = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: "P" }, Zn = (t, e, n, r) => zn[t]; function he(t) { return (e, n) => { const r = n != null && n.context ? String(n.context) : "standalone"; let a; if (r === "formatting" && t.formattingValues) { const i = t.defaultFormattingWidth || t.defaultWidth, s = n != null && n.width ? String(n.width) : i; a = t.formattingValues[s] || t.formattingValues[i]; } else { const i = t.defaultWidth, s = n != null && n.width ? String(n.width) : t.defaultWidth; a = t.values[s] || t.values[i]; } const o = t.argumentCallback ? t.argumentCallback(e) : e; return a[o]; }; } const Qn = { narrow: ["B", "A"], abbreviated: ["BC", "AD"], wide: ["Before Christ", "Anno Domini"] }, Xn = { narrow: ["1", "2", "3", "4"], abbreviated: ["Q1", "Q2", "Q3", "Q4"], wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] }, Ln = { 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" ] }, Vn = { 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" ] }, Un = { 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" } }, Kn = { 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" } }, Jn = (t, e) => { const n = Number(t), r = n % 100; if (r > 20 || r < 10) switch (r % 10) { case 1: return n + "st"; case 2: return n + "nd"; case 3: return n + "rd"; } return n + "th"; }, er = { ordinalNumber: Jn, era: he({ values: Qn, defaultWidth: "wide" }), quarter: he({ values: Xn, defaultWidth: "wide", argumentCallback: (t) => t - 1 }), month: he({ values: Ln, defaultWidth: "wide" }), day: he({ values: Vn, defaultWidth: "wide" }), dayPeriod: he({ values: Un, defaultWidth: "wide", formattingValues: Kn, defaultFormattingWidth: "wide" }) }; function me(t) { return (e, n = {}) => { const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(a); if (!o) return null; const i = o[0], s = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(s) ? nr(s, (u) => u.test(i)) : ( // [TODO] -- I challenge you to fix the type tr(s, (u) => u.test(i)) ); let d; d = t.valueCallback ? t.valueCallback(c) : c, d = n.valueCallback ? ( // [TODO] -- I challenge you to fix the type n.valueCallback(d) ) : d; const l = e.slice(i.length); return { value: d, rest: l }; }; } function tr(t, e) { for (const n in t) if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n])) return n; } function nr(t, e) { for (let n = 0; n < t.length; n++) if (e(t[n])) return n; } function rr(t) { return (e, n = {}) => { const r = e.match(t.matchPattern); if (!r) return null; const a = r[0], o = e.match(t.parsePattern); if (!o) return null; let i = t.valueCallback ? t.valueCallback(o[0]) : o[0]; i = n.valueCallback ? n.valueCallback(i) : i; const s = e.slice(a.length); return { value: i, rest: s }; }; } const ar = /^(\d+)(th|st|nd|rd)?/i, or = /\d+/i, sr = { 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 }, ir = { any: [/^b/i, /^(a|c)/i] }, cr = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }, ur = { any: [/1/i, /2/i, /3/i, /4/i] }, fr = { 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 }, dr = { 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 ] }, lr = { 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 }, hr = { 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] }, mr = { 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 }, yr = { 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 } }, gr = { ordinalNumber: rr({ matchPattern: ar, parsePattern: or, valueCallback: (t) => parseInt(t, 10) }), era: me({ matchPatterns: sr, defaultMatchWidth: "wide", parsePatterns: ir, defaultParseWidth: "any" }), quarter: me({ matchPatterns: cr, defaultMatchWidth: "wide", parsePatterns: ur, defaultParseWidth: "any", valueCallback: (t) => t + 1 }), month: me({ matchPatterns: fr, defaultMatchWidth: "wide", parsePatterns: dr, defaultParseWidth: "any" }), day: me({ matchPatterns: lr, defaultMatchWidth: "wide", parsePatterns: hr, defaultParseWidth: "any" }), dayPeriod: me({ matchPatterns: mr, defaultMatchWidth: "any", parsePatterns: yr, defaultParseWidth: "any" }) }, Re = { code: "en-US", formatDistance: An, formatLong: Rn, formatRelative: Zn, localize: er, match: gr, options: { weekStartsOn: 0, firstWeekContainsDate: 1 } }; function wr(t, e) { const n = Y(t, e == null ? void 0 : e.in); return gt(n, bt(n)) + 1; } function kt(t, e) { const n = Y(t, e == null ? void 0 : e.in), r = +we(n) - +pn(n); return Math.round(r / lt) + 1; } function Dt(t, e) { var l, u, h, w; const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = Me(), o = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((u = (l = e == null ? void 0 : e.locale) == null ? void 0 : l.options) == null ? void 0 : u.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((w = (h = a.locale) == null ? void 0 : h.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, i = _((e == null ? void 0 : e.in) || t, 0); i.setFullYear(r + 1, 0, o), i.setHours(0, 0, 0, 0); const s = ce(i, e), c = _((e == null ? void 0 : e.in) || t, 0); c.setFullYear(r, 0, o), c.setHours(0, 0, 0, 0); const d = ce(c, e); return +n >= +s ? r + 1 : +n >= +d ? r : r - 1; } function br(t, e) { var s, c, d, l; const n = Me(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = Dt(t, e), o = _((e == null ? void 0 : e.in) || t, 0); return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), ce(o, e); } function vt(t, e) { const n = Y(t, e == null ? void 0 : e.in), r = +ce(n, e) - +br(n, e); return Math.round(r / lt) + 1; } function x(t, e) { const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0"); return n + r; } const ne = { // Year y(t, e) { const n = t.getFullYear(), r = n > 0 ? n : 1 - n; return x(e === "yy" ? r % 100 : r, e.length); }, // Month M(t, e) { const n = t.getMonth(); return e === "M" ? String(n + 1) : x(n + 1, 2); }, // Day of the month d(t, e) { return x(t.getDate(), e.length); }, // AM or PM a(t, e) { const n = t.getHours() / 12 >= 1 ? "pm" : "am"; switch (e) { case "a": case "aa": return n.toUpperCase(); case "aaa": return n; case "aaaaa": return n[0]; case "aaaa": default: return n === "am" ? "a.m." : "p.m."; } }, // Hour [1-12] h(t, e) { return x(t.getHours() % 12 || 12, e.length); }, // Hour [0-23] H(t, e) { return x(t.getHours(), e.length); }, // Minute m(t, e) { return x(t.getMinutes(), e.length); }, // Second s(t, e) { return x(t.getSeconds(), e.length); }, // Fraction of second S(t, e) { const n = e.length, r = t.getMilliseconds(), a = Math.trunc( r * Math.pow(10, n - 3) ); return x(a, e.length); } }, ie = { midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, nt = { // Era G: function(t, e, n) { const r = t.getFullYear() > 0 ? 1 : 0; switch (e) { // AD, BC case "G": case "GG": case "GGG": return n.era(r, { width: "abbreviated" }); // A, B case "GGGGG": return n.era(r, { width: "narrow" }); // Anno Domini, Before Christ case "GGGG": default: return n.era(r, { width: "wide" }); } }, // Year y: function(t, e, n) { if (e === "yo") { const r = t.getFullYear(), a = r > 0 ? r : 1 - r; return n.ordinalNumber(a, { unit: "year" }); } return ne.y(t, e); }, // Local week-numbering year Y: function(t, e, n, r) { const a = Dt(t, r), o = a > 0 ? a : 1 - a; if (e === "YY") { const i = o % 100; return x(i, 2); } return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : x(o, e.length); }, // ISO week-numbering year R: function(t, e) { const n = yt(t); return x(n, e.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(t, e) { const n = t.getFullYear(); return x(n, e.length); }, // Quarter Q: function(t, e, n) { const r = Math.ceil((t.getMonth() + 1) / 3); switch (e) { // 1, 2, 3, 4 case "Q": return String(r); // 01, 02, 03, 04 case "QQ": return x(r, 2); // 1st, 2nd, 3rd, 4th case "Qo": return n.ordinalNumber(r, { unit: "quarter" }); // Q1, Q2, Q3, Q4 case "QQQ": return n.quarter(r, { width: "abbreviated", context: "formatting" }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case "QQQQQ": return n.quarter(r, { width: "narrow", context: "formatting" }); // 1st quarter, 2nd quarter, ... case "QQQQ": default: return n.quarter(r, { width: "wide", context: "formatting" }); } }, // Stand-alone quarter q: function(t, e, n) { const r = Math.ceil((t.getMonth() + 1) / 3); switch (e) { // 1, 2, 3, 4 case "q": return String(r); // 01, 02, 03, 04 case "qq": return x(r, 2); // 1st, 2nd, 3rd, 4th case "qo": return n.ordinalNumber(r, { unit: "quarter" }); // Q1, Q2, Q3, Q4 case "qqq": return n.quarter(r, { width: "abbreviated", context: "standalone" }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case "qqqqq": return n.quarter(r, { width: "narrow", context: "standalone" }); // 1st quarter, 2nd quarter, ... case "qqqq": default: return n.quarter(r, { width: "wide", context: "standalone" }); } }, // Month M: function(t, e, n) { const r = t.getMonth(); switch (e) { case "M": case "MM": return ne.M(t, e); // 1st, 2nd, ..., 12th case "Mo": return n.ordinalNumber(r + 1, { unit: "month" }); // Jan, Feb, ..., Dec case "MMM": return n.month(r, { width: "abbreviated", context: "formatting" }); // J, F, ..., D case "MMMMM": return n.month(r, { width: "narrow", context: "formatting" }); // January, February, ..., December case "MMMM": default: return n.month(r, { width: "wide", context: "formatting" }); } }, // Stand-alone month L: function(t, e, n) { const r = t.getMonth(); switch (e) { // 1, 2, ..., 12 case "L": return String(r + 1); // 01, 02, ..., 12 case "LL": return x(r + 1, 2); // 1st, 2nd, ..., 12th case "Lo": return n.ordinalNumber(r + 1, { unit: "month" }); // Jan, Feb, ..., Dec case "LLL": return n.month(r, { width: "abbreviated", context: "standalone" }); // J, F, ..., D case "LLLLL": return n.month(r, { width: "narrow", context: "standalone" }); // January, February, ..., December case "LLLL": default: return n.month(r, { width: "wide", context: "standalone" }); } }, // Local week of year w: function(t, e, n, r) { const a = vt(t, r); return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : x(a, e.length); }, // ISO week of year I: function(t, e, n) { const r = kt(t); return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : x(r, e.length); }, // Day of the month d: function(t, e, n) { return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : ne.d(t, e); }, // Day of year D: function(t, e, n) { const r = wr(t); return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : x(r, e.length); }, // Day of week E: function(t, e, n) { const r = t.getDay(); switch (e) { // Tue case "E": case "EE": case "EEE": return n.day(r, { width: "abbreviated", context: "formatting" }); // T case "EEEEE": return n.day(r, { width: "narrow", context: "formatting" }); // Tu case "EEEEEE": return n.day(r, { width: "short", context: "formatting" }); // Tuesday case "EEEE": default: return n.day(r, { width: "wide", context: "formatting" }); } }, // Local day of week e: function(t, e, n, r) { const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7; switch (e) { // Numerical value (Nth day of week with current locale or weekStartsOn) case "e": return String(o); // Padded numerical value case "ee": return x(o, 2); // 1st, 2nd, ..., 7th case "eo": return n.ordinalNumber(o, { unit: "day" }); case "eee": return n.day(a, { width: "abbreviated", context: "formatting" }); // T case "eeeee": return n.day(a, { width: "narrow", context: "formatting" }); // Tu case "eeeeee": return n.day(a, { width: "short", context: "formatting" }); // Tuesday case "eeee": default: return n.day(a, { width: "wide", context: "formatting" }); } }, // Stand-alone local day of week c: function(t, e, n, r) { const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7; switch (e) { // Numerical value (same as in `e`) case "c": return String(o); // Padded numerical value case "cc": return x(o, e.length); // 1st, 2nd, ..., 7th case "co": return n.ordinalNumber(o, { unit: "day" }); case "ccc": return n.day(a, { width: "abbreviated", context: "standalone" }); // T case "ccccc": return n.day(a, { width: "narrow", context: "standalone" }); // Tu case "cccccc": return n.day(a, { width: "short", context: "standalone" }); // Tuesday case "cccc": default: return n.day(a, { width: "wide", context: "standalone" }); } }, // ISO day of week i: function(t, e, n) { const r = t.getDay(), a = r === 0 ? 7 : r; switch (e) { // 2 case "i": return String(a); // 02 case "ii": return x(a, e.length); // 2nd case "io": return n.ordinalNumber(a, { unit: "day" }); // Tue case "iii": return n.day(r, { width: "abbreviated", context: "formatting" }); // T case "iiiii": return n.day(r, { width: "narrow", context: "formatting" }); // Tu case "iiiiii": return n.day(r, { width: "short", context: "formatting" }); // Tuesday case "iiii": default: return n.day(r, { width: "wide", context: "formatting" }); } }, // AM or PM a: function(t, e, n) { const a = t.getHours() / 12 >= 1 ? "pm" : "am"; switch (e) { case "a": case "aa": return n.dayPeriod(a, { width: "abbreviated", context: "formatting" }); case "aaa": return n.dayPeriod(a, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "aaaaa": return n.dayPeriod(a, { width: "narrow", context: "formatting" }); case "aaaa": default: return n.dayPeriod(a, { width: "wide", context: "formatting" }); } }, // AM, PM, midnight, noon b: function(t, e, n) { const r = t.getHours(); let a; switch (r === 12 ? a = ie.noon : r === 0 ? a = ie.midnight : a = r / 12 >= 1 ? "pm" : "am", e) { case "b": case "bb": return n.dayPeriod(a, { width: "abbreviated", context: "formatting" }); case "bbb": return n.dayPeriod(a, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "bbbbb": return n.dayPeriod(a, { width: "narrow", context: "formatting" }); case "bbbb": default: return n.dayPeriod(a, { width: "wide", context: "formatting" }); } }, // in the morning, in the afternoon, in the evening, at night B: function(t, e, n) { const r = t.getHours(); let a; switch (r >= 17 ? a = ie.evening : r >= 12 ? a = ie.afternoon : r >= 4 ? a = ie.morning : a = ie.night, e) { case "B": case "BB": case "BBB": return n.dayPeriod(a, { width: "abbreviated", context: "formatting" }); case "BBBBB": return n.dayPeriod(a, { width: "narrow", context: "formatting" }); case "BBBB": default: return n.dayPeriod(a, { width: "wide", context: "formatting" }); } }, // Hour [1-12] h: function(t, e, n) { if (e === "ho") { let r = t.getHours() % 12; return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" }); } return ne.h(t, e); }, // Hour [0-23] H: function(t, e, n) { return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : ne.H(t, e); }, // Hour [0-11] K: function(t, e, n) { const r = t.getHours() % 12; return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : x(r, e.length); }, // Hour [1-24] k: function(t, e, n) { let r = t.getHours(); return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : x(r, e.length); }, // Minute m: function(t, e, n) { return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : ne.m(t, e); }, // Second s: function(t, e, n) { return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : ne.s(t, e); }, // Fraction of second S: function(t, e) { return ne.S(t, e); }, // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) X: function(t, e, n) { const r = t.getTimezoneOffset(); if (r === 0) return "Z"; switch (e) { // Hours and optional minutes case "X": return at(r); // 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 re(r); // 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 re(r, ":"); } }, // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) x: function(t, e, n) { const r = t.getTimezoneOffset(); switch (e) { // Hours and optional minutes case "x": return at(r); // 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 re(r); // 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 re(r, ":"); } }, // Timezone (GMT) O: function(t, e, n) { const r = t.getTimezoneOffset(); switch (e) { // Short case "O": case "OO": case "OOO": return "GMT" + rt(r, ":"); // Long case "OOOO": default: return "GMT" + re(r, ":"); } }, // Timezone (specific non-location) z: function(t, e, n) { const r = t.getTimezoneOffset(); switch (e) { // Short case "z": case "zz": case "zzz": return "GMT" + rt(r, ":"); // Long case "zzzz": default: return "GMT" + re(r, ":"); } }, // Seconds timestamp t: function(t, e, n) { const r = Math.trunc(+t / 1e3); return x(r, e.length); }, // Milliseconds timestamp T: function(t, e, n) { return x(+t, e.length); } }; function rt(t, e = "") { const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), o = r % 60; return o === 0 ? n + String(a) : n + String(a) + e + x(o, 2); } function at(t, e) { return t % 60 === 0 ? (t > 0 ? "-" : "+") + x(Math.abs(t) / 60, 2) : re(t, e); } function re(t, e = "") { const n = t > 0 ? "-" : "+", r = Math.abs(t), a = x(Math.trunc(r / 60), 2), o = x(r % 60, 2); return n + a + e + o; } const ot = (t, e) => { switch (t) { case "P": return e.date({ width: "short" }); case "PP": return e.date({ width: "medium" }); case "PPP": return e.date({ width: "long" }); case "PPPP": default: return e.date({ width: "full" }); } }, Ot = (t, e) => { switch (t) { case "p": return e.time({ width: "short" }); case "pp": return e.time({ width: "medium" }); case "ppp": return e.time({ width: "long" }); case "pppp": default: return e.time({ width: "full" }); } }, Mr = (t, e) => { const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2]; if (!a) return ot(t, e); let o; switch (r) { case "P": o = e.dateTime({ width: "short" }); break; case "PP": o = e.dateTime({ width: "medium" }); break; case "PPP": o = e.dateTime({ width: "long" }); break; case "PPPP": default: o = e.dateTime({ width: "full" }); break; } return o.replace("{{date}}", ot(r, e)).replace("{{time}}", Ot(a, e)); }, kr = { p: Ot, P: Mr }, Dr = /^D+$/, vr = /^Y+$/, Or = ["D", "DD", "YY", "YYYY"]; function Wr(t) { return Dr.test(t); } function pr(t) { return vr.test(t); } function Nr(t, e, n) { const r = Sr(t, e, n); if (console.warn(r), Or.includes(t)) throw new RangeError(r); } function Sr(t, e, n) { const r = t[0] === "Y" ? "years" : "days of the month"; return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; } const Cr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, xr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Yr = /^'([^]*?)'?$/, Tr = /''/g, Er = /[a-zA-Z]/; function Pr(t, e, n) { var l, u, h, w, b, W, M, k; const r = Me(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? Re, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((u = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : u.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((w = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, i = (n == null ? void 0 : n.weekStartsOn) ?? ((W = (b = n == null ? void 0 : n.locale) == null ? void 0 : b.options) == null ? void 0 : W.weekStartsOn) ?? r.weekStartsOn ?? ((k = (M = r.locale) == null ? void 0 : M.options) == null ? void 0 : k.weekStartsOn) ?? 0, s = Y(t, n == null ? void 0 : n.in); if (!Tn(s)) throw new RangeError("Invalid time value"); let c = e.match(xr).map((D) => { const y = D[0]; if (y === "p" || y === "P") { const T = kr[y]; return T(D, a.formatLong); } return D; }).join("").match(Cr).map((D) => { if (D === "''") return { isToken: !1, value: "'" }; const y = D[0]; if (y === "'") return { isToken: !1, value: _r(D) }; if (nt[y]) return { isToken: !0, value: D }; if (y.match(Er)) throw new RangeError( "Format string contains an unescaped latin alphabet character `" + y + "`" ); return { isToken: !1, value: D }; }); a.localize.preprocessor && (c = a.localize.preprocessor(s, c)); const d = { firstWeekContainsDate: o, weekStartsOn: i, locale: a }; return c.map((D) => { if (!D.isToken) return D.value; const y = D.value; (!(n != null && n.useAdditionalWeekYearTokens) && pr(y) || !(n != null && n.useAdditionalDayOfYearTokens) && Wr(y)) && Nr(y, e, String(t)); const T = nt[y[0]]; return T(s, y, a.localize, d); }).join(""); } function _r(t) { const e = t.match(Yr); return e ? e[1].replace(Tr, "'") : t; } function Fr(t, e) { const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = n.getMonth(), o = _(n, 0); return o.setFullYear(r, a + 1, 0), o.setHours(0, 0, 0, 0), o.getDate(); } function Br(t, e) { return Y(t, e == null ? void 0 : e.in).getMonth(); } function Ir(t, e) { return Y(t, e == null ? void 0 : e.in).getFullYear(); } function Hr(t, e) { return +Y(t) > +Y(e); } function qr(t, e) { return +Y(t) < +Y(e); } function Ar(t, e, n) { const [r, a] = ue( n == null ? void 0 : n.in, t, e ); return r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth(); } function jr(t, e, n) { const [r, a] = ue( n == null ? void 0 : n.in, t, e ); return r.getFullYear() === a.getFullYear(); } function $r(t, e, n) { const r = Y(t, n == null ? void 0 : n.in), a = r.getFullYear(), o = r.getDate(), i = _(t, 0); i.setFullYear(a, e, 15), i.setHours(0, 0, 0, 0); const s = Fr(i); return r.setMonth(e, Math.min(o, s)), r; } function Gr(t, e, n) { const r = Y(t, n == null ? void 0 : n.in); return isNaN(+r) ? _(t, NaN) : (r.setFullYear(e), r); } const st = 5, Rr = 4; function zr(t, e) { const n = e.startOfMonth(t), r = n.getDay() > 0 ? n.getDay() : 7, a = e.addDays(t, -r + 1), o = e.addDays(a, st * 7 - 1); return e.getMonth(t) === e.getMonth(o) ? st : Rr; } function Wt(t, e) { const n = e.startOfMonth(t), r = n.getDay(); return r === 1 ? n : r === 0 ? e.addDays(n, -1 * 6) : e.addDays(n, -1 * (r - 1)); } function Zr(t, e) { const n = Wt(t, e), r = zr(t, e); return e.addDays(n, r * 7 - 1); } class ee { /** * Creates an instance of `DateLib`. * * @param options Configuration options for the date library. * @param overrides Custom overrides for the date library functions. */ constructor(e, n) { this.Date = Date, this.today = () => { var r; return (r = this.overrides) != null && r.today ? this.overrides.today() : this.options.timeZone ? I.tz(this.options.timeZone) : new this.Date(); }, this.newDate = (r, a, o) => { var i; return (i = this.overrides) != null && i.newDate ? this.overrides.newDate(r, a, o) : this.options.timeZone ? new I(r, a, o, this.options.timeZone) : new Date(r, a, o); }, this.addDays = (r, a) => { var o; return (o = this.overrides) != null && o.addDays ? this.overrides.addDays(r, a) : ht(r, a); }, this.addMonths = (r, a) => { var o; return (o = this.overrides) != null && o.addMonths ? this.overrides.addMonths(r, a) : mt(r, a); }, this.addWeeks = (r, a) => { var o; return (o = this.overrides) != null && o.addWeeks ? this.overrides.addWeeks(r, a) : Nn(r, a); }, this.addYears = (r, a) => { var o; return (o = this.overrides) != null && o.addYears ? this.overrides.addYears(r, a) : Sn(r, a); }, this.differenceInCalendarDays = (r, a) => { var o; return (o = this.overrides) != null && o.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, a) : gt(r, a); }, this.differenceInCalendarMonths = (r, a) => { var o; return (o = this.overrides) != null && o.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, a) : En(r, a); }, this.eachMonthOfInterval = (r) => { var a; return (a = this.overrides) != null && a.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : Fn(r); }, this.endOfBroadcastWeek = (r) => { var a; return (a = this.overrides) != null && a.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : Zr(r, this); }, this.endOfISOWeek = (r) => { var a; return (a = this.overrides) != null && a.endOfISOWeek ? this.overrides.endOfISOWeek(r) : Hn(r); }, this.endOfMonth = (r) => { var a; return (a = this.overrides) != null && a.endOfMonth ? this.overrides.endOfMonth(r) : Pn(r); }, this.endOfWeek = (r, a) => { var o; return (o = this.overrides) != null && o.endOfWeek ? this.overrides.endOfWeek(r, a) : Mt(r, this.options); }, this.endOfYear = (r) => { var a; return (a = this.overrides) != null && a.endOfYear ? this.overrides.endOfYear(r) : In(r); }, this.format = (r, a, o) => { var s; const i = (s = this.overrides) != null && s.format ? this.overrides.format(r, a, this.options) : Pr(r, a, this.options); return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i; }, this.getISOWeek = (r) => { var a; return (a = this.overrides) != null && a.getISOWeek ? this.overrides.getISOWeek(r) : kt(r); }, this.getMonth = (r, a) => { var o; return (o = this.overrides) != null && o.getMonth ? this.overrides.getMonth(r, this.options) : Br(r, this.options); }, this.getYear = (r, a) => { var o; return (o = this.overrides) != null && o.getYear ? this.overrides.getYear(r, this.options) : Ir(r, this.options); }, this.getWeek = (r, a) => { var o; return (o = this.overrides) != null && o.getWeek ? this.overrides.getWeek(r, this.options) : vt(r, this.options); }, this.isAfter = (r, a) => { var o; return (o = this.overrides) != null && o.isAfter ? this.overrides.isAfter(r, a) : Hr(r, a); }, this.isBefore = (r, a) => { var o; return (o = this.overrides) != null && o.isBefore ? this.overrides.isBefore(r, a) : qr(r, a); }, this.isDate = (r) => { var a; return (a = this.overrides) != null && a.isDate ? this.overrides.isDate(r) : wt(r); }, this.isSameDay = (r, a) => { var o; return (o = this.overrides) != null && o.isSameDay ? this.overrides.isSameDay(r, a) : Yn(r, a); }, this.isSameMonth = (r, a) => { var o; return (o = this.overrides) != null && o.isSameMonth ? this.overrides.isSameMonth(r, a) : Ar(r, a); }, this.isSameYear = (r, a) => { var o; return (o = this.overrides) != null && o.isSameYear ? this.overrides.isSameYear(r, a) : jr(r, a); }, this.max = (r) => { var a; return (a = this.overrides) != null && a.max ? this.overrides.max(r) : Cn(r); }, this.min = (r) => { var a; return (a = this.overrides) != null && a.min ? this.overrides.min(r) : xn(r); }, this.setMonth = (r, a) => { var o; return (o = this.