@feedmepos/mf-connect 0.1.58-prod → 0.1.60-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-CB0xAr9Q.js +427 -0
- package/dist/App-fp_3oll7.js +4630 -0
- package/dist/Bin-CPEbn14A.js +166 -0
- package/dist/Broadcast-jKp2iB8c.js +233 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CmJG893h.js +121 -0
- package/dist/Card-BaPJkgd2.js +911 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-Bqsg-ON3.js +458 -0
- package/dist/Credit-C9zIva1h.js +228 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js +2194 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Doyw0pvU.js +348 -0
- package/dist/Experience-CCI_oesa.js +229 -0
- package/dist/FileSaver.min-NlMItPOc.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/Game-CRMVz1JP.js +284 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
- package/dist/Index-szNiSnjR.js +259 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
- package/dist/MainLayout-B1aJoR95.js +41 -0
- package/dist/Marketing-AvEiNiD9.js +319 -0
- package/dist/Member-DIZwt6Hh.js +279 -0
- package/dist/MemberList-dxteIRWn.js +1607 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/MemberTransactions-Q3phmXfI.js +45 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BLk8rX-T.js +60553 -0
- package/dist/Mission-CZjySlcS.js +302 -0
- package/dist/Overview-BXbWEDy3.js +1079 -0
- package/dist/Point-CgjNc_Qn.js +232 -0
- package/dist/Promotion-COYo3qLi.js +289 -0
- package/dist/Queue-BLIStJth.js +260 -0
- package/dist/Record-BWoTvVEE.js +341 -0
- package/dist/Reward-Dq6GxHMP.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CR1feHth.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DuYYfbOH.js +1763 -0
- package/dist/Segment-CUfn6k5R.js +882 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CxycOqNJ.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7jqrfEj.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CMmdbYH4.js +147 -0
- package/dist/Setting-CC5AiQSy.js +1928 -0
- package/dist/SettingAdvertisements-DHQTaMC1.js +262 -0
- package/dist/Store-CEgv5aOD.js +1842 -0
- package/dist/StoreRewards-Dtzk_YG2.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cwt8pmoM.js +995 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BEU2u1-a.js +139 -0
- package/dist/Tier-1xqQvWzc.js +895 -0
- package/dist/Title-Da-G8plz.js +566 -0
- package/dist/Transaction-B0vuVZFZ.js +39 -0
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-e4-wNfrg.js +130 -0
- package/dist/Voucher-DLFjkXLu.js +384 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-5X7dGFD9.js +419 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BPTrvEwa.js +56 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-Do_C3F_N.js +7094 -0
- package/dist/app-o7Kvv5aK.js +57962 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +6 -0
- package/dist/business-BDi-QTa5.js +82 -0
- package/dist/campaign-BHqizYy6.js +1810 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign-DNXI3K9c.js +94 -0
- package/dist/campaign.enum-BXDwYoeA.js +20 -0
- package/dist/campaign.fn-Rws4mJa5.js +758 -0
- package/dist/collectible.enum-cMc4fL1T.js +19 -0
- package/dist/collection.fn-F8FZ7Dnr.js +26 -0
- package/dist/dto-CAtf1jq0.js +216 -0
- package/dist/effect-Dhg1ZIrL.js +78 -0
- package/dist/email-addresses-BZJZwglQ.js +705 -0
- package/dist/export-B6yvRuct.js +97 -0
- package/dist/feedme.ico +0 -0
- package/dist/helper-VoErinsY.js +71 -0
- package/dist/index-B0Pzwzkd.js +31 -0
- package/dist/index-Bq6FwMwW.js +32 -0
- package/dist/index-BvE6Sbog.js +3 -0
- package/dist/index-BysJoGFD.js +146 -0
- package/dist/index-C8m_F_I4.js +121 -0
- package/dist/index-CQZinjc9.js +54 -0
- package/dist/index-Cq7s1Pk2.js +76 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-DOGrOlB8.js +8859 -0
- package/dist/index-Di23nMJ7.js +38 -0
- package/dist/index-Dkyb4P6T.js +30076 -0
- package/dist/index-DvZiQOtl.js +3077 -0
- package/dist/index-Ved5V90A.js +2155 -0
- package/dist/index-d4A3r8kv.js +32269 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index-y7IqG-tl.js +44 -0
- package/dist/index.esm2017-CRTpUsW5.js +3069 -0
- package/dist/loading-CoUrS63J.js +71 -0
- package/dist/lodash-B5I3zXaY.js +3678 -0
- package/dist/membership-BiQwBHAA.js +235 -0
- package/dist/moment-D7p2TMB-.js +2583 -0
- package/dist/money-CA3gpWD3.js +15 -0
- package/dist/number-CgmVpwHm.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/objectid-C80eoTvt.js +145 -0
- package/dist/plugins-BkWtR_R5.js +208 -0
- package/dist/reward-D7SKofYj.js +36 -0
- package/dist/rule-Cpxty5PH.js +1951 -0
- package/dist/rule-builder-d_TMgXEC.js +102 -0
- package/dist/style.css +4 -0
- package/dist/template-BB7bab5R.js +190 -0
- package/dist/tier-BJDhpH6X.js +4 -0
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-Dj3UaenF.js +1151 -0
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-ZVR5eR1H.js +144 -0
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/type_drinks-D6jnpvwV.js +4 -0
- package/dist/usePagination-Ds-cuHop.js +223 -0
- package/dist/user-DjRqnFsC.js +54 -0
- package/dist/vue-i18n-BlCNfIcP.js +2365 -0
- package/dist/xlsx-CtNr_GAa.js +15491 -0
- package/dist/zod-Bg2FbC-D.js +90 -0
- package/package.json +1 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { defineComponent as C, ref as c, h as s, onMounted as x, resolveComponent as d, openBlock as S, createElementBlock as B, Fragment as M, createVNode as l, unref as o, createElementVNode as u } from "vue";
|
|
2
|
+
import { components as p } from "@feedmepos/ui-library";
|
|
3
|
+
import { u as K } from "./loading-CoUrS63J.js";
|
|
4
|
+
import { u as R } from "./business-BDi-QTa5.js";
|
|
5
|
+
import { C as A } from "./campaign-BHqizYy6.js";
|
|
6
|
+
import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js";
|
|
7
|
+
import { _ as U } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
8
|
+
import { _ as Y } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-CMmdbYH4.js";
|
|
9
|
+
import { u as D } from "./vue-i18n-BlCNfIcP.js";
|
|
10
|
+
import { h as E } from "./moment-D7p2TMB-.js";
|
|
11
|
+
import { p as I } from "./plugins-BkWtR_R5.js";
|
|
12
|
+
import { c as g } from "./index-C8m_F_I4.js";
|
|
13
|
+
const T = { class: "px-24 flex flex-col gap-y-16" }, $ = { class: "flex items-center justify-between w-full" }, j = { class: "flex gap-8 overflow-x-auto" }, oe = /* @__PURE__ */ C({
|
|
14
|
+
__name: "Bin",
|
|
15
|
+
setup(H) {
|
|
16
|
+
const { t: n } = D(), y = R(), { global: _, minor: b } = K, a = c({
|
|
17
|
+
searchKey: "",
|
|
18
|
+
location: null
|
|
19
|
+
}), m = c([]), w = [
|
|
20
|
+
{
|
|
21
|
+
header: n("connect.campaign.common.title"),
|
|
22
|
+
accessorFn: (e) => e.name
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
header: n("connect.campaign.common.campaignType"),
|
|
26
|
+
cell(e) {
|
|
27
|
+
return A[e.row.original.type].chip();
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
header: n("connect.campaign.common.deletedAt"),
|
|
32
|
+
cell(e) {
|
|
33
|
+
return E(e.row.original.deletedAt).format("D MMM YYYY, hh:mmA");
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
header: n("connect.voucher.actions"),
|
|
38
|
+
cell(e) {
|
|
39
|
+
return s("div", { class: "flex items-center justify-end" }, [
|
|
40
|
+
s(
|
|
41
|
+
p.FmMenu,
|
|
42
|
+
{
|
|
43
|
+
placement: "bottom-end",
|
|
44
|
+
onClick: (t) => {
|
|
45
|
+
t.stopPropagation();
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"menu-button": () => s(p.FmButton, {
|
|
50
|
+
icon: "more_vert",
|
|
51
|
+
iconColor: "neutral-gray-400",
|
|
52
|
+
variant: "tertiary"
|
|
53
|
+
}),
|
|
54
|
+
default: () => [
|
|
55
|
+
s(
|
|
56
|
+
p.FmMenuItem,
|
|
57
|
+
{
|
|
58
|
+
icon: "restore",
|
|
59
|
+
onClick: async (i) => {
|
|
60
|
+
i.stopPropagation(), F(e.row.original);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: s(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
class: "fm-typo-en-body-md-400"
|
|
68
|
+
},
|
|
69
|
+
n("connect.campaign.common.actions.restore")
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
], v = c(), V = c();
|
|
80
|
+
async function F(e) {
|
|
81
|
+
await I.confirm(
|
|
82
|
+
n("connect.campaign.common.restore.confirm", { name: e.name })
|
|
83
|
+
) && await b(
|
|
84
|
+
async () => {
|
|
85
|
+
await g.restore(e._id), await f();
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
message: n("connect.campaign.common.restore.restoring", { name: e.name }),
|
|
89
|
+
successMessage: n("connect.campaign.common.restore.restored", {
|
|
90
|
+
name: e.name
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
async function f() {
|
|
96
|
+
const e = await g.readAllDeleted({
|
|
97
|
+
limit: 1e3,
|
|
98
|
+
skip: 0,
|
|
99
|
+
sortBy: "_id",
|
|
100
|
+
descending: !0
|
|
101
|
+
});
|
|
102
|
+
m.value = e.resources;
|
|
103
|
+
}
|
|
104
|
+
return x(async () => {
|
|
105
|
+
await _(async () => {
|
|
106
|
+
await f();
|
|
107
|
+
});
|
|
108
|
+
}), (e, t) => {
|
|
109
|
+
const i = d("FmPageHead"), h = d("FmSearch"), k = d("FmTable");
|
|
110
|
+
return S(), B(M, null, [
|
|
111
|
+
l(i, {
|
|
112
|
+
title: o(n)("connect.bin.title")
|
|
113
|
+
}, null, 8, ["title"]),
|
|
114
|
+
u("div", T, [
|
|
115
|
+
l(h, {
|
|
116
|
+
modelValue: o(a).searchKey,
|
|
117
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => o(a).searchKey = r),
|
|
118
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
119
|
+
placeholder: o(n)("connect.voucher.search"),
|
|
120
|
+
collapsible: ""
|
|
121
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
122
|
+
u("div", $, [
|
|
123
|
+
u("div", j, [
|
|
124
|
+
l(U, {
|
|
125
|
+
modelValue: o(a).location,
|
|
126
|
+
"onUpdate:modelValue": t[1] || (t[1] = (r) => o(a).location = r),
|
|
127
|
+
label: o(n)("connect.voucher.location"),
|
|
128
|
+
"show-item-label": !0,
|
|
129
|
+
icon: "storefront",
|
|
130
|
+
placement: "bottom-start",
|
|
131
|
+
items: o(y).locationItems
|
|
132
|
+
}, null, 8, ["modelValue", "label", "items"])
|
|
133
|
+
]),
|
|
134
|
+
l(h, {
|
|
135
|
+
modelValue: o(a).searchKey,
|
|
136
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => o(a).searchKey = r),
|
|
137
|
+
class: "xs:hidden",
|
|
138
|
+
placeholder: o(n)("connect.voucher.search"),
|
|
139
|
+
collapsible: ""
|
|
140
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
141
|
+
]),
|
|
142
|
+
l(k, {
|
|
143
|
+
"row-data": o(m),
|
|
144
|
+
"column-defs": w,
|
|
145
|
+
"search-value": o(a).searchKey,
|
|
146
|
+
"column-filter": [],
|
|
147
|
+
onRowClick: t[3] || (t[3] = (r) => e.onEdit(r.original)),
|
|
148
|
+
"hide-footer": o(m).length < 10
|
|
149
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
150
|
+
l(P, {
|
|
151
|
+
ref_key: "sheetRef",
|
|
152
|
+
ref: v,
|
|
153
|
+
"onSubmit:modelValue": e.onUpdate
|
|
154
|
+
}, null, 8, ["onSubmit:modelValue"]),
|
|
155
|
+
l(Y, {
|
|
156
|
+
ref_key: "sendVoucherSheetRef",
|
|
157
|
+
ref: V
|
|
158
|
+
}, null, 512)
|
|
159
|
+
])
|
|
160
|
+
], 64);
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
export {
|
|
165
|
+
oe as default
|
|
166
|
+
};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { defineComponent as U, ref as h, computed as j, onMounted as E, resolveComponent as m, openBlock as d, createElementBlock as y, Fragment as b, createVNode as r, unref as o, createElementVNode as n, withCtx as w, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as p, createCommentVNode as z, h as G } from "vue";
|
|
2
|
+
import { _ as J } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as Q, components as W } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as X } from "./plugins-BkWtR_R5.js";
|
|
5
|
+
import { u as Y } from "./loading-CoUrS63J.js";
|
|
6
|
+
import { u as Z } from "./business-BDi-QTa5.js";
|
|
7
|
+
import { u as ee } from "./campaign-DNXI3K9c.js";
|
|
8
|
+
import { a as B, b as A, g as te } from "./campaign-BHqizYy6.js";
|
|
9
|
+
import { u as oe } from "./vue-i18n-BlCNfIcP.js";
|
|
10
|
+
import { _ as ae } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
11
|
+
import { _ as ne } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js";
|
|
12
|
+
import { u as se } from "./template-BB7bab5R.js";
|
|
13
|
+
import { c as _ } from "./index-C8m_F_I4.js";
|
|
14
|
+
const ce = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { key: 0 }, ye = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, _e = { class: "flex flex-col gap-16 text-center" }, he = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ U({
|
|
15
|
+
__name: "Broadcast",
|
|
16
|
+
setup(we) {
|
|
17
|
+
const { t: s } = oe(), L = {
|
|
18
|
+
label: s("connect.campaign.common.createCampaign"),
|
|
19
|
+
value: "create",
|
|
20
|
+
isPrimary: !0,
|
|
21
|
+
prependIcon: "add"
|
|
22
|
+
}, V = se("BROADCAST", Q()), D = Z(), u = ee(), { global: R, minor: C } = Y, T = h((/* @__PURE__ */ new Date()).toISOString()), c = h({
|
|
23
|
+
searchKey: "",
|
|
24
|
+
location: []
|
|
25
|
+
});
|
|
26
|
+
function K(e) {
|
|
27
|
+
const t = c.value.location;
|
|
28
|
+
return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
|
|
29
|
+
var i;
|
|
30
|
+
return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(l);
|
|
31
|
+
}) : e.targetLocation.includes(t);
|
|
32
|
+
}
|
|
33
|
+
const f = j(
|
|
34
|
+
() => u.campaigns.broadcast.filter((e) => K(e))
|
|
35
|
+
), O = [
|
|
36
|
+
{
|
|
37
|
+
header: "Broadcast title",
|
|
38
|
+
accessorFn: (e) => e.name
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
header: "Status",
|
|
42
|
+
accessorFn: (e) => te(e),
|
|
43
|
+
cell(e) {
|
|
44
|
+
return B(e.row.original);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
header: "Summary",
|
|
49
|
+
accessorFn: (e) => A(e)
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
header: "Message sent",
|
|
53
|
+
accessorFn: (e) => e.currentReceive ?? "N/A"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
header: "Actions",
|
|
57
|
+
cell(e) {
|
|
58
|
+
return G(W.FmButton, {
|
|
59
|
+
variant: "tertiary",
|
|
60
|
+
icon: "delete",
|
|
61
|
+
iconColor: "neutral-gray-400",
|
|
62
|
+
onClick: (t) => {
|
|
63
|
+
t.stopPropagation(), S(e.row.original);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
], x = h();
|
|
69
|
+
async function S(e) {
|
|
70
|
+
await X.remove(
|
|
71
|
+
s("connect.campaign.common.remove.confirm", { name: e.name })
|
|
72
|
+
) && await C(
|
|
73
|
+
async () => {
|
|
74
|
+
await _.delete(e._id), await u.read("BROADCAST");
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
message: s("connect.campaign.common.remove.removing", { name: e.name }),
|
|
78
|
+
successMessage: s("connect.campaign.common.remove.removed", {
|
|
79
|
+
name: e.name
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
async function g(e) {
|
|
85
|
+
T.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await t() : V.open(async (l) => {
|
|
86
|
+
await t(l);
|
|
87
|
+
});
|
|
88
|
+
async function t(l) {
|
|
89
|
+
var i;
|
|
90
|
+
(i = x.value) == null || i.showSheet(
|
|
91
|
+
!0,
|
|
92
|
+
"BROADCAST",
|
|
93
|
+
e ? await _.readById(e._id) : void 0,
|
|
94
|
+
l
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function I(e) {
|
|
99
|
+
await C(
|
|
100
|
+
async () => {
|
|
101
|
+
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("BROADCAST");
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
message: s(
|
|
105
|
+
`connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
|
|
106
|
+
),
|
|
107
|
+
successMessage: s("connect.campaign.broadcast.update.success", {
|
|
108
|
+
action: e.campaign._id ? "updated" : "created"
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return E(async () => {
|
|
114
|
+
await R(async () => {
|
|
115
|
+
await u.read("BROADCAST");
|
|
116
|
+
});
|
|
117
|
+
}), (e, t) => {
|
|
118
|
+
const l = m("FmPageHead"), i = m("FmSearch"), $ = m("FmTable"), F = m("FmButton"), P = m("FmListItem"), M = m("FmList"), N = m("FmCard");
|
|
119
|
+
return d(), y(b, null, [
|
|
120
|
+
r(l, {
|
|
121
|
+
title: o(s)("connect.campaign.broadcast.title"),
|
|
122
|
+
actions: o(f).length > 0 ? [L] : [],
|
|
123
|
+
"onClick:action": t[0] || (t[0] = () => g())
|
|
124
|
+
}, null, 8, ["title", "actions"]),
|
|
125
|
+
n("div", ce, [
|
|
126
|
+
r(i, {
|
|
127
|
+
modelValue: o(c).searchKey,
|
|
128
|
+
"onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
|
|
129
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
130
|
+
placeholder: o(s)("connect.campaign.common.search"),
|
|
131
|
+
collapsible: ""
|
|
132
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
133
|
+
o(u).campaigns.broadcast && o(u).campaigns.broadcast.length > 0 ? (d(), y(b, { key: 0 }, [
|
|
134
|
+
n("div", re, [
|
|
135
|
+
n("div", ie, [
|
|
136
|
+
r(ae, {
|
|
137
|
+
label: `${o(s)("connect.campaign.common.location")}: `,
|
|
138
|
+
"right-icon": "keyboard_arrow_down",
|
|
139
|
+
modelValue: o(c).location,
|
|
140
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
|
|
141
|
+
icon: "storefront",
|
|
142
|
+
"show-item-label": !0,
|
|
143
|
+
items: o(D).locationOptions
|
|
144
|
+
}, null, 8, ["label", "modelValue", "items"])
|
|
145
|
+
]),
|
|
146
|
+
r(i, {
|
|
147
|
+
modelValue: o(c).searchKey,
|
|
148
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
|
|
149
|
+
class: "xs:hidden",
|
|
150
|
+
placeholder: "search",
|
|
151
|
+
collapsible: ""
|
|
152
|
+
}, null, 8, ["modelValue"])
|
|
153
|
+
]),
|
|
154
|
+
r($, {
|
|
155
|
+
class: "xs:hidden",
|
|
156
|
+
"row-data": o(f),
|
|
157
|
+
"column-defs": O,
|
|
158
|
+
"search-value": o(c).searchKey,
|
|
159
|
+
"column-filter": [],
|
|
160
|
+
onRowClick: t[4] || (t[4] = (a) => g(a.original)),
|
|
161
|
+
"hide-footer": !0
|
|
162
|
+
}, null, 8, ["row-data", "search-value"]),
|
|
163
|
+
r(M, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
164
|
+
default: w(() => [
|
|
165
|
+
(d(!0), y(b, null, H(o(f).filter(
|
|
166
|
+
(a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
|
|
167
|
+
), (a) => (d(), v(P, {
|
|
168
|
+
key: a._id.toString(),
|
|
169
|
+
onClick: (k) => g(a),
|
|
170
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
171
|
+
}, {
|
|
172
|
+
default: w(() => [
|
|
173
|
+
n("div", le, [
|
|
174
|
+
n("div", me, [
|
|
175
|
+
(d(), v(q(o(B)(a)))),
|
|
176
|
+
n("div", de, p(a.currentReceive ?? 0) + " sent ", 1)
|
|
177
|
+
]),
|
|
178
|
+
n("div", ue, [
|
|
179
|
+
n("div", pe, p(a.name), 1),
|
|
180
|
+
n("div", fe, p(o(A)(a)), 1)
|
|
181
|
+
])
|
|
182
|
+
]),
|
|
183
|
+
r(F, {
|
|
184
|
+
icon: "delete",
|
|
185
|
+
"icon-color": "neutral-gray-400",
|
|
186
|
+
variant: "tertiary",
|
|
187
|
+
onClick: (k) => (k.stopPropagation(), S(a))
|
|
188
|
+
}, null, 8, ["onClick"])
|
|
189
|
+
]),
|
|
190
|
+
_: 2
|
|
191
|
+
}, 1032, ["onClick"]))), 128))
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
}),
|
|
195
|
+
o(f).length == 0 ? (d(), y("div", ge, [
|
|
196
|
+
n("div", ye, p(o(s)("connect.campaign.common.noResults")), 1)
|
|
197
|
+
])) : z("", !0)
|
|
198
|
+
], 64)) : (d(), v(N, {
|
|
199
|
+
key: 1,
|
|
200
|
+
variant: "outlined",
|
|
201
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
202
|
+
}, {
|
|
203
|
+
default: w(() => [
|
|
204
|
+
t[6] || (t[6] = n("img", {
|
|
205
|
+
src: J,
|
|
206
|
+
class: "aspect-square w-[150px]"
|
|
207
|
+
}, null, -1)),
|
|
208
|
+
n("div", _e, [
|
|
209
|
+
n("div", he, p(o(s)("connect.campaign.broadcast.create.title")), 1),
|
|
210
|
+
n("div", be, p(o(s)("connect.campaign.broadcast.create.description")), 1)
|
|
211
|
+
]),
|
|
212
|
+
r(F, {
|
|
213
|
+
variant: "primary",
|
|
214
|
+
label: o(s)("connect.campaign.broadcast.create.button"),
|
|
215
|
+
icon: "add",
|
|
216
|
+
onClick: t[5] || (t[5] = (a) => g())
|
|
217
|
+
}, null, 8, ["label"])
|
|
218
|
+
]),
|
|
219
|
+
_: 1
|
|
220
|
+
})),
|
|
221
|
+
r(ne, {
|
|
222
|
+
ref_key: "sheetRef",
|
|
223
|
+
ref: x,
|
|
224
|
+
"onSubmit:modelValue": I
|
|
225
|
+
}, null, 512)
|
|
226
|
+
])
|
|
227
|
+
], 64);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
export {
|
|
232
|
+
Ke as default
|
|
233
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { R as RuleOperator, _ } from "./index-DOGrOlB8.js";
|
|
2
|
+
import { i as isRuleGroup } from "./rule-builder-d_TMgXEC.js";
|
|
3
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, createVNode, toDisplayString } from "vue";
|
|
4
|
+
import { useDialog } from "@feedmepos/ui-library";
|
|
5
|
+
import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-DvZiQOtl.js";
|
|
6
|
+
import "./index-Ved5V90A.js";
|
|
7
|
+
import "./index-Di23nMJ7.js";
|
|
8
|
+
import "./index-CQZinjc9.js";
|
|
9
|
+
function validateRule(data, r, date) {
|
|
10
|
+
const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
|
|
11
|
+
function meetConditions(e) {
|
|
12
|
+
return Object.entries(e.conditions ?? {}).reduce(
|
|
13
|
+
(o, [n, t]) => {
|
|
14
|
+
const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
|
|
15
|
+
if (t == null)
|
|
16
|
+
return console.log("Bad data, ignoring rule", {
|
|
17
|
+
// property: r.property,
|
|
18
|
+
// source,
|
|
19
|
+
conditionKey: n,
|
|
20
|
+
equator: t
|
|
21
|
+
// raw: data,
|
|
22
|
+
}), o;
|
|
23
|
+
const i = rules[n](
|
|
24
|
+
l,
|
|
25
|
+
t
|
|
26
|
+
);
|
|
27
|
+
return o && i;
|
|
28
|
+
},
|
|
29
|
+
!0
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function evaluateRuleResult(rr, logic) {
|
|
33
|
+
const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
|
|
34
|
+
return !logic || !!eval(target);
|
|
35
|
+
}
|
|
36
|
+
function getRuleResults(e) {
|
|
37
|
+
return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
|
|
38
|
+
...o,
|
|
39
|
+
[n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
|
|
40
|
+
}), {}) : {
|
|
41
|
+
[e.name]: meetConditions(e)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return isRuleGroup(r) ? evaluateRuleResult(getRuleResults(r), r.logic) : meetConditions(r);
|
|
45
|
+
}
|
|
46
|
+
const _hoisted_1 = { class: "flex flex-col h-full space-y-24" }, _hoisted_2 = { class: "fm-typo-en-title-sm-600" }, _hoisted_3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
47
|
+
__name: "CampaignTypeDialog",
|
|
48
|
+
props: {
|
|
49
|
+
onSelect: {
|
|
50
|
+
type: Function,
|
|
51
|
+
required: !0
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setup(e) {
|
|
55
|
+
const o = e, n = useDialog(), t = [
|
|
56
|
+
{
|
|
57
|
+
title: "Promotion",
|
|
58
|
+
description: "Special offers or deals made available for a limited time",
|
|
59
|
+
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.PROMOTION
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: "Voucher",
|
|
63
|
+
description: "A digital coupon that can be redeemed for a discounts on future purchases.",
|
|
64
|
+
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
title: "Experience",
|
|
68
|
+
description: "Experience points help customers gain membership tiers.",
|
|
69
|
+
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: "Point",
|
|
73
|
+
description: "Points allow customers to purchase bundle items.",
|
|
74
|
+
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: "Game",
|
|
78
|
+
description: "The game feature adds a fun and encourage customers to engage more.",
|
|
79
|
+
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
title: "Credit",
|
|
83
|
+
description: "Credits are virtual money that customers can use to pay for their purchases.",
|
|
84
|
+
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
function l(i) {
|
|
88
|
+
n.close(), o.onSelect(i);
|
|
89
|
+
}
|
|
90
|
+
return (i, a) => {
|
|
91
|
+
const c = resolveComponent("FmCard");
|
|
92
|
+
return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
|
|
93
|
+
default: withCtx(() => [
|
|
94
|
+
a[0] || (a[0] = createElementVNode("div", { class: "" }, [
|
|
95
|
+
createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
|
|
96
|
+
createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Select the benefit type that you want to reward the selected tier. ")
|
|
97
|
+
], -1)),
|
|
98
|
+
createElementVNode("div", _hoisted_1, [
|
|
99
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
|
|
100
|
+
variant: "outlined",
|
|
101
|
+
key: s.value,
|
|
102
|
+
onClick: (u) => l(s.value),
|
|
103
|
+
class: "p-16 space-y-8 cursor-pointer"
|
|
104
|
+
}, {
|
|
105
|
+
default: withCtx(() => [
|
|
106
|
+
createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
|
|
107
|
+
createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
|
|
108
|
+
]),
|
|
109
|
+
_: 2
|
|
110
|
+
}, 1032, ["onClick"])), 64))
|
|
111
|
+
])
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export {
|
|
119
|
+
_sfc_main as _,
|
|
120
|
+
validateRule as v
|
|
121
|
+
};
|