@intlify/core 12.0.0-alpha.4 → 12.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.esm-browser.js +473 -377
- package/dist/core.esm-browser.prod.js +640 -568
- package/dist/core.global.js +475 -377
- package/dist/core.global.prod.js +659 -579
- package/dist/core.js +1 -1
- package/dist/core.node.js +1 -1
- package/dist/core.runtime.esm-browser.js +448 -363
- package/dist/core.runtime.esm-browser.prod.js +504 -433
- package/dist/core.runtime.global.js +450 -363
- package/dist/core.runtime.global.prod.js +503 -429
- package/dist/core.runtime.js +1 -5
- package/dist/core.runtime.node.js +1 -5
- package/package.json +4 -4
|
@@ -1,30 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @intlify/core v12.0.0-alpha.
|
|
2
|
+
* @intlify/core v12.0.0-alpha.6
|
|
3
3
|
* (c) 2016-present kazuya kawaguchi and contributors
|
|
4
4
|
* @license MIT
|
|
5
|
-
**/
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
const RE_ARGS = /\{([0-9a-z]+)\}/gi;
|
|
9
|
-
function format$1(e, ...n) {
|
|
10
|
-
return n.length === 1 && isObject(n[0]) && (n = n[0]), (!n || !n.hasOwnProperty) && (n = {}), e.replace(RE_ARGS, (e, t) => n.hasOwnProperty(t) ? n[t] : ``);
|
|
5
|
+
**/ const e = /\{([0-9a-z]+)\}/gi;
|
|
6
|
+
function t(t, ...n) {
|
|
7
|
+
return n.length === 1 && y(n[0]) && (n = n[0]), (!n || !n.hasOwnProperty) && (n = {}), t.replace(e, (e, t) => n.hasOwnProperty(t) ? n[t] : ``);
|
|
11
8
|
}
|
|
12
|
-
const
|
|
9
|
+
const n = (e, t, n) => r({
|
|
13
10
|
l: e,
|
|
14
11
|
k: t,
|
|
15
12
|
s: n
|
|
16
|
-
}),
|
|
17
|
-
function
|
|
13
|
+
}), r = (e) => JSON.stringify(e).replace(/\u2028/g, `\\u2028`).replace(/\u2029/g, `\\u2029`).replace(/\u0027/g, `\\u0027`), i = (e) => typeof e == `number` && isFinite(e), a = (e) => S(e) === `[object Date]`, o = (e) => S(e) === `[object RegExp]`, s = (e) => Object.keys(e).length === 0, c = Object.assign, l = Object.create, u = (e = null) => l(e), d = Object.prototype.hasOwnProperty;
|
|
14
|
+
function f(e, t) {
|
|
15
|
+
return d.call(e, t);
|
|
16
|
+
}
|
|
17
|
+
function p(e, t) {
|
|
18
|
+
let n = e[t];
|
|
19
|
+
return f(e, t) ? n : void 0;
|
|
20
|
+
}
|
|
21
|
+
function m(e) {
|
|
22
|
+
return f(Object.prototype, e);
|
|
23
|
+
}
|
|
24
|
+
const h = Array.isArray, g = (e) => typeof e == `function`, _ = (e) => typeof e == `string`, v = (e) => typeof e == `boolean`, y = (e) => typeof e == `object` && !!e, b = (e) => y(e) && g(e.then) && g(e.catch), x = Object.prototype.toString, S = (e) => x.call(e), C = (e) => S(e) === `[object Object]`, w = (e) => e == null ? `` : h(e) || C(e) && e.toString === x ? JSON.stringify(e, null, 2) : String(e);
|
|
25
|
+
function T(e, t = ``) {
|
|
26
|
+
return e.reduce((e, n, r) => r === 0 ? e + n : e + t + n, ``);
|
|
27
|
+
}
|
|
28
|
+
function E(e, t) {
|
|
29
|
+
typeof console < `u` && (console.warn(`[intlify] ` + e), t && console.warn(t.stack));
|
|
30
|
+
}
|
|
31
|
+
function D(e) {
|
|
18
32
|
return e.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/\//g, `/`).replace(/=/g, `=`);
|
|
19
33
|
}
|
|
20
|
-
function
|
|
34
|
+
function ee(e) {
|
|
21
35
|
return e.replace(/&(?![a-z0-9#]{2,6};)/gi, `&`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/</g, `<`).replace(/>/g, `>`);
|
|
22
36
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
25
|
-
|
|
37
|
+
const te = /^javascript:/i, ne = /^(?:href|src|action|formaction)$/i, re = /&#(?:x([0-9a-f]+)|(\d+));?/gi, O = /&(?:Tab|NewLine);/g, ie = /:?/gi, ae = /[\u0000-\u0020\u007f-\u009f]/g, oe = /(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i, k = /(^|[\s"'<>/])on(\w+\s*=)/gi, se = /(?:^|[\s"'<>/])srcdoc\s*=/i, ce = /(^|[\s"'<>/])s(rcdoc\s*=)/gi, le = /(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;
|
|
38
|
+
function ue(e, t, n) {
|
|
39
|
+
let r = t || n;
|
|
40
|
+
if (!r) return e;
|
|
41
|
+
let i = Number.parseInt(r, t ? 16 : 10);
|
|
42
|
+
return i <= 127 ? String.fromCharCode(i) : e;
|
|
26
43
|
}
|
|
27
|
-
function
|
|
44
|
+
function A(e) {
|
|
45
|
+
let t = e.replace(re, ue).replace(O, ``).replace(ie, `:`).replace(ae, ``);
|
|
46
|
+
return te.test(t);
|
|
47
|
+
}
|
|
48
|
+
function de(e) {
|
|
28
49
|
let t = /url\s*\(/gi, n = ``, r = 0, i;
|
|
29
50
|
for (; (i = t.exec(e)) !== null;) {
|
|
30
51
|
let a = i.index, o = t.lastIndex - 1, s = o + 1, c = 1, l = null;
|
|
@@ -40,56 +61,55 @@ function sanitizeStyleValue(e) {
|
|
|
40
61
|
}
|
|
41
62
|
if (c !== 0) break;
|
|
42
63
|
let u = e.slice(o + 1, s).trim(), d = u.startsWith(`"`) && u.endsWith(`"`) || u.startsWith(`'`) && u.endsWith(`'`) ? u.slice(1, -1).trim() : u;
|
|
43
|
-
n += e.slice(r, a), n +=
|
|
64
|
+
n += e.slice(r, a), n += A(d) ? `url(about:blank)` : e.slice(a, s + 1), r = s + 1;
|
|
44
65
|
}
|
|
45
66
|
return n + e.slice(r);
|
|
46
67
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
49
|
-
}
|
|
50
|
-
function sanitizeTranslatedHtml(e) {
|
|
51
|
-
return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${sanitizeAttributeValue(t, n)}"`), e = e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g, (e, t, n) => `${t}='${sanitizeAttributeValue(t, n)}'`), /\s*on\w+\s*=\s*["']?[^"'>]+["']?/i.test(e) && (e = e.replace(/(\s+)on(\w+\s*=)/gi, `$1on$2`)), e = e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi, (e, t, n) => hasJavascriptScheme(n) ? `${t}about:blank` : e), e;
|
|
68
|
+
function j(e, t) {
|
|
69
|
+
return ne.test(e) && A(t) ? `about:blank` : ee(e.toLowerCase() === `style` ? de(t) : t);
|
|
52
70
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return hasOwnProperty.call(e, t);
|
|
71
|
+
function fe(e) {
|
|
72
|
+
return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${j(t, n)}"`), e = e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g, (e, t, n) => `${t}='${j(t, n)}'`), oe.test(e) && (e = e.replace(k, `$1on$2`)), se.test(e) && (e = e.replace(ce, `$1s$2`)), e = e.replace(le, (e, t, n, r) => A(r) ? `${t}${n}about:blank` : e), e;
|
|
56
73
|
}
|
|
57
|
-
const
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const isNotObjectOrIsArray = (e) => !isObject(e) || isArray(e);
|
|
62
|
-
function deepCopy(e, t) {
|
|
63
|
-
if (isNotObjectOrIsArray(e) || isNotObjectOrIsArray(t)) throw Error(`Invalid value`);
|
|
64
|
-
let n = [{
|
|
65
|
-
src: e,
|
|
66
|
-
des: t
|
|
67
|
-
}];
|
|
74
|
+
const M = (e) => !y(e) || h(e);
|
|
75
|
+
function pe(e, t) {
|
|
76
|
+
if (M(e) || M(t) || t === Object.prototype) throw Error(`Invalid value`);
|
|
77
|
+
let n = [e, t];
|
|
68
78
|
for (; n.length;) {
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
let e = n.pop(), t = n.pop(), r = Object.keys(t);
|
|
80
|
+
for (let i = 0; i < r.length; i++) {
|
|
81
|
+
let a = r[i];
|
|
82
|
+
if (a === `__proto__`) continue;
|
|
83
|
+
let o = t[a];
|
|
84
|
+
if (!y(o)) {
|
|
85
|
+
e[a] = o;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (h(o)) {
|
|
89
|
+
let t = [];
|
|
90
|
+
t.length = o.length, e[a] = t, n.push(o, t);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
let s = e[a];
|
|
94
|
+
(!y(s) || h(s)) && (s = e[a] = u()), n.push(o, s);
|
|
95
|
+
}
|
|
76
96
|
}
|
|
77
97
|
}
|
|
78
|
-
function
|
|
98
|
+
function me(e, t, n) {
|
|
79
99
|
return {
|
|
80
100
|
line: e,
|
|
81
101
|
column: t,
|
|
82
102
|
offset: n
|
|
83
103
|
};
|
|
84
104
|
}
|
|
85
|
-
function
|
|
105
|
+
function he(e, t, n) {
|
|
86
106
|
let r = {
|
|
87
107
|
start: e,
|
|
88
108
|
end: t
|
|
89
109
|
};
|
|
90
110
|
return n != null && (r.source = n), r;
|
|
91
111
|
}
|
|
92
|
-
const
|
|
112
|
+
const N = {
|
|
93
113
|
EXPECTED_TOKEN: 1,
|
|
94
114
|
INVALID_TOKEN_IN_PLACEHOLDER: 2,
|
|
95
115
|
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
|
|
@@ -107,30 +127,30 @@ const CompileErrorCodes = {
|
|
|
107
127
|
UNHANDLED_CODEGEN_NODE_TYPE: 15,
|
|
108
128
|
UNHANDLED_MINIFIER_NODE_TYPE: 16
|
|
109
129
|
};
|
|
110
|
-
|
|
111
|
-
function
|
|
130
|
+
N.EXPECTED_TOKEN, N.INVALID_TOKEN_IN_PLACEHOLDER, N.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, N.UNKNOWN_ESCAPE_SEQUENCE, N.INVALID_UNICODE_ESCAPE_SEQUENCE, N.UNBALANCED_CLOSING_BRACE, N.UNTERMINATED_CLOSING_BRACE, N.EMPTY_PLACEHOLDER, N.NOT_ALLOW_NEST_PLACEHOLDER, N.INVALID_LINKED_FORMAT, N.MUST_HAVE_MESSAGES_IN_PLURAL, N.UNEXPECTED_EMPTY_LINKED_MODIFIER, N.UNEXPECTED_EMPTY_LINKED_KEY, N.UNEXPECTED_LEXICAL_ANALYSIS, N.UNHANDLED_CODEGEN_NODE_TYPE, N.UNHANDLED_MINIFIER_NODE_TYPE;
|
|
131
|
+
function P(e, t, n = {}) {
|
|
112
132
|
let { domain: r, messages: i, args: a } = n, o = SyntaxError(String(e));
|
|
113
133
|
return o.code = e, t && (o.location = t), o.domain = r, o;
|
|
114
134
|
}
|
|
115
|
-
function
|
|
135
|
+
function F(e) {
|
|
116
136
|
throw e;
|
|
117
137
|
}
|
|
118
|
-
function
|
|
138
|
+
function I(e) {
|
|
119
139
|
switch (e.t = e.type, e.type) {
|
|
120
140
|
case 0: {
|
|
121
141
|
let t = e;
|
|
122
|
-
|
|
142
|
+
I(t.body), t.b = t.body, delete t.body;
|
|
123
143
|
break;
|
|
124
144
|
}
|
|
125
145
|
case 1: {
|
|
126
146
|
let t = e, n = t.cases;
|
|
127
|
-
for (let e = 0; e < n.length; e++)
|
|
147
|
+
for (let e = 0; e < n.length; e++) I(n[e]);
|
|
128
148
|
t.c = n, delete t.cases;
|
|
129
149
|
break;
|
|
130
150
|
}
|
|
131
151
|
case 2: {
|
|
132
152
|
let t = e, n = t.items;
|
|
133
|
-
for (let e = 0; e < n.length; e++)
|
|
153
|
+
for (let e = 0; e < n.length; e++) I(n[e]);
|
|
134
154
|
t.i = n, delete t.items, t.static && (t.s = t.static, delete t.static);
|
|
135
155
|
break;
|
|
136
156
|
}
|
|
@@ -144,7 +164,7 @@ function mangle(e) {
|
|
|
144
164
|
}
|
|
145
165
|
case 6: {
|
|
146
166
|
let t = e;
|
|
147
|
-
|
|
167
|
+
I(t.key), t.k = t.key, delete t.key, t.modifier && (I(t.modifier), t.m = t.modifier, delete t.modifier);
|
|
148
168
|
break;
|
|
149
169
|
}
|
|
150
170
|
case 5: {
|
|
@@ -157,15 +177,14 @@ function mangle(e) {
|
|
|
157
177
|
t.k = t.key, delete t.key;
|
|
158
178
|
break;
|
|
159
179
|
}
|
|
160
|
-
default:
|
|
161
180
|
}
|
|
162
181
|
delete e.type;
|
|
163
182
|
}
|
|
164
|
-
function
|
|
183
|
+
function L(e) {
|
|
165
184
|
let t = e.body;
|
|
166
|
-
return t.type === 2 ?
|
|
185
|
+
return t.type === 2 ? R(t) : t.cases.forEach((e) => R(e)), e;
|
|
167
186
|
}
|
|
168
|
-
function
|
|
187
|
+
function R(e) {
|
|
169
188
|
if (e.items.length === 1) {
|
|
170
189
|
let t = e.items[0];
|
|
171
190
|
(t.type === 3 || t.type === 9) && (e.static = t.value, delete t.value);
|
|
@@ -173,11 +192,11 @@ function optimizeMessageNode(e) {
|
|
|
173
192
|
let t = [];
|
|
174
193
|
for (let n = 0; n < e.items.length; n++) {
|
|
175
194
|
let r = e.items[n];
|
|
176
|
-
if (
|
|
195
|
+
if (r.type !== 3 && r.type !== 9 || r.value == null) break;
|
|
177
196
|
t.push(r.value);
|
|
178
197
|
}
|
|
179
198
|
if (t.length === e.items.length) {
|
|
180
|
-
e.static =
|
|
199
|
+
e.static = T(t);
|
|
181
200
|
for (let t = 0; t < e.items.length; t++) {
|
|
182
201
|
let n = e.items[t];
|
|
183
202
|
(n.type === 3 || n.type === 9) && delete n.value;
|
|
@@ -185,7 +204,7 @@ function optimizeMessageNode(e) {
|
|
|
185
204
|
}
|
|
186
205
|
}
|
|
187
206
|
}
|
|
188
|
-
function
|
|
207
|
+
function ge(e) {
|
|
189
208
|
let t = e, n = 0, r = 1, i = 1, a = 0, o = (e) => t[e] === `\r` && t[e + 1] === `
|
|
190
209
|
`, s = (e) => t[e] === `
|
|
191
210
|
`, c = (e) => t[e] === `\u2029`, l = (e) => t[e] === `\u2028`, u = (e) => o(e) || s(e) || c(e) || l(e), d = () => n, f = () => r, p = () => i, m = () => a, h = (e) => o(e) || c(e) || l(e) ? `
|
|
@@ -222,8 +241,8 @@ function createScanner(e) {
|
|
|
222
241
|
skipToPeek: S
|
|
223
242
|
};
|
|
224
243
|
}
|
|
225
|
-
function
|
|
226
|
-
let n = t.location !== !1, r =
|
|
244
|
+
function _e(e, t = {}) {
|
|
245
|
+
let n = t.location !== !1, r = ge(e), i = () => r.index(), a = () => me(r.line(), r.column(), r.index()), o = a(), s = i(), c = {
|
|
227
246
|
currentType: 13,
|
|
228
247
|
offset: s,
|
|
229
248
|
startLoc: o,
|
|
@@ -239,11 +258,11 @@ function createTokenizer(e, t = {}) {
|
|
|
239
258
|
function d(e, t, r) {
|
|
240
259
|
e.endLoc = a(), e.currentType = t;
|
|
241
260
|
let i = { type: t };
|
|
242
|
-
return n && (i.loc =
|
|
261
|
+
return n && (i.loc = he(e.startLoc, e.endLoc)), r != null && (i.value = r), i;
|
|
243
262
|
}
|
|
244
263
|
let f = (e) => d(e, 13);
|
|
245
264
|
function p(e, t) {
|
|
246
|
-
return e.currentChar() === t ? (e.next(), t) : (
|
|
265
|
+
return e.currentChar() === t ? (e.next(), t) : (N.EXPECTED_TOKEN, a(), ``);
|
|
247
266
|
}
|
|
248
267
|
function m(e) {
|
|
249
268
|
let t = ``;
|
|
@@ -302,7 +321,7 @@ function createTokenizer(e, t = {}) {
|
|
|
302
321
|
}
|
|
303
322
|
function C(e, t) {
|
|
304
323
|
let { currentType: n } = t;
|
|
305
|
-
if (
|
|
324
|
+
if (n !== 7 && n !== 11) return !1;
|
|
306
325
|
m(e);
|
|
307
326
|
let r = e.currentPeek() === `:`;
|
|
308
327
|
return e.resetPeek(), r;
|
|
@@ -325,10 +344,10 @@ function createTokenizer(e, t = {}) {
|
|
|
325
344
|
function E(e, t = !0) {
|
|
326
345
|
let n = (t = !1, r = ``) => {
|
|
327
346
|
let i = e.currentPeek();
|
|
328
|
-
return i === `{` || i === `@` || !i ? t : i === `|` ?
|
|
329
|
-
`
|
|
330
|
-
`
|
|
331
|
-
`))
|
|
347
|
+
return i === `{` || i === `@` || !i ? t : i === `|` ? r !== ` ` && r !== `
|
|
348
|
+
` : i === ` ` ? (e.peek(), n(!0, ` `)) : i !== `
|
|
349
|
+
` || (e.peek(), n(!0, `
|
|
350
|
+
`));
|
|
332
351
|
}, r = n();
|
|
333
352
|
return t && e.resetPeek(), r;
|
|
334
353
|
}
|
|
@@ -336,40 +355,40 @@ function createTokenizer(e, t = {}) {
|
|
|
336
355
|
let n = e.currentChar();
|
|
337
356
|
if (n !== void 0) return t(n) ? (e.next(), n) : null;
|
|
338
357
|
}
|
|
339
|
-
function
|
|
358
|
+
function ee(e) {
|
|
340
359
|
let t = e.charCodeAt(0);
|
|
341
360
|
return t >= 97 && t <= 122 || t >= 65 && t <= 90 || t >= 48 && t <= 57 || t === 95 || t === 36;
|
|
342
361
|
}
|
|
343
|
-
function
|
|
344
|
-
return D(e,
|
|
362
|
+
function te(e) {
|
|
363
|
+
return D(e, ee);
|
|
345
364
|
}
|
|
346
|
-
function
|
|
365
|
+
function ne(e) {
|
|
347
366
|
let t = e.charCodeAt(0);
|
|
348
367
|
return t >= 97 && t <= 122 || t >= 65 && t <= 90 || t >= 48 && t <= 57 || t === 95 || t === 36 || t === 45;
|
|
349
368
|
}
|
|
350
|
-
function
|
|
351
|
-
return D(e,
|
|
369
|
+
function re(e) {
|
|
370
|
+
return D(e, ne);
|
|
352
371
|
}
|
|
353
|
-
function
|
|
372
|
+
function O(e) {
|
|
354
373
|
let t = e.charCodeAt(0);
|
|
355
374
|
return t >= 48 && t <= 57;
|
|
356
375
|
}
|
|
357
|
-
function
|
|
358
|
-
return D(e,
|
|
376
|
+
function ie(e) {
|
|
377
|
+
return D(e, O);
|
|
359
378
|
}
|
|
360
|
-
function
|
|
379
|
+
function ae(e) {
|
|
361
380
|
let t = e.charCodeAt(0);
|
|
362
381
|
return t >= 48 && t <= 57 || t >= 65 && t <= 70 || t >= 97 && t <= 102;
|
|
363
382
|
}
|
|
364
|
-
function
|
|
365
|
-
return D(e,
|
|
383
|
+
function oe(e) {
|
|
384
|
+
return D(e, ae);
|
|
366
385
|
}
|
|
367
|
-
function
|
|
386
|
+
function k(e) {
|
|
368
387
|
let t = ``, n = ``;
|
|
369
|
-
for (; t =
|
|
388
|
+
for (; t = ie(e);) n += t;
|
|
370
389
|
return n;
|
|
371
390
|
}
|
|
372
|
-
function
|
|
391
|
+
function se(e) {
|
|
373
392
|
let t = ``;
|
|
374
393
|
for (;;) {
|
|
375
394
|
let n = e.currentChar();
|
|
@@ -378,153 +397,153 @@ function createTokenizer(e, t = {}) {
|
|
|
378
397
|
r === `{` || r === `}` || r === `@` || r === `|` || r === `\\` ? (t += n + r, e.next(), e.next()) : (e.resetPeek(), t += n, e.next());
|
|
379
398
|
} else if (n === `{` || n === `}` || n === `@` || n === `|` || !n) break;
|
|
380
399
|
else if (n === ` ` || n === `
|
|
381
|
-
`)
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
400
|
+
`) {
|
|
401
|
+
if (E(e)) t += n, e.next();
|
|
402
|
+
else if (T(e)) break;
|
|
403
|
+
else t += n, e.next();
|
|
404
|
+
} else t += n, e.next();
|
|
385
405
|
}
|
|
386
406
|
return t;
|
|
387
407
|
}
|
|
388
|
-
function
|
|
408
|
+
function ce(e) {
|
|
389
409
|
h(e);
|
|
390
410
|
let t = ``, n = ``;
|
|
391
|
-
for (; t =
|
|
411
|
+
for (; t = re(e);) n += t;
|
|
392
412
|
let r = e.currentChar();
|
|
393
413
|
if (r && r !== `}` && r !== void 0 && r !== ` ` && r !== `
|
|
394
414
|
` && r !== ` `) {
|
|
395
|
-
let t =
|
|
396
|
-
return
|
|
415
|
+
let t = M(e);
|
|
416
|
+
return N.INVALID_TOKEN_IN_PLACEHOLDER, a(), n + t, n + t;
|
|
397
417
|
}
|
|
398
|
-
return e.currentChar() === void 0 && (
|
|
418
|
+
return e.currentChar() === void 0 && (N.UNTERMINATED_CLOSING_BRACE, a()), n;
|
|
399
419
|
}
|
|
400
|
-
function
|
|
420
|
+
function le(e) {
|
|
401
421
|
h(e);
|
|
402
422
|
let t = ``;
|
|
403
|
-
return e.currentChar() === `-` ? (e.next(), t += `-${
|
|
423
|
+
return e.currentChar() === `-` ? (e.next(), t += `-${k(e)}`) : t += k(e), e.currentChar() === void 0 && (N.UNTERMINATED_CLOSING_BRACE, a()), t;
|
|
404
424
|
}
|
|
405
|
-
function
|
|
425
|
+
function ue(e) {
|
|
406
426
|
return e !== `'` && e !== `
|
|
407
427
|
`;
|
|
408
428
|
}
|
|
409
|
-
function
|
|
429
|
+
function A(e) {
|
|
410
430
|
h(e), p(e, `'`);
|
|
411
431
|
let t = ``, n = ``;
|
|
412
|
-
for (; t = D(e,
|
|
432
|
+
for (; t = D(e, ue);) n += t === `\\` ? de(e) : t;
|
|
413
433
|
let r = e.currentChar();
|
|
414
434
|
return r === `
|
|
415
|
-
` || r === void 0 ? (
|
|
435
|
+
` || r === void 0 ? (N.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, a(), r === `
|
|
416
436
|
` && (e.next(), p(e, `'`)), n) : (p(e, `'`), n);
|
|
417
437
|
}
|
|
418
|
-
function
|
|
438
|
+
function de(e) {
|
|
419
439
|
let t = e.currentChar();
|
|
420
440
|
switch (t) {
|
|
421
441
|
case `\\`:
|
|
422
442
|
case `'`: return e.next(), `\\${t}`;
|
|
423
|
-
case `u`: return
|
|
424
|
-
case `U`: return
|
|
425
|
-
default: return
|
|
443
|
+
case `u`: return j(e, t, 4);
|
|
444
|
+
case `U`: return j(e, t, 6);
|
|
445
|
+
default: return N.UNKNOWN_ESCAPE_SEQUENCE, a(), ``;
|
|
426
446
|
}
|
|
427
447
|
}
|
|
428
|
-
function
|
|
448
|
+
function j(e, t, n) {
|
|
429
449
|
p(e, t);
|
|
430
450
|
let r = ``;
|
|
431
451
|
for (let i = 0; i < n; i++) {
|
|
432
|
-
let n =
|
|
452
|
+
let n = oe(e);
|
|
433
453
|
if (!n) {
|
|
434
|
-
|
|
454
|
+
N.INVALID_UNICODE_ESCAPE_SEQUENCE, a(), `${t}${r}${e.currentChar()}`;
|
|
435
455
|
break;
|
|
436
456
|
}
|
|
437
457
|
r += n;
|
|
438
458
|
}
|
|
439
459
|
return `\\${t}${r}`;
|
|
440
460
|
}
|
|
441
|
-
function
|
|
461
|
+
function fe(e) {
|
|
442
462
|
return e !== `{` && e !== `}` && e !== ` ` && e !== `
|
|
443
463
|
`;
|
|
444
464
|
}
|
|
445
|
-
function
|
|
465
|
+
function M(e) {
|
|
446
466
|
h(e);
|
|
447
467
|
let t = ``, n = ``;
|
|
448
|
-
for (; t = D(e,
|
|
468
|
+
for (; t = D(e, fe);) n += t;
|
|
449
469
|
return n;
|
|
450
470
|
}
|
|
451
|
-
function
|
|
471
|
+
function pe(e) {
|
|
452
472
|
let t = ``, n = ``;
|
|
453
|
-
for (; t =
|
|
473
|
+
for (; t = te(e);) n += t;
|
|
454
474
|
return n;
|
|
455
475
|
}
|
|
456
|
-
function
|
|
476
|
+
function P(e) {
|
|
457
477
|
let t = (n) => {
|
|
458
478
|
let r = e.currentChar();
|
|
459
479
|
return r === `{` || r === `@` || r === `|` || r === `(` || r === `)` || !r || r === ` ` ? n : (n += r, e.next(), t(n));
|
|
460
480
|
};
|
|
461
481
|
return t(``);
|
|
462
482
|
}
|
|
463
|
-
function
|
|
483
|
+
function F(e) {
|
|
464
484
|
h(e);
|
|
465
485
|
let t = p(e, `|`);
|
|
466
486
|
return h(e), t;
|
|
467
487
|
}
|
|
468
|
-
function
|
|
488
|
+
function I(e, t) {
|
|
469
489
|
let n = null;
|
|
470
490
|
switch (e.currentChar()) {
|
|
471
|
-
case `{`: return t.braceNest >= 1 && (
|
|
472
|
-
case `}`: return t.braceNest > 0 && t.currentType === 2 && (
|
|
473
|
-
case `@`: return t.braceNest > 0 && (
|
|
491
|
+
case `{`: return t.braceNest >= 1 && (N.NOT_ALLOW_NEST_PLACEHOLDER, a()), e.next(), n = d(t, 2, `{`), h(e), t.braceNest++, n;
|
|
492
|
+
case `}`: return t.braceNest > 0 && t.currentType === 2 && (N.EMPTY_PLACEHOLDER, a()), e.next(), n = d(t, 3, `}`), t.braceNest--, t.braceNest > 0 && h(e), t.inLinked && t.braceNest === 0 && (t.inLinked = !1), n;
|
|
493
|
+
case `@`: return t.braceNest > 0 && (N.UNTERMINATED_CLOSING_BRACE, a()), n = L(e, t) || f(t), t.braceNest = 0, n;
|
|
474
494
|
default: {
|
|
475
495
|
let r = !0, i = !0, o = !0;
|
|
476
|
-
if (T(e)) return t.braceNest > 0 && (
|
|
477
|
-
if (t.braceNest > 0 && (t.currentType === 4 || t.currentType === 5 || t.currentType === 6)) return
|
|
478
|
-
if (r = v(e, t)) return n = d(t, 4,
|
|
479
|
-
if (i = y(e, t)) return n = d(t, 5,
|
|
480
|
-
if (o = b(e, t)) return n = d(t, 6,
|
|
481
|
-
if (!r && !i && !o) return n = d(t, 12,
|
|
496
|
+
if (T(e)) return t.braceNest > 0 && (N.UNTERMINATED_CLOSING_BRACE, a()), n = d(t, 1, F(e)), t.braceNest = 0, t.inLinked = !1, n;
|
|
497
|
+
if (t.braceNest > 0 && (t.currentType === 4 || t.currentType === 5 || t.currentType === 6)) return N.UNTERMINATED_CLOSING_BRACE, a(), t.braceNest = 0, R(e, t);
|
|
498
|
+
if (r = v(e, t)) return n = d(t, 4, ce(e)), h(e), n;
|
|
499
|
+
if (i = y(e, t)) return n = d(t, 5, le(e)), h(e), n;
|
|
500
|
+
if (o = b(e, t)) return n = d(t, 6, A(e)), h(e), n;
|
|
501
|
+
if (!r && !i && !o) return n = d(t, 12, M(e)), N.INVALID_TOKEN_IN_PLACEHOLDER, a(), n.value, h(e), n;
|
|
482
502
|
break;
|
|
483
503
|
}
|
|
484
504
|
}
|
|
485
505
|
return n;
|
|
486
506
|
}
|
|
487
|
-
function
|
|
507
|
+
function L(e, t) {
|
|
488
508
|
let { currentType: n } = t, r = null, i = e.currentChar();
|
|
489
509
|
switch ((n === 7 || n === 8 || n === 11 || n === 9) && (i === `
|
|
490
|
-
` || i === ` `) && (
|
|
510
|
+
` || i === ` `) && (N.INVALID_LINKED_FORMAT, a()), i) {
|
|
491
511
|
case `@`: return e.next(), r = d(t, 7, `@`), t.inLinked = !0, r;
|
|
492
512
|
case `.`: return h(e), e.next(), d(t, 8, `.`);
|
|
493
513
|
case `:`: return h(e), e.next(), d(t, 9, `:`);
|
|
494
|
-
default: return T(e) ? (r = d(t, 1,
|
|
514
|
+
default: return T(e) ? (r = d(t, 1, F(e)), t.braceNest = 0, t.inLinked = !1, r) : x(e, t) || C(e, t) ? (h(e), L(e, t)) : S(e, t) ? (h(e), d(t, 11, pe(e))) : w(e, t) ? (h(e), i === `{` ? I(e, t) || r : d(t, 10, P(e))) : (n === 7 && (N.INVALID_LINKED_FORMAT, a()), t.braceNest = 0, t.inLinked = !1, R(e, t));
|
|
495
515
|
}
|
|
496
516
|
}
|
|
497
|
-
function
|
|
517
|
+
function R(e, t) {
|
|
498
518
|
let n = { type: 13 };
|
|
499
|
-
if (t.braceNest > 0) return
|
|
500
|
-
if (t.inLinked) return
|
|
519
|
+
if (t.braceNest > 0) return I(e, t) || f(t);
|
|
520
|
+
if (t.inLinked) return L(e, t) || f(t);
|
|
501
521
|
switch (e.currentChar()) {
|
|
502
|
-
case `{`: return
|
|
503
|
-
case `}`: return
|
|
504
|
-
case `@`: return
|
|
522
|
+
case `{`: return I(e, t) || f(t);
|
|
523
|
+
case `}`: return N.UNBALANCED_CLOSING_BRACE, a(), e.next(), d(t, 3, `}`);
|
|
524
|
+
case `@`: return L(e, t) || f(t);
|
|
505
525
|
default:
|
|
506
|
-
if (T(e)) return n = d(t, 1,
|
|
507
|
-
if (E(e)) return d(t, 0,
|
|
508
|
-
break;
|
|
526
|
+
if (T(e)) return n = d(t, 1, F(e)), t.braceNest = 0, t.inLinked = !1, n;
|
|
527
|
+
if (E(e)) return d(t, 0, se(e));
|
|
509
528
|
}
|
|
510
529
|
return n;
|
|
511
530
|
}
|
|
512
|
-
function
|
|
531
|
+
function _e() {
|
|
513
532
|
let { currentType: e, offset: t, startLoc: n, endLoc: o } = c;
|
|
514
|
-
return c.lastType = e, c.lastOffset = t, c.lastStartLoc = n, c.lastEndLoc = o, c.offset = i(), c.startLoc = a(), r.currentChar() === void 0 ? d(c, 13) :
|
|
533
|
+
return c.lastType = e, c.lastOffset = t, c.lastStartLoc = n, c.lastEndLoc = o, c.offset = i(), c.startLoc = a(), r.currentChar() === void 0 ? d(c, 13) : R(r, c);
|
|
515
534
|
}
|
|
516
535
|
return {
|
|
517
|
-
nextToken:
|
|
536
|
+
nextToken: _e,
|
|
518
537
|
currentOffset: i,
|
|
519
538
|
currentPosition: a,
|
|
520
539
|
context: l
|
|
521
540
|
};
|
|
522
541
|
}
|
|
523
|
-
const
|
|
524
|
-
function
|
|
542
|
+
const ve = /\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6})/g, ye = /\\([\\@{}|])/g;
|
|
543
|
+
function be(e, t) {
|
|
525
544
|
return t;
|
|
526
545
|
}
|
|
527
|
-
function
|
|
546
|
+
function xe(e, t, n) {
|
|
528
547
|
switch (e) {
|
|
529
548
|
case `\\\\`: return `\\`;
|
|
530
549
|
case `\\'`: return `'`;
|
|
@@ -534,7 +553,7 @@ function fromEscapeSequence(e, t, n) {
|
|
|
534
553
|
}
|
|
535
554
|
}
|
|
536
555
|
}
|
|
537
|
-
function
|
|
556
|
+
function Se(e = {}) {
|
|
538
557
|
let t = e.location !== !1, { onError: n } = e;
|
|
539
558
|
function r(e, n, r) {
|
|
540
559
|
let i = { type: e };
|
|
@@ -548,7 +567,7 @@ function createParser(e = {}) {
|
|
|
548
567
|
}
|
|
549
568
|
function a(e, t) {
|
|
550
569
|
let n = e.context(), a = r(3, n.offset, n.startLoc);
|
|
551
|
-
return a.value = t.replace(
|
|
570
|
+
return a.value = t.replace(ye, be), i(a, e.currentOffset(), e.currentPosition()), a;
|
|
552
571
|
}
|
|
553
572
|
function o(e, t) {
|
|
554
573
|
let { lastOffset: n, lastStartLoc: a } = e.context(), o = r(5, n, a);
|
|
@@ -558,13 +577,13 @@ function createParser(e = {}) {
|
|
|
558
577
|
let { lastOffset: n, lastStartLoc: a } = e.context(), o = r(4, n, a);
|
|
559
578
|
return o.key = t, e.nextToken(), i(o, e.currentOffset(), e.currentPosition()), o;
|
|
560
579
|
}
|
|
561
|
-
function
|
|
580
|
+
function l(e, t) {
|
|
562
581
|
let { lastOffset: n, lastStartLoc: a } = e.context(), o = r(9, n, a);
|
|
563
|
-
return o.value = t.replace(
|
|
582
|
+
return o.value = t.replace(ve, xe), e.nextToken(), i(o, e.currentOffset(), e.currentPosition()), o;
|
|
564
583
|
}
|
|
565
584
|
function u(e) {
|
|
566
585
|
let t = e.nextToken(), n = e.context(), { lastOffset: a, lastStartLoc: o } = n, s = r(8, a, o);
|
|
567
|
-
return t.type === 11 ? (t.value == null && (
|
|
586
|
+
return t.type === 11 ? (t.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, n.lastStartLoc, z(t)), s.value = t.value || ``, i(s, e.currentOffset(), e.currentPosition()), { node: s }) : (N.UNEXPECTED_EMPTY_LINKED_MODIFIER, n.lastStartLoc, s.value = ``, i(s, a, o), {
|
|
568
587
|
nextConsumeToken: t,
|
|
569
588
|
node: s
|
|
570
589
|
});
|
|
@@ -579,21 +598,21 @@ function createParser(e = {}) {
|
|
|
579
598
|
let t = u(e);
|
|
580
599
|
n.modifier = t.node, a = t.nextConsumeToken || e.nextToken();
|
|
581
600
|
}
|
|
582
|
-
switch (a.type !== 9 && (
|
|
601
|
+
switch (a.type !== 9 && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(a)), a = e.nextToken(), a.type === 2 && (a = e.nextToken()), a.type) {
|
|
583
602
|
case 10:
|
|
584
|
-
a.value == null && (
|
|
603
|
+
a.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(a)), n.key = d(e, a.value || ``);
|
|
585
604
|
break;
|
|
586
605
|
case 4:
|
|
587
|
-
a.value == null && (
|
|
606
|
+
a.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(a)), n.key = s(e, a.value || ``);
|
|
588
607
|
break;
|
|
589
608
|
case 5:
|
|
590
|
-
a.value == null && (
|
|
609
|
+
a.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(a)), n.key = o(e, a.value || ``);
|
|
591
610
|
break;
|
|
592
611
|
case 6:
|
|
593
|
-
a.value == null && (
|
|
612
|
+
a.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(a)), n.key = l(e, a.value || ``);
|
|
594
613
|
break;
|
|
595
614
|
default: {
|
|
596
|
-
|
|
615
|
+
N.UNEXPECTED_EMPTY_LINKED_KEY, t.lastStartLoc;
|
|
597
616
|
let o = e.context(), s = r(7, o.offset, o.startLoc);
|
|
598
617
|
return s.value = ``, i(s, o.offset, o.startLoc), n.key = s, i(n, o.offset, o.startLoc), {
|
|
599
618
|
nextConsumeToken: a,
|
|
@@ -606,25 +625,25 @@ function createParser(e = {}) {
|
|
|
606
625
|
function p(e) {
|
|
607
626
|
let t = e.context(), n = r(2, t.currentType === 1 ? e.currentOffset() : t.offset, t.currentType === 1 ? t.endLoc : t.startLoc);
|
|
608
627
|
n.items = [];
|
|
609
|
-
let
|
|
628
|
+
let c = null;
|
|
610
629
|
do {
|
|
611
|
-
let r =
|
|
612
|
-
switch (
|
|
630
|
+
let r = c || e.nextToken();
|
|
631
|
+
switch (c = null, r.type) {
|
|
613
632
|
case 0:
|
|
614
|
-
r.value == null && (
|
|
633
|
+
r.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(r)), n.items.push(a(e, r.value || ``));
|
|
615
634
|
break;
|
|
616
635
|
case 5:
|
|
617
|
-
r.value == null && (
|
|
636
|
+
r.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(r)), n.items.push(o(e, r.value || ``));
|
|
618
637
|
break;
|
|
619
638
|
case 4:
|
|
620
|
-
r.value == null && (
|
|
639
|
+
r.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(r)), n.items.push(s(e, r.value || ``));
|
|
621
640
|
break;
|
|
622
641
|
case 6:
|
|
623
|
-
r.value == null && (
|
|
642
|
+
r.value == null && (N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, z(r)), n.items.push(l(e, r.value || ``));
|
|
624
643
|
break;
|
|
625
644
|
case 7: {
|
|
626
645
|
let t = f(e);
|
|
627
|
-
n.items.push(t.node),
|
|
646
|
+
n.items.push(t.node), c = t.nextConsumeToken || null;
|
|
628
647
|
break;
|
|
629
648
|
}
|
|
630
649
|
}
|
|
@@ -638,276 +657,277 @@ function createParser(e = {}) {
|
|
|
638
657
|
let t = p(e);
|
|
639
658
|
s || (s = t.items.length === 0), c.cases.push(t);
|
|
640
659
|
} while (o.currentType !== 13);
|
|
641
|
-
return s &&
|
|
660
|
+
return s && N.MUST_HAVE_MESSAGES_IN_PLURAL, i(c, e.currentOffset(), e.currentPosition()), c;
|
|
642
661
|
}
|
|
643
662
|
function h(e) {
|
|
644
663
|
let t = e.context(), { offset: n, startLoc: r } = t, i = p(e);
|
|
645
664
|
return t.currentType === 13 ? i : m(e, n, r, i);
|
|
646
665
|
}
|
|
647
666
|
function g(n) {
|
|
648
|
-
let a =
|
|
649
|
-
return t && s.loc && (s.loc.source = n), s.body = h(a), e.onCacheKey && (s.cacheKey = e.onCacheKey(n)), o.currentType !== 13 && (
|
|
667
|
+
let a = _e(n, c({}, e)), o = a.context(), s = r(0, o.offset, o.startLoc);
|
|
668
|
+
return t && s.loc && (s.loc.source = n), s.body = h(a), e.onCacheKey && (s.cacheKey = e.onCacheKey(n)), o.currentType !== 13 && (N.UNEXPECTED_LEXICAL_ANALYSIS, o.lastStartLoc, n[o.offset]), i(s, a.currentOffset(), a.currentPosition()), s;
|
|
650
669
|
}
|
|
651
670
|
return { parse: g };
|
|
652
671
|
}
|
|
653
|
-
function
|
|
672
|
+
function z(e) {
|
|
654
673
|
if (e.type === 13) return `EOF`;
|
|
655
674
|
let t = (e.value || ``).replace(/\r?\n/gu, `\\n`);
|
|
656
675
|
return t.length > 10 ? t.slice(0, 9) + `…` : t;
|
|
657
676
|
}
|
|
658
|
-
function
|
|
659
|
-
return
|
|
677
|
+
function B(e) {
|
|
678
|
+
return y(e) && Me(e) === 0 && (f(e, `b`) || f(e, `body`));
|
|
660
679
|
}
|
|
661
|
-
const
|
|
662
|
-
function
|
|
663
|
-
return
|
|
680
|
+
const Ce = [`b`, `body`];
|
|
681
|
+
function we(e) {
|
|
682
|
+
return H(e, Ce);
|
|
664
683
|
}
|
|
665
|
-
const
|
|
666
|
-
function
|
|
667
|
-
return
|
|
684
|
+
const Te = [`c`, `cases`];
|
|
685
|
+
function Ee(e) {
|
|
686
|
+
return H(e, Te, []);
|
|
668
687
|
}
|
|
669
|
-
const
|
|
670
|
-
function
|
|
671
|
-
return
|
|
688
|
+
const De = [`s`, `static`];
|
|
689
|
+
function Oe(e) {
|
|
690
|
+
return H(e, De);
|
|
672
691
|
}
|
|
673
|
-
const
|
|
674
|
-
function
|
|
675
|
-
return
|
|
692
|
+
const ke = [`i`, `items`];
|
|
693
|
+
function Ae(e) {
|
|
694
|
+
return H(e, ke, []);
|
|
676
695
|
}
|
|
677
|
-
const
|
|
678
|
-
function
|
|
679
|
-
return
|
|
696
|
+
const je = [`t`, `type`];
|
|
697
|
+
function Me(e) {
|
|
698
|
+
return H(e, je);
|
|
680
699
|
}
|
|
681
|
-
const
|
|
682
|
-
function
|
|
683
|
-
let n =
|
|
700
|
+
const Ne = [`v`, `value`];
|
|
701
|
+
function V(e, t) {
|
|
702
|
+
let n = H(e, Ne);
|
|
684
703
|
if (n != null) return n;
|
|
685
|
-
throw
|
|
704
|
+
throw U(t);
|
|
686
705
|
}
|
|
687
|
-
const
|
|
688
|
-
function
|
|
689
|
-
return
|
|
706
|
+
const Pe = [`m`, `modifier`];
|
|
707
|
+
function Fe(e) {
|
|
708
|
+
return H(e, Pe);
|
|
690
709
|
}
|
|
691
|
-
const
|
|
692
|
-
function
|
|
693
|
-
let t =
|
|
710
|
+
const Ie = [`k`, `key`];
|
|
711
|
+
function Le(e) {
|
|
712
|
+
let t = H(e, Ie);
|
|
694
713
|
if (t) return t;
|
|
695
|
-
throw
|
|
714
|
+
throw U(6);
|
|
696
715
|
}
|
|
697
|
-
function
|
|
716
|
+
function H(e, t, n) {
|
|
698
717
|
for (let n = 0; n < t.length; n++) {
|
|
699
718
|
let r = t[n];
|
|
700
|
-
if (
|
|
719
|
+
if (f(e, r) && e[r] != null) return e[r];
|
|
701
720
|
}
|
|
702
721
|
return n;
|
|
703
722
|
}
|
|
704
|
-
const
|
|
705
|
-
...
|
|
706
|
-
...
|
|
707
|
-
...
|
|
708
|
-
...
|
|
709
|
-
...
|
|
710
|
-
...
|
|
711
|
-
...
|
|
712
|
-
...
|
|
723
|
+
const Re = [
|
|
724
|
+
...Ce,
|
|
725
|
+
...Te,
|
|
726
|
+
...De,
|
|
727
|
+
...ke,
|
|
728
|
+
...Ie,
|
|
729
|
+
...Pe,
|
|
730
|
+
...Ne,
|
|
731
|
+
...je
|
|
713
732
|
];
|
|
714
|
-
function
|
|
733
|
+
function U(e) {
|
|
715
734
|
return Error(`unhandled node type: ${e}`);
|
|
716
735
|
}
|
|
717
|
-
function
|
|
718
|
-
return (t) =>
|
|
736
|
+
function ze(e) {
|
|
737
|
+
return (t) => Be(t, e);
|
|
719
738
|
}
|
|
720
|
-
function
|
|
721
|
-
let n =
|
|
722
|
-
if (n == null) throw
|
|
723
|
-
if (
|
|
724
|
-
let t =
|
|
725
|
-
return e.plural(t.reduce((t, n) => [...
|
|
726
|
-
}
|
|
739
|
+
function Be(e, t) {
|
|
740
|
+
let n = we(t);
|
|
741
|
+
if (n == null) throw U(0);
|
|
742
|
+
if (Me(n) === 1) {
|
|
743
|
+
let t = Ee(n);
|
|
744
|
+
return e.plural(t.reduce((t, n) => [...h(t) ? t : [t], Ve(e, n)], []));
|
|
745
|
+
}
|
|
746
|
+
return Ve(e, n);
|
|
727
747
|
}
|
|
728
|
-
function
|
|
729
|
-
let n =
|
|
748
|
+
function Ve(e, t) {
|
|
749
|
+
let n = Oe(t);
|
|
730
750
|
if (n != null) return e.type === `text` ? n : e.normalize([n]);
|
|
731
751
|
{
|
|
732
|
-
let n =
|
|
752
|
+
let n = Ae(t).reduce((t, n) => [...t, He(e, n)], []);
|
|
733
753
|
return e.normalize(n);
|
|
734
754
|
}
|
|
735
755
|
}
|
|
736
|
-
function
|
|
737
|
-
let n =
|
|
756
|
+
function He(e, t) {
|
|
757
|
+
let n = Me(t);
|
|
738
758
|
switch (n) {
|
|
739
|
-
case 3: return
|
|
740
|
-
case 9: return
|
|
759
|
+
case 3: return V(t, n);
|
|
760
|
+
case 9: return V(t, n);
|
|
741
761
|
case 4: {
|
|
742
762
|
let r = t;
|
|
743
|
-
if (
|
|
744
|
-
if (
|
|
745
|
-
throw
|
|
763
|
+
if (f(r, `k`) && r.k) return e.interpolate(e.named(r.k));
|
|
764
|
+
if (f(r, `key`) && r.key) return e.interpolate(e.named(r.key));
|
|
765
|
+
throw U(n);
|
|
746
766
|
}
|
|
747
767
|
case 5: {
|
|
748
768
|
let r = t;
|
|
749
|
-
if (
|
|
750
|
-
if (
|
|
751
|
-
throw
|
|
769
|
+
if (f(r, `i`) && i(r.i)) return e.interpolate(e.list(r.i));
|
|
770
|
+
if (f(r, `index`) && i(r.index)) return e.interpolate(e.list(r.index));
|
|
771
|
+
throw U(n);
|
|
752
772
|
}
|
|
753
773
|
case 6: {
|
|
754
|
-
let n = t, r =
|
|
755
|
-
return e.linked(
|
|
774
|
+
let n = t, r = Fe(n), i = Le(n);
|
|
775
|
+
return e.linked(He(e, i), r ? He(e, r) : void 0, e.type);
|
|
756
776
|
}
|
|
757
|
-
case 7: return
|
|
758
|
-
case 8: return
|
|
777
|
+
case 7: return V(t, n);
|
|
778
|
+
case 8: return V(t, n);
|
|
759
779
|
default: throw Error(`unhandled node on format message part: ${n}`);
|
|
760
780
|
}
|
|
761
781
|
}
|
|
762
|
-
const
|
|
763
|
-
let
|
|
764
|
-
function
|
|
765
|
-
|
|
782
|
+
const Ue = (e) => e;
|
|
783
|
+
let W = u();
|
|
784
|
+
function We() {
|
|
785
|
+
W = u();
|
|
766
786
|
}
|
|
767
|
-
function
|
|
768
|
-
let n = !1, r = t.onError ||
|
|
787
|
+
function Ge(e, t = {}) {
|
|
788
|
+
let n = !1, r = t.onError || F;
|
|
769
789
|
t.onError = (e) => {
|
|
770
790
|
n = !0, r(e);
|
|
771
791
|
};
|
|
772
|
-
let i =
|
|
773
|
-
return t.optimize &&
|
|
792
|
+
let i = Se(t).parse(e);
|
|
793
|
+
return t.optimize && L(i), t.mangle && I(i), {
|
|
774
794
|
ast: i,
|
|
775
795
|
detectError: n,
|
|
776
796
|
code: ``
|
|
777
797
|
};
|
|
778
798
|
}
|
|
779
|
-
function
|
|
780
|
-
if (
|
|
781
|
-
|
|
782
|
-
let n = (t.onCacheKey ||
|
|
799
|
+
function Ke(e, t) {
|
|
800
|
+
if (_(e)) {
|
|
801
|
+
v(t.warnHtmlMessage) && t.warnHtmlMessage;
|
|
802
|
+
let n = (t.onCacheKey || Ue)(e), r = W[n];
|
|
783
803
|
if (r) return r;
|
|
784
|
-
let { ast: i, detectError: a } =
|
|
804
|
+
let { ast: i, detectError: a } = Ge(e, {
|
|
785
805
|
...t,
|
|
786
806
|
location: !1,
|
|
787
807
|
mangle: !0,
|
|
788
808
|
optimize: !0
|
|
789
|
-
}), o =
|
|
790
|
-
return a ? o :
|
|
791
|
-
}
|
|
809
|
+
}), o = ze(i);
|
|
810
|
+
return a ? o : W[n] = o;
|
|
811
|
+
}
|
|
812
|
+
{
|
|
813
|
+
if (!B(e)) return (() => e);
|
|
792
814
|
let t = e.cacheKey;
|
|
793
|
-
return t ?
|
|
815
|
+
return t ? W[t] || (W[t] = ze(e)) : ze(e);
|
|
794
816
|
}
|
|
795
817
|
}
|
|
796
|
-
const
|
|
818
|
+
const G = {
|
|
797
819
|
INVALID_ARGUMENT: 17,
|
|
798
820
|
INVALID_DATE_ARGUMENT: 18,
|
|
799
821
|
INVALID_ISO_DATE_ARGUMENT: 19,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
if (
|
|
815
|
-
|
|
816
|
-
if (e.resolvedOnce && _resolveLocale != null) return _resolveLocale;
|
|
822
|
+
NOT_SUPPORT_LOCALE_PROMISE_VALUE: 20,
|
|
823
|
+
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 21,
|
|
824
|
+
NOT_SUPPORT_LOCALE_TYPE: 22
|
|
825
|
+
}, qe = 23;
|
|
826
|
+
function Je(e) {
|
|
827
|
+
return P(e, null, void 0);
|
|
828
|
+
}
|
|
829
|
+
G.INVALID_ARGUMENT, G.INVALID_DATE_ARGUMENT, G.INVALID_ISO_DATE_ARGUMENT, G.NOT_SUPPORT_LOCALE_PROMISE_VALUE, G.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, G.NOT_SUPPORT_LOCALE_TYPE;
|
|
830
|
+
function Ye(e, t) {
|
|
831
|
+
return t.locale == null ? Xe(e.locale) : Xe(t.locale);
|
|
832
|
+
}
|
|
833
|
+
let K;
|
|
834
|
+
function Xe(e) {
|
|
835
|
+
if (_(e)) return e;
|
|
836
|
+
if (g(e)) {
|
|
837
|
+
if (e.resolvedOnce && K != null) return K;
|
|
817
838
|
if (e.constructor.name === `Function`) {
|
|
818
839
|
let t = e();
|
|
819
|
-
if (
|
|
820
|
-
return
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
let
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
function appendBlockToChain(e, t, n) {
|
|
840
|
+
if (b(t)) throw Error(G.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
|
|
841
|
+
return K = t;
|
|
842
|
+
}
|
|
843
|
+
throw Error(G.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
|
|
844
|
+
}
|
|
845
|
+
throw Error(G.NOT_SUPPORT_LOCALE_TYPE);
|
|
846
|
+
}
|
|
847
|
+
function Ze(e, t, n) {
|
|
848
|
+
return [.../* @__PURE__ */ new Set([n, ...h(t) ? t : y(t) ? Object.keys(t).filter((e) => e !== "default") : _(t) ? [t] : [n]])];
|
|
849
|
+
}
|
|
850
|
+
function Qe(e, t, n) {
|
|
851
|
+
let r = _(n) ? n : Y, i = e, a;
|
|
852
|
+
y(t) ? (i.__localeChainObjectCache || (i.__localeChainObjectCache = /* @__PURE__ */ new WeakMap()), a = i.__localeChainObjectCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainObjectCache.set(t, a))) : (i.__localeChainCache || (i.__localeChainCache = /* @__PURE__ */ new Map()), a = i.__localeChainCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainCache.set(t, a)));
|
|
853
|
+
let o = a.get(r);
|
|
854
|
+
if (o) return o;
|
|
855
|
+
let s = [], c = [n];
|
|
856
|
+
for (; h(c);) c = $e(s, c, t);
|
|
857
|
+
let l = h(t) || !C(t) ? t : t.default ? t.default : null;
|
|
858
|
+
return c = _(l) ? [l] : l, h(c) && $e(s, c, !1), a.set(r, s), s;
|
|
859
|
+
}
|
|
860
|
+
function $e(e, t, n) {
|
|
841
861
|
let r = !0;
|
|
842
|
-
for (let i = 0; i < t.length &&
|
|
862
|
+
for (let i = 0; i < t.length && v(r); i++) {
|
|
843
863
|
let a = t[i];
|
|
844
|
-
|
|
864
|
+
_(a) && (r = et(e, t[i], n));
|
|
845
865
|
}
|
|
846
866
|
return r;
|
|
847
867
|
}
|
|
848
|
-
function
|
|
868
|
+
function et(e, t, n) {
|
|
849
869
|
let r, i = t.split(`-`);
|
|
850
870
|
do
|
|
851
|
-
r =
|
|
871
|
+
r = tt(e, i.join(`-`), n), i.splice(-1, 1);
|
|
852
872
|
while (i.length && r === !0);
|
|
853
873
|
return r;
|
|
854
874
|
}
|
|
855
|
-
function
|
|
875
|
+
function tt(e, t, n) {
|
|
856
876
|
let r = !1;
|
|
857
877
|
if (!e.includes(t) && (r = !0, t)) {
|
|
858
878
|
r = t[t.length - 1] !== `!`;
|
|
859
879
|
let i = t.replace(/!/g, ``);
|
|
860
|
-
e.push(i), (
|
|
880
|
+
e.push(i), (h(n) || C(n)) && n[i] && (r = n[i]);
|
|
861
881
|
}
|
|
862
882
|
return r;
|
|
863
883
|
}
|
|
864
|
-
const
|
|
865
|
-
|
|
884
|
+
const q = [];
|
|
885
|
+
q[0] = {
|
|
866
886
|
w: [0],
|
|
867
887
|
i: [3, 0],
|
|
868
888
|
"[": [4],
|
|
869
889
|
o: [7]
|
|
870
|
-
},
|
|
890
|
+
}, q[1] = {
|
|
871
891
|
w: [1],
|
|
872
892
|
".": [2],
|
|
873
893
|
"[": [4],
|
|
874
894
|
o: [7]
|
|
875
|
-
},
|
|
895
|
+
}, q[2] = {
|
|
876
896
|
w: [2],
|
|
877
897
|
i: [3, 0],
|
|
878
898
|
0: [3, 0]
|
|
879
|
-
},
|
|
899
|
+
}, q[3] = {
|
|
880
900
|
i: [3, 0],
|
|
881
901
|
0: [3, 0],
|
|
882
902
|
w: [1, 1],
|
|
883
903
|
".": [2, 1],
|
|
884
904
|
"[": [4, 1],
|
|
885
905
|
o: [7, 1]
|
|
886
|
-
},
|
|
906
|
+
}, q[4] = {
|
|
887
907
|
"'": [5, 0],
|
|
888
908
|
"\"": [6, 0],
|
|
889
909
|
"[": [4, 2],
|
|
890
910
|
"]": [1, 3],
|
|
891
911
|
o: 8,
|
|
892
912
|
l: [4, 0]
|
|
893
|
-
},
|
|
913
|
+
}, q[5] = {
|
|
894
914
|
"'": [4, 0],
|
|
895
915
|
o: 8,
|
|
896
916
|
l: [5, 0]
|
|
897
|
-
},
|
|
917
|
+
}, q[6] = {
|
|
898
918
|
"\"": [4, 0],
|
|
899
919
|
o: 8,
|
|
900
920
|
l: [6, 0]
|
|
901
921
|
};
|
|
902
|
-
const
|
|
903
|
-
function
|
|
904
|
-
return
|
|
922
|
+
const nt = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
|
|
923
|
+
function rt(e) {
|
|
924
|
+
return nt.test(e);
|
|
905
925
|
}
|
|
906
|
-
function
|
|
926
|
+
function it(e) {
|
|
907
927
|
let t = e.charCodeAt(0);
|
|
908
928
|
return t === e.charCodeAt(e.length - 1) && (t === 34 || t === 39) ? e.slice(1, -1) : e;
|
|
909
929
|
}
|
|
910
|
-
function
|
|
930
|
+
function at(e) {
|
|
911
931
|
if (e == null) return `o`;
|
|
912
932
|
switch (e.charCodeAt(0)) {
|
|
913
933
|
case 91:
|
|
@@ -928,11 +948,11 @@ function getPathCharType(e) {
|
|
|
928
948
|
}
|
|
929
949
|
return `i`;
|
|
930
950
|
}
|
|
931
|
-
function
|
|
951
|
+
function ot(e) {
|
|
932
952
|
let t = e.trim();
|
|
933
|
-
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 :
|
|
953
|
+
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : rt(t) ? it(t) : `*` + t;
|
|
934
954
|
}
|
|
935
|
-
function
|
|
955
|
+
function st(e) {
|
|
936
956
|
let t = [], n = -1, r = 0, i = 0, a, o, s, c, l, u, d, f = [];
|
|
937
957
|
f[0] = () => {
|
|
938
958
|
o === void 0 ? o = s : o += s;
|
|
@@ -943,7 +963,7 @@ function parse(e) {
|
|
|
943
963
|
}, f[3] = () => {
|
|
944
964
|
if (i > 0) i--, r = 4, f[0]();
|
|
945
965
|
else {
|
|
946
|
-
if (i = 0, o === void 0 || (o =
|
|
966
|
+
if (i = 0, o === void 0 || (o = ot(o), o === !1)) return !1;
|
|
947
967
|
f[1]();
|
|
948
968
|
}
|
|
949
969
|
};
|
|
@@ -952,29 +972,29 @@ function parse(e) {
|
|
|
952
972
|
if (r === 5 && t === `'` || r === 6 && t === `"`) return n++, s = `\\` + t, f[0](), !0;
|
|
953
973
|
}
|
|
954
974
|
for (; r !== null;) if (n++, a = e[n], !(a === `\\` && p())) {
|
|
955
|
-
if (c =
|
|
975
|
+
if (c = at(a), d = q[r], l = d[c] || d.l || 8, l === 8 || (r = l[0], l[1] !== void 0 && (u = f[l[1]], u && (s = a, u() === !1)))) return;
|
|
956
976
|
if (r === 7) return t;
|
|
957
977
|
}
|
|
958
978
|
}
|
|
959
|
-
const
|
|
960
|
-
function
|
|
961
|
-
return
|
|
979
|
+
const ct = /* @__PURE__ */ new Map();
|
|
980
|
+
function lt(e, t) {
|
|
981
|
+
return y(e) ? p(e, t) : null;
|
|
962
982
|
}
|
|
963
|
-
function
|
|
964
|
-
if (!
|
|
965
|
-
let n =
|
|
966
|
-
if (n || (n =
|
|
983
|
+
function ut(e, t) {
|
|
984
|
+
if (!y(e)) return null;
|
|
985
|
+
let n = ct.get(t);
|
|
986
|
+
if (n || (n = st(t), n && ct.set(t, n)), !n) return null;
|
|
967
987
|
let r = n.length, i = e, a = 0;
|
|
968
988
|
for (; a < r;) {
|
|
969
989
|
let e = n[a];
|
|
970
|
-
if (
|
|
990
|
+
if (Re.includes(e) && B(i) || !y(i) || !f(i, e)) return null;
|
|
971
991
|
let t = i[e];
|
|
972
|
-
if (t === void 0 ||
|
|
992
|
+
if (t === void 0 || g(i)) return null;
|
|
973
993
|
i = t, a++;
|
|
974
994
|
}
|
|
975
995
|
return i;
|
|
976
996
|
}
|
|
977
|
-
const
|
|
997
|
+
const J = {
|
|
978
998
|
NOT_FOUND_KEY: 1,
|
|
979
999
|
FALLBACK_TO_TRANSLATE: 2,
|
|
980
1000
|
CANNOT_FORMAT_NUMBER: 3,
|
|
@@ -983,126 +1003,184 @@ const CoreWarnCodes = {
|
|
|
983
1003
|
FALLBACK_TO_DATE_FORMAT: 6,
|
|
984
1004
|
EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7,
|
|
985
1005
|
INVALID_NUMBER_ARGUMENT: 8,
|
|
986
|
-
INVALID_DATE_ARGUMENT: 9
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
[
|
|
992
|
-
[
|
|
993
|
-
[
|
|
994
|
-
[
|
|
995
|
-
[
|
|
996
|
-
[
|
|
1006
|
+
INVALID_DATE_ARGUMENT: 9,
|
|
1007
|
+
IGNORE_UNSAFE_LOCALE: 10,
|
|
1008
|
+
FALLBACK_TO_DEFAULT_PLURAL_RULE: 11,
|
|
1009
|
+
FALLBACK_FROM_INVALID_LOCALE: 12
|
|
1010
|
+
}, dt = 13, ft = {
|
|
1011
|
+
[J.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
|
|
1012
|
+
[J.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
|
|
1013
|
+
[J.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
|
|
1014
|
+
[J.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
|
|
1015
|
+
[J.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
|
|
1016
|
+
[J.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
|
|
1017
|
+
[J.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.`,
|
|
1018
|
+
[J.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
|
|
1019
|
+
[J.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`,
|
|
1020
|
+
[J.IGNORE_UNSAFE_LOCALE]: `Ignore '{locale}' locale: it is a property name of Object.prototype`,
|
|
1021
|
+
[J.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
|
|
1022
|
+
[J.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
|
|
997
1023
|
};
|
|
998
|
-
function
|
|
999
|
-
return
|
|
1024
|
+
function pt(e, ...n) {
|
|
1025
|
+
return t(ft[e], ...n);
|
|
1000
1026
|
}
|
|
1001
|
-
const
|
|
1002
|
-
function
|
|
1027
|
+
const mt = `12.0.0-alpha.6`, ht = -1, Y = `en-US`, gt = ``, _t = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
|
|
1028
|
+
function vt() {
|
|
1003
1029
|
return {
|
|
1004
|
-
upper: (e, t) => t === `text` &&
|
|
1005
|
-
lower: (e, t) => t === `text` &&
|
|
1006
|
-
capitalize: (e, t) => t === `text` &&
|
|
1030
|
+
upper: (e, t) => t === `text` && _(e) ? e.toUpperCase() : t === `vnode` && y(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
|
|
1031
|
+
lower: (e, t) => t === `text` && _(e) ? e.toLowerCase() : t === `vnode` && y(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
|
|
1032
|
+
capitalize: (e, t) => t === `text` && _(e) ? _t(e) : t === `vnode` && y(e) && `__v_isVNode` in e ? _t(e.children) : e
|
|
1007
1033
|
};
|
|
1008
1034
|
}
|
|
1009
|
-
let
|
|
1010
|
-
function
|
|
1011
|
-
|
|
1012
|
-
}
|
|
1013
|
-
let
|
|
1014
|
-
function
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
let
|
|
1018
|
-
function
|
|
1019
|
-
|
|
1020
|
-
}
|
|
1021
|
-
let
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
let
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
messageResolver: A,
|
|
1048
|
-
localeFallbacker: j,
|
|
1049
|
-
fallbackContext: M,
|
|
1050
|
-
onWarn: n
|
|
1035
|
+
let yt;
|
|
1036
|
+
function bt(e) {
|
|
1037
|
+
yt = e;
|
|
1038
|
+
}
|
|
1039
|
+
let xt;
|
|
1040
|
+
function St(e) {
|
|
1041
|
+
xt = e;
|
|
1042
|
+
}
|
|
1043
|
+
let Ct;
|
|
1044
|
+
function wt(e) {
|
|
1045
|
+
Ct = e;
|
|
1046
|
+
}
|
|
1047
|
+
let Tt = 0;
|
|
1048
|
+
function Et(e = {}) {
|
|
1049
|
+
let t = g(e.onWarn) ? e.onWarn : E, n = _(e.version) ? e.version : mt, r = _(e.locale) || g(e.locale) ? e.locale : Y, i = g(r) ? Y : r, a = At(e.fallbackLocale) ? e.fallbackLocale : i, o = C(e.messages) ? e.messages : Dt(i), s = C(e.datetimeFormats) ? e.datetimeFormats : Dt(i), l = C(e.numberFormats) ? e.numberFormats : Dt(i), d = c(u(), e.modifiers, vt()), f = e.pluralRules || u(), p = g(e.missing) ? e.missing : null, m = !jt(e.missingWarn) || e.missingWarn, h = !jt(e.fallbackWarn) || e.fallbackWarn, b = !!e.fallbackFormat, x = !!e.unresolving, S = g(e.postTranslation) ? e.postTranslation : null, w = C(e.processor) ? e.processor : null, T = !v(e.warnHtmlMessage) || e.warnHtmlMessage, D = !!e.escapeParameter, ee = g(e.messageCompiler) ? e.messageCompiler : yt || null, te = g(e.messageResolver) ? e.messageResolver : xt || lt, ne = g(e.localeFallbacker) ? e.localeFallbacker : Ct || Ze, re = y(e.fallbackContext) ? e.fallbackContext : void 0;
|
|
1050
|
+
Tt++;
|
|
1051
|
+
let O = {
|
|
1052
|
+
version: n,
|
|
1053
|
+
cid: Tt,
|
|
1054
|
+
locale: r,
|
|
1055
|
+
fallbackLocale: a,
|
|
1056
|
+
messages: o,
|
|
1057
|
+
modifiers: d,
|
|
1058
|
+
pluralRules: f,
|
|
1059
|
+
missing: p,
|
|
1060
|
+
missingWarn: m,
|
|
1061
|
+
fallbackWarn: h,
|
|
1062
|
+
fallbackFormat: b,
|
|
1063
|
+
unresolving: x,
|
|
1064
|
+
postTranslation: S,
|
|
1065
|
+
processor: w,
|
|
1066
|
+
warnHtmlMessage: T,
|
|
1067
|
+
escapeParameter: D,
|
|
1068
|
+
messageCompiler: ee,
|
|
1069
|
+
messageResolver: te,
|
|
1070
|
+
localeFallbacker: ne,
|
|
1071
|
+
fallbackContext: re,
|
|
1072
|
+
onWarn: t
|
|
1051
1073
|
};
|
|
1052
|
-
return
|
|
1074
|
+
return O.datetimeFormats = s, O.numberFormats = l, O.__datetimeFormatters = /* @__PURE__ */ new Map(), O.__numberFormatters = /* @__PURE__ */ new Map(), O;
|
|
1053
1075
|
}
|
|
1054
|
-
const
|
|
1055
|
-
function
|
|
1056
|
-
let n = e.messages
|
|
1076
|
+
const Dt = (e) => ({ [e]: u() });
|
|
1077
|
+
function Ot(e, t) {
|
|
1078
|
+
let n = p(e.messages, t);
|
|
1057
1079
|
if (n == null) return;
|
|
1058
|
-
let r =
|
|
1059
|
-
return
|
|
1080
|
+
let r = u();
|
|
1081
|
+
return pe(n, r), r;
|
|
1082
|
+
}
|
|
1083
|
+
function kt(e, t, n) {
|
|
1084
|
+
m(t) || (e.messages[t] = n);
|
|
1085
|
+
}
|
|
1086
|
+
function At(e) {
|
|
1087
|
+
return _(e) || h(e) || C(e) || e === !1;
|
|
1060
1088
|
}
|
|
1061
|
-
function
|
|
1062
|
-
e
|
|
1089
|
+
function jt(e) {
|
|
1090
|
+
return v(e) || o(e);
|
|
1063
1091
|
}
|
|
1064
|
-
function
|
|
1065
|
-
return
|
|
1092
|
+
function Mt(e, t) {
|
|
1093
|
+
return o(e) ? e.test(t) : e;
|
|
1066
1094
|
}
|
|
1067
|
-
function
|
|
1068
|
-
return
|
|
1095
|
+
function Nt(e, t) {
|
|
1096
|
+
return o(e) ? e.test(t) : e;
|
|
1069
1097
|
}
|
|
1070
|
-
function
|
|
1098
|
+
function Pt(e, t, n, r, i) {
|
|
1071
1099
|
let { missing: a, onWarn: o } = e;
|
|
1072
1100
|
if (a !== null) {
|
|
1073
1101
|
let r = a(e, n, t, i);
|
|
1074
|
-
return
|
|
1075
|
-
}
|
|
1102
|
+
return _(r) ? r : t;
|
|
1103
|
+
}
|
|
1104
|
+
return t;
|
|
1076
1105
|
}
|
|
1077
|
-
function
|
|
1078
|
-
let
|
|
1079
|
-
|
|
1106
|
+
function Ft(e, t) {
|
|
1107
|
+
let n = e;
|
|
1108
|
+
y(t) ? n.__localeChainObjectCache?.delete(t) : n.__localeChainCache?.delete(t);
|
|
1080
1109
|
}
|
|
1081
|
-
function
|
|
1082
|
-
|
|
1110
|
+
function It(e, t, n) {
|
|
1111
|
+
Ft(e, n), e.fallbackContext && Ft(e.fallbackContext, n);
|
|
1112
|
+
{
|
|
1113
|
+
let { __datetimeFormatters: t, __numberFormatters: n } = e;
|
|
1114
|
+
t.clear(), n.clear();
|
|
1115
|
+
}
|
|
1116
|
+
e.localeFallbacker(e, n, t);
|
|
1117
|
+
}
|
|
1118
|
+
function Lt(e, t) {
|
|
1119
|
+
return e !== t && e.split(`-`)[0] === t.split(`-`)[0];
|
|
1083
1120
|
}
|
|
1084
|
-
function
|
|
1121
|
+
function Rt(e, t) {
|
|
1085
1122
|
let n = t.indexOf(e);
|
|
1086
1123
|
if (n === -1) return !1;
|
|
1087
|
-
for (let r = n + 1; r < t.length; r++) if (
|
|
1124
|
+
for (let r = n + 1; r < t.length; r++) if (Lt(e, t[r])) return !0;
|
|
1088
1125
|
return !1;
|
|
1089
1126
|
}
|
|
1090
|
-
function
|
|
1091
|
-
let {
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1127
|
+
function zt(e, t, n, r, i, a, o) {
|
|
1128
|
+
let { fallbackLocale: s, localeFallbacker: c, onWarn: l } = e, u = c(e, s, n);
|
|
1129
|
+
for (let n = 0; n < u.length; n++) {
|
|
1130
|
+
let a = u[n], s = p(p(r, a) || {}, t);
|
|
1131
|
+
if (C(s) && _(a)) return a;
|
|
1132
|
+
Pt(e, t, a, i, o);
|
|
1133
|
+
}
|
|
1134
|
+
return null;
|
|
1135
|
+
}
|
|
1136
|
+
function Bt(e) {
|
|
1137
|
+
try {
|
|
1138
|
+
return Intl.getCanonicalLocales(e), !0;
|
|
1139
|
+
} catch {
|
|
1140
|
+
return !1;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
function Vt(e, t, n, r, i) {
|
|
1144
|
+
try {
|
|
1145
|
+
return new t(n, r);
|
|
1146
|
+
} catch (i) {
|
|
1147
|
+
if (Bt(n)) throw i;
|
|
1148
|
+
let { fallbackLocale: a, localeFallbacker: o, onWarn: s } = e;
|
|
1149
|
+
return new t(o(e, a, n).find(Bt) || `en-US`, r);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
function Ht(e, [t, n, r, i], a, o, s, l) {
|
|
1153
|
+
let u = v(r.missingWarn) ? r.missingWarn : e.missingWarn, d = v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = Ye(e, r);
|
|
1154
|
+
if (!_(t) || t === ``) {
|
|
1155
|
+
let t = Vt(e, a, p.replace(/!/g, ``), i, l);
|
|
1156
|
+
return f ? t.formatToParts(n) : t.format(n);
|
|
1157
|
+
}
|
|
1158
|
+
let m = zt(e, t, p, s, u, d, l);
|
|
1159
|
+
if (!_(m)) return e.unresolving ? -1 : t;
|
|
1160
|
+
let h = s[m][t], g = Ut(m, t, i), y = o.get(g);
|
|
1161
|
+
return y || (y = Vt(e, a, m, c({}, h, i), l), o.set(g, y)), f ? y.formatToParts(n) : y.format(n);
|
|
1162
|
+
}
|
|
1163
|
+
function Ut(e, t, n) {
|
|
1164
|
+
let r = `${e}__${t}`;
|
|
1165
|
+
return C(n) && !s(n) && (r = `${r}__${JSON.stringify(n)}`), r;
|
|
1166
|
+
}
|
|
1167
|
+
function Wt(e, t, n) {
|
|
1168
|
+
for (let r in n) {
|
|
1169
|
+
let n = `${t}__${r}`;
|
|
1170
|
+
for (let t of e.keys()) (t === n || t.startsWith(`${n}__`)) && e.delete(t);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
function Gt(e, t, n, r) {
|
|
1174
|
+
let [, i, a, o] = e, s = n;
|
|
1175
|
+
return _(i) ? t.key = i : C(i) && Object.keys(i).forEach((e) => {
|
|
1176
|
+
r.includes(e) ? s[e] = i[e] : t[e] = i[e];
|
|
1177
|
+
}), _(a) ? t.locale = a : C(a) && (s = a), C(o) && (s = o), s;
|
|
1178
|
+
}
|
|
1179
|
+
function Kt(e, ...t) {
|
|
1180
|
+
let { datetimeFormats: n, onWarn: r } = e, { __datetimeFormatters: o } = e;
|
|
1181
|
+
return !_(t[0]) && !a(t[0]) && !i(t[0]) ? `` : Ht(e, Jt(...t), Intl.DateTimeFormat, o, n, `datetime format`);
|
|
1182
|
+
}
|
|
1183
|
+
const qt = [
|
|
1106
1184
|
`localeMatcher`,
|
|
1107
1185
|
`weekday`,
|
|
1108
1186
|
`era`,
|
|
@@ -1124,55 +1202,39 @@ const DATETIME_FORMAT_OPTIONS_KEYS = [
|
|
|
1124
1202
|
`hourCycle`,
|
|
1125
1203
|
`fractionalSecondDigits`
|
|
1126
1204
|
];
|
|
1127
|
-
function
|
|
1128
|
-
let [t
|
|
1129
|
-
if (
|
|
1130
|
-
let e = t.match(
|
|
1131
|
-
if (!e) throw Error(
|
|
1205
|
+
function Jt(...e) {
|
|
1206
|
+
let [t] = e, n = u(), r = u(), o;
|
|
1207
|
+
if (_(t)) {
|
|
1208
|
+
let e = t.match(/^(\d{4}-\d{2}-\d{2})(?:(T|\s)(.+))?$/);
|
|
1209
|
+
if (!e) throw Error(G.INVALID_ISO_DATE_ARGUMENT);
|
|
1132
1210
|
let n = e[3] ? e[3].trim().startsWith(`T`) ? `${e[1].trim()}${e[3].trim()}` : `${e[1].trim()}T${e[3].trim()}` : e[1].trim();
|
|
1133
|
-
|
|
1211
|
+
o = new Date(n);
|
|
1134
1212
|
try {
|
|
1135
|
-
|
|
1213
|
+
o.toISOString();
|
|
1136
1214
|
} catch {
|
|
1137
|
-
throw Error(
|
|
1215
|
+
throw Error(G.INVALID_ISO_DATE_ARGUMENT);
|
|
1138
1216
|
}
|
|
1139
|
-
} else if (
|
|
1140
|
-
if (isNaN(t.getTime())) throw Error(
|
|
1141
|
-
|
|
1142
|
-
} else if (
|
|
1143
|
-
else throw Error(
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
s
|
|
1150
|
-
c
|
|
1217
|
+
} else if (a(t)) {
|
|
1218
|
+
if (isNaN(t.getTime())) throw Error(G.INVALID_DATE_ARGUMENT);
|
|
1219
|
+
o = t;
|
|
1220
|
+
} else if (i(t)) o = t;
|
|
1221
|
+
else throw Error(G.INVALID_ARGUMENT);
|
|
1222
|
+
let s = Gt(e, n, r, qt);
|
|
1223
|
+
return [
|
|
1224
|
+
n.key || ``,
|
|
1225
|
+
o,
|
|
1226
|
+
n,
|
|
1227
|
+
s
|
|
1151
1228
|
];
|
|
1152
1229
|
}
|
|
1153
|
-
function
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
let { numberFormats: n, unresolving: r, fallbackLocale: i, onWarn: o, localeFallbacker: s } = e, { __numberFormatters: u } = e;
|
|
1162
|
-
if (!isNumber(t[0])) return ``;
|
|
1163
|
-
let [d, f, p, m] = parseNumberArgs(...t), h = isBoolean(p.missingWarn) ? p.missingWarn : e.missingWarn;
|
|
1164
|
-
isBoolean(p.fallbackWarn) ? p.fallbackWarn : e.fallbackWarn;
|
|
1165
|
-
let g = !!p.part, _ = getLocale(e, p), v = s(e, i, _);
|
|
1166
|
-
if (!isString(d) || d === ``) return new Intl.NumberFormat(_.replace(/!/g, ``), m).format(f);
|
|
1167
|
-
let y = {}, b, x = null;
|
|
1168
|
-
for (let t = 0; t < v.length && (b = v[t], y = n[b] || {}, x = y[d], !isPlainObject(x)); t++) handleMissing(e, d, b, h, `number format`);
|
|
1169
|
-
if (!isPlainObject(x) || !isString(b)) return r ? -1 : d;
|
|
1170
|
-
let S = `${b}__${d}`;
|
|
1171
|
-
isPlainObject(m) && !isKeylessObject(m) && (S = `${S}__${JSON.stringify(m)}`);
|
|
1172
|
-
let C = u.get(S);
|
|
1173
|
-
return C || (C = new Intl.NumberFormat(b, assign({}, x, m)), u.set(S, C)), g ? C.formatToParts(f) : C.format(f);
|
|
1174
|
-
}
|
|
1175
|
-
const NUMBER_FORMAT_OPTIONS_KEYS = [
|
|
1230
|
+
function Yt(e, t, n) {
|
|
1231
|
+
Wt(e.__datetimeFormatters, t, n);
|
|
1232
|
+
}
|
|
1233
|
+
function Xt(e, ...t) {
|
|
1234
|
+
let { numberFormats: n, onWarn: r } = e, { __numberFormatters: a } = e;
|
|
1235
|
+
return i(t[0]) ? Ht(e, Qt(...t), Intl.NumberFormat, a, n, `number format`) : ``;
|
|
1236
|
+
}
|
|
1237
|
+
const Zt = [
|
|
1176
1238
|
`localeMatcher`,
|
|
1177
1239
|
`style`,
|
|
1178
1240
|
`currency`,
|
|
@@ -1194,124 +1256,134 @@ const NUMBER_FORMAT_OPTIONS_KEYS = [
|
|
|
1194
1256
|
`roundingIncrement`,
|
|
1195
1257
|
`trailingZeroDisplay`
|
|
1196
1258
|
];
|
|
1197
|
-
function
|
|
1198
|
-
let [t
|
|
1199
|
-
if (!
|
|
1200
|
-
let
|
|
1201
|
-
return
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
o,
|
|
1207
|
-
s
|
|
1259
|
+
function Qt(...e) {
|
|
1260
|
+
let [t] = e, n = u(), r = u();
|
|
1261
|
+
if (!i(t)) throw Error(G.INVALID_ARGUMENT);
|
|
1262
|
+
let a = t, o = Gt(e, n, r, Zt);
|
|
1263
|
+
return [
|
|
1264
|
+
n.key || ``,
|
|
1265
|
+
a,
|
|
1266
|
+
n,
|
|
1267
|
+
o
|
|
1208
1268
|
];
|
|
1209
1269
|
}
|
|
1210
|
-
function
|
|
1211
|
-
|
|
1212
|
-
for (let e in n) {
|
|
1213
|
-
let n = `${t}__${e}`;
|
|
1214
|
-
r.__numberFormatters.has(n) && r.__numberFormatters.delete(n);
|
|
1215
|
-
}
|
|
1270
|
+
function $t(e, t, n) {
|
|
1271
|
+
Wt(e.__numberFormatters, t, n);
|
|
1216
1272
|
}
|
|
1217
|
-
const
|
|
1218
|
-
function
|
|
1273
|
+
const en = (e) => e, tn = (e) => ``, nn = `text`, rn = (e) => e.length === 0 ? `` : T(e), an = w;
|
|
1274
|
+
function X(e, t) {
|
|
1219
1275
|
return e = Math.abs(e), t === 2 ? e === 1 ? 0 : 1 : Math.min(e, 2);
|
|
1220
1276
|
}
|
|
1221
|
-
const
|
|
1277
|
+
const on = [
|
|
1222
1278
|
`zero`,
|
|
1223
1279
|
`one`,
|
|
1224
1280
|
`two`,
|
|
1225
1281
|
`few`,
|
|
1226
1282
|
`many`,
|
|
1227
1283
|
`other`
|
|
1228
|
-
],
|
|
1229
|
-
function
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
let
|
|
1233
|
-
|
|
1234
|
-
rules:
|
|
1235
|
-
categories:
|
|
1236
|
-
}
|
|
1284
|
+
], Z = /* @__PURE__ */ new Map();
|
|
1285
|
+
function sn(e) {
|
|
1286
|
+
try {
|
|
1287
|
+
if (Intl.PluralRules.supportedLocalesOf(e).length === 0) return null;
|
|
1288
|
+
let t = new Intl.PluralRules(e);
|
|
1289
|
+
return {
|
|
1290
|
+
rules: t,
|
|
1291
|
+
categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) => on.indexOf(e) - on.indexOf(t))
|
|
1292
|
+
};
|
|
1293
|
+
} catch {
|
|
1294
|
+
return null;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
function cn(e) {
|
|
1298
|
+
let t = Z.get(e);
|
|
1299
|
+
return t === void 0 && (t = sn(e), Z.size >= 1e3 && Z.delete(Z.keys().next().value), Z.set(e, t)), t;
|
|
1300
|
+
}
|
|
1301
|
+
function ln(e) {
|
|
1302
|
+
return i(e.pluralIndex) ? e.pluralIndex : i(e.named?.count) ? e.named.count : i(e.named?.n) ? e.named.n : -1;
|
|
1303
|
+
}
|
|
1304
|
+
function un(e = {}) {
|
|
1305
|
+
let t = e.locale, n = ln(e), r;
|
|
1306
|
+
r = _(t) && e.pluralRules && g(p(e.pluralRules, t)) ? e.pluralRules[t] : _(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
|
|
1307
|
+
let r = cn(t);
|
|
1308
|
+
if (r === null || n > r.categories.length) return X(e, n);
|
|
1309
|
+
let { rules: i, categories: a } = r, o = i.select(Math.abs(e)), s = a.indexOf(o);
|
|
1310
|
+
return Math.min(s === -1 ? n - 1 : s, n - 1);
|
|
1311
|
+
} : X;
|
|
1312
|
+
let a = r === X ? void 0 : X, o = (e) => e[r(n, e.length, a)], s = e.list || [], l = (e) => s[e], d = e.named || u(), f = i(e.pluralIndex), v = (t) => {
|
|
1313
|
+
let n = m(t) ? p(d, t) : d[t];
|
|
1314
|
+
return f && n == null && (t === `count` || t === `n`) ? e.pluralIndex : n;
|
|
1315
|
+
};
|
|
1316
|
+
function b(t, n) {
|
|
1317
|
+
return (g(e.messages) ? e.messages(t, !!n) : y(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : tn);
|
|
1237
1318
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
return isNumber(e.pluralIndex) ? e.pluralIndex : isNumber(e.named?.count) ? e.named.count : isNumber(e.named?.n) ? e.named.n : -1;
|
|
1242
|
-
}
|
|
1243
|
-
function createMessageContext(e = {}) {
|
|
1244
|
-
let t = e.locale, n = getPluralIndex(e), r;
|
|
1245
|
-
r = isString(t) && isFunction(e.pluralRules?.[t]) ? e.pluralRules[t] : isString(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
|
|
1246
|
-
let { rules: r, categories: i } = getIntlPluralRules(t);
|
|
1247
|
-
if (n > i.length) return pluralDefault(e, n);
|
|
1248
|
-
let a = r.select(Math.abs(e)), o = i.indexOf(a);
|
|
1249
|
-
return Math.min(o === -1 ? n - 1 : o, n - 1);
|
|
1250
|
-
} : pluralDefault;
|
|
1251
|
-
let i = r === pluralDefault ? void 0 : pluralDefault, o = (e) => e[r(n, e.length, i)], s = e.list || [], c = (e) => s[e], u = e.named || create();
|
|
1252
|
-
isNumber(e.pluralIndex) && (u.count ??= e.pluralIndex, u.n ??= e.pluralIndex);
|
|
1253
|
-
let f = (e) => u[e];
|
|
1254
|
-
function p(t, n) {
|
|
1255
|
-
return (isFunction(e.messages) ? e.messages(t, !!n) : isObject(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : DEFAULT_MESSAGE);
|
|
1256
|
-
}
|
|
1257
|
-
let m = (t) => e.modifiers ? e.modifiers[t] : DEFAULT_MODIFIER, h = isFunction(e.processor?.normalize) ? e.processor.normalize : DEFAULT_NORMALIZE, g = isFunction(e.processor?.interpolate) ? e.processor.interpolate : DEFAULT_INTERPOLATE, _ = {
|
|
1258
|
-
list: c,
|
|
1259
|
-
named: f,
|
|
1319
|
+
let x = (t) => e.modifiers ? p(e.modifiers, t) : en, S = g(e.processor?.normalize) ? e.processor.normalize : rn, C = g(e.processor?.interpolate) ? e.processor.interpolate : an, w = {
|
|
1320
|
+
list: l,
|
|
1321
|
+
named: v,
|
|
1260
1322
|
plural: o,
|
|
1261
1323
|
linked: (e, ...t) => {
|
|
1262
1324
|
let [n, r] = t, i = `text`, a = ``;
|
|
1263
|
-
t.length === 1 ?
|
|
1264
|
-
let o =
|
|
1265
|
-
|
|
1325
|
+
t.length === 1 ? y(n) ? (a = n.modifier || a, i = n.type || i) : _(n) && (a = n || a) : t.length === 2 && (_(n) && (a = n || a), _(r) && (i = r || i));
|
|
1326
|
+
let o = b(e, !0)(w), s = o === `` || o === void 0 ? e : o, c = i === `vnode` && h(s) && a ? s[0] : s;
|
|
1327
|
+
if (!a) return c;
|
|
1328
|
+
let l = x(a);
|
|
1329
|
+
return g(l) ? l(c, i) : c;
|
|
1266
1330
|
},
|
|
1267
|
-
message:
|
|
1268
|
-
type:
|
|
1269
|
-
interpolate:
|
|
1270
|
-
normalize:
|
|
1271
|
-
values:
|
|
1331
|
+
message: b,
|
|
1332
|
+
type: _(e.processor?.type) ? e.processor.type : nn,
|
|
1333
|
+
interpolate: C,
|
|
1334
|
+
normalize: S,
|
|
1335
|
+
values: c(u(), s, d, f ? {
|
|
1336
|
+
count: v(`count`),
|
|
1337
|
+
n: v(`n`)
|
|
1338
|
+
} : {})
|
|
1272
1339
|
};
|
|
1273
|
-
return
|
|
1340
|
+
return w;
|
|
1274
1341
|
}
|
|
1275
|
-
const
|
|
1276
|
-
function
|
|
1277
|
-
let [n, r] =
|
|
1278
|
-
a &&
|
|
1342
|
+
const dn = () => ``, Q = (e) => g(e), $ = (e) => _(e) || B(e) || Q(e);
|
|
1343
|
+
function fn(e, ...t) {
|
|
1344
|
+
let [n, r] = gn(...t), i = Ye(e, r), a = v(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
|
|
1345
|
+
a && pn(r);
|
|
1279
1346
|
let o = !!r.resolvedMessage, [s, c, l] = o ? [
|
|
1280
1347
|
n,
|
|
1281
1348
|
i,
|
|
1282
|
-
e.messages
|
|
1283
|
-
] :
|
|
1284
|
-
if (!o &&
|
|
1285
|
-
let t =
|
|
1286
|
-
(e.fallbackFormat || t != null && (
|
|
1287
|
-
}
|
|
1288
|
-
if (!o && (
|
|
1289
|
-
let f = !1,
|
|
1349
|
+
p(e.messages, i) || u()
|
|
1350
|
+
] : mn(e, n, i, e.fallbackLocale, v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, v(r.missingWarn) ? r.missingWarn : e.missingWarn), d = n;
|
|
1351
|
+
if (!o && !$(s)) {
|
|
1352
|
+
let t = _(r.default) ? r.default : v(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
|
|
1353
|
+
(e.fallbackFormat || t != null && (_(t) || g(t))) && (s = t, d = s);
|
|
1354
|
+
}
|
|
1355
|
+
if (!o && (!$(s) || !_(c))) return e.unresolving ? -1 : n;
|
|
1356
|
+
let f = !1, m = Q(s) ? s : hn(e, n, c, s, d, () => {
|
|
1290
1357
|
f = !0;
|
|
1291
1358
|
});
|
|
1292
1359
|
if (f) return s;
|
|
1293
|
-
let
|
|
1294
|
-
return a &&
|
|
1295
|
-
}
|
|
1296
|
-
function
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1360
|
+
let h = m(un(vn(e, c, l, r))), y = e.postTranslation ? e.postTranslation(h, n) : h;
|
|
1361
|
+
return a && _(y) && (y = fe(y)), y;
|
|
1362
|
+
}
|
|
1363
|
+
function pn(e) {
|
|
1364
|
+
if (h(e.list) && (e.list = e.list.map((e) => _(e) ? D(e) : e)), y(e.named)) {
|
|
1365
|
+
let t = e.named, n = u();
|
|
1366
|
+
for (let e of Object.keys(t)) {
|
|
1367
|
+
let r = t[e];
|
|
1368
|
+
n[e] = _(r) ? D(r) : r;
|
|
1369
|
+
}
|
|
1370
|
+
e.named = n;
|
|
1371
|
+
}
|
|
1300
1372
|
}
|
|
1301
|
-
function
|
|
1302
|
-
let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e,
|
|
1303
|
-
for (let n = 0; n <
|
|
1304
|
-
let n =
|
|
1305
|
-
n !== t && (
|
|
1373
|
+
function mn(e, t, n, r, i, a) {
|
|
1374
|
+
let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, d = l(e, r, n), f = u(), m, h = null;
|
|
1375
|
+
for (let n = 0; n < d.length && (m = d[n], f = p(o, m) || u(), (h = c(f, t)) === null && (h = p(f, t)), !$(h)); n++) if (!Rt(m, d)) {
|
|
1376
|
+
let n = Pt(e, t, m, a, `translate`);
|
|
1377
|
+
n !== t && (h = n);
|
|
1306
1378
|
}
|
|
1307
1379
|
return [
|
|
1380
|
+
h,
|
|
1308
1381
|
m,
|
|
1309
|
-
p,
|
|
1310
1382
|
f
|
|
1311
1383
|
];
|
|
1312
1384
|
}
|
|
1313
|
-
function
|
|
1314
|
-
if (
|
|
1385
|
+
function hn(e, t, n, r, i, a) {
|
|
1386
|
+
if (Q(r)) {
|
|
1315
1387
|
let e = r;
|
|
1316
1388
|
return e.locale = e.locale || n, e.key = e.key || t, e;
|
|
1317
1389
|
}
|
|
@@ -1319,50 +1391,50 @@ function compileMessageFormat(e, t, n, r, i, a) {
|
|
|
1319
1391
|
let e = (() => r);
|
|
1320
1392
|
return e.locale = n, e.key = t, e;
|
|
1321
1393
|
}
|
|
1322
|
-
let o = e.messageCompiler(r,
|
|
1394
|
+
let o = e.messageCompiler(r, _n(e, n, i, r, e.warnHtmlMessage, a));
|
|
1323
1395
|
return o.locale = n, o.key = t, o.source = r, o;
|
|
1324
1396
|
}
|
|
1325
|
-
function
|
|
1397
|
+
function gn(...e) {
|
|
1326
1398
|
let [t, n, r] = e;
|
|
1327
|
-
if (!
|
|
1328
|
-
let
|
|
1329
|
-
return
|
|
1399
|
+
if (!_(t) && !i(t) && !Q(t) && !B(t)) throw Error(G.INVALID_ARGUMENT);
|
|
1400
|
+
let a = i(t) ? String(t) : (Q(t), t), o = u();
|
|
1401
|
+
return i(n) ? o.plural = n : _(n) ? o.default = n : C(n) && !s(n) ? o.named = n : h(n) && (o.list = n), i(r) ? o.plural = r : _(r) ? o.default = r : C(r) && c(o, r), [a, o];
|
|
1330
1402
|
}
|
|
1331
|
-
function
|
|
1403
|
+
function _n(e, t, r, i, a, o) {
|
|
1332
1404
|
return {
|
|
1333
1405
|
locale: t,
|
|
1334
|
-
key:
|
|
1406
|
+
key: r,
|
|
1335
1407
|
warnHtmlMessage: a,
|
|
1336
1408
|
onError: (e) => {
|
|
1337
1409
|
throw o?.(e), e;
|
|
1338
1410
|
},
|
|
1339
|
-
onCacheKey: (e) =>
|
|
1411
|
+
onCacheKey: (e) => n(t, r, e)
|
|
1340
1412
|
};
|
|
1341
1413
|
}
|
|
1342
|
-
function
|
|
1343
|
-
let { modifiers:
|
|
1414
|
+
function vn(e, t, n, r) {
|
|
1415
|
+
let { modifiers: a, pluralRules: o, messageResolver: s, fallbackLocale: c, fallbackWarn: l, missingWarn: u, fallbackContext: d } = e;
|
|
1344
1416
|
return {
|
|
1345
1417
|
locale: t,
|
|
1346
|
-
modifiers:
|
|
1418
|
+
modifiers: a,
|
|
1347
1419
|
pluralRules: o,
|
|
1348
1420
|
messages: (r, i) => {
|
|
1349
1421
|
let a = s(n, r);
|
|
1350
1422
|
if (a == null && (d || i)) {
|
|
1351
|
-
let [n, , i] =
|
|
1423
|
+
let [n, , i] = mn(d || e, r, t, c, l, u);
|
|
1352
1424
|
a = n ?? s(i, r);
|
|
1353
1425
|
}
|
|
1354
|
-
if (
|
|
1355
|
-
let n = !1, i =
|
|
1426
|
+
if (_(a) || B(a)) {
|
|
1427
|
+
let n = !1, i = hn(e, r, t, a, r, () => {
|
|
1356
1428
|
n = !0;
|
|
1357
1429
|
});
|
|
1358
|
-
return n ?
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1430
|
+
return n ? dn : i;
|
|
1431
|
+
}
|
|
1432
|
+
return Q(a) ? a : dn;
|
|
1361
1433
|
},
|
|
1362
1434
|
processor: e.processor ?? void 0,
|
|
1363
1435
|
list: r.list ?? void 0,
|
|
1364
1436
|
named: r.named ?? void 0,
|
|
1365
|
-
pluralIndex:
|
|
1437
|
+
pluralIndex: i(r.plural) ? r.plural : void 0
|
|
1366
1438
|
};
|
|
1367
1439
|
}
|
|
1368
|
-
export { AST_NODE_PROPS_KEYS, CORE_ERROR_CODES_EXTEND_POINT, CORE_WARN_CODES_EXTEND_POINT, CoreWarnCodes, DATETIME_FORMAT_OPTIONS_KEYS, DEFAULT_LOCALE, DEFAULT_MESSAGE_DATA_TYPE, MISSING_RESOLVE_VALUE, NOT_RESOLVED, NUMBER_FORMAT_OPTIONS_KEYS, VERSION, clearCompileCache, clearDateTimeFormat, clearNumberFormat, compile, createCompileError, createCoreContext, createCoreError, createMessageContext, datetime, fallbackWithLocaleChain, fallbackWithSimple,
|
|
1440
|
+
export { Re as AST_NODE_PROPS_KEYS, qe as CORE_ERROR_CODES_EXTEND_POINT, dt as CORE_WARN_CODES_EXTEND_POINT, J as CoreWarnCodes, qt as DATETIME_FORMAT_OPTIONS_KEYS, Y as DEFAULT_LOCALE, nn as DEFAULT_MESSAGE_DATA_TYPE, gt as MISSING_RESOLVE_VALUE, ht as NOT_RESOLVED, Zt as NUMBER_FORMAT_OPTIONS_KEYS, mt as VERSION, We as clearCompileCache, Yt as clearDateTimeFormat, $t as clearNumberFormat, Ke as compile, P as createCompileError, Et as createCoreContext, Je as createCoreError, un as createMessageContext, Kt as datetime, Qe as fallbackWithLocaleChain, Ze as fallbackWithSimple, Ye as getLocale, Ot as getLocaleMessage, pt as getWarnMessage, Pt as handleMissing, Lt as isAlmostSameLocale, At as isFallbackLocale, Rt as isImplicitFallback, B as isMessageAST, $ as isMessageFormat, Q as isMessageFunction, Mt as isTranslateFallbackWarn, Nt as isTranslateMissingWarn, jt as isWarnOption, Xt as number, st as parse, Jt as parseDateTimeArgs, Qt as parseNumberArgs, gn as parseTranslateArgs, wt as registerLocaleFallbacker, bt as registerMessageCompiler, St as registerMessageResolver, Xe as resolveLocale, ut as resolveValue, lt as resolveWithKeyValue, kt as setLocaleMessage, fn as translate, It as updateFallbackLocale };
|