UNPKG

@smals-belgium-shared/vidis-diarynote

Version:

Diary notes web component

1,206 lines 1.66 MB
var BZ = Object.defineProperty; var _g = (e) => { throw TypeError(e); }; var HZ = (e, t, n) => t in e ? BZ(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var o = (e, t, n) => HZ(e, typeof t != "symbol" ? t + "" : t, n), xg = (e, t, n) => t.has(e) || _g("Cannot " + n); var Zt = (e, t, n) => (xg(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Yr = (e, t, n) => t.has(e) ? _g("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), wg = (e, t, n, i) => (xg(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n); var $Z = Object.create, gd = Object.defineProperty, qZ = Object.defineProperties, UZ = Object.getOwnPropertyDescriptor, GZ = Object.getOwnPropertyDescriptors, YZ = Object.getOwnPropertyNames, Ec = Object.getOwnPropertySymbols, WZ = Object.getPrototypeOf, Bp = Object.prototype.hasOwnProperty, Ny = Object.prototype.propertyIsEnumerable, Sg = (e, t, n) => t in e ? gd(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, J = (e, t) => { for (var n in t || (t = {})) Bp.call(t, n) && Sg(e, n, t[n]); if (Ec) for (var n of Ec(t)) Ny.call(t, n) && Sg(e, n, t[n]); return e; }, Qe = (e, t) => qZ(e, GZ(t)), ZZ = (e, t) => { var n = {}; for (var i in e) Bp.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]); if (e != null && Ec) for (var i of Ec(e)) t.indexOf(i) < 0 && Ny.call(e, i) && (n[i] = e[i]); return n; }, ye = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Pe = (e, t) => { for (var n in t) gd(e, n, { get: t[n], enumerable: !0 }); }, KZ = (e, t, n, i) => { if (t && typeof t == "object" || typeof t == "function") for (let a of YZ(t)) !Bp.call(e, a) && a !== n && gd(e, a, { get: () => t[a], enumerable: !(i = UZ(t, a)) || i.enumerable }); return e; }, My = (e, t, n) => (n = e != null ? $Z(WZ(e)) : {}, KZ(t || !e || !e.__esModule ? gd(n, "default", { value: e, enumerable: !0 }) : n, e)), Rt = (e, t, n) => new Promise((i, a) => { var r = (c) => { try { l(n.next(c)); } catch (d) { a(d); } }, s = (c) => { try { l(n.throw(c)); } catch (d) { a(d); } }, l = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(r, s); l((n = n.apply(e, t)).next()); }), XZ = ye((e, t) => { (function(n, i) { typeof e == "object" && typeof t < "u" ? t.exports = i() : typeof define == "function" && define.amd ? define(i) : (n = typeof globalThis < "u" ? globalThis : n || self, n.MessageFormat = i()); })(e, function() { var n = function() { return n = Object.assign || function(p) { for (var f, b = 1, y = arguments.length; b < y; b++) { f = arguments[b]; for (var _ in f) Object.prototype.hasOwnProperty.call(f, _) && (p[_] = f[_]); } return p; }, n.apply(this, arguments); }; function i(p) { var f = typeof Symbol == "function" && Symbol.iterator, b = f && p[f], y = 0; if (b) return b.call(p); if (p && typeof p.length == "number") return { next: function() { return p && y >= p.length && (p = void 0), { value: p && p[y++], done: !p }; } }; throw new TypeError(f ? "Object is not iterable." : "Symbol.iterator is not defined."); } function a(p, f) { var b = typeof Symbol == "function" && p[Symbol.iterator]; if (!b) return p; var y = b.call(p), _, k = [], C; try { for (; (f === void 0 || f-- > 0) && !(_ = y.next()).done; ) k.push(_.value); } catch (O) { C = { error: O }; } finally { try { _ && !_.done && (b = y.return) && b.call(y); } finally { if (C) throw C.error; } } return k; } function r(p, f, b) { if (arguments.length === 2) for (var y = 0, _ = f.length, k; y < _; y++) (k || !(y in f)) && (k || (k = Array.prototype.slice.call(f, 0, y)), k[y] = f[y]); return p.concat(k || Array.prototype.slice.call(f)); } typeof SuppressedError == "function" && SuppressedError; class s extends Error { constructor(f, b, y) { super(f), this.token = b, this.type = y || "error"; } } let l = (p) => p < 4 ? "short" : p === 4 ? "long" : "narrow", c = (p) => p % 2 === 0 ? "2-digit" : "numeric"; function d(p, f) { switch (p.char) { case "y": return { year: c(p.width) }; case "r": return { calendar: "gregory", year: "numeric" }; default: return f(`${p.desc} is not supported; falling back to year:numeric`, s.WARNING), { year: "numeric" }; } } function u(p, f) { switch (p.width) { case 1: return "numeric"; case 2: return "2-digit"; case 3: return "short"; case 4: return "long"; case 5: return "narrow"; default: f(`${p.desc} is not supported with width ${p.width}`); return; } } function m(p, f) { let { char: b, desc: y, width: _ } = p; if (b === "d") return c(_); f(`${y} is not supported`); } function v(p, f) { let { char: b, desc: y, width: _ } = p; if ((b === "c" || b === "e") && _ < 3) { let k = `Numeric value is not supported for ${y}; falling back to weekday:short`; f(k, s.WARNING); } return l(_); } function g(p) { let f = c(p.width), b; switch (p.char) { case "h": b = "h12"; break; case "H": b = "h23"; break; case "k": b = "h24"; break; case "K": b = "h11"; break; } return b ? { hour: f, hourCycle: b } : { hour: f }; } function w(p, f) { let { char: b, desc: y, width: _ } = p; switch (b) { case "v": case "z": return _ === 4 ? "long" : "short"; case "V": if (_ === 4) return "long"; f(`${y} is not supported with width ${_}`); return; case "X": f(`${y} is not supported`); return; } return "short"; } function S(p, f) { switch (p.field) { case "era": return { era: l(p.width) }; case "year": return d(p, f); case "month": return { month: u(p, f) }; case "day": return { day: m(p, f) }; case "weekday": return { weekday: v(p, f) }; case "period": return; case "hour": return g(p); case "min": return { minute: c(p.width) }; case "sec": return { second: c(p.width) }; case "tz": return { timeZoneName: w(p, f) }; case "quarter": case "week": case "sec-frac": case "ms": f(`${p.desc} is not supported`); } } function E(p, f) { let b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : (k) => { throw k; }, y = { timeZone: f }, _ = []; for (let k of p) { let { error: C, field: O, str: R } = k; if (C) { let ge = new s(C.message, k); ge.stack = C.stack, b(ge); } if (R) { let ge = `Ignoring string part: ${R}`; b(new s(ge, k, s.WARNING)); } O && (_.indexOf(O) === -1 ? _.push(O) : b(new s(`Duplicate ${O} token`, k))); let G = S(k, (ge, Ae) => b(new s(ge, k, Ae))); G && Object.assign(y, G); } return y; } let N = { G: { field: "era", desc: "Era" }, y: { field: "year", desc: "Year" }, Y: { field: "year", desc: 'Year of "Week of Year"' }, u: { field: "year", desc: "Extended year" }, U: { field: "year", desc: "Cyclic year name" }, r: { field: "year", desc: "Related Gregorian year" }, Q: { field: "quarter", desc: "Quarter" }, q: { field: "quarter", desc: "Stand-alone quarter" }, M: { field: "month", desc: "Month in year" }, L: { field: "month", desc: "Stand-alone month in year" }, w: { field: "week", desc: "Week of year" }, W: { field: "week", desc: "Week of month" }, d: { field: "day", desc: "Day in month" }, D: { field: "day", desc: "Day of year" }, F: { field: "day", desc: "Day of week in month" }, g: { field: "day", desc: "Modified julian day" }, E: { field: "weekday", desc: "Day of week" }, e: { field: "weekday", desc: "Local day of week" }, c: { field: "weekday", desc: "Stand-alone local day of week" }, a: { field: "period", desc: "AM/PM marker" }, b: { field: "period", desc: "AM/PM/noon/midnight marker" }, B: { field: "period", desc: "Flexible day period" }, h: { field: "hour", desc: "Hour in AM/PM (1~12)" }, H: { field: "hour", desc: "Hour in day (0~23)" }, k: { field: "hour", desc: "Hour in day (1~24)" }, K: { field: "hour", desc: "Hour in AM/PM (0~11)" }, j: { field: "hour", desc: "Hour in preferred cycle" }, J: { field: "hour", desc: "Hour in preferred cycle without marker" }, C: { field: "hour", desc: "Hour in preferred cycle with flexible marker" }, m: { field: "min", desc: "Minute in hour" }, s: { field: "sec", desc: "Second in minute" }, S: { field: "sec-frac", desc: "Fractional second" }, A: { field: "ms", desc: "Milliseconds in day" }, z: { field: "tz", desc: "Time Zone: specific non-location" }, Z: { field: "tz", desc: "Time Zone" }, O: { field: "tz", desc: "Time Zone: localized" }, v: { field: "tz", desc: "Time Zone: generic non-location" }, V: { field: "tz", desc: "Time Zone: ID" }, X: { field: "tz", desc: "Time Zone: ISO8601 with Z" }, x: { field: "tz", desc: "Time Zone: ISO8601" } }, L = (p) => p >= "A" && p <= "Z" || p >= "a" && p <= "z"; function P(p, f) { let b = p[f], y = 1; for (; p[++f] === b; ) ++y; let _ = N[b]; if (!_) { let k = `The letter ${b} is not a valid field identifier`; return { char: b, error: new Error(k), width: y }; } return { char: b, field: _.field, desc: _.desc, width: y }; } function se(p, f) { let b = p[++f], y = 2; if (b === "'") return { char: "'", str: b, width: y }; for (; ; ) { let _ = p[++f]; if (++y, _ === void 0) { let k = `Unterminated quoted literal in pattern: ${b || p}`; return { char: "'", error: new Error(k), str: b, width: y }; } else if (_ === "'") { if (p[++f] !== "'") return { char: "'", str: b, width: y }; ++y; } b += _; } } function ke(p, f) { let b = p[f]; if (!b) return null; if (L(b)) return P(p, f); if (b === "'") return se(p, f); let y = b, _ = 1; for (; ; ) { let k = p[++f]; if (!k || L(k) || k === "'") return { char: b, str: y, width: _ }; y += k, _ += 1; } } function ze(p) { let f = [], b = 0; for (; ; ) { let y = ke(p, b); if (!y) return f; f.push(y), b += y.width; } } function ti(p, f, b, y) { typeof f == "string" && (f = ze(f)), typeof b == "function" && (y = b, b = void 0); let _ = E(f, b, y), k = new Intl.DateTimeFormat(p, _); return (C) => k.format(C); } function jt(p, f, b, y) { typeof f == "string" && (f = ze(f)), typeof b == "function" && (y = b, b = void 0); let _ = E(f, b, y); return ["(function() {", `var opt = ${JSON.stringify(_)};`, `var dtf = new Intl.DateTimeFormat(${JSON.stringify(p)}, opt);`, "return function(value) { return dtf.format(value); }"].join(` `) + ` })()`; } class wt extends Error { constructor(f, b) { super(b), this.code = f; } } class Yt extends wt { constructor(f, b) { super("BAD_OPTION", `Unknown ${f} option: ${b}`), this.stem = f, this.option = b; } } class oe extends wt { constructor(f) { super("BAD_STEM", `Unknown stem: ${f}`), this.stem = f; } } class ee extends wt { constructor(f, b) { super("MASKED_VALUE", `Value for ${f} is set multiple times`), this.type = f, this.prev = b; } } class $e extends wt { constructor(f) { super("MISSING_OPTION", `Required option missing for ${f}`), this.stem = f; } } class B extends wt { constructor(f, b) { super("BAD_PATTERN", b), this.char = f; } } class W extends wt { constructor(f, b, y) { let _ = y > 1 ? `${y} options` : "one option"; super("TOO_MANY_OPTIONS", `Token ${f} only supports ${_} (got ${b.length})`), this.stem = f, this.options = b; } } function ae(p, f) { let { numberingSystem: b } = f; return Array.isArray(p) || (p = [p]), b ? p.map((y) => { let _ = y.indexOf("-u-") === -1 ? "u-nu" : "nu"; return `${y}-${_}-${b}`; }).concat(p) : p; } function We(p, f) { let b = +p + f / 2; return b - b % +f; } function yt(p) { let { scale: f, unit: b } = p, y = typeof f == "number" && f >= 0 ? f : 1; return b && b.style === "percent" && (y *= 0.01), y; } function mi(p) { let f = yt(p), { precision: b } = p; return b && b.style === "precision-increment" ? (y) => We(y, b.increment) * f : (y) => y * f; } function et(p) { let f = yt(p), { precision: b } = p; if (b && b.style === "precision-increment") { let y = `+n + ${b.increment / 2}`, _ = `x - (x % +${b.increment})`; return f !== 1 && (_ = `(${_}) * ${f}`), `function(n) { var x = ${y}; return ${_}; }`; } return f !== 1 ? `function(n) { return n * ${f}; }` : null; } function nt(p, f) { let { decimal: b, group: y, integerWidth: _, notation: k, precision: C, roundingMode: O, sign: R, unit: G, unitPer: ge, unitWidth: Ae } = p, Ke = (kt, Bt) => { }, re = {}; if (G) switch (G.style) { case "base-unit": re.style = "decimal"; break; case "currency": re.style = "currency", re.currency = G.currency; break; case "measure-unit": re.style = "unit", re.unit = G.unit.replace(/.*-/, ""), ge && (re.unit += "-per-" + ge.replace(/.*-/, "")); break; case "percent": re.style = "percent"; break; } switch (Ae) { case "unit-width-full-name": re.currencyDisplay = "name", re.unitDisplay = "long"; break; case "unit-width-hidden": break; case "unit-width-iso-code": re.currencyDisplay = "code"; break; case "unit-width-narrow": re.currencyDisplay = "narrowSymbol", re.unitDisplay = "narrow"; break; case "unit-width-short": re.currencyDisplay = "symbol", re.unitDisplay = "short"; break; } switch (y) { case "group-off": re.useGrouping = !1; break; case "group-auto": re.useGrouping = !0; break; case "group-min2": case "group-on-aligned": case "group-thousands": re.useGrouping = !0; break; } if (C) switch (C.style) { case "precision-fraction": { let { minFraction: kt, maxFraction: Bt, minSignificant: ai, maxSignificant: ki, source: ma } = C; typeof kt == "number" && (re.minimumFractionDigits = kt, typeof ai == "number" && Ke()), typeof Bt == "number" && (re.maximumFractionDigits = Bt), typeof ai == "number" && (re.minimumSignificantDigits = ai), typeof ki == "number" && (re.maximumSignificantDigits = ki); break; } case "precision-integer": re.maximumFractionDigits = 0; break; case "precision-unlimited": re.maximumFractionDigits = 20; break; case "precision-increment": break; case "precision-currency-standard": re.trailingZeroDisplay = C.trailingZero; break; case "precision-currency-cash": Ke(C.style); break; } if (k) switch (k.style) { case "compact-short": re.notation = "compact", re.compactDisplay = "short"; break; case "compact-long": re.notation = "compact", re.compactDisplay = "long"; break; case "notation-simple": re.notation = "standard"; break; case "scientific": case "engineering": { let { expDigits: kt, expSign: Bt, source: ai, style: ki } = k; re.notation = ki; break; } } if (_) { let { min: kt, max: Bt, source: ai } = _; if (kt > 0 && (re.minimumIntegerDigits = kt), Number(Bt) > 0) { let ki = re.notation === "engineering" || re.notation === "scientific"; Bt === 3 && ki ? re.notation = "engineering" : Ke(); } } switch (R) { case "sign-auto": re.signDisplay = "auto"; break; case "sign-always": re.signDisplay = "always"; break; case "sign-except-zero": re.signDisplay = "exceptZero"; break; case "sign-never": re.signDisplay = "never"; break; case "sign-accounting": re.currencySign = "accounting"; break; case "sign-accounting-always": re.currencySign = "accounting", re.signDisplay = "always"; break; case "sign-accounting-except-zero": re.currencySign = "accounting", re.signDisplay = "exceptZero"; break; } return re; } function Nt(p, f, b) { let y = p[f]; switch (y) { case "%": return { char: "%", style: "percent", width: 1 }; case "‰": return { char: "%", style: "permille", width: 1 }; case "¤": { let _ = 1; for (; p[++f] === "¤"; ) ++_; switch (_) { case 1: return { char: y, currency: "default", width: _ }; case 2: return { char: y, currency: "iso-code", width: _ }; case 3: return { char: y, currency: "full-name", width: _ }; case 5: return { char: y, currency: "narrow", width: _ }; default: { let k = `Invalid number (${_}) of ¤ chars in pattern`; return b(new B("¤", k)), null; } } } case "*": { let _ = p[f + 1]; if (_) return { char: y, pad: _, width: 2 }; break; } case "+": case "-": return { char: y, width: 1 }; case "'": { let _ = p[++f], k = 2; if (_ === "'") return { char: y, str: _, width: k }; for (; ; ) { let C = p[++f]; if (++k, C === void 0) { let O = `Unterminated quoted literal in pattern: ${_}`; return b(new B("'", O)), { char: y, str: _, width: k }; } else if (C === "'") { if (p[++f] !== "'") return { char: y, str: _, width: k }; ++k; } _ += C; } } } return null; } let pa = (p) => p >= "0" && p <= "9"; function St(p, f) { let b = p[f]; if (pa(b)) { let y = b; for (; ; ) { let _ = p[++f]; if (pa(_)) y += _; else return { char: "0", digits: y, width: y.length }; } } switch (b) { case "#": { let y = 1; for (; p[++f] === "#"; ) ++y; return { char: b, width: y }; } case "@": { let y = 1; for (; p[++f] === "@"; ) ++y; let _ = y; for (f -= 1; p[++f] === "#"; ) ++_; return { char: b, min: y, width: _ }; } case "E": { let y = p[f + 1] === "+"; y && ++f; let _ = 0; for (; p[++f] === "0"; ) ++_; let k = (y ? 2 : 1) + _; if (_) return { char: b, expDigits: _, plus: y, width: k }; break; } case ".": case ",": return { char: b, width: 1 }; } return null; } function fi(p, f, b) { let y; (function(G) { G[G.Prefix = 0] = "Prefix", G[G.Number = 1] = "Number", G[G.Suffix = 2] = "Suffix"; })(y || (y = {})); let _ = [], k = [], C = [], O = y.Prefix, R = ""; for (; f < p.length; ) { let G = p[f]; if (G === ";") { f += 1; break; } switch (O) { case y.Prefix: { let ge = Nt(p, f, b); if (ge) R && (_.push({ char: "'", str: R, width: R.length }), R = ""), _.push(ge), f += ge.width; else { let Ae = St(p, f); Ae ? (R && (_.push({ char: "'", str: R, width: R.length }), R = ""), O = y.Number, k.push(Ae), f += Ae.width) : (R += G, f += 1); } break; } case y.Number: { let ge = St(p, f); ge ? (k.push(ge), f += ge.width) : O = y.Suffix; break; } case y.Suffix: { let ge = Nt(p, f, b); ge ? (R && (C.push({ char: "'", str: R, width: R.length }), R = ""), C.push(ge), f += ge.width) : (R += G, f += 1); break; } } } return R && C.push({ char: "'", str: R, width: R.length }), { pattern: { prefix: _, number: k, suffix: C }, pos: f }; } function ii(p, f) { let { pattern: b, pos: y } = fi(p, 0, f); if (y < p.length) { let { pattern: _ } = fi(p, y, f); return { tokens: b, negative: _ }; } return { tokens: b }; } function Oa(p, f) { let b = {}, y = !1, _ = !1, k = 0, C = "", O = -1, R = "", G = 0; for (let Ae = 0; Ae < p.length; ++Ae) { let Ke = p[Ae]; switch (Ke.char) { case "#": { if (O === -1) { if (C) { let re = "Pattern has # after integer digits"; f(new B("#", re)); } k += Ke.width; } else G += Ke.width; break; } case "0": { if (O === -1) C += Ke.digits; else { if (G) { let re = "Pattern has digits after # in fraction"; f(new B("0", re)); } R += Ke.digits; } break; } case "@": { b.precision && f(new ee("precision", b.precision)), b.precision = { style: "precision-fraction", minSignificant: Ke.min, maxSignificant: Ke.width }; break; } case ",": y = !0; break; case ".": if (O === 1) { let re = "Pattern has more than one decimal separator"; f(new B(".", re)); } O = Ae; break; case "E": { if (_ && f(new ee("exponent", b.notation)), y) { let re = "Exponential patterns may not contain grouping separators"; f(new B("E", re)); } b.notation = { style: "scientific" }, Ke.expDigits > 1 && (b.notation.expDigits = Ke.expDigits), Ke.plus && (b.notation.expSign = "sign-always"), _ = !0; } } } y ? b.group = "group-auto" : k + C.length > 3 && (b.group = "group-off"); let ge = +`${C || "0"}.${R}`; if (ge && (b.precision = { style: "precision-increment", increment: ge }), !_) C.length > 1 && (b.integerWidth = { min: C.length }), !b.precision && (R.length || G) && (b.precision = { style: "precision-fraction", minFraction: R.length, maxFraction: R.length + G }); else if ((!b.precision || ge) && (b.integerWidth = k ? { min: 1, max: k + C.length } : { min: Math.max(1, C.length) }), b.precision) ge || (b.integerWidth = { min: 1, max: 1 }); else { let Ae = C.length + R.length; O === -1 ? Ae > 0 && (b.precision = { style: "precision-fraction", maxSignificant: Ae }) : (b.precision = { style: "precision-fraction", maxSignificant: Math.max(1, Ae) + G }, Ae > 1 && (b.precision.minSignificant = Ae)); } return b; } function In(p, f, b, y, _) { let k = !1, C = ""; for (let O of p) switch (O.char) { case "%": f.unit = { style: O.style }, _ ? k = !0 : C = ""; break; case "¤": if (!b) { let R = "The ¤ pattern requires a currency"; y(new B("¤", R)); break; } switch (f.unit = { style: "currency", currency: b }, O.currency) { case "iso-code": f.unitWidth = "unit-width-iso-code"; break; case "full-name": f.unitWidth = "unit-width-full-name"; break; case "narrow": f.unitWidth = "unit-width-narrow"; break; } _ ? k = !0 : C = ""; break; case "*": break; case "+": k || (C += "+"); break; case "'": k || (C += O.str); break; } return C; } function kl(p, f) { let b = !1, y = ""; for (let _ of p) switch (_.char) { case "%": case "¤": f ? b = !0 : y = ""; break; case "-": b || (y += "-"); break; case "'": b || (y += _.str); break; } return y; } function El(p, f) { let b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : (R) => { throw R; }, { tokens: y, negative: _ } = ii(p, b), k = Oa(y.number, b), C = In(y.prefix, k, f, b, !0), O = In(y.suffix, k, f, b, !1); if (_) { let R = kl(_.prefix, !0), G = kl(_.suffix, !1); k.affix = { pos: [C, O], neg: [R, G] }, k.sign = "sign-never"; } else (C || O) && (k.affix = { pos: [C, O] }); return k; } function JW(p) { return ["arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt"].indexOf(p) !== -1; } function lg(p) { let f = ["acceleration", "angle", "area", "concentr", "consumption", "digital", "duration", "electric", "energy", "force", "frequency", "graphics", "length", "light", "mass", "power", "pressure", "speed", "temperature", "torque", "volume"], [b] = p.split("-", 1); return f.indexOf(b) !== -1; } let cg = { "compact-short": 0, "compact-long": 0, "notation-simple": 0, scientific: 2, engineering: 2, percent: 0, permille: 0, "base-unit": 0, currency: 1, "measure-unit": 1, "per-measure-unit": 1, "unit-width-narrow": 0, "unit-width-short": 0, "unit-width-full-name": 0, "unit-width-iso-code": 0, "unit-width-hidden": 0, "precision-integer": 0, "precision-unlimited": 0, "precision-currency-standard": 1, "precision-currency-cash": 0, "precision-increment": 1, "rounding-mode-ceiling": 0, "rounding-mode-floor": 0, "rounding-mode-down": 0, "rounding-mode-up": 0, "rounding-mode-half-even": 0, "rounding-mode-half-down": 0, "rounding-mode-half-up": 0, "rounding-mode-unnecessary": 0, "integer-width": 1, scale: 1, "group-off": 0, "group-min2": 0, "group-auto": 0, "group-on-aligned": 0, "group-thousands": 0, latin: 0, "numbering-system": 1, "sign-auto": 0, "sign-always": 0, "sign-never": 0, "sign-accounting": 0, "sign-accounting-always": 0, "sign-except-zero": 0, "sign-accounting-except-zero": 0, "decimal-auto": 0, "decimal-always": 0 }, dg = { currency: 1, "integer-width": 1, "measure-unit": 1, "numbering-system": 1, "per-measure-unit": 1, "precision-increment": 1, scale: 1 }; function eZ(p) { return p in cg; } function tZ(p) { return p in dg; } function iZ(p, f, b) { if (eZ(p)) { let y = cg[p]; if (f.length > y) { if (y === 0) for (let _ of f) b(new Yt(p, _)); else b(new W(p, f, y)); return !1; } else if (tZ(p) && f.length < dg[p]) return b(new $e(p)), !1; } return !0; } function hu(p, f) { let b = f === "fraction" ? /^\.(0*)(\+|#*)$/ : /^(@+)(\+|#*)$/, y = p && p.match(b); if (y) { let _ = y[1].length; switch (y[2].charAt(0)) { case "": return { min: _, max: _ }; case "+": return { min: _, max: null }; case "#": return { min: _, max: _ + y[2].length }; } } return null; } function aZ(p, f, b) { let y = hu(p, "fraction"); if (y) { f.length > 1 && b(new W(p, f, 1)); let k = { style: "precision-fraction", source: p, minFraction: y.min }; y.max != null && (k.maxFraction = y.max); let C = f[0], O = hu(C, "significant"); return O ? (k.source = `${p}/${C}`, k.minSignificant = O.min, O.max != null && (k.maxSignificant = O.max)) : C && b(new Yt(p, C)), k; } let _ = hu(p, "significant"); if (_) { for (let C of f) b(new Yt(p, C)); let k = { style: "precision-fraction", source: p, minSignificant: _.min }; return _.max != null && (k.maxSignificant = _.max), k; } return null; } class nZ { constructor(f) { this.skeleton = {}, this.onError = f; } badOption(f, b) { this.onError(new Yt(f, b)); } assertEmpty(f) { let b = this.skeleton[f]; b && this.onError(new ee(f, b)); } parseToken(f, b) { if (!iZ(f, b, this.onError)) return; let y = b[0], _ = this.skeleton; switch (f) { case "compact-short": case "compact-long": case "notation-simple": this.assertEmpty("notation"), _.notation = { style: f }; break; case "scientific": case "engineering": { let k = null, C; for (let R of b) switch (R) { case "sign-auto": case "sign-always": case "sign-never": case "sign-accounting": case "sign-accounting-always": case "sign-except-zero": case "sign-accounting-except-zero": C = R; break; default: /^\+e+$/.test(R) ? k = R.length - 1 : this.badOption(f, R); } this.assertEmpty("notation"); let O = b.join("/"); _.notation = k && C ? { style: f, source: O, expDigits: k, expSign: C } : k ? { style: f, source: O, expDigits: k } : C ? { style: f, source: O, expSign: C } : { style: f, source: O }; break; } case "percent": case "permille": case "base-unit": this.assertEmpty("unit"), _.unit = { style: f }; break; case "currency": /^[A-Z]{3}$/.test(y) ? (this.assertEmpty("unit"), _.unit = { style: f, currency: y }) : this.badOption(f, y); break; case "measure-unit": { lg(y) ? (this.assertEmpty("unit"), _.unit = { style: f, unit: y }) : this.badOption(f, y); break; } case "per-measure-unit": { lg(y) ? (this.assertEmpty("unitPer"), _.unitPer = y) : this.badOption(f, y); break; } case "unit-width-narrow": case "unit-width-short": case "unit-width-full-name": case "unit-width-iso-code": case "unit-width-hidden": this.assertEmpty("unitWidth"), _.unitWidth = f; break; case "precision-integer": case "precision-unlimited": case "precision-currency-cash": this.assertEmpty("precision"), _.precision = { style: f }; break; case "precision-currency-standard": this.assertEmpty("precision"), y === "w" ? _.precision = { style: f, trailingZero: "stripIfInteger" } : _.precision = { style: f }; break; case "precision-increment": { let k = Number(y); k > 0 ? (this.assertEmpty("precision"), _.precision = { style: f, increment: k }) : this.badOption(f, y); break; } case "rounding-mode-ceiling": case "rounding-mode-floor": case "rounding-mode-down": case "rounding-mode-up": case "rounding-mode-half-even": case "rounding-mode-half-odd": case "rounding-mode-half-ceiling": case "rounding-mode-half-floor": case "rounding-mode-half-down": case "rounding-mode-half-up": case "rounding-mode-unnecessary": this.assertEmpty("roundingMode"), _.roundingMode = f; break; case "integer-width": { if (/^\+0*$/.test(y)) this.assertEmpty("integerWidth"), _.integerWidth = { source: y, min: y.length - 1 }; else { let k = y.match(/^#*(0*)$/); k ? (this.assertEmpty("integerWidth"), _.integerWidth = { source: y, min: k[1].length, max: k[0].length }) : this.badOption(f, y); } break; } case "scale": { let k = Number(y); k > 0 ? (this.assertEmpty("scale"), _.scale = k) : this.badOption(f, y); break; } case "group-off": case "group-min2": case "group-auto": case "group-on-aligned": case "group-thousands": this.assertEmpty("group"), _.group = f; break; case "latin": this.assertEmpty("numberingSystem"), _.numberingSystem = "latn"; break; case "numbering-system": { JW(y) ? (this.assertEmpty("numberingSystem"), _.numberingSystem = y) : this.badOption(f, y); break; } case "sign-auto": case "sign-always": case "sign-never": case "sign-accounting": case "sign-accounting-always": case "sign-except-zero": case "sign-accounting-except-zero": this.assertEmpty("sign"), _.sign = f; break; case "decimal-auto": case "decimal-always": this.assertEmpty("decimal"), _.decimal = f; break; default: { let k = aZ(f, b, this.onError); k ? (this.assertEmpty("precision"), _.precision = k) : this.onError(new oe(f)); } } } } function ug(p) { let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (_) => { throw _; }, b = []; for (let _ of p.split(" ")) if (_) { let k = _.split("/"), C = k.shift() || ""; b.push({ stem: C, options: k }); } let y = new nZ(f); for (let { stem: _, options: k } of b) y.parseToken(_, k); return y.skeleton; } function rZ(p, f, b, y) { typeof f == "string" && (f = f.indexOf("::") === 0 ? ug(f.slice(2), y) : El(f, b, y)); let _ = ae(p, f), k = nt(f), C = mi(f), O = new Intl.NumberFormat(_, k); if (f.affix) { let [R, G] = f.affix.pos, [ge, Ae] = f.affix.neg || ["", ""]; return (Ke) => { let re = O.format(C(Ke)); return Ke < 0 ? `${ge}${re}${Ae}` : `${R}${re}${G}`; }; } return (R) => O.format(C(R)); } function oZ(p, f, b, y) { typeof f == "string" && (f = f.indexOf("::") === 0 ? ug(f.slice(2), y) : El(f, b, y)); let _ = ae(p, f), k = nt(f), C = et(f), O = ["(function() {", `var opt = ${JSON.stringify(k)};`, `var nf = new Intl.NumberFormat(${JSON.stringify(_)}, opt);`], R = "nf.format(value)"; if (C && (O.push(`var mod = ${C};`), R = "nf.format(mod(value))"), f.affix) { let [G, ge] = f.affix.pos.map((Ae) => JSON.stringify(Ae)); if (f.affix.neg) { let [Ae, Ke] = f.affix.neg.map((re) => JSON.stringify(re)); R = `value < 0 ? ${Ae} + ${R} + ${Ke} : ${G} + ${R} + ${ge}`; } else R = `${G} + ${R} + ${ge}`; } return O.push(`return function(value) { return ${R}; }`), O.join(` `) + ` })()`; } var pu = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function sZ(p) { return p && p.__esModule && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p; } var Wo = {}, hg = {}, pg = { exports: {} }; (function(p) { (function(f, b) { p.exports ? p.exports = b() : f.moo = b(); })(pu, function() { var f = Object.prototype.hasOwnProperty, b = Object.prototype.toString, y = typeof new RegExp().sticky == "boolean"; function _(F) { return F && b.call(F) === "[object RegExp]"; } function k(F) { return F && typeof F == "object" && !_(F) && !Array.isArray(F); } function C(F) { return F.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); } function O(F) { var Q = new RegExp("|" + F); return Q.exec("").length - 1; } function R(F) { return "(" + F + ")"; } function G(F) { if (!F.length) return "(?!)"; var Q = F.map(function(fe) { return "(?:" + fe + ")"; }).join("|"); return "(?:" + Q + ")"; } function ge(F) { if (typeof F == "string") return "(?:" + C(F) + ")"; if (_(F)) { if (F.ignoreCase) throw new Error("RegExp /i flag not allowed"); if (F.global) throw new Error("RegExp /g flag is implied"); if (F.sticky) throw new Error("RegExp /y flag is implied"); if (F.multiline) throw new Error("RegExp /m flag is implied"); return F.source; } else throw new Error("Not a pattern: " + F); } function Ae(F, Q) { return F.length > Q ? F : Array(Q - F.length + 1).join(" ") + F; } function Ke(F, Q) { for (var fe = F.length, ve = 0; ; ) { var je = F.lastIndexOf(` `, fe - 1); if (je === -1 || (ve++, fe = je, ve === Q) || fe === 0) break; } var Ie = ve < Q ? 0 : fe + 1; return F.substring(Ie).split(` `); } function re(F) { for (var Q = Object.getOwnPropertyNames(F), fe = [], ve = 0; ve < Q.length; ve++) { var je = Q[ve], Ie = F[je], tt = [].concat(Ie); if (je === "include") { for (var It = 0; It < tt.length; It++) fe.push({ include: tt[It] }); continue; } var dt = []; tt.forEach(function(Fe) { k(Fe) ? (dt.length && fe.push(Bt(je, dt)), fe.push(Bt(je, Fe)), dt = []) : dt.push(Fe); }), dt.length && fe.push(Bt(je, dt)); } return fe; } function kt(F) { for (var Q = [], fe = 0; fe < F.length; fe++) { var ve = F[fe]; if (ve.include) { for (var je = [].concat(ve.include), Ie = 0; Ie < je.length; Ie++) Q.push({ include: je[Ie] }); continue; } if (!ve.type) throw new Error("Rule has no type: " + JSON.stringify(ve)); Q.push(Bt(ve.type, ve)); } return Q; } function Bt(F, Q) { if (k(Q) || (Q = { match: Q }), Q.include) throw new Error("Matching rules cannot also include states"); var fe = { defaultType: F, lineBreaks: !!Q.error || !!Q.fallback, pop: !1, next: null, push: null, error: !1, fallback: !1, value: null, type: null, shouldThrow: !1 }; for (var ve in Q) f.call(Q, ve) && (fe[ve] = Q[ve]); if (typeof fe.type == "string" && F !== fe.type) throw new Error("Type transform cannot be a string (type '" + fe.type + "' for token '" + F + "')"); var je = fe.match; return fe.match = Array.isArray(je) ? je : je ? [je] : [], fe.match.sort(function(Ie, tt) { return _(Ie) && _(tt) ? 0 : _(tt) ? -1 : _(Ie) ? 1 : tt.length - Ie.length; }), fe; } function ai(F) { return Array.isArray(F) ? kt(F) : re(F); } var ki = Bt("error", { lineBreaks: !0, shouldThrow: !0 }); function ma(F, Q) { for (var fe = null, ve = /* @__PURE__ */ Object.create(null), je = !0, Ie = null, tt = [], It = [], dt = 0; dt < F.length; dt++) F[dt].fallback && (je = !1); for (var dt = 0; dt < F.length; dt++) { var Fe = F[dt]; if (Fe.include) throw new Error("Inheritance is not allowed in stateless lexers"); if (Fe.error || Fe.fallback) { if (fe) throw !Fe.fallback == !fe.fallback ? new Error("Multiple " + (Fe.fallback ? "fallback" : "error") + " rules not allowed (for token '" + Fe.defaultType + "')") : new Error("fallback and error are mutually exclusive (for token '" + Fe.defaultType + "')"); fe = Fe; } var Wt = Fe.match.slice(); if (je) for (; Wt.length && typeof Wt[0] == "string" && Wt[0].length === 1; ) { var qr = Wt.shift(); ve[qr.charCodeAt(0)] = Fe; } if (Fe.pop || Fe.push || Fe.next) { if (!Q) throw new Error("State-switching options are not allowed in stateless lexers (for token '" + Fe.defaultType + "')"); if (Fe.fallback) throw new Error("State-switching options are not allowed on fallback tokens (for token '" + Fe.defaultType + "')"); } if (Wt.length !== 0) { je = !1, tt.push(Fe); for (var Ma = 0; Ma < Wt.length; Ma++) { var ar = Wt[Ma]; if (_(ar)) { if (Ie === null) Ie = ar.unicode; else if (Ie !== ar.unicode && Fe.fallback === !1) throw new Error("If one rule is /u then all must be"); } } var Ur = G(Wt.map(ge)), fa = new RegExp(Ur); if (fa.test("")) throw new Error("RegExp matches empty string: " + fa); var Ko = O(Ur); if (Ko > 0) throw new Error("RegExp has capture groups: " + fa + ` Use (?: … ) instead`); if (!Fe.lineBreaks && fa.test(` `)) throw new Error("Rule should declare lineBreaks: " + fa); It.push(R(Ur)); } } var Gr = fe && fe.fallback, Xo = y && !Gr ? "ym" : "gm", Nl = y || Gr ? "" : "|"; Ie === !0 && (Xo += "u"); var jZ = new RegExp(G(It) + Nl, Xo); return { regexp: jZ, groups: tt, fast: ve, error: fe || ki }; } function On(F) { var Q = ma(ai(F)); return new Vt({ start: Q }, "start"); } function on(F, Q, fe) { var ve = F && (F.push || F.next); if (ve && !fe[ve]) throw new Error("Missing state '" + ve + "' (in token '" + F.defaultType + "' of state '" + Q + "')"); if (F && F.pop && +F.pop != 1) throw new Error("pop must be 1 (in token '" + F.defaultType + "' of state '" + Q + "')"); } function sn(F, Q) { var fe = F.$all ? ai(F.$all) : []; delete F.$all; var ve = Object.getOwnPropertyNames(F); Q || (Q = ve[0]); for (var je = /* @__PURE__ */ Object.create(null), Ie = 0; Ie < ve.length; Ie++) { var tt = ve[Ie]; je[tt] = ai(F[tt]).concat(fe); } for (var Ie = 0; Ie < ve.length; Ie++) for (var tt = ve[Ie], It = je[tt], dt = /* @__PURE__ */ Object.create(null), Fe = 0; Fe < It.length; Fe++) { var Wt = It[Fe]; if (Wt.include) { var qr = [Fe, 1]; if (Wt.include !== tt && !dt[Wt.include]) { dt[Wt.include] = !0; var Ma = je[Wt.include]; if (!Ma) throw new Error("Cannot include nonexistent state '" + Wt.include + "' (in state '" + tt + "')"); for (var ar = 0; ar < Ma.length; ar++) { var Ur = Ma[ar]; It.indexOf(Ur) === -1 && qr.push(Ur); } } It.splice.apply(It, qr), Fe--; } } for (var fa = /* @__PURE__ */ Object.create(null), Ie = 0; Ie < ve.length; Ie++) { var tt = ve[Ie]; fa[tt] = ma(je[tt], !0); } for (var Ie = 0; Ie < ve.length; Ie++) { for (var Ko = ve[Ie], Gr = fa[Ko], Xo = Gr.groups, Fe = 0; Fe < Xo.length; Fe++) on(Xo[Fe], Ko, fa); for (var Nl = Object.getOwnPropertyNames(Gr.fast), Fe = 0; Fe < Nl.length; Fe++) on(Gr.fast[Nl[Fe]], Ko, fa); } return new Vt(fa, Q); } function ln(F) { for (var Q = typeof Map < "u", fe = Q ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null), ve = Object.getOwnPropertyNames(F), je = 0; je < ve.length; je++) { var Ie = ve[je], tt = F[Ie], It = Array.isArray(tt) ? tt : [tt]; It.forEach(function(dt) { if (typeof dt != "string") throw new Error("keyword must be string (in keyword '" + Ie + "')"); Q ? fe.set(dt, Ie) : fe[dt] = Ie; }); } return function(dt) { return Q ? fe.get(dt) : fe[dt]; }; } var Vt = function(F, Q) { this.startState = Q, this.states = F, this.buffer = "", this.stack = [], this.reset(); }; Vt.prototype.reset = function(F, Q) { return this.buffer = F || "", this.index = 0, this.line = Q ? Q.line : 1, this.col = Q ? Q.col : 1, this.queuedToken = Q ? Q.queuedToken : null, this.queuedText = Q ? Q.queuedText : "", this.queuedThrow = Q ? Q.queuedThrow : null, this.setState(Q ? Q.state : this.startState), this.stack = Q && Q.stack ? Q.stack.slice() : [], this; }, Vt.prototype.save = function() { return { line: this.line, col: this.col, state: this.state, stack: this.stack.slice(), queuedToken: this.queuedToken, queuedText: this.queuedText, queuedThrow: this.queuedThrow }; }, Vt.prototype.setState = function(F) { if (!(!F || this.state === F)) { this.state = F; var Q = this.states[F]; this.groups = Q.groups, this.error = Q.error, this.re = Q.regexp, this.fast = Q.fast; } }, Vt.prototype.popState = function() { this.setState(this.stack.pop()); }, Vt.prototype.pushState = function(F) { this.stack.push(this.state), this.setState(F); }; var Ol = y ? function(F, Q) { return F.exec(Q); } : function(F, Q) { var fe = F.exec(Q); return fe[0].length === 0 ? null : fe; }; Vt.prototype._getGroup = function(F) { for (var Q = this.groups.length, fe = 0; fe < Q; fe++) if (F[fe + 1] !== void 0) return this.groups[fe]; throw new Error("Cannot find token type for matched text"); }; function Tl() { return this.value; } if (Vt.prototype.next = function() { var F = this.index; if (this.queuedGroup) { var Q = this._token(this.queuedGroup, this.queuedText, F); return this.queuedGroup = null, this.queuedText = "", Q; } var fe = this.buffer; if (F !== fe.length) { var tt = this.fast[fe.charCodeAt(F)]; if (tt) return this._token(tt, fe.charAt(F), F); var ve = this.re; ve.lastIndex = F; var je = Ol(ve, fe), Ie = this.error; if (je == null) return this._token(Ie, fe.slice(F, fe.length), F); var tt = this._getGroup(je), It = je[0]; return Ie.fallback && je.index !== F ? (this.queuedGroup = tt, this.queuedText = It, this._token(Ie, fe.slice(F, je.index), F)) : this._token(tt, It, F); } }, Vt.prototype._token = function(F, Q, fe) { var ve = 0; if (F.lineBreaks) { var je = /\n/g, Ie = 1; if (Q === ` `) ve = 1; else for (; je.exec(Q); ) ve++, Ie = je.lastIndex; } var tt = { type: typeof F.type == "function" && F.type(Q) || F.defaultType, value: typeof F.value == "function" ? F.value(Q) : Q, text: Q, toString: Tl, offset: fe, lineBreaks: ve, line: this.line, col: this.col }, It = Q.length; if (this.index += It, this.line += ve, ve !== 0 ? this.col = It - Ie + 1 : this.col += It, F.shouldThrow) { var dt = new Error(this.formatError(tt, "invalid syntax")); throw dt; } return F.pop ? this.popState() : F.push ? this.pushState(F.push) : F.next && this.setState(F.next), tt; }, typeof Symbol < "u" && Symbol.iterator) { var cn = function(F) { this.lexer = F; }; cn.prototype.next = function() { var F = this.lexer.next(); return { value: F, done: !F }; }, cn.prototype[Symbol.iterator] = function() { return this; }, Vt.prototype[Symbol.iterator] = function() { return new cn(this); }; } return Vt.prototype.formatError = function(ve, Q) { if (ve == null) var fe = this.buffer.slice(this.index), ve = { text: fe, offset: this.index, lineBreaks: fe.indexOf(` `) === -1 ? 0 : 1, line: this.line, col: this.col }; var je = 2, Ie = Math.max(ve.line - je, 1), tt = ve.line + je, It = String(tt).length, dt = Ke(this.buffer, this.line - ve.line + je + 1).slice(0, 5), Fe = []; Fe.push(Q + " at line " + ve.line + " col " + v