@feedmepos/mf-connect 0.1.71-prod → 0.1.72-prod

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 (93) hide show
  1. package/dist/{Analytic-DIzZEv_G.js → Analytic-CxQKbOnR.js} +163 -163
  2. package/dist/{App-DrnbBc_l.js → App-C0HCgYW2.js} +7 -7
  3. package/dist/{Bin-Bt_ru3Gd.js → Bin-BFx6j8vs.js} +8 -8
  4. package/dist/{Broadcast-Bn5ZjKqo.js → Broadcast-CUfwWq6_.js} +8 -8
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BojGwK_6.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-2oosZTlv.js} +6 -6
  6. package/dist/{Card-sBhDvBXT.js → Card-DsMVa01V.js} +16 -16
  7. package/dist/{Collections-Duct2pSH.js → Collections-DSbNXU78.js} +7 -7
  8. package/dist/{Credit-D3mJTvRc.js → Credit-Dp-tSMfE.js} +8 -8
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-_60iFOeG.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BW7V_Nsq.js} +817 -794
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D7QHcodO.js +348 -0
  11. package/dist/{Experience-CIGwlErx.js → Experience-DkQbI88m.js} +8 -8
  12. package/dist/{Game-Canf-7L-.js → Game-BJvtVGC7.js} +9 -9
  13. package/dist/{Index-25eVdVm7.js → Index-BcHe2Qqe.js} +10 -10
  14. package/dist/{Marketing-krqaA6fv.js → Marketing-BaYjdZpb.js} +6 -6
  15. package/dist/{Member-Bt0NaXiS.js → Member-BzrcLN4X.js} +10 -10
  16. package/dist/{MemberList-CXk-T9r2.js → MemberList-_uD6WR--.js} +25 -25
  17. package/dist/{MemberTransactions-Dg-A6a0v.js → MemberTransactions-DIG5noli.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DtpDrupj.js → MessageInput.vue_vue_type_script_setup_true_lang-Cm4jVJBM.js} +7 -7
  19. package/dist/{Mission-CsxpvhsB.js → Mission-B0h7ECrd.js} +9 -9
  20. package/dist/{Overview-BUlq3MuQ.js → Overview-BfjTYcaf.js} +18 -18
  21. package/dist/{Point-DvPTk5wL.js → Point-yBqZgf08.js} +8 -8
  22. package/dist/{Promotion-BWygpn4X.js → Promotion-Bh8yiwPe.js} +9 -9
  23. package/dist/{Queue-iD4D04Z-.js → Queue-CMMyxmWP.js} +10 -10
  24. package/dist/{Record-CritfdkX.js → Record-DSLpbGVk.js} +8 -8
  25. package/dist/{Reward-DuZ73-kd.js → Reward-BzAIdcgx.js} +15 -15
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B1073xkE.js → RewardGroup.vue_vue_type_script_setup_true_lang-DoGsPRbi.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-1CJRrkoS.js → RuleGroup.vue_vue_type_script_setup_true_lang-B7qMLC2M.js} +595 -591
  28. package/dist/{Segment-C8rNVlEi.js → Segment-BVH3YC8I.js} +22 -22
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BmWRTRMe.js → SelectItems.vue_vue_type_script_setup_true_lang-BkHWRVba.js} +2 -2
  30. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BaP2tykA.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D-4QjkWh.js} +11 -11
  31. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CqICTY8X.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CzCSXHge.js} +3 -3
  32. package/dist/{Setting-BwLCOkXJ.js → Setting-CFLtqHFJ.js} +12 -12
  33. package/dist/{SettingAdvertisements-Bjw1RSKB.js → SettingAdvertisements-CvFG5Fun.js} +11 -11
  34. package/dist/{Store-DEtsM22Y.js → Store-CHcszdPx.js} +19 -19
  35. package/dist/{StoreRewards-DVzCi6nY.js → StoreRewards-BXrXO3Cg.js} +13 -13
  36. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DKWElE0N.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Clou5scZ.js} +19 -19
  37. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CS_3d3zl.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BEpXudTV.js} +1 -1
  38. package/dist/{Tier-qUFmMLZe.js → Tier-98o6YCz1.js} +19 -19
  39. package/dist/{Title-Qk0xODw6.js → Title-BmvCMh9F.js} +18 -18
  40. package/dist/{Transaction-Be-VAdL0.js → Transaction-D07dnpCB.js} +2 -2
  41. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Lcgh9b36.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DHvItthe.js} +6 -6
  42. package/dist/{Voucher-DjiXcyL2.js → Voucher-BX5Dy6oL.js} +12 -12
  43. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BlXCP_IR.js +421 -0
  44. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B0KU6cW2.js → ZodTextField.vue_vue_type_script_setup_true_lang-TkZAyKkk.js} +1 -1
  45. package/dist/{app-BYt1acSS.js → app-7Ivt_7kS.js} +1974 -914
  46. package/dist/{app-CVDxFFOq.js → app-C98aAmiY.js} +1 -1
  47. package/dist/app.js +1 -1
  48. package/dist/{business-COPU_15m.js → business-B55rTB5S.js} +1 -1
  49. package/dist/{campaign-CANP8DZ7.js → campaign-RS-eYMBW.js} +1 -1
  50. package/dist/campaign-dSphYCws.js +226 -0
  51. package/dist/{campaign.enum-YFcT9qdL.js → campaign.enum-BZRXf9TI.js} +1 -1
  52. package/dist/{campaign.fn-CF0vxr00.js → campaign.fn-D_b763b6.js} +82 -82
  53. package/dist/{collectible.enum-CKyUdzxK.js → collectible.enum-ANnJMtnj.js} +1 -1
  54. package/dist/{collection.fn-CLGxII_6.js → collection.fn-BObHG1bS.js} +2 -2
  55. package/dist/{dto-D2FwEDQQ.js → dto-BA2PX6Mi.js} +4 -4
  56. package/dist/{effect-C_AEVoTp.js → effect-DDAGMMzr.js} +1 -1
  57. package/dist/{email-addresses-BWnpaUzY.js → email-addresses-jx17hvtN.js} +1 -1
  58. package/dist/{export-7MCVnb85.js → export-DI_2PZhY.js} +3 -3
  59. package/dist/{helper-BwCpzGpj.js → helper-ApDLcgT1.js} +1 -1
  60. package/dist/{index-doXz2Xnd.js → index-B5J1HBw3.js} +1 -1
  61. package/dist/{index-B776PH8X.js → index-BCOxYH7r.js} +1 -1
  62. package/dist/{index-CY9fLTpI.js → index-BbNMr2Lt.js} +3 -3
  63. package/dist/{index-BWctDnVc.js → index-C1tcqVNm.js} +3 -3
  64. package/dist/{index-B7v1Tn5m.js → index-CEeIezsZ.js} +1 -1
  65. package/dist/{index-D_Yyiihg.js → index-CN0ree8J.js} +1 -1
  66. package/dist/{index-DhJ4RwuN.js → index-Cl85lvDM.js} +1 -1
  67. package/dist/{index-BRPLDaar.js → index-CtpRdZKH.js} +2 -2
  68. package/dist/{index-BCcnESMx.js → index-DUfWM7U3.js} +1023 -1023
  69. package/dist/{index-CvWUVGAn.js → index-D_9bRGRa.js} +1 -1
  70. package/dist/{index-BdTNXQvR.js → index-Dg6gbVXO.js} +1 -1
  71. package/dist/{index-vEDs6OGV.js → index-Dpe36Jv6.js} +4 -4
  72. package/dist/{index-DMD1qL3R.js → index-DtB1XLw6.js} +183 -178
  73. package/dist/{index.esm2017-BwgUTaPG.js → index.esm2017-CcAT1nnu.js} +1 -1
  74. package/dist/{loading-CpAYlxoG.js → loading-Hh5FSOP9.js} +1 -1
  75. package/dist/{membership-CgJ7PFUR.js → membership-DXQf9Mj3.js} +3 -3
  76. package/dist/{money-CQGmkTRp.js → money-OBHKTSCa.js} +1 -1
  77. package/dist/{number-B_oM4a_k.js → number-DTqujv4j.js} +1 -1
  78. package/dist/{objectid-Dwu4f87A.js → objectid-BkZDKSpn.js} +1 -1
  79. package/dist/{campaign-DRXh3QJ1.js → plugins-CQqQawn6.js} +784 -776
  80. package/dist/{reward-CAhovk_1.js → reward-n9uPwsH1.js} +1 -1
  81. package/dist/{rule-b2BC4jY8.js → rule-BgsibUNE.js} +3 -3
  82. package/dist/{rule-builder-w8uO1XAF.js → rule-builder-BkzqGukH.js} +1 -1
  83. package/dist/template-gXT-yGOY.js +188 -0
  84. package/dist/{timezone-Di5x-2AC.js → timezone-X-iXAUqa.js} +1 -1
  85. package/dist/{trigger-B9EDmE6z.js → trigger-DEZuV7Fw.js} +4 -4
  86. package/dist/{user-BCB96Qct.js → user-DG_FfcGk.js} +1 -1
  87. package/dist/{vue-i18n-DddYl0c6.js → vue-i18n-BB1YkgAs.js} +317 -317
  88. package/dist/{xlsx-Dj8VVXnA.js → xlsx-CJQa9ako.js} +166 -166
  89. package/package.json +1 -1
  90. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Sk5ub0FZ.js +0 -348
  91. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DHySLFcf.js +0 -419
  92. package/dist/plugins-Bo72kWn7.js +0 -208
  93. package/dist/template-DDBscrPK.js +0 -190
@@ -1,73 +1,91 @@
1
- import { h as F } from "./moment-D7p2TMB-.js";
2
- import "./index-vEDs6OGV.js";
3
- import { e as G } from "./effect-C_AEVoTp.js";
4
- import { components as ie } from "@feedmepos/ui-library";
5
- import { i as Ne } from "./rule-builder-w8uO1XAF.js";
6
- import { c as Ee } from "./rule-b2BC4jY8.js";
7
- import { u as Ve } from "./business-COPU_15m.js";
8
- import { C as j } from "./campaign.fn-CF0vxr00.js";
9
- import { c as ce } from "./plugins-Bo72kWn7.js";
10
- import { e as je, Z as S, a as fe, i as Re, z as Fe } from "./app-BYt1acSS.js";
11
- import { detectLocale as Ie, createFeedMeI18n as De } from "@feedmepos/mf-common";
12
- import { h as B } from "vue";
13
- import { F as R } from "./campaign.enum-YFcT9qdL.js";
14
- const d = (a) => typeof a == "string", _ = () => {
15
- let a, e;
1
+ import { u as fe, v as ge, x as Ee, w as Ie, y as Fe } from "./index.esm2017-CcAT1nnu.js";
2
+ import { u as oe } from "./app-wDQR6dpb.js";
3
+ import { e as Ae, Z as O, a as de, i as ke, z as De } from "./app-7Ivt_7kS.js";
4
+ import { detectLocale as Te, createFeedMeI18n as Ke } from "@feedmepos/mf-common";
5
+ import { S as k } from "./index-C1tcqVNm.js";
6
+ function xt(r, e) {
7
+ let t = "", s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
8
+ const i = s.length;
9
+ for (let n = 0; n < r; n++)
10
+ t += s.charAt(Math.floor(Math.random() * i));
11
+ return t;
12
+ }
13
+ const yt = {
14
+ alphabetOnly(r) {
15
+ return r.replace(/[^a-zA-Z]/g, "");
16
+ },
17
+ alphaNumeric(r) {
18
+ return r.replace(/[^a-zA-Z0-9]/g, "");
19
+ },
20
+ numericOnly(r) {
21
+ return r.replace(/[^0-9]/g, "");
22
+ },
23
+ singularOrPlural(r, e, t) {
24
+ const s = r > 1 ? t || `${e}s` : e;
25
+ return `${r} ${s}`;
26
+ }
27
+ }, bt = {
28
+ title: (r) => r.replace(
29
+ /\b\w+/g,
30
+ (e) => e.charAt(0).toUpperCase() + e.substring(1).toLowerCase()
31
+ )
32
+ }, d = (r) => typeof r == "string", H = () => {
33
+ let r, e;
16
34
  const t = new Promise((s, i) => {
17
- a = s, e = i;
35
+ r = s, e = i;
18
36
  });
19
- return t.resolve = a, t.reject = e, t;
20
- }, he = (a) => a == null ? "" : "" + a, Te = (a, e, t) => {
21
- a.forEach((s) => {
37
+ return t.resolve = r, t.reject = e, t;
38
+ }, pe = (r) => r == null ? "" : "" + r, Me = (r, e, t) => {
39
+ r.forEach((s) => {
22
40
  e[s] && (t[s] = e[s]);
23
41
  });
24
- }, Ae = /###/g, ge = (a) => a && a.indexOf("###") > -1 ? a.replace(Ae, ".") : a, de = (a) => !a || d(a), z = (a, e, t) => {
42
+ }, Ue = /###/g, me = (r) => r && r.indexOf("###") > -1 ? r.replace(Ue, ".") : r, ve = (r) => !r || d(r), z = (r, e, t) => {
25
43
  const s = d(e) ? e.split(".") : e;
26
44
  let i = 0;
27
45
  for (; i < s.length - 1; ) {
28
- if (de(a)) return {};
29
- const r = ge(s[i]);
30
- !a[r] && t && (a[r] = new t()), Object.prototype.hasOwnProperty.call(a, r) ? a = a[r] : a = {}, ++i;
46
+ if (ve(r)) return {};
47
+ const n = me(s[i]);
48
+ !r[n] && t && (r[n] = new t()), Object.prototype.hasOwnProperty.call(r, n) ? r = r[n] : r = {}, ++i;
31
49
  }
32
- return de(a) ? {} : {
33
- obj: a,
34
- k: ge(s[i])
50
+ return ve(r) ? {} : {
51
+ obj: r,
52
+ k: me(s[i])
35
53
  };
36
- }, pe = (a, e, t) => {
54
+ }, xe = (r, e, t) => {
37
55
  const {
38
56
  obj: s,
39
57
  k: i
40
- } = z(a, e, Object);
58
+ } = z(r, e, Object);
41
59
  if (s !== void 0 || e.length === 1) {
42
60
  s[i] = t;
43
61
  return;
44
62
  }
45
- let r = e[e.length - 1], n = e.slice(0, e.length - 1), o = z(a, n, Object);
46
- for (; o.obj === void 0 && n.length; )
47
- r = `${n[n.length - 1]}.${r}`, n = n.slice(0, n.length - 1), o = z(a, n, Object), o != null && o.obj && typeof o.obj[`${o.k}.${r}`] < "u" && (o.obj = void 0);
48
- o.obj[`${o.k}.${r}`] = t;
49
- }, Me = (a, e, t, s) => {
63
+ let n = e[e.length - 1], a = e.slice(0, e.length - 1), o = z(r, a, Object);
64
+ for (; o.obj === void 0 && a.length; )
65
+ n = `${a[a.length - 1]}.${n}`, a = a.slice(0, a.length - 1), o = z(r, a, Object), o != null && o.obj && typeof o.obj[`${o.k}.${n}`] < "u" && (o.obj = void 0);
66
+ o.obj[`${o.k}.${n}`] = t;
67
+ }, He = (r, e, t, s) => {
50
68
  const {
51
69
  obj: i,
52
- k: r
53
- } = z(a, e, Object);
54
- i[r] = i[r] || [], i[r].push(t);
55
- }, Z = (a, e) => {
70
+ k: n
71
+ } = z(r, e, Object);
72
+ i[n] = i[n] || [], i[n].push(t);
73
+ }, Y = (r, e) => {
56
74
  const {
57
75
  obj: t,
58
76
  k: s
59
- } = z(a, e);
77
+ } = z(r, e);
60
78
  if (t && Object.prototype.hasOwnProperty.call(t, s))
61
79
  return t[s];
62
- }, Ke = (a, e, t) => {
63
- const s = Z(a, t);
64
- return s !== void 0 ? s : Z(e, t);
65
- }, $e = (a, e, t) => {
80
+ }, ze = (r, e, t) => {
81
+ const s = Y(r, t);
82
+ return s !== void 0 ? s : Y(e, t);
83
+ }, Ne = (r, e, t) => {
66
84
  for (const s in e)
67
- s !== "__proto__" && s !== "constructor" && (s in a ? d(a[s]) || a[s] instanceof String || d(e[s]) || e[s] instanceof String ? t && (a[s] = e[s]) : $e(a[s], e[s], t) : a[s] = e[s]);
68
- return a;
69
- }, T = (a) => a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
70
- var Ue = {
85
+ s !== "__proto__" && s !== "constructor" && (s in r ? d(r[s]) || r[s] instanceof String || d(e[s]) || e[s] instanceof String ? t && (r[s] = e[s]) : Ne(r[s], e[s], t) : r[s] = e[s]);
86
+ return r;
87
+ }, F = (r) => r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
88
+ var Be = {
71
89
  "&": "&amp;",
72
90
  "<": "&lt;",
73
91
  ">": "&gt;",
@@ -75,8 +93,8 @@ var Ue = {
75
93
  "'": "&#39;",
76
94
  "/": "&#x2F;"
77
95
  };
78
- const He = (a) => d(a) ? a.replace(/[&<>"'\/]/g, (e) => Ue[e]) : a;
79
- class _e {
96
+ const Je = (r) => d(r) ? r.replace(/[&<>"'\/]/g, (e) => Be[e]) : r;
97
+ class We {
80
98
  constructor(e) {
81
99
  this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
82
100
  }
@@ -88,62 +106,62 @@ class _e {
88
106
  return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, s), this.regExpQueue.push(e), s;
89
107
  }
90
108
  }
91
- const Be = [" ", ",", "?", "!", ";"], ze = new _e(20), Je = (a, e, t) => {
109
+ const _e = [" ", ",", "?", "!", ";"], Ze = new We(20), Ye = (r, e, t) => {
92
110
  e = e || "", t = t || "";
93
- const s = Be.filter((n) => e.indexOf(n) < 0 && t.indexOf(n) < 0);
111
+ const s = _e.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
94
112
  if (s.length === 0) return !0;
95
- const i = ze.getRegExp(`(${s.map((n) => n === "?" ? "\\?" : n).join("|")})`);
96
- let r = !i.test(a);
97
- if (!r) {
98
- const n = a.indexOf(t);
99
- n > 0 && !i.test(a.substring(0, n)) && (r = !0);
100
- }
101
- return r;
102
- }, re = function(a, e) {
113
+ const i = Ze.getRegExp(`(${s.map((a) => a === "?" ? "\\?" : a).join("|")})`);
114
+ let n = !i.test(r);
115
+ if (!n) {
116
+ const a = r.indexOf(t);
117
+ a > 0 && !i.test(r.substring(0, a)) && (n = !0);
118
+ }
119
+ return n;
120
+ }, ae = function(r, e) {
103
121
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
104
- if (!a) return;
105
- if (a[e])
106
- return Object.prototype.hasOwnProperty.call(a, e) ? a[e] : void 0;
122
+ if (!r) return;
123
+ if (r[e])
124
+ return Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
107
125
  const s = e.split(t);
108
- let i = a;
109
- for (let r = 0; r < s.length; ) {
126
+ let i = r;
127
+ for (let n = 0; n < s.length; ) {
110
128
  if (!i || typeof i != "object")
111
129
  return;
112
- let n, o = "";
113
- for (let l = r; l < s.length; ++l)
114
- if (l !== r && (o += t), o += s[l], n = i[o], n !== void 0) {
115
- if (["string", "number", "boolean"].indexOf(typeof n) > -1 && l < s.length - 1)
130
+ let a, o = "";
131
+ for (let l = n; l < s.length; ++l)
132
+ if (l !== n && (o += t), o += s[l], a = i[o], a !== void 0) {
133
+ if (["string", "number", "boolean"].indexOf(typeof a) > -1 && l < s.length - 1)
116
134
  continue;
117
- r += l - r + 1;
135
+ n += l - n + 1;
118
136
  break;
119
137
  }
120
- i = n;
138
+ i = a;
121
139
  }
122
140
  return i;
123
- }, Q = (a) => a == null ? void 0 : a.replace("_", "-"), Ye = {
141
+ }, Q = (r) => r == null ? void 0 : r.replace("_", "-"), Qe = {
124
142
  type: "logger",
125
- log(a) {
126
- this.output("log", a);
143
+ log(r) {
144
+ this.output("log", r);
127
145
  },
128
- warn(a) {
129
- this.output("warn", a);
146
+ warn(r) {
147
+ this.output("warn", r);
130
148
  },
131
- error(a) {
132
- this.output("error", a);
149
+ error(r) {
150
+ this.output("error", r);
133
151
  },
134
- output(a, e) {
152
+ output(r, e) {
135
153
  var t, s;
136
- (s = (t = console == null ? void 0 : console[a]) == null ? void 0 : t.apply) == null || s.call(t, console, e);
154
+ (s = (t = console == null ? void 0 : console[r]) == null ? void 0 : t.apply) == null || s.call(t, console, e);
137
155
  }
138
156
  };
139
- class X {
157
+ class G {
140
158
  constructor(e) {
141
159
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
142
160
  this.init(e, t);
143
161
  }
144
162
  init(e) {
145
163
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
146
- this.prefix = t.prefix || "i18next:", this.logger = e || Ye, this.options = t, this.debug = t.debug;
164
+ this.prefix = t.prefix || "i18next:", this.logger = e || Qe, this.options = t, this.debug = t.debug;
147
165
  }
148
166
  log() {
149
167
  for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
@@ -169,17 +187,17 @@ class X {
169
187
  return i && !this.debug ? null : (d(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
170
188
  }
171
189
  create(e) {
172
- return new X(this.logger, {
190
+ return new G(this.logger, {
173
191
  prefix: `${this.prefix}:${e}:`,
174
192
  ...this.options
175
193
  });
176
194
  }
177
195
  clone(e) {
178
- return e = e || this.options, e.prefix = e.prefix || this.prefix, new X(this.logger, e);
196
+ return e = e || this.options, e.prefix = e.prefix || this.prefix, new G(this.logger, e);
179
197
  }
180
198
  }
181
- var P = new X();
182
- class ee {
199
+ var P = new G();
200
+ class X {
183
201
  constructor() {
184
202
  this.observers = {};
185
203
  }
@@ -202,18 +220,18 @@ class ee {
202
220
  emit(e) {
203
221
  for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
204
222
  s[i - 1] = arguments[i];
205
- this.observers[e] && Array.from(this.observers[e].entries()).forEach((n) => {
206
- let [o, l] = n;
223
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach((a) => {
224
+ let [o, l] = a;
207
225
  for (let u = 0; u < l; u++)
208
226
  o(...s);
209
- }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((n) => {
210
- let [o, l] = n;
227
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((a) => {
228
+ let [o, l] = a;
211
229
  for (let u = 0; u < l; u++)
212
230
  o.apply(o, [e, ...s]);
213
231
  });
214
232
  }
215
233
  }
216
- class me extends ee {
234
+ class ye extends X {
217
235
  constructor(e) {
218
236
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
219
237
  ns: ["translation"],
@@ -229,43 +247,43 @@ class me extends ee {
229
247
  t > -1 && this.options.ns.splice(t, 1);
230
248
  }
231
249
  getResource(e, t, s) {
232
- var u, f;
250
+ var u, h;
233
251
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
234
- const r = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, n = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
252
+ const n = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, a = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
235
253
  let o;
236
- e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], s && (Array.isArray(s) ? o.push(...s) : d(s) && r ? o.push(...s.split(r)) : o.push(s)));
237
- const l = Z(this.data, o);
238
- return !l && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), l || !n || !d(s) ? l : re((f = (u = this.data) == null ? void 0 : u[e]) == null ? void 0 : f[t], s, r);
254
+ e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], s && (Array.isArray(s) ? o.push(...s) : d(s) && n ? o.push(...s.split(n)) : o.push(s)));
255
+ const l = Y(this.data, o);
256
+ return !l && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), l || !a || !d(s) ? l : ae((h = (u = this.data) == null ? void 0 : u[e]) == null ? void 0 : h[t], s, n);
239
257
  }
240
258
  addResource(e, t, s, i) {
241
- let r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
259
+ let n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
242
260
  silent: !1
243
261
  };
244
- const n = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
262
+ const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
245
263
  let o = [e, t];
246
- s && (o = o.concat(n ? s.split(n) : s)), e.indexOf(".") > -1 && (o = e.split("."), i = t, t = o[1]), this.addNamespaces(t), pe(this.data, o, i), r.silent || this.emit("added", e, t, s, i);
264
+ s && (o = o.concat(a ? s.split(a) : s)), e.indexOf(".") > -1 && (o = e.split("."), i = t, t = o[1]), this.addNamespaces(t), xe(this.data, o, i), n.silent || this.emit("added", e, t, s, i);
247
265
  }
248
266
  addResources(e, t, s) {
249
267
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
250
268
  silent: !1
251
269
  };
252
- for (const r in s)
253
- (d(s[r]) || Array.isArray(s[r])) && this.addResource(e, t, r, s[r], {
270
+ for (const n in s)
271
+ (d(s[n]) || Array.isArray(s[n])) && this.addResource(e, t, n, s[n], {
254
272
  silent: !0
255
273
  });
256
274
  i.silent || this.emit("added", e, t, s);
257
275
  }
258
- addResourceBundle(e, t, s, i, r) {
259
- let n = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
276
+ addResourceBundle(e, t, s, i, n) {
277
+ let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
260
278
  silent: !1,
261
279
  skipCopy: !1
262
280
  }, o = [e, t];
263
281
  e.indexOf(".") > -1 && (o = e.split("."), i = s, s = t, t = o[1]), this.addNamespaces(t);
264
- let l = Z(this.data, o) || {};
265
- n.skipCopy || (s = JSON.parse(JSON.stringify(s))), i ? $e(l, s, r) : l = {
282
+ let l = Y(this.data, o) || {};
283
+ a.skipCopy || (s = JSON.parse(JSON.stringify(s))), i ? Ne(l, s, n) : l = {
266
284
  ...l,
267
285
  ...s
268
- }, pe(this.data, o, l), n.silent || this.emit("added", e, t, s);
286
+ }, xe(this.data, o, l), a.silent || this.emit("added", e, t, s);
269
287
  }
270
288
  removeResourceBundle(e, t) {
271
289
  this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
@@ -287,23 +305,23 @@ class me extends ee {
287
305
  return this.data;
288
306
  }
289
307
  }
290
- var Pe = {
308
+ var Ve = {
291
309
  processors: {},
292
- addPostProcessor(a) {
293
- this.processors[a.name] = a;
310
+ addPostProcessor(r) {
311
+ this.processors[r.name] = r;
294
312
  },
295
- handle(a, e, t, s, i) {
296
- return a.forEach((r) => {
297
- var n;
298
- e = ((n = this.processors[r]) == null ? void 0 : n.process(e, t, s, i)) ?? e;
313
+ handle(r, e, t, s, i) {
314
+ return r.forEach((n) => {
315
+ var a;
316
+ e = ((a = this.processors[n]) == null ? void 0 : a.process(e, t, s, i)) ?? e;
299
317
  }), e;
300
318
  }
301
319
  };
302
- const ve = {};
303
- class q extends ee {
320
+ const be = {};
321
+ class q extends X {
304
322
  constructor(e) {
305
323
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
306
- super(), Te(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
324
+ super(), Me(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
307
325
  }
308
326
  changeLanguage(e) {
309
327
  e && (this.language = e);
@@ -321,21 +339,21 @@ class q extends ee {
321
339
  let s = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
322
340
  s === void 0 && (s = ":");
323
341
  const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
324
- let r = t.ns || this.options.defaultNS || [];
325
- const n = s && e.indexOf(s) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Je(e, s, i);
326
- if (n && !o) {
342
+ let n = t.ns || this.options.defaultNS || [];
343
+ const a = s && e.indexOf(s) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ye(e, s, i);
344
+ if (a && !o) {
327
345
  const l = e.match(this.interpolator.nestingRegexp);
328
346
  if (l && l.length > 0)
329
347
  return {
330
348
  key: e,
331
- namespaces: d(r) ? [r] : r
349
+ namespaces: d(n) ? [n] : n
332
350
  };
333
351
  const u = e.split(s);
334
- (s !== i || s === i && this.options.ns.indexOf(u[0]) > -1) && (r = u.shift()), e = u.join(i);
352
+ (s !== i || s === i && this.options.ns.indexOf(u[0]) > -1) && (n = u.shift()), e = u.join(i);
335
353
  }
336
354
  return {
337
355
  key: e,
338
- namespaces: d(r) ? [r] : r
356
+ namespaces: d(n) ? [n] : n
339
357
  };
340
358
  }
341
359
  translate(e, t, s) {
@@ -343,98 +361,98 @@ class q extends ee {
343
361
  ...t
344
362
  }), t || (t = {}), e == null) return "";
345
363
  Array.isArray(e) || (e = [String(e)]);
346
- const i = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, r = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
347
- key: n,
364
+ const i = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, n = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
365
+ key: a,
348
366
  namespaces: o
349
- } = this.extractFromKey(e[e.length - 1], t), l = o[o.length - 1], u = t.lng || this.language, f = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
367
+ } = this.extractFromKey(e[e.length - 1], t), l = o[o.length - 1], u = t.lng || this.language, h = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
350
368
  if ((u == null ? void 0 : u.toLowerCase()) === "cimode") {
351
- if (f) {
352
- const y = t.nsSeparator || this.options.nsSeparator;
369
+ if (h) {
370
+ const x = t.nsSeparator || this.options.nsSeparator;
353
371
  return i ? {
354
- res: `${l}${y}${n}`,
355
- usedKey: n,
356
- exactUsedKey: n,
372
+ res: `${l}${x}${a}`,
373
+ usedKey: a,
374
+ exactUsedKey: a,
357
375
  usedLng: u,
358
376
  usedNS: l,
359
377
  usedParams: this.getUsedParamsDetails(t)
360
- } : `${l}${y}${n}`;
378
+ } : `${l}${x}${a}`;
361
379
  }
362
380
  return i ? {
363
- res: n,
364
- usedKey: n,
365
- exactUsedKey: n,
381
+ res: a,
382
+ usedKey: a,
383
+ exactUsedKey: a,
366
384
  usedLng: u,
367
385
  usedNS: l,
368
386
  usedParams: this.getUsedParamsDetails(t)
369
- } : n;
387
+ } : a;
370
388
  }
371
- const h = this.resolve(e, t);
372
- let c = h == null ? void 0 : h.res;
373
- const m = (h == null ? void 0 : h.usedKey) || n, g = (h == null ? void 0 : h.exactUsedKey) || n, p = Object.prototype.toString.apply(c), v = ["[object Number]", "[object Function]", "[object RegExp]"], L = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, w = !this.i18nFormat || this.i18nFormat.handleAsObject, I = !d(c) && typeof c != "boolean" && typeof c != "number";
374
- if (w && c && I && v.indexOf(p) < 0 && !(d(L) && Array.isArray(c))) {
389
+ const f = this.resolve(e, t);
390
+ let c = f == null ? void 0 : f.res;
391
+ const p = (f == null ? void 0 : f.usedKey) || a, g = (f == null ? void 0 : f.exactUsedKey) || a, m = Object.prototype.toString.apply(c), v = ["[object Number]", "[object Function]", "[object RegExp]"], w = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, C = !this.i18nFormat || this.i18nFormat.handleAsObject, E = !d(c) && typeof c != "boolean" && typeof c != "number";
392
+ if (C && c && E && v.indexOf(m) < 0 && !(d(w) && Array.isArray(c))) {
375
393
  if (!t.returnObjects && !this.options.returnObjects) {
376
394
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
377
- const y = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m, c, {
395
+ const x = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, c, {
378
396
  ...t,
379
397
  ns: o
380
- }) : `key '${n} (${this.language})' returned an object instead of string.`;
381
- return i ? (h.res = y, h.usedParams = this.getUsedParamsDetails(t), h) : y;
398
+ }) : `key '${a} (${this.language})' returned an object instead of string.`;
399
+ return i ? (f.res = x, f.usedParams = this.getUsedParamsDetails(t), f) : x;
382
400
  }
383
- if (r) {
384
- const y = Array.isArray(c), O = y ? [] : {}, k = y ? g : m;
385
- for (const x in c)
386
- if (Object.prototype.hasOwnProperty.call(c, x)) {
387
- const N = `${k}${r}${x}`;
388
- O[x] = this.translate(N, {
401
+ if (n) {
402
+ const x = Array.isArray(c), L = x ? [] : {}, R = x ? g : p;
403
+ for (const y in c)
404
+ if (Object.prototype.hasOwnProperty.call(c, y)) {
405
+ const N = `${R}${n}${y}`;
406
+ L[y] = this.translate(N, {
389
407
  ...t,
390
408
  joinArrays: !1,
391
409
  ns: o
392
- }), O[x] === N && (O[x] = c[x]);
410
+ }), L[y] === N && (L[y] = c[y]);
393
411
  }
394
- c = O;
412
+ c = L;
395
413
  }
396
- } else if (w && d(L) && Array.isArray(c))
397
- c = c.join(L), c && (c = this.extendTranslation(c, e, t, s));
414
+ } else if (C && d(w) && Array.isArray(c))
415
+ c = c.join(w), c && (c = this.extendTranslation(c, e, t, s));
398
416
  else {
399
- let y = !1, O = !1;
400
- const k = t.count !== void 0 && !d(t.count), x = q.hasDefaultValue(t), N = k ? this.pluralResolver.getSuffix(u, t.count, t) : "", D = t.ordinal && k ? this.pluralResolver.getSuffix(u, t.count, {
417
+ let x = !1, L = !1;
418
+ const R = t.count !== void 0 && !d(t.count), y = q.hasDefaultValue(t), N = R ? this.pluralResolver.getSuffix(u, t.count, t) : "", I = t.ordinal && R ? this.pluralResolver.getSuffix(u, t.count, {
401
419
  ordinal: !1
402
- }) : "", E = k && !t.ordinal && t.count === 0, M = E && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${N}`] || t[`defaultValue${D}`] || t.defaultValue;
403
- !this.isValidLookup(c) && x && (y = !0, c = M), this.isValidLookup(c) || (O = !0, c = n);
404
- const ke = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && O ? void 0 : c, K = x && M !== c && this.options.updateMissing;
405
- if (O || y || K) {
406
- if (this.logger.log(K ? "updateKey" : "missingKey", u, l, n, K ? M : c), r) {
407
- const C = this.resolve(n, {
420
+ }) : "", V = R && !t.ordinal && t.count === 0, T = V && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${N}`] || t[`defaultValue${I}`] || t.defaultValue;
421
+ !this.isValidLookup(c) && y && (x = !0, c = T), this.isValidLookup(c) || (L = !0, c = a);
422
+ const je = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && L ? void 0 : c, K = y && T !== c && this.options.updateMissing;
423
+ if (L || x || K) {
424
+ if (this.logger.log(K ? "updateKey" : "missingKey", u, l, a, K ? T : c), n) {
425
+ const $ = this.resolve(a, {
408
426
  ...t,
409
427
  keySeparator: !1
410
428
  });
411
- C && C.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.");
429
+ $ && $.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.");
412
430
  }
413
- let U = [];
414
- const Y = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
415
- if (this.options.saveMissingTo === "fallback" && Y && Y[0])
416
- for (let C = 0; C < Y.length; C++)
417
- U.push(Y[C]);
418
- else this.options.saveMissingTo === "all" ? U = this.languageUtils.toResolveHierarchy(t.lng || this.language) : U.push(t.lng || this.language);
419
- const oe = (C, V, H) => {
420
- var ue;
421
- const le = x && H !== c ? H : ke;
422
- this.options.missingKeyHandler ? this.options.missingKeyHandler(C, l, V, le, K, t) : (ue = this.backendConnector) != null && ue.saveMissing && this.backendConnector.saveMissing(C, l, V, le, K, t), this.emit("missingKey", C, l, V, c);
431
+ let M = [];
432
+ const J = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
433
+ if (this.options.saveMissingTo === "fallback" && J && J[0])
434
+ for (let $ = 0; $ < J.length; $++)
435
+ M.push(J[$]);
436
+ else this.options.saveMissingTo === "all" ? M = this.languageUtils.toResolveHierarchy(t.lng || this.language) : M.push(t.lng || this.language);
437
+ const ue = ($, j, U) => {
438
+ var he;
439
+ const ce = y && U !== c ? U : je;
440
+ this.options.missingKeyHandler ? this.options.missingKeyHandler($, l, j, ce, K, t) : (he = this.backendConnector) != null && he.saveMissing && this.backendConnector.saveMissing($, l, j, ce, K, t), this.emit("missingKey", $, l, j, c);
423
441
  };
424
- this.options.saveMissing && (this.options.saveMissingPlurals && k ? U.forEach((C) => {
425
- const V = this.pluralResolver.getSuffixes(C, t);
426
- E && t[`defaultValue${this.options.pluralSeparator}zero`] && V.indexOf(`${this.options.pluralSeparator}zero`) < 0 && V.push(`${this.options.pluralSeparator}zero`), V.forEach((H) => {
427
- oe([C], n + H, t[`defaultValue${H}`] || M);
442
+ this.options.saveMissing && (this.options.saveMissingPlurals && R ? M.forEach(($) => {
443
+ const j = this.pluralResolver.getSuffixes($, t);
444
+ V && t[`defaultValue${this.options.pluralSeparator}zero`] && j.indexOf(`${this.options.pluralSeparator}zero`) < 0 && j.push(`${this.options.pluralSeparator}zero`), j.forEach((U) => {
445
+ ue([$], a + U, t[`defaultValue${U}`] || T);
428
446
  });
429
- }) : oe(U, n, M));
447
+ }) : ue(M, a, T));
430
448
  }
431
- c = this.extendTranslation(c, e, t, h, s), O && c === n && this.options.appendNamespaceToMissingKey && (c = `${l}:${n}`), (O || y) && this.options.parseMissingKeyHandler && (c = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}:${n}` : n, y ? c : void 0));
449
+ c = this.extendTranslation(c, e, t, f, s), L && c === a && this.options.appendNamespaceToMissingKey && (c = `${l}:${a}`), (L || x) && this.options.parseMissingKeyHandler && (c = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}:${a}` : a, x ? c : void 0));
432
450
  }
433
- return i ? (h.res = c, h.usedParams = this.getUsedParamsDetails(t), h) : c;
451
+ return i ? (f.res = c, f.usedParams = this.getUsedParamsDetails(t), f) : c;
434
452
  }
435
- extendTranslation(e, t, s, i, r) {
436
- var u, f;
437
- var n = this;
453
+ extendTranslation(e, t, s, i, n) {
454
+ var u, h;
455
+ var a = this;
438
456
  if ((u = this.i18nFormat) != null && u.parse)
439
457
  e = this.i18nFormat.parse(e, {
440
458
  ...this.options.interpolation.defaultVariables,
@@ -450,28 +468,28 @@ class q extends ee {
450
468
  ...s.interpolation
451
469
  }
452
470
  });
453
- const h = d(e) && (((f = s == null ? void 0 : s.interpolation) == null ? void 0 : f.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
471
+ const f = d(e) && (((h = s == null ? void 0 : s.interpolation) == null ? void 0 : h.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
454
472
  let c;
455
- if (h) {
473
+ if (f) {
456
474
  const g = e.match(this.interpolator.nestingRegexp);
457
475
  c = g && g.length;
458
476
  }
459
- let m = s.replace && !d(s.replace) ? s.replace : s;
460
- if (this.options.interpolation.defaultVariables && (m = {
477
+ let p = s.replace && !d(s.replace) ? s.replace : s;
478
+ if (this.options.interpolation.defaultVariables && (p = {
461
479
  ...this.options.interpolation.defaultVariables,
462
- ...m
463
- }), e = this.interpolator.interpolate(e, m, s.lng || this.language || i.usedLng, s), h) {
464
- const g = e.match(this.interpolator.nestingRegexp), p = g && g.length;
465
- c < p && (s.nest = !1);
480
+ ...p
481
+ }), e = this.interpolator.interpolate(e, p, s.lng || this.language || i.usedLng, s), f) {
482
+ const g = e.match(this.interpolator.nestingRegexp), m = g && g.length;
483
+ c < m && (s.nest = !1);
466
484
  }
467
485
  !s.lng && i && i.res && (s.lng = this.language || i.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
468
- for (var g = arguments.length, p = new Array(g), v = 0; v < g; v++)
469
- p[v] = arguments[v];
470
- return (r == null ? void 0 : r[0]) === p[0] && !s.context ? (n.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`), null) : n.translate(...p, t);
486
+ for (var g = arguments.length, m = new Array(g), v = 0; v < g; v++)
487
+ m[v] = arguments[v];
488
+ return (n == null ? void 0 : n[0]) === m[0] && !s.context ? (a.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`), null) : a.translate(...m, t);
471
489
  }, s)), s.interpolation && this.interpolator.reset();
472
490
  }
473
491
  const o = s.postProcess || this.options.postProcess, l = d(o) ? [o] : o;
474
- return e != null && (l != null && l.length) && s.applyPostProcessor !== !1 && (e = Pe.handle(l, e, t, this.options && this.options.postProcessPassResolved ? {
492
+ return e != null && (l != null && l.length) && s.applyPostProcessor !== !1 && (e = Ve.handle(l, e, t, this.options && this.options.postProcessPassResolved ? {
475
493
  i18nResolved: {
476
494
  ...i,
477
495
  usedParams: this.getUsedParamsDetails(s)
@@ -480,42 +498,42 @@ class q extends ee {
480
498
  } : s, this)), e;
481
499
  }
482
500
  resolve(e) {
483
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, i, r, n, o;
501
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, i, n, a, o;
484
502
  return d(e) && (e = [e]), e.forEach((l) => {
485
503
  if (this.isValidLookup(s)) return;
486
- const u = this.extractFromKey(l, t), f = u.key;
487
- i = f;
488
- let h = u.namespaces;
489
- this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
490
- const c = t.count !== void 0 && !d(t.count), m = c && !t.ordinal && t.count === 0, g = t.context !== void 0 && (d(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
491
- h.forEach((v) => {
492
- var L, w;
493
- this.isValidLookup(s) || (o = v, !ve[`${p[0]}-${v}`] && ((L = this.utils) != null && L.hasLoadedNamespace) && !((w = this.utils) != null && w.hasLoadedNamespace(o)) && (ve[`${p[0]}-${v}`] = !0, this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), p.forEach((I) => {
494
- var k;
504
+ const u = this.extractFromKey(l, t), h = u.key;
505
+ i = h;
506
+ let f = u.namespaces;
507
+ this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
508
+ const c = t.count !== void 0 && !d(t.count), p = c && !t.ordinal && t.count === 0, g = t.context !== void 0 && (d(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
509
+ f.forEach((v) => {
510
+ var w, C;
511
+ this.isValidLookup(s) || (o = v, !be[`${m[0]}-${v}`] && ((w = this.utils) != null && w.hasLoadedNamespace) && !((C = this.utils) != null && C.hasLoadedNamespace(o)) && (be[`${m[0]}-${v}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), m.forEach((E) => {
512
+ var R;
495
513
  if (this.isValidLookup(s)) return;
496
- n = I;
497
- const y = [f];
498
- if ((k = this.i18nFormat) != null && k.addLookupKeys)
499
- this.i18nFormat.addLookupKeys(y, f, I, v, t);
514
+ a = E;
515
+ const x = [h];
516
+ if ((R = this.i18nFormat) != null && R.addLookupKeys)
517
+ this.i18nFormat.addLookupKeys(x, h, E, v, t);
500
518
  else {
501
- let x;
502
- c && (x = this.pluralResolver.getSuffix(I, t.count, t));
503
- const N = `${this.options.pluralSeparator}zero`, D = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
504
- if (c && (y.push(f + x), t.ordinal && x.indexOf(D) === 0 && y.push(f + x.replace(D, this.options.pluralSeparator)), m && y.push(f + N)), g) {
505
- const E = `${f}${this.options.contextSeparator}${t.context}`;
506
- y.push(E), c && (y.push(E + x), t.ordinal && x.indexOf(D) === 0 && y.push(E + x.replace(D, this.options.pluralSeparator)), m && y.push(E + N));
519
+ let y;
520
+ c && (y = this.pluralResolver.getSuffix(E, t.count, t));
521
+ const N = `${this.options.pluralSeparator}zero`, I = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
522
+ if (c && (x.push(h + y), t.ordinal && y.indexOf(I) === 0 && x.push(h + y.replace(I, this.options.pluralSeparator)), p && x.push(h + N)), g) {
523
+ const V = `${h}${this.options.contextSeparator}${t.context}`;
524
+ x.push(V), c && (x.push(V + y), t.ordinal && y.indexOf(I) === 0 && x.push(V + y.replace(I, this.options.pluralSeparator)), p && x.push(V + N));
507
525
  }
508
526
  }
509
- let O;
510
- for (; O = y.pop(); )
511
- this.isValidLookup(s) || (r = O, s = this.getResource(I, v, O, t));
527
+ let L;
528
+ for (; L = x.pop(); )
529
+ this.isValidLookup(s) || (n = L, s = this.getResource(E, v, L, t));
512
530
  }));
513
531
  });
514
532
  }), {
515
533
  res: s,
516
534
  usedKey: i,
517
- exactUsedKey: r,
518
- usedLng: n,
535
+ exactUsedKey: n,
536
+ usedLng: a,
519
537
  usedNS: o
520
538
  };
521
539
  }
@@ -523,9 +541,9 @@ class q extends ee {
523
541
  return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
524
542
  }
525
543
  getResource(e, t, s) {
526
- var r;
544
+ var n;
527
545
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
528
- return (r = this.i18nFormat) != null && r.getResource ? this.i18nFormat.getResource(e, t, s, i) : this.resourceStore.getResource(e, t, s, i);
546
+ return (n = this.i18nFormat) != null && n.getResource ? this.i18nFormat.getResource(e, t, s, i) : this.resourceStore.getResource(e, t, s, i);
529
547
  }
530
548
  getUsedParamsDetails() {
531
549
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -538,8 +556,8 @@ class q extends ee {
538
556
  i = {
539
557
  ...i
540
558
  };
541
- for (const r of t)
542
- delete i[r];
559
+ for (const n of t)
560
+ delete i[n];
543
561
  }
544
562
  return i;
545
563
  }
@@ -551,7 +569,7 @@ class q extends ee {
551
569
  return !1;
552
570
  }
553
571
  }
554
- class ye {
572
+ class Se {
555
573
  constructor(e) {
556
574
  this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = P.create("languageUtils");
557
575
  }
@@ -590,10 +608,10 @@ class ye {
590
608
  if (t) return;
591
609
  const i = this.getLanguagePartFromCode(s);
592
610
  if (this.isSupportedCode(i)) return t = i;
593
- t = this.options.supportedLngs.find((r) => {
594
- if (r === i) return r;
595
- if (!(r.indexOf("-") < 0 && i.indexOf("-") < 0) && (r.indexOf("-") > 0 && i.indexOf("-") < 0 && r.substring(0, r.indexOf("-")) === i || r.indexOf(i) === 0 && i.length > 1))
596
- return r;
611
+ t = this.options.supportedLngs.find((n) => {
612
+ if (n === i) return n;
613
+ if (!(n.indexOf("-") < 0 && i.indexOf("-") < 0) && (n.indexOf("-") > 0 && i.indexOf("-") < 0 && n.substring(0, n.indexOf("-")) === i || n.indexOf(i) === 0 && i.length > 1))
614
+ return n;
597
615
  });
598
616
  }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
599
617
  }
@@ -605,28 +623,28 @@ class ye {
605
623
  return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
606
624
  }
607
625
  toResolveHierarchy(e, t) {
608
- const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], r = (n) => {
609
- n && (this.isSupportedCode(n) ? i.push(n) : this.logger.warn(`rejecting language code not found in supportedLngs: ${n}`));
626
+ const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], n = (a) => {
627
+ a && (this.isSupportedCode(a) ? i.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
610
628
  };
611
- return d(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && r(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && r(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && r(this.getLanguagePartFromCode(e))) : d(e) && r(this.formatLanguageCode(e)), s.forEach((n) => {
612
- i.indexOf(n) < 0 && r(this.formatLanguageCode(n));
629
+ return d(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && n(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && n(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && n(this.getLanguagePartFromCode(e))) : d(e) && n(this.formatLanguageCode(e)), s.forEach((a) => {
630
+ i.indexOf(a) < 0 && n(this.formatLanguageCode(a));
613
631
  }), i;
614
632
  }
615
633
  }
616
- const xe = {
634
+ const Oe = {
617
635
  zero: 0,
618
636
  one: 1,
619
637
  two: 2,
620
638
  few: 3,
621
639
  many: 4,
622
640
  other: 5
623
- }, be = {
624
- select: (a) => a === 1 ? "one" : "other",
641
+ }, Le = {
642
+ select: (r) => r === 1 ? "one" : "other",
625
643
  resolvedOptions: () => ({
626
644
  pluralCategories: ["one", "other"]
627
645
  })
628
646
  };
629
- class We {
647
+ class Ge {
630
648
  constructor(e) {
631
649
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
632
650
  this.languageUtils = e, this.options = t, this.logger = P.create("pluralResolver"), this.pluralRulesCache = {};
@@ -639,25 +657,25 @@ class We {
639
657
  }
640
658
  getRule(e) {
641
659
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
642
- const s = Q(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", r = JSON.stringify({
660
+ const s = Q(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", n = JSON.stringify({
643
661
  cleanedCode: s,
644
662
  type: i
645
663
  });
646
- if (r in this.pluralRulesCache)
647
- return this.pluralRulesCache[r];
648
- let n;
664
+ if (n in this.pluralRulesCache)
665
+ return this.pluralRulesCache[n];
666
+ let a;
649
667
  try {
650
- n = new Intl.PluralRules(s, {
668
+ a = new Intl.PluralRules(s, {
651
669
  type: i
652
670
  });
653
671
  } catch {
654
672
  if (!Intl)
655
- return this.logger.error("No Intl support, please use an Intl polyfill!"), be;
656
- if (!e.match(/-|_/)) return be;
673
+ return this.logger.error("No Intl support, please use an Intl polyfill!"), Le;
674
+ if (!e.match(/-|_/)) return Le;
657
675
  const l = this.languageUtils.getLanguagePartFromCode(e);
658
- n = this.getRule(l, t);
676
+ a = this.getRule(l, t);
659
677
  }
660
- return this.pluralRulesCache[r] = n, n;
678
+ return this.pluralRulesCache[n] = a, a;
661
679
  }
662
680
  needsPlural(e) {
663
681
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = this.getRule(e, t);
@@ -669,7 +687,7 @@ class We {
669
687
  }
670
688
  getSuffixes(e) {
671
689
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = this.getRule(e, t);
672
- return s || (s = this.getRule("dev", t)), s ? s.resolvedOptions().pluralCategories.sort((i, r) => xe[i] - xe[r]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
690
+ return s || (s = this.getRule("dev", t)), s ? s.resolvedOptions().pluralCategories.sort((i, n) => Oe[i] - Oe[n]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
673
691
  }
674
692
  getSuffix(e, t) {
675
693
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
@@ -677,11 +695,11 @@ class We {
677
695
  return i ? `${this.options.prepend}${s.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, s));
678
696
  }
679
697
  }
680
- const Se = function(a, e, t) {
681
- let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = Ke(a, e, t);
682
- return !r && i && d(t) && (r = re(a, t, s), r === void 0 && (r = re(e, t, s))), r;
683
- }, te = (a) => a.replace(/\$/g, "$$$$");
684
- class Ge {
698
+ const we = function(r, e, t) {
699
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, n = ze(r, e, t);
700
+ return !n && i && d(t) && (n = ae(r, t, s), n === void 0 && (n = ae(e, t, s))), n;
701
+ }, ee = (r) => r.replace(/\$/g, "$$$$");
702
+ class qe {
685
703
  constructor() {
686
704
  var t;
687
705
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -696,22 +714,22 @@ class Ge {
696
714
  escape: t,
697
715
  escapeValue: s,
698
716
  useRawValueToEscape: i,
699
- prefix: r,
700
- prefixEscaped: n,
717
+ prefix: n,
718
+ prefixEscaped: a,
701
719
  suffix: o,
702
720
  suffixEscaped: l,
703
721
  formatSeparator: u,
704
- unescapeSuffix: f,
705
- unescapePrefix: h,
722
+ unescapeSuffix: h,
723
+ unescapePrefix: f,
706
724
  nestingPrefix: c,
707
- nestingPrefixEscaped: m,
725
+ nestingPrefixEscaped: p,
708
726
  nestingSuffix: g,
709
- nestingSuffixEscaped: p,
727
+ nestingSuffixEscaped: m,
710
728
  nestingOptionsSeparator: v,
711
- maxReplaces: L,
712
- alwaysFormat: w
729
+ maxReplaces: w,
730
+ alwaysFormat: C
713
731
  } = e.interpolation;
714
- this.escape = t !== void 0 ? t : He, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = r ? T(r) : n || "{{", this.suffix = o ? T(o) : l || "}}", this.formatSeparator = u || ",", this.unescapePrefix = f ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : f || "", this.nestingPrefix = c ? T(c) : m || T("$t("), this.nestingSuffix = g ? T(g) : p || T(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces = L || 1e3, this.alwaysFormat = w !== void 0 ? w : !1, this.resetRegExp();
732
+ this.escape = t !== void 0 ? t : Je, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = n ? F(n) : a || "{{", this.suffix = o ? F(o) : l || "}}", this.formatSeparator = u || ",", this.unescapePrefix = h ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : h || "", this.nestingPrefix = c ? F(c) : p || F("$t("), this.nestingSuffix = g ? F(g) : m || F(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces = w || 1e3, this.alwaysFormat = C !== void 0 ? C : !1, this.resetRegExp();
715
733
  }
716
734
  reset() {
717
735
  this.options && this.init(this.options);
@@ -721,103 +739,103 @@ class Ge {
721
739
  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}`);
722
740
  }
723
741
  interpolate(e, t, s, i) {
724
- var m;
725
- let r, n, o;
742
+ var p;
743
+ let n, a, o;
726
744
  const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (g) => {
727
745
  if (g.indexOf(this.formatSeparator) < 0) {
728
- const w = Se(t, l, g, this.options.keySeparator, this.options.ignoreJSONStructure);
729
- return this.alwaysFormat ? this.format(w, void 0, s, {
746
+ const C = we(t, l, g, this.options.keySeparator, this.options.ignoreJSONStructure);
747
+ return this.alwaysFormat ? this.format(C, void 0, s, {
730
748
  ...i,
731
749
  ...t,
732
750
  interpolationkey: g
733
- }) : w;
751
+ }) : C;
734
752
  }
735
- const p = g.split(this.formatSeparator), v = p.shift().trim(), L = p.join(this.formatSeparator).trim();
736
- return this.format(Se(t, l, v, this.options.keySeparator, this.options.ignoreJSONStructure), L, s, {
753
+ const m = g.split(this.formatSeparator), v = m.shift().trim(), w = m.join(this.formatSeparator).trim();
754
+ return this.format(we(t, l, v, this.options.keySeparator, this.options.ignoreJSONStructure), w, s, {
737
755
  ...i,
738
756
  ...t,
739
757
  interpolationkey: v
740
758
  });
741
759
  };
742
760
  this.resetRegExp();
743
- const f = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, h = ((m = i == null ? void 0 : i.interpolation) == null ? void 0 : m.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
761
+ const h = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, f = ((p = i == null ? void 0 : i.interpolation) == null ? void 0 : p.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
744
762
  return [{
745
763
  regex: this.regexpUnescape,
746
- safeValue: (g) => te(g)
764
+ safeValue: (g) => ee(g)
747
765
  }, {
748
766
  regex: this.regexp,
749
- safeValue: (g) => this.escapeValue ? te(this.escape(g)) : te(g)
767
+ safeValue: (g) => this.escapeValue ? ee(this.escape(g)) : ee(g)
750
768
  }].forEach((g) => {
751
- for (o = 0; r = g.regex.exec(e); ) {
752
- const p = r[1].trim();
753
- if (n = u(p), n === void 0)
754
- if (typeof f == "function") {
755
- const L = f(e, r, i);
756
- n = d(L) ? L : "";
757
- } else if (i && Object.prototype.hasOwnProperty.call(i, p))
758
- n = "";
759
- else if (h) {
760
- n = r[0];
769
+ for (o = 0; n = g.regex.exec(e); ) {
770
+ const m = n[1].trim();
771
+ if (a = u(m), a === void 0)
772
+ if (typeof h == "function") {
773
+ const w = h(e, n, i);
774
+ a = d(w) ? w : "";
775
+ } else if (i && Object.prototype.hasOwnProperty.call(i, m))
776
+ a = "";
777
+ else if (f) {
778
+ a = n[0];
761
779
  continue;
762
780
  } else
763
- this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`), n = "";
764
- else !d(n) && !this.useRawValueToEscape && (n = he(n));
765
- const v = g.safeValue(n);
766
- if (e = e.replace(r[0], v), h ? (g.regex.lastIndex += n.length, g.regex.lastIndex -= r[0].length) : g.regex.lastIndex = 0, o++, o >= this.maxReplaces)
781
+ this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`), a = "";
782
+ else !d(a) && !this.useRawValueToEscape && (a = pe(a));
783
+ const v = g.safeValue(a);
784
+ if (e = e.replace(n[0], v), f ? (g.regex.lastIndex += a.length, g.regex.lastIndex -= n[0].length) : g.regex.lastIndex = 0, o++, o >= this.maxReplaces)
767
785
  break;
768
786
  }
769
787
  }), e;
770
788
  }
771
789
  nest(e, t) {
772
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, r, n;
790
+ let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, n, a;
773
791
  const o = (l, u) => {
774
- const f = this.nestingOptionsSeparator;
775
- if (l.indexOf(f) < 0) return l;
776
- const h = l.split(new RegExp(`${f}[ ]*{`));
777
- let c = `{${h[1]}`;
778
- l = h[0], c = this.interpolate(c, n);
779
- const m = c.match(/'/g), g = c.match(/"/g);
780
- (((m == null ? void 0 : m.length) ?? 0) % 2 === 0 && !g || g.length % 2 !== 0) && (c = c.replace(/'/g, '"'));
792
+ const h = this.nestingOptionsSeparator;
793
+ if (l.indexOf(h) < 0) return l;
794
+ const f = l.split(new RegExp(`${h}[ ]*{`));
795
+ let c = `{${f[1]}`;
796
+ l = f[0], c = this.interpolate(c, a);
797
+ const p = c.match(/'/g), g = c.match(/"/g);
798
+ (((p == null ? void 0 : p.length) ?? 0) % 2 === 0 && !g || g.length % 2 !== 0) && (c = c.replace(/'/g, '"'));
781
799
  try {
782
- n = JSON.parse(c), u && (n = {
800
+ a = JSON.parse(c), u && (a = {
783
801
  ...u,
784
- ...n
802
+ ...a
785
803
  });
786
- } catch (p) {
787
- return this.logger.warn(`failed parsing options string in nesting for key ${l}`, p), `${l}${f}${c}`;
804
+ } catch (m) {
805
+ return this.logger.warn(`failed parsing options string in nesting for key ${l}`, m), `${l}${h}${c}`;
788
806
  }
789
- return n.defaultValue && n.defaultValue.indexOf(this.prefix) > -1 && delete n.defaultValue, l;
807
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, l;
790
808
  };
791
809
  for (; i = this.nestingRegexp.exec(e); ) {
792
810
  let l = [];
793
- n = {
811
+ a = {
794
812
  ...s
795
- }, n = n.replace && !d(n.replace) ? n.replace : n, n.applyPostProcessor = !1, delete n.defaultValue;
813
+ }, a = a.replace && !d(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
796
814
  let u = !1;
797
815
  if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
798
- const f = i[1].split(this.formatSeparator).map((h) => h.trim());
799
- i[1] = f.shift(), l = f, u = !0;
816
+ const h = i[1].split(this.formatSeparator).map((f) => f.trim());
817
+ i[1] = h.shift(), l = h, u = !0;
800
818
  }
801
- if (r = t(o.call(this, i[1].trim(), n), n), r && i[0] === e && !d(r)) return r;
802
- d(r) || (r = he(r)), r || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), r = ""), u && (r = l.reduce((f, h) => this.format(f, h, s.lng, {
819
+ if (n = t(o.call(this, i[1].trim(), a), a), n && i[0] === e && !d(n)) return n;
820
+ d(n) || (n = pe(n)), n || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), n = ""), u && (n = l.reduce((h, f) => this.format(h, f, s.lng, {
803
821
  ...s,
804
822
  interpolationkey: i[1].trim()
805
- }), r.trim())), e = e.replace(i[0], r), this.regexp.lastIndex = 0;
823
+ }), n.trim())), e = e.replace(i[0], n), this.regexp.lastIndex = 0;
806
824
  }
807
825
  return e;
808
826
  }
809
827
  }
810
- const Ze = (a) => {
811
- let e = a.toLowerCase().trim();
828
+ const Xe = (r) => {
829
+ let e = r.toLowerCase().trim();
812
830
  const t = {};
813
- if (a.indexOf("(") > -1) {
814
- const s = a.split("(");
831
+ if (r.indexOf("(") > -1) {
832
+ const s = r.split("(");
815
833
  e = s[0].toLowerCase().trim();
816
834
  const i = s[1].substring(0, s[1].length - 1);
817
- e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((n) => {
818
- if (n) {
819
- const [o, ...l] = n.split(":"), u = l.join(":").trim().replace(/^'+|'+$/g, ""), f = o.trim();
820
- t[f] || (t[f] = u), u === "false" && (t[f] = !1), u === "true" && (t[f] = !0), isNaN(u) || (t[f] = parseInt(u, 10));
835
+ e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((a) => {
836
+ if (a) {
837
+ const [o, ...l] = a.split(":"), u = l.join(":").trim().replace(/^'+|'+$/g, ""), h = o.trim();
838
+ t[h] || (t[h] = u), u === "false" && (t[h] = !1), u === "true" && (t[h] = !0), isNaN(u) || (t[h] = parseInt(u, 10));
821
839
  }
822
840
  });
823
841
  }
@@ -825,20 +843,20 @@ const Ze = (a) => {
825
843
  formatName: e,
826
844
  formatOptions: t
827
845
  };
828
- }, A = (a) => {
846
+ }, A = (r) => {
829
847
  const e = {};
830
848
  return (t, s, i) => {
831
- let r = i;
832
- i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (r = {
833
- ...r,
849
+ let n = i;
850
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (n = {
851
+ ...n,
834
852
  [i.interpolationkey]: void 0
835
853
  });
836
- const n = s + JSON.stringify(r);
837
- let o = e[n];
838
- return o || (o = a(Q(s), i), e[n] = o), o(t);
854
+ const a = s + JSON.stringify(n);
855
+ let o = e[a];
856
+ return o || (o = r(Q(s), i), e[a] = o), o(t);
839
857
  };
840
858
  };
841
- class Qe {
859
+ class et {
842
860
  constructor() {
843
861
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
844
862
  this.logger = P.create("formatter"), this.options = e, this.formats = {
@@ -846,32 +864,32 @@ class Qe {
846
864
  const i = new Intl.NumberFormat(t, {
847
865
  ...s
848
866
  });
849
- return (r) => i.format(r);
867
+ return (n) => i.format(n);
850
868
  }),
851
869
  currency: A((t, s) => {
852
870
  const i = new Intl.NumberFormat(t, {
853
871
  ...s,
854
872
  style: "currency"
855
873
  });
856
- return (r) => i.format(r);
874
+ return (n) => i.format(n);
857
875
  }),
858
876
  datetime: A((t, s) => {
859
877
  const i = new Intl.DateTimeFormat(t, {
860
878
  ...s
861
879
  });
862
- return (r) => i.format(r);
880
+ return (n) => i.format(n);
863
881
  }),
864
882
  relativetime: A((t, s) => {
865
883
  const i = new Intl.RelativeTimeFormat(t, {
866
884
  ...s
867
885
  });
868
- return (r) => i.format(r, s.range || "day");
886
+ return (n) => i.format(n, s.range || "day");
869
887
  }),
870
888
  list: A((t, s) => {
871
889
  const i = new Intl.ListFormat(t, {
872
890
  ...s
873
891
  });
874
- return (r) => i.format(r);
892
+ return (n) => i.format(n);
875
893
  })
876
894
  }, this.init(e);
877
895
  }
@@ -889,28 +907,28 @@ class Qe {
889
907
  }
890
908
  format(e, t, s) {
891
909
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
892
- const r = t.split(this.formatSeparator);
893
- if (r.length > 1 && r[0].indexOf("(") > 1 && r[0].indexOf(")") < 0 && r.find((o) => o.indexOf(")") > -1)) {
894
- const o = r.findIndex((l) => l.indexOf(")") > -1);
895
- r[0] = [r[0], ...r.splice(1, o)].join(this.formatSeparator);
910
+ const n = t.split(this.formatSeparator);
911
+ if (n.length > 1 && n[0].indexOf("(") > 1 && n[0].indexOf(")") < 0 && n.find((o) => o.indexOf(")") > -1)) {
912
+ const o = n.findIndex((l) => l.indexOf(")") > -1);
913
+ n[0] = [n[0], ...n.splice(1, o)].join(this.formatSeparator);
896
914
  }
897
- return r.reduce((o, l) => {
898
- var h;
915
+ return n.reduce((o, l) => {
916
+ var f;
899
917
  const {
900
918
  formatName: u,
901
- formatOptions: f
902
- } = Ze(l);
919
+ formatOptions: h
920
+ } = Xe(l);
903
921
  if (this.formats[u]) {
904
922
  let c = o;
905
923
  try {
906
- const m = ((h = i == null ? void 0 : i.formatParams) == null ? void 0 : h[i.interpolationkey]) || {}, g = m.locale || m.lng || i.locale || i.lng || s;
924
+ const p = ((f = i == null ? void 0 : i.formatParams) == null ? void 0 : f[i.interpolationkey]) || {}, g = p.locale || p.lng || i.locale || i.lng || s;
907
925
  c = this.formats[u](o, g, {
908
- ...f,
926
+ ...h,
909
927
  ...i,
910
- ...m
928
+ ...p
911
929
  });
912
- } catch (m) {
913
- this.logger.warn(m);
930
+ } catch (p) {
931
+ this.logger.warn(p);
914
932
  }
915
933
  return c;
916
934
  } else
@@ -919,84 +937,84 @@ class Qe {
919
937
  }, e);
920
938
  }
921
939
  }
922
- const Xe = (a, e) => {
923
- a.pending[e] !== void 0 && (delete a.pending[e], a.pendingCount--);
940
+ const tt = (r, e) => {
941
+ r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
924
942
  };
925
- class qe extends ee {
943
+ class st extends X {
926
944
  constructor(e, t, s) {
927
- var r, n;
945
+ var n, a;
928
946
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
929
- super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = i, this.logger = P.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (n = (r = this.backend) == null ? void 0 : r.init) == null || n.call(r, s, i.backend, i);
947
+ super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = i, this.logger = P.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (a = (n = this.backend) == null ? void 0 : n.init) == null || a.call(n, s, i.backend, i);
930
948
  }
931
949
  queueLoad(e, t, s, i) {
932
- const r = {}, n = {}, o = {}, l = {};
950
+ const n = {}, a = {}, o = {}, l = {};
933
951
  return e.forEach((u) => {
934
- let f = !0;
935
- t.forEach((h) => {
936
- const c = `${u}|${h}`;
937
- !s.reload && this.store.hasResourceBundle(u, h) ? this.state[c] = 2 : this.state[c] < 0 || (this.state[c] === 1 ? n[c] === void 0 && (n[c] = !0) : (this.state[c] = 1, f = !1, n[c] === void 0 && (n[c] = !0), r[c] === void 0 && (r[c] = !0), l[h] === void 0 && (l[h] = !0)));
938
- }), f || (o[u] = !0);
939
- }), (Object.keys(r).length || Object.keys(n).length) && this.queue.push({
940
- pending: n,
941
- pendingCount: Object.keys(n).length,
952
+ let h = !0;
953
+ t.forEach((f) => {
954
+ const c = `${u}|${f}`;
955
+ !s.reload && this.store.hasResourceBundle(u, f) ? this.state[c] = 2 : this.state[c] < 0 || (this.state[c] === 1 ? a[c] === void 0 && (a[c] = !0) : (this.state[c] = 1, h = !1, a[c] === void 0 && (a[c] = !0), n[c] === void 0 && (n[c] = !0), l[f] === void 0 && (l[f] = !0)));
956
+ }), h || (o[u] = !0);
957
+ }), (Object.keys(n).length || Object.keys(a).length) && this.queue.push({
958
+ pending: a,
959
+ pendingCount: Object.keys(a).length,
942
960
  loaded: {},
943
961
  errors: [],
944
962
  callback: i
945
963
  }), {
946
- toLoad: Object.keys(r),
947
- pending: Object.keys(n),
964
+ toLoad: Object.keys(n),
965
+ pending: Object.keys(a),
948
966
  toLoadLanguages: Object.keys(o),
949
967
  toLoadNamespaces: Object.keys(l)
950
968
  };
951
969
  }
952
970
  loaded(e, t, s) {
953
- const i = e.split("|"), r = i[0], n = i[1];
954
- t && this.emit("failedLoading", r, n, t), !t && s && this.store.addResourceBundle(r, n, s, void 0, void 0, {
971
+ const i = e.split("|"), n = i[0], a = i[1];
972
+ t && this.emit("failedLoading", n, a, t), !t && s && this.store.addResourceBundle(n, a, s, void 0, void 0, {
955
973
  skipCopy: !0
956
974
  }), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
957
975
  const o = {};
958
976
  this.queue.forEach((l) => {
959
- Me(l.loaded, [r], n), Xe(l, e), t && l.errors.push(t), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((u) => {
977
+ He(l.loaded, [n], a), tt(l, e), t && l.errors.push(t), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((u) => {
960
978
  o[u] || (o[u] = {});
961
- const f = l.loaded[u];
962
- f.length && f.forEach((h) => {
963
- o[u][h] === void 0 && (o[u][h] = !0);
979
+ const h = l.loaded[u];
980
+ h.length && h.forEach((f) => {
981
+ o[u][f] === void 0 && (o[u][f] = !0);
964
982
  });
965
983
  }), l.done = !0, l.errors.length ? l.callback(l.errors) : l.callback());
966
984
  }), this.emit("loaded", o), this.queue = this.queue.filter((l) => !l.done);
967
985
  }
968
986
  read(e, t, s) {
969
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, n = arguments.length > 5 ? arguments[5] : void 0;
970
- if (!e.length) return n(null, {});
987
+ let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
988
+ if (!e.length) return a(null, {});
971
989
  if (this.readingCalls >= this.maxParallelReads) {
972
990
  this.waitingReads.push({
973
991
  lng: e,
974
992
  ns: t,
975
993
  fcName: s,
976
994
  tried: i,
977
- wait: r,
978
- callback: n
995
+ wait: n,
996
+ callback: a
979
997
  });
980
998
  return;
981
999
  }
982
1000
  this.readingCalls++;
983
- const o = (u, f) => {
1001
+ const o = (u, h) => {
984
1002
  if (this.readingCalls--, this.waitingReads.length > 0) {
985
- const h = this.waitingReads.shift();
986
- this.read(h.lng, h.ns, h.fcName, h.tried, h.wait, h.callback);
1003
+ const f = this.waitingReads.shift();
1004
+ this.read(f.lng, f.ns, f.fcName, f.tried, f.wait, f.callback);
987
1005
  }
988
- if (u && f && i < this.maxRetries) {
1006
+ if (u && h && i < this.maxRetries) {
989
1007
  setTimeout(() => {
990
- this.read.call(this, e, t, s, i + 1, r * 2, n);
991
- }, r);
1008
+ this.read.call(this, e, t, s, i + 1, n * 2, a);
1009
+ }, n);
992
1010
  return;
993
1011
  }
994
- n(u, f);
1012
+ a(u, h);
995
1013
  }, l = this.backend[s].bind(this.backend);
996
1014
  if (l.length === 2) {
997
1015
  try {
998
1016
  const u = l(e, t);
999
- u && typeof u.then == "function" ? u.then((f) => o(null, f)).catch(o) : o(null, u);
1017
+ u && typeof u.then == "function" ? u.then((h) => o(null, h)).catch(o) : o(null, u);
1000
1018
  } catch (u) {
1001
1019
  o(u);
1002
1020
  }
@@ -1009,11 +1027,11 @@ class qe extends ee {
1009
1027
  if (!this.backend)
1010
1028
  return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
1011
1029
  d(e) && (e = this.languageUtils.toResolveHierarchy(e)), d(t) && (t = [t]);
1012
- const r = this.queueLoad(e, t, s, i);
1013
- if (!r.toLoad.length)
1014
- return r.pending.length || i(), null;
1015
- r.toLoad.forEach((n) => {
1016
- this.loadOne(n);
1030
+ const n = this.queueLoad(e, t, s, i);
1031
+ if (!n.toLoad.length)
1032
+ return n.pending.length || i(), null;
1033
+ n.toLoad.forEach((a) => {
1034
+ this.loadOne(a);
1017
1035
  });
1018
1036
  }
1019
1037
  load(e, t, s) {
@@ -1026,40 +1044,40 @@ class qe extends ee {
1026
1044
  }
1027
1045
  loadOne(e) {
1028
1046
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1029
- const s = e.split("|"), i = s[0], r = s[1];
1030
- this.read(i, r, "read", void 0, void 0, (n, o) => {
1031
- n && this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`, n), !n && o && this.logger.log(`${t}loaded namespace ${r} for language ${i}`, o), this.loaded(e, n, o);
1047
+ const s = e.split("|"), i = s[0], n = s[1];
1048
+ this.read(i, n, "read", void 0, void 0, (a, o) => {
1049
+ a && this.logger.warn(`${t}loading namespace ${n} for language ${i} failed`, a), !a && o && this.logger.log(`${t}loaded namespace ${n} for language ${i}`, o), this.loaded(e, a, o);
1032
1050
  });
1033
1051
  }
1034
- saveMissing(e, t, s, i, r) {
1035
- var l, u, f, h, c;
1036
- let n = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
1052
+ saveMissing(e, t, s, i, n) {
1053
+ var l, u, h, f, c;
1054
+ let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
1037
1055
  };
1038
- if ((u = (l = this.services) == null ? void 0 : l.utils) != null && u.hasLoadedNamespace && !((h = (f = this.services) == null ? void 0 : f.utils) != null && h.hasLoadedNamespace(t))) {
1056
+ if ((u = (l = this.services) == null ? void 0 : l.utils) != null && u.hasLoadedNamespace && !((f = (h = this.services) == null ? void 0 : h.utils) != null && f.hasLoadedNamespace(t))) {
1039
1057
  this.logger.warn(`did not save key "${s}" 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!!!");
1040
1058
  return;
1041
1059
  }
1042
1060
  if (!(s == null || s === "")) {
1043
1061
  if ((c = this.backend) != null && c.create) {
1044
- const m = {
1045
- ...n,
1046
- isUpdate: r
1062
+ const p = {
1063
+ ...a,
1064
+ isUpdate: n
1047
1065
  }, g = this.backend.create.bind(this.backend);
1048
1066
  if (g.length < 6)
1049
1067
  try {
1050
- let p;
1051
- g.length === 5 ? p = g(e, t, s, i, m) : p = g(e, t, s, i), p && typeof p.then == "function" ? p.then((v) => o(null, v)).catch(o) : o(null, p);
1052
- } catch (p) {
1053
- o(p);
1068
+ let m;
1069
+ g.length === 5 ? m = g(e, t, s, i, p) : m = g(e, t, s, i), m && typeof m.then == "function" ? m.then((v) => o(null, v)).catch(o) : o(null, m);
1070
+ } catch (m) {
1071
+ o(m);
1054
1072
  }
1055
1073
  else
1056
- g(e, t, s, i, o, m);
1074
+ g(e, t, s, i, o, p);
1057
1075
  }
1058
1076
  !e || !e[0] || this.store.addResource(e[0], t, s, i);
1059
1077
  }
1060
1078
  }
1061
1079
  }
1062
- const Oe = () => ({
1080
+ const $e = () => ({
1063
1081
  debug: !1,
1064
1082
  initAsync: !0,
1065
1083
  ns: ["translation"],
@@ -1092,10 +1110,10 @@ const Oe = () => ({
1092
1110
  parseMissingKeyHandler: !1,
1093
1111
  appendNamespaceToMissingKey: !1,
1094
1112
  appendNamespaceToCIMode: !1,
1095
- overloadTranslationOptionHandler: (a) => {
1113
+ overloadTranslationOptionHandler: (r) => {
1096
1114
  let e = {};
1097
- if (typeof a[1] == "object" && (e = a[1]), d(a[1]) && (e.defaultValue = a[1]), d(a[2]) && (e.tDescription = a[2]), typeof a[2] == "object" || typeof a[3] == "object") {
1098
- const t = a[3] || a[2];
1115
+ if (typeof r[1] == "object" && (e = r[1]), d(r[1]) && (e.defaultValue = r[1]), d(r[2]) && (e.tDescription = r[2]), typeof r[2] == "object" || typeof r[3] == "object") {
1116
+ const t = r[3] || r[2];
1099
1117
  Object.keys(t).forEach((s) => {
1100
1118
  e[s] = t[s];
1101
1119
  });
@@ -1104,7 +1122,7 @@ const Oe = () => ({
1104
1122
  },
1105
1123
  interpolation: {
1106
1124
  escapeValue: !0,
1107
- format: (a) => a,
1125
+ format: (r) => r,
1108
1126
  prefix: "{{",
1109
1127
  suffix: "}}",
1110
1128
  formatSeparator: ",",
@@ -1115,21 +1133,21 @@ const Oe = () => ({
1115
1133
  maxReplaces: 1e3,
1116
1134
  skipOnVariables: !0
1117
1135
  }
1118
- }), Le = (a) => {
1136
+ }), Ce = (r) => {
1119
1137
  var e, t;
1120
- return d(a.ns) && (a.ns = [a.ns]), d(a.fallbackLng) && (a.fallbackLng = [a.fallbackLng]), d(a.fallbackNS) && (a.fallbackNS = [a.fallbackNS]), ((t = (e = a.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (a.supportedLngs = a.supportedLngs.concat(["cimode"])), typeof a.initImmediate == "boolean" && (a.initAsync = a.initImmediate), a;
1138
+ return d(r.ns) && (r.ns = [r.ns]), d(r.fallbackLng) && (r.fallbackLng = [r.fallbackLng]), d(r.fallbackNS) && (r.fallbackNS = [r.fallbackNS]), ((t = (e = r.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (r.supportedLngs = r.supportedLngs.concat(["cimode"])), typeof r.initImmediate == "boolean" && (r.initAsync = r.initImmediate), r;
1121
1139
  }, W = () => {
1122
- }, et = (a) => {
1123
- Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach((t) => {
1124
- typeof a[t] == "function" && (a[t] = a[t].bind(a));
1140
+ }, it = (r) => {
1141
+ Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((t) => {
1142
+ typeof r[t] == "function" && (r[t] = r[t].bind(r));
1125
1143
  });
1126
1144
  };
1127
- class J extends ee {
1145
+ class B extends X {
1128
1146
  constructor() {
1129
1147
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1130
- if (super(), this.options = Le(e), this.services = {}, this.logger = P, this.modules = {
1148
+ if (super(), this.options = Ce(e), this.services = {}, this.logger = P, this.modules = {
1131
1149
  external: []
1132
- }, et(this), t && !this.isInitialized && !e.isClone) {
1150
+ }, it(this), t && !this.isInitialized && !e.isClone) {
1133
1151
  if (!this.options.initAsync)
1134
1152
  return this.init(e, t), this;
1135
1153
  setTimeout(() => {
@@ -1141,90 +1159,90 @@ class J extends ee {
1141
1159
  var e = this;
1142
1160
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
1143
1161
  this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), t.defaultNS == null && t.ns && (d(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
1144
- const i = Oe();
1162
+ const i = $e();
1145
1163
  this.options = {
1146
1164
  ...i,
1147
1165
  ...this.options,
1148
- ...Le(t)
1166
+ ...Ce(t)
1149
1167
  }, this.options.interpolation = {
1150
1168
  ...i.interpolation,
1151
1169
  ...this.options.interpolation
1152
1170
  }, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
1153
- const r = (f) => f ? typeof f == "function" ? new f() : f : null;
1171
+ const n = (h) => h ? typeof h == "function" ? new h() : h : null;
1154
1172
  if (!this.options.isClone) {
1155
- this.modules.logger ? P.init(r(this.modules.logger), this.options) : P.init(null, this.options);
1156
- let f;
1157
- this.modules.formatter ? f = this.modules.formatter : f = Qe;
1158
- const h = new ye(this.options);
1159
- this.store = new me(this.options.resources, this.options);
1173
+ this.modules.logger ? P.init(n(this.modules.logger), this.options) : P.init(null, this.options);
1174
+ let h;
1175
+ this.modules.formatter ? h = this.modules.formatter : h = et;
1176
+ const f = new Se(this.options);
1177
+ this.store = new ye(this.options.resources, this.options);
1160
1178
  const c = this.services;
1161
- c.logger = P, c.resourceStore = this.store, c.languageUtils = h, c.pluralResolver = new We(h, {
1179
+ c.logger = P, c.resourceStore = this.store, c.languageUtils = f, c.pluralResolver = new Ge(f, {
1162
1180
  prepend: this.options.pluralSeparator,
1163
1181
  simplifyPluralSuffix: this.options.simplifyPluralSuffix
1164
- }), f && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (c.formatter = r(f), c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new Ge(this.options), c.utils = {
1182
+ }), h && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (c.formatter = n(h), c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new qe(this.options), c.utils = {
1165
1183
  hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1166
- }, c.backendConnector = new qe(r(this.modules.backend), c.resourceStore, c, this.options), c.backendConnector.on("*", function(m) {
1167
- for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), v = 1; v < g; v++)
1168
- p[v - 1] = arguments[v];
1169
- e.emit(m, ...p);
1170
- }), this.modules.languageDetector && (c.languageDetector = r(this.modules.languageDetector), c.languageDetector.init && c.languageDetector.init(c, this.options.detection, this.options)), this.modules.i18nFormat && (c.i18nFormat = r(this.modules.i18nFormat), c.i18nFormat.init && c.i18nFormat.init(this)), this.translator = new q(this.services, this.options), this.translator.on("*", function(m) {
1171
- for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), v = 1; v < g; v++)
1172
- p[v - 1] = arguments[v];
1173
- e.emit(m, ...p);
1174
- }), this.modules.external.forEach((m) => {
1175
- m.init && m.init(this);
1184
+ }, c.backendConnector = new st(n(this.modules.backend), c.resourceStore, c, this.options), c.backendConnector.on("*", function(p) {
1185
+ for (var g = arguments.length, m = new Array(g > 1 ? g - 1 : 0), v = 1; v < g; v++)
1186
+ m[v - 1] = arguments[v];
1187
+ e.emit(p, ...m);
1188
+ }), this.modules.languageDetector && (c.languageDetector = n(this.modules.languageDetector), c.languageDetector.init && c.languageDetector.init(c, this.options.detection, this.options)), this.modules.i18nFormat && (c.i18nFormat = n(this.modules.i18nFormat), c.i18nFormat.init && c.i18nFormat.init(this)), this.translator = new q(this.services, this.options), this.translator.on("*", function(p) {
1189
+ for (var g = arguments.length, m = new Array(g > 1 ? g - 1 : 0), v = 1; v < g; v++)
1190
+ m[v - 1] = arguments[v];
1191
+ e.emit(p, ...m);
1192
+ }), this.modules.external.forEach((p) => {
1193
+ p.init && p.init(this);
1176
1194
  });
1177
1195
  }
1178
1196
  if (this.format = this.options.interpolation.format, s || (s = W), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1179
- const f = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1180
- f.length > 0 && f[0] !== "dev" && (this.options.lng = f[0]);
1197
+ const h = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1198
+ h.length > 0 && h[0] !== "dev" && (this.options.lng = h[0]);
1181
1199
  }
1182
- !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((f) => {
1183
- this[f] = function() {
1184
- return e.store[f](...arguments);
1200
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((h) => {
1201
+ this[h] = function() {
1202
+ return e.store[h](...arguments);
1185
1203
  };
1186
- }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((f) => {
1187
- this[f] = function() {
1188
- return e.store[f](...arguments), e;
1204
+ }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((h) => {
1205
+ this[h] = function() {
1206
+ return e.store[h](...arguments), e;
1189
1207
  };
1190
1208
  });
1191
- const l = _(), u = () => {
1192
- const f = (h, c) => {
1193
- 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), l.resolve(c), s(h, c);
1209
+ const l = H(), u = () => {
1210
+ const h = (f, c) => {
1211
+ 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), l.resolve(c), s(f, c);
1194
1212
  };
1195
- if (this.languages && !this.isInitialized) return f(null, this.t.bind(this));
1196
- this.changeLanguage(this.options.lng, f);
1213
+ if (this.languages && !this.isInitialized) return h(null, this.t.bind(this));
1214
+ this.changeLanguage(this.options.lng, h);
1197
1215
  };
1198
1216
  return this.options.resources || !this.options.initAsync ? u() : setTimeout(u, 0), l;
1199
1217
  }
1200
1218
  loadResources(e) {
1201
- var r, n;
1219
+ var n, a;
1202
1220
  let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : W;
1203
1221
  const i = d(e) ? e : this.language;
1204
1222
  if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
1205
1223
  if ((i == null ? void 0 : i.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
1206
1224
  const o = [], l = (u) => {
1207
1225
  if (!u || u === "cimode") return;
1208
- this.services.languageUtils.toResolveHierarchy(u).forEach((h) => {
1209
- h !== "cimode" && o.indexOf(h) < 0 && o.push(h);
1226
+ this.services.languageUtils.toResolveHierarchy(u).forEach((f) => {
1227
+ f !== "cimode" && o.indexOf(f) < 0 && o.push(f);
1210
1228
  });
1211
1229
  };
1212
- i ? l(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((f) => l(f)), (n = (r = this.options.preload) == null ? void 0 : r.forEach) == null || n.call(r, (u) => l(u)), this.services.backendConnector.load(o, this.options.ns, (u) => {
1230
+ i ? l(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((h) => l(h)), (a = (n = this.options.preload) == null ? void 0 : n.forEach) == null || a.call(n, (u) => l(u)), this.services.backendConnector.load(o, this.options.ns, (u) => {
1213
1231
  !u && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(u);
1214
1232
  });
1215
1233
  } else
1216
1234
  s(null);
1217
1235
  }
1218
1236
  reloadResources(e, t, s) {
1219
- const i = _();
1220
- return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = W), this.services.backendConnector.reload(e, t, (r) => {
1221
- i.resolve(), s(r);
1237
+ const i = H();
1238
+ return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = W), this.services.backendConnector.reload(e, t, (n) => {
1239
+ i.resolve(), s(n);
1222
1240
  }), i;
1223
1241
  }
1224
1242
  use(e) {
1225
1243
  if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1226
1244
  if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1227
- 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" && Pe.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1245
+ return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && Ve.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1228
1246
  }
1229
1247
  setResolvedLanguage(e) {
1230
1248
  if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
@@ -1239,44 +1257,44 @@ class J extends ee {
1239
1257
  changeLanguage(e, t) {
1240
1258
  var s = this;
1241
1259
  this.isLanguageChangingTo = e;
1242
- const i = _();
1260
+ const i = H();
1243
1261
  this.emit("languageChanging", e);
1244
- const r = (l) => {
1262
+ const n = (l) => {
1245
1263
  this.language = l, this.languages = this.services.languageUtils.toResolveHierarchy(l), this.resolvedLanguage = void 0, this.setResolvedLanguage(l);
1246
- }, n = (l, u) => {
1247
- u ? (r(u), this.translator.changeLanguage(u), this.isLanguageChangingTo = void 0, this.emit("languageChanged", u), this.logger.log("languageChanged", u)) : this.isLanguageChangingTo = void 0, i.resolve(function() {
1264
+ }, a = (l, u) => {
1265
+ u ? (n(u), this.translator.changeLanguage(u), this.isLanguageChangingTo = void 0, this.emit("languageChanged", u), this.logger.log("languageChanged", u)) : this.isLanguageChangingTo = void 0, i.resolve(function() {
1248
1266
  return s.t(...arguments);
1249
1267
  }), t && t(l, function() {
1250
1268
  return s.t(...arguments);
1251
1269
  });
1252
1270
  }, o = (l) => {
1253
- var f, h;
1271
+ var h, f;
1254
1272
  !e && !l && this.services.languageDetector && (l = []);
1255
1273
  const u = d(l) ? l : this.services.languageUtils.getBestMatchFromCodes(l);
1256
- u && (this.language || r(u), this.translator.language || this.translator.changeLanguage(u), (h = (f = this.services.languageDetector) == null ? void 0 : f.cacheUserLanguage) == null || h.call(f, u)), this.loadResources(u, (c) => {
1257
- n(c, u);
1274
+ u && (this.language || n(u), this.translator.language || this.translator.changeLanguage(u), (f = (h = this.services.languageDetector) == null ? void 0 : h.cacheUserLanguage) == null || f.call(h, u)), this.loadResources(u, (c) => {
1275
+ a(c, u);
1258
1276
  });
1259
1277
  };
1260
1278
  return !e && this.services.languageDetector && !this.services.languageDetector.async ? o(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(o) : this.services.languageDetector.detect(o) : o(e), i;
1261
1279
  }
1262
1280
  getFixedT(e, t, s) {
1263
1281
  var i = this;
1264
- const r = function(n, o) {
1282
+ const n = function(a, o) {
1265
1283
  let l;
1266
1284
  if (typeof o != "object") {
1267
- for (var u = arguments.length, f = new Array(u > 2 ? u - 2 : 0), h = 2; h < u; h++)
1268
- f[h - 2] = arguments[h];
1269
- l = i.options.overloadTranslationOptionHandler([n, o].concat(f));
1285
+ for (var u = arguments.length, h = new Array(u > 2 ? u - 2 : 0), f = 2; f < u; f++)
1286
+ h[f - 2] = arguments[f];
1287
+ l = i.options.overloadTranslationOptionHandler([a, o].concat(h));
1270
1288
  } else
1271
1289
  l = {
1272
1290
  ...o
1273
1291
  };
1274
- l.lng = l.lng || r.lng, l.lngs = l.lngs || r.lngs, l.ns = l.ns || r.ns, l.keyPrefix !== "" && (l.keyPrefix = l.keyPrefix || s || r.keyPrefix);
1292
+ l.lng = l.lng || n.lng, l.lngs = l.lngs || n.lngs, l.ns = l.ns || n.ns, l.keyPrefix !== "" && (l.keyPrefix = l.keyPrefix || s || n.keyPrefix);
1275
1293
  const c = i.options.keySeparator || ".";
1276
- let m;
1277
- return l.keyPrefix && Array.isArray(n) ? m = n.map((g) => `${l.keyPrefix}${c}${g}`) : m = l.keyPrefix ? `${l.keyPrefix}${c}${n}` : n, i.t(m, l);
1294
+ let p;
1295
+ return l.keyPrefix && Array.isArray(a) ? p = a.map((g) => `${l.keyPrefix}${c}${g}`) : p = l.keyPrefix ? `${l.keyPrefix}${c}${a}` : a, i.t(p, l);
1278
1296
  };
1279
- return d(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = s, r;
1297
+ return d(e) ? n.lng = e : n.lngs = e, n.ns = t, n.keyPrefix = s, n;
1280
1298
  }
1281
1299
  t() {
1282
1300
  var i;
@@ -1299,20 +1317,20 @@ class J extends ee {
1299
1317
  return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1300
1318
  if (!this.languages || !this.languages.length)
1301
1319
  return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1302
- const s = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, r = this.languages[this.languages.length - 1];
1320
+ const s = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, n = this.languages[this.languages.length - 1];
1303
1321
  if (s.toLowerCase() === "cimode") return !0;
1304
- const n = (o, l) => {
1322
+ const a = (o, l) => {
1305
1323
  const u = this.services.backendConnector.state[`${o}|${l}`];
1306
1324
  return u === -1 || u === 0 || u === 2;
1307
1325
  };
1308
1326
  if (t.precheck) {
1309
- const o = t.precheck(this, n);
1327
+ const o = t.precheck(this, a);
1310
1328
  if (o !== void 0) return o;
1311
1329
  }
1312
- return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || n(s, e) && (!i || n(r, e)));
1330
+ return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(s, e) && (!i || a(n, e)));
1313
1331
  }
1314
1332
  loadNamespaces(e, t) {
1315
- const s = _();
1333
+ const s = H();
1316
1334
  return this.options.ns ? (d(e) && (e = [e]), e.forEach((i) => {
1317
1335
  this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
1318
1336
  }), this.loadResources((i) => {
@@ -1320,22 +1338,22 @@ class J extends ee {
1320
1338
  }), s) : (t && t(), Promise.resolve());
1321
1339
  }
1322
1340
  loadLanguages(e, t) {
1323
- const s = _();
1341
+ const s = H();
1324
1342
  d(e) && (e = [e]);
1325
- const i = this.options.preload || [], r = e.filter((n) => i.indexOf(n) < 0 && this.services.languageUtils.isSupportedCode(n));
1326
- return r.length ? (this.options.preload = i.concat(r), this.loadResources((n) => {
1327
- s.resolve(), t && t(n);
1343
+ const i = this.options.preload || [], n = e.filter((a) => i.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
1344
+ return n.length ? (this.options.preload = i.concat(n), this.loadResources((a) => {
1345
+ s.resolve(), t && t(a);
1328
1346
  }), s) : (t && t(), Promise.resolve());
1329
1347
  }
1330
1348
  dir(e) {
1331
- var i, r;
1349
+ var i, n;
1332
1350
  if (e || (e = this.resolvedLanguage || (((i = this.languages) == null ? void 0 : i.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
1333
- const t = ["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"], s = ((r = this.services) == null ? void 0 : r.languageUtils) || new ye(Oe());
1351
+ const t = ["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"], s = ((n = this.services) == null ? void 0 : n.languageUtils) || new Se($e());
1334
1352
  return t.indexOf(s.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1335
1353
  }
1336
1354
  static createInstance() {
1337
1355
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1338
- return new J(e, t);
1356
+ return new B(e, t);
1339
1357
  }
1340
1358
  cloneInstance() {
1341
1359
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : W;
@@ -1345,28 +1363,28 @@ class J extends ee {
1345
1363
  ...this.options,
1346
1364
  ...e,
1347
1365
  isClone: !0
1348
- }, r = new J(i);
1349
- if ((e.debug !== void 0 || e.prefix !== void 0) && (r.logger = r.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
1350
- r[o] = this[o];
1351
- }), r.services = {
1366
+ }, n = new B(i);
1367
+ if ((e.debug !== void 0 || e.prefix !== void 0) && (n.logger = n.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
1368
+ n[o] = this[o];
1369
+ }), n.services = {
1352
1370
  ...this.services
1353
- }, r.services.utils = {
1354
- hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
1371
+ }, n.services.utils = {
1372
+ hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
1355
1373
  }, s) {
1356
1374
  const o = Object.keys(this.store.data).reduce((l, u) => (l[u] = {
1357
1375
  ...this.store.data[u]
1358
- }, Object.keys(l[u]).reduce((f, h) => (f[h] = {
1359
- ...l[u][h]
1360
- }, f), {})), {});
1361
- r.store = new me(o, i), r.services.resourceStore = r.store;
1376
+ }, Object.keys(l[u]).reduce((h, f) => (h[f] = {
1377
+ ...l[u][f]
1378
+ }, h), {})), {});
1379
+ n.store = new ye(o, i), n.services.resourceStore = n.store;
1362
1380
  }
1363
- return r.translator = new q(r.services, i), r.translator.on("*", function(o) {
1364
- for (var l = arguments.length, u = new Array(l > 1 ? l - 1 : 0), f = 1; f < l; f++)
1365
- u[f - 1] = arguments[f];
1366
- r.emit(o, ...u);
1367
- }), r.init(i, t), r.translator.options = i, r.translator.backendConnector.services.utils = {
1368
- hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
1369
- }, r;
1381
+ return n.translator = new q(n.services, i), n.translator.on("*", function(o) {
1382
+ for (var l = arguments.length, u = new Array(l > 1 ? l - 1 : 0), h = 1; h < l; h++)
1383
+ u[h - 1] = arguments[h];
1384
+ n.emit(o, ...u);
1385
+ }), n.init(i, t), n.translator.options = i, n.translator.backendConnector.services.utils = {
1386
+ hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
1387
+ }, n;
1370
1388
  }
1371
1389
  toJSON() {
1372
1390
  return {
@@ -1378,77 +1396,77 @@ class J extends ee {
1378
1396
  };
1379
1397
  }
1380
1398
  }
1381
- const b = J.createInstance();
1382
- b.createInstance = J.createInstance;
1383
- b.createInstance;
1384
- b.dir;
1385
- b.init;
1386
- b.loadResources;
1387
- b.reloadResources;
1388
- b.use;
1389
- b.changeLanguage;
1390
- b.getFixedT;
1391
- b.t;
1392
- b.exists;
1393
- b.setDefaultNamespace;
1394
- b.hasLoadedNamespace;
1395
- b.loadNamespaces;
1396
- b.loadLanguages;
1397
- var tt = (a, e) => typeof e == "bigint" ? e.toString() : e;
1398
- function se(a, e = " | ") {
1399
- return a.map((t) => typeof t == "string" ? `'${t}'` : t).join(e);
1399
+ const S = B.createInstance();
1400
+ S.createInstance = B.createInstance;
1401
+ S.createInstance;
1402
+ S.dir;
1403
+ S.init;
1404
+ S.loadResources;
1405
+ S.reloadResources;
1406
+ S.use;
1407
+ S.changeLanguage;
1408
+ S.getFixedT;
1409
+ S.t;
1410
+ S.exists;
1411
+ S.setDefaultNamespace;
1412
+ S.hasLoadedNamespace;
1413
+ S.loadNamespaces;
1414
+ S.loadLanguages;
1415
+ var rt = (r, e) => typeof e == "bigint" ? e.toString() : e;
1416
+ function te(r, e = " | ") {
1417
+ return r.map((t) => typeof t == "string" ? `'${t}'` : t).join(e);
1400
1418
  }
1401
- var Ce = (a) => {
1402
- if (typeof a != "object" || a === null)
1419
+ var Pe = (r) => {
1420
+ if (typeof r != "object" || r === null)
1403
1421
  return !1;
1404
- for (const e in a)
1405
- if (!Object.prototype.hasOwnProperty.call(a, e))
1422
+ for (const e in r)
1423
+ if (!Object.prototype.hasOwnProperty.call(r, e))
1406
1424
  return !1;
1407
1425
  return !0;
1408
- }, st = (a, e) => {
1409
- if (typeof a == "string")
1410
- return { key: a, values: {} };
1411
- if (Ce(a)) {
1412
- const t = "key" in a && typeof a.key == "string" ? a.key : e, s = "values" in a && Ce(a.values) ? a.values : {};
1426
+ }, nt = (r, e) => {
1427
+ if (typeof r == "string")
1428
+ return { key: r, values: {} };
1429
+ if (Pe(r)) {
1430
+ const t = "key" in r && typeof r.key == "string" ? r.key : e, s = "values" in r && Pe(r.values) ? r.values : {};
1413
1431
  return { key: t, values: s };
1414
1432
  }
1415
1433
  return { key: e, values: {} };
1416
- }, we = "zod", it = (a) => (e, t) => {
1434
+ }, Re = "zod", at = (r) => (e, t) => {
1417
1435
  var l;
1418
- const { t: s, ns: i, handlePath: r } = {
1419
- t: b.t,
1420
- ns: we,
1421
- ...a,
1422
- handlePath: (a == null ? void 0 : a.handlePath) !== !1 ? {
1436
+ const { t: s, ns: i, handlePath: n } = {
1437
+ t: S.t,
1438
+ ns: Re,
1439
+ ...r,
1440
+ handlePath: (r == null ? void 0 : r.handlePath) !== !1 ? {
1423
1441
  context: "with_path",
1424
- ns: (a == null ? void 0 : a.ns) ?? we,
1442
+ ns: (r == null ? void 0 : r.ns) ?? Re,
1425
1443
  keyPrefix: void 0,
1426
- ...a == null ? void 0 : a.handlePath
1444
+ ...r == null ? void 0 : r.handlePath
1427
1445
  } : null
1428
1446
  };
1429
- let n;
1430
- n = je(e, t).message;
1431
- const o = e.path.length > 0 && r ? {
1432
- context: r.context,
1447
+ let a;
1448
+ a = Ae(e, t).message;
1449
+ const o = e.path.length > 0 && n ? {
1450
+ context: n.context,
1433
1451
  path: s(
1434
- [r.keyPrefix, e.path.join(".")].filter(Boolean).join("."),
1452
+ [n.keyPrefix, e.path.join(".")].filter(Boolean).join("."),
1435
1453
  {
1436
- ns: r.ns,
1454
+ ns: n.ns,
1437
1455
  defaultValue: e.path.join(".")
1438
1456
  }
1439
1457
  )
1440
1458
  } : {};
1441
1459
  switch (e.code) {
1442
- case S.invalid_type:
1443
- e.received === fe.undefined ? n = s("errors.invalid_type_received_undefined", {
1460
+ case O.invalid_type:
1461
+ e.received === de.undefined ? a = s("errors.invalid_type_received_undefined", {
1444
1462
  ns: i,
1445
- defaultValue: n,
1463
+ defaultValue: a,
1446
1464
  ...o
1447
- }) : e.received === fe.null ? n = s("errors.invalid_type_received_null", {
1465
+ }) : e.received === de.null ? a = s("errors.invalid_type_received_null", {
1448
1466
  ns: i,
1449
- defaultValue: n,
1467
+ defaultValue: a,
1450
1468
  ...o
1451
- }) : n = s("errors.invalid_type", {
1469
+ }) : a = s("errors.invalid_type", {
1452
1470
  expected: s(`types.${e.expected}`, {
1453
1471
  defaultValue: e.expected,
1454
1472
  ns: i
@@ -1458,353 +1476,343 @@ var Ce = (a) => {
1458
1476
  ns: i
1459
1477
  }),
1460
1478
  ns: i,
1461
- defaultValue: n,
1479
+ defaultValue: a,
1462
1480
  ...o
1463
1481
  });
1464
1482
  break;
1465
- case S.invalid_literal:
1466
- n = s("errors.invalid_literal", {
1467
- expected: JSON.stringify(e.expected, tt),
1483
+ case O.invalid_literal:
1484
+ a = s("errors.invalid_literal", {
1485
+ expected: JSON.stringify(e.expected, rt),
1468
1486
  ns: i,
1469
- defaultValue: n,
1487
+ defaultValue: a,
1470
1488
  ...o
1471
1489
  });
1472
1490
  break;
1473
- case S.unrecognized_keys:
1474
- n = s("errors.unrecognized_keys", {
1475
- keys: se(e.keys, ", "),
1491
+ case O.unrecognized_keys:
1492
+ a = s("errors.unrecognized_keys", {
1493
+ keys: te(e.keys, ", "),
1476
1494
  count: e.keys.length,
1477
1495
  ns: i,
1478
- defaultValue: n,
1496
+ defaultValue: a,
1479
1497
  ...o
1480
1498
  });
1481
1499
  break;
1482
- case S.invalid_union:
1483
- n = s("errors.invalid_union", {
1500
+ case O.invalid_union:
1501
+ a = s("errors.invalid_union", {
1484
1502
  ns: i,
1485
- defaultValue: n,
1503
+ defaultValue: a,
1486
1504
  ...o
1487
1505
  });
1488
1506
  break;
1489
- case S.invalid_union_discriminator:
1490
- n = s("errors.invalid_union_discriminator", {
1491
- options: se(e.options),
1507
+ case O.invalid_union_discriminator:
1508
+ a = s("errors.invalid_union_discriminator", {
1509
+ options: te(e.options),
1492
1510
  ns: i,
1493
- defaultValue: n,
1511
+ defaultValue: a,
1494
1512
  ...o
1495
1513
  });
1496
1514
  break;
1497
- case S.invalid_enum_value:
1498
- n = s("errors.invalid_enum_value", {
1499
- options: se(e.options),
1515
+ case O.invalid_enum_value:
1516
+ a = s("errors.invalid_enum_value", {
1517
+ options: te(e.options),
1500
1518
  received: e.received,
1501
1519
  ns: i,
1502
- defaultValue: n,
1520
+ defaultValue: a,
1503
1521
  ...o
1504
1522
  });
1505
1523
  break;
1506
- case S.invalid_arguments:
1507
- n = s("errors.invalid_arguments", {
1524
+ case O.invalid_arguments:
1525
+ a = s("errors.invalid_arguments", {
1508
1526
  ns: i,
1509
- defaultValue: n,
1527
+ defaultValue: a,
1510
1528
  ...o
1511
1529
  });
1512
1530
  break;
1513
- case S.invalid_return_type:
1514
- n = s("errors.invalid_return_type", {
1531
+ case O.invalid_return_type:
1532
+ a = s("errors.invalid_return_type", {
1515
1533
  ns: i,
1516
- defaultValue: n,
1534
+ defaultValue: a,
1517
1535
  ...o
1518
1536
  });
1519
1537
  break;
1520
- case S.invalid_date:
1521
- n = s("errors.invalid_date", {
1538
+ case O.invalid_date:
1539
+ a = s("errors.invalid_date", {
1522
1540
  ns: i,
1523
- defaultValue: n,
1541
+ defaultValue: a,
1524
1542
  ...o
1525
1543
  });
1526
1544
  break;
1527
- case S.invalid_string:
1528
- typeof e.validation == "object" ? "startsWith" in e.validation ? n = s("errors.invalid_string.startsWith", {
1545
+ case O.invalid_string:
1546
+ typeof e.validation == "object" ? "startsWith" in e.validation ? a = s("errors.invalid_string.startsWith", {
1529
1547
  startsWith: e.validation.startsWith,
1530
1548
  ns: i,
1531
- defaultValue: n,
1549
+ defaultValue: a,
1532
1550
  ...o
1533
- }) : "endsWith" in e.validation && (n = s("errors.invalid_string.endsWith", {
1551
+ }) : "endsWith" in e.validation && (a = s("errors.invalid_string.endsWith", {
1534
1552
  endsWith: e.validation.endsWith,
1535
1553
  ns: i,
1536
- defaultValue: n,
1554
+ defaultValue: a,
1537
1555
  ...o
1538
- })) : n = s(`errors.invalid_string.${e.validation}`, {
1556
+ })) : a = s(`errors.invalid_string.${e.validation}`, {
1539
1557
  validation: s(`validations.${e.validation}`, {
1540
1558
  defaultValue: e.validation,
1541
1559
  ns: i
1542
1560
  }),
1543
1561
  ns: i,
1544
- defaultValue: n,
1562
+ defaultValue: a,
1545
1563
  ...o
1546
1564
  });
1547
1565
  break;
1548
- case S.too_small:
1566
+ case O.too_small:
1549
1567
  const u = e.type === "date" ? new Date(e.minimum) : e.minimum;
1550
- n = s(
1568
+ a = s(
1551
1569
  `errors.too_small.${e.type}.${e.exact ? "exact" : e.inclusive ? "inclusive" : "not_inclusive"}`,
1552
1570
  {
1553
1571
  minimum: u,
1554
1572
  count: typeof u == "number" ? u : void 0,
1555
1573
  ns: i,
1556
- defaultValue: n,
1574
+ defaultValue: a,
1557
1575
  ...o
1558
1576
  }
1559
1577
  );
1560
1578
  break;
1561
- case S.too_big:
1562
- const f = e.type === "date" ? new Date(e.maximum) : e.maximum;
1563
- n = s(
1579
+ case O.too_big:
1580
+ const h = e.type === "date" ? new Date(e.maximum) : e.maximum;
1581
+ a = s(
1564
1582
  `errors.too_big.${e.type}.${e.exact ? "exact" : e.inclusive ? "inclusive" : "not_inclusive"}`,
1565
1583
  {
1566
- maximum: f,
1567
- count: typeof f == "number" ? f : void 0,
1584
+ maximum: h,
1585
+ count: typeof h == "number" ? h : void 0,
1568
1586
  ns: i,
1569
- defaultValue: n,
1587
+ defaultValue: a,
1570
1588
  ...o
1571
1589
  }
1572
1590
  );
1573
1591
  break;
1574
- case S.custom:
1575
- const { key: h, values: c } = st(
1592
+ case O.custom:
1593
+ const { key: f, values: c } = nt(
1576
1594
  (l = e.params) == null ? void 0 : l.i18n,
1577
1595
  "errors.custom"
1578
1596
  );
1579
- n = s(h, {
1597
+ a = s(f, {
1580
1598
  ...c,
1581
1599
  ns: i,
1582
- defaultValue: n,
1600
+ defaultValue: a,
1583
1601
  ...o
1584
1602
  });
1585
1603
  break;
1586
- case S.invalid_intersection_types:
1587
- n = s("errors.invalid_intersection_types", {
1604
+ case O.invalid_intersection_types:
1605
+ a = s("errors.invalid_intersection_types", {
1588
1606
  ns: i,
1589
- defaultValue: n,
1607
+ defaultValue: a,
1590
1608
  ...o
1591
1609
  });
1592
1610
  break;
1593
- case S.not_multiple_of:
1594
- n = s("errors.not_multiple_of", {
1611
+ case O.not_multiple_of:
1612
+ a = s("errors.not_multiple_of", {
1595
1613
  multipleOf: e.multipleOf,
1596
1614
  ns: i,
1597
- defaultValue: n,
1615
+ defaultValue: a,
1598
1616
  ...o
1599
1617
  });
1600
1618
  break;
1601
- case S.not_finite:
1602
- n = s("errors.not_finite", {
1619
+ case O.not_finite:
1620
+ a = s("errors.not_finite", {
1603
1621
  ns: i,
1604
- defaultValue: n,
1622
+ defaultValue: a,
1605
1623
  ...o
1606
1624
  });
1607
1625
  break;
1608
1626
  }
1609
- return { message: n };
1627
+ return { message: a };
1610
1628
  };
1611
- const ae = Ie(), rt = De({
1612
- locale: ae,
1613
- messages: Re
1629
+ const le = Te(), ot = Ke({
1630
+ locale: le,
1631
+ messages: ke
1614
1632
  });
1615
- console.info("Current locale:", ae);
1616
- b.init({
1617
- lng: ae,
1618
- resources: Re
1633
+ console.info("Current locale:", le);
1634
+ S.init({
1635
+ lng: le,
1636
+ resources: ke
1619
1637
  });
1620
- Fe.setErrorMap(it({ ns: ["connectZod", "connectZodCustom"] }));
1621
- const ne = rt;
1622
- function $(a) {
1623
- return B(
1624
- "div",
1625
- {
1626
- class: `${a.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
1627
- },
1628
- [
1629
- B(ie.FmIcon, { size: "sm", name: a.icon, outline: !0 }),
1630
- B("span", { class: "fm-typo-en-body-md-600" }, a.name)
1631
- ]
1632
- );
1638
+ De.setErrorMap(at({ ns: ["connectZod", "connectZodCustom"] }));
1639
+ const D = ot;
1640
+ var b = [];
1641
+ for (var se = 0; se < 256; ++se)
1642
+ b.push((se + 256).toString(16).slice(1));
1643
+ function lt(r, e = 0) {
1644
+ return (b[r[e + 0]] + b[r[e + 1]] + b[r[e + 2]] + b[r[e + 3]] + "-" + b[r[e + 4]] + b[r[e + 5]] + "-" + b[r[e + 6]] + b[r[e + 7]] + "-" + b[r[e + 8]] + b[r[e + 9]] + "-" + b[r[e + 10]] + b[r[e + 11]] + b[r[e + 12]] + b[r[e + 13]] + b[r[e + 14]] + b[r[e + 15]]).toLowerCase();
1633
1645
  }
1634
- const bt = {
1635
- [R.enum.CREDIT]: {
1636
- chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
1637
- icon: "local_activity",
1638
- name: "Credit",
1639
- chip() {
1640
- return $(this);
1641
- }
1646
+ var _, ut = new Uint8Array(16);
1647
+ function ct() {
1648
+ if (!_ && (_ = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !_))
1649
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1650
+ return _(ut);
1651
+ }
1652
+ var ie, Z, re = 0, ne = 0;
1653
+ function ht(r, e, t) {
1654
+ var s = e && t || 0, i = e || new Array(16);
1655
+ r = r || {};
1656
+ var n = r.node, a = r.clockseq;
1657
+ if (r._v6 || (n || (n = ie), a == null && (a = Z)), n == null || a == null) {
1658
+ var o = r.random || (r.rng || ct)();
1659
+ n == null && (n = [o[0], o[1], o[2], o[3], o[4], o[5]], !ie && !r._v6 && (n[0] |= 1, ie = n)), a == null && (a = (o[6] << 8 | o[7]) & 16383, Z === void 0 && !r._v6 && (Z = a));
1660
+ }
1661
+ var l = r.msecs !== void 0 ? r.msecs : Date.now(), u = r.nsecs !== void 0 ? r.nsecs : ne + 1, h = l - re + (u - ne) / 1e4;
1662
+ if (h < 0 && r.clockseq === void 0 && (a = a + 1 & 16383), (h < 0 || l > re) && r.nsecs === void 0 && (u = 0), u >= 1e4)
1663
+ throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
1664
+ re = l, ne = u, Z = a, l += 122192928e5;
1665
+ var f = ((l & 268435455) * 1e4 + u) % 4294967296;
1666
+ i[s++] = f >>> 24 & 255, i[s++] = f >>> 16 & 255, i[s++] = f >>> 8 & 255, i[s++] = f & 255;
1667
+ var c = l / 4294967296 * 1e4 & 268435455;
1668
+ i[s++] = c >>> 8 & 255, i[s++] = c & 255, i[s++] = c >>> 24 & 15 | 16, i[s++] = c >>> 16 & 255, i[s++] = a >>> 8 | 128, i[s++] = a & 255;
1669
+ for (var p = 0; p < 6; ++p)
1670
+ i[s + p] = n[p];
1671
+ return e || lt(i);
1672
+ }
1673
+ async function St(r, e) {
1674
+ await new Promise((t) => {
1675
+ const s = document.createElement("input");
1676
+ s.value = r, document.body.appendChild(s), s.select(), document.execCommand("copy"), document.body.removeChild(s), t("");
1677
+ }).then(() => {
1678
+ var t;
1679
+ (t = oe().snackbar) == null || t.open({
1680
+ message: (e == null ? void 0 : e.successMessage) || "Copied to clipboard",
1681
+ type: "success",
1682
+ dismissable: !0
1683
+ });
1684
+ });
1685
+ }
1686
+ const Ot = {
1687
+ fileExtension(r) {
1688
+ return (r == null ? void 0 : r.type.replace(/video\/|image\//, "")) || void 0;
1642
1689
  },
1643
- [R.enum.PROMOTION]: {
1644
- chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
1645
- icon: "loyalty",
1646
- name: "Promotion",
1647
- chip() {
1648
- return $(this);
1649
- }
1690
+ generateId(r) {
1691
+ return [ht(), this.fileExtension(r)].filter(Boolean).join(".");
1650
1692
  },
1651
- [R.enum.VOUCHER]: {
1652
- chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
1653
- icon: "sell",
1654
- name: ne.global.t("connect.campaign.voucher.title"),
1655
- chip() {
1656
- return $(this);
1657
- }
1693
+ campaignPath(r) {
1694
+ return `business/${k.getBusinessId()}/campaigns/${r || this.generateId()}`;
1658
1695
  },
1659
- [R.enum.POINT]: {
1660
- chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
1661
- icon: "award_star",
1662
- name: "Experience",
1663
- chip() {
1664
- return $(this);
1665
- }
1696
+ coverImagePath() {
1697
+ return `business/${k.getBusinessId()}/membership/design/image.png`;
1666
1698
  },
1667
- [R.enum.BROADCAST]: {
1668
- chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
1669
- icon: "campaign",
1670
- name: "Broadcast",
1671
- chip() {
1672
- return $(this);
1673
- }
1699
+ advertisementPath(r, e) {
1700
+ return `business/${k.getBusinessId()}/membership/advertisement/${r}.${this.fileExtension(e)}`;
1674
1701
  },
1675
- [R.enum.GAME]: {
1676
- chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
1677
- icon: "database",
1678
- name: "Token",
1679
- chip() {
1680
- return $(this);
1681
- }
1702
+ designPath(r, e) {
1703
+ return `business/${k.getBusinessId()}/membership/design/${r}.${this.fileExtension(e)}`;
1682
1704
  },
1683
- [R.enum.REWARD_POOL]: {
1684
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
1685
- icon: "editor_choice",
1686
- name: "Reward Pool",
1687
- chip() {
1688
- return $(this);
1689
- }
1705
+ bundleImagePath(r, e) {
1706
+ return `business/${k.getBusinessId()}/membership/bundles/${r || this.generateId(e)}`;
1690
1707
  },
1691
- [R.enum.COIN]: {
1692
- chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
1693
- icon: "monetization_on",
1694
- name: "Point",
1695
- chip() {
1696
- return $(this);
1697
- }
1708
+ collectibleImagePath(r, e) {
1709
+ return `business/${k.getBusinessId()}/membership/collectibles/${r || this.generateId(e)}`;
1698
1710
  },
1699
- [R.enum.MEMBERSHIP]: {
1700
- chipClass: "",
1701
- icon: "",
1702
- name: "Membership",
1703
- chip() {
1704
- return $(this);
1705
- }
1711
+ tierImagePath(r, e) {
1712
+ return `business/${k.getBusinessId()}/membership/tiers/${r || this.generateId(e)}`;
1706
1713
  },
1707
- // TODO: confirm color
1708
- [R.enum.MISSION]: {
1709
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
1710
- icon: "editor_choice",
1711
- name: "Mission",
1712
- chip() {
1713
- return $(this);
1714
- }
1714
+ referralTermAndConditionPath() {
1715
+ return `business/${k.getBusinessId()}/membership/referral/term_and_condition.pdf`;
1716
+ },
1717
+ async update(r, e, t) {
1718
+ const s = fe(void 0, t), i = ge(s, r);
1719
+ return await Ee(i, e), Ie(i);
1720
+ },
1721
+ async delete(r, e) {
1722
+ const t = fe(void 0, e), s = ge(t, r);
1723
+ await Fe(s);
1715
1724
  }
1716
- };
1717
- function St(a) {
1718
- const e = nt(a), t = {
1719
- active: "text-fm-color-typo-success bg-fm-color-system-success-100",
1720
- upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
1721
- expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
1722
- };
1723
- return a.type == "VOUCHER" ? B(ie.FmChip, {
1724
- class: t[e],
1725
- label: ce.title(ne.global.t(`connect.campaign.common.status.${e}`)),
1726
- compact: !0
1727
- }) : B(ie.FmChip, {
1728
- class: t[e],
1729
- label: ce.title(ne.global.t(`connect.campaign.common.status.${e}`)),
1730
- compact: !0
1731
- });
1732
- }
1733
- function Ot(a) {
1734
- const { campaign: e } = a;
1735
- function t(s) {
1736
- if (!s || !s.start && !s.end)
1737
- return "connect.campaign.common.always";
1738
- const i = s.start ? F(s.start).format("DD MMM YYYY") : "From campaign creation", r = s.end ? F(s.end).format("DD MMM YYYY") : "Never ends";
1739
- return `${i} - ${r}`;
1725
+ }, Lt = {
1726
+ get dialog() {
1727
+ return oe().dialog;
1728
+ },
1729
+ confirm(r, e = D.global.t("connect.common.confirm"), t = D.global.t("connect.common.confirm"), s = D.global.t("connect.common.cancel")) {
1730
+ return new Promise((i) => {
1731
+ var n;
1732
+ (n = this.dialog) == null || n.open({
1733
+ title: e,
1734
+ message: r,
1735
+ closeButton: !0,
1736
+ overlay: !0,
1737
+ primaryActions: {
1738
+ close: !0,
1739
+ text: t
1740
+ },
1741
+ secondaryActions: {
1742
+ variant: "tertiary",
1743
+ close: !0,
1744
+ text: s
1745
+ }
1746
+ }).onPrimary(() => {
1747
+ i(!0);
1748
+ }).onSecondary(() => {
1749
+ i(!1);
1750
+ }).onClose(() => {
1751
+ i(!1);
1752
+ });
1753
+ });
1754
+ },
1755
+ remove(r, e = D.global.t("connect.common.remove"), t = D.global.t("connect.common.remove"), s = D.global.t("connect.common.cancel")) {
1756
+ return new Promise((i) => {
1757
+ var n;
1758
+ (n = this.dialog) == null || n.open({
1759
+ title: e,
1760
+ message: r,
1761
+ closeButton: !0,
1762
+ overlay: !0,
1763
+ primaryActions: {
1764
+ close: !0,
1765
+ variant: "destructive",
1766
+ text: t
1767
+ },
1768
+ secondaryActions: {
1769
+ variant: "tertiary",
1770
+ close: !0,
1771
+ text: s
1772
+ }
1773
+ }).onPrimary(() => {
1774
+ i(!0);
1775
+ }).onClose(() => {
1776
+ i(!1);
1777
+ });
1778
+ });
1740
1779
  }
1741
- return {
1742
- "connect.campaign.common.campaign_name": e.name,
1743
- "connect.campaign.common.campaign_period": t(e.timeframeOptions),
1744
- get "connect.campaign.common.next_schedule_at"() {
1745
- if (e.event.type != "SCHEDULE" || !e.event.rule || !Ne(e.event.rule))
1746
- return;
1747
- const s = Ee(
1748
- e.event.rule.rules.g_schedule
1749
- );
1750
- return s ? F(s).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
1751
- },
1752
- get "connect.campaign.common.discount_type"() {
1753
- if (e.type == "PROMOTION") return G(e.effect);
1754
- if ("configs" in a && a.configs.type == "VOUCHER")
1755
- return G(a.configs.extras.effect);
1756
- },
1757
- get "connect.campaign.common.available_at"() {
1758
- return e.targetLocation ? e.targetLocation.length > 0 ? e.targetLocation.map(
1759
- (s) => Ve().locationItems.find((i) => i.value == s).label
1760
- ).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
1761
- }
1762
- };
1763
- }
1764
- function nt(a) {
1765
- return a.timeframeOptions && a.timeframeOptions.type == "timeframe" ? F().isBetween(
1766
- a.timeframeOptions.start ?? F().subtract(1, "d"),
1767
- a.timeframeOptions.end ?? F().add(1, "d")
1768
- ) ? "active" : F().isAfter(a.timeframeOptions.end) ? "expired" : "upcoming" : "active";
1769
- }
1770
- function Lt(a) {
1771
- var e, t;
1772
- switch (a.event.type) {
1773
- case "BILL_COMPLETED":
1774
- const s = `Spend to get ${j.formattedType(a.type)}`;
1775
- switch (a.type) {
1776
- case "POINT":
1777
- case "CREDIT":
1778
- case "COIN":
1779
- return a.earningOption.type == "FIXED" ? `Spend to get ${a.earningOption.amount} ${j.formattedType(a.type)}` : `Every ${a.earningOption.every} amount spent get ${a.earningOption.amount} ${j.formattedType(a.type)}`;
1780
- case "VOUCHER":
1781
- const i = (t = (e = a == null ? void 0 : a.pf_collectible) == null ? void 0 : e.extras) == null ? void 0 : t.effect;
1782
- return i ? `${s} - ${G(i)}` : s;
1783
- default:
1784
- return s;
1785
- }
1786
- case "FEEDBACK":
1787
- return `Give feedback to receive ${j.formattedType(a.type)}`;
1788
- case "SCHEDULE":
1789
- return `Receive ${j.formattedType(a.type)} on scheduled time`;
1790
- case "SIMPLE_CLAIM":
1791
- return "Simple claim voucher";
1792
- case "TIER_UPGRADED":
1793
- return `Receive ${j.formattedType(a.type)} when member tier upgraded`;
1794
- case "MEMBERSHIP_JOINED":
1795
- return `Receive ${j.formattedType(a.type)} when member joined`;
1796
- case "MAKING_ORDER":
1797
- return a.type !== "PROMOTION" ? void 0 : G(a.effect);
1798
- default:
1799
- throw new Error(
1800
- `Not implemented ${JSON.stringify({ cause: a.event.type })}`
1801
- );
1780
+ }, wt = {
1781
+ get snackbar() {
1782
+ return oe().snackbar;
1783
+ },
1784
+ success(r, e = 2e3) {
1785
+ var t;
1786
+ return (t = this.snackbar) == null ? void 0 : t.open({ message: r, type: "success" }, e);
1787
+ },
1788
+ error(r, e = 2e3) {
1789
+ var t;
1790
+ return (t = this.snackbar) == null ? void 0 : t.open({ message: r, type: "error" }, e);
1791
+ },
1792
+ info(r, e = 2e3, t = !1) {
1793
+ var s;
1794
+ return (s = this.snackbar) == null ? void 0 : s.open(
1795
+ {
1796
+ message: r,
1797
+ type: "info",
1798
+ dismissable: e !== null,
1799
+ spinner: t
1800
+ },
1801
+ e
1802
+ );
1803
+ },
1804
+ close(r) {
1805
+ var e;
1806
+ return (e = this.snackbar) == null ? void 0 : e.close(r);
1802
1807
  }
1803
- }
1808
+ };
1804
1809
  export {
1805
- bt as C,
1806
1810
  St as a,
1807
- Lt as b,
1808
- Ot as c,
1809
- nt as g
1811
+ yt as b,
1812
+ bt as c,
1813
+ Ot as f,
1814
+ D as i,
1815
+ wt as n,
1816
+ Lt as p,
1817
+ xt as r
1810
1818
  };