gt-react 10.19.16 → 10.19.17
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/CHANGELOG.md +13 -0
- package/dist/browser.cjs +626 -501
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +71 -104
- package/dist/browser.d.cts.map +1 -1
- package/dist/browser.d.mts +71 -104
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.mjs +622 -496
- package/dist/browser.mjs.map +1 -1
- package/dist/client.cjs +399 -304
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -8
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.mts +7 -8
- package/dist/client.d.mts.map +1 -1
- package/dist/client.mjs +399 -303
- package/dist/client.mjs.map +1 -1
- package/dist/index.cjs +602 -420
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +9 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +601 -418
- package/dist/index.mjs.map +1 -1
- package/dist/internal.cjs +590 -498
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +18 -18
- package/dist/internal.d.cts.map +1 -1
- package/dist/internal.d.mts +8 -8
- package/dist/internal.d.mts.map +1 -1
- package/dist/internal.mjs +556 -464
- package/dist/internal.mjs.map +1 -1
- package/dist/macros.cjs +100 -33
- package/dist/macros.cjs.map +1 -1
- package/dist/macros.mjs +100 -33
- package/dist/macros.mjs.map +1 -1
- package/package.json +7 -7
package/dist/client.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as e from "react";
|
|
3
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { Suspense, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { determineLocale } from "@generaltranslation/format";
|
|
5
5
|
import { GT } from "generaltranslation";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -20,43 +20,76 @@ var c = Object.defineProperty, l = Object.getOwnPropertyDescriptor, u = Object.g
|
|
|
20
20
|
});
|
|
21
21
|
return e;
|
|
22
22
|
}, g = (e) => d.call(e, `module.exports`) ? e[`module.exports`] : h(c({}, `__esModule`, { value: !0 }), e);
|
|
23
|
-
function
|
|
23
|
+
function b(e) {
|
|
24
|
+
let t = e.trim();
|
|
25
|
+
return t ? /[.!?)]$/.test(t) ? t : `${t}.` : ``;
|
|
26
|
+
}
|
|
27
|
+
function x(e) {
|
|
28
|
+
let t = e.trim(), n = t.length;
|
|
29
|
+
for (; n > 0;) {
|
|
30
|
+
let e = t[n - 1];
|
|
31
|
+
if (e !== `.` && e !== `!` && e !== `?`) break;
|
|
32
|
+
--n;
|
|
33
|
+
}
|
|
34
|
+
return t.slice(0, n);
|
|
35
|
+
}
|
|
36
|
+
function te(e) {
|
|
37
|
+
return e.replace(/^[A-Z][a-z]/, (e) => e.toLowerCase());
|
|
38
|
+
}
|
|
39
|
+
function ne(e) {
|
|
40
|
+
if (!e) return ``;
|
|
41
|
+
let t = Array.isArray(e) ? e.join(`, `) : e;
|
|
42
|
+
return t.trim() ? b(`Details: ${t}`) : ``;
|
|
43
|
+
}
|
|
44
|
+
function S({ source: e, severity: t, whatHappened: n, reassurance: r, why: i, fix: a, wayOut: o, details: s, docsUrl: c }) {
|
|
45
|
+
let l = e ? t ? `${e} ${t}:` : `${e}:` : t ? `${t}:` : ``, u = i ? `${x(n)} because ${te(x(i))}` : n, d = !!a && !!o && /^[a-z]/.test(x(o)), f = [
|
|
46
|
+
u,
|
|
47
|
+
r,
|
|
48
|
+
d ? `${x(a)}, or ${te(x(o))}` : a,
|
|
49
|
+
d ? void 0 : o,
|
|
50
|
+
ne(s)
|
|
51
|
+
].filter((e) => !!e).map(b);
|
|
52
|
+
c && f.push(`Learn more: ${c}`);
|
|
53
|
+
let p = f.join(` `);
|
|
54
|
+
return l ? `${l} ${p}` : p;
|
|
55
|
+
}
|
|
56
|
+
function ie(e) {
|
|
24
57
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === `Uint8Array` && `BYTES_PER_ELEMENT` in e && e.BYTES_PER_ELEMENT === 1;
|
|
25
58
|
}
|
|
26
|
-
function
|
|
27
|
-
let r =
|
|
59
|
+
function D(e, t, n = ``) {
|
|
60
|
+
let r = ie(e), i = e?.length, a = t !== void 0;
|
|
28
61
|
if (!r || a && i !== t) {
|
|
29
62
|
let o = n && `"${n}" `, s = a ? ` of length ${t}` : ``, c = r ? `length=${i}` : `type=${typeof e}`, l = o + `expected Uint8Array` + s + `, got ` + c;
|
|
30
63
|
throw r ? RangeError(l) : TypeError(l);
|
|
31
64
|
}
|
|
32
65
|
return e;
|
|
33
66
|
}
|
|
34
|
-
function
|
|
67
|
+
function ae(e, t = !0) {
|
|
35
68
|
if (e.destroyed) throw Error(`Hash instance has been destroyed`);
|
|
36
69
|
if (t && e.finished) throw Error(`Hash#digest() has already been called`);
|
|
37
70
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
71
|
+
function oe(e, t) {
|
|
72
|
+
D(e, void 0, `digestInto() output`);
|
|
40
73
|
let n = t.outputLen;
|
|
41
74
|
if (e.length < n) throw RangeError(`"digestInto() output" expected to be of length >=` + n);
|
|
42
75
|
}
|
|
43
|
-
function
|
|
76
|
+
function se(...e) {
|
|
44
77
|
for (let t = 0; t < e.length; t++) e[t].fill(0);
|
|
45
78
|
}
|
|
46
|
-
function
|
|
79
|
+
function ce(e) {
|
|
47
80
|
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
48
81
|
}
|
|
49
|
-
function
|
|
82
|
+
function O(e, t) {
|
|
50
83
|
return e << 32 - t | e >>> t;
|
|
51
84
|
}
|
|
52
85
|
new Uint8Array(new Uint32Array([287454020]).buffer)[0];
|
|
53
86
|
typeof Uint8Array.from([]).toHex == `function` && Uint8Array.fromHex;
|
|
54
87
|
Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, `0`));
|
|
55
|
-
function
|
|
88
|
+
function pe(e, t = {}) {
|
|
56
89
|
let n = (t, n) => e(n).update(t).digest(), r = e(void 0);
|
|
57
90
|
return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.canXOF = r.canXOF, n.create = (t) => e(t), Object.assign(n, t), Object.freeze(n);
|
|
58
91
|
}
|
|
59
|
-
const
|
|
92
|
+
const me = (e) => ({ oid: Uint8Array.from([
|
|
60
93
|
6,
|
|
61
94
|
9,
|
|
62
95
|
96,
|
|
@@ -69,13 +102,13 @@ const se = (e) => ({ oid: Uint8Array.from([
|
|
|
69
102
|
2,
|
|
70
103
|
e
|
|
71
104
|
]) });
|
|
72
|
-
function
|
|
105
|
+
function he(e, t, n) {
|
|
73
106
|
return e & t ^ ~e & n;
|
|
74
107
|
}
|
|
75
|
-
function
|
|
108
|
+
function ge(e, t, n) {
|
|
76
109
|
return e & t ^ e & n ^ t & n;
|
|
77
110
|
}
|
|
78
|
-
var
|
|
111
|
+
var _e = class {
|
|
79
112
|
blockLen;
|
|
80
113
|
outputLen;
|
|
81
114
|
canXOF = !1;
|
|
@@ -88,15 +121,15 @@ var ue = class {
|
|
|
88
121
|
pos = 0;
|
|
89
122
|
destroyed = !1;
|
|
90
123
|
constructor(e, t, n, r) {
|
|
91
|
-
this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = r, this.buffer = new Uint8Array(e), this.view =
|
|
124
|
+
this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = r, this.buffer = new Uint8Array(e), this.view = ce(this.buffer);
|
|
92
125
|
}
|
|
93
126
|
update(e) {
|
|
94
|
-
|
|
127
|
+
ae(this), D(e);
|
|
95
128
|
let { view: t, buffer: n, blockLen: r } = this, i = e.length;
|
|
96
129
|
for (let a = 0; a < i;) {
|
|
97
130
|
let o = Math.min(r - this.pos, i - a);
|
|
98
131
|
if (o === r) {
|
|
99
|
-
let t =
|
|
132
|
+
let t = ce(e);
|
|
100
133
|
for (; r <= i - a; a += r) this.process(t, a);
|
|
101
134
|
continue;
|
|
102
135
|
}
|
|
@@ -105,12 +138,12 @@ var ue = class {
|
|
|
105
138
|
return this.length += e.length, this.roundClean(), this;
|
|
106
139
|
}
|
|
107
140
|
digestInto(e) {
|
|
108
|
-
|
|
141
|
+
ae(this), oe(e, this), this.finished = !0;
|
|
109
142
|
let { buffer: t, view: n, blockLen: r, isLE: i } = this, { pos: a } = this;
|
|
110
|
-
t[a++] = 128,
|
|
143
|
+
t[a++] = 128, se(this.buffer.subarray(a)), this.padOffset > r - a && (this.process(n, 0), a = 0);
|
|
111
144
|
for (let e = a; e < r; e++) t[e] = 0;
|
|
112
145
|
n.setBigUint64(r - 8, BigInt(this.length * 8), i), this.process(n, 0);
|
|
113
|
-
let o =
|
|
146
|
+
let o = ce(e), s = this.outputLen;
|
|
114
147
|
if (s % 4) throw Error(`_sha2: outputLen must be aligned to 32bit`);
|
|
115
148
|
let c = s / 4, l = this.get();
|
|
116
149
|
if (c > l.length) throw Error(`_sha2: outputLen bigger than state`);
|
|
@@ -131,7 +164,7 @@ var ue = class {
|
|
|
131
164
|
return this._cloneInto();
|
|
132
165
|
}
|
|
133
166
|
};
|
|
134
|
-
const
|
|
167
|
+
const k = Uint32Array.from([
|
|
135
168
|
1779033703,
|
|
136
169
|
3144134277,
|
|
137
170
|
1013904242,
|
|
@@ -140,25 +173,25 @@ const j = Uint32Array.from([
|
|
|
140
173
|
2600822924,
|
|
141
174
|
528734635,
|
|
142
175
|
1541459225
|
|
143
|
-
]),
|
|
144
|
-
function
|
|
176
|
+
]), A = BigInt(2 ** 32 - 1), ve = BigInt(32);
|
|
177
|
+
function ye(e, t = !1) {
|
|
145
178
|
return t ? {
|
|
146
|
-
h: Number(e &
|
|
147
|
-
l: Number(e >>
|
|
179
|
+
h: Number(e & A),
|
|
180
|
+
l: Number(e >> ve & A)
|
|
148
181
|
} : {
|
|
149
|
-
h: Number(e >>
|
|
150
|
-
l: Number(e &
|
|
182
|
+
h: Number(e >> ve & A) | 0,
|
|
183
|
+
l: Number(e & A) | 0
|
|
151
184
|
};
|
|
152
185
|
}
|
|
153
|
-
function
|
|
186
|
+
function be(e, t = !1) {
|
|
154
187
|
let n = e.length, r = new Uint32Array(n), i = new Uint32Array(n);
|
|
155
188
|
for (let a = 0; a < n; a++) {
|
|
156
|
-
let { h: n, l: o } =
|
|
189
|
+
let { h: n, l: o } = ye(e[a], t);
|
|
157
190
|
[r[a], i[a]] = [n, o];
|
|
158
191
|
}
|
|
159
192
|
return [r, i];
|
|
160
193
|
}
|
|
161
|
-
const
|
|
194
|
+
const xe = Uint32Array.from([
|
|
162
195
|
1116352408,
|
|
163
196
|
1899447441,
|
|
164
197
|
3049323471,
|
|
@@ -223,8 +256,8 @@ const me = Uint32Array.from([
|
|
|
223
256
|
2756734187,
|
|
224
257
|
3204031479,
|
|
225
258
|
3329325298
|
|
226
|
-
]),
|
|
227
|
-
var
|
|
259
|
+
]), j = new Uint32Array(64);
|
|
260
|
+
var Se = class extends _e {
|
|
228
261
|
constructor(e) {
|
|
229
262
|
super(64, e, 8, !1);
|
|
230
263
|
}
|
|
@@ -245,41 +278,41 @@ var he = class extends ue {
|
|
|
245
278
|
this.A = e | 0, this.B = t | 0, this.C = n | 0, this.D = r | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H = s | 0;
|
|
246
279
|
}
|
|
247
280
|
process(e, t) {
|
|
248
|
-
for (let n = 0; n < 16; n++, t += 4)
|
|
281
|
+
for (let n = 0; n < 16; n++, t += 4) j[n] = e.getUint32(t, !1);
|
|
249
282
|
for (let e = 16; e < 64; e++) {
|
|
250
|
-
let t =
|
|
251
|
-
|
|
283
|
+
let t = j[e - 15], n = j[e - 2], r = O(t, 7) ^ O(t, 18) ^ t >>> 3;
|
|
284
|
+
j[e] = (O(n, 17) ^ O(n, 19) ^ n >>> 10) + j[e - 7] + r + j[e - 16] | 0;
|
|
252
285
|
}
|
|
253
286
|
let { A: n, B: r, C: i, D: a, E: o, F: s, G: c, H: l } = this;
|
|
254
287
|
for (let e = 0; e < 64; e++) {
|
|
255
|
-
let t =
|
|
288
|
+
let t = O(o, 6) ^ O(o, 11) ^ O(o, 25), u = l + t + he(o, s, c) + xe[e] + j[e] | 0, d = (O(n, 2) ^ O(n, 13) ^ O(n, 22)) + ge(n, r, i) | 0;
|
|
256
289
|
l = c, c = s, s = o, o = a + u | 0, a = i, i = r, r = n, n = u + d | 0;
|
|
257
290
|
}
|
|
258
291
|
n = n + this.A | 0, r = r + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, s = s + this.F | 0, c = c + this.G | 0, l = l + this.H | 0, this.set(n, r, i, a, o, s, c, l);
|
|
259
292
|
}
|
|
260
293
|
roundClean() {
|
|
261
|
-
|
|
294
|
+
se(j);
|
|
262
295
|
}
|
|
263
296
|
destroy() {
|
|
264
|
-
this.destroyed = !0, this.set(0, 0, 0, 0, 0, 0, 0, 0),
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
A =
|
|
268
|
-
B =
|
|
269
|
-
C =
|
|
270
|
-
D =
|
|
271
|
-
E =
|
|
272
|
-
F =
|
|
273
|
-
G =
|
|
274
|
-
H =
|
|
297
|
+
this.destroyed = !0, this.set(0, 0, 0, 0, 0, 0, 0, 0), se(this.buffer);
|
|
298
|
+
}
|
|
299
|
+
}, Ce = class extends Se {
|
|
300
|
+
A = k[0] | 0;
|
|
301
|
+
B = k[1] | 0;
|
|
302
|
+
C = k[2] | 0;
|
|
303
|
+
D = k[3] | 0;
|
|
304
|
+
E = k[4] | 0;
|
|
305
|
+
F = k[5] | 0;
|
|
306
|
+
G = k[6] | 0;
|
|
307
|
+
H = k[7] | 0;
|
|
275
308
|
constructor() {
|
|
276
309
|
super(32);
|
|
277
310
|
}
|
|
278
311
|
};
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
const
|
|
312
|
+
const we = be(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map((e) => BigInt(e)));
|
|
313
|
+
we[0], we[1];
|
|
314
|
+
pe(() => new Ce(), me(1));
|
|
315
|
+
const Ee = (e) => `generaltranslation Formatting Error: Invalid cutoff style: ${e}.`, De = `DEFAULT_TERMINATOR_KEY`, Oe = {
|
|
283
316
|
ellipsis: {
|
|
284
317
|
fr: {
|
|
285
318
|
terminator: `…`,
|
|
@@ -293,37 +326,35 @@ const ye = (e) => `generaltranslation Formatting Error: Invalid cutoff style: ${
|
|
|
293
326
|
terminator: `……`,
|
|
294
327
|
separator: void 0
|
|
295
328
|
},
|
|
296
|
-
[
|
|
329
|
+
[De]: {
|
|
297
330
|
terminator: `…`,
|
|
298
331
|
separator: void 0
|
|
299
332
|
}
|
|
300
333
|
},
|
|
301
|
-
none: { [
|
|
334
|
+
none: { [De]: {
|
|
302
335
|
terminator: void 0,
|
|
303
336
|
separator: void 0
|
|
304
337
|
} }
|
|
305
338
|
};
|
|
306
|
-
var
|
|
307
|
-
|
|
339
|
+
var ke = class e {
|
|
340
|
+
static resolveLocale(e) {
|
|
308
341
|
try {
|
|
309
|
-
let t = e ? Array.isArray(e) ? e.map(
|
|
310
|
-
|
|
342
|
+
let t = e ? Array.isArray(e) ? e.map(String) : [String(e)] : [`en`], [n] = Intl.getCanonicalLocales(t);
|
|
343
|
+
return n ?? `en`;
|
|
311
344
|
} catch {
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
if (!xe[t.style ?? `ellipsis`]) throw Error(ye(t.style ?? `ellipsis`));
|
|
315
|
-
let n, r;
|
|
316
|
-
if (t.maxChars !== void 0) {
|
|
317
|
-
n = t.style ?? `ellipsis`;
|
|
318
|
-
let e = new Intl.Locale(this.locale).language;
|
|
319
|
-
r = xe[n][e] || xe[n].DEFAULT_TERMINATOR_KEY;
|
|
345
|
+
return `en`;
|
|
320
346
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
347
|
+
}
|
|
348
|
+
constructor(t, n = {}) {
|
|
349
|
+
this.locale = e.resolveLocale(t);
|
|
350
|
+
let r = n.style ?? `ellipsis`;
|
|
351
|
+
if (!Oe[r]) throw Error(Ee(r));
|
|
352
|
+
let i = n.maxChars === void 0 ? void 0 : Oe[r][new Intl.Locale(this.locale).language] || Oe[r].DEFAULT_TERMINATOR_KEY, a = n.terminator ?? i?.terminator, o = a == null ? void 0 : n.separator ?? i?.separator;
|
|
353
|
+
this.additionLength = (a?.length ?? 0) + (o?.length ?? 0), n.maxChars !== void 0 && Math.abs(n.maxChars) < this.additionLength && (a = void 0, o = void 0), this.options = {
|
|
354
|
+
maxChars: n.maxChars,
|
|
355
|
+
style: n.maxChars === void 0 ? void 0 : r,
|
|
356
|
+
terminator: a,
|
|
357
|
+
separator: o
|
|
327
358
|
};
|
|
328
359
|
}
|
|
329
360
|
format(e) {
|
|
@@ -345,7 +376,7 @@ var Se = class {
|
|
|
345
376
|
return this.options;
|
|
346
377
|
}
|
|
347
378
|
};
|
|
348
|
-
const
|
|
379
|
+
const Ae = {
|
|
349
380
|
Collator: Intl.Collator,
|
|
350
381
|
DateTimeFormat: Intl.DateTimeFormat,
|
|
351
382
|
DisplayNames: Intl.DisplayNames,
|
|
@@ -355,81 +386,83 @@ const Ce = {
|
|
|
355
386
|
PluralRules: Intl.PluralRules,
|
|
356
387
|
RelativeTimeFormat: Intl.RelativeTimeFormat,
|
|
357
388
|
Segmenter: Intl.Segmenter,
|
|
358
|
-
CutoffFormat:
|
|
389
|
+
CutoffFormat: ke
|
|
359
390
|
};
|
|
360
391
|
new class {
|
|
361
392
|
constructor() {
|
|
362
393
|
this.cache = {};
|
|
363
394
|
}
|
|
364
|
-
|
|
395
|
+
generateKey(e, t = {}) {
|
|
365
396
|
return `${e ? Array.isArray(e) ? e.map((e) => String(e)).join(`,`) : String(e) : `undefined`}:${t ? JSON.stringify(t, Object.keys(t).sort()) : `{}`}`;
|
|
366
397
|
}
|
|
367
398
|
get(e, ...t) {
|
|
368
|
-
let [n = `en`, r = {}] = t, i = this.
|
|
369
|
-
|
|
399
|
+
let [n = `en`, r = {}] = t, i = this.generateKey(n, r), a = this.cache[e];
|
|
400
|
+
a === void 0 && (a = {}, this.cache[e] = a);
|
|
401
|
+
let o = a[i];
|
|
402
|
+
return o === void 0 && (o = new Ae[e](...t), a[i] = o), o;
|
|
370
403
|
}
|
|
371
404
|
}();
|
|
372
|
-
var
|
|
373
|
-
__addDisposableResource: () =>
|
|
374
|
-
__assign: () =>
|
|
375
|
-
__asyncDelegator: () =>
|
|
376
|
-
__asyncGenerator: () =>
|
|
377
|
-
__asyncValues: () =>
|
|
378
|
-
__await: () =>
|
|
379
|
-
__awaiter: () =>
|
|
380
|
-
__classPrivateFieldGet: () =>
|
|
381
|
-
__classPrivateFieldIn: () =>
|
|
382
|
-
__classPrivateFieldSet: () =>
|
|
383
|
-
__createBinding: () =>
|
|
384
|
-
__decorate: () =>
|
|
385
|
-
__disposeResources: () =>
|
|
386
|
-
__esDecorate: () =>
|
|
387
|
-
__exportStar: () =>
|
|
388
|
-
__extends: () =>
|
|
389
|
-
__generator: () =>
|
|
390
|
-
__importDefault: () =>
|
|
391
|
-
__importStar: () =>
|
|
392
|
-
__makeTemplateObject: () =>
|
|
393
|
-
__metadata: () =>
|
|
394
|
-
__param: () =>
|
|
395
|
-
__propKey: () =>
|
|
396
|
-
__read: () =>
|
|
397
|
-
__rest: () =>
|
|
398
|
-
__rewriteRelativeImportExtension: () =>
|
|
399
|
-
__runInitializers: () =>
|
|
400
|
-
__setFunctionName: () =>
|
|
401
|
-
__spread: () =>
|
|
402
|
-
__spreadArray: () =>
|
|
403
|
-
__spreadArrays: () =>
|
|
404
|
-
__values: () =>
|
|
405
|
-
default: () =>
|
|
405
|
+
var M = m({
|
|
406
|
+
__addDisposableResource: () => it,
|
|
407
|
+
__assign: () => F,
|
|
408
|
+
__asyncDelegator: () => Xe,
|
|
409
|
+
__asyncGenerator: () => Ye,
|
|
410
|
+
__asyncValues: () => Ze,
|
|
411
|
+
__await: () => P,
|
|
412
|
+
__awaiter: () => He,
|
|
413
|
+
__classPrivateFieldGet: () => tt,
|
|
414
|
+
__classPrivateFieldIn: () => rt,
|
|
415
|
+
__classPrivateFieldSet: () => nt,
|
|
416
|
+
__createBinding: () => I,
|
|
417
|
+
__decorate: () => Fe,
|
|
418
|
+
__disposeResources: () => at,
|
|
419
|
+
__esDecorate: () => Le,
|
|
420
|
+
__exportStar: () => We,
|
|
421
|
+
__extends: () => Ne,
|
|
422
|
+
__generator: () => Ue,
|
|
423
|
+
__importDefault: () => et,
|
|
424
|
+
__importStar: () => $e,
|
|
425
|
+
__makeTemplateObject: () => Qe,
|
|
426
|
+
__metadata: () => Ve,
|
|
427
|
+
__param: () => Ie,
|
|
428
|
+
__propKey: () => ze,
|
|
429
|
+
__read: () => Ge,
|
|
430
|
+
__rest: () => Pe,
|
|
431
|
+
__rewriteRelativeImportExtension: () => ot,
|
|
432
|
+
__runInitializers: () => Re,
|
|
433
|
+
__setFunctionName: () => Be,
|
|
434
|
+
__spread: () => Ke,
|
|
435
|
+
__spreadArray: () => Je,
|
|
436
|
+
__spreadArrays: () => qe,
|
|
437
|
+
__values: () => N,
|
|
438
|
+
default: () => ut
|
|
406
439
|
});
|
|
407
|
-
function
|
|
440
|
+
function Ne(e, t) {
|
|
408
441
|
if (typeof t != `function` && t !== null) throw TypeError(`Class extends value ` + String(t) + ` is not a constructor or null`);
|
|
409
|
-
|
|
442
|
+
st(e, t);
|
|
410
443
|
function n() {
|
|
411
444
|
this.constructor = e;
|
|
412
445
|
}
|
|
413
446
|
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
414
447
|
}
|
|
415
|
-
function
|
|
448
|
+
function Pe(e, t) {
|
|
416
449
|
var n = {};
|
|
417
450
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
418
451
|
if (e != null && typeof Object.getOwnPropertySymbols == `function`) for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
419
452
|
return n;
|
|
420
453
|
}
|
|
421
|
-
function
|
|
454
|
+
function Fe(e, t, n, r) {
|
|
422
455
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
423
456
|
if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a = Reflect.decorate(e, t, n, r);
|
|
424
457
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
425
458
|
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
426
459
|
}
|
|
427
|
-
function
|
|
460
|
+
function Ie(e, t) {
|
|
428
461
|
return function(n, r) {
|
|
429
462
|
t(n, r, e);
|
|
430
463
|
};
|
|
431
464
|
}
|
|
432
|
-
function
|
|
465
|
+
function Le(e, t, n, r, i, a) {
|
|
433
466
|
function o(e) {
|
|
434
467
|
if (e !== void 0 && typeof e != `function`) throw TypeError(`Function expected`);
|
|
435
468
|
return e;
|
|
@@ -454,23 +487,23 @@ function Ae(e, t, n, r, i, a) {
|
|
|
454
487
|
}
|
|
455
488
|
l && Object.defineProperty(l, r.name, u), f = !0;
|
|
456
489
|
}
|
|
457
|
-
function
|
|
490
|
+
function Re(e, t, n) {
|
|
458
491
|
for (var r = arguments.length > 2, i = 0; i < t.length; i++) n = r ? t[i].call(e, n) : t[i].call(e);
|
|
459
492
|
return r ? n : void 0;
|
|
460
493
|
}
|
|
461
|
-
function
|
|
494
|
+
function ze(e) {
|
|
462
495
|
return typeof e == `symbol` ? e : `${e}`;
|
|
463
496
|
}
|
|
464
|
-
function
|
|
497
|
+
function Be(e, t, n) {
|
|
465
498
|
return typeof t == `symbol` && (t = t.description ? `[${t.description}]` : ``), Object.defineProperty(e, `name`, {
|
|
466
499
|
configurable: !0,
|
|
467
500
|
value: n ? `${n} ${t}` : t
|
|
468
501
|
});
|
|
469
502
|
}
|
|
470
|
-
function
|
|
503
|
+
function Ve(e, t) {
|
|
471
504
|
if (typeof Reflect == `object` && typeof Reflect.metadata == `function`) return Reflect.metadata(e, t);
|
|
472
505
|
}
|
|
473
|
-
function
|
|
506
|
+
function He(e, t, n, r) {
|
|
474
507
|
function i(e) {
|
|
475
508
|
return e instanceof n ? e : new n(function(t) {
|
|
476
509
|
t(e);
|
|
@@ -497,7 +530,7 @@ function Fe(e, t, n, r) {
|
|
|
497
530
|
c((r = r.apply(e, t || [])).next());
|
|
498
531
|
});
|
|
499
532
|
}
|
|
500
|
-
function
|
|
533
|
+
function Ue(e, t) {
|
|
501
534
|
var n = {
|
|
502
535
|
label: 0,
|
|
503
536
|
sent: function() {
|
|
@@ -567,10 +600,10 @@ function Ie(e, t) {
|
|
|
567
600
|
};
|
|
568
601
|
}
|
|
569
602
|
}
|
|
570
|
-
function
|
|
571
|
-
for (var n in e) n !== `default` && !Object.prototype.hasOwnProperty.call(t, n) &&
|
|
603
|
+
function We(e, t) {
|
|
604
|
+
for (var n in e) n !== `default` && !Object.prototype.hasOwnProperty.call(t, n) && I(t, e, n);
|
|
572
605
|
}
|
|
573
|
-
function
|
|
606
|
+
function N(e) {
|
|
574
607
|
var t = typeof Symbol == `function` && Symbol.iterator, n = t && e[t], r = 0;
|
|
575
608
|
if (n) return n.call(e);
|
|
576
609
|
if (e && typeof e.length == `number`) return { next: function() {
|
|
@@ -581,7 +614,7 @@ function F(e) {
|
|
|
581
614
|
} };
|
|
582
615
|
throw TypeError(t ? `Object is not iterable.` : `Symbol.iterator is not defined.`);
|
|
583
616
|
}
|
|
584
|
-
function
|
|
617
|
+
function Ge(e, t) {
|
|
585
618
|
var n = typeof Symbol == `function` && e[Symbol.iterator];
|
|
586
619
|
if (!n) return e;
|
|
587
620
|
var r = n.call(e), i, a = [], o;
|
|
@@ -598,23 +631,23 @@ function Re(e, t) {
|
|
|
598
631
|
}
|
|
599
632
|
return a;
|
|
600
633
|
}
|
|
601
|
-
function
|
|
602
|
-
for (var e = [], t = 0; t < arguments.length; t++) e = e.concat(
|
|
634
|
+
function Ke() {
|
|
635
|
+
for (var e = [], t = 0; t < arguments.length; t++) e = e.concat(Ge(arguments[t]));
|
|
603
636
|
return e;
|
|
604
637
|
}
|
|
605
|
-
function
|
|
638
|
+
function qe() {
|
|
606
639
|
for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
|
|
607
640
|
for (var r = Array(e), i = 0, t = 0; t < n; t++) for (var a = arguments[t], o = 0, s = a.length; o < s; o++, i++) r[i] = a[o];
|
|
608
641
|
return r;
|
|
609
642
|
}
|
|
610
|
-
function
|
|
643
|
+
function Je(e, t, n) {
|
|
611
644
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
612
645
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
613
646
|
}
|
|
614
|
-
function
|
|
615
|
-
return this instanceof
|
|
647
|
+
function P(e) {
|
|
648
|
+
return this instanceof P ? (this.v = e, this) : new P(e);
|
|
616
649
|
}
|
|
617
|
-
function
|
|
650
|
+
function Ye(e, t, n) {
|
|
618
651
|
if (!Symbol.asyncIterator) throw TypeError(`Symbol.asyncIterator is not defined.`);
|
|
619
652
|
var r = n.apply(e, t || []), i, a = [];
|
|
620
653
|
return i = Object.create((typeof AsyncIterator == `function` ? AsyncIterator : Object).prototype), s(`next`), s(`throw`), s(`return`, o), i[Symbol.asyncIterator] = function() {
|
|
@@ -645,7 +678,7 @@ function He(e, t, n) {
|
|
|
645
678
|
}
|
|
646
679
|
}
|
|
647
680
|
function l(e) {
|
|
648
|
-
e.value instanceof
|
|
681
|
+
e.value instanceof P ? Promise.resolve(e.value.v).then(u, d) : f(a[0][2], e);
|
|
649
682
|
}
|
|
650
683
|
function u(e) {
|
|
651
684
|
c(`next`, e);
|
|
@@ -657,7 +690,7 @@ function He(e, t, n) {
|
|
|
657
690
|
e(t), a.shift(), a.length && c(a[0][0], a[0][1]);
|
|
658
691
|
}
|
|
659
692
|
}
|
|
660
|
-
function
|
|
693
|
+
function Xe(e) {
|
|
661
694
|
var t, n;
|
|
662
695
|
return t = {}, r(`next`), r(`throw`, function(e) {
|
|
663
696
|
throw e;
|
|
@@ -667,16 +700,16 @@ function Ue(e) {
|
|
|
667
700
|
function r(r, i) {
|
|
668
701
|
t[r] = e[r] ? function(t) {
|
|
669
702
|
return (n = !n) ? {
|
|
670
|
-
value:
|
|
703
|
+
value: P(e[r](t)),
|
|
671
704
|
done: !1
|
|
672
705
|
} : i ? i(t) : t;
|
|
673
706
|
} : i;
|
|
674
707
|
}
|
|
675
708
|
}
|
|
676
|
-
function
|
|
709
|
+
function Ze(e) {
|
|
677
710
|
if (!Symbol.asyncIterator) throw TypeError(`Symbol.asyncIterator is not defined.`);
|
|
678
711
|
var t = e[Symbol.asyncIterator], n;
|
|
679
|
-
return t ? t.call(e) : (e = typeof
|
|
712
|
+
return t ? t.call(e) : (e = typeof N == `function` ? N(e) : e[Symbol.iterator](), n = {}, r(`next`), r(`throw`), r(`return`), n[Symbol.asyncIterator] = function() {
|
|
680
713
|
return this;
|
|
681
714
|
}, n);
|
|
682
715
|
function r(t) {
|
|
@@ -695,34 +728,34 @@ function We(e) {
|
|
|
695
728
|
}, t);
|
|
696
729
|
}
|
|
697
730
|
}
|
|
698
|
-
function
|
|
731
|
+
function Qe(e, t) {
|
|
699
732
|
return Object.defineProperty ? Object.defineProperty(e, `raw`, { value: t }) : e.raw = t, e;
|
|
700
733
|
}
|
|
701
|
-
function
|
|
734
|
+
function $e(e) {
|
|
702
735
|
if (e && e.__esModule) return e;
|
|
703
736
|
var t = {};
|
|
704
|
-
if (e != null) for (var n =
|
|
705
|
-
return
|
|
737
|
+
if (e != null) for (var n = L(e), r = 0; r < n.length; r++) n[r] !== `default` && I(t, e, n[r]);
|
|
738
|
+
return ct(t, e), t;
|
|
706
739
|
}
|
|
707
|
-
function
|
|
740
|
+
function et(e) {
|
|
708
741
|
return e && e.__esModule ? e : { default: e };
|
|
709
742
|
}
|
|
710
|
-
function
|
|
743
|
+
function tt(e, t, n, r) {
|
|
711
744
|
if (n === `a` && !r) throw TypeError(`Private accessor was defined without a getter`);
|
|
712
745
|
if (typeof t == `function` ? e !== t || !r : !t.has(e)) throw TypeError(`Cannot read private member from an object whose class did not declare it`);
|
|
713
746
|
return n === `m` ? r : n === `a` ? r.call(e) : r ? r.value : t.get(e);
|
|
714
747
|
}
|
|
715
|
-
function
|
|
748
|
+
function nt(e, t, n, r, i) {
|
|
716
749
|
if (r === `m`) throw TypeError(`Private method is not writable`);
|
|
717
750
|
if (r === `a` && !i) throw TypeError(`Private accessor was defined without a setter`);
|
|
718
751
|
if (typeof t == `function` ? e !== t || !i : !t.has(e)) throw TypeError(`Cannot write private member to an object whose class did not declare it`);
|
|
719
752
|
return r === `a` ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
|
|
720
753
|
}
|
|
721
|
-
function
|
|
754
|
+
function rt(e, t) {
|
|
722
755
|
if (t === null || typeof t != `object` && typeof t != `function`) throw TypeError(`Cannot use 'in' operator on non-object`);
|
|
723
756
|
return typeof e == `function` ? t === e : e.has(t);
|
|
724
757
|
}
|
|
725
|
-
function
|
|
758
|
+
function it(e, t, n) {
|
|
726
759
|
if (t != null) {
|
|
727
760
|
if (typeof t != `object` && typeof t != `function`) throw TypeError(`Object expected.`);
|
|
728
761
|
var r, i;
|
|
@@ -749,9 +782,9 @@ function Ze(e, t, n) {
|
|
|
749
782
|
} else n && e.stack.push({ async: !0 });
|
|
750
783
|
return t;
|
|
751
784
|
}
|
|
752
|
-
function
|
|
785
|
+
function at(e) {
|
|
753
786
|
function t(t) {
|
|
754
|
-
e.error = e.hasError ? new
|
|
787
|
+
e.error = e.hasError ? new lt(t, e.error, `An error was suppressed during disposal.`) : t, e.hasError = !0;
|
|
755
788
|
}
|
|
756
789
|
var n, r = 0;
|
|
757
790
|
function i() {
|
|
@@ -771,24 +804,24 @@ function Qe(e) {
|
|
|
771
804
|
}
|
|
772
805
|
return i();
|
|
773
806
|
}
|
|
774
|
-
function
|
|
807
|
+
function ot(e, t) {
|
|
775
808
|
return typeof e == `string` && /^\.\.?\//.test(e) ? e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(e, n, r, i, a) {
|
|
776
809
|
return n ? t ? `.jsx` : `.js` : r && (!i || !a) ? e : r + i + `.` + a.toLowerCase() + `js`;
|
|
777
810
|
}) : e;
|
|
778
811
|
}
|
|
779
|
-
var
|
|
780
|
-
|
|
781
|
-
return
|
|
812
|
+
var st, F, I, ct, L, lt, ut, R = f((() => {
|
|
813
|
+
st = function(e, t) {
|
|
814
|
+
return st = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
|
|
782
815
|
e.__proto__ = t;
|
|
783
816
|
} || function(e, t) {
|
|
784
817
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
785
|
-
},
|
|
786
|
-
},
|
|
787
|
-
return
|
|
818
|
+
}, st(e, t);
|
|
819
|
+
}, F = function() {
|
|
820
|
+
return F = Object.assign || function(e) {
|
|
788
821
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
789
822
|
return e;
|
|
790
|
-
},
|
|
791
|
-
},
|
|
823
|
+
}, F.apply(this, arguments);
|
|
824
|
+
}, I = Object.create ? (function(e, t, n, r) {
|
|
792
825
|
r === void 0 && (r = n);
|
|
793
826
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
794
827
|
(!i || (`get` in i ? !t.__esModule : i.writable || i.configurable)) && (i = {
|
|
@@ -799,63 +832,63 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
799
832
|
}), Object.defineProperty(e, r, i);
|
|
800
833
|
}) : (function(e, t, n, r) {
|
|
801
834
|
r === void 0 && (r = n), e[r] = t[n];
|
|
802
|
-
}),
|
|
835
|
+
}), ct = Object.create ? (function(e, t) {
|
|
803
836
|
Object.defineProperty(e, `default`, {
|
|
804
837
|
enumerable: !0,
|
|
805
838
|
value: t
|
|
806
839
|
});
|
|
807
840
|
}) : function(e, t) {
|
|
808
841
|
e.default = t;
|
|
809
|
-
},
|
|
810
|
-
return
|
|
842
|
+
}, L = function(e) {
|
|
843
|
+
return L = Object.getOwnPropertyNames || function(e) {
|
|
811
844
|
var t = [];
|
|
812
845
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[t.length] = n);
|
|
813
846
|
return t;
|
|
814
|
-
},
|
|
815
|
-
},
|
|
847
|
+
}, L(e);
|
|
848
|
+
}, lt = typeof SuppressedError == `function` ? SuppressedError : function(e, t, n) {
|
|
816
849
|
var r = Error(n);
|
|
817
850
|
return r.name = `SuppressedError`, r.error = e, r.suppressed = t, r;
|
|
818
|
-
},
|
|
819
|
-
__extends:
|
|
820
|
-
__assign:
|
|
821
|
-
__rest:
|
|
822
|
-
__decorate:
|
|
823
|
-
__param:
|
|
824
|
-
__esDecorate:
|
|
825
|
-
__runInitializers:
|
|
826
|
-
__propKey:
|
|
827
|
-
__setFunctionName:
|
|
828
|
-
__metadata:
|
|
829
|
-
__awaiter:
|
|
830
|
-
__generator:
|
|
831
|
-
__createBinding:
|
|
832
|
-
__exportStar:
|
|
833
|
-
__values:
|
|
834
|
-
__read:
|
|
835
|
-
__spread:
|
|
836
|
-
__spreadArrays:
|
|
837
|
-
__spreadArray:
|
|
838
|
-
__await:
|
|
839
|
-
__asyncGenerator:
|
|
840
|
-
__asyncDelegator:
|
|
841
|
-
__asyncValues:
|
|
842
|
-
__makeTemplateObject:
|
|
843
|
-
__importStar:
|
|
844
|
-
__importDefault:
|
|
845
|
-
__classPrivateFieldGet:
|
|
846
|
-
__classPrivateFieldSet:
|
|
847
|
-
__classPrivateFieldIn:
|
|
848
|
-
__addDisposableResource:
|
|
849
|
-
__disposeResources:
|
|
850
|
-
__rewriteRelativeImportExtension:
|
|
851
|
+
}, ut = {
|
|
852
|
+
__extends: Ne,
|
|
853
|
+
__assign: F,
|
|
854
|
+
__rest: Pe,
|
|
855
|
+
__decorate: Fe,
|
|
856
|
+
__param: Ie,
|
|
857
|
+
__esDecorate: Le,
|
|
858
|
+
__runInitializers: Re,
|
|
859
|
+
__propKey: ze,
|
|
860
|
+
__setFunctionName: Be,
|
|
861
|
+
__metadata: Ve,
|
|
862
|
+
__awaiter: He,
|
|
863
|
+
__generator: Ue,
|
|
864
|
+
__createBinding: I,
|
|
865
|
+
__exportStar: We,
|
|
866
|
+
__values: N,
|
|
867
|
+
__read: Ge,
|
|
868
|
+
__spread: Ke,
|
|
869
|
+
__spreadArrays: qe,
|
|
870
|
+
__spreadArray: Je,
|
|
871
|
+
__await: P,
|
|
872
|
+
__asyncGenerator: Ye,
|
|
873
|
+
__asyncDelegator: Xe,
|
|
874
|
+
__asyncValues: Ze,
|
|
875
|
+
__makeTemplateObject: Qe,
|
|
876
|
+
__importStar: $e,
|
|
877
|
+
__importDefault: et,
|
|
878
|
+
__classPrivateFieldGet: tt,
|
|
879
|
+
__classPrivateFieldSet: nt,
|
|
880
|
+
__classPrivateFieldIn: rt,
|
|
881
|
+
__addDisposableResource: it,
|
|
882
|
+
__disposeResources: at,
|
|
883
|
+
__rewriteRelativeImportExtension: ot
|
|
851
884
|
};
|
|
852
|
-
})),
|
|
885
|
+
})), dt = p(((e) => {
|
|
853
886
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.ErrorKind = void 0;
|
|
854
887
|
var t;
|
|
855
888
|
(function(e) {
|
|
856
889
|
e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = `EXPECT_ARGUMENT_CLOSING_BRACE`, e[e.EMPTY_ARGUMENT = 2] = `EMPTY_ARGUMENT`, e[e.MALFORMED_ARGUMENT = 3] = `MALFORMED_ARGUMENT`, e[e.EXPECT_ARGUMENT_TYPE = 4] = `EXPECT_ARGUMENT_TYPE`, e[e.INVALID_ARGUMENT_TYPE = 5] = `INVALID_ARGUMENT_TYPE`, e[e.EXPECT_ARGUMENT_STYLE = 6] = `EXPECT_ARGUMENT_STYLE`, e[e.INVALID_NUMBER_SKELETON = 7] = `INVALID_NUMBER_SKELETON`, e[e.INVALID_DATE_TIME_SKELETON = 8] = `INVALID_DATE_TIME_SKELETON`, e[e.EXPECT_NUMBER_SKELETON = 9] = `EXPECT_NUMBER_SKELETON`, e[e.EXPECT_DATE_TIME_SKELETON = 10] = `EXPECT_DATE_TIME_SKELETON`, e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = `UNCLOSED_QUOTE_IN_ARGUMENT_STYLE`, e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = `EXPECT_SELECT_ARGUMENT_OPTIONS`, e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = `EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE`, e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = `INVALID_PLURAL_ARGUMENT_OFFSET_VALUE`, e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = `EXPECT_SELECT_ARGUMENT_SELECTOR`, e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = `EXPECT_PLURAL_ARGUMENT_SELECTOR`, e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = `EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT`, e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = `EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT`, e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = `INVALID_PLURAL_ARGUMENT_SELECTOR`, e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = `DUPLICATE_PLURAL_ARGUMENT_SELECTOR`, e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = `DUPLICATE_SELECT_ARGUMENT_SELECTOR`, e[e.MISSING_OTHER_CLAUSE = 22] = `MISSING_OTHER_CLAUSE`, e[e.INVALID_TAG = 23] = `INVALID_TAG`, e[e.INVALID_TAG_NAME = 25] = `INVALID_TAG_NAME`, e[e.UNMATCHED_CLOSING_TAG = 26] = `UNMATCHED_CLOSING_TAG`, e[e.UNCLOSED_TAG = 27] = `UNCLOSED_TAG`;
|
|
857
890
|
})(t || (e.ErrorKind = t = {}));
|
|
858
|
-
})),
|
|
891
|
+
})), z = p(((e) => {
|
|
859
892
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.SKELETON_TYPE = e.TYPE = void 0, e.isLiteralElement = r, e.isArgumentElement = i, e.isNumberElement = a, e.isDateElement = o, e.isTimeElement = s, e.isSelectElement = c, e.isPluralElement = l, e.isPoundElement = u, e.isTagElement = d, e.isNumberSkeleton = f, e.isDateTimeSkeleton = p, e.createLiteralElement = m, e.createNumberElement = h;
|
|
860
893
|
var t;
|
|
861
894
|
(function(e) {
|
|
@@ -911,9 +944,9 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
911
944
|
style: n
|
|
912
945
|
};
|
|
913
946
|
}
|
|
914
|
-
})),
|
|
947
|
+
})), ft = p(((e) => {
|
|
915
948
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.WHITE_SPACE_REGEX = e.SPACE_SEPARATOR_REGEX = void 0, e.SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, e.WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/;
|
|
916
|
-
})),
|
|
949
|
+
})), pt = p(((e) => {
|
|
917
950
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.parseDateTimeSkeleton = n;
|
|
918
951
|
var t = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
919
952
|
function n(e) {
|
|
@@ -1013,11 +1046,11 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
1013
1046
|
return ``;
|
|
1014
1047
|
}), n;
|
|
1015
1048
|
}
|
|
1016
|
-
})),
|
|
1049
|
+
})), mt = p(((e) => {
|
|
1017
1050
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.WHITE_SPACE_REGEX = void 0, e.WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
1018
|
-
})),
|
|
1051
|
+
})), ht = p(((e) => {
|
|
1019
1052
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.parseNumberSkeletonFromString = r, e.parseNumberSkeleton = p;
|
|
1020
|
-
var t = (
|
|
1053
|
+
var t = (R(), g(M)), n = mt();
|
|
1021
1054
|
function r(e) {
|
|
1022
1055
|
if (e.length === 0) throw Error(`Number skeleton cannot be empty`);
|
|
1023
1056
|
for (var t = e.split(n.WHITE_SPACE_REGEX).filter(function(e) {
|
|
@@ -1195,11 +1228,11 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
1195
1228
|
}
|
|
1196
1229
|
return n;
|
|
1197
1230
|
}
|
|
1198
|
-
})),
|
|
1231
|
+
})), gt = p(((e) => {
|
|
1199
1232
|
Object.defineProperty(e, `__esModule`, { value: !0 });
|
|
1200
|
-
var t = (
|
|
1201
|
-
t.__exportStar(
|
|
1202
|
-
})),
|
|
1233
|
+
var t = (R(), g(M));
|
|
1234
|
+
t.__exportStar(pt(), e), t.__exportStar(ht(), e);
|
|
1235
|
+
})), _t = p(((e) => {
|
|
1203
1236
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.timeData = void 0, e.timeData = {
|
|
1204
1237
|
"001": [`H`, `h`],
|
|
1205
1238
|
419: [
|
|
@@ -2356,9 +2389,9 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2356
2389
|
`h`
|
|
2357
2390
|
]
|
|
2358
2391
|
};
|
|
2359
|
-
})),
|
|
2392
|
+
})), vt = p(((e) => {
|
|
2360
2393
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.getBestPattern = n;
|
|
2361
|
-
var t =
|
|
2394
|
+
var t = _t();
|
|
2362
2395
|
function n(e, t) {
|
|
2363
2396
|
for (var n = ``, i = 0; i < e.length; i++) {
|
|
2364
2397
|
var a = e.charAt(i);
|
|
@@ -2383,9 +2416,9 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2383
2416
|
var r = e.language, i;
|
|
2384
2417
|
return r !== `root` && (i = e.maximize().region), (t.timeData[i || ``] || t.timeData[r || ``] || t.timeData[`${r}-001`] || t.timeData[`001`])[0];
|
|
2385
2418
|
}
|
|
2386
|
-
})),
|
|
2419
|
+
})), yt = p(((e) => {
|
|
2387
2420
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.Parser = void 0;
|
|
2388
|
-
var t = (
|
|
2421
|
+
var t = (R(), g(M)), n = dt(), r = z(), i = ft(), a = gt(), o = vt(), s = RegExp(`^${i.SPACE_SEPARATOR_REGEX.source}*`), c = RegExp(`${i.SPACE_SEPARATOR_REGEX.source}*\$`);
|
|
2389
2422
|
function l(e, t) {
|
|
2390
2423
|
return {
|
|
2391
2424
|
start: e,
|
|
@@ -2396,21 +2429,21 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2396
2429
|
return typeof e == `number` && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
|
|
2397
2430
|
}, v = !0;
|
|
2398
2431
|
try {
|
|
2399
|
-
v =
|
|
2432
|
+
v = S(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`).exec(`a`)?.[0] === `a`;
|
|
2400
2433
|
} catch {
|
|
2401
2434
|
v = !1;
|
|
2402
2435
|
}
|
|
2403
|
-
var
|
|
2436
|
+
var ee = u ? function(e, t, n) {
|
|
2404
2437
|
return e.startsWith(t, n);
|
|
2405
2438
|
} : function(e, t, n) {
|
|
2406
2439
|
return e.slice(n, n + t.length) === t;
|
|
2407
|
-
},
|
|
2440
|
+
}, y = d ? String.fromCodePoint : function() {
|
|
2408
2441
|
for (var e = [...arguments], t = ``, n = e.length, r = 0, i; n > r;) {
|
|
2409
2442
|
if (i = e[r++], i > 1114111) throw RangeError(i + ` is not a valid code point`);
|
|
2410
2443
|
t += i < 65536 ? String.fromCharCode(i) : String.fromCharCode(((i -= 65536) >> 10) + 55296, i % 1024 + 56320);
|
|
2411
2444
|
}
|
|
2412
2445
|
return t;
|
|
2413
|
-
},
|
|
2446
|
+
}, b = f ? Object.fromEntries : function(e) {
|
|
2414
2447
|
for (var t = {}, n = 0, r = e; n < r.length; n++) {
|
|
2415
2448
|
var i = r[n], a = i[0];
|
|
2416
2449
|
t[a] = i[1];
|
|
@@ -2424,31 +2457,31 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2424
2457
|
var r = e.charCodeAt(t), i;
|
|
2425
2458
|
return r < 55296 || r > 56319 || t + 1 === n || (i = e.charCodeAt(t + 1)) < 56320 || i > 57343 ? r : (r - 55296 << 10) + (i - 56320) + 65536;
|
|
2426
2459
|
}
|
|
2427
|
-
},
|
|
2460
|
+
}, te = m ? function(e) {
|
|
2428
2461
|
return e.trimStart();
|
|
2429
2462
|
} : function(e) {
|
|
2430
2463
|
return e.replace(s, ``);
|
|
2431
|
-
},
|
|
2464
|
+
}, ne = h ? function(e) {
|
|
2432
2465
|
return e.trimEnd();
|
|
2433
2466
|
} : function(e) {
|
|
2434
2467
|
return e.replace(c, ``);
|
|
2435
2468
|
};
|
|
2436
|
-
function
|
|
2469
|
+
function S(e, t) {
|
|
2437
2470
|
return new RegExp(e, t);
|
|
2438
2471
|
}
|
|
2439
|
-
var
|
|
2472
|
+
var C;
|
|
2440
2473
|
if (v) {
|
|
2441
|
-
var
|
|
2442
|
-
|
|
2443
|
-
return
|
|
2474
|
+
var w = S(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
|
|
2475
|
+
C = function(e, t) {
|
|
2476
|
+
return w.lastIndex = t, w.exec(e)[1] ?? ``;
|
|
2444
2477
|
};
|
|
2445
|
-
} else
|
|
2478
|
+
} else C = function(e, t) {
|
|
2446
2479
|
for (var n = [];;) {
|
|
2447
2480
|
var r = x(e, t);
|
|
2448
|
-
if (r === void 0 ||
|
|
2481
|
+
if (r === void 0 || ie(r) || D(r)) break;
|
|
2449
2482
|
n.push(r), t += r >= 65536 ? 2 : 1;
|
|
2450
2483
|
}
|
|
2451
|
-
return
|
|
2484
|
+
return y.apply(void 0, n);
|
|
2452
2485
|
};
|
|
2453
2486
|
e.Parser = function() {
|
|
2454
2487
|
function e(e, t) {
|
|
@@ -2478,7 +2511,7 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2478
2511
|
} else if (o === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2479
2512
|
if (i) break;
|
|
2480
2513
|
return this.error(n.ErrorKind.UNMATCHED_CLOSING_TAG, l(this.clonePosition(), this.clonePosition()));
|
|
2481
|
-
} else if (o === 60 && !this.ignoreTag &&
|
|
2514
|
+
} else if (o === 60 && !this.ignoreTag && T(this.peek() || 0)) {
|
|
2482
2515
|
var s = this.parseTag(e, t);
|
|
2483
2516
|
if (s.err) return s;
|
|
2484
2517
|
a.push(s.val);
|
|
@@ -2509,7 +2542,7 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2509
2542
|
if (o.err) return o;
|
|
2510
2543
|
var s = o.val, c = this.clonePosition();
|
|
2511
2544
|
if (this.bumpIf(`</`)) {
|
|
2512
|
-
if (this.isEOF() || !
|
|
2545
|
+
if (this.isEOF() || !T(this.char())) return this.error(n.ErrorKind.INVALID_TAG, l(c, this.clonePosition()));
|
|
2513
2546
|
var u = this.clonePosition();
|
|
2514
2547
|
return a === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? {
|
|
2515
2548
|
val: {
|
|
@@ -2524,7 +2557,7 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2524
2557
|
} else return this.error(n.ErrorKind.INVALID_TAG, l(i, this.clonePosition()));
|
|
2525
2558
|
}, e.prototype.parseTagName = function() {
|
|
2526
2559
|
var e = this.offset();
|
|
2527
|
-
for (this.bump(); !this.isEOF() &&
|
|
2560
|
+
for (this.bump(); !this.isEOF() && E(this.char());) this.bump();
|
|
2528
2561
|
return this.message.slice(e, this.offset());
|
|
2529
2562
|
}, e.prototype.parseLiteral = function(e, t) {
|
|
2530
2563
|
for (var n = this.clonePosition(), i = ``;;) {
|
|
@@ -2555,7 +2588,7 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2555
2588
|
err: null
|
|
2556
2589
|
};
|
|
2557
2590
|
}, e.prototype.tryParseLeftAngleBracket = function() {
|
|
2558
|
-
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !
|
|
2591
|
+
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !re(this.peek() || 0)) ? (this.bump(), `<`) : null;
|
|
2559
2592
|
}, e.prototype.tryParseQuote = function(e) {
|
|
2560
2593
|
if (this.isEOF() || this.char() !== 39) return null;
|
|
2561
2594
|
switch (this.peek()) {
|
|
@@ -2581,11 +2614,11 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2581
2614
|
else t.push(n);
|
|
2582
2615
|
this.bump();
|
|
2583
2616
|
}
|
|
2584
|
-
return
|
|
2617
|
+
return y.apply(void 0, t);
|
|
2585
2618
|
}, e.prototype.tryParseUnquoted = function(e, t) {
|
|
2586
2619
|
if (this.isEOF()) return null;
|
|
2587
2620
|
var n = this.char();
|
|
2588
|
-
return n === 60 || n === 123 || n === 35 && (t === `plural` || t === `selectordinal`) || n === 125 && e > 0 ? null : (this.bump(),
|
|
2621
|
+
return n === 60 || n === 123 || n === 35 && (t === `plural` || t === `selectordinal`) || n === 125 && e > 0 ? null : (this.bump(), y(n));
|
|
2589
2622
|
}, e.prototype.parseArgument = function(e, t) {
|
|
2590
2623
|
var i = this.clonePosition();
|
|
2591
2624
|
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(n.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, l(i, this.clonePosition()));
|
|
@@ -2606,7 +2639,7 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2606
2639
|
default: return this.error(n.ErrorKind.MALFORMED_ARGUMENT, l(i, this.clonePosition()));
|
|
2607
2640
|
}
|
|
2608
2641
|
}, e.prototype.parseIdentifierIfPossible = function() {
|
|
2609
|
-
var e = this.clonePosition(), t = this.offset(), n =
|
|
2642
|
+
var e = this.clonePosition(), t = this.offset(), n = C(this.message, t), r = t + n.length;
|
|
2610
2643
|
return this.bumpTo(r), {
|
|
2611
2644
|
value: n,
|
|
2612
2645
|
location: l(e, this.clonePosition())
|
|
@@ -2624,7 +2657,7 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2624
2657
|
this.bumpSpace();
|
|
2625
2658
|
var m = this.clonePosition(), h = this.parseSimpleArgStyleIfPossible();
|
|
2626
2659
|
if (h.err) return h;
|
|
2627
|
-
var g =
|
|
2660
|
+
var g = ne(h.val);
|
|
2628
2661
|
if (g.length === 0) return this.error(n.ErrorKind.EXPECT_ARGUMENT_STYLE, l(this.clonePosition(), this.clonePosition()));
|
|
2629
2662
|
p = {
|
|
2630
2663
|
style: g,
|
|
@@ -2634,10 +2667,10 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2634
2667
|
var _ = this.tryParseArgumentClose(c);
|
|
2635
2668
|
if (_.err) return _;
|
|
2636
2669
|
var v = l(c, this.clonePosition());
|
|
2637
|
-
if (p &&
|
|
2638
|
-
var
|
|
2670
|
+
if (p && ee(p?.style, `::`, 0)) {
|
|
2671
|
+
var y = te(p.style.slice(2));
|
|
2639
2672
|
if (d === `number`) {
|
|
2640
|
-
var h = this.parseNumberSkeletonFromString(
|
|
2673
|
+
var h = this.parseNumberSkeletonFromString(y, p.styleLocation);
|
|
2641
2674
|
return h.err ? h : {
|
|
2642
2675
|
val: {
|
|
2643
2676
|
type: r.TYPE.number,
|
|
@@ -2648,9 +2681,9 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2648
2681
|
err: null
|
|
2649
2682
|
};
|
|
2650
2683
|
} else {
|
|
2651
|
-
if (
|
|
2652
|
-
var x =
|
|
2653
|
-
this.locale && (x = (0, o.getBestPattern)(
|
|
2684
|
+
if (y.length === 0) return this.error(n.ErrorKind.EXPECT_DATE_TIME_SKELETON, v);
|
|
2685
|
+
var x = y;
|
|
2686
|
+
this.locale && (x = (0, o.getBestPattern)(y, this.locale));
|
|
2654
2687
|
var g = {
|
|
2655
2688
|
type: r.SKELETON_TYPE.dateTime,
|
|
2656
2689
|
pattern: x,
|
|
@@ -2680,38 +2713,38 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2680
2713
|
case `plural`:
|
|
2681
2714
|
case `selectordinal`:
|
|
2682
2715
|
case `select`:
|
|
2683
|
-
var
|
|
2684
|
-
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(n.ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, l(
|
|
2716
|
+
var S = this.clonePosition();
|
|
2717
|
+
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(n.ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, l(S, t.__assign({}, S)));
|
|
2685
2718
|
this.bumpSpace();
|
|
2686
|
-
var
|
|
2687
|
-
if (d !== `select` &&
|
|
2719
|
+
var C = this.parseIdentifierIfPossible(), w = 0;
|
|
2720
|
+
if (d !== `select` && C.value === `offset`) {
|
|
2688
2721
|
if (!this.bumpIf(`:`)) return this.error(n.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, l(this.clonePosition(), this.clonePosition()));
|
|
2689
2722
|
this.bumpSpace();
|
|
2690
2723
|
var h = this.tryParseDecimalInteger(n.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, n.ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
|
2691
2724
|
if (h.err) return h;
|
|
2692
|
-
this.bumpSpace(),
|
|
2725
|
+
this.bumpSpace(), C = this.parseIdentifierIfPossible(), w = h.val;
|
|
2693
2726
|
}
|
|
2694
|
-
var
|
|
2695
|
-
if (
|
|
2727
|
+
var T = this.tryParsePluralOrSelectOptions(e, d, i, C);
|
|
2728
|
+
if (T.err) return T;
|
|
2696
2729
|
var _ = this.tryParseArgumentClose(c);
|
|
2697
2730
|
if (_.err) return _;
|
|
2698
|
-
var
|
|
2731
|
+
var re = l(c, this.clonePosition());
|
|
2699
2732
|
return d === `select` ? {
|
|
2700
2733
|
val: {
|
|
2701
2734
|
type: r.TYPE.select,
|
|
2702
2735
|
value: s,
|
|
2703
|
-
options:
|
|
2704
|
-
location:
|
|
2736
|
+
options: b(T.val),
|
|
2737
|
+
location: re
|
|
2705
2738
|
},
|
|
2706
2739
|
err: null
|
|
2707
2740
|
} : {
|
|
2708
2741
|
val: {
|
|
2709
2742
|
type: r.TYPE.plural,
|
|
2710
2743
|
value: s,
|
|
2711
|
-
options:
|
|
2712
|
-
offset:
|
|
2744
|
+
options: b(T.val),
|
|
2745
|
+
offset: w,
|
|
2713
2746
|
pluralType: d === `plural` ? `cardinal` : `ordinal`,
|
|
2714
|
-
location:
|
|
2747
|
+
location: re
|
|
2715
2748
|
},
|
|
2716
2749
|
err: null
|
|
2717
2750
|
};
|
|
@@ -2835,7 +2868,7 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2835
2868
|
e === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += e < 65536 ? 1 : 2);
|
|
2836
2869
|
}
|
|
2837
2870
|
}, e.prototype.bumpIf = function(e) {
|
|
2838
|
-
if (
|
|
2871
|
+
if (ee(this.message, e, this.offset())) {
|
|
2839
2872
|
for (var t = 0; t < e.length; t++) this.bump();
|
|
2840
2873
|
return !0;
|
|
2841
2874
|
}
|
|
@@ -2852,31 +2885,31 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2852
2885
|
if (this.bump(), this.isEOF()) break;
|
|
2853
2886
|
}
|
|
2854
2887
|
}, e.prototype.bumpSpace = function() {
|
|
2855
|
-
for (; !this.isEOF() &&
|
|
2888
|
+
for (; !this.isEOF() && ie(this.char());) this.bump();
|
|
2856
2889
|
}, e.prototype.peek = function() {
|
|
2857
2890
|
if (this.isEOF()) return null;
|
|
2858
2891
|
var e = this.char(), t = this.offset();
|
|
2859
2892
|
return this.message.charCodeAt(t + (e >= 65536 ? 2 : 1)) ?? null;
|
|
2860
2893
|
}, e;
|
|
2861
2894
|
}();
|
|
2862
|
-
function
|
|
2895
|
+
function T(e) {
|
|
2863
2896
|
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
|
|
2864
2897
|
}
|
|
2865
|
-
function
|
|
2866
|
-
return
|
|
2898
|
+
function re(e) {
|
|
2899
|
+
return T(e) || e === 47;
|
|
2867
2900
|
}
|
|
2868
|
-
function
|
|
2901
|
+
function E(e) {
|
|
2869
2902
|
return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
|
|
2870
2903
|
}
|
|
2871
|
-
function
|
|
2904
|
+
function ie(e) {
|
|
2872
2905
|
return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
|
|
2873
2906
|
}
|
|
2874
|
-
function
|
|
2907
|
+
function D(e) {
|
|
2875
2908
|
return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;
|
|
2876
2909
|
}
|
|
2877
|
-
})),
|
|
2910
|
+
})), bt = p(((e) => {
|
|
2878
2911
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.hoistSelectors = s, e.isStructurallySame = l;
|
|
2879
|
-
var t = (
|
|
2912
|
+
var t = (R(), g(M)), n = z();
|
|
2880
2913
|
function r(e) {
|
|
2881
2914
|
return Array.isArray(e) ? t.__spreadArray([], e.map(r), !0) : typeof e == `object` && e ? Object.keys(e).reduce(function(t, n) {
|
|
2882
2915
|
return t[n] = r(e[n]), t;
|
|
@@ -2933,9 +2966,9 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2933
2966
|
error: Error(`Different number of variables: [${Array.from(r.keys()).join(`, `)}] vs [${Array.from(i.keys()).join(`, `)}]`)
|
|
2934
2967
|
};
|
|
2935
2968
|
}
|
|
2936
|
-
})),
|
|
2969
|
+
})), xt = p(((e) => {
|
|
2937
2970
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.isStructurallySame = e._Parser = void 0, e.parse = o;
|
|
2938
|
-
var t = (
|
|
2971
|
+
var t = (R(), g(M)), n = dt(), r = yt(), i = z();
|
|
2939
2972
|
function a(e) {
|
|
2940
2973
|
e.forEach(function(e) {
|
|
2941
2974
|
if (delete e.location, (0, i.isSelectElement)(e) || (0, i.isPluralElement)(e)) for (var t in e.options) delete e.options[t].location, a(e.options[t].value);
|
|
@@ -2954,17 +2987,17 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
2954
2987
|
}
|
|
2955
2988
|
return i?.captureLocation || a(o.val), o.val;
|
|
2956
2989
|
}
|
|
2957
|
-
t.__exportStar(
|
|
2958
|
-
var s =
|
|
2990
|
+
t.__exportStar(z(), e), e._Parser = r.Parser;
|
|
2991
|
+
var s = bt();
|
|
2959
2992
|
Object.defineProperty(e, `isStructurallySame`, {
|
|
2960
2993
|
enumerable: !0,
|
|
2961
2994
|
get: function() {
|
|
2962
2995
|
return s.isStructurallySame;
|
|
2963
2996
|
}
|
|
2964
2997
|
});
|
|
2965
|
-
})),
|
|
2998
|
+
})), St = p(((e) => {
|
|
2966
2999
|
Object.defineProperty(e, `__esModule`, { value: !0 }), e.printAST = r;
|
|
2967
|
-
var t = (
|
|
3000
|
+
var t = (R(), g(M)), n = z();
|
|
2968
3001
|
function r(e) {
|
|
2969
3002
|
return i(e, !1);
|
|
2970
3003
|
}
|
|
@@ -3027,28 +3060,95 @@ var L, R, z, et, B, tt, nt, V = f((() => {
|
|
|
3027
3060
|
].join(`,`)}}`;
|
|
3028
3061
|
}
|
|
3029
3062
|
}));
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
const
|
|
3034
|
-
RegExp(`^${
|
|
3035
|
-
RegExp(`^${
|
|
3036
|
-
const
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3063
|
+
xt();
|
|
3064
|
+
z();
|
|
3065
|
+
St();
|
|
3066
|
+
const U = `_gt_`;
|
|
3067
|
+
RegExp(`^${U}\\d+$`);
|
|
3068
|
+
RegExp(`^${U}$`);
|
|
3069
|
+
const Ht = `@generaltranslation/react-core`;
|
|
3070
|
+
function W(e) {
|
|
3071
|
+
return S({
|
|
3072
|
+
source: Ht,
|
|
3073
|
+
...e
|
|
3074
|
+
});
|
|
3075
|
+
}
|
|
3076
|
+
W({
|
|
3077
|
+
severity: `Error`,
|
|
3078
|
+
whatHappened: `Runtime translation needs a project ID`,
|
|
3079
|
+
fix: `Add projectId to your <GTProvider> configuration or set GT_PROJECT_ID in your environment`,
|
|
3080
|
+
docsUrl: `https://generaltranslation.com/dashboard`
|
|
3081
|
+
}), W({
|
|
3082
|
+
severity: `Error`,
|
|
3083
|
+
whatHappened: `Production environments cannot use a development API key`,
|
|
3084
|
+
fix: `Replace it with a production API key before deploying`
|
|
3085
|
+
}), W({
|
|
3086
|
+
severity: `Error`,
|
|
3087
|
+
whatHappened: `The API key is available to client-side production code`,
|
|
3088
|
+
fix: `Move translation credentials to a server-only environment before deploying`
|
|
3089
|
+
}), W({
|
|
3090
|
+
severity: `Error`,
|
|
3091
|
+
whatHappened: `Runtime translation is not configured`,
|
|
3092
|
+
fix: `Add projectId and devApiKey to your environment, or pass them to <GTProvider> directly`
|
|
3093
|
+
}), W({
|
|
3094
|
+
severity: `Error`,
|
|
3095
|
+
whatHappened: `Runtime translations could not be loaded`,
|
|
3096
|
+
wayOut: `Source content will render as a fallback`,
|
|
3097
|
+
fix: `Check your runtime translation configuration and try again`
|
|
3098
|
+
}), W({
|
|
3099
|
+
severity: `Error`,
|
|
3100
|
+
whatHappened: `Runtime translation could not be completed`
|
|
3101
|
+
});
|
|
3102
|
+
W({
|
|
3103
|
+
severity: `Warning`,
|
|
3104
|
+
whatHappened: `Runtime translation needs a project ID`,
|
|
3105
|
+
fix: `Add projectId to <GTProvider> or set GT_PROJECT_ID in your environment`,
|
|
3106
|
+
docsUrl: `https://generaltranslation.com/dashboard`
|
|
3107
|
+
}), W({
|
|
3108
|
+
severity: `Warning`,
|
|
3109
|
+
whatHappened: `Runtime translation needs a development API key`,
|
|
3110
|
+
fix: `Find your development API key at generaltranslation.com/dashboard, or set runtimeUrl to an empty string to disable runtime translation`
|
|
3111
|
+
}), W({
|
|
3112
|
+
severity: `Warning`,
|
|
3113
|
+
whatHappened: `Runtime translation timed out`
|
|
3114
|
+
}), W({
|
|
3115
|
+
severity: `Warning`,
|
|
3116
|
+
whatHappened: `No dictionary was found`,
|
|
3117
|
+
fix: `Pass a dictionary to <GTProvider> or configure a dictionary loader before rendering translations`
|
|
3118
|
+
});
|
|
3119
|
+
`${Ht}`;
|
|
3120
|
+
const pn = `generaltranslation.locale`, mn = `generaltranslation.region`;
|
|
3041
3121
|
e.use;
|
|
3042
|
-
function
|
|
3122
|
+
function Jn({ children: e }) {
|
|
3043
3123
|
return e;
|
|
3044
3124
|
}
|
|
3045
|
-
function
|
|
3046
|
-
return
|
|
3125
|
+
function Yn(e) {
|
|
3126
|
+
return Jn(e);
|
|
3127
|
+
}
|
|
3128
|
+
Jn._gtt = `derive`, Yn._gtt = `derive`;
|
|
3129
|
+
//#endregion
|
|
3130
|
+
//#region src/shared/cookies.ts
|
|
3131
|
+
/**
|
|
3132
|
+
* Minimally parses a cookie value for a given cookie name.
|
|
3133
|
+
* @param cookieName - The name of the cookie
|
|
3134
|
+
* @returns The cookie value, or undefined when it is not found
|
|
3135
|
+
*/
|
|
3136
|
+
function getCookieValue(cookieName) {
|
|
3137
|
+
if (typeof document === "undefined") return void 0;
|
|
3138
|
+
return document.cookie.split("; ").find((row) => row.startsWith(`${cookieName}=`))?.split("=")[1];
|
|
3139
|
+
}
|
|
3140
|
+
/**
|
|
3141
|
+
* Sets a cookie value for a given cookie name.
|
|
3142
|
+
* @param cookieName - The name of the cookie
|
|
3143
|
+
* @param value - The value to set
|
|
3144
|
+
*/
|
|
3145
|
+
function setCookieValue(cookieName, value) {
|
|
3146
|
+
if (typeof document === "undefined") return;
|
|
3147
|
+
document.cookie = `${cookieName}=${value};path=/`;
|
|
3047
3148
|
}
|
|
3048
|
-
Hn._gtt = `derive`, Un._gtt = `derive`;
|
|
3049
3149
|
//#endregion
|
|
3050
3150
|
//#region src/react-context/provider/ClientProvider.tsx
|
|
3051
|
-
function ClientProvider({ children, dictionary: _dictionary, dictionaryTranslations: _dictionaryTranslations, translations: _translations, locale: _locale, region: _region, _versionId, defaultLocale, translationRequired, dialectTranslationRequired, locales = [], renderSettings, projectId, devApiKey, runtimeUrl, developmentApiEnabled, resetLocaleCookieName, localeCookieName =
|
|
3151
|
+
function ClientProvider({ children, dictionary: _dictionary, dictionaryTranslations: _dictionaryTranslations, translations: _translations, locale: _locale, region: _region, _versionId, defaultLocale, translationRequired, dialectTranslationRequired, locales = [], renderSettings, projectId, devApiKey, runtimeUrl, developmentApiEnabled, resetLocaleCookieName, localeCookieName = pn, regionCookieName = mn, customMapping, environment, reloadServer }) {
|
|
3052
3152
|
const didMount = useRef(false);
|
|
3053
3153
|
const [translations, setTranslations] = useState(_translations);
|
|
3054
3154
|
useEffect(() => {
|
|
@@ -3057,28 +3157,25 @@ function ClientProvider({ children, dictionary: _dictionary, dictionaryTranslati
|
|
|
3057
3157
|
}, [_translations]);
|
|
3058
3158
|
const [locale, _setLocale] = useState(_locale ? determineLocale(_locale, locales, customMapping) || "" : "");
|
|
3059
3159
|
useEffect(() => {
|
|
3060
|
-
let cookieLocale =
|
|
3160
|
+
let cookieLocale = getCookieValue(localeCookieName);
|
|
3061
3161
|
if (cookieLocale) cookieLocale = gt.resolveAliasLocale(cookieLocale);
|
|
3062
|
-
if (locale && cookieLocale && cookieLocale !== locale)
|
|
3162
|
+
if (locale && cookieLocale && cookieLocale !== locale) setCookieValue(localeCookieName, "");
|
|
3063
3163
|
}, [locale, localeCookieName]);
|
|
3064
3164
|
const [dictionaryTranslations, setDictionaryTranslations] = useState(_dictionaryTranslations || {});
|
|
3065
3165
|
const [dictionary, setDictionary] = useState(_dictionary || {});
|
|
3066
3166
|
useEffect(() => {
|
|
3067
3167
|
if (!didMount.current) return;
|
|
3068
3168
|
setDictionaryTranslations(_dictionaryTranslations);
|
|
3069
|
-
}, [_dictionaryTranslations]);
|
|
3070
|
-
useEffect(() => {
|
|
3071
|
-
if (!didMount.current) return;
|
|
3072
3169
|
setDictionary(_dictionary);
|
|
3073
|
-
}, [_dictionary]);
|
|
3170
|
+
}, [_dictionaryTranslations, _dictionary]);
|
|
3074
3171
|
const [region, _setRegion] = useState(_region);
|
|
3075
3172
|
const setRegion = (newRegion) => {
|
|
3076
|
-
|
|
3173
|
+
setCookieValue(regionCookieName, newRegion || "");
|
|
3077
3174
|
_setRegion(newRegion);
|
|
3078
3175
|
};
|
|
3079
3176
|
useEffect(() => {
|
|
3080
|
-
const cookieRegion =
|
|
3081
|
-
if (region && cookieRegion && cookieRegion !== region)
|
|
3177
|
+
const cookieRegion = getCookieValue(regionCookieName);
|
|
3178
|
+
if (region && cookieRegion && cookieRegion !== region) setCookieValue(regionCookieName, "");
|
|
3082
3179
|
}, [region, regionCookieName]);
|
|
3083
3180
|
const gt = useMemo(() => new GT({
|
|
3084
3181
|
devApiKey,
|
|
@@ -3098,8 +3195,8 @@ function ClientProvider({ children, dictionary: _dictionary, dictionaryTranslati
|
|
|
3098
3195
|
const setLocale = (newLocale) => {
|
|
3099
3196
|
newLocale = determineLocale(newLocale, locales, customMapping) || locale || defaultLocale;
|
|
3100
3197
|
newLocale = gt.resolveAliasLocale(newLocale);
|
|
3101
|
-
|
|
3102
|
-
|
|
3198
|
+
setCookieValue(localeCookieName, newLocale);
|
|
3199
|
+
setCookieValue(resetLocaleCookieName, "true");
|
|
3103
3200
|
_setLocale(newLocale);
|
|
3104
3201
|
reloadServer();
|
|
3105
3202
|
};
|
|
@@ -3154,7 +3251,7 @@ function ClientProvider({ children, dictionary: _dictionary, dictionaryTranslati
|
|
|
3154
3251
|
developmentApiEnabled,
|
|
3155
3252
|
_versionId
|
|
3156
3253
|
},
|
|
3157
|
-
children: /* @__PURE__ */ jsx(
|
|
3254
|
+
children: /* @__PURE__ */ jsx(Suspense, {
|
|
3158
3255
|
fallback: display && children,
|
|
3159
3256
|
children: display && children
|
|
3160
3257
|
})
|
|
@@ -3199,13 +3296,12 @@ function _convertCustomNamesToMapping(customNames) {
|
|
|
3199
3296
|
*/
|
|
3200
3297
|
function InternalLocaleSelector({ locale, locales, customNames, customMapping = _convertCustomNamesToMapping(customNames), setLocale, getLocaleProperties, ...props }) {
|
|
3201
3298
|
const getDisplayName = (locale) => {
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
}
|
|
3299
|
+
const customLocale = customMapping?.[locale];
|
|
3300
|
+
if (typeof customLocale === "string") return customLocale;
|
|
3301
|
+
if (customLocale?.name) return customLocale.name;
|
|
3206
3302
|
return capitalizeName(getLocaleProperties(locale).nativeNameWithRegionCode);
|
|
3207
3303
|
};
|
|
3208
|
-
if (!locales
|
|
3304
|
+
if (!locales?.length || !setLocale) return null;
|
|
3209
3305
|
return /* @__PURE__ */ jsxs("select", {
|
|
3210
3306
|
...props,
|
|
3211
3307
|
value: locale || "",
|