@pie-element/simple-cloze 0.1.4-next.17 → 0.1.4-next.19
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/browser/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/{i18n-C7YV9VIN.js → i18n-CBClmRAq.js} +143 -122
- package/dist/browser/editor-runtime/i18n-CBClmRAq.js.map +1 -0
- package/dist/browser/editor-runtime/print/index.js +1 -1
- package/dist/browser/{i18n-C7YV9VIN.js → i18n-CBClmRAq.js} +143 -122
- package/dist/browser/i18n-CBClmRAq.js.map +1 -0
- package/dist/browser/print/index.js +1 -1
- package/dist/delivery/index.js +36 -12
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +2 -2
- package/dist/print/index.js +36 -12
- package/dist/print/index.js.map +1 -1
- package/module/print.js +178 -157
- package/module/print.js.map +1 -1
- package/package.json +3 -3
- package/dist/browser/editor-runtime/i18n-C7YV9VIN.js.map +0 -1
- package/dist/browser/i18n-C7YV9VIN.js.map +0 -1
package/module/print.js
CHANGED
|
@@ -2251,36 +2251,57 @@ function xi(e = {}) {
|
|
|
2251
2251
|
await a?.startup?.promise, typeof a?.typesetPromise == "function" && (await a.typesetPromise([n]), oi(n));
|
|
2252
2252
|
};
|
|
2253
2253
|
}
|
|
2254
|
-
var Si = "@pie-lib/math-rendering", Ci = "@pie-lib/math-rendering@2", wi = null;
|
|
2255
|
-
function
|
|
2254
|
+
var Si = "@pie-lib/math-rendering", Ci = "@pie-lib/math-rendering@2", wi = "pie-print", Ti = 50, Ei = 1e4, Di = null;
|
|
2255
|
+
function Oi() {
|
|
2256
2256
|
return !!window[Ci]?.opts?.useSingleDollar;
|
|
2257
2257
|
}
|
|
2258
|
-
function
|
|
2259
|
-
return
|
|
2258
|
+
function ki() {
|
|
2259
|
+
return Di ||= xi({ useSingleDollar: Oi() }), Di;
|
|
2260
2260
|
}
|
|
2261
|
-
function
|
|
2261
|
+
function Ai() {
|
|
2262
2262
|
if (typeof window > "u") return null;
|
|
2263
2263
|
let e = window[Si];
|
|
2264
2264
|
return typeof e?.renderMath == "function" ? e : null;
|
|
2265
2265
|
}
|
|
2266
|
-
function
|
|
2267
|
-
let
|
|
2268
|
-
|
|
2266
|
+
function ji(e) {
|
|
2267
|
+
let t = e;
|
|
2268
|
+
for (; t;) {
|
|
2269
|
+
if (t instanceof Element && t.localName === wi) return t;
|
|
2270
|
+
t = t instanceof ShadowRoot ? t.host : t.parentNode;
|
|
2271
|
+
}
|
|
2272
|
+
return null;
|
|
2273
|
+
}
|
|
2274
|
+
function Mi() {
|
|
2275
|
+
let e = window.renderMath;
|
|
2276
|
+
return typeof e == "function" ? e : null;
|
|
2277
|
+
}
|
|
2278
|
+
async function Ni(e) {
|
|
2279
|
+
let t = ji(e);
|
|
2280
|
+
if (!t) return null;
|
|
2281
|
+
let n = Mi();
|
|
2282
|
+
if (n || t.mathRenderingModuleUrlImported !== !0) return n;
|
|
2283
|
+
let r = Date.now() + Ei;
|
|
2284
|
+
for (; Date.now() < r;) {
|
|
2285
|
+
await new Promise((e) => setTimeout(e, Ti));
|
|
2286
|
+
let e = Mi();
|
|
2287
|
+
if (e) return e;
|
|
2288
|
+
}
|
|
2289
|
+
return null;
|
|
2269
2290
|
}
|
|
2270
|
-
var
|
|
2291
|
+
var Pi = async (e) => {
|
|
2271
2292
|
if (typeof window > "u") return;
|
|
2272
2293
|
let t = typeof e == "string", n;
|
|
2273
2294
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
2274
|
-
let r =
|
|
2275
|
-
return r ?
|
|
2276
|
-
},
|
|
2295
|
+
let r = Ai(), i = r || t ? null : await Ni(n);
|
|
2296
|
+
return r ? await r.renderMath?.(n) : i ? await i(n) : await ki()(n), t ? n.innerHTML : void 0;
|
|
2297
|
+
}, Fi = [
|
|
2277
2298
|
"nbsp iexcl cent pound curren yen brvbar sect uml copy ordf laquo not shy reg macr",
|
|
2278
2299
|
"deg plusmn sup2 sup3 acute micro para middot cedil sup1 ordm raquo frac14 frac12 frac34 iquest",
|
|
2279
2300
|
"Agrave Aacute Acirc Atilde Auml Aring AElig Ccedil Egrave Eacute Ecirc Euml Igrave Iacute Icirc Iuml",
|
|
2280
2301
|
"ETH Ntilde Ograve Oacute Ocirc Otilde Ouml times Oslash Ugrave Uacute Ucirc Uuml Yacute THORN szlig",
|
|
2281
2302
|
"agrave aacute acirc atilde auml aring aelig ccedil egrave eacute ecirc euml igrave iacute icirc iuml",
|
|
2282
2303
|
"eth ntilde ograve oacute ocirc otilde ouml divide oslash ugrave uacute ucirc uuml yacute thorn yuml"
|
|
2283
|
-
].join(" "),
|
|
2304
|
+
].join(" "), Ii = "alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigmaf sigma tau upsilon phi chi psi omega", Li = new Map(Object.entries({
|
|
2284
2305
|
quot: 34,
|
|
2285
2306
|
amp: 38,
|
|
2286
2307
|
apos: 39,
|
|
@@ -2311,16 +2332,16 @@ var ki = async (e) => {
|
|
|
2311
2332
|
le: 8804,
|
|
2312
2333
|
ge: 8805
|
|
2313
2334
|
}));
|
|
2314
|
-
for (let [e, t] of
|
|
2315
|
-
for (let [e, t] of
|
|
2316
|
-
var
|
|
2335
|
+
for (let [e, t] of Fi.split(" ").entries()) Li.set(t, 160 + e);
|
|
2336
|
+
for (let [e, t] of Ii.split(" ").entries()) Li.set(t, 945 + e), t !== "sigmaf" && Li.set(t[0].toUpperCase() + t.slice(1), 913 + e);
|
|
2337
|
+
var Ri = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, zi = /<\/?[a-z][^>]*>|<!--[\s\S]*?-->/gi, Bi = /&(#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]*);/gi, Vi = (e, t) => {
|
|
2317
2338
|
if (t[0] === "#") {
|
|
2318
2339
|
let e = t[1] === "x" || t[1] === "X", n = Number.parseInt(t.slice(e ? 2 : 1), e ? 16 : 10), r = n > 0 && n <= 1114111 && (n < 55296 || n > 57343);
|
|
2319
2340
|
return String.fromCodePoint(r ? n : 65533);
|
|
2320
2341
|
}
|
|
2321
|
-
let n =
|
|
2342
|
+
let n = Li.get(t);
|
|
2322
2343
|
return n === void 0 ? e : String.fromCodePoint(n);
|
|
2323
|
-
},
|
|
2344
|
+
}, Hi = (e) => typeof e == "string" ? e.replace(Ri, " ").replace(zi, "").replace(Bi, Vi).replace(/\s+/g, " ").trim() : "", Ui = {
|
|
2324
2345
|
translation: {
|
|
2325
2346
|
categorize: {
|
|
2326
2347
|
limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
|
|
@@ -2460,7 +2481,7 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2460
2481
|
hideNote: "Hide Note",
|
|
2461
2482
|
cancel: "Cancel"
|
|
2462
2483
|
}
|
|
2463
|
-
},
|
|
2484
|
+
}, Wi = {
|
|
2464
2485
|
translation: {
|
|
2465
2486
|
categorize: {
|
|
2466
2487
|
limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
|
|
@@ -2600,55 +2621,55 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2600
2621
|
hideNote: "Ocultar Nota",
|
|
2601
2622
|
cancel: "Cancelar"
|
|
2602
2623
|
}
|
|
2603
|
-
}, Z = (e) => typeof e == "string",
|
|
2624
|
+
}, Z = (e) => typeof e == "string", Gi = () => {
|
|
2604
2625
|
let e, t, n = new Promise((n, r) => {
|
|
2605
2626
|
e = n, t = r;
|
|
2606
2627
|
});
|
|
2607
2628
|
return n.resolve = e, n.reject = t, n;
|
|
2608
|
-
},
|
|
2629
|
+
}, Ki = (e) => e == null ? "" : "" + e, qi = (e, t, n) => {
|
|
2609
2630
|
e.forEach((e) => {
|
|
2610
2631
|
t[e] && (n[e] = t[e]);
|
|
2611
2632
|
});
|
|
2612
|
-
},
|
|
2633
|
+
}, Ji = /###/g, Yi = (e) => e && e.indexOf("###") > -1 ? e.replace(Ji, ".") : e, Xi = (e) => !e || Z(e), Zi = (e, t, n) => {
|
|
2613
2634
|
let r = Z(t) ? t.split(".") : t, i = 0;
|
|
2614
2635
|
for (; i < r.length - 1;) {
|
|
2615
|
-
if (
|
|
2616
|
-
let t =
|
|
2636
|
+
if (Xi(e)) return {};
|
|
2637
|
+
let t = Yi(r[i]);
|
|
2617
2638
|
!e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
|
|
2618
2639
|
}
|
|
2619
|
-
return
|
|
2640
|
+
return Xi(e) ? {} : {
|
|
2620
2641
|
obj: e,
|
|
2621
|
-
k:
|
|
2642
|
+
k: Yi(r[i])
|
|
2622
2643
|
};
|
|
2623
|
-
},
|
|
2624
|
-
let { obj: r, k: i } =
|
|
2644
|
+
}, Qi = (e, t, n) => {
|
|
2645
|
+
let { obj: r, k: i } = Zi(e, t, Object);
|
|
2625
2646
|
if (r !== void 0 || t.length === 1) {
|
|
2626
2647
|
r[i] = n;
|
|
2627
2648
|
return;
|
|
2628
2649
|
}
|
|
2629
|
-
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s =
|
|
2630
|
-
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s =
|
|
2650
|
+
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = Zi(e, o, Object);
|
|
2651
|
+
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = Zi(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
|
|
2631
2652
|
s.obj[`${s.k}.${a}`] = n;
|
|
2632
|
-
},
|
|
2633
|
-
let { obj: i, k: a } =
|
|
2653
|
+
}, $i = (e, t, n, r) => {
|
|
2654
|
+
let { obj: i, k: a } = Zi(e, t, Object);
|
|
2634
2655
|
i[a] = i[a] || [], i[a].push(n);
|
|
2635
|
-
},
|
|
2636
|
-
let { obj: n, k: r } =
|
|
2656
|
+
}, ea = (e, t) => {
|
|
2657
|
+
let { obj: n, k: r } = Zi(e, t);
|
|
2637
2658
|
if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
|
|
2638
|
-
},
|
|
2639
|
-
let r =
|
|
2640
|
-
return r === void 0 ?
|
|
2641
|
-
},
|
|
2642
|
-
for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? Z(e[r]) || e[r] instanceof String || Z(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) :
|
|
2659
|
+
}, ta = (e, t, n) => {
|
|
2660
|
+
let r = ea(e, n);
|
|
2661
|
+
return r === void 0 ? ea(t, n) : r;
|
|
2662
|
+
}, na = (e, t, n) => {
|
|
2663
|
+
for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? Z(e[r]) || e[r] instanceof String || Z(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : na(e[r], t[r], n) : e[r] = t[r]);
|
|
2643
2664
|
return e;
|
|
2644
|
-
},
|
|
2665
|
+
}, ra = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), ia = {
|
|
2645
2666
|
"&": "&",
|
|
2646
2667
|
"<": "<",
|
|
2647
2668
|
">": ">",
|
|
2648
2669
|
"\"": """,
|
|
2649
2670
|
"'": "'",
|
|
2650
2671
|
"/": "/"
|
|
2651
|
-
},
|
|
2672
|
+
}, aa = (e) => Z(e) ? e.replace(/[&<>"'\/]/g, (e) => ia[e]) : e, oa = class {
|
|
2652
2673
|
constructor(e) {
|
|
2653
2674
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
2654
2675
|
}
|
|
@@ -2658,23 +2679,23 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2658
2679
|
let n = new RegExp(e);
|
|
2659
2680
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
2660
2681
|
}
|
|
2661
|
-
},
|
|
2682
|
+
}, sa = [
|
|
2662
2683
|
" ",
|
|
2663
2684
|
",",
|
|
2664
2685
|
"?",
|
|
2665
2686
|
"!",
|
|
2666
2687
|
";"
|
|
2667
|
-
],
|
|
2688
|
+
], ca = new oa(20), la = (e, t, n) => {
|
|
2668
2689
|
t ||= "", n ||= "";
|
|
2669
|
-
let r =
|
|
2690
|
+
let r = sa.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
|
|
2670
2691
|
if (r.length === 0) return !0;
|
|
2671
|
-
let i =
|
|
2692
|
+
let i = ca.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
|
|
2672
2693
|
if (!a) {
|
|
2673
2694
|
let t = e.indexOf(n);
|
|
2674
2695
|
t > 0 && !i.test(e.substring(0, t)) && (a = !0);
|
|
2675
2696
|
}
|
|
2676
2697
|
return a;
|
|
2677
|
-
},
|
|
2698
|
+
}, ua = (e, t, n = ".") => {
|
|
2678
2699
|
if (!e) return;
|
|
2679
2700
|
if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
2680
2701
|
let r = t.split(n), i = e;
|
|
@@ -2693,7 +2714,7 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2693
2714
|
i = t;
|
|
2694
2715
|
}
|
|
2695
2716
|
return i;
|
|
2696
|
-
},
|
|
2717
|
+
}, da = (e) => e?.replace(/_/g, "-"), fa = {
|
|
2697
2718
|
type: "logger",
|
|
2698
2719
|
log(e) {
|
|
2699
2720
|
this.output("log", e);
|
|
@@ -2712,7 +2733,7 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2712
2733
|
this.init(e, t);
|
|
2713
2734
|
}
|
|
2714
2735
|
init(e, t = {}) {
|
|
2715
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
2736
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || fa, this.options = t, this.debug = t.debug;
|
|
2716
2737
|
}
|
|
2717
2738
|
log(...e) {
|
|
2718
2739
|
return this.forward(e, "log", "", !0);
|
|
@@ -2738,7 +2759,7 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2738
2759
|
clone(t) {
|
|
2739
2760
|
return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
|
|
2740
2761
|
}
|
|
2741
|
-
}(),
|
|
2762
|
+
}(), pa = class {
|
|
2742
2763
|
constructor() {
|
|
2743
2764
|
this.observers = {};
|
|
2744
2765
|
}
|
|
@@ -2765,7 +2786,7 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2765
2786
|
for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
|
|
2766
2787
|
});
|
|
2767
2788
|
}
|
|
2768
|
-
},
|
|
2789
|
+
}, ma = class extends pa {
|
|
2769
2790
|
constructor(e, t = {
|
|
2770
2791
|
ns: ["translation"],
|
|
2771
2792
|
defaultNS: "translation"
|
|
@@ -2782,12 +2803,12 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2782
2803
|
getResource(e, t, n, r = {}) {
|
|
2783
2804
|
let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
|
|
2784
2805
|
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : Z(n) && i ? o.push(...n.split(i)) : o.push(n)));
|
|
2785
|
-
let s =
|
|
2786
|
-
return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !Z(n) ? s :
|
|
2806
|
+
let s = ea(this.data, o);
|
|
2807
|
+
return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !Z(n) ? s : ua(this.data?.[e]?.[t], n, i);
|
|
2787
2808
|
}
|
|
2788
2809
|
addResource(e, t, n, r, i = { silent: !1 }) {
|
|
2789
2810
|
let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
|
|
2790
|
-
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t),
|
|
2811
|
+
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), Qi(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
|
|
2791
2812
|
}
|
|
2792
2813
|
addResources(e, t, n, r = { silent: !1 }) {
|
|
2793
2814
|
for (let r in n) (Z(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
|
|
@@ -2799,11 +2820,11 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2799
2820
|
}) {
|
|
2800
2821
|
let o = [e, t];
|
|
2801
2822
|
e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
2802
|
-
let s =
|
|
2803
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ?
|
|
2823
|
+
let s = ea(this.data, o) || {};
|
|
2824
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? na(s, n, i) : s = {
|
|
2804
2825
|
...s,
|
|
2805
2826
|
...n
|
|
2806
|
-
},
|
|
2827
|
+
}, Qi(this.data, o, s), a.silent || this.emit("added", e, t, n);
|
|
2807
2828
|
}
|
|
2808
2829
|
removeResourceBundle(e, t) {
|
|
2809
2830
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -2824,7 +2845,7 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2824
2845
|
toJSON() {
|
|
2825
2846
|
return this.data;
|
|
2826
2847
|
}
|
|
2827
|
-
},
|
|
2848
|
+
}, ha = {
|
|
2828
2849
|
processors: {},
|
|
2829
2850
|
addPostProcessor(e) {
|
|
2830
2851
|
this.processors[e.name] = e;
|
|
@@ -2834,22 +2855,22 @@ var Ni = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, Pi = /<
|
|
|
2834
2855
|
t = this.processors[e]?.process(t, n, r, i) ?? t;
|
|
2835
2856
|
}), t;
|
|
2836
2857
|
}
|
|
2837
|
-
},
|
|
2838
|
-
function
|
|
2858
|
+
}, ga = Symbol("i18next/PATH_KEY");
|
|
2859
|
+
function _a() {
|
|
2839
2860
|
let e = [], t = Object.create(null), n;
|
|
2840
|
-
return t.get = (r, i) => (n?.revoke?.(), i ===
|
|
2861
|
+
return t.get = (r, i) => (n?.revoke?.(), i === ga ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
|
|
2841
2862
|
}
|
|
2842
|
-
function
|
|
2843
|
-
let { [
|
|
2863
|
+
function va(e, t) {
|
|
2864
|
+
let { [ga]: n } = e(_a()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
|
|
2844
2865
|
if (n.length > 1 && i) {
|
|
2845
2866
|
let e = t?.ns, a = Array.isArray(e) ? e : null;
|
|
2846
2867
|
if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
|
|
2847
2868
|
}
|
|
2848
2869
|
return n.join(r);
|
|
2849
2870
|
}
|
|
2850
|
-
var
|
|
2871
|
+
var ya = {}, ba = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number", xa = class e extends pa {
|
|
2851
2872
|
constructor(e, t = {}) {
|
|
2852
|
-
super(),
|
|
2873
|
+
super(), qi([
|
|
2853
2874
|
"resourceStore",
|
|
2854
2875
|
"languageUtils",
|
|
2855
2876
|
"pluralResolver",
|
|
@@ -2867,13 +2888,13 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2867
2888
|
if (e == null) return !1;
|
|
2868
2889
|
let r = this.resolve(e, n);
|
|
2869
2890
|
if (r?.res === void 0) return !1;
|
|
2870
|
-
let i =
|
|
2891
|
+
let i = ba(r.res);
|
|
2871
2892
|
return !(n.returnObjects === !1 && i);
|
|
2872
2893
|
}
|
|
2873
2894
|
extractFromKey(e, t) {
|
|
2874
2895
|
let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
|
|
2875
2896
|
n === void 0 && (n = ":");
|
|
2876
|
-
let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
2897
|
+
let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !la(e, n, r);
|
|
2877
2898
|
if (a && !o) {
|
|
2878
2899
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2879
2900
|
if (t && t.length > 0) return {
|
|
@@ -2891,10 +2912,10 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2891
2912
|
translate(t, n, r) {
|
|
2892
2913
|
let i = typeof n == "object" ? { ...n } : n;
|
|
2893
2914
|
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
|
|
2894
|
-
typeof t == "function" && (t =
|
|
2915
|
+
typeof t == "function" && (t = va(t, {
|
|
2895
2916
|
...this.options,
|
|
2896
2917
|
...i
|
|
2897
|
-
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ?
|
|
2918
|
+
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? va(e, {
|
|
2898
2919
|
...this.options,
|
|
2899
2920
|
...i
|
|
2900
2921
|
}) : String(e));
|
|
@@ -2922,7 +2943,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2922
2943
|
"[object RegExp]"
|
|
2923
2944
|
], _ = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, v = !this.i18nFormat || this.i18nFormat.handleAsObject, y = i.count !== void 0 && !Z(i.count), b = e.hasDefaultValue(i), te = y ? this.pluralResolver.getSuffix(d, i.count, i) : "", ne = i.ordinal && y ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", re = y && !i.ordinal && i.count === 0, x = re && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${te}`] || i[`defaultValue${ne}`] || i.defaultValue, S = m;
|
|
2924
2945
|
v && !m && b && (S = x);
|
|
2925
|
-
let ie =
|
|
2946
|
+
let ie = ba(S), ae = Object.prototype.toString.apply(S);
|
|
2926
2947
|
if (v && S && ie && ee.indexOf(ae) < 0 && !(Z(_) && Array.isArray(S))) {
|
|
2927
2948
|
if (!i.returnObjects && !this.options.returnObjects) {
|
|
2928
2949
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
@@ -2938,7 +2959,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2938
2959
|
let r = `${n}${o}${e}`;
|
|
2939
2960
|
b && !m ? t[e] = this.translate(r, {
|
|
2940
2961
|
...i,
|
|
2941
|
-
defaultValue:
|
|
2962
|
+
defaultValue: ba(x) ? x[e] : void 0,
|
|
2942
2963
|
joinArrays: !1,
|
|
2943
2964
|
ns: c
|
|
2944
2965
|
}) : t[e] = this.translate(r, {
|
|
@@ -3009,7 +3030,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3009
3030
|
!n.lng && r && r.res && (n.lng = this.language || r.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...e) => i?.[0] === e[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : this.translate(...e, t), n)), n.interpolation && this.interpolator.reset();
|
|
3010
3031
|
}
|
|
3011
3032
|
let a = n.postProcess || this.options.postProcess, o = Z(a) ? [a] : a;
|
|
3012
|
-
return e != null && o?.length && n.applyPostProcessor !== !1 && (e =
|
|
3033
|
+
return e != null && o?.length && n.applyPostProcessor !== !1 && (e = ha.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
3013
3034
|
i18nResolved: {
|
|
3014
3035
|
...r,
|
|
3015
3036
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -3019,7 +3040,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3019
3040
|
}
|
|
3020
3041
|
resolve(e, t = {}) {
|
|
3021
3042
|
let n, r, i, a, o;
|
|
3022
|
-
return Z(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ?
|
|
3043
|
+
return Z(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? va(e, {
|
|
3023
3044
|
...this.options,
|
|
3024
3045
|
...t
|
|
3025
3046
|
}) : e)), e.forEach((e) => {
|
|
@@ -3030,7 +3051,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3030
3051
|
this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
|
|
3031
3052
|
let u = t.count !== void 0 && !Z(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (Z(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
3032
3053
|
l.forEach((e) => {
|
|
3033
|
-
this.isValidLookup(n) || (o = e, !
|
|
3054
|
+
this.isValidLookup(n) || (o = e, !ya[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (ya[`${p[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${p.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!!!")), p.forEach((r) => {
|
|
3034
3055
|
if (this.isValidLookup(n)) return;
|
|
3035
3056
|
a = r;
|
|
3036
3057
|
let o = [c];
|
|
@@ -3093,17 +3114,17 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3093
3114
|
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
|
|
3094
3115
|
return !1;
|
|
3095
3116
|
}
|
|
3096
|
-
},
|
|
3117
|
+
}, Sa = class {
|
|
3097
3118
|
constructor(e) {
|
|
3098
3119
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Q.create("languageUtils");
|
|
3099
3120
|
}
|
|
3100
3121
|
getScriptPartFromCode(e) {
|
|
3101
|
-
if (e =
|
|
3122
|
+
if (e = da(e), !e || e.indexOf("-") < 0) return null;
|
|
3102
3123
|
let t = e.split("-");
|
|
3103
3124
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
3104
3125
|
}
|
|
3105
3126
|
getLanguagePartFromCode(e) {
|
|
3106
|
-
if (e =
|
|
3127
|
+
if (e = da(e), !e || e.indexOf("-") < 0) return e;
|
|
3107
3128
|
let t = e.split("-");
|
|
3108
3129
|
return this.formatLanguageCode(t[0]);
|
|
3109
3130
|
}
|
|
@@ -3153,17 +3174,17 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3153
3174
|
r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
|
|
3154
3175
|
}), r;
|
|
3155
3176
|
}
|
|
3156
|
-
},
|
|
3177
|
+
}, Ca = {
|
|
3157
3178
|
zero: 0,
|
|
3158
3179
|
one: 1,
|
|
3159
3180
|
two: 2,
|
|
3160
3181
|
few: 3,
|
|
3161
3182
|
many: 4,
|
|
3162
3183
|
other: 5
|
|
3163
|
-
},
|
|
3184
|
+
}, wa = {
|
|
3164
3185
|
select: (e) => e === 1 ? "one" : "other",
|
|
3165
3186
|
resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
|
|
3166
|
-
},
|
|
3187
|
+
}, Ta = class {
|
|
3167
3188
|
constructor(e, t = {}) {
|
|
3168
3189
|
this.languageUtils = e, this.options = t, this.logger = Q.create("pluralResolver"), this.pluralRulesCache = {};
|
|
3169
3190
|
}
|
|
@@ -3171,7 +3192,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3171
3192
|
this.pluralRulesCache = {};
|
|
3172
3193
|
}
|
|
3173
3194
|
getRule(e, t = {}) {
|
|
3174
|
-
let n =
|
|
3195
|
+
let n = da(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
|
|
3175
3196
|
cleanedCode: n,
|
|
3176
3197
|
type: r
|
|
3177
3198
|
});
|
|
@@ -3180,8 +3201,8 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3180
3201
|
try {
|
|
3181
3202
|
a = new Intl.PluralRules(n, { type: r });
|
|
3182
3203
|
} catch {
|
|
3183
|
-
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
3184
|
-
if (!e.match(/-|_/)) return
|
|
3204
|
+
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), wa;
|
|
3205
|
+
if (!e.match(/-|_/)) return wa;
|
|
3185
3206
|
let n = this.languageUtils.getLanguagePartFromCode(e);
|
|
3186
3207
|
a = this.getRule(n, t);
|
|
3187
3208
|
}
|
|
@@ -3196,23 +3217,23 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3196
3217
|
}
|
|
3197
3218
|
getSuffixes(e, t = {}) {
|
|
3198
3219
|
let n = this.getRule(e, t);
|
|
3199
|
-
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) =>
|
|
3220
|
+
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => Ca[e] - Ca[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
|
|
3200
3221
|
}
|
|
3201
3222
|
getSuffix(e, t, n = {}) {
|
|
3202
3223
|
let r = this.getRule(e, n);
|
|
3203
3224
|
return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
|
|
3204
3225
|
}
|
|
3205
|
-
},
|
|
3206
|
-
let a =
|
|
3207
|
-
return !a && i && Z(n) && (a =
|
|
3208
|
-
},
|
|
3226
|
+
}, Ea = (e, t, n, r = ".", i = !0) => {
|
|
3227
|
+
let a = ta(e, t, n);
|
|
3228
|
+
return !a && i && Z(n) && (a = ua(e, n, r), a === void 0 && (a = ua(t, n, r))), a;
|
|
3229
|
+
}, Da = (e) => e.replace(/\$/g, "$$$$"), Oa = class {
|
|
3209
3230
|
constructor(e = {}) {
|
|
3210
3231
|
this.logger = Q.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
|
|
3211
3232
|
}
|
|
3212
3233
|
init(e = {}) {
|
|
3213
3234
|
e.interpolation ||= { escapeValue: !0 };
|
|
3214
3235
|
let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: g, alwaysFormat: ee } = e.interpolation;
|
|
3215
|
-
this.escape = t === void 0 ?
|
|
3236
|
+
this.escape = t === void 0 ? aa : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? ra(i) : a || "{{", this.suffix = o ? ra(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? ra(d) : f || ra("$t("), this.nestingSuffix = p ? ra(p) : m || ra(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = ee !== void 0 && ee, this.resetRegExp();
|
|
3216
3237
|
}
|
|
3217
3238
|
reset() {
|
|
3218
3239
|
this.options && this.init(this.options);
|
|
@@ -3224,7 +3245,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3224
3245
|
interpolate(e, t, n, r) {
|
|
3225
3246
|
let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
|
|
3226
3247
|
if (e.indexOf(this.formatSeparator) < 0) {
|
|
3227
|
-
let i =
|
|
3248
|
+
let i = Ea(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
3228
3249
|
return this.alwaysFormat ? this.format(i, void 0, n, {
|
|
3229
3250
|
...r,
|
|
3230
3251
|
...t,
|
|
@@ -3232,7 +3253,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3232
3253
|
}) : i;
|
|
3233
3254
|
}
|
|
3234
3255
|
let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
|
|
3235
|
-
return this.format(
|
|
3256
|
+
return this.format(Ea(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
|
|
3236
3257
|
...r,
|
|
3237
3258
|
...t,
|
|
3238
3259
|
interpolationkey: a
|
|
@@ -3242,10 +3263,10 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3242
3263
|
let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
|
|
3243
3264
|
return [{
|
|
3244
3265
|
regex: this.regexpUnescape,
|
|
3245
|
-
safeValue: (e) =>
|
|
3266
|
+
safeValue: (e) => Da(e)
|
|
3246
3267
|
}, {
|
|
3247
3268
|
regex: this.regexp,
|
|
3248
|
-
safeValue: (e) => this.escapeValue ?
|
|
3269
|
+
safeValue: (e) => this.escapeValue ? Da(this.escape(e)) : Da(e)
|
|
3249
3270
|
}].forEach((t) => {
|
|
3250
3271
|
for (o = 0; i = t.regex.exec(e);) {
|
|
3251
3272
|
let n = i[1].trim();
|
|
@@ -3257,7 +3278,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3257
3278
|
a = i[0];
|
|
3258
3279
|
continue;
|
|
3259
3280
|
} else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
|
|
3260
|
-
else !Z(a) && !this.useRawValueToEscape && (a =
|
|
3281
|
+
else !Z(a) && !this.useRawValueToEscape && (a = Ki(a));
|
|
3261
3282
|
let s = t.safeValue(a);
|
|
3262
3283
|
if (e = e.replace(i[0], s), u ? (t.regex.lastIndex += a.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
|
|
3263
3284
|
}
|
|
@@ -3267,7 +3288,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3267
3288
|
let r, i, a, o = (e, t) => {
|
|
3268
3289
|
let n = this.nestingOptionsSeparator;
|
|
3269
3290
|
if (e.indexOf(n) < 0) return e;
|
|
3270
|
-
let r = e.split(RegExp(`${
|
|
3291
|
+
let r = e.split(RegExp(`${ra(n)}[ ]*{`)), i = `{${r[1]}`;
|
|
3271
3292
|
e = r[0], i = this.interpolate(i, a);
|
|
3272
3293
|
let o = i.match(/'/g), s = i.match(/"/g);
|
|
3273
3294
|
((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
|
|
@@ -3286,14 +3307,14 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3286
3307
|
a = { ...n }, a = a.replace && !Z(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
3287
3308
|
let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
|
|
3288
3309
|
if (c !== -1 && (s = r[1].slice(c).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), r[1] = r[1].slice(0, c)), i = t(o.call(this, r[1].trim(), a), a), i && r[0] === e && !Z(i)) return i;
|
|
3289
|
-
Z(i) || (i =
|
|
3310
|
+
Z(i) || (i = Ki(i)), i ||= (this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`), ""), s.length && (i = s.reduce((e, t) => this.format(e, t, n.lng, {
|
|
3290
3311
|
...n,
|
|
3291
3312
|
interpolationkey: r[1].trim()
|
|
3292
3313
|
}), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
|
|
3293
3314
|
}
|
|
3294
3315
|
return e;
|
|
3295
3316
|
}
|
|
3296
|
-
},
|
|
3317
|
+
}, ka = (e) => {
|
|
3297
3318
|
let t = e.toLowerCase().trim(), n = {};
|
|
3298
3319
|
if (e.indexOf("(") > -1) {
|
|
3299
3320
|
let r = e.split("(");
|
|
@@ -3310,7 +3331,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3310
3331
|
formatName: t,
|
|
3311
3332
|
formatOptions: n
|
|
3312
3333
|
};
|
|
3313
|
-
},
|
|
3334
|
+
}, Aa = (e) => {
|
|
3314
3335
|
let t = {};
|
|
3315
3336
|
return (n, r, i) => {
|
|
3316
3337
|
let a = i;
|
|
@@ -3319,15 +3340,15 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3319
3340
|
[i.interpolationkey]: void 0
|
|
3320
3341
|
});
|
|
3321
3342
|
let o = r + JSON.stringify(a), s = t[o];
|
|
3322
|
-
return s || (s = e(
|
|
3343
|
+
return s || (s = e(da(r), i), t[o] = s), s(n);
|
|
3323
3344
|
};
|
|
3324
|
-
},
|
|
3345
|
+
}, ja = (e) => (t, n, r) => e(da(n), r)(t), Ma = class {
|
|
3325
3346
|
constructor(e = {}) {
|
|
3326
3347
|
this.logger = Q.create("formatter"), this.options = e, this.init(e);
|
|
3327
3348
|
}
|
|
3328
3349
|
init(e, t = { interpolation: {} }) {
|
|
3329
3350
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
3330
|
-
let n = t.cacheInBuiltFormats ?
|
|
3351
|
+
let n = t.cacheInBuiltFormats ? Aa : ja;
|
|
3331
3352
|
this.formats = {
|
|
3332
3353
|
number: n((e, t) => {
|
|
3333
3354
|
let n = new Intl.NumberFormat(e, { ...t });
|
|
@@ -3358,7 +3379,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3358
3379
|
this.formats[e.toLowerCase().trim()] = t;
|
|
3359
3380
|
}
|
|
3360
3381
|
addCached(e, t) {
|
|
3361
|
-
this.formats[e.toLowerCase().trim()] =
|
|
3382
|
+
this.formats[e.toLowerCase().trim()] = Aa(t);
|
|
3362
3383
|
}
|
|
3363
3384
|
format(e, t, n, r = {}) {
|
|
3364
3385
|
let i = t.split(this.formatSeparator);
|
|
@@ -3367,7 +3388,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3367
3388
|
i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
|
|
3368
3389
|
}
|
|
3369
3390
|
return i.reduce((e, t) => {
|
|
3370
|
-
let { formatName: i, formatOptions: a } =
|
|
3391
|
+
let { formatName: i, formatOptions: a } = ka(t);
|
|
3371
3392
|
if (this.formats[i]) {
|
|
3372
3393
|
let t = e;
|
|
3373
3394
|
try {
|
|
@@ -3385,9 +3406,9 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3385
3406
|
return e;
|
|
3386
3407
|
}, e);
|
|
3387
3408
|
}
|
|
3388
|
-
},
|
|
3409
|
+
}, Na = (e, t) => {
|
|
3389
3410
|
e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
|
|
3390
|
-
},
|
|
3411
|
+
}, Pa = class extends pa {
|
|
3391
3412
|
constructor(e, t, n, r = {}) {
|
|
3392
3413
|
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = Q.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
|
|
3393
3414
|
}
|
|
@@ -3417,7 +3438,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3417
3438
|
t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
|
|
3418
3439
|
let o = {};
|
|
3419
3440
|
this.queue.forEach((n) => {
|
|
3420
|
-
|
|
3441
|
+
$i(n.loaded, [i], a), Na(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
|
|
3421
3442
|
o[e] || (o[e] = {});
|
|
3422
3443
|
let t = n.loaded[e];
|
|
3423
3444
|
t.length && t.forEach((t) => {
|
|
@@ -3507,7 +3528,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3507
3528
|
!e || !e[0] || this.store.addResource(e[0], t, n, r);
|
|
3508
3529
|
}
|
|
3509
3530
|
}
|
|
3510
|
-
},
|
|
3531
|
+
}, Fa = () => ({
|
|
3511
3532
|
debug: !1,
|
|
3512
3533
|
initAsync: !0,
|
|
3513
3534
|
ns: ["translation"],
|
|
@@ -3564,15 +3585,15 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3564
3585
|
skipOnVariables: !0
|
|
3565
3586
|
},
|
|
3566
3587
|
cacheInBuiltFormats: !0
|
|
3567
|
-
}),
|
|
3588
|
+
}), Ia = (e) => (Z(e.ns) && (e.ns = [e.ns]), Z(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), Z(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs?.indexOf?.("cimode") < 0 && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), typeof e.initImmediate == "boolean" && (e.initAsync = e.initImmediate), e), La = () => {}, Ra = (e) => {
|
|
3568
3589
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
|
|
3569
3590
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
3570
3591
|
});
|
|
3571
|
-
},
|
|
3572
|
-
typeof globalThis < "u" && (globalThis[
|
|
3573
|
-
},
|
|
3592
|
+
}, za = "__i18next_supportNoticeShown", Ba = () => !!(typeof globalThis < "u" && globalThis[za] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), Va = () => {
|
|
3593
|
+
typeof globalThis < "u" && (globalThis[za] = !0);
|
|
3594
|
+
}, Ha = (e) => !!(e?.modules?.backend?.name?.indexOf("Locize") > 0 || e?.modules?.backend?.constructor?.name?.indexOf("Locize") > 0 || e?.options?.backend?.backends && e.options.backend.backends.some((e) => e?.name?.indexOf("Locize") > 0 || e?.constructor?.name?.indexOf("Locize") > 0) || e?.options?.backend?.projectId || e?.options?.backend?.backendOptions && e.options.backend.backendOptions.some((e) => e?.projectId)), $ = class e extends pa {
|
|
3574
3595
|
constructor(e = {}, t) {
|
|
3575
|
-
if (super(), this.options =
|
|
3596
|
+
if (super(), this.options = Ia(e), this.services = {}, this.logger = Q, this.modules = { external: [] }, Ra(this), t && !this.isInitialized && !e.isClone) {
|
|
3576
3597
|
if (!this.options.initAsync) return this.init(e, t), this;
|
|
3577
3598
|
setTimeout(() => {
|
|
3578
3599
|
this.init(e, t);
|
|
@@ -3581,35 +3602,35 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3581
3602
|
}
|
|
3582
3603
|
init(e = {}, t) {
|
|
3583
3604
|
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (Z(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
3584
|
-
let n =
|
|
3605
|
+
let n = Fa();
|
|
3585
3606
|
this.options = {
|
|
3586
3607
|
...n,
|
|
3587
3608
|
...this.options,
|
|
3588
|
-
...
|
|
3609
|
+
...Ia(e)
|
|
3589
3610
|
}, this.options.interpolation = {
|
|
3590
3611
|
...n.interpolation,
|
|
3591
3612
|
...this.options.interpolation
|
|
3592
|
-
}, 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 = n.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !
|
|
3613
|
+
}, 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 = n.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !Ha(this) && !Ba() && (typeof console < "u" && console.info !== void 0 && console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"), Va());
|
|
3593
3614
|
let r = (e) => e ? typeof e == "function" ? new e() : e : null;
|
|
3594
3615
|
if (!this.options.isClone) {
|
|
3595
3616
|
this.modules.logger ? Q.init(r(this.modules.logger), this.options) : Q.init(null, this.options);
|
|
3596
3617
|
let e;
|
|
3597
|
-
e = this.modules.formatter ? this.modules.formatter :
|
|
3598
|
-
let t = new
|
|
3599
|
-
this.store = new
|
|
3618
|
+
e = this.modules.formatter ? this.modules.formatter : Ma;
|
|
3619
|
+
let t = new Sa(this.options);
|
|
3620
|
+
this.store = new ma(this.options.resources, this.options);
|
|
3600
3621
|
let i = this.services;
|
|
3601
|
-
i.logger = Q, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new
|
|
3622
|
+
i.logger = Q, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new Ta(t, {
|
|
3602
3623
|
prepend: this.options.pluralSeparator,
|
|
3603
3624
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
3604
|
-
}), this.options.interpolation.format && this.options.interpolation.format !== n.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"), e && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (i.formatter = r(e), i.formatter.init && i.formatter.init(i, this.options), this.options.interpolation.format = i.formatter.format.bind(i.formatter)), i.interpolator = new
|
|
3625
|
+
}), this.options.interpolation.format && this.options.interpolation.format !== n.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"), e && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (i.formatter = r(e), i.formatter.init && i.formatter.init(i, this.options), this.options.interpolation.format = i.formatter.format.bind(i.formatter)), i.interpolator = new Oa(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new Pa(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
|
|
3605
3626
|
this.emit(e, ...t);
|
|
3606
|
-
}), this.modules.languageDetector && (i.languageDetector = r(this.modules.languageDetector), i.languageDetector.init && i.languageDetector.init(i, this.options.detection, this.options)), this.modules.i18nFormat && (i.i18nFormat = r(this.modules.i18nFormat), i.i18nFormat.init && i.i18nFormat.init(this)), this.translator = new
|
|
3627
|
+
}), this.modules.languageDetector && (i.languageDetector = r(this.modules.languageDetector), i.languageDetector.init && i.languageDetector.init(i, this.options.detection, this.options)), this.modules.i18nFormat && (i.i18nFormat = r(this.modules.i18nFormat), i.i18nFormat.init && i.i18nFormat.init(this)), this.translator = new xa(this.services, this.options), this.translator.on("*", (e, ...t) => {
|
|
3607
3628
|
this.emit(e, ...t);
|
|
3608
3629
|
}), this.modules.external.forEach((e) => {
|
|
3609
3630
|
e.init && e.init(this);
|
|
3610
3631
|
});
|
|
3611
3632
|
}
|
|
3612
|
-
if (this.format = this.options.interpolation.format, t ||=
|
|
3633
|
+
if (this.format = this.options.interpolation.format, t ||= La, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
3613
3634
|
let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
3614
3635
|
e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
|
|
3615
3636
|
}
|
|
@@ -3628,7 +3649,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3628
3649
|
].forEach((e) => {
|
|
3629
3650
|
this[e] = (...t) => (this.store[e](...t), this);
|
|
3630
3651
|
});
|
|
3631
|
-
let i =
|
|
3652
|
+
let i = Gi(), a = () => {
|
|
3632
3653
|
let e = (e, n) => {
|
|
3633
3654
|
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), i.resolve(n), t(e, n);
|
|
3634
3655
|
};
|
|
@@ -3637,7 +3658,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3637
3658
|
};
|
|
3638
3659
|
return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
|
|
3639
3660
|
}
|
|
3640
|
-
loadResources(e, t =
|
|
3661
|
+
loadResources(e, t = La) {
|
|
3641
3662
|
let n = t, r = Z(e) ? e : this.language;
|
|
3642
3663
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
3643
3664
|
if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
@@ -3652,15 +3673,15 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3652
3673
|
} else n(null);
|
|
3653
3674
|
}
|
|
3654
3675
|
reloadResources(e, t, n) {
|
|
3655
|
-
let r =
|
|
3656
|
-
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||=
|
|
3676
|
+
let r = Gi();
|
|
3677
|
+
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||= La, this.services.backendConnector.reload(e, t, (e) => {
|
|
3657
3678
|
r.resolve(), n(e);
|
|
3658
3679
|
}), r;
|
|
3659
3680
|
}
|
|
3660
3681
|
use(e) {
|
|
3661
3682
|
if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
3662
3683
|
if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
3663
|
-
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" &&
|
|
3684
|
+
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" && ha.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
3664
3685
|
}
|
|
3665
3686
|
setResolvedLanguage(e) {
|
|
3666
3687
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
@@ -3676,7 +3697,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3676
3697
|
}
|
|
3677
3698
|
changeLanguage(e, t) {
|
|
3678
3699
|
this.isLanguageChangingTo = e;
|
|
3679
|
-
let n =
|
|
3700
|
+
let n = Gi();
|
|
3680
3701
|
this.emit("languageChanging", e);
|
|
3681
3702
|
let r = (e) => {
|
|
3682
3703
|
this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
|
|
@@ -3699,9 +3720,9 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3699
3720
|
...this.options,
|
|
3700
3721
|
...a
|
|
3701
3722
|
};
|
|
3702
|
-
typeof a.keyPrefix == "function" && (a.keyPrefix =
|
|
3723
|
+
typeof a.keyPrefix == "function" && (a.keyPrefix = va(a.keyPrefix, o));
|
|
3703
3724
|
let s = this.options.keySeparator || ".", c;
|
|
3704
|
-
return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e =
|
|
3725
|
+
return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = va(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = va(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
|
|
3705
3726
|
};
|
|
3706
3727
|
return Z(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
|
|
3707
3728
|
}
|
|
@@ -3730,7 +3751,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3730
3751
|
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
|
|
3731
3752
|
}
|
|
3732
3753
|
loadNamespaces(e, t) {
|
|
3733
|
-
let n =
|
|
3754
|
+
let n = Gi();
|
|
3734
3755
|
return this.options.ns ? (Z(e) && (e = [e]), e.forEach((e) => {
|
|
3735
3756
|
this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
|
|
3736
3757
|
}), this.loadResources((e) => {
|
|
@@ -3738,7 +3759,7 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3738
3759
|
}), n) : (t && t(), Promise.resolve());
|
|
3739
3760
|
}
|
|
3740
3761
|
loadLanguages(e, t) {
|
|
3741
|
-
let n =
|
|
3762
|
+
let n = Gi();
|
|
3742
3763
|
Z(e) && (e = [e]);
|
|
3743
3764
|
let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
|
|
3744
3765
|
return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
|
|
@@ -3754,14 +3775,14 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3754
3775
|
if (e && e.direction) return e.direction;
|
|
3755
3776
|
}
|
|
3756
3777
|
} catch {}
|
|
3757
|
-
let t = /* @__PURE__ */ "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".split("."), n = this.services?.languageUtils || new
|
|
3778
|
+
let t = /* @__PURE__ */ "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".split("."), n = this.services?.languageUtils || new Sa(Fa());
|
|
3758
3779
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
3759
3780
|
}
|
|
3760
3781
|
static createInstance(t = {}, n) {
|
|
3761
3782
|
let r = new e(t, n);
|
|
3762
3783
|
return r.createInstance = e.createInstance, r;
|
|
3763
3784
|
}
|
|
3764
|
-
cloneInstance(t = {}, n =
|
|
3785
|
+
cloneInstance(t = {}, n = La) {
|
|
3765
3786
|
let r = t.forkResourceStore;
|
|
3766
3787
|
r && delete t.forkResourceStore;
|
|
3767
3788
|
let i = {
|
|
@@ -3775,18 +3796,18 @@ var ma = {}, ha = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3775
3796
|
"language"
|
|
3776
3797
|
].forEach((e) => {
|
|
3777
3798
|
a[e] = this[e];
|
|
3778
|
-
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new
|
|
3799
|
+
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new ma(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, e[t] = Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), e[t]), e), {}), i), a.services.resourceStore = a.store), t.interpolation) {
|
|
3779
3800
|
let e = {
|
|
3780
|
-
...
|
|
3801
|
+
...Fa().interpolation,
|
|
3781
3802
|
...this.options.interpolation,
|
|
3782
3803
|
...t.interpolation
|
|
3783
3804
|
}, n = {
|
|
3784
3805
|
...i,
|
|
3785
3806
|
interpolation: e
|
|
3786
3807
|
};
|
|
3787
|
-
a.services.interpolator = new
|
|
3808
|
+
a.services.interpolator = new Oa(n);
|
|
3788
3809
|
}
|
|
3789
|
-
return a.translator = new
|
|
3810
|
+
return a.translator = new xa(a.services, i), a.translator.on("*", (e, ...t) => {
|
|
3790
3811
|
a.emit(e, ...t);
|
|
3791
3812
|
}), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
|
|
3792
3813
|
}
|
|
@@ -3807,13 +3828,13 @@ $.createInstance, $.dir, $.init, $.loadResources, $.reloadResources, $.use, $.ch
|
|
|
3807
3828
|
lng: "en",
|
|
3808
3829
|
showSupportNotice: !1,
|
|
3809
3830
|
resources: {
|
|
3810
|
-
en:
|
|
3811
|
-
es:
|
|
3831
|
+
en: Ui,
|
|
3832
|
+
es: Wi
|
|
3812
3833
|
}
|
|
3813
3834
|
});
|
|
3814
3835
|
//#endregion
|
|
3815
3836
|
//#region src/i18n.ts
|
|
3816
|
-
var { translator:
|
|
3837
|
+
var { translator: Ua } = {
|
|
3817
3838
|
translator: {
|
|
3818
3839
|
...$,
|
|
3819
3840
|
t: (e, t) => {
|
|
@@ -3845,23 +3866,23 @@ var { translator: Ra } = {
|
|
|
3845
3866
|
label: "Spanish"
|
|
3846
3867
|
}]
|
|
3847
3868
|
};
|
|
3848
|
-
function
|
|
3849
|
-
return
|
|
3869
|
+
function Wa(e, t) {
|
|
3870
|
+
return Ua.t(`translation:simpleCloze:${e}`, { lng: t });
|
|
3850
3871
|
}
|
|
3851
3872
|
//#endregion
|
|
3852
3873
|
//#region src/print/Print.svelte
|
|
3853
|
-
var
|
|
3874
|
+
var Ga = /* @__PURE__ */ or("<div class=\"simple-cloze-print-teacher-instructions svelte-1fx5wwa\"></div>"), Ka = /* @__PURE__ */ or("<div class=\"simple-cloze-print-prompt svelte-1fx5wwa\"></div>"), qa = /* @__PURE__ */ or("<span class=\"simple-cloze-print-key-label svelte-1fx5wwa\"> </span> <span class=\"simple-cloze-print-blank simple-cloze-print-blank--key svelte-1fx5wwa\"> </span>", 1), Ja = /* @__PURE__ */ or("<span class=\"simple-cloze-print-blank svelte-1fx5wwa\" role=\"img\"></span>"), Ya = /* @__PURE__ */ or("<div class=\"simple-cloze-print svelte-1fx5wwa\"><!> <!> <div class=\"simple-cloze-print-response svelte-1fx5wwa\"><!></div></div>"), Xa = {
|
|
3854
3875
|
hash: "svelte-1fx5wwa",
|
|
3855
3876
|
code: "\n /* Self-contained: print players ship no Tailwind or CSS reset. */.simple-cloze-print.svelte-1fx5wwa {padding:1rem;color:var(--pie-text, black);}.simple-cloze-print-teacher-instructions.svelte-1fx5wwa,\n .simple-cloze-print-prompt.svelte-1fx5wwa {margin-bottom:1rem;}.simple-cloze-print-teacher-instructions.svelte-1fx5wwa p,\n .simple-cloze-print-prompt.svelte-1fx5wwa p {margin:0.5em 0;}.simple-cloze-print-prompt.svelte-1fx5wwa strong {font-weight:600;}.simple-cloze-print-response.svelte-1fx5wwa {display:inline-flex;align-items:baseline;gap:0.5rem;}.simple-cloze-print-key-label.svelte-1fx5wwa {font-size:0.875rem;line-height:1.25rem;font-weight:600;}.simple-cloze-print-blank.svelte-1fx5wwa {display:inline-block;min-width:12rem;min-height:1.5rem;padding:0.5rem 0.75rem;border-bottom:2px solid var(--pie-text, black);}.simple-cloze-print-blank--key.svelte-1fx5wwa {min-width:6rem;font-weight:600;}\n\n @media print {.simple-cloze-print.svelte-1fx5wwa {padding:0;}\n }"
|
|
3856
3877
|
};
|
|
3857
|
-
function
|
|
3858
|
-
We(t, !0), wr(e,
|
|
3859
|
-
let n = Ir(t, "model", 7, null), r = Ir(t, "options", 7, null), i = /* @__PURE__ */ lt(() => r()?.role === "instructor"), a = /* @__PURE__ */ lt(() => n()?.promptEnabled !== !1 && typeof n()?.prompt == "string" ? n().prompt : ""), o = /* @__PURE__ */ lt(() =>
|
|
3878
|
+
function Za(e, t) {
|
|
3879
|
+
We(t, !0), wr(e, Xa);
|
|
3880
|
+
let n = Ir(t, "model", 7, null), r = Ir(t, "options", 7, null), i = /* @__PURE__ */ lt(() => r()?.role === "instructor"), a = /* @__PURE__ */ lt(() => n()?.promptEnabled !== !1 && typeof n()?.prompt == "string" ? n().prompt : ""), o = /* @__PURE__ */ lt(() => Hi(n()?.correctAnswer)), s = /* @__PURE__ */ lt(() => X(i) && !!X(o)), c = /* @__PURE__ */ lt(() => X(i) && n()?.teacherInstructionsEnabled !== !1 && n()?.teacherInstructions || ""), l = /* @__PURE__ */ M(null);
|
|
3860
3881
|
dn(() => {
|
|
3861
3882
|
if (!X(l) || !X(a)) return;
|
|
3862
3883
|
let e = (e) => console.warn("simple-cloze: MathJax render failed", e);
|
|
3863
3884
|
try {
|
|
3864
|
-
Promise.resolve(
|
|
3885
|
+
Promise.resolve(Pi(X(l))).catch(e);
|
|
3865
3886
|
} catch (t) {
|
|
3866
3887
|
e(t);
|
|
3867
3888
|
}
|
|
@@ -3879,41 +3900,41 @@ function Ka(e, t) {
|
|
|
3879
3900
|
set options(e = null) {
|
|
3880
3901
|
r(e), Et();
|
|
3881
3902
|
}
|
|
3882
|
-
}, d =
|
|
3883
|
-
var t =
|
|
3903
|
+
}, d = Ya(), f = Zt(d), p = (e) => {
|
|
3904
|
+
var t = Ga();
|
|
3884
3905
|
Cr(t, () => X(c), !0), Te(t), sr(e, t);
|
|
3885
3906
|
};
|
|
3886
3907
|
Sr(f, (e) => {
|
|
3887
3908
|
X(c) && e(p);
|
|
3888
3909
|
});
|
|
3889
3910
|
var m = en(f, 2), h = (e) => {
|
|
3890
|
-
var t =
|
|
3911
|
+
var t = Ka();
|
|
3891
3912
|
Cr(t, () => X(a), !0), Te(t), Nr(t, (e) => N(l, e), () => X(l)), sr(e, t);
|
|
3892
3913
|
};
|
|
3893
3914
|
Sr(m, (e) => {
|
|
3894
3915
|
X(a) && e(h);
|
|
3895
3916
|
});
|
|
3896
3917
|
var g = en(m, 2), ee = Zt(g), _ = (e) => {
|
|
3897
|
-
var t =
|
|
3918
|
+
var t = qa(), r = Qt(t), i = $t(r, !0), a = $t(en(r, 2), !0);
|
|
3898
3919
|
vn((e) => {
|
|
3899
3920
|
mr(i, e), mr(a, X(o));
|
|
3900
|
-
}, [() =>
|
|
3921
|
+
}, [() => Wa("printCorrectAnswer", n()?.language)]), sr(e, t);
|
|
3901
3922
|
}, v = (e) => {
|
|
3902
|
-
var t =
|
|
3903
|
-
vn((e) => Or(t, "aria-label", e), [() =>
|
|
3923
|
+
var t = Ja();
|
|
3924
|
+
vn((e) => Or(t, "aria-label", e), [() => Wa("printAnswerBlank", n()?.language)]), sr(e, t);
|
|
3904
3925
|
};
|
|
3905
3926
|
return Sr(ee, (e) => {
|
|
3906
3927
|
X(s) ? e(_) : e(v, -1);
|
|
3907
3928
|
}), Te(g), Te(d), sr(e, d), Ge(u);
|
|
3908
3929
|
}
|
|
3909
|
-
Hr(
|
|
3930
|
+
Hr(Za, {
|
|
3910
3931
|
model: { type: "Object" },
|
|
3911
3932
|
options: { type: "Object" }
|
|
3912
3933
|
}, [], []);
|
|
3913
3934
|
//#endregion
|
|
3914
3935
|
//#region src/print/index.ts
|
|
3915
|
-
var
|
|
3936
|
+
var Qa = Za.element;
|
|
3916
3937
|
//#endregion
|
|
3917
|
-
export {
|
|
3938
|
+
export { Qa as default };
|
|
3918
3939
|
|
|
3919
3940
|
//# sourceMappingURL=print.js.map
|