@feedmepos/mf-connect 0.1.57-prod → 0.1.58-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/package.json +1 -1
- package/dist/Analytic-BqvhYgCU.js +0 -427
- package/dist/App-Dtl_D0cH.js +0 -4630
- package/dist/Bin-y4ikpgPS.js +0 -166
- package/dist/Broadcast-DSROFwe4.js +0 -233
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CcsG6vOP.js +0 -121
- package/dist/Card-BiSEPsZb.js +0 -911
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-CX-nN7Xj.js +0 -458
- package/dist/Credit-IiV9b4cB.js +0 -228
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.js +0 -2194
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-sGh_SMCH.js +0 -348
- package/dist/Experience-Cf-EMhKy.js +0 -229
- package/dist/FileSaver.min-NlMItPOc.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-C8mfJn6W.js +0 -284
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
- package/dist/Index-DkvO1AoT.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-xJTIo3RF.js +0 -319
- package/dist/Member-DZkYoKW8.js +0 -279
- package/dist/MemberList-CAYEJnf3.js +0 -1607
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-Dc5aAQ69.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BSvlPzw8.js +0 -60553
- package/dist/Mission-C_NbNWZw.js +0 -302
- package/dist/Overview-DyxEwEfe.js +0 -1079
- package/dist/Point-CsEWk61V.js +0 -232
- package/dist/Promotion--pWgy9Dx.js +0 -289
- package/dist/Queue-k3qAQR7B.js +0 -260
- package/dist/Record-D5F5JyVA.js +0 -341
- package/dist/Reward-3FSrq5mX.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Dzj7a7UY.js +0 -150
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DRl_Gjfx.js +0 -1763
- package/dist/Segment-BWJn6ODR.js +0 -882
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BKsV_zcr.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3efGNC_.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cj7c2V3h.js +0 -147
- package/dist/Setting-UiTXazZV.js +0 -1936
- package/dist/Store-BrvmHPCX.js +0 -1842
- package/dist/StoreRewards-D_7fr-Ef.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BXy0L5AH.js +0 -995
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DumcDlBs.js +0 -139
- package/dist/Tier-C4wvx8F7.js +0 -895
- package/dist/Title-CPHT85Uj.js +0 -566
- package/dist/Transaction-6Ig2W00P.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DknFkIJh.js +0 -130
- package/dist/Voucher-Bbl-7gZ5.js +0 -384
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-xsswRZG8.js +0 -419
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js +0 -56
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-BDVZwARN.js +0 -7057
- package/dist/app-CAEhNFRG.js +0 -57962
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -6
- package/dist/business-6C_ol5wd.js +0 -82
- package/dist/campaign-B13G6pZ3.js +0 -1810
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-DrQp6qBu.js +0 -94
- package/dist/campaign.enum-DnTrlaNC.js +0 -20
- package/dist/campaign.fn-BZse90_k.js +0 -758
- package/dist/collectible.enum-633Me0yR.js +0 -19
- package/dist/collection.fn-C96855j5.js +0 -26
- package/dist/dto-2bMujqmZ.js +0 -216
- package/dist/effect-C7lAJwKh.js +0 -78
- package/dist/email-addresses-3ayN-9jv.js +0 -705
- package/dist/export-BNbDV7SC.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/helper-CsfZ__dQ.js +0 -71
- package/dist/index-BLSAz0gK.js +0 -32
- package/dist/index-BY9I3Cer.js +0 -3
- package/dist/index-BdnRNcVO.js +0 -146
- package/dist/index-BmyNfpfG.js +0 -30076
- package/dist/index-CSBRkhKy.js +0 -38
- package/dist/index-Cf_fcvoS.js +0 -54
- package/dist/index-CqrO13uj.js +0 -76
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-D4kdSzs9.js +0 -3070
- package/dist/index-DcJq7tl4.js +0 -32269
- package/dist/index-DdjSIwSL.js +0 -44
- package/dist/index-LKr2k8J2.js +0 -8861
- package/dist/index-XAxwm-1v.js +0 -2130
- package/dist/index-b82LrGSB.js +0 -121
- package/dist/index-tcAb0W5F.js +0 -31
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-BklqmujQ.js +0 -3069
- package/dist/loading-OXARGiqO.js +0 -71
- package/dist/lodash-B5I3zXaY.js +0 -3678
- package/dist/membership-D1Vb1rUo.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-BpyAytEq.js +0 -15
- package/dist/number-C-PtPOOj.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-BrLIKTmQ.js +0 -145
- package/dist/plugins-CjPWhNb2.js +0 -208
- package/dist/reward-DonQFzvW.js +0 -36
- package/dist/rule-AtNPBnbE.js +0 -1951
- package/dist/rule-builder-C0Q-3g6T.js +0 -102
- package/dist/style.css +0 -4
- package/dist/template-CNjE7eht.js +0 -190
- package/dist/tier-BJDhpH6X.js +0 -4
- 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-CYbdI3q2.js +0 -1151
- 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-Bdi6n80h.js +0 -144
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-Ds-cuHop.js +0 -223
- package/dist/user-BwGm78n8.js +0 -54
- package/dist/vue-i18n-D1nTd69a.js +0 -2365
- package/dist/xlsx-DF5iW3wh.js +0 -15491
- package/dist/zod-Bg2FbC-D.js +0 -90
package/dist/Bin-y4ikpgPS.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
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-OXARGiqO.js";
|
|
4
|
-
import { u as R } from "./business-6C_ol5wd.js";
|
|
5
|
-
import { C as A } from "./campaign-B13G6pZ3.js";
|
|
6
|
-
import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.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-Cj7c2V3h.js";
|
|
9
|
-
import { u as D } from "./vue-i18n-D1nTd69a.js";
|
|
10
|
-
import { h as E } from "./moment-D7p2TMB-.js";
|
|
11
|
-
import { p as I } from "./plugins-CjPWhNb2.js";
|
|
12
|
-
import { c as g } from "./index-b82LrGSB.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
|
-
};
|
|
@@ -1,233 +0,0 @@
|
|
|
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-CjPWhNb2.js";
|
|
5
|
-
import { u as Y } from "./loading-OXARGiqO.js";
|
|
6
|
-
import { u as Z } from "./business-6C_ol5wd.js";
|
|
7
|
-
import { u as ee } from "./campaign-DrQp6qBu.js";
|
|
8
|
-
import { a as B, b as A, g as te } from "./campaign-B13G6pZ3.js";
|
|
9
|
-
import { u as oe } from "./vue-i18n-D1nTd69a.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-CoGes8YL.js";
|
|
12
|
-
import { u as se } from "./template-CNjE7eht.js";
|
|
13
|
-
import { c as _ } from "./index-b82LrGSB.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
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { R as RuleOperator, _ } from "./index-LKr2k8J2.js";
|
|
2
|
-
import { i as isRuleGroup } from "./rule-builder-C0Q-3g6T.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-D4kdSzs9.js";
|
|
6
|
-
import "./index-XAxwm-1v.js";
|
|
7
|
-
import "./index-CSBRkhKy.js";
|
|
8
|
-
import "./index-Cf_fcvoS.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
|
-
};
|