@qikdev/vue-ui
Version:
Vue UI component library
1,862 lines • 1.41 MB
JavaScript
(function (E, t) {
typeof exports == "object" && typeof module < "u"
? t(exports, require("vue"), require("@qikdev/sdk"))
: typeof define == "function" && define.amd
? define(["exports", "vue", "@qikdev/sdk"], t)
: ((E = typeof globalThis < "u" ? globalThis : E || self),
t((E["@qikdev/vue-ui"] = {}), E.Vue, E.sdk));
})(this, function (E, t, El) {
"use strict";
const wm = "0.2.326";
class ft extends Error {}
class Cm extends ft {
constructor(n) {
super(`Invalid DateTime: ${n.toMessage()}`);
}
}
class Vm extends ft {
constructor(n) {
super(`Invalid Interval: ${n.toMessage()}`);
}
}
class Nm extends ft {
constructor(n) {
super(`Invalid Duration: ${n.toMessage()}`);
}
}
class zt extends ft {}
class Tl extends ft {
constructor(n) {
super(`Invalid unit ${n}`);
}
}
class Se extends ft {}
class et extends ft {
constructor() {
super("Zone is an abstract class");
}
}
const S = "numeric",
Ie = "short",
Ce = "long",
mr = { year: S, month: S, day: S },
Dl = { year: S, month: Ie, day: S },
Bm = { year: S, month: Ie, day: S, weekday: Ie },
Ol = { year: S, month: Ce, day: S },
Fl = { year: S, month: Ce, day: S, weekday: Ce },
Ml = { hour: S, minute: S },
Il = { hour: S, minute: S, second: S },
Ll = { hour: S, minute: S, second: S, timeZoneName: Ie },
Al = { hour: S, minute: S, second: S, timeZoneName: Ce },
$l = { hour: S, minute: S, hourCycle: "h23" },
Ul = { hour: S, minute: S, second: S, hourCycle: "h23" },
Rl = { hour: S, minute: S, second: S, hourCycle: "h23", timeZoneName: Ie },
Pl = { hour: S, minute: S, second: S, hourCycle: "h23", timeZoneName: Ce },
jl = { year: S, month: S, day: S, hour: S, minute: S },
ql = { year: S, month: S, day: S, hour: S, minute: S, second: S },
zl = { year: S, month: Ie, day: S, hour: S, minute: S },
Hl = { year: S, month: Ie, day: S, hour: S, minute: S, second: S },
Sm = { year: S, month: Ie, day: S, weekday: Ie, hour: S, minute: S },
Wl = { year: S, month: Ce, day: S, hour: S, minute: S, timeZoneName: Ie },
Jl = {
year: S,
month: Ce,
day: S,
hour: S,
minute: S,
second: S,
timeZoneName: Ie,
},
Gl = {
year: S,
month: Ce,
day: S,
weekday: Ce,
hour: S,
minute: S,
timeZoneName: Ce,
},
Kl = {
year: S,
month: Ce,
day: S,
weekday: Ce,
hour: S,
minute: S,
second: S,
timeZoneName: Ce,
};
function z(e) {
return typeof e > "u";
}
function ht(e) {
return typeof e == "number";
}
function bn(e) {
return typeof e == "number" && e % 1 === 0;
}
function Em(e) {
return typeof e == "string";
}
function Tm(e) {
return Object.prototype.toString.call(e) === "[object Date]";
}
function Yl() {
try {
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
} catch {
return !1;
}
}
function Dm(e) {
return Array.isArray(e) ? e : [e];
}
function Zl(e, n, r) {
if (e.length !== 0)
return e.reduce((i, l) => {
const o = [n(l), l];
return i && r(i[0], o[0]) === i[0] ? i : o;
}, null)[1];
}
function Om(e, n) {
return n.reduce((r, i) => ((r[i] = e[i]), r), {});
}
function St(e, n) {
return Object.prototype.hasOwnProperty.call(e, n);
}
function Ge(e, n, r) {
return bn(e) && e >= n && e <= r;
}
function Fm(e, n) {
return e - n * Math.floor(e / n);
}
function se(e, n = 2) {
const r = e < 0;
let i;
return (
r
? (i = "-" + ("" + -e).padStart(n, "0"))
: (i = ("" + e).padStart(n, "0")),
i
);
}
function tt(e) {
if (!(z(e) || e === null || e === "")) return parseInt(e, 10);
}
function pt(e) {
if (!(z(e) || e === null || e === "")) return parseFloat(e);
}
function fr(e) {
if (!(z(e) || e === null || e === "")) {
const n = parseFloat("0." + e) * 1e3;
return Math.floor(n);
}
}
function hr(e, n, r = !1) {
const i = 10 ** n;
return (r ? Math.trunc : Math.round)(e * i) / i;
}
function Ht(e) {
return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
}
function Wt(e) {
return Ht(e) ? 366 : 365;
}
function xn(e, n) {
const r = Fm(n - 1, 12) + 1,
i = e + (n - r) / 12;
return r === 2
? Ht(i)
? 29
: 28
: [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][r - 1];
}
function pr(e) {
let n = Date.UTC(
e.year,
e.month - 1,
e.day,
e.hour,
e.minute,
e.second,
e.millisecond,
);
return (
e.year < 100 &&
e.year >= 0 &&
((n = new Date(n)), n.setUTCFullYear(n.getUTCFullYear() - 1900)),
+n
);
}
function wn(e) {
const n =
(e + Math.floor(e / 4) - Math.floor(e / 100) + Math.floor(e / 400)) % 7,
r = e - 1,
i =
(r + Math.floor(r / 4) - Math.floor(r / 100) + Math.floor(r / 400)) % 7;
return n === 4 || i === 3 ? 53 : 52;
}
function yr(e) {
return e > 99 ? e : e > 60 ? 1900 + e : 2e3 + e;
}
function Xl(e, n, r, i = null) {
const l = new Date(e),
o = {
hourCycle: "h23",
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
};
i && (o.timeZone = i);
const a = { timeZoneName: n, ...o },
s = new Intl.DateTimeFormat(r, a)
.formatToParts(l)
.find((c) => c.type.toLowerCase() === "timezonename");
return s ? s.value : null;
}
function Cn(e, n) {
let r = parseInt(e, 10);
Number.isNaN(r) && (r = 0);
const i = parseInt(n, 10) || 0,
l = r < 0 || Object.is(r, -0) ? -i : i;
return r * 60 + l;
}
function Ql(e) {
const n = Number(e);
if (typeof e == "boolean" || e === "" || Number.isNaN(n))
throw new Se(`Invalid unit value ${e}`);
return n;
}
function Vn(e, n) {
const r = {};
for (const i in e)
if (St(e, i)) {
const l = e[i];
if (l == null) continue;
r[n(i)] = Ql(l);
}
return r;
}
function Nn(e, n) {
const r = Math.trunc(Math.abs(e / 60)),
i = Math.trunc(Math.abs(e % 60)),
l = e >= 0 ? "+" : "-";
switch (n) {
case "short":
return `${l}${se(r, 2)}:${se(i, 2)}`;
case "narrow":
return `${l}${r}${i > 0 ? `:${i}` : ""}`;
case "techie":
return `${l}${se(r, 2)}${se(i, 2)}`;
default:
throw new RangeError(
`Value format ${n} is out of range for property format`,
);
}
}
function Bn(e) {
return Om(e, ["hour", "minute", "second", "millisecond"]);
}
const Mm =
/[A-Za-z_+-]{1,256}(:?\/[A-Za-z0-9_+-]{1,256}(\/[A-Za-z0-9_+-]{1,256})?)?/,
Im = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
vl = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
Lm = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
function ea(e) {
switch (e) {
case "narrow":
return [...Lm];
case "short":
return [...vl];
case "long":
return [...Im];
case "numeric":
return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
case "2-digit":
return [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12",
];
default:
return null;
}
}
const ta = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
],
na = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
Am = ["M", "T", "W", "T", "F", "S", "S"];
function ra(e) {
switch (e) {
case "narrow":
return [...Am];
case "short":
return [...na];
case "long":
return [...ta];
case "numeric":
return ["1", "2", "3", "4", "5", "6", "7"];
default:
return null;
}
}
const oa = ["AM", "PM"],
$m = ["Before Christ", "Anno Domini"],
Um = ["BC", "AD"],
Rm = ["B", "A"];
function ia(e) {
switch (e) {
case "narrow":
return [...Rm];
case "short":
return [...Um];
case "long":
return [...$m];
default:
return null;
}
}
function Pm(e) {
return oa[e.hour < 12 ? 0 : 1];
}
function jm(e, n) {
return ra(n)[e.weekday - 1];
}
function qm(e, n) {
return ea(n)[e.month - 1];
}
function zm(e, n) {
return ia(n)[e.year < 0 ? 0 : 1];
}
function Hm(e, n, r = "always", i = !1) {
const l = {
years: ["year", "yr."],
quarters: ["quarter", "qtr."],
months: ["month", "mo."],
weeks: ["week", "wk."],
days: ["day", "day", "days"],
hours: ["hour", "hr."],
minutes: ["minute", "min."],
seconds: ["second", "sec."],
},
o = ["hours", "minutes", "seconds"].indexOf(e) === -1;
if (r === "auto" && o) {
const m = e === "days";
switch (n) {
case 1:
return m ? "tomorrow" : `next ${l[e][0]}`;
case -1:
return m ? "yesterday" : `last ${l[e][0]}`;
case 0:
return m ? "today" : `this ${l[e][0]}`;
}
}
const a = Object.is(n, -0) || n < 0,
s = Math.abs(n),
c = s === 1,
d = l[e],
u = i ? (c ? d[1] : d[2] || d[1]) : c ? l[e][0] : e;
return a ? `${s} ${u} ago` : `in ${s} ${u}`;
}
function la(e, n) {
let r = "";
for (const i of e) i.literal ? (r += i.val) : (r += n(i.val));
return r;
}
const Wm = {
D: mr,
DD: Dl,
DDD: Ol,
DDDD: Fl,
t: Ml,
tt: Il,
ttt: Ll,
tttt: Al,
T: $l,
TT: Ul,
TTT: Rl,
TTTT: Pl,
f: jl,
ff: zl,
fff: Wl,
ffff: Gl,
F: ql,
FF: Hl,
FFF: Jl,
FFFF: Kl,
};
class xe {
static create(n, r = {}) {
return new xe(n, r);
}
static parseFormat(n) {
let r = null,
i = "",
l = !1;
const o = [];
for (let a = 0; a < n.length; a++) {
const s = n.charAt(a);
s === "'"
? (i.length > 0 && o.push({ literal: l, val: i }),
(r = null),
(i = ""),
(l = !l))
: l || s === r
? (i += s)
: (i.length > 0 && o.push({ literal: !1, val: i }),
(i = s),
(r = s));
}
return i.length > 0 && o.push({ literal: l, val: i }), o;
}
static macroTokenToFormatOpts(n) {
return Wm[n];
}
constructor(n, r) {
(this.opts = r), (this.loc = n), (this.systemLoc = null);
}
formatWithSystemDefault(n, r) {
return (
this.systemLoc === null &&
(this.systemLoc = this.loc.redefaultToSystem()),
this.systemLoc.dtFormatter(n, { ...this.opts, ...r }).format()
);
}
formatDateTime(n, r = {}) {
return this.loc.dtFormatter(n, { ...this.opts, ...r }).format();
}
formatDateTimeParts(n, r = {}) {
return this.loc.dtFormatter(n, { ...this.opts, ...r }).formatToParts();
}
resolvedOptions(n, r = {}) {
return this.loc.dtFormatter(n, { ...this.opts, ...r }).resolvedOptions();
}
num(n, r = 0) {
if (this.opts.forceSimple) return se(n, r);
const i = { ...this.opts };
return r > 0 && (i.padTo = r), this.loc.numberFormatter(i).format(n);
}
formatDateTimeFromString(n, r) {
const i = this.loc.listingMode() === "en",
l = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory",
o = (h, p) => this.loc.extract(n, h, p),
a = (h) =>
n.isOffsetFixed && n.offset === 0 && h.allowZ
? "Z"
: n.isValid
? n.zone.formatOffset(n.ts, h.format)
: "",
s = () =>
i ? Pm(n) : o({ hour: "numeric", hourCycle: "h12" }, "dayperiod"),
c = (h, p) =>
i
? qm(n, h)
: o(p ? { month: h } : { month: h, day: "numeric" }, "month"),
d = (h, p) =>
i
? jm(n, h)
: o(
p
? { weekday: h }
: { weekday: h, month: "long", day: "numeric" },
"weekday",
),
u = (h) => {
const p = xe.macroTokenToFormatOpts(h);
return p ? this.formatWithSystemDefault(n, p) : h;
},
m = (h) => (i ? zm(n, h) : o({ era: h }, "era")),
f = (h) => {
switch (h) {
case "S":
return this.num(n.millisecond);
case "u":
case "SSS":
return this.num(n.millisecond, 3);
case "s":
return this.num(n.second);
case "ss":
return this.num(n.second, 2);
case "uu":
return this.num(Math.floor(n.millisecond / 10), 2);
case "uuu":
return this.num(Math.floor(n.millisecond / 100));
case "m":
return this.num(n.minute);
case "mm":
return this.num(n.minute, 2);
case "h":
return this.num(n.hour % 12 === 0 ? 12 : n.hour % 12);
case "hh":
return this.num(n.hour % 12 === 0 ? 12 : n.hour % 12, 2);
case "H":
return this.num(n.hour);
case "HH":
return this.num(n.hour, 2);
case "Z":
return a({ format: "narrow", allowZ: this.opts.allowZ });
case "ZZ":
return a({ format: "short", allowZ: this.opts.allowZ });
case "ZZZ":
return a({ format: "techie", allowZ: this.opts.allowZ });
case "ZZZZ":
return n.zone.offsetName(n.ts, {
format: "short",
locale: this.loc.locale,
});
case "ZZZZZ":
return n.zone.offsetName(n.ts, {
format: "long",
locale: this.loc.locale,
});
case "z":
return n.zoneName;
case "a":
return s();
case "d":
return l ? o({ day: "numeric" }, "day") : this.num(n.day);
case "dd":
return l ? o({ day: "2-digit" }, "day") : this.num(n.day, 2);
case "c":
return this.num(n.weekday);
case "ccc":
return d("short", !0);
case "cccc":
return d("long", !0);
case "ccccc":
return d("narrow", !0);
case "E":
return this.num(n.weekday);
case "EEE":
return d("short", !1);
case "EEEE":
return d("long", !1);
case "EEEEE":
return d("narrow", !1);
case "L":
return l
? o({ month: "numeric", day: "numeric" }, "month")
: this.num(n.month);
case "LL":
return l
? o({ month: "2-digit", day: "numeric" }, "month")
: this.num(n.month, 2);
case "LLL":
return c("short", !0);
case "LLLL":
return c("long", !0);
case "LLLLL":
return c("narrow", !0);
case "M":
return l ? o({ month: "numeric" }, "month") : this.num(n.month);
case "MM":
return l
? o({ month: "2-digit" }, "month")
: this.num(n.month, 2);
case "MMM":
return c("short", !1);
case "MMMM":
return c("long", !1);
case "MMMMM":
return c("narrow", !1);
case "y":
return l ? o({ year: "numeric" }, "year") : this.num(n.year);
case "yy":
return l
? o({ year: "2-digit" }, "year")
: this.num(n.year.toString().slice(-2), 2);
case "yyyy":
return l ? o({ year: "numeric" }, "year") : this.num(n.year, 4);
case "yyyyyy":
return l ? o({ year: "numeric" }, "year") : this.num(n.year, 6);
case "G":
return m("short");
case "GG":
return m("long");
case "GGGGG":
return m("narrow");
case "kk":
return this.num(n.weekYear.toString().slice(-2), 2);
case "kkkk":
return this.num(n.weekYear, 4);
case "W":
return this.num(n.weekNumber);
case "WW":
return this.num(n.weekNumber, 2);
case "o":
return this.num(n.ordinal);
case "ooo":
return this.num(n.ordinal, 3);
case "q":
return this.num(n.quarter);
case "qq":
return this.num(n.quarter, 2);
case "X":
return this.num(Math.floor(n.ts / 1e3));
case "x":
return this.num(n.ts);
default:
return u(h);
}
};
return la(xe.parseFormat(r), f);
}
formatDurationFromString(n, r) {
const i = (c) => {
switch (c[0]) {
case "S":
return "millisecond";
case "s":
return "second";
case "m":
return "minute";
case "h":
return "hour";
case "d":
return "day";
case "w":
return "week";
case "M":
return "month";
case "y":
return "year";
default:
return null;
}
},
l = (c) => (d) => {
const u = i(d);
return u ? this.num(c.get(u), d.length) : d;
},
o = xe.parseFormat(r),
a = o.reduce((c, { literal: d, val: u }) => (d ? c : c.concat(u)), []),
s = n.shiftTo(...a.map(i).filter((c) => c));
return la(o, l(s));
}
}
class Le {
constructor(n, r) {
(this.reason = n), (this.explanation = r);
}
toMessage() {
return this.explanation
? `${this.reason}: ${this.explanation}`
: this.reason;
}
}
class Jt {
get type() {
throw new et();
}
get name() {
throw new et();
}
get isUniversal() {
throw new et();
}
offsetName(n, r) {
throw new et();
}
formatOffset(n, r) {
throw new et();
}
offset(n) {
throw new et();
}
equals(n) {
throw new et();
}
get isValid() {
throw new et();
}
}
let gr = null;
class kr extends Jt {
static get instance() {
return gr === null && (gr = new kr()), gr;
}
get type() {
return "system";
}
get name() {
return new Intl.DateTimeFormat().resolvedOptions().timeZone;
}
get isUniversal() {
return !1;
}
offsetName(n, { format: r, locale: i }) {
return Xl(n, r, i);
}
formatOffset(n, r) {
return Nn(this.offset(n), r);
}
offset(n) {
return -new Date(n).getTimezoneOffset();
}
equals(n) {
return n.type === "system";
}
get isValid() {
return !0;
}
}
let Sn = {};
function Jm(e) {
return (
Sn[e] ||
(Sn[e] = new Intl.DateTimeFormat("en-US", {
hour12: !1,
timeZone: e,
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
era: "short",
})),
Sn[e]
);
}
const Gm = {
year: 0,
month: 1,
day: 2,
era: 3,
hour: 4,
minute: 5,
second: 6,
};
function Km(e, n) {
const r = e.format(n).replace(/\u200E/g, ""),
i = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),
[, l, o, a, s, c, d, u] = i;
return [a, l, o, s, c, d, u];
}
function Ym(e, n) {
const r = e.formatToParts(n),
i = [];
for (let l = 0; l < r.length; l++) {
const { type: o, value: a } = r[l],
s = Gm[o];
o === "era" ? (i[s] = a) : z(s) || (i[s] = parseInt(a, 10));
}
return i;
}
let En = {};
class Ke extends Jt {
static create(n) {
return En[n] || (En[n] = new Ke(n)), En[n];
}
static resetCache() {
(En = {}), (Sn = {});
}
static isValidSpecifier(n) {
return this.isValidZone(n);
}
static isValidZone(n) {
if (!n) return !1;
try {
return new Intl.DateTimeFormat("en-US", { timeZone: n }).format(), !0;
} catch {
return !1;
}
}
constructor(n) {
super(), (this.zoneName = n), (this.valid = Ke.isValidZone(n));
}
get type() {
return "iana";
}
get name() {
return this.zoneName;
}
get isUniversal() {
return !1;
}
offsetName(n, { format: r, locale: i }) {
return Xl(n, r, i, this.name);
}
formatOffset(n, r) {
return Nn(this.offset(n), r);
}
offset(n) {
const r = new Date(n);
if (isNaN(r)) return NaN;
const i = Jm(this.name);
let [l, o, a, s, c, d, u] = i.formatToParts ? Ym(i, r) : Km(i, r);
s === "BC" && (l = -Math.abs(l) + 1);
const f = pr({
year: l,
month: o,
day: a,
hour: c === 24 ? 0 : c,
minute: d,
second: u,
millisecond: 0,
});
let h = +r;
const p = h % 1e3;
return (h -= p >= 0 ? p : 1e3 + p), (f - h) / (60 * 1e3);
}
equals(n) {
return n.type === "iana" && n.name === this.name;
}
get isValid() {
return this.valid;
}
}
let _r = null;
class ke extends Jt {
static get utcInstance() {
return _r === null && (_r = new ke(0)), _r;
}
static instance(n) {
return n === 0 ? ke.utcInstance : new ke(n);
}
static parseSpecifier(n) {
if (n) {
const r = n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
if (r) return new ke(Cn(r[1], r[2]));
}
return null;
}
constructor(n) {
super(), (this.fixed = n);
}
get type() {
return "fixed";
}
get name() {
return this.fixed === 0 ? "UTC" : `UTC${Nn(this.fixed, "narrow")}`;
}
offsetName() {
return this.name;
}
formatOffset(n, r) {
return Nn(this.fixed, r);
}
get isUniversal() {
return !0;
}
offset() {
return this.fixed;
}
equals(n) {
return n.type === "fixed" && n.fixed === this.fixed;
}
get isValid() {
return !0;
}
}
class Zm extends Jt {
constructor(n) {
super(), (this.zoneName = n);
}
get type() {
return "invalid";
}
get name() {
return this.zoneName;
}
get isUniversal() {
return !1;
}
offsetName() {
return null;
}
formatOffset() {
return "";
}
offset() {
return NaN;
}
equals() {
return !1;
}
get isValid() {
return !1;
}
}
function nt(e, n) {
if (z(e) || e === null) return n;
if (e instanceof Jt) return e;
if (Em(e)) {
const r = e.toLowerCase();
return r === "local" || r === "system"
? n
: r === "utc" || r === "gmt"
? ke.utcInstance
: ke.parseSpecifier(r) || Ke.create(e);
} else
return ht(e)
? ke.instance(e)
: typeof e == "object" && e.offset && typeof e.offset == "number"
? e
: new Zm(e);
}
let aa = () => Date.now(),
sa = "system",
ca = null,
da = null,
ua = null,
ma;
class me {
static get now() {
return aa;
}
static set now(n) {
aa = n;
}
static set defaultZone(n) {
sa = n;
}
static get defaultZone() {
return nt(sa, kr.instance);
}
static get defaultLocale() {
return ca;
}
static set defaultLocale(n) {
ca = n;
}
static get defaultNumberingSystem() {
return da;
}
static set defaultNumberingSystem(n) {
da = n;
}
static get defaultOutputCalendar() {
return ua;
}
static set defaultOutputCalendar(n) {
ua = n;
}
static get throwOnInvalid() {
return ma;
}
static set throwOnInvalid(n) {
ma = n;
}
static resetCaches() {
ne.resetCache(), Ke.resetCache();
}
}
let fa = {};
function Xm(e, n = {}) {
const r = JSON.stringify([e, n]);
let i = fa[r];
return i || ((i = new Intl.ListFormat(e, n)), (fa[r] = i)), i;
}
let br = {};
function xr(e, n = {}) {
const r = JSON.stringify([e, n]);
let i = br[r];
return i || ((i = new Intl.DateTimeFormat(e, n)), (br[r] = i)), i;
}
let wr = {};
function Qm(e, n = {}) {
const r = JSON.stringify([e, n]);
let i = wr[r];
return i || ((i = new Intl.NumberFormat(e, n)), (wr[r] = i)), i;
}
let Cr = {};
function vm(e, n = {}) {
const { base: r, ...i } = n,
l = JSON.stringify([e, i]);
let o = Cr[l];
return o || ((o = new Intl.RelativeTimeFormat(e, n)), (Cr[l] = o)), o;
}
let Gt = null;
function ef() {
return (
Gt || ((Gt = new Intl.DateTimeFormat().resolvedOptions().locale), Gt)
);
}
function tf(e) {
const n = e.indexOf("-u-");
if (n === -1) return [e];
{
let r;
const i = e.substring(0, n);
try {
r = xr(e).resolvedOptions();
} catch {
r = xr(i).resolvedOptions();
}
const { numberingSystem: l, calendar: o } = r;
return [i, l, o];
}
}
function nf(e, n, r) {
return (
(r || n) && ((e += "-u"), r && (e += `-ca-${r}`), n && (e += `-nu-${n}`)),
e
);
}
function rf(e) {
const n = [];
for (let r = 1; r <= 12; r++) {
const i = g.utc(2016, r, 1);
n.push(e(i));
}
return n;
}
function of(e) {
const n = [];
for (let r = 1; r <= 7; r++) {
const i = g.utc(2016, 11, 13 + r);
n.push(e(i));
}
return n;
}
function Tn(e, n, r, i, l) {
const o = e.listingMode(r);
return o === "error" ? null : o === "en" ? i(n) : l(n);
}
function lf(e) {
return e.numberingSystem && e.numberingSystem !== "latn"
? !1
: e.numberingSystem === "latn" ||
!e.locale ||
e.locale.startsWith("en") ||
new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem ===
"latn";
}
class af {
constructor(n, r, i) {
(this.padTo = i.padTo || 0), (this.floor = i.floor || !1);
const { padTo: l, floor: o, ...a } = i;
if (!r || Object.keys(a).length > 0) {
const s = { useGrouping: !1, ...i };
i.padTo > 0 && (s.minimumIntegerDigits = i.padTo),
(this.inf = Qm(n, s));
}
}
format(n) {
if (this.inf) {
const r = this.floor ? Math.floor(n) : n;
return this.inf.format(r);
} else {
const r = this.floor ? Math.floor(n) : hr(n, 3);
return se(r, this.padTo);
}
}
}
class sf {
constructor(n, r, i) {
this.opts = i;
let l;
if (n.zone.isUniversal) {
const a = -1 * (n.offset / 60),
s = a >= 0 ? `Etc/GMT+${a}` : `Etc/GMT${a}`;
n.offset !== 0 && Ke.create(s).valid
? ((l = s), (this.dt = n))
: ((l = "UTC"),
i.timeZoneName
? (this.dt = n)
: (this.dt =
n.offset === 0
? n
: g.fromMillis(n.ts + n.offset * 60 * 1e3)));
} else
n.zone.type === "system"
? (this.dt = n)
: ((this.dt = n), (l = n.zone.name));
const o = { ...this.opts };
l && (o.timeZone = l), (this.dtf = xr(r, o));
}
format() {
return this.dtf.format(this.dt.toJSDate());
}
formatToParts() {
return this.dtf.formatToParts(this.dt.toJSDate());
}
resolvedOptions() {
return this.dtf.resolvedOptions();
}
}
class cf {
constructor(n, r, i) {
(this.opts = { style: "long", ...i }),
!r && Yl() && (this.rtf = vm(n, i));
}
format(n, r) {
return this.rtf
? this.rtf.format(n, r)
: Hm(r, n, this.opts.numeric, this.opts.style !== "long");
}
formatToParts(n, r) {
return this.rtf ? this.rtf.formatToParts(n, r) : [];
}
}
class ne {
static fromOpts(n) {
return ne.create(
n.locale,
n.numberingSystem,
n.outputCalendar,
n.defaultToEN,
);
}
static create(n, r, i, l = !1) {
const o = n || me.defaultLocale,
a = o || (l ? "en-US" : ef()),
s = r || me.defaultNumberingSystem,
c = i || me.defaultOutputCalendar;
return new ne(a, s, c, o);
}
static resetCache() {
(Gt = null), (br = {}), (wr = {}), (Cr = {});
}
static fromObject({
locale: n,
numberingSystem: r,
outputCalendar: i,
} = {}) {
return ne.create(n, r, i);
}
constructor(n, r, i, l) {
const [o, a, s] = tf(n);
(this.locale = o),
(this.numberingSystem = r || a || null),
(this.outputCalendar = i || s || null),
(this.intl = nf(
this.locale,
this.numberingSystem,
this.outputCalendar,
)),
(this.weekdaysCache = { format: {}, standalone: {} }),
(this.monthsCache = { format: {}, standalone: {} }),
(this.meridiemCache = null),
(this.eraCache = {}),
(this.specifiedLocale = l),
(this.fastNumbersCached = null);
}
get fastNumbers() {
return (
this.fastNumbersCached == null && (this.fastNumbersCached = lf(this)),
this.fastNumbersCached
);
}
listingMode() {
const n = this.isEnglish(),
r =
(this.numberingSystem === null || this.numberingSystem === "latn") &&
(this.outputCalendar === null || this.outputCalendar === "gregory");
return n && r ? "en" : "intl";
}
clone(n) {
return !n || Object.getOwnPropertyNames(n).length === 0
? this
: ne.create(
n.locale || this.specifiedLocale,
n.numberingSystem || this.numberingSystem,
n.outputCalendar || this.outputCalendar,
n.defaultToEN || !1,
);
}
redefaultToEN(n = {}) {
return this.clone({ ...n, defaultToEN: !0 });
}
redefaultToSystem(n = {}) {
return this.clone({ ...n, defaultToEN: !1 });
}
months(n, r = !1, i = !0) {
return Tn(this, n, i, ea, () => {
const l = r ? { month: n, day: "numeric" } : { month: n },
o = r ? "format" : "standalone";
return (
this.monthsCache[o][n] ||
(this.monthsCache[o][n] = rf((a) => this.extract(a, l, "month"))),
this.monthsCache[o][n]
);
});
}
weekdays(n, r = !1, i = !0) {
return Tn(this, n, i, ra, () => {
const l = r
? { weekday: n, year: "numeric", month: "long", day: "numeric" }
: { weekday: n },
o = r ? "format" : "standalone";
return (
this.weekdaysCache[o][n] ||
(this.weekdaysCache[o][n] = of((a) =>
this.extract(a, l, "weekday"),
)),
this.weekdaysCache[o][n]
);
});
}
meridiems(n = !0) {
return Tn(
this,
void 0,
n,
() => oa,
() => {
if (!this.meridiemCache) {
const r = { hour: "numeric", hourCycle: "h12" };
this.meridiemCache = [
g.utc(2016, 11, 13, 9),
g.utc(2016, 11, 13, 19),
].map((i) => this.extract(i, r, "dayperiod"));
}
return this.meridiemCache;
},
);
}
eras(n, r = !0) {
return Tn(this, n, r, ia, () => {
const i = { era: n };
return (
this.eraCache[n] ||
(this.eraCache[n] = [g.utc(-40, 1, 1), g.utc(2017, 1, 1)].map((l) =>
this.extract(l, i, "era"),
)),
this.eraCache[n]
);
});
}
extract(n, r, i) {
const l = this.dtFormatter(n, r),
o = l.formatToParts(),
a = o.find((s) => s.type.toLowerCase() === i);
return a ? a.value : null;
}
numberFormatter(n = {}) {
return new af(this.intl, n.forceSimple || this.fastNumbers, n);
}
dtFormatter(n, r = {}) {
return new sf(n, this.intl, r);
}
relFormatter(n = {}) {
return new cf(this.intl, this.isEnglish(), n);
}
listFormatter(n = {}) {
return Xm(this.intl, n);
}
isEnglish() {
return (
this.locale === "en" ||
this.locale.toLowerCase() === "en-us" ||
new Intl.DateTimeFormat(this.intl)
.resolvedOptions()
.locale.startsWith("en-us")
);
}
equals(n) {
return (
this.locale === n.locale &&
this.numberingSystem === n.numberingSystem &&
this.outputCalendar === n.outputCalendar
);
}
}
function Et(...e) {
const n = e.reduce((r, i) => r + i.source, "");
return RegExp(`^${n}$`);
}
function yt(...e) {
return (n) =>
e
.reduce(
([r, i, l], o) => {
const [a, s, c] = o(n, l);
return [{ ...r, ...a }, i || s, c];
},
[{}, null, 1],
)
.slice(0, 2);
}
function Tt(e, ...n) {
if (e == null) return [null, null];
for (const [r, i] of n) {
const l = r.exec(e);
if (l) return i(l);
}
return [null, null];
}
function ha(...e) {
return (n, r) => {
const i = {};
let l;
for (l = 0; l < e.length; l++) i[e[l]] = tt(n[r + l]);
return [i, null, r + l];
};
}
const pa = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,
Vr = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,
ya = RegExp(`${Vr.source}${pa.source}?`),
Nr = RegExp(`(?:T${ya.source})?`),
df = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,
uf = /(\d{4})-?W(\d\d)(?:-?(\d))?/,
mf = /(\d{4})-?(\d{3})/,
ff = ha("weekYear", "weekNumber", "weekDay"),
hf = ha("year", "ordinal"),
pf = /(\d{4})-(\d\d)-(\d\d)/,
ga = RegExp(`${Vr.source} ?(?:${pa.source}|(${Mm.source}))?`),
yf = RegExp(`(?: ${ga.source})?`);
function Dt(e, n, r) {
const i = e[n];
return z(i) ? r : tt(i);
}
function ka(e, n) {
return [
{ year: Dt(e, n), month: Dt(e, n + 1, 1), day: Dt(e, n + 2, 1) },
null,
n + 3,
];
}
function gt(e, n) {
return [
{
hours: Dt(e, n, 0),
minutes: Dt(e, n + 1, 0),
seconds: Dt(e, n + 2, 0),
milliseconds: fr(e[n + 3]),
},
null,
n + 4,
];
}
function Ot(e, n) {
const r = !e[n] && !e[n + 1],
i = Cn(e[n + 1], e[n + 2]),
l = r ? null : ke.instance(i);
return [{}, l, n + 3];
}
function _a(e, n) {
const r = e[n] ? Ke.create(e[n]) : null;
return [{}, r, n + 1];
}
const gf = RegExp(`^T?${Vr.source}$`),
kf =
/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
function _f(e) {
const [n, r, i, l, o, a, s, c, d] = e,
u = n[0] === "-",
m = c && c[0] === "-",
f = (h, p = !1) => (h !== void 0 && (p || (h && u)) ? -h : h);
return [
{
years: f(pt(r)),
months: f(pt(i)),
weeks: f(pt(l)),
days: f(pt(o)),
hours: f(pt(a)),
minutes: f(pt(s)),
seconds: f(pt(c), c === "-0"),
milliseconds: f(fr(d), m),
},
];
}
const bf = {
GMT: 0,
EDT: -4 * 60,
EST: -5 * 60,
CDT: -5 * 60,
CST: -6 * 60,
MDT: -6 * 60,
MST: -7 * 60,
PDT: -7 * 60,
PST: -8 * 60,
};
function Br(e, n, r, i, l, o, a) {
const s = {
year: n.length === 2 ? yr(tt(n)) : tt(n),
month: vl.indexOf(r) + 1,
day: tt(i),
hour: tt(l),
minute: tt(o),
};
return (
a && (s.second = tt(a)),
e && (s.weekday = e.length > 3 ? ta.indexOf(e) + 1 : na.indexOf(e) + 1),
s
);
}
const xf =
/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
function wf(e) {
const [, n, r, i, l, o, a, s, c, d, u, m] = e,
f = Br(n, l, i, r, o, a, s);
let h;
return c ? (h = bf[c]) : d ? (h = 0) : (h = Cn(u, m)), [f, new ke(h)];
}
function Cf(e) {
return e
.replace(/\([^)]*\)|[\n\t]/g, " ")
.replace(/(\s\s+)/g, " ")
.trim();
}
const Vf =
/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,
Nf =
/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,
Bf =
/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
function ba(e) {
const [, n, r, i, l, o, a, s] = e;
return [Br(n, l, i, r, o, a, s), ke.utcInstance];
}
function Sf(e) {
const [, n, r, i, l, o, a, s] = e;
return [Br(n, s, r, i, l, o, a), ke.utcInstance];
}
const Ef = Et(df, Nr),
Tf = Et(uf, Nr),
Df = Et(mf, Nr),
Of = Et(ya),
Ff = yt(ka, gt, Ot),
Mf = yt(ff, gt, Ot),
If = yt(hf, gt, Ot),
Lf = yt(gt, Ot);
function Af(e) {
return Tt(e, [Ef, Ff], [Tf, Mf], [Df, If], [Of, Lf]);
}
function $f(e) {
return Tt(Cf(e), [xf, wf]);
}
function Uf(e) {
return Tt(e, [Vf, ba], [Nf, ba], [Bf, Sf]);
}
function Rf(e) {
return Tt(e, [kf, _f]);
}
const Pf = yt(gt);
function jf(e) {
return Tt(e, [gf, Pf]);
}
const qf = Et(pf, yf),
zf = Et(ga),
Hf = yt(ka, gt, Ot, _a),
Wf = yt(gt, Ot, _a);
function Jf(e) {
return Tt(e, [qf, Hf], [zf, Wf]);
}
const Gf = "Invalid Duration",
xa = {
weeks: {
days: 7,
hours: 7 * 24,
minutes: 7 * 24 * 60,
seconds: 7 * 24 * 60 * 60,
milliseconds: 7 * 24 * 60 * 60 * 1e3,
},
days: {
hours: 24,
minutes: 24 * 60,
seconds: 24 * 60 * 60,
milliseconds: 24 * 60 * 60 * 1e3,
},
hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
minutes: { seconds: 60, milliseconds: 60 * 1e3 },
seconds: { milliseconds: 1e3 },
},
Kf = {
years: {
quarters: 4,
months: 12,
weeks: 52,
days: 365,
hours: 365 * 24,
minutes: 365 * 24 * 60,
seconds: 365 * 24 * 60 * 60,
milliseconds: 365 * 24 * 60 * 60 * 1e3,
},
quarters: {
months: 3,
weeks: 13,
days: 91,
hours: 91 * 24,
minutes: 91 * 24 * 60,
seconds: 91 * 24 * 60 * 60,
milliseconds: 91 * 24 * 60 * 60 * 1e3,
},
months: {
weeks: 4,
days: 30,
hours: 30 * 24,
minutes: 30 * 24 * 60,
seconds: 30 * 24 * 60 * 60,
milliseconds: 30 * 24 * 60 * 60 * 1e3,
},
...xa,
},
Ee = 146097 / 400,
Ft = 146097 / 4800,
Yf = {
years: {
quarters: 4,
months: 12,
weeks: Ee / 7,
days: Ee,
hours: Ee * 24,
minutes: Ee * 24 * 60,
seconds: Ee * 24 * 60 * 60,
milliseconds: Ee * 24 * 60 * 60 * 1e3,
},
quarters: {
months: 3,
weeks: Ee / 28,
days: Ee / 4,
hours: (Ee * 24) / 4,
minutes: (Ee * 24 * 60) / 4,
seconds: (Ee * 24 * 60 * 60) / 4,
milliseconds: (Ee * 24 * 60 * 60 * 1e3) / 4,
},
months: {
weeks: Ft / 7,
days: Ft,
hours: Ft * 24,
minutes: Ft * 24 * 60,
seconds: Ft * 24 * 60 * 60,
milliseconds: Ft * 24 * 60 * 60 * 1e3,
},
...xa,
},
kt = [
"years",
"quarters",
"months",
"weeks",
"days",
"hours",
"minutes",
"seconds",
"milliseconds",
],
Zf = kt.slice(0).reverse();
function _t(e, n, r = !1) {
const i = {
values: r ? n.values : { ...e.values, ...(n.values || {}) },
loc: e.loc.clone(n.loc),
conversionAccuracy: n.conversionAccuracy || e.conversionAccuracy,
};
return new W(i);
}
function Xf(e) {
return e < 0 ? Math.floor(e) : Math.ceil(e);
}
function wa(e, n, r, i, l) {
const o = e[l][r],
a = n[r] / o,
s = Math.sign(a) === Math.sign(i[l]),
c = !s && i[l] !== 0 && Math.abs(a) <= 1 ? Xf(a) : Math.trunc(a);
(i[l] += c), (n[r] -= c * o);
}
function Qf(e, n) {
Zf.reduce((r, i) => (z(n[i]) ? r : (r && wa(e, n, r, n, i), i)), null);
}
class W {
constructor(n) {
const r = n.conversionAccuracy === "longterm" || !1;
(this.values = n.values),
(this.loc = n.loc || ne.create()),
(this.conversionAccuracy = r ? "longterm" : "casual"),
(this.invalid = n.invalid || null),
(this.matrix = r ? Yf : Kf),
(this.isLuxonDuration = !0);
}
static fromMillis(n, r) {
return W.fromObject({ milliseconds: n }, r);
}
static fromObject(n, r = {}) {
if (n == null || typeof n != "object")
throw new Se(
`Duration.fromObject: argument expected to be an object, got ${n === null ? "null" : typeof n}`,
);
return new W({
values: Vn(n, W.normalizeUnit),
loc: ne.fromObject(r),
conversionAccuracy: r.conversionAccuracy,
});
}
static fromDurationLike(n) {
if (ht(n)) return W.fromMillis(n);
if (W.isDuration(n)) return n;
if (typeof n == "object") return W.fromObject(n);
throw new Se(`Unknown duration argument ${n} of type ${typeof n}`);
}
static fromISO(n, r) {
const [i] = Rf(n);
return i
? W.fromObject(i, r)
: W.invalid(
"unparsable",
`the input "${n}" can't be parsed as ISO 8601`,
);
}
static fromISOTime(n, r) {
const [i] = jf(n);
return i
? W.fromObject(i, r)
: W.invalid(
"unparsable",
`the input "${n}" can't be parsed as ISO 8601`,
);
}
static invalid(n, r = null) {
if (!n) throw new Se("need to specify a reason the Duration is invalid");
const i = n instanceof Le ? n : new Le(n, r);
if (me.throwOnInvalid) throw new Nm(i);
return new W({ invalid: i });
}
static normalizeUnit(n) {
const r = {
year: "years",
years: "years",
quarter: "quarters",
quarters: "quarters",
month: "months",
months: "months",
week: "weeks",
weeks: "weeks",
day: "days",
days: "days",
hour: "hours",
hours: "hours",
minute: "minutes",
minutes: "minutes",
second: "seconds",
seconds: "seconds",
millisecond: "milliseconds",
milliseconds: "milliseconds",
}[n && n.toLowerCase()];
if (!r) throw new Tl(n);
return r;
}
static isDuration(n) {
return (n && n.isLuxonDuration) || !1;
}
get locale() {
return this.isValid ? this.loc.locale : null;
}
get numberingSystem() {
return this.isValid ? this.loc.numberingSystem : null;
}
toFormat(n, r = {}) {
const i = { ...r, floor: r.round !== !1 && r.floor !== !1 };
return this.isValid
? xe.create(this.loc, i).formatDurationFromString(this, n)
: Gf;
}
toHuman(n = {}) {
const r = kt
.map((i) => {
const l = this.values[i];
return z(l)
? null
: this.loc
.numberFormatter({
style: "unit",
unitDisplay: "long",
...n,
unit: i.slice(0, -1),
})
.format(l);
})
.filter((i) => i);
return this.loc
.listFormatter({
type: "conjunction",
style: n.listStyle || "narrow",
...n,
})
.format(r);
}
toObject() {
return this.isValid ? { ...this.values } : {};
}
toISO() {
if (!this.isValid) return null;
let n = "P";
return (
this.years !== 0 && (n += this.years + "Y"),
(this.months !== 0 || this.quarters !== 0) &&
(n += this.months + this.quarters * 3 + "M"),
this.weeks !== 0 && (n += this.weeks + "W"),
this.days !== 0 && (n += this.days + "D"),
(this.hours !== 0 ||
this.minutes !== 0 ||
this.seconds !== 0 ||
this.milliseconds !== 0) &&
(n += "T"),
this.hours !== 0 && (n += this.hours + "H"),
this.minutes !== 0 && (n += this.minutes + "M"),
(this.seconds !== 0 || this.milliseconds !== 0) &&
(n += hr(this.seconds + this.milliseconds / 1e3, 3) + "S"),
n === "P" && (n += "T0S"),
n
);
}
toISOTime(n = {}) {
if (!this.isValid) return null;
const r = this.toMillis();
if (r < 0 || r >= 864e5) return null;
n = {
suppressMilliseconds: !1,
suppressSeconds: !1,
includePrefix: !1,
format: "extended",
...n,
};
const i = this.shiftTo("hours", "minutes", "seconds", "milliseconds");
let l = n.format === "basic" ? "hhmm" : "hh:mm";
(!n.suppressSeconds || i.seconds !== 0 || i.milliseconds !== 0) &&
((l += n.format === "basic" ? "ss" : ":ss"),
(!n.suppressMilliseconds || i.milliseconds !== 0) && (l += ".SSS"));
let o = i.toFormat(l);
return n.includePrefix && (o = "T" + o), o;
}
toJSON() {
return this.toISO();
}
toString() {
return this.toISO();
}
toMillis() {
return this.as("milliseconds");
}
valueOf() {
return this.toMillis();
}
plus(n) {
if (!this.isValid) return this;
const r = W.fromDurationLike(n),
i = {};
for (const l of kt)
(St(r.values, l) || St(this.values, l)) &&
(i[l] = r.get(l) + this.get(l));
return _t(this, { values: i }, !0);
}
minus(n) {
if (!this.isValid) return this;
const r = W.fromDurationLike(n);
return this.plus(r.negate());
}
mapUnits(n) {
if (!this.isValid) return this;
const r = {};
for (const i of Object.keys(this.values)) r[i] = Ql(n(this.values[i], i));
return _t(this, { values: r }, !0);
}
get(n) {
return this[W.normalizeUnit(n)];
}
set(n) {
if (!this.isValid) return this;
const r = { ...this.values, ...Vn(n, W.normalizeUnit) };
return _t(this, { values: r });
}
reconfigure({ locale: n, numberingSystem: r, conversionAccuracy: i } = {}) {
const l = this.loc.clone({ locale: n, numberingSystem: r }),
o = { loc: l };
return i && (o.conversionAccuracy = i), _t(this, o);
}
as(n) {
return this.isValid ? this.shiftTo(n).get(n) : NaN;
}
normalize() {
if (!this.isValid) return this;
const n = this.toObject();
return Qf(this.matrix, n), _t(this, { values: n }, !0);
}
shiftTo(...n) {
if (!this.isValid) return this;
if (n.length === 0) return this;
n = n.map((a) => W.normalizeUnit(a));
const r = {},
i = {},
l = this.toObject();
let o;
for (const a of kt)
if (n.indexOf(a) >= 0) {
o = a;
let s = 0;
for (const d in i) (s += this.matrix[d][a] * i[d]), (i[d] = 0);
ht(l[a]) && (s += l[a]);
const c = Math.trunc(s);
(r[a] = c), (i[a] = (s * 1e3 - c * 1e3) / 1e3);
for (const d in l)
kt.indexOf(d) > kt.indexOf(a) && wa(this.matrix, l, d, r, a);
} else ht(l[a]) && (i[a] = l[a]);
for (const a in i)
i[a] !== 0 && (r[o] += a === o ? i[a] : i[a] / this.matrix[o][a]);
return _t(this, { values: r }, !0).normalize();
}
negate() {
if (!this.isValid) return this;
const n = {};
for (const r of Object.keys(this.values))
n[r] = this.values[r] === 0 ? 0 : -this.values[r];
return _t(this, { values: n }, !0);
}
get years() {
return this.isValid ? this.values.years || 0 : NaN;
}
get quarters() {
return this.isValid ? this.values.quarters || 0 : NaN;
}
get months() {
return this.isValid ? this.values.months || 0 : NaN;
}
get weeks() {
return this.isValid ? this.values.weeks || 0 : NaN;
}
get days() {
return this.isValid ? this.values.days || 0 : NaN;
}
get hours() {
return this.isValid ? this.values.hours || 0 : NaN;
}
get minutes() {
return this.isValid ? this.values.minutes || 0 : NaN;
}
get seconds() {
return this.isValid ? this.values.seconds |