@nizza/core 0.4.5-alpha.10 → 0.4.5-alpha.11
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +121 -121
- package/dist/index.mjs.map +1 -1
- package/dist/lib/i18n/init.d.ts +2 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2426,74 +2426,29 @@ var Zt = /* @__PURE__ */ function() {
|
|
|
2426
2426
|
}]), n;
|
|
2427
2427
|
}();
|
|
2428
2428
|
Zt.type = "languageDetector";
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
"&": "&",
|
|
2432
|
-
"<": "<",
|
|
2433
|
-
"<": "<",
|
|
2434
|
-
">": ">",
|
|
2435
|
-
">": ">",
|
|
2436
|
-
"'": "'",
|
|
2437
|
-
"'": "'",
|
|
2438
|
-
""": '"',
|
|
2439
|
-
""": '"',
|
|
2440
|
-
" ": " ",
|
|
2441
|
-
" ": " ",
|
|
2442
|
-
"©": "©",
|
|
2443
|
-
"©": "©",
|
|
2444
|
-
"®": "®",
|
|
2445
|
-
"®": "®",
|
|
2446
|
-
"…": "…",
|
|
2447
|
-
"…": "…",
|
|
2448
|
-
"/": "/",
|
|
2449
|
-
"/": "/"
|
|
2450
|
-
}, Ua = (n) => _a[n], Ma = (n) => n.replace(Va, Ua);
|
|
2451
|
-
let kt = {
|
|
2452
|
-
bindI18n: "languageChanged",
|
|
2453
|
-
bindI18nStore: "",
|
|
2454
|
-
transEmptyNodeValue: "",
|
|
2455
|
-
transSupportBasicHtmlNodes: !0,
|
|
2456
|
-
transWrapTextNodes: "",
|
|
2457
|
-
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
2458
|
-
useSuspense: !0,
|
|
2459
|
-
unescape: Ma
|
|
2460
|
-
};
|
|
2461
|
-
function ja() {
|
|
2462
|
-
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2463
|
-
kt = {
|
|
2464
|
-
...kt,
|
|
2465
|
-
...n
|
|
2466
|
-
};
|
|
2467
|
-
}
|
|
2468
|
-
const $a = {
|
|
2469
|
-
type: "3rdParty",
|
|
2470
|
-
init(n) {
|
|
2471
|
-
ja(n.options.react);
|
|
2472
|
-
}
|
|
2473
|
-
};
|
|
2474
|
-
function za(n) {
|
|
2475
|
-
n.use($a).use(Zt).init({
|
|
2429
|
+
function Va(n, e) {
|
|
2430
|
+
n.use(e).use(Zt).init({
|
|
2476
2431
|
resources: {},
|
|
2477
2432
|
fallbackLng: "en",
|
|
2478
2433
|
debug: !1,
|
|
2479
2434
|
interpolation: {
|
|
2480
2435
|
escapeValue: !1,
|
|
2481
2436
|
// not needed for react as it escapes by default
|
|
2482
|
-
format: (
|
|
2483
|
-
if (
|
|
2484
|
-
const [
|
|
2485
|
-
if (
|
|
2486
|
-
return new Intl.NumberFormat(
|
|
2487
|
-
if (
|
|
2488
|
-
return new Intl.DateTimeFormat(
|
|
2489
|
-
if (
|
|
2490
|
-
return new Intl.NumberFormat(
|
|
2437
|
+
format: (t, i, a) => {
|
|
2438
|
+
if (i) {
|
|
2439
|
+
const [s, ...r] = i.split(",").map((o) => o.trim());
|
|
2440
|
+
if (s === "number")
|
|
2441
|
+
return new Intl.NumberFormat(a).format(t);
|
|
2442
|
+
if (s === "date")
|
|
2443
|
+
return new Intl.DateTimeFormat(a).format(t);
|
|
2444
|
+
if (s === "currency")
|
|
2445
|
+
return new Intl.NumberFormat(a, {
|
|
2491
2446
|
style: "currency",
|
|
2492
|
-
currency:
|
|
2447
|
+
currency: r[0] || "USD",
|
|
2493
2448
|
currencyDisplay: "narrowSymbol"
|
|
2494
|
-
}).format(
|
|
2449
|
+
}).format(t).replace("$", "").trim();
|
|
2495
2450
|
}
|
|
2496
|
-
return
|
|
2451
|
+
return t;
|
|
2497
2452
|
}
|
|
2498
2453
|
},
|
|
2499
2454
|
detection: {
|
|
@@ -2511,7 +2466,7 @@ function za(n) {
|
|
|
2511
2466
|
}
|
|
2512
2467
|
});
|
|
2513
2468
|
}
|
|
2514
|
-
const
|
|
2469
|
+
const _a = {
|
|
2515
2470
|
type: "logger",
|
|
2516
2471
|
log(n) {
|
|
2517
2472
|
this.output("log", n);
|
|
@@ -2533,7 +2488,7 @@ class pe {
|
|
|
2533
2488
|
}
|
|
2534
2489
|
init(e) {
|
|
2535
2490
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2536
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
2491
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || _a, this.options = t, this.debug = t.debug;
|
|
2537
2492
|
}
|
|
2538
2493
|
log() {
|
|
2539
2494
|
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
|
|
@@ -2604,10 +2559,10 @@ function X() {
|
|
|
2604
2559
|
});
|
|
2605
2560
|
return t.resolve = n, t.reject = e, t;
|
|
2606
2561
|
}
|
|
2607
|
-
function
|
|
2562
|
+
function kt(n) {
|
|
2608
2563
|
return n == null ? "" : "" + n;
|
|
2609
2564
|
}
|
|
2610
|
-
function
|
|
2565
|
+
function Ua(n, e, t) {
|
|
2611
2566
|
n.forEach((i) => {
|
|
2612
2567
|
e[i] && (t[i] = e[i]);
|
|
2613
2568
|
});
|
|
@@ -2631,14 +2586,14 @@ function Ke(n, e, t) {
|
|
|
2631
2586
|
k: i(s.shift())
|
|
2632
2587
|
};
|
|
2633
2588
|
}
|
|
2634
|
-
function
|
|
2589
|
+
function vt(n, e, t) {
|
|
2635
2590
|
const {
|
|
2636
2591
|
obj: i,
|
|
2637
2592
|
k: a
|
|
2638
2593
|
} = Ke(n, e, Object);
|
|
2639
2594
|
i[a] = t;
|
|
2640
2595
|
}
|
|
2641
|
-
function
|
|
2596
|
+
function Ma(n, e, t, i) {
|
|
2642
2597
|
const {
|
|
2643
2598
|
obj: a,
|
|
2644
2599
|
k: s
|
|
@@ -2653,7 +2608,7 @@ function he(n, e) {
|
|
|
2653
2608
|
if (t)
|
|
2654
2609
|
return t[i];
|
|
2655
2610
|
}
|
|
2656
|
-
function
|
|
2611
|
+
function ja(n, e, t) {
|
|
2657
2612
|
const i = he(n, t);
|
|
2658
2613
|
return i !== void 0 ? i : he(e, t);
|
|
2659
2614
|
}
|
|
@@ -2665,7 +2620,7 @@ function Xt(n, e, t) {
|
|
|
2665
2620
|
function Q(n) {
|
|
2666
2621
|
return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
2667
2622
|
}
|
|
2668
|
-
var
|
|
2623
|
+
var $a = {
|
|
2669
2624
|
"&": "&",
|
|
2670
2625
|
"<": "<",
|
|
2671
2626
|
">": ">",
|
|
@@ -2673,13 +2628,13 @@ var Wa = {
|
|
|
2673
2628
|
"'": "'",
|
|
2674
2629
|
"/": "/"
|
|
2675
2630
|
};
|
|
2676
|
-
function
|
|
2677
|
-
return typeof n == "string" ? n.replace(/[&<>"'\/]/g, (e) =>
|
|
2631
|
+
function za(n) {
|
|
2632
|
+
return typeof n == "string" ? n.replace(/[&<>"'\/]/g, (e) => $a[e]) : n;
|
|
2678
2633
|
}
|
|
2679
|
-
const
|
|
2680
|
-
function
|
|
2634
|
+
const Ba = [" ", ",", "?", "!", ";"];
|
|
2635
|
+
function Qa(n, e, t) {
|
|
2681
2636
|
e = e || "", t = t || "";
|
|
2682
|
-
const i =
|
|
2637
|
+
const i = Ba.filter((r) => e.indexOf(r) < 0 && t.indexOf(r) < 0);
|
|
2683
2638
|
if (i.length === 0)
|
|
2684
2639
|
return !0;
|
|
2685
2640
|
const a = new RegExp(`(${i.map((r) => r === "?" ? "\\?" : r).join("|")})`);
|
|
@@ -2725,7 +2680,7 @@ function ge(n, e) {
|
|
|
2725
2680
|
function ke(n) {
|
|
2726
2681
|
return n && n.indexOf("_") > 0 ? n.replace("_", "-") : n;
|
|
2727
2682
|
}
|
|
2728
|
-
class
|
|
2683
|
+
class St extends Ne {
|
|
2729
2684
|
constructor(e) {
|
|
2730
2685
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
2731
2686
|
ns: ["translation"],
|
|
@@ -2754,7 +2709,7 @@ class yt extends Ne {
|
|
|
2754
2709
|
};
|
|
2755
2710
|
const r = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator;
|
|
2756
2711
|
let o = [e, t];
|
|
2757
|
-
i && (o = o.concat(r ? i.split(r) : i)), e.indexOf(".") > -1 && (o = e.split("."), a = t, t = o[1]), this.addNamespaces(t),
|
|
2712
|
+
i && (o = o.concat(r ? i.split(r) : i)), e.indexOf(".") > -1 && (o = e.split("."), a = t, t = o[1]), this.addNamespaces(t), vt(this.data, o, a), s.silent || this.emit("added", e, t, i, a);
|
|
2758
2713
|
}
|
|
2759
2714
|
addResources(e, t, i) {
|
|
2760
2715
|
let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
@@ -2775,7 +2730,7 @@ class yt extends Ne {
|
|
|
2775
2730
|
a ? Xt(d, i, s) : d = {
|
|
2776
2731
|
...d,
|
|
2777
2732
|
...i
|
|
2778
|
-
},
|
|
2733
|
+
}, vt(this.data, o, d), r.silent || this.emit("added", e, t, i);
|
|
2779
2734
|
}
|
|
2780
2735
|
removeResourceBundle(e, t) {
|
|
2781
2736
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -2810,11 +2765,11 @@ var Yt = {
|
|
|
2810
2765
|
}), e;
|
|
2811
2766
|
}
|
|
2812
2767
|
};
|
|
2813
|
-
const
|
|
2768
|
+
const yt = {};
|
|
2814
2769
|
class ve extends Ne {
|
|
2815
2770
|
constructor(e) {
|
|
2816
2771
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2817
|
-
super(),
|
|
2772
|
+
super(), Ua(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = j.create("translator");
|
|
2818
2773
|
}
|
|
2819
2774
|
changeLanguage(e) {
|
|
2820
2775
|
e && (this.language = e);
|
|
@@ -2833,7 +2788,7 @@ class ve extends Ne {
|
|
|
2833
2788
|
i === void 0 && (i = ":");
|
|
2834
2789
|
const a = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
2835
2790
|
let s = t.ns || this.options.defaultNS || [];
|
|
2836
|
-
const r = i && e.indexOf(i) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
2791
|
+
const r = i && e.indexOf(i) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Qa(e, i, a);
|
|
2837
2792
|
if (r && !o) {
|
|
2838
2793
|
const d = e.match(this.interpolator.nestingRegexp);
|
|
2839
2794
|
if (d && d.length > 0)
|
|
@@ -3000,7 +2955,7 @@ class ve extends Ne {
|
|
|
3000
2955
|
this.options.fallbackNS && (p = p.concat(this.options.fallbackNS));
|
|
3001
2956
|
const c = t.count !== void 0 && typeof t.count != "string", v = c && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), S = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", k = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
3002
2957
|
p.forEach((y) => {
|
|
3003
|
-
this.isValidLookup(i) || (o = y, !
|
|
2958
|
+
this.isValidLookup(i) || (o = y, !yt[`${k[0]}-${y}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (yt[`${k[0]}-${y}`] = !0, this.logger.warn(`key "${a}" for languages "${k.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), k.forEach((F) => {
|
|
3004
2959
|
if (this.isValidLookup(i))
|
|
3005
2960
|
return;
|
|
3006
2961
|
r = F;
|
|
@@ -3063,7 +3018,7 @@ class ve extends Ne {
|
|
|
3063
3018
|
function Oe(n) {
|
|
3064
3019
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
3065
3020
|
}
|
|
3066
|
-
class
|
|
3021
|
+
class Nt {
|
|
3067
3022
|
constructor(e) {
|
|
3068
3023
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = j.create("languageUtils");
|
|
3069
3024
|
}
|
|
@@ -3132,7 +3087,7 @@ class bt {
|
|
|
3132
3087
|
}), a;
|
|
3133
3088
|
}
|
|
3134
3089
|
}
|
|
3135
|
-
let
|
|
3090
|
+
let Ka = [{
|
|
3136
3091
|
lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
|
|
3137
3092
|
nr: [1, 2],
|
|
3138
3093
|
fc: 1
|
|
@@ -3224,7 +3179,7 @@ let Za = [{
|
|
|
3224
3179
|
lngs: ["he", "iw"],
|
|
3225
3180
|
nr: [1, 2, 20, 21],
|
|
3226
3181
|
fc: 22
|
|
3227
|
-
}],
|
|
3182
|
+
}], Ga = {
|
|
3228
3183
|
1: function(n) {
|
|
3229
3184
|
return +(n > 1);
|
|
3230
3185
|
},
|
|
@@ -3292,7 +3247,7 @@ let Za = [{
|
|
|
3292
3247
|
return n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3;
|
|
3293
3248
|
}
|
|
3294
3249
|
};
|
|
3295
|
-
const
|
|
3250
|
+
const Wa = ["v1", "v2", "v3"], Ja = ["v4"], bt = {
|
|
3296
3251
|
zero: 0,
|
|
3297
3252
|
one: 1,
|
|
3298
3253
|
two: 2,
|
|
@@ -3300,21 +3255,21 @@ const Ya = ["v1", "v2", "v3"], es = ["v4"], Ft = {
|
|
|
3300
3255
|
many: 4,
|
|
3301
3256
|
other: 5
|
|
3302
3257
|
};
|
|
3303
|
-
function
|
|
3258
|
+
function qa() {
|
|
3304
3259
|
const n = {};
|
|
3305
|
-
return
|
|
3260
|
+
return Ka.forEach((e) => {
|
|
3306
3261
|
e.lngs.forEach((t) => {
|
|
3307
3262
|
n[t] = {
|
|
3308
3263
|
numbers: e.nr,
|
|
3309
|
-
plurals:
|
|
3264
|
+
plurals: Ga[e.fc]
|
|
3310
3265
|
};
|
|
3311
3266
|
});
|
|
3312
3267
|
}), n;
|
|
3313
3268
|
}
|
|
3314
|
-
class
|
|
3269
|
+
class Ha {
|
|
3315
3270
|
constructor(e) {
|
|
3316
3271
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
3317
|
-
this.languageUtils = e, this.options = t, this.logger = j.create("pluralResolver"), (!this.options.compatibilityJSON ||
|
|
3272
|
+
this.languageUtils = e, this.options = t, this.logger = j.create("pluralResolver"), (!this.options.compatibilityJSON || Ja.includes(this.options.compatibilityJSON)) && (typeof Intl == "undefined" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = qa();
|
|
3318
3273
|
}
|
|
3319
3274
|
addRule(e, t) {
|
|
3320
3275
|
this.rules[e] = t;
|
|
@@ -3343,7 +3298,7 @@ class ns {
|
|
|
3343
3298
|
getSuffixes(e) {
|
|
3344
3299
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
3345
3300
|
const i = this.getRule(e, t);
|
|
3346
|
-
return i ? this.shouldUseIntlApi() ? i.resolvedOptions().pluralCategories.sort((a, s) =>
|
|
3301
|
+
return i ? this.shouldUseIntlApi() ? i.resolvedOptions().pluralCategories.sort((a, s) => bt[a] - bt[s]).map((a) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${a}`) : i.numbers.map((a) => this.getSuffix(e, a, t)) : [];
|
|
3347
3302
|
}
|
|
3348
3303
|
getSuffix(e, t) {
|
|
3349
3304
|
let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
@@ -3358,14 +3313,14 @@ class ns {
|
|
|
3358
3313
|
return this.options.compatibilityJSON === "v1" ? a === 1 ? "" : typeof a == "number" ? `_plural_${a.toString()}` : s() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? s() : this.options.prepend && i.toString() ? this.options.prepend + i.toString() : i.toString();
|
|
3359
3314
|
}
|
|
3360
3315
|
shouldUseIntlApi() {
|
|
3361
|
-
return !
|
|
3316
|
+
return !Wa.includes(this.options.compatibilityJSON);
|
|
3362
3317
|
}
|
|
3363
3318
|
}
|
|
3364
|
-
function
|
|
3365
|
-
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s =
|
|
3319
|
+
function Ft(n, e, t) {
|
|
3320
|
+
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s = ja(n, e, t);
|
|
3366
3321
|
return !s && a && typeof t == "string" && (s = ge(n, t, i), s === void 0 && (s = ge(e, t, i))), s;
|
|
3367
3322
|
}
|
|
3368
|
-
class
|
|
3323
|
+
class Za {
|
|
3369
3324
|
constructor() {
|
|
3370
3325
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3371
3326
|
this.logger = j.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
|
|
@@ -3376,7 +3331,7 @@ class is {
|
|
|
3376
3331
|
escapeValue: !0
|
|
3377
3332
|
});
|
|
3378
3333
|
const t = e.interpolation;
|
|
3379
|
-
this.escape = t.escape !== void 0 ? t.escape :
|
|
3334
|
+
this.escape = t.escape !== void 0 ? t.escape : za, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ? Q(t.prefix) : t.prefixEscaped || "{{", this.suffix = t.suffix ? Q(t.suffix) : t.suffixEscaped || "}}", this.formatSeparator = t.formatSeparator ? t.formatSeparator : t.formatSeparator || ",", this.unescapePrefix = t.unescapeSuffix ? "" : t.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t.unescapeSuffix || "", this.nestingPrefix = t.nestingPrefix ? Q(t.nestingPrefix) : t.nestingPrefixEscaped || Q("$t("), this.nestingSuffix = t.nestingSuffix ? Q(t.nestingSuffix) : t.nestingSuffixEscaped || Q(")"), this.nestingOptionsSeparator = t.nestingOptionsSeparator ? t.nestingOptionsSeparator : t.nestingOptionsSeparator || ",", this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3, this.alwaysFormat = t.alwaysFormat !== void 0 ? t.alwaysFormat : !1, this.resetRegExp();
|
|
3380
3335
|
}
|
|
3381
3336
|
reset() {
|
|
3382
3337
|
this.options && this.init(this.options);
|
|
@@ -3397,7 +3352,7 @@ class is {
|
|
|
3397
3352
|
}
|
|
3398
3353
|
const u = (S) => {
|
|
3399
3354
|
if (S.indexOf(this.formatSeparator) < 0) {
|
|
3400
|
-
const w =
|
|
3355
|
+
const w = Ft(t, d, S, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
3401
3356
|
return this.alwaysFormat ? this.format(w, void 0, i, {
|
|
3402
3357
|
...a,
|
|
3403
3358
|
...t,
|
|
@@ -3405,7 +3360,7 @@ class is {
|
|
|
3405
3360
|
}) : w;
|
|
3406
3361
|
}
|
|
3407
3362
|
const k = S.split(this.formatSeparator), y = k.shift().trim(), F = k.join(this.formatSeparator).trim();
|
|
3408
|
-
return this.format(
|
|
3363
|
+
return this.format(Ft(t, d, y, this.options.keySeparator, this.options.ignoreJSONStructure), F, i, {
|
|
3409
3364
|
...a,
|
|
3410
3365
|
...t,
|
|
3411
3366
|
interpolationkey: y
|
|
@@ -3434,7 +3389,7 @@ class is {
|
|
|
3434
3389
|
} else
|
|
3435
3390
|
this.logger.warn(`missed to pass in variable ${k} for interpolating ${e}`), r = "";
|
|
3436
3391
|
else
|
|
3437
|
-
typeof r != "string" && !this.useRawValueToEscape && (r =
|
|
3392
|
+
typeof r != "string" && !this.useRawValueToEscape && (r = kt(r));
|
|
3438
3393
|
const y = S.safeValue(r);
|
|
3439
3394
|
if (e = e.replace(s[0], y), c ? (S.regex.lastIndex += r.length, S.regex.lastIndex -= s[0].length) : S.regex.lastIndex = 0, o++, o >= this.maxReplaces)
|
|
3440
3395
|
break;
|
|
@@ -3474,7 +3429,7 @@ class is {
|
|
|
3474
3429
|
}
|
|
3475
3430
|
if (s = t(o.call(this, a[1].trim(), r), r), s && a[0] === e && typeof s != "string")
|
|
3476
3431
|
return s;
|
|
3477
|
-
typeof s != "string" && (s =
|
|
3432
|
+
typeof s != "string" && (s = kt(s)), s || (this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`), s = ""), l && (s = d.reduce((u, p) => this.format(u, p, i.lng, {
|
|
3478
3433
|
...i,
|
|
3479
3434
|
interpolationkey: a[1].trim()
|
|
3480
3435
|
}), s.trim())), e = e.replace(a[0], s), this.regexp.lastIndex = 0;
|
|
@@ -3482,7 +3437,7 @@ class is {
|
|
|
3482
3437
|
return e;
|
|
3483
3438
|
}
|
|
3484
3439
|
}
|
|
3485
|
-
function
|
|
3440
|
+
function Xa(n) {
|
|
3486
3441
|
let e = n.toLowerCase().trim();
|
|
3487
3442
|
const t = {};
|
|
3488
3443
|
if (n.indexOf("(") > -1) {
|
|
@@ -3509,7 +3464,7 @@ function K(n) {
|
|
|
3509
3464
|
return o || (o = n(ke(a), s), e[r] = o), o(i);
|
|
3510
3465
|
};
|
|
3511
3466
|
}
|
|
3512
|
-
class
|
|
3467
|
+
class Ya {
|
|
3513
3468
|
constructor() {
|
|
3514
3469
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3515
3470
|
this.logger = j.create("formatter"), this.options = e, this.formats = {
|
|
@@ -3564,7 +3519,7 @@ class ss {
|
|
|
3564
3519
|
const {
|
|
3565
3520
|
formatName: l,
|
|
3566
3521
|
formatOptions: u
|
|
3567
|
-
} =
|
|
3522
|
+
} = Xa(d);
|
|
3568
3523
|
if (this.formats[l]) {
|
|
3569
3524
|
let p = o;
|
|
3570
3525
|
try {
|
|
@@ -3584,10 +3539,10 @@ class ss {
|
|
|
3584
3539
|
}, e);
|
|
3585
3540
|
}
|
|
3586
3541
|
}
|
|
3587
|
-
function
|
|
3542
|
+
function es(n, e) {
|
|
3588
3543
|
n.pending[e] !== void 0 && (delete n.pending[e], n.pendingCount--);
|
|
3589
3544
|
}
|
|
3590
|
-
class
|
|
3545
|
+
class ts extends Ne {
|
|
3591
3546
|
constructor(e, t, i) {
|
|
3592
3547
|
let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
3593
3548
|
super(), this.backend = e, this.store = t, this.services = i, this.languageUtils = i.languageUtils, this.options = a, this.logger = j.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = a.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = a.maxRetries >= 0 ? a.maxRetries : 5, this.retryTimeout = a.retryTimeout >= 1 ? a.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(i, a.backend, a);
|
|
@@ -3618,7 +3573,7 @@ class os extends Ne {
|
|
|
3618
3573
|
t && this.emit("failedLoading", s, r, t), i && this.store.addResourceBundle(s, r, i), this.state[e] = t ? -1 : 2;
|
|
3619
3574
|
const o = {};
|
|
3620
3575
|
this.queue.forEach((d) => {
|
|
3621
|
-
|
|
3576
|
+
Ma(d.loaded, [s], r), es(d, e), t && d.errors.push(t), d.pendingCount === 0 && !d.done && (Object.keys(d.loaded).forEach((l) => {
|
|
3622
3577
|
o[l] || (o[l] = {});
|
|
3623
3578
|
const u = d.loaded[l];
|
|
3624
3579
|
u.length && u.forEach((p) => {
|
|
@@ -3721,7 +3676,7 @@ class os extends Ne {
|
|
|
3721
3676
|
}
|
|
3722
3677
|
}
|
|
3723
3678
|
}
|
|
3724
|
-
function
|
|
3679
|
+
function wt() {
|
|
3725
3680
|
return {
|
|
3726
3681
|
debug: !1,
|
|
3727
3682
|
initImmediate: !0,
|
|
@@ -3780,12 +3735,12 @@ function Ct() {
|
|
|
3780
3735
|
}
|
|
3781
3736
|
};
|
|
3782
3737
|
}
|
|
3783
|
-
function
|
|
3738
|
+
function Ct(n) {
|
|
3784
3739
|
return typeof n.ns == "string" && (n.ns = [n.ns]), typeof n.fallbackLng == "string" && (n.fallbackLng = [n.fallbackLng]), typeof n.fallbackNS == "string" && (n.fallbackNS = [n.fallbackNS]), n.supportedLngs && n.supportedLngs.indexOf("cimode") < 0 && (n.supportedLngs = n.supportedLngs.concat(["cimode"])), n;
|
|
3785
3740
|
}
|
|
3786
3741
|
function le() {
|
|
3787
3742
|
}
|
|
3788
|
-
function
|
|
3743
|
+
function ns(n) {
|
|
3789
3744
|
Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t) => {
|
|
3790
3745
|
typeof n[t] == "function" && (n[t] = n[t].bind(n));
|
|
3791
3746
|
});
|
|
@@ -3793,9 +3748,9 @@ function ls(n) {
|
|
|
3793
3748
|
class ae extends Ne {
|
|
3794
3749
|
constructor() {
|
|
3795
3750
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
3796
|
-
if (super(), this.options =
|
|
3751
|
+
if (super(), this.options = Ct(e), this.services = {}, this.logger = j, this.modules = {
|
|
3797
3752
|
external: []
|
|
3798
|
-
},
|
|
3753
|
+
}, ns(this), t && !this.isInitialized && !e.isClone) {
|
|
3799
3754
|
if (!this.options.initImmediate)
|
|
3800
3755
|
return this.init(e, t), this;
|
|
3801
3756
|
setTimeout(() => {
|
|
@@ -3807,11 +3762,11 @@ class ae extends Ne {
|
|
|
3807
3762
|
var e = this;
|
|
3808
3763
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = arguments.length > 1 ? arguments[1] : void 0;
|
|
3809
3764
|
typeof t == "function" && (i = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (typeof t.ns == "string" ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
3810
|
-
const a =
|
|
3765
|
+
const a = wt();
|
|
3811
3766
|
this.options = {
|
|
3812
3767
|
...a,
|
|
3813
3768
|
...this.options,
|
|
3814
|
-
...
|
|
3769
|
+
...Ct(t)
|
|
3815
3770
|
}, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
|
|
3816
3771
|
...a.interpolation,
|
|
3817
3772
|
...this.options.interpolation
|
|
@@ -3822,17 +3777,17 @@ class ae extends Ne {
|
|
|
3822
3777
|
if (!this.options.isClone) {
|
|
3823
3778
|
this.modules.logger ? j.init(s(this.modules.logger), this.options) : j.init(null, this.options);
|
|
3824
3779
|
let u;
|
|
3825
|
-
this.modules.formatter ? u = this.modules.formatter : typeof Intl != "undefined" && (u =
|
|
3826
|
-
const p = new
|
|
3827
|
-
this.store = new
|
|
3780
|
+
this.modules.formatter ? u = this.modules.formatter : typeof Intl != "undefined" && (u = Ya);
|
|
3781
|
+
const p = new Nt(this.options);
|
|
3782
|
+
this.store = new St(this.options.resources, this.options);
|
|
3828
3783
|
const c = this.services;
|
|
3829
|
-
c.logger = j, c.resourceStore = this.store, c.languageUtils = p, c.pluralResolver = new
|
|
3784
|
+
c.logger = j, c.resourceStore = this.store, c.languageUtils = p, c.pluralResolver = new Ha(p, {
|
|
3830
3785
|
prepend: this.options.pluralSeparator,
|
|
3831
3786
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
3832
3787
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
3833
|
-
}), u && (!this.options.interpolation.format || this.options.interpolation.format === a.interpolation.format) && (c.formatter = s(u), c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new
|
|
3788
|
+
}), u && (!this.options.interpolation.format || this.options.interpolation.format === a.interpolation.format) && (c.formatter = s(u), c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new Za(this.options), c.utils = {
|
|
3834
3789
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
3835
|
-
}, c.backendConnector = new
|
|
3790
|
+
}, c.backendConnector = new ts(s(this.modules.backend), c.resourceStore, c, this.options), c.backendConnector.on("*", function(v) {
|
|
3836
3791
|
for (var S = arguments.length, k = new Array(S > 1 ? S - 1 : 0), y = 1; y < S; y++)
|
|
3837
3792
|
k[y - 1] = arguments[y];
|
|
3838
3793
|
e.emit(v, ...k);
|
|
@@ -3998,7 +3953,7 @@ class ae extends Ne {
|
|
|
3998
3953
|
dir(e) {
|
|
3999
3954
|
if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e)
|
|
4000
3955
|
return "rtl";
|
|
4001
|
-
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], i = this.services && this.services.languageUtils || new
|
|
3956
|
+
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], i = this.services && this.services.languageUtils || new Nt(wt());
|
|
4002
3957
|
return t.indexOf(i.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
4003
3958
|
}
|
|
4004
3959
|
static createInstance() {
|
|
@@ -4020,7 +3975,7 @@ class ae extends Ne {
|
|
|
4020
3975
|
...this.services
|
|
4021
3976
|
}, s.services.utils = {
|
|
4022
3977
|
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
4023
|
-
}, i && (s.store = new
|
|
3978
|
+
}, i && (s.store = new St(this.store.data, a), s.services.resourceStore = s.store), s.translator = new ve(s.services, a), s.translator.on("*", function(o) {
|
|
4024
3979
|
for (var d = arguments.length, l = new Array(d > 1 ? d - 1 : 0), u = 1; u < d; u++)
|
|
4025
3980
|
l[u - 1] = arguments[u];
|
|
4026
3981
|
s.emit(o, ...l);
|
|
@@ -4054,7 +4009,52 @@ U.setDefaultNamespace;
|
|
|
4054
4009
|
U.hasLoadedNamespace;
|
|
4055
4010
|
U.loadNamespaces;
|
|
4056
4011
|
U.loadLanguages;
|
|
4057
|
-
|
|
4012
|
+
const is = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, as = {
|
|
4013
|
+
"&": "&",
|
|
4014
|
+
"&": "&",
|
|
4015
|
+
"<": "<",
|
|
4016
|
+
"<": "<",
|
|
4017
|
+
">": ">",
|
|
4018
|
+
">": ">",
|
|
4019
|
+
"'": "'",
|
|
4020
|
+
"'": "'",
|
|
4021
|
+
""": '"',
|
|
4022
|
+
""": '"',
|
|
4023
|
+
" ": " ",
|
|
4024
|
+
" ": " ",
|
|
4025
|
+
"©": "©",
|
|
4026
|
+
"©": "©",
|
|
4027
|
+
"®": "®",
|
|
4028
|
+
"®": "®",
|
|
4029
|
+
"…": "…",
|
|
4030
|
+
"…": "…",
|
|
4031
|
+
"/": "/",
|
|
4032
|
+
"/": "/"
|
|
4033
|
+
}, ss = (n) => as[n], rs = (n) => n.replace(is, ss);
|
|
4034
|
+
let Et = {
|
|
4035
|
+
bindI18n: "languageChanged",
|
|
4036
|
+
bindI18nStore: "",
|
|
4037
|
+
transEmptyNodeValue: "",
|
|
4038
|
+
transSupportBasicHtmlNodes: !0,
|
|
4039
|
+
transWrapTextNodes: "",
|
|
4040
|
+
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
4041
|
+
useSuspense: !0,
|
|
4042
|
+
unescape: rs
|
|
4043
|
+
};
|
|
4044
|
+
function os() {
|
|
4045
|
+
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
4046
|
+
Et = {
|
|
4047
|
+
...Et,
|
|
4048
|
+
...n
|
|
4049
|
+
};
|
|
4050
|
+
}
|
|
4051
|
+
const ls = {
|
|
4052
|
+
type: "3rdParty",
|
|
4053
|
+
init(n) {
|
|
4054
|
+
os(n.options.react);
|
|
4055
|
+
}
|
|
4056
|
+
};
|
|
4057
|
+
Va(U, ls);
|
|
4058
4058
|
const er = (n) => va(U, n);
|
|
4059
4059
|
let Ge = /* @__PURE__ */ new Map();
|
|
4060
4060
|
const Ie = Ot(Ge), tr = ({ children: n, stores: e }) => {
|
|
@@ -4157,7 +4157,7 @@ export {
|
|
|
4157
4157
|
Js as getClientTimeZone,
|
|
4158
4158
|
ir as getStore,
|
|
4159
4159
|
ua as globalAtomStore,
|
|
4160
|
-
|
|
4160
|
+
Va as i18Init,
|
|
4161
4161
|
On as jsDownload,
|
|
4162
4162
|
Ks as logger,
|
|
4163
4163
|
je as nizza,
|