@mp-front/components 0.0.1-next-12 → 0.0.1-next-13
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as m, m as fe } from "./proxy-uRb7Bek8.js";
|
|
2
2
|
import { a as V } from "./classNames-BiTpavcN.js";
|
|
3
3
|
import * as U from "react";
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { P as
|
|
6
|
-
import { s as
|
|
7
|
-
import { u as
|
|
8
|
-
var
|
|
9
|
-
const { decorative: t, orientation: i =
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
4
|
+
import { useMemo as Ve, createElement as Ae, Fragment as De } from "react";
|
|
5
|
+
import { P as He, K as Pe, z as B, a2 as Ke, a7 as Me, E as ze, ab as Ue } from "./carousel.component-CdgrJtst.js";
|
|
6
|
+
import { s as Be, a as Je, I as Ze, u as _e } from "./useTranslation-B0fSob9I.js";
|
|
7
|
+
import { u as We } from "./index-q_fyr_Rn.js";
|
|
8
|
+
var Ye = "Separator", ce = "horizontal", Ge = ["horizontal", "vertical"], je = U.forwardRef((r, e) => {
|
|
9
|
+
const { decorative: t, orientation: i = ce, ...s } = r, n = Qe(i) ? i : ce, o = t ? { role: "none" } : { "aria-orientation": n === "vertical" ? n : void 0, role: "separator" };
|
|
10
|
+
return /* @__PURE__ */ m.jsx(
|
|
11
|
+
He.div,
|
|
12
12
|
{
|
|
13
13
|
"data-orientation": n,
|
|
14
14
|
...o,
|
|
@@ -17,34 +17,34 @@ var _e = "Separator", fe = "horizontal", We = ["horizontal", "vertical"], Pe = U
|
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
return
|
|
20
|
+
je.displayName = Ye;
|
|
21
|
+
function Qe(r) {
|
|
22
|
+
return Ge.includes(r);
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var qe = je;
|
|
25
25
|
const g = (r) => typeof r == "string", K = () => {
|
|
26
26
|
let r, e;
|
|
27
27
|
const t = new Promise((i, s) => {
|
|
28
28
|
r = i, e = s;
|
|
29
29
|
});
|
|
30
30
|
return t.resolve = r, t.reject = e, t;
|
|
31
|
-
},
|
|
31
|
+
}, he = (r) => r == null ? "" : "" + r, Xe = (r, e, t) => {
|
|
32
32
|
r.forEach((i) => {
|
|
33
33
|
e[i] && (t[i] = e[i]);
|
|
34
34
|
});
|
|
35
|
-
},
|
|
35
|
+
}, et = /###/g, de = (r) => r && r.indexOf("###") > -1 ? r.replace(et, ".") : r, pe = (r) => !r || g(r), M = (r, e, t) => {
|
|
36
36
|
const i = g(e) ? e.split(".") : e;
|
|
37
37
|
let s = 0;
|
|
38
38
|
for (; s < i.length - 1; ) {
|
|
39
|
-
if (
|
|
40
|
-
const n =
|
|
39
|
+
if (pe(r)) return {};
|
|
40
|
+
const n = de(i[s]);
|
|
41
41
|
!r[n] && t && (r[n] = new t()), Object.prototype.hasOwnProperty.call(r, n) ? r = r[n] : r = {}, ++s;
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return pe(r) ? {} : {
|
|
44
44
|
obj: r,
|
|
45
|
-
k:
|
|
45
|
+
k: de(i[s])
|
|
46
46
|
};
|
|
47
|
-
},
|
|
47
|
+
}, ge = (r, e, t) => {
|
|
48
48
|
const {
|
|
49
49
|
obj: i,
|
|
50
50
|
k: s
|
|
@@ -57,7 +57,7 @@ const g = (r) => typeof r == "string", K = () => {
|
|
|
57
57
|
for (; o.obj === void 0 && a.length; )
|
|
58
58
|
n = `${a[a.length - 1]}.${n}`, a = a.slice(0, a.length - 1), o = M(r, a, Object), o != null && o.obj && typeof o.obj[`${o.k}.${n}`] < "u" && (o.obj = void 0);
|
|
59
59
|
o.obj[`${o.k}.${n}`] = t;
|
|
60
|
-
},
|
|
60
|
+
}, tt = (r, e, t, i) => {
|
|
61
61
|
const {
|
|
62
62
|
obj: s,
|
|
63
63
|
k: n
|
|
@@ -70,15 +70,15 @@ const g = (r) => typeof r == "string", K = () => {
|
|
|
70
70
|
} = M(r, e);
|
|
71
71
|
if (t && Object.prototype.hasOwnProperty.call(t, i))
|
|
72
72
|
return t[i];
|
|
73
|
-
},
|
|
73
|
+
}, st = (r, e, t) => {
|
|
74
74
|
const i = G(r, t);
|
|
75
75
|
return i !== void 0 ? i : G(e, t);
|
|
76
76
|
}, $e = (r, e, t) => {
|
|
77
77
|
for (const i in e)
|
|
78
78
|
i !== "__proto__" && i !== "constructor" && (i in r ? g(r[i]) || r[i] instanceof String || g(e[i]) || e[i] instanceof String ? t && (r[i] = e[i]) : $e(r[i], e[i], t) : r[i] = e[i]);
|
|
79
79
|
return r;
|
|
80
|
-
},
|
|
81
|
-
var
|
|
80
|
+
}, T = (r) => r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
81
|
+
var it = {
|
|
82
82
|
"&": "&",
|
|
83
83
|
"<": "<",
|
|
84
84
|
">": ">",
|
|
@@ -86,8 +86,8 @@ var tt = {
|
|
|
86
86
|
"'": "'",
|
|
87
87
|
"/": "/"
|
|
88
88
|
};
|
|
89
|
-
const
|
|
90
|
-
class
|
|
89
|
+
const nt = (r) => g(r) ? r.replace(/[&<>"'\/]/g, (e) => it[e]) : r;
|
|
90
|
+
class rt {
|
|
91
91
|
constructor(e) {
|
|
92
92
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
93
93
|
}
|
|
@@ -99,11 +99,11 @@ class it {
|
|
|
99
99
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, i), this.regExpQueue.push(e), i;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const at = [" ", ",", "?", "!", ";"], ot = new rt(20), lt = (r, e, t) => {
|
|
103
103
|
e = e || "", t = t || "";
|
|
104
|
-
const i =
|
|
104
|
+
const i = at.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
|
|
105
105
|
if (i.length === 0) return !0;
|
|
106
|
-
const s =
|
|
106
|
+
const s = ot.getRegExp(`(${i.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
107
107
|
let n = !s.test(r);
|
|
108
108
|
if (!n) {
|
|
109
109
|
const a = r.indexOf(t);
|
|
@@ -130,7 +130,7 @@ const nt = [" ", ",", "?", "!", ";"], rt = new it(20), at = (r, e, t) => {
|
|
|
130
130
|
s = a;
|
|
131
131
|
}
|
|
132
132
|
return s;
|
|
133
|
-
}, J = (r) => r == null ? void 0 : r.replace("_", "-"),
|
|
133
|
+
}, J = (r) => r == null ? void 0 : r.replace("_", "-"), ut = {
|
|
134
134
|
type: "logger",
|
|
135
135
|
log(r) {
|
|
136
136
|
this.output("log", r);
|
|
@@ -151,7 +151,7 @@ class Q {
|
|
|
151
151
|
this.init(e, t);
|
|
152
152
|
}
|
|
153
153
|
init(e, t = {}) {
|
|
154
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
154
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || ut, this.options = t, this.debug = t.debug;
|
|
155
155
|
}
|
|
156
156
|
log(...e) {
|
|
157
157
|
return this.forward(e, "log", "", !0);
|
|
@@ -178,7 +178,7 @@ class Q {
|
|
|
178
178
|
return e = e || this.options, e.prefix = e.prefix || this.prefix, new Q(this.logger, e);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
var
|
|
181
|
+
var j = new Q();
|
|
182
182
|
class X {
|
|
183
183
|
constructor() {
|
|
184
184
|
this.observers = {};
|
|
@@ -209,7 +209,7 @@ class X {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
class
|
|
212
|
+
class me extends X {
|
|
213
213
|
constructor(e, t = {
|
|
214
214
|
ns: ["translation"],
|
|
215
215
|
defaultNS: "translation"
|
|
@@ -236,7 +236,7 @@ class ge extends X {
|
|
|
236
236
|
}) {
|
|
237
237
|
const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
|
|
238
238
|
let o = [e, t];
|
|
239
|
-
i && (o = o.concat(a ? i.split(a) : i)), e.indexOf(".") > -1 && (o = e.split("."), s = t, t = o[1]), this.addNamespaces(t),
|
|
239
|
+
i && (o = o.concat(a ? i.split(a) : i)), e.indexOf(".") > -1 && (o = e.split("."), s = t, t = o[1]), this.addNamespaces(t), ge(this.data, o, s), n.silent || this.emit("added", e, t, i, s);
|
|
240
240
|
}
|
|
241
241
|
addResources(e, t, i, s = {
|
|
242
242
|
silent: !1
|
|
@@ -257,7 +257,7 @@ class ge extends X {
|
|
|
257
257
|
a.skipCopy || (i = JSON.parse(JSON.stringify(i))), s ? $e(u, i, n) : u = {
|
|
258
258
|
...u,
|
|
259
259
|
...i
|
|
260
|
-
},
|
|
260
|
+
}, ge(this.data, o, u), a.silent || this.emit("added", e, t, i);
|
|
261
261
|
}
|
|
262
262
|
removeResourceBundle(e, t) {
|
|
263
263
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -279,7 +279,7 @@ class ge extends X {
|
|
|
279
279
|
return this.data;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
var
|
|
282
|
+
var ke = {
|
|
283
283
|
processors: {},
|
|
284
284
|
addPostProcessor(r) {
|
|
285
285
|
this.processors[r.name] = r;
|
|
@@ -291,25 +291,25 @@ var je = {
|
|
|
291
291
|
}), e;
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
-
const
|
|
295
|
-
function
|
|
294
|
+
const Ee = Symbol("i18next/PATH_KEY");
|
|
295
|
+
function ft() {
|
|
296
296
|
const r = [], e = /* @__PURE__ */ Object.create(null);
|
|
297
297
|
let t;
|
|
298
298
|
return e.get = (i, s) => {
|
|
299
299
|
var n;
|
|
300
|
-
return (n = t == null ? void 0 : t.revoke) == null || n.call(t), s ===
|
|
300
|
+
return (n = t == null ? void 0 : t.revoke) == null || n.call(t), s === Ee ? r : (r.push(s), t = Proxy.revocable(i, e), t.proxy);
|
|
301
301
|
}, Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
|
|
302
302
|
}
|
|
303
303
|
function ne(r, e) {
|
|
304
304
|
const {
|
|
305
|
-
[
|
|
306
|
-
} = r(
|
|
305
|
+
[Ee]: t
|
|
306
|
+
} = r(ft());
|
|
307
307
|
return t.join((e == null ? void 0 : e.keySeparator) ?? ".");
|
|
308
308
|
}
|
|
309
|
-
const
|
|
309
|
+
const xe = {}, ee = (r) => !g(r) && typeof r != "boolean" && typeof r != "number";
|
|
310
310
|
class q extends X {
|
|
311
311
|
constructor(e, t = {}) {
|
|
312
|
-
super(),
|
|
312
|
+
super(), Xe(["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");
|
|
313
313
|
}
|
|
314
314
|
changeLanguage(e) {
|
|
315
315
|
e && (this.language = e);
|
|
@@ -331,7 +331,7 @@ class q extends X {
|
|
|
331
331
|
i === void 0 && (i = ":");
|
|
332
332
|
const s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
333
333
|
let n = t.ns || this.options.defaultNS || [];
|
|
334
|
-
const a = i && e.indexOf(i) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
334
|
+
const a = i && e.indexOf(i) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !lt(e, i, s);
|
|
335
335
|
if (a && !o) {
|
|
336
336
|
const u = e.match(this.interpolator.nestingRegexp);
|
|
337
337
|
if (u && u.length > 0)
|
|
@@ -383,27 +383,27 @@ class q extends X {
|
|
|
383
383
|
} : o;
|
|
384
384
|
const d = this.resolve(e, s);
|
|
385
385
|
let h = d == null ? void 0 : d.res;
|
|
386
|
-
const
|
|
386
|
+
const x = (d == null ? void 0 : d.usedKey) || o, y = (d == null ? void 0 : d.exactUsedKey) || o, v = ["[object Number]", "[object Function]", "[object RegExp]"], w = s.joinArrays !== void 0 ? s.joinArrays : this.options.joinArrays, F = !this.i18nFormat || this.i18nFormat.handleAsObject, L = s.count !== void 0 && !g(s.count), $ = q.hasDefaultValue(s), _ = L ? this.pluralResolver.getSuffix(f, s.count, s) : "", k = s.ordinal && L ? this.pluralResolver.getSuffix(f, s.count, {
|
|
387
387
|
ordinal: !1
|
|
388
|
-
}) : "",
|
|
388
|
+
}) : "", A = L && !s.ordinal && s.count === 0, O = A && s[`defaultValue${this.options.pluralSeparator}zero`] || s[`defaultValue${_}`] || s[`defaultValue${k}`] || s.defaultValue;
|
|
389
389
|
let b = h;
|
|
390
|
-
F && !h &&
|
|
391
|
-
const
|
|
392
|
-
if (F && b &&
|
|
390
|
+
F && !h && $ && (b = O);
|
|
391
|
+
const Ie = ee(b), Te = Object.prototype.toString.apply(b);
|
|
392
|
+
if (F && b && Ie && v.indexOf(Te) < 0 && !(g(w) && Array.isArray(b))) {
|
|
393
393
|
if (!s.returnObjects && !this.options.returnObjects) {
|
|
394
394
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
395
|
-
const R = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(
|
|
395
|
+
const R = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(x, b, {
|
|
396
396
|
...s,
|
|
397
397
|
ns: u
|
|
398
398
|
}) : `key '${o} (${this.language})' returned an object instead of string.`;
|
|
399
399
|
return n ? (d.res = R, d.usedParams = this.getUsedParamsDetails(s), d) : R;
|
|
400
400
|
}
|
|
401
401
|
if (a) {
|
|
402
|
-
const R = Array.isArray(b), N = R ? [] : {}, ae = R ? y :
|
|
402
|
+
const R = Array.isArray(b), N = R ? [] : {}, ae = R ? y : x;
|
|
403
403
|
for (const P in b)
|
|
404
404
|
if (Object.prototype.hasOwnProperty.call(b, P)) {
|
|
405
405
|
const E = `${ae}${a}${P}`;
|
|
406
|
-
|
|
406
|
+
$ && !h ? N[P] = this.translate(E, {
|
|
407
407
|
...s,
|
|
408
408
|
defaultValue: ee(O) ? O[P] : void 0,
|
|
409
409
|
joinArrays: !1,
|
|
@@ -420,8 +420,8 @@ class q extends X {
|
|
|
420
420
|
h = h.join(w), h && (h = this.extendTranslation(h, e, s, i));
|
|
421
421
|
else {
|
|
422
422
|
let R = !1, N = !1;
|
|
423
|
-
!this.isValidLookup(h) &&
|
|
424
|
-
const P = (s.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && N ? void 0 : h, E =
|
|
423
|
+
!this.isValidLookup(h) && $ && (R = !0, h = O), this.isValidLookup(h) || (N = !0, h = o);
|
|
424
|
+
const P = (s.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && N ? void 0 : h, E = $ && O !== h && this.options.updateMissing;
|
|
425
425
|
if (N || R || E) {
|
|
426
426
|
if (this.logger.log(E ? "updateKey" : "missingKey", f, l, o, E ? O : h), a) {
|
|
427
427
|
const C = this.resolve(o, {
|
|
@@ -430,23 +430,23 @@ class q extends X {
|
|
|
430
430
|
});
|
|
431
431
|
C && C.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
|
|
432
432
|
}
|
|
433
|
-
let
|
|
433
|
+
let D = [];
|
|
434
434
|
const W = this.languageUtils.getFallbackCodes(this.options.fallbackLng, s.lng || this.language);
|
|
435
435
|
if (this.options.saveMissingTo === "fallback" && W && W[0])
|
|
436
436
|
for (let C = 0; C < W.length; C++)
|
|
437
|
-
|
|
438
|
-
else this.options.saveMissingTo === "all" ?
|
|
439
|
-
const oe = (C,
|
|
437
|
+
D.push(W[C]);
|
|
438
|
+
else this.options.saveMissingTo === "all" ? D = this.languageUtils.toResolveHierarchy(s.lng || this.language) : D.push(s.lng || this.language);
|
|
439
|
+
const oe = (C, I, H) => {
|
|
440
440
|
var ue;
|
|
441
|
-
const le =
|
|
442
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(C, l,
|
|
441
|
+
const le = $ && H !== h ? H : P;
|
|
442
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(C, l, I, le, E, s) : (ue = this.backendConnector) != null && ue.saveMissing && this.backendConnector.saveMissing(C, l, I, le, E, s), this.emit("missingKey", C, l, I, h);
|
|
443
443
|
};
|
|
444
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && L ?
|
|
445
|
-
const
|
|
446
|
-
|
|
444
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && L ? D.forEach((C) => {
|
|
445
|
+
const I = this.pluralResolver.getSuffixes(C, s);
|
|
446
|
+
A && s[`defaultValue${this.options.pluralSeparator}zero`] && I.indexOf(`${this.options.pluralSeparator}zero`) < 0 && I.push(`${this.options.pluralSeparator}zero`), I.forEach((H) => {
|
|
447
447
|
oe([C], o + H, s[`defaultValue${H}`] || O);
|
|
448
448
|
});
|
|
449
|
-
}) : oe(
|
|
449
|
+
}) : oe(D, o, O));
|
|
450
450
|
}
|
|
451
451
|
h = this.extendTranslation(h, e, s, d, i), N && h === o && this.options.appendNamespaceToMissingKey && (h = `${l}${c}${o}`), (N || R) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${c}${o}` : o, R ? h : void 0, s));
|
|
452
452
|
}
|
|
@@ -486,7 +486,7 @@ class q extends X {
|
|
|
486
486
|
!i.lng && s && s.res && (i.lng = this.language || s.usedLng), i.nest !== !1 && (e = this.interpolator.nest(e, (...d) => (n == null ? void 0 : n[0]) === d[0] && !i.context ? (this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${t[0]}`), null) : this.translate(...d, t), i)), i.interpolation && this.interpolator.reset();
|
|
487
487
|
}
|
|
488
488
|
const a = i.postProcess || this.options.postProcess, o = g(a) ? [a] : a;
|
|
489
|
-
return e != null && (o != null && o.length) && i.applyPostProcessor !== !1 && (e =
|
|
489
|
+
return e != null && (o != null && o.length) && i.applyPostProcessor !== !1 && (e = ke.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
490
490
|
i18nResolved: {
|
|
491
491
|
...s,
|
|
492
492
|
usedParams: this.getUsedParamsDetails(i)
|
|
@@ -502,10 +502,10 @@ class q extends X {
|
|
|
502
502
|
s = c;
|
|
503
503
|
let f = l.namespaces;
|
|
504
504
|
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
505
|
-
const p = t.count !== void 0 && !g(t.count), d = p && !t.ordinal && t.count === 0, h = t.context !== void 0 && (g(t.context) || typeof t.context == "number") && t.context !== "",
|
|
505
|
+
const p = t.count !== void 0 && !g(t.count), d = p && !t.ordinal && t.count === 0, h = t.context !== void 0 && (g(t.context) || typeof t.context == "number") && t.context !== "", x = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
506
506
|
f.forEach((y) => {
|
|
507
507
|
var v, w;
|
|
508
|
-
this.isValidLookup(i) || (o = y, !
|
|
508
|
+
this.isValidLookup(i) || (o = y, !xe[`${x[0]}-${y}`] && ((v = this.utils) != null && v.hasLoadedNamespace) && !((w = this.utils) != null && w.hasLoadedNamespace(o)) && (xe[`${x[0]}-${y}`] = !0, this.logger.warn(`key "${s}" for languages "${x.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!!!")), x.forEach((F) => {
|
|
509
509
|
var _;
|
|
510
510
|
if (this.isValidLookup(i)) return;
|
|
511
511
|
a = F;
|
|
@@ -515,15 +515,15 @@ class q extends X {
|
|
|
515
515
|
else {
|
|
516
516
|
let k;
|
|
517
517
|
p && (k = this.pluralResolver.getSuffix(F, t.count, t));
|
|
518
|
-
const
|
|
519
|
-
if (p && (t.ordinal && k.indexOf(O) === 0 && L.push(c + k.replace(O, this.options.pluralSeparator)), L.push(c + k), d && L.push(c +
|
|
518
|
+
const A = `${this.options.pluralSeparator}zero`, O = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
519
|
+
if (p && (t.ordinal && k.indexOf(O) === 0 && L.push(c + k.replace(O, this.options.pluralSeparator)), L.push(c + k), d && L.push(c + A)), h) {
|
|
520
520
|
const b = `${c}${this.options.contextSeparator || "_"}${t.context}`;
|
|
521
|
-
L.push(b), p && (t.ordinal && k.indexOf(O) === 0 && L.push(b + k.replace(O, this.options.pluralSeparator)), L.push(b + k), d && L.push(b +
|
|
521
|
+
L.push(b), p && (t.ordinal && k.indexOf(O) === 0 && L.push(b + k.replace(O, this.options.pluralSeparator)), L.push(b + k), d && L.push(b + A));
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
let
|
|
525
|
-
for (;
|
|
526
|
-
this.isValidLookup(i) || (n =
|
|
524
|
+
let $;
|
|
525
|
+
for (; $ = L.pop(); )
|
|
526
|
+
this.isValidLookup(i) || (n = $, i = this.getResource(F, y, $, t));
|
|
527
527
|
}));
|
|
528
528
|
});
|
|
529
529
|
}), {
|
|
@@ -564,9 +564,9 @@ class q extends X {
|
|
|
564
564
|
return !1;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
class
|
|
567
|
+
class ye {
|
|
568
568
|
constructor(e) {
|
|
569
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
569
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = j.create("languageUtils");
|
|
570
570
|
}
|
|
571
571
|
getScriptPartFromCode(e) {
|
|
572
572
|
if (e = J(e), !e || e.indexOf("-") < 0) return null;
|
|
@@ -628,22 +628,22 @@ class xe {
|
|
|
628
628
|
}), s;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
const
|
|
631
|
+
const Se = {
|
|
632
632
|
zero: 0,
|
|
633
633
|
one: 1,
|
|
634
634
|
two: 2,
|
|
635
635
|
few: 3,
|
|
636
636
|
many: 4,
|
|
637
637
|
other: 5
|
|
638
|
-
},
|
|
638
|
+
}, be = {
|
|
639
639
|
select: (r) => r === 1 ? "one" : "other",
|
|
640
640
|
resolvedOptions: () => ({
|
|
641
641
|
pluralCategories: ["one", "other"]
|
|
642
642
|
})
|
|
643
643
|
};
|
|
644
|
-
class
|
|
644
|
+
class ct {
|
|
645
645
|
constructor(e, t = {}) {
|
|
646
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
646
|
+
this.languageUtils = e, this.options = t, this.logger = j.create("pluralResolver"), this.pluralRulesCache = {};
|
|
647
647
|
}
|
|
648
648
|
clearCache() {
|
|
649
649
|
this.pluralRulesCache = {};
|
|
@@ -662,8 +662,8 @@ class ut {
|
|
|
662
662
|
});
|
|
663
663
|
} catch {
|
|
664
664
|
if (typeof Intl > "u")
|
|
665
|
-
return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
666
|
-
if (!e.match(/-|_/)) return
|
|
665
|
+
return this.logger.error("No Intl support, please use an Intl polyfill!"), be;
|
|
666
|
+
if (!e.match(/-|_/)) return be;
|
|
667
667
|
const u = this.languageUtils.getLanguagePartFromCode(e);
|
|
668
668
|
a = this.getRule(u, t);
|
|
669
669
|
}
|
|
@@ -678,21 +678,21 @@ class ut {
|
|
|
678
678
|
}
|
|
679
679
|
getSuffixes(e, t = {}) {
|
|
680
680
|
let i = this.getRule(e, t);
|
|
681
|
-
return i || (i = this.getRule("dev", t)), i ? i.resolvedOptions().pluralCategories.sort((s, n) =>
|
|
681
|
+
return i || (i = this.getRule("dev", t)), i ? i.resolvedOptions().pluralCategories.sort((s, n) => Se[s] - Se[n]).map((s) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : [];
|
|
682
682
|
}
|
|
683
683
|
getSuffix(e, t, i = {}) {
|
|
684
684
|
const s = this.getRule(e, i);
|
|
685
685
|
return s ? `${this.options.prepend}${i.ordinal ? `ordinal${this.options.prepend}` : ""}${s.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, i));
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
const
|
|
689
|
-
let n =
|
|
688
|
+
const Le = (r, e, t, i = ".", s = !0) => {
|
|
689
|
+
let n = st(r, e, t);
|
|
690
690
|
return !n && s && g(t) && (n = ie(r, t, i), n === void 0 && (n = ie(e, t, i))), n;
|
|
691
691
|
}, te = (r) => r.replace(/\$/g, "$$$$");
|
|
692
|
-
class
|
|
692
|
+
class Oe {
|
|
693
693
|
constructor(e = {}) {
|
|
694
694
|
var t;
|
|
695
|
-
this.logger =
|
|
695
|
+
this.logger = j.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((i) => i), this.init(e);
|
|
696
696
|
}
|
|
697
697
|
init(e = {}) {
|
|
698
698
|
e.interpolation || (e.interpolation = {
|
|
@@ -712,12 +712,12 @@ class Le {
|
|
|
712
712
|
nestingPrefix: p,
|
|
713
713
|
nestingPrefixEscaped: d,
|
|
714
714
|
nestingSuffix: h,
|
|
715
|
-
nestingSuffixEscaped:
|
|
715
|
+
nestingSuffixEscaped: x,
|
|
716
716
|
nestingOptionsSeparator: y,
|
|
717
717
|
maxReplaces: v,
|
|
718
718
|
alwaysFormat: w
|
|
719
719
|
} = e.interpolation;
|
|
720
|
-
this.escape = t !== void 0 ? t :
|
|
720
|
+
this.escape = t !== void 0 ? t : nt, this.escapeValue = i !== void 0 ? i : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = n ? T(n) : a || "{{", this.suffix = o ? T(o) : u || "}}", this.formatSeparator = l || ",", this.unescapePrefix = c ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : c || "", this.nestingPrefix = p ? T(p) : d || T("$t("), this.nestingSuffix = h ? T(h) : x || T(")"), this.nestingOptionsSeparator = y || ",", this.maxReplaces = v || 1e3, this.alwaysFormat = w !== void 0 ? w : !1, this.resetRegExp();
|
|
721
721
|
}
|
|
722
722
|
reset() {
|
|
723
723
|
this.options && this.init(this.options);
|
|
@@ -731,15 +731,15 @@ class Le {
|
|
|
731
731
|
let n, a, o;
|
|
732
732
|
const u = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (h) => {
|
|
733
733
|
if (h.indexOf(this.formatSeparator) < 0) {
|
|
734
|
-
const w =
|
|
734
|
+
const w = Le(t, u, h, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
735
735
|
return this.alwaysFormat ? this.format(w, void 0, i, {
|
|
736
736
|
...s,
|
|
737
737
|
...t,
|
|
738
738
|
interpolationkey: h
|
|
739
739
|
}) : w;
|
|
740
740
|
}
|
|
741
|
-
const
|
|
742
|
-
return this.format(
|
|
741
|
+
const x = h.split(this.formatSeparator), y = x.shift().trim(), v = x.join(this.formatSeparator).trim();
|
|
742
|
+
return this.format(Le(t, u, y, this.options.keySeparator, this.options.ignoreJSONStructure), v, i, {
|
|
743
743
|
...s,
|
|
744
744
|
...t,
|
|
745
745
|
interpolationkey: y
|
|
@@ -755,19 +755,19 @@ class Le {
|
|
|
755
755
|
safeValue: (h) => this.escapeValue ? te(this.escape(h)) : te(h)
|
|
756
756
|
}].forEach((h) => {
|
|
757
757
|
for (o = 0; n = h.regex.exec(e); ) {
|
|
758
|
-
const
|
|
759
|
-
if (a = l(
|
|
758
|
+
const x = n[1].trim();
|
|
759
|
+
if (a = l(x), a === void 0)
|
|
760
760
|
if (typeof c == "function") {
|
|
761
761
|
const v = c(e, n, s);
|
|
762
762
|
a = g(v) ? v : "";
|
|
763
|
-
} else if (s && Object.prototype.hasOwnProperty.call(s,
|
|
763
|
+
} else if (s && Object.prototype.hasOwnProperty.call(s, x))
|
|
764
764
|
a = "";
|
|
765
765
|
else if (f) {
|
|
766
766
|
a = n[0];
|
|
767
767
|
continue;
|
|
768
768
|
} else
|
|
769
|
-
this.logger.warn(`missed to pass in variable ${
|
|
770
|
-
else !g(a) && !this.useRawValueToEscape && (a =
|
|
769
|
+
this.logger.warn(`missed to pass in variable ${x} for interpolating ${e}`), a = "";
|
|
770
|
+
else !g(a) && !this.useRawValueToEscape && (a = he(a));
|
|
771
771
|
const y = h.safeValue(a);
|
|
772
772
|
if (e = e.replace(n[0], y), f ? (h.regex.lastIndex += a.length, h.regex.lastIndex -= n[0].length) : h.regex.lastIndex = 0, o++, o >= this.maxReplaces)
|
|
773
773
|
break;
|
|
@@ -779,7 +779,7 @@ class Le {
|
|
|
779
779
|
const o = (u, l) => {
|
|
780
780
|
const c = this.nestingOptionsSeparator;
|
|
781
781
|
if (u.indexOf(c) < 0) return u;
|
|
782
|
-
const f = u.split(new RegExp(`${
|
|
782
|
+
const f = u.split(new RegExp(`${T(c)}[ ]*{`));
|
|
783
783
|
let p = `{${f[1]}`;
|
|
784
784
|
u = f[0], p = this.interpolate(p, a);
|
|
785
785
|
const d = p.match(/'/g), h = p.match(/"/g);
|
|
@@ -789,8 +789,8 @@ class Le {
|
|
|
789
789
|
...l,
|
|
790
790
|
...a
|
|
791
791
|
});
|
|
792
|
-
} catch (
|
|
793
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${u}`,
|
|
792
|
+
} catch (x) {
|
|
793
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${u}`, x), `${u}${c}${p}`;
|
|
794
794
|
}
|
|
795
795
|
return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, u;
|
|
796
796
|
};
|
|
@@ -801,7 +801,7 @@ class Le {
|
|
|
801
801
|
}, a = a.replace && !g(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
802
802
|
const l = /{.*}/.test(s[1]) ? s[1].lastIndexOf("}") + 1 : s[1].indexOf(this.formatSeparator);
|
|
803
803
|
if (l !== -1 && (u = s[1].slice(l).split(this.formatSeparator).map((c) => c.trim()).filter(Boolean), s[1] = s[1].slice(0, l)), n = t(o.call(this, s[1].trim(), a), a), n && s[0] === e && !g(n)) return n;
|
|
804
|
-
g(n) || (n =
|
|
804
|
+
g(n) || (n = he(n)), n || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), n = ""), u.length && (n = u.reduce((c, f) => this.format(c, f, i.lng, {
|
|
805
805
|
...i,
|
|
806
806
|
interpolationkey: s[1].trim()
|
|
807
807
|
}), n.trim())), e = e.replace(s[0], n), this.regexp.lastIndex = 0;
|
|
@@ -809,7 +809,7 @@ class Le {
|
|
|
809
809
|
return e;
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
const
|
|
812
|
+
const ht = (r) => {
|
|
813
813
|
let e = r.toLowerCase().trim();
|
|
814
814
|
const t = {};
|
|
815
815
|
if (r.indexOf("(") > -1) {
|
|
@@ -827,7 +827,7 @@ const ft = (r) => {
|
|
|
827
827
|
formatName: e,
|
|
828
828
|
formatOptions: t
|
|
829
829
|
};
|
|
830
|
-
},
|
|
830
|
+
}, Ce = (r) => {
|
|
831
831
|
const e = {};
|
|
832
832
|
return (t, i, s) => {
|
|
833
833
|
let n = s;
|
|
@@ -839,16 +839,16 @@ const ft = (r) => {
|
|
|
839
839
|
let o = e[a];
|
|
840
840
|
return o || (o = r(J(i), s), e[a] = o), o(t);
|
|
841
841
|
};
|
|
842
|
-
},
|
|
843
|
-
class
|
|
842
|
+
}, dt = (r) => (e, t, i) => r(J(t), i)(e);
|
|
843
|
+
class pt {
|
|
844
844
|
constructor(e = {}) {
|
|
845
|
-
this.logger =
|
|
845
|
+
this.logger = j.create("formatter"), this.options = e, this.init(e);
|
|
846
846
|
}
|
|
847
847
|
init(e, t = {
|
|
848
848
|
interpolation: {}
|
|
849
849
|
}) {
|
|
850
850
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
851
|
-
const i = t.cacheInBuiltFormats ?
|
|
851
|
+
const i = t.cacheInBuiltFormats ? Ce : dt;
|
|
852
852
|
this.formats = {
|
|
853
853
|
number: i((s, n) => {
|
|
854
854
|
const a = new Intl.NumberFormat(s, {
|
|
@@ -887,7 +887,7 @@ class ht {
|
|
|
887
887
|
this.formats[e.toLowerCase().trim()] = t;
|
|
888
888
|
}
|
|
889
889
|
addCached(e, t) {
|
|
890
|
-
this.formats[e.toLowerCase().trim()] =
|
|
890
|
+
this.formats[e.toLowerCase().trim()] = Ce(t);
|
|
891
891
|
}
|
|
892
892
|
format(e, t, i, s = {}) {
|
|
893
893
|
const n = t.split(this.formatSeparator);
|
|
@@ -900,7 +900,7 @@ class ht {
|
|
|
900
900
|
const {
|
|
901
901
|
formatName: l,
|
|
902
902
|
formatOptions: c
|
|
903
|
-
} =
|
|
903
|
+
} = ht(u);
|
|
904
904
|
if (this.formats[l]) {
|
|
905
905
|
let p = o;
|
|
906
906
|
try {
|
|
@@ -920,13 +920,13 @@ class ht {
|
|
|
920
920
|
}, e);
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
|
-
const
|
|
923
|
+
const gt = (r, e) => {
|
|
924
924
|
r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
|
|
925
925
|
};
|
|
926
|
-
class
|
|
926
|
+
class mt extends X {
|
|
927
927
|
constructor(e, t, i, s = {}) {
|
|
928
928
|
var n, a;
|
|
929
|
-
super(), this.backend = e, this.store = t, this.services = i, this.languageUtils = i.languageUtils, this.options = s, this.logger =
|
|
929
|
+
super(), this.backend = e, this.store = t, this.services = i, this.languageUtils = i.languageUtils, this.options = s, this.logger = j.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = s.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, this.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, this.state = {}, this.queue = [], (a = (n = this.backend) == null ? void 0 : n.init) == null || a.call(n, i, s.backend, s);
|
|
930
930
|
}
|
|
931
931
|
queueLoad(e, t, i, s) {
|
|
932
932
|
const n = {}, a = {}, o = {}, u = {};
|
|
@@ -956,7 +956,7 @@ class pt extends X {
|
|
|
956
956
|
}), this.state[e] = t ? -1 : 2, t && i && (this.state[e] = 0);
|
|
957
957
|
const o = {};
|
|
958
958
|
this.queue.forEach((u) => {
|
|
959
|
-
|
|
959
|
+
tt(u.loaded, [n], a), gt(u, e), t && u.errors.push(t), u.pendingCount === 0 && !u.done && (Object.keys(u.loaded).forEach((l) => {
|
|
960
960
|
o[l] || (o[l] = {});
|
|
961
961
|
const c = u.loaded[l];
|
|
962
962
|
c.length && c.forEach((f) => {
|
|
@@ -1043,10 +1043,10 @@ class pt extends X {
|
|
|
1043
1043
|
}, h = this.backend.create.bind(this.backend);
|
|
1044
1044
|
if (h.length < 6)
|
|
1045
1045
|
try {
|
|
1046
|
-
let
|
|
1047
|
-
h.length === 5 ?
|
|
1048
|
-
} catch (
|
|
1049
|
-
o(
|
|
1046
|
+
let x;
|
|
1047
|
+
h.length === 5 ? x = h(e, t, i, s, d) : x = h(e, t, i, s), x && typeof x.then == "function" ? x.then((y) => o(null, y)).catch(o) : o(null, x);
|
|
1048
|
+
} catch (x) {
|
|
1049
|
+
o(x);
|
|
1050
1050
|
}
|
|
1051
1051
|
else
|
|
1052
1052
|
h(e, t, i, s, o, d);
|
|
@@ -1112,17 +1112,17 @@ const se = () => ({
|
|
|
1112
1112
|
skipOnVariables: !0
|
|
1113
1113
|
},
|
|
1114
1114
|
cacheInBuiltFormats: !0
|
|
1115
|
-
}),
|
|
1115
|
+
}), we = (r) => {
|
|
1116
1116
|
var e, t;
|
|
1117
1117
|
return g(r.ns) && (r.ns = [r.ns]), g(r.fallbackLng) && (r.fallbackLng = [r.fallbackLng]), g(r.fallbackNS) && (r.fallbackNS = [r.fallbackNS]), ((t = (e = r.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (r.supportedLngs = r.supportedLngs.concat(["cimode"])), typeof r.initImmediate == "boolean" && (r.initAsync = r.initImmediate), r;
|
|
1118
1118
|
}, Y = () => {
|
|
1119
|
-
},
|
|
1119
|
+
}, xt = (r) => {
|
|
1120
1120
|
Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((t) => {
|
|
1121
1121
|
typeof r[t] == "function" && (r[t] = r[t].bind(r));
|
|
1122
1122
|
});
|
|
1123
1123
|
};
|
|
1124
|
-
let
|
|
1125
|
-
const
|
|
1124
|
+
let ve = !1;
|
|
1125
|
+
const yt = (r) => {
|
|
1126
1126
|
var e, t, i, s, n, a, o, u, l;
|
|
1127
1127
|
return !!(((i = (t = (e = r == null ? void 0 : r.modules) == null ? void 0 : e.backend) == null ? void 0 : t.name) == null ? void 0 : i.indexOf("Locize")) > 0 || ((o = (a = (n = (s = r == null ? void 0 : r.modules) == null ? void 0 : s.backend) == null ? void 0 : n.constructor) == null ? void 0 : a.name) == null ? void 0 : o.indexOf("Locize")) > 0 || (l = (u = r == null ? void 0 : r.options) == null ? void 0 : u.backend) != null && l.backends && r.options.backend.backends.some((c) => {
|
|
1128
1128
|
var f, p, d;
|
|
@@ -1131,9 +1131,9 @@ const mt = (r) => {
|
|
|
1131
1131
|
};
|
|
1132
1132
|
class z extends X {
|
|
1133
1133
|
constructor(e = {}, t) {
|
|
1134
|
-
if (super(), this.options =
|
|
1134
|
+
if (super(), this.options = we(e), this.services = {}, this.logger = j, this.modules = {
|
|
1135
1135
|
external: []
|
|
1136
|
-
},
|
|
1136
|
+
}, xt(this), t && !this.isInitialized && !e.isClone) {
|
|
1137
1137
|
if (!this.options.initAsync)
|
|
1138
1138
|
return this.init(e, t), this;
|
|
1139
1139
|
setTimeout(() => {
|
|
@@ -1147,25 +1147,25 @@ class z extends X {
|
|
|
1147
1147
|
this.options = {
|
|
1148
1148
|
...i,
|
|
1149
1149
|
...this.options,
|
|
1150
|
-
...
|
|
1150
|
+
...we(e)
|
|
1151
1151
|
}, this.options.interpolation = {
|
|
1152
1152
|
...i.interpolation,
|
|
1153
1153
|
...this.options.interpolation
|
|
1154
|
-
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = i.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !
|
|
1154
|
+
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = i.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !yt(this) && !ve && (typeof console < "u" && typeof console.info < "u" && console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"), ve = !0);
|
|
1155
1155
|
const s = (l) => l ? typeof l == "function" ? new l() : l : null;
|
|
1156
1156
|
if (!this.options.isClone) {
|
|
1157
|
-
this.modules.logger ?
|
|
1157
|
+
this.modules.logger ? j.init(s(this.modules.logger), this.options) : j.init(null, this.options);
|
|
1158
1158
|
let l;
|
|
1159
|
-
this.modules.formatter ? l = this.modules.formatter : l =
|
|
1160
|
-
const c = new
|
|
1161
|
-
this.store = new
|
|
1159
|
+
this.modules.formatter ? l = this.modules.formatter : l = pt;
|
|
1160
|
+
const c = new ye(this.options);
|
|
1161
|
+
this.store = new me(this.options.resources, this.options);
|
|
1162
1162
|
const f = this.services;
|
|
1163
|
-
f.logger =
|
|
1163
|
+
f.logger = j, f.resourceStore = this.store, f.languageUtils = c, f.pluralResolver = new ct(c, {
|
|
1164
1164
|
prepend: this.options.pluralSeparator,
|
|
1165
1165
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1166
|
-
}), this.options.interpolation.format && this.options.interpolation.format !== i.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), l && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (f.formatter = s(l), f.formatter.init && f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new
|
|
1166
|
+
}), this.options.interpolation.format && this.options.interpolation.format !== i.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), l && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (f.formatter = s(l), f.formatter.init && f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new Oe(this.options), f.utils = {
|
|
1167
1167
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1168
|
-
}, f.backendConnector = new
|
|
1168
|
+
}, f.backendConnector = new mt(s(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", (d, ...h) => {
|
|
1169
1169
|
this.emit(d, ...h);
|
|
1170
1170
|
}), this.modules.languageDetector && (f.languageDetector = s(this.modules.languageDetector), f.languageDetector.init && f.languageDetector.init(f, this.options.detection, this.options)), this.modules.i18nFormat && (f.i18nFormat = s(this.modules.i18nFormat), f.i18nFormat.init && f.i18nFormat.init(this)), this.translator = new q(this.services, this.options), this.translator.on("*", (d, ...h) => {
|
|
1171
1171
|
this.emit(d, ...h);
|
|
@@ -1218,7 +1218,7 @@ class z extends X {
|
|
|
1218
1218
|
use(e) {
|
|
1219
1219
|
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1220
1220
|
if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1221
|
-
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" &&
|
|
1221
|
+
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && ke.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1222
1222
|
}
|
|
1223
1223
|
setResolvedLanguage(e) {
|
|
1224
1224
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
@@ -1323,7 +1323,7 @@ class z extends X {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
} catch {
|
|
1325
1325
|
}
|
|
1326
|
-
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 = ((n = this.services) == null ? void 0 : n.languageUtils) || new
|
|
1326
|
+
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 = ((n = this.services) == null ? void 0 : n.languageUtils) || new ye(se());
|
|
1327
1327
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(i.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1328
1328
|
}
|
|
1329
1329
|
static createInstance(e = {}, t) {
|
|
@@ -1350,7 +1350,7 @@ class z extends X {
|
|
|
1350
1350
|
}, u[l] = Object.keys(u[l]).reduce((c, f) => (c[f] = {
|
|
1351
1351
|
...u[l][f]
|
|
1352
1352
|
}, c), u[l]), u), {});
|
|
1353
|
-
n.store = new
|
|
1353
|
+
n.store = new me(o, s), n.services.resourceStore = n.store;
|
|
1354
1354
|
}
|
|
1355
1355
|
if (e.interpolation) {
|
|
1356
1356
|
const u = {
|
|
@@ -1361,7 +1361,7 @@ class z extends X {
|
|
|
1361
1361
|
...s,
|
|
1362
1362
|
interpolation: u
|
|
1363
1363
|
};
|
|
1364
|
-
n.services.interpolator = new
|
|
1364
|
+
n.services.interpolator = new Oe(l);
|
|
1365
1365
|
}
|
|
1366
1366
|
return n.translator = new q(n.services, s), n.translator.on("*", (o, ...u) => {
|
|
1367
1367
|
n.emit(o, ...u);
|
|
@@ -1394,53 +1394,53 @@ S.setDefaultNamespace;
|
|
|
1394
1394
|
S.hasLoadedNamespace;
|
|
1395
1395
|
S.loadNamespaces;
|
|
1396
1396
|
S.loadLanguages;
|
|
1397
|
-
const
|
|
1397
|
+
const St = {
|
|
1398
1398
|
type: "3rdParty",
|
|
1399
1399
|
init(r) {
|
|
1400
|
-
|
|
1400
|
+
Be(r.options.react), Je(r);
|
|
1401
1401
|
}
|
|
1402
1402
|
};
|
|
1403
|
-
function
|
|
1403
|
+
function bt({
|
|
1404
1404
|
i18n: r,
|
|
1405
1405
|
defaultNS: e,
|
|
1406
1406
|
children: t
|
|
1407
1407
|
}) {
|
|
1408
|
-
const i =
|
|
1408
|
+
const i = Ve(() => ({
|
|
1409
1409
|
i18n: r,
|
|
1410
1410
|
defaultNS: e
|
|
1411
1411
|
}), [r, e]);
|
|
1412
|
-
return
|
|
1412
|
+
return Ae(Ze.Provider, {
|
|
1413
1413
|
value: i
|
|
1414
1414
|
}, t);
|
|
1415
1415
|
}
|
|
1416
|
-
const
|
|
1417
|
-
const { t } =
|
|
1418
|
-
return !e || e.trim() === "" ? null : /* @__PURE__ */
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
-
/* @__PURE__ */
|
|
1421
|
-
/* @__PURE__ */
|
|
1416
|
+
const Lt = ({ className: r, ...e }) => /* @__PURE__ */ m.jsx("div", { className: V("[&_svg]:w-40", r), ...e }), Ot = (r) => /* @__PURE__ */ U.createElement("svg", { height: "1em", width: "1em", fill: "currentColor", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ U.createElement("path", { d: "M1.86879 5.11875C2.52504 3.25 4.28754 2 6.26879 2H25.7813C27.7625 2 29.525 3.25 30.1813 5.11875L31.3313 8.40625C32.0188 10.375 31.3938 12.4 30.025 13.6812V25.5063C30.025 27.9937 28.0125 30.0063 25.525 30.0063H6.52504C4.03754 30.0063 2.02504 27.9937 2.02504 25.5063V13.6812C0.656291 12.4 0.0312907 10.375 0.718791 8.40625L1.86879 5.11875ZM5.02504 14.9875V20H27.025V14.9875C26.9 14.9938 26.7813 15 26.6563 15C25.2938 15 24.0438 14.4437 23.1438 13.5437C22.2313 14.4437 20.9813 15 19.5875 15C18.2 15 16.9375 14.4375 16.025 13.5312C15.1125 14.4375 13.85 15 12.4625 15C11.0688 15 9.81879 14.4437 8.90629 13.5437C8.00629 14.45 6.76254 15 5.39379 15C5.26879 15 5.14379 14.9938 5.01879 14.9875H5.02504ZM10.8813 5L10.4063 9.73125C10.2875 10.9437 11.2375 12 12.4563 12C13.5938 12 14.5188 11.075 14.5188 9.9375V5H10.875H10.8813ZM17.525 9.9375C17.525 11.075 18.45 12 19.5875 12C20.8063 12 21.7625 10.9437 21.6375 9.73125L21.1625 5H17.5188V9.9375H17.525ZM24.7063 10.2375C24.8063 11.2375 25.65 12 26.65 12C28 12 28.9438 10.6687 28.4938 9.4L27.35 6.1125C27.1188 5.44375 26.4875 5 25.7813 5H24.1813L24.7063 10.2375ZM5.40004 12C6.40629 12 7.24379 11.2375 7.34379 10.2375L7.86879 5H6.26879C5.56254 5 4.93754 5.44375 4.70004 6.1125L3.55004 9.4C3.10629 10.675 4.05004 12 5.39379 12H5.40004ZM5.02504 25.5C5.02504 26.3312 5.69379 27 6.52504 27H25.525C26.3563 27 27.025 26.3312 27.025 25.5V23H5.02504V25.5Z" })), Ct = (r) => /* @__PURE__ */ U.createElement("svg", { height: "1em", width: "1em", fill: "currentColor", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ U.createElement("path", { d: "M14.7688 8.45C15.5563 7.80625 16.7125 7.85625 17.4438 8.5875L25.4438 16.5875C26.0188 17.1625 26.1875 18.0188 25.875 18.7688C25.5625 19.5188 24.8375 20 24.0313 20H8.03127C7.22502 20 6.49377 19.5125 6.18127 18.7625C5.86877 18.0125 6.04377 17.1563 6.61877 16.5875L14.6188 8.5875L14.7688 8.45Z" })), { Text: Ne } = Pe, wt = ({ className: r, children: e }) => {
|
|
1417
|
+
const { t } = _e();
|
|
1418
|
+
return !e || e.trim() === "" ? null : /* @__PURE__ */ m.jsxs(B, { className: r, align: "center", gap: 2, children: [
|
|
1419
|
+
/* @__PURE__ */ m.jsxs(B, { align: "center", gap: 1, children: [
|
|
1420
|
+
/* @__PURE__ */ m.jsx(Ot, { className: "text-primary-blue size-6" }),
|
|
1421
|
+
/* @__PURE__ */ m.jsx(Ne, { className: "text-primary-blue", size: "sm", weight: "semibold", children: t("layout.header.store") })
|
|
1422
1422
|
] }),
|
|
1423
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ m.jsx(Ne, { className: "text-grays-macropay-05", size: "sm", weight: "semibold", children: e })
|
|
1424
1424
|
] });
|
|
1425
|
-
}, { Text:
|
|
1426
|
-
const { md: s } =
|
|
1425
|
+
}, { Text: Re } = Pe, vt = ({ name: r, role: e, imageUrl: t, items: i = [] }) => {
|
|
1426
|
+
const { md: s } = We();
|
|
1427
1427
|
if (!r || r.trim() === "")
|
|
1428
1428
|
return null;
|
|
1429
|
-
const n = /* @__PURE__ */
|
|
1430
|
-
/* @__PURE__ */
|
|
1431
|
-
/* @__PURE__ */
|
|
1429
|
+
const n = /* @__PURE__ */ m.jsxs(B, { gap: 1, direction: "vertical", children: [
|
|
1430
|
+
/* @__PURE__ */ m.jsx(Re, { className: "text-primary-blue", size: "sm", weight: "semibold", children: r }),
|
|
1431
|
+
/* @__PURE__ */ m.jsx(Re, { className: "text-grays-macropay-05", size: "sm", weight: "semibold", children: e })
|
|
1432
1432
|
] });
|
|
1433
|
-
return /* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ m.jsxs(B, { align: "center", gap: 2, children: [
|
|
1434
|
+
/* @__PURE__ */ m.jsx(Ke, { src: t, alt: r, size: "sm" }),
|
|
1435
1435
|
s && n,
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
|
|
1436
|
+
/* @__PURE__ */ m.jsx(
|
|
1437
|
+
Me,
|
|
1438
1438
|
{
|
|
1439
1439
|
classNames: {
|
|
1440
1440
|
trigger: "size-6.5 p-0",
|
|
1441
1441
|
content: "z-10 shadow-sm"
|
|
1442
1442
|
},
|
|
1443
|
-
trigger: /* @__PURE__ */
|
|
1443
|
+
trigger: /* @__PURE__ */ m.jsx(Ct, { className: "rotate-180" }),
|
|
1444
1444
|
items: s ? i : [
|
|
1445
1445
|
{ label: n, id: "user-name", type: "label" },
|
|
1446
1446
|
{ id: "separator-1", type: "separator" },
|
|
@@ -1449,14 +1449,14 @@ const St = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx("div", { className:
|
|
|
1449
1449
|
}
|
|
1450
1450
|
)
|
|
1451
1451
|
] });
|
|
1452
|
-
},
|
|
1452
|
+
}, Fe = ({ className: r, children: e }) => {
|
|
1453
1453
|
if (Array.isArray(e) && e.length === 0)
|
|
1454
1454
|
return null;
|
|
1455
1455
|
const t = e.filter((s) => s !== null), i = (s) => s === t.length - 1;
|
|
1456
|
-
return /* @__PURE__ */
|
|
1456
|
+
return /* @__PURE__ */ m.jsx(B, { align: "center", gap: 4, className: V(r), children: t.map((s, n) => /* @__PURE__ */ m.jsxs(De, { children: [
|
|
1457
1457
|
s,
|
|
1458
|
-
i(n) ? null : /* @__PURE__ */
|
|
1459
|
-
|
|
1458
|
+
i(n) ? null : /* @__PURE__ */ m.jsx(
|
|
1459
|
+
qe,
|
|
1460
1460
|
{
|
|
1461
1461
|
"data-slot": "separator",
|
|
1462
1462
|
orientation: "vertical",
|
|
@@ -1468,8 +1468,8 @@ const St = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx("div", { className:
|
|
|
1468
1468
|
)
|
|
1469
1469
|
] }, n)) });
|
|
1470
1470
|
};
|
|
1471
|
-
|
|
1472
|
-
const Z = ({ className: r, ...e }) => /* @__PURE__ */
|
|
1471
|
+
Fe.disPlayName = "Layout.Header.RightSide";
|
|
1472
|
+
const Z = ({ className: r, ...e }) => /* @__PURE__ */ m.jsx(
|
|
1473
1473
|
"header",
|
|
1474
1474
|
{
|
|
1475
1475
|
className: V(
|
|
@@ -1479,15 +1479,15 @@ const Z = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx(
|
|
|
1479
1479
|
...e
|
|
1480
1480
|
}
|
|
1481
1481
|
);
|
|
1482
|
-
Z.LeftSide =
|
|
1483
|
-
Z.Store =
|
|
1484
|
-
Z.User =
|
|
1485
|
-
Z.RightSide =
|
|
1486
|
-
const
|
|
1482
|
+
Z.LeftSide = Lt;
|
|
1483
|
+
Z.Store = wt;
|
|
1484
|
+
Z.User = vt;
|
|
1485
|
+
Z.RightSide = Fe;
|
|
1486
|
+
const Nt = ({
|
|
1487
1487
|
className: r,
|
|
1488
1488
|
children: e,
|
|
1489
1489
|
...t
|
|
1490
|
-
}) => /* @__PURE__ */
|
|
1490
|
+
}) => /* @__PURE__ */ m.jsx(
|
|
1491
1491
|
"div",
|
|
1492
1492
|
{
|
|
1493
1493
|
className: V(
|
|
@@ -1495,9 +1495,9 @@ const wt = ({
|
|
|
1495
1495
|
r
|
|
1496
1496
|
),
|
|
1497
1497
|
...t,
|
|
1498
|
-
children: /* @__PURE__ */
|
|
1498
|
+
children: /* @__PURE__ */ m.jsx("div", { className: "flex-1 rounded-lg bg-white p-4", children: e })
|
|
1499
1499
|
}
|
|
1500
|
-
),
|
|
1500
|
+
), Rt = ({ className: r, ...e }) => /* @__PURE__ */ m.jsx(
|
|
1501
1501
|
"footer",
|
|
1502
1502
|
{
|
|
1503
1503
|
className: V(
|
|
@@ -1506,14 +1506,14 @@ const wt = ({
|
|
|
1506
1506
|
),
|
|
1507
1507
|
...e
|
|
1508
1508
|
}
|
|
1509
|
-
),
|
|
1509
|
+
), Pt = {
|
|
1510
1510
|
login: {
|
|
1511
1511
|
btnLabel: "Iniciar sesión"
|
|
1512
1512
|
}
|
|
1513
|
-
},
|
|
1513
|
+
}, jt = {
|
|
1514
1514
|
translation: {
|
|
1515
1515
|
layout: {
|
|
1516
|
-
...
|
|
1516
|
+
...Pt,
|
|
1517
1517
|
header: {
|
|
1518
1518
|
store: "Centro"
|
|
1519
1519
|
}
|
|
@@ -1564,28 +1564,56 @@ const wt = ({
|
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
1567
|
-
S.use(
|
|
1568
|
-
resources: { es:
|
|
1567
|
+
S.use(St).init({
|
|
1568
|
+
resources: { es: jt },
|
|
1569
1569
|
lng: "es",
|
|
1570
1570
|
interpolation: {
|
|
1571
1571
|
escapeValue: !1
|
|
1572
1572
|
}
|
|
1573
1573
|
});
|
|
1574
|
-
const re = ({ children: r, loading: e, ...t }) =>
|
|
1575
|
-
|
|
1576
|
-
{
|
|
1577
|
-
"
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1574
|
+
const re = ({ children: r, loading: e, ...t }) => {
|
|
1575
|
+
const i = (s) => s === 0 ? [0, 6, 0] : s === 2 ? [0, -6, 0] : 0;
|
|
1576
|
+
return /* @__PURE__ */ m.jsx(bt, { i18n: S, children: /* @__PURE__ */ m.jsxs(
|
|
1577
|
+
"main",
|
|
1578
|
+
{
|
|
1579
|
+
"data-slot": "sidebar-inset",
|
|
1580
|
+
className: "relative flex min-h-svh w-full flex-1 flex-col bg-grays-macropay-02",
|
|
1581
|
+
...t,
|
|
1582
|
+
children: [
|
|
1583
|
+
r,
|
|
1584
|
+
/* @__PURE__ */ m.jsx(ze, { children: e && /* @__PURE__ */ m.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ m.jsx(
|
|
1585
|
+
fe.div,
|
|
1586
|
+
{
|
|
1587
|
+
className: "position backdrop-blur-sm bg-white/30 absolute top-0 left-0 z-50 flex h-full w-full items-center justify-center",
|
|
1588
|
+
initial: { opacity: 0 },
|
|
1589
|
+
animate: { opacity: 1 },
|
|
1590
|
+
exit: { opacity: 0 },
|
|
1591
|
+
transition: { duration: 0.2 },
|
|
1592
|
+
children: /* @__PURE__ */ m.jsx("div", { className: "flex gap-3", children: [0, 1, 2].map((s) => /* @__PURE__ */ m.jsx(
|
|
1593
|
+
fe.div,
|
|
1594
|
+
{
|
|
1595
|
+
className: `w-3 h-3 rounded-full ${s === 1 ? "bg-primary-blue" : "bg-grays-macropay-05"}`,
|
|
1596
|
+
animate: {
|
|
1597
|
+
y: s === 1 ? [0, -8, 0] : 0,
|
|
1598
|
+
x: i(s)
|
|
1599
|
+
},
|
|
1600
|
+
transition: {
|
|
1601
|
+
duration: 0.8,
|
|
1602
|
+
repeat: 1 / 0,
|
|
1603
|
+
ease: "easeInOut"
|
|
1604
|
+
}
|
|
1605
|
+
},
|
|
1606
|
+
s
|
|
1607
|
+
)) })
|
|
1608
|
+
}
|
|
1609
|
+
) }) })
|
|
1610
|
+
]
|
|
1611
|
+
}
|
|
1612
|
+
) });
|
|
1613
|
+
};
|
|
1586
1614
|
re.Header = Z;
|
|
1587
|
-
re.Content =
|
|
1588
|
-
re.Footer =
|
|
1615
|
+
re.Content = Nt;
|
|
1616
|
+
re.Footer = Rt;
|
|
1589
1617
|
export {
|
|
1590
1618
|
re as RootLayout
|
|
1591
1619
|
};
|