@feedmepos/mf-connect 0.0.5-beta.3 → 0.0.5-beta.31
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-EK8eCE0V.js → Analytic-DQLL4d6x.js} +43 -44
- package/dist/{Broadcast-0sC4u4AP.js → Broadcast-BWcdYdz0.js} +42 -42
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C_y3KnJc.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CTiYv4jr.js} +34 -34
- package/dist/Card-83bPaBjg.js +827 -0
- package/dist/Collections-DvERgMZ8.js +424 -0
- package/dist/{Credit-DlRafcnR.js → Credit-Crm54zmF.js} +7 -7
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BP4MkXQG.js +2685 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-GxapvbsJ.js +330 -0
- package/dist/{Experience-DVf59TEF.js → Experience-Q4U18dfR.js} +7 -7
- package/dist/{Game-BxCAPgNa.js → Game-BZLPo-Yg.js} +7 -7
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DMsxZkxf.js → ImageInput.vue_vue_type_script_setup_true_lang-DccxXCOH.js} +8 -8
- package/dist/{MainLayout-CThfv_dG.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D2csUJY_.js} +20 -53
- package/dist/MainLayout-DadiUZbY.js +41 -0
- package/dist/{Marketing-DszF7rAe.js → Marketing-DPDlB928.js} +25 -26
- package/dist/Member-DKhrNAlF.js +91 -0
- package/dist/MemberList-DoNI-fw6.js +1727 -0
- package/dist/{MemberTransactions-DzdEWjSU.js → MemberTransactions-Dss9SCsl.js} +2 -2
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-AiPEEyTb.js +432 -0
- package/dist/Mission-Bv_StyAI.js +248 -0
- package/dist/{Point-Bd6prfBi.js → Point-jvhL0cBo.js} +7 -7
- package/dist/{Promotion-BjPQlD8B.js → Promotion-uu6ygEil.js} +42 -43
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BBjfeUV8.js +1744 -0
- package/dist/Segment-DLTHLGIF.js +408 -0
- package/dist/{Setting-DnXwHt2L.js → Setting-B_y41Yez.js} +592 -562
- package/dist/Store-CVFRvb41.js +1456 -0
- package/dist/StoreRewards-Cu7wZ0ZU.js +434 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CKlJt4G6.js +794 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CS_wJ7zK.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DUo5qVcv.js} +1 -1
- package/dist/Tier-Db8Lg0Vb.js +845 -0
- package/dist/{Title-B2OkSGQI.js → Title-CvXd5BLT.js} +284 -256
- package/dist/Transaction-Csmzom2v.js +36 -0
- package/dist/Voucher-BXET5aJR.js +481 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +55 -0
- package/dist/app-CNDjscMY.js +53382 -0
- package/dist/{app-t5J3ByNe.js → app-DLrqEkpN.js} +3919 -3786
- package/dist/app.js +1 -1
- package/dist/campaign-el9UbKPS.js +96 -0
- package/dist/{collection.fn-DHlfGYAC.js → collection.fn-DX_vR3D0.js} +4 -2
- package/dist/dto-nI9tXw_a.js +1132 -0
- package/dist/{effect-wCTTVwRm.js → effect-ClGuF42_.js} +1 -1
- package/dist/export-D2rZkp_a.js +97 -0
- package/dist/{helper-qiI8jIhI.js → helper-rCOz3CsQ.js} +21 -8
- package/dist/{index-CyEToiwz.js → index-B4Kds-ma.js} +1 -1
- package/dist/{index-BDB8wyiW.js → index-B5jSpptU.js} +7 -17
- package/dist/{index-CVyJH-AI.js → index-BVIk3CBr.js} +256 -192
- package/dist/{index-COsL3xza.js → index-C-4fybpk.js} +1945 -1927
- package/dist/{index-CG-m3fvl.js → index-CM4H_24q.js} +79 -69
- package/dist/index-CNJHOzLv.js +73 -0
- package/dist/{index-DQu4ng0C.js → index-CPs_BVYE.js} +4 -8
- package/dist/index-CVWlZHun.js +1737 -0
- package/dist/{index-Db1xANwr.js → index-DU3kVZJo.js} +380 -96
- package/dist/{index-BmRQED3J.js → index-DbWauIjL.js} +46 -34
- package/dist/{index-DYsVydns.js → loading-uAAk9Jhw.js} +14444 -11314
- package/dist/{lodash-AulMLK9Y.js → lodash-BrKuGzuq.js} +1 -1
- package/dist/membership-DxgwKo0i.js +221 -0
- package/dist/{money-E7u1alNr.js → money-BB8cJhJ9.js} +1 -1
- package/dist/{number-CJHkglOa.js → number-B7yiKCmJ.js} +3 -3
- package/dist/{rule-CrM9hLOY.js → rule-LiZBsce_.js} +142 -135
- package/dist/{rule-builder-CLxdmsx5.js → rule-builder-z8MibNmg.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-B-YfXPUm.js → template-D5x7w2gg.js} +6 -6
- package/dist/usePagination-DokNC372.js +223 -0
- package/dist/user-Bm4KttFq.js +37 -0
- package/dist/{xlsx-BwS6MrLm.js → xlsx-BMNlmH0N.js} +1 -1
- package/dist/zod-W_PvIofQ.js +90 -0
- package/package.json +11 -6
- package/dist/Card-CUr_jpDa.js +0 -775
- package/dist/Collections-cRrfpwd_.js +0 -437
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-7lK3ol3O.js +0 -1952
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-XYiEt0Rd.js +0 -309
- package/dist/JsonViewer-B308_2ww.js +0 -87
- package/dist/Member-D2LAw8c8.js +0 -90
- package/dist/MemberList-DerRwnck.js +0 -1752
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DeKLHu-X.js +0 -163
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DiMhmAcI.js +0 -1461
- package/dist/Segment-DSoyAXLy.js +0 -392
- package/dist/Store-DiPNbQ0N.js +0 -1415
- package/dist/StoreRewards-i91SFvSl.js +0 -432
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CBztsx9U.js +0 -640
- package/dist/Tier-B67Jm52O.js +0 -821
- package/dist/Transaction-DAD5zMle.js +0 -34
- package/dist/Voucher-bIfd5T-D.js +0 -448
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/campaign-CdSPZhF-.js +0 -93
- package/dist/dto-BLBidjC9.js +0 -353
- package/dist/index-CGHE9cfB.js +0 -64
- package/dist/index-C_ssI6I6.js +0 -1742
- package/dist/loading-DxbFPzwG.js +0 -3131
- package/dist/membership-CbVE3rZD.js +0 -213
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { defineComponent as I, openBlock as l, createElementBlock as h, Fragment as V, renderList as
|
|
1
|
+
import { defineComponent as I, openBlock as l, createElementBlock as h, Fragment as V, renderList as P, createElementVNode as a, toDisplayString as U, createCommentVNode as B, resolveComponent as S, createBlock as F, withCtx as O, createVNode as p, unref as n, ref as C, computed as G, onMounted as q, watch as X, isRef as N, createSlots as Y, createTextVNode as ee, reactive as te, onBeforeMount as ae, normalizeClass as ne } from "vue";
|
|
2
2
|
import { _ as oe } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { f as le } from "./number-
|
|
4
|
-
import { C as se, F as ie, a as re } from "./dto-
|
|
3
|
+
import { f as le } from "./number-B7yiKCmJ.js";
|
|
4
|
+
import { C as se, F as ie, a as re } from "./dto-nI9tXw_a.js";
|
|
5
5
|
import { useRouter as ce } from "vue-router";
|
|
6
|
-
import { c as
|
|
7
|
-
import { _ as ue
|
|
8
|
-
import {
|
|
9
|
-
import "./
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { u as ve } from "./loading-DxbFPzwG.js";
|
|
6
|
+
import { c as T } from "./index-B5jSpptU.js";
|
|
7
|
+
import { _ as ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js";
|
|
8
|
+
import { Z as de } from "./zod-W_PvIofQ.js";
|
|
9
|
+
import { J as me, u as pe } from "./app-DLrqEkpN.js";
|
|
10
|
+
import { u as fe } from "./loading-uAAk9Jhw.js";
|
|
11
|
+
import { useSnackbar as ve } from "@feedmepos/ui-library";
|
|
13
12
|
import { g as ye } from "./object-qECH92oz.js";
|
|
14
|
-
import { u as _e } from "./campaign-
|
|
15
|
-
import { m as ge } from "./index-
|
|
13
|
+
import { u as _e } from "./campaign-el9UbKPS.js";
|
|
14
|
+
import { m as ge } from "./index-CNJHOzLv.js";
|
|
16
15
|
const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, xe = { class: "fm-typo-en-title-sm-800" }, Ce = /* @__PURE__ */ I({
|
|
17
16
|
__name: "CampaignStat",
|
|
18
17
|
props: {
|
|
@@ -35,14 +34,14 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
35
34
|
return le((r = R.data) == null ? void 0 : r[_], 2, !0) || 0;
|
|
36
35
|
}
|
|
37
36
|
return (_, r) => (l(), h("div", he, [
|
|
38
|
-
(l(), h(V, null,
|
|
37
|
+
(l(), h(V, null, P(i, (e) => (l(), h(V, null, [
|
|
39
38
|
e.key in m.data ? (l(), h("div", {
|
|
40
39
|
key: e.key,
|
|
41
40
|
class: "px-16"
|
|
42
41
|
}, [
|
|
43
42
|
a("div", be, U(e.label), 1),
|
|
44
43
|
a("div", xe, U(u(e.key)), 1)
|
|
45
|
-
])) :
|
|
44
|
+
])) : B("", !0)
|
|
46
45
|
], 64))), 64))
|
|
47
46
|
]));
|
|
48
47
|
}
|
|
@@ -115,7 +114,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
115
114
|
}))) || [];
|
|
116
115
|
});
|
|
117
116
|
return q(async () => {
|
|
118
|
-
u.value = await
|
|
117
|
+
u.value = await T.readStats({
|
|
119
118
|
groupId: i.group._id.toString()
|
|
120
119
|
});
|
|
121
120
|
}), (e, c) => {
|
|
@@ -137,7 +136,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
137
136
|
])
|
|
138
137
|
]),
|
|
139
138
|
a("div", Ae, [
|
|
140
|
-
(l(!0), h(V, null,
|
|
139
|
+
(l(!0), h(V, null, P(n(r), (f) => (l(), F(we, {
|
|
141
140
|
key: e.index,
|
|
142
141
|
type: f.campaign.type,
|
|
143
142
|
label: f.label
|
|
@@ -190,7 +189,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
190
189
|
"onUpdate:modelValue": _
|
|
191
190
|
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
192
191
|
a("div", Oe, [
|
|
193
|
-
(l(!0), h(V, null,
|
|
192
|
+
(l(!0), h(V, null, P(i.items, (g, w) => (l(), F(f, {
|
|
194
193
|
key: w,
|
|
195
194
|
"model-value": n(c),
|
|
196
195
|
label: g.label,
|
|
@@ -203,7 +202,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
203
202
|
});
|
|
204
203
|
};
|
|
205
204
|
}
|
|
206
|
-
}),
|
|
205
|
+
}), Be = { class: "space-y-16" }, Pe = { class: "flex items-center" }, Te = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Ge = { class: "space-y-[40px]" }, Ie = /* @__PURE__ */ I({
|
|
207
206
|
__name: "LinkCampaign",
|
|
208
207
|
props: {
|
|
209
208
|
modelValue: {
|
|
@@ -234,9 +233,9 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
234
233
|
const f = S("FmTextField");
|
|
235
234
|
return l(), h(V, null, [
|
|
236
235
|
p(me, { json: m.campaigns }, null, 8, ["json"]),
|
|
237
|
-
a("div",
|
|
238
|
-
a("div",
|
|
239
|
-
a("div",
|
|
236
|
+
a("div", Be, [
|
|
237
|
+
a("div", Pe, [
|
|
238
|
+
a("div", Te, U(n(u).length) + " campaign(s) linked ", 1),
|
|
240
239
|
p(f, {
|
|
241
240
|
modelValue: n(i),
|
|
242
241
|
"onUpdate:modelValue": o[0] || (o[0] = (b) => N(i) ? i.value = b : null),
|
|
@@ -246,7 +245,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
246
245
|
}, null, 8, ["modelValue"])
|
|
247
246
|
]),
|
|
248
247
|
a("div", Ge, [
|
|
249
|
-
(l(!0), h(V, null,
|
|
248
|
+
(l(!0), h(V, null, P(n(e), (b, g) => (l(), F(Ee, {
|
|
250
249
|
"model-value": n(u),
|
|
251
250
|
title: g,
|
|
252
251
|
items: b,
|
|
@@ -264,13 +263,13 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
264
263
|
__name: "AnalyticSheet",
|
|
265
264
|
emits: ["success"],
|
|
266
265
|
setup(m, { expose: R, emit: i }) {
|
|
267
|
-
const u = i, _ =
|
|
268
|
-
|
|
266
|
+
const u = i, _ = pe();
|
|
267
|
+
ve();
|
|
269
268
|
const r = C(!1), e = C(!1), c = {
|
|
270
269
|
name: "",
|
|
271
270
|
campaigns: []
|
|
272
271
|
}, s = C(""), o = C({ ...c }), f = ie.superRefine((d, t) => {
|
|
273
|
-
}), b = C([]), g = C(null), { global: w, minor: v } =
|
|
272
|
+
}), b = C([]), g = C(null), { global: w, minor: v } = fe, E = G(() => {
|
|
274
273
|
const d = f.safeParse(o.value);
|
|
275
274
|
return d.success ? [] : d.error.errors;
|
|
276
275
|
});
|
|
@@ -285,7 +284,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
285
284
|
e.value = !0;
|
|
286
285
|
}
|
|
287
286
|
async function $() {
|
|
288
|
-
const d = await
|
|
287
|
+
const d = await T.readAll({
|
|
289
288
|
limit: 1e3,
|
|
290
289
|
skip: 0,
|
|
291
290
|
sortBy: "_id",
|
|
@@ -327,10 +326,10 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
327
326
|
f.safeParse(o.value).success && await v(
|
|
328
327
|
async () => {
|
|
329
328
|
var t;
|
|
330
|
-
g.value ? await
|
|
329
|
+
g.value ? await T.updateGroup(
|
|
331
330
|
(t = g.value) == null ? void 0 : t._id,
|
|
332
331
|
o.value
|
|
333
|
-
) : await
|
|
332
|
+
) : await T.createGroup(o.value), u("success"), k();
|
|
334
333
|
},
|
|
335
334
|
{
|
|
336
335
|
message: "Saving group",
|
|
@@ -342,7 +341,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
342
341
|
await v(
|
|
343
342
|
async () => {
|
|
344
343
|
var d;
|
|
345
|
-
await
|
|
344
|
+
await T.deleteGroup((d = g.value) == null ? void 0 : d._id), u("success"), k();
|
|
346
345
|
},
|
|
347
346
|
{
|
|
348
347
|
message: "Deleting group",
|
|
@@ -367,7 +366,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
367
366
|
}, Y({
|
|
368
367
|
"side-sheet-footer": O(() => [
|
|
369
368
|
a("div", Je, [
|
|
370
|
-
n(e) ?
|
|
369
|
+
n(e) ? B("", !0) : (l(), h(V, { key: 0 }, [
|
|
371
370
|
p(y, {
|
|
372
371
|
label: "Submit",
|
|
373
372
|
onClick: W,
|
|
@@ -384,17 +383,17 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
384
383
|
variant: "plain",
|
|
385
384
|
class: "ml-auto fm-color-system-error-300",
|
|
386
385
|
onClick: t[5] || (t[5] = (x) => Z())
|
|
387
|
-
})) :
|
|
386
|
+
})) : B("", !0)
|
|
388
387
|
], 64)),
|
|
389
388
|
n(e) ? (l(), F(y, {
|
|
390
389
|
key: 1,
|
|
391
390
|
label: "Confirm",
|
|
392
391
|
onClick: t[6] || (t[6] = (x) => e.value = !1)
|
|
393
|
-
})) :
|
|
392
|
+
})) : B("", !0)
|
|
394
393
|
])
|
|
395
394
|
]),
|
|
396
395
|
default: O(() => [
|
|
397
|
-
n(e) ?
|
|
396
|
+
n(e) ? B("", !0) : (l(), h("div", je, [
|
|
398
397
|
Me,
|
|
399
398
|
p(ue, {
|
|
400
399
|
modelValue: n(o).name,
|
|
@@ -425,13 +424,13 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
425
424
|
modelValue: n(o).campaigns,
|
|
426
425
|
"onUpdate:modelValue": t[3] || (t[3] = (x) => n(o).campaigns = x),
|
|
427
426
|
campaigns: n(M)
|
|
428
|
-
}, null, 8, ["modelValue", "campaigns"])) :
|
|
427
|
+
}, null, 8, ["modelValue", "campaigns"])) : B("", !0),
|
|
429
428
|
a("div", He, [
|
|
430
|
-
n(e) ?
|
|
429
|
+
n(e) ? B("", !0) : (l(!0), h(V, { key: 0 }, P(n(K), (x, Q) => (l(), h("div", null, [
|
|
431
430
|
a("div", ze, U(Q), 1),
|
|
432
431
|
p(j, { separator: !0 }, {
|
|
433
432
|
default: O(() => [
|
|
434
|
-
(l(!0), h(V, null,
|
|
433
|
+
(l(!0), h(V, null, P(x, (z) => (l(), h("div", Ke, [
|
|
435
434
|
a("div", null, U(z.label), 1),
|
|
436
435
|
a("div", null, [
|
|
437
436
|
p(y, {
|
|
@@ -469,7 +468,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
469
468
|
}), Ze = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Qe = { class: "space-y-16" }, Xe = { class: "flex items-center justify-end" }, Ye = /* @__PURE__ */ a("div", { class: "fm-typo-en-body-lg-600" }, "Connect summary", -1), et = { class: "grid grid-cols-4 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, tt = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, at = { class: "fm-typo-en-title-sm-800" }, nt = /* @__PURE__ */ a("img", {
|
|
470
469
|
src: oe,
|
|
471
470
|
class: "w-[150px]"
|
|
472
|
-
}, null, -1), ot = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Create campaign group to track performance ", -1), lt = /* @__PURE__ */ a("div", { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, " Start organizing your campaigns and promotions by creating groups. Groups allow you to aggregate performance metrics across multiple vouchers, promotions, or other rewards. ", -1), st = { class: "flex gap-16 items-center" },
|
|
471
|
+
}, null, -1), ot = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Create campaign group to track performance ", -1), lt = /* @__PURE__ */ a("div", { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, " Start organizing your campaigns and promotions by creating groups. Groups allow you to aggregate performance metrics across multiple vouchers, promotions, or other rewards. ", -1), st = { class: "flex gap-16 items-center" }, Ct = /* @__PURE__ */ I({
|
|
473
472
|
__name: "Analytic",
|
|
474
473
|
setup(m) {
|
|
475
474
|
const R = {
|
|
@@ -501,7 +500,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
501
500
|
}
|
|
502
501
|
async function f() {
|
|
503
502
|
await i.readGroups();
|
|
504
|
-
const w = await
|
|
503
|
+
const w = await T.readAllGrouped({
|
|
505
504
|
limit: 100,
|
|
506
505
|
skip: 0,
|
|
507
506
|
sortBy: "_id",
|
|
@@ -518,7 +517,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
518
517
|
sortBy: "_id",
|
|
519
518
|
search: "",
|
|
520
519
|
descending: !1
|
|
521
|
-
}), v = await
|
|
520
|
+
}), v = await T.readAll({
|
|
522
521
|
limit: 1e3,
|
|
523
522
|
skip: 0,
|
|
524
523
|
sortBy: "_id",
|
|
@@ -552,7 +551,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
552
551
|
class: "xs:hidden",
|
|
553
552
|
modelValue: n(r),
|
|
554
553
|
"onUpdate:modelValue": v[1] || (v[1] = ($) => N(r) ? r.value = $ : null),
|
|
555
|
-
placeholder: "Search
|
|
554
|
+
placeholder: "Search",
|
|
556
555
|
collapsible: ""
|
|
557
556
|
}, null, 8, ["modelValue"])
|
|
558
557
|
]),
|
|
@@ -563,7 +562,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
563
562
|
default: O(() => [
|
|
564
563
|
Ye,
|
|
565
564
|
a("div", et, [
|
|
566
|
-
(l(), h(V, null,
|
|
565
|
+
(l(), h(V, null, P(s, ($, M) => a("div", {
|
|
567
566
|
key: $.key,
|
|
568
567
|
class: ne(["px-8", { "xs:!border-r": M % 2 == 0 }])
|
|
569
568
|
}, [
|
|
@@ -575,7 +574,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
575
574
|
_: 1
|
|
576
575
|
})
|
|
577
576
|
]),
|
|
578
|
-
n(_).length ?
|
|
577
|
+
n(_).length ? B("", !0) : (l(), F(k, {
|
|
579
578
|
key: 0,
|
|
580
579
|
variant: "outlined",
|
|
581
580
|
class: "flex flex-col gap-y-24 items-center p-16"
|
|
@@ -594,7 +593,7 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
594
593
|
]),
|
|
595
594
|
_: 1
|
|
596
595
|
})),
|
|
597
|
-
(l(!0), h(V, null,
|
|
596
|
+
(l(!0), h(V, null, P(n(g), ($) => (l(), F(Ue, {
|
|
598
597
|
key: $._id.toString(),
|
|
599
598
|
group: $,
|
|
600
599
|
"on-edit": o
|
|
@@ -610,5 +609,5 @@ const he = { class: "divide-x flex flex-wrap" }, be = { class: "fm-typo-en-body-
|
|
|
610
609
|
}
|
|
611
610
|
});
|
|
612
611
|
export {
|
|
613
|
-
|
|
612
|
+
Ct as default
|
|
614
613
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as P, ref as g, computed as U, onMounted as M, resolveComponent as l, openBlock as i, createElementBlock as f, Fragment as _, createVNode as r, unref as
|
|
1
|
+
import { defineComponent as P, ref as g, computed as U, onMounted as M, resolveComponent as l, openBlock as i, createElementBlock as f, Fragment as _, createVNode as r, unref as a, createElementVNode as s, withCtx as h, renderList as j, createBlock as w, resolveDynamicComponent as E, toDisplayString as b, createCommentVNode as H, h as q } from "vue";
|
|
2
2
|
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
3
|
import { useDialog as G, components as J } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as Q, p as W } from "./loading-
|
|
5
|
-
import { a as X } from "./app-
|
|
6
|
-
import { u as Y } from "./campaign-
|
|
7
|
-
import { g as F, b as k } from "./dto-
|
|
4
|
+
import { u as Q, p as W } from "./loading-uAAk9Jhw.js";
|
|
5
|
+
import { a as X } from "./app-DLrqEkpN.js";
|
|
6
|
+
import { u as Y } from "./campaign-el9UbKPS.js";
|
|
7
|
+
import { g as F, b as k } from "./dto-nI9tXw_a.js";
|
|
8
8
|
import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
-
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { u as te } from "./template-
|
|
11
|
-
import { c as y } from "./index-
|
|
12
|
-
const
|
|
9
|
+
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BP4MkXQG.js";
|
|
10
|
+
import { u as te } from "./template-D5x7w2gg.js";
|
|
11
|
+
import { c as y } from "./index-B5jSpptU.js";
|
|
12
|
+
const oe = { 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" }, re = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ie = { 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 = { key: 0 }, ue = /* @__PURE__ */ s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1), pe = [
|
|
13
13
|
ue
|
|
14
14
|
], fe = /* @__PURE__ */ s("img", {
|
|
15
15
|
src: z,
|
|
16
16
|
class: "aspect-square w-[150px]"
|
|
17
17
|
}, null, -1), ye = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
18
18
|
/* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, " Create your broadcast campaign "),
|
|
19
|
-
/* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "
|
|
19
|
+
/* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Broadcasting allows you to send text messages to all your customers, informing them about new deals, events, or important updates. ")
|
|
20
20
|
], -1), Ae = /* @__PURE__ */ P({
|
|
21
21
|
__name: "Broadcast",
|
|
22
22
|
setup(ge) {
|
|
@@ -25,7 +25,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
25
25
|
value: "create",
|
|
26
26
|
isPrimary: !0,
|
|
27
27
|
prependIcon: "add"
|
|
28
|
-
}, V = te("BROADCAST", G()), R = X(), c = Y(), { global: D, minor:
|
|
28
|
+
}, V = te("BROADCAST", G()), R = X(), c = Y(), { global: D, minor: C } = Q, L = g((/* @__PURE__ */ new Date()).toISOString()), n = g({
|
|
29
29
|
searchKey: "",
|
|
30
30
|
location: null
|
|
31
31
|
}), u = U(
|
|
@@ -58,15 +58,15 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
58
58
|
variant: "tertiary",
|
|
59
59
|
icon: "delete",
|
|
60
60
|
iconColor: "neutral-gray-400",
|
|
61
|
-
onClick: (
|
|
62
|
-
|
|
61
|
+
onClick: (o) => {
|
|
62
|
+
o.stopPropagation(), x(e.row.original);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
], v = g();
|
|
68
68
|
async function x(e) {
|
|
69
|
-
await W.remove(`Are you sure you want to remove ${e.name}?`) && await
|
|
69
|
+
await W.remove(`Are you sure you want to remove ${e.name}?`) && await C(
|
|
70
70
|
async () => {
|
|
71
71
|
await y.delete(e._id), await c.read("BROADCAST");
|
|
72
72
|
},
|
|
@@ -77,10 +77,10 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
async function p(e) {
|
|
80
|
-
L.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await
|
|
81
|
-
await
|
|
80
|
+
L.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await o() : V.open(async (m) => {
|
|
81
|
+
await o(m);
|
|
82
82
|
});
|
|
83
|
-
async function
|
|
83
|
+
async function o(m) {
|
|
84
84
|
var d;
|
|
85
85
|
(d = v.value) == null || d.showSheet(
|
|
86
86
|
!0,
|
|
@@ -91,7 +91,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
async function $(e) {
|
|
94
|
-
await
|
|
94
|
+
await C(
|
|
95
95
|
async () => {
|
|
96
96
|
e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await c.read("BROADCAST");
|
|
97
97
|
},
|
|
@@ -105,38 +105,38 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
105
105
|
await D(async () => {
|
|
106
106
|
await c.read("BROADCAST");
|
|
107
107
|
});
|
|
108
|
-
}), (e,
|
|
108
|
+
}), (e, o) => {
|
|
109
109
|
const m = l("FmPageHead"), d = l("FmSearch"), K = l("FmTable"), S = l("FmButton"), I = l("FmListItem"), O = l("FmList"), N = l("FmCard");
|
|
110
110
|
return i(), f(_, null, [
|
|
111
111
|
r(m, {
|
|
112
112
|
title: "Broadcast",
|
|
113
|
-
actions:
|
|
114
|
-
"onClick:action":
|
|
113
|
+
actions: a(u).length > 0 ? [A] : [],
|
|
114
|
+
"onClick:action": o[0] || (o[0] = () => p())
|
|
115
115
|
}, null, 8, ["actions"]),
|
|
116
|
-
s("div",
|
|
116
|
+
s("div", oe, [
|
|
117
117
|
r(d, {
|
|
118
|
-
modelValue:
|
|
119
|
-
"onUpdate:modelValue":
|
|
118
|
+
modelValue: a(n).searchKey,
|
|
119
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => a(n).searchKey = t),
|
|
120
120
|
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
121
121
|
placeholder: "search",
|
|
122
122
|
collapsible: ""
|
|
123
123
|
}, null, 8, ["modelValue"]),
|
|
124
|
-
|
|
125
|
-
s("div",
|
|
124
|
+
a(c).campaigns.broadcast && a(c).campaigns.broadcast.length > 0 ? (i(), f(_, { key: 0 }, [
|
|
125
|
+
s("div", ae, [
|
|
126
126
|
s("div", se, [
|
|
127
127
|
r(Z, {
|
|
128
|
-
modelValue:
|
|
129
|
-
"onUpdate:modelValue":
|
|
128
|
+
modelValue: a(n).location,
|
|
129
|
+
"onUpdate:modelValue": o[2] || (o[2] = (t) => a(n).location = t),
|
|
130
130
|
label: "Location: ",
|
|
131
131
|
"show-item-label": !0,
|
|
132
132
|
icon: "storefront",
|
|
133
133
|
placement: "bottom-start",
|
|
134
|
-
items:
|
|
134
|
+
items: a(R).locationItems
|
|
135
135
|
}, null, 8, ["modelValue", "items"])
|
|
136
136
|
]),
|
|
137
137
|
r(d, {
|
|
138
|
-
modelValue:
|
|
139
|
-
"onUpdate:modelValue":
|
|
138
|
+
modelValue: a(n).searchKey,
|
|
139
|
+
"onUpdate:modelValue": o[3] || (o[3] = (t) => a(n).searchKey = t),
|
|
140
140
|
class: "xs:hidden",
|
|
141
141
|
placeholder: "search",
|
|
142
142
|
collapsible: ""
|
|
@@ -144,17 +144,17 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
144
144
|
]),
|
|
145
145
|
r(K, {
|
|
146
146
|
class: "xs:hidden",
|
|
147
|
-
"row-data":
|
|
147
|
+
"row-data": a(u),
|
|
148
148
|
"column-defs": T,
|
|
149
|
-
"search-value":
|
|
149
|
+
"search-value": a(n).searchKey,
|
|
150
150
|
"column-filter": [],
|
|
151
|
-
onRowClick:
|
|
151
|
+
onRowClick: o[4] || (o[4] = (t) => p(t.original)),
|
|
152
152
|
"hide-footer": !0
|
|
153
153
|
}, null, 8, ["row-data", "search-value"]),
|
|
154
154
|
r(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
155
155
|
default: h(() => [
|
|
156
|
-
(i(!0), f(_, null, j(
|
|
157
|
-
(t) => t.name.toLowerCase().includes(
|
|
156
|
+
(i(!0), f(_, null, j(a(u).filter(
|
|
157
|
+
(t) => t.name.toLowerCase().includes(a(n).searchKey.toLowerCase())
|
|
158
158
|
), (t) => (i(), w(I, {
|
|
159
159
|
key: t._id.toString(),
|
|
160
160
|
onClick: (B) => p(t),
|
|
@@ -163,12 +163,12 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
163
163
|
default: h(() => [
|
|
164
164
|
s("div", ne, [
|
|
165
165
|
s("div", re, [
|
|
166
|
-
(i(), w(E(
|
|
167
|
-
s("div", le,
|
|
166
|
+
(i(), w(E(a(F)(t)))),
|
|
167
|
+
s("div", le, b(t.currentReceive ?? 0) + " sent ", 1)
|
|
168
168
|
]),
|
|
169
169
|
s("div", ie, [
|
|
170
|
-
s("div", ce,
|
|
171
|
-
s("div", me,
|
|
170
|
+
s("div", ce, b(t.name), 1),
|
|
171
|
+
s("div", me, b(a(k)(t)), 1)
|
|
172
172
|
])
|
|
173
173
|
]),
|
|
174
174
|
r(S, {
|
|
@@ -183,7 +183,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
183
183
|
]),
|
|
184
184
|
_: 1
|
|
185
185
|
}),
|
|
186
|
-
|
|
186
|
+
a(u).length == 0 ? (i(), f("div", de, pe)) : H("", !0)
|
|
187
187
|
], 64)) : (i(), w(N, {
|
|
188
188
|
key: 1,
|
|
189
189
|
variant: "outlined",
|
|
@@ -196,7 +196,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-
|
|
|
196
196
|
variant: "primary",
|
|
197
197
|
label: "Create broadcast campaign",
|
|
198
198
|
icon: "add",
|
|
199
|
-
onClick:
|
|
199
|
+
onClick: o[5] || (o[5] = (t) => p())
|
|
200
200
|
})
|
|
201
201
|
]),
|
|
202
202
|
_: 1
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { R as RuleOperator, _ } from "./index-
|
|
2
|
-
import { i as isRuleGroup } from "./rule-builder-
|
|
1
|
+
import { R as RuleOperator, _ } from "./index-C-4fybpk.js";
|
|
2
|
+
import { i as isRuleGroup } from "./rule-builder-z8MibNmg.js";
|
|
3
3
|
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, createVNode, toDisplayString } from "vue";
|
|
4
4
|
import { useDialog } from "@feedmepos/ui-library";
|
|
5
|
-
import "./index-
|
|
6
|
-
import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-
|
|
7
|
-
import "./index-
|
|
8
|
-
import "./index-
|
|
9
|
-
import "./index-
|
|
10
|
-
import "./index-
|
|
5
|
+
import "./index-DbWauIjL.js";
|
|
6
|
+
import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-BVIk3CBr.js";
|
|
7
|
+
import "./index-CVWlZHun.js";
|
|
8
|
+
import "./index-DU3kVZJo.js";
|
|
9
|
+
import "./index-CM4H_24q.js";
|
|
10
|
+
import "./index-B4Kds-ma.js";
|
|
11
11
|
function validateRule(data, r, date) {
|
|
12
12
|
const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
|
|
13
13
|
function meetConditions(e) {
|
|
14
14
|
return Object.entries(e.conditions ?? {}).reduce(
|
|
15
|
-
(o, [
|
|
16
|
-
const
|
|
15
|
+
(o, [n, t]) => {
|
|
16
|
+
const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
|
|
17
17
|
if (!t)
|
|
18
18
|
return o;
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const i = rules[n](
|
|
20
|
+
l,
|
|
21
21
|
t
|
|
22
22
|
);
|
|
23
|
-
return o &&
|
|
23
|
+
return o && i;
|
|
24
24
|
},
|
|
25
25
|
!0
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
function evaluateRuleResult(rr, logic) {
|
|
29
|
-
const target = Object.entries(rr).reduce((e, [o,
|
|
29
|
+
const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
|
|
30
30
|
return !logic || !!eval(target);
|
|
31
31
|
}
|
|
32
32
|
function getRuleResults(e) {
|
|
33
|
-
return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [
|
|
33
|
+
return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
|
|
34
34
|
...o,
|
|
35
|
-
[
|
|
35
|
+
[n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
|
|
36
36
|
}), {}) : {
|
|
37
37
|
[e.name]: meetConditions(e)
|
|
38
38
|
};
|
|
@@ -42,7 +42,7 @@ function validateRule(data, r, date) {
|
|
|
42
42
|
const _hoisted_1 = /* @__PURE__ */ createElementVNode("div", { class: "" }, [
|
|
43
43
|
/* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
|
|
44
44
|
/* @__PURE__ */ 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. ")
|
|
45
|
-
], -1), _hoisted_2 = { class: "flex flex-col h-full space-y-24" }, _hoisted_3 = { class: "fm-typo-en-title-sm-
|
|
45
|
+
], -1), _hoisted_2 = { class: "flex flex-col h-full space-y-24" }, _hoisted_3 = { class: "fm-typo-en-title-sm-600" }, _hoisted_4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
46
46
|
__name: "CampaignTypeDialog",
|
|
47
47
|
props: {
|
|
48
48
|
onSelect: {
|
|
@@ -51,7 +51,7 @@ const _hoisted_1 = /* @__PURE__ */ createElementVNode("div", { class: "" }, [
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
setup(e) {
|
|
54
|
-
const o = e,
|
|
54
|
+
const o = e, n = useDialog(), t = [
|
|
55
55
|
{
|
|
56
56
|
title: "Promotion",
|
|
57
57
|
description: "Special offers or deals made available for a limited time",
|
|
@@ -59,48 +59,48 @@ const _hoisted_1 = /* @__PURE__ */ createElementVNode("div", { class: "" }, [
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
title: "Voucher",
|
|
62
|
-
description: "
|
|
62
|
+
description: "A digital coupon that can be redeemed for a discounts on future purchases.",
|
|
63
63
|
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
title: "Experience",
|
|
67
|
-
description: "
|
|
67
|
+
description: "Experience points help customers gain membership tiers.",
|
|
68
68
|
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
title: "Point",
|
|
72
|
-
description: "
|
|
72
|
+
description: "Points allow customers to purchase bundle items.",
|
|
73
73
|
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
title: "Game",
|
|
77
|
-
description: "
|
|
77
|
+
description: "The game feature adds a fun and encourage customers to engage more.",
|
|
78
78
|
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
title: "Credit",
|
|
82
|
-
description: "
|
|
82
|
+
description: "Credits are virtual money that customers can use to pay for their purchases.",
|
|
83
83
|
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
|
|
84
84
|
}
|
|
85
85
|
];
|
|
86
|
-
function
|
|
87
|
-
|
|
86
|
+
function l(i) {
|
|
87
|
+
n.close(), o.onSelect(i);
|
|
88
88
|
}
|
|
89
|
-
return (
|
|
90
|
-
const
|
|
91
|
-
return openBlock(), createBlock(
|
|
89
|
+
return (i, c) => {
|
|
90
|
+
const a = resolveComponent("FmCard");
|
|
91
|
+
return openBlock(), createBlock(a, { class: "p-24 space-y-16" }, {
|
|
92
92
|
default: withCtx(() => [
|
|
93
93
|
_hoisted_1,
|
|
94
94
|
createElementVNode("div", _hoisted_2, [
|
|
95
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(t, (
|
|
95
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(a, {
|
|
96
96
|
variant: "outlined",
|
|
97
|
-
key:
|
|
98
|
-
onClick: (
|
|
99
|
-
class: "p-16"
|
|
97
|
+
key: s.value,
|
|
98
|
+
onClick: (u) => l(s.value),
|
|
99
|
+
class: "p-16 space-y-8 cursor-pointer"
|
|
100
100
|
}, {
|
|
101
101
|
default: withCtx(() => [
|
|
102
|
-
createElementVNode("div", _hoisted_3, toDisplayString(
|
|
103
|
-
createElementVNode("div", _hoisted_4, toDisplayString(
|
|
102
|
+
createElementVNode("div", _hoisted_3, toDisplayString(s.title), 1),
|
|
103
|
+
createElementVNode("div", _hoisted_4, toDisplayString(s.description), 1)
|
|
104
104
|
]),
|
|
105
105
|
_: 2
|
|
106
106
|
}, 1032, ["onClick"])), 64))
|