@pie-element/simple-cloze 0.1.4-next.8 → 0.1.4

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.
Files changed (48) hide show
  1. package/dist/author/index.d.ts +2 -18
  2. package/dist/author/index.js +1151 -456
  3. package/dist/author/index.js.map +1 -1
  4. package/dist/browser/author/index.js +3764 -3612
  5. package/dist/browser/author/index.js.map +1 -1
  6. package/dist/browser/{client-BSTc3boO.js → client-e4ZTphpa.js} +874 -680
  7. package/dist/browser/client-e4ZTphpa.js.map +1 -0
  8. package/dist/browser/controller/index.js +2 -62
  9. package/dist/browser/controller-1IBOQFFL.js +69 -0
  10. package/dist/browser/controller-1IBOQFFL.js.map +1 -0
  11. package/dist/browser/delivery/index.js +82 -82
  12. package/dist/browser/delivery/index.js.map +1 -1
  13. package/dist/browser/editor-runtime/author/index.js +634 -0
  14. package/dist/browser/editor-runtime/author/index.js.map +1 -0
  15. package/dist/browser/editor-runtime/client-e4ZTphpa.js +2370 -0
  16. package/dist/browser/editor-runtime/client-e4ZTphpa.js.map +1 -0
  17. package/dist/browser/editor-runtime/controller/index.js +2 -0
  18. package/dist/browser/editor-runtime/controller-1IBOQFFL.js +69 -0
  19. package/dist/browser/editor-runtime/controller-1IBOQFFL.js.map +1 -0
  20. package/dist/browser/editor-runtime/delivery/index.js +243 -0
  21. package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
  22. package/dist/browser/{i18n-BaF24Jzw.js → editor-runtime/i18n-BTsdzpBv.js} +397 -252
  23. package/dist/browser/editor-runtime/i18n-BTsdzpBv.js.map +1 -0
  24. package/dist/browser/editor-runtime/plain-text-iaQZhkGe.js +53 -0
  25. package/dist/browser/editor-runtime/plain-text-iaQZhkGe.js.map +1 -0
  26. package/dist/browser/editor-runtime/print/index.js +71 -0
  27. package/dist/browser/editor-runtime/print/index.js.map +1 -0
  28. package/dist/browser/i18n-BTsdzpBv.js +1755 -0
  29. package/dist/browser/i18n-BTsdzpBv.js.map +1 -0
  30. package/dist/browser/print/index.js +37 -52
  31. package/dist/browser/print/index.js.map +1 -1
  32. package/dist/controller/defaults.d.ts +5 -0
  33. package/dist/controller/index.js +11 -4
  34. package/dist/controller/index.js.map +1 -1
  35. package/dist/delivery/index.js +366 -200
  36. package/dist/delivery/index.js.map +1 -1
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.iife.d.ts +1 -1
  39. package/dist/index.iife.js +4 -4
  40. package/dist/print/index.d.ts +2 -10
  41. package/dist/print/index.js +366 -221
  42. package/dist/print/index.js.map +1 -1
  43. package/module/print.js +928 -783
  44. package/module/print.js.map +1 -1
  45. package/package.json +22 -4
  46. package/dist/browser/client-BSTc3boO.js.map +0 -1
  47. package/dist/browser/controller/index.js.map +0 -1
  48. package/dist/browser/i18n-BaF24Jzw.js.map +0 -1
@@ -0,0 +1,1755 @@
1
+ //#region ../../shared/math-rendering-mathjax/dist/index.js
2
+ var e = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page", t = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
3
+ function n(n, r) {
4
+ if (typeof window > "u") return;
5
+ let i = globalThis;
6
+ i[t] ??= {
7
+ logged: !1,
8
+ conditions: []
9
+ };
10
+ let a = i[t];
11
+ if (a.conditions.includes(n)) return;
12
+ a.conditions.push(n);
13
+ let o = `[math-rendering] Unsupported page (${n}): ${r}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${e}`;
14
+ a.logged || (a.logged = !0, console.error(o)), window.dispatchEvent(new CustomEvent("pie-mathjax-version-conflict", { detail: {
15
+ condition: n,
16
+ message: o,
17
+ docsUrl: e
18
+ } }));
19
+ }
20
+ function r() {
21
+ let e = window.MathJax?.version;
22
+ return typeof e == "string" && e.startsWith("3.") ? e : void 0;
23
+ }
24
+ var i = "https://cdn.jsdelivr.net/npm/mathjax@4.1.3/tex-mml-chtml.js", a = {
25
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
26
+ overarc: "\\overparen",
27
+ napprox: "\\not\\approx",
28
+ longdiv: "\\enclose{longdiv}",
29
+ abs: ["\\left|#1\\right|", 1]
30
+ }, o = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", s = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, c = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, l = /\\embed\{newLine\}\[\]/g, u = [
31
+ ["$$", "$$"],
32
+ ["$", "$"],
33
+ ["\\[", "\\]"],
34
+ ["\\(", "\\)"]
35
+ ], d = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), f = "PIE-MJX-CHTML-styles", p = "MJX-CHTML-styles", m = [p, "MJX-SVG-styles"], h = 201;
36
+ function g(e) {
37
+ let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
38
+ for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
39
+ }
40
+ function _() {
41
+ return window.MathJax;
42
+ }
43
+ function v(e) {
44
+ for (let [t, n] of u) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
45
+ return e;
46
+ }
47
+ function y(e) {
48
+ return v(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
49
+ }
50
+ var b = "mathjax_ignore", x = "mathjax_process";
51
+ function S(e, t) {
52
+ let n = e.closest(`.${b}, .${x}`);
53
+ return n !== null && t.contains(n) && !n.classList.contains(x);
54
+ }
55
+ function C(e) {
56
+ for (let t of e.querySelectorAll("[data-latex]")) {
57
+ if (t.dataset.mathHandled || t.closest("mjx-container") || S(t, e)) continue;
58
+ let n = t.textContent;
59
+ n && (t.textContent = `\\(${y(n)}\\)`.replace(l, "\\newline "), t.dataset.mathHandled = "true");
60
+ }
61
+ }
62
+ function w(e, t) {
63
+ for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
64
+ return (t ? c : s).test(e.textContent ?? "");
65
+ }
66
+ function T(e) {
67
+ return new Promise((t, n) => {
68
+ let { useSingleDollar: r = !1, accessibility: s = !0, loadFonts: c = !0, srcUrl: l } = e, u = {
69
+ loader: {
70
+ load: s ? ["a11y/assistive-mml"] : [],
71
+ failed: (e) => n(e)
72
+ },
73
+ startup: {
74
+ typeset: !1,
75
+ ready: () => {
76
+ let e = _(), r = e?.startup, i = !!e?.version?.startsWith("4.");
77
+ i && E(e), r?.defaultReady?.(), i && D(r?.document), Promise.resolve(r?.promise).then(() => t(), n);
78
+ }
79
+ },
80
+ tex: { macros: { ...a } },
81
+ options: {
82
+ enableMenu: s,
83
+ menuOptions: { settings: {
84
+ assistiveMml: s,
85
+ enrich: !1,
86
+ inTabOrder: !1
87
+ } }
88
+ }
89
+ };
90
+ r && u.tex && (console.warn(o), u.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], u.tex.processEscapes = !0), c || (u.chtml = { fontURL: "" }), window.MathJax = u;
91
+ let d = document.createElement("script");
92
+ d.src = l || i, d.async = !0, d.onerror = () => n(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(d);
93
+ });
94
+ }
95
+ function E(e) {
96
+ let t = e?._?.output?.chtml_ts?.CHTML;
97
+ t && (t.STYLESHEETID = f);
98
+ }
99
+ function D(e) {
100
+ if (!e) return;
101
+ let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
102
+ let n = e.typesetRoot;
103
+ !n || t.has(n) || (g(n), t.add(n));
104
+ };
105
+ e.addRenderAction?.("pie-strip-latex", h, (e) => {
106
+ for (let t of e.math ?? []) n(t);
107
+ return !1;
108
+ }, (e) => {
109
+ let t = e.typesetRoot;
110
+ return t && g(t), !1;
111
+ });
112
+ let r = e.outputJax?.chtmlStyles;
113
+ r?.id === p && (r.id = f), ee();
114
+ }
115
+ function O(e) {
116
+ return e instanceof HTMLStyleElement && m.includes(e.id);
117
+ }
118
+ function k(e) {
119
+ n("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
120
+ }
121
+ function ee() {
122
+ let e = document.head, t = [...e.children].find(O);
123
+ if (t) {
124
+ k(t);
125
+ return;
126
+ }
127
+ let n = new MutationObserver((e) => {
128
+ for (let t of e) {
129
+ let e = [...t.addedNodes].find(O);
130
+ if (e) {
131
+ k(e), n.disconnect();
132
+ return;
133
+ }
134
+ }
135
+ });
136
+ n.observe(e, { childList: !0 });
137
+ }
138
+ function te(e) {
139
+ return new Promise((t, n) => {
140
+ let r = e.startup ?? {};
141
+ e.startup = r;
142
+ let i = r.ready;
143
+ r.ready = () => {
144
+ let e = _()?.startup;
145
+ i ? i.call(r) : e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
146
+ };
147
+ });
148
+ }
149
+ function ne(e) {
150
+ let t = _();
151
+ return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : te(t) : T(e);
152
+ }
153
+ function re(e) {
154
+ return ne(e).then(() => {
155
+ typeof _()?.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
156
+ });
157
+ }
158
+ function ie(e) {
159
+ let t = globalThis, n = t[d];
160
+ return n || (n = re(e), t[d] = n), n;
161
+ }
162
+ function ae(e = {}) {
163
+ let t = e.useSingleDollar ?? !1;
164
+ return async (i) => {
165
+ if (typeof window > "u") return;
166
+ let a = r();
167
+ a && n("mathjax-3-global", `window.MathJax is MathJax ${a}`), C(i);
168
+ let o = ie(e);
169
+ if (!w(i, t)) {
170
+ o.catch(() => {});
171
+ return;
172
+ }
173
+ await o;
174
+ let s = _();
175
+ await s?.startup?.promise, typeof s?.typesetPromise == "function" && (await s.typesetPromise([i]), g(i));
176
+ };
177
+ }
178
+ var oe = "@pie-lib/math-rendering", se = "@pie-lib/math-rendering@2", ce = "pie-print", le = 50, ue = 1e4, de = null;
179
+ function fe() {
180
+ return !!window[se]?.opts?.useSingleDollar;
181
+ }
182
+ function pe() {
183
+ return de ||= ae({ useSingleDollar: fe() }), de;
184
+ }
185
+ function me() {
186
+ if (typeof window > "u") return null;
187
+ let e = window[oe];
188
+ return typeof e?.renderMath == "function" && e.renderMath !== j ? e : null;
189
+ }
190
+ function he(e) {
191
+ let t = e;
192
+ for (; t;) {
193
+ if (t instanceof Element && t.localName === ce) return t;
194
+ t = t instanceof ShadowRoot ? t.host : t.parentNode;
195
+ }
196
+ return null;
197
+ }
198
+ function A() {
199
+ let e = window.renderMath;
200
+ return typeof e == "function" ? e : null;
201
+ }
202
+ async function ge(e) {
203
+ let t = he(e);
204
+ if (!t) return null;
205
+ let n = A();
206
+ if (n || t.mathRenderingModuleUrlImported !== !0) return n;
207
+ let r = Date.now() + ue;
208
+ for (; Date.now() < r;) {
209
+ await new Promise((e) => setTimeout(e, le));
210
+ let e = A();
211
+ if (e) return e;
212
+ }
213
+ return null;
214
+ }
215
+ var j = async (e) => {
216
+ if (typeof window > "u") return;
217
+ let t = typeof e == "string", n;
218
+ t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
219
+ let r = me(), i = r || t ? null : await ge(n);
220
+ return r ? await r.renderMath?.(n) : i && i !== j ? await i(n) : await pe()(n), t ? n.innerHTML : void 0;
221
+ }, _e = {
222
+ translation: {
223
+ categorize: {
224
+ limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
225
+ maxChoicesPerCategoryRestriction: "To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."
226
+ },
227
+ ebsr: { part: "Part {{index}}" },
228
+ numberLine: {
229
+ addElementLimit_one: "You can only add {{count}} element",
230
+ addElementLimit_other: "You can only add {{count}} elements",
231
+ clearAll: "Clear all"
232
+ },
233
+ imageClozeAssociation: {
234
+ reachedLimit_one: "You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",
235
+ reachedLimit_other: "Full"
236
+ },
237
+ drawingResponse: {
238
+ fillColor: "Fill color",
239
+ outlineColor: "Outline color",
240
+ noFill: "No fill",
241
+ lightblue: "Light blue",
242
+ lightyellow: "Light yellow",
243
+ red: "Red",
244
+ orange: "Orange",
245
+ yellow: "Yellow",
246
+ violet: "Violet",
247
+ blue: "Blue",
248
+ green: "Green",
249
+ white: "White",
250
+ black: "Black",
251
+ onDoubleClick: "Double click to edit this text. Press Enter to submit."
252
+ },
253
+ charting: {
254
+ addCategory: "Add category",
255
+ actions: "Actions",
256
+ add: "Add",
257
+ delete: "Delete",
258
+ newLabel: "New label",
259
+ reachedLimit_other: "There can't be more than {{count}} categories.",
260
+ keyLegend: {
261
+ incorrectAnswer: "Student incorrect answer",
262
+ correctAnswer: "Student correct answer",
263
+ correctKeyAnswer: "Answer key correct"
264
+ }
265
+ },
266
+ graphing: {
267
+ point: "Point",
268
+ circle: "Circle",
269
+ line: "Line",
270
+ parabola: "Parabola",
271
+ absolute: "Absolute Value",
272
+ exponential: "Exponential",
273
+ polygon: "Polygon",
274
+ ray: "Ray",
275
+ segment: "Segment",
276
+ sine: "Sine",
277
+ vector: "Vector",
278
+ label: "Label",
279
+ redo: "Redo",
280
+ reset: "Reset"
281
+ },
282
+ mathInline: { primaryCorrectWithAlternates: "Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct." },
283
+ mcPopulatedBlank: {
284
+ answerChoices: "Answer choices",
285
+ blankLabel: "blank",
286
+ emptyBlank: "(blank)",
287
+ blankPreSelectionHint: "The answer you choose will appear on the blank line above.",
288
+ correctAnswerSelected: "Correct answer selected",
289
+ incorrectAnswerSelected: "Incorrect answer selected",
290
+ selectedAnswerImage: "Selected answer image",
291
+ choiceImage: "Choice {{id}}",
292
+ clickToEnableAutoplay: "Click to enable audio autoplay",
293
+ audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
294
+ listen: "Listen",
295
+ listenSilentAlt: "Repeat instructions",
296
+ listenPlayingAlt: "Instructions are playing",
297
+ printAudio: "Audio:",
298
+ printTranscript: "Transcript:"
299
+ },
300
+ multipleChoice: {
301
+ minSelections: "Select at least {{minSelections}}.",
302
+ maxSelections_one: "Only {{maxSelections}} answer is allowed.",
303
+ maxSelections_other: "Only {{maxSelections}} answers are allowed.",
304
+ minmaxSelections_equal: "Select {{minSelections}}.",
305
+ minmaxSelections_range: "Select between {{minSelections}} and {{maxSelections}}."
306
+ },
307
+ selectText: {
308
+ correctAnswerSelected: "Correct",
309
+ correctAnswerNotSelected: "Correct Answer Not Selected",
310
+ incorrectSelection: "Incorrect Selection",
311
+ key: "Key"
312
+ },
313
+ simpleCloze: {
314
+ correctAnswerShown: "Correct answer",
315
+ correct: "Correct",
316
+ incorrect: "Incorrect",
317
+ unanswered: "No answer",
318
+ placeholder: "Enter your answer...",
319
+ answerInput: "Your answer",
320
+ printCorrectAnswer: "Correct answer:",
321
+ printAnswerBlank: "Answer blank"
322
+ },
323
+ vennClassification: {
324
+ tray: "Tiles to classify",
325
+ unknownTarget: "unknown",
326
+ cancelled: "Cancelled",
327
+ returnedToTray: "{{name}} returned to tray",
328
+ placedIn: "{{name}} placed in {{target}}",
329
+ pickedUp: "Picked up {{name}}",
330
+ pickedUpWithKeyboard: "Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.",
331
+ dropTarget: "Drop target: {{target}}",
332
+ unsupportedCircles_one: "This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.",
333
+ unsupportedCircles_other: "This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.",
334
+ setNumber: "Set {{number}}",
335
+ regionOnly: "{{set}} only",
336
+ regionNeither: "Neither {{first}} nor {{second}}",
337
+ regionNoneOf: "None of {{sets}}",
338
+ regionAndSeparator: " and ",
339
+ tileFallbackName: "Tile",
340
+ tileNotPlaced: "not placed",
341
+ tileInRegion: "in {{region}}",
342
+ tileCorrect: "correct",
343
+ tileIncorrect: "incorrect"
344
+ }
345
+ },
346
+ common: {
347
+ undo: "Undo",
348
+ clearAll: "Clear all",
349
+ correct: "Correct",
350
+ incorrect: "Incorrect",
351
+ showCorrectAnswer: "Show correct answer",
352
+ hideCorrectAnswer: "Hide correct answer",
353
+ showTeacherInstructions: "Show Teacher Instructions",
354
+ hideTeacherInstructions: "Hide Teacher Instructions",
355
+ commonCorrectAnswerWithAlternates: "Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",
356
+ warning: "Warning",
357
+ showNote: "Show Note",
358
+ hideNote: "Hide Note",
359
+ cancel: "Cancel"
360
+ }
361
+ }, ve = {
362
+ translation: {
363
+ categorize: {
364
+ limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
365
+ maxChoicesPerCategoryRestriction: "Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"
366
+ },
367
+ ebsr: { part: "Parte {{index}}" },
368
+ numberLine: {
369
+ addElementLimit_one: "Solo puedes agregar {{count}} elemento",
370
+ addElementLimit_other: "Solo puedes agregar {{count}} elementos",
371
+ clearAll: "Borrar todo"
372
+ },
373
+ imageClozeAssociation: {
374
+ reachedLimit_one: "Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
375
+ reachedLimit_other: "Lleno"
376
+ },
377
+ drawingResponse: {
378
+ fillColor: "Color de relleno",
379
+ outlineColor: "Color del contorno",
380
+ noFill: "Sin relleno",
381
+ lightblue: "Azul claro",
382
+ lightyellow: "Amarillo claro",
383
+ red: "Rojo",
384
+ orange: "Naranja",
385
+ yellow: "Amarillo",
386
+ violet: "Violeta",
387
+ blue: "Azul",
388
+ green: "Verde",
389
+ white: "Blanco",
390
+ black: "Negro",
391
+ onDoubleClick: "Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"
392
+ },
393
+ charting: {
394
+ addCategory: "Añadir categoría",
395
+ actions: "Acciones",
396
+ add: "Añadir",
397
+ delete: "Eliminar",
398
+ newLabel: "Nueva etiqueta",
399
+ reachedLimit_other: "No puede haber más de {{count}} categorías.",
400
+ keyLegend: {
401
+ incorrectAnswer: "Respuesta incorrecta del estudiante",
402
+ correctAnswer: "Respuesta correcta del estudiante",
403
+ correctKeyAnswer: "Clave de respuesta correcta"
404
+ }
405
+ },
406
+ graphing: {
407
+ point: "Punto",
408
+ circle: "Circulo",
409
+ line: "Línea",
410
+ parabola: "Parábola",
411
+ absolute: "Valor absoluto",
412
+ exponential: "Exponencial",
413
+ polygon: "Polígono",
414
+ ray: "Semirrecta",
415
+ segment: "Segmento ",
416
+ sine: "Seno",
417
+ vector: "Vector",
418
+ label: "Etiqueta",
419
+ redo: "Rehacer",
420
+ reset: "Reiniciar"
421
+ },
422
+ mathInline: { primaryCorrectWithAlternates: "Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas." },
423
+ mcPopulatedBlank: {
424
+ answerChoices: "Opciones de respuesta",
425
+ blankLabel: "espacio en blanco",
426
+ emptyBlank: "(en blanco)",
427
+ blankPreSelectionHint: "La respuesta que elijas aparecerá en la línea en blanco de arriba.",
428
+ correctAnswerSelected: "Respuesta correcta seleccionada",
429
+ incorrectAnswerSelected: "Respuesta incorrecta seleccionada",
430
+ selectedAnswerImage: "Imagen de la respuesta seleccionada",
431
+ choiceImage: "Opción {{id}}",
432
+ clickToEnableAutoplay: "Haz clic para activar la reproducción automática del audio",
433
+ audioResourceUnavailable: "El audio está activado, pero no hay una URL de audio reproducible configurada.",
434
+ listen: "Escuchar",
435
+ listenSilentAlt: "Escuchar. Repetir las instrucciones.",
436
+ listenPlayingAlt: "Escuchar. Estas son las instrucciones.",
437
+ printAudio: "Audio:",
438
+ printTranscript: "Transcripción:"
439
+ },
440
+ multipleChoice: {
441
+ minSelections: "Seleccione al menos {{minSelections}}.",
442
+ maxSelections_one: "Sólo se permite {{maxSelections}} respuesta.",
443
+ maxSelections_other: "Sólo se permiten {{maxSelections}} respuestas.",
444
+ minmaxSelections_equal: "Seleccione {{minSelections}}.",
445
+ minmaxSelections_range: "Seleccione entre {{minSelections}} y {{maxSelections}}."
446
+ },
447
+ selectText: {
448
+ correctAnswerSelected: "Respuesta Correcta",
449
+ correctAnswerNotSelected: "Respuesta Correcta No Seleccionada",
450
+ incorrectSelection: "Selección Incorrecta",
451
+ key: "Clave"
452
+ },
453
+ simpleCloze: {
454
+ correctAnswerShown: "Respuesta correcta",
455
+ correct: "Correcto",
456
+ incorrect: "Incorrecto",
457
+ unanswered: "Sin respuesta",
458
+ placeholder: "Escribe tu respuesta...",
459
+ answerInput: "Tu respuesta",
460
+ printCorrectAnswer: "Respuesta correcta:",
461
+ printAnswerBlank: "Espacio para la respuesta"
462
+ },
463
+ vennClassification: {
464
+ tray: "Fichas para clasificar",
465
+ unknownTarget: "desconocido",
466
+ cancelled: "Cancelado",
467
+ returnedToTray: "Se devolvió {{name}} a la bandeja",
468
+ placedIn: "Se colocó {{name}} en {{target}}",
469
+ pickedUp: "Se tomó {{name}}",
470
+ pickedUpWithKeyboard: "Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.",
471
+ dropTarget: "Destino: {{target}}",
472
+ unsupportedCircles_one: "No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.",
473
+ unsupportedCircles_other: "No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.",
474
+ setNumber: "Conjunto {{number}}",
475
+ regionOnly: "Solo {{set}}",
476
+ regionNeither: "Ni {{first}} ni {{second}}",
477
+ regionNoneOf: "Ninguno de {{sets}}",
478
+ regionAndSeparator: " y ",
479
+ tileFallbackName: "Ficha",
480
+ tileNotPlaced: "sin colocar",
481
+ tileInRegion: "en {{region}}",
482
+ tileCorrect: "correcta",
483
+ tileIncorrect: "incorrecta"
484
+ }
485
+ },
486
+ common: {
487
+ undo: "Deshacer",
488
+ clearAll: "Borrar todo",
489
+ correct: "Correcto",
490
+ incorrect: "Incorrecto",
491
+ showCorrectAnswer: "Mostrar respuesta correcta",
492
+ hideCorrectAnswer: "Ocultar respuesta correcta",
493
+ showTeacherInstructions: "Mostrar instrucciones para el maestro",
494
+ hideTeacherInstructions: "Ocultar instrucciones para el maestro",
495
+ commonCorrectAnswerWithAlternates: "Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",
496
+ warning: "Advertencia",
497
+ showNote: "Mostrar Nota",
498
+ hideNote: "Ocultar Nota",
499
+ cancel: "Cancelar"
500
+ }
501
+ }, M = (e) => typeof e == "string", N = () => {
502
+ let e, t, n = new Promise((n, r) => {
503
+ e = n, t = r;
504
+ });
505
+ return n.resolve = e, n.reject = t, n;
506
+ }, P = (e) => e == null ? "" : "" + e, ye = (e, t, n) => {
507
+ e.forEach((e) => {
508
+ t[e] && (n[e] = t[e]);
509
+ });
510
+ }, be = /###/g, F = (e) => e && e.indexOf("###") > -1 ? e.replace(be, ".") : e, I = (e) => !e || M(e), L = (e, t, n) => {
511
+ let r = M(t) ? t.split(".") : t, i = 0;
512
+ for (; i < r.length - 1;) {
513
+ if (I(e)) return {};
514
+ let t = F(r[i]);
515
+ !e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
516
+ }
517
+ return I(e) ? {} : {
518
+ obj: e,
519
+ k: F(r[i])
520
+ };
521
+ }, R = (e, t, n) => {
522
+ let { obj: r, k: i } = L(e, t, Object);
523
+ if (r !== void 0 || t.length === 1) {
524
+ r[i] = n;
525
+ return;
526
+ }
527
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = L(e, o, Object);
528
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = L(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
529
+ s.obj[`${s.k}.${a}`] = n;
530
+ }, xe = (e, t, n, r) => {
531
+ let { obj: i, k: a } = L(e, t, Object);
532
+ i[a] = i[a] || [], i[a].push(n);
533
+ }, z = (e, t) => {
534
+ let { obj: n, k: r } = L(e, t);
535
+ if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
536
+ }, Se = (e, t, n) => {
537
+ let r = z(e, n);
538
+ return r === void 0 ? z(t, n) : r;
539
+ }, B = (e, t, n) => {
540
+ for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? M(e[r]) || e[r] instanceof String || M(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : B(e[r], t[r], n) : e[r] = t[r]);
541
+ return e;
542
+ }, V = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), Ce = {
543
+ "&": "&amp;",
544
+ "<": "&lt;",
545
+ ">": "&gt;",
546
+ "\"": "&quot;",
547
+ "'": "&#39;",
548
+ "/": "&#x2F;"
549
+ }, we = (e) => M(e) ? e.replace(/[&<>"'\/]/g, (e) => Ce[e]) : e, Te = class {
550
+ constructor(e) {
551
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
552
+ }
553
+ getRegExp(e) {
554
+ let t = this.regExpMap.get(e);
555
+ if (t !== void 0) return t;
556
+ let n = new RegExp(e);
557
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
558
+ }
559
+ }, Ee = [
560
+ " ",
561
+ ",",
562
+ "?",
563
+ "!",
564
+ ";"
565
+ ], De = new Te(20), Oe = (e, t, n) => {
566
+ t ||= "", n ||= "";
567
+ let r = Ee.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
568
+ if (r.length === 0) return !0;
569
+ let i = De.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
570
+ if (!a) {
571
+ let t = e.indexOf(n);
572
+ t > 0 && !i.test(e.substring(0, t)) && (a = !0);
573
+ }
574
+ return a;
575
+ }, H = (e, t, n = ".") => {
576
+ if (!e) return;
577
+ if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
578
+ let r = t.split(n), i = e;
579
+ for (let e = 0; e < r.length;) {
580
+ if (!i || typeof i != "object") return;
581
+ let t, a = "";
582
+ for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
583
+ if ([
584
+ "string",
585
+ "number",
586
+ "boolean"
587
+ ].indexOf(typeof t) > -1 && o < r.length - 1) continue;
588
+ e += o - e + 1;
589
+ break;
590
+ }
591
+ i = t;
592
+ }
593
+ return i;
594
+ }, U = (e) => e?.replace(/_/g, "-"), ke = {
595
+ type: "logger",
596
+ log(e) {
597
+ this.output("log", e);
598
+ },
599
+ warn(e) {
600
+ this.output("warn", e);
601
+ },
602
+ error(e) {
603
+ this.output("error", e);
604
+ },
605
+ output(e, t) {
606
+ console?.[e]?.apply?.(console, t);
607
+ }
608
+ }, W = new class e {
609
+ constructor(e, t = {}) {
610
+ this.init(e, t);
611
+ }
612
+ init(e, t = {}) {
613
+ this.prefix = t.prefix || "i18next:", this.logger = e || ke, this.options = t, this.debug = t.debug;
614
+ }
615
+ log(...e) {
616
+ return this.forward(e, "log", "", !0);
617
+ }
618
+ warn(...e) {
619
+ return this.forward(e, "warn", "", !0);
620
+ }
621
+ error(...e) {
622
+ return this.forward(e, "error", "");
623
+ }
624
+ deprecate(...e) {
625
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
626
+ }
627
+ forward(e, t, n, r) {
628
+ return r && !this.debug ? null : (M(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
629
+ }
630
+ create(t) {
631
+ return new e(this.logger, {
632
+ prefix: `${this.prefix}:${t}:`,
633
+ ...this.options
634
+ });
635
+ }
636
+ clone(t) {
637
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
638
+ }
639
+ }(), G = class {
640
+ constructor() {
641
+ this.observers = {};
642
+ }
643
+ on(e, t) {
644
+ return e.split(" ").forEach((e) => {
645
+ this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
646
+ let n = this.observers[e].get(t) || 0;
647
+ this.observers[e].set(t, n + 1);
648
+ }), this;
649
+ }
650
+ off(e, t) {
651
+ if (this.observers[e]) {
652
+ if (!t) {
653
+ delete this.observers[e];
654
+ return;
655
+ }
656
+ this.observers[e].delete(t);
657
+ }
658
+ }
659
+ emit(e, ...t) {
660
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([e, n]) => {
661
+ for (let r = 0; r < n; r++) e(...t);
662
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, r]) => {
663
+ for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
664
+ });
665
+ }
666
+ }, K = class extends G {
667
+ constructor(e, t = {
668
+ ns: ["translation"],
669
+ defaultNS: "translation"
670
+ }) {
671
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
672
+ }
673
+ addNamespaces(e) {
674
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
675
+ }
676
+ removeNamespaces(e) {
677
+ let t = this.options.ns.indexOf(e);
678
+ t > -1 && this.options.ns.splice(t, 1);
679
+ }
680
+ getResource(e, t, n, r = {}) {
681
+ let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
682
+ e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : M(n) && i ? o.push(...n.split(i)) : o.push(n)));
683
+ let s = z(this.data, o);
684
+ return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !M(n) ? s : H(this.data?.[e]?.[t], n, i);
685
+ }
686
+ addResource(e, t, n, r, i = { silent: !1 }) {
687
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
688
+ n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), R(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
689
+ }
690
+ addResources(e, t, n, r = { silent: !1 }) {
691
+ for (let r in n) (M(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
692
+ r.silent || this.emit("added", e, t, n);
693
+ }
694
+ addResourceBundle(e, t, n, r, i, a = {
695
+ silent: !1,
696
+ skipCopy: !1
697
+ }) {
698
+ let o = [e, t];
699
+ e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
700
+ let s = z(this.data, o) || {};
701
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? B(s, n, i) : s = {
702
+ ...s,
703
+ ...n
704
+ }, R(this.data, o, s), a.silent || this.emit("added", e, t, n);
705
+ }
706
+ removeResourceBundle(e, t) {
707
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
708
+ }
709
+ hasResourceBundle(e, t) {
710
+ return this.getResource(e, t) !== void 0;
711
+ }
712
+ getResourceBundle(e, t) {
713
+ return t ||= this.options.defaultNS, this.getResource(e, t);
714
+ }
715
+ getDataByLanguage(e) {
716
+ return this.data[e];
717
+ }
718
+ hasLanguageSomeTranslations(e) {
719
+ let t = this.getDataByLanguage(e);
720
+ return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
721
+ }
722
+ toJSON() {
723
+ return this.data;
724
+ }
725
+ }, Ae = {
726
+ processors: {},
727
+ addPostProcessor(e) {
728
+ this.processors[e.name] = e;
729
+ },
730
+ handle(e, t, n, r, i) {
731
+ return e.forEach((e) => {
732
+ t = this.processors[e]?.process(t, n, r, i) ?? t;
733
+ }), t;
734
+ }
735
+ }, je = Symbol("i18next/PATH_KEY");
736
+ function Me() {
737
+ let e = [], t = Object.create(null), n;
738
+ return t.get = (r, i) => (n?.revoke?.(), i === je ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
739
+ }
740
+ function q(e, t) {
741
+ let { [je]: n } = e(Me()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
742
+ if (n.length > 1 && i) {
743
+ let e = t?.ns, a = Array.isArray(e) ? e : null;
744
+ if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
745
+ }
746
+ return n.join(r);
747
+ }
748
+ var Ne = {}, J = (e) => !M(e) && typeof e != "boolean" && typeof e != "number", Pe = class e extends G {
749
+ constructor(e, t = {}) {
750
+ super(), ye([
751
+ "resourceStore",
752
+ "languageUtils",
753
+ "pluralResolver",
754
+ "interpolator",
755
+ "backendConnector",
756
+ "i18nFormat",
757
+ "utils"
758
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = W.create("translator");
759
+ }
760
+ changeLanguage(e) {
761
+ e && (this.language = e);
762
+ }
763
+ exists(e, t = { interpolation: {} }) {
764
+ let n = { ...t };
765
+ if (e == null) return !1;
766
+ let r = this.resolve(e, n);
767
+ if (r?.res === void 0) return !1;
768
+ let i = J(r.res);
769
+ return !(n.returnObjects === !1 && i);
770
+ }
771
+ extractFromKey(e, t) {
772
+ let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
773
+ n === void 0 && (n = ":");
774
+ 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 && !Oe(e, n, r);
775
+ if (a && !o) {
776
+ let t = e.match(this.interpolator.nestingRegexp);
777
+ if (t && t.length > 0) return {
778
+ key: e,
779
+ namespaces: M(i) ? [i] : i
780
+ };
781
+ let a = e.split(n);
782
+ (n !== r || n === r && this.options.ns.indexOf(a[0]) > -1) && (i = a.shift()), e = a.join(r);
783
+ }
784
+ return {
785
+ key: e,
786
+ namespaces: M(i) ? [i] : i
787
+ };
788
+ }
789
+ translate(t, n, r) {
790
+ let i = typeof n == "object" ? { ...n } : n;
791
+ if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
792
+ typeof t == "function" && (t = q(t, {
793
+ ...this.options,
794
+ ...i
795
+ })), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? q(e, {
796
+ ...this.options,
797
+ ...i
798
+ }) : String(e));
799
+ let a = i.returnDetails === void 0 ? this.options.returnDetails : i.returnDetails, o = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, { key: s, namespaces: c } = this.extractFromKey(t[t.length - 1], i), l = c[c.length - 1], u = i.nsSeparator === void 0 ? this.options.nsSeparator : i.nsSeparator;
800
+ u === void 0 && (u = ":");
801
+ let d = i.lng || this.language, f = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
802
+ if (d?.toLowerCase() === "cimode") return f ? a ? {
803
+ res: `${l}${u}${s}`,
804
+ usedKey: s,
805
+ exactUsedKey: s,
806
+ usedLng: d,
807
+ usedNS: l,
808
+ usedParams: this.getUsedParamsDetails(i)
809
+ } : `${l}${u}${s}` : a ? {
810
+ res: s,
811
+ usedKey: s,
812
+ exactUsedKey: s,
813
+ usedLng: d,
814
+ usedNS: l,
815
+ usedParams: this.getUsedParamsDetails(i)
816
+ } : s;
817
+ let p = this.resolve(t, i), m = p?.res, h = p?.usedKey || s, g = p?.exactUsedKey || s, _ = [
818
+ "[object Number]",
819
+ "[object Function]",
820
+ "[object RegExp]"
821
+ ], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !M(i.count), x = e.hasDefaultValue(i), S = b ? this.pluralResolver.getSuffix(d, i.count, i) : "", C = i.ordinal && b ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", w = b && !i.ordinal && i.count === 0, T = w && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${S}`] || i[`defaultValue${C}`] || i.defaultValue, E = m;
822
+ y && !m && x && (E = T);
823
+ let D = J(E), O = Object.prototype.toString.apply(E);
824
+ if (y && E && D && _.indexOf(O) < 0 && !(M(v) && Array.isArray(E))) {
825
+ if (!i.returnObjects && !this.options.returnObjects) {
826
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
827
+ let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, E, {
828
+ ...i,
829
+ ns: c
830
+ }) : `key '${s} (${this.language})' returned an object instead of string.`;
831
+ return a ? (p.res = e, p.usedParams = this.getUsedParamsDetails(i), p) : e;
832
+ }
833
+ if (o) {
834
+ let e = Array.isArray(E), t = e ? [] : {}, n = e ? g : h;
835
+ for (let e in E) if (Object.prototype.hasOwnProperty.call(E, e)) {
836
+ let r = `${n}${o}${e}`;
837
+ x && !m ? t[e] = this.translate(r, {
838
+ ...i,
839
+ defaultValue: J(T) ? T[e] : void 0,
840
+ joinArrays: !1,
841
+ ns: c
842
+ }) : t[e] = this.translate(r, {
843
+ ...i,
844
+ joinArrays: !1,
845
+ ns: c
846
+ }), t[e] === r && (t[e] = E[e]);
847
+ }
848
+ m = t;
849
+ }
850
+ } else if (y && M(v) && Array.isArray(m)) m = m.join(v), m &&= this.extendTranslation(m, t, i, r);
851
+ else {
852
+ let e = !1, n = !1;
853
+ !this.isValidLookup(m) && x && (e = !0, m = T), this.isValidLookup(m) || (n = !0, m = s);
854
+ let a = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n ? void 0 : m, c = x && T !== m && this.options.updateMissing;
855
+ if (n || e || c) {
856
+ if (this.logger.log(c ? "updateKey" : "missingKey", d, l, s, c ? T : m), o) {
857
+ let e = this.resolve(s, {
858
+ ...i,
859
+ keySeparator: !1
860
+ });
861
+ e && e.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.");
862
+ }
863
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
864
+ if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
865
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(i.lng || this.language) : e.push(i.lng || this.language);
866
+ let n = (e, t, n) => {
867
+ let r = x && n !== m ? n : a;
868
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(e, l, t, r, c, i) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, l, t, r, c, i), this.emit("missingKey", e, l, t, m);
869
+ };
870
+ this.options.saveMissing && (this.options.saveMissingPlurals && b ? e.forEach((e) => {
871
+ let t = this.pluralResolver.getSuffixes(e, i);
872
+ w && i[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
873
+ n([e], s + t, i[`defaultValue${t}`] || T);
874
+ });
875
+ }) : n(e, s, T));
876
+ }
877
+ m = this.extendTranslation(m, t, i, p, r), n && m === s && this.options.appendNamespaceToMissingKey && (m = `${l}${u}${s}`), (n || e) && this.options.parseMissingKeyHandler && (m = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${u}${s}` : s, e ? m : void 0, i));
878
+ }
879
+ return a ? (p.res = m, p.usedParams = this.getUsedParamsDetails(i), p) : m;
880
+ }
881
+ extendTranslation(e, t, n, r, i) {
882
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
883
+ ...this.options.interpolation.defaultVariables,
884
+ ...n
885
+ }, n.lng || this.language || r.usedLng, r.usedNS, r.usedKey, { resolved: r });
886
+ else if (!n.skipInterpolation) {
887
+ n.interpolation && this.interpolator.init({
888
+ ...n,
889
+ interpolation: {
890
+ ...this.options.interpolation,
891
+ ...n.interpolation
892
+ }
893
+ });
894
+ let a = M(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
895
+ if (a) {
896
+ let t = e.match(this.interpolator.nestingRegexp);
897
+ o = t && t.length;
898
+ }
899
+ let s = n.replace && !M(n.replace) ? n.replace : n;
900
+ if (this.options.interpolation.defaultVariables && (s = {
901
+ ...this.options.interpolation.defaultVariables,
902
+ ...s
903
+ }), e = this.interpolator.interpolate(e, s, n.lng || this.language || r.usedLng, n), a) {
904
+ let t = e.match(this.interpolator.nestingRegexp), r = t && t.length;
905
+ o < r && (n.nest = !1);
906
+ }
907
+ !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();
908
+ }
909
+ let a = n.postProcess || this.options.postProcess, o = M(a) ? [a] : a;
910
+ return e != null && o?.length && n.applyPostProcessor !== !1 && (e = Ae.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
911
+ i18nResolved: {
912
+ ...r,
913
+ usedParams: this.getUsedParamsDetails(n)
914
+ },
915
+ ...n
916
+ } : n, this)), e;
917
+ }
918
+ resolve(e, t = {}) {
919
+ let n, r, i, a, o;
920
+ return M(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? q(e, {
921
+ ...this.options,
922
+ ...t
923
+ }) : e)), e.forEach((e) => {
924
+ if (this.isValidLookup(n)) return;
925
+ let s = this.extractFromKey(e, t), c = s.key;
926
+ r = c;
927
+ let l = s.namespaces;
928
+ this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
929
+ let u = t.count !== void 0 && !M(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (M(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
930
+ l.forEach((e) => {
931
+ this.isValidLookup(n) || (o = e, !Ne[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (Ne[`${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) => {
932
+ if (this.isValidLookup(n)) return;
933
+ a = r;
934
+ let o = [c];
935
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o, c, r, e, t);
936
+ else {
937
+ let e;
938
+ u && (e = this.pluralResolver.getSuffix(r, t.count, t));
939
+ let n = `${this.options.pluralSeparator}zero`, i = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
940
+ if (u && (t.ordinal && e.indexOf(i) === 0 && o.push(c + e.replace(i, this.options.pluralSeparator)), o.push(c + e), d && o.push(c + n)), f) {
941
+ let r = `${c}${this.options.contextSeparator || "_"}${t.context}`;
942
+ o.push(r), u && (t.ordinal && e.indexOf(i) === 0 && o.push(r + e.replace(i, this.options.pluralSeparator)), o.push(r + e), d && o.push(r + n));
943
+ }
944
+ }
945
+ let s;
946
+ for (; s = o.pop();) this.isValidLookup(n) || (i = s, n = this.getResource(r, e, s, t));
947
+ }));
948
+ });
949
+ }), {
950
+ res: n,
951
+ usedKey: r,
952
+ exactUsedKey: i,
953
+ usedLng: a,
954
+ usedNS: o
955
+ };
956
+ }
957
+ isValidLookup(e) {
958
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
959
+ }
960
+ getResource(e, t, n, r = {}) {
961
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
962
+ }
963
+ getUsedParamsDetails(e = {}) {
964
+ let t = [
965
+ "defaultValue",
966
+ "ordinal",
967
+ "context",
968
+ "replace",
969
+ "lng",
970
+ "lngs",
971
+ "fallbackLng",
972
+ "ns",
973
+ "keySeparator",
974
+ "nsSeparator",
975
+ "returnObjects",
976
+ "returnDetails",
977
+ "joinArrays",
978
+ "postProcess",
979
+ "interpolation"
980
+ ], n = e.replace && !M(e.replace), r = n ? e.replace : e;
981
+ if (n && e.count !== void 0 && (r.count = e.count), this.options.interpolation.defaultVariables && (r = {
982
+ ...this.options.interpolation.defaultVariables,
983
+ ...r
984
+ }), !n) {
985
+ r = { ...r };
986
+ for (let e of t) delete r[e];
987
+ }
988
+ return r;
989
+ }
990
+ static hasDefaultValue(e) {
991
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
992
+ return !1;
993
+ }
994
+ }, Fe = class {
995
+ constructor(e) {
996
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = W.create("languageUtils");
997
+ }
998
+ getScriptPartFromCode(e) {
999
+ if (e = U(e), !e || e.indexOf("-") < 0) return null;
1000
+ let t = e.split("-");
1001
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
1002
+ }
1003
+ getLanguagePartFromCode(e) {
1004
+ if (e = U(e), !e || e.indexOf("-") < 0) return e;
1005
+ let t = e.split("-");
1006
+ return this.formatLanguageCode(t[0]);
1007
+ }
1008
+ formatLanguageCode(e) {
1009
+ if (M(e) && e.indexOf("-") > -1) {
1010
+ let t;
1011
+ try {
1012
+ t = Intl.getCanonicalLocales(e)[0];
1013
+ } catch {}
1014
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
1015
+ }
1016
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
1017
+ }
1018
+ isSupportedCode(e) {
1019
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
1020
+ }
1021
+ getBestMatchFromCodes(e) {
1022
+ if (!e) return null;
1023
+ let t;
1024
+ return e.forEach((e) => {
1025
+ if (t) return;
1026
+ let n = this.formatLanguageCode(e);
1027
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
1028
+ }), !t && this.options.supportedLngs && e.forEach((e) => {
1029
+ if (t) return;
1030
+ let n = this.getScriptPartFromCode(e);
1031
+ if (this.isSupportedCode(n)) return t = n;
1032
+ let r = this.getLanguagePartFromCode(e);
1033
+ if (this.isSupportedCode(r)) return t = r;
1034
+ t = this.options.supportedLngs.find((e) => {
1035
+ if (e === r || !(e.indexOf("-") < 0 && r.indexOf("-") < 0) && (e.indexOf("-") > 0 && r.indexOf("-") < 0 && e.substring(0, e.indexOf("-")) === r || e.indexOf(r) === 0 && r.length > 1)) return e;
1036
+ });
1037
+ }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
1038
+ }
1039
+ getFallbackCodes(e, t) {
1040
+ if (!e) return [];
1041
+ if (typeof e == "function" && (e = e(t)), M(e) && (e = [e]), Array.isArray(e)) return e;
1042
+ if (!t) return e.default || [];
1043
+ let n = e[t];
1044
+ return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
1045
+ }
1046
+ toResolveHierarchy(e, t) {
1047
+ let n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), r = [], i = (e) => {
1048
+ e && (this.isSupportedCode(e) ? r.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
1049
+ };
1050
+ return M(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && i(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && i(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && i(this.getLanguagePartFromCode(e))) : M(e) && i(this.formatLanguageCode(e)), n.forEach((e) => {
1051
+ r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
1052
+ }), r;
1053
+ }
1054
+ }, Ie = {
1055
+ zero: 0,
1056
+ one: 1,
1057
+ two: 2,
1058
+ few: 3,
1059
+ many: 4,
1060
+ other: 5
1061
+ }, Le = {
1062
+ select: (e) => e === 1 ? "one" : "other",
1063
+ resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
1064
+ }, Re = class {
1065
+ constructor(e, t = {}) {
1066
+ this.languageUtils = e, this.options = t, this.logger = W.create("pluralResolver"), this.pluralRulesCache = {};
1067
+ }
1068
+ clearCache() {
1069
+ this.pluralRulesCache = {};
1070
+ }
1071
+ getRule(e, t = {}) {
1072
+ let n = U(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
1073
+ cleanedCode: n,
1074
+ type: r
1075
+ });
1076
+ if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
1077
+ let a;
1078
+ try {
1079
+ a = new Intl.PluralRules(n, { type: r });
1080
+ } catch {
1081
+ if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), Le;
1082
+ if (!e.match(/-|_/)) return Le;
1083
+ let n = this.languageUtils.getLanguagePartFromCode(e);
1084
+ a = this.getRule(n, t);
1085
+ }
1086
+ return this.pluralRulesCache[i] = a, a;
1087
+ }
1088
+ needsPlural(e, t = {}) {
1089
+ let n = this.getRule(e, t);
1090
+ return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
1091
+ }
1092
+ getPluralFormsOfKey(e, t, n = {}) {
1093
+ return this.getSuffixes(e, n).map((e) => `${t}${e}`);
1094
+ }
1095
+ getSuffixes(e, t = {}) {
1096
+ let n = this.getRule(e, t);
1097
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => Ie[e] - Ie[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
1098
+ }
1099
+ getSuffix(e, t, n = {}) {
1100
+ let r = this.getRule(e, n);
1101
+ 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));
1102
+ }
1103
+ }, ze = (e, t, n, r = ".", i = !0) => {
1104
+ let a = Se(e, t, n);
1105
+ return !a && i && M(n) && (a = H(e, n, r), a === void 0 && (a = H(t, n, r))), a;
1106
+ }, Y = (e) => e.replace(/\$/g, "$$$$"), Be = class {
1107
+ constructor(e = {}) {
1108
+ this.logger = W.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
1109
+ }
1110
+ init(e = {}) {
1111
+ e.interpolation ||= { escapeValue: !0 };
1112
+ 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: _ } = e.interpolation;
1113
+ this.escape = t === void 0 ? we : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? V(i) : a || "{{", this.suffix = o ? V(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? V(d) : f || V("$t("), this.nestingSuffix = p ? V(p) : m || V(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
1114
+ }
1115
+ reset() {
1116
+ this.options && this.init(this.options);
1117
+ }
1118
+ resetRegExp() {
1119
+ let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
1120
+ this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
1121
+ }
1122
+ interpolate(e, t, n, r) {
1123
+ let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
1124
+ if (e.indexOf(this.formatSeparator) < 0) {
1125
+ let i = ze(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
1126
+ return this.alwaysFormat ? this.format(i, void 0, n, {
1127
+ ...r,
1128
+ ...t,
1129
+ interpolationkey: e
1130
+ }) : i;
1131
+ }
1132
+ let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
1133
+ return this.format(ze(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
1134
+ ...r,
1135
+ ...t,
1136
+ interpolationkey: a
1137
+ });
1138
+ };
1139
+ this.resetRegExp();
1140
+ let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
1141
+ return [{
1142
+ regex: this.regexpUnescape,
1143
+ safeValue: (e) => Y(e)
1144
+ }, {
1145
+ regex: this.regexp,
1146
+ safeValue: (e) => this.escapeValue ? Y(this.escape(e)) : Y(e)
1147
+ }].forEach((t) => {
1148
+ for (o = 0; i = t.regex.exec(e);) {
1149
+ let n = i[1].trim();
1150
+ if (a = c(n), a === void 0) if (typeof l == "function") {
1151
+ let t = l(e, i, r);
1152
+ a = M(t) ? t : "";
1153
+ } else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
1154
+ else if (u) {
1155
+ a = i[0];
1156
+ continue;
1157
+ } else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
1158
+ else !M(a) && !this.useRawValueToEscape && (a = P(a));
1159
+ let s = t.safeValue(a);
1160
+ 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;
1161
+ }
1162
+ }), e;
1163
+ }
1164
+ nest(e, t, n = {}) {
1165
+ let r, i, a, o = (e, t) => {
1166
+ let n = this.nestingOptionsSeparator;
1167
+ if (e.indexOf(n) < 0) return e;
1168
+ let r = e.split(RegExp(`${V(n)}[ ]*{`)), i = `{${r[1]}`;
1169
+ e = r[0], i = this.interpolate(i, a);
1170
+ let o = i.match(/'/g), s = i.match(/"/g);
1171
+ ((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
1172
+ try {
1173
+ a = JSON.parse(i), t && (a = {
1174
+ ...t,
1175
+ ...a
1176
+ });
1177
+ } catch (t) {
1178
+ return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
1179
+ }
1180
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, e;
1181
+ };
1182
+ for (; r = this.nestingRegexp.exec(e);) {
1183
+ let s = [];
1184
+ a = { ...n }, a = a.replace && !M(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
1185
+ let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
1186
+ 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 && !M(i)) return i;
1187
+ M(i) || (i = P(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, {
1188
+ ...n,
1189
+ interpolationkey: r[1].trim()
1190
+ }), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
1191
+ }
1192
+ return e;
1193
+ }
1194
+ }, Ve = (e) => {
1195
+ let t = e.toLowerCase().trim(), n = {};
1196
+ if (e.indexOf("(") > -1) {
1197
+ let r = e.split("(");
1198
+ t = r[0].toLowerCase().trim();
1199
+ let i = r[1].substring(0, r[1].length - 1);
1200
+ t === "currency" && i.indexOf(":") < 0 ? n.currency ||= i.trim() : t === "relativetime" && i.indexOf(":") < 0 ? n.range ||= i.trim() : i.split(";").forEach((e) => {
1201
+ if (e) {
1202
+ let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
1203
+ n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
1204
+ }
1205
+ });
1206
+ }
1207
+ return {
1208
+ formatName: t,
1209
+ formatOptions: n
1210
+ };
1211
+ }, He = (e) => {
1212
+ let t = {};
1213
+ return (n, r, i) => {
1214
+ let a = i;
1215
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
1216
+ ...a,
1217
+ [i.interpolationkey]: void 0
1218
+ });
1219
+ let o = r + JSON.stringify(a), s = t[o];
1220
+ return s || (s = e(U(r), i), t[o] = s), s(n);
1221
+ };
1222
+ }, Ue = (e) => (t, n, r) => e(U(n), r)(t), We = class {
1223
+ constructor(e = {}) {
1224
+ this.logger = W.create("formatter"), this.options = e, this.init(e);
1225
+ }
1226
+ init(e, t = { interpolation: {} }) {
1227
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
1228
+ let n = t.cacheInBuiltFormats ? He : Ue;
1229
+ this.formats = {
1230
+ number: n((e, t) => {
1231
+ let n = new Intl.NumberFormat(e, { ...t });
1232
+ return (e) => n.format(e);
1233
+ }),
1234
+ currency: n((e, t) => {
1235
+ let n = new Intl.NumberFormat(e, {
1236
+ ...t,
1237
+ style: "currency"
1238
+ });
1239
+ return (e) => n.format(e);
1240
+ }),
1241
+ datetime: n((e, t) => {
1242
+ let n = new Intl.DateTimeFormat(e, { ...t });
1243
+ return (e) => n.format(e);
1244
+ }),
1245
+ relativetime: n((e, t) => {
1246
+ let n = new Intl.RelativeTimeFormat(e, { ...t });
1247
+ return (e) => n.format(e, t.range || "day");
1248
+ }),
1249
+ list: n((e, t) => {
1250
+ let n = new Intl.ListFormat(e, { ...t });
1251
+ return (e) => n.format(e);
1252
+ })
1253
+ };
1254
+ }
1255
+ add(e, t) {
1256
+ this.formats[e.toLowerCase().trim()] = t;
1257
+ }
1258
+ addCached(e, t) {
1259
+ this.formats[e.toLowerCase().trim()] = He(t);
1260
+ }
1261
+ format(e, t, n, r = {}) {
1262
+ let i = t.split(this.formatSeparator);
1263
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((e) => e.indexOf(")") > -1)) {
1264
+ let e = i.findIndex((e) => e.indexOf(")") > -1);
1265
+ i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
1266
+ }
1267
+ return i.reduce((e, t) => {
1268
+ let { formatName: i, formatOptions: a } = Ve(t);
1269
+ if (this.formats[i]) {
1270
+ let t = e;
1271
+ try {
1272
+ let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
1273
+ t = this.formats[i](e, s, {
1274
+ ...a,
1275
+ ...r,
1276
+ ...o
1277
+ });
1278
+ } catch (e) {
1279
+ this.logger.warn(e);
1280
+ }
1281
+ return t;
1282
+ } else this.logger.warn(`there was no format function for ${i}`);
1283
+ return e;
1284
+ }, e);
1285
+ }
1286
+ }, Ge = (e, t) => {
1287
+ e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
1288
+ }, Ke = class extends G {
1289
+ constructor(e, t, n, r = {}) {
1290
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = W.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);
1291
+ }
1292
+ queueLoad(e, t, n, r) {
1293
+ let i = {}, a = {}, o = {}, s = {};
1294
+ return e.forEach((e) => {
1295
+ let r = !0;
1296
+ t.forEach((t) => {
1297
+ let o = `${e}|${t}`;
1298
+ !n.reload && this.store.hasResourceBundle(e, t) ? this.state[o] = 2 : this.state[o] < 0 || (this.state[o] === 1 ? a[o] === void 0 && (a[o] = !0) : (this.state[o] = 1, r = !1, a[o] === void 0 && (a[o] = !0), i[o] === void 0 && (i[o] = !0), s[t] === void 0 && (s[t] = !0)));
1299
+ }), r || (o[e] = !0);
1300
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
1301
+ pending: a,
1302
+ pendingCount: Object.keys(a).length,
1303
+ loaded: {},
1304
+ errors: [],
1305
+ callback: r
1306
+ }), {
1307
+ toLoad: Object.keys(i),
1308
+ pending: Object.keys(a),
1309
+ toLoadLanguages: Object.keys(o),
1310
+ toLoadNamespaces: Object.keys(s)
1311
+ };
1312
+ }
1313
+ loaded(e, t, n) {
1314
+ let r = e.split("|"), i = r[0], a = r[1];
1315
+ 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);
1316
+ let o = {};
1317
+ this.queue.forEach((n) => {
1318
+ xe(n.loaded, [i], a), Ge(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
1319
+ o[e] || (o[e] = {});
1320
+ let t = n.loaded[e];
1321
+ t.length && t.forEach((t) => {
1322
+ o[e][t] === void 0 && (o[e][t] = !0);
1323
+ });
1324
+ }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
1325
+ }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
1326
+ }
1327
+ read(e, t, n, r = 0, i = this.retryTimeout, a) {
1328
+ if (!e.length) return a(null, {});
1329
+ if (this.readingCalls >= this.maxParallelReads) {
1330
+ this.waitingReads.push({
1331
+ lng: e,
1332
+ ns: t,
1333
+ fcName: n,
1334
+ tried: r,
1335
+ wait: i,
1336
+ callback: a
1337
+ });
1338
+ return;
1339
+ }
1340
+ this.readingCalls++;
1341
+ let o = (o, s) => {
1342
+ if (this.readingCalls--, this.waitingReads.length > 0) {
1343
+ let e = this.waitingReads.shift();
1344
+ this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
1345
+ }
1346
+ if (o && s && r < this.maxRetries) {
1347
+ setTimeout(() => {
1348
+ this.read.call(this, e, t, n, r + 1, i * 2, a);
1349
+ }, i);
1350
+ return;
1351
+ }
1352
+ a(o, s);
1353
+ }, s = this.backend[n].bind(this.backend);
1354
+ if (s.length === 2) {
1355
+ try {
1356
+ let n = s(e, t);
1357
+ n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
1358
+ } catch (e) {
1359
+ o(e);
1360
+ }
1361
+ return;
1362
+ }
1363
+ return s(e, t, o);
1364
+ }
1365
+ prepareLoading(e, t, n = {}, r) {
1366
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
1367
+ M(e) && (e = this.languageUtils.toResolveHierarchy(e)), M(t) && (t = [t]);
1368
+ let i = this.queueLoad(e, t, n, r);
1369
+ if (!i.toLoad.length) return i.pending.length || r(), null;
1370
+ i.toLoad.forEach((e) => {
1371
+ this.loadOne(e);
1372
+ });
1373
+ }
1374
+ load(e, t, n) {
1375
+ this.prepareLoading(e, t, {}, n);
1376
+ }
1377
+ reload(e, t, n) {
1378
+ this.prepareLoading(e, t, { reload: !0 }, n);
1379
+ }
1380
+ loadOne(e, t = "") {
1381
+ let n = e.split("|"), r = n[0], i = n[1];
1382
+ this.read(r, i, "read", void 0, void 0, (n, a) => {
1383
+ n && this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`, n), !n && a && this.logger.log(`${t}loaded namespace ${i} for language ${r}`, a), this.loaded(e, n, a);
1384
+ });
1385
+ }
1386
+ saveMissing(e, t, n, r, i, a = {}, o = () => {}) {
1387
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
1388
+ this.logger.warn(`did not save key "${n}" as the namespace "${t}" 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!!!");
1389
+ return;
1390
+ }
1391
+ if (!(n == null || n === "")) {
1392
+ if (this.backend?.create) {
1393
+ let s = {
1394
+ ...a,
1395
+ isUpdate: i
1396
+ }, c = this.backend.create.bind(this.backend);
1397
+ if (c.length < 6) try {
1398
+ let i;
1399
+ i = c.length === 5 ? c(e, t, n, r, s) : c(e, t, n, r), i && typeof i.then == "function" ? i.then((e) => o(null, e)).catch(o) : o(null, i);
1400
+ } catch (e) {
1401
+ o(e);
1402
+ }
1403
+ else c(e, t, n, r, o, s);
1404
+ }
1405
+ !e || !e[0] || this.store.addResource(e[0], t, n, r);
1406
+ }
1407
+ }
1408
+ }, X = () => ({
1409
+ debug: !1,
1410
+ initAsync: !0,
1411
+ ns: ["translation"],
1412
+ defaultNS: ["translation"],
1413
+ fallbackLng: ["dev"],
1414
+ fallbackNS: !1,
1415
+ supportedLngs: !1,
1416
+ nonExplicitSupportedLngs: !1,
1417
+ load: "all",
1418
+ preload: !1,
1419
+ simplifyPluralSuffix: !0,
1420
+ keySeparator: ".",
1421
+ nsSeparator: ":",
1422
+ pluralSeparator: "_",
1423
+ contextSeparator: "_",
1424
+ partialBundledLanguages: !1,
1425
+ saveMissing: !1,
1426
+ updateMissing: !1,
1427
+ saveMissingTo: "fallback",
1428
+ saveMissingPlurals: !0,
1429
+ missingKeyHandler: !1,
1430
+ missingInterpolationHandler: !1,
1431
+ postProcess: !1,
1432
+ postProcessPassResolved: !1,
1433
+ returnNull: !1,
1434
+ returnEmptyString: !0,
1435
+ returnObjects: !1,
1436
+ joinArrays: !1,
1437
+ returnedObjectHandler: !1,
1438
+ parseMissingKeyHandler: !1,
1439
+ appendNamespaceToMissingKey: !1,
1440
+ appendNamespaceToCIMode: !1,
1441
+ overloadTranslationOptionHandler: (e) => {
1442
+ let t = {};
1443
+ if (typeof e[1] == "object" && (t = e[1]), M(e[1]) && (t.defaultValue = e[1]), M(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
1444
+ let n = e[3] || e[2];
1445
+ Object.keys(n).forEach((e) => {
1446
+ t[e] = n[e];
1447
+ });
1448
+ }
1449
+ return t;
1450
+ },
1451
+ interpolation: {
1452
+ escapeValue: !0,
1453
+ format: (e) => e,
1454
+ prefix: "{{",
1455
+ suffix: "}}",
1456
+ formatSeparator: ",",
1457
+ unescapePrefix: "-",
1458
+ nestingPrefix: "$t(",
1459
+ nestingSuffix: ")",
1460
+ nestingOptionsSeparator: ",",
1461
+ maxReplaces: 1e3,
1462
+ skipOnVariables: !0
1463
+ },
1464
+ cacheInBuiltFormats: !0
1465
+ }), qe = (e) => (M(e.ns) && (e.ns = [e.ns]), M(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), M(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), Z = () => {}, Je = (e) => {
1466
+ Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
1467
+ typeof e[t] == "function" && (e[t] = e[t].bind(e));
1468
+ });
1469
+ }, Ye = "__i18next_supportNoticeShown", Xe = () => !!(typeof globalThis < "u" && globalThis[Ye] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), Ze = () => {
1470
+ typeof globalThis < "u" && (globalThis[Ye] = !0);
1471
+ }, Qe = (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)), Q = class e extends G {
1472
+ constructor(e = {}, t) {
1473
+ if (super(), this.options = qe(e), this.services = {}, this.logger = W, this.modules = { external: [] }, Je(this), t && !this.isInitialized && !e.isClone) {
1474
+ if (!this.options.initAsync) return this.init(e, t), this;
1475
+ setTimeout(() => {
1476
+ this.init(e, t);
1477
+ }, 0);
1478
+ }
1479
+ }
1480
+ init(e = {}, t) {
1481
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (M(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
1482
+ let n = X();
1483
+ this.options = {
1484
+ ...n,
1485
+ ...this.options,
1486
+ ...qe(e)
1487
+ }, this.options.interpolation = {
1488
+ ...n.interpolation,
1489
+ ...this.options.interpolation
1490
+ }, 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 && !Qe(this) && !Xe() && (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 💙"), Ze());
1491
+ let r = (e) => e ? typeof e == "function" ? new e() : e : null;
1492
+ if (!this.options.isClone) {
1493
+ this.modules.logger ? W.init(r(this.modules.logger), this.options) : W.init(null, this.options);
1494
+ let e;
1495
+ e = this.modules.formatter ? this.modules.formatter : We;
1496
+ let t = new Fe(this.options);
1497
+ this.store = new K(this.options.resources, this.options);
1498
+ let i = this.services;
1499
+ i.logger = W, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new Re(t, {
1500
+ prepend: this.options.pluralSeparator,
1501
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1502
+ }), 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 Be(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new Ke(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
1503
+ this.emit(e, ...t);
1504
+ }), 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 Pe(this.services, this.options), this.translator.on("*", (e, ...t) => {
1505
+ this.emit(e, ...t);
1506
+ }), this.modules.external.forEach((e) => {
1507
+ e.init && e.init(this);
1508
+ });
1509
+ }
1510
+ if (this.format = this.options.interpolation.format, t ||= Z, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1511
+ let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1512
+ e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1513
+ }
1514
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
1515
+ "getResource",
1516
+ "hasResourceBundle",
1517
+ "getResourceBundle",
1518
+ "getDataByLanguage"
1519
+ ].forEach((e) => {
1520
+ this[e] = (...t) => this.store[e](...t);
1521
+ }), [
1522
+ "addResource",
1523
+ "addResources",
1524
+ "addResourceBundle",
1525
+ "removeResourceBundle"
1526
+ ].forEach((e) => {
1527
+ this[e] = (...t) => (this.store[e](...t), this);
1528
+ });
1529
+ let i = N(), a = () => {
1530
+ let e = (e, n) => {
1531
+ 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);
1532
+ };
1533
+ if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1534
+ this.changeLanguage(this.options.lng, e);
1535
+ };
1536
+ return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
1537
+ }
1538
+ loadResources(e, t = Z) {
1539
+ let n = t, r = M(e) ? e : this.language;
1540
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1541
+ if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1542
+ let e = [], t = (t) => {
1543
+ t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1544
+ t !== "cimode" && e.indexOf(t) < 0 && e.push(t);
1545
+ });
1546
+ };
1547
+ r ? t(r) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => t(e)), this.options.preload?.forEach?.((e) => t(e)), this.services.backendConnector.load(e, this.options.ns, (e) => {
1548
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(e);
1549
+ });
1550
+ } else n(null);
1551
+ }
1552
+ reloadResources(e, t, n) {
1553
+ let r = N();
1554
+ 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 ||= Z, this.services.backendConnector.reload(e, t, (e) => {
1555
+ r.resolve(), n(e);
1556
+ }), r;
1557
+ }
1558
+ use(e) {
1559
+ if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1560
+ if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1561
+ 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" && Ae.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1562
+ }
1563
+ setResolvedLanguage(e) {
1564
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
1565
+ for (let e = 0; e < this.languages.length; e++) {
1566
+ let t = this.languages[e];
1567
+ if (!(["cimode", "dev"].indexOf(t) > -1) && this.store.hasLanguageSomeTranslations(t)) {
1568
+ this.resolvedLanguage = t;
1569
+ break;
1570
+ }
1571
+ }
1572
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1573
+ }
1574
+ }
1575
+ changeLanguage(e, t) {
1576
+ this.isLanguageChangingTo = e;
1577
+ let n = N();
1578
+ this.emit("languageChanging", e);
1579
+ let r = (e) => {
1580
+ this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1581
+ }, i = (i, a) => {
1582
+ a ? this.isLanguageChangingTo === e && (r(a), this.translator.changeLanguage(a), this.isLanguageChangingTo = void 0, this.emit("languageChanged", a), this.logger.log("languageChanged", a)) : this.isLanguageChangingTo = void 0, n.resolve((...e) => this.t(...e)), t && t(i, (...e) => this.t(...e));
1583
+ }, a = (t) => {
1584
+ !e && !t && this.services.languageDetector && (t = []);
1585
+ let n = M(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(M(t) ? [t] : t);
1586
+ a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
1587
+ i(e, a);
1588
+ });
1589
+ };
1590
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), n;
1591
+ }
1592
+ getFixedT(e, t, n) {
1593
+ let r = (e, t, ...i) => {
1594
+ let a;
1595
+ a = typeof t == "object" ? { ...t } : this.options.overloadTranslationOptionHandler([e, t].concat(i)), a.lng = a.lng || r.lng, a.lngs = a.lngs || r.lngs, a.ns = a.ns || r.ns, a.keyPrefix !== "" && (a.keyPrefix = a.keyPrefix || n || r.keyPrefix);
1596
+ let o = {
1597
+ ...this.options,
1598
+ ...a
1599
+ };
1600
+ typeof a.keyPrefix == "function" && (a.keyPrefix = q(a.keyPrefix, o));
1601
+ let s = this.options.keySeparator || ".", c;
1602
+ return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = q(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = q(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1603
+ };
1604
+ return M(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
1605
+ }
1606
+ t(...e) {
1607
+ return this.translator?.translate(...e);
1608
+ }
1609
+ exists(...e) {
1610
+ return this.translator?.exists(...e);
1611
+ }
1612
+ setDefaultNamespace(e) {
1613
+ this.options.defaultNS = e;
1614
+ }
1615
+ hasLoadedNamespace(e, t = {}) {
1616
+ if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1617
+ if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1618
+ let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1619
+ if (n.toLowerCase() === "cimode") return !0;
1620
+ let a = (e, t) => {
1621
+ let n = this.services.backendConnector.state[`${e}|${t}`];
1622
+ return n === -1 || n === 0 || n === 2;
1623
+ };
1624
+ if (t.precheck) {
1625
+ let e = t.precheck(this, a);
1626
+ if (e !== void 0) return e;
1627
+ }
1628
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1629
+ }
1630
+ loadNamespaces(e, t) {
1631
+ let n = N();
1632
+ return this.options.ns ? (M(e) && (e = [e]), e.forEach((e) => {
1633
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
1634
+ }), this.loadResources((e) => {
1635
+ n.resolve(), t && t(e);
1636
+ }), n) : (t && t(), Promise.resolve());
1637
+ }
1638
+ loadLanguages(e, t) {
1639
+ let n = N();
1640
+ M(e) && (e = [e]);
1641
+ let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1642
+ return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
1643
+ n.resolve(), t && t(e);
1644
+ }), n) : (t && t(), Promise.resolve());
1645
+ }
1646
+ dir(e) {
1647
+ if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
1648
+ try {
1649
+ let t = new Intl.Locale(e);
1650
+ if (t && t.getTextInfo) {
1651
+ let e = t.getTextInfo();
1652
+ if (e && e.direction) return e.direction;
1653
+ }
1654
+ } catch {}
1655
+ 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 Fe(X());
1656
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1657
+ }
1658
+ static createInstance(t = {}, n) {
1659
+ let r = new e(t, n);
1660
+ return r.createInstance = e.createInstance, r;
1661
+ }
1662
+ cloneInstance(t = {}, n = Z) {
1663
+ let r = t.forkResourceStore;
1664
+ r && delete t.forkResourceStore;
1665
+ let i = {
1666
+ ...this.options,
1667
+ ...t,
1668
+ isClone: !0
1669
+ }, a = new e(i);
1670
+ if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1671
+ "store",
1672
+ "services",
1673
+ "language"
1674
+ ].forEach((e) => {
1675
+ a[e] = this[e];
1676
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new K(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) {
1677
+ let e = {
1678
+ ...X().interpolation,
1679
+ ...this.options.interpolation,
1680
+ ...t.interpolation
1681
+ }, n = {
1682
+ ...i,
1683
+ interpolation: e
1684
+ };
1685
+ a.services.interpolator = new Be(n);
1686
+ }
1687
+ return a.translator = new Pe(a.services, i), a.translator.on("*", (e, ...t) => {
1688
+ a.emit(e, ...t);
1689
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1690
+ }
1691
+ toJSON() {
1692
+ return {
1693
+ options: this.options,
1694
+ store: this.store,
1695
+ language: this.language,
1696
+ languages: this.languages,
1697
+ resolvedLanguage: this.resolvedLanguage
1698
+ };
1699
+ }
1700
+ }.createInstance();
1701
+ //#endregion
1702
+ //#region ../../shared/translator/dist/index.js
1703
+ Q.createInstance, Q.dir, Q.init, Q.loadResources, Q.reloadResources, Q.use, Q.changeLanguage, Q.getFixedT, Q.t, Q.exists, Q.setDefaultNamespace, Q.hasLoadedNamespace, Q.loadNamespaces, Q.loadLanguages, Q.init({
1704
+ fallbackLng: "en",
1705
+ lng: "en",
1706
+ showSupportNotice: !1,
1707
+ resources: {
1708
+ en: _e,
1709
+ es: ve
1710
+ }
1711
+ });
1712
+ //#endregion
1713
+ //#region src/i18n.ts
1714
+ var { translator: $ } = {
1715
+ translator: {
1716
+ ...Q,
1717
+ t: (e, t) => {
1718
+ let { lng: n } = t;
1719
+ switch (n) {
1720
+ case "en_US":
1721
+ case "en-US":
1722
+ t.lng = "en";
1723
+ break;
1724
+ case "es_ES":
1725
+ case "es-ES":
1726
+ case "es_MX":
1727
+ case "es-MX":
1728
+ t.lng = "es";
1729
+ break;
1730
+ default: break;
1731
+ }
1732
+ return Q.t(e, {
1733
+ lng: n,
1734
+ ...t
1735
+ });
1736
+ }
1737
+ },
1738
+ languageOptions: [{
1739
+ value: "en_US",
1740
+ label: "English (US)"
1741
+ }, {
1742
+ value: "es_ES",
1743
+ label: "Spanish"
1744
+ }]
1745
+ };
1746
+ function $e(e, t) {
1747
+ return $.t(`translation:simpleCloze:${e}`, { lng: t });
1748
+ }
1749
+ function et(e, t) {
1750
+ return $.t(`common:${e}`, { lng: t });
1751
+ }
1752
+ //#endregion
1753
+ export { et as n, j as r, $e as t };
1754
+
1755
+ //# sourceMappingURL=i18n-BTsdzpBv.js.map