@pie-element/placement-ordering 14.1.2-next.19 → 14.1.2-next.20

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