@agendize/vue-event-booking
Version:
Vue agendize's booking component
1,531 lines • 253 kB
JavaScript
import { ref as U, computed as Ge, defineComponent as Wn, h as Hs, getCurrentInstance as Vn, effectScope as Ao, inject as Fo, onMounted as zs, onUnmounted as Ro, shallowRef as Po, onBeforeMount as Vo, watch as Wt, Fragment as fa, isRef as He, createVNode as rt, Text as xo, openBlock as Z, createBlock as We, unref as f, withCtx as Ht, createElementVNode as ae, toDisplayString as ke, createCommentVNode as he, nextTick as Re, resolveDirective as Uo, createElementBlock as ie, withDirectives as $o, createTextVNode as ln } from "vue";
import { CompanySearch as Wo, ServiceSearch as Ho, ChipsFilterServiceType as zo, StaffSearch as Go, ChipsFilterStaffType as Yo, ContactSearch as Zo, ChipsFilterContactType as Bo, CompanyItem as jo, ServiceItem as qo, StaffItem as Jo, ContactItem as Ko } from "@agendize/vue-search";
import { ContactEntity as Gs, AddressEntity as Xo, QUERY_TYPE as In, applyValueToField as Qo, EventEntity as el, ServiceTypeEntity as Aa, ServiceEntity as tl, ServiceResourceEntity as nl, SettingsPeriodWorkingEntity as al, SettingsPeriodWorkingDayEntity as rl } from "@agendize/js-calendar-api";
import { messages as sl } from "@agendize/az-i18n";
import { Panel as Ys, FieldInput as da, Mandatory as ze, FieldEmail as il, FieldPhone as ol, FieldToggle as An, FieldDateTime as Mr, FieldTextArea as Ar, FieldNumber as ll, FormFields as ul } from "@agendize/design-system";
function cl(t, e, n, a, r) {
const s = U(!1), i = U(""), o = U(""), l = U(), c = U(), h = U(!1), y = U(""), v = U(!0), b = U(!1), L = U(""), M = U(!1), C = U(!1), _ = U(!1), T = U(!1), O = U(!1);
g();
function g() {
if (!a) {
h.value = !1, y.value = "", v.value = !0, b.value = !1, L.value = "", M.value = !1;
return;
}
e.getPrivacyPolicy(a.owner.id, a.owner.userName).then((R) => {
const w = R.result;
if (v.value = !1, w && w.privateData && w.privateData.consentMode === "ON" && w.privateData.consentText)
switch (h.value = !0, r == null ? void 0 : r.toLowerCase()) {
case "en":
y.value = w.privateData.consentText.EN;
break;
case "de":
y.value = w.privateData.consentText.DE;
break;
case "es":
y.value = w.privateData.consentText.ES;
break;
case "pt":
y.value = w.privateData.consentText.PT;
break;
case "it":
y.value = w.privateData.consentText.IT;
break;
case "nl":
y.value = w.privateData.consentText.NL;
break;
case "fr":
default:
y.value = w.privateData.consentText.FR;
}
else
h.value = !1, v.value = !0, y.value = "";
if (w && w.marketing && w.marketing.consentMode === "ON" && w.marketing.consentText)
switch (b.value = !0, r == null ? void 0 : r.toLowerCase()) {
case "en":
L.value = w.marketing.consentText.EN;
break;
case "de":
L.value = w.marketing.consentText.DE;
break;
case "es":
L.value = w.marketing.consentText.ES;
break;
case "pt":
L.value = w.marketing.consentText.PT;
break;
case "it":
L.value = w.marketing.consentText.IT;
break;
case "nl":
L.value = w.marketing.consentText.NL;
break;
case "fr":
default:
L.value = w.marketing.consentText.FR;
}
else
b.value = !1, L.value = "", M.value = !1;
});
}
function I(R, w) {
const X = typeof w == "boolean" ? w : typeof w == "string" ? w.length > 0 : w.isValid;
switch (R) {
case "firstName":
C.value = X;
break;
case "lastName":
_.value = X;
break;
case "email":
T.value = X;
break;
case "phone":
O.value = X;
break;
case "privacyConsent":
v.value = X;
break;
}
}
const N = Ge(() => C.value && _.value && T.value && O.value && v.value);
function A() {
const R = new Gs();
R.firstName = i.value, R.lastName = o.value, R.email = l.value, R.phone = c.value, R.address = new Xo(), R.address.country = "FR", R.email && (R.emailAddresses = [{ email: R.email, primary: !0 }]), R.phone && (R.phoneNumbers = [{ number: R.phone, primary: !0 }]), M.value ? R.marketingConsent = { text: L.value } : delete R.marketingConsent, e.createContact(a == null ? void 0 : a.owner.userName, R).then((w) => {
M.value && (w.marketingConsent = { text: L.value }), t("onCreated", w);
}).catch((w) => {
n == null || n.error("vue-event-booking", "Error while creating contact", w), t("onError", w.errorCode);
});
}
return {
loading: s,
createContact: A,
firstName: i,
lastName: o,
email: l,
phone: c,
hasPrivacyConsent: h,
privacyConsentText: y,
privacyConsentValid: v,
hasMarketingConsent: b,
marketingConsentText: L,
marketingConsentValid: M,
saveEnabled: N,
validatedField: I
};
}
/*!
* shared v9.5.0
* (c) 2023 kazuya kawaguchi
* Released under the MIT License.
*/
const Nt = typeof window < "u";
let it, en;
if (process.env.NODE_ENV !== "production") {
const t = Nt && window.performance;
t && t.mark && t.measure && t.clearMarks && t.clearMeasures && (it = (e) => {
t.mark(e);
}, en = (e, n, a) => {
t.measure(e, n, a), t.clearMarks(n), t.clearMarks(a);
});
}
const fl = /\{([0-9a-zA-Z]+)\}/g;
function cr(t, ...e) {
return e.length === 1 && re(e[0]) && (e = e[0]), (!e || !e.hasOwnProperty) && (e = {}), t.replace(fl, (n, a) => e.hasOwnProperty(a) ? e[a] : "");
}
const bt = (t, e = !1) => e ? Symbol.for(t) : Symbol(t), dl = (t, e, n) => ml({ l: t, k: e, s: n }), ml = (t) => JSON.stringify(t).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027"), Ae = (t) => typeof t == "number" && isFinite(t), hl = (t) => Bs(t) === "[object Date]", zt = (t) => Bs(t) === "[object RegExp]", ya = (t) => B(t) && Object.keys(t).length === 0, Ue = Object.assign;
let Fr;
const wt = () => Fr || (Fr = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
function Rr(t) {
return t.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
}
const _l = Object.prototype.hasOwnProperty;
function fr(t, e) {
return _l.call(t, e);
}
const ce = Array.isArray, ye = (t) => typeof t == "function", P = (t) => typeof t == "string", J = (t) => typeof t == "boolean", re = (t) => t !== null && typeof t == "object", Zs = Object.prototype.toString, Bs = (t) => Zs.call(t), B = (t) => {
if (!re(t))
return !1;
const e = Object.getPrototypeOf(t);
return e === null || e.constructor === Object;
}, gl = (t) => t == null ? "" : ce(t) || B(t) && t.toString === Zs ? JSON.stringify(t, null, 2) : String(t);
function vl(t, e = "") {
return t.reduce((n, a, r) => r === 0 ? n + a : n + e + a, "");
}
const Pr = 2;
function yl(t, e = 0, n = t.length) {
const a = t.split(/\r?\n/);
let r = 0;
const s = [];
for (let i = 0; i < a.length; i++)
if (r += a[i].length + 1, r >= e) {
for (let o = i - Pr; o <= i + Pr || n > r; o++) {
if (o < 0 || o >= a.length)
continue;
const l = o + 1;
s.push(`${l}${" ".repeat(3 - String(l).length)}| ${a[o]}`);
const c = a[o].length;
if (o === i) {
const h = e - (r - c) + 1, y = Math.max(1, n > r ? c - h : n - e);
s.push(" | " + " ".repeat(h) + "^".repeat(y));
} else if (o > i) {
if (n > r) {
const h = Math.max(Math.min(n - r, c), 1);
s.push(" | " + "^".repeat(h));
}
r += c + 1;
}
}
break;
}
return s.join(`
`);
}
function dr(t) {
let e = t;
return () => ++e;
}
function Pe(t, e) {
typeof console < "u" && (console.warn("[intlify] " + t), e && console.warn(e.stack));
}
const Vr = {};
function pl(t) {
Vr[t] || (Vr[t] = !0, Pe(t));
}
function mr() {
const t = /* @__PURE__ */ new Map();
return {
events: t,
on(n, a) {
const r = t.get(n);
r && r.push(a) || t.set(n, [a]);
},
off(n, a) {
const r = t.get(n);
r && r.splice(r.indexOf(a) >>> 0, 1);
},
emit(n, a) {
(t.get(n) || []).slice().map((r) => r(a)), (t.get("*") || []).slice().map((r) => r(n, a));
}
};
}
/*!
* message-compiler v9.5.0
* (c) 2023 kazuya kawaguchi
* Released under the MIT License.
*/
function El(t, e, n) {
return { line: t, column: e, offset: n };
}
function Ya(t, e, n) {
const a = { start: t, end: e };
return n != null && (a.source = n), a;
}
const bl = /\{([0-9a-zA-Z]+)\}/g;
function Tl(t, ...e) {
return e.length === 1 && Nl(e[0]) && (e = e[0]), (!e || !e.hasOwnProperty) && (e = {}), t.replace(bl, (n, a) => e.hasOwnProperty(a) ? e[a] : "");
}
const js = Object.assign, xr = (t) => typeof t == "string", Nl = (t) => t !== null && typeof t == "object";
function qs(t, e = "") {
return t.reduce((n, a, r) => r === 0 ? n + a : n + e + a, "");
}
const Y = {
EXPECTED_TOKEN: 1,
INVALID_TOKEN_IN_PLACEHOLDER: 2,
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
UNKNOWN_ESCAPE_SEQUENCE: 4,
INVALID_UNICODE_ESCAPE_SEQUENCE: 5,
UNBALANCED_CLOSING_BRACE: 6,
UNTERMINATED_CLOSING_BRACE: 7,
EMPTY_PLACEHOLDER: 8,
NOT_ALLOW_NEST_PLACEHOLDER: 9,
INVALID_LINKED_FORMAT: 10,
MUST_HAVE_MESSAGES_IN_PLURAL: 11,
UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
UNEXPECTED_EMPTY_LINKED_KEY: 13,
UNEXPECTED_LEXICAL_ANALYSIS: 14,
UNHANDLED_CODEGEN_NODE_TYPE: 15,
UNHANDLED_MINIFIER_NODE_TYPE: 16,
__EXTEND_POINT__: 17
}, Ol = {
[Y.EXPECTED_TOKEN]: "Expected token: '{0}'",
[Y.INVALID_TOKEN_IN_PLACEHOLDER]: "Invalid token in placeholder: '{0}'",
[Y.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: "Unterminated single quote in placeholder",
[Y.UNKNOWN_ESCAPE_SEQUENCE]: "Unknown escape sequence: \\{0}",
[Y.INVALID_UNICODE_ESCAPE_SEQUENCE]: "Invalid unicode escape sequence: {0}",
[Y.UNBALANCED_CLOSING_BRACE]: "Unbalanced closing brace",
[Y.UNTERMINATED_CLOSING_BRACE]: "Unterminated closing brace",
[Y.EMPTY_PLACEHOLDER]: "Empty placeholder",
[Y.NOT_ALLOW_NEST_PLACEHOLDER]: "Not allowed nest placeholder",
[Y.INVALID_LINKED_FORMAT]: "Invalid linked format",
[Y.MUST_HAVE_MESSAGES_IN_PLURAL]: "Plural must have messages",
[Y.UNEXPECTED_EMPTY_LINKED_MODIFIER]: "Unexpected empty linked modifier",
[Y.UNEXPECTED_EMPTY_LINKED_KEY]: "Unexpected empty linked key",
[Y.UNEXPECTED_LEXICAL_ANALYSIS]: "Unexpected lexical analysis in token: '{0}'",
[Y.UNHANDLED_CODEGEN_NODE_TYPE]: "unhandled codegen node type: '{0}'",
[Y.UNHANDLED_MINIFIER_NODE_TYPE]: "unhandled mimifier node type: '{0}'"
};
function yn(t, e, n = {}) {
const { domain: a, messages: r, args: s } = n, i = Tl((r || Ol)[t] || "", ...s || []), o = new SyntaxError(String(i));
return o.code = t, e && (o.location = e), o.domain = a, o;
}
function kl(t) {
throw t;
}
const Sl = /<\/?[\w\s="/.':;#-\/]+>/, Il = (t) => Sl.test(t), Lt = " ", Ll = "\r", je = `
`, wl = String.fromCharCode(8232), Cl = String.fromCharCode(8233);
function Dl(t) {
const e = t;
let n = 0, a = 1, r = 1, s = 0;
const i = (A) => e[A] === Ll && e[A + 1] === je, o = (A) => e[A] === je, l = (A) => e[A] === Cl, c = (A) => e[A] === wl, h = (A) => i(A) || o(A) || l(A) || c(A), y = () => n, v = () => a, b = () => r, L = () => s, M = (A) => i(A) || l(A) || c(A) ? je : e[A], C = () => M(n), _ = () => M(n + s);
function T() {
return s = 0, h(n) && (a++, r = 0), i(n) && n++, n++, r++, e[n];
}
function O() {
return i(n + s) && s++, s++, e[n + s];
}
function g() {
n = 0, a = 1, r = 1, s = 0;
}
function I(A = 0) {
s = A;
}
function N() {
const A = n + s;
for (; A !== n; )
T();
s = 0;
}
return {
index: y,
line: v,
column: b,
peekOffset: L,
charAt: M,
currentChar: C,
currentPeek: _,
next: T,
peek: O,
reset: g,
resetPeek: I,
skipToPeek: N
};
}
const Rt = void 0, Ml = ".", Ur = "'", Al = "tokenizer";
function Fl(t, e = {}) {
const n = e.location !== !1, a = Dl(t), r = () => a.index(), s = () => El(a.line(), a.column(), a.index()), i = s(), o = r(), l = {
currentType: 14,
offset: o,
startLoc: i,
endLoc: i,
lastType: 14,
lastOffset: o,
lastStartLoc: i,
lastEndLoc: i,
braceNest: 0,
inLinked: !1,
text: ""
}, c = () => l, { onError: h } = e;
function y(d, u, E, ...x) {
const W = c();
if (u.column += E, u.offset += E, h) {
const j = n ? Ya(W.startLoc, u) : null, Oe = yn(d, j, {
domain: Al,
args: x
});
h(Oe);
}
}
function v(d, u, E) {
d.endLoc = s(), d.currentType = u;
const x = { type: u };
return n && (x.loc = Ya(d.startLoc, d.endLoc)), E != null && (x.value = E), x;
}
const b = (d) => v(d, 14);
function L(d, u) {
return d.currentChar() === u ? (d.next(), u) : (y(Y.EXPECTED_TOKEN, s(), 0, u), "");
}
function M(d) {
let u = "";
for (; d.currentPeek() === Lt || d.currentPeek() === je; )
u += d.currentPeek(), d.peek();
return u;
}
function C(d) {
const u = M(d);
return d.skipToPeek(), u;
}
function _(d) {
if (d === Rt)
return !1;
const u = d.charCodeAt(0);
return u >= 97 && u <= 122 || u >= 65 && u <= 90 || u === 95;
}
function T(d) {
if (d === Rt)
return !1;
const u = d.charCodeAt(0);
return u >= 48 && u <= 57;
}
function O(d, u) {
const { currentType: E } = u;
if (E !== 2)
return !1;
M(d);
const x = _(d.currentPeek());
return d.resetPeek(), x;
}
function g(d, u) {
const { currentType: E } = u;
if (E !== 2)
return !1;
M(d);
const x = d.currentPeek() === "-" ? d.peek() : d.currentPeek(), W = T(x);
return d.resetPeek(), W;
}
function I(d, u) {
const { currentType: E } = u;
if (E !== 2)
return !1;
M(d);
const x = d.currentPeek() === Ur;
return d.resetPeek(), x;
}
function N(d, u) {
const { currentType: E } = u;
if (E !== 8)
return !1;
M(d);
const x = d.currentPeek() === ".";
return d.resetPeek(), x;
}
function A(d, u) {
const { currentType: E } = u;
if (E !== 9)
return !1;
M(d);
const x = _(d.currentPeek());
return d.resetPeek(), x;
}
function R(d, u) {
const { currentType: E } = u;
if (!(E === 8 || E === 12))
return !1;
M(d);
const x = d.currentPeek() === ":";
return d.resetPeek(), x;
}
function w(d, u) {
const { currentType: E } = u;
if (E !== 10)
return !1;
const x = () => {
const j = d.currentPeek();
return j === "{" ? _(d.peek()) : j === "@" || j === "%" || j === "|" || j === ":" || j === "." || j === Lt || !j ? !1 : j === je ? (d.peek(), x()) : _(j);
}, W = x();
return d.resetPeek(), W;
}
function X(d) {
M(d);
const u = d.currentPeek() === "|";
return d.resetPeek(), u;
}
function H(d) {
const u = M(d), E = d.currentPeek() === "%" && d.peek() === "{";
return d.resetPeek(), {
isModulo: E,
hasSpace: u.length > 0
};
}
function te(d, u = !0) {
const E = (W = !1, j = "", Oe = !1) => {
const Ce = d.currentPeek();
return Ce === "{" ? j === "%" ? !1 : W : Ce === "@" || !Ce ? j === "%" ? !0 : W : Ce === "%" ? (d.peek(), E(W, "%", !0)) : Ce === "|" ? j === "%" || Oe ? !0 : !(j === Lt || j === je) : Ce === Lt ? (d.peek(), E(!0, Lt, Oe)) : Ce === je ? (d.peek(), E(!0, je, Oe)) : !0;
}, x = E();
return u && d.resetPeek(), x;
}
function pe(d, u) {
const E = d.currentChar();
return E === Rt ? Rt : u(E) ? (d.next(), E) : null;
}
function le(d) {
return pe(d, (E) => {
const x = E.charCodeAt(0);
return x >= 97 && x <= 122 || x >= 65 && x <= 90 || x >= 48 && x <= 57 || x === 95 || x === 36;
});
}
function Ze(d) {
return pe(d, (E) => {
const x = E.charCodeAt(0);
return x >= 48 && x <= 57;
});
}
function Ne(d) {
return pe(d, (E) => {
const x = E.charCodeAt(0);
return x >= 48 && x <= 57 || x >= 65 && x <= 70 || x >= 97 && x <= 102;
});
}
function fe(d) {
let u = "", E = "";
for (; u = Ze(d); )
E += u;
return E;
}
function ge(d) {
C(d);
const u = d.currentChar();
return u !== "%" && y(Y.EXPECTED_TOKEN, s(), 0, u), d.next(), "%";
}
function K(d) {
let u = "";
for (; ; ) {
const E = d.currentChar();
if (E === "{" || E === "}" || E === "@" || E === "|" || !E)
break;
if (E === "%")
if (te(d))
u += E, d.next();
else
break;
else if (E === Lt || E === je)
if (te(d))
u += E, d.next();
else {
if (X(d))
break;
u += E, d.next();
}
else
u += E, d.next();
}
return u;
}
function ue(d) {
C(d);
let u = "", E = "";
for (; u = le(d); )
E += u;
return d.currentChar() === Rt && y(Y.UNTERMINATED_CLOSING_BRACE, s(), 0), E;
}
function lt(d) {
C(d);
let u = "";
return d.currentChar() === "-" ? (d.next(), u += `-${fe(d)}`) : u += fe(d), d.currentChar() === Rt && y(Y.UNTERMINATED_CLOSING_BRACE, s(), 0), u;
}
function Ot(d) {
C(d), L(d, "'");
let u = "", E = "";
const x = (j) => j !== Ur && j !== je;
for (; u = pe(d, x); )
u === "\\" ? E += Ke(d) : E += u;
const W = d.currentChar();
return W === je || W === Rt ? (y(Y.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, s(), 0), W === je && (d.next(), L(d, "'")), E) : (L(d, "'"), E);
}
function Ke(d) {
const u = d.currentChar();
switch (u) {
case "\\":
case "'":
return d.next(), `\\${u}`;
case "u":
return Ve(d, u, 4);
case "U":
return Ve(d, u, 6);
default:
return y(Y.UNKNOWN_ESCAPE_SEQUENCE, s(), 0, u), "";
}
}
function Ve(d, u, E) {
L(d, u);
let x = "";
for (let W = 0; W < E; W++) {
const j = Ne(d);
if (!j) {
y(Y.INVALID_UNICODE_ESCAPE_SEQUENCE, s(), 0, `\\${u}${x}${d.currentChar()}`);
break;
}
x += j;
}
return `\\${u}${x}`;
}
function Xe(d) {
C(d);
let u = "", E = "";
const x = (W) => W !== "{" && W !== "}" && W !== Lt && W !== je;
for (; u = pe(d, x); )
E += u;
return E;
}
function we(d) {
let u = "", E = "";
for (; u = le(d); )
E += u;
return E;
}
function Qe(d) {
const u = (E = !1, x) => {
const W = d.currentChar();
return W === "{" || W === "%" || W === "@" || W === "|" || W === "(" || W === ")" || !W || W === Lt ? x : W === je || W === Ml ? (x += W, d.next(), u(E, x)) : (x += W, d.next(), u(!0, x));
};
return u(!1, "");
}
function Be(d) {
C(d);
const u = L(d, "|");
return C(d), u;
}
function de(d, u) {
let E = null;
switch (d.currentChar()) {
case "{":
return u.braceNest >= 1 && y(Y.NOT_ALLOW_NEST_PLACEHOLDER, s(), 0), d.next(), E = v(u, 2, "{"), C(d), u.braceNest++, E;
case "}":
return u.braceNest > 0 && u.currentType === 2 && y(Y.EMPTY_PLACEHOLDER, s(), 0), d.next(), E = v(u, 3, "}"), u.braceNest--, u.braceNest > 0 && C(d), u.inLinked && u.braceNest === 0 && (u.inLinked = !1), E;
case "@":
return u.braceNest > 0 && y(Y.UNTERMINATED_CLOSING_BRACE, s(), 0), E = $e(d, u) || b(u), u.braceNest = 0, E;
default:
let W = !0, j = !0, Oe = !0;
if (X(d))
return u.braceNest > 0 && y(Y.UNTERMINATED_CLOSING_BRACE, s(), 0), E = v(u, 1, Be(d)), u.braceNest = 0, u.inLinked = !1, E;
if (u.braceNest > 0 && (u.currentType === 5 || u.currentType === 6 || u.currentType === 7))
return y(Y.UNTERMINATED_CLOSING_BRACE, s(), 0), u.braceNest = 0, Te(d, u);
if (W = O(d, u))
return E = v(u, 5, ue(d)), C(d), E;
if (j = g(d, u))
return E = v(u, 6, lt(d)), C(d), E;
if (Oe = I(d, u))
return E = v(u, 7, Ot(d)), C(d), E;
if (!W && !j && !Oe)
return E = v(u, 13, Xe(d)), y(Y.INVALID_TOKEN_IN_PLACEHOLDER, s(), 0, E.value), C(d), E;
break;
}
return E;
}
function $e(d, u) {
const { currentType: E } = u;
let x = null;
const W = d.currentChar();
switch ((E === 8 || E === 9 || E === 12 || E === 10) && (W === je || W === Lt) && y(Y.INVALID_LINKED_FORMAT, s(), 0), W) {
case "@":
return d.next(), x = v(u, 8, "@"), u.inLinked = !0, x;
case ".":
return C(d), d.next(), v(u, 9, ".");
case ":":
return C(d), d.next(), v(u, 10, ":");
default:
return X(d) ? (x = v(u, 1, Be(d)), u.braceNest = 0, u.inLinked = !1, x) : N(d, u) || R(d, u) ? (C(d), $e(d, u)) : A(d, u) ? (C(d), v(u, 12, we(d))) : w(d, u) ? (C(d), W === "{" ? de(d, u) || x : v(u, 11, Qe(d))) : (E === 8 && y(Y.INVALID_LINKED_FORMAT, s(), 0), u.braceNest = 0, u.inLinked = !1, Te(d, u));
}
}
function Te(d, u) {
let E = { type: 14 };
if (u.braceNest > 0)
return de(d, u) || b(u);
if (u.inLinked)
return $e(d, u) || b(u);
switch (d.currentChar()) {
case "{":
return de(d, u) || b(u);
case "}":
return y(Y.UNBALANCED_CLOSING_BRACE, s(), 0), d.next(), v(u, 3, "}");
case "@":
return $e(d, u) || b(u);
default:
if (X(d))
return E = v(u, 1, Be(d)), u.braceNest = 0, u.inLinked = !1, E;
const { isModulo: W, hasSpace: j } = H(d);
if (W)
return j ? v(u, 0, K(d)) : v(u, 4, ge(d));
if (te(d))
return v(u, 0, K(d));
break;
}
return E;
}
function at() {
const { currentType: d, offset: u, startLoc: E, endLoc: x } = l;
return l.lastType = d, l.lastOffset = u, l.lastStartLoc = E, l.lastEndLoc = x, l.offset = r(), l.startLoc = s(), a.currentChar() === Rt ? v(l, 14) : Te(a, l);
}
return {
nextToken: at,
currentOffset: r,
currentPosition: s,
context: c
};
}
const Rl = "parser", Pl = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
function Vl(t, e, n) {
switch (t) {
case "\\\\":
return "\\";
case "\\'":
return "'";
default: {
const a = parseInt(e || n, 16);
return a <= 55295 || a >= 57344 ? String.fromCodePoint(a) : "\uFFFD";
}
}
}
function xl(t = {}) {
const e = t.location !== !1, { onError: n } = t;
function a(_, T, O, g, ...I) {
const N = _.currentPosition();
if (N.offset += g, N.column += g, n) {
const A = e ? Ya(O, N) : null, R = yn(T, A, {
domain: Rl,
args: I
});
n(R);
}
}
function r(_, T, O) {
const g = { type: _ };
return e && (g.start = T, g.end = T, g.loc = { start: O, end: O }), g;
}
function s(_, T, O, g) {
g && (_.type = g), e && (_.end = T, _.loc && (_.loc.end = O));
}
function i(_, T) {
const O = _.context(), g = r(3, O.offset, O.startLoc);
return g.value = T, s(g, _.currentOffset(), _.currentPosition()), g;
}
function o(_, T) {
const O = _.context(), { lastOffset: g, lastStartLoc: I } = O, N = r(5, g, I);
return N.index = parseInt(T, 10), _.nextToken(), s(N, _.currentOffset(), _.currentPosition()), N;
}
function l(_, T) {
const O = _.context(), { lastOffset: g, lastStartLoc: I } = O, N = r(4, g, I);
return N.key = T, _.nextToken(), s(N, _.currentOffset(), _.currentPosition()), N;
}
function c(_, T) {
const O = _.context(), { lastOffset: g, lastStartLoc: I } = O, N = r(9, g, I);
return N.value = T.replace(Pl, Vl), _.nextToken(), s(N, _.currentOffset(), _.currentPosition()), N;
}
function h(_) {
const T = _.nextToken(), O = _.context(), { lastOffset: g, lastStartLoc: I } = O, N = r(8, g, I);
return T.type !== 12 ? (a(_, Y.UNEXPECTED_EMPTY_LINKED_MODIFIER, O.lastStartLoc, 0), N.value = "", s(N, g, I), {
nextConsumeToken: T,
node: N
}) : (T.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, O.lastStartLoc, 0, Tt(T)), N.value = T.value || "", s(N, _.currentOffset(), _.currentPosition()), {
node: N
});
}
function y(_, T) {
const O = _.context(), g = r(7, O.offset, O.startLoc);
return g.value = T, s(g, _.currentOffset(), _.currentPosition()), g;
}
function v(_) {
const T = _.context(), O = r(6, T.offset, T.startLoc);
let g = _.nextToken();
if (g.type === 9) {
const I = h(_);
O.modifier = I.node, g = I.nextConsumeToken || _.nextToken();
}
switch (g.type !== 10 && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(g)), g = _.nextToken(), g.type === 2 && (g = _.nextToken()), g.type) {
case 11:
g.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(g)), O.key = y(_, g.value || "");
break;
case 5:
g.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(g)), O.key = l(_, g.value || "");
break;
case 6:
g.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(g)), O.key = o(_, g.value || "");
break;
case 7:
g.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(g)), O.key = c(_, g.value || "");
break;
default:
a(_, Y.UNEXPECTED_EMPTY_LINKED_KEY, T.lastStartLoc, 0);
const I = _.context(), N = r(7, I.offset, I.startLoc);
return N.value = "", s(N, I.offset, I.startLoc), O.key = N, s(O, I.offset, I.startLoc), {
nextConsumeToken: g,
node: O
};
}
return s(O, _.currentOffset(), _.currentPosition()), {
node: O
};
}
function b(_) {
const T = _.context(), O = T.currentType === 1 ? _.currentOffset() : T.offset, g = T.currentType === 1 ? T.endLoc : T.startLoc, I = r(2, O, g);
I.items = [];
let N = null;
do {
const w = N || _.nextToken();
switch (N = null, w.type) {
case 0:
w.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(w)), I.items.push(i(_, w.value || ""));
break;
case 6:
w.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(w)), I.items.push(o(_, w.value || ""));
break;
case 5:
w.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(w)), I.items.push(l(_, w.value || ""));
break;
case 7:
w.value == null && a(_, Y.UNEXPECTED_LEXICAL_ANALYSIS, T.lastStartLoc, 0, Tt(w)), I.items.push(c(_, w.value || ""));
break;
case 8:
const X = v(_);
I.items.push(X.node), N = X.nextConsumeToken || null;
break;
}
} while (T.currentType !== 14 && T.currentType !== 1);
const A = T.currentType === 1 ? T.lastOffset : _.currentOffset(), R = T.currentType === 1 ? T.lastEndLoc : _.currentPosition();
return s(I, A, R), I;
}
function L(_, T, O, g) {
const I = _.context();
let N = g.items.length === 0;
const A = r(1, T, O);
A.cases = [], A.cases.push(g);
do {
const R = b(_);
N || (N = R.items.length === 0), A.cases.push(R);
} while (I.currentType !== 14);
return N && a(_, Y.MUST_HAVE_MESSAGES_IN_PLURAL, O, 0), s(A, _.currentOffset(), _.currentPosition()), A;
}
function M(_) {
const T = _.context(), { offset: O, startLoc: g } = T, I = b(_);
return T.currentType === 14 ? I : L(_, O, g, I);
}
function C(_) {
const T = Fl(_, js({}, t)), O = T.context(), g = r(0, O.offset, O.startLoc);
return e && g.loc && (g.loc.source = _), g.body = M(T), t.onCacheKey && (g.cacheKey = t.onCacheKey(_)), O.currentType !== 14 && a(T, Y.UNEXPECTED_LEXICAL_ANALYSIS, O.lastStartLoc, 0, _[O.offset] || ""), s(g, T.currentOffset(), T.currentPosition()), g;
}
return { parse: C };
}
function Tt(t) {
if (t.type === 14)
return "EOF";
const e = (t.value || "").replace(/\r?\n/gu, "\\n");
return e.length > 10 ? e.slice(0, 9) + "\u2026" : e;
}
function Ul(t, e = {}) {
const n = {
ast: t,
helpers: /* @__PURE__ */ new Set()
};
return { context: () => n, helper: (s) => (n.helpers.add(s), s) };
}
function $r(t, e) {
for (let n = 0; n < t.length; n++)
hr(t[n], e);
}
function hr(t, e) {
switch (t.type) {
case 1:
$r(t.cases, e), e.helper("plural");
break;
case 2:
$r(t.items, e);
break;
case 6:
hr(t.key, e), e.helper("linked"), e.helper("type");
break;
case 5:
e.helper("interpolate"), e.helper("list");
break;
case 4:
e.helper("interpolate"), e.helper("named");
break;
}
}
function $l(t, e = {}) {
const n = Ul(t);
n.helper("normalize"), t.body && hr(t.body, n);
const a = n.context();
t.helpers = Array.from(a.helpers);
}
function Wl(t) {
const e = t.body;
return e.type === 2 ? Wr(e) : e.cases.forEach((n) => Wr(n)), t;
}
function Wr(t) {
if (t.items.length === 1) {
const e = t.items[0];
(e.type === 3 || e.type === 9) && (t.static = e.value, delete e.value);
} else {
const e = [];
for (let n = 0; n < t.items.length; n++) {
const a = t.items[n];
if (!(a.type === 3 || a.type === 9) || a.value == null)
break;
e.push(a.value);
}
if (e.length === t.items.length) {
t.static = qs(e);
for (let n = 0; n < t.items.length; n++) {
const a = t.items[n];
(a.type === 3 || a.type === 9) && delete a.value;
}
}
}
}
const Hl = "minifier";
function dn(t) {
switch (t.t = t.type, t.type) {
case 0:
const e = t;
dn(e.body), e.b = e.body, delete e.body;
break;
case 1:
const n = t, a = n.cases;
for (let h = 0; h < a.length; h++)
dn(a[h]);
n.c = a, delete n.cases;
break;
case 2:
const r = t, s = r.items;
for (let h = 0; h < s.length; h++)
dn(s[h]);
r.i = s, delete r.items, r.static && (r.s = r.static, delete r.static);
break;
case 3:
case 9:
case 8:
case 7:
const i = t;
i.value && (i.v = i.value, delete i.value);
break;
case 6:
const o = t;
dn(o.key), o.k = o.key, delete o.key, o.modifier && (dn(o.modifier), o.m = o.modifier, delete o.modifier);
break;
case 5:
const l = t;
l.i = l.index, delete l.index;
break;
case 4:
const c = t;
c.k = c.key, delete c.key;
break;
default:
throw yn(Y.UNHANDLED_MINIFIER_NODE_TYPE, null, {
domain: Hl,
args: [t.type]
});
}
delete t.type;
}
const zl = "parser";
function Gl(t, e) {
const { sourceMap: n, filename: a, breakLineCode: r, needIndent: s } = e, i = e.location !== !1, o = {
filename: a,
code: "",
column: 1,
line: 1,
offset: 0,
map: void 0,
breakLineCode: r,
needIndent: s,
indentLevel: 0
};
i && t.loc && (o.source = t.loc.source);
const l = () => o;
function c(C, _) {
o.code += C;
}
function h(C, _ = !0) {
const T = _ ? r : "";
c(s ? T + " ".repeat(C) : T);
}
function y(C = !0) {
const _ = ++o.indentLevel;
C && h(_);
}
function v(C = !0) {
const _ = --o.indentLevel;
C && h(_);
}
function b() {
h(o.indentLevel);
}
return {
context: l,
push: c,
indent: y,
deindent: v,
newline: b,
helper: (C) => `_${C}`,
needIndent: () => o.needIndent
};
}
function Yl(t, e) {
const { helper: n } = t;
t.push(`${n("linked")}(`), _n(t, e.key), e.modifier ? (t.push(", "), _n(t, e.modifier), t.push(", _type")) : t.push(", undefined, _type"), t.push(")");
}
function Zl(t, e) {
const { helper: n, needIndent: a } = t;
t.push(`${n("normalize")}([`), t.indent(a());
const r = e.items.length;
for (let s = 0; s < r && (_n(t, e.items[s]), s !== r - 1); s++)
t.push(", ");
t.deindent(a()), t.push("])");
}
function Bl(t, e) {
const { helper: n, needIndent: a } = t;
if (e.cases.length > 1) {
t.push(`${n("plural")}([`), t.indent(a());
const r = e.cases.length;
for (let s = 0; s < r && (_n(t, e.cases[s]), s !== r - 1); s++)
t.push(", ");
t.deindent(a()), t.push("])");
}
}
function jl(t, e) {
e.body ? _n(t, e.body) : t.push("null");
}
function _n(t, e) {
const { helper: n } = t;
switch (e.type) {
case 0:
jl(t, e);
break;
case 1:
Bl(t, e);
break;
case 2:
Zl(t, e);
break;
case 6:
Yl(t, e);
break;
case 8:
t.push(JSON.stringify(e.value), e);
break;
case 7:
t.push(JSON.stringify(e.value), e);
break;
case 5:
t.push(`${n("interpolate")}(${n("list")}(${e.index}))`, e);
break;
case 4:
t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`, e);
break;
case 9:
t.push(JSON.stringify(e.value), e);
break;
case 3:
t.push(JSON.stringify(e.value), e);
break;
default:
throw yn(Y.UNHANDLED_CODEGEN_NODE_TYPE, null, {
domain: zl,
args: [e.type]
});
}
}
const ql = (t, e = {}) => {
const n = xr(e.mode) ? e.mode : "normal", a = xr(e.filename) ? e.filename : "message.intl", r = !!e.sourceMap, s = e.breakLineCode != null ? e.breakLineCode : n === "arrow" ? ";" : `
`, i = e.needIndent ? e.needIndent : n !== "arrow", o = t.helpers || [], l = Gl(t, {
mode: n,
filename: a,
sourceMap: r,
breakLineCode: s,
needIndent: i
});
l.push(n === "normal" ? "function __msg__ (ctx) {" : "(ctx) => {"), l.indent(i), o.length > 0 && (l.push(`const { ${qs(o.map((y) => `${y}: _${y}`), ", ")} } = ctx`), l.newline()), l.push("return "), _n(l, t), l.deindent(i), l.push("}"), delete t.helpers;
const { code: c, map: h } = l.context();
return {
ast: t,
code: c,
map: h ? h.toJSON() : void 0
};
};
function Jl(t, e = {}) {
const n = js({}, e), a = !!n.jit, r = !!n.minify, s = n.optimize == null ? !0 : n.optimize, o = xl(n).parse(t);
return a ? (s && Wl(o), r && dn(o), { ast: o, code: "" }) : ($l(o, n), ql(o, n));
}
/*!
* core-base v9.5.0
* (c) 2023 kazuya kawaguchi
* Released under the MIT License.
*/
function Kl() {
typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (wt().__INTLIFY_PROD_DEVTOOLS__ = !1), typeof __INTLIFY_JIT_COMPILATION__ != "boolean" && (wt().__INTLIFY_JIT_COMPILATION__ = !1), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (wt().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1);
}
const Gt = [];
Gt[0] = {
w: [0],
i: [3, 0],
["["]: [4],
o: [7]
};
Gt[1] = {
w: [1],
["."]: [2],
["["]: [4],
o: [7]
};
Gt[2] = {
w: [2],
i: [3, 0],
[0]: [3, 0]
};
Gt[3] = {
i: [3, 0],
[0]: [3, 0],
w: [1, 1],
["."]: [2, 1],
["["]: [4, 1],
o: [7, 1]
};
Gt[4] = {
["'"]: [5, 0],
['"']: [6, 0],
["["]: [
4,
2
],
["]"]: [1, 3],
o: 8,
l: [4, 0]
};
Gt[5] = {
["'"]: [4, 0],
o: 8,
l: [5, 0]
};
Gt[6] = {
['"']: [4, 0],
o: 8,
l: [6, 0]
};
const Xl = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
function Ql(t) {
return Xl.test(t);
}
function eu(t) {
const e = t.charCodeAt(0), n = t.charCodeAt(t.length - 1);
return e === n && (e === 34 || e === 39) ? t.slice(1, -1) : t;
}
function tu(t) {
if (t == null)
return "o";
switch (t.charCodeAt(0)) {
case 91:
case 93:
case 46:
case 34:
case 39:
return t;
case 95:
case 36:
case 45:
return "i";
case 9:
case 10:
case 13:
case 160:
case 65279:
case 8232:
case 8233:
return "w";
}
return "i";
}
function nu(t) {
const e = t.trim();
return t.charAt(0) === "0" && isNaN(parseInt(t)) ? !1 : Ql(e) ? eu(e) : "*" + e;
}
function au(t) {
const e = [];
let n = -1, a = 0, r = 0, s, i, o, l, c, h, y;
const v = [];
v[0] = () => {
i === void 0 ? i = o : i += o;
}, v[1] = () => {
i !== void 0 && (e.push(i), i = void 0);
}, v[2] = () => {
v[0](), r++;
}, v[3] = () => {
if (r > 0)
r--, a = 4, v[0]();
else {
if (r = 0, i === void 0 || (i = nu(i), i === !1))
return !1;
v[1]();
}
};
function b() {
const L = t[n + 1];
if (a === 5 && L === "'" || a === 6 && L === '"')
return n++, o = "\\" + L, v[0](), !0;
}
for (; a !== null; )
if (n++, s = t[n], !(s === "\\" && b())) {
if (l = tu(s), y = Gt[a], c = y[l] || y.l || 8, c === 8 || (a = c[0], c[1] !== void 0 && (h = v[c[1]], h && (o = s, h() === !1))))
return;
if (a === 7)
return e;
}
}
const Hr = /* @__PURE__ */ new Map();
function ru(t, e) {
return re(t) ? t[e] : null;
}
function su(t, e) {
if (!re(t))
return null;
let n = Hr.get(e);
if (n || (n = au(e), n && Hr.set(e, n)), !n)
return null;
const a = n.length;
let r = t, s = 0;
for (; s < a; ) {
const i = r[n[s]];
if (i === void 0)
return null;
r = i, s++;
}
return r;
}
const iu = (t) => t, ou = (t) => "", lu = "text", uu = (t) => t.length === 0 ? "" : vl(t), cu = gl;
function zr(t, e) {
return t = Math.abs(t), e === 2 ? t ? t > 1 ? 1 : 0 : 1 : t ? Math.min(t, 2) : 0;
}
function fu(t) {
const e = Ae(t.pluralIndex) ? t.pluralIndex : -1;
return t.named && (Ae(t.named.count) || Ae(t.named.n)) ? Ae(t.named.count) ? t.named.count : Ae(t.named.n) ? t.named.n : e : e;
}
function du(t, e) {
e.count || (e.count = t), e.n || (e.n = t);
}
function mu(t = {}) {
const e = t.locale, n = fu(t), a = re(t.pluralRules) && P(e) && ye(t.pluralRules[e]) ? t.pluralRules[e] : zr, r = re(t.pluralRules) && P(e) && ye(t.pluralRules[e]) ? zr : void 0, s = (_) => _[a(n, _.length, r)], i = t.list || [], o = (_) => i[_], l = t.named || {};
Ae(t.pluralIndex) && du(n, l);
const c = (_) => l[_];
function h(_) {
const T = ye(t.messages) ? t.messages(_) : re(t.messages) ? t.messages[_] : !1;
return T || (t.parent ? t.parent.message(_) : ou);
}
const y = (_) => t.modifiers ? t.modifiers[_] : iu, v = B(t.processor) && ye(t.processor.normalize) ? t.processor.normalize : uu, b = B(t.processor) && ye(t.processor.interpolate) ? t.processor.interpolate : cu, L = B(t.processor) && P(t.processor.type) ? t.processor.type : lu, C = {
list: o,
named: c,
plural: s,
linked: (_, ...T) => {
const [O, g] = T;
let I = "text", N = "";
T.length === 1 ? re(O) ? (N = O.modifier || N, I = O.type || I) : P(O) && (N = O || N) : T.length === 2 && (P(O) && (N = O || N), P(g) && (I = g || I));
const A = h(_)(C), R = I === "vnode" && ce(A) && N ? A[0] : A;
return N ? y(N)(R, I) : R;
},
message: h,
type: L,
interpolate: b,
normalize: v,
values: Ue({}, i, l)
};
return C;
}
let xn = null;
function hu(t) {
xn = t;
}
function _u(t, e, n) {
xn && xn.emit("i18n:init", {
timestamp: Date.now(),
i18n: t,
version: e,
meta: n
});
}
const gu = /* @__PURE__ */ vu("function:translate");
function vu(t) {
return (e) => xn && xn.emit(t, e);
}
const qe = {
NOT_FOUND_KEY: 1,
FALLBACK_TO_TRANSLATE: 2,
CANNOT_FORMAT_NUMBER: 3,
FALLBACK_TO_NUMBER_FORMAT: 4,
CANNOT_FORMAT_DATE: 5,
FALLBACK_TO_DATE_FORMAT: 6,
EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7,
__EXTEND_POINT__: 8
}, yu = {
[qe.NOT_FOUND_KEY]: "Not found '{key}' key in '{locale}' locale messages.",
[qe.FALLBACK_TO_TRANSLATE]: "Fall back to translate '{key}' key with '{target}' locale.",
[qe.CANNOT_FORMAT_NUMBER]: "Cannot format a number value due to not supported Intl.NumberFormat.",
[qe.FALLBACK_TO_NUMBER_FORMAT]: "Fall back to number format '{key}' key with '{target}' locale.",
[qe.CANNOT_FORMAT_DATE]: "Cannot format a date value due to not supported Intl.DateTimeFormat.",
[qe.FALLBACK_TO_DATE_FORMAT]: "Fall back to datetime format '{key}' key with '{target}' locale.",
[qe.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: "This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."
};
function tn(t, ...e) {
return cr(yu[t], ...e);
}
function _r(t, e) {
return e.locale != null ? Gr(e.locale) : Gr(t.locale);
}
let Fa;
function Gr(t) {
return P(t) ? t : Fa != null && t.resolvedOnce ? Fa : Fa = t();
}
function pu(t, e, n) {
return [.../* @__PURE__ */ new Set([
n,
...ce(e) ? e : re(e) ? Object.keys(e) : P(e) ? [e] : [n]
])];
}
function Js(t, e, n) {
const a = P(n) ? n : gn, r = t;
r.__localeChainCache || (r.__localeChainCache = /* @__PURE__ */ new Map());
let s = r.__localeChainCache.get(a);
if (!s) {
s = [];
let i = [n];
for (; ce(i); )
i = Yr(s, i, e);
const o = ce(e) || !B(e) ? e : e.default ? e.default : null;
i = P(o) ? [o] : o, ce(i) && Yr(s, i, !1), r.__localeChainCache.set(a, s);
}
return s;
}
function Yr(t, e, n) {
let a = !0;
for (let r = 0; r < e.length && J(a); r++) {
const s = e[r];
P(s) && (a = Eu(t, e[r], n));
}
return a;
}
function Eu(t, e, n) {
let a;
const r = e.split("-");
do {
const s = r.join("-");
a = bu(t, s, n), r.splice(-1, 1);
} while (r.length && a === !0);
return a;
}
function bu(t, e, n) {
let a = !1;
if (!t.includes(e) && (a = !0, e)) {
a = e[e.length - 1] !== "!";
const r = e.replace(/!/g, "");
t.push(r), (ce(n) || B(n)) && n[r] && (a = n[r]);
}
return a;
}
const Tu = "9.5.0", pa = -1, gn = "en-US", ma = "", Zr = (t) => `${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;
function Nu() {
return {
upper: (t, e) => e === "text" && P(t) ? t.toUpperCase() : e === "vnode" && re(t) && "__v_isVNode" in t ? t.children.toUpperCase() : t,
lower: (t, e) => e === "text" && P(t) ? t.toLowerCase() : e === "vnode" && re(t) && "__v_isVNode" in t ? t.children.toLowerCase() : t,
capitalize: (t, e) => e === "text" && P(t) ? Zr(t) : e === "vnode" && re(t) && "__v_isVNode" in t ? Zr(t.children) : t
};
}
let Ks;
function Br(t) {
Ks = t;
}
let Xs;
function Ou(t) {
Xs = t;
}
let Qs;
function ku(t) {
Qs = t;
}
let ei = null;
const jr = (t) => {
ei = t;
}, Su = () => ei;
let ti = null;
const qr = (t) => {
ti = t;
}, Iu = () => ti;
let Jr = 0;
function Lu(t = {}) {
const e = ye(t.onWarn) ? t.onWarn : Pe, n = P(t.version) ? t.version : Tu, a = P(t.locale) || ye(t.locale) ? t.locale : gn, r = ye(a) ? gn : a, s = ce(t.fallbackLocale) || B(t.fallbackLocale) || P(t.fallbackLocale) || t.fallbackLocale === !1 ? t.fallbackLocale : r, i = B(t.messages) ? t.messages : { [r]: {} }, o = B(t.datetimeFormats) ? t.datetimeFormats : { [r]: {} }, l = B(t.numberFormats) ? t.numberFormats : { [r]: {} }, c = Ue({}, t.modifiers || {}, Nu()), h = t.pluralRules || {}, y = ye(t.missing) ? t.missing : null, v = J(t.missingWarn) || zt(t.missingWarn) ? t.missingWarn : !0, b = J(t.fallbackWarn) || zt(t.fallbackWarn) ? t.fallbackWarn : !0, L = !!t.fallbackFormat, M = !!t.unresolving, C = ye(t.postTranslation) ? t.postTranslation : null, _ = B(t.processor) ? t.processor : null, T = J(t.warnHtmlMessage) ? t.warnHtmlMessage : !0, O = !!t.escapeParameter, g = ye(t.messageCompiler) ? t.messageCompiler : Ks;
process.env.NODE_ENV !== "production" && !0 && !0 && ye(t.messageCompiler) && pl(tn(qe.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));
const I = ye(t.messageResolver) ? t.messageResolver : Xs || ru, N = ye(t.localeFallbacker) ? t.localeFallbacker : Qs || pu, A = re(t.fallbackContext) ? t.fallbackContext : void 0, R = t, w = re(R.__datetimeFormatters) ? R.__datetimeFormatters : /* @__PURE__ */ new Map(), X = re(R.__numberFormatters) ? R.__numberFormatters : /* @__PURE__ */ new Map(), H = re(R.__meta) ? R.__meta : {};
Jr++;
const te = {
version: n,
cid: Jr,
locale: a,
fallbackLocale: s,
messages: i,
modifiers: c,
pluralRules: h,
missing: y,
missingWarn: v,
fallbackWarn: b,
fallbackFormat: L,
unresolving: M,
postTranslation: C,
processor: _,
warnHtmlMessage: T,
escapeParameter: O,
messageCompiler: g,
messageResolver: I,
localeFallbacker: N,
fallbackContext: A,
onWarn: e,
__meta: H
};
return te.datetimeFormats = o, te.numberFormats = l, te.__datetimeFormatters = w, te.__numberFormatters = X, process.env.NODE_ENV !== "production" && (te.__v_emitter = R.__v_emitter != null ? R.__v_emitter : void 0), (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) && _u(te, n, H), te;
}
function Ea(t, e) {
return t instanceof RegExp ? t.test(e) : t;
}
function ni(t, e) {
return t instanceof RegExp ? t.test(e) : t;
}
function gr(t, e, n, a, r) {
const { missing: s, onWarn: i } = t;
if (process.env.NODE_ENV !== "production") {
const o = t.__v_emitter;
o && o.emit("missing", {
locale: n,
key: e,
type: r,
groupId: `${r}:${e}`
});
}
if (s !== null) {
const o = s(t, n, e, r);
return P(o) ? o : e;
} else
return process.env.NODE_ENV !== "production" && ni(a, e) && i(tn(qe.NOT_FOUND_KEY, { key: e, locale: n })), e;
}
function Ln(t, e, n) {
const a = t;
a.__localeChainCache = /* @__PURE__ */ new Map(), t.localeFallbacker(t, n, e);
}
function Ra(t) {
return (n) => wu(n, t);
}
function wu(t, e) {
const n = e.b || e.body;
if ((n.t || n.type) === 1) {
const a = n, r = a.c || a.cases;
return t.plural(r.reduce((s, i) => [
...s,
Kr(t, i)
], []));
} else
return Kr(t, n);
}
function Kr(t, e) {
const n = e.s || e.static;
if (n)
return t.type === "text" ? n : t.normalize([n]);
{
const a = (e.i || e.items).reduce((r, s) => [...r, Za(t, s)], []);
return t.normalize(a);
}
}
function Za(t, e) {
const n = e.t || e.type;
switch (n) {
case 3:
const a = e;
return a.v || a.value;
case 9:
const r = e;
return r.v || r.value;
case 4:
const s = e;
return t.interpolate(t.named(s.k || s.key));
case 5:
const i = e;
return t.interpolate(t.list(i.i != null ? i.i : i.index));
case 6:
const o = e, l = o.m || o.modifier;
return t.linked(Za(t, o.k || o.key), l ? Za(t, l) : void 0, t.type);
case 7:
const c = e;
return c.v || c.value;
case 8:
const h = e;
return h.v || h.value;
default:
throw new Error(`unhandled node type on format message part: ${n}`);
}
}
const ai = Y.__EXTEND_POINT__, ea = dr(ai), ft = {
INVALID_ARGUMENT: ai,
INVALID_DATE_ARGUMENT: ea(),
INVALID_ISO_DATE_ARGUMENT: ea(),
NOT_SUPPORT_NON_STRING_MESSAGE: ea(),
__EXTEND_POINT__: ea()
};
function Kt(t) {
return yn(t, null, process.env.NODE_ENV !== "production" ? { messages: Cu } : void 0);
}
const Cu = {
[ft.INVALID_ARGUMENT]: "Invalid arguments",
[ft.INVALID_DATE_ARGUMENT]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
[ft.INVALID_ISO_DATE_ARGUMENT]: "The argument provided is not a valid ISO date string",
[ft.NOT_SUPPORT_NON_STRING_MESSAGE]: "Not support non-string message"
}, Du = "Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";
function ri(t, e) {
e && Il(t) && Pe(cr(Du, { source: t }));
}
const si = (t) => t;
let mn = /* @__PURE__ */ Object.create(null);
const nn = (t) => re(t) && (t.t === 0 || t.type === 0) && ("b" in t || "body" in t);
function ii(t, e = {}) {
let n = !1;
const a = e.onError || kl;
return e.onError = (r) => {
n = !0, a(r);
}, { ...Jl(t, e), detectError: n };
}
const Mu = (t, e) => {
if (!P(t))
throw Kt(ft.NOT_SUPPORT_NON_STRING_MESSAGE);
{
const n = J(e.warnHtmlMessage) ? e.warnHtmlMessage : !0;
process.env.NODE_ENV !== "production" && ri(t, n);
const r = (e.onCacheKey || si)(t), s = mn[r];
if (s)
return s;
const { code: i, detectError: o } = ii(t, e), l = new Function(`return ${i}`)();
return o ? l : mn[r] = l;
}
};
function Au(t, e) {
if (__INTLIFY_JIT_COMPILATION__ && !__INTLIFY_DROP_MESSAGE_COMPILER__ && P(t)) {
const n = J(e.warnHtmlMessage) ? e.warnHtmlMessage : !0;
process.env.NODE_ENV !== "production" && ri(t, n);
const r = (e.onCacheKey || si)(t), s = mn[r];
if (s)
return s;
const { ast: i, detectError: o } = ii(t, {
...e,
location: process.env.NODE_ENV !== "production",
jit: !0
}), l = Ra(i);
return o ? l : mn[r] = l;
} else {
if (process.env.NODE_ENV !== "production" && !nn(t))
return Pe(`the message that is resolve with key '${e.key}' is not supported for jit compilation`), () => t;
const n = t.cacheKey;
if (n) {
const a = mn[n];
return a || (mn[n] = Ra(t));
} else
return Ra(t);
}
}
const Xr = () => "", yt = (t) => ye(t);
function Qr(t, ...e) {
const { fallbackFormat: n, postTranslation: a, unresolving: r, messageCompiler: s, fallbackLocale: i, messages: o } = t, [l, c] = Ba(...e), h = J(c.missingWarn) ? c.missingWarn : t.missingWarn, y = J(c.fallbackWarn) ? c.fallbackWarn : t.fallbackWarn, v = J(c.escapeParameter) ? c.escapeParameter : t.escapeParameter, b = !!c.resolvedMessage, L = P(c.default) || J(c.default) ? J(c.default) ? s ? l : () => l : c.default : n ? s ? l : () => l : "", M = n || L !== "", C = _r(t, c);
v && Fu(c);
let [_, T, O] = b ? [
l,
C,
o[C] || {}
] : oi(t, l, C, i, y, h), g = _, I = l;
if (!b && !(P(g) || nn(g) || yt(g)) && M && (g = L, I = g), !b && (!(P(g) || nn(g) || yt(g)) || !P(T)))
return r ? pa : l;
if (process.env.NODE_ENV !== "production" && P(g) && t.messageCompiler == null)
return Pe(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${l}'.`), l;
let N = !1;
const A = () => {
N = !0;
}, R = yt(