@pie-element/multiple-choice 13.4.0-beta.0 → 13.4.0-next.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/author.js +2 -0
  2. package/configure.js +2 -0
  3. package/controller.js +1 -0
  4. package/dist/author/defaults.d.ts +205 -0
  5. package/dist/author/defaults.js +151 -0
  6. package/dist/author/index.d.ts +26 -0
  7. package/dist/author/index.js +119 -0
  8. package/dist/author/main.d.ts +34 -0
  9. package/dist/author/main.js +287 -0
  10. package/dist/author/utils.d.ts +9 -0
  11. package/dist/author/utils.js +7 -0
  12. package/dist/browser/Radio-B-Cd30zs.js +9592 -0
  13. package/dist/browser/Radio-B-Cd30zs.js.map +1 -0
  14. package/dist/browser/author/index.js +35031 -0
  15. package/dist/browser/author/index.js.map +1 -0
  16. package/dist/browser/controller/index.js +204 -0
  17. package/dist/browser/controller/index.js.map +1 -0
  18. package/dist/browser/delivery/index.js +303 -0
  19. package/dist/browser/delivery/index.js.map +1 -0
  20. package/dist/browser/dist-CHbLnyuX.js +111 -0
  21. package/dist/browser/dist-CHbLnyuX.js.map +1 -0
  22. package/dist/browser/main-DoiD4nKm.js +2553 -0
  23. package/dist/browser/main-DoiD4nKm.js.map +1 -0
  24. package/dist/browser/multiple-choice.css +2 -0
  25. package/dist/browser/print/index.js +43 -0
  26. package/dist/browser/print/index.js.map +1 -0
  27. package/dist/controller/defaults.d.ts +35 -0
  28. package/dist/controller/defaults.js +29 -0
  29. package/dist/controller/index.d.ts +65 -0
  30. package/dist/controller/index.js +129 -0
  31. package/dist/controller/utils.d.ts +10 -0
  32. package/dist/controller/utils.js +8 -0
  33. package/dist/delivery/choice-input.d.ts +44 -0
  34. package/dist/delivery/choice-input.js +280 -0
  35. package/dist/delivery/choice.d.ts +20 -0
  36. package/dist/delivery/choice.js +106 -0
  37. package/dist/delivery/feedback-tick.d.ts +20 -0
  38. package/dist/delivery/feedback-tick.js +104 -0
  39. package/dist/delivery/index.d.ts +37 -0
  40. package/dist/delivery/index.js +217 -0
  41. package/dist/delivery/main.d.ts +31 -0
  42. package/dist/delivery/main.js +51 -0
  43. package/dist/delivery/multiple-choice.d.ts +61 -0
  44. package/dist/delivery/multiple-choice.js +245 -0
  45. package/dist/delivery/session-updater.d.ts +10 -0
  46. package/dist/delivery/session-updater.js +9 -0
  47. package/dist/delivery/utils.d.ts +10 -0
  48. package/dist/delivery/utils.js +4 -0
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.iife.d.ts +8 -0
  51. package/dist/index.iife.js +148 -0
  52. package/dist/index.js +2 -0
  53. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  54. package/dist/print/index.d.ts +15 -0
  55. package/dist/print/index.js +43 -0
  56. package/dist/runtime-support.d.ts +12 -0
  57. package/dist/runtime-support.js +12 -0
  58. package/module/print.js +18058 -1
  59. package/module/print.js.map +1 -0
  60. package/package.json +95 -28
  61. package/print.js +2 -0
  62. package/CHANGELOG.json +0 -1972
  63. package/CHANGELOG.md +0 -2741
  64. package/LICENSE.md +0 -5
  65. package/PRINT.md +0 -35
  66. package/README.md +0 -56
  67. package/choice.png +0 -0
  68. package/configure/CHANGELOG.json +0 -1387
  69. package/configure/CHANGELOG.md +0 -2081
  70. package/configure/lib/__tests__/root.test.js +0 -279
  71. package/configure/lib/defaults.js +0 -203
  72. package/configure/lib/defaults.js.map +0 -1
  73. package/configure/lib/index.js +0 -203
  74. package/configure/lib/index.js.map +0 -1
  75. package/configure/lib/main.js +0 -484
  76. package/configure/lib/main.js.map +0 -1
  77. package/configure/lib/utils.js +0 -18
  78. package/configure/lib/utils.js.map +0 -1
  79. package/configure/package.json +0 -22
  80. package/controller/CHANGELOG.json +0 -527
  81. package/controller/CHANGELOG.md +0 -1412
  82. package/controller/lib/__tests__/index.test.js +0 -561
  83. package/controller/lib/__tests__/utils.test.js +0 -8
  84. package/controller/lib/defaults.js +0 -33
  85. package/controller/lib/defaults.js.map +0 -1
  86. package/controller/lib/index.js +0 -298
  87. package/controller/lib/index.js.map +0 -1
  88. package/controller/lib/utils.js +0 -15
  89. package/controller/lib/utils.js.map +0 -1
  90. package/controller/package.json +0 -15
  91. package/docs/config-schema.json +0 -2993
  92. package/docs/config-schema.json.md +0 -2217
  93. package/docs/demo/config.js +0 -8
  94. package/docs/demo/generate.js +0 -61
  95. package/docs/demo/index.html +0 -1
  96. package/docs/demo/pie.manifest.json +0 -11
  97. package/docs/demo/session.js +0 -7
  98. package/docs/pie-schema.json +0 -1332
  99. package/docs/pie-schema.json.md +0 -1015
  100. package/lib/__tests__/choice-input-test.js +0 -49
  101. package/lib/__tests__/choice-input.test.js +0 -49
  102. package/lib/__tests__/index-test.js +0 -206
  103. package/lib/__tests__/index.test.js +0 -221
  104. package/lib/__tests__/key-events-test.js +0 -95
  105. package/lib/__tests__/key-events.test.js +0 -107
  106. package/lib/__tests__/multiple-choice-test.js +0 -101
  107. package/lib/__tests__/multiple-choice.test.js +0 -256
  108. package/lib/__tests__/session-updater-test.js +0 -70
  109. package/lib/__tests__/session-updater.test.js +0 -70
  110. package/lib/choice-input.js +0 -383
  111. package/lib/choice-input.js.map +0 -1
  112. package/lib/choice.js +0 -192
  113. package/lib/choice.js.map +0 -1
  114. package/lib/feedback-tick.js +0 -134
  115. package/lib/feedback-tick.js.map +0 -1
  116. package/lib/index.js +0 -405
  117. package/lib/index.js.map +0 -1
  118. package/lib/main.js +0 -63
  119. package/lib/main.js.map +0 -1
  120. package/lib/multiple-choice.js +0 -399
  121. package/lib/multiple-choice.js.map +0 -1
  122. package/lib/print.js +0 -94
  123. package/lib/print.js.map +0 -1
  124. package/lib/session-updater.js +0 -37
  125. package/lib/session-updater.js.map +0 -1
  126. package/lib/utils.js +0 -14
  127. package/lib/utils.js.map +0 -1
  128. package/module/configure.js +0 -1
  129. package/module/controller.js +0 -3045
  130. package/module/demo.js +0 -86
  131. package/module/element.js +0 -1
  132. package/module/index.html +0 -21
  133. package/module/manifest.json +0 -14
  134. package/module/print-demo.js +0 -124
  135. package/module/print.html +0 -18
@@ -0,0 +1,2553 @@
1
+ import { At as e, It as t, Rt as n, Vt as r, _t as i, g as a, gt as o, h as s, ht as c, i as l, j as u, n as d, o as f, p, s as m, t as h, w as g, yt as _ } from "./Radio-B-Cd30zs.js";
2
+ import v, { useRef as y } from "react";
3
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
4
+ //#region ../../lib-react/icons/dist/correct-response-icon.js
5
+ var C = /* @__PURE__ */ r(n(), 1), w = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ S("svg", {
6
+ preserveAspectRatio: "xMinYMin meet",
7
+ version: "1.1",
8
+ viewBox: "-283 359 34 35",
9
+ style: { enableBackground: "new -283 359 34 35" },
10
+ children: [
11
+ /* @__PURE__ */ x("circle", {
12
+ cx: "-266",
13
+ cy: "375.9",
14
+ r: "14",
15
+ fill: e
16
+ }),
17
+ /* @__PURE__ */ x("path", {
18
+ d: "M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",
19
+ fill: e
20
+ }),
21
+ /* @__PURE__ */ x("polygon", {
22
+ points: "-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",
23
+ fill: t
24
+ })
25
+ ]
26
+ });
27
+ w.propTypes = {
28
+ bgFill: C.default.string.isRequired,
29
+ fgFill: C.default.string.isRequired
30
+ };
31
+ var T = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ S("svg", {
32
+ preserveAspectRatio: "xMinYMin meet",
33
+ version: "1.1",
34
+ viewBox: "-129.5 127 34 35",
35
+ style: { enableBackground: "new -129.5 127 34 35" },
36
+ children: [
37
+ /* @__PURE__ */ x("path", {
38
+ style: {
39
+ fill: "#D0CAC5",
40
+ stroke: "#E6E3E0",
41
+ strokeWidth: .75,
42
+ strokeMiterlimit: 10
43
+ },
44
+ d: "M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\n C-97.4,153.5-104.3,160.4-112.9,160.4z"
45
+ }),
46
+ /* @__PURE__ */ x("path", {
47
+ style: {
48
+ fill: "#B3ABA4",
49
+ stroke: "#CDC7C2",
50
+ strokeWidth: .5,
51
+ strokeMiterlimit: 10
52
+ },
53
+ d: "M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"
54
+ }),
55
+ /* @__PURE__ */ x("circle", {
56
+ cx: "-114.2",
57
+ cy: "143.5",
58
+ r: "14",
59
+ fill: e
60
+ }),
61
+ /* @__PURE__ */ x("path", {
62
+ d: "M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",
63
+ fill: n
64
+ }),
65
+ /* @__PURE__ */ x("polygon", {
66
+ points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
67
+ fill: t
68
+ })
69
+ ]
70
+ });
71
+ T.propTypes = {
72
+ bgFill: C.default.string.isRequired,
73
+ fgFill: C.default.string.isRequired,
74
+ borderFill: C.default.string.isRequired
75
+ };
76
+ var E = _("div")(({ size: e }) => ({
77
+ width: e || "25px",
78
+ height: e || "25px"
79
+ })), D = ({ open: e, size: t }) => /* @__PURE__ */ x(E, {
80
+ size: t,
81
+ children: e ? /* @__PURE__ */ x(w, {
82
+ bgFill: "#bce2ff",
83
+ fgFill: "#1a9cff"
84
+ }) : /* @__PURE__ */ x(T, {
85
+ bgFill: "white",
86
+ fgFill: "#1a9cff",
87
+ borderFill: "#bce2ff"
88
+ })
89
+ });
90
+ D.propTypes = {
91
+ open: C.default.bool,
92
+ size: C.default.string
93
+ }, D.defaultProps = { open: !1 };
94
+ //#endregion
95
+ //#region ../../lib-react/correct-answer-toggle/dist/expander.js
96
+ var O = "height ease-in 300ms, opacity ease-in 300ms", k = _("div")(() => ({
97
+ position: "relative",
98
+ height: 0,
99
+ overflow: "hidden",
100
+ display: "flex",
101
+ visibility: "hidden",
102
+ width: 0,
103
+ "&.enter": {
104
+ transition: O,
105
+ opacity: 1,
106
+ height: "auto",
107
+ width: "auto",
108
+ visibility: "visible",
109
+ minHeight: "25px"
110
+ },
111
+ "&.enter-done": {
112
+ height: "auto",
113
+ visibility: "visible",
114
+ width: "auto",
115
+ minHeight: "25px"
116
+ },
117
+ "&.exit": {
118
+ transition: O,
119
+ opacity: 0,
120
+ height: 0,
121
+ visibility: "visible",
122
+ width: 0
123
+ },
124
+ "&.exit-done": {
125
+ opacity: 0,
126
+ visibility: "hidden",
127
+ height: 0,
128
+ width: 0
129
+ }
130
+ })), A = (e) => {
131
+ let { show: t, children: n, className: r } = e, a = y(null);
132
+ return /* @__PURE__ */ x(i, {
133
+ nodeRef: a,
134
+ in: t,
135
+ appear: !0,
136
+ mountOnEnter: !1,
137
+ timeout: 300,
138
+ classNames: {
139
+ enter: "enter",
140
+ enterDone: "enter-done",
141
+ exit: "exit",
142
+ exitDone: "exit-done"
143
+ },
144
+ children: /* @__PURE__ */ x(k, {
145
+ ref: a,
146
+ className: r,
147
+ children: n
148
+ })
149
+ });
150
+ };
151
+ A.propTypes = {
152
+ show: C.default.bool.isRequired,
153
+ className: C.default.string,
154
+ children: C.default.oneOfType([C.default.arrayOf(C.default.node), C.default.node]).isRequired
155
+ };
156
+ //#endregion
157
+ //#region ../../shared/translator/dist/en.js
158
+ var j = {
159
+ translation: {
160
+ categorize: {
161
+ limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
162
+ maxChoicesPerCategoryRestriction: "To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."
163
+ },
164
+ ebsr: { part: "Part {{index}}" },
165
+ numberLine: {
166
+ addElementLimit_one: "You can only add {{count}} element",
167
+ addElementLimit_other: "You can only add {{count}} elements",
168
+ clearAll: "Clear all"
169
+ },
170
+ imageClozeAssociation: {
171
+ reachedLimit_one: "You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",
172
+ reachedLimit_other: "Full"
173
+ },
174
+ drawingResponse: {
175
+ fillColor: "Fill color",
176
+ outlineColor: "Outline color",
177
+ noFill: "No fill",
178
+ lightblue: "Light blue",
179
+ lightyellow: "Light yellow",
180
+ red: "Red",
181
+ orange: "Orange",
182
+ yellow: "Yellow",
183
+ violet: "Violet",
184
+ blue: "Blue",
185
+ green: "Green",
186
+ white: "White",
187
+ black: "Black",
188
+ onDoubleClick: "Double click to edit this text. Press Enter to submit."
189
+ },
190
+ charting: {
191
+ addCategory: "Add category",
192
+ actions: "Actions",
193
+ add: "Add",
194
+ delete: "Delete",
195
+ newLabel: "New label",
196
+ reachedLimit_other: "There can't be more than {{count}} categories.",
197
+ keyLegend: {
198
+ incorrectAnswer: "Student incorrect answer",
199
+ correctAnswer: "Student correct answer",
200
+ correctKeyAnswer: "Answer key correct"
201
+ }
202
+ },
203
+ graphing: {
204
+ point: "Point",
205
+ circle: "Circle",
206
+ line: "Line",
207
+ parabola: "Parabola",
208
+ absolute: "Absolute Value",
209
+ exponential: "Exponential",
210
+ polygon: "Polygon",
211
+ ray: "Ray",
212
+ segment: "Segment",
213
+ sine: "Sine",
214
+ vector: "Vector",
215
+ label: "Label",
216
+ redo: "Redo",
217
+ reset: "Reset"
218
+ },
219
+ 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." },
220
+ mcPopulatedBlank: {
221
+ answerChoices: "Answer choices",
222
+ blankLabel: "blank",
223
+ emptyBlank: "(blank)",
224
+ blankPreSelectionHint: "The answer you choose will appear on the blank line above.",
225
+ correctAnswerSelected: "Correct answer selected",
226
+ incorrectAnswerSelected: "Incorrect answer selected",
227
+ selectedAnswerImage: "Selected answer image",
228
+ choiceImage: "Choice {{id}}",
229
+ clickToEnableAutoplay: "Click to enable audio autoplay",
230
+ audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
231
+ listen: "Listen",
232
+ listenSilentAlt: "Repeat instructions",
233
+ listenPlayingAlt: "Instructions are playing",
234
+ printAudio: "Audio:",
235
+ printTranscript: "Transcript:"
236
+ },
237
+ multipleChoice: {
238
+ minSelections: "Select at least {{minSelections}}.",
239
+ maxSelections_one: "Only {{maxSelections}} answer is allowed.",
240
+ maxSelections_other: "Only {{maxSelections}} answers are allowed.",
241
+ minmaxSelections_equal: "Select {{minSelections}}.",
242
+ minmaxSelections_range: "Select between {{minSelections}} and {{maxSelections}}."
243
+ },
244
+ selectText: {
245
+ correctAnswerSelected: "Correct",
246
+ correctAnswerNotSelected: "Correct Answer Not Selected",
247
+ incorrectSelection: "Incorrect Selection",
248
+ key: "Key"
249
+ },
250
+ simpleCloze: {
251
+ correctAnswerShown: "Correct answer",
252
+ correct: "Correct",
253
+ incorrect: "Incorrect",
254
+ unanswered: "No answer",
255
+ placeholder: "Enter your answer...",
256
+ answerInput: "Your answer",
257
+ printCorrectAnswer: "Correct answer:",
258
+ printAnswerBlank: "Answer blank"
259
+ },
260
+ vennClassification: {
261
+ tray: "Tiles to classify",
262
+ unknownTarget: "unknown",
263
+ cancelled: "Cancelled",
264
+ returnedToTray: "{{name}} returned to tray",
265
+ placedIn: "{{name}} placed in {{target}}",
266
+ pickedUp: "Picked up {{name}}",
267
+ pickedUpWithKeyboard: "Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.",
268
+ dropTarget: "Drop target: {{target}}",
269
+ unsupportedCircles_one: "This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.",
270
+ unsupportedCircles_other: "This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.",
271
+ setNumber: "Set {{number}}",
272
+ regionOnly: "{{set}} only",
273
+ regionNeither: "Neither {{first}} nor {{second}}",
274
+ regionNoneOf: "None of {{sets}}",
275
+ regionAndSeparator: " and ",
276
+ tileFallbackName: "Tile",
277
+ tileNotPlaced: "not placed",
278
+ tileInRegion: "in {{region}}",
279
+ tileCorrect: "correct",
280
+ tileIncorrect: "incorrect"
281
+ }
282
+ },
283
+ common: {
284
+ undo: "Undo",
285
+ clearAll: "Clear all",
286
+ correct: "Correct",
287
+ incorrect: "Incorrect",
288
+ showCorrectAnswer: "Show correct answer",
289
+ hideCorrectAnswer: "Hide correct answer",
290
+ showTeacherInstructions: "Show Teacher Instructions",
291
+ hideTeacherInstructions: "Hide Teacher Instructions",
292
+ 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.",
293
+ warning: "Warning",
294
+ showNote: "Show Note",
295
+ hideNote: "Hide Note",
296
+ cancel: "Cancel"
297
+ }
298
+ }, M = {
299
+ translation: {
300
+ categorize: {
301
+ limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
302
+ maxChoicesPerCategoryRestriction: "Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"
303
+ },
304
+ ebsr: { part: "Parte {{index}}" },
305
+ numberLine: {
306
+ addElementLimit_one: "Solo puedes agregar {{count}} elemento",
307
+ addElementLimit_other: "Solo puedes agregar {{count}} elementos",
308
+ clearAll: "Borrar todo"
309
+ },
310
+ imageClozeAssociation: {
311
+ reachedLimit_one: "Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
312
+ reachedLimit_other: "Lleno"
313
+ },
314
+ drawingResponse: {
315
+ fillColor: "Color de relleno",
316
+ outlineColor: "Color del contorno",
317
+ noFill: "Sin relleno",
318
+ lightblue: "Azul claro",
319
+ lightyellow: "Amarillo claro",
320
+ red: "Rojo",
321
+ orange: "Naranja",
322
+ yellow: "Amarillo",
323
+ violet: "Violeta",
324
+ blue: "Azul",
325
+ green: "Verde",
326
+ white: "Blanco",
327
+ black: "Negro",
328
+ onDoubleClick: "Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"
329
+ },
330
+ charting: {
331
+ addCategory: "Añadir categoría",
332
+ actions: "Acciones",
333
+ add: "Añadir",
334
+ delete: "Eliminar",
335
+ newLabel: "Nueva etiqueta",
336
+ reachedLimit_other: "No puede haber más de {{count}} categorías.",
337
+ keyLegend: {
338
+ incorrectAnswer: "Respuesta incorrecta del estudiante",
339
+ correctAnswer: "Respuesta correcta del estudiante",
340
+ correctKeyAnswer: "Clave de respuesta correcta"
341
+ }
342
+ },
343
+ graphing: {
344
+ point: "Punto",
345
+ circle: "Circulo",
346
+ line: "Línea",
347
+ parabola: "Parábola",
348
+ absolute: "Valor absoluto",
349
+ exponential: "Exponencial",
350
+ polygon: "Polígono",
351
+ ray: "Semirrecta",
352
+ segment: "Segmento ",
353
+ sine: "Seno",
354
+ vector: "Vector",
355
+ label: "Etiqueta",
356
+ redo: "Rehacer",
357
+ reset: "Reiniciar"
358
+ },
359
+ 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." },
360
+ mcPopulatedBlank: {
361
+ answerChoices: "Opciones de respuesta",
362
+ blankLabel: "espacio en blanco",
363
+ emptyBlank: "(en blanco)",
364
+ blankPreSelectionHint: "La respuesta que elijas aparecerá en la línea en blanco de arriba.",
365
+ correctAnswerSelected: "Respuesta correcta seleccionada",
366
+ incorrectAnswerSelected: "Respuesta incorrecta seleccionada",
367
+ selectedAnswerImage: "Imagen de la respuesta seleccionada",
368
+ choiceImage: "Opción {{id}}",
369
+ clickToEnableAutoplay: "Haz clic para activar la reproducción automática del audio",
370
+ audioResourceUnavailable: "El audio está activado, pero no hay una URL de audio reproducible configurada.",
371
+ listen: "Escuchar",
372
+ listenSilentAlt: "Escuchar. Repetir las instrucciones.",
373
+ listenPlayingAlt: "Escuchar. Estas son las instrucciones.",
374
+ printAudio: "Audio:",
375
+ printTranscript: "Transcripción:"
376
+ },
377
+ multipleChoice: {
378
+ minSelections: "Seleccione al menos {{minSelections}}.",
379
+ maxSelections_one: "Sólo se permite {{maxSelections}} respuesta.",
380
+ maxSelections_other: "Sólo se permiten {{maxSelections}} respuestas.",
381
+ minmaxSelections_equal: "Seleccione {{minSelections}}.",
382
+ minmaxSelections_range: "Seleccione entre {{minSelections}} y {{maxSelections}}."
383
+ },
384
+ selectText: {
385
+ correctAnswerSelected: "Respuesta Correcta",
386
+ correctAnswerNotSelected: "Respuesta Correcta No Seleccionada",
387
+ incorrectSelection: "Selección Incorrecta",
388
+ key: "Clave"
389
+ },
390
+ simpleCloze: {
391
+ correctAnswerShown: "Respuesta correcta",
392
+ correct: "Correcto",
393
+ incorrect: "Incorrecto",
394
+ unanswered: "Sin respuesta",
395
+ placeholder: "Escribe tu respuesta...",
396
+ answerInput: "Tu respuesta",
397
+ printCorrectAnswer: "Respuesta correcta:",
398
+ printAnswerBlank: "Espacio para la respuesta"
399
+ },
400
+ vennClassification: {
401
+ tray: "Fichas para clasificar",
402
+ unknownTarget: "desconocido",
403
+ cancelled: "Cancelado",
404
+ returnedToTray: "Se devolvió {{name}} a la bandeja",
405
+ placedIn: "Se colocó {{name}} en {{target}}",
406
+ pickedUp: "Se tomó {{name}}",
407
+ pickedUpWithKeyboard: "Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.",
408
+ dropTarget: "Destino: {{target}}",
409
+ unsupportedCircles_one: "No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.",
410
+ unsupportedCircles_other: "No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.",
411
+ setNumber: "Conjunto {{number}}",
412
+ regionOnly: "Solo {{set}}",
413
+ regionNeither: "Ni {{first}} ni {{second}}",
414
+ regionNoneOf: "Ninguno de {{sets}}",
415
+ regionAndSeparator: " y ",
416
+ tileFallbackName: "Ficha",
417
+ tileNotPlaced: "sin colocar",
418
+ tileInRegion: "en {{region}}",
419
+ tileCorrect: "correcta",
420
+ tileIncorrect: "incorrecta"
421
+ }
422
+ },
423
+ common: {
424
+ undo: "Deshacer",
425
+ clearAll: "Borrar todo",
426
+ correct: "Correcto",
427
+ incorrect: "Incorrecto",
428
+ showCorrectAnswer: "Mostrar respuesta correcta",
429
+ hideCorrectAnswer: "Ocultar respuesta correcta",
430
+ showTeacherInstructions: "Mostrar instrucciones para el maestro",
431
+ hideTeacherInstructions: "Ocultar instrucciones para el maestro",
432
+ 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.",
433
+ warning: "Advertencia",
434
+ showNote: "Mostrar Nota",
435
+ hideNote: "Ocultar Nota",
436
+ cancel: "Cancelar"
437
+ }
438
+ }, N = (e) => typeof e == "string", P = () => {
439
+ let e, t, n = new Promise((n, r) => {
440
+ e = n, t = r;
441
+ });
442
+ return n.resolve = e, n.reject = t, n;
443
+ }, ee = (e) => e == null ? "" : "" + e, te = (e, t, n) => {
444
+ e.forEach((e) => {
445
+ t[e] && (n[e] = t[e]);
446
+ });
447
+ }, ne = /###/g, re = (e) => e && e.indexOf("###") > -1 ? e.replace(ne, ".") : e, ie = (e) => !e || N(e), F = (e, t, n) => {
448
+ let r = N(t) ? t.split(".") : t, i = 0;
449
+ for (; i < r.length - 1;) {
450
+ if (ie(e)) return {};
451
+ let t = re(r[i]);
452
+ !e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
453
+ }
454
+ return ie(e) ? {} : {
455
+ obj: e,
456
+ k: re(r[i])
457
+ };
458
+ }, ae = (e, t, n) => {
459
+ let { obj: r, k: i } = F(e, t, Object);
460
+ if (r !== void 0 || t.length === 1) {
461
+ r[i] = n;
462
+ return;
463
+ }
464
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = F(e, o, Object);
465
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = F(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
466
+ s.obj[`${s.k}.${a}`] = n;
467
+ }, oe = (e, t, n, r) => {
468
+ let { obj: i, k: a } = F(e, t, Object);
469
+ i[a] = i[a] || [], i[a].push(n);
470
+ }, I = (e, t) => {
471
+ let { obj: n, k: r } = F(e, t);
472
+ if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
473
+ }, se = (e, t, n) => {
474
+ let r = I(e, n);
475
+ return r === void 0 ? I(t, n) : r;
476
+ }, ce = (e, t, n) => {
477
+ for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? N(e[r]) || e[r] instanceof String || N(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : ce(e[r], t[r], n) : e[r] = t[r]);
478
+ return e;
479
+ }, L = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), le = {
480
+ "&": "&amp;",
481
+ "<": "&lt;",
482
+ ">": "&gt;",
483
+ "\"": "&quot;",
484
+ "'": "&#39;",
485
+ "/": "&#x2F;"
486
+ }, ue = (e) => N(e) ? e.replace(/[&<>"'\/]/g, (e) => le[e]) : e, de = class {
487
+ constructor(e) {
488
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
489
+ }
490
+ getRegExp(e) {
491
+ let t = this.regExpMap.get(e);
492
+ if (t !== void 0) return t;
493
+ let n = new RegExp(e);
494
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
495
+ }
496
+ }, fe = [
497
+ " ",
498
+ ",",
499
+ "?",
500
+ "!",
501
+ ";"
502
+ ], pe = new de(20), me = (e, t, n) => {
503
+ t ||= "", n ||= "";
504
+ let r = fe.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
505
+ if (r.length === 0) return !0;
506
+ let i = pe.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
507
+ if (!a) {
508
+ let t = e.indexOf(n);
509
+ t > 0 && !i.test(e.substring(0, t)) && (a = !0);
510
+ }
511
+ return a;
512
+ }, he = (e, t, n = ".") => {
513
+ if (!e) return;
514
+ if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
515
+ let r = t.split(n), i = e;
516
+ for (let e = 0; e < r.length;) {
517
+ if (!i || typeof i != "object") return;
518
+ let t, a = "";
519
+ for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
520
+ if ([
521
+ "string",
522
+ "number",
523
+ "boolean"
524
+ ].indexOf(typeof t) > -1 && o < r.length - 1) continue;
525
+ e += o - e + 1;
526
+ break;
527
+ }
528
+ i = t;
529
+ }
530
+ return i;
531
+ }, R = (e) => e?.replace(/_/g, "-"), ge = {
532
+ type: "logger",
533
+ log(e) {
534
+ this.output("log", e);
535
+ },
536
+ warn(e) {
537
+ this.output("warn", e);
538
+ },
539
+ error(e) {
540
+ this.output("error", e);
541
+ },
542
+ output(e, t) {
543
+ console?.[e]?.apply?.(console, t);
544
+ }
545
+ }, z = new class e {
546
+ constructor(e, t = {}) {
547
+ this.init(e, t);
548
+ }
549
+ init(e, t = {}) {
550
+ this.prefix = t.prefix || "i18next:", this.logger = e || ge, this.options = t, this.debug = t.debug;
551
+ }
552
+ log(...e) {
553
+ return this.forward(e, "log", "", !0);
554
+ }
555
+ warn(...e) {
556
+ return this.forward(e, "warn", "", !0);
557
+ }
558
+ error(...e) {
559
+ return this.forward(e, "error", "");
560
+ }
561
+ deprecate(...e) {
562
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
563
+ }
564
+ forward(e, t, n, r) {
565
+ return r && !this.debug ? null : (N(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
566
+ }
567
+ create(t) {
568
+ return new e(this.logger, {
569
+ prefix: `${this.prefix}:${t}:`,
570
+ ...this.options
571
+ });
572
+ }
573
+ clone(t) {
574
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
575
+ }
576
+ }(), B = class {
577
+ constructor() {
578
+ this.observers = {};
579
+ }
580
+ on(e, t) {
581
+ return e.split(" ").forEach((e) => {
582
+ this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
583
+ let n = this.observers[e].get(t) || 0;
584
+ this.observers[e].set(t, n + 1);
585
+ }), this;
586
+ }
587
+ off(e, t) {
588
+ if (this.observers[e]) {
589
+ if (!t) {
590
+ delete this.observers[e];
591
+ return;
592
+ }
593
+ this.observers[e].delete(t);
594
+ }
595
+ }
596
+ emit(e, ...t) {
597
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([e, n]) => {
598
+ for (let r = 0; r < n; r++) e(...t);
599
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, r]) => {
600
+ for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
601
+ });
602
+ }
603
+ }, _e = class extends B {
604
+ constructor(e, t = {
605
+ ns: ["translation"],
606
+ defaultNS: "translation"
607
+ }) {
608
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
609
+ }
610
+ addNamespaces(e) {
611
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
612
+ }
613
+ removeNamespaces(e) {
614
+ let t = this.options.ns.indexOf(e);
615
+ t > -1 && this.options.ns.splice(t, 1);
616
+ }
617
+ getResource(e, t, n, r = {}) {
618
+ let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
619
+ e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : N(n) && i ? o.push(...n.split(i)) : o.push(n)));
620
+ let s = I(this.data, o);
621
+ return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !N(n) ? s : he(this.data?.[e]?.[t], n, i);
622
+ }
623
+ addResource(e, t, n, r, i = { silent: !1 }) {
624
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
625
+ n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), ae(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
626
+ }
627
+ addResources(e, t, n, r = { silent: !1 }) {
628
+ for (let r in n) (N(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
629
+ r.silent || this.emit("added", e, t, n);
630
+ }
631
+ addResourceBundle(e, t, n, r, i, a = {
632
+ silent: !1,
633
+ skipCopy: !1
634
+ }) {
635
+ let o = [e, t];
636
+ e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
637
+ let s = I(this.data, o) || {};
638
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? ce(s, n, i) : s = {
639
+ ...s,
640
+ ...n
641
+ }, ae(this.data, o, s), a.silent || this.emit("added", e, t, n);
642
+ }
643
+ removeResourceBundle(e, t) {
644
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
645
+ }
646
+ hasResourceBundle(e, t) {
647
+ return this.getResource(e, t) !== void 0;
648
+ }
649
+ getResourceBundle(e, t) {
650
+ return t ||= this.options.defaultNS, this.getResource(e, t);
651
+ }
652
+ getDataByLanguage(e) {
653
+ return this.data[e];
654
+ }
655
+ hasLanguageSomeTranslations(e) {
656
+ let t = this.getDataByLanguage(e);
657
+ return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
658
+ }
659
+ toJSON() {
660
+ return this.data;
661
+ }
662
+ }, ve = {
663
+ processors: {},
664
+ addPostProcessor(e) {
665
+ this.processors[e.name] = e;
666
+ },
667
+ handle(e, t, n, r, i) {
668
+ return e.forEach((e) => {
669
+ t = this.processors[e]?.process(t, n, r, i) ?? t;
670
+ }), t;
671
+ }
672
+ }, ye = Symbol("i18next/PATH_KEY");
673
+ function be() {
674
+ let e = [], t = Object.create(null), n;
675
+ return t.get = (r, i) => (n?.revoke?.(), i === ye ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
676
+ }
677
+ function V(e, t) {
678
+ let { [ye]: n } = e(be()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
679
+ if (n.length > 1 && i) {
680
+ let e = t?.ns, a = Array.isArray(e) ? e : null;
681
+ if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
682
+ }
683
+ return n.join(r);
684
+ }
685
+ var xe = {}, Se = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Ce = class e extends B {
686
+ constructor(e, t = {}) {
687
+ super(), te([
688
+ "resourceStore",
689
+ "languageUtils",
690
+ "pluralResolver",
691
+ "interpolator",
692
+ "backendConnector",
693
+ "i18nFormat",
694
+ "utils"
695
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = z.create("translator");
696
+ }
697
+ changeLanguage(e) {
698
+ e && (this.language = e);
699
+ }
700
+ exists(e, t = { interpolation: {} }) {
701
+ let n = { ...t };
702
+ if (e == null) return !1;
703
+ let r = this.resolve(e, n);
704
+ if (r?.res === void 0) return !1;
705
+ let i = Se(r.res);
706
+ return !(n.returnObjects === !1 && i);
707
+ }
708
+ extractFromKey(e, t) {
709
+ let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
710
+ n === void 0 && (n = ":");
711
+ 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 && !me(e, n, r);
712
+ if (a && !o) {
713
+ let t = e.match(this.interpolator.nestingRegexp);
714
+ if (t && t.length > 0) return {
715
+ key: e,
716
+ namespaces: N(i) ? [i] : i
717
+ };
718
+ let a = e.split(n);
719
+ (n !== r || n === r && this.options.ns.indexOf(a[0]) > -1) && (i = a.shift()), e = a.join(r);
720
+ }
721
+ return {
722
+ key: e,
723
+ namespaces: N(i) ? [i] : i
724
+ };
725
+ }
726
+ translate(t, n, r) {
727
+ let i = typeof n == "object" ? { ...n } : n;
728
+ if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
729
+ typeof t == "function" && (t = V(t, {
730
+ ...this.options,
731
+ ...i
732
+ })), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? V(e, {
733
+ ...this.options,
734
+ ...i
735
+ }) : String(e));
736
+ 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;
737
+ u === void 0 && (u = ":");
738
+ let d = i.lng || this.language, f = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
739
+ if (d?.toLowerCase() === "cimode") return f ? a ? {
740
+ res: `${l}${u}${s}`,
741
+ usedKey: s,
742
+ exactUsedKey: s,
743
+ usedLng: d,
744
+ usedNS: l,
745
+ usedParams: this.getUsedParamsDetails(i)
746
+ } : `${l}${u}${s}` : a ? {
747
+ res: s,
748
+ usedKey: s,
749
+ exactUsedKey: s,
750
+ usedLng: d,
751
+ usedNS: l,
752
+ usedParams: this.getUsedParamsDetails(i)
753
+ } : s;
754
+ let p = this.resolve(t, i), m = p?.res, h = p?.usedKey || s, g = p?.exactUsedKey || s, _ = [
755
+ "[object Number]",
756
+ "[object Function]",
757
+ "[object RegExp]"
758
+ ], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !N(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;
759
+ y && !m && x && (E = T);
760
+ let D = Se(E), O = Object.prototype.toString.apply(E);
761
+ if (y && E && D && _.indexOf(O) < 0 && !(N(v) && Array.isArray(E))) {
762
+ if (!i.returnObjects && !this.options.returnObjects) {
763
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
764
+ let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, E, {
765
+ ...i,
766
+ ns: c
767
+ }) : `key '${s} (${this.language})' returned an object instead of string.`;
768
+ return a ? (p.res = e, p.usedParams = this.getUsedParamsDetails(i), p) : e;
769
+ }
770
+ if (o) {
771
+ let e = Array.isArray(E), t = e ? [] : {}, n = e ? g : h;
772
+ for (let e in E) if (Object.prototype.hasOwnProperty.call(E, e)) {
773
+ let r = `${n}${o}${e}`;
774
+ x && !m ? t[e] = this.translate(r, {
775
+ ...i,
776
+ defaultValue: Se(T) ? T[e] : void 0,
777
+ joinArrays: !1,
778
+ ns: c
779
+ }) : t[e] = this.translate(r, {
780
+ ...i,
781
+ joinArrays: !1,
782
+ ns: c
783
+ }), t[e] === r && (t[e] = E[e]);
784
+ }
785
+ m = t;
786
+ }
787
+ } else if (y && N(v) && Array.isArray(m)) m = m.join(v), m &&= this.extendTranslation(m, t, i, r);
788
+ else {
789
+ let e = !1, n = !1;
790
+ !this.isValidLookup(m) && x && (e = !0, m = T), this.isValidLookup(m) || (n = !0, m = s);
791
+ let a = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n ? void 0 : m, c = x && T !== m && this.options.updateMissing;
792
+ if (n || e || c) {
793
+ if (this.logger.log(c ? "updateKey" : "missingKey", d, l, s, c ? T : m), o) {
794
+ let e = this.resolve(s, {
795
+ ...i,
796
+ keySeparator: !1
797
+ });
798
+ 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.");
799
+ }
800
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
801
+ if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
802
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(i.lng || this.language) : e.push(i.lng || this.language);
803
+ let n = (e, t, n) => {
804
+ let r = x && n !== m ? n : a;
805
+ 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);
806
+ };
807
+ this.options.saveMissing && (this.options.saveMissingPlurals && b ? e.forEach((e) => {
808
+ let t = this.pluralResolver.getSuffixes(e, i);
809
+ w && i[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
810
+ n([e], s + t, i[`defaultValue${t}`] || T);
811
+ });
812
+ }) : n(e, s, T));
813
+ }
814
+ 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));
815
+ }
816
+ return a ? (p.res = m, p.usedParams = this.getUsedParamsDetails(i), p) : m;
817
+ }
818
+ extendTranslation(e, t, n, r, i) {
819
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
820
+ ...this.options.interpolation.defaultVariables,
821
+ ...n
822
+ }, n.lng || this.language || r.usedLng, r.usedNS, r.usedKey, { resolved: r });
823
+ else if (!n.skipInterpolation) {
824
+ n.interpolation && this.interpolator.init({
825
+ ...n,
826
+ interpolation: {
827
+ ...this.options.interpolation,
828
+ ...n.interpolation
829
+ }
830
+ });
831
+ let a = N(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
832
+ if (a) {
833
+ let t = e.match(this.interpolator.nestingRegexp);
834
+ o = t && t.length;
835
+ }
836
+ let s = n.replace && !N(n.replace) ? n.replace : n;
837
+ if (this.options.interpolation.defaultVariables && (s = {
838
+ ...this.options.interpolation.defaultVariables,
839
+ ...s
840
+ }), e = this.interpolator.interpolate(e, s, n.lng || this.language || r.usedLng, n), a) {
841
+ let t = e.match(this.interpolator.nestingRegexp), r = t && t.length;
842
+ o < r && (n.nest = !1);
843
+ }
844
+ !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();
845
+ }
846
+ let a = n.postProcess || this.options.postProcess, o = N(a) ? [a] : a;
847
+ return e != null && o?.length && n.applyPostProcessor !== !1 && (e = ve.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
848
+ i18nResolved: {
849
+ ...r,
850
+ usedParams: this.getUsedParamsDetails(n)
851
+ },
852
+ ...n
853
+ } : n, this)), e;
854
+ }
855
+ resolve(e, t = {}) {
856
+ let n, r, i, a, o;
857
+ return N(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? V(e, {
858
+ ...this.options,
859
+ ...t
860
+ }) : e)), e.forEach((e) => {
861
+ if (this.isValidLookup(n)) return;
862
+ let s = this.extractFromKey(e, t), c = s.key;
863
+ r = c;
864
+ let l = s.namespaces;
865
+ this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
866
+ let u = t.count !== void 0 && !N(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (N(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
867
+ l.forEach((e) => {
868
+ this.isValidLookup(n) || (o = e, !xe[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (xe[`${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) => {
869
+ if (this.isValidLookup(n)) return;
870
+ a = r;
871
+ let o = [c];
872
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o, c, r, e, t);
873
+ else {
874
+ let e;
875
+ u && (e = this.pluralResolver.getSuffix(r, t.count, t));
876
+ let n = `${this.options.pluralSeparator}zero`, i = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
877
+ 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) {
878
+ let r = `${c}${this.options.contextSeparator || "_"}${t.context}`;
879
+ 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));
880
+ }
881
+ }
882
+ let s;
883
+ for (; s = o.pop();) this.isValidLookup(n) || (i = s, n = this.getResource(r, e, s, t));
884
+ }));
885
+ });
886
+ }), {
887
+ res: n,
888
+ usedKey: r,
889
+ exactUsedKey: i,
890
+ usedLng: a,
891
+ usedNS: o
892
+ };
893
+ }
894
+ isValidLookup(e) {
895
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
896
+ }
897
+ getResource(e, t, n, r = {}) {
898
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
899
+ }
900
+ getUsedParamsDetails(e = {}) {
901
+ let t = [
902
+ "defaultValue",
903
+ "ordinal",
904
+ "context",
905
+ "replace",
906
+ "lng",
907
+ "lngs",
908
+ "fallbackLng",
909
+ "ns",
910
+ "keySeparator",
911
+ "nsSeparator",
912
+ "returnObjects",
913
+ "returnDetails",
914
+ "joinArrays",
915
+ "postProcess",
916
+ "interpolation"
917
+ ], n = e.replace && !N(e.replace), r = n ? e.replace : e;
918
+ if (n && e.count !== void 0 && (r.count = e.count), this.options.interpolation.defaultVariables && (r = {
919
+ ...this.options.interpolation.defaultVariables,
920
+ ...r
921
+ }), !n) {
922
+ r = { ...r };
923
+ for (let e of t) delete r[e];
924
+ }
925
+ return r;
926
+ }
927
+ static hasDefaultValue(e) {
928
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
929
+ return !1;
930
+ }
931
+ }, we = class {
932
+ constructor(e) {
933
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = z.create("languageUtils");
934
+ }
935
+ getScriptPartFromCode(e) {
936
+ if (e = R(e), !e || e.indexOf("-") < 0) return null;
937
+ let t = e.split("-");
938
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
939
+ }
940
+ getLanguagePartFromCode(e) {
941
+ if (e = R(e), !e || e.indexOf("-") < 0) return e;
942
+ let t = e.split("-");
943
+ return this.formatLanguageCode(t[0]);
944
+ }
945
+ formatLanguageCode(e) {
946
+ if (N(e) && e.indexOf("-") > -1) {
947
+ let t;
948
+ try {
949
+ t = Intl.getCanonicalLocales(e)[0];
950
+ } catch {}
951
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
952
+ }
953
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
954
+ }
955
+ isSupportedCode(e) {
956
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
957
+ }
958
+ getBestMatchFromCodes(e) {
959
+ if (!e) return null;
960
+ let t;
961
+ return e.forEach((e) => {
962
+ if (t) return;
963
+ let n = this.formatLanguageCode(e);
964
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
965
+ }), !t && this.options.supportedLngs && e.forEach((e) => {
966
+ if (t) return;
967
+ let n = this.getScriptPartFromCode(e);
968
+ if (this.isSupportedCode(n)) return t = n;
969
+ let r = this.getLanguagePartFromCode(e);
970
+ if (this.isSupportedCode(r)) return t = r;
971
+ t = this.options.supportedLngs.find((e) => {
972
+ 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;
973
+ });
974
+ }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
975
+ }
976
+ getFallbackCodes(e, t) {
977
+ if (!e) return [];
978
+ if (typeof e == "function" && (e = e(t)), N(e) && (e = [e]), Array.isArray(e)) return e;
979
+ if (!t) return e.default || [];
980
+ let n = e[t];
981
+ return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
982
+ }
983
+ toResolveHierarchy(e, t) {
984
+ let n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), r = [], i = (e) => {
985
+ e && (this.isSupportedCode(e) ? r.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
986
+ };
987
+ return N(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))) : N(e) && i(this.formatLanguageCode(e)), n.forEach((e) => {
988
+ r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
989
+ }), r;
990
+ }
991
+ }, Te = {
992
+ zero: 0,
993
+ one: 1,
994
+ two: 2,
995
+ few: 3,
996
+ many: 4,
997
+ other: 5
998
+ }, Ee = {
999
+ select: (e) => e === 1 ? "one" : "other",
1000
+ resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
1001
+ }, De = class {
1002
+ constructor(e, t = {}) {
1003
+ this.languageUtils = e, this.options = t, this.logger = z.create("pluralResolver"), this.pluralRulesCache = {};
1004
+ }
1005
+ clearCache() {
1006
+ this.pluralRulesCache = {};
1007
+ }
1008
+ getRule(e, t = {}) {
1009
+ let n = R(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
1010
+ cleanedCode: n,
1011
+ type: r
1012
+ });
1013
+ if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
1014
+ let a;
1015
+ try {
1016
+ a = new Intl.PluralRules(n, { type: r });
1017
+ } catch {
1018
+ if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), Ee;
1019
+ if (!e.match(/-|_/)) return Ee;
1020
+ let n = this.languageUtils.getLanguagePartFromCode(e);
1021
+ a = this.getRule(n, t);
1022
+ }
1023
+ return this.pluralRulesCache[i] = a, a;
1024
+ }
1025
+ needsPlural(e, t = {}) {
1026
+ let n = this.getRule(e, t);
1027
+ return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
1028
+ }
1029
+ getPluralFormsOfKey(e, t, n = {}) {
1030
+ return this.getSuffixes(e, n).map((e) => `${t}${e}`);
1031
+ }
1032
+ getSuffixes(e, t = {}) {
1033
+ let n = this.getRule(e, t);
1034
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => Te[e] - Te[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
1035
+ }
1036
+ getSuffix(e, t, n = {}) {
1037
+ let r = this.getRule(e, n);
1038
+ 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));
1039
+ }
1040
+ }, Oe = (e, t, n, r = ".", i = !0) => {
1041
+ let a = se(e, t, n);
1042
+ return !a && i && N(n) && (a = he(e, n, r), a === void 0 && (a = he(t, n, r))), a;
1043
+ }, ke = (e) => e.replace(/\$/g, "$$$$"), Ae = class {
1044
+ constructor(e = {}) {
1045
+ this.logger = z.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
1046
+ }
1047
+ init(e = {}) {
1048
+ e.interpolation ||= { escapeValue: !0 };
1049
+ 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;
1050
+ this.escape = t === void 0 ? ue : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? L(i) : a || "{{", this.suffix = o ? L(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? L(d) : f || L("$t("), this.nestingSuffix = p ? L(p) : m || L(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
1051
+ }
1052
+ reset() {
1053
+ this.options && this.init(this.options);
1054
+ }
1055
+ resetRegExp() {
1056
+ let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
1057
+ 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}`);
1058
+ }
1059
+ interpolate(e, t, n, r) {
1060
+ let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
1061
+ if (e.indexOf(this.formatSeparator) < 0) {
1062
+ let i = Oe(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
1063
+ return this.alwaysFormat ? this.format(i, void 0, n, {
1064
+ ...r,
1065
+ ...t,
1066
+ interpolationkey: e
1067
+ }) : i;
1068
+ }
1069
+ let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
1070
+ return this.format(Oe(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
1071
+ ...r,
1072
+ ...t,
1073
+ interpolationkey: a
1074
+ });
1075
+ };
1076
+ this.resetRegExp();
1077
+ let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
1078
+ return [{
1079
+ regex: this.regexpUnescape,
1080
+ safeValue: (e) => ke(e)
1081
+ }, {
1082
+ regex: this.regexp,
1083
+ safeValue: (e) => this.escapeValue ? ke(this.escape(e)) : ke(e)
1084
+ }].forEach((t) => {
1085
+ for (o = 0; i = t.regex.exec(e);) {
1086
+ let n = i[1].trim();
1087
+ if (a = c(n), a === void 0) if (typeof l == "function") {
1088
+ let t = l(e, i, r);
1089
+ a = N(t) ? t : "";
1090
+ } else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
1091
+ else if (u) {
1092
+ a = i[0];
1093
+ continue;
1094
+ } else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
1095
+ else !N(a) && !this.useRawValueToEscape && (a = ee(a));
1096
+ let s = t.safeValue(a);
1097
+ 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;
1098
+ }
1099
+ }), e;
1100
+ }
1101
+ nest(e, t, n = {}) {
1102
+ let r, i, a, o = (e, t) => {
1103
+ let n = this.nestingOptionsSeparator;
1104
+ if (e.indexOf(n) < 0) return e;
1105
+ let r = e.split(RegExp(`${L(n)}[ ]*{`)), i = `{${r[1]}`;
1106
+ e = r[0], i = this.interpolate(i, a);
1107
+ let o = i.match(/'/g), s = i.match(/"/g);
1108
+ ((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
1109
+ try {
1110
+ a = JSON.parse(i), t && (a = {
1111
+ ...t,
1112
+ ...a
1113
+ });
1114
+ } catch (t) {
1115
+ return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
1116
+ }
1117
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, e;
1118
+ };
1119
+ for (; r = this.nestingRegexp.exec(e);) {
1120
+ let s = [];
1121
+ a = { ...n }, a = a.replace && !N(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
1122
+ let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
1123
+ 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 && !N(i)) return i;
1124
+ N(i) || (i = ee(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, {
1125
+ ...n,
1126
+ interpolationkey: r[1].trim()
1127
+ }), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
1128
+ }
1129
+ return e;
1130
+ }
1131
+ }, je = (e) => {
1132
+ let t = e.toLowerCase().trim(), n = {};
1133
+ if (e.indexOf("(") > -1) {
1134
+ let r = e.split("(");
1135
+ t = r[0].toLowerCase().trim();
1136
+ let i = r[1].substring(0, r[1].length - 1);
1137
+ t === "currency" && i.indexOf(":") < 0 ? n.currency ||= i.trim() : t === "relativetime" && i.indexOf(":") < 0 ? n.range ||= i.trim() : i.split(";").forEach((e) => {
1138
+ if (e) {
1139
+ let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
1140
+ n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
1141
+ }
1142
+ });
1143
+ }
1144
+ return {
1145
+ formatName: t,
1146
+ formatOptions: n
1147
+ };
1148
+ }, Me = (e) => {
1149
+ let t = {};
1150
+ return (n, r, i) => {
1151
+ let a = i;
1152
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
1153
+ ...a,
1154
+ [i.interpolationkey]: void 0
1155
+ });
1156
+ let o = r + JSON.stringify(a), s = t[o];
1157
+ return s || (s = e(R(r), i), t[o] = s), s(n);
1158
+ };
1159
+ }, Ne = (e) => (t, n, r) => e(R(n), r)(t), Pe = class {
1160
+ constructor(e = {}) {
1161
+ this.logger = z.create("formatter"), this.options = e, this.init(e);
1162
+ }
1163
+ init(e, t = { interpolation: {} }) {
1164
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
1165
+ let n = t.cacheInBuiltFormats ? Me : Ne;
1166
+ this.formats = {
1167
+ number: n((e, t) => {
1168
+ let n = new Intl.NumberFormat(e, { ...t });
1169
+ return (e) => n.format(e);
1170
+ }),
1171
+ currency: n((e, t) => {
1172
+ let n = new Intl.NumberFormat(e, {
1173
+ ...t,
1174
+ style: "currency"
1175
+ });
1176
+ return (e) => n.format(e);
1177
+ }),
1178
+ datetime: n((e, t) => {
1179
+ let n = new Intl.DateTimeFormat(e, { ...t });
1180
+ return (e) => n.format(e);
1181
+ }),
1182
+ relativetime: n((e, t) => {
1183
+ let n = new Intl.RelativeTimeFormat(e, { ...t });
1184
+ return (e) => n.format(e, t.range || "day");
1185
+ }),
1186
+ list: n((e, t) => {
1187
+ let n = new Intl.ListFormat(e, { ...t });
1188
+ return (e) => n.format(e);
1189
+ })
1190
+ };
1191
+ }
1192
+ add(e, t) {
1193
+ this.formats[e.toLowerCase().trim()] = t;
1194
+ }
1195
+ addCached(e, t) {
1196
+ this.formats[e.toLowerCase().trim()] = Me(t);
1197
+ }
1198
+ format(e, t, n, r = {}) {
1199
+ let i = t.split(this.formatSeparator);
1200
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((e) => e.indexOf(")") > -1)) {
1201
+ let e = i.findIndex((e) => e.indexOf(")") > -1);
1202
+ i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
1203
+ }
1204
+ return i.reduce((e, t) => {
1205
+ let { formatName: i, formatOptions: a } = je(t);
1206
+ if (this.formats[i]) {
1207
+ let t = e;
1208
+ try {
1209
+ let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
1210
+ t = this.formats[i](e, s, {
1211
+ ...a,
1212
+ ...r,
1213
+ ...o
1214
+ });
1215
+ } catch (e) {
1216
+ this.logger.warn(e);
1217
+ }
1218
+ return t;
1219
+ } else this.logger.warn(`there was no format function for ${i}`);
1220
+ return e;
1221
+ }, e);
1222
+ }
1223
+ }, Fe = (e, t) => {
1224
+ e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
1225
+ }, Ie = class extends B {
1226
+ constructor(e, t, n, r = {}) {
1227
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = z.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);
1228
+ }
1229
+ queueLoad(e, t, n, r) {
1230
+ let i = {}, a = {}, o = {}, s = {};
1231
+ return e.forEach((e) => {
1232
+ let r = !0;
1233
+ t.forEach((t) => {
1234
+ let o = `${e}|${t}`;
1235
+ !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)));
1236
+ }), r || (o[e] = !0);
1237
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
1238
+ pending: a,
1239
+ pendingCount: Object.keys(a).length,
1240
+ loaded: {},
1241
+ errors: [],
1242
+ callback: r
1243
+ }), {
1244
+ toLoad: Object.keys(i),
1245
+ pending: Object.keys(a),
1246
+ toLoadLanguages: Object.keys(o),
1247
+ toLoadNamespaces: Object.keys(s)
1248
+ };
1249
+ }
1250
+ loaded(e, t, n) {
1251
+ let r = e.split("|"), i = r[0], a = r[1];
1252
+ 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);
1253
+ let o = {};
1254
+ this.queue.forEach((n) => {
1255
+ oe(n.loaded, [i], a), Fe(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
1256
+ o[e] || (o[e] = {});
1257
+ let t = n.loaded[e];
1258
+ t.length && t.forEach((t) => {
1259
+ o[e][t] === void 0 && (o[e][t] = !0);
1260
+ });
1261
+ }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
1262
+ }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
1263
+ }
1264
+ read(e, t, n, r = 0, i = this.retryTimeout, a) {
1265
+ if (!e.length) return a(null, {});
1266
+ if (this.readingCalls >= this.maxParallelReads) {
1267
+ this.waitingReads.push({
1268
+ lng: e,
1269
+ ns: t,
1270
+ fcName: n,
1271
+ tried: r,
1272
+ wait: i,
1273
+ callback: a
1274
+ });
1275
+ return;
1276
+ }
1277
+ this.readingCalls++;
1278
+ let o = (o, s) => {
1279
+ if (this.readingCalls--, this.waitingReads.length > 0) {
1280
+ let e = this.waitingReads.shift();
1281
+ this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
1282
+ }
1283
+ if (o && s && r < this.maxRetries) {
1284
+ setTimeout(() => {
1285
+ this.read.call(this, e, t, n, r + 1, i * 2, a);
1286
+ }, i);
1287
+ return;
1288
+ }
1289
+ a(o, s);
1290
+ }, s = this.backend[n].bind(this.backend);
1291
+ if (s.length === 2) {
1292
+ try {
1293
+ let n = s(e, t);
1294
+ n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
1295
+ } catch (e) {
1296
+ o(e);
1297
+ }
1298
+ return;
1299
+ }
1300
+ return s(e, t, o);
1301
+ }
1302
+ prepareLoading(e, t, n = {}, r) {
1303
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
1304
+ N(e) && (e = this.languageUtils.toResolveHierarchy(e)), N(t) && (t = [t]);
1305
+ let i = this.queueLoad(e, t, n, r);
1306
+ if (!i.toLoad.length) return i.pending.length || r(), null;
1307
+ i.toLoad.forEach((e) => {
1308
+ this.loadOne(e);
1309
+ });
1310
+ }
1311
+ load(e, t, n) {
1312
+ this.prepareLoading(e, t, {}, n);
1313
+ }
1314
+ reload(e, t, n) {
1315
+ this.prepareLoading(e, t, { reload: !0 }, n);
1316
+ }
1317
+ loadOne(e, t = "") {
1318
+ let n = e.split("|"), r = n[0], i = n[1];
1319
+ this.read(r, i, "read", void 0, void 0, (n, a) => {
1320
+ 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);
1321
+ });
1322
+ }
1323
+ saveMissing(e, t, n, r, i, a = {}, o = () => {}) {
1324
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
1325
+ 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!!!");
1326
+ return;
1327
+ }
1328
+ if (!(n == null || n === "")) {
1329
+ if (this.backend?.create) {
1330
+ let s = {
1331
+ ...a,
1332
+ isUpdate: i
1333
+ }, c = this.backend.create.bind(this.backend);
1334
+ if (c.length < 6) try {
1335
+ let i;
1336
+ 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);
1337
+ } catch (e) {
1338
+ o(e);
1339
+ }
1340
+ else c(e, t, n, r, o, s);
1341
+ }
1342
+ !e || !e[0] || this.store.addResource(e[0], t, n, r);
1343
+ }
1344
+ }
1345
+ }, Le = () => ({
1346
+ debug: !1,
1347
+ initAsync: !0,
1348
+ ns: ["translation"],
1349
+ defaultNS: ["translation"],
1350
+ fallbackLng: ["dev"],
1351
+ fallbackNS: !1,
1352
+ supportedLngs: !1,
1353
+ nonExplicitSupportedLngs: !1,
1354
+ load: "all",
1355
+ preload: !1,
1356
+ simplifyPluralSuffix: !0,
1357
+ keySeparator: ".",
1358
+ nsSeparator: ":",
1359
+ pluralSeparator: "_",
1360
+ contextSeparator: "_",
1361
+ partialBundledLanguages: !1,
1362
+ saveMissing: !1,
1363
+ updateMissing: !1,
1364
+ saveMissingTo: "fallback",
1365
+ saveMissingPlurals: !0,
1366
+ missingKeyHandler: !1,
1367
+ missingInterpolationHandler: !1,
1368
+ postProcess: !1,
1369
+ postProcessPassResolved: !1,
1370
+ returnNull: !1,
1371
+ returnEmptyString: !0,
1372
+ returnObjects: !1,
1373
+ joinArrays: !1,
1374
+ returnedObjectHandler: !1,
1375
+ parseMissingKeyHandler: !1,
1376
+ appendNamespaceToMissingKey: !1,
1377
+ appendNamespaceToCIMode: !1,
1378
+ overloadTranslationOptionHandler: (e) => {
1379
+ let t = {};
1380
+ 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") {
1381
+ let n = e[3] || e[2];
1382
+ Object.keys(n).forEach((e) => {
1383
+ t[e] = n[e];
1384
+ });
1385
+ }
1386
+ return t;
1387
+ },
1388
+ interpolation: {
1389
+ escapeValue: !0,
1390
+ format: (e) => e,
1391
+ prefix: "{{",
1392
+ suffix: "}}",
1393
+ formatSeparator: ",",
1394
+ unescapePrefix: "-",
1395
+ nestingPrefix: "$t(",
1396
+ nestingSuffix: ")",
1397
+ nestingOptionsSeparator: ",",
1398
+ maxReplaces: 1e3,
1399
+ skipOnVariables: !0
1400
+ },
1401
+ cacheInBuiltFormats: !0
1402
+ }), Re = (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), H = () => {}, ze = (e) => {
1403
+ Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
1404
+ typeof e[t] == "function" && (e[t] = e[t].bind(e));
1405
+ });
1406
+ }, Be = "__i18next_supportNoticeShown", Ve = () => !!(typeof globalThis < "u" && globalThis[Be] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), He = () => {
1407
+ typeof globalThis < "u" && (globalThis[Be] = !0);
1408
+ }, Ue = (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)), U = class e extends B {
1409
+ constructor(e = {}, t) {
1410
+ if (super(), this.options = Re(e), this.services = {}, this.logger = z, this.modules = { external: [] }, ze(this), t && !this.isInitialized && !e.isClone) {
1411
+ if (!this.options.initAsync) return this.init(e, t), this;
1412
+ setTimeout(() => {
1413
+ this.init(e, t);
1414
+ }, 0);
1415
+ }
1416
+ }
1417
+ init(e = {}, t) {
1418
+ 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]));
1419
+ let n = Le();
1420
+ this.options = {
1421
+ ...n,
1422
+ ...this.options,
1423
+ ...Re(e)
1424
+ }, this.options.interpolation = {
1425
+ ...n.interpolation,
1426
+ ...this.options.interpolation
1427
+ }, 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 && !Ue(this) && !Ve() && (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 💙"), He());
1428
+ let r = (e) => e ? typeof e == "function" ? new e() : e : null;
1429
+ if (!this.options.isClone) {
1430
+ this.modules.logger ? z.init(r(this.modules.logger), this.options) : z.init(null, this.options);
1431
+ let e;
1432
+ e = this.modules.formatter ? this.modules.formatter : Pe;
1433
+ let t = new we(this.options);
1434
+ this.store = new _e(this.options.resources, this.options);
1435
+ let i = this.services;
1436
+ i.logger = z, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new De(t, {
1437
+ prepend: this.options.pluralSeparator,
1438
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1439
+ }), 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 Ae(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new Ie(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
1440
+ this.emit(e, ...t);
1441
+ }), 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 Ce(this.services, this.options), this.translator.on("*", (e, ...t) => {
1442
+ this.emit(e, ...t);
1443
+ }), this.modules.external.forEach((e) => {
1444
+ e.init && e.init(this);
1445
+ });
1446
+ }
1447
+ if (this.format = this.options.interpolation.format, t ||= H, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1448
+ let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1449
+ e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1450
+ }
1451
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
1452
+ "getResource",
1453
+ "hasResourceBundle",
1454
+ "getResourceBundle",
1455
+ "getDataByLanguage"
1456
+ ].forEach((e) => {
1457
+ this[e] = (...t) => this.store[e](...t);
1458
+ }), [
1459
+ "addResource",
1460
+ "addResources",
1461
+ "addResourceBundle",
1462
+ "removeResourceBundle"
1463
+ ].forEach((e) => {
1464
+ this[e] = (...t) => (this.store[e](...t), this);
1465
+ });
1466
+ let i = P(), a = () => {
1467
+ let e = (e, n) => {
1468
+ 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);
1469
+ };
1470
+ if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1471
+ this.changeLanguage(this.options.lng, e);
1472
+ };
1473
+ return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
1474
+ }
1475
+ loadResources(e, t = H) {
1476
+ let n = t, r = N(e) ? e : this.language;
1477
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1478
+ if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1479
+ let e = [], t = (t) => {
1480
+ t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1481
+ t !== "cimode" && e.indexOf(t) < 0 && e.push(t);
1482
+ });
1483
+ };
1484
+ 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) => {
1485
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(e);
1486
+ });
1487
+ } else n(null);
1488
+ }
1489
+ reloadResources(e, t, n) {
1490
+ let r = P();
1491
+ 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 ||= H, this.services.backendConnector.reload(e, t, (e) => {
1492
+ r.resolve(), n(e);
1493
+ }), r;
1494
+ }
1495
+ use(e) {
1496
+ if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1497
+ if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1498
+ 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" && ve.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1499
+ }
1500
+ setResolvedLanguage(e) {
1501
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
1502
+ for (let e = 0; e < this.languages.length; e++) {
1503
+ let t = this.languages[e];
1504
+ if (!(["cimode", "dev"].indexOf(t) > -1) && this.store.hasLanguageSomeTranslations(t)) {
1505
+ this.resolvedLanguage = t;
1506
+ break;
1507
+ }
1508
+ }
1509
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1510
+ }
1511
+ }
1512
+ changeLanguage(e, t) {
1513
+ this.isLanguageChangingTo = e;
1514
+ let n = P();
1515
+ this.emit("languageChanging", e);
1516
+ let r = (e) => {
1517
+ this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1518
+ }, i = (i, a) => {
1519
+ 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));
1520
+ }, a = (t) => {
1521
+ !e && !t && this.services.languageDetector && (t = []);
1522
+ let n = N(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(N(t) ? [t] : t);
1523
+ a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
1524
+ i(e, a);
1525
+ });
1526
+ };
1527
+ 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;
1528
+ }
1529
+ getFixedT(e, t, n) {
1530
+ let r = (e, t, ...i) => {
1531
+ let a;
1532
+ 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);
1533
+ let o = {
1534
+ ...this.options,
1535
+ ...a
1536
+ };
1537
+ typeof a.keyPrefix == "function" && (a.keyPrefix = V(a.keyPrefix, o));
1538
+ let s = this.options.keySeparator || ".", c;
1539
+ return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = V(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = V(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1540
+ };
1541
+ return N(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
1542
+ }
1543
+ t(...e) {
1544
+ return this.translator?.translate(...e);
1545
+ }
1546
+ exists(...e) {
1547
+ return this.translator?.exists(...e);
1548
+ }
1549
+ setDefaultNamespace(e) {
1550
+ this.options.defaultNS = e;
1551
+ }
1552
+ hasLoadedNamespace(e, t = {}) {
1553
+ if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1554
+ if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1555
+ let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1556
+ if (n.toLowerCase() === "cimode") return !0;
1557
+ let a = (e, t) => {
1558
+ let n = this.services.backendConnector.state[`${e}|${t}`];
1559
+ return n === -1 || n === 0 || n === 2;
1560
+ };
1561
+ if (t.precheck) {
1562
+ let e = t.precheck(this, a);
1563
+ if (e !== void 0) return e;
1564
+ }
1565
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1566
+ }
1567
+ loadNamespaces(e, t) {
1568
+ let n = P();
1569
+ return this.options.ns ? (N(e) && (e = [e]), e.forEach((e) => {
1570
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
1571
+ }), this.loadResources((e) => {
1572
+ n.resolve(), t && t(e);
1573
+ }), n) : (t && t(), Promise.resolve());
1574
+ }
1575
+ loadLanguages(e, t) {
1576
+ let n = P();
1577
+ N(e) && (e = [e]);
1578
+ let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1579
+ return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
1580
+ n.resolve(), t && t(e);
1581
+ }), n) : (t && t(), Promise.resolve());
1582
+ }
1583
+ dir(e) {
1584
+ if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
1585
+ try {
1586
+ let t = new Intl.Locale(e);
1587
+ if (t && t.getTextInfo) {
1588
+ let e = t.getTextInfo();
1589
+ if (e && e.direction) return e.direction;
1590
+ }
1591
+ } catch {}
1592
+ 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 we(Le());
1593
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1594
+ }
1595
+ static createInstance(t = {}, n) {
1596
+ let r = new e(t, n);
1597
+ return r.createInstance = e.createInstance, r;
1598
+ }
1599
+ cloneInstance(t = {}, n = H) {
1600
+ let r = t.forkResourceStore;
1601
+ r && delete t.forkResourceStore;
1602
+ let i = {
1603
+ ...this.options,
1604
+ ...t,
1605
+ isClone: !0
1606
+ }, a = new e(i);
1607
+ if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1608
+ "store",
1609
+ "services",
1610
+ "language"
1611
+ ].forEach((e) => {
1612
+ a[e] = this[e];
1613
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new _e(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) {
1614
+ let e = {
1615
+ ...Le().interpolation,
1616
+ ...this.options.interpolation,
1617
+ ...t.interpolation
1618
+ }, n = {
1619
+ ...i,
1620
+ interpolation: e
1621
+ };
1622
+ a.services.interpolator = new Ae(n);
1623
+ }
1624
+ return a.translator = new Ce(a.services, i), a.translator.on("*", (e, ...t) => {
1625
+ a.emit(e, ...t);
1626
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1627
+ }
1628
+ toJSON() {
1629
+ return {
1630
+ options: this.options,
1631
+ store: this.store,
1632
+ language: this.language,
1633
+ languages: this.languages,
1634
+ resolvedLanguage: this.resolvedLanguage
1635
+ };
1636
+ }
1637
+ }.createInstance();
1638
+ //#endregion
1639
+ //#region ../../shared/translator/dist/index.js
1640
+ U.createInstance, U.dir, U.init, U.loadResources, U.reloadResources, U.use, U.changeLanguage, U.getFixedT, U.t, U.exists, U.setDefaultNamespace, U.hasLoadedNamespace, U.loadNamespaces, U.loadLanguages, U.init({
1641
+ fallbackLng: "en",
1642
+ lng: "en",
1643
+ showSupportNotice: !1,
1644
+ resources: {
1645
+ en: j,
1646
+ es: M
1647
+ }
1648
+ });
1649
+ var We = {
1650
+ translator: {
1651
+ ...U,
1652
+ t: (e, t) => {
1653
+ let { lng: n } = t;
1654
+ switch (n) {
1655
+ case "en_US":
1656
+ case "en-US":
1657
+ t.lng = "en";
1658
+ break;
1659
+ case "es_ES":
1660
+ case "es-ES":
1661
+ case "es_MX":
1662
+ case "es-MX":
1663
+ t.lng = "es";
1664
+ break;
1665
+ default: break;
1666
+ }
1667
+ return U.t(e, {
1668
+ lng: n,
1669
+ ...t
1670
+ });
1671
+ }
1672
+ },
1673
+ languageOptions: [{
1674
+ value: "en_US",
1675
+ label: "English (US)"
1676
+ }, {
1677
+ value: "es_ES",
1678
+ label: "Spanish"
1679
+ }]
1680
+ };
1681
+ //#endregion
1682
+ //#region ../../lib-react/correct-answer-toggle/dist/index.js
1683
+ function W(e) {
1684
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
1685
+ }
1686
+ function Ge(e, t) {
1687
+ return !e || W(e) ? e : W(e.default) ? e.default : t && W(e[t]) ? e[t] : t && W(e[t]?.default) ? e[t].default : e;
1688
+ }
1689
+ var Ke = Ge(s, "Readable") || Ge(Ye.Readable, "Readable"), qe = m, Je = qe.default, Ye = Je && typeof Je == "object" ? Je : qe, { translator: G } = We, Xe = {
1690
+ WebkitTouchCallout: "none",
1691
+ WebkitUserSelect: "none",
1692
+ KhtmlUserSelect: "none",
1693
+ MozUserSelect: "none",
1694
+ msUserSelect: "none",
1695
+ userSelect: "none"
1696
+ }, Ze = _("div")(() => ({
1697
+ width: "100%",
1698
+ cursor: "pointer"
1699
+ })), Qe = _("div")(() => ({
1700
+ margin: "0 auto",
1701
+ textAlign: "center",
1702
+ display: "flex"
1703
+ })), $e = _("div")(() => ({
1704
+ width: "fit-content",
1705
+ minWidth: "140px",
1706
+ alignSelf: "center",
1707
+ verticalAlign: "middle",
1708
+ color: `var(--correct-answer-toggle-label-color, ${t.text()})`,
1709
+ fontWeight: "normal",
1710
+ ...Xe
1711
+ })), et = _("div")(() => ({
1712
+ position: "absolute",
1713
+ width: "25px",
1714
+ "&.enter": { opacity: "0" },
1715
+ "&.enter-active": {
1716
+ opacity: "1",
1717
+ transition: "opacity 0.3s ease-in"
1718
+ },
1719
+ "&.exit": { opacity: "1" },
1720
+ "&.exit-active": {
1721
+ opacity: "0",
1722
+ transition: "opacity 0.3s ease-in"
1723
+ }
1724
+ })), tt = _("div")(() => ({
1725
+ width: "25px",
1726
+ marginRight: "5px",
1727
+ display: "flex",
1728
+ alignItems: "center"
1729
+ })), nt = class e extends v.Component {
1730
+ static propTypes = {
1731
+ onToggle: C.default.func,
1732
+ toggled: C.default.bool,
1733
+ show: C.default.bool,
1734
+ hideMessage: C.default.string,
1735
+ showMessage: C.default.string,
1736
+ className: C.default.string,
1737
+ language: C.default.string
1738
+ };
1739
+ static defaultProps = {
1740
+ showMessage: "Show correct answer",
1741
+ hideMessage: "Hide correct answer",
1742
+ show: !1,
1743
+ toggled: !1
1744
+ };
1745
+ constructor(t) {
1746
+ super(t), this.state = { show: t.show }, this.openIconRef = v.createRef(), this.closedIconRef = v.createRef(), e.defaultProps = {
1747
+ ...e.defaultProps,
1748
+ showMessage: G.t("common:showCorrectAnswer", { lng: t.language }),
1749
+ hideMessage: G.t("common:hideCorrectAnswer", { lng: t.language })
1750
+ };
1751
+ }
1752
+ onClick() {
1753
+ this.props.onToggle(!this.props.toggled);
1754
+ }
1755
+ onTouch(e) {
1756
+ e.preventDefault(), this.props.onToggle(!this.props.toggled);
1757
+ }
1758
+ UNSAFE_componentWillReceiveProps(t) {
1759
+ this.setState({ show: t.show }), t.language !== this.props?.language && (e.defaultProps = {
1760
+ ...e.defaultProps,
1761
+ showMessage: G.t("common:showCorrectAnswer", { lng: t.language }),
1762
+ hideMessage: G.t("common:hideCorrectAnswer", { lng: t.language })
1763
+ });
1764
+ }
1765
+ render() {
1766
+ let { className: e, toggled: t, hideMessage: n, showMessage: r } = this.props;
1767
+ return /* @__PURE__ */ x(Ze, {
1768
+ className: e,
1769
+ children: /* @__PURE__ */ x(A, {
1770
+ show: this.state.show,
1771
+ children: /* @__PURE__ */ S(Qe, {
1772
+ onClick: this.onClick.bind(this),
1773
+ onTouchEnd: this.onTouch.bind(this),
1774
+ children: [/* @__PURE__ */ S(tt, { children: [/* @__PURE__ */ x(i, {
1775
+ nodeRef: this.openIconRef,
1776
+ timeout: 400,
1777
+ in: t,
1778
+ exit: !t,
1779
+ classNames: {
1780
+ enter: "enter",
1781
+ enterActive: "enter-active",
1782
+ exit: "exit",
1783
+ exitActive: "exit-active"
1784
+ },
1785
+ children: /* @__PURE__ */ x(et, {
1786
+ ref: this.openIconRef,
1787
+ children: /* @__PURE__ */ x(D, { open: t }, "correct-open")
1788
+ })
1789
+ }), /* @__PURE__ */ x(i, {
1790
+ nodeRef: this.closedIconRef,
1791
+ timeout: 5e3,
1792
+ in: !t,
1793
+ exit: t,
1794
+ classNames: {
1795
+ enter: "enter",
1796
+ enterActive: "enter-active",
1797
+ exit: "exit",
1798
+ exitActive: "exit-active"
1799
+ },
1800
+ children: /* @__PURE__ */ x(et, {
1801
+ ref: this.closedIconRef,
1802
+ children: /* @__PURE__ */ x(D, { open: t }, "correct-closed")
1803
+ })
1804
+ })] }), /* @__PURE__ */ x(Ke, {
1805
+ false: !0,
1806
+ children: /* @__PURE__ */ x($e, {
1807
+ "aria-hidden": !this.state.show,
1808
+ children: t ? n : r
1809
+ })
1810
+ })]
1811
+ })
1812
+ })
1813
+ });
1814
+ }
1815
+ }, rt = _(f)({
1816
+ width: "33px",
1817
+ height: "33px",
1818
+ "& svg": {
1819
+ position: "absolute",
1820
+ display: "inline-block",
1821
+ width: "33px",
1822
+ height: "33px",
1823
+ verticalAlign: "middle",
1824
+ "& hide": { display: "none" }
1825
+ }
1826
+ }), it = _("svg")({
1827
+ "& .incorrect-fill": { fill: `var(--feedback-incorrect-bg-color, ${t.incorrect()})` },
1828
+ "& .correct-fill": { fill: `var(--feedback-correct-bg-color, ${t.correct()})` }
1829
+ }), at = _("div")({
1830
+ position: "relative",
1831
+ "&.feedback-tick-enter": {
1832
+ opacity: "0",
1833
+ left: "-50px"
1834
+ },
1835
+ "&.feedback-tick-enter-active": {
1836
+ opacity: "1",
1837
+ left: "0px",
1838
+ transition: "left 500ms ease-in 200ms, opacity 500ms linear 200ms"
1839
+ },
1840
+ "&.feedback-tick-exit": {
1841
+ opacity: "1",
1842
+ left: "0px"
1843
+ },
1844
+ "&.feedback-tick-exit-active": {
1845
+ opacity: "0",
1846
+ left: "-50px",
1847
+ transition: "left 300ms ease-in, opacity 300ms"
1848
+ }
1849
+ }), ot = class extends v.Component {
1850
+ static propTypes = { correctness: C.default.string };
1851
+ constructor(e) {
1852
+ super(e), this.nodeRef = v.createRef();
1853
+ }
1854
+ getIncorrectIcon = () => /* @__PURE__ */ x(it, {
1855
+ preserveAspectRatio: "xMinYMin meet",
1856
+ x: "0px",
1857
+ y: "0px",
1858
+ viewBox: "0 0 44 40",
1859
+ style: { enableBackground: "new 0 0 44 40" },
1860
+ children: /* @__PURE__ */ S("g", { children: [/* @__PURE__ */ x("rect", {
1861
+ x: "11",
1862
+ y: "17.3",
1863
+ transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",
1864
+ className: "incorrect-fill",
1865
+ width: "16.6",
1866
+ height: "3.7"
1867
+ }), /* @__PURE__ */ x("rect", {
1868
+ x: "17.4",
1869
+ y: "10.7",
1870
+ transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",
1871
+ className: "incorrect-fill",
1872
+ width: "3.7",
1873
+ height: "16.6"
1874
+ })] })
1875
+ }, "1");
1876
+ getCorrectIcon = () => /* @__PURE__ */ x(it, {
1877
+ preserveAspectRatio: "xMinYMin meet",
1878
+ version: "1.1",
1879
+ x: "0px",
1880
+ y: "0px",
1881
+ viewBox: "0 0 44 40",
1882
+ style: { enableBackground: "new 0 0 44 40" },
1883
+ children: /* @__PURE__ */ x("polygon", {
1884
+ className: "correct-fill",
1885
+ points: "19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4"
1886
+ })
1887
+ }, "2");
1888
+ render() {
1889
+ let { correctness: e } = this.props, t = e === "incorrect" ? this.getIncorrectIcon() : e === "correct" ? this.getCorrectIcon() : null;
1890
+ return /* @__PURE__ */ x(rt, { children: /* @__PURE__ */ x(o, { children: e && /* @__PURE__ */ x(i, {
1891
+ nodeRef: this.nodeRef,
1892
+ classNames: {
1893
+ enter: "feedback-tick-enter",
1894
+ enterActive: "feedback-tick-enter-active",
1895
+ exit: "feedback-tick-exit",
1896
+ exitActive: "feedback-tick-exit-active"
1897
+ },
1898
+ timeout: {
1899
+ enter: 700,
1900
+ exit: 300
1901
+ },
1902
+ children: /* @__PURE__ */ x(at, {
1903
+ ref: this.nodeRef,
1904
+ children: t
1905
+ })
1906
+ }) }) });
1907
+ }
1908
+ };
1909
+ //#endregion
1910
+ //#region src/delivery/choice-input.tsx
1911
+ function K(e) {
1912
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
1913
+ }
1914
+ function q(e, t) {
1915
+ return !e || K(e) ? e : K(e.default) ? e.default : t && K(e[t]) ? e[t] : t && K(e[t]?.default) ? e[t].default : e;
1916
+ }
1917
+ var st = q(a, "PreviewPrompt") || q(dt.PreviewPrompt, "PreviewPrompt"), ct = q(c, "Feedback") || q(dt.Feedback, "Feedback"), lt = m, ut = lt.default, dt = ut && typeof ut == "object" ? ut : lt, J = "multiple-choice-component", ft = _(f)({
1918
+ display: "flex",
1919
+ alignItems: "center",
1920
+ backgroundColor: t.background()
1921
+ }), pt = _(f)({
1922
+ display: "flex",
1923
+ alignItems: "center",
1924
+ backgroundColor: t.background(),
1925
+ flex: 1,
1926
+ "& .MuiFormControlLabel-root": { marginLeft: "-14px" },
1927
+ "& label": {
1928
+ color: t.text(),
1929
+ "& > span": { fontSize: "inherit" },
1930
+ "& > .MuiButtonBase-root": { padding: "12px" }
1931
+ }
1932
+ }), mt = _("span")(({ theme: e }) => ({
1933
+ display: "flex",
1934
+ alignItems: "center",
1935
+ "& > span": { marginLeft: `-${e.spacing(1)}` }
1936
+ })), ht = _("span")({
1937
+ position: "absolute",
1938
+ left: "-10000px",
1939
+ top: "auto",
1940
+ width: "1px",
1941
+ height: "1px",
1942
+ overflow: "hidden"
1943
+ }), gt = _(l)({
1944
+ "& .MuiFormControlLabel-label": {
1945
+ color: `${t.text()} !important`,
1946
+ backgroundColor: t.background(),
1947
+ letterSpacing: "normal"
1948
+ },
1949
+ "&.Mui-disabled *": { cursor: "not-allowed !important" }
1950
+ }), Y = (e, t) => ({ [`&.${J}`]: { color: `var(--choice-input-${e}, ${t}) !important` } }), _t = (e) => {
1951
+ let n = (t) => e ? `${e}-${t}` : t;
1952
+ return {
1953
+ [n("root")]: {
1954
+ ...Y("color", t.text()),
1955
+ ...e === "correct" ? Y("correct-color", t.text()) : {},
1956
+ ...e === "incorrect" ? Y("incorrect-color", t.incorrect()) : {}
1957
+ },
1958
+ [n("checked")]: {
1959
+ ...e === "correct" ? Y("correct-selected-color", t.correct()) : {},
1960
+ ...e === "incorrect" ? Y("incorrect-checked", t.incorrect()) : {},
1961
+ ...e ? {} : Y("selected-color", t.primary())
1962
+ },
1963
+ [n("disabled")]: {
1964
+ ...Y("disabled-color", t.text()),
1965
+ ...e === "correct" ? Y("correct-disabled-color", t.disabled()) : {},
1966
+ ...e === "incorrect" ? Y("incorrect-disabled-color", t.disabled()) : {},
1967
+ opacity: .6,
1968
+ cursor: "not-allowed !important",
1969
+ pointerEvents: "initial !important"
1970
+ },
1971
+ focusVisibleUnchecked: {
1972
+ outline: `2px solid ${t.keyBoardFocusIndicator()}`,
1973
+ backgroundColor: "transparent"
1974
+ },
1975
+ focusVisibleChecked: {
1976
+ outline: `2px solid ${t.keyBoardFocusIndicator()}`,
1977
+ backgroundColor: "transparent"
1978
+ }
1979
+ };
1980
+ }, vt = _(d, { shouldForwardProp: (e) => e !== "correctness" })(({ correctness: e }) => {
1981
+ let n = _t(e), r = (t) => e ? `${e}-${t}` : t;
1982
+ return {
1983
+ [`&.${J}`]: {
1984
+ ...n[r("root")],
1985
+ "&.Mui-checked": n[r("checked")],
1986
+ "&.Mui-disabled": e ? {} : n[r("disabled")],
1987
+ "&:hover:not(.Mui-disabled) svg": {
1988
+ boxShadow: `0px 0px 0px 2px ${t.keyBoardFocusIndicator()}`,
1989
+ borderRadius: "4px"
1990
+ }
1991
+ },
1992
+ "&.Mui-focusVisible": {
1993
+ "&:not(.Mui-checked)": n.focusVisibleUnchecked,
1994
+ "&.Mui-checked": n.focusVisibleChecked
1995
+ }
1996
+ };
1997
+ }), yt = (e) => {
1998
+ let { correctness: t, checked: n, onChange: r, disabled: i, value: a, id: o, onKeyDown: s, inputRef: c } = e;
1999
+ return /* @__PURE__ */ x(vt, {
2000
+ id: o,
2001
+ slotProps: { input: { ref: c } },
2002
+ onKeyDown: s,
2003
+ disableRipple: !0,
2004
+ checked: n,
2005
+ onChange: r,
2006
+ disabled: i,
2007
+ value: a,
2008
+ correctness: t,
2009
+ className: J
2010
+ });
2011
+ }, bt = _(h, { shouldForwardProp: (e) => e !== "correctness" })(({ correctness: e }) => {
2012
+ let n = _t(e), r = (t) => e ? `${e}-${t}` : t;
2013
+ return {
2014
+ [`&.${J}`]: {
2015
+ ...n[r("root")],
2016
+ "&.Mui-checked": n[r("checked")],
2017
+ "&.Mui-disabled": e ? {} : n[r("disabled")],
2018
+ "&.Mui-focusVisible:not(.Mui-checked)": n.focusVisibleUnchecked,
2019
+ "&.Mui-focusVisible.Mui-checked": n.focusVisibleChecked,
2020
+ "&:hover:not(.Mui-disabled) svg": {
2021
+ boxShadow: `0px 0px 0px 2px ${t.keyBoardFocusIndicator()}`,
2022
+ borderRadius: "50%"
2023
+ }
2024
+ },
2025
+ "&.Mui-focusVisible": {
2026
+ "& input": { outline: 0 },
2027
+ "& .MuiTouchRipple-root": { display: "none" }
2028
+ }
2029
+ };
2030
+ }), xt = (e) => {
2031
+ let { correctness: t, checked: n, onChange: r, disabled: i, value: a, id: o, tagName: s, inputRef: c } = e;
2032
+ return /* @__PURE__ */ x(bt, {
2033
+ id: o,
2034
+ slotProps: { input: { ref: c } },
2035
+ disableRipple: !0,
2036
+ checked: n,
2037
+ onChange: r,
2038
+ disabled: i,
2039
+ value: a,
2040
+ correctness: t,
2041
+ className: J,
2042
+ name: s
2043
+ });
2044
+ }, St = class extends v.Component {
2045
+ static propTypes = {
2046
+ choiceMode: C.default.oneOf(["radio", "checkbox"]),
2047
+ displayKey: C.default.string,
2048
+ checked: C.default.bool.isRequired,
2049
+ correctness: C.default.string,
2050
+ disabled: C.default.bool.isRequired,
2051
+ feedback: C.default.string,
2052
+ label: C.default.string.isRequired,
2053
+ rationale: C.default.string,
2054
+ onChange: C.default.func.isRequired,
2055
+ value: C.default.string.isRequired,
2056
+ className: C.default.string,
2057
+ tagName: C.default.string,
2058
+ hideTick: C.default.bool,
2059
+ isEvaluateMode: C.default.bool,
2060
+ choicesLayout: C.default.oneOf([
2061
+ "vertical",
2062
+ "grid",
2063
+ "horizontal"
2064
+ ]),
2065
+ isSelectionButtonBelow: C.default.bool
2066
+ };
2067
+ static defaultProps = {
2068
+ rationale: null,
2069
+ checked: !1,
2070
+ isEvaluateMode: !1
2071
+ };
2072
+ constructor(e) {
2073
+ super(e), this.onToggleChoice = this.onToggleChoice.bind(this), this.choiceId = this.generateChoiceId(), this.descId = `${this.choiceId}-desc`;
2074
+ }
2075
+ onToggleChoice(e) {
2076
+ this.props.onChange(e);
2077
+ }
2078
+ generateChoiceId() {
2079
+ return "choice-" + (Math.random() * 1e4).toFixed();
2080
+ }
2081
+ handleKeyDown = (e) => {
2082
+ let { choiceMode: t } = this.props;
2083
+ if (t !== "checkbox") return;
2084
+ let n = e.key === "ArrowDown", r = e.key === "ArrowUp";
2085
+ if (!n && !r) return;
2086
+ e.preventDefault();
2087
+ let i = document.getElementById(this.choiceId);
2088
+ if (!i) return;
2089
+ let a = i.closest("fieldset");
2090
+ if (!a) return;
2091
+ let o = Array.from(a.querySelectorAll("input[type=\"checkbox\"]")), s = o.findIndex((e) => e === i);
2092
+ if (s === -1) return;
2093
+ let c = o[n ? s + 1 : s - 1];
2094
+ c && c.focus();
2095
+ };
2096
+ render() {
2097
+ let { choiceMode: t, disabled: n, displayKey: r, feedback: i, label: a, correctness: o, className: s, rationale: c, hideTick: l, isEvaluateMode: u, choicesLayout: d, value: f, checked: p, tagName: m, isSelectionButtonBelow: h } = this.props, g = t === "checkbox" ? yt : xt, _ = t === "checkbox" ? "checkbox" : "radio-button", v = {
2098
+ ...d === "horizontal" && { [`& .${J}`]: {
2099
+ padding: "8px",
2100
+ margin: "4px 0 4px 4px"
2101
+ } },
2102
+ ...h && d !== "grid" && { "& > label": { alignItems: "flex-start" } },
2103
+ ...h && d === "grid" && {
2104
+ justifyContent: "center",
2105
+ "& > label": { alignItems: "center" }
2106
+ }
2107
+ }, y = typeof a == "string" && (a.includes("<math") || a.includes("\\(") || a.includes("\\[") || a.includes("<img") || a.includes("data-latex") || a.includes("data-raw") || a.includes("<mjx-container")), C = r ? /* @__PURE__ */ x(ht, {
2108
+ id: this.descId,
2109
+ children: y ? `Pick the answer below, ${r}` : r
2110
+ }) : null, w = /* @__PURE__ */ x(b, { children: r && !h ? /* @__PURE__ */ S(ft, {
2111
+ component: "span",
2112
+ children: [/* @__PURE__ */ S("span", {
2113
+ "aria-hidden": "true",
2114
+ children: [
2115
+ r,
2116
+ ".",
2117
+ "\xA0"
2118
+ ]
2119
+ }), /* @__PURE__ */ x(st, {
2120
+ className: "prompt-label",
2121
+ prompt: a,
2122
+ tagName: "span"
2123
+ })]
2124
+ }) : /* @__PURE__ */ x(st, {
2125
+ className: "prompt-label",
2126
+ prompt: a,
2127
+ tagName: "span"
2128
+ }) }), T = {
2129
+ disabled: n,
2130
+ checked: p,
2131
+ correctness: o,
2132
+ tagName: m,
2133
+ value: f,
2134
+ id: this.choiceId,
2135
+ onChange: this.onToggleChoice,
2136
+ onKeyDown: this.handleKeyDown,
2137
+ ...C ? { "aria-describedby": this.descId } : {}
2138
+ }, E = h ? /* @__PURE__ */ S(mt, { children: [
2139
+ C,
2140
+ /* @__PURE__ */ x(g, {
2141
+ ...T,
2142
+ style: { padding: 0 }
2143
+ }),
2144
+ /* @__PURE__ */ x("span", {
2145
+ "aria-hidden": "true",
2146
+ children: r ? `${r}.` : ""
2147
+ })
2148
+ ] }) : /* @__PURE__ */ S(b, { children: [C, /* @__PURE__ */ x(g, { ...T })] });
2149
+ return /* @__PURE__ */ S("div", {
2150
+ className: e(s, "corespring-" + _, "choice-input"),
2151
+ children: [
2152
+ /* @__PURE__ */ S(ft, { children: [!l && u && /* @__PURE__ */ x(ot, { correctness: o }), /* @__PURE__ */ x(pt, {
2153
+ className: "checkbox-holder",
2154
+ sx: v,
2155
+ children: /* @__PURE__ */ x(gt, {
2156
+ label: w,
2157
+ value: f,
2158
+ htmlFor: this.choiceId,
2159
+ labelPlacement: h ? "top" : void 0,
2160
+ control: E
2161
+ })
2162
+ })] }),
2163
+ c && /* @__PURE__ */ x(st, {
2164
+ className: "rationale",
2165
+ defaultClassName: "rationale",
2166
+ prompt: c
2167
+ }),
2168
+ /* @__PURE__ */ x(ct, {
2169
+ feedback: i,
2170
+ correctness: o
2171
+ })
2172
+ ]
2173
+ });
2174
+ }
2175
+ }, Ct = _(f, { shouldForwardProp: (e) => e !== "noBorder" && e !== "horizontalLayout" })(({ theme: e, noBorder: n, horizontalLayout: r }) => ({
2176
+ paddingTop: e.spacing(2.5),
2177
+ paddingBottom: `calc(${e.spacing(1)} + 2px)`,
2178
+ paddingLeft: `calc(${e.spacing(1)} + 2px)`,
2179
+ paddingRight: `calc(${e.spacing(1)} + 2px)`,
2180
+ borderBottom: n ? "none" : `1px solid ${t.border()}`,
2181
+ ...r && {
2182
+ paddingRight: e.spacing(2.5),
2183
+ "& label": { marginRight: e.spacing(1) }
2184
+ }
2185
+ })), wt = class extends v.Component {
2186
+ static propTypes = {};
2187
+ state = { isHovered: !1 };
2188
+ handleMouseEnter = () => {
2189
+ let { disabled: e, checked: t } = this.props;
2190
+ !e && !t && this.setState({ isHovered: !0 });
2191
+ };
2192
+ handleMouseLeave = () => {
2193
+ this.setState({ isHovered: !1 });
2194
+ };
2195
+ onChange = (e) => {
2196
+ let { disabled: t, onChoiceChanged: n } = this.props;
2197
+ t || n(e);
2198
+ };
2199
+ render() {
2200
+ let { choice: e, index: t, choicesLength: n, showCorrect: r, isEvaluateMode: i, choiceMode: a, disabled: o, checked: s, correctness: c, displayKey: l, choicesLayout: u, gridColumns: d, isSelectionButtonBelow: f, selectedAnswerBackgroundColor: p, selectedAnswerStrokeColor: m, selectedAnswerStrokeWidth: h, hoverAnswerBackgroundColor: g, hoverAnswerStrokeColor: _, hoverAnswerStrokeWidth: v, tagName: y } = this.props, { isHovered: b } = this.state, S = "choice" + (t === n - 1 ? " last" : ""), C = !i || r ? "" : e.feedback, w = {
2201
+ ...e,
2202
+ checked: s,
2203
+ choiceMode: a,
2204
+ disabled: o,
2205
+ feedback: C,
2206
+ correctness: c,
2207
+ displayKey: l,
2208
+ index: t,
2209
+ choicesLayout: u,
2210
+ gridColumns: d,
2211
+ onChange: this.onChange,
2212
+ isEvaluateMode: i,
2213
+ isSelectionButtonBelow: f,
2214
+ selectedAnswerStrokeColor: m,
2215
+ selectedAnswerStrokeWidth: h,
2216
+ tagName: y
2217
+ }, T = (e) => {
2218
+ if (!e) return "2px";
2219
+ let t = String(e).trim();
2220
+ return /^\d+(\.\d+)?$/.test(t) ? `${t}px` : t;
2221
+ }, E = m && m !== "initial", D = _ && _ !== "initial", O = "transparent", k = "2px", A = "initial";
2222
+ (E || D) && (s && E ? (O = m, k = h) : b && !o && D && (O = _, k = v)), s && p && p !== "initial" ? A = p : b && !o && g && g !== "initial" && (A = g);
2223
+ let j = E || D, M = j ? {
2224
+ border: `${T(k)} solid ${O}`,
2225
+ borderRadius: "8px"
2226
+ } : {}, N = t === n - 1 || u !== "vertical" || j, P = u === "horizontal";
2227
+ return /* @__PURE__ */ x("div", {
2228
+ className: S,
2229
+ style: {
2230
+ backgroundColor: A === "initial" ? "initial" : A,
2231
+ ...M
2232
+ },
2233
+ onMouseEnter: this.handleMouseEnter,
2234
+ onMouseLeave: this.handleMouseLeave,
2235
+ children: /* @__PURE__ */ x(Ct, {
2236
+ component: "div",
2237
+ noBorder: N,
2238
+ horizontalLayout: P,
2239
+ children: /* @__PURE__ */ x(St, { ...w })
2240
+ })
2241
+ }, t);
2242
+ }
2243
+ };
2244
+ wt.propTypes = {
2245
+ choiceMode: C.default.oneOf(["radio", "checkbox"]),
2246
+ choice: C.default.object,
2247
+ disabled: C.default.bool.isRequired,
2248
+ onChoiceChanged: C.default.func,
2249
+ index: C.default.number,
2250
+ choicesLength: C.default.number,
2251
+ showCorrect: C.default.bool,
2252
+ isEvaluateMode: C.default.bool,
2253
+ checked: C.default.bool,
2254
+ correctness: C.default.string,
2255
+ displayKey: C.default.string,
2256
+ choicesLayout: C.default.oneOf([
2257
+ "vertical",
2258
+ "grid",
2259
+ "horizontal"
2260
+ ]),
2261
+ gridColumns: C.default.string,
2262
+ selectedAnswerBackgroundColor: C.default.string,
2263
+ selectedAnswerStrokeColor: C.default.string,
2264
+ selectedAnswerStrokeWidth: C.default.string,
2265
+ hoverAnswerBackgroundColor: C.default.string,
2266
+ hoverAnswerStrokeColor: C.default.string,
2267
+ hoverAnswerStrokeWidth: C.default.string,
2268
+ tagName: C.default.string,
2269
+ isSelectionButtonBelow: C.default.bool
2270
+ };
2271
+ //#endregion
2272
+ //#region src/delivery/utils.ts
2273
+ var Tt = (e, t) => t != null && e >= t, Et = (e, t) => t != null && e > t;
2274
+ //#endregion
2275
+ //#region src/delivery/multiple-choice.tsx
2276
+ function X(e) {
2277
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
2278
+ }
2279
+ function Z(e, t) {
2280
+ return !e || X(e) ? e : X(e.default) ? e.default : t && X(e[t]) ? e[t] : t && X(e[t]?.default) ? e[t].default : e;
2281
+ }
2282
+ var Dt = Z(a, "PreviewPrompt") || Z(jt.PreviewPrompt, "PreviewPrompt"), Ot = Z(u, "Collapsible") || Z(jt.Collapsible, "Collapsible"), kt = m, At = kt.default, jt = At && typeof At == "object" ? At : kt, { translator: Q } = We, Mt = _(f)({
2283
+ color: t.text(),
2284
+ backgroundColor: t.background(),
2285
+ "& *": { "-webkit-font-smoothing": "antialiased" },
2286
+ position: "relative",
2287
+ "& legend": { border: "none !important" }
2288
+ }), Nt = _("h2")(({ theme: e }) => ({
2289
+ display: "block",
2290
+ fontSize: "inherit",
2291
+ margin: "0",
2292
+ fontWeight: "normal",
2293
+ paddingBottom: e.spacing(2)
2294
+ })), Pt = _(f)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Ft = _(f)({
2295
+ display: "flex",
2296
+ flexDirection: "row",
2297
+ flexWrap: "wrap"
2298
+ }), It = _(f)({ display: "grid" }), Lt = _("fieldset")({
2299
+ border: "0px",
2300
+ padding: "0.01em 0 0 0",
2301
+ margin: "0px",
2302
+ minWidth: "0px"
2303
+ }), Rt = _("h3")({
2304
+ position: "absolute",
2305
+ left: "-10000px",
2306
+ top: "auto",
2307
+ width: "1px",
2308
+ height: "1px",
2309
+ overflow: "hidden"
2310
+ }), zt = _("div")(({ theme: e }) => ({
2311
+ fontSize: e.typography.fontSize - 2,
2312
+ color: e.palette.error.main,
2313
+ paddingTop: e.spacing(1)
2314
+ })), Bt = class extends v.Component {
2315
+ static propTypes = {
2316
+ className: C.default.string,
2317
+ mode: C.default.oneOf([
2318
+ "gather",
2319
+ "view",
2320
+ "evaluate"
2321
+ ]),
2322
+ choiceMode: C.default.oneOf(["radio", "checkbox"]),
2323
+ keyMode: C.default.oneOf([
2324
+ "numbers",
2325
+ "letters",
2326
+ "none"
2327
+ ]),
2328
+ choices: C.default.array,
2329
+ partLabel: C.default.string,
2330
+ prompt: C.default.string,
2331
+ teacherInstructions: C.default.string,
2332
+ session: C.default.object,
2333
+ disabled: C.default.bool,
2334
+ onChoiceChanged: C.default.func,
2335
+ responseCorrect: C.default.bool,
2336
+ correctResponse: C.default.array,
2337
+ choicesLayout: C.default.oneOf([
2338
+ "vertical",
2339
+ "grid",
2340
+ "horizontal"
2341
+ ]),
2342
+ gridColumns: C.default.string,
2343
+ alwaysShowCorrect: C.default.bool,
2344
+ animationsDisabled: C.default.bool,
2345
+ language: C.default.string,
2346
+ selectedAnswerBackgroundColor: C.default.string,
2347
+ selectedAnswerStrokeColor: C.default.string,
2348
+ selectedAnswerStrokeWidth: C.default.string,
2349
+ hoverAnswerBackgroundColor: C.default.string,
2350
+ hoverAnswerStrokeColor: C.default.string,
2351
+ hoverAnswerStrokeWidth: C.default.string,
2352
+ onShowCorrectToggle: C.default.func,
2353
+ isSelectionButtonBelow: C.default.bool,
2354
+ minSelections: C.default.number,
2355
+ maxSelections: C.default.number,
2356
+ autoplayAudioEnabled: C.default.bool,
2357
+ customAudioButton: {
2358
+ playImage: C.default.string,
2359
+ pauseImage: C.default.string
2360
+ },
2361
+ options: C.default.object,
2362
+ baseHeadingLevel: C.default.number,
2363
+ includeSrHeading: C.default.bool
2364
+ };
2365
+ constructor(e) {
2366
+ super(e), this.state = {
2367
+ showCorrect: this.props.options && this.props.alwaysShowCorrect || !1,
2368
+ maxSelectionsErrorState: !1
2369
+ }, this.onToggle = this.onToggle.bind(this), this.groupName = `mc-group-${Math.random().toString(36).slice(2, 10)}`;
2370
+ }
2371
+ isSelected(e) {
2372
+ let t = this.props.session && this.props.session.value;
2373
+ return t && t.indexOf && t.indexOf(e) >= 0;
2374
+ }
2375
+ handleChange = (e) => {
2376
+ let { value: t, checked: n } = e.target, { choiceMode: r, maxSelections: i, onChoiceChanged: a, session: o } = this.props;
2377
+ r !== "radio" && o.value && Tt(o.value.length, i) && (this.setState({ maxSelectionsErrorState: n }), n) || a({
2378
+ value: t,
2379
+ selected: n,
2380
+ selector: "Mouse"
2381
+ });
2382
+ };
2383
+ onToggle = () => {
2384
+ this.props.mode === "evaluate" && this.setState({ showCorrect: !this.state.showCorrect }, () => {
2385
+ this.props.onShowCorrectToggle && this.props.onShowCorrectToggle();
2386
+ });
2387
+ };
2388
+ UNSAFE_componentWillReceiveProps(e) {
2389
+ !e.correctResponse && this.state.showCorrect !== !1 && this.setState({ showCorrect: !1 }, () => {
2390
+ this.props.onShowCorrectToggle && this.props.onShowCorrectToggle();
2391
+ }), e.options && e.alwaysShowCorrect && this.state.showCorrect !== !0 && this.setState({ showCorrect: !0 }, () => {
2392
+ this.props.onShowCorrectToggle && this.props.onShowCorrectToggle();
2393
+ });
2394
+ }
2395
+ indexToSymbol(e) {
2396
+ return this.props.keyMode === "numbers" ? `${e + 1}` : this.props.keyMode === "letters" ? String.fromCharCode(97 + e).toUpperCase() : "";
2397
+ }
2398
+ getCorrectness = (e = {}) => {
2399
+ let t = e.correct, n = this.isSelected(e.value);
2400
+ if (this.state.showCorrect) return t ? "correct" : void 0;
2401
+ if (t) return n ? "correct" : "incorrect";
2402
+ if (n) return "incorrect";
2403
+ };
2404
+ getChecked(e) {
2405
+ return this.props.options && this.props.alwaysShowCorrect || this.state.showCorrect && this.props.mode === "evaluate" ? e.correct || !1 : this.isSelected(e.value);
2406
+ }
2407
+ renderHeading() {
2408
+ let { mode: e, choiceMode: t, includeSrHeading: n, baseHeadingLevel: r, partLabel: i } = this.props;
2409
+ if (!(!i && n !== !1) || e !== "gather") return null;
2410
+ let a = r ? Math.min(6, r) : 2;
2411
+ return /* @__PURE__ */ x(Rt.withComponent(`h${a}`), { children: t === "radio" ? "Multiple Choice Question" : "Multiple Select Question" });
2412
+ }
2413
+ render() {
2414
+ let { mode: t, disabled: n, className: r, choices: i = [], choiceMode: a, gridColumns: o, partLabel: s, prompt: c, responseCorrect: l, teacherInstructions: u, alwaysShowCorrect: d, animationsDisabled: m, language: h, isSelectionButtonBelow: g, minSelections: _, maxSelections: v, autoplayAudioEnabled: y, session: b, customAudioButton: C, options: w, baseHeadingLevel: T } = this.props, { showCorrect: E, maxSelectionsErrorState: D } = this.state, O = t === "evaluate", k = O && !l, A = o > 1 ? { gridTemplateColumns: `repeat(${o}, 1fr)` } : void 0, j = b.value && b.value.length || 0, M = (() => {
2415
+ if (!T) return;
2416
+ let e = 1;
2417
+ return s && (e += 1), Math.min(6, T + e);
2418
+ })(), N = (e) => e && M ? p(e, M) : e, P = /* @__PURE__ */ x(Dt, {
2419
+ tagName: "div",
2420
+ className: "prompt",
2421
+ defaultClassName: "teacher-instructions",
2422
+ prompt: u
2423
+ }), ee = () => _ && v ? _ === v ? Q.t("translation:multipleChoice:minmaxSelections_equal", {
2424
+ lng: h,
2425
+ minSelections: _
2426
+ }) : Q.t("translation:multipleChoice:minmaxSelections_range", {
2427
+ lng: h,
2428
+ minSelections: _,
2429
+ maxSelections: v
2430
+ }) : _ ? Q.t("translation:multipleChoice:minSelections", {
2431
+ lng: h,
2432
+ minSelections: _
2433
+ }) : "", te = this.props.choicesLayout === "grid" ? It : this.props.choicesLayout === "horizontal" ? Ft : f;
2434
+ return /* @__PURE__ */ S(Mt, {
2435
+ id: "main-container",
2436
+ className: e(r, "multiple-choice"),
2437
+ children: [
2438
+ s && /* @__PURE__ */ x(Nt, {
2439
+ as: T ? `h${Math.min(6, T + 1)}` : "h2",
2440
+ children: s
2441
+ }),
2442
+ this.renderHeading(),
2443
+ u && /* @__PURE__ */ x(Pt, { children: m ? P : /* @__PURE__ */ x(Ot, {
2444
+ labels: {
2445
+ hidden: "Show Teacher Instructions",
2446
+ visible: "Hide Teacher Instructions"
2447
+ },
2448
+ children: P
2449
+ }) }),
2450
+ /* @__PURE__ */ S(Lt, {
2451
+ role: a === "radio" ? "radiogroup" : "group",
2452
+ children: [
2453
+ /* @__PURE__ */ x(Dt, {
2454
+ className: "prompt",
2455
+ defaultClassName: "prompt",
2456
+ prompt: N(c),
2457
+ tagName: "legend",
2458
+ autoplayAudioEnabled: y,
2459
+ customAudioButton: C
2460
+ }),
2461
+ !(w && d) && /* @__PURE__ */ x(nt, {
2462
+ show: k,
2463
+ toggled: E,
2464
+ onToggle: this.onToggle.bind(this),
2465
+ language: h
2466
+ }),
2467
+ /* @__PURE__ */ x(te, {
2468
+ style: A,
2469
+ children: i.map((e, t) => /* @__PURE__ */ x(wt, {
2470
+ choicesLayout: this.props.choicesLayout,
2471
+ selectedAnswerBackgroundColor: this.props.selectedAnswerBackgroundColor,
2472
+ selectedAnswerStrokeColor: this.props.selectedAnswerStrokeColor,
2473
+ selectedAnswerStrokeWidth: this.props.selectedAnswerStrokeWidth,
2474
+ hoverAnswerBackgroundColor: this.props.hoverAnswerBackgroundColor,
2475
+ hoverAnswerStrokeColor: this.props.hoverAnswerStrokeColor,
2476
+ hoverAnswerStrokeWidth: this.props.hoverAnswerStrokeWidth,
2477
+ gridColumns: o,
2478
+ choice: e,
2479
+ index: t,
2480
+ choicesLength: i.length,
2481
+ showCorrect: E,
2482
+ isEvaluateMode: O,
2483
+ choiceMode: a,
2484
+ disabled: n,
2485
+ tagName: this.groupName,
2486
+ onChoiceChanged: this.handleChange,
2487
+ hideTick: e.hideTick,
2488
+ checked: this.getChecked(e),
2489
+ correctness: O ? this.getCorrectness(e) : void 0,
2490
+ displayKey: this.indexToSymbol(t),
2491
+ isSelectionButtonBelow: g
2492
+ }, `choice-${t}`))
2493
+ })
2494
+ ]
2495
+ }),
2496
+ a === "checkbox" && j < _ && /* @__PURE__ */ x(zt, { children: ee() }),
2497
+ a === "checkbox" && D && /* @__PURE__ */ x(zt, { children: Q.t(`translation:multipleChoice:maxSelections_${v === 1 ? "one" : "other"}`, {
2498
+ lng: h,
2499
+ maxSelections: v
2500
+ }) })
2501
+ ]
2502
+ });
2503
+ }
2504
+ };
2505
+ Bt.defaultProps = { session: { value: [] } };
2506
+ //#endregion
2507
+ //#region src/delivery/main.tsx
2508
+ function $(e) {
2509
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
2510
+ }
2511
+ function Vt(e, t) {
2512
+ return !e || $(e) ? e : $(e.default) ? e.default : t && $(e[t]) ? e[t] : t && $(e[t]?.default) ? e[t].default : e;
2513
+ }
2514
+ var Ht = Vt(g, "PreviewLayout") || Vt(Gt.PreviewLayout, "PreviewLayout"), Ut = m, Wt = Ut.default, Gt = Wt && typeof Wt == "object" ? Wt : Ut, Kt = class extends v.Component {
2515
+ static propTypes = {
2516
+ model: C.default.object,
2517
+ session: C.default.object,
2518
+ options: C.default.object,
2519
+ onChoiceChanged: C.default.func,
2520
+ onShowCorrectToggle: C.default.func,
2521
+ extraCSSRules: C.default.shape({
2522
+ names: C.default.arrayOf(C.default.string),
2523
+ rules: C.default.string
2524
+ }),
2525
+ baseHeadingLevel: C.default.number,
2526
+ includeSrHeading: C.default.bool
2527
+ };
2528
+ static defaultProps = {
2529
+ model: {},
2530
+ session: {}
2531
+ };
2532
+ render() {
2533
+ let { model: e, onChoiceChanged: t, session: n, onShowCorrectToggle: r, options: i, baseHeadingLevel: a, includeSrHeading: o } = this.props, { extraCSSRules: s, fontSizeFactor: c } = e;
2534
+ return /* @__PURE__ */ x(Ht, {
2535
+ extraCSSRules: s,
2536
+ fontSizeFactor: c,
2537
+ classes: {},
2538
+ children: /* @__PURE__ */ x(Bt, {
2539
+ ...e,
2540
+ options: i,
2541
+ session: n,
2542
+ onChoiceChanged: t,
2543
+ onShowCorrectToggle: r,
2544
+ baseHeadingLevel: a,
2545
+ includeSrHeading: o
2546
+ })
2547
+ });
2548
+ }
2549
+ };
2550
+ //#endregion
2551
+ export { Et as n, Kt as t };
2552
+
2553
+ //# sourceMappingURL=main-DoiD4nKm.js.map