@ukpc-lib/react 0.13.1-dev.22 → 0.13.1-dev.24

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,3528 +0,0 @@
1
- import "./index2.css";
2
- import { r as $, c as ce, g as Jt, s as Xt, j as E } from "./react-to-web-component-D7SoYMky.js";
3
- import { a as Wt, _ as Y } from "./setPrototypeOf-CP0c5ut2.js";
4
- function Gt(i, e) {
5
- for (var t = 0; t < e.length; t++) {
6
- const n = e[t];
7
- if (typeof n != "string" && !Array.isArray(n)) {
8
- for (const r in n)
9
- if (r !== "default" && !(r in i)) {
10
- const a = Object.getOwnPropertyDescriptor(n, r);
11
- a && Object.defineProperty(i, r, a.get ? a : {
12
- enumerable: !0,
13
- get: () => n[r]
14
- });
15
- }
16
- }
17
- }
18
- return Object.freeze(Object.defineProperty(i, Symbol.toStringTag, { value: "Module" }));
19
- }
20
- function U(i) {
21
- "@babel/helpers - typeof";
22
- return U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
23
- return typeof e;
24
- } : function(e) {
25
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
26
- }, U(i);
27
- }
28
- function B(i, e) {
29
- if (!(i instanceof e))
30
- throw new TypeError("Cannot call a class as a function");
31
- }
32
- function Qt(i, e) {
33
- if (U(i) != "object" || !i)
34
- return i;
35
- var t = i[Symbol.toPrimitive];
36
- if (t !== void 0) {
37
- var n = t.call(i, e);
38
- if (U(n) != "object")
39
- return n;
40
- throw new TypeError("@@toPrimitive must return a primitive value.");
41
- }
42
- return (e === "string" ? String : Number)(i);
43
- }
44
- function kt(i) {
45
- var e = Qt(i, "string");
46
- return U(e) == "symbol" ? e : e + "";
47
- }
48
- function $e(i, e) {
49
- for (var t = 0; t < e.length; t++) {
50
- var n = e[t];
51
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(i, kt(n.key), n);
52
- }
53
- }
54
- function H(i, e, t) {
55
- return e && $e(i.prototype, e), t && $e(i, t), Object.defineProperty(i, "prototype", {
56
- writable: !1
57
- }), i;
58
- }
59
- function Se(i, e) {
60
- if (typeof e != "function" && e !== null)
61
- throw new TypeError("Super expression must either be null or a function");
62
- i.prototype = Object.create(e && e.prototype, {
63
- constructor: {
64
- value: i,
65
- writable: !0,
66
- configurable: !0
67
- }
68
- }), Object.defineProperty(i, "prototype", {
69
- writable: !1
70
- }), e && Wt(i, e);
71
- }
72
- function de(i, e) {
73
- if (e && (U(e) == "object" || typeof e == "function"))
74
- return e;
75
- if (e !== void 0)
76
- throw new TypeError("Derived constructors may only return object or undefined");
77
- return Y(i);
78
- }
79
- function X(i) {
80
- return X = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
81
- return e.__proto__ || Object.getPrototypeOf(e);
82
- }, X(i);
83
- }
84
- function W(i, e, t) {
85
- return (e = kt(e)) in i ? Object.defineProperty(i, e, {
86
- value: t,
87
- enumerable: !0,
88
- configurable: !0,
89
- writable: !0
90
- }) : i[e] = t, i;
91
- }
92
- function Lt(i) {
93
- if (Array.isArray(i))
94
- return i;
95
- }
96
- function Yt(i) {
97
- if (typeof Symbol < "u" && i[Symbol.iterator] != null || i["@@iterator"] != null)
98
- return Array.from(i);
99
- }
100
- function qe(i, e) {
101
- (e == null || e > i.length) && (e = i.length);
102
- for (var t = 0, n = Array(e); t < e; t++)
103
- n[t] = i[t];
104
- return n;
105
- }
106
- function Rt(i, e) {
107
- if (i) {
108
- if (typeof i == "string")
109
- return qe(i, e);
110
- var t = {}.toString.call(i).slice(8, -1);
111
- return t === "Object" && i.constructor && (t = i.constructor.name), t === "Map" || t === "Set" ? Array.from(i) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? qe(i, e) : void 0;
112
- }
113
- }
114
- function Et() {
115
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
116
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
117
- }
118
- function Zt(i) {
119
- return Lt(i) || Yt(i) || Rt(i) || Et();
120
- }
121
- function Ke(i, e) {
122
- var t = Object.keys(i);
123
- if (Object.getOwnPropertySymbols) {
124
- var n = Object.getOwnPropertySymbols(i);
125
- e && (n = n.filter(function(r) {
126
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
127
- })), t.push.apply(t, n);
128
- }
129
- return t;
130
- }
131
- function Ve(i) {
132
- for (var e = 1; e < arguments.length; e++) {
133
- var t = arguments[e] != null ? arguments[e] : {};
134
- e % 2 ? Ke(Object(t), !0).forEach(function(n) {
135
- W(i, n, t[n]);
136
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : Ke(Object(t)).forEach(function(n) {
137
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
138
- });
139
- }
140
- return i;
141
- }
142
- var en = {
143
- type: "logger",
144
- log: function(e) {
145
- this.output("log", e);
146
- },
147
- warn: function(e) {
148
- this.output("warn", e);
149
- },
150
- error: function(e) {
151
- this.output("error", e);
152
- },
153
- output: function(e, t) {
154
- console && console[e] && console[e].apply(console, t);
155
- }
156
- }, tn = function() {
157
- function i(e) {
158
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
159
- B(this, i), this.init(e, t);
160
- }
161
- return H(i, [{
162
- key: "init",
163
- value: function(t) {
164
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
165
- this.prefix = n.prefix || "i18next:", this.logger = t || en, this.options = n, this.debug = n.debug;
166
- }
167
- }, {
168
- key: "setDebug",
169
- value: function(t) {
170
- this.debug = t;
171
- }
172
- }, {
173
- key: "log",
174
- value: function() {
175
- for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
176
- n[r] = arguments[r];
177
- return this.forward(n, "log", "", !0);
178
- }
179
- }, {
180
- key: "warn",
181
- value: function() {
182
- for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
183
- n[r] = arguments[r];
184
- return this.forward(n, "warn", "", !0);
185
- }
186
- }, {
187
- key: "error",
188
- value: function() {
189
- for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
190
- n[r] = arguments[r];
191
- return this.forward(n, "error", "");
192
- }
193
- }, {
194
- key: "deprecate",
195
- value: function() {
196
- for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
197
- n[r] = arguments[r];
198
- return this.forward(n, "warn", "WARNING DEPRECATED: ", !0);
199
- }
200
- }, {
201
- key: "forward",
202
- value: function(t, n, r, a) {
203
- return a && !this.debug ? null : (typeof t[0] == "string" && (t[0] = "".concat(r).concat(this.prefix, " ").concat(t[0])), this.logger[n](t));
204
- }
205
- }, {
206
- key: "create",
207
- value: function(t) {
208
- return new i(this.logger, Ve(Ve({}, {
209
- prefix: "".concat(this.prefix, ":").concat(t, ":")
210
- }), this.options));
211
- }
212
- }, {
213
- key: "clone",
214
- value: function(t) {
215
- return t = t || this.options, t.prefix = t.prefix || this.prefix, new i(this.logger, t);
216
- }
217
- }]), i;
218
- }(), J = new tn(), Z = function() {
219
- function i() {
220
- B(this, i), this.observers = {};
221
- }
222
- return H(i, [{
223
- key: "on",
224
- value: function(t, n) {
225
- var r = this;
226
- return t.split(" ").forEach(function(a) {
227
- r.observers[a] = r.observers[a] || [], r.observers[a].push(n);
228
- }), this;
229
- }
230
- }, {
231
- key: "off",
232
- value: function(t, n) {
233
- if (this.observers[t]) {
234
- if (!n) {
235
- delete this.observers[t];
236
- return;
237
- }
238
- this.observers[t] = this.observers[t].filter(function(r) {
239
- return r !== n;
240
- });
241
- }
242
- }
243
- }, {
244
- key: "emit",
245
- value: function(t) {
246
- for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++)
247
- r[a - 1] = arguments[a];
248
- if (this.observers[t]) {
249
- var o = [].concat(this.observers[t]);
250
- o.forEach(function(u) {
251
- u.apply(void 0, r);
252
- });
253
- }
254
- if (this.observers["*"]) {
255
- var s = [].concat(this.observers["*"]);
256
- s.forEach(function(u) {
257
- u.apply(u, [t].concat(r));
258
- });
259
- }
260
- }
261
- }]), i;
262
- }();
263
- function se() {
264
- var i, e, t = new Promise(function(n, r) {
265
- i = n, e = r;
266
- });
267
- return t.resolve = i, t.reject = e, t;
268
- }
269
- function ze(i) {
270
- return i == null ? "" : "" + i;
271
- }
272
- function nn(i, e, t) {
273
- i.forEach(function(n) {
274
- e[n] && (t[n] = e[n]);
275
- });
276
- }
277
- function Fe(i, e, t) {
278
- function n(s) {
279
- return s && s.indexOf("###") > -1 ? s.replace(/###/g, ".") : s;
280
- }
281
- function r() {
282
- return !i || typeof i == "string";
283
- }
284
- for (var a = typeof e != "string" ? [].concat(e) : e.split("."); a.length > 1; ) {
285
- if (r())
286
- return {};
287
- var o = n(a.shift());
288
- !i[o] && t && (i[o] = new t()), Object.prototype.hasOwnProperty.call(i, o) ? i = i[o] : i = {};
289
- }
290
- return r() ? {} : {
291
- obj: i,
292
- k: n(a.shift())
293
- };
294
- }
295
- function Je(i, e, t) {
296
- var n = Fe(i, e, Object), r = n.obj, a = n.k;
297
- r[a] = t;
298
- }
299
- function rn(i, e, t, n) {
300
- var r = Fe(i, e, Object), a = r.obj, o = r.k;
301
- a[o] = a[o] || [], a[o].push(t);
302
- }
303
- function ye(i, e) {
304
- var t = Fe(i, e), n = t.obj, r = t.k;
305
- if (n)
306
- return n[r];
307
- }
308
- function an(i, e, t) {
309
- var n = ye(i, t);
310
- return n !== void 0 ? n : ye(e, t);
311
- }
312
- function Ct(i, e, t) {
313
- for (var n in e)
314
- n !== "__proto__" && n !== "constructor" && (n in i ? typeof i[n] == "string" || i[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? t && (i[n] = e[n]) : Ct(i[n], e[n], t) : i[n] = e[n]);
315
- return i;
316
- }
317
- function re(i) {
318
- return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
319
- }
320
- var on = {
321
- "&": "&amp;",
322
- "<": "&lt;",
323
- ">": "&gt;",
324
- '"': "&quot;",
325
- "'": "&#39;",
326
- "/": "&#x2F;"
327
- };
328
- function sn(i) {
329
- return typeof i == "string" ? i.replace(/[&<>"'\/]/g, function(e) {
330
- return on[e];
331
- }) : i;
332
- }
333
- var xe = typeof window < "u" && window.navigator && typeof window.navigator.userAgentData > "u" && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1, un = [" ", ",", "?", "!", ";"];
334
- function fn(i, e, t) {
335
- e = e || "", t = t || "";
336
- var n = un.filter(function(s) {
337
- return e.indexOf(s) < 0 && t.indexOf(s) < 0;
338
- });
339
- if (n.length === 0)
340
- return !0;
341
- var r = new RegExp("(".concat(n.map(function(s) {
342
- return s === "?" ? "\\?" : s;
343
- }).join("|"), ")")), a = !r.test(i);
344
- if (!a) {
345
- var o = i.indexOf(t);
346
- o > 0 && !r.test(i.substring(0, o)) && (a = !0);
347
- }
348
- return a;
349
- }
350
- function be(i, e) {
351
- var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
352
- if (i) {
353
- if (i[e])
354
- return i[e];
355
- for (var n = e.split(t), r = i, a = 0; a < n.length; ++a) {
356
- if (!r || typeof r[n[a]] == "string" && a + 1 < n.length)
357
- return;
358
- if (r[n[a]] === void 0) {
359
- for (var o = 2, s = n.slice(a, a + o).join(t), u = r[s]; u === void 0 && n.length > a + o; )
360
- o++, s = n.slice(a, a + o).join(t), u = r[s];
361
- if (u === void 0)
362
- return;
363
- if (u === null)
364
- return null;
365
- if (e.endsWith(s)) {
366
- if (typeof u == "string")
367
- return u;
368
- if (s && typeof u[s] == "string")
369
- return u[s];
370
- }
371
- var d = n.slice(a + o).join(t);
372
- return d ? be(u, d, t) : void 0;
373
- }
374
- r = r[n[a]];
375
- }
376
- return r;
377
- }
378
- }
379
- function Xe(i, e) {
380
- var t = Object.keys(i);
381
- if (Object.getOwnPropertySymbols) {
382
- var n = Object.getOwnPropertySymbols(i);
383
- e && (n = n.filter(function(r) {
384
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
385
- })), t.push.apply(t, n);
386
- }
387
- return t;
388
- }
389
- function ge(i) {
390
- for (var e = 1; e < arguments.length; e++) {
391
- var t = arguments[e] != null ? arguments[e] : {};
392
- e % 2 ? Xe(Object(t), !0).forEach(function(n) {
393
- W(i, n, t[n]);
394
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : Xe(Object(t)).forEach(function(n) {
395
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
396
- });
397
- }
398
- return i;
399
- }
400
- function cn(i) {
401
- var e = ln();
402
- return function() {
403
- var n = X(i), r;
404
- if (e) {
405
- var a = X(this).constructor;
406
- r = Reflect.construct(n, arguments, a);
407
- } else
408
- r = n.apply(this, arguments);
409
- return de(this, r);
410
- };
411
- }
412
- function ln() {
413
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
414
- return !1;
415
- if (typeof Proxy == "function")
416
- return !0;
417
- try {
418
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
419
- })), !0;
420
- } catch {
421
- return !1;
422
- }
423
- }
424
- var dn = function(i) {
425
- Se(t, i);
426
- var e = cn(t);
427
- function t(n) {
428
- var r, a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
429
- ns: ["translation"],
430
- defaultNS: "translation"
431
- };
432
- return B(this, t), r = e.call(this), xe && Z.call(Y(r)), r.data = n || {}, r.options = a, r.options.keySeparator === void 0 && (r.options.keySeparator = "."), r.options.ignoreJSONStructure === void 0 && (r.options.ignoreJSONStructure = !0), r;
433
- }
434
- return H(t, [{
435
- key: "addNamespaces",
436
- value: function(r) {
437
- this.options.ns.indexOf(r) < 0 && this.options.ns.push(r);
438
- }
439
- }, {
440
- key: "removeNamespaces",
441
- value: function(r) {
442
- var a = this.options.ns.indexOf(r);
443
- a > -1 && this.options.ns.splice(a, 1);
444
- }
445
- }, {
446
- key: "getResource",
447
- value: function(r, a, o) {
448
- var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, u = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, d = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure, c = [r, a];
449
- o && typeof o != "string" && (c = c.concat(o)), o && typeof o == "string" && (c = c.concat(u ? o.split(u) : o)), r.indexOf(".") > -1 && (c = r.split("."));
450
- var f = ye(this.data, c);
451
- return f || !d || typeof o != "string" ? f : be(this.data && this.data[r] && this.data[r][a], o, u);
452
- }
453
- }, {
454
- key: "addResource",
455
- value: function(r, a, o, s) {
456
- var u = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
457
- silent: !1
458
- }, d = u.keySeparator !== void 0 ? u.keySeparator : this.options.keySeparator, c = [r, a];
459
- o && (c = c.concat(d ? o.split(d) : o)), r.indexOf(".") > -1 && (c = r.split("."), s = a, a = c[1]), this.addNamespaces(a), Je(this.data, c, s), u.silent || this.emit("added", r, a, o, s);
460
- }
461
- }, {
462
- key: "addResources",
463
- value: function(r, a, o) {
464
- var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
465
- silent: !1
466
- };
467
- for (var u in o)
468
- (typeof o[u] == "string" || Object.prototype.toString.apply(o[u]) === "[object Array]") && this.addResource(r, a, u, o[u], {
469
- silent: !0
470
- });
471
- s.silent || this.emit("added", r, a, o);
472
- }
473
- }, {
474
- key: "addResourceBundle",
475
- value: function(r, a, o, s, u) {
476
- var d = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
477
- silent: !1
478
- }, c = [r, a];
479
- r.indexOf(".") > -1 && (c = r.split("."), s = o, o = a, a = c[1]), this.addNamespaces(a);
480
- var f = ye(this.data, c) || {};
481
- s ? Ct(f, o, u) : f = ge(ge({}, f), o), Je(this.data, c, f), d.silent || this.emit("added", r, a, o);
482
- }
483
- }, {
484
- key: "removeResourceBundle",
485
- value: function(r, a) {
486
- this.hasResourceBundle(r, a) && delete this.data[r][a], this.removeNamespaces(a), this.emit("removed", r, a);
487
- }
488
- }, {
489
- key: "hasResourceBundle",
490
- value: function(r, a) {
491
- return this.getResource(r, a) !== void 0;
492
- }
493
- }, {
494
- key: "getResourceBundle",
495
- value: function(r, a) {
496
- return a || (a = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? ge(ge({}, {}), this.getResource(r, a)) : this.getResource(r, a);
497
- }
498
- }, {
499
- key: "getDataByLanguage",
500
- value: function(r) {
501
- return this.data[r];
502
- }
503
- }, {
504
- key: "hasLanguageSomeTranslations",
505
- value: function(r) {
506
- var a = this.getDataByLanguage(r), o = a && Object.keys(a) || [];
507
- return !!o.find(function(s) {
508
- return a[s] && Object.keys(a[s]).length > 0;
509
- });
510
- }
511
- }, {
512
- key: "toJSON",
513
- value: function() {
514
- return this.data;
515
- }
516
- }]), t;
517
- }(Z), _t = {
518
- processors: {},
519
- addPostProcessor: function(e) {
520
- this.processors[e.name] = e;
521
- },
522
- handle: function(e, t, n, r, a) {
523
- var o = this;
524
- return e.forEach(function(s) {
525
- o.processors[s] && (t = o.processors[s].process(t, n, r, a));
526
- }), t;
527
- }
528
- };
529
- function We(i, e) {
530
- var t = Object.keys(i);
531
- if (Object.getOwnPropertySymbols) {
532
- var n = Object.getOwnPropertySymbols(i);
533
- e && (n = n.filter(function(r) {
534
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
535
- })), t.push.apply(t, n);
536
- }
537
- return t;
538
- }
539
- function T(i) {
540
- for (var e = 1; e < arguments.length; e++) {
541
- var t = arguments[e] != null ? arguments[e] : {};
542
- e % 2 ? We(Object(t), !0).forEach(function(n) {
543
- W(i, n, t[n]);
544
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : We(Object(t)).forEach(function(n) {
545
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
546
- });
547
- }
548
- return i;
549
- }
550
- function pn(i) {
551
- var e = gn();
552
- return function() {
553
- var n = X(i), r;
554
- if (e) {
555
- var a = X(this).constructor;
556
- r = Reflect.construct(n, arguments, a);
557
- } else
558
- r = n.apply(this, arguments);
559
- return de(this, r);
560
- };
561
- }
562
- function gn() {
563
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
564
- return !1;
565
- if (typeof Proxy == "function")
566
- return !0;
567
- try {
568
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
569
- })), !0;
570
- } catch {
571
- return !1;
572
- }
573
- }
574
- var Ge = {}, Qe = function(i) {
575
- Se(t, i);
576
- var e = pn(t);
577
- function t(n) {
578
- var r, a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
579
- return B(this, t), r = e.call(this), xe && Z.call(Y(r)), nn(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], n, Y(r)), r.options = a, r.options.keySeparator === void 0 && (r.options.keySeparator = "."), r.logger = J.create("translator"), r;
580
- }
581
- return H(t, [{
582
- key: "changeLanguage",
583
- value: function(r) {
584
- r && (this.language = r);
585
- }
586
- }, {
587
- key: "exists",
588
- value: function(r) {
589
- var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
590
- interpolation: {}
591
- };
592
- if (r == null)
593
- return !1;
594
- var o = this.resolve(r, a);
595
- return o && o.res !== void 0;
596
- }
597
- }, {
598
- key: "extractFromKey",
599
- value: function(r, a) {
600
- var o = a.nsSeparator !== void 0 ? a.nsSeparator : this.options.nsSeparator;
601
- o === void 0 && (o = ":");
602
- var s = a.keySeparator !== void 0 ? a.keySeparator : this.options.keySeparator, u = a.ns || this.options.defaultNS || [], d = o && r.indexOf(o) > -1, c = !this.options.userDefinedKeySeparator && !a.keySeparator && !this.options.userDefinedNsSeparator && !a.nsSeparator && !fn(r, o, s);
603
- if (d && !c) {
604
- var f = r.match(this.interpolator.nestingRegexp);
605
- if (f && f.length > 0)
606
- return {
607
- key: r,
608
- namespaces: u
609
- };
610
- var p = r.split(o);
611
- (o !== s || o === s && this.options.ns.indexOf(p[0]) > -1) && (u = p.shift()), r = p.join(s);
612
- }
613
- return typeof u == "string" && (u = [u]), {
614
- key: r,
615
- namespaces: u
616
- };
617
- }
618
- }, {
619
- key: "translate",
620
- value: function(r, a, o) {
621
- var s = this;
622
- if (U(a) !== "object" && this.options.overloadTranslationOptionHandler && (a = this.options.overloadTranslationOptionHandler(arguments)), U(a) === "object" && (a = T({}, a)), a || (a = {}), r == null)
623
- return "";
624
- Array.isArray(r) || (r = [String(r)]);
625
- var u = a.returnDetails !== void 0 ? a.returnDetails : this.options.returnDetails, d = a.keySeparator !== void 0 ? a.keySeparator : this.options.keySeparator, c = this.extractFromKey(r[r.length - 1], a), f = c.key, p = c.namespaces, g = p[p.length - 1], b = a.lng || this.language, y = a.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
626
- if (b && b.toLowerCase() === "cimode") {
627
- if (y) {
628
- var w = a.nsSeparator || this.options.nsSeparator;
629
- return u ? {
630
- res: "".concat(g).concat(w).concat(f),
631
- usedKey: f,
632
- exactUsedKey: f,
633
- usedLng: b,
634
- usedNS: g
635
- } : "".concat(g).concat(w).concat(f);
636
- }
637
- return u ? {
638
- res: f,
639
- usedKey: f,
640
- exactUsedKey: f,
641
- usedLng: b,
642
- usedNS: g
643
- } : f;
644
- }
645
- var v = this.resolve(r, a), m = v && v.res, S = v && v.usedKey || f, x = v && v.exactUsedKey || f, k = Object.prototype.toString.apply(m), D = ["[object Number]", "[object Function]", "[object RegExp]"], I = a.joinArrays !== void 0 ? a.joinArrays : this.options.joinArrays, _ = !this.i18nFormat || this.i18nFormat.handleAsObject, R = typeof m != "string" && typeof m != "boolean" && typeof m != "number";
646
- if (_ && m && R && D.indexOf(k) < 0 && !(typeof I == "string" && k === "[object Array]")) {
647
- if (!a.returnObjects && !this.options.returnObjects) {
648
- this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
649
- var C = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(S, m, T(T({}, a), {}, {
650
- ns: p
651
- })) : "key '".concat(f, " (").concat(this.language, ")' returned an object instead of string.");
652
- return u ? (v.res = C, v) : C;
653
- }
654
- if (d) {
655
- var Q = k === "[object Array]", A = Q ? [] : {}, Pe = Q ? x : S;
656
- for (var q in m)
657
- if (Object.prototype.hasOwnProperty.call(m, q)) {
658
- var l = "".concat(Pe).concat(d).concat(q);
659
- A[q] = this.translate(l, T(T({}, a), {
660
- joinArrays: !1,
661
- ns: p
662
- })), A[q] === l && (A[q] = m[q]);
663
- }
664
- m = A;
665
- }
666
- } else if (_ && typeof I == "string" && k === "[object Array]")
667
- m = m.join(I), m && (m = this.extendTranslation(m, r, a, o));
668
- else {
669
- var h = !1, O = !1, j = a.count !== void 0 && typeof a.count != "string", L = t.hasDefaultValue(a), P = j ? this.pluralResolver.getSuffix(b, a.count, a) : "", K = a["defaultValue".concat(P)] || a.defaultValue;
670
- !this.isValidLookup(m) && L && (h = !0, m = K), this.isValidLookup(m) || (O = !0, m = f);
671
- var je = a.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey, F = je && O ? void 0 : m, V = L && K !== m && this.options.updateMissing;
672
- if (O || h || V) {
673
- if (this.logger.log(V ? "updateKey" : "missingKey", b, g, f, V ? K : m), d) {
674
- var Ue = this.resolve(f, T(T({}, a), {}, {
675
- keySeparator: !1
676
- }));
677
- Ue && Ue.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.");
678
- }
679
- var oe = [], pe = this.languageUtils.getFallbackCodes(this.options.fallbackLng, a.lng || this.language);
680
- if (this.options.saveMissingTo === "fallback" && pe && pe[0])
681
- for (var ke = 0; ke < pe.length; ke++)
682
- oe.push(pe[ke]);
683
- else
684
- this.options.saveMissingTo === "all" ? oe = this.languageUtils.toResolveHierarchy(a.lng || this.language) : oe.push(a.lng || this.language);
685
- var Be = function(ne, Re, He) {
686
- var Me = L && He !== m ? He : F;
687
- s.options.missingKeyHandler ? s.options.missingKeyHandler(ne, g, Re, Me, V, a) : s.backendConnector && s.backendConnector.saveMissing && s.backendConnector.saveMissing(ne, g, Re, Me, V, a), s.emit("missingKey", ne, g, Re, m);
688
- };
689
- this.options.saveMissing && (this.options.saveMissingPlurals && j ? oe.forEach(function(Le) {
690
- s.pluralResolver.getSuffixes(Le, a).forEach(function(ne) {
691
- Be([Le], f + ne, a["defaultValue".concat(ne)] || K);
692
- });
693
- }) : Be(oe, f, K));
694
- }
695
- m = this.extendTranslation(m, r, a, v, o), O && m === f && this.options.appendNamespaceToMissingKey && (m = "".concat(g, ":").concat(f)), (O || h) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? m = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(g, ":").concat(f) : f, h ? m : void 0) : m = this.options.parseMissingKeyHandler(m));
696
- }
697
- return u ? (v.res = m, v) : m;
698
- }
699
- }, {
700
- key: "extendTranslation",
701
- value: function(r, a, o, s, u) {
702
- var d = this;
703
- if (this.i18nFormat && this.i18nFormat.parse)
704
- r = this.i18nFormat.parse(r, T(T({}, this.options.interpolation.defaultVariables), o), s.usedLng, s.usedNS, s.usedKey, {
705
- resolved: s
706
- });
707
- else if (!o.skipInterpolation) {
708
- o.interpolation && this.interpolator.init(T(T({}, o), {
709
- interpolation: T(T({}, this.options.interpolation), o.interpolation)
710
- }));
711
- var c = typeof r == "string" && (o && o.interpolation && o.interpolation.skipOnVariables !== void 0 ? o.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables), f;
712
- if (c) {
713
- var p = r.match(this.interpolator.nestingRegexp);
714
- f = p && p.length;
715
- }
716
- var g = o.replace && typeof o.replace != "string" ? o.replace : o;
717
- if (this.options.interpolation.defaultVariables && (g = T(T({}, this.options.interpolation.defaultVariables), g)), r = this.interpolator.interpolate(r, g, o.lng || this.language, o), c) {
718
- var b = r.match(this.interpolator.nestingRegexp), y = b && b.length;
719
- f < y && (o.nest = !1);
720
- }
721
- !o.lng && this.options.compatibilityAPI !== "v1" && s && s.res && (o.lng = s.usedLng), o.nest !== !1 && (r = this.interpolator.nest(r, function() {
722
- for (var m = arguments.length, S = new Array(m), x = 0; x < m; x++)
723
- S[x] = arguments[x];
724
- return u && u[0] === S[0] && !o.context ? (d.logger.warn("It seems you are nesting recursively key: ".concat(S[0], " in key: ").concat(a[0])), null) : d.translate.apply(d, S.concat([a]));
725
- }, o)), o.interpolation && this.interpolator.reset();
726
- }
727
- var w = o.postProcess || this.options.postProcess, v = typeof w == "string" ? [w] : w;
728
- return r != null && v && v.length && o.applyPostProcessor !== !1 && (r = _t.handle(v, r, a, this.options && this.options.postProcessPassResolved ? T({
729
- i18nResolved: s
730
- }, o) : o, this)), r;
731
- }
732
- }, {
733
- key: "resolve",
734
- value: function(r) {
735
- var a = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, u, d, c, f;
736
- return typeof r == "string" && (r = [r]), r.forEach(function(p) {
737
- if (!a.isValidLookup(s)) {
738
- var g = a.extractFromKey(p, o), b = g.key;
739
- u = b;
740
- var y = g.namespaces;
741
- a.options.fallbackNS && (y = y.concat(a.options.fallbackNS));
742
- var w = o.count !== void 0 && typeof o.count != "string", v = w && !o.ordinal && o.count === 0 && a.pluralResolver.shouldUseIntlApi(), m = o.context !== void 0 && (typeof o.context == "string" || typeof o.context == "number") && o.context !== "", S = o.lngs ? o.lngs : a.languageUtils.toResolveHierarchy(o.lng || a.language, o.fallbackLng);
743
- y.forEach(function(x) {
744
- a.isValidLookup(s) || (f = x, !Ge["".concat(S[0], "-").concat(x)] && a.utils && a.utils.hasLoadedNamespace && !a.utils.hasLoadedNamespace(f) && (Ge["".concat(S[0], "-").concat(x)] = !0, a.logger.warn('key "'.concat(u, '" for languages "').concat(S.join(", "), `" won't get resolved as namespace "`).concat(f, '" 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!!!")), S.forEach(function(k) {
745
- if (!a.isValidLookup(s)) {
746
- c = k;
747
- var D = [b];
748
- if (a.i18nFormat && a.i18nFormat.addLookupKeys)
749
- a.i18nFormat.addLookupKeys(D, b, k, x, o);
750
- else {
751
- var I;
752
- w && (I = a.pluralResolver.getSuffix(k, o.count, o));
753
- var _ = "".concat(a.options.pluralSeparator, "zero");
754
- if (w && (D.push(b + I), v && D.push(b + _)), m) {
755
- var R = "".concat(b).concat(a.options.contextSeparator).concat(o.context);
756
- D.push(R), w && (D.push(R + I), v && D.push(R + _));
757
- }
758
- }
759
- for (var C; C = D.pop(); )
760
- a.isValidLookup(s) || (d = C, s = a.getResource(k, x, C, o));
761
- }
762
- }));
763
- });
764
- }
765
- }), {
766
- res: s,
767
- usedKey: u,
768
- exactUsedKey: d,
769
- usedLng: c,
770
- usedNS: f
771
- };
772
- }
773
- }, {
774
- key: "isValidLookup",
775
- value: function(r) {
776
- return r !== void 0 && !(!this.options.returnNull && r === null) && !(!this.options.returnEmptyString && r === "");
777
- }
778
- }, {
779
- key: "getResource",
780
- value: function(r, a, o) {
781
- var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
782
- return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(r, a, o, s) : this.resourceStore.getResource(r, a, o, s);
783
- }
784
- }], [{
785
- key: "hasDefaultValue",
786
- value: function(r) {
787
- var a = "defaultValue";
788
- for (var o in r)
789
- if (Object.prototype.hasOwnProperty.call(r, o) && a === o.substring(0, a.length) && r[o] !== void 0)
790
- return !0;
791
- return !1;
792
- }
793
- }]), t;
794
- }(Z);
795
- function Ee(i) {
796
- return i.charAt(0).toUpperCase() + i.slice(1);
797
- }
798
- var Ye = function() {
799
- function i(e) {
800
- B(this, i), this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = J.create("languageUtils");
801
- }
802
- return H(i, [{
803
- key: "getScriptPartFromCode",
804
- value: function(t) {
805
- if (!t || t.indexOf("-") < 0)
806
- return null;
807
- var n = t.split("-");
808
- return n.length === 2 || (n.pop(), n[n.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(n.join("-"));
809
- }
810
- }, {
811
- key: "getLanguagePartFromCode",
812
- value: function(t) {
813
- if (!t || t.indexOf("-") < 0)
814
- return t;
815
- var n = t.split("-");
816
- return this.formatLanguageCode(n[0]);
817
- }
818
- }, {
819
- key: "formatLanguageCode",
820
- value: function(t) {
821
- if (typeof t == "string" && t.indexOf("-") > -1) {
822
- var n = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"], r = t.split("-");
823
- return this.options.lowerCaseLng ? r = r.map(function(a) {
824
- return a.toLowerCase();
825
- }) : r.length === 2 ? (r[0] = r[0].toLowerCase(), r[1] = r[1].toUpperCase(), n.indexOf(r[1].toLowerCase()) > -1 && (r[1] = Ee(r[1].toLowerCase()))) : r.length === 3 && (r[0] = r[0].toLowerCase(), r[1].length === 2 && (r[1] = r[1].toUpperCase()), r[0] !== "sgn" && r[2].length === 2 && (r[2] = r[2].toUpperCase()), n.indexOf(r[1].toLowerCase()) > -1 && (r[1] = Ee(r[1].toLowerCase())), n.indexOf(r[2].toLowerCase()) > -1 && (r[2] = Ee(r[2].toLowerCase()))), r.join("-");
826
- }
827
- return this.options.cleanCode || this.options.lowerCaseLng ? t.toLowerCase() : t;
828
- }
829
- }, {
830
- key: "isSupportedCode",
831
- value: function(t) {
832
- return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (t = this.getLanguagePartFromCode(t)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(t) > -1;
833
- }
834
- }, {
835
- key: "getBestMatchFromCodes",
836
- value: function(t) {
837
- var n = this;
838
- if (!t)
839
- return null;
840
- var r;
841
- return t.forEach(function(a) {
842
- if (!r) {
843
- var o = n.formatLanguageCode(a);
844
- (!n.options.supportedLngs || n.isSupportedCode(o)) && (r = o);
845
- }
846
- }), !r && this.options.supportedLngs && t.forEach(function(a) {
847
- if (!r) {
848
- var o = n.getLanguagePartFromCode(a);
849
- if (n.isSupportedCode(o))
850
- return r = o;
851
- r = n.options.supportedLngs.find(function(s) {
852
- if (s === o)
853
- return s;
854
- if (!(s.indexOf("-") < 0 && o.indexOf("-") < 0) && s.indexOf(o) === 0)
855
- return s;
856
- });
857
- }
858
- }), r || (r = this.getFallbackCodes(this.options.fallbackLng)[0]), r;
859
- }
860
- }, {
861
- key: "getFallbackCodes",
862
- value: function(t, n) {
863
- if (!t)
864
- return [];
865
- if (typeof t == "function" && (t = t(n)), typeof t == "string" && (t = [t]), Object.prototype.toString.apply(t) === "[object Array]")
866
- return t;
867
- if (!n)
868
- return t.default || [];
869
- var r = t[n];
870
- return r || (r = t[this.getScriptPartFromCode(n)]), r || (r = t[this.formatLanguageCode(n)]), r || (r = t[this.getLanguagePartFromCode(n)]), r || (r = t.default), r || [];
871
- }
872
- }, {
873
- key: "toResolveHierarchy",
874
- value: function(t, n) {
875
- var r = this, a = this.getFallbackCodes(n || this.options.fallbackLng || [], t), o = [], s = function(d) {
876
- d && (r.isSupportedCode(d) ? o.push(d) : r.logger.warn("rejecting language code not found in supportedLngs: ".concat(d)));
877
- };
878
- return typeof t == "string" && t.indexOf("-") > -1 ? (this.options.load !== "languageOnly" && s(this.formatLanguageCode(t)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && s(this.getScriptPartFromCode(t)), this.options.load !== "currentOnly" && s(this.getLanguagePartFromCode(t))) : typeof t == "string" && s(this.formatLanguageCode(t)), a.forEach(function(u) {
879
- o.indexOf(u) < 0 && s(r.formatLanguageCode(u));
880
- }), o;
881
- }
882
- }]), i;
883
- }(), hn = [{
884
- lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
885
- nr: [1, 2],
886
- fc: 1
887
- }, {
888
- lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
889
- nr: [1, 2],
890
- fc: 2
891
- }, {
892
- lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
893
- nr: [1],
894
- fc: 3
895
- }, {
896
- lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
897
- nr: [1, 2, 5],
898
- fc: 4
899
- }, {
900
- lngs: ["ar"],
901
- nr: [0, 1, 2, 3, 11, 100],
902
- fc: 5
903
- }, {
904
- lngs: ["cs", "sk"],
905
- nr: [1, 2, 5],
906
- fc: 6
907
- }, {
908
- lngs: ["csb", "pl"],
909
- nr: [1, 2, 5],
910
- fc: 7
911
- }, {
912
- lngs: ["cy"],
913
- nr: [1, 2, 3, 8],
914
- fc: 8
915
- }, {
916
- lngs: ["fr"],
917
- nr: [1, 2],
918
- fc: 9
919
- }, {
920
- lngs: ["ga"],
921
- nr: [1, 2, 3, 7, 11],
922
- fc: 10
923
- }, {
924
- lngs: ["gd"],
925
- nr: [1, 2, 3, 20],
926
- fc: 11
927
- }, {
928
- lngs: ["is"],
929
- nr: [1, 2],
930
- fc: 12
931
- }, {
932
- lngs: ["jv"],
933
- nr: [0, 1],
934
- fc: 13
935
- }, {
936
- lngs: ["kw"],
937
- nr: [1, 2, 3, 4],
938
- fc: 14
939
- }, {
940
- lngs: ["lt"],
941
- nr: [1, 2, 10],
942
- fc: 15
943
- }, {
944
- lngs: ["lv"],
945
- nr: [1, 2, 0],
946
- fc: 16
947
- }, {
948
- lngs: ["mk"],
949
- nr: [1, 2],
950
- fc: 17
951
- }, {
952
- lngs: ["mnk"],
953
- nr: [0, 1, 2],
954
- fc: 18
955
- }, {
956
- lngs: ["mt"],
957
- nr: [1, 2, 11, 20],
958
- fc: 19
959
- }, {
960
- lngs: ["or"],
961
- nr: [2, 1],
962
- fc: 2
963
- }, {
964
- lngs: ["ro"],
965
- nr: [1, 2, 20],
966
- fc: 20
967
- }, {
968
- lngs: ["sl"],
969
- nr: [5, 1, 2, 3],
970
- fc: 21
971
- }, {
972
- lngs: ["he", "iw"],
973
- nr: [1, 2, 20, 21],
974
- fc: 22
975
- }], vn = {
976
- 1: function(e) {
977
- return +(e > 1);
978
- },
979
- 2: function(e) {
980
- return +(e != 1);
981
- },
982
- 3: function(e) {
983
- return 0;
984
- },
985
- 4: function(e) {
986
- return e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2;
987
- },
988
- 5: function(e) {
989
- return e == 0 ? 0 : e == 1 ? 1 : e == 2 ? 2 : e % 100 >= 3 && e % 100 <= 10 ? 3 : e % 100 >= 11 ? 4 : 5;
990
- },
991
- 6: function(e) {
992
- return e == 1 ? 0 : e >= 2 && e <= 4 ? 1 : 2;
993
- },
994
- 7: function(e) {
995
- return e == 1 ? 0 : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2;
996
- },
997
- 8: function(e) {
998
- return e == 1 ? 0 : e == 2 ? 1 : e != 8 && e != 11 ? 2 : 3;
999
- },
1000
- 9: function(e) {
1001
- return +(e >= 2);
1002
- },
1003
- 10: function(e) {
1004
- return e == 1 ? 0 : e == 2 ? 1 : e < 7 ? 2 : e < 11 ? 3 : 4;
1005
- },
1006
- 11: function(e) {
1007
- return e == 1 || e == 11 ? 0 : e == 2 || e == 12 ? 1 : e > 2 && e < 20 ? 2 : 3;
1008
- },
1009
- 12: function(e) {
1010
- return +(e % 10 != 1 || e % 100 == 11);
1011
- },
1012
- 13: function(e) {
1013
- return +(e !== 0);
1014
- },
1015
- 14: function(e) {
1016
- return e == 1 ? 0 : e == 2 ? 1 : e == 3 ? 2 : 3;
1017
- },
1018
- 15: function(e) {
1019
- return e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2;
1020
- },
1021
- 16: function(e) {
1022
- return e % 10 == 1 && e % 100 != 11 ? 0 : e !== 0 ? 1 : 2;
1023
- },
1024
- 17: function(e) {
1025
- return e == 1 || e % 10 == 1 && e % 100 != 11 ? 0 : 1;
1026
- },
1027
- 18: function(e) {
1028
- return e == 0 ? 0 : e == 1 ? 1 : 2;
1029
- },
1030
- 19: function(e) {
1031
- return e == 1 ? 0 : e == 0 || e % 100 > 1 && e % 100 < 11 ? 1 : e % 100 > 10 && e % 100 < 20 ? 2 : 3;
1032
- },
1033
- 20: function(e) {
1034
- return e == 1 ? 0 : e == 0 || e % 100 > 0 && e % 100 < 20 ? 1 : 2;
1035
- },
1036
- 21: function(e) {
1037
- return e % 100 == 1 ? 1 : e % 100 == 2 ? 2 : e % 100 == 3 || e % 100 == 4 ? 3 : 0;
1038
- },
1039
- 22: function(e) {
1040
- return e == 1 ? 0 : e == 2 ? 1 : (e < 0 || e > 10) && e % 10 == 0 ? 2 : 3;
1041
- }
1042
- }, mn = ["v1", "v2", "v3"], Ze = {
1043
- zero: 0,
1044
- one: 1,
1045
- two: 2,
1046
- few: 3,
1047
- many: 4,
1048
- other: 5
1049
- };
1050
- function yn() {
1051
- var i = {};
1052
- return hn.forEach(function(e) {
1053
- e.lngs.forEach(function(t) {
1054
- i[t] = {
1055
- numbers: e.nr,
1056
- plurals: vn[e.fc]
1057
- };
1058
- });
1059
- }), i;
1060
- }
1061
- var bn = function() {
1062
- function i(e) {
1063
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1064
- B(this, i), this.languageUtils = e, this.options = t, this.logger = J.create("pluralResolver"), (!this.options.compatibilityJSON || this.options.compatibilityJSON === "v4") && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = yn();
1065
- }
1066
- return H(i, [{
1067
- key: "addRule",
1068
- value: function(t, n) {
1069
- this.rules[t] = n;
1070
- }
1071
- }, {
1072
- key: "getRule",
1073
- value: function(t) {
1074
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1075
- if (this.shouldUseIntlApi())
1076
- try {
1077
- return new Intl.PluralRules(t, {
1078
- type: n.ordinal ? "ordinal" : "cardinal"
1079
- });
1080
- } catch {
1081
- return;
1082
- }
1083
- return this.rules[t] || this.rules[this.languageUtils.getLanguagePartFromCode(t)];
1084
- }
1085
- }, {
1086
- key: "needsPlural",
1087
- value: function(t) {
1088
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = this.getRule(t, n);
1089
- return this.shouldUseIntlApi() ? r && r.resolvedOptions().pluralCategories.length > 1 : r && r.numbers.length > 1;
1090
- }
1091
- }, {
1092
- key: "getPluralFormsOfKey",
1093
- value: function(t, n) {
1094
- var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1095
- return this.getSuffixes(t, r).map(function(a) {
1096
- return "".concat(n).concat(a);
1097
- });
1098
- }
1099
- }, {
1100
- key: "getSuffixes",
1101
- value: function(t) {
1102
- var n = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = this.getRule(t, r);
1103
- return a ? this.shouldUseIntlApi() ? a.resolvedOptions().pluralCategories.sort(function(o, s) {
1104
- return Ze[o] - Ze[s];
1105
- }).map(function(o) {
1106
- return "".concat(n.options.prepend).concat(o);
1107
- }) : a.numbers.map(function(o) {
1108
- return n.getSuffix(t, o, r);
1109
- }) : [];
1110
- }
1111
- }, {
1112
- key: "getSuffix",
1113
- value: function(t, n) {
1114
- var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = this.getRule(t, r);
1115
- return a ? this.shouldUseIntlApi() ? "".concat(this.options.prepend).concat(a.select(n)) : this.getSuffixRetroCompatible(a, n) : (this.logger.warn("no plural rule found for: ".concat(t)), "");
1116
- }
1117
- }, {
1118
- key: "getSuffixRetroCompatible",
1119
- value: function(t, n) {
1120
- var r = this, a = t.noAbs ? t.plurals(n) : t.plurals(Math.abs(n)), o = t.numbers[a];
1121
- this.options.simplifyPluralSuffix && t.numbers.length === 2 && t.numbers[0] === 1 && (o === 2 ? o = "plural" : o === 1 && (o = ""));
1122
- var s = function() {
1123
- return r.options.prepend && o.toString() ? r.options.prepend + o.toString() : o.toString();
1124
- };
1125
- return this.options.compatibilityJSON === "v1" ? o === 1 ? "" : typeof o == "number" ? "_plural_".concat(o.toString()) : s() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && t.numbers.length === 2 && t.numbers[0] === 1 ? s() : this.options.prepend && a.toString() ? this.options.prepend + a.toString() : a.toString();
1126
- }
1127
- }, {
1128
- key: "shouldUseIntlApi",
1129
- value: function() {
1130
- return !mn.includes(this.options.compatibilityJSON);
1131
- }
1132
- }]), i;
1133
- }();
1134
- function et(i, e) {
1135
- var t = Object.keys(i);
1136
- if (Object.getOwnPropertySymbols) {
1137
- var n = Object.getOwnPropertySymbols(i);
1138
- e && (n = n.filter(function(r) {
1139
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
1140
- })), t.push.apply(t, n);
1141
- }
1142
- return t;
1143
- }
1144
- function M(i) {
1145
- for (var e = 1; e < arguments.length; e++) {
1146
- var t = arguments[e] != null ? arguments[e] : {};
1147
- e % 2 ? et(Object(t), !0).forEach(function(n) {
1148
- W(i, n, t[n]);
1149
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : et(Object(t)).forEach(function(n) {
1150
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
1151
- });
1152
- }
1153
- return i;
1154
- }
1155
- function tt(i, e, t) {
1156
- var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = an(i, e, t);
1157
- return !a && r && typeof t == "string" && (a = be(i, t, n), a === void 0 && (a = be(e, t, n))), a;
1158
- }
1159
- var wn = function() {
1160
- function i() {
1161
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1162
- B(this, i), this.logger = J.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || function(t) {
1163
- return t;
1164
- }, this.init(e);
1165
- }
1166
- return H(i, [{
1167
- key: "init",
1168
- value: function() {
1169
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1170
- t.interpolation || (t.interpolation = {
1171
- escapeValue: !0
1172
- });
1173
- var n = t.interpolation;
1174
- this.escape = n.escape !== void 0 ? n.escape : sn, this.escapeValue = n.escapeValue !== void 0 ? n.escapeValue : !0, this.useRawValueToEscape = n.useRawValueToEscape !== void 0 ? n.useRawValueToEscape : !1, this.prefix = n.prefix ? re(n.prefix) : n.prefixEscaped || "{{", this.suffix = n.suffix ? re(n.suffix) : n.suffixEscaped || "}}", this.formatSeparator = n.formatSeparator ? n.formatSeparator : n.formatSeparator || ",", this.unescapePrefix = n.unescapeSuffix ? "" : n.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : n.unescapeSuffix || "", this.nestingPrefix = n.nestingPrefix ? re(n.nestingPrefix) : n.nestingPrefixEscaped || re("$t("), this.nestingSuffix = n.nestingSuffix ? re(n.nestingSuffix) : n.nestingSuffixEscaped || re(")"), this.nestingOptionsSeparator = n.nestingOptionsSeparator ? n.nestingOptionsSeparator : n.nestingOptionsSeparator || ",", this.maxReplaces = n.maxReplaces ? n.maxReplaces : 1e3, this.alwaysFormat = n.alwaysFormat !== void 0 ? n.alwaysFormat : !1, this.resetRegExp();
1175
- }
1176
- }, {
1177
- key: "reset",
1178
- value: function() {
1179
- this.options && this.init(this.options);
1180
- }
1181
- }, {
1182
- key: "resetRegExp",
1183
- value: function() {
1184
- var t = "".concat(this.prefix, "(.+?)").concat(this.suffix);
1185
- this.regexp = new RegExp(t, "g");
1186
- var n = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
1187
- this.regexpUnescape = new RegExp(n, "g");
1188
- var r = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
1189
- this.nestingRegexp = new RegExp(r, "g");
1190
- }
1191
- }, {
1192
- key: "interpolate",
1193
- value: function(t, n, r, a) {
1194
- var o = this, s, u, d, c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
1195
- function f(w) {
1196
- return w.replace(/\$/g, "$$$$");
1197
- }
1198
- var p = function(v) {
1199
- if (v.indexOf(o.formatSeparator) < 0) {
1200
- var m = tt(n, c, v, o.options.keySeparator, o.options.ignoreJSONStructure);
1201
- return o.alwaysFormat ? o.format(m, void 0, r, M(M(M({}, a), n), {}, {
1202
- interpolationkey: v
1203
- })) : m;
1204
- }
1205
- var S = v.split(o.formatSeparator), x = S.shift().trim(), k = S.join(o.formatSeparator).trim();
1206
- return o.format(tt(n, c, x, o.options.keySeparator, o.options.ignoreJSONStructure), k, r, M(M(M({}, a), n), {}, {
1207
- interpolationkey: x
1208
- }));
1209
- };
1210
- this.resetRegExp();
1211
- var g = a && a.missingInterpolationHandler || this.options.missingInterpolationHandler, b = a && a.interpolation && a.interpolation.skipOnVariables !== void 0 ? a.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables, y = [{
1212
- regex: this.regexpUnescape,
1213
- safeValue: function(v) {
1214
- return f(v);
1215
- }
1216
- }, {
1217
- regex: this.regexp,
1218
- safeValue: function(v) {
1219
- return o.escapeValue ? f(o.escape(v)) : f(v);
1220
- }
1221
- }];
1222
- return y.forEach(function(w) {
1223
- for (d = 0; s = w.regex.exec(t); ) {
1224
- var v = s[1].trim();
1225
- if (u = p(v), u === void 0)
1226
- if (typeof g == "function") {
1227
- var m = g(t, s, a);
1228
- u = typeof m == "string" ? m : "";
1229
- } else if (a && Object.prototype.hasOwnProperty.call(a, v))
1230
- u = "";
1231
- else if (b) {
1232
- u = s[0];
1233
- continue;
1234
- } else
1235
- o.logger.warn("missed to pass in variable ".concat(v, " for interpolating ").concat(t)), u = "";
1236
- else
1237
- typeof u != "string" && !o.useRawValueToEscape && (u = ze(u));
1238
- var S = w.safeValue(u);
1239
- if (t = t.replace(s[0], S), b ? (w.regex.lastIndex += u.length, w.regex.lastIndex -= s[0].length) : w.regex.lastIndex = 0, d++, d >= o.maxReplaces)
1240
- break;
1241
- }
1242
- }), t;
1243
- }
1244
- }, {
1245
- key: "nest",
1246
- value: function(t, n) {
1247
- var r = this, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o, s, u;
1248
- function d(g, b) {
1249
- var y = this.nestingOptionsSeparator;
1250
- if (g.indexOf(y) < 0)
1251
- return g;
1252
- var w = g.split(new RegExp("".concat(y, "[ ]*{"))), v = "{".concat(w[1]);
1253
- g = w[0], v = this.interpolate(v, u);
1254
- var m = v.match(/'/g), S = v.match(/"/g);
1255
- (m && m.length % 2 === 0 && !S || S.length % 2 !== 0) && (v = v.replace(/'/g, '"'));
1256
- try {
1257
- u = JSON.parse(v), b && (u = M(M({}, b), u));
1258
- } catch (x) {
1259
- return this.logger.warn("failed parsing options string in nesting for key ".concat(g), x), "".concat(g).concat(y).concat(v);
1260
- }
1261
- return delete u.defaultValue, g;
1262
- }
1263
- for (; o = this.nestingRegexp.exec(t); ) {
1264
- var c = [];
1265
- u = M({}, a), u = u.replace && typeof u.replace != "string" ? u.replace : u, u.applyPostProcessor = !1, delete u.defaultValue;
1266
- var f = !1;
1267
- if (o[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(o[1])) {
1268
- var p = o[1].split(this.formatSeparator).map(function(g) {
1269
- return g.trim();
1270
- });
1271
- o[1] = p.shift(), c = p, f = !0;
1272
- }
1273
- if (s = n(d.call(this, o[1].trim(), u), u), s && o[0] === t && typeof s != "string")
1274
- return s;
1275
- typeof s != "string" && (s = ze(s)), s || (this.logger.warn("missed to resolve ".concat(o[1], " for nesting ").concat(t)), s = ""), f && (s = c.reduce(function(g, b) {
1276
- return r.format(g, b, a.lng, M(M({}, a), {}, {
1277
- interpolationkey: o[1].trim()
1278
- }));
1279
- }, s.trim())), t = t.replace(o[0], s), this.regexp.lastIndex = 0;
1280
- }
1281
- return t;
1282
- }
1283
- }]), i;
1284
- }();
1285
- function nt(i, e) {
1286
- var t = Object.keys(i);
1287
- if (Object.getOwnPropertySymbols) {
1288
- var n = Object.getOwnPropertySymbols(i);
1289
- e && (n = n.filter(function(r) {
1290
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
1291
- })), t.push.apply(t, n);
1292
- }
1293
- return t;
1294
- }
1295
- function G(i) {
1296
- for (var e = 1; e < arguments.length; e++) {
1297
- var t = arguments[e] != null ? arguments[e] : {};
1298
- e % 2 ? nt(Object(t), !0).forEach(function(n) {
1299
- W(i, n, t[n]);
1300
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : nt(Object(t)).forEach(function(n) {
1301
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
1302
- });
1303
- }
1304
- return i;
1305
- }
1306
- function On(i) {
1307
- var e = i.toLowerCase().trim(), t = {};
1308
- if (i.indexOf("(") > -1) {
1309
- var n = i.split("(");
1310
- e = n[0].toLowerCase().trim();
1311
- var r = n[1].substring(0, n[1].length - 1);
1312
- if (e === "currency" && r.indexOf(":") < 0)
1313
- t.currency || (t.currency = r.trim());
1314
- else if (e === "relativetime" && r.indexOf(":") < 0)
1315
- t.range || (t.range = r.trim());
1316
- else {
1317
- var a = r.split(";");
1318
- a.forEach(function(o) {
1319
- if (o) {
1320
- var s = o.split(":"), u = Zt(s), d = u[0], c = u.slice(1), f = c.join(":").trim().replace(/^'+|'+$/g, "");
1321
- t[d.trim()] || (t[d.trim()] = f), f === "false" && (t[d.trim()] = !1), f === "true" && (t[d.trim()] = !0), isNaN(f) || (t[d.trim()] = parseInt(f, 10));
1322
- }
1323
- });
1324
- }
1325
- }
1326
- return {
1327
- formatName: e,
1328
- formatOptions: t
1329
- };
1330
- }
1331
- function ie(i) {
1332
- var e = {};
1333
- return function(n, r, a) {
1334
- var o = r + JSON.stringify(a), s = e[o];
1335
- return s || (s = i(r, a), e[o] = s), s(n);
1336
- };
1337
- }
1338
- var Sn = function() {
1339
- function i() {
1340
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1341
- B(this, i), this.logger = J.create("formatter"), this.options = e, this.formats = {
1342
- number: ie(function(t, n) {
1343
- var r = new Intl.NumberFormat(t, G({}, n));
1344
- return function(a) {
1345
- return r.format(a);
1346
- };
1347
- }),
1348
- currency: ie(function(t, n) {
1349
- var r = new Intl.NumberFormat(t, G(G({}, n), {}, {
1350
- style: "currency"
1351
- }));
1352
- return function(a) {
1353
- return r.format(a);
1354
- };
1355
- }),
1356
- datetime: ie(function(t, n) {
1357
- var r = new Intl.DateTimeFormat(t, G({}, n));
1358
- return function(a) {
1359
- return r.format(a);
1360
- };
1361
- }),
1362
- relativetime: ie(function(t, n) {
1363
- var r = new Intl.RelativeTimeFormat(t, G({}, n));
1364
- return function(a) {
1365
- return r.format(a, n.range || "day");
1366
- };
1367
- }),
1368
- list: ie(function(t, n) {
1369
- var r = new Intl.ListFormat(t, G({}, n));
1370
- return function(a) {
1371
- return r.format(a);
1372
- };
1373
- })
1374
- }, this.init(e);
1375
- }
1376
- return H(i, [{
1377
- key: "init",
1378
- value: function(t) {
1379
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
1380
- interpolation: {}
1381
- }, r = n.interpolation;
1382
- this.formatSeparator = r.formatSeparator ? r.formatSeparator : r.formatSeparator || ",";
1383
- }
1384
- }, {
1385
- key: "add",
1386
- value: function(t, n) {
1387
- this.formats[t.toLowerCase().trim()] = n;
1388
- }
1389
- }, {
1390
- key: "addCached",
1391
- value: function(t, n) {
1392
- this.formats[t.toLowerCase().trim()] = ie(n);
1393
- }
1394
- }, {
1395
- key: "format",
1396
- value: function(t, n, r) {
1397
- var a = this, o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, s = n.split(this.formatSeparator), u = s.reduce(function(d, c) {
1398
- var f = On(c), p = f.formatName, g = f.formatOptions;
1399
- if (a.formats[p]) {
1400
- var b = d;
1401
- try {
1402
- var y = o && o.formatParams && o.formatParams[o.interpolationkey] || {}, w = y.locale || y.lng || o.locale || o.lng || r;
1403
- b = a.formats[p](d, w, G(G(G({}, g), o), y));
1404
- } catch (v) {
1405
- a.logger.warn(v);
1406
- }
1407
- return b;
1408
- } else
1409
- a.logger.warn("there was no format function for ".concat(p));
1410
- return d;
1411
- }, t);
1412
- return u;
1413
- }
1414
- }]), i;
1415
- }();
1416
- function rt(i, e) {
1417
- var t = Object.keys(i);
1418
- if (Object.getOwnPropertySymbols) {
1419
- var n = Object.getOwnPropertySymbols(i);
1420
- e && (n = n.filter(function(r) {
1421
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
1422
- })), t.push.apply(t, n);
1423
- }
1424
- return t;
1425
- }
1426
- function it(i) {
1427
- for (var e = 1; e < arguments.length; e++) {
1428
- var t = arguments[e] != null ? arguments[e] : {};
1429
- e % 2 ? rt(Object(t), !0).forEach(function(n) {
1430
- W(i, n, t[n]);
1431
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : rt(Object(t)).forEach(function(n) {
1432
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
1433
- });
1434
- }
1435
- return i;
1436
- }
1437
- function xn(i) {
1438
- var e = Pn();
1439
- return function() {
1440
- var n = X(i), r;
1441
- if (e) {
1442
- var a = X(this).constructor;
1443
- r = Reflect.construct(n, arguments, a);
1444
- } else
1445
- r = n.apply(this, arguments);
1446
- return de(this, r);
1447
- };
1448
- }
1449
- function Pn() {
1450
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1451
- return !1;
1452
- if (typeof Proxy == "function")
1453
- return !0;
1454
- try {
1455
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1456
- })), !0;
1457
- } catch {
1458
- return !1;
1459
- }
1460
- }
1461
- function jn(i, e) {
1462
- i.pending[e] !== void 0 && (delete i.pending[e], i.pendingCount--);
1463
- }
1464
- var kn = function(i) {
1465
- Se(t, i);
1466
- var e = xn(t);
1467
- function t(n, r, a) {
1468
- var o, s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1469
- return B(this, t), o = e.call(this), xe && Z.call(Y(o)), o.backend = n, o.store = r, o.services = a, o.languageUtils = a.languageUtils, o.options = s, o.logger = J.create("backendConnector"), o.waitingReads = [], o.maxParallelReads = s.maxParallelReads || 10, o.readingCalls = 0, o.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, o.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, o.state = {}, o.queue = [], o.backend && o.backend.init && o.backend.init(a, s.backend, s), o;
1470
- }
1471
- return H(t, [{
1472
- key: "queueLoad",
1473
- value: function(r, a, o, s) {
1474
- var u = this, d = {}, c = {}, f = {}, p = {};
1475
- return r.forEach(function(g) {
1476
- var b = !0;
1477
- a.forEach(function(y) {
1478
- var w = "".concat(g, "|").concat(y);
1479
- !o.reload && u.store.hasResourceBundle(g, y) ? u.state[w] = 2 : u.state[w] < 0 || (u.state[w] === 1 ? c[w] === void 0 && (c[w] = !0) : (u.state[w] = 1, b = !1, c[w] === void 0 && (c[w] = !0), d[w] === void 0 && (d[w] = !0), p[y] === void 0 && (p[y] = !0)));
1480
- }), b || (f[g] = !0);
1481
- }), (Object.keys(d).length || Object.keys(c).length) && this.queue.push({
1482
- pending: c,
1483
- pendingCount: Object.keys(c).length,
1484
- loaded: {},
1485
- errors: [],
1486
- callback: s
1487
- }), {
1488
- toLoad: Object.keys(d),
1489
- pending: Object.keys(c),
1490
- toLoadLanguages: Object.keys(f),
1491
- toLoadNamespaces: Object.keys(p)
1492
- };
1493
- }
1494
- }, {
1495
- key: "loaded",
1496
- value: function(r, a, o) {
1497
- var s = r.split("|"), u = s[0], d = s[1];
1498
- a && this.emit("failedLoading", u, d, a), o && this.store.addResourceBundle(u, d, o), this.state[r] = a ? -1 : 2;
1499
- var c = {};
1500
- this.queue.forEach(function(f) {
1501
- rn(f.loaded, [u], d), jn(f, r), a && f.errors.push(a), f.pendingCount === 0 && !f.done && (Object.keys(f.loaded).forEach(function(p) {
1502
- c[p] || (c[p] = {});
1503
- var g = f.loaded[p];
1504
- g.length && g.forEach(function(b) {
1505
- c[p][b] === void 0 && (c[p][b] = !0);
1506
- });
1507
- }), f.done = !0, f.errors.length ? f.callback(f.errors) : f.callback());
1508
- }), this.emit("loaded", c), this.queue = this.queue.filter(function(f) {
1509
- return !f.done;
1510
- });
1511
- }
1512
- }, {
1513
- key: "read",
1514
- value: function(r, a, o) {
1515
- var s = this, u = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, d = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, c = arguments.length > 5 ? arguments[5] : void 0;
1516
- if (!r.length)
1517
- return c(null, {});
1518
- if (this.readingCalls >= this.maxParallelReads) {
1519
- this.waitingReads.push({
1520
- lng: r,
1521
- ns: a,
1522
- fcName: o,
1523
- tried: u,
1524
- wait: d,
1525
- callback: c
1526
- });
1527
- return;
1528
- }
1529
- this.readingCalls++;
1530
- var f = function(y, w) {
1531
- if (s.readingCalls--, s.waitingReads.length > 0) {
1532
- var v = s.waitingReads.shift();
1533
- s.read(v.lng, v.ns, v.fcName, v.tried, v.wait, v.callback);
1534
- }
1535
- if (y && w && u < s.maxRetries) {
1536
- setTimeout(function() {
1537
- s.read.call(s, r, a, o, u + 1, d * 2, c);
1538
- }, d);
1539
- return;
1540
- }
1541
- c(y, w);
1542
- }, p = this.backend[o].bind(this.backend);
1543
- if (p.length === 2) {
1544
- try {
1545
- var g = p(r, a);
1546
- g && typeof g.then == "function" ? g.then(function(b) {
1547
- return f(null, b);
1548
- }).catch(f) : f(null, g);
1549
- } catch (b) {
1550
- f(b);
1551
- }
1552
- return;
1553
- }
1554
- return p(r, a, f);
1555
- }
1556
- }, {
1557
- key: "prepareLoading",
1558
- value: function(r, a) {
1559
- var o = this, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, u = arguments.length > 3 ? arguments[3] : void 0;
1560
- if (!this.backend)
1561
- return this.logger.warn("No backend was added via i18next.use. Will not load resources."), u && u();
1562
- typeof r == "string" && (r = this.languageUtils.toResolveHierarchy(r)), typeof a == "string" && (a = [a]);
1563
- var d = this.queueLoad(r, a, s, u);
1564
- if (!d.toLoad.length)
1565
- return d.pending.length || u(), null;
1566
- d.toLoad.forEach(function(c) {
1567
- o.loadOne(c);
1568
- });
1569
- }
1570
- }, {
1571
- key: "load",
1572
- value: function(r, a, o) {
1573
- this.prepareLoading(r, a, {}, o);
1574
- }
1575
- }, {
1576
- key: "reload",
1577
- value: function(r, a, o) {
1578
- this.prepareLoading(r, a, {
1579
- reload: !0
1580
- }, o);
1581
- }
1582
- }, {
1583
- key: "loadOne",
1584
- value: function(r) {
1585
- var a = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", s = r.split("|"), u = s[0], d = s[1];
1586
- this.read(u, d, "read", void 0, void 0, function(c, f) {
1587
- c && a.logger.warn("".concat(o, "loading namespace ").concat(d, " for language ").concat(u, " failed"), c), !c && f && a.logger.log("".concat(o, "loaded namespace ").concat(d, " for language ").concat(u), f), a.loaded(r, c, f);
1588
- });
1589
- }
1590
- }, {
1591
- key: "saveMissing",
1592
- value: function(r, a, o, s, u) {
1593
- var d = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, c = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : function() {
1594
- };
1595
- if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(a)) {
1596
- this.logger.warn('did not save key "'.concat(o, '" as the namespace "').concat(a, '" 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!!!");
1597
- return;
1598
- }
1599
- if (!(o == null || o === "")) {
1600
- if (this.backend && this.backend.create) {
1601
- var f = it(it({}, d), {}, {
1602
- isUpdate: u
1603
- }), p = this.backend.create.bind(this.backend);
1604
- if (p.length < 6)
1605
- try {
1606
- var g;
1607
- p.length === 5 ? g = p(r, a, o, s, f) : g = p(r, a, o, s), g && typeof g.then == "function" ? g.then(function(b) {
1608
- return c(null, b);
1609
- }).catch(c) : c(null, g);
1610
- } catch (b) {
1611
- c(b);
1612
- }
1613
- else
1614
- p(r, a, o, s, c, f);
1615
- }
1616
- !r || !r[0] || this.store.addResource(r[0], a, o, s);
1617
- }
1618
- }
1619
- }]), t;
1620
- }(Z);
1621
- function at() {
1622
- return {
1623
- debug: !1,
1624
- initImmediate: !0,
1625
- ns: ["translation"],
1626
- defaultNS: ["translation"],
1627
- fallbackLng: ["dev"],
1628
- fallbackNS: !1,
1629
- supportedLngs: !1,
1630
- nonExplicitSupportedLngs: !1,
1631
- load: "all",
1632
- preload: !1,
1633
- simplifyPluralSuffix: !0,
1634
- keySeparator: ".",
1635
- nsSeparator: ":",
1636
- pluralSeparator: "_",
1637
- contextSeparator: "_",
1638
- partialBundledLanguages: !1,
1639
- saveMissing: !1,
1640
- updateMissing: !1,
1641
- saveMissingTo: "fallback",
1642
- saveMissingPlurals: !0,
1643
- missingKeyHandler: !1,
1644
- missingInterpolationHandler: !1,
1645
- postProcess: !1,
1646
- postProcessPassResolved: !1,
1647
- returnNull: !0,
1648
- returnEmptyString: !0,
1649
- returnObjects: !1,
1650
- joinArrays: !1,
1651
- returnedObjectHandler: !1,
1652
- parseMissingKeyHandler: !1,
1653
- appendNamespaceToMissingKey: !1,
1654
- appendNamespaceToCIMode: !1,
1655
- overloadTranslationOptionHandler: function(e) {
1656
- var t = {};
1657
- if (U(e[1]) === "object" && (t = e[1]), typeof e[1] == "string" && (t.defaultValue = e[1]), typeof e[2] == "string" && (t.tDescription = e[2]), U(e[2]) === "object" || U(e[3]) === "object") {
1658
- var n = e[3] || e[2];
1659
- Object.keys(n).forEach(function(r) {
1660
- t[r] = n[r];
1661
- });
1662
- }
1663
- return t;
1664
- },
1665
- interpolation: {
1666
- escapeValue: !0,
1667
- format: function(e, t, n, r) {
1668
- return e;
1669
- },
1670
- prefix: "{{",
1671
- suffix: "}}",
1672
- formatSeparator: ",",
1673
- unescapePrefix: "-",
1674
- nestingPrefix: "$t(",
1675
- nestingSuffix: ")",
1676
- nestingOptionsSeparator: ",",
1677
- maxReplaces: 1e3,
1678
- skipOnVariables: !0
1679
- }
1680
- };
1681
- }
1682
- function ot(i) {
1683
- return typeof i.ns == "string" && (i.ns = [i.ns]), typeof i.fallbackLng == "string" && (i.fallbackLng = [i.fallbackLng]), typeof i.fallbackNS == "string" && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i;
1684
- }
1685
- function st(i, e) {
1686
- var t = Object.keys(i);
1687
- if (Object.getOwnPropertySymbols) {
1688
- var n = Object.getOwnPropertySymbols(i);
1689
- e && (n = n.filter(function(r) {
1690
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
1691
- })), t.push.apply(t, n);
1692
- }
1693
- return t;
1694
- }
1695
- function z(i) {
1696
- for (var e = 1; e < arguments.length; e++) {
1697
- var t = arguments[e] != null ? arguments[e] : {};
1698
- e % 2 ? st(Object(t), !0).forEach(function(n) {
1699
- W(i, n, t[n]);
1700
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : st(Object(t)).forEach(function(n) {
1701
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
1702
- });
1703
- }
1704
- return i;
1705
- }
1706
- function Ln(i) {
1707
- var e = Rn();
1708
- return function() {
1709
- var n = X(i), r;
1710
- if (e) {
1711
- var a = X(this).constructor;
1712
- r = Reflect.construct(n, arguments, a);
1713
- } else
1714
- r = n.apply(this, arguments);
1715
- return de(this, r);
1716
- };
1717
- }
1718
- function Rn() {
1719
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1720
- return !1;
1721
- if (typeof Proxy == "function")
1722
- return !0;
1723
- try {
1724
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1725
- })), !0;
1726
- } catch {
1727
- return !1;
1728
- }
1729
- }
1730
- function he() {
1731
- }
1732
- function En(i) {
1733
- var e = Object.getOwnPropertyNames(Object.getPrototypeOf(i));
1734
- e.forEach(function(t) {
1735
- typeof i[t] == "function" && (i[t] = i[t].bind(i));
1736
- });
1737
- }
1738
- var we = function(i) {
1739
- Se(t, i);
1740
- var e = Ln(t);
1741
- function t() {
1742
- var n, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, a = arguments.length > 1 ? arguments[1] : void 0;
1743
- if (B(this, t), n = e.call(this), xe && Z.call(Y(n)), n.options = ot(r), n.services = {}, n.logger = J, n.modules = {
1744
- external: []
1745
- }, En(Y(n)), a && !n.isInitialized && !r.isClone) {
1746
- if (!n.options.initImmediate)
1747
- return n.init(r, a), de(n, Y(n));
1748
- setTimeout(function() {
1749
- n.init(r, a);
1750
- }, 0);
1751
- }
1752
- return n;
1753
- }
1754
- return H(t, [{
1755
- key: "init",
1756
- value: function() {
1757
- var r = this, a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 ? arguments[1] : void 0;
1758
- typeof a == "function" && (o = a, a = {}), !a.defaultNS && a.defaultNS !== !1 && a.ns && (typeof a.ns == "string" ? a.defaultNS = a.ns : a.ns.indexOf("translation") < 0 && (a.defaultNS = a.ns[0]));
1759
- var s = at();
1760
- this.options = z(z(z({}, s), this.options), ot(a)), this.options.compatibilityAPI !== "v1" && (this.options.interpolation = z(z({}, s.interpolation), this.options.interpolation)), a.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = a.keySeparator), a.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = a.nsSeparator);
1761
- function u(v) {
1762
- return v ? typeof v == "function" ? new v() : v : null;
1763
- }
1764
- if (!this.options.isClone) {
1765
- this.modules.logger ? J.init(u(this.modules.logger), this.options) : J.init(null, this.options);
1766
- var d;
1767
- this.modules.formatter ? d = this.modules.formatter : typeof Intl < "u" && (d = Sn);
1768
- var c = new Ye(this.options);
1769
- this.store = new dn(this.options.resources, this.options);
1770
- var f = this.services;
1771
- f.logger = J, f.resourceStore = this.store, f.languageUtils = c, f.pluralResolver = new bn(c, {
1772
- prepend: this.options.pluralSeparator,
1773
- compatibilityJSON: this.options.compatibilityJSON,
1774
- simplifyPluralSuffix: this.options.simplifyPluralSuffix
1775
- }), d && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (f.formatter = u(d), f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new wn(this.options), f.utils = {
1776
- hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1777
- }, f.backendConnector = new kn(u(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", function(v) {
1778
- for (var m = arguments.length, S = new Array(m > 1 ? m - 1 : 0), x = 1; x < m; x++)
1779
- S[x - 1] = arguments[x];
1780
- r.emit.apply(r, [v].concat(S));
1781
- }), this.modules.languageDetector && (f.languageDetector = u(this.modules.languageDetector), f.languageDetector.init && f.languageDetector.init(f, this.options.detection, this.options)), this.modules.i18nFormat && (f.i18nFormat = u(this.modules.i18nFormat), f.i18nFormat.init && f.i18nFormat.init(this)), this.translator = new Qe(this.services, this.options), this.translator.on("*", function(v) {
1782
- for (var m = arguments.length, S = new Array(m > 1 ? m - 1 : 0), x = 1; x < m; x++)
1783
- S[x - 1] = arguments[x];
1784
- r.emit.apply(r, [v].concat(S));
1785
- }), this.modules.external.forEach(function(v) {
1786
- v.init && v.init(r);
1787
- });
1788
- }
1789
- if (this.format = this.options.interpolation.format, o || (o = he), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1790
- var p = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1791
- p.length > 0 && p[0] !== "dev" && (this.options.lng = p[0]);
1792
- }
1793
- !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined");
1794
- var g = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"];
1795
- g.forEach(function(v) {
1796
- r[v] = function() {
1797
- var m;
1798
- return (m = r.store)[v].apply(m, arguments);
1799
- };
1800
- });
1801
- var b = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"];
1802
- b.forEach(function(v) {
1803
- r[v] = function() {
1804
- var m;
1805
- return (m = r.store)[v].apply(m, arguments), r;
1806
- };
1807
- });
1808
- var y = se(), w = function() {
1809
- var m = function(x, k) {
1810
- r.isInitialized && !r.initializedStoreOnce && r.logger.warn("init: i18next is already initialized. You should call init just once!"), r.isInitialized = !0, r.options.isClone || r.logger.log("initialized", r.options), r.emit("initialized", r.options), y.resolve(k), o(x, k);
1811
- };
1812
- if (r.languages && r.options.compatibilityAPI !== "v1" && !r.isInitialized)
1813
- return m(null, r.t.bind(r));
1814
- r.changeLanguage(r.options.lng, m);
1815
- };
1816
- return this.options.resources || !this.options.initImmediate ? w() : setTimeout(w, 0), y;
1817
- }
1818
- }, {
1819
- key: "loadResources",
1820
- value: function(r) {
1821
- var a = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : he, s = o, u = typeof r == "string" ? r : this.language;
1822
- if (typeof r == "function" && (s = r), !this.options.resources || this.options.partialBundledLanguages) {
1823
- if (u && u.toLowerCase() === "cimode")
1824
- return s();
1825
- var d = [], c = function(g) {
1826
- if (g) {
1827
- var b = a.services.languageUtils.toResolveHierarchy(g);
1828
- b.forEach(function(y) {
1829
- d.indexOf(y) < 0 && d.push(y);
1830
- });
1831
- }
1832
- };
1833
- if (u)
1834
- c(u);
1835
- else {
1836
- var f = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1837
- f.forEach(function(p) {
1838
- return c(p);
1839
- });
1840
- }
1841
- this.options.preload && this.options.preload.forEach(function(p) {
1842
- return c(p);
1843
- }), this.services.backendConnector.load(d, this.options.ns, function(p) {
1844
- !p && !a.resolvedLanguage && a.language && a.setResolvedLanguage(a.language), s(p);
1845
- });
1846
- } else
1847
- s(null);
1848
- }
1849
- }, {
1850
- key: "reloadResources",
1851
- value: function(r, a, o) {
1852
- var s = se();
1853
- return r || (r = this.languages), a || (a = this.options.ns), o || (o = he), this.services.backendConnector.reload(r, a, function(u) {
1854
- s.resolve(), o(u);
1855
- }), s;
1856
- }
1857
- }, {
1858
- key: "use",
1859
- value: function(r) {
1860
- if (!r)
1861
- throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1862
- if (!r.type)
1863
- throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1864
- return r.type === "backend" && (this.modules.backend = r), (r.type === "logger" || r.log && r.warn && r.error) && (this.modules.logger = r), r.type === "languageDetector" && (this.modules.languageDetector = r), r.type === "i18nFormat" && (this.modules.i18nFormat = r), r.type === "postProcessor" && _t.addPostProcessor(r), r.type === "formatter" && (this.modules.formatter = r), r.type === "3rdParty" && this.modules.external.push(r), this;
1865
- }
1866
- }, {
1867
- key: "setResolvedLanguage",
1868
- value: function(r) {
1869
- if (!(!r || !this.languages) && !(["cimode", "dev"].indexOf(r) > -1))
1870
- for (var a = 0; a < this.languages.length; a++) {
1871
- var o = this.languages[a];
1872
- if (!(["cimode", "dev"].indexOf(o) > -1) && this.store.hasLanguageSomeTranslations(o)) {
1873
- this.resolvedLanguage = o;
1874
- break;
1875
- }
1876
- }
1877
- }
1878
- }, {
1879
- key: "changeLanguage",
1880
- value: function(r, a) {
1881
- var o = this;
1882
- this.isLanguageChangingTo = r;
1883
- var s = se();
1884
- this.emit("languageChanging", r);
1885
- var u = function(p) {
1886
- o.language = p, o.languages = o.services.languageUtils.toResolveHierarchy(p), o.resolvedLanguage = void 0, o.setResolvedLanguage(p);
1887
- }, d = function(p, g) {
1888
- g ? (u(g), o.translator.changeLanguage(g), o.isLanguageChangingTo = void 0, o.emit("languageChanged", g), o.logger.log("languageChanged", g)) : o.isLanguageChangingTo = void 0, s.resolve(function() {
1889
- return o.t.apply(o, arguments);
1890
- }), a && a(p, function() {
1891
- return o.t.apply(o, arguments);
1892
- });
1893
- }, c = function(p) {
1894
- !r && !p && o.services.languageDetector && (p = []);
1895
- var g = typeof p == "string" ? p : o.services.languageUtils.getBestMatchFromCodes(p);
1896
- g && (o.language || u(g), o.translator.language || o.translator.changeLanguage(g), o.services.languageDetector && o.services.languageDetector.cacheUserLanguage && o.services.languageDetector.cacheUserLanguage(g)), o.loadResources(g, function(b) {
1897
- d(b, g);
1898
- });
1899
- };
1900
- return !r && this.services.languageDetector && !this.services.languageDetector.async ? c(this.services.languageDetector.detect()) : !r && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(c) : this.services.languageDetector.detect(c) : c(r), s;
1901
- }
1902
- }, {
1903
- key: "getFixedT",
1904
- value: function(r, a, o) {
1905
- var s = this, u = function d(c, f) {
1906
- var p;
1907
- if (U(f) !== "object") {
1908
- for (var g = arguments.length, b = new Array(g > 2 ? g - 2 : 0), y = 2; y < g; y++)
1909
- b[y - 2] = arguments[y];
1910
- p = s.options.overloadTranslationOptionHandler([c, f].concat(b));
1911
- } else
1912
- p = z({}, f);
1913
- p.lng = p.lng || d.lng, p.lngs = p.lngs || d.lngs, p.ns = p.ns || d.ns, p.keyPrefix = p.keyPrefix || o || d.keyPrefix;
1914
- var w = s.options.keySeparator || ".", v;
1915
- return p.keyPrefix && Array.isArray(c) ? v = c.map(function(m) {
1916
- return "".concat(p.keyPrefix).concat(w).concat(m);
1917
- }) : v = p.keyPrefix ? "".concat(p.keyPrefix).concat(w).concat(c) : c, s.t(v, p);
1918
- };
1919
- return typeof r == "string" ? u.lng = r : u.lngs = r, u.ns = a, u.keyPrefix = o, u;
1920
- }
1921
- }, {
1922
- key: "t",
1923
- value: function() {
1924
- var r;
1925
- return this.translator && (r = this.translator).translate.apply(r, arguments);
1926
- }
1927
- }, {
1928
- key: "exists",
1929
- value: function() {
1930
- var r;
1931
- return this.translator && (r = this.translator).exists.apply(r, arguments);
1932
- }
1933
- }, {
1934
- key: "setDefaultNamespace",
1935
- value: function(r) {
1936
- this.options.defaultNS = r;
1937
- }
1938
- }, {
1939
- key: "hasLoadedNamespace",
1940
- value: function(r) {
1941
- var a = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1942
- if (!this.isInitialized)
1943
- return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1944
- if (!this.languages || !this.languages.length)
1945
- return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1946
- var s = o.lng || this.resolvedLanguage || this.languages[0], u = this.options ? this.options.fallbackLng : !1, d = this.languages[this.languages.length - 1];
1947
- if (s.toLowerCase() === "cimode")
1948
- return !0;
1949
- var c = function(g, b) {
1950
- var y = a.services.backendConnector.state["".concat(g, "|").concat(b)];
1951
- return y === -1 || y === 2;
1952
- };
1953
- if (o.precheck) {
1954
- var f = o.precheck(this, c);
1955
- if (f !== void 0)
1956
- return f;
1957
- }
1958
- return !!(this.hasResourceBundle(s, r) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || c(s, r) && (!u || c(d, r)));
1959
- }
1960
- }, {
1961
- key: "loadNamespaces",
1962
- value: function(r, a) {
1963
- var o = this, s = se();
1964
- return this.options.ns ? (typeof r == "string" && (r = [r]), r.forEach(function(u) {
1965
- o.options.ns.indexOf(u) < 0 && o.options.ns.push(u);
1966
- }), this.loadResources(function(u) {
1967
- s.resolve(), a && a(u);
1968
- }), s) : (a && a(), Promise.resolve());
1969
- }
1970
- }, {
1971
- key: "loadLanguages",
1972
- value: function(r, a) {
1973
- var o = se();
1974
- typeof r == "string" && (r = [r]);
1975
- var s = this.options.preload || [], u = r.filter(function(d) {
1976
- return s.indexOf(d) < 0;
1977
- });
1978
- return u.length ? (this.options.preload = s.concat(u), this.loadResources(function(d) {
1979
- o.resolve(), a && a(d);
1980
- }), o) : (a && a(), Promise.resolve());
1981
- }
1982
- }, {
1983
- key: "dir",
1984
- value: function(r) {
1985
- if (r || (r = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !r)
1986
- return "rtl";
1987
- var a = ["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"], o = this.services && this.services.languageUtils || new Ye(at());
1988
- return a.indexOf(o.getLanguagePartFromCode(r)) > -1 || r.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1989
- }
1990
- }, {
1991
- key: "cloneInstance",
1992
- value: function() {
1993
- var r = this, a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : he, s = z(z(z({}, this.options), a), {
1994
- isClone: !0
1995
- }), u = new t(s);
1996
- (a.debug !== void 0 || a.prefix !== void 0) && (u.logger = u.logger.clone(a));
1997
- var d = ["store", "services", "language"];
1998
- return d.forEach(function(c) {
1999
- u[c] = r[c];
2000
- }), u.services = z({}, this.services), u.services.utils = {
2001
- hasLoadedNamespace: u.hasLoadedNamespace.bind(u)
2002
- }, u.translator = new Qe(u.services, u.options), u.translator.on("*", function(c) {
2003
- for (var f = arguments.length, p = new Array(f > 1 ? f - 1 : 0), g = 1; g < f; g++)
2004
- p[g - 1] = arguments[g];
2005
- u.emit.apply(u, [c].concat(p));
2006
- }), u.init(s, o), u.translator.options = u.options, u.translator.backendConnector.services.utils = {
2007
- hasLoadedNamespace: u.hasLoadedNamespace.bind(u)
2008
- }, u;
2009
- }
2010
- }, {
2011
- key: "toJSON",
2012
- value: function() {
2013
- return {
2014
- options: this.options,
2015
- store: this.store,
2016
- language: this.language,
2017
- languages: this.languages,
2018
- resolvedLanguage: this.resolvedLanguage
2019
- };
2020
- }
2021
- }]), t;
2022
- }(Z);
2023
- W(we, "createInstance", function() {
2024
- var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 ? arguments[1] : void 0;
2025
- return new we(i, e);
2026
- });
2027
- var N = we.createInstance();
2028
- N.createInstance = we.createInstance;
2029
- N.createInstance;
2030
- N.dir;
2031
- N.init;
2032
- N.loadResources;
2033
- N.reloadResources;
2034
- N.use;
2035
- N.changeLanguage;
2036
- N.getFixedT;
2037
- var Dr = N.t;
2038
- N.exists;
2039
- N.setDefaultNamespace;
2040
- N.hasLoadedNamespace;
2041
- N.loadNamespaces;
2042
- N.loadLanguages;
2043
- var Nt = [], Cn = Nt.forEach, _n = Nt.slice;
2044
- function Nn(i) {
2045
- return Cn.call(_n.call(arguments, 1), function(e) {
2046
- if (e)
2047
- for (var t in e)
2048
- i[t] === void 0 && (i[t] = e[t]);
2049
- }), i;
2050
- }
2051
- var ut = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, An = function(e, t, n) {
2052
- var r = n || {};
2053
- r.path = r.path || "/";
2054
- var a = encodeURIComponent(t), o = "".concat(e, "=").concat(a);
2055
- if (r.maxAge > 0) {
2056
- var s = r.maxAge - 0;
2057
- if (Number.isNaN(s))
2058
- throw new Error("maxAge should be a Number");
2059
- o += "; Max-Age=".concat(Math.floor(s));
2060
- }
2061
- if (r.domain) {
2062
- if (!ut.test(r.domain))
2063
- throw new TypeError("option domain is invalid");
2064
- o += "; Domain=".concat(r.domain);
2065
- }
2066
- if (r.path) {
2067
- if (!ut.test(r.path))
2068
- throw new TypeError("option path is invalid");
2069
- o += "; Path=".concat(r.path);
2070
- }
2071
- if (r.expires) {
2072
- if (typeof r.expires.toUTCString != "function")
2073
- throw new TypeError("option expires is invalid");
2074
- o += "; Expires=".concat(r.expires.toUTCString());
2075
- }
2076
- if (r.httpOnly && (o += "; HttpOnly"), r.secure && (o += "; Secure"), r.sameSite) {
2077
- var u = typeof r.sameSite == "string" ? r.sameSite.toLowerCase() : r.sameSite;
2078
- switch (u) {
2079
- case !0:
2080
- o += "; SameSite=Strict";
2081
- break;
2082
- case "lax":
2083
- o += "; SameSite=Lax";
2084
- break;
2085
- case "strict":
2086
- o += "; SameSite=Strict";
2087
- break;
2088
- case "none":
2089
- o += "; SameSite=None";
2090
- break;
2091
- default:
2092
- throw new TypeError("option sameSite is invalid");
2093
- }
2094
- }
2095
- return o;
2096
- }, ft = {
2097
- create: function(e, t, n, r) {
2098
- var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
2099
- path: "/",
2100
- sameSite: "strict"
2101
- };
2102
- n && (a.expires = /* @__PURE__ */ new Date(), a.expires.setTime(a.expires.getTime() + n * 60 * 1e3)), r && (a.domain = r), document.cookie = An(e, encodeURIComponent(t), a);
2103
- },
2104
- read: function(e) {
2105
- for (var t = "".concat(e, "="), n = document.cookie.split(";"), r = 0; r < n.length; r++) {
2106
- for (var a = n[r]; a.charAt(0) === " "; )
2107
- a = a.substring(1, a.length);
2108
- if (a.indexOf(t) === 0)
2109
- return a.substring(t.length, a.length);
2110
- }
2111
- return null;
2112
- },
2113
- remove: function(e) {
2114
- this.create(e, "", -1);
2115
- }
2116
- }, Tn = {
2117
- name: "cookie",
2118
- lookup: function(e) {
2119
- var t;
2120
- if (e.lookupCookie && typeof document < "u") {
2121
- var n = ft.read(e.lookupCookie);
2122
- n && (t = n);
2123
- }
2124
- return t;
2125
- },
2126
- cacheUserLanguage: function(e, t) {
2127
- t.lookupCookie && typeof document < "u" && ft.create(t.lookupCookie, e, t.cookieMinutes, t.cookieDomain, t.cookieOptions);
2128
- }
2129
- }, Dn = {
2130
- name: "querystring",
2131
- lookup: function(e) {
2132
- var t;
2133
- if (typeof window < "u") {
2134
- var n = window.location.search;
2135
- !window.location.search && window.location.hash && window.location.hash.indexOf("?") > -1 && (n = window.location.hash.substring(window.location.hash.indexOf("?")));
2136
- for (var r = n.substring(1), a = r.split("&"), o = 0; o < a.length; o++) {
2137
- var s = a[o].indexOf("=");
2138
- if (s > 0) {
2139
- var u = a[o].substring(0, s);
2140
- u === e.lookupQuerystring && (t = a[o].substring(s + 1));
2141
- }
2142
- }
2143
- }
2144
- return t;
2145
- }
2146
- }, ue = null, ct = function() {
2147
- if (ue !== null)
2148
- return ue;
2149
- try {
2150
- ue = window !== "undefined" && window.localStorage !== null;
2151
- var e = "i18next.translate.boo";
2152
- window.localStorage.setItem(e, "foo"), window.localStorage.removeItem(e);
2153
- } catch {
2154
- ue = !1;
2155
- }
2156
- return ue;
2157
- }, In = {
2158
- name: "localStorage",
2159
- lookup: function(e) {
2160
- var t;
2161
- if (e.lookupLocalStorage && ct()) {
2162
- var n = window.localStorage.getItem(e.lookupLocalStorage);
2163
- n && (t = n);
2164
- }
2165
- return t;
2166
- },
2167
- cacheUserLanguage: function(e, t) {
2168
- t.lookupLocalStorage && ct() && window.localStorage.setItem(t.lookupLocalStorage, e);
2169
- }
2170
- }, fe = null, lt = function() {
2171
- if (fe !== null)
2172
- return fe;
2173
- try {
2174
- fe = window !== "undefined" && window.sessionStorage !== null;
2175
- var e = "i18next.translate.boo";
2176
- window.sessionStorage.setItem(e, "foo"), window.sessionStorage.removeItem(e);
2177
- } catch {
2178
- fe = !1;
2179
- }
2180
- return fe;
2181
- }, Fn = {
2182
- name: "sessionStorage",
2183
- lookup: function(e) {
2184
- var t;
2185
- if (e.lookupSessionStorage && lt()) {
2186
- var n = window.sessionStorage.getItem(e.lookupSessionStorage);
2187
- n && (t = n);
2188
- }
2189
- return t;
2190
- },
2191
- cacheUserLanguage: function(e, t) {
2192
- t.lookupSessionStorage && lt() && window.sessionStorage.setItem(t.lookupSessionStorage, e);
2193
- }
2194
- }, Un = {
2195
- name: "navigator",
2196
- lookup: function(e) {
2197
- var t = [];
2198
- if (typeof navigator < "u") {
2199
- if (navigator.languages)
2200
- for (var n = 0; n < navigator.languages.length; n++)
2201
- t.push(navigator.languages[n]);
2202
- navigator.userLanguage && t.push(navigator.userLanguage), navigator.language && t.push(navigator.language);
2203
- }
2204
- return t.length > 0 ? t : void 0;
2205
- }
2206
- }, Bn = {
2207
- name: "htmlTag",
2208
- lookup: function(e) {
2209
- var t, n = e.htmlTag || (typeof document < "u" ? document.documentElement : null);
2210
- return n && typeof n.getAttribute == "function" && (t = n.getAttribute("lang")), t;
2211
- }
2212
- }, Hn = {
2213
- name: "path",
2214
- lookup: function(e) {
2215
- var t;
2216
- if (typeof window < "u") {
2217
- var n = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
2218
- if (n instanceof Array)
2219
- if (typeof e.lookupFromPathIndex == "number") {
2220
- if (typeof n[e.lookupFromPathIndex] != "string")
2221
- return;
2222
- t = n[e.lookupFromPathIndex].replace("/", "");
2223
- } else
2224
- t = n[0].replace("/", "");
2225
- }
2226
- return t;
2227
- }
2228
- }, Mn = {
2229
- name: "subdomain",
2230
- lookup: function(e) {
2231
- var t = typeof e.lookupFromSubdomainIndex == "number" ? e.lookupFromSubdomainIndex + 1 : 1, n = typeof window < "u" && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
2232
- if (n)
2233
- return n[t];
2234
- }
2235
- }, At = !1;
2236
- try {
2237
- document.cookie, At = !0;
2238
- } catch {
2239
- }
2240
- var Tt = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
2241
- At || Tt.splice(1, 1);
2242
- function $n() {
2243
- return {
2244
- order: Tt,
2245
- lookupQuerystring: "lng",
2246
- lookupCookie: "i18next",
2247
- lookupLocalStorage: "i18nextLng",
2248
- lookupSessionStorage: "i18nextLng",
2249
- // cache user language
2250
- caches: ["localStorage"],
2251
- excludeCacheFor: ["cimode"],
2252
- // cookieMinutes: 10,
2253
- // cookieDomain: 'myDomain'
2254
- convertDetectedLanguage: function(e) {
2255
- return e;
2256
- }
2257
- };
2258
- }
2259
- var Dt = /* @__PURE__ */ function() {
2260
- function i(e) {
2261
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2262
- B(this, i), this.type = "languageDetector", this.detectors = {}, this.init(e, t);
2263
- }
2264
- return H(i, [{
2265
- key: "init",
2266
- value: function(t) {
2267
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2268
- this.services = t || {
2269
- languageUtils: {}
2270
- }, this.options = Nn(n, this.options || {}, $n()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = function(a) {
2271
- return a.replace("-", "_");
2272
- }), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = r, this.addDetector(Tn), this.addDetector(Dn), this.addDetector(In), this.addDetector(Fn), this.addDetector(Un), this.addDetector(Bn), this.addDetector(Hn), this.addDetector(Mn);
2273
- }
2274
- }, {
2275
- key: "addDetector",
2276
- value: function(t) {
2277
- return this.detectors[t.name] = t, this;
2278
- }
2279
- }, {
2280
- key: "detect",
2281
- value: function(t) {
2282
- var n = this;
2283
- t || (t = this.options.order);
2284
- var r = [];
2285
- return t.forEach(function(a) {
2286
- if (n.detectors[a]) {
2287
- var o = n.detectors[a].lookup(n.options);
2288
- o && typeof o == "string" && (o = [o]), o && (r = r.concat(o));
2289
- }
2290
- }), r = r.map(function(a) {
2291
- return n.options.convertDetectedLanguage(a);
2292
- }), this.services.languageUtils.getBestMatchFromCodes ? r : r.length > 0 ? r[0] : null;
2293
- }
2294
- }, {
2295
- key: "cacheUserLanguage",
2296
- value: function(t, n) {
2297
- var r = this;
2298
- n || (n = this.options.caches), n && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(t) > -1 || n.forEach(function(a) {
2299
- r.detectors[a] && r.detectors[a].cacheUserLanguage(t, r.options);
2300
- }));
2301
- }
2302
- }]);
2303
- }();
2304
- Dt.type = "languageDetector";
2305
- function qn() {
2306
- if (console && console.warn) {
2307
- for (var i, e = arguments.length, t = new Array(e), n = 0; n < e; n++)
2308
- t[n] = arguments[n];
2309
- typeof t[0] == "string" && (t[0] = "react-i18next:: ".concat(t[0])), (i = console).warn.apply(i, t);
2310
- }
2311
- }
2312
- var dt = {};
2313
- function Ne() {
2314
- for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
2315
- e[t] = arguments[t];
2316
- typeof e[0] == "string" && dt[e[0]] || (typeof e[0] == "string" && (dt[e[0]] = /* @__PURE__ */ new Date()), qn.apply(void 0, e));
2317
- }
2318
- var It = function(e, t) {
2319
- return function() {
2320
- if (e.isInitialized)
2321
- t();
2322
- else {
2323
- var n = function r() {
2324
- setTimeout(function() {
2325
- e.off("initialized", r);
2326
- }, 0), t();
2327
- };
2328
- e.on("initialized", n);
2329
- }
2330
- };
2331
- };
2332
- function pt(i, e, t) {
2333
- i.loadNamespaces(e, It(i, t));
2334
- }
2335
- function gt(i, e, t, n) {
2336
- typeof t == "string" && (t = [t]), t.forEach(function(r) {
2337
- i.options.ns.indexOf(r) < 0 && i.options.ns.push(r);
2338
- }), i.loadLanguages(e, It(i, n));
2339
- }
2340
- function Kn(i, e) {
2341
- var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = e.languages[0], r = e.options ? e.options.fallbackLng : !1, a = e.languages[e.languages.length - 1];
2342
- if (n.toLowerCase() === "cimode")
2343
- return !0;
2344
- var o = function(u, d) {
2345
- var c = e.services.backendConnector.state["".concat(u, "|").concat(d)];
2346
- return c === -1 || c === 2;
2347
- };
2348
- return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !o(e.isLanguageChangingTo, i) ? !1 : !!(e.hasResourceBundle(n, i) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || o(n, i) && (!r || o(a, i)));
2349
- }
2350
- function Vn(i, e) {
2351
- var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2352
- if (!e.languages || !e.languages.length)
2353
- return Ne("i18n.languages were undefined or empty", e.languages), !0;
2354
- var n = e.options.ignoreJSONStructure !== void 0;
2355
- return n ? e.hasLoadedNamespace(i, {
2356
- lng: t.lng,
2357
- precheck: function(a, o) {
2358
- if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && a.services.backendConnector.backend && a.isLanguageChangingTo && !o(a.isLanguageChangingTo, i))
2359
- return !1;
2360
- }
2361
- }) : Kn(i, e, t);
2362
- }
2363
- var zn = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, Jn = {
2364
- "&amp;": "&",
2365
- "&#38;": "&",
2366
- "&lt;": "<",
2367
- "&#60;": "<",
2368
- "&gt;": ">",
2369
- "&#62;": ">",
2370
- "&apos;": "'",
2371
- "&#39;": "'",
2372
- "&quot;": '"',
2373
- "&#34;": '"',
2374
- "&nbsp;": " ",
2375
- "&#160;": " ",
2376
- "&copy;": "©",
2377
- "&#169;": "©",
2378
- "&reg;": "®",
2379
- "&#174;": "®",
2380
- "&hellip;": "…",
2381
- "&#8230;": "…",
2382
- "&#x2F;": "/",
2383
- "&#47;": "/"
2384
- }, Xn = function(e) {
2385
- return Jn[e];
2386
- }, Wn = function(e) {
2387
- return e.replace(zn, Xn);
2388
- };
2389
- function ht(i, e) {
2390
- var t = Object.keys(i);
2391
- if (Object.getOwnPropertySymbols) {
2392
- var n = Object.getOwnPropertySymbols(i);
2393
- e && (n = n.filter(function(r) {
2394
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
2395
- })), t.push.apply(t, n);
2396
- }
2397
- return t;
2398
- }
2399
- function vt(i) {
2400
- for (var e = 1; e < arguments.length; e++) {
2401
- var t = arguments[e] != null ? arguments[e] : {};
2402
- e % 2 ? ht(Object(t), !0).forEach(function(n) {
2403
- W(i, n, t[n]);
2404
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : ht(Object(t)).forEach(function(n) {
2405
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
2406
- });
2407
- }
2408
- return i;
2409
- }
2410
- var Ae = {
2411
- bindI18n: "languageChanged",
2412
- bindI18nStore: "",
2413
- transEmptyNodeValue: "",
2414
- transSupportBasicHtmlNodes: !0,
2415
- transWrapTextNodes: "",
2416
- transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
2417
- useSuspense: !0,
2418
- unescape: Wn
2419
- };
2420
- function Gn() {
2421
- var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2422
- Ae = vt(vt({}, Ae), i);
2423
- }
2424
- function Qn() {
2425
- return Ae;
2426
- }
2427
- var Ft;
2428
- function Yn(i) {
2429
- Ft = i;
2430
- }
2431
- function Zn() {
2432
- return Ft;
2433
- }
2434
- var er = {
2435
- type: "3rdParty",
2436
- init: function(e) {
2437
- Gn(e.options.react), Yn(e);
2438
- }
2439
- }, Ut = $.createContext(), tr = function() {
2440
- function i() {
2441
- B(this, i), this.usedNamespaces = {};
2442
- }
2443
- return H(i, [{
2444
- key: "addUsedNamespaces",
2445
- value: function(t) {
2446
- var n = this;
2447
- t.forEach(function(r) {
2448
- n.usedNamespaces[r] || (n.usedNamespaces[r] = !0);
2449
- });
2450
- }
2451
- }, {
2452
- key: "getUsedNamespaces",
2453
- value: function() {
2454
- return Object.keys(this.usedNamespaces);
2455
- }
2456
- }]), i;
2457
- }();
2458
- function nr(i, e) {
2459
- var t = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
2460
- if (t != null) {
2461
- var n, r, a, o, s = [], u = !0, d = !1;
2462
- try {
2463
- if (a = (t = t.call(i)).next, e !== 0)
2464
- for (; !(u = (n = a.call(t)).done) && (s.push(n.value), s.length !== e); u = !0)
2465
- ;
2466
- } catch (c) {
2467
- d = !0, r = c;
2468
- } finally {
2469
- try {
2470
- if (!u && t.return != null && (o = t.return(), Object(o) !== o))
2471
- return;
2472
- } finally {
2473
- if (d)
2474
- throw r;
2475
- }
2476
- }
2477
- return s;
2478
- }
2479
- }
2480
- function rr(i, e) {
2481
- return Lt(i) || nr(i, e) || Rt(i, e) || Et();
2482
- }
2483
- function mt(i, e) {
2484
- var t = Object.keys(i);
2485
- if (Object.getOwnPropertySymbols) {
2486
- var n = Object.getOwnPropertySymbols(i);
2487
- e && (n = n.filter(function(r) {
2488
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
2489
- })), t.push.apply(t, n);
2490
- }
2491
- return t;
2492
- }
2493
- function Ce(i) {
2494
- for (var e = 1; e < arguments.length; e++) {
2495
- var t = arguments[e] != null ? arguments[e] : {};
2496
- e % 2 ? mt(Object(t), !0).forEach(function(n) {
2497
- W(i, n, t[n]);
2498
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : mt(Object(t)).forEach(function(n) {
2499
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
2500
- });
2501
- }
2502
- return i;
2503
- }
2504
- var ir = function(e, t) {
2505
- var n = $.useRef();
2506
- return $.useEffect(function() {
2507
- n.current = e;
2508
- }, [e, t]), n.current;
2509
- };
2510
- function ar(i) {
2511
- var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = e.i18n, n = $.useContext(Ut) || {}, r = n.i18n, a = n.defaultNS, o = t || r || Zn();
2512
- if (o && !o.reportNamespaces && (o.reportNamespaces = new tr()), !o) {
2513
- Ne("You will need to pass in an i18next instance by using initReactI18next");
2514
- var s = function(R, C) {
2515
- return typeof C == "string" ? C : C && U(C) === "object" && typeof C.defaultValue == "string" ? C.defaultValue : Array.isArray(R) ? R[R.length - 1] : R;
2516
- }, u = [s, {}, !1];
2517
- return u.t = s, u.i18n = {}, u.ready = !1, u;
2518
- }
2519
- o.options.react && o.options.react.wait !== void 0 && Ne("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
2520
- var d = Ce(Ce(Ce({}, Qn()), o.options.react), e), c = d.useSuspense, f = d.keyPrefix, p = a || o.options && o.options.defaultNS;
2521
- p = typeof p == "string" ? [p] : p || ["translation"], o.reportNamespaces.addUsedNamespaces && o.reportNamespaces.addUsedNamespaces(p);
2522
- var g = (o.isInitialized || o.initializedStoreOnce) && p.every(function(_) {
2523
- return Vn(_, o, d);
2524
- });
2525
- function b() {
2526
- return o.getFixedT(e.lng || null, d.nsMode === "fallback" ? p : p[0], f);
2527
- }
2528
- var y = $.useState(b), w = rr(y, 2), v = w[0], m = w[1], S = p.join();
2529
- e.lng && (S = "".concat(e.lng).concat(S));
2530
- var x = ir(S), k = $.useRef(!0);
2531
- $.useEffect(function() {
2532
- var _ = d.bindI18n, R = d.bindI18nStore;
2533
- k.current = !0, !g && !c && (e.lng ? gt(o, e.lng, p, function() {
2534
- k.current && m(b);
2535
- }) : pt(o, p, function() {
2536
- k.current && m(b);
2537
- })), g && x && x !== S && k.current && m(b);
2538
- function C() {
2539
- k.current && m(b);
2540
- }
2541
- return _ && o && o.on(_, C), R && o && o.store.on(R, C), function() {
2542
- k.current = !1, _ && o && _.split(" ").forEach(function(Q) {
2543
- return o.off(Q, C);
2544
- }), R && o && R.split(" ").forEach(function(Q) {
2545
- return o.store.off(Q, C);
2546
- });
2547
- };
2548
- }, [o, S]);
2549
- var D = $.useRef(!0);
2550
- $.useEffect(function() {
2551
- k.current && !D.current && m(b), D.current = !1;
2552
- }, [o, f]);
2553
- var I = [v, o, g];
2554
- if (I.t = v, I.i18n = o, I.ready = g, g || !g && !c)
2555
- return I;
2556
- throw new Promise(function(_) {
2557
- e.lng ? gt(o, e.lng, p, function() {
2558
- return _();
2559
- }) : pt(o, p, function() {
2560
- return _();
2561
- });
2562
- });
2563
- }
2564
- function or(i) {
2565
- var e = i.i18n, t = i.defaultNS, n = i.children, r = $.useMemo(function() {
2566
- return {
2567
- i18n: e,
2568
- defaultNS: t
2569
- };
2570
- }, [e, t]);
2571
- return $.createElement(Ut.Provider, {
2572
- value: r
2573
- }, n);
2574
- }
2575
- var Bt = [], sr = Bt.forEach, ur = Bt.slice;
2576
- function fr(i) {
2577
- return sr.call(ur.call(arguments, 1), function(e) {
2578
- if (e)
2579
- for (var t in e)
2580
- i[t] === void 0 && (i[t] = e[t]);
2581
- }), i;
2582
- }
2583
- function cr(i) {
2584
- return i ? typeof i == "function" ? new i() : i : null;
2585
- }
2586
- function lr() {
2587
- return {
2588
- handleEmptyResourcesAsFailed: !0,
2589
- cacheHitMode: "none"
2590
- // reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000
2591
- // refreshExpirationTime: 60 * 60 * 1000
2592
- };
2593
- }
2594
- function yt(i, e, t, n) {
2595
- var r = i.read.bind(i);
2596
- if (r.length === 2) {
2597
- try {
2598
- var a = r(e, t);
2599
- a && typeof a.then == "function" ? a.then(function(o) {
2600
- return n(null, o);
2601
- }).catch(n) : n(null, a);
2602
- } catch (o) {
2603
- n(o);
2604
- }
2605
- return;
2606
- }
2607
- r(e, t, n);
2608
- }
2609
- var Ht = /* @__PURE__ */ function() {
2610
- function i(e) {
2611
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2612
- B(this, i), this.backends = [], this.type = "backend", this.allOptions = n, this.init(e, t);
2613
- }
2614
- return H(i, [{
2615
- key: "init",
2616
- value: function(t) {
2617
- var n = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2618
- this.services = t, this.options = fr(r, this.options || {}, lr()), this.allOptions = a, this.options.backends && this.options.backends.forEach(function(o, s) {
2619
- n.backends[s] = n.backends[s] || cr(o), n.backends[s].init(t, n.options.backendOptions && n.options.backendOptions[s] || {}, a);
2620
- }), this.services && this.options.reloadInterval && setInterval(function() {
2621
- return n.reload();
2622
- }, this.options.reloadInterval);
2623
- }
2624
- }, {
2625
- key: "read",
2626
- value: function(t, n, r) {
2627
- var a = this, o = this.backends.length, s = function d(c) {
2628
- if (c >= o)
2629
- return r(new Error("non of the backend loaded data", !0));
2630
- var f = c === o - 1, p = a.options.handleEmptyResourcesAsFailed && !f ? 0 : -1, g = a.backends[c];
2631
- g.read ? yt(g, t, n, function(b, y, w) {
2632
- if (!b && y && Object.keys(y).length > p) {
2633
- if (r(null, y, c), u(c - 1, y), g.save && a.options.cacheHitMode && ["refresh", "refreshAndUpdateStore"].indexOf(a.options.cacheHitMode) > -1) {
2634
- if (w && a.options.refreshExpirationTime && w + a.options.refreshExpirationTime > Date.now())
2635
- return;
2636
- var v = a.backends[c + 1];
2637
- v && v.read && yt(v, t, n, function(m, S) {
2638
- m || S && (Object.keys(S).length <= p || (u(c, S), a.options.cacheHitMode === "refreshAndUpdateStore" && a.services && a.services.resourceStore && a.services.resourceStore.addResourceBundle(t, n, S)));
2639
- });
2640
- }
2641
- } else
2642
- d(c + 1);
2643
- }) : d(c + 1);
2644
- }, u = function d(c, f) {
2645
- if (!(c < 0)) {
2646
- var p = a.backends[c];
2647
- p.save && p.save(t, n, f), d(c - 1, f);
2648
- }
2649
- };
2650
- s(0);
2651
- }
2652
- }, {
2653
- key: "create",
2654
- value: function(t, n, r, a) {
2655
- var o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function() {
2656
- }, s = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
2657
- this.backends.forEach(function(u) {
2658
- if (u.create) {
2659
- var d = u.create.bind(u);
2660
- if (d.length < 6) {
2661
- try {
2662
- var c;
2663
- d.length === 5 ? c = d(t, n, r, a, s) : c = d(t, n, r, a), c && typeof c.then == "function" ? c.then(function(f) {
2664
- return o(null, f);
2665
- }).catch(o) : o(null, c);
2666
- } catch (f) {
2667
- o(f);
2668
- }
2669
- return;
2670
- }
2671
- d(t, n, r, a, o, s);
2672
- }
2673
- });
2674
- }
2675
- }, {
2676
- key: "reload",
2677
- value: function() {
2678
- var t = this, n = this.services, r = n.backendConnector, a = n.languageUtils, o = n.logger, s = r.language;
2679
- if (!(s && s.toLowerCase() === "cimode")) {
2680
- var u = [], d = function(f) {
2681
- var p = a.toResolveHierarchy(f);
2682
- p.forEach(function(g) {
2683
- u.indexOf(g) < 0 && u.push(g);
2684
- });
2685
- };
2686
- d(s), this.allOptions.preload && this.allOptions.preload.forEach(function(c) {
2687
- return d(c);
2688
- }), u.forEach(function(c) {
2689
- t.allOptions.ns.forEach(function(f) {
2690
- r.read(c, f, "read", null, null, function(p, g) {
2691
- p && o.warn("loading namespace ".concat(f, " for language ").concat(c, " failed"), p), !p && g && o.log("loaded namespace ".concat(f, " for language ").concat(c), g), r.loaded("".concat(c, "|").concat(f), p, g);
2692
- });
2693
- });
2694
- });
2695
- }
2696
- }
2697
- }]), i;
2698
- }();
2699
- Ht.type = "backend";
2700
- function Te(i) {
2701
- "@babel/helpers - typeof";
2702
- return Te = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2703
- return typeof e;
2704
- } : function(e) {
2705
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2706
- }, Te(i);
2707
- }
2708
- function Mt() {
2709
- return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : Te(XMLHttpRequest)) === "object";
2710
- }
2711
- function dr(i) {
2712
- return !!i && typeof i.then == "function";
2713
- }
2714
- function pr(i) {
2715
- return dr(i) ? i : Promise.resolve(i);
2716
- }
2717
- function gr(i) {
2718
- throw new Error('Could not dynamically require "' + i + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
2719
- }
2720
- var De = { exports: {} }, ve = { exports: {} }, bt;
2721
- function hr() {
2722
- return bt || (bt = 1, function(i, e) {
2723
- var t = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof ce < "u" && ce, n = function() {
2724
- function a() {
2725
- this.fetch = !1, this.DOMException = t.DOMException;
2726
- }
2727
- return a.prototype = t, new a();
2728
- }();
2729
- (function(a) {
2730
- (function(o) {
2731
- var s = typeof a < "u" && a || typeof self < "u" && self || typeof s < "u" && s, u = {
2732
- searchParams: "URLSearchParams" in s,
2733
- iterable: "Symbol" in s && "iterator" in Symbol,
2734
- blob: "FileReader" in s && "Blob" in s && function() {
2735
- try {
2736
- return new Blob(), !0;
2737
- } catch {
2738
- return !1;
2739
- }
2740
- }(),
2741
- formData: "FormData" in s,
2742
- arrayBuffer: "ArrayBuffer" in s
2743
- };
2744
- function d(l) {
2745
- return l && DataView.prototype.isPrototypeOf(l);
2746
- }
2747
- if (u.arrayBuffer)
2748
- var c = [
2749
- "[object Int8Array]",
2750
- "[object Uint8Array]",
2751
- "[object Uint8ClampedArray]",
2752
- "[object Int16Array]",
2753
- "[object Uint16Array]",
2754
- "[object Int32Array]",
2755
- "[object Uint32Array]",
2756
- "[object Float32Array]",
2757
- "[object Float64Array]"
2758
- ], f = ArrayBuffer.isView || function(l) {
2759
- return l && c.indexOf(Object.prototype.toString.call(l)) > -1;
2760
- };
2761
- function p(l) {
2762
- if (typeof l != "string" && (l = String(l)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(l) || l === "")
2763
- throw new TypeError('Invalid character in header field name: "' + l + '"');
2764
- return l.toLowerCase();
2765
- }
2766
- function g(l) {
2767
- return typeof l != "string" && (l = String(l)), l;
2768
- }
2769
- function b(l) {
2770
- var h = {
2771
- next: function() {
2772
- var O = l.shift();
2773
- return { done: O === void 0, value: O };
2774
- }
2775
- };
2776
- return u.iterable && (h[Symbol.iterator] = function() {
2777
- return h;
2778
- }), h;
2779
- }
2780
- function y(l) {
2781
- this.map = {}, l instanceof y ? l.forEach(function(h, O) {
2782
- this.append(O, h);
2783
- }, this) : Array.isArray(l) ? l.forEach(function(h) {
2784
- this.append(h[0], h[1]);
2785
- }, this) : l && Object.getOwnPropertyNames(l).forEach(function(h) {
2786
- this.append(h, l[h]);
2787
- }, this);
2788
- }
2789
- y.prototype.append = function(l, h) {
2790
- l = p(l), h = g(h);
2791
- var O = this.map[l];
2792
- this.map[l] = O ? O + ", " + h : h;
2793
- }, y.prototype.delete = function(l) {
2794
- delete this.map[p(l)];
2795
- }, y.prototype.get = function(l) {
2796
- return l = p(l), this.has(l) ? this.map[l] : null;
2797
- }, y.prototype.has = function(l) {
2798
- return this.map.hasOwnProperty(p(l));
2799
- }, y.prototype.set = function(l, h) {
2800
- this.map[p(l)] = g(h);
2801
- }, y.prototype.forEach = function(l, h) {
2802
- for (var O in this.map)
2803
- this.map.hasOwnProperty(O) && l.call(h, this.map[O], O, this);
2804
- }, y.prototype.keys = function() {
2805
- var l = [];
2806
- return this.forEach(function(h, O) {
2807
- l.push(O);
2808
- }), b(l);
2809
- }, y.prototype.values = function() {
2810
- var l = [];
2811
- return this.forEach(function(h) {
2812
- l.push(h);
2813
- }), b(l);
2814
- }, y.prototype.entries = function() {
2815
- var l = [];
2816
- return this.forEach(function(h, O) {
2817
- l.push([O, h]);
2818
- }), b(l);
2819
- }, u.iterable && (y.prototype[Symbol.iterator] = y.prototype.entries);
2820
- function w(l) {
2821
- if (l.bodyUsed)
2822
- return Promise.reject(new TypeError("Already read"));
2823
- l.bodyUsed = !0;
2824
- }
2825
- function v(l) {
2826
- return new Promise(function(h, O) {
2827
- l.onload = function() {
2828
- h(l.result);
2829
- }, l.onerror = function() {
2830
- O(l.error);
2831
- };
2832
- });
2833
- }
2834
- function m(l) {
2835
- var h = new FileReader(), O = v(h);
2836
- return h.readAsArrayBuffer(l), O;
2837
- }
2838
- function S(l) {
2839
- var h = new FileReader(), O = v(h);
2840
- return h.readAsText(l), O;
2841
- }
2842
- function x(l) {
2843
- for (var h = new Uint8Array(l), O = new Array(h.length), j = 0; j < h.length; j++)
2844
- O[j] = String.fromCharCode(h[j]);
2845
- return O.join("");
2846
- }
2847
- function k(l) {
2848
- if (l.slice)
2849
- return l.slice(0);
2850
- var h = new Uint8Array(l.byteLength);
2851
- return h.set(new Uint8Array(l)), h.buffer;
2852
- }
2853
- function D() {
2854
- return this.bodyUsed = !1, this._initBody = function(l) {
2855
- this.bodyUsed = this.bodyUsed, this._bodyInit = l, l ? typeof l == "string" ? this._bodyText = l : u.blob && Blob.prototype.isPrototypeOf(l) ? this._bodyBlob = l : u.formData && FormData.prototype.isPrototypeOf(l) ? this._bodyFormData = l : u.searchParams && URLSearchParams.prototype.isPrototypeOf(l) ? this._bodyText = l.toString() : u.arrayBuffer && u.blob && d(l) ? (this._bodyArrayBuffer = k(l.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : u.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(l) || f(l)) ? this._bodyArrayBuffer = k(l) : this._bodyText = l = Object.prototype.toString.call(l) : this._bodyText = "", this.headers.get("content-type") || (typeof l == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : u.searchParams && URLSearchParams.prototype.isPrototypeOf(l) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
2856
- }, u.blob && (this.blob = function() {
2857
- var l = w(this);
2858
- if (l)
2859
- return l;
2860
- if (this._bodyBlob)
2861
- return Promise.resolve(this._bodyBlob);
2862
- if (this._bodyArrayBuffer)
2863
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
2864
- if (this._bodyFormData)
2865
- throw new Error("could not read FormData body as blob");
2866
- return Promise.resolve(new Blob([this._bodyText]));
2867
- }, this.arrayBuffer = function() {
2868
- if (this._bodyArrayBuffer) {
2869
- var l = w(this);
2870
- return l || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
2871
- this._bodyArrayBuffer.buffer.slice(
2872
- this._bodyArrayBuffer.byteOffset,
2873
- this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
2874
- )
2875
- ) : Promise.resolve(this._bodyArrayBuffer));
2876
- } else
2877
- return this.blob().then(m);
2878
- }), this.text = function() {
2879
- var l = w(this);
2880
- if (l)
2881
- return l;
2882
- if (this._bodyBlob)
2883
- return S(this._bodyBlob);
2884
- if (this._bodyArrayBuffer)
2885
- return Promise.resolve(x(this._bodyArrayBuffer));
2886
- if (this._bodyFormData)
2887
- throw new Error("could not read FormData body as text");
2888
- return Promise.resolve(this._bodyText);
2889
- }, u.formData && (this.formData = function() {
2890
- return this.text().then(C);
2891
- }), this.json = function() {
2892
- return this.text().then(JSON.parse);
2893
- }, this;
2894
- }
2895
- var I = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
2896
- function _(l) {
2897
- var h = l.toUpperCase();
2898
- return I.indexOf(h) > -1 ? h : l;
2899
- }
2900
- function R(l, h) {
2901
- if (!(this instanceof R))
2902
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
2903
- h = h || {};
2904
- var O = h.body;
2905
- if (l instanceof R) {
2906
- if (l.bodyUsed)
2907
- throw new TypeError("Already read");
2908
- this.url = l.url, this.credentials = l.credentials, h.headers || (this.headers = new y(l.headers)), this.method = l.method, this.mode = l.mode, this.signal = l.signal, !O && l._bodyInit != null && (O = l._bodyInit, l.bodyUsed = !0);
2909
- } else
2910
- this.url = String(l);
2911
- if (this.credentials = h.credentials || this.credentials || "same-origin", (h.headers || !this.headers) && (this.headers = new y(h.headers)), this.method = _(h.method || this.method || "GET"), this.mode = h.mode || this.mode || null, this.signal = h.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && O)
2912
- throw new TypeError("Body not allowed for GET or HEAD requests");
2913
- if (this._initBody(O), (this.method === "GET" || this.method === "HEAD") && (h.cache === "no-store" || h.cache === "no-cache")) {
2914
- var j = /([?&])_=[^&]*/;
2915
- if (j.test(this.url))
2916
- this.url = this.url.replace(j, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
2917
- else {
2918
- var L = /\?/;
2919
- this.url += (L.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
2920
- }
2921
- }
2922
- }
2923
- R.prototype.clone = function() {
2924
- return new R(this, { body: this._bodyInit });
2925
- };
2926
- function C(l) {
2927
- var h = new FormData();
2928
- return l.trim().split("&").forEach(function(O) {
2929
- if (O) {
2930
- var j = O.split("="), L = j.shift().replace(/\+/g, " "), P = j.join("=").replace(/\+/g, " ");
2931
- h.append(decodeURIComponent(L), decodeURIComponent(P));
2932
- }
2933
- }), h;
2934
- }
2935
- function Q(l) {
2936
- var h = new y(), O = l.replace(/\r?\n[\t ]+/g, " ");
2937
- return O.split("\r").map(function(j) {
2938
- return j.indexOf(`
2939
- `) === 0 ? j.substr(1, j.length) : j;
2940
- }).forEach(function(j) {
2941
- var L = j.split(":"), P = L.shift().trim();
2942
- if (P) {
2943
- var K = L.join(":").trim();
2944
- h.append(P, K);
2945
- }
2946
- }), h;
2947
- }
2948
- D.call(R.prototype);
2949
- function A(l, h) {
2950
- if (!(this instanceof A))
2951
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
2952
- h || (h = {}), this.type = "default", this.status = h.status === void 0 ? 200 : h.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = h.statusText === void 0 ? "" : "" + h.statusText, this.headers = new y(h.headers), this.url = h.url || "", this._initBody(l);
2953
- }
2954
- D.call(A.prototype), A.prototype.clone = function() {
2955
- return new A(this._bodyInit, {
2956
- status: this.status,
2957
- statusText: this.statusText,
2958
- headers: new y(this.headers),
2959
- url: this.url
2960
- });
2961
- }, A.error = function() {
2962
- var l = new A(null, { status: 0, statusText: "" });
2963
- return l.type = "error", l;
2964
- };
2965
- var Pe = [301, 302, 303, 307, 308];
2966
- A.redirect = function(l, h) {
2967
- if (Pe.indexOf(h) === -1)
2968
- throw new RangeError("Invalid status code");
2969
- return new A(null, { status: h, headers: { location: l } });
2970
- }, o.DOMException = s.DOMException;
2971
- try {
2972
- new o.DOMException();
2973
- } catch {
2974
- o.DOMException = function(h, O) {
2975
- this.message = h, this.name = O;
2976
- var j = Error(h);
2977
- this.stack = j.stack;
2978
- }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
2979
- }
2980
- function q(l, h) {
2981
- return new Promise(function(O, j) {
2982
- var L = new R(l, h);
2983
- if (L.signal && L.signal.aborted)
2984
- return j(new o.DOMException("Aborted", "AbortError"));
2985
- var P = new XMLHttpRequest();
2986
- function K() {
2987
- P.abort();
2988
- }
2989
- P.onload = function() {
2990
- var F = {
2991
- status: P.status,
2992
- statusText: P.statusText,
2993
- headers: Q(P.getAllResponseHeaders() || "")
2994
- };
2995
- F.url = "responseURL" in P ? P.responseURL : F.headers.get("X-Request-URL");
2996
- var V = "response" in P ? P.response : P.responseText;
2997
- setTimeout(function() {
2998
- O(new A(V, F));
2999
- }, 0);
3000
- }, P.onerror = function() {
3001
- setTimeout(function() {
3002
- j(new TypeError("Network request failed"));
3003
- }, 0);
3004
- }, P.ontimeout = function() {
3005
- setTimeout(function() {
3006
- j(new TypeError("Network request failed"));
3007
- }, 0);
3008
- }, P.onabort = function() {
3009
- setTimeout(function() {
3010
- j(new o.DOMException("Aborted", "AbortError"));
3011
- }, 0);
3012
- };
3013
- function je(F) {
3014
- try {
3015
- return F === "" && s.location.href ? s.location.href : F;
3016
- } catch {
3017
- return F;
3018
- }
3019
- }
3020
- P.open(L.method, je(L.url), !0), L.credentials === "include" ? P.withCredentials = !0 : L.credentials === "omit" && (P.withCredentials = !1), "responseType" in P && (u.blob ? P.responseType = "blob" : u.arrayBuffer && L.headers.get("Content-Type") && L.headers.get("Content-Type").indexOf("application/octet-stream") !== -1 && (P.responseType = "arraybuffer")), h && typeof h.headers == "object" && !(h.headers instanceof y) ? Object.getOwnPropertyNames(h.headers).forEach(function(F) {
3021
- P.setRequestHeader(F, g(h.headers[F]));
3022
- }) : L.headers.forEach(function(F, V) {
3023
- P.setRequestHeader(V, F);
3024
- }), L.signal && (L.signal.addEventListener("abort", K), P.onreadystatechange = function() {
3025
- P.readyState === 4 && L.signal.removeEventListener("abort", K);
3026
- }), P.send(typeof L._bodyInit > "u" ? null : L._bodyInit);
3027
- });
3028
- }
3029
- return q.polyfill = !0, s.fetch || (s.fetch = q, s.Headers = y, s.Request = R, s.Response = A), o.Headers = y, o.Request = R, o.Response = A, o.fetch = q, o;
3030
- })({});
3031
- })(n), n.fetch.ponyfill = !0, delete n.fetch.polyfill;
3032
- var r = t.fetch ? t : n;
3033
- e = r.fetch, e.default = r.fetch, e.fetch = r.fetch, e.Headers = r.Headers, e.Request = r.Request, e.Response = r.Response, i.exports = e;
3034
- }(ve, ve.exports)), ve.exports;
3035
- }
3036
- (function(i, e) {
3037
- var t = typeof fetch == "function" ? fetch : void 0;
3038
- if (typeof ce < "u" && ce.fetch ? t = ce.fetch : typeof window < "u" && window.fetch && (t = window.fetch), typeof gr < "u" && typeof window > "u") {
3039
- var n = t || hr();
3040
- n.default && (n = n.default), e.default = n, i.exports = e.default;
3041
- }
3042
- })(De, De.exports);
3043
- var $t = De.exports;
3044
- const qt = /* @__PURE__ */ Jt($t), wt = /* @__PURE__ */ Gt({
3045
- __proto__: null,
3046
- default: qt
3047
- }, [$t]);
3048
- function Ot(i, e) {
3049
- var t = Object.keys(i);
3050
- if (Object.getOwnPropertySymbols) {
3051
- var n = Object.getOwnPropertySymbols(i);
3052
- e && (n = n.filter(function(r) {
3053
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
3054
- })), t.push.apply(t, n);
3055
- }
3056
- return t;
3057
- }
3058
- function St(i) {
3059
- for (var e = 1; e < arguments.length; e++) {
3060
- var t = arguments[e] != null ? arguments[e] : {};
3061
- e % 2 ? Ot(Object(t), !0).forEach(function(n) {
3062
- vr(i, n, t[n]);
3063
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : Ot(Object(t)).forEach(function(n) {
3064
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
3065
- });
3066
- }
3067
- return i;
3068
- }
3069
- function vr(i, e, t) {
3070
- return (e = mr(e)) in i ? Object.defineProperty(i, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : i[e] = t, i;
3071
- }
3072
- function mr(i) {
3073
- var e = yr(i, "string");
3074
- return te(e) == "symbol" ? e : e + "";
3075
- }
3076
- function yr(i, e) {
3077
- if (te(i) != "object" || !i)
3078
- return i;
3079
- var t = i[Symbol.toPrimitive];
3080
- if (t !== void 0) {
3081
- var n = t.call(i, e);
3082
- if (te(n) != "object")
3083
- return n;
3084
- throw new TypeError("@@toPrimitive must return a primitive value.");
3085
- }
3086
- return (e === "string" ? String : Number)(i);
3087
- }
3088
- function te(i) {
3089
- "@babel/helpers - typeof";
3090
- return te = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
3091
- return typeof e;
3092
- } : function(e) {
3093
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
3094
- }, te(i);
3095
- }
3096
- var ee = typeof fetch == "function" ? fetch : void 0;
3097
- typeof global < "u" && global.fetch ? ee = global.fetch : typeof window < "u" && window.fetch && (ee = window.fetch);
3098
- var le;
3099
- Mt() && (typeof global < "u" && global.XMLHttpRequest ? le = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (le = window.XMLHttpRequest));
3100
- var Oe;
3101
- typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? Oe = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (Oe = window.ActiveXObject));
3102
- !ee && wt && !le && !Oe && (ee = qt || wt);
3103
- typeof ee != "function" && (ee = void 0);
3104
- var Ie = function(e, t) {
3105
- if (t && te(t) === "object") {
3106
- var n = "";
3107
- for (var r in t)
3108
- n += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(t[r]);
3109
- if (!n)
3110
- return e;
3111
- e = e + (e.indexOf("?") !== -1 ? "&" : "?") + n.slice(1);
3112
- }
3113
- return e;
3114
- }, xt = function(e, t, n, r) {
3115
- var a = function(u) {
3116
- if (!u.ok)
3117
- return n(u.statusText || "Error", {
3118
- status: u.status
3119
- });
3120
- u.text().then(function(d) {
3121
- n(null, {
3122
- status: u.status,
3123
- data: d
3124
- });
3125
- }).catch(n);
3126
- };
3127
- if (r) {
3128
- var o = r(e, t);
3129
- if (o instanceof Promise) {
3130
- o.then(a).catch(n);
3131
- return;
3132
- }
3133
- }
3134
- typeof fetch == "function" ? fetch(e, t).then(a).catch(n) : ee(e, t).then(a).catch(n);
3135
- }, Pt = !1, br = function(e, t, n, r) {
3136
- e.queryStringParams && (t = Ie(t, e.queryStringParams));
3137
- var a = St({}, typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders);
3138
- typeof window > "u" && typeof global < "u" && typeof global.process < "u" && global.process.versions && global.process.versions.node && (a["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")")), n && (a["Content-Type"] = "application/json");
3139
- var o = typeof e.requestOptions == "function" ? e.requestOptions(n) : e.requestOptions, s = St({
3140
- method: n ? "POST" : "GET",
3141
- body: n ? e.stringify(n) : void 0,
3142
- headers: a
3143
- }, Pt ? {} : o), u = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
3144
- try {
3145
- xt(t, s, r, u);
3146
- } catch (d) {
3147
- if (!o || Object.keys(o).length === 0 || !d.message || d.message.indexOf("not implemented") < 0)
3148
- return r(d);
3149
- try {
3150
- Object.keys(o).forEach(function(c) {
3151
- delete s[c];
3152
- }), xt(t, s, r, u), Pt = !0;
3153
- } catch (c) {
3154
- r(c);
3155
- }
3156
- }
3157
- }, wr = function(e, t, n, r) {
3158
- n && te(n) === "object" && (n = Ie("", n).slice(1)), e.queryStringParams && (t = Ie(t, e.queryStringParams));
3159
- try {
3160
- var a;
3161
- le ? a = new le() : a = new Oe("MSXML2.XMLHTTP.3.0"), a.open(n ? "POST" : "GET", t, 1), e.crossDomain || a.setRequestHeader("X-Requested-With", "XMLHttpRequest"), a.withCredentials = !!e.withCredentials, n && a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), a.overrideMimeType && a.overrideMimeType("application/json");
3162
- var o = e.customHeaders;
3163
- if (o = typeof o == "function" ? o() : o, o)
3164
- for (var s in o)
3165
- a.setRequestHeader(s, o[s]);
3166
- a.onreadystatechange = function() {
3167
- a.readyState > 3 && r(a.status >= 400 ? a.statusText : null, {
3168
- status: a.status,
3169
- data: a.responseText
3170
- });
3171
- }, a.send(n);
3172
- } catch (u) {
3173
- console && console.log(u);
3174
- }
3175
- }, Or = function(e, t, n, r) {
3176
- if (typeof n == "function" && (r = n, n = void 0), r = r || function() {
3177
- }, ee && t.indexOf("file:") !== 0)
3178
- return br(e, t, n, r);
3179
- if (Mt() || typeof ActiveXObject == "function")
3180
- return wr(e, t, n, r);
3181
- r(new Error("No fetch and no xhr implementation found!"));
3182
- };
3183
- function ae(i) {
3184
- "@babel/helpers - typeof";
3185
- return ae = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
3186
- return typeof e;
3187
- } : function(e) {
3188
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
3189
- }, ae(i);
3190
- }
3191
- function jt(i, e) {
3192
- var t = Object.keys(i);
3193
- if (Object.getOwnPropertySymbols) {
3194
- var n = Object.getOwnPropertySymbols(i);
3195
- e && (n = n.filter(function(r) {
3196
- return Object.getOwnPropertyDescriptor(i, r).enumerable;
3197
- })), t.push.apply(t, n);
3198
- }
3199
- return t;
3200
- }
3201
- function _e(i) {
3202
- for (var e = 1; e < arguments.length; e++) {
3203
- var t = arguments[e] != null ? arguments[e] : {};
3204
- e % 2 ? jt(Object(t), !0).forEach(function(n) {
3205
- Kt(i, n, t[n]);
3206
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : jt(Object(t)).forEach(function(n) {
3207
- Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
3208
- });
3209
- }
3210
- return i;
3211
- }
3212
- function Sr(i, e) {
3213
- if (!(i instanceof e))
3214
- throw new TypeError("Cannot call a class as a function");
3215
- }
3216
- function xr(i, e) {
3217
- for (var t = 0; t < e.length; t++) {
3218
- var n = e[t];
3219
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(i, Vt(n.key), n);
3220
- }
3221
- }
3222
- function Pr(i, e, t) {
3223
- return e && xr(i.prototype, e), Object.defineProperty(i, "prototype", { writable: !1 }), i;
3224
- }
3225
- function Kt(i, e, t) {
3226
- return (e = Vt(e)) in i ? Object.defineProperty(i, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : i[e] = t, i;
3227
- }
3228
- function Vt(i) {
3229
- var e = jr(i, "string");
3230
- return ae(e) == "symbol" ? e : e + "";
3231
- }
3232
- function jr(i, e) {
3233
- if (ae(i) != "object" || !i)
3234
- return i;
3235
- var t = i[Symbol.toPrimitive];
3236
- if (t !== void 0) {
3237
- var n = t.call(i, e);
3238
- if (ae(n) != "object")
3239
- return n;
3240
- throw new TypeError("@@toPrimitive must return a primitive value.");
3241
- }
3242
- return String(i);
3243
- }
3244
- var kr = function() {
3245
- return {
3246
- loadPath: "/locales/{{lng}}/{{ns}}.json",
3247
- addPath: "/locales/add/{{lng}}/{{ns}}",
3248
- parse: function(t) {
3249
- return JSON.parse(t);
3250
- },
3251
- stringify: JSON.stringify,
3252
- parsePayload: function(t, n, r) {
3253
- return Kt({}, n, r || "");
3254
- },
3255
- parseLoadPayload: function(t, n) {
3256
- },
3257
- request: Or,
3258
- reloadInterval: typeof window < "u" ? !1 : 60 * 60 * 1e3,
3259
- customHeaders: {},
3260
- queryStringParams: {},
3261
- crossDomain: !1,
3262
- withCredentials: !1,
3263
- overrideMimeType: !1,
3264
- requestOptions: {
3265
- mode: "cors",
3266
- credentials: "same-origin",
3267
- cache: "default"
3268
- }
3269
- };
3270
- }, zt = function() {
3271
- function i(e) {
3272
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3273
- Sr(this, i), this.services = e, this.options = t, this.allOptions = n, this.type = "backend", this.init(e, t, n);
3274
- }
3275
- return Pr(i, [{
3276
- key: "init",
3277
- value: function(t) {
3278
- var n = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3279
- if (this.services = t, this.options = _e(_e(_e({}, kr()), this.options || {}), r), this.allOptions = a, this.services && this.options.reloadInterval) {
3280
- var o = setInterval(function() {
3281
- return n.reload();
3282
- }, this.options.reloadInterval);
3283
- ae(o) === "object" && typeof o.unref == "function" && o.unref();
3284
- }
3285
- }
3286
- }, {
3287
- key: "readMulti",
3288
- value: function(t, n, r) {
3289
- this._readAny(t, t, n, n, r);
3290
- }
3291
- }, {
3292
- key: "read",
3293
- value: function(t, n, r) {
3294
- this._readAny([t], t, [n], n, r);
3295
- }
3296
- }, {
3297
- key: "_readAny",
3298
- value: function(t, n, r, a, o) {
3299
- var s = this, u = this.options.loadPath;
3300
- typeof this.options.loadPath == "function" && (u = this.options.loadPath(t, r)), u = pr(u), u.then(function(d) {
3301
- if (!d)
3302
- return o(null, {});
3303
- var c = s.services.interpolator.interpolate(d, {
3304
- lng: t.join("+"),
3305
- ns: r.join("+")
3306
- });
3307
- s.loadUrl(c, o, n, a);
3308
- });
3309
- }
3310
- }, {
3311
- key: "loadUrl",
3312
- value: function(t, n, r, a) {
3313
- var o = this, s = typeof r == "string" ? [r] : r, u = typeof a == "string" ? [a] : a, d = this.options.parseLoadPayload(s, u);
3314
- this.options.request(this.options, t, d, function(c, f) {
3315
- if (f && (f.status >= 500 && f.status < 600 || !f.status))
3316
- return n("failed loading " + t + "; status code: " + f.status, !0);
3317
- if (f && f.status >= 400 && f.status < 500)
3318
- return n("failed loading " + t + "; status code: " + f.status, !1);
3319
- if (!f && c && c.message) {
3320
- var p = c.message.toLowerCase(), g = ["failed", "fetch", "network", "load"].find(function(w) {
3321
- return p.indexOf(w) > -1;
3322
- });
3323
- if (g)
3324
- return n("failed loading " + t + ": " + c.message, !0);
3325
- }
3326
- if (c)
3327
- return n(c, !1);
3328
- var b, y;
3329
- try {
3330
- typeof f.data == "string" ? b = o.options.parse(f.data, r, a) : b = f.data;
3331
- } catch {
3332
- y = "failed parsing " + t + " to json";
3333
- }
3334
- if (y)
3335
- return n(y, !1);
3336
- n(null, b);
3337
- });
3338
- }
3339
- }, {
3340
- key: "create",
3341
- value: function(t, n, r, a, o) {
3342
- var s = this;
3343
- if (this.options.addPath) {
3344
- typeof t == "string" && (t = [t]);
3345
- var u = this.options.parsePayload(n, r, a), d = 0, c = [], f = [];
3346
- t.forEach(function(p) {
3347
- var g = s.options.addPath;
3348
- typeof s.options.addPath == "function" && (g = s.options.addPath(p, n));
3349
- var b = s.services.interpolator.interpolate(g, {
3350
- lng: p,
3351
- ns: n
3352
- });
3353
- s.options.request(s.options, b, u, function(y, w) {
3354
- d += 1, c.push(y), f.push(w), d === t.length && typeof o == "function" && o(c, f);
3355
- });
3356
- });
3357
- }
3358
- }
3359
- }, {
3360
- key: "reload",
3361
- value: function() {
3362
- var t = this, n = this.services, r = n.backendConnector, a = n.languageUtils, o = n.logger, s = r.language;
3363
- if (!(s && s.toLowerCase() === "cimode")) {
3364
- var u = [], d = function(f) {
3365
- var p = a.toResolveHierarchy(f);
3366
- p.forEach(function(g) {
3367
- u.indexOf(g) < 0 && u.push(g);
3368
- });
3369
- };
3370
- d(s), this.allOptions.preload && this.allOptions.preload.forEach(function(c) {
3371
- return d(c);
3372
- }), u.forEach(function(c) {
3373
- t.allOptions.ns.forEach(function(f) {
3374
- r.read(c, f, "read", null, null, function(p, g) {
3375
- p && o.warn("loading namespace ".concat(f, " for language ").concat(c, " failed"), p), !p && g && o.log("loaded namespace ".concat(f, " for language ").concat(c), g), r.loaded("".concat(c, "|").concat(f), p, g);
3376
- });
3377
- });
3378
- });
3379
- }
3380
- }
3381
- }]);
3382
- }();
3383
- zt.type = "backend";
3384
- var Lr = /* @__PURE__ */ ((i) => (i.en = "en", i.de = "de", i))(Lr || {});
3385
- const Rr = {
3386
- en: "English",
3387
- de: "German"
3388
- };
3389
- N.use(Ht).use(er).use(Dt).init({
3390
- // defaultNS: "translation",
3391
- // resources,
3392
- initImmediate: !0,
3393
- ns: ["translation"],
3394
- fallbackLng: Object.keys(Rr),
3395
- fallbackNS: "translation",
3396
- partialBundledLanguages: !0,
3397
- resources: {},
3398
- interpolation: {
3399
- escapeValue: !1
3400
- },
3401
- backend: {
3402
- backends: [zt],
3403
- backendOptions: [
3404
- {
3405
- // loadPath: 'https://ukpcsaprod.blob.core.windows.net/lib/translations/{{lng}}/{{ns}}.json',
3406
- loadPath: () => {
3407
- var e, t, n;
3408
- if ((e = window == null ? void 0 : window.env) != null && e.TRANSLATION_URL)
3409
- return `${window.env.TRANSLATION_URL}/{{lng}}`;
3410
- const i = ((t = window == null ? void 0 : window.env) == null ? void 0 : t.VITE_BASE_URL) || ((n = window == null ? void 0 : window.env) == null ? void 0 : n.REACT_APP_BASE_URL) || location.protocol + "//" + location.host;
3411
- return console.log("url", i), `${i}/translations/{{lng}}`;
3412
- },
3413
- crossDomain: !0,
3414
- cacheHitMode: "refresh"
3415
- }
3416
- ]
3417
- }
3418
- });
3419
- const me = {
3420
- "page-container": "_page-container_1pwo1_1",
3421
- "page-main-content": "_page-main-content_1pwo1_8",
3422
- "page-title": "_page-title_1pwo1_19",
3423
- "text-base": "_text-base_1pwo1_26",
3424
- "mt-4": "_mt-4_1pwo1_33"
3425
- }, Er = () => {
3426
- const { t: i } = ar();
3427
- return /* @__PURE__ */ E.jsx("div", { className: "unauth__container " + me["page-container"], children: /* @__PURE__ */ E.jsxs("div", { className: "unauth__main-content " + me["page-main-content"], children: [
3428
- /* @__PURE__ */ E.jsx(Cr, {}),
3429
- /* @__PURE__ */ E.jsxs("div", { className: "unauth__main-text", children: [
3430
- /* @__PURE__ */ E.jsx("h2", { className: "unauth__main-text__title " + me["page-title"], children: i("components.unauthorizedPage.title") }),
3431
- /* @__PURE__ */ E.jsxs("p", { className: "unauth__main-text__desc " + me["text-base"], children: [
3432
- i("components.unauthorizedPage.description1"),
3433
- " ",
3434
- /* @__PURE__ */ E.jsx("br", {}),
3435
- " ",
3436
- i("components.unauthorizedPage.description2")
3437
- ] })
3438
- ] })
3439
- ] }) });
3440
- }, Cr = () => /* @__PURE__ */ E.jsxs(
3441
- "svg",
3442
- {
3443
- width: "61",
3444
- height: "60",
3445
- viewBox: "0 0 61 60",
3446
- fill: "none",
3447
- xmlns: "http://www.w3.org/2000/svg",
3448
- children: [
3449
- /* @__PURE__ */ E.jsxs("g", { filter: "url(#filter0_d_10800_50471)", children: [
3450
- /* @__PURE__ */ E.jsx("rect", { x: "2.5", y: "1", width: "56", height: "56", rx: "28", fill: "white" }),
3451
- /* @__PURE__ */ E.jsx(
3452
- "path",
3453
- {
3454
- d: "M24.6667 27.833V23.1663C24.6667 21.6192 25.2812 20.1355 26.3752 19.0416C27.4692 17.9476 28.9529 17.333 30.5 17.333C32.0471 17.333 33.5308 17.9476 34.6248 19.0416C35.7188 20.1355 36.3333 21.6192 36.3333 23.1663V27.833M22.3333 27.833H38.6667C39.9553 27.833 41 28.8777 41 30.1663V38.333C41 39.6217 39.9553 40.6663 38.6667 40.6663H22.3333C21.0447 40.6663 20 39.6217 20 38.333V30.1663C20 28.8777 21.0447 27.833 22.3333 27.833Z",
3455
- stroke: "#292929",
3456
- "stroke-width": "2.33333",
3457
- "stroke-linecap": "round",
3458
- "stroke-linejoin": "round"
3459
- }
3460
- )
3461
- ] }),
3462
- /* @__PURE__ */ E.jsx("defs", { children: /* @__PURE__ */ E.jsxs(
3463
- "filter",
3464
- {
3465
- id: "filter0_d_10800_50471",
3466
- x: "0.5",
3467
- y: "0",
3468
- width: "60",
3469
- height: "60",
3470
- filterUnits: "userSpaceOnUse",
3471
- "color-interpolation-filters": "sRGB",
3472
- children: [
3473
- /* @__PURE__ */ E.jsx("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }),
3474
- /* @__PURE__ */ E.jsx(
3475
- "feColorMatrix",
3476
- {
3477
- in: "SourceAlpha",
3478
- type: "matrix",
3479
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
3480
- result: "hardAlpha"
3481
- }
3482
- ),
3483
- /* @__PURE__ */ E.jsx("feOffset", { dy: "1" }),
3484
- /* @__PURE__ */ E.jsx("feGaussianBlur", { stdDeviation: "1" }),
3485
- /* @__PURE__ */ E.jsx(
3486
- "feColorMatrix",
3487
- {
3488
- type: "matrix",
3489
- values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.05 0"
3490
- }
3491
- ),
3492
- /* @__PURE__ */ E.jsx(
3493
- "feBlend",
3494
- {
3495
- mode: "normal",
3496
- in2: "BackgroundImageFix",
3497
- result: "effect1_dropShadow_10800_50471"
3498
- }
3499
- ),
3500
- /* @__PURE__ */ E.jsx(
3501
- "feBlend",
3502
- {
3503
- mode: "normal",
3504
- in: "SourceGraphic",
3505
- in2: "effect1_dropShadow_10800_50471",
3506
- result: "shape"
3507
- }
3508
- )
3509
- ]
3510
- }
3511
- ) })
3512
- ]
3513
- }
3514
- );
3515
- function _r() {
3516
- return /* @__PURE__ */ E.jsx(or, { i18n: N, children: /* @__PURE__ */ E.jsx(Er, {}) });
3517
- }
3518
- {
3519
- const i = Xt(_r);
3520
- customElements.define("access-denied", i);
3521
- }
3522
- export {
3523
- or as I,
3524
- Lr as L,
3525
- Er as U,
3526
- N as i,
3527
- Dr as t
3528
- };