@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,32 +1,53 @@
|
|
|
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
5
|
**/ var IntlifyCore = (function(e) {
|
|
6
6
|
Object.defineProperty(e, Symbol.toStringTag, { value: `Module` });
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let n = /\{([0-9a-z]+)\}/gi;
|
|
11
|
-
function r(e, ...t) {
|
|
12
|
-
return t.length === 1 && D(t[0]) && (t = t[0]), (!t || !t.hasOwnProperty) && (t = {}), e.replace(n, (e, n) => t.hasOwnProperty(n) ? t[n] : ``);
|
|
7
|
+
let t = /\{([0-9a-z]+)\}/gi;
|
|
8
|
+
function n(e, ...n) {
|
|
9
|
+
return n.length === 1 && b(n[0]) && (n = n[0]), (!n || !n.hasOwnProperty) && (n = {}), e.replace(t, (e, t) => n.hasOwnProperty(t) ? n[t] : ``);
|
|
13
10
|
}
|
|
14
|
-
let
|
|
11
|
+
let r = (e, t, n) => i({
|
|
15
12
|
l: e,
|
|
16
13
|
k: t,
|
|
17
14
|
s: n
|
|
18
|
-
}),
|
|
19
|
-
function p(e) {
|
|
15
|
+
}), i = (e) => JSON.stringify(e).replace(/\u2028/g, `\\u2028`).replace(/\u2029/g, `\\u2029`).replace(/\u0027/g, `\\u0027`), a = (e) => typeof e == `number` && isFinite(e), o = (e) => C(e) === `[object Date]`, s = (e) => C(e) === `[object RegExp]`, c = (e) => Object.keys(e).length === 0, l = Object.assign, u = Object.create, d = (e = null) => u(e), f = Object.prototype.hasOwnProperty;
|
|
16
|
+
function p(e, t) {
|
|
17
|
+
return f.call(e, t);
|
|
18
|
+
}
|
|
19
|
+
function m(e, t) {
|
|
20
|
+
let n = e[t];
|
|
21
|
+
return p(e, t) ? n : void 0;
|
|
22
|
+
}
|
|
23
|
+
function h(e) {
|
|
24
|
+
return p(Object.prototype, e);
|
|
25
|
+
}
|
|
26
|
+
let g = Array.isArray, _ = (e) => typeof e == `function`, v = (e) => typeof e == `string`, y = (e) => typeof e == `boolean`, b = (e) => typeof e == `object` && !!e, x = (e) => b(e) && _(e.then) && _(e.catch), S = Object.prototype.toString, C = (e) => S.call(e), w = (e) => C(e) === `[object Object]`, ee = (e) => e == null ? `` : g(e) || w(e) && e.toString === S ? JSON.stringify(e, null, 2) : String(e);
|
|
27
|
+
function te(e, t = ``) {
|
|
28
|
+
return e.reduce((e, n, r) => r === 0 ? e + n : e + t + n, ``);
|
|
29
|
+
}
|
|
30
|
+
function ne(e, t) {
|
|
31
|
+
typeof console < `u` && (console.warn(`[intlify] ` + e), t && console.warn(t.stack));
|
|
32
|
+
}
|
|
33
|
+
function T(e) {
|
|
20
34
|
return e.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/\//g, `/`).replace(/=/g, `=`);
|
|
21
35
|
}
|
|
22
|
-
function
|
|
36
|
+
function re(e) {
|
|
23
37
|
return e.replace(/&(?![a-z0-9#]{2,6};)/gi, `&`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/</g, `<`).replace(/>/g, `>`);
|
|
24
38
|
}
|
|
25
|
-
let
|
|
26
|
-
function
|
|
27
|
-
|
|
39
|
+
let ie = /^javascript:/i, ae = /^(?:href|src|action|formaction)$/i, E = /&#(?:x([0-9a-f]+)|(\d+));?/gi, oe = /&(?:Tab|NewLine);/g, se = /:?/gi, ce = /[\u0000-\u0020\u007f-\u009f]/g, le = /(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i, ue = /(^|[\s"'<>/])on(\w+\s*=)/gi, de = /(?:^|[\s"'<>/])srcdoc\s*=/i, fe = /(^|[\s"'<>/])s(rcdoc\s*=)/gi, pe = /(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;
|
|
40
|
+
function me(e, t, n) {
|
|
41
|
+
let r = t || n;
|
|
42
|
+
if (!r) return e;
|
|
43
|
+
let i = Number.parseInt(r, t ? 16 : 10);
|
|
44
|
+
return i <= 127 ? String.fromCharCode(i) : e;
|
|
28
45
|
}
|
|
29
|
-
function
|
|
46
|
+
function D(e) {
|
|
47
|
+
let t = e.replace(E, me).replace(oe, ``).replace(se, `:`).replace(ce, ``);
|
|
48
|
+
return ie.test(t);
|
|
49
|
+
}
|
|
50
|
+
function he(e) {
|
|
30
51
|
let t = /url\s*\(/gi, n = ``, r = 0, i;
|
|
31
52
|
for (; (i = t.exec(e)) !== null;) {
|
|
32
53
|
let a = i.index, o = t.lastIndex - 1, s = o + 1, c = 1, l = null;
|
|
@@ -42,42 +63,41 @@
|
|
|
42
63
|
}
|
|
43
64
|
if (c !== 0) break;
|
|
44
65
|
let u = e.slice(o + 1, s).trim(), d = u.startsWith(`"`) && u.endsWith(`"`) || u.startsWith(`'`) && u.endsWith(`'`) ? u.slice(1, -1).trim() : u;
|
|
45
|
-
n += e.slice(r, a), n +=
|
|
66
|
+
n += e.slice(r, a), n += D(d) ? `url(about:blank)` : e.slice(a, s + 1), r = s + 1;
|
|
46
67
|
}
|
|
47
68
|
return n + e.slice(r);
|
|
48
69
|
}
|
|
49
|
-
function
|
|
50
|
-
return
|
|
70
|
+
function ge(e, t) {
|
|
71
|
+
return ae.test(e) && D(t) ? `about:blank` : re(e.toLowerCase() === `style` ? he(t) : t);
|
|
51
72
|
}
|
|
52
|
-
function
|
|
53
|
-
return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${
|
|
54
|
-
}
|
|
55
|
-
let x = Object.prototype.hasOwnProperty;
|
|
56
|
-
function S(e, t) {
|
|
57
|
-
return x.call(e, t);
|
|
58
|
-
}
|
|
59
|
-
let C = Array.isArray, w = (e) => typeof e == `function`, T = (e) => typeof e == `string`, E = (e) => typeof e == `boolean`, D = (e) => typeof e == `object` && !!e, ee = (e) => D(e) && w(e.then) && w(e.catch), O = Object.prototype.toString, k = (e) => O.call(e), A = (e) => k(e) === `[object Object]`, te = (e) => e == null ? `` : C(e) || A(e) && e.toString === O ? JSON.stringify(e, null, 2) : String(e);
|
|
60
|
-
function ne(e, t = ``) {
|
|
61
|
-
return e.reduce((e, n, r) => r === 0 ? e + n : e + t + n, ``);
|
|
73
|
+
function _e(e) {
|
|
74
|
+
return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${ge(t, n)}"`), e = e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g, (e, t, n) => `${t}='${ge(t, n)}'`), le.test(e) && (e = e.replace(ue, `$1on$2`)), de.test(e) && (e = e.replace(fe, `$1s$2`)), e = e.replace(pe, (e, t, n, r) => D(r) ? `${t}${n}about:blank` : e), e;
|
|
62
75
|
}
|
|
63
|
-
let
|
|
64
|
-
function
|
|
65
|
-
if (
|
|
66
|
-
let n = [
|
|
67
|
-
src: e,
|
|
68
|
-
des: t
|
|
69
|
-
}];
|
|
76
|
+
let ve = (e) => !b(e) || g(e);
|
|
77
|
+
function ye(e, t) {
|
|
78
|
+
if (ve(e) || ve(t) || t === Object.prototype) throw Error(`Invalid value`);
|
|
79
|
+
let n = [e, t];
|
|
70
80
|
for (; n.length;) {
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
let e = n.pop(), t = n.pop(), r = Object.keys(t);
|
|
82
|
+
for (let i = 0; i < r.length; i++) {
|
|
83
|
+
let a = r[i];
|
|
84
|
+
if (a === `__proto__`) continue;
|
|
85
|
+
let o = t[a];
|
|
86
|
+
if (!b(o)) {
|
|
87
|
+
e[a] = o;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (g(o)) {
|
|
91
|
+
let t = [];
|
|
92
|
+
t.length = o.length, e[a] = t, n.push(o, t);
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
let s = e[a];
|
|
96
|
+
(!b(s) || g(s)) && (s = e[a] = d()), n.push(o, s);
|
|
97
|
+
}
|
|
78
98
|
}
|
|
79
99
|
}
|
|
80
|
-
let
|
|
100
|
+
let O = {
|
|
81
101
|
EXPECTED_TOKEN: 1,
|
|
82
102
|
INVALID_TOKEN_IN_PLACEHOLDER: 2,
|
|
83
103
|
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
|
|
@@ -95,240 +115,240 @@
|
|
|
95
115
|
UNHANDLED_CODEGEN_NODE_TYPE: 15,
|
|
96
116
|
UNHANDLED_MINIFIER_NODE_TYPE: 16
|
|
97
117
|
};
|
|
98
|
-
|
|
99
|
-
function
|
|
118
|
+
O.EXPECTED_TOKEN, O.INVALID_TOKEN_IN_PLACEHOLDER, O.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, O.UNKNOWN_ESCAPE_SEQUENCE, O.INVALID_UNICODE_ESCAPE_SEQUENCE, O.UNBALANCED_CLOSING_BRACE, O.UNTERMINATED_CLOSING_BRACE, O.EMPTY_PLACEHOLDER, O.NOT_ALLOW_NEST_PLACEHOLDER, O.INVALID_LINKED_FORMAT, O.MUST_HAVE_MESSAGES_IN_PLURAL, O.UNEXPECTED_EMPTY_LINKED_MODIFIER, O.UNEXPECTED_EMPTY_LINKED_KEY, O.UNEXPECTED_LEXICAL_ANALYSIS, O.UNHANDLED_CODEGEN_NODE_TYPE, O.UNHANDLED_MINIFIER_NODE_TYPE;
|
|
119
|
+
function be(e, t, n = {}) {
|
|
100
120
|
let { domain: r, messages: i, args: a } = n, o = SyntaxError(String(e));
|
|
101
121
|
return o.code = e, t && (o.location = t), o.domain = r, o;
|
|
102
122
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
123
|
+
function k(e) {
|
|
124
|
+
return b(e) && M(e) === 0 && (p(e, `b`) || p(e, `body`));
|
|
105
125
|
}
|
|
106
|
-
let
|
|
107
|
-
function
|
|
108
|
-
return
|
|
126
|
+
let xe = [`b`, `body`];
|
|
127
|
+
function Se(e) {
|
|
128
|
+
return P(e, xe);
|
|
109
129
|
}
|
|
110
|
-
let
|
|
111
|
-
function
|
|
112
|
-
return
|
|
130
|
+
let Ce = [`c`, `cases`];
|
|
131
|
+
function we(e) {
|
|
132
|
+
return P(e, Ce, []);
|
|
113
133
|
}
|
|
114
|
-
let
|
|
115
|
-
function
|
|
116
|
-
return
|
|
134
|
+
let A = [`s`, `static`];
|
|
135
|
+
function Te(e) {
|
|
136
|
+
return P(e, A);
|
|
117
137
|
}
|
|
118
|
-
let
|
|
119
|
-
function
|
|
120
|
-
return
|
|
138
|
+
let j = [`i`, `items`];
|
|
139
|
+
function Ee(e) {
|
|
140
|
+
return P(e, j, []);
|
|
121
141
|
}
|
|
122
|
-
let
|
|
123
|
-
function
|
|
124
|
-
return
|
|
142
|
+
let De = [`t`, `type`];
|
|
143
|
+
function M(e) {
|
|
144
|
+
return P(e, De);
|
|
125
145
|
}
|
|
126
|
-
let
|
|
127
|
-
function
|
|
128
|
-
let n =
|
|
146
|
+
let Oe = [`v`, `value`];
|
|
147
|
+
function N(e, t) {
|
|
148
|
+
let n = P(e, Oe);
|
|
129
149
|
if (n != null) return n;
|
|
130
|
-
throw
|
|
150
|
+
throw F(t);
|
|
131
151
|
}
|
|
132
|
-
let
|
|
133
|
-
function
|
|
134
|
-
return
|
|
152
|
+
let ke = [`m`, `modifier`];
|
|
153
|
+
function Ae(e) {
|
|
154
|
+
return P(e, ke);
|
|
135
155
|
}
|
|
136
|
-
let
|
|
137
|
-
function
|
|
138
|
-
let t =
|
|
156
|
+
let je = [`k`, `key`];
|
|
157
|
+
function Me(e) {
|
|
158
|
+
let t = P(e, je);
|
|
139
159
|
if (t) return t;
|
|
140
|
-
throw
|
|
160
|
+
throw F(6);
|
|
141
161
|
}
|
|
142
|
-
function
|
|
162
|
+
function P(e, t, n) {
|
|
143
163
|
for (let n = 0; n < t.length; n++) {
|
|
144
164
|
let r = t[n];
|
|
145
|
-
if (
|
|
165
|
+
if (p(e, r) && e[r] != null) return e[r];
|
|
146
166
|
}
|
|
147
167
|
return n;
|
|
148
168
|
}
|
|
149
|
-
let
|
|
150
|
-
...
|
|
151
|
-
...
|
|
152
|
-
...
|
|
153
|
-
...
|
|
154
|
-
...
|
|
155
|
-
...
|
|
156
|
-
...
|
|
157
|
-
...
|
|
169
|
+
let Ne = [
|
|
170
|
+
...xe,
|
|
171
|
+
...Ce,
|
|
172
|
+
...A,
|
|
173
|
+
...j,
|
|
174
|
+
...je,
|
|
175
|
+
...ke,
|
|
176
|
+
...Oe,
|
|
177
|
+
...De
|
|
158
178
|
];
|
|
159
|
-
function
|
|
179
|
+
function F(e) {
|
|
160
180
|
return Error(`unhandled node type: ${e}`);
|
|
161
181
|
}
|
|
162
|
-
function
|
|
163
|
-
return (t) =>
|
|
182
|
+
function Pe(e) {
|
|
183
|
+
return (t) => Fe(t, e);
|
|
164
184
|
}
|
|
165
|
-
function
|
|
166
|
-
let n =
|
|
167
|
-
if (n == null) throw
|
|
168
|
-
if (
|
|
169
|
-
let t =
|
|
170
|
-
return e.plural(t.reduce((t, n) => [...
|
|
171
|
-
}
|
|
185
|
+
function Fe(e, t) {
|
|
186
|
+
let n = Se(t);
|
|
187
|
+
if (n == null) throw F(0);
|
|
188
|
+
if (M(n) === 1) {
|
|
189
|
+
let t = we(n);
|
|
190
|
+
return e.plural(t.reduce((t, n) => [...g(t) ? t : [t], Ie(e, n)], []));
|
|
191
|
+
}
|
|
192
|
+
return Ie(e, n);
|
|
172
193
|
}
|
|
173
|
-
function
|
|
174
|
-
let n =
|
|
194
|
+
function Ie(e, t) {
|
|
195
|
+
let n = Te(t);
|
|
175
196
|
if (n != null) return e.type === `text` ? n : e.normalize([n]);
|
|
176
197
|
{
|
|
177
|
-
let n =
|
|
198
|
+
let n = Ee(t).reduce((t, n) => [...t, I(e, n)], []);
|
|
178
199
|
return e.normalize(n);
|
|
179
200
|
}
|
|
180
201
|
}
|
|
181
|
-
function
|
|
182
|
-
let n =
|
|
202
|
+
function I(e, t) {
|
|
203
|
+
let n = M(t);
|
|
183
204
|
switch (n) {
|
|
184
|
-
case 3: return
|
|
185
|
-
case 9: return
|
|
205
|
+
case 3: return N(t, n);
|
|
206
|
+
case 9: return N(t, n);
|
|
186
207
|
case 4: {
|
|
187
208
|
let r = t;
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
throw
|
|
209
|
+
if (p(r, `k`) && r.k) return e.interpolate(e.named(r.k));
|
|
210
|
+
if (p(r, `key`) && r.key) return e.interpolate(e.named(r.key));
|
|
211
|
+
throw F(n);
|
|
191
212
|
}
|
|
192
213
|
case 5: {
|
|
193
214
|
let r = t;
|
|
194
|
-
if (
|
|
195
|
-
if (
|
|
196
|
-
throw
|
|
215
|
+
if (p(r, `i`) && a(r.i)) return e.interpolate(e.list(r.i));
|
|
216
|
+
if (p(r, `index`) && a(r.index)) return e.interpolate(e.list(r.index));
|
|
217
|
+
throw F(n);
|
|
197
218
|
}
|
|
198
219
|
case 6: {
|
|
199
|
-
let n = t, r =
|
|
200
|
-
return e.linked(
|
|
220
|
+
let n = t, r = Ae(n), i = Me(n);
|
|
221
|
+
return e.linked(I(e, i), r ? I(e, r) : void 0, e.type);
|
|
201
222
|
}
|
|
202
|
-
case 7: return
|
|
203
|
-
case 8: return
|
|
223
|
+
case 7: return N(t, n);
|
|
224
|
+
case 8: return N(t, n);
|
|
204
225
|
default: throw Error(`unhandled node on format message part: ${n}`);
|
|
205
226
|
}
|
|
206
227
|
}
|
|
207
|
-
let
|
|
208
|
-
function
|
|
209
|
-
|
|
228
|
+
let L = d();
|
|
229
|
+
function Le() {
|
|
230
|
+
L = d();
|
|
210
231
|
}
|
|
211
|
-
function
|
|
232
|
+
function Re(e, t) {
|
|
212
233
|
{
|
|
234
|
+
if (!k(e)) return (() => e);
|
|
213
235
|
let t = e.cacheKey;
|
|
214
|
-
return t ?
|
|
236
|
+
return t ? L[t] || (L[t] = Pe(e)) : Pe(e);
|
|
215
237
|
}
|
|
216
238
|
}
|
|
217
|
-
let
|
|
239
|
+
let R = {
|
|
218
240
|
INVALID_ARGUMENT: 17,
|
|
219
241
|
INVALID_DATE_ARGUMENT: 18,
|
|
220
242
|
INVALID_ISO_DATE_ARGUMENT: 19,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
NOT_SUPPORT_LOCALE_TYPE: 23
|
|
243
|
+
NOT_SUPPORT_LOCALE_PROMISE_VALUE: 20,
|
|
244
|
+
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 21,
|
|
245
|
+
NOT_SUPPORT_LOCALE_TYPE: 22
|
|
225
246
|
};
|
|
226
|
-
function
|
|
227
|
-
return
|
|
247
|
+
function z(e) {
|
|
248
|
+
return be(e, null, void 0);
|
|
228
249
|
}
|
|
229
|
-
|
|
230
|
-
function
|
|
231
|
-
return t.locale == null ?
|
|
250
|
+
R.INVALID_ARGUMENT, R.INVALID_DATE_ARGUMENT, R.INVALID_ISO_DATE_ARGUMENT, R.NOT_SUPPORT_LOCALE_PROMISE_VALUE, R.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, R.NOT_SUPPORT_LOCALE_TYPE;
|
|
251
|
+
function B(e, t) {
|
|
252
|
+
return t.locale == null ? H(e.locale) : H(t.locale);
|
|
232
253
|
}
|
|
233
|
-
let
|
|
234
|
-
function
|
|
235
|
-
if (
|
|
236
|
-
if (
|
|
237
|
-
if (e.resolvedOnce &&
|
|
254
|
+
let V;
|
|
255
|
+
function H(e) {
|
|
256
|
+
if (v(e)) return e;
|
|
257
|
+
if (_(e)) {
|
|
258
|
+
if (e.resolvedOnce && V != null) return V;
|
|
238
259
|
if (e.constructor.name === `Function`) {
|
|
239
260
|
let t = e();
|
|
240
|
-
if (
|
|
241
|
-
return
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
function we(e, t, n) {
|
|
246
|
-
return [...new Set([n, ...C(t) ? t : D(t) ? Object.keys(t) : T(t) ? [t] : [n]])];
|
|
247
|
-
}
|
|
248
|
-
function Te(e, t, n) {
|
|
249
|
-
let r = T(n) ? n : Y, i = e;
|
|
250
|
-
i.__localeChainCache || (i.__localeChainCache = /* @__PURE__ */ new Map());
|
|
251
|
-
let a = i.__localeChainCache.get(r);
|
|
252
|
-
if (!a) {
|
|
253
|
-
a = [];
|
|
254
|
-
let e = [n];
|
|
255
|
-
for (; C(e);) e = Ee(a, e, t);
|
|
256
|
-
let o = C(t) || !A(t) ? t : t.default ? t.default : null;
|
|
257
|
-
e = T(o) ? [o] : o, C(e) && Ee(a, e, !1), i.__localeChainCache.set(r, a);
|
|
261
|
+
if (x(t)) throw z(R.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
|
|
262
|
+
return V = t;
|
|
263
|
+
}
|
|
264
|
+
throw z(R.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
|
|
258
265
|
}
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
function
|
|
266
|
+
throw z(R.NOT_SUPPORT_LOCALE_TYPE);
|
|
267
|
+
}
|
|
268
|
+
function ze(e, t, n) {
|
|
269
|
+
return [.../* @__PURE__ */ new Set([n, ...g(t) ? t : b(t) ? Object.keys(t).filter((e) => e !== "default") : v(t) ? [t] : [n]])];
|
|
270
|
+
}
|
|
271
|
+
function Be(e, t, n) {
|
|
272
|
+
let r = v(n) ? n : K, i = e, a;
|
|
273
|
+
b(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)));
|
|
274
|
+
let o = a.get(r);
|
|
275
|
+
if (o) return o;
|
|
276
|
+
let s = [], c = [n];
|
|
277
|
+
for (; g(c);) c = Ve(s, c, t);
|
|
278
|
+
let l = g(t) || !w(t) ? t : t.default ? t.default : null;
|
|
279
|
+
return c = v(l) ? [l] : l, g(c) && Ve(s, c, !1), a.set(r, s), s;
|
|
280
|
+
}
|
|
281
|
+
function Ve(e, t, n) {
|
|
262
282
|
let r = !0;
|
|
263
|
-
for (let i = 0; i < t.length &&
|
|
283
|
+
for (let i = 0; i < t.length && y(r); i++) {
|
|
264
284
|
let a = t[i];
|
|
265
|
-
|
|
285
|
+
v(a) && (r = He(e, t[i], n));
|
|
266
286
|
}
|
|
267
287
|
return r;
|
|
268
288
|
}
|
|
269
|
-
function
|
|
289
|
+
function He(e, t, n) {
|
|
270
290
|
let r, i = t.split(`-`);
|
|
271
291
|
do
|
|
272
|
-
r =
|
|
292
|
+
r = Ue(e, i.join(`-`), n), i.splice(-1, 1);
|
|
273
293
|
while (i.length && r === !0);
|
|
274
294
|
return r;
|
|
275
295
|
}
|
|
276
|
-
function
|
|
296
|
+
function Ue(e, t, n) {
|
|
277
297
|
let r = !1;
|
|
278
298
|
if (!e.includes(t) && (r = !0, t)) {
|
|
279
299
|
r = t[t.length - 1] !== `!`;
|
|
280
300
|
let i = t.replace(/!/g, ``);
|
|
281
|
-
e.push(i), (
|
|
301
|
+
e.push(i), (g(n) || w(n)) && n[i] && (r = n[i]);
|
|
282
302
|
}
|
|
283
303
|
return r;
|
|
284
304
|
}
|
|
285
|
-
let
|
|
286
|
-
|
|
305
|
+
let U = [];
|
|
306
|
+
U[0] = {
|
|
287
307
|
w: [0],
|
|
288
308
|
i: [3, 0],
|
|
289
309
|
"[": [4],
|
|
290
310
|
o: [7]
|
|
291
|
-
},
|
|
311
|
+
}, U[1] = {
|
|
292
312
|
w: [1],
|
|
293
313
|
".": [2],
|
|
294
314
|
"[": [4],
|
|
295
315
|
o: [7]
|
|
296
|
-
},
|
|
316
|
+
}, U[2] = {
|
|
297
317
|
w: [2],
|
|
298
318
|
i: [3, 0],
|
|
299
319
|
0: [3, 0]
|
|
300
|
-
},
|
|
320
|
+
}, U[3] = {
|
|
301
321
|
i: [3, 0],
|
|
302
322
|
0: [3, 0],
|
|
303
323
|
w: [1, 1],
|
|
304
324
|
".": [2, 1],
|
|
305
325
|
"[": [4, 1],
|
|
306
326
|
o: [7, 1]
|
|
307
|
-
},
|
|
327
|
+
}, U[4] = {
|
|
308
328
|
"'": [5, 0],
|
|
309
329
|
"\"": [6, 0],
|
|
310
330
|
"[": [4, 2],
|
|
311
331
|
"]": [1, 3],
|
|
312
332
|
o: 8,
|
|
313
333
|
l: [4, 0]
|
|
314
|
-
},
|
|
334
|
+
}, U[5] = {
|
|
315
335
|
"'": [4, 0],
|
|
316
336
|
o: 8,
|
|
317
337
|
l: [5, 0]
|
|
318
|
-
},
|
|
338
|
+
}, U[6] = {
|
|
319
339
|
"\"": [4, 0],
|
|
320
340
|
o: 8,
|
|
321
341
|
l: [6, 0]
|
|
322
342
|
};
|
|
323
|
-
let
|
|
324
|
-
function
|
|
325
|
-
return
|
|
343
|
+
let We = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
|
|
344
|
+
function Ge(e) {
|
|
345
|
+
return We.test(e);
|
|
326
346
|
}
|
|
327
|
-
function
|
|
347
|
+
function Ke(e) {
|
|
328
348
|
let t = e.charCodeAt(0);
|
|
329
349
|
return t === e.charCodeAt(e.length - 1) && (t === 34 || t === 39) ? e.slice(1, -1) : e;
|
|
330
350
|
}
|
|
331
|
-
function
|
|
351
|
+
function qe(e) {
|
|
332
352
|
if (e == null) return `o`;
|
|
333
353
|
switch (e.charCodeAt(0)) {
|
|
334
354
|
case 91:
|
|
@@ -349,11 +369,11 @@
|
|
|
349
369
|
}
|
|
350
370
|
return `i`;
|
|
351
371
|
}
|
|
352
|
-
function
|
|
372
|
+
function Je(e) {
|
|
353
373
|
let t = e.trim();
|
|
354
|
-
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 :
|
|
374
|
+
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : Ge(t) ? Ke(t) : `*` + t;
|
|
355
375
|
}
|
|
356
|
-
function
|
|
376
|
+
function Ye(e) {
|
|
357
377
|
let t = [], n = -1, r = 0, i = 0, a, o, s, c, l, u, d, f = [];
|
|
358
378
|
f[0] = () => {
|
|
359
379
|
o === void 0 ? o = s : o += s;
|
|
@@ -364,7 +384,7 @@
|
|
|
364
384
|
}, f[3] = () => {
|
|
365
385
|
if (i > 0) i--, r = 4, f[0]();
|
|
366
386
|
else {
|
|
367
|
-
if (i = 0, o === void 0 || (o =
|
|
387
|
+
if (i = 0, o === void 0 || (o = Je(o), o === !1)) return !1;
|
|
368
388
|
f[1]();
|
|
369
389
|
}
|
|
370
390
|
};
|
|
@@ -373,29 +393,29 @@
|
|
|
373
393
|
if (r === 5 && t === `'` || r === 6 && t === `"`) return n++, s = `\\` + t, f[0](), !0;
|
|
374
394
|
}
|
|
375
395
|
for (; r !== null;) if (n++, a = e[n], !(a === `\\` && p())) {
|
|
376
|
-
if (c =
|
|
396
|
+
if (c = qe(a), d = U[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;
|
|
377
397
|
if (r === 7) return t;
|
|
378
398
|
}
|
|
379
399
|
}
|
|
380
|
-
let
|
|
381
|
-
function
|
|
382
|
-
return
|
|
400
|
+
let W = /* @__PURE__ */ new Map();
|
|
401
|
+
function Xe(e, t) {
|
|
402
|
+
return b(e) ? m(e, t) : null;
|
|
383
403
|
}
|
|
384
|
-
function
|
|
385
|
-
if (!
|
|
386
|
-
let n =
|
|
387
|
-
if (n || (n =
|
|
404
|
+
function Ze(e, t) {
|
|
405
|
+
if (!b(e)) return null;
|
|
406
|
+
let n = W.get(t);
|
|
407
|
+
if (n || (n = Ye(t), n && W.set(t, n)), !n) return null;
|
|
388
408
|
let r = n.length, i = e, a = 0;
|
|
389
409
|
for (; a < r;) {
|
|
390
410
|
let e = n[a];
|
|
391
|
-
if (
|
|
411
|
+
if (Ne.includes(e) && k(i) || !b(i) || !p(i, e)) return null;
|
|
392
412
|
let t = i[e];
|
|
393
|
-
if (t === void 0 ||
|
|
413
|
+
if (t === void 0 || _(i)) return null;
|
|
394
414
|
i = t, a++;
|
|
395
415
|
}
|
|
396
416
|
return i;
|
|
397
417
|
}
|
|
398
|
-
let
|
|
418
|
+
let G = {
|
|
399
419
|
NOT_FOUND_KEY: 1,
|
|
400
420
|
FALLBACK_TO_TRANSLATE: 2,
|
|
401
421
|
CANNOT_FORMAT_NUMBER: 3,
|
|
@@ -404,124 +424,184 @@
|
|
|
404
424
|
FALLBACK_TO_DATE_FORMAT: 6,
|
|
405
425
|
EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7,
|
|
406
426
|
INVALID_NUMBER_ARGUMENT: 8,
|
|
407
|
-
INVALID_DATE_ARGUMENT: 9
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
[
|
|
413
|
-
[
|
|
414
|
-
[
|
|
415
|
-
[
|
|
416
|
-
[
|
|
417
|
-
[
|
|
427
|
+
INVALID_DATE_ARGUMENT: 9,
|
|
428
|
+
IGNORE_UNSAFE_LOCALE: 10,
|
|
429
|
+
FALLBACK_TO_DEFAULT_PLURAL_RULE: 11,
|
|
430
|
+
FALLBACK_FROM_INVALID_LOCALE: 12
|
|
431
|
+
}, Qe = {
|
|
432
|
+
[G.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
|
|
433
|
+
[G.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
|
|
434
|
+
[G.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
|
|
435
|
+
[G.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
|
|
436
|
+
[G.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
|
|
437
|
+
[G.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
|
|
438
|
+
[G.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.`,
|
|
439
|
+
[G.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
|
|
440
|
+
[G.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`,
|
|
441
|
+
[G.IGNORE_UNSAFE_LOCALE]: `Ignore '{locale}' locale: it is a property name of Object.prototype`,
|
|
442
|
+
[G.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
|
|
443
|
+
[G.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
|
|
418
444
|
};
|
|
419
|
-
function
|
|
420
|
-
return
|
|
445
|
+
function $e(e, ...t) {
|
|
446
|
+
return n(Qe[e], ...t);
|
|
421
447
|
}
|
|
422
|
-
let
|
|
423
|
-
function
|
|
448
|
+
let et = `12.0.0-alpha.6`, K = `en-US`, tt = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
|
|
449
|
+
function nt() {
|
|
424
450
|
return {
|
|
425
|
-
upper: (e, t) => t === `text` &&
|
|
426
|
-
lower: (e, t) => t === `text` &&
|
|
427
|
-
capitalize: (e, t) => t === `text` &&
|
|
451
|
+
upper: (e, t) => t === `text` && v(e) ? e.toUpperCase() : t === `vnode` && b(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
|
|
452
|
+
lower: (e, t) => t === `text` && v(e) ? e.toLowerCase() : t === `vnode` && b(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
|
|
453
|
+
capitalize: (e, t) => t === `text` && v(e) ? tt(e) : t === `vnode` && b(e) && `__v_isVNode` in e ? tt(e.children) : e
|
|
428
454
|
};
|
|
429
455
|
}
|
|
430
|
-
let
|
|
431
|
-
function
|
|
432
|
-
|
|
433
|
-
}
|
|
434
|
-
let
|
|
435
|
-
function
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
let
|
|
439
|
-
function
|
|
440
|
-
|
|
441
|
-
}
|
|
442
|
-
let
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
let
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
fallbackContext: ne,
|
|
469
|
-
onWarn: n
|
|
456
|
+
let rt;
|
|
457
|
+
function it(e) {
|
|
458
|
+
rt = e;
|
|
459
|
+
}
|
|
460
|
+
let at;
|
|
461
|
+
function ot(e) {
|
|
462
|
+
at = e;
|
|
463
|
+
}
|
|
464
|
+
let st;
|
|
465
|
+
function ct(e) {
|
|
466
|
+
st = e;
|
|
467
|
+
}
|
|
468
|
+
let lt = 0;
|
|
469
|
+
function ut(e = {}) {
|
|
470
|
+
let t = _(e.onWarn) ? e.onWarn : ne, n = v(e.version) ? e.version : et, r = v(e.locale) || _(e.locale) ? e.locale : K, i = _(r) ? K : r, a = pt(e.fallbackLocale) ? e.fallbackLocale : i, o = w(e.messages) ? e.messages : q(i), s = w(e.datetimeFormats) ? e.datetimeFormats : q(i), c = w(e.numberFormats) ? e.numberFormats : q(i), u = l(d(), e.modifiers, nt()), f = e.pluralRules || d(), p = _(e.missing) ? e.missing : null, m = !J(e.missingWarn) || e.missingWarn, h = !J(e.fallbackWarn) || e.fallbackWarn, g = !!e.fallbackFormat, x = !!e.unresolving, S = _(e.postTranslation) ? e.postTranslation : null, C = w(e.processor) ? e.processor : null, ee = !y(e.warnHtmlMessage) || e.warnHtmlMessage, te = !!e.escapeParameter, T = _(e.messageCompiler) ? e.messageCompiler : rt || null, re = _(e.messageResolver) ? e.messageResolver : at || Xe, ie = _(e.localeFallbacker) ? e.localeFallbacker : st || ze, ae = b(e.fallbackContext) ? e.fallbackContext : void 0;
|
|
471
|
+
lt++;
|
|
472
|
+
let E = {
|
|
473
|
+
version: n,
|
|
474
|
+
cid: lt,
|
|
475
|
+
locale: r,
|
|
476
|
+
fallbackLocale: a,
|
|
477
|
+
messages: o,
|
|
478
|
+
modifiers: u,
|
|
479
|
+
pluralRules: f,
|
|
480
|
+
missing: p,
|
|
481
|
+
missingWarn: m,
|
|
482
|
+
fallbackWarn: h,
|
|
483
|
+
fallbackFormat: g,
|
|
484
|
+
unresolving: x,
|
|
485
|
+
postTranslation: S,
|
|
486
|
+
processor: C,
|
|
487
|
+
warnHtmlMessage: ee,
|
|
488
|
+
escapeParameter: te,
|
|
489
|
+
messageCompiler: T,
|
|
490
|
+
messageResolver: re,
|
|
491
|
+
localeFallbacker: ie,
|
|
492
|
+
fallbackContext: ae,
|
|
493
|
+
onWarn: t
|
|
470
494
|
};
|
|
471
|
-
return
|
|
495
|
+
return E.datetimeFormats = s, E.numberFormats = c, E.__datetimeFormatters = /* @__PURE__ */ new Map(), E.__numberFormatters = /* @__PURE__ */ new Map(), E;
|
|
472
496
|
}
|
|
473
|
-
let
|
|
474
|
-
function
|
|
475
|
-
let n = e.messages
|
|
497
|
+
let q = (e) => ({ [e]: d() });
|
|
498
|
+
function dt(e, t) {
|
|
499
|
+
let n = m(e.messages, t);
|
|
476
500
|
if (n == null) return;
|
|
477
|
-
let r =
|
|
478
|
-
return
|
|
501
|
+
let r = d();
|
|
502
|
+
return ye(n, r), r;
|
|
479
503
|
}
|
|
480
|
-
function
|
|
481
|
-
e.messages[t] = n;
|
|
504
|
+
function ft(e, t, n) {
|
|
505
|
+
h(t) || (e.messages[t] = n);
|
|
482
506
|
}
|
|
483
|
-
function
|
|
484
|
-
return
|
|
507
|
+
function pt(e) {
|
|
508
|
+
return v(e) || g(e) || w(e) || e === !1;
|
|
485
509
|
}
|
|
486
|
-
function
|
|
487
|
-
return
|
|
510
|
+
function J(e) {
|
|
511
|
+
return y(e) || s(e);
|
|
488
512
|
}
|
|
489
|
-
function
|
|
513
|
+
function mt(e, t) {
|
|
514
|
+
return s(e) ? e.test(t) : e;
|
|
515
|
+
}
|
|
516
|
+
function ht(e, t) {
|
|
517
|
+
return s(e) ? e.test(t) : e;
|
|
518
|
+
}
|
|
519
|
+
function Y(e, t, n, r, i) {
|
|
490
520
|
let { missing: a, onWarn: o } = e;
|
|
491
521
|
if (a !== null) {
|
|
492
522
|
let r = a(e, n, t, i);
|
|
493
|
-
return
|
|
494
|
-
}
|
|
523
|
+
return v(r) ? r : t;
|
|
524
|
+
}
|
|
525
|
+
return t;
|
|
495
526
|
}
|
|
496
|
-
function
|
|
497
|
-
let
|
|
498
|
-
|
|
527
|
+
function gt(e, t) {
|
|
528
|
+
let n = e;
|
|
529
|
+
b(t) ? n.__localeChainObjectCache?.delete(t) : n.__localeChainCache?.delete(t);
|
|
499
530
|
}
|
|
500
|
-
function
|
|
501
|
-
|
|
531
|
+
function _t(e, t, n) {
|
|
532
|
+
gt(e, n), e.fallbackContext && gt(e.fallbackContext, n);
|
|
533
|
+
{
|
|
534
|
+
let { __datetimeFormatters: t, __numberFormatters: n } = e;
|
|
535
|
+
t.clear(), n.clear();
|
|
536
|
+
}
|
|
537
|
+
e.localeFallbacker(e, n, t);
|
|
502
538
|
}
|
|
503
|
-
function
|
|
539
|
+
function vt(e, t) {
|
|
540
|
+
return e !== t && e.split(`-`)[0] === t.split(`-`)[0];
|
|
541
|
+
}
|
|
542
|
+
function yt(e, t) {
|
|
504
543
|
let n = t.indexOf(e);
|
|
505
544
|
if (n === -1) return !1;
|
|
506
|
-
for (let r = n + 1; r < t.length; r++) if (
|
|
545
|
+
for (let r = n + 1; r < t.length; r++) if (vt(e, t[r])) return !0;
|
|
507
546
|
return !1;
|
|
508
547
|
}
|
|
509
|
-
function
|
|
510
|
-
let {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
548
|
+
function bt(e, t, n, r, i, a, o) {
|
|
549
|
+
let { fallbackLocale: s, localeFallbacker: c, onWarn: l } = e, u = c(e, s, n);
|
|
550
|
+
for (let n = 0; n < u.length; n++) {
|
|
551
|
+
let a = u[n], s = m(m(r, a) || {}, t);
|
|
552
|
+
if (w(s) && v(a)) return a;
|
|
553
|
+
Y(e, t, a, i, o);
|
|
554
|
+
}
|
|
555
|
+
return null;
|
|
556
|
+
}
|
|
557
|
+
function xt(e) {
|
|
558
|
+
try {
|
|
559
|
+
return Intl.getCanonicalLocales(e), !0;
|
|
560
|
+
} catch {
|
|
561
|
+
return !1;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
function St(e, t, n, r, i) {
|
|
565
|
+
try {
|
|
566
|
+
return new t(n, r);
|
|
567
|
+
} catch (i) {
|
|
568
|
+
if (xt(n)) throw i;
|
|
569
|
+
let { fallbackLocale: a, localeFallbacker: o, onWarn: s } = e;
|
|
570
|
+
return new t(o(e, a, n).find(xt) || `en-US`, r);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
function Ct(e, [t, n, r, i], a, o, s, c) {
|
|
574
|
+
let u = y(r.missingWarn) ? r.missingWarn : e.missingWarn, d = y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = B(e, r);
|
|
575
|
+
if (!v(t) || t === ``) {
|
|
576
|
+
let t = St(e, a, p.replace(/!/g, ``), i, c);
|
|
577
|
+
return f ? t.formatToParts(n) : t.format(n);
|
|
578
|
+
}
|
|
579
|
+
let m = bt(e, t, p, s, u, d, c);
|
|
580
|
+
if (!v(m)) return e.unresolving ? -1 : t;
|
|
581
|
+
let h = s[m][t], g = wt(m, t, i), _ = o.get(g);
|
|
582
|
+
return _ || (_ = St(e, a, m, l({}, h, i), c), o.set(g, _)), f ? _.formatToParts(n) : _.format(n);
|
|
583
|
+
}
|
|
584
|
+
function wt(e, t, n) {
|
|
585
|
+
let r = `${e}__${t}`;
|
|
586
|
+
return w(n) && !c(n) && (r = `${r}__${JSON.stringify(n)}`), r;
|
|
587
|
+
}
|
|
588
|
+
function Tt(e, t, n) {
|
|
589
|
+
for (let r in n) {
|
|
590
|
+
let n = `${t}__${r}`;
|
|
591
|
+
for (let t of e.keys()) (t === n || t.startsWith(`${n}__`)) && e.delete(t);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
function Et(e, t, n, r) {
|
|
595
|
+
let [, i, a, o] = e, s = n;
|
|
596
|
+
return v(i) ? t.key = i : w(i) && Object.keys(i).forEach((e) => {
|
|
597
|
+
r.includes(e) ? s[e] = i[e] : t[e] = i[e];
|
|
598
|
+
}), v(a) ? t.locale = a : w(a) && (s = a), w(o) && (s = o), s;
|
|
599
|
+
}
|
|
600
|
+
function Dt(e, ...t) {
|
|
601
|
+
let { datetimeFormats: n, onWarn: r } = e, { __datetimeFormatters: i } = e;
|
|
602
|
+
return !v(t[0]) && !o(t[0]) && !a(t[0]) ? `` : Ct(e, kt(...t), Intl.DateTimeFormat, i, n, `datetime format`);
|
|
603
|
+
}
|
|
604
|
+
let Ot = [
|
|
525
605
|
`localeMatcher`,
|
|
526
606
|
`weekday`,
|
|
527
607
|
`era`,
|
|
@@ -543,55 +623,39 @@
|
|
|
543
623
|
`hourCycle`,
|
|
544
624
|
`fractionalSecondDigits`
|
|
545
625
|
];
|
|
546
|
-
function
|
|
547
|
-
let [t
|
|
548
|
-
if (
|
|
549
|
-
let e = t.match(
|
|
550
|
-
if (!e) throw
|
|
626
|
+
function kt(...e) {
|
|
627
|
+
let [t] = e, n = d(), r = d(), i;
|
|
628
|
+
if (v(t)) {
|
|
629
|
+
let e = t.match(/^(\d{4}-\d{2}-\d{2})(?:(T|\s)(.+))?$/);
|
|
630
|
+
if (!e) throw z(R.INVALID_ISO_DATE_ARGUMENT);
|
|
551
631
|
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();
|
|
552
|
-
|
|
632
|
+
i = new Date(n);
|
|
553
633
|
try {
|
|
554
|
-
|
|
634
|
+
i.toISOString();
|
|
555
635
|
} catch {
|
|
556
|
-
throw
|
|
636
|
+
throw z(R.INVALID_ISO_DATE_ARGUMENT);
|
|
557
637
|
}
|
|
558
|
-
} else if (
|
|
559
|
-
if (isNaN(t.getTime())) throw
|
|
560
|
-
|
|
561
|
-
} else if (
|
|
562
|
-
else throw
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
c
|
|
638
|
+
} else if (o(t)) {
|
|
639
|
+
if (isNaN(t.getTime())) throw z(R.INVALID_DATE_ARGUMENT);
|
|
640
|
+
i = t;
|
|
641
|
+
} else if (a(t)) i = t;
|
|
642
|
+
else throw z(R.INVALID_ARGUMENT);
|
|
643
|
+
let s = Et(e, n, r, Ot);
|
|
644
|
+
return [
|
|
645
|
+
n.key || ``,
|
|
646
|
+
i,
|
|
647
|
+
n,
|
|
648
|
+
s
|
|
570
649
|
];
|
|
571
650
|
}
|
|
572
|
-
function
|
|
573
|
-
|
|
574
|
-
for (let e in n) {
|
|
575
|
-
let n = `${t}__${e}`;
|
|
576
|
-
r.__datetimeFormatters.has(n) && r.__datetimeFormatters.delete(n);
|
|
577
|
-
}
|
|
651
|
+
function At(e, t, n) {
|
|
652
|
+
Tt(e.__datetimeFormatters, t, n);
|
|
578
653
|
}
|
|
579
|
-
function
|
|
580
|
-
let { numberFormats: n,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
let g = !!p.part, _ = U(e, p), v = s(e, i, _);
|
|
585
|
-
if (!T(d) || d === ``) return new Intl.NumberFormat(_.replace(/!/g, ``), m).format(f);
|
|
586
|
-
let y = {}, b, x = null;
|
|
587
|
-
for (let t = 0; t < v.length && (b = v[t], y = n[b] || {}, x = y[d], !A(x)); t++) Z(e, d, b, h, `number format`);
|
|
588
|
-
if (!A(x) || !T(b)) return r ? -1 : d;
|
|
589
|
-
let S = `${b}__${d}`;
|
|
590
|
-
A(m) && !l(m) && (S = `${S}__${JSON.stringify(m)}`);
|
|
591
|
-
let C = c.get(S);
|
|
592
|
-
return C || (C = new Intl.NumberFormat(b, u({}, x, m)), c.set(S, C)), g ? C.formatToParts(f) : C.format(f);
|
|
593
|
-
}
|
|
594
|
-
let dt = [
|
|
654
|
+
function jt(e, ...t) {
|
|
655
|
+
let { numberFormats: n, onWarn: r } = e, { __numberFormatters: i } = e;
|
|
656
|
+
return a(t[0]) ? Ct(e, Nt(...t), Intl.NumberFormat, i, n, `number format`) : ``;
|
|
657
|
+
}
|
|
658
|
+
let Mt = [
|
|
595
659
|
`localeMatcher`,
|
|
596
660
|
`style`,
|
|
597
661
|
`currency`,
|
|
@@ -613,124 +677,134 @@
|
|
|
613
677
|
`roundingIncrement`,
|
|
614
678
|
`trailingZeroDisplay`
|
|
615
679
|
];
|
|
616
|
-
function
|
|
617
|
-
let [t
|
|
618
|
-
if (!
|
|
619
|
-
let
|
|
620
|
-
return
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
a,
|
|
626
|
-
s
|
|
680
|
+
function Nt(...e) {
|
|
681
|
+
let [t] = e, n = d(), r = d();
|
|
682
|
+
if (!a(t)) throw z(R.INVALID_ARGUMENT);
|
|
683
|
+
let i = t, o = Et(e, n, r, Mt);
|
|
684
|
+
return [
|
|
685
|
+
n.key || ``,
|
|
686
|
+
i,
|
|
687
|
+
n,
|
|
688
|
+
o
|
|
627
689
|
];
|
|
628
690
|
}
|
|
629
|
-
function
|
|
630
|
-
|
|
631
|
-
for (let e in n) {
|
|
632
|
-
let n = `${t}__${e}`;
|
|
633
|
-
r.__numberFormatters.has(n) && r.__numberFormatters.delete(n);
|
|
634
|
-
}
|
|
691
|
+
function Pt(e, t, n) {
|
|
692
|
+
Tt(e.__numberFormatters, t, n);
|
|
635
693
|
}
|
|
636
|
-
let
|
|
637
|
-
function
|
|
694
|
+
let Ft = (e) => e, It = (e) => ``, Lt = `text`, Rt = (e) => e.length === 0 ? `` : te(e), zt = ee;
|
|
695
|
+
function X(e, t) {
|
|
638
696
|
return e = Math.abs(e), t === 2 ? e === 1 ? 0 : 1 : Math.min(e, 2);
|
|
639
697
|
}
|
|
640
|
-
let
|
|
698
|
+
let Bt = [
|
|
641
699
|
`zero`,
|
|
642
700
|
`one`,
|
|
643
701
|
`two`,
|
|
644
702
|
`few`,
|
|
645
703
|
`many`,
|
|
646
704
|
`other`
|
|
647
|
-
],
|
|
648
|
-
function
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
let
|
|
652
|
-
|
|
653
|
-
rules:
|
|
654
|
-
categories:
|
|
655
|
-
}
|
|
705
|
+
], Z = /* @__PURE__ */ new Map();
|
|
706
|
+
function Vt(e) {
|
|
707
|
+
try {
|
|
708
|
+
if (Intl.PluralRules.supportedLocalesOf(e).length === 0) return null;
|
|
709
|
+
let t = new Intl.PluralRules(e);
|
|
710
|
+
return {
|
|
711
|
+
rules: t,
|
|
712
|
+
categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) => Bt.indexOf(e) - Bt.indexOf(t))
|
|
713
|
+
};
|
|
714
|
+
} catch {
|
|
715
|
+
return null;
|
|
656
716
|
}
|
|
657
|
-
return t;
|
|
658
717
|
}
|
|
659
|
-
function
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
718
|
+
function Ht(e) {
|
|
719
|
+
let t = Z.get(e);
|
|
720
|
+
return t === void 0 && (t = Vt(e), Z.size >= 1e3 && Z.delete(Z.keys().next().value), Z.set(e, t)), t;
|
|
721
|
+
}
|
|
722
|
+
function Ut(e) {
|
|
723
|
+
return a(e.pluralIndex) ? e.pluralIndex : a(e.named?.count) ? e.named.count : a(e.named?.n) ? e.named.n : -1;
|
|
724
|
+
}
|
|
725
|
+
function Wt(e = {}) {
|
|
726
|
+
let t = e.locale, n = Ut(e), r;
|
|
727
|
+
r = v(t) && e.pluralRules && _(m(e.pluralRules, t)) ? e.pluralRules[t] : v(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
|
|
728
|
+
let r = Ht(t);
|
|
729
|
+
if (r === null || n > r.categories.length) return X(e, n);
|
|
730
|
+
let { rules: i, categories: a } = r, o = i.select(Math.abs(e)), s = a.indexOf(o);
|
|
731
|
+
return Math.min(s === -1 ? n - 1 : s, n - 1);
|
|
732
|
+
} : X;
|
|
733
|
+
let i = r === X ? void 0 : X, o = (e) => e[r(n, e.length, i)], s = e.list || [], c = (e) => s[e], u = e.named || d(), f = a(e.pluralIndex), p = (t) => {
|
|
734
|
+
let n = h(t) ? m(u, t) : u[t];
|
|
735
|
+
return f && n == null && (t === `count` || t === `n`) ? e.pluralIndex : n;
|
|
736
|
+
};
|
|
737
|
+
function y(t, n) {
|
|
738
|
+
return (_(e.messages) ? e.messages(t, !!n) : b(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : It);
|
|
675
739
|
}
|
|
676
|
-
let
|
|
740
|
+
let x = (t) => e.modifiers ? m(e.modifiers, t) : Ft, S = _(e.processor?.normalize) ? e.processor.normalize : Rt, C = _(e.processor?.interpolate) ? e.processor.interpolate : zt, w = {
|
|
677
741
|
list: c,
|
|
678
|
-
named:
|
|
679
|
-
plural:
|
|
742
|
+
named: p,
|
|
743
|
+
plural: o,
|
|
680
744
|
linked: (e, ...t) => {
|
|
681
745
|
let [n, r] = t, i = `text`, a = ``;
|
|
682
|
-
t.length === 1 ?
|
|
683
|
-
let o =
|
|
684
|
-
|
|
746
|
+
t.length === 1 ? b(n) ? (a = n.modifier || a, i = n.type || i) : v(n) && (a = n || a) : t.length === 2 && (v(n) && (a = n || a), v(r) && (i = r || i));
|
|
747
|
+
let o = y(e, !0)(w), s = o === `` || o === void 0 ? e : o, c = i === `vnode` && g(s) && a ? s[0] : s;
|
|
748
|
+
if (!a) return c;
|
|
749
|
+
let l = x(a);
|
|
750
|
+
return _(l) ? l(c, i) : c;
|
|
685
751
|
},
|
|
686
|
-
message:
|
|
687
|
-
type:
|
|
688
|
-
interpolate:
|
|
689
|
-
normalize:
|
|
690
|
-
values:
|
|
752
|
+
message: y,
|
|
753
|
+
type: v(e.processor?.type) ? e.processor.type : Lt,
|
|
754
|
+
interpolate: C,
|
|
755
|
+
normalize: S,
|
|
756
|
+
values: l(d(), s, u, f ? {
|
|
757
|
+
count: p(`count`),
|
|
758
|
+
n: p(`n`)
|
|
759
|
+
} : {})
|
|
691
760
|
};
|
|
692
|
-
return
|
|
761
|
+
return w;
|
|
693
762
|
}
|
|
694
|
-
let
|
|
695
|
-
function
|
|
696
|
-
let [n, r] =
|
|
697
|
-
a &&
|
|
763
|
+
let Gt = () => ``, Q = (e) => _(e), $ = (e) => v(e) || k(e) || Q(e);
|
|
764
|
+
function Kt(e, ...t) {
|
|
765
|
+
let [n, r] = Xt(...t), i = B(e, r), a = y(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
|
|
766
|
+
a && qt(r);
|
|
698
767
|
let o = !!r.resolvedMessage, [s, c, l] = o ? [
|
|
699
768
|
n,
|
|
700
769
|
i,
|
|
701
|
-
e.messages
|
|
702
|
-
] :
|
|
703
|
-
if (!o &&
|
|
704
|
-
let t =
|
|
705
|
-
(e.fallbackFormat || t != null && (
|
|
770
|
+
m(e.messages, i) || d()
|
|
771
|
+
] : Jt(e, n, i, e.fallbackLocale, y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, y(r.missingWarn) ? r.missingWarn : e.missingWarn), u = n;
|
|
772
|
+
if (!o && !$(s)) {
|
|
773
|
+
let t = v(r.default) ? r.default : y(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
|
|
774
|
+
(e.fallbackFormat || t != null && (v(t) || _(t))) && (s = t, u = s);
|
|
706
775
|
}
|
|
707
|
-
if (!o && (
|
|
708
|
-
let
|
|
709
|
-
|
|
710
|
-
});
|
|
711
|
-
if (d) return s;
|
|
712
|
-
let m = p(Ct(jt(e, c, l, r))), h = e.postTranslation ? e.postTranslation(m, n) : m;
|
|
713
|
-
return a && T(h) && (h = b(h)), h;
|
|
714
|
-
}
|
|
715
|
-
function Et(e) {
|
|
716
|
-
C(e.list) ? e.list = e.list.map((e) => T(e) ? p(e) : e) : D(e.named) && Object.keys(e.named).forEach((t) => {
|
|
717
|
-
T(e.named[t]) && (e.named[t] = p(e.named[t]));
|
|
776
|
+
if (!o && (!$(s) || !v(c))) return e.unresolving ? -1 : n;
|
|
777
|
+
let f = !1, p = Q(s) ? s : Yt(e, n, c, s, u, () => {
|
|
778
|
+
f = !0;
|
|
718
779
|
});
|
|
780
|
+
if (f) return s;
|
|
781
|
+
let h = p(Wt(Qt(e, c, l, r))), g = e.postTranslation ? e.postTranslation(h, n) : h;
|
|
782
|
+
return a && v(g) && (g = _e(g)), g;
|
|
783
|
+
}
|
|
784
|
+
function qt(e) {
|
|
785
|
+
if (g(e.list) && (e.list = e.list.map((e) => v(e) ? T(e) : e)), b(e.named)) {
|
|
786
|
+
let t = e.named, n = d();
|
|
787
|
+
for (let e of Object.keys(t)) {
|
|
788
|
+
let r = t[e];
|
|
789
|
+
n[e] = v(r) ? T(r) : r;
|
|
790
|
+
}
|
|
791
|
+
e.named = n;
|
|
792
|
+
}
|
|
719
793
|
}
|
|
720
|
-
function
|
|
721
|
-
let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, u = l(e, r, n),
|
|
722
|
-
for (let n = 0; n < u.length && (p = u[n],
|
|
723
|
-
let n =
|
|
724
|
-
n !== t && (
|
|
794
|
+
function Jt(e, t, n, r, i, a) {
|
|
795
|
+
let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, u = l(e, r, n), f = d(), p, h = null;
|
|
796
|
+
for (let n = 0; n < u.length && (p = u[n], f = m(o, p) || d(), (h = c(f, t)) === null && (h = m(f, t)), !$(h)); n++) if (!yt(p, u)) {
|
|
797
|
+
let n = Y(e, t, p, a, `translate`);
|
|
798
|
+
n !== t && (h = n);
|
|
725
799
|
}
|
|
726
800
|
return [
|
|
727
|
-
|
|
801
|
+
h,
|
|
728
802
|
p,
|
|
729
|
-
|
|
803
|
+
f
|
|
730
804
|
];
|
|
731
805
|
}
|
|
732
|
-
function
|
|
733
|
-
if (
|
|
806
|
+
function Yt(e, t, n, r, i, a) {
|
|
807
|
+
if (Q(r)) {
|
|
734
808
|
let e = r;
|
|
735
809
|
return e.locale = e.locale || n, e.key = e.key || t, e;
|
|
736
810
|
}
|
|
@@ -738,16 +812,16 @@
|
|
|
738
812
|
let e = (() => r);
|
|
739
813
|
return e.locale = n, e.key = t, e;
|
|
740
814
|
}
|
|
741
|
-
let o = e.messageCompiler(r,
|
|
815
|
+
let o = e.messageCompiler(r, Zt(e, n, i, r, e.warnHtmlMessage, a));
|
|
742
816
|
return o.locale = n, o.key = t, o.source = r, o;
|
|
743
817
|
}
|
|
744
|
-
function
|
|
818
|
+
function Xt(...e) {
|
|
745
819
|
let [t, n, r] = e;
|
|
746
|
-
if (!
|
|
747
|
-
let i =
|
|
748
|
-
return
|
|
820
|
+
if (!v(t) && !a(t) && !Q(t) && !k(t)) throw z(R.INVALID_ARGUMENT);
|
|
821
|
+
let i = a(t) ? String(t) : (Q(t), t), o = d();
|
|
822
|
+
return a(n) ? o.plural = n : v(n) ? o.default = n : w(n) && !c(n) ? o.named = n : g(n) && (o.list = n), a(r) ? o.plural = r : v(r) ? o.default = r : w(r) && l(o, r), [i, o];
|
|
749
823
|
}
|
|
750
|
-
function
|
|
824
|
+
function Zt(e, t, n, i, a, o) {
|
|
751
825
|
return {
|
|
752
826
|
locale: t,
|
|
753
827
|
key: n,
|
|
@@ -755,34 +829,34 @@
|
|
|
755
829
|
onError: (e) => {
|
|
756
830
|
throw o?.(e), e;
|
|
757
831
|
},
|
|
758
|
-
onCacheKey: (e) =>
|
|
832
|
+
onCacheKey: (e) => r(t, n, e)
|
|
759
833
|
};
|
|
760
834
|
}
|
|
761
|
-
function
|
|
762
|
-
let { modifiers: i, pluralRules:
|
|
835
|
+
function Qt(e, t, n, r) {
|
|
836
|
+
let { modifiers: i, pluralRules: o, messageResolver: s, fallbackLocale: c, fallbackWarn: l, missingWarn: u, fallbackContext: d } = e;
|
|
763
837
|
return {
|
|
764
838
|
locale: t,
|
|
765
839
|
modifiers: i,
|
|
766
|
-
pluralRules:
|
|
840
|
+
pluralRules: o,
|
|
767
841
|
messages: (r, i) => {
|
|
768
842
|
let a = s(n, r);
|
|
769
843
|
if (a == null && (d || i)) {
|
|
770
|
-
let [n, , i] =
|
|
844
|
+
let [n, , i] = Jt(d || e, r, t, c, l, u);
|
|
771
845
|
a = n ?? s(i, r);
|
|
772
846
|
}
|
|
773
|
-
if (
|
|
774
|
-
let n = !1, i =
|
|
847
|
+
if (v(a) || k(a)) {
|
|
848
|
+
let n = !1, i = Yt(e, r, t, a, r, () => {
|
|
775
849
|
n = !0;
|
|
776
850
|
});
|
|
777
|
-
return n ?
|
|
778
|
-
}
|
|
779
|
-
|
|
851
|
+
return n ? Gt : i;
|
|
852
|
+
}
|
|
853
|
+
return Q(a) ? a : Gt;
|
|
780
854
|
},
|
|
781
855
|
processor: e.processor ?? void 0,
|
|
782
856
|
list: r.list ?? void 0,
|
|
783
857
|
named: r.named ?? void 0,
|
|
784
|
-
pluralIndex:
|
|
858
|
+
pluralIndex: a(r.plural) ? r.plural : void 0
|
|
785
859
|
};
|
|
786
860
|
}
|
|
787
|
-
return
|
|
861
|
+
return e.AST_NODE_PROPS_KEYS = Ne, e.CORE_ERROR_CODES_EXTEND_POINT = 23, e.CORE_WARN_CODES_EXTEND_POINT = 13, e.CoreWarnCodes = G, e.DATETIME_FORMAT_OPTIONS_KEYS = Ot, e.DEFAULT_LOCALE = K, e.DEFAULT_MESSAGE_DATA_TYPE = Lt, e.MISSING_RESOLVE_VALUE = ``, e.NOT_RESOLVED = -1, e.NUMBER_FORMAT_OPTIONS_KEYS = Mt, e.VERSION = et, e.clearCompileCache = Le, e.clearDateTimeFormat = At, e.clearNumberFormat = Pt, e.compile = Re, e.createCompileError = be, e.createCoreContext = ut, e.createCoreError = z, e.createMessageContext = Wt, e.datetime = Dt, e.fallbackWithLocaleChain = Be, e.fallbackWithSimple = ze, e.getLocale = B, e.getLocaleMessage = dt, e.getWarnMessage = $e, e.handleMissing = Y, e.isAlmostSameLocale = vt, e.isFallbackLocale = pt, e.isImplicitFallback = yt, e.isMessageAST = k, e.isMessageFormat = $, e.isMessageFunction = Q, e.isTranslateFallbackWarn = mt, e.isTranslateMissingWarn = ht, e.isWarnOption = J, e.number = jt, e.parse = Ye, e.parseDateTimeArgs = kt, e.parseNumberArgs = Nt, e.parseTranslateArgs = Xt, e.registerLocaleFallbacker = ct, e.registerMessageCompiler = it, e.registerMessageResolver = ot, e.resolveLocale = H, e.resolveValue = Ze, e.resolveWithKeyValue = Xe, e.setLocaleMessage = ft, e.translate = Kt, e.updateFallbackLocale = _t, e;
|
|
788
862
|
})({});
|