@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,829 lines • 420 kB
JavaScript
var Zo = Object.defineProperty;
var er = (t, n, e) => n in t ? Zo(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
var D = (t, n, e) => er(t, typeof n != "symbol" ? n + "" : n, e);
import { ref as w, defineComponent as je, watch as ve, computed as L, onMounted as lt, createVNode as M, createTextVNode as vt, mergeProps as gt, Teleport as An, createApp as bn, onUnmounted as zt, Fragment as Nt, onBeforeMount as tr, Transition as qn, shallowRef as nr, nextTick as Pt, render as sn, h as or, cloneVNode as rr, inject as Ct, withDirectives as Gn, vShow as ar, reactive as wt, onBeforeUnmount as zn, resolveDirective as ir, provide as sr, triggerRef as lr, isVNode as ur, resolveComponent as cr } from "vue";
import { isPlainObject as Fn, cloneDeep as Ot, isUndefined as En } from "lodash-es";
import Yn from "../button-edit/index.esm.js";
import "bignumber.js";
import { withInstall as Un, useDateFormat as dr, useNumberFormat as fr, resolveField as ot, setFieldValue as dn, getCustomClass as ln, FormSchemaEntityField$Type as In, FormSchemaEntityFieldType$Type as pr } from "../common/index.esm.js";
import { resolveAppearance as mr, createPropsResolver as hr } from "../dynamic-resolver/index.esm.js";
import Xn from "../tags/index.esm.js";
import vr from "../popover/index.esm.js";
import { useDesignerComponent as gr, DgControl as Dn } from "../designer-canvas/index.esm.js";
import { useResizeObserver as Qn } from "@vueuse/core";
import { useIdentify as yr, useGroupData as br, useFilter as wr, useHierarchy as Cr, useLoading as xr, useDataView as _r, useSelection as Sr, useSelectHierarchyItem as Tr, useDataViewContainerStyle as kr, useCommandColumn as Mr, useColumn as Or, useSort as Fr, useGroupColumn as Er, useRow as Ir, useEdit as Dr, useVisualDataBound as Br, useVisualDataCell as Vr, useVisualDataRow as Pr, useVisualData as Hr, useCellPosition as Nr, useSidebar as Rr, useVirtualScroll as $r, useFitColumn as Lr, useFilterHistory as Wr, useColumnFilter as jr, useDragColumn as Ar, getColumnHeader as qr, getSidebar as Gr, getDisableMask as zr, getHorizontalScrollbar as Yr, getVerticalScrollbar as Ur, getEmpty as Xr } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import Qr from "../transfer/index.esm.js";
import Kr from "../tabs/index.esm.js";
import Jr from "../order/index.esm.js";
import "../condition/index.esm.js";
import Zr, { FCheckbox as ea } from "../checkbox/index.esm.js";
import ta from "../filter-bar/index.esm.js";
import Bn from "../tooltip/index.esm.js";
import na from "../pagination/index.esm.js";
import oa from "../button/index.esm.js";
import ra from "../search-box/index.esm.js";
import aa, { FDynamicFormGroup as ia, FDynamicFormInput as sa } from "../dynamic-form/index.esm.js";
import la from "../binding-selector/index.esm.js";
import "../notify/index.esm.js";
import ua from "../accordion/index.esm.js";
import ca from "../avatar/index.esm.js";
import da from "../button-group/index.esm.js";
import fa from "../calendar/index.esm.js";
import pa from "../capsule/index.esm.js";
import ma from "../color-picker/index.esm.js";
import fn from "../combo-list/index.esm.js";
import ha from "../content-container/index.esm.js";
import va from "../data-grid/index.esm.js";
import ga from "../date-picker/index.esm.js";
import ya from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import ba from "../events-editor/index.esm.js";
import wa from "../image-cropper/index.esm.js";
import Ca from "../input-group/index.esm.js";
import xa from "../layout/index.esm.js";
import _a from "../list-nav/index.esm.js";
import Sa from "../list-view/index.esm.js";
import Ta from "../lookup/index.esm.js";
import ka from "../nav/index.esm.js";
import Ma from "../number-spinner/index.esm.js";
import Oa from "../number-range/index.esm.js";
import Fa from "../page-header/index.esm.js";
import Ea from "../page-footer/index.esm.js";
import Ia from "../progress/index.esm.js";
import Da from "../query-solution/index.esm.js";
import Ba from "../radio-group/index.esm.js";
import Va from "../rate/index.esm.js";
import Pa from "../response-toolbar/index.esm.js";
import Ha from "../response-layout/index.esm.js";
import Na from "../response-layout-editor/index.esm.js";
import Ra from "../section/index.esm.js";
import $a from "../smoke-detector/index.esm.js";
import La from "../splitter/index.esm.js";
import Wa from "../step/index.esm.js";
import ja from "../switch/index.esm.js";
import Aa from "../text/index.esm.js";
import qa from "../time-picker/index.esm.js";
import Ga from "../tree-view/index.esm.js";
import za from "../uploader/index.esm.js";
import Ya from "../verify-detail/index.esm.js";
import Ua from "../component/index.esm.js";
import Xa from "../video/index.esm.js";
import Qa from "../textarea/index.esm.js";
import Ka from "../tree-grid/index.esm.js";
import Ja from "../fieldset/index.esm.js";
import Za from "../drawer/index.esm.js";
import ei from "../combo-tree/index.esm.js";
import ti from "../field-selector/index.esm.js";
import ni from "../mapping-editor/index.esm.js";
import oi from "../schema-selector/index.esm.js";
import ri from "../event-parameter/index.esm.js";
import ai from "../filter-condition-editor/index.esm.js";
import ii from "../sort-condition-editor/index.esm.js";
import si from "../menu-lookup/index.esm.js";
const Kn = {}, Jn = {};
function wn(t) {
const { properties: n, title: e, ignore: o } = t, r = o && Array.isArray(o), a = Object.keys(n).reduce((i, s) => ((!r || !o.find((u) => u === s)) && (i[s] = n[s].type === "object" && n[s].properties ? wn(n[s]) : Ot(n[s].default)), i), {});
if (e && (!r || !o.find((i) => i === "id"))) {
const i = e.toLowerCase().replace(/-/g, "_");
a.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
function li(t) {
const { properties: n, title: e, required: o } = t;
if (o && Array.isArray(o)) {
const r = o.reduce((a, i) => (a[i] = n[i].type === "object" && n[i].properties ? wn(n[i]) : Ot(n[i].default), a), {});
if (e && o.find((a) => a === "id")) {
const a = e.toLowerCase().replace(/-/g, "_");
r.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: e
};
}
function Zn(t, n = {}, e) {
const o = Kn[t];
if (o) {
let r = li(o);
const a = Jn[t];
return r = a ? a({ getSchemaByType: Zn }, r, n, e) : r, r;
}
return null;
}
function ui(t, n) {
const e = wn(n);
return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(t, r) && (o[r] && Fn(o[r]) && Fn(t[r] || !t[r]) ? Object.assign(o[r], t[r] || {}) : o[r] = t[r]), o), e), e;
}
function eo(t, n) {
return Object.keys(t).filter((o) => t[o] != null).reduce((o, r) => {
if (n.has(r)) {
const a = n.get(r);
if (typeof a == "string")
o[a] = t[r];
else {
const i = a(r, t[r], t);
Object.assign(o, i);
}
} else
o[r] = t[r];
return o;
}, {});
}
function ci(t, n, e = /* @__PURE__ */ new Map()) {
const o = ui(t, n);
return eo(o, e);
}
function di(t = {}) {
function n(f, d, l, c) {
if (typeof l == "number")
return c[f].length === l;
if (typeof l == "object") {
const h = Object.keys(l)[0], m = l[h];
if (h === "not")
return Number(c[f].length) !== Number(m);
if (h === "moreThan")
return Number(c[f].length) >= Number(m);
if (h === "lessThan")
return Number(c[f].length) <= Number(m);
}
return !1;
}
function e(f, d, l, c) {
return c[f] && c[f].propertyValue && String(c[f].propertyValue.value) === String(l);
}
const o = /* @__PURE__ */ new Map([
["length", n],
["getProperty", e]
]);
Object.keys(t).reduce((f, d) => (f.set(d, t[d]), f), o);
function r(f, d) {
const l = f;
return typeof d == "number" ? [{ target: l, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: l, operator: "getProperty", param: f, value: !!d }] : typeof d == "object" ? Object.keys(d).map((c) => {
if (c === "length")
return { target: l, operator: "length", param: null, value: d[c] };
const h = c, m = d[c];
return { target: l, operator: "getProperty", param: h, value: m };
}) : [];
}
function a(f) {
return Object.keys(f).reduce((l, c) => {
const h = r(c, f[c]);
return l.push(...h), l;
}, []);
}
function i(f, d) {
if (o.has(f.operator)) {
const l = o.get(f.operator);
return l && l(f.target, f.param, f.value, d) || !1;
}
return !1;
}
function s(f, d) {
return a(f).reduce((h, m) => h && i(m, d), !0);
}
function u(f, d) {
const l = Object.keys(f), c = l.includes("allOf"), h = l.includes("anyOf"), m = c || h, g = (m ? f[m ? c ? "allOf" : "anyOf" : "allOf"] : [f]).map((b) => s(b, d));
return c ? !g.includes(!1) : g.includes(!0);
}
return { parseValueSchema: u };
}
const se = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" }
}, fi = {}, pi = {};
di();
function xt(t, n, e = /* @__PURE__ */ new Map(), o = (i, s, u, f) => s, r = {}, a = (i) => i) {
return Kn[n.title] = n, Jn[n.title] = o, fi[n.title] = r, pi[n.title] = a, (i = {}, s = !0) => {
if (!s)
return eo(i, e);
const u = ci(i, n, e), f = Object.keys(t).reduce((d, l) => (d[l] = t[l].default, d), {});
return Object.assign(f, u);
};
}
function Yt(t, n) {
return { customClass: n.class, customStyle: n.style };
}
function mi() {
function t(n, e) {
const { dataSource: o } = n || {};
return o === void 0 ? {} : {};
}
return {
resolve: t
};
}
function hi() {
function t(n, e) {
return n.selectItemById(e);
}
return {
selectItemById: t
};
}
function vi() {
function t(n, e) {
const { columns: o } = e;
return n.updateColumns(o);
}
return {
updateColumns: t
};
}
const gi = /* @__PURE__ */ new Map([
["appearance", Yt]
]), yi = "https://json-schema.org/draft/2020-12/schema", bi = "https://farris-design.gitee.io/time-picker.schema.json", wi = "time-picker", Ci = "A Farris Input Component", xi = "object", _i = {
id: {
description: "The unique identifier for a time picker",
type: "string"
},
type: {
description: "The type string of time picker component",
type: "string",
default: "time-picker"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disabled: {
type: "string",
default: !1
},
editable: {
description: "",
type: "boolean",
default: !0
},
placeholder: {
description: "",
type: "string",
default: ""
},
readonly: {
description: "",
type: "boolean",
default: !1
},
require: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
visible: {
description: "",
type: "boolean",
default: !0
},
format: {
description: "",
type: "enum",
default: "HH:mm:ss"
},
showHeader: {
description: "",
type: "boolean",
default: !1
},
use12Hours: {
description: "",
type: "boolean",
default: !1
},
hourStep: {
description: "",
type: "number",
default: 1
},
minuteStep: {
description: "",
type: "number",
default: 1
},
secondStep: {
description: "",
type: "number",
default: 1
}
}, Si = [
"type"
], Ti = [
"id",
"appearance",
"binding",
"visible"
], ki = {
$schema: yi,
$id: bi,
title: wi,
description: Ci,
type: xi,
properties: _i,
required: Si,
ignore: Ti
};
function Mi(t, n, e) {
return n;
}
const Cn = {
/**
* 组件值,这个是与指定的format格式相对应的值
*/
modelValue: { type: String, default: "" },
hourStep: { type: Number, default: 1 },
minuteStep: { type: Number, default: 1 },
secondStep: { type: Number, default: 1 },
popupClassName: { type: String, default: "" },
placeholder: { type: String, default: "" },
/**
* 默认时间控件下拉面板,展开时的值
*/
defaultOpenValue: { type: Date, default: null },
format: { type: String, default: "HH:mm:ss" },
isOpen: { type: Boolean, default: !1 },
showHeader: { type: Boolean, default: !1 },
use12Hours: { type: Boolean, default: !1 },
disabledHours: { type: Function, default: null },
disabledMinutes: { type: Function, default: null },
disabledSeconds: { type: Function, default: null },
/**
* 是否隐藏禁用的元素
*/
hideDisabledElements: { type: Boolean, default: !1 },
disabled: { type: Boolean, default: !1 },
readonly: { type: Boolean, default: !1 },
editable: { type: Boolean, default: !0 }
}, to = xt(Cn, ki, gi, Mi), Oi = {
modelValue: {
type: String,
default: ""
},
hourStep: {
type: Number,
default: 1
},
minuteStep: {
type: Number,
default: 1
},
secondStep: {
type: Number,
default: 1
},
defaultOpenValue: {
type: Date,
default: null
},
disabledHours: {
type: Function,
default: null
},
disabledMinutes: {
type: Function,
default: null
},
disabledSeconds: {
type: Function,
default: null
},
format: {
type: String,
default: "HH:mm:ss"
},
isOpen: {
type: Boolean,
default: !1
},
use12Hours: {
type: Boolean,
default: !1
},
showHeader: {
type: Boolean,
default: !1
},
hideDisabledElements: {
type: Boolean,
default: !1
}
};
function Le(t) {
const n = Object.prototype.toString.call(t);
return t instanceof Date || typeof t == "object" && n === "[object Date]" ? new t.constructor(+t) : typeof t == "number" || n === "[object Number]" || typeof t == "string" || n === "[object String]" ? new Date(t) : /* @__PURE__ */ new Date(NaN);
}
function Ie(t, n) {
return t instanceof Date ? new t.constructor(n) : new Date(n);
}
function no(t, n) {
const e = Le(t);
return isNaN(n) ? Ie(t, NaN) : (n && e.setDate(e.getDate() + n), e);
}
const oo = 6048e5, Fi = 864e5, Ei = 6e4, Ii = 36e5, Di = 1e3;
let Bi = {};
function $t() {
return Bi;
}
function Ft(t, n) {
var s, u, f, d;
const e = $t(), o = (n == null ? void 0 : n.weekStartsOn) ?? ((u = (s = n == null ? void 0 : n.locale) == null ? void 0 : s.options) == null ? void 0 : u.weekStartsOn) ?? e.weekStartsOn ?? ((d = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : d.weekStartsOn) ?? 0, r = Le(t), a = r.getDay(), i = (a < o ? 7 : 0) + a - o;
return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r;
}
function Rt(t) {
return Ft(t, { weekStartsOn: 1 });
}
function ro(t) {
const n = Le(t), e = n.getFullYear(), o = Ie(t, 0);
o.setFullYear(e + 1, 0, 4), o.setHours(0, 0, 0, 0);
const r = Rt(o), a = Ie(t, 0);
a.setFullYear(e, 0, 4), a.setHours(0, 0, 0, 0);
const i = Rt(a);
return n.getTime() >= r.getTime() ? e + 1 : n.getTime() >= i.getTime() ? e : e - 1;
}
function Vn(t) {
const n = Le(t);
return n.setHours(0, 0, 0, 0), n;
}
function Kt(t) {
const n = Le(t), e = new Date(
Date.UTC(
n.getFullYear(),
n.getMonth(),
n.getDate(),
n.getHours(),
n.getMinutes(),
n.getSeconds(),
n.getMilliseconds()
)
);
return e.setUTCFullYear(n.getFullYear()), +t - +e;
}
function Vi(t, n) {
const e = Vn(t), o = Vn(n), r = +e - Kt(e), a = +o - Kt(o);
return Math.round((r - a) / Fi);
}
function Pi(t) {
const n = ro(t), e = Ie(t, 0);
return e.setFullYear(n, 0, 4), e.setHours(0, 0, 0, 0), Rt(e);
}
function Hi(t) {
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
}
function ao(t) {
if (!Hi(t) && typeof t != "number")
return !1;
const n = Le(t);
return !isNaN(Number(n));
}
function Ni(t) {
const n = Le(t), e = Ie(t, 0);
return e.setFullYear(n.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
}
const Ri = {
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"
}
}, $i = (t, n, e) => {
let o;
const r = Ri[t];
return typeof r == "string" ? o = r : n === 1 ? o = r.one : o = r.other.replace("{{count}}", n.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + o : o + " ago" : o;
};
function un(t) {
return (n = {}) => {
const e = n.width ? String(n.width) : t.defaultWidth;
return t.formats[e] || t.formats[t.defaultWidth];
};
}
const Li = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
}, Wi = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
}, ji = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
}, Ai = {
date: un({
formats: Li,
defaultWidth: "full"
}),
time: un({
formats: Wi,
defaultWidth: "full"
}),
dateTime: un({
formats: ji,
defaultWidth: "full"
})
}, qi = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
}, Gi = (t, n, e, o) => qi[t];
function Lt(t) {
return (n, e) => {
const o = e != null && e.context ? String(e.context) : "standalone";
let r;
if (o === "formatting" && t.formattingValues) {
const i = t.defaultFormattingWidth || t.defaultWidth, s = e != null && e.width ? String(e.width) : i;
r = t.formattingValues[s] || t.formattingValues[i];
} else {
const i = t.defaultWidth, s = e != null && e.width ? String(e.width) : t.defaultWidth;
r = t.values[s] || t.values[i];
}
const a = t.argumentCallback ? t.argumentCallback(n) : n;
return r[a];
};
}
const zi = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
}, Yi = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, Ui = {
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"
]
}, Xi = {
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"
]
}, Qi = {
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"
}
}, Ki = {
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"
}
}, Ji = (t, n) => {
const e = Number(t), o = e % 100;
if (o > 20 || o < 10)
switch (o % 10) {
case 1:
return e + "st";
case 2:
return e + "nd";
case 3:
return e + "rd";
}
return e + "th";
}, Zi = {
ordinalNumber: Ji,
era: Lt({
values: zi,
defaultWidth: "wide"
}),
quarter: Lt({
values: Yi,
defaultWidth: "wide",
argumentCallback: (t) => t - 1
}),
month: Lt({
values: Ui,
defaultWidth: "wide"
}),
day: Lt({
values: Xi,
defaultWidth: "wide"
}),
dayPeriod: Lt({
values: Qi,
defaultWidth: "wide",
formattingValues: Ki,
defaultFormattingWidth: "wide"
})
};
function Wt(t) {
return (n, e = {}) => {
const o = e.width, r = o && t.matchPatterns[o] || t.matchPatterns[t.defaultMatchWidth], a = n.match(r);
if (!a)
return null;
const i = a[0], s = o && t.parsePatterns[o] || t.parsePatterns[t.defaultParseWidth], u = Array.isArray(s) ? ts(s, (l) => l.test(i)) : (
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
es(s, (l) => l.test(i))
);
let f;
f = t.valueCallback ? t.valueCallback(u) : u, f = e.valueCallback ? (
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
e.valueCallback(f)
) : f;
const d = n.slice(i.length);
return { value: f, rest: d };
};
}
function es(t, n) {
for (const e in t)
if (Object.prototype.hasOwnProperty.call(t, e) && n(t[e]))
return e;
}
function ts(t, n) {
for (let e = 0; e < t.length; e++)
if (n(t[e]))
return e;
}
function ns(t) {
return (n, e = {}) => {
const o = n.match(t.matchPattern);
if (!o) return null;
const r = o[0], a = n.match(t.parsePattern);
if (!a) return null;
let i = t.valueCallback ? t.valueCallback(a[0]) : a[0];
i = e.valueCallback ? e.valueCallback(i) : i;
const s = n.slice(r.length);
return { value: i, rest: s };
};
}
const os = /^(\d+)(th|st|nd|rd)?/i, rs = /\d+/i, as = {
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
}, is = {
any: [/^b/i, /^(a|c)/i]
}, ss = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
}, ls = {
any: [/1/i, /2/i, /3/i, /4/i]
}, us = {
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
}, cs = {
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
]
}, ds = {
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
}, fs = {
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]
}, ps = {
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
}, ms = {
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
}
}, hs = {
ordinalNumber: ns({
matchPattern: os,
parsePattern: rs,
valueCallback: (t) => parseInt(t, 10)
}),
era: Wt({
matchPatterns: as,
defaultMatchWidth: "wide",
parsePatterns: is,
defaultParseWidth: "any"
}),
quarter: Wt({
matchPatterns: ss,
defaultMatchWidth: "wide",
parsePatterns: ls,
defaultParseWidth: "any",
valueCallback: (t) => t + 1
}),
month: Wt({
matchPatterns: us,
defaultMatchWidth: "wide",
parsePatterns: cs,
defaultParseWidth: "any"
}),
day: Wt({
matchPatterns: ds,
defaultMatchWidth: "wide",
parsePatterns: fs,
defaultParseWidth: "any"
}),
dayPeriod: Wt({
matchPatterns: ps,
defaultMatchWidth: "any",
parsePatterns: ms,
defaultParseWidth: "any"
})
}, io = {
code: "en-US",
formatDistance: $i,
formatLong: Ai,
formatRelative: Gi,
localize: Zi,
match: hs,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
function vs(t) {
const n = Le(t);
return Vi(n, Ni(n)) + 1;
}
function so(t) {
const n = Le(t), e = +Rt(n) - +Pi(n);
return Math.round(e / oo) + 1;
}
function xn(t, n) {
var d, l, c, h;
const e = Le(t), o = e.getFullYear(), r = $t(), a = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((l = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : l.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (c = r.locale) == null ? void 0 : c.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, i = Ie(t, 0);
i.setFullYear(o + 1, 0, a), i.setHours(0, 0, 0, 0);
const s = Ft(i, n), u = Ie(t, 0);
u.setFullYear(o, 0, a), u.setHours(0, 0, 0, 0);
const f = Ft(u, n);
return e.getTime() >= s.getTime() ? o + 1 : e.getTime() >= f.getTime() ? o : o - 1;
}
function gs(t, n) {
var s, u, f, d;
const e = $t(), o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((u = (s = n == null ? void 0 : n.locale) == null ? void 0 : s.options) == null ? void 0 : u.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((d = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? 1, r = xn(t, n), a = Ie(t, 0);
return a.setFullYear(r, 0, o), a.setHours(0, 0, 0, 0), Ft(a, n);
}
function lo(t, n) {
const e = Le(t), o = +Ft(e, n) - +gs(e, n);
return Math.round(o / oo) + 1;
}
function Te(t, n) {
const e = t < 0 ? "-" : "", o = Math.abs(t).toString().padStart(n, "0");
return e + o;
}
const Tt = {
// Year
y(t, n) {
const e = t.getFullYear(), o = e > 0 ? e : 1 - e;
return Te(n === "yy" ? o % 100 : o, n.length);
},
// Month
M(t, n) {
const e = t.getMonth();
return n === "M" ? String(e + 1) : Te(e + 1, 2);
},
// Day of the month
d(t, n) {
return Te(t.getDate(), n.length);
},
// AM or PM
a(t, n) {
const e = t.getHours() / 12 >= 1 ? "pm" : "am";
switch (n) {
case "a":
case "aa":
return e.toUpperCase();
case "aaa":
return e;
case "aaaaa":
return e[0];
case "aaaa":
default:
return e === "am" ? "a.m." : "p.m.";
}
},
// Hour [1-12]
h(t, n) {
return Te(t.getHours() % 12 || 12, n.length);
},
// Hour [0-23]
H(t, n) {
return Te(t.getHours(), n.length);
},
// Minute
m(t, n) {
return Te(t.getMinutes(), n.length);
},
// Second
s(t, n) {
return Te(t.getSeconds(), n.length);
},
// Fraction of second
S(t, n) {
const e = n.length, o = t.getMilliseconds(), r = Math.trunc(
o * Math.pow(10, e - 3)
);
return Te(r, n.length);
}
}, Bt = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}, Pn = {
// Era
G: function(t, n, e) {
const o = t.getFullYear() > 0 ? 1 : 0;
switch (n) {
case "G":
case "GG":
case "GGG":
return e.era(o, { width: "abbreviated" });
case "GGGGG":
return e.era(o, { width: "narrow" });
case "GGGG":
default:
return e.era(o, { width: "wide" });
}
},
// Year
y: function(t, n, e) {
if (n === "yo") {
const o = t.getFullYear(), r = o > 0 ? o : 1 - o;
return e.ordinalNumber(r, { unit: "year" });
}
return Tt.y(t, n);
},
// Local week-numbering year
Y: function(t, n, e, o) {
const r = xn(t, o), a = r > 0 ? r : 1 - r;
if (n === "YY") {
const i = a % 100;
return Te(i, 2);
}
return n === "Yo" ? e.ordinalNumber(a, { unit: "year" }) : Te(a, n.length);
},
// ISO week-numbering year
R: function(t, n) {
const e = ro(t);
return Te(e, 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(t, n) {
const e = t.getFullYear();
return Te(e, n.length);
},
// Quarter
Q: function(t, n, e) {
const o = Math.ceil((t.getMonth() + 1) / 3);
switch (n) {
case "Q":
return String(o);
case "QQ":
return Te(o, 2);
case "Qo":
return e.ordinalNumber(o, { unit: "quarter" });
case "QQQ":
return e.quarter(o, {
width: "abbreviated",
context: "formatting"
});
case "QQQQQ":
return e.quarter(o, {
width: "narrow",
context: "formatting"
});
case "QQQQ":
default:
return e.quarter(o, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone quarter
q: function(t, n, e) {
const o = Math.ceil((t.getMonth() + 1) / 3);
switch (n) {
case "q":
return String(o);
case "qq":
return Te(o, 2);
case "qo":
return e.ordinalNumber(o, { unit: "quarter" });
case "qqq":
return e.quarter(o, {
width: "abbreviated",
context: "standalone"
});
case "qqqqq":
return e.quarter(o, {
width: "narrow",
context: "standalone"
});
case "qqqq":
default:
return e.quarter(o, {
width: "wide",
context: "standalone"
});
}
},
// Month
M: function(t, n, e) {
const o = t.getMonth();
switch (n) {
case "M":
case "MM":
return Tt.M(t, n);
case "Mo":
return e.ordinalNumber(o + 1, { unit: "month" });
case "MMM":
return e.month(o, {
width: "abbreviated",
context: "formatting"
});
case "MMMMM":
return e.month(o, {
width: "narrow",
context: "formatting"
});
case "MMMM":
default:
return e.month(o, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function(t, n, e) {
const o = t.getMonth();
switch (n) {
case "L":
return String(o + 1);
case "LL":
return Te(o + 1, 2);
case "Lo":
return e.ordinalNumber(o + 1, { unit: "month" });
case "LLL":
return e.month(o, {
width: "abbreviated",
context: "standalone"
});
case "LLLLL":
return e.month(o, {
width: "narrow",
context: "standalone"
});
case "LLLL":
default:
return e.month(o, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function(t, n, e, o) {
const r = lo(t, o);
return n === "wo" ? e.ordinalNumber(r, { unit: "week" }) : Te(r, n.length);
},
// ISO week of year
I: function(t, n, e) {
const o = so(t);
return n === "Io" ? e.ordinalNumber(o, { unit: "week" }) : Te(o, n.length);
},
// Day of the month
d: function(t, n, e) {
return n === "do" ? e.ordinalNumber(t.getDate(), { unit: "date" }) : Tt.d(t, n);
},
// Day of year
D: function(t, n, e) {
const o = vs(t);
return n === "Do" ? e.ordinalNumber(o, { unit: "dayOfYear" }) : Te(o, n.length);
},
// Day of week
E: function(t, n, e) {
const o = t.getDay();
switch (n) {
case "E":
case "EE":
case "EEE":
return e.day(o, {
width: "abbreviated",
context: "formatting"
});
case "EEEEE":
return e.day(o, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return e.day(o, {
width: "short",
context: "formatting"
});
case "EEEE":
default:
return e.day(o, {
width: "wide",
context: "formatting"
});
}
},
// Local day of week
e: function(t, n, e, o) {
const r = t.getDay(), a = (r - o.weekStartsOn + 8) % 7 || 7;
switch (n) {
case "e":
return String(a);
case "ee":
return Te(a, 2);
case "eo":
return e.ordinalNumber(a, { unit: "day" });
case "eee":
return e.day(r, {
width: "abbreviated",
context: "formatting"
});
case "eeeee":
return e.day(r, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return e.day(r, {
width: "short",
context: "formatting"
});
case "eeee":
default:
return e.day(r, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone local day of week
c: function(t, n, e, o) {
const r = t.getDay(), a = (r - o.weekStartsOn + 8) % 7 || 7;
switch (n) {
case "c":
return String(a);
case "cc":
return Te(a, n.length);
case "co":
return e.ordinalNumber(a, { unit: "day" });
case "ccc":
return e.day(r, {
width: "abbreviated",
context: "standalone"
});
case "ccccc":
return e.day(r, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return e.day(r, {
width: "short",
context: "standalone"
});
case "cccc":
default:
return e.day(r, {
width: "wide",
context: "standalone"
});
}
},
// ISO day of week
i: function(t, n, e) {
const o = t.getDay(), r = o === 0 ? 7 : o;
switch (n) {
case "i":
return String(r);
case "ii":
return Te(r, n.length);
case "io":
return e.ordinalNumber(r, { unit: "day" });
case "iii":
return e.day(o, {
width: "abbreviated",
context: "formatting"
});
case "iiiii":
return e.day(o, {
width: "narrow",
context: "formatting"
});
case "iiiiii":
return e.day(o, {
width: "short",
context: "formatting"
});
case "iiii":
default:
return e.day(o, {
width: "wide",
context: "formatting"
});
}
},
// AM or PM
a: function(t, n, e) {
const r = t.getHours() / 12 >= 1 ? "pm" : "am";
switch (n) {
case "a":
case "aa":
return e.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return e.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return e.dayPeriod(r, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return e.dayPeriod(r, {
width: "wide",
context: "formatting"
});
}
},
// AM, PM, midnight, noon
b: function(t, n, e) {
const o = t.getHours();
let r;
switch (o === 12 ? r = Bt.noon : o === 0 ? r = Bt.midnight : r = o / 12 >= 1 ? "pm" : "am", n) {
case "b":
case "bb":
return e.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return e.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return e.dayPeriod(r, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return e.dayPeriod(r, {
width: "wide",
context: "formatting"
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function(t, n, e) {
const o = t.getHours();
let r;
switch (o >= 17 ? r = Bt.evening : o >= 12 ? r = Bt.afternoon : o >= 4 ? r = Bt.morning : r = Bt.night, n) {
case "B":
case "BB":
case "BBB":
return e.dayPeriod(r, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return e.dayPeriod(r, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return e.dayPeriod(r, {
width: "wide",
context: "formatting"
});
}
},
// Hour [1-12]
h: function(t, n, e) {
if (n === "ho") {
let o = t.getHours() % 12;
return o === 0 && (o = 12), e.ordinalNumber(o, { unit: "hour" });
}
return Tt.h(t, n);
},
// Hour [0-23]
H: function(t, n, e) {
return n === "Ho" ? e.ordinalNumber(t.getHours(), { unit: "hour" }) : Tt.H(t, n);
},
// Hour [0-11]
K: function(t, n, e) {
const o = t.getHours() % 12;
return n === "Ko" ? e.ordinalNumber(o, { unit: "hour" }) : Te(o, n.length);
},
// Hour [1-24]
k: function(t, n, e) {
let o = t.getHours();
return o === 0 && (o = 24), n === "ko" ? e.ordinalNumber(o, { unit: "hour" }) : Te(o, n.length);
},
// Minute
m: function(t, n, e) {
return n === "mo" ? e.ordinalNumber(t.getMinutes(), { unit: "minute" }) : Tt.m(t, n);
},
// Second
s: function(t, n, e) {
return n === "so" ? e.ordinalNumber(t.getSeconds(), { unit: "second" }) : Tt.s(t, n);
},
// Fraction of second
S: function(t, n) {
return Tt.S(t, n);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function(t, n, e) {
const o = t.getTimezoneOffset();
if (o === 0)
return "Z";
switch (n) {
case "X":
return Nn(o);
case "XXXX":
case "XX":
return Et(o);
case "XXXXX":
case "XXX":
default:
return Et(o, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function(t, n, e) {
const o = t.getTimezoneOffset();
switch (n) {
case "x":
return Nn(o);
case "xxxx":
case "xx":
return Et(o);
case "xxxxx":
case "xxx":
default:
return Et(o, ":");
}
},
// Timezone (GMT)
O: function(t, n, e) {
const o = t.getTimezoneOffset();
switch (n) {
case "O":
case "OO":
case "OOO":
return "GMT" + Hn(o, ":");
case "OOOO":
default:
return "GMT" + Et(o, ":");
}
},
// Timezone (specific non-location)
z: function(t, n, e) {
const o = t.getTimezoneOffset();
switch (n) {
case "z":
case "zz":
case "zzz":
return "GMT" + Hn(o, ":");
case "zzzz":
default:
return "GMT" + Et(o, ":");
}
},
// Seconds timestamp
t: function(t, n, e) {
const o = Math.trunc(t.getTime() / 1e3);
return Te(o, n.length);
},
// Milliseconds timestamp
T: function(t, n, e) {
const o = t.getTime();
return Te(o, n.length);
}
};
function Hn(t, n = "") {
const e = t > 0 ? "-" : "+", o = Math.abs(t), r = Math.trunc(o / 60), a = o % 60;
return a === 0 ? e + String(r) : e + String(r) + n + Te(a, 2);
}
function Nn(t, n) {
return t % 60 === 0 ? (t > 0 ? "-" : "+") + Te(Math.abs(t) / 60, 2) : Et(t, n);
}
function Et(t, n = "") {
const e = t > 0 ? "-" : "+", o = Math.abs(t), r = Te(Math.trunc(o / 60), 2), a = Te(o % 60, 2);
return e + r + n + a;
}
const Rn = (t, n) => {
switch (t) {
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" });
}
}, uo = (t, n) => {
switch (t) {
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" });
}
}, ys = (t, n) => {
const e = t.match(/(P+)(p+)?/) || [], o = e[1], r = e[2];
if (!r)
return Rn(t, n);
let a;
switch (o) {
case "P":
a = n.dateTime({ width: "short" });
break;
case "PP":
a = n.dateTime({ width: "medium" });
break;
case "PPP":
a = n.dateTime({ width: "long" });
break;
case "PPPP":
default:
a = n.dateTime({ width: "full" });
break;
}
return a.replace("{{date}}", Rn(o, n)).replace("{{time}}", uo(r, n));
}, pn = {
p: uo,
P: ys
}, bs = /^D+$/, ws = /^Y+$/, Cs = ["D", "DD", "YY", "YYYY"];
function co(t) {
return bs.test(t);
}
function fo(t) {
return ws.test(t);
}
function mn(t, n, e) {
const o = xs(t, n, e);
if (console.warn(o), Cs.includes(t)) throw new RangeError(o);
}
function xs(t, n, e) {
const o = t[0] === "Y" ? "years" : "days of the month";
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${o} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
const _s = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ss = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ts = /^'([^]*?)'?$/, ks = /''/g, Ms = /[a-zA-Z]/;
function $n(t, n, e) {
var d, l, c, h;
const o = $t(), r = o.locale ?? io, a = o.firstWeekContainsDate ?? ((l = (d = o.locale) == null ? void 0 : d.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, i = o.weekStartsOn ?? ((h = (c = o.locale) == null ? void 0 : c.options) == null ? void 0 : h.weekStartsOn) ?? 0, s = Le(t);
if (!ao(s))
throw new RangeError("Invalid time value");
let u = n.match(Ss).map((m) => {
const O = m[0];
if (O === "p" || O === "P") {
const _ = pn[O];
return _(m, r.formatLong);
}
return m;
}).join("").match(_s).map((m) => {
if (m === "''")
return { isToken: !1, value: "'" };
const O = m[0];
if (O === "'")
return { isToken: !1, value: Os(m) };
if (Pn[O])
return { isToken: !0, value: m };
if (O.match(Ms))
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" + O + "`"
);
return { isToken: !1, value: m };
});
r.localize.preprocessor && (u = r.localize.preprocessor(s, u));
const f = {
firstWeekContainsDate: a,
weekStartsOn: i,
locale: r
};
return u.map((m) => {
if (!m.isToken) return m.value;
const O = m.value;
(fo(O) || co(O)) && mn(O, n, String(t));
const _ = Pn[O[0]];
return _(s, O, r.localize, f);
}).join("");
}
function Os(t) {
const n = t.match(Ts);
return n ? n[1].replace(ks, "'") : t;
}
function Fs() {
return Object.assign({}, $t());
}
function Es(t) {
let e = Le(t).getDay();
return e === 0 && (e = 7), e;
}
function Is(t, n) {
const e = n instanceof Date ? Ie(n, 0) : new n(0);
return e.setFullYear(
t.getFullYear(),
t.getMonth(),
t.getDate()
), e.setHours(
t.getHours(),
t.getMinutes(),
t.getSeconds(),
t.getMilliseconds()
), e;
}
const Ds = 10;
class po {
constructor() {
D(this, "subPriority", 0);
}
validate(n, e) {
return !0;
}
}
class Bs extends po {
constructor(n, e, o, r, a) {
super(), this.value = n, this.validateValue = e, this.setValue = o, this.priority = r, a && (this.subPriority = a);
}
validate(n, e) {
return this.validateValue(n, this.value, e);
}
set(n, e, o) {
return this.setValue(n, e, this.value, o);
}
}
class Vs extends po {
constructor() {
super(...arguments);
D(this, "priority", Ds);
D(this, "subPriority", -1);
}
set(e, o) {
return o.timestampIsSet ? e : Ie(e, Is(e, Date));
}
}
class _e {
run(n, e, o, r) {
const a = this.parse(n, e, o, r);
return a ? {
setter: new Bs(
a.value,
this.validate,
this.set,
this.priority,
this.subPriority
),
rest: a.rest
} : null;
}
validate(n, e, o) {
return !0;
}
}
class Ps extends _e {
constructor() {
super(...arguments);
D(this, "priority", 140);
D(this, "incompatibleTokens", ["R", "u", "t", "T"]);
}
parse(e, o, r) {
switch (o) {
case "G":
case "GG":
case "GGG":
return r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" });
case "GGGGG":
return r.era(e, { width: "narrow" });
case "GGGG":
default:
return r.era(e, { width: "wide" }) || r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" });
}
}
set(e, o, r) {
return o.era = r, e.setFullYear(r, 0, 1), e.setHours(0, 0, 0, 0), e;
}
}
const Ve = {
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
}, pt = {
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 Pe(t, n) {
return t && {
value: n(t.value),
rest: t.rest
};
}
function Ee(t, n) {
const e = n.match(t);
return e ? {
value: parseInt(e[0], 10),
rest: n.slice(e[0].length)
} : null;
}
function mt(t, n) {
const e = n.match(t);
if (!e)
return null;
if (e[0] === "Z")
return {
value: 0,
rest: n.slice(1)
};
const o = e[1] === "+" ? 1 : -