@feedmepos/mf-connect 0.1.38-beta.45 → 0.1.38-beta.46
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.
- package/dist/{Analytic-DzRxGF_t.js → Analytic-BGKCj1jr.js} +13 -13
- package/dist/{App-CAiDN8rO.js → App-Rjzbi736.js} +7 -7
- package/dist/{AuditLogs-BLSbQEeM.js → AuditLogs-Dip8piV3.js} +9 -9
- package/dist/{Bin-CCnoA4p4.js → Bin-DOvnUMsH.js} +8 -8
- package/dist/{Broadcast-BrRAGwcE.js → Broadcast-xcZBuHpL.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DjUo28QL.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dizv5GP_.js} +6 -6
- package/dist/{Card-BKXk-LPv.js → Card-CKjNEigS.js} +18 -18
- package/dist/{Collections-Ckw1cc6Y.js → Collections-x5ofCSJN.js} +74 -73
- package/dist/{Credit-r6s5xB1Z.js → Credit-BWBu_w2L.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B3o3_9OC.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBoP1Jwt.js} +209 -206
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-YjvIstf7.js +348 -0
- package/dist/{Experience-B-QsgzRX.js → Experience-pkdcwDSi.js} +8 -8
- package/dist/{Game-BTAp2PUX.js → Game-Dna43QZe.js} +9 -9
- package/dist/{Grab-2grgKCgD.js → Grab-C9Z_Zfe8.js} +8 -8
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js → ImageInput.vue_vue_type_script_setup_true_lang-DElYlMlB.js} +44 -43
- package/dist/{Index-Crzd6V_e.js → Index-DRIWf1NE.js} +10 -10
- package/dist/{Marketing-72znTAbJ.js → Marketing-usRTwLLw.js} +7 -7
- package/dist/{Member-DcavBmkw.js → Member-B70QVgJa.js} +10 -10
- package/dist/{MemberList-L-sgN6nP.js → MemberList-JI4mBPfA.js} +25 -25
- package/dist/{MemberTransactions-Bx1BRKGB.js → MemberTransactions-DYHJdzBn.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B57rXfVH.js → MessageInput.vue_vue_type_script_setup_true_lang-Dvr2n1Qk.js} +5090 -5091
- package/dist/{Mission-DzfeU-U2.js → Mission-D8FTOnMy.js} +9 -9
- package/dist/{Overview-DXHUfefR.js → Overview-CaxFeeVL.js} +19 -19
- package/dist/{Point-MAnQZKQ0.js → Point-I9wVIa2q.js} +8 -8
- package/dist/{Promotion-CNVK3kxX.js → Promotion-CWFtbYmb.js} +9 -9
- package/dist/{Queue-C65uzJYa.js → Queue-BmjIEX84.js} +10 -10
- package/dist/{Record-CNzZB4vZ.js → Record-DuvGrBry.js} +8 -8
- package/dist/{Reward-Cw4EhYW9.js → Reward-BQ36_7d0.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-e-BLmLll.js → RewardGroup.vue_vue_type_script_setup_true_lang-0AbXVk_6.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DZrpBefN.js → RuleGroup.vue_vue_type_script_setup_true_lang-pwHQUtHq.js} +15 -15
- package/dist/{Segment-Chpwplve.js → Segment-ClGmNf-7.js} +23 -23
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-B6IWbpoI.js → SelectItems.vue_vue_type_script_setup_true_lang-CGsYilHx.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-VrswK2oC.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Bbisi3wu.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-3bG4g6Yl.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CRnHuPPI.js} +3 -3
- package/dist/{Setting-BZyRBt7n.js → Setting-DtRP7-KR.js} +14 -14
- package/dist/{SettingAdvertisements-CCUR2JGR.js → SettingAdvertisements-9gG904yk.js} +12 -12
- package/dist/{Store-BfVrEOge.js → Store-j8N8l1e7.js} +21 -21
- package/dist/{StoreRewards-sfgkzvZR.js → StoreRewards-9o5EngS4.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-dHgJjSrH.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Bs54sDKB.js} +31 -29
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DgC5rSp5.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CqBeBxgc.js} +1 -1
- package/dist/{Tier-DSq05aWe.js → Tier-N4Fwb4c2.js} +23 -23
- package/dist/{Title-BPd8NkgA.js → Title-BisuO_Bq.js} +20 -20
- package/dist/{Transaction-mgdvhO3E.js → Transaction-BvL-lHUW.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C3upUu10.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-D3zT4NEB.js} +6 -6
- package/dist/{Voucher-Dul14F2K.js → Voucher-BNVS0bf_.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BH40SVl1.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BdAaQtUx.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Dx_65PIx.js → ZodTextField.vue_vue_type_script_setup_true_lang-Db5UjYDs.js} +2 -2
- package/dist/{app-BmlT5rWe.js → app-5gFoCIZ5.js} +739 -259
- package/dist/{app-BHoXxwSd.js → app-HOMrHaJX.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-BffDCvuW.js → business-DrOrg91y.js} +1 -1
- package/dist/{campaign-BLOhqNmK.js → campaign-D-0jxXgS.js} +1 -1
- package/dist/campaign-DxZjTV1c.js +233 -0
- package/dist/{campaign.enum-CxrXdUK5.js → campaign.enum-DfqdgPF7.js} +1 -1
- package/dist/{campaign.fn-CbmvJ9_A.js → campaign.fn-BA9SsYlS.js} +95 -95
- package/dist/{collectible.enum-BFN6omqT.js → collectible.enum-CUY4edTO.js} +1 -1
- package/dist/{collection.fn-Dbf300ZJ.js → collection.fn-BUyLrKuP.js} +2 -2
- package/dist/{dto-DDdkrd0L.js → dto-CdsbCKbi.js} +4 -4
- package/dist/{effect-B-WDkXGw.js → effect-CHvrDcct.js} +1 -1
- package/dist/{email-addresses-BuuQUEeC.js → email-addresses-BQGuEvTh.js} +1 -1
- package/dist/{export-CrIym_VI.js → export-CgyLGAFe.js} +3 -3
- package/dist/{helper-NaOsygD8.js → helper-CUXD11Bp.js} +1 -1
- package/dist/{index-BEEZcAxg.js → index-BMpQ1Eq2.js} +1 -1
- package/dist/{index-ClcKSapn.js → index-BTzBc44a.js} +4 -4
- package/dist/{index-C7znGNFh.js → index-BmOfDfwV.js} +43 -43
- package/dist/{index-DigtF3g0.js → index-Bsz-Af4_.js} +2 -2
- package/dist/{index-Cra9LhF-.js → index-D-Qagjww.js} +3 -3
- package/dist/{index-DJz5saei.js → index-DQlMaN5j.js} +3 -3
- package/dist/{index-B_3OqeIJ.js → index-DUBEbnDX.js} +1 -1
- package/dist/{index-Csa4xZZn.js → index-DUZWoVeF.js} +1 -1
- package/dist/{index-Df4Cjhjc.js → index-DrRjJg2A.js} +1 -1
- package/dist/{index-JsWMqBgG.js → index-DtcXk4cG.js} +1 -1
- package/dist/{index-Dx80UTIP.js → index-Dvy1ftAd.js} +1 -1
- package/dist/{index-BaZm_8os.js → index-ePW_CRtd.js} +1 -1
- package/dist/{index-CcvV0Ycm.js → index-uliDTEHQ.js} +3 -3
- package/dist/{index.esm2017-wI3mKHK2.js → index.esm2017-CJJcI6HI.js} +1 -1
- package/dist/{loading-DCn_bsMp.js → loading-O2OJnB-v.js} +1 -1
- package/dist/{membership-BKYeOLSh.js → membership-kVwD3i5I.js} +3 -3
- package/dist/{money-CnC0LxlQ.js → money-CvRqEjZN.js} +1 -1
- package/dist/{number-CrQ7VGjP.js → number-BtM53Gqu.js} +1 -1
- package/dist/{objectid-Ci50Ut-H.js → objectid-BbEyb60f.js} +4 -4
- package/dist/{campaign-8JVG_xlZ.js → plugins-nuoNiWZV.js} +706 -731
- package/dist/{reward-RNU0kxHS.js → reward-C904TC9N.js} +1 -1
- package/dist/{rule-7BPQX4bI.js → rule-B2r0vrQs.js} +3 -3
- package/dist/{rule-builder-nA2Fz_Io.js → rule-builder-DxCXxYrs.js} +1 -1
- package/dist/{template-kqdC8Xw5.js → template-C8z7oS1X.js} +5 -5
- package/dist/{timezone-CDuFFjqV.js → timezone-C-mgrIzx.js} +1 -1
- package/dist/trigger-DrmYFT7r.js +213 -0
- package/dist/{user-BgM-N8MI.js → user-C_PXVgnR.js} +1 -1
- package/dist/{vue-i18n-Do2KE3Pm.js → vue-i18n-CBY1MepG.js} +158 -158
- package/dist/{xlsx-Xu2Ba8cj.js → xlsx-DmlvPg-W.js} +1 -1
- package/dist/{zod-Bg2FbC-D.js → zod-DlxxgJ-R.js} +32 -31
- package/package.json +1 -1
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CLUGsUwO.js +0 -348
- package/dist/plugins-BuYRryHJ.js +0 -208
- package/dist/trigger-CxzUKrF8.js +0 -144
|
@@ -1,73 +1,91 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import { e as Z } from "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { u as fe, v as ge, x as Ee, w as Ie, y as Fe } from "./index.esm2017-CJJcI6HI.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-5gFoCIZ5.js";
|
|
4
|
+
import { detectLocale as Te, createFeedMeI18n as Ke } from "@feedmepos/mf-common";
|
|
5
|
+
import { S as k } from "./index-D-Qagjww.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
|
-
|
|
35
|
+
r = s, e = i;
|
|
18
36
|
});
|
|
19
|
-
return t.resolve =
|
|
20
|
-
},
|
|
21
|
-
|
|
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
|
-
},
|
|
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 (
|
|
29
|
-
const n =
|
|
30
|
-
!
|
|
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
|
|
33
|
-
obj:
|
|
34
|
-
k:
|
|
50
|
+
return ve(r) ? {} : {
|
|
51
|
+
obj: r,
|
|
52
|
+
k: me(s[i])
|
|
35
53
|
};
|
|
36
|
-
},
|
|
54
|
+
}, xe = (r, e, t) => {
|
|
37
55
|
const {
|
|
38
56
|
obj: s,
|
|
39
57
|
k: i
|
|
40
|
-
} =
|
|
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 n = e[e.length - 1],
|
|
46
|
-
for (; o.obj === void 0 &&
|
|
47
|
-
n = `${
|
|
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);
|
|
48
66
|
o.obj[`${o.k}.${n}`] = t;
|
|
49
|
-
},
|
|
67
|
+
}, He = (r, e, t, s) => {
|
|
50
68
|
const {
|
|
51
69
|
obj: i,
|
|
52
70
|
k: n
|
|
53
|
-
} =
|
|
71
|
+
} = z(r, e, Object);
|
|
54
72
|
i[n] = i[n] || [], i[n].push(t);
|
|
55
|
-
},
|
|
73
|
+
}, Y = (r, e) => {
|
|
56
74
|
const {
|
|
57
75
|
obj: t,
|
|
58
76
|
k: s
|
|
59
|
-
} =
|
|
77
|
+
} = z(r, e);
|
|
60
78
|
if (t && Object.prototype.hasOwnProperty.call(t, s))
|
|
61
79
|
return t[s];
|
|
62
|
-
},
|
|
63
|
-
const s =
|
|
64
|
-
return s !== void 0 ? s :
|
|
65
|
-
},
|
|
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
|
|
68
|
-
return
|
|
69
|
-
},
|
|
70
|
-
var
|
|
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
|
"&": "&",
|
|
72
90
|
"<": "<",
|
|
73
91
|
">": ">",
|
|
@@ -75,8 +93,8 @@ var Ue = {
|
|
|
75
93
|
"'": "'",
|
|
76
94
|
"/": "/"
|
|
77
95
|
};
|
|
78
|
-
const
|
|
79
|
-
class
|
|
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
|
|
109
|
+
const _e = [" ", ",", "?", "!", ";"], Ze = new We(20), Ye = (r, e, t) => {
|
|
92
110
|
e = e || "", t = t || "";
|
|
93
|
-
const s =
|
|
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 =
|
|
96
|
-
let n = !i.test(
|
|
113
|
+
const i = Ze.getRegExp(`(${s.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
114
|
+
let n = !i.test(r);
|
|
97
115
|
if (!n) {
|
|
98
|
-
const
|
|
99
|
-
|
|
116
|
+
const a = r.indexOf(t);
|
|
117
|
+
a > 0 && !i.test(r.substring(0, a)) && (n = !0);
|
|
100
118
|
}
|
|
101
119
|
return n;
|
|
102
|
-
},
|
|
120
|
+
}, ae = function(r, e) {
|
|
103
121
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
|
104
|
-
if (!
|
|
105
|
-
if (
|
|
106
|
-
return Object.prototype.hasOwnProperty.call(
|
|
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 =
|
|
126
|
+
let i = r;
|
|
109
127
|
for (let n = 0; n < s.length; ) {
|
|
110
128
|
if (!i || typeof i != "object")
|
|
111
129
|
return;
|
|
112
|
-
let
|
|
130
|
+
let a, o = "";
|
|
113
131
|
for (let l = n; l < s.length; ++l)
|
|
114
|
-
if (l !== n && (o += t), o += s[l],
|
|
115
|
-
if (["string", "number", "boolean"].indexOf(typeof
|
|
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
135
|
n += l - n + 1;
|
|
118
136
|
break;
|
|
119
137
|
}
|
|
120
|
-
i =
|
|
138
|
+
i = a;
|
|
121
139
|
}
|
|
122
140
|
return i;
|
|
123
|
-
},
|
|
141
|
+
}, Q = (r) => r == null ? void 0 : r.replace("_", "-"), Qe = {
|
|
124
142
|
type: "logger",
|
|
125
|
-
log(
|
|
126
|
-
this.output("log",
|
|
143
|
+
log(r) {
|
|
144
|
+
this.output("log", r);
|
|
127
145
|
},
|
|
128
|
-
warn(
|
|
129
|
-
this.output("warn",
|
|
146
|
+
warn(r) {
|
|
147
|
+
this.output("warn", r);
|
|
130
148
|
},
|
|
131
|
-
error(
|
|
132
|
-
this.output("error",
|
|
149
|
+
error(r) {
|
|
150
|
+
this.output("error", r);
|
|
133
151
|
},
|
|
134
|
-
output(
|
|
152
|
+
output(r, e) {
|
|
135
153
|
var t, s;
|
|
136
|
-
(s = (t = console == null ? void 0 : console[
|
|
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
|
|
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 ||
|
|
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 q {
|
|
|
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
|
|
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
|
|
196
|
+
return e = e || this.options, e.prefix = e.prefix || this.prefix, new G(this.logger, e);
|
|
179
197
|
}
|
|
180
198
|
}
|
|
181
|
-
var
|
|
182
|
-
class
|
|
199
|
+
var P = new G();
|
|
200
|
+
class X {
|
|
183
201
|
constructor() {
|
|
184
202
|
this.observers = {};
|
|
185
203
|
}
|
|
@@ -202,18 +220,18 @@ class te {
|
|
|
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((
|
|
206
|
-
let [o, l] =
|
|
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((
|
|
210
|
-
let [o, l] =
|
|
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
|
|
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,21 +247,21 @@ class me extends te {
|
|
|
229
247
|
t > -1 && this.options.ns.splice(t, 1);
|
|
230
248
|
}
|
|
231
249
|
getResource(e, t, s) {
|
|
232
|
-
var u,
|
|
250
|
+
var u, h;
|
|
233
251
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
234
|
-
const n = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator,
|
|
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
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)));
|
|
237
|
-
const l =
|
|
238
|
-
return !l && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), l || !
|
|
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
259
|
let n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
242
260
|
silent: !1
|
|
243
261
|
};
|
|
244
|
-
const
|
|
262
|
+
const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
|
|
245
263
|
let o = [e, t];
|
|
246
|
-
s && (o = o.concat(
|
|
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] : {
|
|
@@ -256,16 +274,16 @@ class me extends te {
|
|
|
256
274
|
i.silent || this.emit("added", e, t, s);
|
|
257
275
|
}
|
|
258
276
|
addResourceBundle(e, t, s, i, n) {
|
|
259
|
-
let
|
|
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 =
|
|
265
|
-
|
|
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
|
-
},
|
|
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 te {
|
|
|
287
305
|
return this.data;
|
|
288
306
|
}
|
|
289
307
|
}
|
|
290
|
-
var
|
|
308
|
+
var Ve = {
|
|
291
309
|
processors: {},
|
|
292
|
-
addPostProcessor(
|
|
293
|
-
this.processors[
|
|
310
|
+
addPostProcessor(r) {
|
|
311
|
+
this.processors[r.name] = r;
|
|
294
312
|
},
|
|
295
|
-
handle(
|
|
296
|
-
return
|
|
297
|
-
var
|
|
298
|
-
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
|
|
303
|
-
class
|
|
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(),
|
|
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);
|
|
@@ -322,8 +340,8 @@ class ee extends te {
|
|
|
322
340
|
s === void 0 && (s = ":");
|
|
323
341
|
const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
324
342
|
let n = t.ns || this.options.defaultNS || [];
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
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 {
|
|
@@ -344,97 +362,97 @@ class ee extends te {
|
|
|
344
362
|
}), t || (t = {}), e == null) return "";
|
|
345
363
|
Array.isArray(e) || (e = [String(e)]);
|
|
346
364
|
const i = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, n = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
|
|
347
|
-
key:
|
|
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,
|
|
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 (
|
|
352
|
-
const
|
|
369
|
+
if (h) {
|
|
370
|
+
const x = t.nsSeparator || this.options.nsSeparator;
|
|
353
371
|
return i ? {
|
|
354
|
-
res: `${l}${
|
|
355
|
-
usedKey:
|
|
356
|
-
exactUsedKey:
|
|
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}${
|
|
378
|
+
} : `${l}${x}${a}`;
|
|
361
379
|
}
|
|
362
380
|
return i ? {
|
|
363
|
-
res:
|
|
364
|
-
usedKey:
|
|
365
|
-
exactUsedKey:
|
|
381
|
+
res: a,
|
|
382
|
+
usedKey: a,
|
|
383
|
+
exactUsedKey: a,
|
|
366
384
|
usedLng: u,
|
|
367
385
|
usedNS: l,
|
|
368
386
|
usedParams: this.getUsedParamsDetails(t)
|
|
369
|
-
} :
|
|
387
|
+
} : a;
|
|
370
388
|
}
|
|
371
|
-
const
|
|
372
|
-
let c =
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
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
|
|
395
|
+
const x = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, c, {
|
|
378
396
|
...t,
|
|
379
397
|
ns: o
|
|
380
|
-
}) : `key '${
|
|
381
|
-
return i ? (
|
|
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
401
|
if (n) {
|
|
384
|
-
const
|
|
385
|
-
for (const
|
|
386
|
-
if (Object.prototype.hasOwnProperty.call(c,
|
|
387
|
-
const
|
|
388
|
-
|
|
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
|
-
}),
|
|
410
|
+
}), L[y] === N && (L[y] = c[y]);
|
|
393
411
|
}
|
|
394
|
-
c =
|
|
412
|
+
c = L;
|
|
395
413
|
}
|
|
396
|
-
} else if (
|
|
397
|
-
c = c.join(
|
|
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
|
|
400
|
-
const
|
|
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
|
-
}) : "",
|
|
403
|
-
!this.isValidLookup(c) &&
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
if (this.logger.log(
|
|
407
|
-
const
|
|
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
|
-
|
|
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
|
|
414
|
-
const
|
|
415
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
416
|
-
for (let
|
|
417
|
-
|
|
418
|
-
else this.options.saveMissingTo === "all" ?
|
|
419
|
-
const
|
|
420
|
-
var
|
|
421
|
-
const
|
|
422
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
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 &&
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
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
|
-
}) :
|
|
447
|
+
}) : ue(M, a, T));
|
|
430
448
|
}
|
|
431
|
-
c = this.extendTranslation(c, e, t,
|
|
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 ? (
|
|
451
|
+
return i ? (f.res = c, f.usedParams = this.getUsedParamsDetails(t), f) : c;
|
|
434
452
|
}
|
|
435
453
|
extendTranslation(e, t, s, i, n) {
|
|
436
|
-
var u,
|
|
437
|
-
var
|
|
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 ee extends te {
|
|
|
450
468
|
...s.interpolation
|
|
451
469
|
}
|
|
452
470
|
});
|
|
453
|
-
const
|
|
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 (
|
|
473
|
+
if (f) {
|
|
456
474
|
const g = e.match(this.interpolator.nestingRegexp);
|
|
457
475
|
c = g && g.length;
|
|
458
476
|
}
|
|
459
|
-
let
|
|
460
|
-
if (this.options.interpolation.defaultVariables && (
|
|
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
|
-
...
|
|
463
|
-
}), e = this.interpolator.interpolate(e,
|
|
464
|
-
const g = e.match(this.interpolator.nestingRegexp),
|
|
465
|
-
c <
|
|
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,
|
|
469
|
-
|
|
470
|
-
return (n == null ? void 0 : n[0]) ===
|
|
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 =
|
|
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 ee extends te {
|
|
|
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, n,
|
|
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),
|
|
487
|
-
i =
|
|
488
|
-
let
|
|
489
|
-
this.options.fallbackNS && (
|
|
490
|
-
const c = t.count !== void 0 && !d(t.count),
|
|
491
|
-
|
|
492
|
-
var
|
|
493
|
-
this.isValidLookup(s) || (o = v, !
|
|
494
|
-
var
|
|
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
|
-
|
|
497
|
-
const
|
|
498
|
-
if ((
|
|
499
|
-
this.i18nFormat.addLookupKeys(
|
|
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
|
|
502
|
-
c && (
|
|
503
|
-
const
|
|
504
|
-
if (c && (
|
|
505
|
-
const
|
|
506
|
-
|
|
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
|
|
510
|
-
for (;
|
|
511
|
-
this.isValidLookup(s) || (n =
|
|
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
535
|
exactUsedKey: n,
|
|
518
|
-
usedLng:
|
|
536
|
+
usedLng: a,
|
|
519
537
|
usedNS: o
|
|
520
538
|
};
|
|
521
539
|
}
|
|
@@ -551,17 +569,17 @@ class ee extends te {
|
|
|
551
569
|
return !1;
|
|
552
570
|
}
|
|
553
571
|
}
|
|
554
|
-
class
|
|
572
|
+
class Se {
|
|
555
573
|
constructor(e) {
|
|
556
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
574
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = P.create("languageUtils");
|
|
557
575
|
}
|
|
558
576
|
getScriptPartFromCode(e) {
|
|
559
|
-
if (e =
|
|
577
|
+
if (e = Q(e), !e || e.indexOf("-") < 0) return null;
|
|
560
578
|
const t = e.split("-");
|
|
561
579
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
562
580
|
}
|
|
563
581
|
getLanguagePartFromCode(e) {
|
|
564
|
-
if (e =
|
|
582
|
+
if (e = Q(e), !e || e.indexOf("-") < 0) return e;
|
|
565
583
|
const t = e.split("-");
|
|
566
584
|
return this.formatLanguageCode(t[0]);
|
|
567
585
|
}
|
|
@@ -605,31 +623,31 @@ 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 = [], n = (
|
|
609
|
-
|
|
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" && 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((
|
|
612
|
-
i.indexOf(
|
|
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
|
|
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
|
-
},
|
|
624
|
-
select: (
|
|
641
|
+
}, Le = {
|
|
642
|
+
select: (r) => r === 1 ? "one" : "other",
|
|
625
643
|
resolvedOptions: () => ({
|
|
626
644
|
pluralCategories: ["one", "other"]
|
|
627
645
|
})
|
|
628
646
|
};
|
|
629
|
-
class
|
|
647
|
+
class Ge {
|
|
630
648
|
constructor(e) {
|
|
631
649
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
632
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
650
|
+
this.languageUtils = e, this.options = t, this.logger = P.create("pluralResolver"), this.pluralRulesCache = {};
|
|
633
651
|
}
|
|
634
652
|
addRule(e, t) {
|
|
635
653
|
this.rules[e] = t;
|
|
@@ -639,25 +657,25 @@ class Ye {
|
|
|
639
657
|
}
|
|
640
658
|
getRule(e) {
|
|
641
659
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
642
|
-
const s =
|
|
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
664
|
if (n in this.pluralRulesCache)
|
|
647
665
|
return this.pluralRulesCache[n];
|
|
648
|
-
let
|
|
666
|
+
let a;
|
|
649
667
|
try {
|
|
650
|
-
|
|
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!"),
|
|
656
|
-
if (!e.match(/-|_/)) return
|
|
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
|
-
|
|
676
|
+
a = this.getRule(l, t);
|
|
659
677
|
}
|
|
660
|
-
return this.pluralRulesCache[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 Ye {
|
|
|
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, n) =>
|
|
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,15 +695,15 @@ class Ye {
|
|
|
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
|
|
681
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, n =
|
|
682
|
-
return !n && i && d(t) && (n =
|
|
683
|
-
},
|
|
684
|
-
class
|
|
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] : {};
|
|
688
|
-
this.logger =
|
|
706
|
+
this.logger = P.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((s) => s), this.init(e);
|
|
689
707
|
}
|
|
690
708
|
init() {
|
|
691
709
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -697,21 +715,21 @@ class Ge {
|
|
|
697
715
|
escapeValue: s,
|
|
698
716
|
useRawValueToEscape: i,
|
|
699
717
|
prefix: n,
|
|
700
|
-
prefixEscaped:
|
|
718
|
+
prefixEscaped: a,
|
|
701
719
|
suffix: o,
|
|
702
720
|
suffixEscaped: l,
|
|
703
721
|
formatSeparator: u,
|
|
704
|
-
unescapeSuffix:
|
|
705
|
-
unescapePrefix:
|
|
722
|
+
unescapeSuffix: h,
|
|
723
|
+
unescapePrefix: f,
|
|
706
724
|
nestingPrefix: c,
|
|
707
|
-
nestingPrefixEscaped:
|
|
725
|
+
nestingPrefixEscaped: p,
|
|
708
726
|
nestingSuffix: g,
|
|
709
|
-
nestingSuffixEscaped:
|
|
727
|
+
nestingSuffixEscaped: m,
|
|
710
728
|
nestingOptionsSeparator: v,
|
|
711
|
-
maxReplaces:
|
|
712
|
-
alwaysFormat:
|
|
729
|
+
maxReplaces: w,
|
|
730
|
+
alwaysFormat: C
|
|
713
731
|
} = e.interpolation;
|
|
714
|
-
this.escape = t !== void 0 ? t :
|
|
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,85 +739,85 @@ 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
|
|
725
|
-
let n,
|
|
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
|
|
729
|
-
return this.alwaysFormat ? this.format(
|
|
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
|
-
}) :
|
|
751
|
+
}) : C;
|
|
734
752
|
}
|
|
735
|
-
const
|
|
736
|
-
return this.format(
|
|
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
|
|
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) =>
|
|
764
|
+
safeValue: (g) => ee(g)
|
|
747
765
|
}, {
|
|
748
766
|
regex: this.regexp,
|
|
749
|
-
safeValue: (g) => this.escapeValue ?
|
|
767
|
+
safeValue: (g) => this.escapeValue ? ee(this.escape(g)) : ee(g)
|
|
750
768
|
}].forEach((g) => {
|
|
751
769
|
for (o = 0; n = g.regex.exec(e); ) {
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
754
|
-
if (typeof
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
} else if (i && Object.prototype.hasOwnProperty.call(i,
|
|
758
|
-
|
|
759
|
-
else if (
|
|
760
|
-
|
|
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 ${
|
|
764
|
-
else !d(
|
|
765
|
-
const v = g.safeValue(
|
|
766
|
-
if (e = e.replace(n[0], v),
|
|
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, n,
|
|
790
|
+
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, n, a;
|
|
773
791
|
const o = (l, u) => {
|
|
774
|
-
const
|
|
775
|
-
if (l.indexOf(
|
|
776
|
-
const
|
|
777
|
-
let c = `{${
|
|
778
|
-
l =
|
|
779
|
-
const
|
|
780
|
-
(((
|
|
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
|
-
|
|
800
|
+
a = JSON.parse(c), u && (a = {
|
|
783
801
|
...u,
|
|
784
|
-
...
|
|
802
|
+
...a
|
|
785
803
|
});
|
|
786
|
-
} catch (
|
|
787
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${l}`,
|
|
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
|
|
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
|
-
|
|
811
|
+
a = {
|
|
794
812
|
...s
|
|
795
|
-
},
|
|
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
|
|
799
|
-
i[1] =
|
|
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 (n = t(o.call(this, i[1].trim(),
|
|
802
|
-
d(n) || (n =
|
|
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
823
|
}), n.trim())), e = e.replace(i[0], n), this.regexp.lastIndex = 0;
|
|
@@ -807,17 +825,17 @@ class Ge {
|
|
|
807
825
|
return e;
|
|
808
826
|
}
|
|
809
827
|
}
|
|
810
|
-
const
|
|
811
|
-
let e =
|
|
828
|
+
const Xe = (r) => {
|
|
829
|
+
let e = r.toLowerCase().trim();
|
|
812
830
|
const t = {};
|
|
813
|
-
if (
|
|
814
|
-
const s =
|
|
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((
|
|
818
|
-
if (
|
|
819
|
-
const [o, ...l] =
|
|
820
|
-
t[
|
|
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,7 +843,7 @@ const Ze = (a) => {
|
|
|
825
843
|
formatName: e,
|
|
826
844
|
formatOptions: t
|
|
827
845
|
};
|
|
828
|
-
},
|
|
846
|
+
}, A = (r) => {
|
|
829
847
|
const e = {};
|
|
830
848
|
return (t, s, i) => {
|
|
831
849
|
let n = i;
|
|
@@ -833,41 +851,41 @@ const Ze = (a) => {
|
|
|
833
851
|
...n,
|
|
834
852
|
[i.interpolationkey]: void 0
|
|
835
853
|
});
|
|
836
|
-
const
|
|
837
|
-
let o = e[
|
|
838
|
-
return o || (o =
|
|
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
|
|
859
|
+
class et {
|
|
842
860
|
constructor() {
|
|
843
861
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
844
|
-
this.logger =
|
|
845
|
-
number:
|
|
862
|
+
this.logger = P.create("formatter"), this.options = e, this.formats = {
|
|
863
|
+
number: A((t, s) => {
|
|
846
864
|
const i = new Intl.NumberFormat(t, {
|
|
847
865
|
...s
|
|
848
866
|
});
|
|
849
867
|
return (n) => i.format(n);
|
|
850
868
|
}),
|
|
851
|
-
currency:
|
|
869
|
+
currency: A((t, s) => {
|
|
852
870
|
const i = new Intl.NumberFormat(t, {
|
|
853
871
|
...s,
|
|
854
872
|
style: "currency"
|
|
855
873
|
});
|
|
856
874
|
return (n) => i.format(n);
|
|
857
875
|
}),
|
|
858
|
-
datetime:
|
|
876
|
+
datetime: A((t, s) => {
|
|
859
877
|
const i = new Intl.DateTimeFormat(t, {
|
|
860
878
|
...s
|
|
861
879
|
});
|
|
862
880
|
return (n) => i.format(n);
|
|
863
881
|
}),
|
|
864
|
-
relativetime:
|
|
882
|
+
relativetime: A((t, s) => {
|
|
865
883
|
const i = new Intl.RelativeTimeFormat(t, {
|
|
866
884
|
...s
|
|
867
885
|
});
|
|
868
886
|
return (n) => i.format(n, s.range || "day");
|
|
869
887
|
}),
|
|
870
|
-
list:
|
|
888
|
+
list: A((t, s) => {
|
|
871
889
|
const i = new Intl.ListFormat(t, {
|
|
872
890
|
...s
|
|
873
891
|
});
|
|
@@ -885,7 +903,7 @@ class Qe {
|
|
|
885
903
|
this.formats[e.toLowerCase().trim()] = t;
|
|
886
904
|
}
|
|
887
905
|
addCached(e, t) {
|
|
888
|
-
this.formats[e.toLowerCase().trim()] =
|
|
906
|
+
this.formats[e.toLowerCase().trim()] = A(t);
|
|
889
907
|
}
|
|
890
908
|
format(e, t, s) {
|
|
891
909
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
@@ -895,22 +913,22 @@ class Qe {
|
|
|
895
913
|
n[0] = [n[0], ...n.splice(1, o)].join(this.formatSeparator);
|
|
896
914
|
}
|
|
897
915
|
return n.reduce((o, l) => {
|
|
898
|
-
var
|
|
916
|
+
var f;
|
|
899
917
|
const {
|
|
900
918
|
formatName: u,
|
|
901
|
-
formatOptions:
|
|
902
|
-
} =
|
|
919
|
+
formatOptions: h
|
|
920
|
+
} = Xe(l);
|
|
903
921
|
if (this.formats[u]) {
|
|
904
922
|
let c = o;
|
|
905
923
|
try {
|
|
906
|
-
const
|
|
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
|
-
...
|
|
926
|
+
...h,
|
|
909
927
|
...i,
|
|
910
|
-
...
|
|
928
|
+
...p
|
|
911
929
|
});
|
|
912
|
-
} catch (
|
|
913
|
-
this.logger.warn(
|
|
930
|
+
} catch (p) {
|
|
931
|
+
this.logger.warn(p);
|
|
914
932
|
}
|
|
915
933
|
return c;
|
|
916
934
|
} else
|
|
@@ -919,55 +937,55 @@ class Qe {
|
|
|
919
937
|
}, e);
|
|
920
938
|
}
|
|
921
939
|
}
|
|
922
|
-
const
|
|
923
|
-
|
|
940
|
+
const tt = (r, e) => {
|
|
941
|
+
r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
|
|
924
942
|
};
|
|
925
|
-
class
|
|
943
|
+
class st extends X {
|
|
926
944
|
constructor(e, t, s) {
|
|
927
|
-
var 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 =
|
|
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 n = {},
|
|
950
|
+
const n = {}, a = {}, o = {}, l = {};
|
|
933
951
|
return e.forEach((u) => {
|
|
934
|
-
let
|
|
935
|
-
t.forEach((
|
|
936
|
-
const c = `${u}|${
|
|
937
|
-
!s.reload && this.store.hasResourceBundle(u,
|
|
938
|
-
}),
|
|
939
|
-
}), (Object.keys(n).length || Object.keys(
|
|
940
|
-
pending:
|
|
941
|
-
pendingCount: Object.keys(
|
|
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
964
|
toLoad: Object.keys(n),
|
|
947
|
-
pending: Object.keys(
|
|
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("|"), n = i[0],
|
|
954
|
-
t && this.emit("failedLoading", n,
|
|
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
|
-
|
|
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
|
|
962
|
-
|
|
963
|
-
o[u][
|
|
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, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout,
|
|
970
|
-
if (!e.length) return
|
|
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,
|
|
@@ -975,28 +993,28 @@ class qe extends te {
|
|
|
975
993
|
fcName: s,
|
|
976
994
|
tried: i,
|
|
977
995
|
wait: n,
|
|
978
|
-
callback:
|
|
996
|
+
callback: a
|
|
979
997
|
});
|
|
980
998
|
return;
|
|
981
999
|
}
|
|
982
1000
|
this.readingCalls++;
|
|
983
|
-
const o = (u,
|
|
1001
|
+
const o = (u, h) => {
|
|
984
1002
|
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
985
|
-
const
|
|
986
|
-
this.read(
|
|
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 &&
|
|
1006
|
+
if (u && h && i < this.maxRetries) {
|
|
989
1007
|
setTimeout(() => {
|
|
990
|
-
this.read.call(this, e, t, s, i + 1, n * 2,
|
|
1008
|
+
this.read.call(this, e, t, s, i + 1, n * 2, a);
|
|
991
1009
|
}, n);
|
|
992
1010
|
return;
|
|
993
1011
|
}
|
|
994
|
-
|
|
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((
|
|
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
|
}
|
|
@@ -1012,8 +1030,8 @@ class qe extends te {
|
|
|
1012
1030
|
const n = this.queueLoad(e, t, s, i);
|
|
1013
1031
|
if (!n.toLoad.length)
|
|
1014
1032
|
return n.pending.length || i(), null;
|
|
1015
|
-
n.toLoad.forEach((
|
|
1016
|
-
this.loadOne(
|
|
1033
|
+
n.toLoad.forEach((a) => {
|
|
1034
|
+
this.loadOne(a);
|
|
1017
1035
|
});
|
|
1018
1036
|
}
|
|
1019
1037
|
load(e, t, s) {
|
|
@@ -1027,39 +1045,39 @@ class qe extends te {
|
|
|
1027
1045
|
loadOne(e) {
|
|
1028
1046
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1029
1047
|
const s = e.split("|"), i = s[0], n = s[1];
|
|
1030
|
-
this.read(i, n, "read", void 0, void 0, (
|
|
1031
|
-
|
|
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
1052
|
saveMissing(e, t, s, i, n) {
|
|
1035
|
-
var l, u,
|
|
1036
|
-
let
|
|
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 && !((
|
|
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
|
|
1045
|
-
...
|
|
1062
|
+
const p = {
|
|
1063
|
+
...a,
|
|
1046
1064
|
isUpdate: n
|
|
1047
1065
|
}, g = this.backend.create.bind(this.backend);
|
|
1048
1066
|
if (g.length < 6)
|
|
1049
1067
|
try {
|
|
1050
|
-
let
|
|
1051
|
-
g.length === 5 ?
|
|
1052
|
-
} catch (
|
|
1053
|
-
o(
|
|
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,
|
|
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
|
|
1080
|
+
const $e = () => ({
|
|
1063
1081
|
debug: !1,
|
|
1064
1082
|
initAsync: !0,
|
|
1065
1083
|
ns: ["translation"],
|
|
@@ -1092,10 +1110,10 @@ const Se = () => ({
|
|
|
1092
1110
|
parseMissingKeyHandler: !1,
|
|
1093
1111
|
appendNamespaceToMissingKey: !1,
|
|
1094
1112
|
appendNamespaceToCIMode: !1,
|
|
1095
|
-
overloadTranslationOptionHandler: (
|
|
1113
|
+
overloadTranslationOptionHandler: (r) => {
|
|
1096
1114
|
let e = {};
|
|
1097
|
-
if (typeof
|
|
1098
|
-
const t =
|
|
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 Se = () => ({
|
|
|
1104
1122
|
},
|
|
1105
1123
|
interpolation: {
|
|
1106
1124
|
escapeValue: !0,
|
|
1107
|
-
format: (
|
|
1125
|
+
format: (r) => r,
|
|
1108
1126
|
prefix: "{{",
|
|
1109
1127
|
suffix: "}}",
|
|
1110
1128
|
formatSeparator: ",",
|
|
@@ -1115,21 +1133,21 @@ const Se = () => ({
|
|
|
1115
1133
|
maxReplaces: 1e3,
|
|
1116
1134
|
skipOnVariables: !0
|
|
1117
1135
|
}
|
|
1118
|
-
}),
|
|
1136
|
+
}), Ce = (r) => {
|
|
1119
1137
|
var e, t;
|
|
1120
|
-
return d(
|
|
1121
|
-
},
|
|
1122
|
-
},
|
|
1123
|
-
Object.getOwnPropertyNames(Object.getPrototypeOf(
|
|
1124
|
-
typeof
|
|
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;
|
|
1139
|
+
}, W = () => {
|
|
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
|
|
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 =
|
|
1148
|
+
if (super(), this.options = Ce(e), this.services = {}, this.logger = P, this.modules = {
|
|
1131
1149
|
external: []
|
|
1132
|
-
},
|
|
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 W extends te {
|
|
|
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 =
|
|
1162
|
+
const i = $e();
|
|
1145
1163
|
this.options = {
|
|
1146
1164
|
...i,
|
|
1147
1165
|
...this.options,
|
|
1148
|
-
...
|
|
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 n = (
|
|
1171
|
+
const n = (h) => h ? typeof h == "function" ? new h() : h : null;
|
|
1154
1172
|
if (!this.options.isClone) {
|
|
1155
|
-
this.modules.logger ?
|
|
1156
|
-
let
|
|
1157
|
-
this.modules.formatter ?
|
|
1158
|
-
const
|
|
1159
|
-
this.store = new
|
|
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 =
|
|
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
|
-
}),
|
|
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
|
|
1167
|
-
for (var g = arguments.length,
|
|
1168
|
-
|
|
1169
|
-
e.emit(
|
|
1170
|
-
}), 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
|
|
1171
|
-
for (var g = arguments.length,
|
|
1172
|
-
|
|
1173
|
-
e.emit(
|
|
1174
|
-
}), this.modules.external.forEach((
|
|
1175
|
-
|
|
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
|
-
if (this.format = this.options.interpolation.format, s || (s =
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1196
|
+
if (this.format = this.options.interpolation.format, s || (s = W), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
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((
|
|
1183
|
-
this[
|
|
1184
|
-
return e.store[
|
|
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((
|
|
1187
|
-
this[
|
|
1188
|
-
return e.store[
|
|
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 =
|
|
1192
|
-
const
|
|
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(
|
|
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
|
|
1196
|
-
this.changeLanguage(this.options.lng,
|
|
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 n,
|
|
1202
|
-
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1219
|
+
var n, a;
|
|
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((
|
|
1209
|
-
|
|
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((
|
|
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 =
|
|
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) => {
|
|
1221
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" &&
|
|
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,42 +1257,42 @@ class W extends te {
|
|
|
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
1262
|
const n = (l) => {
|
|
1245
1263
|
this.language = l, this.languages = this.services.languageUtils.toResolveHierarchy(l), this.resolvedLanguage = void 0, this.setResolvedLanguage(l);
|
|
1246
|
-
},
|
|
1264
|
+
}, a = (l, u) => {
|
|
1247
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
|
|
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 || n(u), this.translator.language || this.translator.changeLanguage(u), (
|
|
1257
|
-
|
|
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 n = function(
|
|
1282
|
+
const n = function(a, o) {
|
|
1265
1283
|
let l;
|
|
1266
1284
|
if (typeof o != "object") {
|
|
1267
|
-
for (var u = arguments.length,
|
|
1268
|
-
f
|
|
1269
|
-
l = i.options.overloadTranslationOptionHandler([
|
|
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
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
|
|
1277
|
-
return l.keyPrefix && Array.isArray(
|
|
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
1297
|
return d(e) ? n.lng = e : n.lngs = e, n.ns = t, n.keyPrefix = s, n;
|
|
1280
1298
|
}
|
|
@@ -1301,18 +1319,18 @@ class W extends te {
|
|
|
1301
1319
|
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
1302
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
|
|
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,
|
|
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 ||
|
|
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,32 +1338,32 @@ class W extends te {
|
|
|
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 || [], n = e.filter((
|
|
1326
|
-
return n.length ? (this.options.preload = i.concat(n), this.loadResources((
|
|
1327
|
-
s.resolve(), t && t(
|
|
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
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 = ((n = this.services) == null ? void 0 : n.languageUtils) || new
|
|
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
|
|
1356
|
+
return new B(e, t);
|
|
1339
1357
|
}
|
|
1340
1358
|
cloneInstance() {
|
|
1341
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1359
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : W;
|
|
1342
1360
|
const s = e.forkResourceStore;
|
|
1343
1361
|
s && delete e.forkResourceStore;
|
|
1344
1362
|
const i = {
|
|
1345
1363
|
...this.options,
|
|
1346
1364
|
...e,
|
|
1347
1365
|
isClone: !0
|
|
1348
|
-
}, n = new
|
|
1366
|
+
}, n = new B(i);
|
|
1349
1367
|
if ((e.debug !== void 0 || e.prefix !== void 0) && (n.logger = n.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
|
|
1350
1368
|
n[o] = this[o];
|
|
1351
1369
|
}), n.services = {
|
|
@@ -1355,14 +1373,14 @@ class W extends te {
|
|
|
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((
|
|
1359
|
-
...l[u][
|
|
1360
|
-
},
|
|
1361
|
-
n.store = new
|
|
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 n.translator = new
|
|
1364
|
-
for (var l = arguments.length, u = new Array(l > 1 ? l - 1 : 0),
|
|
1365
|
-
u[
|
|
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];
|
|
1366
1384
|
n.emit(o, ...u);
|
|
1367
1385
|
}), n.init(i, t), n.translator.options = i, n.translator.backendConnector.services.utils = {
|
|
1368
1386
|
hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
|
|
@@ -1378,56 +1396,56 @@ class W extends te {
|
|
|
1378
1396
|
};
|
|
1379
1397
|
}
|
|
1380
1398
|
}
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
var
|
|
1398
|
-
function
|
|
1399
|
-
return
|
|
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
|
|
1402
|
-
if (typeof
|
|
1419
|
+
var Pe = (r) => {
|
|
1420
|
+
if (typeof r != "object" || r === null)
|
|
1403
1421
|
return !1;
|
|
1404
|
-
for (const e in
|
|
1405
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1422
|
+
for (const e in r)
|
|
1423
|
+
if (!Object.prototype.hasOwnProperty.call(r, e))
|
|
1406
1424
|
return !1;
|
|
1407
1425
|
return !0;
|
|
1408
|
-
},
|
|
1409
|
-
if (typeof
|
|
1410
|
-
return { key:
|
|
1411
|
-
if (
|
|
1412
|
-
const t = "key" in
|
|
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
|
-
},
|
|
1434
|
+
}, Re = "zod", at = (r) => (e, t) => {
|
|
1417
1435
|
var l;
|
|
1418
1436
|
const { t: s, ns: i, handlePath: n } = {
|
|
1419
|
-
t:
|
|
1420
|
-
ns:
|
|
1421
|
-
...
|
|
1422
|
-
handlePath: (
|
|
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: (
|
|
1442
|
+
ns: (r == null ? void 0 : r.ns) ?? Re,
|
|
1425
1443
|
keyPrefix: void 0,
|
|
1426
|
-
...
|
|
1444
|
+
...r == null ? void 0 : r.handlePath
|
|
1427
1445
|
} : null
|
|
1428
1446
|
};
|
|
1429
|
-
let
|
|
1430
|
-
|
|
1447
|
+
let a;
|
|
1448
|
+
a = Ae(e, t).message;
|
|
1431
1449
|
const o = e.path.length > 0 && n ? {
|
|
1432
1450
|
context: n.context,
|
|
1433
1451
|
path: s(
|
|
@@ -1440,15 +1458,15 @@ var Ce = (a) => {
|
|
|
1440
1458
|
} : {};
|
|
1441
1459
|
switch (e.code) {
|
|
1442
1460
|
case O.invalid_type:
|
|
1443
|
-
e.received ===
|
|
1461
|
+
e.received === de.undefined ? a = s("errors.invalid_type_received_undefined", {
|
|
1444
1462
|
ns: i,
|
|
1445
|
-
defaultValue:
|
|
1463
|
+
defaultValue: a,
|
|
1446
1464
|
...o
|
|
1447
|
-
}) : e.received ===
|
|
1465
|
+
}) : e.received === de.null ? a = s("errors.invalid_type_received_null", {
|
|
1448
1466
|
ns: i,
|
|
1449
|
-
defaultValue:
|
|
1467
|
+
defaultValue: a,
|
|
1450
1468
|
...o
|
|
1451
|
-
}) :
|
|
1469
|
+
}) : a = s("errors.invalid_type", {
|
|
1452
1470
|
expected: s(`types.${e.expected}`, {
|
|
1453
1471
|
defaultValue: e.expected,
|
|
1454
1472
|
ns: i
|
|
@@ -1458,386 +1476,343 @@ var Ce = (a) => {
|
|
|
1458
1476
|
ns: i
|
|
1459
1477
|
}),
|
|
1460
1478
|
ns: i,
|
|
1461
|
-
defaultValue:
|
|
1479
|
+
defaultValue: a,
|
|
1462
1480
|
...o
|
|
1463
1481
|
});
|
|
1464
1482
|
break;
|
|
1465
1483
|
case O.invalid_literal:
|
|
1466
|
-
|
|
1467
|
-
expected: JSON.stringify(e.expected,
|
|
1484
|
+
a = s("errors.invalid_literal", {
|
|
1485
|
+
expected: JSON.stringify(e.expected, rt),
|
|
1468
1486
|
ns: i,
|
|
1469
|
-
defaultValue:
|
|
1487
|
+
defaultValue: a,
|
|
1470
1488
|
...o
|
|
1471
1489
|
});
|
|
1472
1490
|
break;
|
|
1473
1491
|
case O.unrecognized_keys:
|
|
1474
|
-
|
|
1475
|
-
keys:
|
|
1492
|
+
a = s("errors.unrecognized_keys", {
|
|
1493
|
+
keys: te(e.keys, ", "),
|
|
1476
1494
|
count: e.keys.length,
|
|
1477
1495
|
ns: i,
|
|
1478
|
-
defaultValue:
|
|
1496
|
+
defaultValue: a,
|
|
1479
1497
|
...o
|
|
1480
1498
|
});
|
|
1481
1499
|
break;
|
|
1482
1500
|
case O.invalid_union:
|
|
1483
|
-
|
|
1501
|
+
a = s("errors.invalid_union", {
|
|
1484
1502
|
ns: i,
|
|
1485
|
-
defaultValue:
|
|
1503
|
+
defaultValue: a,
|
|
1486
1504
|
...o
|
|
1487
1505
|
});
|
|
1488
1506
|
break;
|
|
1489
1507
|
case O.invalid_union_discriminator:
|
|
1490
|
-
|
|
1491
|
-
options:
|
|
1508
|
+
a = s("errors.invalid_union_discriminator", {
|
|
1509
|
+
options: te(e.options),
|
|
1492
1510
|
ns: i,
|
|
1493
|
-
defaultValue:
|
|
1511
|
+
defaultValue: a,
|
|
1494
1512
|
...o
|
|
1495
1513
|
});
|
|
1496
1514
|
break;
|
|
1497
1515
|
case O.invalid_enum_value:
|
|
1498
|
-
|
|
1499
|
-
options:
|
|
1516
|
+
a = s("errors.invalid_enum_value", {
|
|
1517
|
+
options: te(e.options),
|
|
1500
1518
|
received: e.received,
|
|
1501
1519
|
ns: i,
|
|
1502
|
-
defaultValue:
|
|
1520
|
+
defaultValue: a,
|
|
1503
1521
|
...o
|
|
1504
1522
|
});
|
|
1505
1523
|
break;
|
|
1506
1524
|
case O.invalid_arguments:
|
|
1507
|
-
|
|
1525
|
+
a = s("errors.invalid_arguments", {
|
|
1508
1526
|
ns: i,
|
|
1509
|
-
defaultValue:
|
|
1527
|
+
defaultValue: a,
|
|
1510
1528
|
...o
|
|
1511
1529
|
});
|
|
1512
1530
|
break;
|
|
1513
1531
|
case O.invalid_return_type:
|
|
1514
|
-
|
|
1532
|
+
a = s("errors.invalid_return_type", {
|
|
1515
1533
|
ns: i,
|
|
1516
|
-
defaultValue:
|
|
1534
|
+
defaultValue: a,
|
|
1517
1535
|
...o
|
|
1518
1536
|
});
|
|
1519
1537
|
break;
|
|
1520
1538
|
case O.invalid_date:
|
|
1521
|
-
|
|
1539
|
+
a = s("errors.invalid_date", {
|
|
1522
1540
|
ns: i,
|
|
1523
|
-
defaultValue:
|
|
1541
|
+
defaultValue: a,
|
|
1524
1542
|
...o
|
|
1525
1543
|
});
|
|
1526
1544
|
break;
|
|
1527
1545
|
case O.invalid_string:
|
|
1528
|
-
typeof e.validation == "object" ? "startsWith" in e.validation ?
|
|
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:
|
|
1549
|
+
defaultValue: a,
|
|
1532
1550
|
...o
|
|
1533
|
-
}) : "endsWith" in e.validation && (
|
|
1551
|
+
}) : "endsWith" in e.validation && (a = s("errors.invalid_string.endsWith", {
|
|
1534
1552
|
endsWith: e.validation.endsWith,
|
|
1535
1553
|
ns: i,
|
|
1536
|
-
defaultValue:
|
|
1554
|
+
defaultValue: a,
|
|
1537
1555
|
...o
|
|
1538
|
-
})) :
|
|
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:
|
|
1562
|
+
defaultValue: a,
|
|
1545
1563
|
...o
|
|
1546
1564
|
});
|
|
1547
1565
|
break;
|
|
1548
1566
|
case O.too_small:
|
|
1549
1567
|
const u = e.type === "date" ? new Date(e.minimum) : e.minimum;
|
|
1550
|
-
|
|
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:
|
|
1574
|
+
defaultValue: a,
|
|
1557
1575
|
...o
|
|
1558
1576
|
}
|
|
1559
1577
|
);
|
|
1560
1578
|
break;
|
|
1561
1579
|
case O.too_big:
|
|
1562
|
-
const
|
|
1563
|
-
|
|
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:
|
|
1567
|
-
count: typeof
|
|
1584
|
+
maximum: h,
|
|
1585
|
+
count: typeof h == "number" ? h : void 0,
|
|
1568
1586
|
ns: i,
|
|
1569
|
-
defaultValue:
|
|
1587
|
+
defaultValue: a,
|
|
1570
1588
|
...o
|
|
1571
1589
|
}
|
|
1572
1590
|
);
|
|
1573
1591
|
break;
|
|
1574
1592
|
case O.custom:
|
|
1575
|
-
const { key:
|
|
1593
|
+
const { key: f, values: c } = nt(
|
|
1576
1594
|
(l = e.params) == null ? void 0 : l.i18n,
|
|
1577
1595
|
"errors.custom"
|
|
1578
1596
|
);
|
|
1579
|
-
|
|
1597
|
+
a = s(f, {
|
|
1580
1598
|
...c,
|
|
1581
1599
|
ns: i,
|
|
1582
|
-
defaultValue:
|
|
1600
|
+
defaultValue: a,
|
|
1583
1601
|
...o
|
|
1584
1602
|
});
|
|
1585
1603
|
break;
|
|
1586
1604
|
case O.invalid_intersection_types:
|
|
1587
|
-
|
|
1605
|
+
a = s("errors.invalid_intersection_types", {
|
|
1588
1606
|
ns: i,
|
|
1589
|
-
defaultValue:
|
|
1607
|
+
defaultValue: a,
|
|
1590
1608
|
...o
|
|
1591
1609
|
});
|
|
1592
1610
|
break;
|
|
1593
1611
|
case O.not_multiple_of:
|
|
1594
|
-
|
|
1612
|
+
a = s("errors.not_multiple_of", {
|
|
1595
1613
|
multipleOf: e.multipleOf,
|
|
1596
1614
|
ns: i,
|
|
1597
|
-
defaultValue:
|
|
1615
|
+
defaultValue: a,
|
|
1598
1616
|
...o
|
|
1599
1617
|
});
|
|
1600
1618
|
break;
|
|
1601
1619
|
case O.not_finite:
|
|
1602
|
-
|
|
1620
|
+
a = s("errors.not_finite", {
|
|
1603
1621
|
ns: i,
|
|
1604
|
-
defaultValue:
|
|
1622
|
+
defaultValue: a,
|
|
1605
1623
|
...o
|
|
1606
1624
|
});
|
|
1607
1625
|
break;
|
|
1608
1626
|
}
|
|
1609
|
-
return { message:
|
|
1627
|
+
return { message: a };
|
|
1610
1628
|
};
|
|
1611
|
-
const
|
|
1612
|
-
locale:
|
|
1613
|
-
messages:
|
|
1629
|
+
const le = Te(), ot = Ke({
|
|
1630
|
+
locale: le,
|
|
1631
|
+
messages: ke
|
|
1614
1632
|
});
|
|
1615
|
-
console.info("Current locale:",
|
|
1616
|
-
|
|
1617
|
-
lng:
|
|
1618
|
-
resources:
|
|
1633
|
+
console.info("Current locale:", le);
|
|
1634
|
+
S.init({
|
|
1635
|
+
lng: le,
|
|
1636
|
+
resources: ke
|
|
1619
1637
|
});
|
|
1620
|
-
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
},
|
|
1628
|
-
[
|
|
1629
|
-
z(ne.FmIcon, { size: "sm", name: a.icon, outline: !0 }),
|
|
1630
|
-
z("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
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
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;
|
|
1644
1689
|
},
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
icon: "loyalty",
|
|
1648
|
-
get name() {
|
|
1649
|
-
return w.global.t("connect.campaign.common.typeName.PROMOTION");
|
|
1650
|
-
},
|
|
1651
|
-
chip() {
|
|
1652
|
-
return P(this);
|
|
1653
|
-
}
|
|
1690
|
+
generateId(r) {
|
|
1691
|
+
return [ht(), this.fileExtension(r)].filter(Boolean).join(".");
|
|
1654
1692
|
},
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
icon: "sell",
|
|
1658
|
-
get name() {
|
|
1659
|
-
return w.global.t("connect.campaign.common.typeName.VOUCHER");
|
|
1660
|
-
},
|
|
1661
|
-
chip() {
|
|
1662
|
-
return P(this);
|
|
1663
|
-
}
|
|
1693
|
+
campaignPath(r) {
|
|
1694
|
+
return `business/${k.getBusinessId()}/campaigns/${r || this.generateId()}`;
|
|
1664
1695
|
},
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
icon: "award_star",
|
|
1668
|
-
get name() {
|
|
1669
|
-
return w.global.t("connect.campaign.common.typeName.POINT");
|
|
1670
|
-
},
|
|
1671
|
-
chip() {
|
|
1672
|
-
return P(this);
|
|
1673
|
-
}
|
|
1696
|
+
coverImagePath() {
|
|
1697
|
+
return `business/${k.getBusinessId()}/membership/design/image.png`;
|
|
1674
1698
|
},
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
icon: "campaign",
|
|
1678
|
-
get name() {
|
|
1679
|
-
return w.global.t("connect.campaign.common.typeName.BROADCAST");
|
|
1680
|
-
},
|
|
1681
|
-
chip() {
|
|
1682
|
-
return P(this);
|
|
1683
|
-
}
|
|
1699
|
+
advertisementPath(r, e) {
|
|
1700
|
+
return `business/${k.getBusinessId()}/membership/advertisement/${r}.${this.fileExtension(e)}`;
|
|
1684
1701
|
},
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
icon: "database",
|
|
1688
|
-
get name() {
|
|
1689
|
-
return w.global.t("connect.campaign.common.typeName.GAME");
|
|
1690
|
-
},
|
|
1691
|
-
chip() {
|
|
1692
|
-
return P(this);
|
|
1693
|
-
}
|
|
1702
|
+
designPath(r, e) {
|
|
1703
|
+
return `business/${k.getBusinessId()}/membership/design/${r}.${this.fileExtension(e)}`;
|
|
1694
1704
|
},
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
icon: "editor_choice",
|
|
1698
|
-
get name() {
|
|
1699
|
-
return w.global.t("connect.campaign.common.typeName.REWARD_POOL");
|
|
1700
|
-
},
|
|
1701
|
-
chip() {
|
|
1702
|
-
return P(this);
|
|
1703
|
-
}
|
|
1705
|
+
bundleImagePath(r, e) {
|
|
1706
|
+
return `business/${k.getBusinessId()}/membership/bundles/${r || this.generateId(e)}`;
|
|
1704
1707
|
},
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
icon: "monetization_on",
|
|
1708
|
-
get name() {
|
|
1709
|
-
return w.global.t("connect.campaign.common.typeName.COIN");
|
|
1710
|
-
},
|
|
1711
|
-
chip() {
|
|
1712
|
-
return P(this);
|
|
1713
|
-
}
|
|
1708
|
+
collectibleImagePath(r, e) {
|
|
1709
|
+
return `business/${k.getBusinessId()}/membership/collectibles/${r || this.generateId(e)}`;
|
|
1714
1710
|
},
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
icon: "",
|
|
1718
|
-
get name() {
|
|
1719
|
-
return w.global.t("connect.campaign.common.typeName.MEMBERSHIP");
|
|
1720
|
-
},
|
|
1721
|
-
chip() {
|
|
1722
|
-
return P(this);
|
|
1723
|
-
}
|
|
1711
|
+
tierImagePath(r, e) {
|
|
1712
|
+
return `business/${k.getBusinessId()}/membership/tiers/${r || this.generateId(e)}`;
|
|
1724
1713
|
},
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
icon: "editor_choice",
|
|
1728
|
-
get name() {
|
|
1729
|
-
return w.global.t("connect.campaign.common.typeName.MISSION");
|
|
1730
|
-
},
|
|
1731
|
-
chip() {
|
|
1732
|
-
return P(this);
|
|
1733
|
-
}
|
|
1714
|
+
referralTermAndConditionPath() {
|
|
1715
|
+
return `business/${k.getBusinessId()}/membership/referral/term_and_condition.pdf`;
|
|
1734
1716
|
},
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
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);
|
|
1742
1724
|
}
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
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
|
+
});
|
|
1771
1779
|
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
a.timeframeOptions.start ?? F().subtract(1, "d"),
|
|
1800
|
-
a.timeframeOptions.end ?? F().add(1, "d")
|
|
1801
|
-
) ? "active" : F().isAfter(a.timeframeOptions.end) ? "expired" : "upcoming" : "active";
|
|
1802
|
-
}
|
|
1803
|
-
function Lt(a) {
|
|
1804
|
-
var e, t;
|
|
1805
|
-
switch (a.event.type) {
|
|
1806
|
-
case "BILL_COMPLETED":
|
|
1807
|
-
const s = `Spend to get ${j.formattedType(a.type)}`;
|
|
1808
|
-
switch (a.type) {
|
|
1809
|
-
case "POINT":
|
|
1810
|
-
case "CREDIT":
|
|
1811
|
-
case "COIN":
|
|
1812
|
-
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)}`;
|
|
1813
|
-
case "VOUCHER":
|
|
1814
|
-
const i = (t = (e = a == null ? void 0 : a.pf_collectible) == null ? void 0 : e.extras) == null ? void 0 : t.effect;
|
|
1815
|
-
return i ? `${s} - ${Z(i)}` : s;
|
|
1816
|
-
default:
|
|
1817
|
-
return s;
|
|
1818
|
-
}
|
|
1819
|
-
case "FEEDBACK":
|
|
1820
|
-
return `Give feedback to receive ${j.formattedType(a.type)}`;
|
|
1821
|
-
case "SCHEDULE":
|
|
1822
|
-
return `Receive ${j.formattedType(a.type)} on scheduled time`;
|
|
1823
|
-
case "SIMPLE_CLAIM":
|
|
1824
|
-
return "Simple claim voucher";
|
|
1825
|
-
case "TIER_UPGRADED":
|
|
1826
|
-
return `Receive ${j.formattedType(a.type)} when member tier upgraded`;
|
|
1827
|
-
case "MEMBERSHIP_JOINED":
|
|
1828
|
-
return `Receive ${j.formattedType(a.type)} when member joined`;
|
|
1829
|
-
case "MAKING_ORDER":
|
|
1830
|
-
return a.type !== "PROMOTION" ? void 0 : Z(a.effect);
|
|
1831
|
-
default:
|
|
1832
|
-
throw new Error(
|
|
1833
|
-
`Not implemented ${JSON.stringify({ cause: a.event.type })}`
|
|
1834
|
-
);
|
|
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);
|
|
1835
1807
|
}
|
|
1836
|
-
}
|
|
1808
|
+
};
|
|
1837
1809
|
export {
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1810
|
+
St as a,
|
|
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
|
|
1843
1818
|
};
|