@feedmepos/mf-connect 0.1.98-beta.21 → 0.1.98-beta.22
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/{App-B3f8GWoR.js → App-DkvPrOD_.js} +10 -9
- package/dist/{AuditLogs-LRHzzpqj.js → AuditLogs-CWYsiJmS.js} +9 -9
- package/dist/{Bin-Y761Ua4-.js → Bin-BeuBpKQM.js} +8 -8
- package/dist/{Broadcast-CdRuG42N.js → Broadcast-Dm-HdR4q.js} +13 -12
- package/dist/CampaignAnalytic-DipDONF1.js +1656 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsULDH9l.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4wbIGp6.js} +6 -5
- package/dist/{Card-GZ3ZLnBl.js → Card-i5EhYfDp.js} +18 -18
- package/dist/{Collections-B59fL-oS.js → Collections-B4lpotjz.js} +14 -13
- package/dist/{Credit-DJxzXBam.js → Credit-DbK_BdJJ.js} +119 -93
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C3d8frgZ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-B8Soqc5E.js} +34 -30
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DKUFvacX.js → EffectSheet.vue_vue_type_style_index_0_lang-DzdJH_eS.js} +6 -6
- package/dist/{Experience-lzpvYFPP.js → Experience-W3vkkzi6.js} +112 -86
- package/dist/{FileSaver.min-BXoEv5ve.js → FileSaver.min-BI4NzqgX.js} +1 -1
- package/dist/Game-fftjNIOx.js +356 -0
- package/dist/{Grab-BQgS104D.js → Grab-CMQ8P4g9.js} +32 -31
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Cz9iB9ox.js → ImageInput.vue_vue_type_script_setup_true_lang-DUi11pWY.js} +1 -1
- package/dist/{Index-B5UTBbUy.js → Index-Cnztjepd.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CLLhy4-v.js → LocationPicker.vue_vue_type_script_setup_true_lang-Dy8WW9eT.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BiIqs4zW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DTHvv2lB.js} +1 -1
- package/dist/LoyaltyDashboard-1gKZWq0g.js +1339 -0
- package/dist/{MainLayout-AvQ4_-oT.js → MainLayout-CfKJ6l-r.js} +1 -1
- package/dist/{Marketing-Bn1ygF8d.js → Marketing-Dk_nSJuC.js} +4 -4
- package/dist/{MarketingMaterialEdit-Cw-VPVqE.js → MarketingMaterialEdit-DnO9DNuB.js} +6 -6
- package/dist/{Member-CpEXFHIF.js → Member-CpXKw34e.js} +11 -11
- package/dist/{MemberList-gSEw_idJ.js → MemberList-8ppDIsaQ.js} +36 -35
- package/dist/{MemberTransactions-DEMzj9-y.js → MemberTransactions-B52DV6hR.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B4Y5KPpw.js → MessageInput.vue_vue_type_script_setup_true_lang-Di0tBK7t.js} +4400 -4431
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-B1Yj3odA.js +38 -0
- package/dist/Mission-dT284_xH.js +360 -0
- package/dist/{Overview-CMudFYOc.js → Overview-CUXmQ5AN.js} +3 -3
- package/dist/{Overview-DjNcF88f.js → Overview-CePgs6nV.js} +18 -18
- package/dist/Point-BLr01-Fi.js +288 -0
- package/dist/Promotion-BJUWwJir.js +423 -0
- package/dist/{Queue-BjoAJoVe.js → Queue-DpjzPA9X.js} +16 -16
- package/dist/{Record-CfZFuwy_.js → Record-D5iz3VhQ.js} +9 -9
- package/dist/{Review-pIAxbjVU.js → Review-BIDSfZ-d.js} +2 -2
- package/dist/{ReviewFacebookCallback-BRW4T-5-.js → ReviewFacebookCallback-Cl4apd5U.js} +5 -5
- package/dist/{ReviewGoogleCallback-B-6EojXR.js → ReviewGoogleCallback-CxQ3jv5Z.js} +5 -5
- package/dist/{Reward-_pdE2XZp.js → Reward-FhUo0v2c.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-S5dh0IGc.js → RewardGroup.vue_vue_type_script_setup_true_lang-9Fdl4-Zk.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-C9B7NmF0.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bh1rez91.js} +16 -15
- package/dist/{Segment-B1EMe-LZ.js → Segment-XrwahyNZ.js} +39 -37
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DAmjk8b3.js → SelectItems.vue_vue_type_script_setup_true_lang-Bd_O16Eo.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7sgPf8l.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CB0bY0pg.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DVYTZr_E.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B1-fwLJq.js} +4 -4
- package/dist/{Setting-CQQ6zacB.js → Setting-Cs5abyWq.js} +40 -40
- package/dist/{SettingAdvertisements-9Wl9VWbM.js → SettingAdvertisements-C0NbeiB9.js} +12 -12
- package/dist/{Settings-Bvj2ChDR.js → Settings-xdy_sV8_.js} +5 -5
- package/dist/{Store-BdUZ22g6.js → Store-BVn4DGJN.js} +21 -21
- package/dist/{StoreRewards-DsUS_Lu1.js → StoreRewards-BnEDugiP.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Zw-lIDCN.js → StoreTransactions.vue_vue_type_script_setup_true_lang-B63UqQ0d.js} +21 -21
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BECp3eqQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BOIUqr5c.js} +2 -2
- package/dist/{Tier-2-mJ3SNK.js → Tier-BdyyZ6S8.js} +36 -34
- package/dist/{Title-BjeEDjxl.js → Title-Y7GfS9n5.js} +39 -37
- package/dist/{Transaction--U_kJKec.js → Transaction-DF217QY1.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BkLyvjA5.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-QrbU0JEl.js} +6 -6
- package/dist/{Voucher-INa3N_6V.js → Voucher-q9JMtbmK.js} +156 -133
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-4Quzmc7-.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Cm040eE9.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CPCnBExY.js → ZodTextField.vue_vue_type_script_setup_true_lang-DibJzz40.js} +2 -2
- package/dist/{app-Dlqr-LX4.js → app-BZJkvDm7.js} +3279 -3135
- package/dist/app.js +1 -1
- package/dist/{business-DWrfGEe_.js → business-akMhlJ-M.js} +1 -1
- package/dist/{campaign-DtNt-BqN.js → campaign-BDXIKhhi.js} +74 -96
- package/dist/campaign-hm_reShF.js +100 -0
- package/dist/{campaign.enum-B9-ZpK0C.js → campaign.enum-Dx-Zo68Q.js} +1 -1
- package/dist/{campaign.fn-COxaWmi_.js → campaign.fn-BFI2Flc_.js} +126 -126
- package/dist/{collectible.enum-CF0VF-r7.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/collection.fn-RUGxb2Zd.js +26 -0
- package/dist/{duplicateCampaign-8ciT68QF.js → duplicateCampaign-DsGtbLbP.js} +2 -2
- package/dist/{effect-CaSn-84h.js → effect-8iyz8Uq4.js} +1 -1
- package/dist/{email-addresses-BiMQ8xIx.js → email-addresses-gyl-C-R_.js} +2 -2
- package/dist/{export-BwBNgCo5.js → export-wupBk3du.js} +3 -3
- package/dist/{helper-CajV_0CM.js → helper-CaxDAXPt.js} +1 -1
- package/dist/{index-CQIciFrH.js → index-BMin5EVt.js} +1 -1
- package/dist/{index-CQj9BQlQ.js → index-BO9SkdZr.js} +105 -123
- package/dist/index-BOcaalDh.js +146 -0
- package/dist/{index-B6ldAC8Y.js → index-BQmxPtoj.js} +1 -1
- package/dist/{index-B6tm_U_M.js → index-Bic6MeUk.js} +18 -17
- package/dist/{index-D1vhLY7l.js → index-C4drX0Ls.js} +1 -1
- package/dist/index-C8cXXcLk.js +45 -0
- package/dist/{index-DBUTFa2h.js → index-CG66mIC4.js} +2 -2
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-Bqcfsd4p.js → index-Cw-UC5sx.js} +8 -7
- package/dist/{index-D1--K-QL.js → index-D4BfoKjK.js} +1 -1
- package/dist/{index-DWBKko92.js → index-DhQlBP7P.js} +6 -6
- package/dist/{index-J8pSZ3WO.js → index-Dvf0YXyw.js} +1 -1
- package/dist/{index-BP5rdioN.js → index-J3y4ZPL5.js} +8027 -10766
- package/dist/{index-CjW6Mj-1.js → index-bZhlsMWI.js} +1 -1
- package/dist/{index-B0ohh62P.js → index-xGCLj50g.js} +230 -351
- package/dist/{index-D90p28Hr.js → index-yYZu6iPh.js} +205 -229
- package/dist/{index.esm2017-QlPanYiW.js → index.esm2017-DgAjf49-.js} +1 -1
- package/dist/{loading-CqqkzWSm.js → loading-DIme5B41.js} +1 -1
- package/dist/{lodash-DmbW2QhA.js → lodash-ssnk3xgl.js} +1 -1
- package/dist/{membership-Dcwyu-rr.js → membership-CNHGvM-v.js} +3 -3
- package/dist/{money-DWr1gi--.js → money-CxE1yyP-.js} +1 -1
- package/dist/{number-CHhHAd1q.js → number-MuiSu5EH.js} +1 -1
- package/dist/{objectid-BsiuHVH8.js → objectid-BKst2tcL.js} +9 -9
- package/dist/{plugins-BxmMI8fo.js → plugins-J8P61v6q.js} +3 -3
- package/dist/{reward-DX0FjsNT.js → reward-CvyDLx6u.js} +1 -1
- package/dist/{rule-DDLcqiHH.js → rule-CidUfHRV.js} +3 -3
- package/dist/rule-builder-CzSwZHFX.js +126 -0
- package/dist/{template-C0lF82yv.js → template-DDFGgRca.js} +6 -6
- package/dist/timezone-C55-EXUa.js +20 -0
- package/dist/{trigger-CsJcg_RY.js → trigger-BHmznST2.js} +5 -5
- package/dist/{useMarketingMaterialActions-B0iV6YzB.js → useMarketingMaterialActions-CRGy07Kl.js} +3 -3
- package/dist/{usePagination-4EISkyGW.js → usePagination-nKd3ToBL.js} +1 -1
- package/dist/{user-DZuSeqRY.js → user-CxxLM4oI.js} +1 -1
- package/dist/{vue-i18n-BKcwYlp1.js → vue-i18n-BIqCnVyc.js} +300 -300
- package/dist/{xlsx-C-7dia55.js → xlsx-CUqEhJg1.js} +1 -1
- package/dist/{zod-DPxXVSRw.js → zod-B3g-tD-1.js} +1 -1
- package/package.json +1 -1
- package/dist/Game-KCxIpXEC.js +0 -330
- package/dist/LoyaltyDashboard-DPHWpaNJ.js +0 -1082
- package/dist/Mission-DMtpauNQ.js +0 -334
- package/dist/Point-CgdTrgXc.js +0 -262
- package/dist/Promotion-DDQodFDb.js +0 -397
- package/dist/campaign-un9Ji1KF.js +0 -219
package/dist/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as i, computed as u } from "vue";
|
|
2
2
|
import { defineStore as w } from "pinia";
|
|
3
3
|
import { useCoreStore as y } from "@feedmepos/mf-common";
|
|
4
|
-
import { a as I, g as r, A as b, S, b as D } from "./index-
|
|
4
|
+
import { a as I, g as r, A as b, S, b as D } from "./index-CG66mIC4.js";
|
|
5
5
|
const $ = {
|
|
6
6
|
async readSettings(e) {
|
|
7
7
|
try {
|
|
@@ -1,67 +1,45 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./index-
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { u as C } from "./business-DWrfGEe_.js";
|
|
10
|
-
import { C as m } from "./campaign.fn-COxaWmi_.js";
|
|
1
|
+
import { h as i } from "./moment-D7p2TMB-.js";
|
|
2
|
+
import "./index-yYZu6iPh.js";
|
|
3
|
+
import { e as p } from "./effect-8iyz8Uq4.js";
|
|
4
|
+
import { components as f } from "@feedmepos/ui-library";
|
|
5
|
+
import { i as y } from "./rule-builder-CzSwZHFX.js";
|
|
6
|
+
import { c as h } from "./rule-CidUfHRV.js";
|
|
7
|
+
import { u as O } from "./business-akMhlJ-M.js";
|
|
8
|
+
import { C as m } from "./campaign.fn-BFI2Flc_.js";
|
|
11
9
|
import { c as g } from "./string-Gcy5IM_H.js";
|
|
12
|
-
import { i as d } from "./plugins-
|
|
13
|
-
import { h as
|
|
14
|
-
import { F as a } from "./campaign.enum-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
case "PROMOTION":
|
|
18
|
-
return "Promotion";
|
|
19
|
-
case "VOUCHER":
|
|
20
|
-
return "Voucher";
|
|
21
|
-
case "CREDIT":
|
|
22
|
-
return "Credit";
|
|
23
|
-
case "POINT":
|
|
24
|
-
return "Experience";
|
|
25
|
-
case "COIN":
|
|
26
|
-
return "Point";
|
|
27
|
-
case "GAME":
|
|
28
|
-
return "Game";
|
|
29
|
-
default:
|
|
30
|
-
return e;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const G = {
|
|
34
|
-
formattedType: E
|
|
35
|
-
}, o = d.global.t;
|
|
36
|
-
function I() {
|
|
10
|
+
import { i as d } from "./plugins-J8P61v6q.js";
|
|
11
|
+
import { h as s } from "vue";
|
|
12
|
+
import { F as a } from "./campaign.enum-Dx-Zo68Q.js";
|
|
13
|
+
const n = d.global.t;
|
|
14
|
+
function C() {
|
|
37
15
|
const e = d.global.locale;
|
|
38
16
|
return typeof e == "string" ? e : e.value;
|
|
39
17
|
}
|
|
40
18
|
function u(e) {
|
|
41
|
-
return new Intl.DateTimeFormat(
|
|
19
|
+
return new Intl.DateTimeFormat(C(), {
|
|
42
20
|
day: "2-digit",
|
|
43
21
|
month: "short",
|
|
44
22
|
year: "numeric"
|
|
45
23
|
}).format(new Date(e));
|
|
46
24
|
}
|
|
47
25
|
function c(e) {
|
|
48
|
-
return
|
|
26
|
+
return s(
|
|
49
27
|
"div",
|
|
50
28
|
{
|
|
51
29
|
class: `${e.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
|
|
52
30
|
},
|
|
53
31
|
[
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
s(f.FmIcon, { size: "sm", name: e.icon, outline: !0 }),
|
|
33
|
+
s("span", { class: "fm-typo-en-body-md-600" }, e.name)
|
|
56
34
|
]
|
|
57
35
|
);
|
|
58
36
|
}
|
|
59
|
-
const
|
|
37
|
+
const P = {
|
|
60
38
|
[a.enum.CREDIT]: {
|
|
61
39
|
chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
|
|
62
40
|
icon: "local_activity",
|
|
63
41
|
get name() {
|
|
64
|
-
return
|
|
42
|
+
return n("connect.campaign.common.typeName.CREDIT");
|
|
65
43
|
},
|
|
66
44
|
chip() {
|
|
67
45
|
return c(this);
|
|
@@ -71,7 +49,7 @@ const H = {
|
|
|
71
49
|
chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
|
|
72
50
|
icon: "loyalty",
|
|
73
51
|
get name() {
|
|
74
|
-
return
|
|
52
|
+
return n("connect.campaign.common.typeName.PROMOTION");
|
|
75
53
|
},
|
|
76
54
|
chip() {
|
|
77
55
|
return c(this);
|
|
@@ -81,7 +59,7 @@ const H = {
|
|
|
81
59
|
chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
|
|
82
60
|
icon: "sell",
|
|
83
61
|
get name() {
|
|
84
|
-
return
|
|
62
|
+
return n("connect.campaign.common.typeName.VOUCHER");
|
|
85
63
|
},
|
|
86
64
|
chip() {
|
|
87
65
|
return c(this);
|
|
@@ -91,7 +69,7 @@ const H = {
|
|
|
91
69
|
chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
|
|
92
70
|
icon: "award_star",
|
|
93
71
|
get name() {
|
|
94
|
-
return
|
|
72
|
+
return n("connect.campaign.common.typeName.POINT");
|
|
95
73
|
},
|
|
96
74
|
chip() {
|
|
97
75
|
return c(this);
|
|
@@ -101,7 +79,7 @@ const H = {
|
|
|
101
79
|
chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
102
80
|
icon: "campaign",
|
|
103
81
|
get name() {
|
|
104
|
-
return
|
|
82
|
+
return n("connect.campaign.common.typeName.BROADCAST");
|
|
105
83
|
},
|
|
106
84
|
chip() {
|
|
107
85
|
return c(this);
|
|
@@ -111,7 +89,7 @@ const H = {
|
|
|
111
89
|
chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
|
|
112
90
|
icon: "database",
|
|
113
91
|
get name() {
|
|
114
|
-
return
|
|
92
|
+
return n("connect.campaign.common.typeName.GAME");
|
|
115
93
|
},
|
|
116
94
|
chip() {
|
|
117
95
|
return c(this);
|
|
@@ -121,7 +99,7 @@ const H = {
|
|
|
121
99
|
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
122
100
|
icon: "editor_choice",
|
|
123
101
|
get name() {
|
|
124
|
-
return
|
|
102
|
+
return n("connect.campaign.common.typeName.REWARD_POOL");
|
|
125
103
|
},
|
|
126
104
|
chip() {
|
|
127
105
|
return c(this);
|
|
@@ -131,7 +109,7 @@ const H = {
|
|
|
131
109
|
chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
|
|
132
110
|
icon: "monetization_on",
|
|
133
111
|
get name() {
|
|
134
|
-
return
|
|
112
|
+
return n("connect.campaign.common.typeName.COIN");
|
|
135
113
|
},
|
|
136
114
|
chip() {
|
|
137
115
|
return c(this);
|
|
@@ -141,7 +119,7 @@ const H = {
|
|
|
141
119
|
chipClass: "",
|
|
142
120
|
icon: "",
|
|
143
121
|
get name() {
|
|
144
|
-
return
|
|
122
|
+
return n("connect.campaign.common.typeName.MEMBERSHIP");
|
|
145
123
|
},
|
|
146
124
|
chip() {
|
|
147
125
|
return c(this);
|
|
@@ -151,7 +129,7 @@ const H = {
|
|
|
151
129
|
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
152
130
|
icon: "editor_choice",
|
|
153
131
|
get name() {
|
|
154
|
-
return
|
|
132
|
+
return n("connect.campaign.common.typeName.MISSION");
|
|
155
133
|
},
|
|
156
134
|
chip() {
|
|
157
135
|
return c(this);
|
|
@@ -166,87 +144,87 @@ const H = {
|
|
|
166
144
|
}
|
|
167
145
|
}
|
|
168
146
|
};
|
|
169
|
-
function
|
|
170
|
-
const t =
|
|
147
|
+
function L(e) {
|
|
148
|
+
const t = b(e), o = {
|
|
171
149
|
active: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
172
150
|
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
173
151
|
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
174
152
|
};
|
|
175
|
-
return e.type == "VOUCHER" ?
|
|
176
|
-
class:
|
|
177
|
-
label: g.title(
|
|
153
|
+
return e.type == "VOUCHER" ? s(f.FmChip, {
|
|
154
|
+
class: o[t],
|
|
155
|
+
label: g.title(n(`connect.campaign.common.status.${t}`)),
|
|
178
156
|
compact: !0
|
|
179
|
-
}) :
|
|
180
|
-
class:
|
|
181
|
-
label: g.title(
|
|
157
|
+
}) : s(f.FmChip, {
|
|
158
|
+
class: o[t],
|
|
159
|
+
label: g.title(n(`connect.campaign.common.status.${t}`)),
|
|
182
160
|
compact: !0
|
|
183
161
|
});
|
|
184
162
|
}
|
|
185
|
-
function
|
|
163
|
+
function w(e) {
|
|
186
164
|
const t = e.timeframeOptions;
|
|
187
165
|
if (!t || !t.start && !t.end)
|
|
188
|
-
return
|
|
166
|
+
return n("connect.campaign.common.always_active");
|
|
189
167
|
if (!t.start && t.end)
|
|
190
|
-
return
|
|
168
|
+
return n("connect.campaign.common.valid_until", {
|
|
191
169
|
date: u(t.end)
|
|
192
170
|
});
|
|
193
|
-
const
|
|
194
|
-
return `${
|
|
171
|
+
const o = u(t.start), r = t.end ? u(t.end) : n("connect.campaign.common.unlimited");
|
|
172
|
+
return `${o} -> ${r}`;
|
|
195
173
|
}
|
|
196
|
-
function
|
|
174
|
+
function E(e) {
|
|
175
|
+
if (!e || !e.start && !e.end)
|
|
176
|
+
return "connect.campaign.common.always";
|
|
177
|
+
const t = e.start ? i(e.start).format("DD MMM YYYY") : "From campaign creation", o = e.end ? i(e.end).format("DD MMM YYYY") : "Never ends";
|
|
178
|
+
return `${t} - ${o}`;
|
|
179
|
+
}
|
|
180
|
+
function Y(e) {
|
|
197
181
|
const { campaign: t } = e;
|
|
198
|
-
function r(n) {
|
|
199
|
-
if (!n || !n.start && !n.end)
|
|
200
|
-
return "connect.campaign.common.always";
|
|
201
|
-
const i = n.start ? u(n.start) : "From campaign creation", y = n.end ? u(n.end) : "Never ends";
|
|
202
|
-
return `${i} - ${y}`;
|
|
203
|
-
}
|
|
204
182
|
return {
|
|
205
183
|
"connect.campaign.common.campaign_name": t.name,
|
|
206
|
-
"connect.campaign.common.campaign_period":
|
|
184
|
+
"connect.campaign.common.campaign_period": E(
|
|
207
185
|
t.timeframeOptions
|
|
208
186
|
),
|
|
209
187
|
get "connect.campaign.common.next_schedule_at"() {
|
|
210
|
-
if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !
|
|
188
|
+
if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !y(t.event.rule))
|
|
211
189
|
return;
|
|
212
|
-
const
|
|
190
|
+
const o = h(
|
|
213
191
|
t.event.rule.rules.g_schedule
|
|
214
192
|
);
|
|
215
|
-
return
|
|
193
|
+
return o ? i(o).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
|
|
216
194
|
},
|
|
217
195
|
get "connect.campaign.common.discount_type"() {
|
|
218
|
-
if (t.type == "PROMOTION") return
|
|
196
|
+
if (t.type == "PROMOTION") return p(t.effect);
|
|
219
197
|
if ("configs" in e && e.configs.type == "VOUCHER")
|
|
220
|
-
return
|
|
198
|
+
return p(e.configs.extras.effect);
|
|
221
199
|
},
|
|
222
200
|
get "connect.campaign.common.available_at"() {
|
|
223
201
|
return t.targetLocation ? t.targetLocation.length > 0 ? t.targetLocation.map(
|
|
224
|
-
(
|
|
202
|
+
(o) => O().locationItems.find((r) => r.value == o).label
|
|
225
203
|
).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
|
|
226
204
|
}
|
|
227
205
|
};
|
|
228
206
|
}
|
|
229
|
-
function
|
|
230
|
-
return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ?
|
|
231
|
-
e.timeframeOptions.start ??
|
|
232
|
-
e.timeframeOptions.end ??
|
|
233
|
-
) ? "active" :
|
|
207
|
+
function b(e) {
|
|
208
|
+
return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ? i().isBetween(
|
|
209
|
+
e.timeframeOptions.start ?? i().subtract(1, "d"),
|
|
210
|
+
e.timeframeOptions.end ?? i().add(1, "d")
|
|
211
|
+
) ? "active" : i().isAfter(e.timeframeOptions.end) ? "expired" : "upcoming" : "active";
|
|
234
212
|
}
|
|
235
|
-
function
|
|
236
|
-
var t,
|
|
213
|
+
function B(e) {
|
|
214
|
+
var t, o;
|
|
237
215
|
switch (e.event.type) {
|
|
238
216
|
case "BILL_COMPLETED":
|
|
239
|
-
const
|
|
217
|
+
const r = `Spend to get ${m.formattedType(e.type)}`;
|
|
240
218
|
switch (e.type) {
|
|
241
219
|
case "POINT":
|
|
242
220
|
case "CREDIT":
|
|
243
221
|
case "COIN":
|
|
244
222
|
return e.earningOption.type == "FIXED" ? `Spend to get ${e.earningOption.amount} ${m.formattedType(e.type)}` : `Every ${e.earningOption.every} amount spent get ${e.earningOption.amount} ${m.formattedType(e.type)}`;
|
|
245
223
|
case "VOUCHER":
|
|
246
|
-
const
|
|
247
|
-
return
|
|
224
|
+
const l = (o = (t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.extras) == null ? void 0 : o.effect;
|
|
225
|
+
return l ? `${r} - ${p(l)}` : r;
|
|
248
226
|
default:
|
|
249
|
-
return
|
|
227
|
+
return r;
|
|
250
228
|
}
|
|
251
229
|
case "FEEDBACK":
|
|
252
230
|
return `Give feedback to receive ${m.formattedType(e.type)}`;
|
|
@@ -259,7 +237,7 @@ function V(e) {
|
|
|
259
237
|
case "MEMBERSHIP_JOINED":
|
|
260
238
|
return `Receive ${m.formattedType(e.type)} when member joined`;
|
|
261
239
|
case "MAKING_ORDER":
|
|
262
|
-
return e.type !== "PROMOTION" ? void 0 :
|
|
240
|
+
return e.type !== "PROMOTION" ? void 0 : p(e.effect);
|
|
263
241
|
default:
|
|
264
242
|
throw new Error(
|
|
265
243
|
`Not implemented ${JSON.stringify({ cause: e.event.type })}`
|
|
@@ -267,11 +245,11 @@ function V(e) {
|
|
|
267
245
|
}
|
|
268
246
|
}
|
|
269
247
|
export {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
248
|
+
P as C,
|
|
249
|
+
b as a,
|
|
250
|
+
L as b,
|
|
251
|
+
B as c,
|
|
252
|
+
Y as d,
|
|
253
|
+
w as g,
|
|
254
|
+
E as s
|
|
277
255
|
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineStore as d } from "pinia";
|
|
2
|
+
import { reactive as b, onMounted as f, ref as s } from "vue";
|
|
3
|
+
import { c } from "./index-BOcaalDh.js";
|
|
4
|
+
import { g as i, S as g, b as h } from "./index-CG66mIC4.js";
|
|
5
|
+
const p = () => {
|
|
6
|
+
const e = g.getBusinessId();
|
|
7
|
+
if (!e) throw new Error("Invalid business ID");
|
|
8
|
+
return h(`businesses/${e}/campaigns`, {
|
|
9
|
+
noIdRequired: !0
|
|
10
|
+
});
|
|
11
|
+
}, I = {
|
|
12
|
+
async readAll() {
|
|
13
|
+
return i(await p().get("templates"));
|
|
14
|
+
},
|
|
15
|
+
async readById(e) {
|
|
16
|
+
return i(
|
|
17
|
+
await p().get(`templates/${e}`)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}, A = d("mf-connect-campaign", () => {
|
|
21
|
+
const e = b({
|
|
22
|
+
promotion: [],
|
|
23
|
+
voucher: [],
|
|
24
|
+
broadcast: [],
|
|
25
|
+
experience: [],
|
|
26
|
+
point: [],
|
|
27
|
+
credit: [],
|
|
28
|
+
token: [],
|
|
29
|
+
mission: [],
|
|
30
|
+
grab: [],
|
|
31
|
+
all: []
|
|
32
|
+
});
|
|
33
|
+
f(() => {
|
|
34
|
+
console.log("🔧 CampaignStore Installed");
|
|
35
|
+
});
|
|
36
|
+
const t = s([]), r = s([]), n = s([]);
|
|
37
|
+
async function u(k) {
|
|
38
|
+
const o = await c.readAll({
|
|
39
|
+
limit: 1e3,
|
|
40
|
+
skip: 0,
|
|
41
|
+
sortBy: "_id",
|
|
42
|
+
descending: !0
|
|
43
|
+
});
|
|
44
|
+
Object.keys(e).forEach((a) => {
|
|
45
|
+
e[a] = [];
|
|
46
|
+
}), e.all = o.resources.filter(
|
|
47
|
+
(a) => a.type !== "MEMBERSHIP"
|
|
48
|
+
);
|
|
49
|
+
for (const a of o.resources)
|
|
50
|
+
switch (a.type) {
|
|
51
|
+
case "PROMOTION":
|
|
52
|
+
e.promotion.push(a);
|
|
53
|
+
break;
|
|
54
|
+
case "VOUCHER":
|
|
55
|
+
e.voucher.push(a), n.value.push(a);
|
|
56
|
+
break;
|
|
57
|
+
case "BROADCAST":
|
|
58
|
+
["SCHEDULE", "FEEDBACK"].includes(a.event.type) && e.broadcast.push(a);
|
|
59
|
+
break;
|
|
60
|
+
case "POINT":
|
|
61
|
+
e.experience.push(a);
|
|
62
|
+
break;
|
|
63
|
+
case "COIN":
|
|
64
|
+
e.point.push(a);
|
|
65
|
+
break;
|
|
66
|
+
case "CREDIT":
|
|
67
|
+
e.credit.push(a);
|
|
68
|
+
break;
|
|
69
|
+
case "GAME":
|
|
70
|
+
e.token.push(a);
|
|
71
|
+
break;
|
|
72
|
+
case "MISSION":
|
|
73
|
+
e.mission.push(a);
|
|
74
|
+
break;
|
|
75
|
+
case "GRAB":
|
|
76
|
+
e.grab.push(a);
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async function l() {
|
|
81
|
+
r.value = await c.readGroups();
|
|
82
|
+
}
|
|
83
|
+
async function m() {
|
|
84
|
+
t.value = await I.readAll();
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
// State
|
|
88
|
+
campaigns: e,
|
|
89
|
+
templates: t,
|
|
90
|
+
groups: r,
|
|
91
|
+
voucher: n,
|
|
92
|
+
// Actions
|
|
93
|
+
read: u,
|
|
94
|
+
readGroups: l,
|
|
95
|
+
readTemplates: m
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
export {
|
|
99
|
+
A as u
|
|
100
|
+
};
|