@elia-assistant/chatui 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,53 +1,69 @@
1
- //#region node_modules/i18next/dist/esm/i18next.js
2
- var e = (e) => typeof e == "string", t = () => {
1
+ //#region \0rolldown/runtime.js
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
3
+ let r = {};
4
+ for (var i in e) t(r, i, {
5
+ get: e[i],
6
+ enumerable: !0
7
+ });
8
+ return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
9
+ }, c = (e, i, o, s) => {
10
+ if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
11
+ get: ((e) => i[e]).bind(null, d),
12
+ enumerable: !(s = n(i, d)) || s.enumerable
13
+ });
14
+ return e;
15
+ }, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
16
+ value: n,
17
+ enumerable: !0
18
+ }) : a, n)), u = (e) => typeof e == "string", d = () => {
3
19
  let e, t, n = new Promise((n, r) => {
4
20
  e = n, t = r;
5
21
  });
6
22
  return n.resolve = e, n.reject = t, n;
7
- }, n = (e) => e == null ? "" : "" + e, r = (e, t, n) => {
23
+ }, f = (e) => e == null ? "" : "" + e, p = (e, t, n) => {
8
24
  e.forEach((e) => {
9
25
  t[e] && (n[e] = t[e]);
10
26
  });
11
- }, i = /###/g, a = (e) => e && e.indexOf("###") > -1 ? e.replace(i, ".") : e, o = (t) => !t || e(t), s = (t, n, r) => {
12
- let i = e(n) ? n.split(".") : n, s = 0;
13
- for (; s < i.length - 1;) {
14
- if (o(t)) return {};
15
- let e = a(i[s]);
16
- !t[e] && r && (t[e] = new r()), t = Object.prototype.hasOwnProperty.call(t, e) ? t[e] : {}, ++s;
17
- }
18
- return o(t) ? {} : {
19
- obj: t,
20
- k: a(i[s])
27
+ }, m = /###/g, h = (e) => e && e.indexOf("###") > -1 ? e.replace(m, ".") : e, g = (e) => !e || u(e), _ = (e, t, n) => {
28
+ let r = u(t) ? t.split(".") : t, i = 0;
29
+ for (; i < r.length - 1;) {
30
+ if (g(e)) return {};
31
+ let t = h(r[i]);
32
+ !e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
33
+ }
34
+ return g(e) ? {} : {
35
+ obj: e,
36
+ k: h(r[i])
21
37
  };
22
- }, c = (e, t, n) => {
23
- let { obj: r, k: i } = s(e, t, Object);
38
+ }, v = (e, t, n) => {
39
+ let { obj: r, k: i } = _(e, t, Object);
24
40
  if (r !== void 0 || t.length === 1) {
25
41
  r[i] = n;
26
42
  return;
27
43
  }
28
- let a = t[t.length - 1], o = t.slice(0, t.length - 1), c = s(e, o, Object);
29
- for (; c.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), c = s(e, o, Object), c?.obj && c.obj[`${c.k}.${a}`] !== void 0 && (c.obj = void 0);
30
- c.obj[`${c.k}.${a}`] = n;
31
- }, l = (e, t, n, r) => {
32
- let { obj: i, k: a } = s(e, t, Object);
44
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = _(e, o, Object);
45
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = _(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
46
+ s.obj[`${s.k}.${a}`] = n;
47
+ }, y = (e, t, n, r) => {
48
+ let { obj: i, k: a } = _(e, t, Object);
33
49
  i[a] = i[a] || [], i[a].push(n);
34
- }, u = (e, t) => {
35
- let { obj: n, k: r } = s(e, t);
50
+ }, b = (e, t) => {
51
+ let { obj: n, k: r } = _(e, t);
36
52
  if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
37
- }, d = (e, t, n) => {
38
- let r = u(e, n);
39
- return r === void 0 ? u(t, n) : r;
40
- }, f = (t, n, r) => {
41
- for (let i in n) i !== "__proto__" && i !== "constructor" && (i in t ? e(t[i]) || t[i] instanceof String || e(n[i]) || n[i] instanceof String ? r && (t[i] = n[i]) : f(t[i], n[i], r) : t[i] = n[i]);
42
- return t;
43
- }, p = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), m = {
53
+ }, x = (e, t, n) => {
54
+ let r = b(e, n);
55
+ return r === void 0 ? b(t, n) : r;
56
+ }, S = (e, t, n) => {
57
+ for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? u(e[r]) || e[r] instanceof String || u(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : S(e[r], t[r], n) : e[r] = t[r]);
58
+ return e;
59
+ }, C = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), w = {
44
60
  "&": "&amp;",
45
61
  "<": "&lt;",
46
62
  ">": "&gt;",
47
63
  "\"": "&quot;",
48
64
  "'": "&#39;",
49
65
  "/": "&#x2F;"
50
- }, h = (t) => e(t) ? t.replace(/[&<>"'\/]/g, (e) => m[e]) : t, g = class {
66
+ }, T = (e) => u(e) ? e.replace(/[&<>"'\/]/g, (e) => w[e]) : e, E = class {
51
67
  constructor(e) {
52
68
  this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
53
69
  }
@@ -57,23 +73,23 @@ var e = (e) => typeof e == "string", t = () => {
57
73
  let n = new RegExp(e);
58
74
  return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
59
75
  }
60
- }, _ = [
76
+ }, D = [
61
77
  " ",
62
78
  ",",
63
79
  "?",
64
80
  "!",
65
81
  ";"
66
- ], v = new g(20), y = (e, t, n) => {
82
+ ], ee = new E(20), O = (e, t, n) => {
67
83
  t ||= "", n ||= "";
68
- let r = _.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
84
+ let r = D.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
69
85
  if (r.length === 0) return !0;
70
- let i = v.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
86
+ let i = ee.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
71
87
  if (!a) {
72
88
  let t = e.indexOf(n);
73
89
  t > 0 && !i.test(e.substring(0, t)) && (a = !0);
74
90
  }
75
91
  return a;
76
- }, b = (e, t, n = ".") => {
92
+ }, k = (e, t, n = ".") => {
77
93
  if (!e) return;
78
94
  if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
79
95
  let r = t.split(n), i = e;
@@ -92,7 +108,7 @@ var e = (e) => typeof e == "string", t = () => {
92
108
  i = t;
93
109
  }
94
110
  return i;
95
- }, x = (e) => e?.replace(/_/g, "-"), S = {
111
+ }, A = (e) => e?.replace(/_/g, "-"), te = {
96
112
  type: "logger",
97
113
  log(e) {
98
114
  this.output("log", e);
@@ -106,12 +122,12 @@ var e = (e) => typeof e == "string", t = () => {
106
122
  output(e, t) {
107
123
  console?.[e]?.apply?.(console, t);
108
124
  }
109
- }, C = new class t {
125
+ }, j = new class e {
110
126
  constructor(e, t = {}) {
111
127
  this.init(e, t);
112
128
  }
113
129
  init(e, t = {}) {
114
- this.prefix = t.prefix || "i18next:", this.logger = e || S, this.options = t, this.debug = t.debug;
130
+ this.prefix = t.prefix || "i18next:", this.logger = e || te, this.options = t, this.debug = t.debug;
115
131
  }
116
132
  log(...e) {
117
133
  return this.forward(e, "log", "", !0);
@@ -125,19 +141,19 @@ var e = (e) => typeof e == "string", t = () => {
125
141
  deprecate(...e) {
126
142
  return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
127
143
  }
128
- forward(t, n, r, i) {
129
- return i && !this.debug ? null : (e(t[0]) && (t[0] = `${r}${this.prefix} ${t[0]}`), this.logger[n](t));
144
+ forward(e, t, n, r) {
145
+ return r && !this.debug ? null : (u(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
130
146
  }
131
- create(e) {
132
- return new t(this.logger, {
133
- prefix: `${this.prefix}:${e}:`,
147
+ create(t) {
148
+ return new e(this.logger, {
149
+ prefix: `${this.prefix}:${t}:`,
134
150
  ...this.options
135
151
  });
136
152
  }
137
- clone(e) {
138
- return e ||= this.options, e.prefix = e.prefix || this.prefix, new t(this.logger, e);
153
+ clone(t) {
154
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
139
155
  }
140
- }(), w = class {
156
+ }(), M = class {
141
157
  constructor() {
142
158
  this.observers = {};
143
159
  }
@@ -164,7 +180,7 @@ var e = (e) => typeof e == "string", t = () => {
164
180
  for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
165
181
  });
166
182
  }
167
- }, T = class extends w {
183
+ }, N = class extends M {
168
184
  constructor(e, t = {
169
185
  ns: ["translation"],
170
186
  defaultNS: "translation"
@@ -178,19 +194,19 @@ var e = (e) => typeof e == "string", t = () => {
178
194
  let t = this.options.ns.indexOf(e);
179
195
  t > -1 && this.options.ns.splice(t, 1);
180
196
  }
181
- getResource(t, n, r, i = {}) {
182
- let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = i.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : i.ignoreJSONStructure, s;
183
- t.indexOf(".") > -1 ? s = t.split(".") : (s = [t, n], r && (Array.isArray(r) ? s.push(...r) : e(r) && a ? s.push(...r.split(a)) : s.push(r)));
184
- let c = u(this.data, s);
185
- return !c && !n && !r && t.indexOf(".") > -1 && (t = s[0], n = s[1], r = s.slice(2).join(".")), c || !o || !e(r) ? c : b(this.data?.[t]?.[n], r, a);
197
+ getResource(e, t, n, r = {}) {
198
+ let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
199
+ e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : u(n) && i ? o.push(...n.split(i)) : o.push(n)));
200
+ let s = b(this.data, o);
201
+ return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !u(n) ? s : k(this.data?.[e]?.[t], n, i);
186
202
  }
187
203
  addResource(e, t, n, r, i = { silent: !1 }) {
188
204
  let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
189
- n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), c(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
205
+ n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), v(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
190
206
  }
191
- addResources(t, n, r, i = { silent: !1 }) {
192
- for (let i in r) (e(r[i]) || Array.isArray(r[i])) && this.addResource(t, n, i, r[i], { silent: !0 });
193
- i.silent || this.emit("added", t, n, r);
207
+ addResources(e, t, n, r = { silent: !1 }) {
208
+ for (let r in n) (u(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
209
+ r.silent || this.emit("added", e, t, n);
194
210
  }
195
211
  addResourceBundle(e, t, n, r, i, a = {
196
212
  silent: !1,
@@ -198,11 +214,11 @@ var e = (e) => typeof e == "string", t = () => {
198
214
  }) {
199
215
  let o = [e, t];
200
216
  e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
201
- let s = u(this.data, o) || {};
202
- a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? f(s, n, i) : s = {
217
+ let s = b(this.data, o) || {};
218
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? S(s, n, i) : s = {
203
219
  ...s,
204
220
  ...n
205
- }, c(this.data, o, s), a.silent || this.emit("added", e, t, n);
221
+ }, v(this.data, o, s), a.silent || this.emit("added", e, t, n);
206
222
  }
207
223
  removeResourceBundle(e, t) {
208
224
  this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
@@ -223,7 +239,7 @@ var e = (e) => typeof e == "string", t = () => {
223
239
  toJSON() {
224
240
  return this.data;
225
241
  }
226
- }, E = {
242
+ }, P = {
227
243
  processors: {},
228
244
  addPostProcessor(e) {
229
245
  this.processors[e.name] = e;
@@ -233,22 +249,22 @@ var e = (e) => typeof e == "string", t = () => {
233
249
  t = this.processors[e]?.process(t, n, r, i) ?? t;
234
250
  }), t;
235
251
  }
236
- }, D = Symbol("i18next/PATH_KEY");
237
- function O() {
252
+ }, F = Symbol("i18next/PATH_KEY");
253
+ function ne() {
238
254
  let e = [], t = Object.create(null), n;
239
- return t.get = (r, i) => (n?.revoke?.(), i === D ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
255
+ return t.get = (r, i) => (n?.revoke?.(), i === F ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
240
256
  }
241
- function k(e, t) {
242
- let { [D]: n } = e(O()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
257
+ function I(e, t) {
258
+ let { [F]: n } = e(ne()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
243
259
  if (n.length > 1 && i) {
244
260
  let e = t?.ns, a = Array.isArray(e) ? e : null;
245
261
  if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
246
262
  }
247
263
  return n.join(r);
248
264
  }
249
- var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M = class t extends w {
265
+ var L = {}, R = (e) => !u(e) && typeof e != "boolean" && typeof e != "number", z = class e extends M {
250
266
  constructor(e, t = {}) {
251
- super(), r([
267
+ super(), p([
252
268
  "resourceStore",
253
269
  "languageUtils",
254
270
  "pluralResolver",
@@ -256,7 +272,7 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
256
272
  "backendConnector",
257
273
  "i18nFormat",
258
274
  "utils"
259
- ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = C.create("translator");
275
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = j.create("translator");
260
276
  }
261
277
  changeLanguage(e) {
262
278
  e && (this.language = e);
@@ -266,193 +282,193 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
266
282
  if (e == null) return !1;
267
283
  let r = this.resolve(e, n);
268
284
  if (r?.res === void 0) return !1;
269
- let i = j(r.res);
285
+ let i = R(r.res);
270
286
  return !(n.returnObjects === !1 && i);
271
287
  }
272
- extractFromKey(t, n) {
273
- let r = n.nsSeparator === void 0 ? this.options.nsSeparator : n.nsSeparator;
274
- r === void 0 && (r = ":");
275
- let i = n.keySeparator === void 0 ? this.options.keySeparator : n.keySeparator, a = n.ns || this.options.defaultNS || [], o = r && t.indexOf(r) > -1, s = !this.options.userDefinedKeySeparator && !n.keySeparator && !this.options.userDefinedNsSeparator && !n.nsSeparator && !y(t, r, i);
276
- if (o && !s) {
277
- let n = t.match(this.interpolator.nestingRegexp);
278
- if (n && n.length > 0) return {
279
- key: t,
280
- namespaces: e(a) ? [a] : a
288
+ extractFromKey(e, t) {
289
+ let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
290
+ n === void 0 && (n = ":");
291
+ 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 && !O(e, n, r);
292
+ if (a && !o) {
293
+ let t = e.match(this.interpolator.nestingRegexp);
294
+ if (t && t.length > 0) return {
295
+ key: e,
296
+ namespaces: u(i) ? [i] : i
281
297
  };
282
- let o = t.split(r);
283
- (r !== i || r === i && this.options.ns.indexOf(o[0]) > -1) && (a = o.shift()), t = o.join(i);
298
+ let a = e.split(n);
299
+ (n !== r || n === r && this.options.ns.indexOf(a[0]) > -1) && (i = a.shift()), e = a.join(r);
284
300
  }
285
301
  return {
286
- key: t,
287
- namespaces: e(a) ? [a] : a
302
+ key: e,
303
+ namespaces: u(i) ? [i] : i
288
304
  };
289
305
  }
290
- translate(n, r, i) {
291
- let a = typeof r == "object" ? { ...r } : r;
292
- if (typeof a != "object" && this.options.overloadTranslationOptionHandler && (a = this.options.overloadTranslationOptionHandler(arguments)), typeof a == "object" && (a = { ...a }), a ||= {}, n == null) return "";
293
- typeof n == "function" && (n = k(n, {
306
+ translate(t, n, r) {
307
+ let i = typeof n == "object" ? { ...n } : n;
308
+ if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
309
+ typeof t == "function" && (t = I(t, {
294
310
  ...this.options,
295
- ...a
296
- })), Array.isArray(n) || (n = [String(n)]), n = n.map((e) => typeof e == "function" ? k(e, {
311
+ ...i
312
+ })), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? I(e, {
297
313
  ...this.options,
298
- ...a
314
+ ...i
299
315
  }) : String(e));
300
- let o = a.returnDetails === void 0 ? this.options.returnDetails : a.returnDetails, s = a.keySeparator === void 0 ? this.options.keySeparator : a.keySeparator, { key: c, namespaces: l } = this.extractFromKey(n[n.length - 1], a), u = l[l.length - 1], d = a.nsSeparator === void 0 ? this.options.nsSeparator : a.nsSeparator;
316
+ 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], d = i.nsSeparator === void 0 ? this.options.nsSeparator : i.nsSeparator;
301
317
  d === void 0 && (d = ":");
302
- let f = a.lng || this.language, p = a.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
303
- if (f?.toLowerCase() === "cimode") return p ? o ? {
304
- res: `${u}${d}${c}`,
305
- usedKey: c,
306
- exactUsedKey: c,
318
+ let f = i.lng || this.language, p = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
319
+ if (f?.toLowerCase() === "cimode") return p ? a ? {
320
+ res: `${l}${d}${s}`,
321
+ usedKey: s,
322
+ exactUsedKey: s,
307
323
  usedLng: f,
308
- usedNS: u,
309
- usedParams: this.getUsedParamsDetails(a)
310
- } : `${u}${d}${c}` : o ? {
311
- res: c,
312
- usedKey: c,
313
- exactUsedKey: c,
324
+ usedNS: l,
325
+ usedParams: this.getUsedParamsDetails(i)
326
+ } : `${l}${d}${s}` : a ? {
327
+ res: s,
328
+ usedKey: s,
329
+ exactUsedKey: s,
314
330
  usedLng: f,
315
- usedNS: u,
316
- usedParams: this.getUsedParamsDetails(a)
317
- } : c;
318
- let m = this.resolve(n, a), h = m?.res, g = m?.usedKey || c, _ = m?.exactUsedKey || c, v = [
331
+ usedNS: l,
332
+ usedParams: this.getUsedParamsDetails(i)
333
+ } : s;
334
+ let m = this.resolve(t, i), h = m?.res, g = m?.usedKey || s, _ = m?.exactUsedKey || s, v = [
319
335
  "[object Number]",
320
336
  "[object Function]",
321
337
  "[object RegExp]"
322
- ], y = a.joinArrays === void 0 ? this.options.joinArrays : a.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, x = a.count !== void 0 && !e(a.count), S = t.hasDefaultValue(a), C = x ? this.pluralResolver.getSuffix(f, a.count, a) : "", w = a.ordinal && x ? this.pluralResolver.getSuffix(f, a.count, { ordinal: !1 }) : "", T = x && !a.ordinal && a.count === 0, E = T && a[`defaultValue${this.options.pluralSeparator}zero`] || a[`defaultValue${C}`] || a[`defaultValue${w}`] || a.defaultValue, D = h;
338
+ ], y = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, x = i.count !== void 0 && !u(i.count), S = e.hasDefaultValue(i), C = x ? this.pluralResolver.getSuffix(f, i.count, i) : "", w = i.ordinal && x ? this.pluralResolver.getSuffix(f, i.count, { ordinal: !1 }) : "", T = x && !i.ordinal && i.count === 0, E = T && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${C}`] || i[`defaultValue${w}`] || i.defaultValue, D = h;
323
339
  b && !h && S && (D = E);
324
- let O = j(D), A = Object.prototype.toString.apply(D);
325
- if (b && D && O && v.indexOf(A) < 0 && !(e(y) && Array.isArray(D))) {
326
- if (!a.returnObjects && !this.options.returnObjects) {
340
+ let ee = R(D), O = Object.prototype.toString.apply(D);
341
+ if (b && D && ee && v.indexOf(O) < 0 && !(u(y) && Array.isArray(D))) {
342
+ if (!i.returnObjects && !this.options.returnObjects) {
327
343
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
328
344
  let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(g, D, {
329
- ...a,
330
- ns: l
331
- }) : `key '${c} (${this.language})' returned an object instead of string.`;
332
- return o ? (m.res = e, m.usedParams = this.getUsedParamsDetails(a), m) : e;
345
+ ...i,
346
+ ns: c
347
+ }) : `key '${s} (${this.language})' returned an object instead of string.`;
348
+ return a ? (m.res = e, m.usedParams = this.getUsedParamsDetails(i), m) : e;
333
349
  }
334
- if (s) {
350
+ if (o) {
335
351
  let e = Array.isArray(D), t = e ? [] : {}, n = e ? _ : g;
336
352
  for (let e in D) if (Object.prototype.hasOwnProperty.call(D, e)) {
337
- let r = `${n}${s}${e}`;
353
+ let r = `${n}${o}${e}`;
338
354
  S && !h ? t[e] = this.translate(r, {
339
- ...a,
340
- defaultValue: j(E) ? E[e] : void 0,
355
+ ...i,
356
+ defaultValue: R(E) ? E[e] : void 0,
341
357
  joinArrays: !1,
342
- ns: l
358
+ ns: c
343
359
  }) : t[e] = this.translate(r, {
344
- ...a,
360
+ ...i,
345
361
  joinArrays: !1,
346
- ns: l
362
+ ns: c
347
363
  }), t[e] === r && (t[e] = D[e]);
348
364
  }
349
365
  h = t;
350
366
  }
351
- } else if (b && e(y) && Array.isArray(h)) h = h.join(y), h &&= this.extendTranslation(h, n, a, i);
367
+ } else if (b && u(y) && Array.isArray(h)) h = h.join(y), h &&= this.extendTranslation(h, t, i, r);
352
368
  else {
353
- let e = !1, t = !1;
354
- !this.isValidLookup(h) && S && (e = !0, h = E), this.isValidLookup(h) || (t = !0, h = c);
355
- let r = (a.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && t ? void 0 : h, o = S && E !== h && this.options.updateMissing;
356
- if (t || e || o) {
357
- if (this.logger.log(o ? "updateKey" : "missingKey", f, u, c, o ? E : h), s) {
358
- let e = this.resolve(c, {
359
- ...a,
369
+ let e = !1, n = !1;
370
+ !this.isValidLookup(h) && S && (e = !0, h = E), this.isValidLookup(h) || (n = !0, h = s);
371
+ let a = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n ? void 0 : h, c = S && E !== h && this.options.updateMissing;
372
+ if (n || e || c) {
373
+ if (this.logger.log(c ? "updateKey" : "missingKey", f, l, s, c ? E : h), o) {
374
+ let e = this.resolve(s, {
375
+ ...i,
360
376
  keySeparator: !1
361
377
  });
362
378
  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.");
363
379
  }
364
- let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, a.lng || this.language);
380
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
365
381
  if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
366
- else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(a.lng || this.language) : e.push(a.lng || this.language);
382
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(i.lng || this.language) : e.push(i.lng || this.language);
367
383
  let n = (e, t, n) => {
368
- let i = S && n !== h ? n : r;
369
- this.options.missingKeyHandler ? this.options.missingKeyHandler(e, u, t, i, o, a) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, u, t, i, o, a), this.emit("missingKey", e, u, t, h);
384
+ let r = S && n !== h ? n : a;
385
+ 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, h);
370
386
  };
371
387
  this.options.saveMissing && (this.options.saveMissingPlurals && x ? e.forEach((e) => {
372
- let t = this.pluralResolver.getSuffixes(e, a);
373
- T && a[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
374
- n([e], c + t, a[`defaultValue${t}`] || E);
388
+ let t = this.pluralResolver.getSuffixes(e, i);
389
+ T && i[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
390
+ n([e], s + t, i[`defaultValue${t}`] || E);
375
391
  });
376
- }) : n(e, c, E));
392
+ }) : n(e, s, E));
377
393
  }
378
- h = this.extendTranslation(h, n, a, m, i), t && h === c && this.options.appendNamespaceToMissingKey && (h = `${u}${d}${c}`), (t || e) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}${d}${c}` : c, e ? h : void 0, a));
394
+ h = this.extendTranslation(h, t, i, m, r), n && h === s && this.options.appendNamespaceToMissingKey && (h = `${l}${d}${s}`), (n || e) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${d}${s}` : s, e ? h : void 0, i));
379
395
  }
380
- return o ? (m.res = h, m.usedParams = this.getUsedParamsDetails(a), m) : h;
396
+ return a ? (m.res = h, m.usedParams = this.getUsedParamsDetails(i), m) : h;
381
397
  }
382
- extendTranslation(t, n, r, i, a) {
383
- if (this.i18nFormat?.parse) t = this.i18nFormat.parse(t, {
398
+ extendTranslation(e, t, n, r, i) {
399
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
384
400
  ...this.options.interpolation.defaultVariables,
385
- ...r
386
- }, r.lng || this.language || i.usedLng, i.usedNS, i.usedKey, { resolved: i });
387
- else if (!r.skipInterpolation) {
388
- r.interpolation && this.interpolator.init({
389
- ...r,
401
+ ...n
402
+ }, n.lng || this.language || r.usedLng, r.usedNS, r.usedKey, { resolved: r });
403
+ else if (!n.skipInterpolation) {
404
+ n.interpolation && this.interpolator.init({
405
+ ...n,
390
406
  interpolation: {
391
407
  ...this.options.interpolation,
392
- ...r.interpolation
408
+ ...n.interpolation
393
409
  }
394
410
  });
395
- let o = e(t) && (r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables), s;
396
- if (o) {
397
- let e = t.match(this.interpolator.nestingRegexp);
398
- s = e && e.length;
411
+ let a = u(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
412
+ if (a) {
413
+ let t = e.match(this.interpolator.nestingRegexp);
414
+ o = t && t.length;
399
415
  }
400
- let c = r.replace && !e(r.replace) ? r.replace : r;
401
- if (this.options.interpolation.defaultVariables && (c = {
416
+ let s = n.replace && !u(n.replace) ? n.replace : n;
417
+ if (this.options.interpolation.defaultVariables && (s = {
402
418
  ...this.options.interpolation.defaultVariables,
403
- ...c
404
- }), t = this.interpolator.interpolate(t, c, r.lng || this.language || i.usedLng, r), o) {
405
- let e = t.match(this.interpolator.nestingRegexp), n = e && e.length;
406
- s < n && (r.nest = !1);
419
+ ...s
420
+ }), e = this.interpolator.interpolate(e, s, n.lng || this.language || r.usedLng, n), a) {
421
+ let t = e.match(this.interpolator.nestingRegexp), r = t && t.length;
422
+ o < r && (n.nest = !1);
407
423
  }
408
- !r.lng && i && i.res && (r.lng = this.language || i.usedLng), r.nest !== !1 && (t = this.interpolator.nest(t, (...e) => a?.[0] === e[0] && !r.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${n[0]}`), null) : this.translate(...e, n), r)), r.interpolation && this.interpolator.reset();
424
+ !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();
409
425
  }
410
- let o = r.postProcess || this.options.postProcess, s = e(o) ? [o] : o;
411
- return t != null && s?.length && r.applyPostProcessor !== !1 && (t = E.handle(s, t, n, this.options && this.options.postProcessPassResolved ? {
426
+ let a = n.postProcess || this.options.postProcess, o = u(a) ? [a] : a;
427
+ return e != null && o?.length && n.applyPostProcessor !== !1 && (e = P.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
412
428
  i18nResolved: {
413
- ...i,
414
- usedParams: this.getUsedParamsDetails(r)
429
+ ...r,
430
+ usedParams: this.getUsedParamsDetails(n)
415
431
  },
416
- ...r
417
- } : r, this)), t;
432
+ ...n
433
+ } : n, this)), e;
418
434
  }
419
- resolve(t, n = {}) {
420
- let r, i, a, o, s;
421
- return e(t) && (t = [t]), Array.isArray(t) && (t = t.map((e) => typeof e == "function" ? k(e, {
435
+ resolve(e, t = {}) {
436
+ let n, r, i, a, o;
437
+ return u(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? I(e, {
422
438
  ...this.options,
423
- ...n
424
- }) : e)), t.forEach((t) => {
425
- if (this.isValidLookup(r)) return;
426
- let c = this.extractFromKey(t, n), l = c.key;
427
- i = l;
428
- let u = c.namespaces;
429
- this.options.fallbackNS && (u = u.concat(this.options.fallbackNS));
430
- let d = n.count !== void 0 && !e(n.count), f = d && !n.ordinal && n.count === 0, p = n.context !== void 0 && (e(n.context) || typeof n.context == "number") && n.context !== "", m = n.lngs ? n.lngs : this.languageUtils.toResolveHierarchy(n.lng || this.language, n.fallbackLng);
431
- u.forEach((e) => {
432
- this.isValidLookup(r) || (s = e, !A[`${m[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(s) && (A[`${m[0]}-${e}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), m.forEach((t) => {
433
- if (this.isValidLookup(r)) return;
434
- o = t;
435
- let i = [l];
436
- if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(i, l, t, e, n);
439
+ ...t
440
+ }) : e)), e.forEach((e) => {
441
+ if (this.isValidLookup(n)) return;
442
+ let s = this.extractFromKey(e, t), c = s.key;
443
+ r = c;
444
+ let l = s.namespaces;
445
+ this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
446
+ let d = t.count !== void 0 && !u(t.count), f = d && !t.ordinal && t.count === 0, p = t.context !== void 0 && (u(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
447
+ l.forEach((e) => {
448
+ this.isValidLookup(n) || (o = e, !L[`${m[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (L[`${m[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${m.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!!!")), m.forEach((r) => {
449
+ if (this.isValidLookup(n)) return;
450
+ a = r;
451
+ let o = [c];
452
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o, c, r, e, t);
437
453
  else {
438
454
  let e;
439
- d && (e = this.pluralResolver.getSuffix(t, n.count, n));
440
- let r = `${this.options.pluralSeparator}zero`, a = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
441
- if (d && (n.ordinal && e.indexOf(a) === 0 && i.push(l + e.replace(a, this.options.pluralSeparator)), i.push(l + e), f && i.push(l + r)), p) {
442
- let t = `${l}${this.options.contextSeparator || "_"}${n.context}`;
443
- i.push(t), d && (n.ordinal && e.indexOf(a) === 0 && i.push(t + e.replace(a, this.options.pluralSeparator)), i.push(t + e), f && i.push(t + r));
455
+ d && (e = this.pluralResolver.getSuffix(r, t.count, t));
456
+ let n = `${this.options.pluralSeparator}zero`, i = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
457
+ if (d && (t.ordinal && e.indexOf(i) === 0 && o.push(c + e.replace(i, this.options.pluralSeparator)), o.push(c + e), f && o.push(c + n)), p) {
458
+ let r = `${c}${this.options.contextSeparator || "_"}${t.context}`;
459
+ o.push(r), d && (t.ordinal && e.indexOf(i) === 0 && o.push(r + e.replace(i, this.options.pluralSeparator)), o.push(r + e), f && o.push(r + n));
444
460
  }
445
461
  }
446
462
  let s;
447
- for (; s = i.pop();) this.isValidLookup(r) || (a = s, r = this.getResource(t, e, s, n));
463
+ for (; s = o.pop();) this.isValidLookup(n) || (i = s, n = this.getResource(r, e, s, t));
448
464
  }));
449
465
  });
450
466
  }), {
451
- res: r,
452
- usedKey: i,
453
- exactUsedKey: a,
454
- usedLng: o,
455
- usedNS: s
467
+ res: n,
468
+ usedKey: r,
469
+ exactUsedKey: i,
470
+ usedLng: a,
471
+ usedNS: o
456
472
  };
457
473
  }
458
474
  isValidLookup(e) {
@@ -461,8 +477,8 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
461
477
  getResource(e, t, n, r = {}) {
462
478
  return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
463
479
  }
464
- getUsedParamsDetails(t = {}) {
465
- let n = [
480
+ getUsedParamsDetails(e = {}) {
481
+ let t = [
466
482
  "defaultValue",
467
483
  "ordinal",
468
484
  "context",
@@ -478,43 +494,43 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
478
494
  "joinArrays",
479
495
  "postProcess",
480
496
  "interpolation"
481
- ], r = t.replace && !e(t.replace), i = r ? t.replace : t;
482
- if (r && t.count !== void 0 && (i.count = t.count), this.options.interpolation.defaultVariables && (i = {
497
+ ], n = e.replace && !u(e.replace), r = n ? e.replace : e;
498
+ if (n && e.count !== void 0 && (r.count = e.count), this.options.interpolation.defaultVariables && (r = {
483
499
  ...this.options.interpolation.defaultVariables,
484
- ...i
485
- }), !r) {
486
- i = { ...i };
487
- for (let e of n) delete i[e];
500
+ ...r
501
+ }), !n) {
502
+ r = { ...r };
503
+ for (let e of t) delete r[e];
488
504
  }
489
- return i;
505
+ return r;
490
506
  }
491
507
  static hasDefaultValue(e) {
492
508
  for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
493
509
  return !1;
494
510
  }
495
- }, N = class {
511
+ }, B = class {
496
512
  constructor(e) {
497
- this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = C.create("languageUtils");
513
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = j.create("languageUtils");
498
514
  }
499
515
  getScriptPartFromCode(e) {
500
- if (e = x(e), !e || e.indexOf("-") < 0) return null;
516
+ if (e = A(e), !e || e.indexOf("-") < 0) return null;
501
517
  let t = e.split("-");
502
518
  return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
503
519
  }
504
520
  getLanguagePartFromCode(e) {
505
- if (e = x(e), !e || e.indexOf("-") < 0) return e;
521
+ if (e = A(e), !e || e.indexOf("-") < 0) return e;
506
522
  let t = e.split("-");
507
523
  return this.formatLanguageCode(t[0]);
508
524
  }
509
- formatLanguageCode(t) {
510
- if (e(t) && t.indexOf("-") > -1) {
511
- let e;
525
+ formatLanguageCode(e) {
526
+ if (u(e) && e.indexOf("-") > -1) {
527
+ let t;
512
528
  try {
513
- e = Intl.getCanonicalLocales(t)[0];
529
+ t = Intl.getCanonicalLocales(e)[0];
514
530
  } catch {}
515
- return e && this.options.lowerCaseLng && (e = e.toLowerCase()), e || (this.options.lowerCaseLng ? t.toLowerCase() : t);
531
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
516
532
  }
517
- return this.options.cleanCode || this.options.lowerCaseLng ? t.toLowerCase() : t;
533
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
518
534
  }
519
535
  isSupportedCode(e) {
520
536
  return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
@@ -537,40 +553,40 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
537
553
  });
538
554
  }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
539
555
  }
540
- getFallbackCodes(t, n) {
541
- if (!t) return [];
542
- if (typeof t == "function" && (t = t(n)), e(t) && (t = [t]), Array.isArray(t)) return t;
543
- if (!n) return t.default || [];
544
- let r = t[n];
545
- return r ||= t[this.getScriptPartFromCode(n)], r ||= t[this.formatLanguageCode(n)], r ||= t[this.getLanguagePartFromCode(n)], r ||= t.default, r || [];
556
+ getFallbackCodes(e, t) {
557
+ if (!e) return [];
558
+ if (typeof e == "function" && (e = e(t)), u(e) && (e = [e]), Array.isArray(e)) return e;
559
+ if (!t) return e.default || [];
560
+ let n = e[t];
561
+ return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
546
562
  }
547
- toResolveHierarchy(t, n) {
548
- let r = this.getFallbackCodes((n === !1 ? [] : n) || this.options.fallbackLng || [], t), i = [], a = (e) => {
549
- e && (this.isSupportedCode(e) ? i.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
563
+ toResolveHierarchy(e, t) {
564
+ let n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), r = [], i = (e) => {
565
+ e && (this.isSupportedCode(e) ? r.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
550
566
  };
551
- return e(t) && (t.indexOf("-") > -1 || t.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(t)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(t)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(t))) : e(t) && a(this.formatLanguageCode(t)), r.forEach((e) => {
552
- i.indexOf(e) < 0 && a(this.formatLanguageCode(e));
553
- }), i;
567
+ return u(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))) : u(e) && i(this.formatLanguageCode(e)), n.forEach((e) => {
568
+ r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
569
+ }), r;
554
570
  }
555
- }, P = {
571
+ }, V = {
556
572
  zero: 0,
557
573
  one: 1,
558
574
  two: 2,
559
575
  few: 3,
560
576
  many: 4,
561
577
  other: 5
562
- }, F = {
578
+ }, H = {
563
579
  select: (e) => e === 1 ? "one" : "other",
564
580
  resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
565
- }, ee = class {
581
+ }, re = class {
566
582
  constructor(e, t = {}) {
567
- this.languageUtils = e, this.options = t, this.logger = C.create("pluralResolver"), this.pluralRulesCache = {};
583
+ this.languageUtils = e, this.options = t, this.logger = j.create("pluralResolver"), this.pluralRulesCache = {};
568
584
  }
569
585
  clearCache() {
570
586
  this.pluralRulesCache = {};
571
587
  }
572
588
  getRule(e, t = {}) {
573
- let n = x(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
589
+ let n = A(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
574
590
  cleanedCode: n,
575
591
  type: r
576
592
  });
@@ -579,8 +595,8 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
579
595
  try {
580
596
  a = new Intl.PluralRules(n, { type: r });
581
597
  } catch {
582
- if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), F;
583
- if (!e.match(/-|_/)) return F;
598
+ if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), H;
599
+ if (!e.match(/-|_/)) return H;
584
600
  let n = this.languageUtils.getLanguagePartFromCode(e);
585
601
  a = this.getRule(n, t);
586
602
  }
@@ -595,23 +611,23 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
595
611
  }
596
612
  getSuffixes(e, t = {}) {
597
613
  let n = this.getRule(e, t);
598
- return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => P[e] - P[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
614
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => V[e] - V[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
599
615
  }
600
616
  getSuffix(e, t, n = {}) {
601
617
  let r = this.getRule(e, n);
602
618
  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));
603
619
  }
604
- }, I = (t, n, r, i = ".", a = !0) => {
605
- let o = d(t, n, r);
606
- return !o && a && e(r) && (o = b(t, r, i), o === void 0 && (o = b(n, r, i))), o;
607
- }, L = (e) => e.replace(/\$/g, "$$$$"), R = class {
620
+ }, U = (e, t, n, r = ".", i = !0) => {
621
+ let a = x(e, t, n);
622
+ return !a && i && u(n) && (a = k(e, n, r), a === void 0 && (a = k(t, n, r))), a;
623
+ }, W = (e) => e.replace(/\$/g, "$$$$"), G = class {
608
624
  constructor(e = {}) {
609
- this.logger = C.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
625
+ this.logger = j.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
610
626
  }
611
627
  init(e = {}) {
612
628
  e.interpolation ||= { escapeValue: !0 };
613
- 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: m, nestingSuffixEscaped: g, nestingOptionsSeparator: _, maxReplaces: v, alwaysFormat: y } = e.interpolation;
614
- this.escape = t === void 0 ? h : t, this.escapeValue = n === void 0 ? !0 : n, this.useRawValueToEscape = r === void 0 ? !1 : r, this.prefix = i ? p(i) : a || "{{", this.suffix = o ? p(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? p(d) : f || p("$t("), this.nestingSuffix = m ? p(m) : g || p(")"), this.nestingOptionsSeparator = _ || ",", this.maxReplaces = v || 1e3, this.alwaysFormat = y === void 0 ? !1 : y, this.resetRegExp();
629
+ 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;
630
+ this.escape = t === void 0 ? T : t, this.escapeValue = n === void 0 ? !0 : n, this.useRawValueToEscape = r === void 0 ? !1 : r, this.prefix = i ? C(i) : a || "{{", this.suffix = o ? C(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? C(d) : f || C("$t("), this.nestingSuffix = p ? C(p) : m || C(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ === void 0 ? !1 : _, this.resetRegExp();
615
631
  }
616
632
  reset() {
617
633
  this.options && this.init(this.options);
@@ -620,79 +636,79 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
620
636
  let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
621
637
  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}`);
622
638
  }
623
- interpolate(t, r, i, a) {
624
- let o, s, c, l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (e) => {
639
+ interpolate(e, t, n, r) {
640
+ let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
625
641
  if (e.indexOf(this.formatSeparator) < 0) {
626
- let t = I(r, l, e, this.options.keySeparator, this.options.ignoreJSONStructure);
627
- return this.alwaysFormat ? this.format(t, void 0, i, {
628
- ...a,
642
+ let i = U(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
643
+ return this.alwaysFormat ? this.format(i, void 0, n, {
629
644
  ...r,
645
+ ...t,
630
646
  interpolationkey: e
631
- }) : t;
647
+ }) : i;
632
648
  }
633
- let t = e.split(this.formatSeparator), n = t.shift().trim(), o = t.join(this.formatSeparator).trim();
634
- return this.format(I(r, l, n, this.options.keySeparator, this.options.ignoreJSONStructure), o, i, {
635
- ...a,
649
+ let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
650
+ return this.format(U(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
636
651
  ...r,
637
- interpolationkey: n
652
+ ...t,
653
+ interpolationkey: a
638
654
  });
639
655
  };
640
656
  this.resetRegExp();
641
- let d = a?.missingInterpolationHandler || this.options.missingInterpolationHandler, f = a?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : a.interpolation.skipOnVariables;
657
+ let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, d = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
642
658
  return [{
643
659
  regex: this.regexpUnescape,
644
- safeValue: (e) => L(e)
660
+ safeValue: (e) => W(e)
645
661
  }, {
646
662
  regex: this.regexp,
647
- safeValue: (e) => this.escapeValue ? L(this.escape(e)) : L(e)
648
- }].forEach((r) => {
649
- for (c = 0; o = r.regex.exec(t);) {
650
- let i = o[1].trim();
651
- if (s = u(i), s === void 0) if (typeof d == "function") {
652
- let n = d(t, o, a);
653
- s = e(n) ? n : "";
654
- } else if (a && Object.prototype.hasOwnProperty.call(a, i)) s = "";
655
- else if (f) {
656
- s = o[0];
663
+ safeValue: (e) => this.escapeValue ? W(this.escape(e)) : W(e)
664
+ }].forEach((t) => {
665
+ for (o = 0; i = t.regex.exec(e);) {
666
+ let n = i[1].trim();
667
+ if (a = c(n), a === void 0) if (typeof l == "function") {
668
+ let t = l(e, i, r);
669
+ a = u(t) ? t : "";
670
+ } else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
671
+ else if (d) {
672
+ a = i[0];
657
673
  continue;
658
- } else this.logger.warn(`missed to pass in variable ${i} for interpolating ${t}`), s = "";
659
- else !e(s) && !this.useRawValueToEscape && (s = n(s));
660
- let l = r.safeValue(s);
661
- if (t = t.replace(o[0], l), f ? (r.regex.lastIndex += s.length, r.regex.lastIndex -= o[0].length) : r.regex.lastIndex = 0, c++, c >= this.maxReplaces) break;
674
+ } else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
675
+ else !u(a) && !this.useRawValueToEscape && (a = f(a));
676
+ let s = t.safeValue(a);
677
+ if (e = e.replace(i[0], s), d ? (t.regex.lastIndex += a.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
662
678
  }
663
- }), t;
679
+ }), e;
664
680
  }
665
- nest(t, r, i = {}) {
666
- let a, o, s, c = (e, t) => {
681
+ nest(e, t, n = {}) {
682
+ let r, i, a, o = (e, t) => {
667
683
  let n = this.nestingOptionsSeparator;
668
684
  if (e.indexOf(n) < 0) return e;
669
- let r = e.split(RegExp(`${p(n)}[ ]*{`)), i = `{${r[1]}`;
670
- e = r[0], i = this.interpolate(i, s);
671
- let a = i.match(/'/g), o = i.match(/"/g);
672
- ((a?.length ?? 0) % 2 == 0 && !o || (o?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
685
+ let r = e.split(RegExp(`${C(n)}[ ]*{`)), i = `{${r[1]}`;
686
+ e = r[0], i = this.interpolate(i, a);
687
+ let o = i.match(/'/g), s = i.match(/"/g);
688
+ ((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
673
689
  try {
674
- s = JSON.parse(i), t && (s = {
690
+ a = JSON.parse(i), t && (a = {
675
691
  ...t,
676
- ...s
692
+ ...a
677
693
  });
678
694
  } catch (t) {
679
695
  return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
680
696
  }
681
- return s.defaultValue && s.defaultValue.indexOf(this.prefix) > -1 && delete s.defaultValue, e;
697
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, e;
682
698
  };
683
- for (; a = this.nestingRegexp.exec(t);) {
684
- let l = [];
685
- s = { ...i }, s = s.replace && !e(s.replace) ? s.replace : s, s.applyPostProcessor = !1, delete s.defaultValue;
686
- let u = /{.*}/.test(a[1]) ? a[1].lastIndexOf("}") + 1 : a[1].indexOf(this.formatSeparator);
687
- if (u !== -1 && (l = a[1].slice(u).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), a[1] = a[1].slice(0, u)), o = r(c.call(this, a[1].trim(), s), s), o && a[0] === t && !e(o)) return o;
688
- e(o) || (o = n(o)), o ||= (this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`), ""), l.length && (o = l.reduce((e, t) => this.format(e, t, i.lng, {
689
- ...i,
690
- interpolationkey: a[1].trim()
691
- }), o.trim())), t = t.replace(a[0], o), this.regexp.lastIndex = 0;
699
+ for (; r = this.nestingRegexp.exec(e);) {
700
+ let s = [];
701
+ a = { ...n }, a = a.replace && !u(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
702
+ let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
703
+ 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 && !u(i)) return i;
704
+ u(i) || (i = f(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, {
705
+ ...n,
706
+ interpolationkey: r[1].trim()
707
+ }), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
692
708
  }
693
- return t;
709
+ return e;
694
710
  }
695
- }, te = (e) => {
711
+ }, ie = (e) => {
696
712
  let t = e.toLowerCase().trim(), n = {};
697
713
  if (e.indexOf("(") > -1) {
698
714
  let r = e.split("(");
@@ -709,7 +725,7 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
709
725
  formatName: t,
710
726
  formatOptions: n
711
727
  };
712
- }, z = (e) => {
728
+ }, K = (e) => {
713
729
  let t = {};
714
730
  return (n, r, i) => {
715
731
  let a = i;
@@ -718,15 +734,15 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
718
734
  [i.interpolationkey]: void 0
719
735
  });
720
736
  let o = r + JSON.stringify(a), s = t[o];
721
- return s || (s = e(x(r), i), t[o] = s), s(n);
737
+ return s || (s = e(A(r), i), t[o] = s), s(n);
722
738
  };
723
- }, ne = (e) => (t, n, r) => e(x(n), r)(t), re = class {
739
+ }, ae = (e) => (t, n, r) => e(A(n), r)(t), oe = class {
724
740
  constructor(e = {}) {
725
- this.logger = C.create("formatter"), this.options = e, this.init(e);
741
+ this.logger = j.create("formatter"), this.options = e, this.init(e);
726
742
  }
727
743
  init(e, t = { interpolation: {} }) {
728
744
  this.formatSeparator = t.interpolation.formatSeparator || ",";
729
- let n = t.cacheInBuiltFormats ? z : ne;
745
+ let n = t.cacheInBuiltFormats ? K : ae;
730
746
  this.formats = {
731
747
  number: n((e, t) => {
732
748
  let n = new Intl.NumberFormat(e, { ...t });
@@ -757,7 +773,7 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
757
773
  this.formats[e.toLowerCase().trim()] = t;
758
774
  }
759
775
  addCached(e, t) {
760
- this.formats[e.toLowerCase().trim()] = z(t);
776
+ this.formats[e.toLowerCase().trim()] = K(t);
761
777
  }
762
778
  format(e, t, n, r = {}) {
763
779
  let i = t.split(this.formatSeparator);
@@ -766,7 +782,7 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
766
782
  i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
767
783
  }
768
784
  return i.reduce((e, t) => {
769
- let { formatName: i, formatOptions: a } = te(t);
785
+ let { formatName: i, formatOptions: a } = ie(t);
770
786
  if (this.formats[i]) {
771
787
  let t = e;
772
788
  try {
@@ -784,11 +800,11 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
784
800
  return e;
785
801
  }, e);
786
802
  }
787
- }, B = (e, t) => {
803
+ }, se = (e, t) => {
788
804
  e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
789
- }, ie = class extends w {
805
+ }, ce = class extends M {
790
806
  constructor(e, t, n, r = {}) {
791
- super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = C.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);
807
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = j.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);
792
808
  }
793
809
  queueLoad(e, t, n, r) {
794
810
  let i = {}, a = {}, o = {}, s = {};
@@ -816,7 +832,7 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
816
832
  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);
817
833
  let o = {};
818
834
  this.queue.forEach((n) => {
819
- l(n.loaded, [i], a), B(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
835
+ y(n.loaded, [i], a), se(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
820
836
  o[e] || (o[e] = {});
821
837
  let t = n.loaded[e];
822
838
  t.length && t.forEach((t) => {
@@ -863,12 +879,12 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
863
879
  }
864
880
  return s(e, t, o);
865
881
  }
866
- prepareLoading(t, n, r = {}, i) {
867
- if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
868
- e(t) && (t = this.languageUtils.toResolveHierarchy(t)), e(n) && (n = [n]);
869
- let a = this.queueLoad(t, n, r, i);
870
- if (!a.toLoad.length) return a.pending.length || i(), null;
871
- a.toLoad.forEach((e) => {
882
+ prepareLoading(e, t, n = {}, r) {
883
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
884
+ u(e) && (e = this.languageUtils.toResolveHierarchy(e)), u(t) && (t = [t]);
885
+ let i = this.queueLoad(e, t, n, r);
886
+ if (!i.toLoad.length) return i.pending.length || r(), null;
887
+ i.toLoad.forEach((e) => {
872
888
  this.loadOne(e);
873
889
  });
874
890
  }
@@ -906,7 +922,7 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
906
922
  !e || !e[0] || this.store.addResource(e[0], t, n, r);
907
923
  }
908
924
  }
909
- }, V = () => ({
925
+ }, q = () => ({
910
926
  debug: !1,
911
927
  initAsync: !0,
912
928
  ns: ["translation"],
@@ -939,15 +955,15 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
939
955
  parseMissingKeyHandler: !1,
940
956
  appendNamespaceToMissingKey: !1,
941
957
  appendNamespaceToCIMode: !1,
942
- overloadTranslationOptionHandler: (t) => {
943
- let n = {};
944
- if (typeof t[1] == "object" && (n = t[1]), e(t[1]) && (n.defaultValue = t[1]), e(t[2]) && (n.tDescription = t[2]), typeof t[2] == "object" || typeof t[3] == "object") {
945
- let e = t[3] || t[2];
946
- Object.keys(e).forEach((t) => {
947
- n[t] = e[t];
958
+ overloadTranslationOptionHandler: (e) => {
959
+ let t = {};
960
+ if (typeof e[1] == "object" && (t = e[1]), u(e[1]) && (t.defaultValue = e[1]), u(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
961
+ let n = e[3] || e[2];
962
+ Object.keys(n).forEach((e) => {
963
+ t[e] = n[e];
948
964
  });
949
965
  }
950
- return n;
966
+ return t;
951
967
  },
952
968
  interpolation: {
953
969
  escapeValue: !0,
@@ -963,52 +979,52 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
963
979
  skipOnVariables: !0
964
980
  },
965
981
  cacheInBuiltFormats: !0
966
- }), H = (t) => (e(t.ns) && (t.ns = [t.ns]), e(t.fallbackLng) && (t.fallbackLng = [t.fallbackLng]), e(t.fallbackNS) && (t.fallbackNS = [t.fallbackNS]), t.supportedLngs?.indexOf?.("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])), typeof t.initImmediate == "boolean" && (t.initAsync = t.initImmediate), t), U = () => {}, ae = (e) => {
982
+ }), J = (e) => (u(e.ns) && (e.ns = [e.ns]), u(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), u(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), Y = () => {}, le = (e) => {
967
983
  Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
968
984
  typeof e[t] == "function" && (e[t] = e[t].bind(e));
969
985
  });
970
- }, W = "__i18next_supportNoticeShown", G = () => !!(typeof globalThis < "u" && globalThis[W] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env && process.env.NODE_ENV === "production"), K = () => {
971
- typeof globalThis < "u" && (globalThis[W] = !0);
972
- }, q = (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)), J = class n extends w {
986
+ }, X = "__i18next_supportNoticeShown", ue = () => !!(typeof globalThis < "u" && globalThis[X] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env && process.env.NODE_ENV === "production"), de = () => {
987
+ typeof globalThis < "u" && (globalThis[X] = !0);
988
+ }, fe = (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)), Z = class e extends M {
973
989
  constructor(e = {}, t) {
974
- if (super(), this.options = H(e), this.services = {}, this.logger = C, this.modules = { external: [] }, ae(this), t && !this.isInitialized && !e.isClone) {
990
+ if (super(), this.options = J(e), this.services = {}, this.logger = j, this.modules = { external: [] }, le(this), t && !this.isInitialized && !e.isClone) {
975
991
  if (!this.options.initAsync) return this.init(e, t), this;
976
992
  setTimeout(() => {
977
993
  this.init(e, t);
978
994
  }, 0);
979
995
  }
980
996
  }
981
- init(n = {}, r) {
982
- this.isInitializing = !0, typeof n == "function" && (r = n, n = {}), n.defaultNS == null && n.ns && (e(n.ns) ? n.defaultNS = n.ns : n.ns.indexOf("translation") < 0 && (n.defaultNS = n.ns[0]));
983
- let i = V();
997
+ init(e = {}, t) {
998
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (u(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
999
+ let n = q();
984
1000
  this.options = {
985
- ...i,
1001
+ ...n,
986
1002
  ...this.options,
987
- ...H(n)
1003
+ ...J(e)
988
1004
  }, this.options.interpolation = {
989
- ...i.interpolation,
1005
+ ...n.interpolation,
990
1006
  ...this.options.interpolation
991
- }, n.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = n.keySeparator), n.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = n.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = i.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !q(this) && !G() && (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 💙"), K());
992
- let a = (e) => e ? typeof e == "function" ? new e() : e : null;
1007
+ }, 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 && !fe(this) && !ue() && (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 💙"), de());
1008
+ let r = (e) => e ? typeof e == "function" ? new e() : e : null;
993
1009
  if (!this.options.isClone) {
994
- this.modules.logger ? C.init(a(this.modules.logger), this.options) : C.init(null, this.options);
1010
+ this.modules.logger ? j.init(r(this.modules.logger), this.options) : j.init(null, this.options);
995
1011
  let e;
996
- e = this.modules.formatter ? this.modules.formatter : re;
997
- let t = new N(this.options);
998
- this.store = new T(this.options.resources, this.options);
999
- let n = this.services;
1000
- n.logger = C, n.resourceStore = this.store, n.languageUtils = t, n.pluralResolver = new ee(t, {
1012
+ e = this.modules.formatter ? this.modules.formatter : oe;
1013
+ let t = new B(this.options);
1014
+ this.store = new N(this.options.resources, this.options);
1015
+ let i = this.services;
1016
+ i.logger = j, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new re(t, {
1001
1017
  prepend: this.options.pluralSeparator,
1002
1018
  simplifyPluralSuffix: this.options.simplifyPluralSuffix
1003
- }), this.options.interpolation.format && this.options.interpolation.format !== i.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), e && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (n.formatter = a(e), n.formatter.init && n.formatter.init(n, this.options), this.options.interpolation.format = n.formatter.format.bind(n.formatter)), n.interpolator = new R(this.options), n.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n.backendConnector = new ie(a(this.modules.backend), n.resourceStore, n, this.options), n.backendConnector.on("*", (e, ...t) => {
1019
+ }), 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 G(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new ce(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
1004
1020
  this.emit(e, ...t);
1005
- }), this.modules.languageDetector && (n.languageDetector = a(this.modules.languageDetector), n.languageDetector.init && n.languageDetector.init(n, this.options.detection, this.options)), this.modules.i18nFormat && (n.i18nFormat = a(this.modules.i18nFormat), n.i18nFormat.init && n.i18nFormat.init(this)), this.translator = new M(this.services, this.options), this.translator.on("*", (e, ...t) => {
1021
+ }), 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 z(this.services, this.options), this.translator.on("*", (e, ...t) => {
1006
1022
  this.emit(e, ...t);
1007
1023
  }), this.modules.external.forEach((e) => {
1008
1024
  e.init && e.init(this);
1009
1025
  });
1010
1026
  }
1011
- if (this.format = this.options.interpolation.format, r ||= U, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1027
+ if (this.format = this.options.interpolation.format, t ||= Y, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1012
1028
  let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1013
1029
  e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1014
1030
  }
@@ -1027,39 +1043,39 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
1027
1043
  ].forEach((e) => {
1028
1044
  this[e] = (...t) => (this.store[e](...t), this);
1029
1045
  });
1030
- let o = t(), s = () => {
1031
- let e = (e, t) => {
1032
- this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), o.resolve(t), r(e, t);
1046
+ let i = d(), a = () => {
1047
+ let e = (e, n) => {
1048
+ 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);
1033
1049
  };
1034
1050
  if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1035
1051
  this.changeLanguage(this.options.lng, e);
1036
1052
  };
1037
- return this.options.resources || !this.options.initAsync ? s() : setTimeout(s, 0), o;
1053
+ return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
1038
1054
  }
1039
- loadResources(t, n = U) {
1040
- let r = n, i = e(t) ? t : this.language;
1041
- if (typeof t == "function" && (r = t), !this.options.resources || this.options.partialBundledLanguages) {
1042
- if (i?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return r();
1055
+ loadResources(e, t = Y) {
1056
+ let n = t, r = u(e) ? e : this.language;
1057
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1058
+ if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1043
1059
  let e = [], t = (t) => {
1044
1060
  t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1045
1061
  t !== "cimode" && e.indexOf(t) < 0 && e.push(t);
1046
1062
  });
1047
1063
  };
1048
- i ? t(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => t(e)), this.options.preload?.forEach?.((e) => t(e)), this.services.backendConnector.load(e, this.options.ns, (e) => {
1049
- !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), r(e);
1064
+ 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) => {
1065
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(e);
1050
1066
  });
1051
- } else r(null);
1067
+ } else n(null);
1052
1068
  }
1053
- reloadResources(e, n, r) {
1054
- let i = t();
1055
- return typeof e == "function" && (r = e, e = void 0), typeof n == "function" && (r = n, n = void 0), e ||= this.languages, n ||= this.options.ns, r ||= U, this.services.backendConnector.reload(e, n, (e) => {
1056
- i.resolve(), r(e);
1057
- }), i;
1069
+ reloadResources(e, t, n) {
1070
+ let r = d();
1071
+ 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 ||= Y, this.services.backendConnector.reload(e, t, (e) => {
1072
+ r.resolve(), n(e);
1073
+ }), r;
1058
1074
  }
1059
1075
  use(e) {
1060
1076
  if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1061
1077
  if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1062
- 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" && E.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1078
+ 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" && P.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1063
1079
  }
1064
1080
  setResolvedLanguage(e) {
1065
1081
  if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
@@ -1073,36 +1089,36 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
1073
1089
  !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1074
1090
  }
1075
1091
  }
1076
- changeLanguage(n, r) {
1077
- this.isLanguageChangingTo = n;
1078
- let i = t();
1079
- this.emit("languageChanging", n);
1080
- let a = (e) => {
1092
+ changeLanguage(e, t) {
1093
+ this.isLanguageChangingTo = e;
1094
+ let n = d();
1095
+ this.emit("languageChanging", e);
1096
+ let r = (e) => {
1081
1097
  this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1082
- }, o = (e, t) => {
1083
- t ? this.isLanguageChangingTo === n && (a(t), this.translator.changeLanguage(t), this.isLanguageChangingTo = void 0, this.emit("languageChanged", t), this.logger.log("languageChanged", t)) : this.isLanguageChangingTo = void 0, i.resolve((...e) => this.t(...e)), r && r(e, (...e) => this.t(...e));
1084
- }, s = (t) => {
1085
- !n && !t && this.services.languageDetector && (t = []);
1086
- let r = e(t) ? t : t && t[0], i = this.store.hasLanguageSomeTranslations(r) ? r : this.services.languageUtils.getBestMatchFromCodes(e(t) ? [t] : t);
1087
- i && (this.language || a(i), this.translator.language || this.translator.changeLanguage(i), this.services.languageDetector?.cacheUserLanguage?.(i)), this.loadResources(i, (e) => {
1088
- o(e, i);
1098
+ }, i = (i, a) => {
1099
+ 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));
1100
+ }, a = (t) => {
1101
+ !e && !t && this.services.languageDetector && (t = []);
1102
+ let n = u(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(u(t) ? [t] : t);
1103
+ a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
1104
+ i(e, a);
1089
1105
  });
1090
1106
  };
1091
- return !n && this.services.languageDetector && !this.services.languageDetector.async ? s(this.services.languageDetector.detect()) : !n && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(s) : this.services.languageDetector.detect(s) : s(n), i;
1107
+ 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;
1092
1108
  }
1093
- getFixedT(t, n, r) {
1094
- let i = (e, t, ...n) => {
1109
+ getFixedT(e, t, n) {
1110
+ let r = (e, t, ...i) => {
1095
1111
  let a;
1096
- a = typeof t == "object" ? { ...t } : this.options.overloadTranslationOptionHandler([e, t].concat(n)), a.lng = a.lng || i.lng, a.lngs = a.lngs || i.lngs, a.ns = a.ns || i.ns, a.keyPrefix !== "" && (a.keyPrefix = a.keyPrefix || r || i.keyPrefix);
1112
+ 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);
1097
1113
  let o = {
1098
1114
  ...this.options,
1099
1115
  ...a
1100
1116
  };
1101
- typeof a.keyPrefix == "function" && (a.keyPrefix = k(a.keyPrefix, o));
1117
+ typeof a.keyPrefix == "function" && (a.keyPrefix = I(a.keyPrefix, o));
1102
1118
  let s = this.options.keySeparator || ".", c;
1103
- return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = k(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = k(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1119
+ return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = I(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = I(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1104
1120
  };
1105
- return e(t) ? i.lng = t : i.lngs = t, i.ns = n, i.keyPrefix = r, i;
1121
+ return u(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
1106
1122
  }
1107
1123
  t(...e) {
1108
1124
  return this.translator?.translate(...e);
@@ -1128,21 +1144,21 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
1128
1144
  }
1129
1145
  return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1130
1146
  }
1131
- loadNamespaces(n, r) {
1132
- let i = t();
1133
- return this.options.ns ? (e(n) && (n = [n]), n.forEach((e) => {
1147
+ loadNamespaces(e, t) {
1148
+ let n = d();
1149
+ return this.options.ns ? (u(e) && (e = [e]), e.forEach((e) => {
1134
1150
  this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
1135
1151
  }), this.loadResources((e) => {
1136
- i.resolve(), r && r(e);
1137
- }), i) : (r && r(), Promise.resolve());
1152
+ n.resolve(), t && t(e);
1153
+ }), n) : (t && t(), Promise.resolve());
1138
1154
  }
1139
- loadLanguages(n, r) {
1140
- let i = t();
1141
- e(n) && (n = [n]);
1142
- let a = this.options.preload || [], o = n.filter((e) => a.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1143
- return o.length ? (this.options.preload = a.concat(o), this.loadResources((e) => {
1144
- i.resolve(), r && r(e);
1145
- }), i) : (r && r(), Promise.resolve());
1155
+ loadLanguages(e, t) {
1156
+ let n = d();
1157
+ u(e) && (e = [e]);
1158
+ let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1159
+ return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
1160
+ n.resolve(), t && t(e);
1161
+ }), n) : (t && t(), Promise.resolve());
1146
1162
  }
1147
1163
  dir(e) {
1148
1164
  if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
@@ -1153,41 +1169,41 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
1153
1169
  if (e && e.direction) return e.direction;
1154
1170
  }
1155
1171
  } catch {}
1156
- 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 N(V());
1172
+ 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 B(q());
1157
1173
  return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1158
1174
  }
1159
- static createInstance(e = {}, t) {
1160
- let r = new n(e, t);
1161
- return r.createInstance = n.createInstance, r;
1175
+ static createInstance(t = {}, n) {
1176
+ let r = new e(t, n);
1177
+ return r.createInstance = e.createInstance, r;
1162
1178
  }
1163
- cloneInstance(e = {}, t = U) {
1164
- let r = e.forkResourceStore;
1165
- r && delete e.forkResourceStore;
1179
+ cloneInstance(t = {}, n = Y) {
1180
+ let r = t.forkResourceStore;
1181
+ r && delete t.forkResourceStore;
1166
1182
  let i = {
1167
1183
  ...this.options,
1168
- ...e,
1184
+ ...t,
1169
1185
  isClone: !0
1170
- }, a = new n(i);
1171
- if ((e.debug !== void 0 || e.prefix !== void 0) && (a.logger = a.logger.clone(e)), [
1186
+ }, a = new e(i);
1187
+ if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1172
1188
  "store",
1173
1189
  "services",
1174
1190
  "language"
1175
1191
  ].forEach((e) => {
1176
1192
  a[e] = this[e];
1177
- }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new T(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), e.interpolation) {
1178
- let t = {
1179
- ...V().interpolation,
1193
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new N(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) {
1194
+ let e = {
1195
+ ...q().interpolation,
1180
1196
  ...this.options.interpolation,
1181
- ...e.interpolation
1197
+ ...t.interpolation
1182
1198
  }, n = {
1183
1199
  ...i,
1184
- interpolation: t
1200
+ interpolation: e
1185
1201
  };
1186
- a.services.interpolator = new R(n);
1202
+ a.services.interpolator = new G(n);
1187
1203
  }
1188
- return a.translator = new M(a.services, i), a.translator.on("*", (e, ...t) => {
1204
+ return a.translator = new z(a.services, i), a.translator.on("*", (e, ...t) => {
1189
1205
  a.emit(e, ...t);
1190
- }), a.init(i, t), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1206
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1191
1207
  }
1192
1208
  toJSON() {
1193
1209
  return {
@@ -1199,10 +1215,10 @@ var A = {}, j = (t) => !e(t) && typeof t != "boolean" && typeof t != "number", M
1199
1215
  };
1200
1216
  }
1201
1217
  }.createInstance();
1202
- J.createInstance, J.dir, J.init, J.loadResources, J.reloadResources, J.use, J.changeLanguage, J.getFixedT, J.t, J.exists, J.setDefaultNamespace, J.hasLoadedNamespace, J.loadNamespaces, J.loadLanguages;
1218
+ Z.createInstance, Z.dir, Z.init, Z.loadResources, Z.reloadResources, Z.use, Z.changeLanguage, Z.getFixedT, Z.t, Z.exists, Z.setDefaultNamespace, Z.hasLoadedNamespace, Z.loadNamespaces, Z.loadLanguages;
1203
1219
  //#endregion
1204
1220
  //#region node_modules/react-i18next/dist/es/unescape.js
1205
- var oe = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, se = {
1221
+ var pe = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, me = {
1206
1222
  "&amp;": "&",
1207
1223
  "&#38;": "&",
1208
1224
  "&lt;": "<",
@@ -1223,7 +1239,7 @@ var oe = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
1223
1239
  "&#8230;": "…",
1224
1240
  "&#x2F;": "/",
1225
1241
  "&#47;": "/"
1226
- }, ce = (e) => se[e], Y = (e) => e.replace(oe, ce), X = {
1242
+ }, he = (e) => me[e], Q = (e) => e.replace(pe, he), $ = {
1227
1243
  bindI18n: "languageChanged",
1228
1244
  bindI18nStore: "",
1229
1245
  transEmptyNodeValue: "",
@@ -1236,21 +1252,21 @@ var oe = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
1236
1252
  "p"
1237
1253
  ],
1238
1254
  useSuspense: !0,
1239
- unescape: Y,
1255
+ unescape: Q,
1240
1256
  transDefaultProps: void 0
1241
- }, le = (e = {}) => {
1242
- X = {
1243
- ...X,
1257
+ }, ge = (e = {}) => {
1258
+ $ = {
1259
+ ...$,
1244
1260
  ...e
1245
1261
  };
1246
- }, ue = () => X, Z, de = (e) => {
1247
- Z = e;
1248
- }, fe = () => Z, Q = {
1262
+ }, _e = () => $, ve, ye = (e) => {
1263
+ ve = e;
1264
+ }, be = () => ve, xe = {
1249
1265
  type: "3rdParty",
1250
1266
  init(e) {
1251
- le(e.options.react), de(e);
1267
+ ge(e.options.react), ye(e);
1252
1268
  }
1253
- }, pe = function(e) {
1269
+ }, Se = function(e) {
1254
1270
  return {
1255
1271
  type: "backend",
1256
1272
  init: function(e, t, n) {},
@@ -1273,11 +1289,11 @@ var oe = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
1273
1289
  r(null, e && e[t] && e[t][n]);
1274
1290
  }
1275
1291
  };
1276
- }, $ = /* @__PURE__ */ Object.assign({
1277
- "./locales/en/translation.json": () => import("./translation-LFv38Ne3.js"),
1278
- "./locales/sk/translation.json": () => import("./translation-KUznr2y2.js")
1279
- }), me = Array.from(new Set(Object.keys($).map((e) => e.split("/")[2]).filter((e) => !!e)));
1280
- function he() {
1292
+ }, Ce = /* @__PURE__ */ s({ default: () => De }), we = /* #__PURE__ */ Object.assign({
1293
+ "./locales/en/translation.json": () => import("./translation-BWX2qtSY.js"),
1294
+ "./locales/sk/translation.json": () => import("./translation-CfAg14N6.js")
1295
+ }), Te = Array.from(new Set(Object.keys(we).map((e) => e.split("/")[2]).filter((e) => !!e)));
1296
+ function Ee() {
1281
1297
  try {
1282
1298
  let e = localStorage.getItem("chatui-settings");
1283
1299
  if (e) {
@@ -1287,18 +1303,18 @@ function he() {
1287
1303
  } catch {}
1288
1304
  return "en";
1289
1305
  }
1290
- J.use(pe(async (e, t) => {
1291
- let n = $[`./locales/${e}/${t}.json`];
1306
+ Z.use(Se(async (e, t) => {
1307
+ let n = we[`./locales/${e}/${t}.json`];
1292
1308
  if (!n) throw Error(`Missing locale bundle: ${e}/${t}`);
1293
1309
  return (await n()).default;
1294
- })).use(Q).init({
1295
- lng: he(),
1310
+ })).use(xe).init({
1311
+ lng: Ee(),
1296
1312
  fallbackLng: "en",
1297
- supportedLngs: me,
1313
+ supportedLngs: Te,
1298
1314
  interpolation: { escapeValue: !1 }
1299
1315
  });
1300
- var ge = J;
1316
+ var De = Z;
1301
1317
  //#endregion
1302
- export { k as a, Y as i, fe as n, ue as r, ge as t };
1318
+ export { I as a, l as c, Q as i, be as n, o, _e as r, s, Ce as t };
1303
1319
 
1304
- //# sourceMappingURL=i18n-fqYdUrSg.js.map
1320
+ //# sourceMappingURL=i18n-5KV_0_J2.js.map