@smals-belgium-shared/vidis-medication-scheme-list
Version:
Medication scheme list web component
1,205 lines • 1.96 MB
JavaScript
var Hue = Object.defineProperty;
var Y0 = (e) => {
throw TypeError(e);
};
var Uue = (e, t, n) => t in e ? Hue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var o = (e, t, n) => Uue(e, typeof t != "symbol" ? t + "" : t, n), Z0 = (e, t, n) => t.has(e) || Y0("Cannot " + n);
var ya = (e, t, n) => (Z0(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Ao = (e, t, n) => t.has(e) ? Y0("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), K0 = (e, t, n, a) => (Z0(e, t, "write to private field"), a ? a.call(e, n) : t.set(e, n), n);
var Wue = Object.create, fu = Object.defineProperty, que = Object.defineProperties, Gue = Object.getOwnPropertyDescriptor, $ue = Object.getOwnPropertyDescriptors, Yue = Object.getOwnPropertyNames, Cd = Object.getOwnPropertySymbols, Zue = Object.getPrototypeOf, sf = Object.prototype.hasOwnProperty, E_ = Object.prototype.propertyIsEnumerable, Q0 = (e, t, n) => t in e ? fu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, he = (e, t) => {
for (var n in t || (t = {})) sf.call(t, n) && Q0(e, n, t[n]);
if (Cd) for (var n of Cd(t)) E_.call(t, n) && Q0(e, n, t[n]);
return e;
}, lt = (e, t) => que(e, $ue(t)), Kue = (e, t) => {
var n = {};
for (var a in e) sf.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
if (e != null && Cd) for (var a of Cd(e)) t.indexOf(a) < 0 && E_.call(e, a) && (n[a] = e[a]);
return n;
}, Re = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), se = (e, t) => {
for (var n in t) fu(e, n, { get: t[n], enumerable: !0 });
}, Que = (e, t, n, a) => {
if (t && typeof t == "object" || typeof t == "function") for (let i of Yue(t)) !sf.call(e, i) && i !== n && fu(e, i, { get: () => t[i], enumerable: !(a = Gue(t, i)) || a.enumerable });
return e;
}, k_ = (e, t, n) => (n = e != null ? Wue(Zue(e)) : {}, Que(t || !e || !e.__esModule ? fu(n, "default", { value: e, enumerable: !0 }) : n, e)), Pa = (e, t, n) => new Promise((a, i) => {
var r = (c) => {
try {
l(n.next(c));
} catch (d) {
i(d);
}
}, s = (c) => {
try {
l(n.throw(c));
} catch (d) {
i(d);
}
}, l = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(r, s);
l((n = n.apply(e, t)).next());
}), Xue = Re((e, t) => {
(function(n, a) {
typeof e == "object" && typeof t < "u" ? t.exports = a() : typeof define == "function" && define.amd ? define(a) : (n = typeof globalThis < "u" ? globalThis : n || self, n.MessageFormat = a());
})(e, function() {
var n = function() {
return n = Object.assign || function(m) {
for (var g, b = 1, y = arguments.length; b < y; b++) {
g = arguments[b];
for (var x in g) Object.prototype.hasOwnProperty.call(g, x) && (m[x] = g[x]);
}
return m;
}, n.apply(this, arguments);
};
function a(m) {
var g = typeof Symbol == "function" && Symbol.iterator, b = g && m[g], y = 0;
if (b) return b.call(m);
if (m && typeof m.length == "number") return { next: function() {
return m && y >= m.length && (m = void 0), { value: m && m[y++], done: !m };
} };
throw new TypeError(g ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function i(m, g) {
var b = typeof Symbol == "function" && m[Symbol.iterator];
if (!b) return m;
var y = b.call(m), x, k = [], O;
try {
for (; (g === void 0 || g-- > 0) && !(x = y.next()).done; ) k.push(x.value);
} catch (M) {
O = { error: M };
} finally {
try {
x && !x.done && (b = y.return) && b.call(y);
} finally {
if (O) throw O.error;
}
}
return k;
}
function r(m, g, b) {
if (arguments.length === 2) for (var y = 0, x = g.length, k; y < x; y++) (k || !(y in g)) && (k || (k = Array.prototype.slice.call(g, 0, y)), k[y] = g[y]);
return m.concat(k || Array.prototype.slice.call(g));
}
typeof SuppressedError == "function" && SuppressedError;
class s extends Error {
constructor(g, b, y) {
super(g), this.token = b, this.type = y || "error";
}
}
let l = (m) => m < 4 ? "short" : m === 4 ? "long" : "narrow", c = (m) => m % 2 === 0 ? "2-digit" : "numeric";
function d(m, g) {
switch (m.char) {
case "y":
return { year: c(m.width) };
case "r":
return { calendar: "gregory", year: "numeric" };
default:
return g(`${m.desc} is not supported; falling back to year:numeric`, s.WARNING), { year: "numeric" };
}
}
function u(m, g) {
switch (m.width) {
case 1:
return "numeric";
case 2:
return "2-digit";
case 3:
return "short";
case 4:
return "long";
case 5:
return "narrow";
default:
g(`${m.desc} is not supported with width ${m.width}`);
return;
}
}
function p(m, g) {
let { char: b, desc: y, width: x } = m;
if (b === "d") return c(x);
g(`${y} is not supported`);
}
function v(m, g) {
let { char: b, desc: y, width: x } = m;
if ((b === "c" || b === "e") && x < 3) {
let k = `Numeric value is not supported for ${y}; falling back to weekday:short`;
g(k, s.WARNING);
}
return l(x);
}
function f(m) {
let g = c(m.width), b;
switch (m.char) {
case "h":
b = "h12";
break;
case "H":
b = "h23";
break;
case "k":
b = "h24";
break;
case "K":
b = "h11";
break;
}
return b ? { hour: g, hourCycle: b } : { hour: g };
}
function w(m, g) {
let { char: b, desc: y, width: x } = m;
switch (b) {
case "v":
case "z":
return x === 4 ? "long" : "short";
case "V":
if (x === 4) return "long";
g(`${y} is not supported with width ${x}`);
return;
case "X":
g(`${y} is not supported`);
return;
}
return "short";
}
function E(m, g) {
switch (m.field) {
case "era":
return { era: l(m.width) };
case "year":
return d(m, g);
case "month":
return { month: u(m, g) };
case "day":
return { day: p(m, g) };
case "weekday":
return { weekday: v(m, g) };
case "period":
return;
case "hour":
return f(m);
case "min":
return { minute: c(m.width) };
case "sec":
return { second: c(m.width) };
case "tz":
return { timeZoneName: w(m, g) };
case "quarter":
case "week":
case "sec-frac":
case "ms":
g(`${m.desc} is not supported`);
}
}
function S(m, g) {
let b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : (k) => {
throw k;
}, y = { timeZone: g }, x = [];
for (let k of m) {
let { error: O, field: M, str: z } = k;
if (O) {
let Oe = new s(O.message, k);
Oe.stack = O.stack, b(Oe);
}
if (z) {
let Oe = `Ignoring string part: ${z}`;
b(new s(Oe, k, s.WARNING));
}
M && (x.indexOf(M) === -1 ? x.push(M) : b(new s(`Duplicate ${M} token`, k)));
let Q = E(k, (Oe, Ve) => b(new s(Oe, k, Ve)));
Q && Object.assign(y, Q);
}
return y;
}
let A = { 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" } }, j = (m) => m >= "A" && m <= "Z" || m >= "a" && m <= "z";
function H(m, g) {
let b = m[g], y = 1;
for (; m[++g] === b; ) ++y;
let x = A[b];
if (!x) {
let k = `The letter ${b} is not a valid field identifier`;
return { char: b, error: new Error(k), width: y };
}
return { char: b, field: x.field, desc: x.desc, width: y };
}
function _e(m, g) {
let b = m[++g], y = 2;
if (b === "'") return { char: "'", str: b, width: y };
for (; ; ) {
let x = m[++g];
if (++y, x === void 0) {
let k = `Unterminated quoted literal in pattern: ${b || m}`;
return { char: "'", error: new Error(k), str: b, width: y };
} else if (x === "'") {
if (m[++g] !== "'") return { char: "'", str: b, width: y };
++y;
}
b += x;
}
}
function Pe(m, g) {
let b = m[g];
if (!b) return null;
if (j(b)) return H(m, g);
if (b === "'") return _e(m, g);
let y = b, x = 1;
for (; ; ) {
let k = m[++g];
if (!k || j(k) || k === "'") return { char: b, str: y, width: x };
y += k, x += 1;
}
}
function Ue(m) {
let g = [], b = 0;
for (; ; ) {
let y = Pe(m, b);
if (!y) return g;
g.push(y), b += y.width;
}
}
function ka(m, g, b, y) {
typeof g == "string" && (g = Ue(g)), typeof b == "function" && (y = b, b = void 0);
let x = S(g, b, y), k = new Intl.DateTimeFormat(m, x);
return (O) => k.format(O);
}
function da(m, g, b, y) {
typeof g == "string" && (g = Ue(g)), typeof b == "function" && (y = b, b = void 0);
let x = S(g, b, y);
return ["(function() {", `var opt = ${JSON.stringify(x)};`, `var dtf = new Intl.DateTimeFormat(${JSON.stringify(m)}, opt);`, "return function(value) { return dtf.format(value); }"].join(`
`) + `
})()`;
}
class Pt extends Error {
constructor(g, b) {
super(b), this.code = g;
}
}
class va extends Pt {
constructor(g, b) {
super("BAD_OPTION", `Unknown ${g} option: ${b}`), this.stem = g, this.option = b;
}
}
class ge extends Pt {
constructor(g) {
super("BAD_STEM", `Unknown stem: ${g}`), this.stem = g;
}
}
class le extends Pt {
constructor(g, b) {
super("MASKED_VALUE", `Value for ${g} is set multiple times`), this.type = g, this.prev = b;
}
}
class Ge extends Pt {
constructor(g) {
super("MISSING_OPTION", `Required option missing for ${g}`), this.stem = g;
}
}
class Y extends Pt {
constructor(g, b) {
super("BAD_PATTERN", b), this.char = g;
}
}
class X extends Pt {
constructor(g, b, y) {
let x = y > 1 ? `${y} options` : "one option";
super("TOO_MANY_OPTIONS", `Token ${g} only supports ${x} (got ${b.length})`), this.stem = g, this.options = b;
}
}
function pe(m, g) {
let { numberingSystem: b } = g;
return Array.isArray(m) || (m = [m]), b ? m.map((y) => {
let x = y.indexOf("-u-") === -1 ? "u-nu" : "nu";
return `${y}-${x}-${b}`;
}).concat(m) : m;
}
function Qe(m, g) {
let b = +m + g / 2;
return b - b % +g;
}
function At(m) {
let { scale: g, unit: b } = m, y = typeof g == "number" && g >= 0 ? g : 1;
return b && b.style === "percent" && (y *= 0.01), y;
}
function Ga(m) {
let g = At(m), { precision: b } = m;
return b && b.style === "precision-increment" ? (y) => Qe(y, b.increment) * g : (y) => y * g;
}
function it(m) {
let g = At(m), { precision: b } = m;
if (b && b.style === "precision-increment") {
let y = `+n + ${b.increment / 2}`, x = `x - (x % +${b.increment})`;
return g !== 1 && (x = `(${x}) * ${g}`), `function(n) { var x = ${y}; return ${x}; }`;
}
return g !== 1 ? `function(n) { return n * ${g}; }` : null;
}
function ht(m, g) {
let { decimal: b, group: y, integerWidth: x, notation: k, precision: O, roundingMode: M, sign: z, unit: Q, unitPer: Oe, unitWidth: Ve } = m, Je = (Lt, ua) => {
}, fe = {};
if (Q) switch (Q.style) {
case "base-unit":
fe.style = "decimal";
break;
case "currency":
fe.style = "currency", fe.currency = Q.currency;
break;
case "measure-unit":
fe.style = "unit", fe.unit = Q.unit.replace(/.*-/, ""), Oe && (fe.unit += "-per-" + Oe.replace(/.*-/, ""));
break;
case "percent":
fe.style = "percent";
break;
}
switch (Ve) {
case "unit-width-full-name":
fe.currencyDisplay = "name", fe.unitDisplay = "long";
break;
case "unit-width-hidden":
break;
case "unit-width-iso-code":
fe.currencyDisplay = "code";
break;
case "unit-width-narrow":
fe.currencyDisplay = "narrowSymbol", fe.unitDisplay = "narrow";
break;
case "unit-width-short":
fe.currencyDisplay = "symbol", fe.unitDisplay = "short";
break;
}
switch (y) {
case "group-off":
fe.useGrouping = !1;
break;
case "group-auto":
fe.useGrouping = !0;
break;
case "group-min2":
case "group-on-aligned":
case "group-thousands":
fe.useGrouping = !0;
break;
}
if (O) switch (O.style) {
case "precision-fraction": {
let { minFraction: Lt, maxFraction: ua, minSignificant: Sa, maxSignificant: ni, source: Wi } = O;
typeof Lt == "number" && (fe.minimumFractionDigits = Lt, typeof Sa == "number" && Je()), typeof ua == "number" && (fe.maximumFractionDigits = ua), typeof Sa == "number" && (fe.minimumSignificantDigits = Sa), typeof ni == "number" && (fe.maximumSignificantDigits = ni);
break;
}
case "precision-integer":
fe.maximumFractionDigits = 0;
break;
case "precision-unlimited":
fe.maximumFractionDigits = 20;
break;
case "precision-increment":
break;
case "precision-currency-standard":
fe.trailingZeroDisplay = O.trailingZero;
break;
case "precision-currency-cash":
Je(O.style);
break;
}
if (k) switch (k.style) {
case "compact-short":
fe.notation = "compact", fe.compactDisplay = "short";
break;
case "compact-long":
fe.notation = "compact", fe.compactDisplay = "long";
break;
case "notation-simple":
fe.notation = "standard";
break;
case "scientific":
case "engineering": {
let { expDigits: Lt, expSign: ua, source: Sa, style: ni } = k;
fe.notation = ni;
break;
}
}
if (x) {
let { min: Lt, max: ua, source: Sa } = x;
if (Lt > 0 && (fe.minimumIntegerDigits = Lt), Number(ua) > 0) {
let ni = fe.notation === "engineering" || fe.notation === "scientific";
ua === 3 && ni ? fe.notation = "engineering" : Je();
}
}
switch (z) {
case "sign-auto":
fe.signDisplay = "auto";
break;
case "sign-always":
fe.signDisplay = "always";
break;
case "sign-except-zero":
fe.signDisplay = "exceptZero";
break;
case "sign-never":
fe.signDisplay = "never";
break;
case "sign-accounting":
fe.currencySign = "accounting";
break;
case "sign-accounting-always":
fe.currencySign = "accounting", fe.signDisplay = "always";
break;
case "sign-accounting-except-zero":
fe.currencySign = "accounting", fe.signDisplay = "exceptZero";
break;
}
return fe;
}
function Ut(m, g, b) {
let y = m[g];
switch (y) {
case "%":
return { char: "%", style: "percent", width: 1 };
case "‰":
return { char: "%", style: "permille", width: 1 };
case "¤": {
let x = 1;
for (; m[++g] === "¤"; ) ++x;
switch (x) {
case 1:
return { char: y, currency: "default", width: x };
case 2:
return { char: y, currency: "iso-code", width: x };
case 3:
return { char: y, currency: "full-name", width: x };
case 5:
return { char: y, currency: "narrow", width: x };
default: {
let k = `Invalid number (${x}) of ¤ chars in pattern`;
return b(new Y("¤", k)), null;
}
}
}
case "*": {
let x = m[g + 1];
if (x) return { char: y, pad: x, width: 2 };
break;
}
case "+":
case "-":
return { char: y, width: 1 };
case "'": {
let x = m[++g], k = 2;
if (x === "'") return { char: y, str: x, width: k };
for (; ; ) {
let O = m[++g];
if (++k, O === void 0) {
let M = `Unterminated quoted literal in pattern: ${x}`;
return b(new Y("'", M)), { char: y, str: x, width: k };
} else if (O === "'") {
if (m[++g] !== "'") return { char: y, str: x, width: k };
++k;
}
x += O;
}
}
}
return null;
}
let Ui = (m) => m >= "0" && m <= "9";
function Nt(m, g) {
let b = m[g];
if (Ui(b)) {
let y = b;
for (; ; ) {
let x = m[++g];
if (Ui(x)) y += x;
else return { char: "0", digits: y, width: y.length };
}
}
switch (b) {
case "#": {
let y = 1;
for (; m[++g] === "#"; ) ++y;
return { char: b, width: y };
}
case "@": {
let y = 1;
for (; m[++g] === "@"; ) ++y;
let x = y;
for (g -= 1; m[++g] === "#"; ) ++x;
return { char: b, min: y, width: x };
}
case "E": {
let y = m[g + 1] === "+";
y && ++g;
let x = 0;
for (; m[++g] === "0"; ) ++x;
let k = (y ? 2 : 1) + x;
if (x) return { char: b, expDigits: x, plus: y, width: k };
break;
}
case ".":
case ",":
return { char: b, width: 1 };
}
return null;
}
function $a(m, g, b) {
let y;
(function(Q) {
Q[Q.Prefix = 0] = "Prefix", Q[Q.Number = 1] = "Number", Q[Q.Suffix = 2] = "Suffix";
})(y || (y = {}));
let x = [], k = [], O = [], M = y.Prefix, z = "";
for (; g < m.length; ) {
let Q = m[g];
if (Q === ";") {
g += 1;
break;
}
switch (M) {
case y.Prefix: {
let Oe = Ut(m, g, b);
if (Oe) z && (x.push({ char: "'", str: z, width: z.length }), z = ""), x.push(Oe), g += Oe.width;
else {
let Ve = Nt(m, g);
Ve ? (z && (x.push({ char: "'", str: z, width: z.length }), z = ""), M = y.Number, k.push(Ve), g += Ve.width) : (z += Q, g += 1);
}
break;
}
case y.Number: {
let Oe = Nt(m, g);
Oe ? (k.push(Oe), g += Oe.width) : M = y.Suffix;
break;
}
case y.Suffix: {
let Oe = Ut(m, g, b);
Oe ? (z && (O.push({ char: "'", str: z, width: z.length }), z = ""), O.push(Oe), g += Oe.width) : (z += Q, g += 1);
break;
}
}
}
return z && O.push({ char: "'", str: z, width: z.length }), { pattern: { prefix: x, number: k, suffix: O }, pos: g };
}
function Ca(m, g) {
let { pattern: b, pos: y } = $a(m, 0, g);
if (y < m.length) {
let { pattern: x } = $a(m, y, g);
return { tokens: b, negative: x };
}
return { tokens: b };
}
function an(m, g) {
let b = {}, y = !1, x = !1, k = 0, O = "", M = -1, z = "", Q = 0;
for (let Ve = 0; Ve < m.length; ++Ve) {
let Je = m[Ve];
switch (Je.char) {
case "#": {
if (M === -1) {
if (O) {
let fe = "Pattern has # after integer digits";
g(new Y("#", fe));
}
k += Je.width;
} else Q += Je.width;
break;
}
case "0": {
if (M === -1) O += Je.digits;
else {
if (Q) {
let fe = "Pattern has digits after # in fraction";
g(new Y("0", fe));
}
z += Je.digits;
}
break;
}
case "@": {
b.precision && g(new le("precision", b.precision)), b.precision = { style: "precision-fraction", minSignificant: Je.min, maxSignificant: Je.width };
break;
}
case ",":
y = !0;
break;
case ".":
if (M === 1) {
let fe = "Pattern has more than one decimal separator";
g(new Y(".", fe));
}
M = Ve;
break;
case "E": {
if (x && g(new le("exponent", b.notation)), y) {
let fe = "Exponential patterns may not contain grouping separators";
g(new Y("E", fe));
}
b.notation = { style: "scientific" }, Je.expDigits > 1 && (b.notation.expDigits = Je.expDigits), Je.plus && (b.notation.expSign = "sign-always"), x = !0;
}
}
}
y ? b.group = "group-auto" : k + O.length > 3 && (b.group = "group-off");
let Oe = +`${O || "0"}.${z}`;
if (Oe && (b.precision = { style: "precision-increment", increment: Oe }), !x) O.length > 1 && (b.integerWidth = { min: O.length }), !b.precision && (z.length || Q) && (b.precision = { style: "precision-fraction", minFraction: z.length, maxFraction: z.length + Q });
else if ((!b.precision || Oe) && (b.integerWidth = k ? { min: 1, max: k + O.length } : { min: Math.max(1, O.length) }), b.precision) Oe || (b.integerWidth = { min: 1, max: 1 });
else {
let Ve = O.length + z.length;
M === -1 ? Ve > 0 && (b.precision = { style: "precision-fraction", maxSignificant: Ve }) : (b.precision = { style: "precision-fraction", maxSignificant: Math.max(1, Ve) + Q }, Ve > 1 && (b.precision.minSignificant = Ve));
}
return b;
}
function rr(m, g, b, y, x) {
let k = !1, O = "";
for (let M of m) switch (M.char) {
case "%":
g.unit = { style: M.style }, x ? k = !0 : O = "";
break;
case "¤":
if (!b) {
let z = "The ¤ pattern requires a currency";
y(new Y("¤", z));
break;
}
switch (g.unit = { style: "currency", currency: b }, M.currency) {
case "iso-code":
g.unitWidth = "unit-width-iso-code";
break;
case "full-name":
g.unitWidth = "unit-width-full-name";
break;
case "narrow":
g.unitWidth = "unit-width-narrow";
break;
}
x ? k = !0 : O = "";
break;
case "*":
break;
case "+":
k || (O += "+");
break;
case "'":
k || (O += M.str);
break;
}
return O;
}
function _c(m, g) {
let b = !1, y = "";
for (let x of m) switch (x.char) {
case "%":
case "¤":
g ? b = !0 : y = "";
break;
case "-":
b || (y += "-");
break;
case "'":
b || (y += x.str);
break;
}
return y;
}
function xc(m, g) {
let b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : (z) => {
throw z;
}, { tokens: y, negative: x } = Ca(m, b), k = an(y.number, b), O = rr(y.prefix, k, g, b, !0), M = rr(y.suffix, k, g, b, !1);
if (x) {
let z = _c(x.prefix, !0), Q = _c(x.suffix, !1);
k.affix = { pos: [O, M], neg: [z, Q] }, k.sign = "sign-never";
} else (O || M) && (k.affix = { pos: [O, M] });
return k;
}
function eue(m) {
return ["arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt"].indexOf(m) !== -1;
}
function L0(m) {
let g = ["acceleration", "angle", "area", "concentr", "consumption", "digital", "duration", "electric", "energy", "force", "frequency", "graphics", "length", "light", "mass", "power", "pressure", "speed", "temperature", "torque", "volume"], [b] = m.split("-", 1);
return g.indexOf(b) !== -1;
}
let F0 = { "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 }, V0 = { currency: 1, "integer-width": 1, "measure-unit": 1, "numbering-system": 1, "per-measure-unit": 1, "precision-increment": 1, scale: 1 };
function tue(m) {
return m in F0;
}
function aue(m) {
return m in V0;
}
function iue(m, g, b) {
if (tue(m)) {
let y = F0[m];
if (g.length > y) {
if (y === 0) for (let x of g) b(new va(m, x));
else b(new X(m, g, y));
return !1;
} else if (aue(m) && g.length < V0[m]) return b(new Ge(m)), !1;
}
return !0;
}
function gh(m, g) {
let b = g === "fraction" ? /^\.(0*)(\+|#*)$/ : /^(@+)(\+|#*)$/, y = m && m.match(b);
if (y) {
let x = y[1].length;
switch (y[2].charAt(0)) {
case "":
return { min: x, max: x };
case "+":
return { min: x, max: null };
case "#":
return { min: x, max: x + y[2].length };
}
}
return null;
}
function nue(m, g, b) {
let y = gh(m, "fraction");
if (y) {
g.length > 1 && b(new X(m, g, 1));
let k = { style: "precision-fraction", source: m, minFraction: y.min };
y.max != null && (k.maxFraction = y.max);
let O = g[0], M = gh(O, "significant");
return M ? (k.source = `${m}/${O}`, k.minSignificant = M.min, M.max != null && (k.maxSignificant = M.max)) : O && b(new va(m, O)), k;
}
let x = gh(m, "significant");
if (x) {
for (let O of g) b(new va(m, O));
let k = { style: "precision-fraction", source: m, minSignificant: x.min };
return x.max != null && (k.maxSignificant = x.max), k;
}
return null;
}
class rue {
constructor(g) {
this.skeleton = {}, this.onError = g;
}
badOption(g, b) {
this.onError(new va(g, b));
}
assertEmpty(g) {
let b = this.skeleton[g];
b && this.onError(new le(g, b));
}
parseToken(g, b) {
if (!iue(g, b, this.onError)) return;
let y = b[0], x = this.skeleton;
switch (g) {
case "compact-short":
case "compact-long":
case "notation-simple":
this.assertEmpty("notation"), x.notation = { style: g };
break;
case "scientific":
case "engineering": {
let k = null, O;
for (let z of b) switch (z) {
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":
O = z;
break;
default:
/^\+e+$/.test(z) ? k = z.length - 1 : this.badOption(g, z);
}
this.assertEmpty("notation");
let M = b.join("/");
x.notation = k && O ? { style: g, source: M, expDigits: k, expSign: O } : k ? { style: g, source: M, expDigits: k } : O ? { style: g, source: M, expSign: O } : { style: g, source: M };
break;
}
case "percent":
case "permille":
case "base-unit":
this.assertEmpty("unit"), x.unit = { style: g };
break;
case "currency":
/^[A-Z]{3}$/.test(y) ? (this.assertEmpty("unit"), x.unit = { style: g, currency: y }) : this.badOption(g, y);
break;
case "measure-unit": {
L0(y) ? (this.assertEmpty("unit"), x.unit = { style: g, unit: y }) : this.badOption(g, y);
break;
}
case "per-measure-unit": {
L0(y) ? (this.assertEmpty("unitPer"), x.unitPer = y) : this.badOption(g, 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"), x.unitWidth = g;
break;
case "precision-integer":
case "precision-unlimited":
case "precision-currency-cash":
this.assertEmpty("precision"), x.precision = { style: g };
break;
case "precision-currency-standard":
this.assertEmpty("precision"), y === "w" ? x.precision = { style: g, trailingZero: "stripIfInteger" } : x.precision = { style: g };
break;
case "precision-increment": {
let k = Number(y);
k > 0 ? (this.assertEmpty("precision"), x.precision = { style: g, increment: k }) : this.badOption(g, 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"), x.roundingMode = g;
break;
case "integer-width": {
if (/^\+0*$/.test(y)) this.assertEmpty("integerWidth"), x.integerWidth = { source: y, min: y.length - 1 };
else {
let k = y.match(/^#*(0*)$/);
k ? (this.assertEmpty("integerWidth"), x.integerWidth = { source: y, min: k[1].length, max: k[0].length }) : this.badOption(g, y);
}
break;
}
case "scale": {
let k = Number(y);
k > 0 ? (this.assertEmpty("scale"), x.scale = k) : this.badOption(g, y);
break;
}
case "group-off":
case "group-min2":
case "group-auto":
case "group-on-aligned":
case "group-thousands":
this.assertEmpty("group"), x.group = g;
break;
case "latin":
this.assertEmpty("numberingSystem"), x.numberingSystem = "latn";
break;
case "numbering-system": {
eue(y) ? (this.assertEmpty("numberingSystem"), x.numberingSystem = y) : this.badOption(g, 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"), x.sign = g;
break;
case "decimal-auto":
case "decimal-always":
this.assertEmpty("decimal"), x.decimal = g;
break;
default: {
let k = nue(g, b, this.onError);
k ? (this.assertEmpty("precision"), x.precision = k) : this.onError(new ge(g));
}
}
}
}
function z0(m) {
let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (x) => {
throw x;
}, b = [];
for (let x of m.split(" ")) if (x) {
let k = x.split("/"), O = k.shift() || "";
b.push({ stem: O, options: k });
}
let y = new rue(g);
for (let { stem: x, options: k } of b) y.parseToken(x, k);
return y.skeleton;
}
function oue(m, g, b, y) {
typeof g == "string" && (g = g.indexOf("::") === 0 ? z0(g.slice(2), y) : xc(g, b, y));
let x = pe(m, g), k = ht(g), O = Ga(g), M = new Intl.NumberFormat(x, k);
if (g.affix) {
let [z, Q] = g.affix.pos, [Oe, Ve] = g.affix.neg || ["", ""];
return (Je) => {
let fe = M.format(O(Je));
return Je < 0 ? `${Oe}${fe}${Ve}` : `${z}${fe}${Q}`;
};
}
return (z) => M.format(O(z));
}
function sue(m, g, b, y) {
typeof g == "string" && (g = g.indexOf("::") === 0 ? z0(g.slice(2), y) : xc(g, b, y));
let x = pe(m, g), k = ht(g), O = it(g), M = ["(function() {", `var opt = ${JSON.stringify(k)};`, `var nf = new Intl.NumberFormat(${JSON.stringify(x)}, opt);`], z = "nf.format(value)";
if (O && (M.push(`var mod = ${O};`), z = "nf.format(mod(value))"), g.affix) {
let [Q, Oe] = g.affix.pos.map((Ve) => JSON.stringify(Ve));
if (g.affix.neg) {
let [Ve, Je] = g.affix.neg.map((fe) => JSON.stringify(fe));
z = `value < 0 ? ${Ve} + ${z} + ${Je} : ${Q} + ${z} + ${Oe}`;
} else z = `${Q} + ${z} + ${Oe}`;
}
return M.push(`return function(value) { return ${z}; }`), M.join(`
`) + `
})()`;
}
var vh = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function lue(m) {
return m && m.__esModule && Object.prototype.hasOwnProperty.call(m, "default") ? m.default : m;
}
var Us = {}, B0 = {}, j0 = { exports: {} };
(function(m) {
(function(g, b) {
m.exports ? m.exports = b() : g.moo = b();
})(vh, function() {
var g = Object.prototype.hasOwnProperty, b = Object.prototype.toString, y = typeof new RegExp().sticky == "boolean";
function x(W) {
return W && b.call(W) === "[object RegExp]";
}
function k(W) {
return W && typeof W == "object" && !x(W) && !Array.isArray(W);
}
function O(W) {
return W.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
}
function M(W) {
var re = new RegExp("|" + W);
return re.exec("").length - 1;
}
function z(W) {
return "(" + W + ")";
}
function Q(W) {
if (!W.length) return "(?!)";
var re = W.map(function(Se) {
return "(?:" + Se + ")";
}).join("|");
return "(?:" + re + ")";
}
function Oe(W) {
if (typeof W == "string") return "(?:" + O(W) + ")";
if (x(W)) {
if (W.ignoreCase) throw new Error("RegExp /i flag not allowed");
if (W.global) throw new Error("RegExp /g flag is implied");
if (W.sticky) throw new Error("RegExp /y flag is implied");
if (W.multiline) throw new Error("RegExp /m flag is implied");
return W.source;
} else throw new Error("Not a pattern: " + W);
}
function Ve(W, re) {
return W.length > re ? W : Array(re - W.length + 1).join(" ") + W;
}
function Je(W, re) {
for (var Se = W.length, Te = 0; ; ) {
var We = W.lastIndexOf(`
`, Se - 1);
if (We === -1 || (Te++, Se = We, Te === re) || Se === 0) break;
}
var Fe = Te < re ? 0 : Se + 1;
return W.substring(Fe).split(`
`);
}
function fe(W) {
for (var re = Object.getOwnPropertyNames(W), Se = [], Te = 0; Te < re.length; Te++) {
var We = re[Te], Fe = W[We], nt = [].concat(Fe);
if (We === "include") {
for (var Ht = 0; Ht < nt.length; Ht++) Se.push({ include: nt[Ht] });
continue;
}
var wt = [];
nt.forEach(function(je) {
k(je) ? (wt.length && Se.push(ua(We, wt)), Se.push(ua(We, je)), wt = []) : wt.push(je);
}), wt.length && Se.push(ua(We, wt));
}
return Se;
}
function Lt(W) {
for (var re = [], Se = 0; Se < W.length; Se++) {
var Te = W[Se];
if (Te.include) {
for (var We = [].concat(Te.include), Fe = 0; Fe < We.length; Fe++) re.push({ include: We[Fe] });
continue;
}
if (!Te.type) throw new Error("Rule has no type: " + JSON.stringify(Te));
re.push(ua(Te.type, Te));
}
return re;
}
function ua(W, re) {
if (k(re) || (re = { match: re }), re.include) throw new Error("Matching rules cannot also include states");
var Se = { defaultType: W, lineBreaks: !!re.error || !!re.fallback, pop: !1, next: null, push: null, error: !1, fallback: !1, value: null, type: null, shouldThrow: !1 };
for (var Te in re) g.call(re, Te) && (Se[Te] = re[Te]);
if (typeof Se.type == "string" && W !== Se.type) throw new Error("Type transform cannot be a string (type '" + Se.type + "' for token '" + W + "')");
var We = Se.match;
return Se.match = Array.isArray(We) ? We : We ? [We] : [], Se.match.sort(function(Fe, nt) {
return x(Fe) && x(nt) ? 0 : x(nt) ? -1 : x(Fe) ? 1 : nt.length - Fe.length;
}), Se;
}
function Sa(W) {
return Array.isArray(W) ? Lt(W) : fe(W);
}
var ni = ua("error", { lineBreaks: !0, shouldThrow: !0 });
function Wi(W, re) {
for (var Se = null, Te = /* @__PURE__ */ Object.create(null), We = !0, Fe = null, nt = [], Ht = [], wt = 0; wt < W.length; wt++) W[wt].fallback && (We = !1);
for (var wt = 0; wt < W.length; wt++) {
var je = W[wt];
if (je.include) throw new Error("Inheritance is not allowed in stateless lexers");
if (je.error || je.fallback) {
if (Se) throw !je.fallback == !Se.fallback ? new Error("Multiple " + (je.fallback ? "fallback" : "error") + " rules not allowed (for token '" + je.defaultType + "')") : new Error("fallback and error are mutually exclusive (for token '" + je.defaultType + "')");
Se = je;
}
var ba = je.match.slice();
if (We) for (; ba.length && typeof ba[0] == "string" && ba[0].length === 1; ) {
var Io = ba.shift();
Te[Io.charCodeAt(0)] = je;
}
if (je.pop || je.push || je.next) {
if (!re) throw new Error("State-switching options are not allowed in stateless lexers (for token '" + je.defaultType + "')");
if (je.fallback) throw new Error("State-switching options are not allowed on fallback tokens (for token '" + je.defaultType + "')");
}
if (ba.length !== 0) {
We = !1, nt.push(je);
for (var on = 0; on < ba.length; on++) {
var Nr = ba[on];
if (x(Nr)) {
if (Fe === null) Fe = Nr.unicode;
else if (Fe !== Nr.unicode && je.fallback === !1) throw new Error("If one rule is /u then all must be");
}
}
var Oo = Q(ba.map(Oe)), qi = new RegExp(Oo);
if (qi.test("")) throw new Error("RegExp matches empty string: " + qi);
var qs = M(Oo);
if (qs > 0) throw new Error("RegExp has capture groups: " + qi + `
Use (?: … ) instead`);
if (!je.lineBreaks && qi.test(`
`)) throw new Error("Rule should declare lineBreaks: " + qi);
Ht.push(z(Oo));
}
}
var To = Se && Se.fallback, Gs = y && !To ? "ym" : "gm", Ic = y || To ? "" : "|";
Fe === !0 && (Gs += "u");
var jue = new RegExp(Q(Ht) + Ic, Gs);
return { regexp: jue, groups: nt, fast: Te, error: Se || ni };
}
function sr(W) {
var re = Wi(Sa(W));
return new Jt({ start: re }, "start");
}
function Nn(W, re, Se) {
var Te = W && (W.push || W.next);
if (Te && !Se[Te]) throw new Error("Missing state '" + Te + "' (in token '" + W.defaultType + "' of state '" + re + "')");
if (W && W.pop && +W.pop != 1) throw new Error("pop must be 1 (in token '" + W.defaultType + "' of state '" + re + "')");
}
function Ln(W, re) {
var Se = W.$all ? Sa(W.$all) : [];
delete W.$all;
var Te = Object.getOwnPropertyNames(W);
re || (re = Te[0]);
for (var We = /* @__PURE__ */ Object.create(null), Fe = 0; Fe < Te.length; Fe++) {
var nt = Te[Fe];
We[nt] = Sa(W[nt]).concat(Se);
}
for (var Fe = 0; Fe < Te.length; Fe++) for (var nt = Te[Fe], Ht = We[nt], wt = /* @__PURE__ */ Object.create(null), je = 0; je < Ht.length; je++) {
var ba = Ht[je];
if (ba.include) {
var Io = [je, 1];
if (ba.include !== nt && !wt[ba.include]) {
wt[ba.include] = !0;
var on = We[ba.include];
if (!on) throw new Error("Cannot include nonexistent state '" + ba.include + "' (in state '" + nt + "')");
for (var Nr = 0; Nr < on.length; Nr++) {
var Oo = on[Nr];
Ht.indexOf(Oo) === -1 && Io.push(Oo);
}
}
Ht.splice.apply(Ht, Io), je--;
}
}
for (var qi = /* @__PURE__ */ Object.create(null), Fe = 0; Fe < Te.length; Fe++) {
var nt = Te[Fe];
qi[nt] = Wi(We[nt], !0);
}
for (var Fe = 0; Fe < Te.length; Fe++) {
for (var qs = Te[Fe], To = qi[qs], Gs = To.groups, je = 0; je < Gs.length; je++) Nn(Gs[je], qs, qi);
for (var Ic = Object.getOwnPropertyNames(To.fast), je = 0; je < Ic.length; je++) Nn(To.fast[Ic[je]], qs, qi);
}
return new Jt(qi, re);
}
function Fn(W) {
for (var re = typeof Map < "u", Se = re ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null), Te = Object.getOwnPropertyNames(W), We = 0; We < Te.length; We++) {
var Fe = Te[We], nt = W[Fe], Ht = Array.isArray(nt) ? nt : [nt];
Ht.forEach(function(wt) {
if (typeof wt != "string") throw new Error("keyword must be string (in keyword '" + Fe + "')");
re ? Se.set(wt, Fe) : Se[wt] = Fe;
});
}
return function(wt) {
return re ? Se.get(wt) : Se[wt];
};
}
var Jt = function(W, re) {
this.startState = re, this.states = W, this.buffer = "", this.stack = [], this.reset();
};
Jt.prototype.reset = function(W, re) {
return this.buffer = W || "", this.index = 0, this.line = re ? re.line : 1, this.col = re ? re.col : 1, this.queuedToken = re ? re.queuedToken : null, this.queuedText = re ? re.queuedText : "", this.queuedThrow = re ? re.queuedThrow : null, this.setState(re ? re.state : this.startState), this.stack = re && re.stack ? re.stack.slice() : [], this;
}, Jt.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 };
}, Jt.prototype.setState = function(W) {
if (!(!W || this.state === W)) {
this.state = W;
var re = this.states[W];
this.groups = re.groups, this.error = re.error, this.re = re.regexp, this.fast = re.fast;
}
}, Jt.prototype.popState = function() {
this.setState(this.stack.pop());
}, Jt.prototype.pushState = function(W) {
this.stack.push(this.state), this.setState(W);
};
var Sc = y ? function(W, re) {
return W.exec(re);
} : function(W, re) {
var Se = W.exec(re);
return Se[0].length === 0 ? null : Se;
};
Jt.prototype._getGroup = function(W) {
for (var re = this.groups.length, Se = 0; Se < re; Se++) if (W[Se + 1] !== void 0) return this.groups[Se];
throw new Error("Cannot find token type for matched text");
};
function Dc() {
return this.value;
}
if (Jt.prototype.next = function() {
var W = this.index;
if (this.queuedGroup) {
var re = this._token(this.queuedGroup, this.queuedText, W);
return this.queuedGroup = null, this.queuedText = "", re;
}
var Se = this.buffer;
if (W !== Se.length) {
var nt = this.fast[Se.charCodeAt(W)];
if (nt) return this._token(nt, Se.charAt(W), W);
var Te = this.re;
Te.lastIndex = W;
var We = Sc(Te, Se), Fe = this.error;
if (We == null) return this._token(Fe, Se.slice(W, Se.length), W);
var nt = this._getGroup(We), Ht = We[0];
return Fe.fallback && We.index !== W ? (this.queuedGroup = nt, this.queuedText = Ht, this._token(Fe, Se.slice(W, We.index), W)) : this._token(nt, Ht, W);
}
}, Jt.prototype._token = function(W, re, Se) {
var Te = 0;
if (W.lineBreaks) {
var We = /\n/g, Fe = 1;
if (re === `
`) Te = 1;
else for (; We.exec(re); ) Te++, Fe = We.lastIndex;
}
var nt = { type: typeof W.type == "function" && W.type(re) || W.defaultType, value: typeof W.value == "function" ? W.value(re) : re, text: re, toString: Dc, offset: Se, lineBreaks: Te, line: this.line, col: this.col }, Ht = re.length;
if (this.index += Ht, this.line += Te, Te !== 0 ? this.col = Ht - Fe + 1 : this.col += Ht, W.shouldThrow) {
var wt = new Error(this.formatError(nt, "invalid syntax"));
throw wt;
}
return W.pop ? this.popState() : W.push ? this.pushState(W.push) : W.next && this.setState(W.next), nt;
}, typeof Symbol < "u" && Symbol.iterator) {
var Vn = function(W) {
this.lexer = W;
};
Vn.prototype.next = function() {
var W = this.lexer.next();
return { value: W, done: !W };
}, Vn.prototype[Symbol.iterator] = function() {
return this;
}, Jt.prototype[Symbol.iterator] = function() {
return new Vn(this);
};
}
return Jt.prototype.formatError = function(Te, re) {
if (Te == null) var Se = this.buffer.slice(this.index), Te = { text: Se, offset: this.index, lineBreaks: Se.indexOf(`
`) === -1 ? 0 : 1, line: this.line, col: this.col };
var We = 2, Fe = Math.max(Te.line - We, 1), nt = Te.line + We, Ht = String(nt).length, wt = Je(th