@feedmepos/mf-connect 0.1.0-beta.9 → 0.1.0-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Analytic-D1vIDmhJ.js +620 -0
- package/dist/{App-DQUbRsdA.js → App-DHrfWG8l.js} +249 -250
- package/dist/Broadcast-B2rxZAZi.js +216 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-BFllvG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js} +20 -20
- package/dist/Card-Dr6pTTM0.js +824 -0
- package/dist/Collections-0tbg0MFt.js +441 -0
- package/dist/Credit-KbB_7Jq-.js +214 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js} +999 -1018
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js +344 -0
- package/dist/Experience-C_Q9Iml8.js +211 -0
- package/dist/Game-BwODw7M6.js +250 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
- package/dist/Marketing-QOKTAS_T.js +309 -0
- package/dist/Member-d7RIGRm1.js +92 -0
- package/dist/MemberList-CK9629ew.js +1737 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-zSxSnUkK.js → MemberTransactions-D-pnlXiP.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js +203 -0
- package/dist/Mission-BAKDm4VZ.js +248 -0
- package/dist/Point-Puu0jKz0.js +220 -0
- package/dist/Promotion-DRIaUvJi.js +244 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTKKhH-r.js → RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js} +557 -557
- package/dist/Segment-DpBxGuuu.js +435 -0
- package/dist/Setting-DLB2ywCp.js +1870 -0
- package/dist/Store-8DO6ITWc.js +1513 -0
- package/dist/StoreRewards-DZfqUeYR.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-2Jqj_rKv.js → StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BkdSj0cX.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js} +1 -1
- package/dist/{Tier-Cpl0FV8L.js → Tier-BnQRujpX.js} +453 -481
- package/dist/{Title-CbMDd1Et.js → Title-BPf1tUFx.js} +295 -314
- package/dist/Transaction-ese0oNrz.js +36 -0
- package/dist/Voucher--gtOZQx1.js +485 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/app-Bt59niI-.js +2974 -0
- package/dist/{app-VxaUCtgl.js → app-DHE61XdR.js} +1 -1
- package/dist/app.js +3 -5
- package/dist/{business-DR7jpnLz.js → business-BSo7EPan.js} +1 -1
- package/dist/{campaign-MqcTb329.js → campaign-CsOje3Ap.js} +3 -5
- package/dist/{collection.fn-CvEoe61K.js → collection.fn-BYQfFJOr.js} +2 -2
- package/dist/dto-CfEXSCq6.js +1145 -0
- package/dist/{effect-BjjQeiQg.js → effect-Bn_ofYS3.js} +9 -9
- package/dist/{export-B8cvWh5n.js → export-CMR243CF.js} +3 -3
- package/dist/{helper-DfgVNY7B.js → helper-BqOQRtvW.js} +1 -1
- package/dist/index-BLDYTxnc.js +28058 -0
- package/dist/{index-C2JNcGc-.js → index-BWnFs-Cb.js} +281 -299
- package/dist/{index-B5NufbUt.js → index-BaBNmzUb.js} +1 -1
- package/dist/{index-CWR3qYjb.js → index-Boo5np6l.js} +1 -1
- package/dist/{index-BsfWRB8R.js → index-CC1GV8OW.js} +1 -1
- package/dist/{index-0UYoh1-7.js → index-CHO4_zsT.js} +1 -1
- package/dist/{index-2P9w5u3m.js → index-DEZsrQ2f.js} +3 -3
- package/dist/{index-C7zMfUgy.js → index-D_f2lmK2.js} +1 -1
- package/dist/{index-Dap5R3vr.js → index-Da142OER.js} +66 -78
- package/dist/index-DbP04yeg.js +11 -0
- package/dist/{index-DBy30v8N.js → index-DtPe-TEm.js} +3 -3
- package/dist/{index-CJ8Uh2Ja.js → index-FvlaxwGB.js} +3 -3
- package/dist/{index.esm2017-D1X3PgpO.js → index.esm2017-ePm--Atp.js} +55 -55
- package/dist/{loading-CJ3nOovJ.js → loading-KNmEMBUB.js} +460 -469
- package/dist/{membership-B1cmSRyk.js → membership-DKoVIS1a.js} +3 -3
- package/dist/money-CkD3zl5C.js +15 -0
- package/dist/number-BDsGpOXm.js +12 -0
- package/dist/{rule-ChWyR-0j.js → rule-CzamI50_.js} +2 -2
- package/dist/{rule-builder-CSmOONdb.js → rule-builder-DHf6wfaQ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-Cug7aRK0.js → template-CFAIPoD7.js} +63 -63
- package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
- package/dist/{xlsx-CfgPFFvp.js → xlsx-BDJMaozs.js} +517 -517
- package/package.json +4 -7
- package/dist/Analytic-CMXUjK_F.js +0 -622
- package/dist/Broadcast-DowFtHv6.js +0 -223
- package/dist/Card-C7rhL0pV.js +0 -825
- package/dist/Collections-B-1wlk3r.js +0 -453
- package/dist/Credit-DDjozmoF.js +0 -220
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-pwMuIgs5.js +0 -345
- package/dist/Experience-BbE-c1Op.js +0 -221
- package/dist/Game-DQdRpaN-.js +0 -255
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-Dgmxzg4h.js +0 -316
- package/dist/Member-w23oRVwN.js +0 -69
- package/dist/MemberList-BLIdjznQ.js +0 -1735
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dy_lMdZA.js +0 -432
- package/dist/Mission-Cjt0E083.js +0 -261
- package/dist/Point-CQJL3Ewu.js +0 -222
- package/dist/Promotion-BYViH3bu.js +0 -247
- package/dist/Segment-B9Jj1ak0.js +0 -437
- package/dist/Setting-DXWbgRxs.js +0 -1901
- package/dist/Store-Dswk2e_z.js +0 -1511
- package/dist/StoreRewards-CNUhG_Ue.js +0 -401
- package/dist/Transaction-BB-kk-84.js +0 -39
- package/dist/Voucher-b1_Jlm6X.js +0 -490
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-pG-SrXp9.js +0 -56
- package/dist/app-DCHKJoql.js +0 -5639
- package/dist/dto-jcK3TGB7.js +0 -2770
- package/dist/index-Cv7pLAYq.js +0 -3
- package/dist/index-LrSSauN2.js +0 -29193
- package/dist/money-BEATdGS6.js +0 -15
- package/dist/number-CeAYAKCp.js +0 -12
- package/dist/vue-i18n-BRhKDHdF.js +0 -2365
- package/dist/zod-Bg2FbC-D.js +0 -90
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent as d, resolveComponent as o, openBlock as r, createElementBlock as s, Fragment as a, createElementVNode as e, createVNode as c, withCtx as v, renderList as p, normalizeClass as _, toDisplayString as n, createCommentVNode as u } from "vue";
|
|
2
|
+
const y = { class: "bg-gradient-to-r from-orange-200 p-24 to-blue-200 via-pink-100 mx-[-24px]" }, b = /* @__PURE__ */ e("div", { class: "fm-typo-en-body-lg-600" }, "Member overview", -1), g = { class: "grid grid-cols-6 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, x = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, f = { class: "fm-typo-en-title-sm-800" }, F = /* @__PURE__ */ d({
|
|
3
|
+
__name: "MemberOverview",
|
|
4
|
+
setup(k) {
|
|
5
|
+
const l = [
|
|
6
|
+
{
|
|
7
|
+
key: "Total member",
|
|
8
|
+
value: 4
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
key: "New member",
|
|
12
|
+
value: 2
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
key: "Member average spend",
|
|
16
|
+
value: 100
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: "Average visit time",
|
|
20
|
+
value: 567
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: "Member growth",
|
|
24
|
+
value: "100%"
|
|
25
|
+
},
|
|
26
|
+
{ key: "Inactive member", value: 0 }
|
|
27
|
+
];
|
|
28
|
+
return (h, C) => {
|
|
29
|
+
const i = o("FmCard");
|
|
30
|
+
return o("FmButton"), r(), s(a, null, [
|
|
31
|
+
e("div", y, [
|
|
32
|
+
c(i, {
|
|
33
|
+
variant: "outlined",
|
|
34
|
+
class: "flex flex-col gap-16 p-16"
|
|
35
|
+
}, {
|
|
36
|
+
default: v(() => [
|
|
37
|
+
b,
|
|
38
|
+
e("div", g, [
|
|
39
|
+
(r(), s(a, null, p(l, (t, m) => e("div", {
|
|
40
|
+
key: t.key,
|
|
41
|
+
class: _(["px-8", { "xs:!border-r": m % 2 == 0 }])
|
|
42
|
+
}, [
|
|
43
|
+
e("div", x, n(t.key), 1),
|
|
44
|
+
e("div", f, n(t.value), 1)
|
|
45
|
+
], 2)), 64))
|
|
46
|
+
])
|
|
47
|
+
]),
|
|
48
|
+
_: 1
|
|
49
|
+
})
|
|
50
|
+
]),
|
|
51
|
+
u("", !0)
|
|
52
|
+
], 64);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
F as default
|
|
58
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as i, ref as p, resolveComponent as _, openBlock as l, createElementBlock as d, createVNode as f, unref as e, createBlock as r, createCommentVNode as v } from "vue";
|
|
2
|
-
import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js";
|
|
3
3
|
import { useRouter as x } from "vue-router";
|
|
4
4
|
const C = { class: "flex flex-col gap-y-32 pb-24" }, N = /* @__PURE__ */ i({
|
|
5
5
|
__name: "MemberTransactions",
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { defineComponent as M, ref as C, computed as E, onMounted as D, resolveComponent as l, openBlock as p, createElementBlock as v, createElementVNode as m, createVNode as c, unref as u, withCtx as h, createTextVNode as F, toDisplayString as T, Fragment as j, renderList as k, createBlock as U } from "vue";
|
|
2
|
+
import { p as A } from "./loading-KNmEMBUB.js";
|
|
3
|
+
import { r as B } from "./index-Da142OER.js";
|
|
4
|
+
const L = {
|
|
5
|
+
"user.name": {
|
|
6
|
+
name: "User name"
|
|
7
|
+
},
|
|
8
|
+
"user.birthday": {
|
|
9
|
+
name: "Birthday"
|
|
10
|
+
},
|
|
11
|
+
"user.joinAt": {
|
|
12
|
+
name: "Join at"
|
|
13
|
+
},
|
|
14
|
+
"user.expiringVouchers.days7": {
|
|
15
|
+
name: "Expiring vouchers in 7 days"
|
|
16
|
+
},
|
|
17
|
+
"user.expiringVouchers.days30": {
|
|
18
|
+
name: "Expiring vouchers in 30 days"
|
|
19
|
+
},
|
|
20
|
+
"user.expiringVouchers.days90": {
|
|
21
|
+
name: "Expiring vouchers in 90 days"
|
|
22
|
+
},
|
|
23
|
+
"user.tier": {
|
|
24
|
+
name: "User tier"
|
|
25
|
+
},
|
|
26
|
+
"user.point": {
|
|
27
|
+
name: "User experience"
|
|
28
|
+
},
|
|
29
|
+
"transaction.amount": {
|
|
30
|
+
name: "Reward amount"
|
|
31
|
+
},
|
|
32
|
+
"collectible.name": {
|
|
33
|
+
name: "Reward name"
|
|
34
|
+
}
|
|
35
|
+
}, O = { class: "space-y-0" }, $ = { class: "flex items-center gap-8 justify-between" }, I = /* @__PURE__ */ m("div", { class: "fm-typo-en-body-lg-400" }, "Add message", -1), N = { class: "relative" }, P = { class: "absolute bottom-[24px] right-[4px]" }, K = /* @__PURE__ */ M({
|
|
36
|
+
__name: "MessageInput",
|
|
37
|
+
props: {
|
|
38
|
+
modelValue: {
|
|
39
|
+
type: Object
|
|
40
|
+
},
|
|
41
|
+
triggerType: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: () => "SCHEDULE"
|
|
44
|
+
},
|
|
45
|
+
helperText: {
|
|
46
|
+
type: String
|
|
47
|
+
},
|
|
48
|
+
helperState: {
|
|
49
|
+
type: String
|
|
50
|
+
},
|
|
51
|
+
variables: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => [
|
|
54
|
+
"user.name",
|
|
55
|
+
"user.birthday",
|
|
56
|
+
"user.joinAt",
|
|
57
|
+
"user.expiringVouchers.days7",
|
|
58
|
+
"user.expiringVouchers.days30",
|
|
59
|
+
"user.expiringVouchers.days90",
|
|
60
|
+
"user.tier",
|
|
61
|
+
"user.point",
|
|
62
|
+
"transaction.amount",
|
|
63
|
+
"collectible.name"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
placeholder: {
|
|
67
|
+
type: String
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
emits: ["update:model-value"],
|
|
71
|
+
setup(r, { emit: V }) {
|
|
72
|
+
const n = r, g = V;
|
|
73
|
+
function S() {
|
|
74
|
+
var t;
|
|
75
|
+
const a = {
|
|
76
|
+
user: {
|
|
77
|
+
name: "John Doe",
|
|
78
|
+
tier: 1,
|
|
79
|
+
point: 1283,
|
|
80
|
+
birthday: (/* @__PURE__ */ new Date("2000-10-02T16:00:00.000Z")).toLocaleDateString(),
|
|
81
|
+
joinAt: (/* @__PURE__ */ new Date("2024-06-14")).toLocaleDateString(),
|
|
82
|
+
expiringVouchers: { days7: 3, days30: 5, days90: 5 }
|
|
83
|
+
},
|
|
84
|
+
transaction: {
|
|
85
|
+
amount: 3
|
|
86
|
+
},
|
|
87
|
+
collectible: {
|
|
88
|
+
name: "RM10 Voucher"
|
|
89
|
+
}
|
|
90
|
+
}, e = B(
|
|
91
|
+
((t = n.modelValue) == null ? void 0 : t.content) ?? "",
|
|
92
|
+
a
|
|
93
|
+
);
|
|
94
|
+
A.confirm(e, "Preview message", "OK");
|
|
95
|
+
}
|
|
96
|
+
function d(a) {
|
|
97
|
+
g("update:model-value", {
|
|
98
|
+
channel: "SMS",
|
|
99
|
+
content: a,
|
|
100
|
+
language: "en",
|
|
101
|
+
variables: n.variables
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const _ = C(n.helperState || "none"), y = E(() => {
|
|
105
|
+
var t;
|
|
106
|
+
const a = ((t = n.modelValue) == null ? void 0 : t.content.replace(/{{([^}]+)}}/g, (s, o) => {
|
|
107
|
+
switch (o) {
|
|
108
|
+
case "user.name":
|
|
109
|
+
return "1234567890";
|
|
110
|
+
case "user.tier":
|
|
111
|
+
return "1";
|
|
112
|
+
case "user.point":
|
|
113
|
+
return "1000";
|
|
114
|
+
case "user.birthday":
|
|
115
|
+
return "01/01/2024";
|
|
116
|
+
case "user.joinAt":
|
|
117
|
+
return "01/01/2024";
|
|
118
|
+
case "user.expiringVouchers.days7":
|
|
119
|
+
case "user.expiringVouchers.days30":
|
|
120
|
+
case "user.expiringVouchers.days90":
|
|
121
|
+
return "5";
|
|
122
|
+
case "transaction.amount":
|
|
123
|
+
return "100";
|
|
124
|
+
case "collectible.name":
|
|
125
|
+
return "Voucher";
|
|
126
|
+
default:
|
|
127
|
+
return "...";
|
|
128
|
+
}
|
|
129
|
+
})) || "";
|
|
130
|
+
let e = 0;
|
|
131
|
+
for (let s = 0; s < a.length; s++) {
|
|
132
|
+
const o = a.charAt(s);
|
|
133
|
+
/[\u4e00-\u9fff\u3040-\u30ff\u3400-\u4dbf]/.test(o) || /[{}\\~\[\]|\^€]/.test(o) ? e += 2 : e += 1;
|
|
134
|
+
}
|
|
135
|
+
return `Character used: ${e} ≈ ${Math.ceil(e / 160)} SMS (Every 160 characters will be sent as 1 SMS)`;
|
|
136
|
+
});
|
|
137
|
+
return D(() => {
|
|
138
|
+
g("update:model-value", {
|
|
139
|
+
...n.modelValue,
|
|
140
|
+
variables: n.variables
|
|
141
|
+
}), n.modelValue || d("");
|
|
142
|
+
}), (a, e) => {
|
|
143
|
+
var x;
|
|
144
|
+
const t = l("FmButton"), s = l("FmTextarea"), o = l("FmMenuItem"), w = l("FmMenu");
|
|
145
|
+
return p(), v("div", O, [
|
|
146
|
+
m("div", $, [
|
|
147
|
+
I,
|
|
148
|
+
c(t, {
|
|
149
|
+
icon: "visibility",
|
|
150
|
+
label: "Preview message",
|
|
151
|
+
variant: "plain",
|
|
152
|
+
onClick: S
|
|
153
|
+
})
|
|
154
|
+
]),
|
|
155
|
+
m("div", N, [
|
|
156
|
+
c(s, {
|
|
157
|
+
"model-value": (x = r.modelValue) == null ? void 0 : x.content,
|
|
158
|
+
"onUpdate:modelValue": d,
|
|
159
|
+
"show-word-count": !0,
|
|
160
|
+
placeholder: r.placeholder,
|
|
161
|
+
"helper-state": u(_) || "none",
|
|
162
|
+
"helper-text": u(y)
|
|
163
|
+
}, {
|
|
164
|
+
"helper-text": h(() => [
|
|
165
|
+
F(T(u(y)), 1)
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}, 8, ["model-value", "placeholder", "helper-state", "helper-text"]),
|
|
169
|
+
m("div", P, [
|
|
170
|
+
c(w, { placement: "left-end" }, {
|
|
171
|
+
"menu-button": h(() => [
|
|
172
|
+
c(t, {
|
|
173
|
+
icon: "add",
|
|
174
|
+
variant: "tertiary",
|
|
175
|
+
size: "md"
|
|
176
|
+
})
|
|
177
|
+
]),
|
|
178
|
+
default: h(() => [
|
|
179
|
+
(p(!0), v(j, null, k(r.variables.filter(
|
|
180
|
+
(i) => r.triggerType == "SCHEDULE" ? !i.startsWith("transaction.") : !0
|
|
181
|
+
), (i) => {
|
|
182
|
+
var f;
|
|
183
|
+
return p(), U(o, {
|
|
184
|
+
key: i,
|
|
185
|
+
label: ((f = u(L)[i]) == null ? void 0 : f.name) || i,
|
|
186
|
+
onClick: (R) => {
|
|
187
|
+
var b;
|
|
188
|
+
return d(((b = r.modelValue) == null ? void 0 : b.content) + `{{${i}}}`);
|
|
189
|
+
}
|
|
190
|
+
}, null, 8, ["label", "onClick"]);
|
|
191
|
+
}), 128))
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
})
|
|
195
|
+
])
|
|
196
|
+
])
|
|
197
|
+
]);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
export {
|
|
202
|
+
K as _
|
|
203
|
+
};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { defineComponent as j, ref as I, computed as A, onMounted as D, resolveComponent as r, openBlock as c, createElementBlock as _, Fragment as h, createVNode as i, unref as a, createElementVNode as s, withCtx as w, renderList as E, createBlock as x, resolveDynamicComponent as H, toDisplayString as y, h as m } from "vue";
|
|
2
|
+
import { _ as q } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as z, components as C } from "@feedmepos/ui-library";
|
|
4
|
+
import { u as G, a as J, p as Q } from "./loading-KNmEMBUB.js";
|
|
5
|
+
import { u as W } from "./business-BSo7EPan.js";
|
|
6
|
+
import { u as X } from "./campaign-CsOje3Ap.js";
|
|
7
|
+
import { g as M, b as V } from "./dto-CfEXSCq6.js";
|
|
8
|
+
import { _ as Y } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
+
import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js";
|
|
10
|
+
import { u as ee } from "./template-CFAIPoD7.js";
|
|
11
|
+
import { s as oe } from "./index-CuvNtC_M.js";
|
|
12
|
+
import { c as g } from "./index-Boo5np6l.js";
|
|
13
|
+
const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ne = { class: "space-y-8" }, ie = { class: "flex w-full gap-4 items-center" }, re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, le = { class: "space-y-4" }, ce = { class: "fm-typo-en-body-lg-600" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = /* @__PURE__ */ s("img", {
|
|
14
|
+
src: q,
|
|
15
|
+
class: "aspect-square w-[150px]"
|
|
16
|
+
}, null, -1), pe = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
17
|
+
/* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create your mission program"),
|
|
18
|
+
/* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " The mission feature adds a fun element to shopping, encouraging customers to engage more. ")
|
|
19
|
+
], -1), Ie = /* @__PURE__ */ j({
|
|
20
|
+
__name: "Mission",
|
|
21
|
+
setup(fe) {
|
|
22
|
+
const L = {
|
|
23
|
+
label: "Create campaign",
|
|
24
|
+
value: "create",
|
|
25
|
+
isPrimary: !0,
|
|
26
|
+
prependIcon: "add"
|
|
27
|
+
}, B = ee("MISSION", z()), $ = W(), l = X(), { global: K, minor: b } = G, n = I({
|
|
28
|
+
searchKey: "",
|
|
29
|
+
location: null
|
|
30
|
+
}), d = A(
|
|
31
|
+
() => l.campaigns.mission.filter(
|
|
32
|
+
(e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
|
|
33
|
+
)
|
|
34
|
+
), R = [
|
|
35
|
+
{
|
|
36
|
+
header: "Program title",
|
|
37
|
+
accessorKey: "name",
|
|
38
|
+
// accessorFn: (v) => v.name,
|
|
39
|
+
cell(e) {
|
|
40
|
+
return m("div", { class: "flex items-center justify-between gap-4" }, [
|
|
41
|
+
m("div", { class: "flex items-center" }, [
|
|
42
|
+
m(
|
|
43
|
+
C.FmTooltip,
|
|
44
|
+
{
|
|
45
|
+
content: e.row.original._id,
|
|
46
|
+
onClick: (o) => {
|
|
47
|
+
o.stopPropagation(), J(e.row.original._id);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
[
|
|
51
|
+
m(C.FmIcon, {
|
|
52
|
+
name: "info",
|
|
53
|
+
outline: !0,
|
|
54
|
+
size: "sm"
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
)
|
|
58
|
+
]),
|
|
59
|
+
m("div", { class: "flex-1" }, e.row.original.name)
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
header: "Mission type",
|
|
65
|
+
accessorFn: (e) => oe(e.mission.type)
|
|
66
|
+
//v.effect,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
header: "Status",
|
|
70
|
+
cell(e) {
|
|
71
|
+
return M(e.row.original);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
header: "Summary",
|
|
76
|
+
accessorFn: (e) => V(e)
|
|
77
|
+
//v.effect,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
header: "Missions received",
|
|
81
|
+
accessorFn: (e) => {
|
|
82
|
+
var o;
|
|
83
|
+
return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
header: "Actions",
|
|
88
|
+
cell(e) {
|
|
89
|
+
return m(C.FmButton, {
|
|
90
|
+
variant: "tertiary",
|
|
91
|
+
icon: "delete",
|
|
92
|
+
iconColor: "neutral-gray-400",
|
|
93
|
+
onClick: (o) => {
|
|
94
|
+
o.stopPropagation(), S(e.row.original);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
], v = I();
|
|
100
|
+
async function S(e) {
|
|
101
|
+
await Q.remove(`Are you sure you want to remove ${e.name}?`) && await b(
|
|
102
|
+
async () => {
|
|
103
|
+
await g.delete(e._id), await l.read("MISSION");
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
message: `Removing ${e.name}`,
|
|
107
|
+
successMessage: `Removed ${e.name} successfully`
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
async function f(e) {
|
|
112
|
+
e ? await o() : B.open(async (u) => {
|
|
113
|
+
await o(u);
|
|
114
|
+
});
|
|
115
|
+
async function o(u) {
|
|
116
|
+
var p;
|
|
117
|
+
(p = v.value) == null || p.showSheet(
|
|
118
|
+
!0,
|
|
119
|
+
"MISSION",
|
|
120
|
+
e ? await g.readById(e._id) : void 0,
|
|
121
|
+
u
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async function N(e) {
|
|
126
|
+
await b(
|
|
127
|
+
async () => {
|
|
128
|
+
e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await l.read("MISSION");
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
message: `${e.campaign._id ? "Updating" : "Creating"} Mission program`,
|
|
132
|
+
successMessage: `Mission program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return D(async () => {
|
|
137
|
+
await K(async () => {
|
|
138
|
+
await l.read("MISSION"), console.log(d);
|
|
139
|
+
});
|
|
140
|
+
}), (e, o) => {
|
|
141
|
+
const u = r("FmPageHead"), p = r("FmSearch"), P = r("FmTable"), F = r("FmButton"), T = r("FmListItem"), O = r("FmList"), U = r("FmCard");
|
|
142
|
+
return c(), _(h, null, [
|
|
143
|
+
i(u, {
|
|
144
|
+
title: "Mission",
|
|
145
|
+
actions: a(d).length > 0 ? [L] : [],
|
|
146
|
+
"onClick:action": o[0] || (o[0] = () => f())
|
|
147
|
+
}, null, 8, ["actions"]),
|
|
148
|
+
s("div", te, [
|
|
149
|
+
i(p, {
|
|
150
|
+
modelValue: a(n).searchKey,
|
|
151
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => a(n).searchKey = t),
|
|
152
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
153
|
+
placeholder: "search",
|
|
154
|
+
collapsible: ""
|
|
155
|
+
}, null, 8, ["modelValue"]),
|
|
156
|
+
a(l).campaigns.mission && a(l).campaigns.mission.length > 0 ? (c(), _(h, { key: 0 }, [
|
|
157
|
+
s("div", ae, [
|
|
158
|
+
s("div", se, [
|
|
159
|
+
i(Y, {
|
|
160
|
+
modelValue: a(n).location,
|
|
161
|
+
"onUpdate:modelValue": o[2] || (o[2] = (t) => a(n).location = t),
|
|
162
|
+
label: "Location: ",
|
|
163
|
+
"show-item-label": !0,
|
|
164
|
+
icon: "storefront",
|
|
165
|
+
placement: "bottom-start",
|
|
166
|
+
items: a($).locationItems
|
|
167
|
+
}, null, 8, ["modelValue", "items"])
|
|
168
|
+
]),
|
|
169
|
+
i(p, {
|
|
170
|
+
modelValue: a(n).searchKey,
|
|
171
|
+
"onUpdate:modelValue": o[3] || (o[3] = (t) => a(n).searchKey = t),
|
|
172
|
+
class: "xs:hidden",
|
|
173
|
+
placeholder: "search",
|
|
174
|
+
collapsible: ""
|
|
175
|
+
}, null, 8, ["modelValue"])
|
|
176
|
+
]),
|
|
177
|
+
i(P, {
|
|
178
|
+
class: "xs:hidden",
|
|
179
|
+
"row-data": a(d),
|
|
180
|
+
"column-defs": R,
|
|
181
|
+
"search-value": a(n).searchKey,
|
|
182
|
+
"column-filter": [],
|
|
183
|
+
onRowClick: o[4] || (o[4] = (t) => f(t.original)),
|
|
184
|
+
"hide-footer": a(d).length < 10
|
|
185
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
186
|
+
i(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
187
|
+
default: w(() => [
|
|
188
|
+
(c(!0), _(h, null, E(a(d).filter(
|
|
189
|
+
(t) => t.name.toLowerCase().includes(a(n).searchKey.toLowerCase())
|
|
190
|
+
), (t) => (c(), x(T, {
|
|
191
|
+
key: t._id.toString(),
|
|
192
|
+
onClick: (k) => f(t),
|
|
193
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
194
|
+
}, {
|
|
195
|
+
default: w(() => [
|
|
196
|
+
s("div", ne, [
|
|
197
|
+
s("div", ie, [
|
|
198
|
+
(c(), x(H(a(M)(t)))),
|
|
199
|
+
s("div", re, y(t.currentReceive ?? 0) + " used ", 1)
|
|
200
|
+
]),
|
|
201
|
+
s("div", le, [
|
|
202
|
+
s("div", ce, y(t.name), 1),
|
|
203
|
+
s("div", me, y(a(V)(t)), 1)
|
|
204
|
+
]),
|
|
205
|
+
s("div", de, " Token received: " + y(t.currentReceive ?? 0), 1)
|
|
206
|
+
]),
|
|
207
|
+
i(F, {
|
|
208
|
+
icon: "delete",
|
|
209
|
+
"icon-color": "neutral-gray-400",
|
|
210
|
+
variant: "tertiary",
|
|
211
|
+
onClick: (k) => (k.stopPropagation(), S(t))
|
|
212
|
+
}, null, 8, ["onClick"])
|
|
213
|
+
]),
|
|
214
|
+
_: 2
|
|
215
|
+
}, 1032, ["onClick"]))), 128))
|
|
216
|
+
]),
|
|
217
|
+
_: 1
|
|
218
|
+
})
|
|
219
|
+
], 64)) : (c(), x(U, {
|
|
220
|
+
key: 1,
|
|
221
|
+
variant: "outlined",
|
|
222
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
223
|
+
}, {
|
|
224
|
+
default: w(() => [
|
|
225
|
+
ue,
|
|
226
|
+
pe,
|
|
227
|
+
i(F, {
|
|
228
|
+
variant: "primary",
|
|
229
|
+
label: "Create Mission program",
|
|
230
|
+
icon: "add",
|
|
231
|
+
onClick: o[5] || (o[5] = (t) => f())
|
|
232
|
+
})
|
|
233
|
+
]),
|
|
234
|
+
_: 1
|
|
235
|
+
})),
|
|
236
|
+
i(Z, {
|
|
237
|
+
ref_key: "sheetRef",
|
|
238
|
+
ref: v,
|
|
239
|
+
"onSubmit:modelValue": N
|
|
240
|
+
}, null, 512)
|
|
241
|
+
])
|
|
242
|
+
], 64);
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
export {
|
|
247
|
+
Ie as default
|
|
248
|
+
};
|