@andre1502/react-utilities 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +74 -51
  2. package/dist/EnvironmentEnum-F4hjulGN.js +12 -0
  3. package/dist/EnvironmentEnum-F4hjulGN.js.map +1 -0
  4. package/dist/Utils-Bb2yUYbQ.js +14 -0
  5. package/dist/Utils-Bb2yUYbQ.js.map +1 -0
  6. package/dist/config-cli-CY_z5CYp.js +1493 -0
  7. package/dist/config-cli-CY_z5CYp.js.map +1 -0
  8. package/dist/config-cli.js +3 -229
  9. package/dist/enums/CurrencySymbolEnum.d.ts +6 -5
  10. package/dist/enums/DeviceEnum.d.ts +5 -4
  11. package/dist/enums/EnvironmentEnum.d.ts +8 -5
  12. package/dist/format-DOgTlvp7.js +65549 -0
  13. package/dist/format-DOgTlvp7.js.map +1 -0
  14. package/dist/format.d.ts +26 -26
  15. package/dist/format.js +2 -55
  16. package/dist/hooks-BBCIHhac.js +78 -0
  17. package/dist/hooks-BBCIHhac.js.map +1 -0
  18. package/dist/hooks.js +2 -86
  19. package/dist/i18n-CJthsaWo.js +1819 -0
  20. package/dist/i18n-CJthsaWo.js.map +1 -0
  21. package/dist/i18n.js +4 -28
  22. package/dist/index-cli.d.ts +0 -1
  23. package/dist/index-cli.js +3 -28
  24. package/dist/index-rn.js +6 -39
  25. package/dist/index.js +7 -61
  26. package/dist/sentry-rn-DNJphpGY.js +743 -0
  27. package/dist/sentry-rn-DNJphpGY.js.map +1 -0
  28. package/dist/sentry-rn.js +2 -28
  29. package/dist/sentry.js +39 -26
  30. package/dist/sentry.js.map +1 -1
  31. package/dist/utils.js +45 -37
  32. package/dist/utils.js.map +1 -1
  33. package/package.json +56 -86
  34. package/src/Config/Config.ts +1 -1
  35. package/src/Config/GoogleAuth.ts +1 -1
  36. package/src/Sentry/React.ts +2 -4
  37. package/src/Sentry/ReactNative.ts +2 -4
  38. package/src/enums/CurrencySymbolEnum.ts +8 -5
  39. package/src/enums/DeviceEnum.ts +6 -4
  40. package/src/enums/EnvironmentEnum.ts +10 -5
  41. package/src/format.ts +32 -32
  42. package/src/index-cli.ts +0 -1
  43. package/dist/Config/Config.js +0 -249
  44. package/dist/Config/Config.js.map +0 -1
  45. package/dist/Config/GoogleAuth.js +0 -68
  46. package/dist/Config/GoogleAuth.js.map +0 -1
  47. package/dist/Config/Locales.js +0 -62
  48. package/dist/Config/Locales.js.map +0 -1
  49. package/dist/Config/Output.js +0 -36
  50. package/dist/Config/Output.js.map +0 -1
  51. package/dist/Config/Sitemap.js +0 -72
  52. package/dist/Config/Sitemap.js.map +0 -1
  53. package/dist/EnvironmentEnum-BjXsfSRZ.js +0 -9
  54. package/dist/EnvironmentEnum-BjXsfSRZ.js.map +0 -1
  55. package/dist/EnvironmentEnum-UcQ6Il1O.js +0 -9
  56. package/dist/EnvironmentEnum-UcQ6Il1O.js.map +0 -1
  57. package/dist/Format/NumberFormat.js +0 -77
  58. package/dist/Format/NumberFormat.js.map +0 -1
  59. package/dist/Format/NumberParser.js +0 -51
  60. package/dist/Format/NumberParser.js.map +0 -1
  61. package/dist/Hooks/useDevice.js +0 -47
  62. package/dist/Hooks/useDevice.js.map +0 -1
  63. package/dist/Hooks/useSound.js +0 -47
  64. package/dist/Hooks/useSound.js.map +0 -1
  65. package/dist/Hooks/useWebSocket.js +0 -120
  66. package/dist/Hooks/useWebSocket.js.map +0 -1
  67. package/dist/I18n/I18n.js +0 -134
  68. package/dist/I18n/I18n.js.map +0 -1
  69. package/dist/NumberFormat-CvvBWhHc.js +0 -89
  70. package/dist/NumberFormat-CvvBWhHc.js.map +0 -1
  71. package/dist/NumberFormat-glmpbk7E.js +0 -94
  72. package/dist/NumberFormat-glmpbk7E.js.map +0 -1
  73. package/dist/React-BaJ1KfGF.js +0 -87
  74. package/dist/React-BaJ1KfGF.js.map +0 -1
  75. package/dist/React-qUl0CBmE.js +0 -109
  76. package/dist/React-qUl0CBmE.js.map +0 -1
  77. package/dist/ReactNative-B4gt8nBr.js +0 -1790
  78. package/dist/ReactNative-B4gt8nBr.js.map +0 -1
  79. package/dist/ReactNative-CDMfQFfN.js +0 -1812
  80. package/dist/ReactNative-CDMfQFfN.js.map +0 -1
  81. package/dist/Sentry/Build.d.ts +0 -9
  82. package/dist/Sentry/Build.js +0 -87
  83. package/dist/Sentry/Build.js.map +0 -1
  84. package/dist/Sentry/React.js +0 -103
  85. package/dist/Sentry/React.js.map +0 -1
  86. package/dist/Sentry/ReactNative.js +0 -113
  87. package/dist/Sentry/ReactNative.js.map +0 -1
  88. package/dist/Sentry/Utils.js +0 -24
  89. package/dist/Sentry/Utils.js.map +0 -1
  90. package/dist/Utils/Array.js +0 -26
  91. package/dist/Utils/Array.js.map +0 -1
  92. package/dist/Utils/Files.js +0 -51
  93. package/dist/Utils/Files.js.map +0 -1
  94. package/dist/Utils/Pagination.js +0 -32
  95. package/dist/Utils/Pagination.js.map +0 -1
  96. package/dist/Utils/Utils.js +0 -101
  97. package/dist/Utils/Utils.js.map +0 -1
  98. package/dist/Utils-BC1fDy39.js +0 -74
  99. package/dist/Utils-BC1fDy39.js.map +0 -1
  100. package/dist/Utils-Cq948gfa.js +0 -20
  101. package/dist/Utils-Cq948gfa.js.map +0 -1
  102. package/dist/Utils-D7KRF8VU.js +0 -64
  103. package/dist/Utils-D7KRF8VU.js.map +0 -1
  104. package/dist/Utils-Dilye04y.js +0 -22
  105. package/dist/Utils-Dilye04y.js.map +0 -1
  106. package/dist/config-cli.cjs +0 -532
  107. package/dist/config-cli.cjs.map +0 -1
  108. package/dist/config-cli.js.map +0 -1
  109. package/dist/config-cli.mjs +0 -500
  110. package/dist/config-cli.mjs.map +0 -1
  111. package/dist/enums/CurrencySymbolEnum.js +0 -15
  112. package/dist/enums/CurrencySymbolEnum.js.map +0 -1
  113. package/dist/enums/DeviceEnum.js +0 -12
  114. package/dist/enums/DeviceEnum.js.map +0 -1
  115. package/dist/enums/EnvironmentEnum.js +0 -13
  116. package/dist/enums/EnvironmentEnum.js.map +0 -1
  117. package/dist/format.cjs +0 -43
  118. package/dist/format.cjs.map +0 -1
  119. package/dist/format.js.map +0 -1
  120. package/dist/format.mjs +0 -30
  121. package/dist/format.mjs.map +0 -1
  122. package/dist/hooks.cjs +0 -13
  123. package/dist/hooks.cjs.map +0 -1
  124. package/dist/hooks.js.map +0 -1
  125. package/dist/hooks.mjs +0 -4
  126. package/dist/hooks.mjs.map +0 -1
  127. package/dist/i18n.cjs +0 -3039
  128. package/dist/i18n.cjs.map +0 -1
  129. package/dist/i18n.js.map +0 -1
  130. package/dist/i18n.mjs +0 -3032
  131. package/dist/i18n.mjs.map +0 -1
  132. package/dist/index-cli.cjs +0 -31
  133. package/dist/index-cli.cjs.map +0 -1
  134. package/dist/index-cli.js.map +0 -1
  135. package/dist/index-cli.mjs +0 -14
  136. package/dist/index-cli.mjs.map +0 -1
  137. package/dist/index-rn.cjs +0 -57
  138. package/dist/index-rn.cjs.map +0 -1
  139. package/dist/index-rn.js.map +0 -1
  140. package/dist/index-rn.mjs +0 -36
  141. package/dist/index-rn.mjs.map +0 -1
  142. package/dist/index.cjs +0 -79
  143. package/dist/index.cjs.map +0 -1
  144. package/dist/index.js.map +0 -1
  145. package/dist/index.mjs +0 -40
  146. package/dist/index.mjs.map +0 -1
  147. package/dist/interfaces/Config/ConfigOptions.js +0 -6
  148. package/dist/interfaces/Config/ConfigOptions.js.map +0 -1
  149. package/dist/interfaces/Config/EntryOptions.js +0 -6
  150. package/dist/interfaces/Config/EntryOptions.js.map +0 -1
  151. package/dist/interfaces/Config/OutputMap.js +0 -6
  152. package/dist/interfaces/Config/OutputMap.js.map +0 -1
  153. package/dist/interfaces/Config/OutputOptions.js +0 -6
  154. package/dist/interfaces/Config/OutputOptions.js.map +0 -1
  155. package/dist/interfaces/Config/SitemapMap.js +0 -6
  156. package/dist/interfaces/Config/SitemapMap.js.map +0 -1
  157. package/dist/interfaces/Config/StringMap.js +0 -6
  158. package/dist/interfaces/Config/StringMap.js.map +0 -1
  159. package/dist/interfaces/Format/FormatOptions.js +0 -6
  160. package/dist/interfaces/Format/FormatOptions.js.map +0 -1
  161. package/dist/interfaces/Sentry/InitOptions.js +0 -6
  162. package/dist/interfaces/Sentry/InitOptions.js.map +0 -1
  163. package/dist/interfaces/Sentry/InitOptionsRN.js +0 -6
  164. package/dist/interfaces/Sentry/InitOptionsRN.js.map +0 -1
  165. package/dist/interfaces/Sentry/SourceMapOptions.d.ts +0 -7
  166. package/dist/interfaces/Sentry/SourceMapOptions.js +0 -6
  167. package/dist/interfaces/Sentry/SourceMapOptions.js.map +0 -1
  168. package/dist/sentry-cli.cjs +0 -119
  169. package/dist/sentry-cli.cjs.map +0 -1
  170. package/dist/sentry-cli.d.ts +0 -9
  171. package/dist/sentry-cli.js +0 -49
  172. package/dist/sentry-cli.js.map +0 -1
  173. package/dist/sentry-cli.mjs +0 -98
  174. package/dist/sentry-cli.mjs.map +0 -1
  175. package/dist/sentry-rn.cjs +0 -11
  176. package/dist/sentry-rn.cjs.map +0 -1
  177. package/dist/sentry-rn.js.map +0 -1
  178. package/dist/sentry-rn.mjs +0 -4
  179. package/dist/sentry-rn.mjs.map +0 -1
  180. package/dist/sentry.cjs +0 -11
  181. package/dist/sentry.cjs.map +0 -1
  182. package/dist/sentry.mjs +0 -4
  183. package/dist/sentry.mjs.map +0 -1
  184. package/dist/types/Config/OptionType.js +0 -6
  185. package/dist/types/Config/OptionType.js.map +0 -1
  186. package/dist/types/Format/OptionType.js +0 -6
  187. package/dist/types/Format/OptionType.js.map +0 -1
  188. package/dist/types/Sentry/OptionType.js +0 -6
  189. package/dist/types/Sentry/OptionType.js.map +0 -1
  190. package/dist/useWebSocket-B_B6kWXM.js +0 -167
  191. package/dist/useWebSocket-B_B6kWXM.js.map +0 -1
  192. package/dist/useWebSocket-YQWaiBz9.js +0 -172
  193. package/dist/useWebSocket-YQWaiBz9.js.map +0 -1
  194. package/dist/utils.cjs +0 -59
  195. package/dist/utils.cjs.map +0 -1
  196. package/dist/utils.mjs +0 -43
  197. package/dist/utils.mjs.map +0 -1
  198. package/src/Sentry/Build.ts +0 -67
  199. package/src/interfaces/Sentry/SourceMapOptions.ts +0 -7
  200. package/src/sentry-cli.ts +0 -16
@@ -0,0 +1,1819 @@
1
+ import { getV as e } from "./utils.js";
2
+ //#region node_modules/i18next/dist/esm/i18next.js
3
+ var t = (e) => typeof e == "string", n = () => {
4
+ let e, t, n = new Promise((n, r) => {
5
+ e = n, t = r;
6
+ });
7
+ return n.resolve = e, n.reject = t, n;
8
+ }, r = (e) => e == null ? "" : String(e), i = (e, t, n) => {
9
+ e.forEach((e) => {
10
+ t[e] && (n[e] = t[e]);
11
+ });
12
+ }, a = /###/g, o = (e) => e && e.includes("###") ? e.replace(a, ".") : e, s = (e) => !e || t(e), c = (e, n, r) => {
13
+ let i = t(n) ? n.split(".") : n, a = 0;
14
+ for (; a < i.length - 1;) {
15
+ if (s(e)) return {};
16
+ let t = o(i[a]);
17
+ !e[t] && r && (e[t] = new r()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++a;
18
+ }
19
+ return s(e) ? {} : {
20
+ obj: e,
21
+ k: o(i[a])
22
+ };
23
+ }, l = (e, t, n) => {
24
+ let { obj: r, k: i } = c(e, t, Object);
25
+ if (r !== void 0 || t.length === 1) {
26
+ r[i] = n;
27
+ return;
28
+ }
29
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = c(e, o, Object);
30
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = c(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
31
+ s.obj[`${s.k}.${a}`] = n;
32
+ }, u = (e, t, n, r) => {
33
+ let { obj: i, k: a } = c(e, t, Object);
34
+ i[a] = i[a] || [], i[a].push(n);
35
+ }, d = (e, t) => {
36
+ let { obj: n, k: r } = c(e, t);
37
+ if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
38
+ }, f = (e, t, n) => {
39
+ let r = d(e, n);
40
+ return r === void 0 ? d(t, n) : r;
41
+ }, p = (e, n, r) => {
42
+ for (let i in n) i !== "__proto__" && i !== "constructor" && (i in e ? t(e[i]) || e[i] instanceof String || t(n[i]) || n[i] instanceof String ? r && (e[i] = n[i]) : p(e[i], n[i], r) : e[i] = n[i]);
43
+ return e;
44
+ }, m = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), h = {
45
+ "&": "&amp;",
46
+ "<": "&lt;",
47
+ ">": "&gt;",
48
+ "\"": "&quot;",
49
+ "'": "&#39;",
50
+ "/": "&#x2F;"
51
+ }, g = (e) => t(e) ? e.replace(/[&<>"'\/]/g, (e) => h[e]) : e, _ = class {
52
+ constructor(e) {
53
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
54
+ }
55
+ getRegExp(e) {
56
+ let t = this.regExpMap.get(e);
57
+ if (t !== void 0) return t;
58
+ let n = new RegExp(e);
59
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
60
+ }
61
+ }, v = [
62
+ " ",
63
+ ",",
64
+ "?",
65
+ "!",
66
+ ";"
67
+ ], y = new _(20), b = (e, t, n) => {
68
+ t ||= "", n ||= "";
69
+ let r = v.filter((e) => !t.includes(e) && !n.includes(e));
70
+ if (r.length === 0) return !0;
71
+ let i = y.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
72
+ if (!a) {
73
+ let t = e.indexOf(n);
74
+ t > 0 && !i.test(e.substring(0, t)) && (a = !0);
75
+ }
76
+ return a;
77
+ }, x = (e, t, n = ".") => {
78
+ if (!e) return;
79
+ if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
80
+ let r = t.split(n), i = e;
81
+ for (let e = 0; e < r.length;) {
82
+ if (!i || typeof i != "object") return;
83
+ let t, a = "";
84
+ for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
85
+ if ([
86
+ "string",
87
+ "number",
88
+ "boolean"
89
+ ].includes(typeof t) && o < r.length - 1) continue;
90
+ e += o - e + 1;
91
+ break;
92
+ }
93
+ i = t;
94
+ }
95
+ return i;
96
+ }, S = (e) => e?.replace(/_/g, "-"), ee = {
97
+ type: "logger",
98
+ log(e) {
99
+ this.output("log", e);
100
+ },
101
+ warn(e) {
102
+ this.output("warn", e);
103
+ },
104
+ error(e) {
105
+ this.output("error", e);
106
+ },
107
+ output(e, t) {
108
+ console?.[e]?.apply?.(console, t);
109
+ }
110
+ }, C = new class e {
111
+ constructor(e, t = {}) {
112
+ this.init(e, t);
113
+ }
114
+ init(e, t = {}) {
115
+ this.prefix = t.prefix || "i18next:", this.logger = e || ee, this.options = t, this.debug = t.debug;
116
+ }
117
+ log(...e) {
118
+ return this.forward(e, "log", "", !0);
119
+ }
120
+ warn(...e) {
121
+ return this.forward(e, "warn", "", !0);
122
+ }
123
+ error(...e) {
124
+ return this.forward(e, "error", "");
125
+ }
126
+ deprecate(...e) {
127
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
128
+ }
129
+ forward(e, n, r, i) {
130
+ return i && !this.debug ? null : (t(e[0]) && (e[0] = `${r}${this.prefix} ${e[0]}`), this.logger[n](e));
131
+ }
132
+ create(t) {
133
+ return new e(this.logger, {
134
+ prefix: `${this.prefix}:${t}:`,
135
+ ...this.options
136
+ });
137
+ }
138
+ clone(t) {
139
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
140
+ }
141
+ }(), w = class {
142
+ constructor() {
143
+ this.observers = {};
144
+ }
145
+ on(e, t) {
146
+ return e.split(" ").forEach((e) => {
147
+ this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
148
+ let n = this.observers[e].get(t) || 0;
149
+ this.observers[e].set(t, n + 1);
150
+ }), this;
151
+ }
152
+ off(e, t) {
153
+ if (this.observers[e]) {
154
+ if (!t) {
155
+ delete this.observers[e];
156
+ return;
157
+ }
158
+ this.observers[e].delete(t);
159
+ }
160
+ }
161
+ once(e, t) {
162
+ let n = (...r) => {
163
+ t(...r), this.off(e, n);
164
+ };
165
+ return this.on(e, n), this;
166
+ }
167
+ emit(e, ...t) {
168
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([e, n]) => {
169
+ for (let r = 0; r < n; r++) e(...t);
170
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, r]) => {
171
+ for (let i = 0; i < r; i++) n(e, ...t);
172
+ });
173
+ }
174
+ }, T = class extends w {
175
+ constructor(e, t = {
176
+ ns: ["translation"],
177
+ defaultNS: "translation"
178
+ }) {
179
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
180
+ }
181
+ addNamespaces(e) {
182
+ this.options.ns.includes(e) || this.options.ns.push(e);
183
+ }
184
+ removeNamespaces(e) {
185
+ let t = this.options.ns.indexOf(e);
186
+ t > -1 && this.options.ns.splice(t, 1);
187
+ }
188
+ getResource(e, n, r, i = {}) {
189
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = i.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : i.ignoreJSONStructure, s;
190
+ e.includes(".") ? s = e.split(".") : (s = [e, n], r && (Array.isArray(r) ? s.push(...r) : t(r) && a ? s.push(...r.split(a)) : s.push(r)));
191
+ let c = d(this.data, s);
192
+ return !c && !n && !r && e.includes(".") && (e = s[0], n = s[1], r = s.slice(2).join(".")), c || !o || !t(r) ? c : x(this.data?.[e]?.[n], r, a);
193
+ }
194
+ addResource(e, t, n, r, i = { silent: !1 }) {
195
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
196
+ n && (o = o.concat(a ? n.split(a) : n)), e.includes(".") && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), l(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
197
+ }
198
+ addResources(e, n, r, i = { silent: !1 }) {
199
+ for (let i in r) (t(r[i]) || Array.isArray(r[i])) && this.addResource(e, n, i, r[i], { silent: !0 });
200
+ i.silent || this.emit("added", e, n, r);
201
+ }
202
+ addResourceBundle(e, t, n, r, i, a = {
203
+ silent: !1,
204
+ skipCopy: !1
205
+ }) {
206
+ let o = [e, t];
207
+ e.includes(".") && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
208
+ let s = d(this.data, o) || {};
209
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? p(s, n, i) : s = {
210
+ ...s,
211
+ ...n
212
+ }, l(this.data, o, s), a.silent || this.emit("added", e, t, n);
213
+ }
214
+ removeResourceBundle(e, t) {
215
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
216
+ }
217
+ hasResourceBundle(e, t) {
218
+ return this.getResource(e, t) !== void 0;
219
+ }
220
+ getResourceBundle(e, t) {
221
+ return t ||= this.options.defaultNS, this.getResource(e, t);
222
+ }
223
+ getDataByLanguage(e) {
224
+ return this.data[e];
225
+ }
226
+ hasLanguageSomeTranslations(e) {
227
+ let t = this.getDataByLanguage(e);
228
+ return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
229
+ }
230
+ toJSON() {
231
+ return this.data;
232
+ }
233
+ }, E = {
234
+ processors: {},
235
+ addPostProcessor(e) {
236
+ this.processors[e.name] = e;
237
+ },
238
+ handle(e, t, n, r, i) {
239
+ return e.forEach((e) => {
240
+ t = this.processors[e]?.process(t, n, r, i) ?? t;
241
+ }), t;
242
+ }
243
+ }, D = Symbol("i18next/PATH_KEY");
244
+ function te() {
245
+ let e = [], t = Object.create(null), n;
246
+ return t.get = (r, i) => (n?.revoke?.(), i === D ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
247
+ }
248
+ function O(e, t) {
249
+ let { [D]: n } = e(te()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
250
+ if (n.length > 1 && i) {
251
+ let e = t?.ns, a = Array.isArray(e) ? e : null;
252
+ if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
253
+ }
254
+ return n.join(r);
255
+ }
256
+ var k = (e) => !t(e) && typeof e != "boolean" && typeof e != "number", A = class e extends w {
257
+ constructor(e, t = {}) {
258
+ super(), i([
259
+ "resourceStore",
260
+ "languageUtils",
261
+ "pluralResolver",
262
+ "interpolator",
263
+ "backendConnector",
264
+ "i18nFormat",
265
+ "utils"
266
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = C.create("translator"), this.checkedLoadedFor = {};
267
+ }
268
+ changeLanguage(e) {
269
+ e && (this.language = e);
270
+ }
271
+ exists(e, t = { interpolation: {} }) {
272
+ let n = { ...t };
273
+ if (e == null) return !1;
274
+ let r = this.resolve(e, n);
275
+ if (r?.res === void 0) return !1;
276
+ let i = k(r.res);
277
+ return !(n.returnObjects === !1 && i);
278
+ }
279
+ extractFromKey(e, n) {
280
+ let r = n.nsSeparator === void 0 ? this.options.nsSeparator : n.nsSeparator;
281
+ r === void 0 && (r = ":");
282
+ let i = n.keySeparator === void 0 ? this.options.keySeparator : n.keySeparator, a = n.ns || this.options.defaultNS || [], o = r && e.includes(r), s = !this.options.userDefinedKeySeparator && !n.keySeparator && !this.options.userDefinedNsSeparator && !n.nsSeparator && !b(e, r, i);
283
+ if (o && !s) {
284
+ let n = e.match(this.interpolator.nestingRegexp);
285
+ if (n && n.length > 0) return {
286
+ key: e,
287
+ namespaces: t(a) ? [a] : a
288
+ };
289
+ let o = e.split(r);
290
+ (r !== i || r === i && this.options.ns.includes(o[0])) && (a = o.shift()), e = o.join(i);
291
+ }
292
+ return {
293
+ key: e,
294
+ namespaces: t(a) ? [a] : a
295
+ };
296
+ }
297
+ translate(n, r, i) {
298
+ let a = typeof r == "object" ? { ...r } : r;
299
+ if (typeof a != "object" && this.options.overloadTranslationOptionHandler && (a = this.options.overloadTranslationOptionHandler(arguments)), typeof a == "object" && (a = { ...a }), a ||= {}, n == null) return "";
300
+ typeof n == "function" && (n = O(n, {
301
+ ...this.options,
302
+ ...a
303
+ })), Array.isArray(n) || (n = [String(n)]), n = n.map((e) => typeof e == "function" ? O(e, {
304
+ ...this.options,
305
+ ...a
306
+ }) : String(e));
307
+ let o = a.returnDetails === void 0 ? this.options.returnDetails : a.returnDetails, s = a.keySeparator === void 0 ? this.options.keySeparator : a.keySeparator, { key: c, namespaces: l } = this.extractFromKey(n[n.length - 1], a), u = l[l.length - 1], d = a.nsSeparator === void 0 ? this.options.nsSeparator : a.nsSeparator;
308
+ d === void 0 && (d = ":");
309
+ let f = a.lng || this.language, p = a.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
310
+ if (f?.toLowerCase() === "cimode") return p ? o ? {
311
+ res: `${u}${d}${c}`,
312
+ usedKey: c,
313
+ exactUsedKey: c,
314
+ usedLng: f,
315
+ usedNS: u,
316
+ usedParams: this.getUsedParamsDetails(a)
317
+ } : `${u}${d}${c}` : o ? {
318
+ res: c,
319
+ usedKey: c,
320
+ exactUsedKey: c,
321
+ usedLng: f,
322
+ usedNS: u,
323
+ usedParams: this.getUsedParamsDetails(a)
324
+ } : c;
325
+ let m = this.resolve(n, a), h = m?.res, g = m?.usedKey || c, _ = m?.exactUsedKey || c, v = [
326
+ "[object Number]",
327
+ "[object Function]",
328
+ "[object RegExp]"
329
+ ], y = a.joinArrays === void 0 ? this.options.joinArrays : a.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, x = a.count !== void 0 && !t(a.count), S = e.hasDefaultValue(a), ee = x ? this.pluralResolver.getSuffix(f, a.count, a) : "", C = a.ordinal && x ? this.pluralResolver.getSuffix(f, a.count, { ordinal: !1 }) : "", w = x && !a.ordinal && a.count === 0, T = w && a[`defaultValue${this.options.pluralSeparator}zero`] || a[`defaultValue${ee}`] || a[`defaultValue${C}`] || a.defaultValue, E = h;
330
+ b && !h && S && (E = T);
331
+ let D = k(E), te = Object.prototype.toString.apply(E);
332
+ if (b && E && D && !v.includes(te) && !(t(y) && Array.isArray(E))) {
333
+ if (!a.returnObjects && !this.options.returnObjects) {
334
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
335
+ let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(g, E, {
336
+ ...a,
337
+ ns: l
338
+ }) : `key '${c} (${this.language})' returned an object instead of string.`;
339
+ return o ? (m.res = e, m.usedParams = this.getUsedParamsDetails(a), m) : e;
340
+ }
341
+ if (s) {
342
+ let e = Array.isArray(E), t = e ? [] : {}, n = e ? _ : g;
343
+ for (let e in E) if (Object.prototype.hasOwnProperty.call(E, e)) {
344
+ let r = `${n}${s}${e}`;
345
+ S && !h ? t[e] = this.translate(r, {
346
+ ...a,
347
+ defaultValue: k(T) ? T[e] : void 0,
348
+ joinArrays: !1,
349
+ ns: l
350
+ }) : t[e] = this.translate(r, {
351
+ ...a,
352
+ joinArrays: !1,
353
+ ns: l
354
+ }), t[e] === r && (t[e] = E[e]);
355
+ }
356
+ h = t;
357
+ }
358
+ } else if (b && t(y) && Array.isArray(h)) h = h.join(y), h &&= this.extendTranslation(h, n, a, i);
359
+ else {
360
+ let e = !1, t = !1;
361
+ !this.isValidLookup(h) && S && (e = !0, h = T), this.isValidLookup(h) || (t = !0, h = c);
362
+ let r = (a.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && t ? void 0 : h, o = S && T !== h && this.options.updateMissing;
363
+ if (t || e || o) {
364
+ if (this.logger.log(o ? "updateKey" : "missingKey", f, u, c, o ? T : h), s) {
365
+ let e = this.resolve(c, {
366
+ ...a,
367
+ keySeparator: !1
368
+ });
369
+ e && e.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
370
+ }
371
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, a.lng || this.language);
372
+ if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
373
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(a.lng || this.language) : e.push(a.lng || this.language);
374
+ let n = (e, t, n) => {
375
+ let i = S && n !== h ? n : r;
376
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(e, u, t, i, o, a) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, u, t, i, o, a), this.emit("missingKey", e, u, t, h);
377
+ };
378
+ this.options.saveMissing && (this.options.saveMissingPlurals && x ? e.forEach((e) => {
379
+ let t = this.pluralResolver.getSuffixes(e, a);
380
+ w && a[`defaultValue${this.options.pluralSeparator}zero`] && !t.includes(`${this.options.pluralSeparator}zero`) && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
381
+ n([e], c + t, a[`defaultValue${t}`] || T);
382
+ });
383
+ }) : n(e, c, T));
384
+ }
385
+ h = this.extendTranslation(h, n, a, m, i), t && h === c && this.options.appendNamespaceToMissingKey && (h = `${u}${d}${c}`), (t || e) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}${d}${c}` : c, e ? h : void 0, a));
386
+ }
387
+ return o ? (m.res = h, m.usedParams = this.getUsedParamsDetails(a), m) : h;
388
+ }
389
+ extendTranslation(e, n, r, i, a) {
390
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
391
+ ...this.options.interpolation.defaultVariables,
392
+ ...r
393
+ }, r.lng || this.language || i.usedLng, i.usedNS, i.usedKey, { resolved: i });
394
+ else if (!r.skipInterpolation) {
395
+ r.interpolation && this.interpolator.init({
396
+ ...r,
397
+ interpolation: {
398
+ ...this.options.interpolation,
399
+ ...r.interpolation
400
+ }
401
+ });
402
+ let o = t(e) && (r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables), s;
403
+ if (o) {
404
+ let t = e.match(this.interpolator.nestingRegexp);
405
+ s = t && t.length;
406
+ }
407
+ let c = r.replace && !t(r.replace) ? r.replace : r;
408
+ if (this.options.interpolation.defaultVariables && (c = {
409
+ ...this.options.interpolation.defaultVariables,
410
+ ...c
411
+ }), e = this.interpolator.interpolate(e, c, r.lng || this.language || i.usedLng, r), o) {
412
+ let t = e.match(this.interpolator.nestingRegexp), n = t && t.length;
413
+ s < n && (r.nest = !1);
414
+ }
415
+ !r.lng && i && i.res && (r.lng = this.language || i.usedLng), r.nest !== !1 && (e = this.interpolator.nest(e, (...e) => a?.[0] === e[0] && !r.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${n[0]}`), null) : this.translate(...e, n), r)), r.interpolation && this.interpolator.reset();
416
+ }
417
+ let o = r.postProcess || this.options.postProcess, s = t(o) ? [o] : o;
418
+ return e != null && s?.length && r.applyPostProcessor !== !1 && (e = E.handle(s, e, n, this.options && this.options.postProcessPassResolved ? {
419
+ i18nResolved: {
420
+ ...i,
421
+ usedParams: this.getUsedParamsDetails(r)
422
+ },
423
+ ...r
424
+ } : r, this)), e;
425
+ }
426
+ resolve(e, n = {}) {
427
+ let r, i, a, o, s;
428
+ return t(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? O(e, {
429
+ ...this.options,
430
+ ...n
431
+ }) : e)), e.forEach((e) => {
432
+ if (this.isValidLookup(r)) return;
433
+ let c = this.extractFromKey(e, n), l = c.key;
434
+ i = l;
435
+ let u = c.namespaces;
436
+ this.options.fallbackNS && (u = u.concat(this.options.fallbackNS));
437
+ let d = n.count !== void 0 && !t(n.count), f = d && !n.ordinal && n.count === 0, p = n.context !== void 0 && (t(n.context) || typeof n.context == "number") && n.context !== "", m = n.lngs ? n.lngs : this.languageUtils.toResolveHierarchy(n.lng || this.language, n.fallbackLng);
438
+ u.forEach((e) => {
439
+ this.isValidLookup(r) || (s = e, !this.checkedLoadedFor[`${m[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(s) && (this.checkedLoadedFor[`${m[0]}-${e}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), m.forEach((t) => {
440
+ if (this.isValidLookup(r)) return;
441
+ o = t;
442
+ let i = [l];
443
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(i, l, t, e, n);
444
+ else {
445
+ let e;
446
+ d && (e = this.pluralResolver.getSuffix(t, n.count, n));
447
+ let r = `${this.options.pluralSeparator}zero`, a = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
448
+ if (d && (n.ordinal && e.startsWith(a) && i.push(l + e.replace(a, this.options.pluralSeparator)), i.push(l + e), f && i.push(l + r)), p) {
449
+ let t = `${l}${this.options.contextSeparator || "_"}${n.context}`;
450
+ i.push(t), d && (n.ordinal && e.startsWith(a) && i.push(t + e.replace(a, this.options.pluralSeparator)), i.push(t + e), f && i.push(t + r));
451
+ }
452
+ }
453
+ let s;
454
+ for (; s = i.pop();) this.isValidLookup(r) || (a = s, r = this.getResource(t, e, s, n));
455
+ }));
456
+ });
457
+ }), {
458
+ res: r,
459
+ usedKey: i,
460
+ exactUsedKey: a,
461
+ usedLng: o,
462
+ usedNS: s
463
+ };
464
+ }
465
+ isValidLookup(e) {
466
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
467
+ }
468
+ getResource(e, t, n, r = {}) {
469
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
470
+ }
471
+ getUsedParamsDetails(e = {}) {
472
+ let n = [
473
+ "defaultValue",
474
+ "ordinal",
475
+ "context",
476
+ "replace",
477
+ "lng",
478
+ "lngs",
479
+ "fallbackLng",
480
+ "ns",
481
+ "keySeparator",
482
+ "nsSeparator",
483
+ "returnObjects",
484
+ "returnDetails",
485
+ "joinArrays",
486
+ "postProcess",
487
+ "interpolation"
488
+ ], r = e.replace && !t(e.replace), i = r ? e.replace : e;
489
+ if (r && e.count !== void 0 && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
490
+ ...this.options.interpolation.defaultVariables,
491
+ ...i
492
+ }), !r) {
493
+ i = { ...i };
494
+ for (let e of n) delete i[e];
495
+ }
496
+ return i;
497
+ }
498
+ static hasDefaultValue(e) {
499
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.startsWith("defaultValue") && e[t] !== void 0) return !0;
500
+ return !1;
501
+ }
502
+ }, j = class {
503
+ constructor(e) {
504
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = C.create("languageUtils");
505
+ }
506
+ getScriptPartFromCode(e) {
507
+ if (e = S(e), !e || !e.includes("-")) return null;
508
+ let t = e.split("-");
509
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
510
+ }
511
+ getLanguagePartFromCode(e) {
512
+ if (e = S(e), !e || !e.includes("-")) return e;
513
+ let t = e.split("-");
514
+ return this.formatLanguageCode(t[0]);
515
+ }
516
+ formatLanguageCode(e) {
517
+ if (t(e) && e.includes("-")) {
518
+ let t;
519
+ try {
520
+ t = Intl.getCanonicalLocales(e)[0];
521
+ } catch {}
522
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
523
+ }
524
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
525
+ }
526
+ isSupportedCode(e) {
527
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.includes(e);
528
+ }
529
+ getBestMatchFromCodes(e) {
530
+ if (!e) return null;
531
+ let t;
532
+ return e.forEach((e) => {
533
+ if (t) return;
534
+ let n = this.formatLanguageCode(e);
535
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
536
+ }), !t && this.options.supportedLngs && e.forEach((e) => {
537
+ if (t) return;
538
+ let n = this.getScriptPartFromCode(e);
539
+ if (this.isSupportedCode(n)) return t = n;
540
+ let r = this.getLanguagePartFromCode(e);
541
+ if (this.isSupportedCode(r)) return t = r;
542
+ t = this.options.supportedLngs.find((e) => e === r ? !0 : !e.includes("-") && !r.includes("-") ? !1 : !!(e.includes("-") && !r.includes("-") && e.slice(0, e.indexOf("-")) === r || e.startsWith(r) && r.length > 1));
543
+ }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
544
+ }
545
+ getFallbackCodes(e, n) {
546
+ if (!e) return [];
547
+ if (typeof e == "function" && (e = e(n)), t(e) && (e = [e]), Array.isArray(e)) return e;
548
+ if (!n) return e.default || [];
549
+ let r = e[n];
550
+ return r ||= e[this.getScriptPartFromCode(n)], r ||= e[this.formatLanguageCode(n)], r ||= e[this.getLanguagePartFromCode(n)], r ||= e.default, r || [];
551
+ }
552
+ toResolveHierarchy(e, n) {
553
+ let r = this.getFallbackCodes((n === !1 ? [] : n) || this.options.fallbackLng || [], e), i = [], a = (e) => {
554
+ e && (this.isSupportedCode(e) ? i.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
555
+ };
556
+ return t(e) && (e.includes("-") || e.includes("_")) ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(e))) : t(e) && a(this.formatLanguageCode(e)), r.forEach((e) => {
557
+ i.includes(e) || a(this.formatLanguageCode(e));
558
+ }), i;
559
+ }
560
+ }, M = {
561
+ zero: 0,
562
+ one: 1,
563
+ two: 2,
564
+ few: 3,
565
+ many: 4,
566
+ other: 5
567
+ }, N = {
568
+ select: (e) => e === 1 ? "one" : "other",
569
+ resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
570
+ }, ne = class {
571
+ constructor(e, t = {}) {
572
+ this.languageUtils = e, this.options = t, this.logger = C.create("pluralResolver"), this.pluralRulesCache = {};
573
+ }
574
+ clearCache() {
575
+ this.pluralRulesCache = {};
576
+ }
577
+ getRule(e, t = {}) {
578
+ let n = S(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
579
+ cleanedCode: n,
580
+ type: r
581
+ });
582
+ if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
583
+ let a;
584
+ try {
585
+ a = new Intl.PluralRules(n, { type: r });
586
+ } catch {
587
+ if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), N;
588
+ if (!e.match(/-|_/)) return N;
589
+ let n = this.languageUtils.getLanguagePartFromCode(e);
590
+ a = this.getRule(n, t);
591
+ }
592
+ return this.pluralRulesCache[i] = a, a;
593
+ }
594
+ needsPlural(e, t = {}) {
595
+ let n = this.getRule(e, t);
596
+ return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
597
+ }
598
+ getPluralFormsOfKey(e, t, n = {}) {
599
+ return this.getSuffixes(e, n).map((e) => `${t}${e}`);
600
+ }
601
+ getSuffixes(e, t = {}) {
602
+ let n = this.getRule(e, t);
603
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => M[e] - M[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
604
+ }
605
+ getSuffix(e, t, n = {}) {
606
+ let r = this.getRule(e, n);
607
+ return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
608
+ }
609
+ }, P = (e, n, r, i = ".", a = !0) => {
610
+ let o = f(e, n, r);
611
+ return !o && a && t(r) && (o = x(e, r, i), o === void 0 && (o = x(n, r, i))), o;
612
+ }, F = (e) => e.replace(/\$/g, "$$$$"), re = class {
613
+ constructor(e = {}) {
614
+ this.logger = C.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
615
+ }
616
+ init(e = {}) {
617
+ e.interpolation ||= { escapeValue: !0 };
618
+ let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: h, nestingOptionsSeparator: _, maxReplaces: v, alwaysFormat: y } = e.interpolation;
619
+ this.escape = t === void 0 ? g : t, this.escapeValue = n === void 0 ? !0 : n, this.useRawValueToEscape = r === void 0 ? !1 : r, this.prefix = i ? m(i) : a || "{{", this.suffix = o ? m(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? m(d) : f || m("$t("), this.nestingSuffix = p ? m(p) : h || m(")"), this.nestingOptionsSeparator = _ || ",", this.maxReplaces = v || 1e3, this.alwaysFormat = y === void 0 ? !1 : y, this.resetRegExp();
620
+ }
621
+ reset() {
622
+ this.options && this.init(this.options);
623
+ }
624
+ resetRegExp() {
625
+ let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
626
+ this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
627
+ }
628
+ interpolate(e, n, i, a) {
629
+ let o, s, c, l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (e) => {
630
+ if (!e.includes(this.formatSeparator)) {
631
+ let t = P(n, l, e, this.options.keySeparator, this.options.ignoreJSONStructure);
632
+ return this.alwaysFormat ? this.format(t, void 0, i, {
633
+ ...a,
634
+ ...n,
635
+ interpolationkey: e
636
+ }) : t;
637
+ }
638
+ let t = e.split(this.formatSeparator), r = t.shift().trim(), o = t.join(this.formatSeparator).trim();
639
+ return this.format(P(n, l, r, this.options.keySeparator, this.options.ignoreJSONStructure), o, i, {
640
+ ...a,
641
+ ...n,
642
+ interpolationkey: r
643
+ });
644
+ };
645
+ this.resetRegExp();
646
+ let d = a?.missingInterpolationHandler || this.options.missingInterpolationHandler, f = a?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : a.interpolation.skipOnVariables;
647
+ return [{
648
+ regex: this.regexpUnescape,
649
+ safeValue: (e) => F(e)
650
+ }, {
651
+ regex: this.regexp,
652
+ safeValue: (e) => this.escapeValue ? F(this.escape(e)) : F(e)
653
+ }].forEach((n) => {
654
+ for (c = 0; o = n.regex.exec(e);) {
655
+ let i = o[1].trim();
656
+ if (s = u(i), s === void 0) if (typeof d == "function") {
657
+ let n = d(e, o, a);
658
+ s = t(n) ? n : "";
659
+ } else if (a && Object.prototype.hasOwnProperty.call(a, i)) s = "";
660
+ else if (f) {
661
+ s = o[0];
662
+ continue;
663
+ } else this.logger.warn(`missed to pass in variable ${i} for interpolating ${e}`), s = "";
664
+ else !t(s) && !this.useRawValueToEscape && (s = r(s));
665
+ let l = n.safeValue(s);
666
+ if (e = e.replace(o[0], l), f ? (n.regex.lastIndex += s.length, n.regex.lastIndex -= o[0].length) : n.regex.lastIndex = 0, c++, c >= this.maxReplaces) break;
667
+ }
668
+ }), e;
669
+ }
670
+ nest(e, n, i = {}) {
671
+ let a, o, s, c = (e, t) => {
672
+ let n = this.nestingOptionsSeparator;
673
+ if (!e.includes(n)) return e;
674
+ let r = e.split(RegExp(`${m(n)}[ ]*{`)), i = `{${r[1]}`;
675
+ e = r[0], i = this.interpolate(i, s);
676
+ let a = i.match(/'/g), o = i.match(/"/g);
677
+ ((a?.length ?? 0) % 2 == 0 && !o || (o?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
678
+ try {
679
+ s = JSON.parse(i), t && (s = {
680
+ ...t,
681
+ ...s
682
+ });
683
+ } catch (t) {
684
+ return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
685
+ }
686
+ return s.defaultValue && s.defaultValue.includes(this.prefix) && delete s.defaultValue, e;
687
+ };
688
+ for (; a = this.nestingRegexp.exec(e);) {
689
+ let l = [];
690
+ s = { ...i }, s = s.replace && !t(s.replace) ? s.replace : s, s.applyPostProcessor = !1, delete s.defaultValue;
691
+ let u = /{.*}/.test(a[1]) ? a[1].lastIndexOf("}") + 1 : a[1].indexOf(this.formatSeparator);
692
+ if (u !== -1 && (l = a[1].slice(u).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), a[1] = a[1].slice(0, u)), o = n(c.call(this, a[1].trim(), s), s), o && a[0] === e && !t(o)) return o;
693
+ t(o) || (o = r(o)), o ||= (this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`), ""), l.length && (o = l.reduce((e, t) => this.format(e, t, i.lng, {
694
+ ...i,
695
+ interpolationkey: a[1].trim()
696
+ }), o.trim())), e = e.replace(a[0], o), this.regexp.lastIndex = 0;
697
+ }
698
+ return e;
699
+ }
700
+ }, ie = (e) => {
701
+ let t = e.toLowerCase().trim(), n = {};
702
+ if (e.includes("(")) {
703
+ let r = e.split("(");
704
+ t = r[0].toLowerCase().trim();
705
+ let i = r[1].slice(0, -1);
706
+ t === "currency" && !i.includes(":") ? n.currency ||= i.trim() : t === "relativetime" && !i.includes(":") ? n.range ||= i.trim() : i.split(";").forEach((e) => {
707
+ if (e) {
708
+ let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
709
+ n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
710
+ }
711
+ });
712
+ }
713
+ return {
714
+ formatName: t,
715
+ formatOptions: n
716
+ };
717
+ }, ae = (e) => {
718
+ let t = {};
719
+ return (n, r, i) => {
720
+ let a = i;
721
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
722
+ ...a,
723
+ [i.interpolationkey]: void 0
724
+ });
725
+ let o = r + JSON.stringify(a), s = t[o];
726
+ return s || (s = e(S(r), i), t[o] = s), s(n);
727
+ };
728
+ }, oe = (e) => (t, n, r) => e(S(n), r)(t), se = class {
729
+ constructor(e = {}) {
730
+ this.logger = C.create("formatter"), this.options = e, this.init(e);
731
+ }
732
+ init(e, t = { interpolation: {} }) {
733
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
734
+ let n = t.cacheInBuiltFormats ? ae : oe;
735
+ this.formats = {
736
+ number: n((e, t) => {
737
+ let n = new Intl.NumberFormat(e, { ...t });
738
+ return (e) => n.format(e);
739
+ }),
740
+ currency: n((e, t) => {
741
+ let n = new Intl.NumberFormat(e, {
742
+ ...t,
743
+ style: "currency"
744
+ });
745
+ return (e) => n.format(e);
746
+ }),
747
+ datetime: n((e, t) => {
748
+ let n = new Intl.DateTimeFormat(e, { ...t });
749
+ return (e) => n.format(e);
750
+ }),
751
+ relativetime: n((e, t) => {
752
+ let n = new Intl.RelativeTimeFormat(e, { ...t });
753
+ return (e) => n.format(e, t.range || "day");
754
+ }),
755
+ list: n((e, t) => {
756
+ let n = new Intl.ListFormat(e, { ...t });
757
+ return (e) => n.format(e);
758
+ })
759
+ };
760
+ }
761
+ add(e, t) {
762
+ this.formats[e.toLowerCase().trim()] = t;
763
+ }
764
+ addCached(e, t) {
765
+ this.formats[e.toLowerCase().trim()] = ae(t);
766
+ }
767
+ format(e, t, n, r = {}) {
768
+ if (!t || e == null) return e;
769
+ let i = t.split(this.formatSeparator);
770
+ if (i.length > 1 && i[0].indexOf("(") > 1 && !i[0].includes(")") && i.find((e) => e.includes(")"))) {
771
+ let e = i.findIndex((e) => e.includes(")"));
772
+ i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
773
+ }
774
+ return i.reduce((e, t) => {
775
+ let { formatName: i, formatOptions: a } = ie(t);
776
+ if (this.formats[i]) {
777
+ let t = e;
778
+ try {
779
+ let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
780
+ t = this.formats[i](e, s, {
781
+ ...a,
782
+ ...r,
783
+ ...o
784
+ });
785
+ } catch (e) {
786
+ this.logger.warn(e);
787
+ }
788
+ return t;
789
+ } else this.logger.warn(`there was no format function for ${i}`);
790
+ return e;
791
+ }, e);
792
+ }
793
+ }, ce = (e, t) => {
794
+ e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
795
+ }, le = class extends w {
796
+ constructor(e, t, n, r = {}) {
797
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = C.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
798
+ }
799
+ queueLoad(e, t, n, r) {
800
+ let i = {}, a = {}, o = {}, s = {};
801
+ return e.forEach((e) => {
802
+ let r = !0;
803
+ t.forEach((t) => {
804
+ let o = `${e}|${t}`;
805
+ !n.reload && this.store.hasResourceBundle(e, t) ? this.state[o] = 2 : this.state[o] < 0 || (this.state[o] === 1 ? a[o] === void 0 && (a[o] = !0) : (this.state[o] = 1, r = !1, a[o] === void 0 && (a[o] = !0), i[o] === void 0 && (i[o] = !0), s[t] === void 0 && (s[t] = !0)));
806
+ }), r || (o[e] = !0);
807
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
808
+ pending: a,
809
+ pendingCount: Object.keys(a).length,
810
+ loaded: {},
811
+ errors: [],
812
+ callback: r
813
+ }), {
814
+ toLoad: Object.keys(i),
815
+ pending: Object.keys(a),
816
+ toLoadLanguages: Object.keys(o),
817
+ toLoadNamespaces: Object.keys(s)
818
+ };
819
+ }
820
+ loaded(e, t, n) {
821
+ let r = e.split("|"), i = r[0], a = r[1];
822
+ t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
823
+ let o = {};
824
+ this.queue.forEach((n) => {
825
+ u(n.loaded, [i], a), ce(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
826
+ o[e] || (o[e] = {});
827
+ let t = n.loaded[e];
828
+ t.length && t.forEach((t) => {
829
+ o[e][t] === void 0 && (o[e][t] = !0);
830
+ });
831
+ }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
832
+ }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
833
+ }
834
+ read(e, t, n, r = 0, i = this.retryTimeout, a) {
835
+ if (!e.length) return a(null, {});
836
+ if (this.readingCalls >= this.maxParallelReads) {
837
+ this.waitingReads.push({
838
+ lng: e,
839
+ ns: t,
840
+ fcName: n,
841
+ tried: r,
842
+ wait: i,
843
+ callback: a
844
+ });
845
+ return;
846
+ }
847
+ this.readingCalls++;
848
+ let o = (o, s) => {
849
+ if (this.readingCalls--, this.waitingReads.length > 0) {
850
+ let e = this.waitingReads.shift();
851
+ this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
852
+ }
853
+ if (o && s && r < this.maxRetries) {
854
+ setTimeout(() => {
855
+ this.read(e, t, n, r + 1, i * 2, a);
856
+ }, i);
857
+ return;
858
+ }
859
+ a(o, s);
860
+ }, s = this.backend[n].bind(this.backend);
861
+ if (s.length === 2) {
862
+ try {
863
+ let n = s(e, t);
864
+ n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
865
+ } catch (e) {
866
+ o(e);
867
+ }
868
+ return;
869
+ }
870
+ return s(e, t, o);
871
+ }
872
+ prepareLoading(e, n, r = {}, i) {
873
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
874
+ t(e) && (e = this.languageUtils.toResolveHierarchy(e)), t(n) && (n = [n]);
875
+ let a = this.queueLoad(e, n, r, i);
876
+ if (!a.toLoad.length) return a.pending.length || i(), null;
877
+ a.toLoad.forEach((e) => {
878
+ this.loadOne(e);
879
+ });
880
+ }
881
+ load(e, t, n) {
882
+ this.prepareLoading(e, t, {}, n);
883
+ }
884
+ reload(e, t, n) {
885
+ this.prepareLoading(e, t, { reload: !0 }, n);
886
+ }
887
+ loadOne(e, t = "") {
888
+ let n = e.split("|"), r = n[0], i = n[1];
889
+ this.read(r, i, "read", void 0, void 0, (n, a) => {
890
+ n && this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`, n), !n && a && this.logger.log(`${t}loaded namespace ${i} for language ${r}`, a), this.loaded(e, n, a);
891
+ });
892
+ }
893
+ saveMissing(e, t, n, r, i, a = {}, o = () => {}) {
894
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
895
+ this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
896
+ return;
897
+ }
898
+ if (!(n == null || n === "")) {
899
+ if (this.backend?.create) {
900
+ let s = {
901
+ ...a,
902
+ isUpdate: i
903
+ }, c = this.backend.create.bind(this.backend);
904
+ if (c.length < 6) try {
905
+ let i;
906
+ i = c.length === 5 ? c(e, t, n, r, s) : c(e, t, n, r), i && typeof i.then == "function" ? i.then((e) => o(null, e)).catch(o) : o(null, i);
907
+ } catch (e) {
908
+ o(e);
909
+ }
910
+ else c(e, t, n, r, o, s);
911
+ }
912
+ !e || !e[0] || this.store.addResource(e[0], t, n, r);
913
+ }
914
+ }
915
+ }, I = () => ({
916
+ debug: !1,
917
+ initAsync: !0,
918
+ ns: ["translation"],
919
+ defaultNS: ["translation"],
920
+ fallbackLng: ["dev"],
921
+ fallbackNS: !1,
922
+ supportedLngs: !1,
923
+ nonExplicitSupportedLngs: !1,
924
+ load: "all",
925
+ preload: !1,
926
+ keySeparator: ".",
927
+ nsSeparator: ":",
928
+ pluralSeparator: "_",
929
+ contextSeparator: "_",
930
+ partialBundledLanguages: !1,
931
+ saveMissing: !1,
932
+ updateMissing: !1,
933
+ saveMissingTo: "fallback",
934
+ saveMissingPlurals: !0,
935
+ missingKeyHandler: !1,
936
+ missingInterpolationHandler: !1,
937
+ postProcess: !1,
938
+ postProcessPassResolved: !1,
939
+ returnNull: !1,
940
+ returnEmptyString: !0,
941
+ returnObjects: !1,
942
+ joinArrays: !1,
943
+ returnedObjectHandler: !1,
944
+ parseMissingKeyHandler: !1,
945
+ appendNamespaceToMissingKey: !1,
946
+ appendNamespaceToCIMode: !1,
947
+ overloadTranslationOptionHandler: (e) => {
948
+ let n = {};
949
+ if (typeof e[1] == "object" && (n = e[1]), t(e[1]) && (n.defaultValue = e[1]), t(e[2]) && (n.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
950
+ let t = e[3] || e[2];
951
+ Object.keys(t).forEach((e) => {
952
+ n[e] = t[e];
953
+ });
954
+ }
955
+ return n;
956
+ },
957
+ interpolation: {
958
+ escapeValue: !0,
959
+ prefix: "{{",
960
+ suffix: "}}",
961
+ formatSeparator: ",",
962
+ unescapePrefix: "-",
963
+ nestingPrefix: "$t(",
964
+ nestingSuffix: ")",
965
+ nestingOptionsSeparator: ",",
966
+ maxReplaces: 1e3,
967
+ skipOnVariables: !0
968
+ },
969
+ cacheInBuiltFormats: !0
970
+ }), L = (e) => (t(e.ns) && (e.ns = [e.ns]), t(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), t(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs && !e.supportedLngs.includes("cimode") && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), e), R = () => {}, ue = (e) => {
971
+ Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
972
+ typeof e[t] == "function" && (e[t] = e[t].bind(e));
973
+ });
974
+ }, z = class e extends w {
975
+ constructor(e = {}, t) {
976
+ if (super(), this.options = L(e), this.services = {}, this.logger = C, this.modules = { external: [] }, ue(this), t && !this.isInitialized && !e.isClone) {
977
+ if (!this.options.initAsync) return this.init(e, t), this;
978
+ setTimeout(() => {
979
+ this.init(e, t);
980
+ }, 0);
981
+ }
982
+ }
983
+ init(e = {}, r) {
984
+ this.isInitializing = !0, typeof e == "function" && (r = e, e = {}), e.defaultNS == null && e.ns && (t(e.ns) ? e.defaultNS = e.ns : e.ns.includes("translation") || (e.defaultNS = e.ns[0]));
985
+ let i = I();
986
+ this.options = {
987
+ ...i,
988
+ ...this.options,
989
+ ...L(e)
990
+ }, this.options.interpolation = {
991
+ ...i.interpolation,
992
+ ...this.options.interpolation
993
+ }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = i.overloadTranslationOptionHandler);
994
+ let a = (e) => e ? typeof e == "function" ? new e() : e : null;
995
+ if (!this.options.isClone) {
996
+ this.modules.logger ? C.init(a(this.modules.logger), this.options) : C.init(null, this.options);
997
+ let e;
998
+ e = this.modules.formatter ? this.modules.formatter : se;
999
+ let t = new j(this.options);
1000
+ this.store = new T(this.options.resources, this.options);
1001
+ let n = this.services;
1002
+ n.logger = C, n.resourceStore = this.store, n.languageUtils = t, n.pluralResolver = new ne(t, { prepend: this.options.pluralSeparator }), e && (n.formatter = a(e), n.formatter.init && n.formatter.init(n, this.options), this.options.interpolation.format = n.formatter.format.bind(n.formatter)), n.interpolator = new re(this.options), n.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n.backendConnector = new le(a(this.modules.backend), n.resourceStore, n, this.options), n.backendConnector.on("*", (e, ...t) => {
1003
+ this.emit(e, ...t);
1004
+ }), this.modules.languageDetector && (n.languageDetector = a(this.modules.languageDetector), n.languageDetector.init && n.languageDetector.init(n, this.options.detection, this.options)), this.modules.i18nFormat && (n.i18nFormat = a(this.modules.i18nFormat), n.i18nFormat.init && n.i18nFormat.init(this)), this.translator = new A(this.services, this.options), this.translator.on("*", (e, ...t) => {
1005
+ this.emit(e, ...t);
1006
+ }), this.modules.external.forEach((e) => {
1007
+ e.init && e.init(this);
1008
+ });
1009
+ }
1010
+ if (this.format = this.options.interpolation.format, r ||= R, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1011
+ let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1012
+ e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1013
+ }
1014
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
1015
+ "getResource",
1016
+ "hasResourceBundle",
1017
+ "getResourceBundle",
1018
+ "getDataByLanguage"
1019
+ ].forEach((e) => {
1020
+ this[e] = (...t) => this.store[e](...t);
1021
+ }), [
1022
+ "addResource",
1023
+ "addResources",
1024
+ "addResourceBundle",
1025
+ "removeResourceBundle"
1026
+ ].forEach((e) => {
1027
+ this[e] = (...t) => (this.store[e](...t), this);
1028
+ });
1029
+ let o = n(), s = () => {
1030
+ let e = (e, t) => {
1031
+ this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), o.resolve(t), r(e, t);
1032
+ };
1033
+ if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1034
+ this.changeLanguage(this.options.lng, e);
1035
+ };
1036
+ return this.options.resources || !this.options.initAsync ? s() : setTimeout(s, 0), o;
1037
+ }
1038
+ loadResources(e, n = R) {
1039
+ let r = n, i = t(e) ? e : this.language;
1040
+ if (typeof e == "function" && (r = e), !this.options.resources || this.options.partialBundledLanguages) {
1041
+ if (i?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return r();
1042
+ let e = [], t = (t) => {
1043
+ t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1044
+ t !== "cimode" && (e.includes(t) || e.push(t));
1045
+ });
1046
+ };
1047
+ i ? t(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => t(e)), this.options.preload?.forEach?.((e) => t(e)), this.services.backendConnector.load(e, this.options.ns, (e) => {
1048
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), r(e);
1049
+ });
1050
+ } else r(null);
1051
+ }
1052
+ reloadResources(e, t, r) {
1053
+ let i = n();
1054
+ return typeof e == "function" && (r = e, e = void 0), typeof t == "function" && (r = t, t = void 0), e ||= this.languages, t ||= this.options.ns, r ||= R, this.services.backendConnector.reload(e, t, (e) => {
1055
+ i.resolve(), r(e);
1056
+ }), i;
1057
+ }
1058
+ use(e) {
1059
+ if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1060
+ if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1061
+ return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && E.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1062
+ }
1063
+ setResolvedLanguage(e) {
1064
+ if (!(!e || !this.languages) && !["cimode", "dev"].includes(e)) {
1065
+ for (let e = 0; e < this.languages.length; e++) {
1066
+ let t = this.languages[e];
1067
+ if (!["cimode", "dev"].includes(t) && this.store.hasLanguageSomeTranslations(t)) {
1068
+ this.resolvedLanguage = t;
1069
+ break;
1070
+ }
1071
+ }
1072
+ !this.resolvedLanguage && !this.languages.includes(e) && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1073
+ }
1074
+ }
1075
+ changeLanguage(e, r) {
1076
+ this.isLanguageChangingTo = e;
1077
+ let i = n();
1078
+ this.emit("languageChanging", e);
1079
+ let a = (e) => {
1080
+ this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1081
+ }, o = (t, n) => {
1082
+ n ? this.isLanguageChangingTo === e && (a(n), this.translator.changeLanguage(n), this.isLanguageChangingTo = void 0, this.emit("languageChanged", n), this.logger.log("languageChanged", n)) : this.isLanguageChangingTo = void 0, i.resolve((...e) => this.t(...e)), r && r(t, (...e) => this.t(...e));
1083
+ }, s = (n) => {
1084
+ !e && !n && this.services.languageDetector && (n = []);
1085
+ let r = t(n) ? n : n && n[0], i = this.store.hasLanguageSomeTranslations(r) ? r : this.services.languageUtils.getBestMatchFromCodes(t(n) ? [n] : n);
1086
+ i && (this.language || a(i), this.translator.language || this.translator.changeLanguage(i), this.services.languageDetector?.cacheUserLanguage?.(i)), this.loadResources(i, (e) => {
1087
+ o(e, i);
1088
+ });
1089
+ };
1090
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? s(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(s) : this.services.languageDetector.detect(s) : s(e), i;
1091
+ }
1092
+ getFixedT(e, n, r) {
1093
+ let i = (e, t, ...n) => {
1094
+ let a;
1095
+ a = typeof t == "object" ? { ...t } : this.options.overloadTranslationOptionHandler([e, t].concat(n)), a.lng = a.lng || i.lng, a.lngs = a.lngs || i.lngs, a.ns = a.ns || i.ns, a.keyPrefix !== "" && (a.keyPrefix = a.keyPrefix || r || i.keyPrefix);
1096
+ let o = {
1097
+ ...this.options,
1098
+ ...a
1099
+ };
1100
+ typeof a.keyPrefix == "function" && (a.keyPrefix = O(a.keyPrefix, o));
1101
+ let s = this.options.keySeparator || ".", c;
1102
+ return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = O(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = O(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1103
+ };
1104
+ return t(e) ? i.lng = e : i.lngs = e, i.ns = n, i.keyPrefix = r, i;
1105
+ }
1106
+ t(...e) {
1107
+ return this.translator?.translate(...e);
1108
+ }
1109
+ exists(...e) {
1110
+ return this.translator?.exists(...e);
1111
+ }
1112
+ setDefaultNamespace(e) {
1113
+ this.options.defaultNS = e;
1114
+ }
1115
+ hasLoadedNamespace(e, t = {}) {
1116
+ if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1117
+ if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1118
+ let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1119
+ if (n.toLowerCase() === "cimode") return !0;
1120
+ let a = (e, t) => {
1121
+ let n = this.services.backendConnector.state[`${e}|${t}`];
1122
+ return n === -1 || n === 0 || n === 2;
1123
+ };
1124
+ if (t.precheck) {
1125
+ let e = t.precheck(this, a);
1126
+ if (e !== void 0) return e;
1127
+ }
1128
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1129
+ }
1130
+ loadNamespaces(e, r) {
1131
+ let i = n();
1132
+ return this.options.ns ? (t(e) && (e = [e]), e.forEach((e) => {
1133
+ this.options.ns.includes(e) || this.options.ns.push(e);
1134
+ }), this.loadResources((e) => {
1135
+ i.resolve(), r && r(e);
1136
+ }), i) : (r && r(), Promise.resolve());
1137
+ }
1138
+ loadLanguages(e, r) {
1139
+ let i = n();
1140
+ t(e) && (e = [e]);
1141
+ let a = this.options.preload || [], o = e.filter((e) => !a.includes(e) && this.services.languageUtils.isSupportedCode(e));
1142
+ return o.length ? (this.options.preload = a.concat(o), this.loadResources((e) => {
1143
+ i.resolve(), r && r(e);
1144
+ }), i) : (r && r(), Promise.resolve());
1145
+ }
1146
+ dir(e) {
1147
+ if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
1148
+ try {
1149
+ let t = new Intl.Locale(e);
1150
+ if (t && t.getTextInfo) {
1151
+ let e = t.getTextInfo();
1152
+ if (e && e.direction) return e.direction;
1153
+ }
1154
+ } catch {}
1155
+ let t = /* @__PURE__ */ "ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb".split("."), n = this.services?.languageUtils || new j(I());
1156
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.includes(n.getLanguagePartFromCode(e)) || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1157
+ }
1158
+ static createInstance(t = {}, n) {
1159
+ let r = new e(t, n);
1160
+ return r.createInstance = e.createInstance, r;
1161
+ }
1162
+ cloneInstance(t = {}, n = R) {
1163
+ let r = t.forkResourceStore;
1164
+ r && delete t.forkResourceStore;
1165
+ let i = {
1166
+ ...this.options,
1167
+ ...t,
1168
+ isClone: !0
1169
+ }, a = new e(i);
1170
+ if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1171
+ "store",
1172
+ "services",
1173
+ "language"
1174
+ ].forEach((e) => {
1175
+ a[e] = this[e];
1176
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new T(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, e[t] = Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), e[t]), e), {}), i), a.services.resourceStore = a.store), t.interpolation) {
1177
+ let e = {
1178
+ ...I().interpolation,
1179
+ ...this.options.interpolation,
1180
+ ...t.interpolation
1181
+ }, n = {
1182
+ ...i,
1183
+ interpolation: e
1184
+ };
1185
+ a.services.interpolator = new re(n);
1186
+ }
1187
+ return a.translator = new A(a.services, i), a.translator.on("*", (e, ...t) => {
1188
+ a.emit(e, ...t);
1189
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1190
+ }
1191
+ toJSON() {
1192
+ return {
1193
+ options: this.options,
1194
+ store: this.store,
1195
+ language: this.language,
1196
+ languages: this.languages,
1197
+ resolvedLanguage: this.resolvedLanguage
1198
+ };
1199
+ }
1200
+ }.createInstance();
1201
+ z.createInstance, z.dir, z.init, z.loadResources, z.reloadResources, z.use, z.changeLanguage, z.getFixedT, z.t, z.exists, z.setDefaultNamespace, z.hasLoadedNamespace, z.loadNamespaces, z.loadLanguages;
1202
+ //#endregion
1203
+ //#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
1204
+ function B(e, t) {
1205
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1206
+ }
1207
+ //#endregion
1208
+ //#region node_modules/@babel/runtime/helpers/esm/typeof.js
1209
+ function V(e) {
1210
+ "@babel/helpers - typeof";
1211
+ return V = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1212
+ return typeof e;
1213
+ } : function(e) {
1214
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1215
+ }, V(e);
1216
+ }
1217
+ //#endregion
1218
+ //#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
1219
+ function de(e, t) {
1220
+ if (V(e) != "object" || !e) return e;
1221
+ var n = e[Symbol.toPrimitive];
1222
+ if (n !== void 0) {
1223
+ var r = n.call(e, t || "default");
1224
+ if (V(r) != "object") return r;
1225
+ throw TypeError("@@toPrimitive must return a primitive value.");
1226
+ }
1227
+ return (t === "string" ? String : Number)(e);
1228
+ }
1229
+ //#endregion
1230
+ //#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
1231
+ function H(e) {
1232
+ var t = de(e, "string");
1233
+ return V(t) == "symbol" ? t : t + "";
1234
+ }
1235
+ //#endregion
1236
+ //#region node_modules/@babel/runtime/helpers/esm/createClass.js
1237
+ function U(e, t) {
1238
+ for (var n = 0; n < t.length; n++) {
1239
+ var r = t[n];
1240
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, H(r.key), r);
1241
+ }
1242
+ }
1243
+ function W(e, t, n) {
1244
+ return t && U(e.prototype, t), n && U(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1245
+ }
1246
+ //#endregion
1247
+ //#region node_modules/i18next-chained-backend/dist/esm/index.js
1248
+ var G = [], fe = G.forEach, pe = G.slice;
1249
+ function me(e) {
1250
+ return fe.call(pe.call(arguments, 1), function(t) {
1251
+ if (t) for (var n in t) e[n] === void 0 && (e[n] = t[n]);
1252
+ }), e;
1253
+ }
1254
+ function he(e) {
1255
+ return e ? typeof e == "function" ? new e() : e : null;
1256
+ }
1257
+ function ge() {
1258
+ return {
1259
+ handleEmptyResourcesAsFailed: !0,
1260
+ cacheHitMode: "none"
1261
+ };
1262
+ }
1263
+ function K(e, t, n, r) {
1264
+ var i = e.read.bind(e);
1265
+ if (i.length === 2) {
1266
+ try {
1267
+ var a = i(t, n);
1268
+ a && typeof a.then == "function" ? a.then(function(e) {
1269
+ return r(null, e);
1270
+ }).catch(r) : r(null, a);
1271
+ } catch (e) {
1272
+ r(e);
1273
+ }
1274
+ return;
1275
+ }
1276
+ i(t, n, r);
1277
+ }
1278
+ var q = /* @__PURE__ */ function() {
1279
+ function e(t) {
1280
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1281
+ B(this, e), this.backends = [], this.type = "backend", this.allOptions = r, this.init(t, n);
1282
+ }
1283
+ return W(e, [
1284
+ {
1285
+ key: "init",
1286
+ value: function(e) {
1287
+ var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1288
+ this.services = e, this.options = me(n, this.options || {}, ge()), this.allOptions = r, this.options.backends && this.options.backends.length > 1 && (this.allOptions.saveMissing || this.allOptions.updateMissing) && this.services && this.services.logger && this.services.logger.warn("i18next-chained-backend: Using multiple backends in combination with saveMissing/updateMissing is not recommended, as it may trigger based on stale data."), this.options.backends && this.options.backends.forEach(function(n, i) {
1289
+ t.backends[i] = t.backends[i] || he(n), t.backends[i].init(e, t.options.backendOptions && t.options.backendOptions[i] || {}, r);
1290
+ }), this.services && this.options.reloadInterval && setInterval(function() {
1291
+ return t.reload();
1292
+ }, this.options.reloadInterval);
1293
+ }
1294
+ },
1295
+ {
1296
+ key: "read",
1297
+ value: function(e, t, n) {
1298
+ var r = this, i = this.backends.length, a = function(s) {
1299
+ if (s >= i) return n(Error("non of the backend loaded data", !0));
1300
+ var c = s === i - 1, l = r.options.handleEmptyResourcesAsFailed && !c ? 0 : -1, u = r.backends[s];
1301
+ u.read ? K(u, e, t, function(i, c, d) {
1302
+ if (!i && c && Object.keys(c).length > l) {
1303
+ if (n(null, c, s), o(s - 1, c), u.save && r.options.cacheHitMode && ["refresh", "refreshAndUpdateStore"].indexOf(r.options.cacheHitMode) > -1) {
1304
+ if (d && r.options.refreshExpirationTime && d + r.options.refreshExpirationTime > Date.now()) return;
1305
+ var f = r.backends[s + 1];
1306
+ f && f.read && K(f, e, t, function(n, i) {
1307
+ n || i && (Object.keys(i).length <= l || (o(s, i), r.options.cacheHitMode === "refreshAndUpdateStore" && r.services && r.services.resourceStore && r.services.resourceStore.addResourceBundle(e, t, i)));
1308
+ });
1309
+ }
1310
+ } else a(s + 1);
1311
+ }) : a(s + 1);
1312
+ }, o = function(n, i) {
1313
+ if (!(n < 0)) {
1314
+ var a = r.backends[n];
1315
+ a.save && a.save(e, t, i), o(n - 1, i);
1316
+ }
1317
+ };
1318
+ a(0);
1319
+ }
1320
+ },
1321
+ {
1322
+ key: "create",
1323
+ value: function(e, t, n, r) {
1324
+ var i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function() {}, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
1325
+ this.backends.forEach(function(o) {
1326
+ if (o.create) {
1327
+ var s = o.create.bind(o);
1328
+ if (s.length < 6) {
1329
+ try {
1330
+ var c = s.length === 5 ? s(e, t, n, r, a) : s(e, t, n, r);
1331
+ c && typeof c.then == "function" ? c.then(function(e) {
1332
+ return i(null, e);
1333
+ }).catch(i) : i(null, c);
1334
+ } catch (e) {
1335
+ i(e);
1336
+ }
1337
+ return;
1338
+ }
1339
+ s(e, t, n, r, i, a);
1340
+ }
1341
+ });
1342
+ }
1343
+ },
1344
+ {
1345
+ key: "reload",
1346
+ value: function() {
1347
+ var e = this, t = this.services, n = t.backendConnector, r = t.languageUtils, i = t.logger, a = n.language;
1348
+ if (!(a && a.toLowerCase() === "cimode")) {
1349
+ var o = [], s = function(e) {
1350
+ r.toResolveHierarchy(e).forEach(function(e) {
1351
+ o.indexOf(e) < 0 && o.push(e);
1352
+ });
1353
+ };
1354
+ s(a), this.allOptions.preload && this.allOptions.preload.forEach(function(e) {
1355
+ return s(e);
1356
+ }), o.forEach(function(t) {
1357
+ e.allOptions.ns.forEach(function(e) {
1358
+ n.read(t, e, "read", null, null, function(r, a) {
1359
+ r && i.warn(`loading namespace ${e} for language ${t} failed`, r), !r && a && i.log(`loaded namespace ${e} for language ${t}`, a), n.loaded(`${t}|${e}`, r, a);
1360
+ });
1361
+ });
1362
+ });
1363
+ }
1364
+ }
1365
+ }
1366
+ ]);
1367
+ }();
1368
+ q.type = "backend";
1369
+ //#endregion
1370
+ //#region node_modules/i18next-http-backend/esm/index.js
1371
+ var _e = [];
1372
+ _e.forEach, _e.slice;
1373
+ var ve = [
1374
+ "__proto__",
1375
+ "constructor",
1376
+ "prototype"
1377
+ ];
1378
+ function ye(e) {
1379
+ return !(typeof e != "string" || e.length === 0 || e.length > 128 || ve.indexOf(e) > -1 || e.indexOf("..") > -1 || e.indexOf("\\") > -1 || /[?#%\s@]/.test(e) || /[\x00-\x1F\x7F]/.test(e));
1380
+ }
1381
+ function be(e) {
1382
+ return !(!ye(e) || e.indexOf("/") > -1);
1383
+ }
1384
+ function xe(e) {
1385
+ return ye(e);
1386
+ }
1387
+ var Se = {
1388
+ lng: be,
1389
+ ns: xe
1390
+ };
1391
+ function J(e) {
1392
+ return typeof e == "string" ? e.replace(/[\r\n\x00-\x1F\x7F]/g, " ") : e;
1393
+ }
1394
+ function Ce(e) {
1395
+ if (typeof e != "string" || e.length === 0) return e;
1396
+ try {
1397
+ let t = new URL(e);
1398
+ return t.username || t.password ? (t.username = "", t.password = "", t.toString()) : e;
1399
+ } catch {
1400
+ return e.replace(/(\/\/)[^/@\s]+@/g, "$1");
1401
+ }
1402
+ }
1403
+ function we() {
1404
+ return typeof XMLHttpRequest == "function" || typeof XMLHttpRequest == "object";
1405
+ }
1406
+ function Te(e) {
1407
+ return !!e && typeof e.then == "function";
1408
+ }
1409
+ function Ee(e) {
1410
+ return Te(e) ? e : Promise.resolve(e);
1411
+ }
1412
+ var De = /\{\{(.+?)\}\}/g;
1413
+ function Oe(e, t) {
1414
+ let n = !1, r = e.replace(De, (e, r) => {
1415
+ let i = r.trim();
1416
+ if (ve.indexOf(i) > -1) return e;
1417
+ let a = t[i];
1418
+ if (a == null) return e;
1419
+ let o = Se[i] || be, s = String(a).split("+");
1420
+ for (let t of s) if (!o(t)) return n = !0, e;
1421
+ return s.join("+");
1422
+ });
1423
+ return n ? null : r;
1424
+ }
1425
+ var Y = typeof globalThis < "u" ? globalThis : typeof global < "u" ? global : typeof window < "u" ? window : void 0, X;
1426
+ typeof fetch == "function" ? X = fetch : Y && typeof Y.fetch == "function" && (X = Y.fetch);
1427
+ var ke = we() && Y ? Y.XMLHttpRequest : void 0, Ae = typeof ActiveXObject == "function" && Y ? Y.ActiveXObject : void 0, je = [
1428
+ "__proto__",
1429
+ "constructor",
1430
+ "prototype"
1431
+ ], Z = (e, t) => {
1432
+ if (t && typeof t == "object") {
1433
+ let n = "";
1434
+ for (let e of Object.keys(t)) je.indexOf(e) > -1 || (n += "&" + encodeURIComponent(e) + "=" + encodeURIComponent(t[e]));
1435
+ if (!n) return e;
1436
+ e = e + (e.indexOf("?") === -1 ? "?" : "&") + n.slice(1);
1437
+ }
1438
+ return e;
1439
+ }, Me = (e, t, n, r) => {
1440
+ let i = (e) => {
1441
+ if (!e.ok) return n(e.statusText || "Error", { status: e.status });
1442
+ e.text().then((t) => {
1443
+ n(null, {
1444
+ status: e.status,
1445
+ data: t
1446
+ });
1447
+ }).catch(n);
1448
+ };
1449
+ if (r) {
1450
+ let a = r(e, t);
1451
+ if (a instanceof Promise) {
1452
+ a.then(i).catch(n);
1453
+ return;
1454
+ }
1455
+ }
1456
+ typeof fetch == "function" ? fetch(e, t).then(i).catch(n) : X(e, t).then(i).catch(n);
1457
+ }, Ne = (e, t, n, r) => {
1458
+ e.queryStringParams && (t = Z(t, e.queryStringParams));
1459
+ let i = { ...typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders };
1460
+ typeof window > "u" && typeof global < "u" && global.process !== void 0 && global.process.versions && global.process.versions.node && (i["User-Agent"] = `i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`), n && (i["Content-Type"] = "application/json");
1461
+ let a = typeof e.requestOptions == "function" ? e.requestOptions(n) : e.requestOptions, o = {
1462
+ method: n ? "POST" : "GET",
1463
+ body: n ? e.stringify(n) : void 0,
1464
+ headers: i,
1465
+ ...e._omitFetchOptions ? {} : a
1466
+ }, s = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
1467
+ try {
1468
+ Me(t, o, r, s);
1469
+ } catch (n) {
1470
+ if (!a || Object.keys(a).length === 0 || !n.message || n.message.indexOf("not implemented") < 0) return r(n);
1471
+ try {
1472
+ Object.keys(a).forEach((e) => {
1473
+ delete o[e];
1474
+ }), Me(t, o, r, s), e._omitFetchOptions = !0;
1475
+ } catch (e) {
1476
+ r(e);
1477
+ }
1478
+ }
1479
+ }, Pe = (e, t, n, r) => {
1480
+ n && typeof n == "object" && (n = Z("", n).slice(1)), e.queryStringParams && (t = Z(t, e.queryStringParams));
1481
+ try {
1482
+ let i = ke ? new ke() : new Ae("MSXML2.XMLHTTP.3.0");
1483
+ i.open(n ? "POST" : "GET", t, 1), e.crossDomain || i.setRequestHeader("X-Requested-With", "XMLHttpRequest"), i.withCredentials = !!e.withCredentials, n && i.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), i.overrideMimeType && i.overrideMimeType("application/json");
1484
+ let a = e.customHeaders;
1485
+ if (a = typeof a == "function" ? a() : a, a) for (let e of Object.keys(a)) je.indexOf(e) > -1 || i.setRequestHeader(e, a[e]);
1486
+ i.onreadystatechange = () => {
1487
+ i.readyState > 3 && r(i.status >= 400 ? i.statusText : null, {
1488
+ status: i.status,
1489
+ data: i.responseText
1490
+ });
1491
+ }, i.send(n);
1492
+ } catch (e) {
1493
+ console && console.log(e);
1494
+ }
1495
+ }, Fe = (e, t, n, r) => {
1496
+ if (typeof n == "function" && (r = n, n = void 0), r ||= (() => {}), X && t.indexOf("file:") !== 0) return Ne(e, t, n, r);
1497
+ if (we() || typeof ActiveXObject == "function") return Pe(e, t, n, r);
1498
+ r(/* @__PURE__ */ Error("No fetch and no xhr implementation found!"));
1499
+ }, Ie = () => ({
1500
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
1501
+ addPath: "/locales/add/{{lng}}/{{ns}}",
1502
+ parse: (e) => JSON.parse(e),
1503
+ stringify: JSON.stringify,
1504
+ parsePayload: (e, t, n) => ({ [t]: n || "" }),
1505
+ parseLoadPayload: (e, t) => void 0,
1506
+ request: Fe,
1507
+ reloadInterval: typeof window < "u" ? !1 : 3600 * 1e3,
1508
+ customHeaders: {},
1509
+ queryStringParams: {},
1510
+ crossDomain: !1,
1511
+ withCredentials: !1,
1512
+ overrideMimeType: !1,
1513
+ requestOptions: {
1514
+ mode: "cors",
1515
+ credentials: "same-origin",
1516
+ cache: "default"
1517
+ }
1518
+ }), Le = class {
1519
+ constructor(e, t = {}, n = {}) {
1520
+ this.services = e, this.options = t, this.allOptions = n, this.type = "backend", this.init(e, t, n);
1521
+ }
1522
+ init(e, t = {}, n = {}) {
1523
+ if (this.services = e, this.options = {
1524
+ ...Ie(),
1525
+ ...this.options || {},
1526
+ ...t
1527
+ }, this.allOptions = n, this.services && this.options.reloadInterval) {
1528
+ let e = setInterval(() => this.reload(), this.options.reloadInterval);
1529
+ typeof e == "object" && typeof e.unref == "function" && e.unref();
1530
+ }
1531
+ }
1532
+ readMulti(e, t, n) {
1533
+ this._readAny(e, e, t, t, n);
1534
+ }
1535
+ read(e, t, n) {
1536
+ this._readAny([e], e, [t], t, n);
1537
+ }
1538
+ _readAny(e, t, n, r, i) {
1539
+ let a = this.options.loadPath;
1540
+ typeof this.options.loadPath == "function" && (a = this.options.loadPath(e, n)), a = Ee(a), a.then((a) => {
1541
+ if (!a) return i(null, {});
1542
+ let o = Oe(a, {
1543
+ lng: e.join("+"),
1544
+ ns: n.join("+")
1545
+ });
1546
+ if (o == null) {
1547
+ let t = e.map(J).join(", "), r = n.map(J).join(", ");
1548
+ return i(/* @__PURE__ */ Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[" + t + "] namespaces=[" + r + "]"), !1);
1549
+ }
1550
+ this.loadUrl(o, i, t, r);
1551
+ });
1552
+ }
1553
+ loadUrl(e, t, n, r) {
1554
+ let i = typeof n == "string" ? [n] : n, a = typeof r == "string" ? [r] : r, o = this.options.parseLoadPayload(i, a), s = J(Ce(e));
1555
+ this.options.request(this.options, e, o, (e, i) => {
1556
+ if (i && (i.status >= 500 && i.status < 600 || !i.status)) return t("failed loading " + s + "; status code: " + i.status, !0);
1557
+ if (i && i.status >= 400 && i.status < 500) return t("failed loading " + s + "; status code: " + i.status, !1);
1558
+ if (!i && e && e.message) {
1559
+ let n = e.message.toLowerCase();
1560
+ if ([
1561
+ "failed",
1562
+ "fetch",
1563
+ "network",
1564
+ "load"
1565
+ ].find((e) => n.indexOf(e) > -1)) return t("failed loading " + s + ": " + J(e.message), !0);
1566
+ }
1567
+ if (e) return t(e, !1);
1568
+ let a, o;
1569
+ try {
1570
+ a = typeof i.data == "string" ? this.options.parse(i.data, n, r) : i.data;
1571
+ } catch {
1572
+ o = "failed parsing " + s + " to json";
1573
+ }
1574
+ if (o) return t(o, !1);
1575
+ t(null, a);
1576
+ });
1577
+ }
1578
+ create(e, t, n, r, i) {
1579
+ if (!this.options.addPath) return;
1580
+ typeof e == "string" && (e = [e]);
1581
+ let a = this.options.parsePayload(t, n, r), o = 0, s = [], c = [];
1582
+ e.forEach((n) => {
1583
+ let r = this.options.addPath;
1584
+ typeof this.options.addPath == "function" && (r = this.options.addPath(n, t));
1585
+ let l = Oe(r, {
1586
+ lng: n,
1587
+ ns: t
1588
+ });
1589
+ if (l == null) {
1590
+ o += 1, i && o === e.length && i(s, c);
1591
+ return;
1592
+ }
1593
+ this.options.request(this.options, l, a, (t, n) => {
1594
+ o += 1, s.push(t), c.push(n), o === e.length && typeof i == "function" && i(s, c);
1595
+ });
1596
+ });
1597
+ }
1598
+ reload() {
1599
+ let { backendConnector: e, languageUtils: t, logger: n } = this.services, r = e.language;
1600
+ if (r && r.toLowerCase() === "cimode") return;
1601
+ let i = [], a = (e) => {
1602
+ t.toResolveHierarchy(e).forEach((e) => {
1603
+ i.indexOf(e) < 0 && i.push(e);
1604
+ });
1605
+ };
1606
+ a(r), this.allOptions.preload && this.allOptions.preload.forEach((e) => a(e)), i.forEach((t) => {
1607
+ this.allOptions.ns.forEach((r) => {
1608
+ e.read(t, r, "read", null, null, (i, a) => {
1609
+ i && n.warn(`loading namespace ${r} for language ${t} failed`, i), !i && a && n.log(`loaded namespace ${r} for language ${t}`, a), e.loaded(`${t}|${r}`, i, a);
1610
+ });
1611
+ });
1612
+ });
1613
+ }
1614
+ };
1615
+ Le.type = "backend";
1616
+ //#endregion
1617
+ //#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
1618
+ function Re(e, t, n) {
1619
+ return (t = H(t)) in e ? Object.defineProperty(e, t, {
1620
+ value: n,
1621
+ enumerable: !0,
1622
+ configurable: !0,
1623
+ writable: !0
1624
+ }) : e[t] = n, e;
1625
+ }
1626
+ //#endregion
1627
+ //#region node_modules/i18next-localstorage-backend/dist/esm/i18nextLocalStorageBackend.js
1628
+ function ze(e, t) {
1629
+ var n = Object.keys(e);
1630
+ if (Object.getOwnPropertySymbols) {
1631
+ var r = Object.getOwnPropertySymbols(e);
1632
+ t && (r = r.filter(function(t) {
1633
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
1634
+ })), n.push.apply(n, r);
1635
+ }
1636
+ return n;
1637
+ }
1638
+ function Q(e) {
1639
+ for (var t = 1; t < arguments.length; t++) {
1640
+ var n = arguments[t] == null ? {} : arguments[t];
1641
+ t % 2 ? ze(Object(n), !0).forEach(function(t) {
1642
+ Re(e, t, n[t]);
1643
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ze(Object(n)).forEach(function(t) {
1644
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
1645
+ });
1646
+ }
1647
+ return e;
1648
+ }
1649
+ var Be = /* @__PURE__ */ function() {
1650
+ function e(t) {
1651
+ B(this, e), this.store = t.store;
1652
+ }
1653
+ return W(e, [{
1654
+ key: "setItem",
1655
+ value: function(e, t) {
1656
+ if (this.store) try {
1657
+ this.store.setItem(e, t);
1658
+ } catch {}
1659
+ }
1660
+ }, {
1661
+ key: "getItem",
1662
+ value: function(e, t) {
1663
+ if (this.store) try {
1664
+ return this.store.getItem(e, t);
1665
+ } catch {}
1666
+ }
1667
+ }]);
1668
+ }();
1669
+ function Ve() {
1670
+ var e = null;
1671
+ try {
1672
+ e = window.localStorage;
1673
+ } catch (e) {
1674
+ typeof window < "u" && console.log("Failed to load local storage.", e);
1675
+ }
1676
+ return {
1677
+ prefix: "i18next_res_",
1678
+ expirationTime: 10080 * 60 * 1e3,
1679
+ defaultVersion: void 0,
1680
+ getVersion: void 0,
1681
+ versions: {},
1682
+ store: e
1683
+ };
1684
+ }
1685
+ var $ = /* @__PURE__ */ function() {
1686
+ function e(t) {
1687
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1688
+ B(this, e), this.init(t, n), this.type = "backend";
1689
+ }
1690
+ return W(e, [
1691
+ {
1692
+ key: "init",
1693
+ value: function(e) {
1694
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1695
+ this.services = e, this.options = Q(Q(Q({}, Ve()), this.options), t), this.storage = new Be(this.options);
1696
+ }
1697
+ },
1698
+ {
1699
+ key: "read",
1700
+ value: function(e, t, n) {
1701
+ var r = Date.now();
1702
+ if (!this.storage.store) return n(null, null);
1703
+ var i = this.storage.getItem(`${this.options.prefix}${e}-${t}`);
1704
+ if (i) {
1705
+ i = JSON.parse(i);
1706
+ var a = this.getVersion(e, t);
1707
+ if (i.i18nStamp && i.i18nStamp + this.options.expirationTime > r && a === i.i18nVersion) {
1708
+ var o = i.i18nStamp;
1709
+ return delete i.i18nVersion, delete i.i18nStamp, n(null, i, o);
1710
+ }
1711
+ }
1712
+ return n(null, null);
1713
+ }
1714
+ },
1715
+ {
1716
+ key: "save",
1717
+ value: function(e, t, n) {
1718
+ if (this.storage.store) {
1719
+ n.i18nStamp = Date.now();
1720
+ var r = this.getVersion(e, t);
1721
+ r && (n.i18nVersion = r), this.storage.setItem(`${this.options.prefix}${e}-${t}`, JSON.stringify(n));
1722
+ }
1723
+ }
1724
+ },
1725
+ {
1726
+ key: "getVersion",
1727
+ value: function(e, t) {
1728
+ var n;
1729
+ return (n = this.options).getVersion?.call(n, e, t) || this.options.versions[e] || this.options.defaultVersion;
1730
+ }
1731
+ }
1732
+ ]);
1733
+ }();
1734
+ $.type = "backend";
1735
+ //#endregion
1736
+ //#region node_modules/i18next-resources-to-backend/dist/esm/index.js
1737
+ var He = function(e) {
1738
+ return {
1739
+ type: "backend",
1740
+ init: function(e, t, n) {},
1741
+ read: function(t, n, r) {
1742
+ if (typeof e == "function") {
1743
+ if (e.length < 3) {
1744
+ try {
1745
+ var i = e(t, n);
1746
+ i && typeof i.then == "function" ? i.then(function(e) {
1747
+ return r(null, e && e.default || e);
1748
+ }).catch(r) : r(null, i);
1749
+ } catch (e) {
1750
+ r(e);
1751
+ }
1752
+ return;
1753
+ }
1754
+ e(t, n, r);
1755
+ return;
1756
+ }
1757
+ r(null, e && e[t] && e[t][n]);
1758
+ }
1759
+ };
1760
+ }, Ue = ({ initReactI18next: t, lang: n, fallbackLang: r, langCacheExpiredTimeMs: i, resources: a, version: o, useBackend: s, withLocalstorageBackend: c = !1, cdnUrl: l = "", debug: u = !1 }) => {
1761
+ let d = [], f = [], p = Object.keys(a);
1762
+ if (s && c) {
1763
+ let e = {};
1764
+ p.forEach((t) => Object.assign(e, { [t]: o })), d.push($), f.push({
1765
+ prefix: "i18next_res_",
1766
+ expirationTime: i,
1767
+ versions: e
1768
+ });
1769
+ }
1770
+ s && l && (d.push(Le), f.push({
1771
+ loadPath: `${l}/locales/{{lng}}.json`,
1772
+ queryStringParams: { v: `${o}.${e(i)}` },
1773
+ reloadInterval: i
1774
+ })), s && d.push(He(a));
1775
+ let m = {
1776
+ type: "languageDetector",
1777
+ name: "customDetector",
1778
+ async: !1,
1779
+ init: () => {},
1780
+ detect: (e) => n
1781
+ }, h = {
1782
+ debug: u,
1783
+ compatibilityJSON: "v4",
1784
+ ns: ["translation"],
1785
+ defaultNS: "translation",
1786
+ lng: n,
1787
+ fallbackLng: r,
1788
+ load: "currentOnly",
1789
+ keySeparator: !1,
1790
+ nonExplicitSupportedLngs: !0,
1791
+ interpolation: { escapeValue: !1 }
1792
+ };
1793
+ if (h = s ? {
1794
+ ...h,
1795
+ backend: {
1796
+ backends: d,
1797
+ backendOptions: f,
1798
+ cacheHitMode: "refreshAndUpdateStore",
1799
+ reloadInterval: i,
1800
+ refreshExpirationTime: i
1801
+ },
1802
+ react: { bindI18nStore: "added" }
1803
+ } : {
1804
+ ...h,
1805
+ resources: a
1806
+ }, !z.isInitialized) {
1807
+ let e = z;
1808
+ s && (e = e.use(q)), e.use(m).use(t).init(h, (e, t) => {
1809
+ if (e) {
1810
+ console.error("Error when i18n init", e);
1811
+ return;
1812
+ }
1813
+ });
1814
+ }
1815
+ };
1816
+ //#endregion
1817
+ export { Ue as t };
1818
+
1819
+ //# sourceMappingURL=i18n-CJthsaWo.js.map