@feedmepos/mf-connect 0.1.0-beta.82 → 0.1.0-beta.83
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-CBw8P2GD.js → Analytic-Cibsck1I.js} +13 -13
- package/dist/{App-DRzhoICo.js → App-SoAq8GOG.js} +6 -6
- package/dist/{AuditLogs-CupGmk76.js → AuditLogs-DA_mWKzc.js} +9 -9
- package/dist/{Bin-DrhOCAsm.js → Bin-xS1gq6Ef.js} +8 -8
- package/dist/{Broadcast-CYONPJ3E.js → Broadcast-B4_G3Nxl.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C20p-3KM.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cdvzy8SW.js} +6 -6
- package/dist/{Card-D5hAelRk.js → Card-k37p6E9f.js} +16 -16
- package/dist/{Collections-BewVPWaP.js → Collections-BiCsEdHI.js} +6 -6
- package/dist/{Credit-f27AOJWs.js → Credit-BmH_1y4-.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-WAGvcQYq.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-hTew1on4.js} +29 -29
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DqkD9ia0.js → EffectSheet.vue_vue_type_style_index_0_lang-D66o4jLh.js} +6 -6
- package/dist/{Experience-BbRmTJtu.js → Experience-DWCOxkKu.js} +9 -9
- package/dist/{Game-DAIQyW3W.js → Game-DvnIVWoe.js} +10 -10
- package/dist/{Index-CoYPIOaz.js → Index-BburQLx3.js} +10 -10
- package/dist/{Marketing-DVMlPT-C.js → Marketing-6gOsFqD0.js} +6 -6
- package/dist/{Member-CKMXp7Kv.js → Member-DsaeuO7g.js} +10 -10
- package/dist/{MemberList-B1gyqgLI.js → MemberList-BQbjU034.js} +25 -25
- package/dist/{MemberTransactions-C93IQkF4.js → MemberTransactions-CL2MjorK.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-9Ok7oQDE.js → MessageInput.vue_vue_type_script_setup_true_lang-CK19Rthj.js} +136 -128
- package/dist/{Mission-CejSfF0T.js → Mission-CWffZPBc.js} +10 -10
- package/dist/{Overview-BXlPrjEc.js → Overview-D5XuLyMY.js} +18 -18
- package/dist/{Point-8vHZ6FGG.js → Point-CZu6bfKl.js} +9 -9
- package/dist/{Promotion-DiITB5S7.js → Promotion-Bu0iaUjf.js} +10 -10
- package/dist/{Queue-CvIPgm_d.js → Queue-TxsPN8pg.js} +10 -10
- package/dist/{Record-CVwBBLeZ.js → Record-ByXR_2W8.js} +8 -8
- package/dist/{Reward-r-S2TRN8.js → Reward-DVhbmwtO.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DSura5J3.js → RewardGroup.vue_vue_type_script_setup_true_lang-yrRqQFP5.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-fYW68q6D.js → RuleGroup.vue_vue_type_script_setup_true_lang-eV4cGyPO.js} +13 -13
- package/dist/{Segment-CIhsVO5h.js → Segment-CEaCc68W.js} +219 -217
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DWcMoj2p.js → SelectItems.vue_vue_type_script_setup_true_lang-DsMoG__V.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-A6FE7KOm.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-KCFSf3iO.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-ClJLVgdQ.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bhd9c8Fj.js} +3 -3
- package/dist/{Setting-DZwRXWam.js → Setting-BZIexU1r.js} +11 -11
- package/dist/{Store-BhpMkNBs.js → Store-D4nW0QZw.js} +20 -20
- package/dist/{StoreRewards-M1aFhC9J.js → StoreRewards-mlbS9GMt.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CP_h7zod.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BUmnBgzt.js} +19 -19
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Bcz4gbEr.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CHDdwrgb.js} +1 -1
- package/dist/{Tier-BMVX0jFk.js → Tier-BwrWurfH.js} +20 -20
- package/dist/{Title-DdjKcxur.js → Title-PrHbpiRu.js} +19 -19
- package/dist/{Transaction-DkV8PrBz.js → Transaction-5Tf08q5c.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BlrkCtxB.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BAMDhiVR.js} +6 -6
- package/dist/{Voucher-Bpc2egmB.js → Voucher-C9b6l8Nz.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-rz6V9CH-.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CVKmmjgI.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-9w0W0P56.js → ZodTextField.vue_vue_type_script_setup_true_lang-C_pkz5HN.js} +1 -1
- package/dist/{app-DZhfz_ql.js → app-BYPSPDqq.js} +1 -1
- package/dist/{app-XexW_r1G.js → app-CF6qrgbf.js} +31 -31
- package/dist/app.js +1 -1
- package/dist/{business-BaHhfC8g.js → business-mXwIv1Tk.js} +1 -1
- package/dist/{campaign-D2e6NjMK.js → campaign-3ZIlabCM.js} +2 -2
- package/dist/{campaign-DnPSPS0x.js → campaign-BRtfNz4N.js} +9 -9
- package/dist/{campaign.enum-C1OTS8g7.js → campaign.enum-CynkbMYa.js} +1 -1
- package/dist/{campaign.fn-C9oQqSbb.js → campaign.fn-Drbvc3as.js} +29 -29
- package/dist/{collectible.enum-DKwYTT9-.js → collectible.enum-C2OtYUr8.js} +1 -1
- package/dist/{collection.fn-BVJivAe7.js → collection.fn-B-8JrHXm.js} +2 -2
- package/dist/{dto-Cp--moPA.js → dto-DafJD1UU.js} +4 -4
- package/dist/{effect-BXciGhmP.js → effect-DelgHXLV.js} +1 -1
- package/dist/{email-addresses-C42sBywW.js → email-addresses-DJOQGvhY.js} +1 -1
- package/dist/{export-B6FT6F56.js → export-B5zyYKA4.js} +3 -3
- package/dist/{helper-BoAVLFyb.js → helper-CZ5y5f8x.js} +1 -1
- package/dist/{index-D9h2nwgA.js → index-BGgGjSMf.js} +1 -1
- package/dist/{index-aBEeXM5A.js → index-BLJQJJpG.js} +1 -1
- package/dist/{index-CMZahSvv.js → index-C1TFVEid.js} +1 -1
- package/dist/{index-CnJF0iBS.js → index-C27FGDKl.js} +6 -6
- package/dist/{index-DS3AamMg.js → index-C5gy-Mrl.js} +1 -1
- package/dist/{index-DTVP45aL.js → index-CdzKALkl.js} +1 -1
- package/dist/{index-DjSd_4j9.js → index-D6iARrXd.js} +1 -1
- package/dist/{index-D6zoalIT.js → index-DIj1y1ql.js} +3 -3
- package/dist/{index-LCqX0e8J.js → index-DOHEErmn.js} +11462 -10984
- package/dist/{index-DAbyEWej.js → index-DtY7OWdm.js} +4 -4
- package/dist/{index-CTeFQcfF.js → index-NmKUUV-n.js} +2 -2
- package/dist/index-m_sYTNL4.js +32260 -0
- package/dist/{index-BBj-RobN.js → index-pB_UPDXB.js} +1 -1
- package/dist/{index.esm2017-slgkm3vs.js → index.esm2017-Dz5wgmrr.js} +1 -1
- package/dist/{loading-TPqOzupf.js → loading-CDyMmWrV.js} +1 -1
- package/dist/{membership-DIeSZc-c.js → membership-CzWcmaRa.js} +3 -3
- package/dist/{money-BqEFcNd7.js → money-CSkaYOR8.js} +1 -1
- package/dist/{number-DYqQUiIA.js → number-Ba8nXwRs.js} +1 -1
- package/dist/{objectid-Bt4e2s8i.js → objectid-C6acOwBF.js} +9 -9
- package/dist/{plugins-t3U231HK.js → plugins-D4DLyZOD.js} +2 -2
- package/dist/{reward-CRIhvDJv.js → reward-JNYFh1VU.js} +1 -1
- package/dist/{rule-Di-bv9Kl.js → rule-Rb07vcPX.js} +3 -3
- package/dist/{rule-builder-Bn0LlsqI.js → rule-builder-BZhVDn3O.js} +1 -1
- package/dist/{template-Dimacks8.js → template-BnIs2YDg.js} +4 -4
- package/dist/{trigger-2vCjzy2B.js → trigger-CKGpvx3W.js} +4 -4
- package/dist/{user-BMpW1caM.js → user-JklnhTUu.js} +1 -1
- package/dist/{vue-i18n-inTBFBvR.js → vue-i18n-6805g0Ok.js} +2 -2
- package/dist/{xlsx-DpjVCWYe.js → xlsx-_pkp206G.js} +1 -1
- package/package.json +2 -2
- package/dist/index-BRsU9RwL.js +0 -29566
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as z, resolveComponent as
|
|
1
|
+
import { defineComponent as ee, ref as z, resolveComponent as b, openBlock as p, createElementBlock as k, createElementVNode as l, createVNode as r, unref as t, createCommentVNode as le, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as $, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
|
|
2
2
|
import { _ as Ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { p as
|
|
4
|
-
import { u as
|
|
5
|
-
import { FmButtonVariant as
|
|
6
|
-
import { u as we, _ as
|
|
7
|
-
import { u as
|
|
8
|
-
import "./index-
|
|
9
|
-
import { i as
|
|
10
|
-
import "./index-
|
|
11
|
-
import "./index-
|
|
12
|
-
import "./index-
|
|
13
|
-
import { u as
|
|
14
|
-
import { e as Pe, M as
|
|
15
|
-
import { Z as
|
|
3
|
+
import { p as Ae } from "./plugins-D4DLyZOD.js";
|
|
4
|
+
import { u as De } from "./loading-CDyMmWrV.js";
|
|
5
|
+
import { FmButtonVariant as ae, useSnackbar as Re, components as X } from "@feedmepos/ui-library";
|
|
6
|
+
import { u as we, _ as be } from "./usePagination-BeF5K3M7.js";
|
|
7
|
+
import { u as Fe } from "./vue-i18n-6805g0Ok.js";
|
|
8
|
+
import "./index-C27FGDKl.js";
|
|
9
|
+
import { i as $e, j as R, c as fe } from "./index-DtY7OWdm.js";
|
|
10
|
+
import "./index-NmKUUV-n.js";
|
|
11
|
+
import "./index-C1TFVEid.js";
|
|
12
|
+
import "./index-DIj1y1ql.js";
|
|
13
|
+
import { u as ne, w as he } from "./xlsx-_pkp206G.js";
|
|
14
|
+
import { e as Pe, M as Be } from "./email-addresses-DJOQGvhY.js";
|
|
15
|
+
import { Z as Ne } from "./zod-Bg2FbC-D.js";
|
|
16
16
|
import { u as Ve } from "./app-wDQR6dpb.js";
|
|
17
|
-
import { F as ye, z as Ye } from "./index-
|
|
18
|
-
import { R as ge } from "./rule-builder-
|
|
19
|
-
import { _ as
|
|
20
|
-
import { _ as
|
|
21
|
-
import { u as ze, v as Oe, w as je } from "./index.esm2017-
|
|
17
|
+
import { F as ye, z as Ye } from "./index-m_sYTNL4.js";
|
|
18
|
+
import { R as ge } from "./rule-builder-BZhVDn3O.js";
|
|
19
|
+
import { _ as Ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-C_pkz5HN.js";
|
|
20
|
+
import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-eV4cGyPO.js";
|
|
21
|
+
import { u as ze, v as Oe, w as je } from "./index.esm2017-Dz5wgmrr.js";
|
|
22
22
|
import { F as qe } from "./FileSaver.min-NlMItPOc.js";
|
|
23
|
-
import { h as
|
|
24
|
-
import { s as
|
|
25
|
-
import { o as
|
|
26
|
-
import { u as Ce } from "./business-
|
|
27
|
-
import { f as Je } from "./number-
|
|
28
|
-
import { t as Qe } from "./money-
|
|
29
|
-
import "./index-
|
|
23
|
+
import { h as H } from "./moment-BWErdI6_.js";
|
|
24
|
+
import { s as B, u as Ge } from "./membership-CzWcmaRa.js";
|
|
25
|
+
import { o as He } from "./objectId-dwaoBfJX.js";
|
|
26
|
+
import { u as Ce } from "./business-mXwIv1Tk.js";
|
|
27
|
+
import { f as Je } from "./number-Ba8nXwRs.js";
|
|
28
|
+
import { t as Qe } from "./money-CSkaYOR8.js";
|
|
29
|
+
import "./index-pB_UPDXB.js";
|
|
30
30
|
import { useRouter as We } from "vue-router";
|
|
31
|
-
import { m as ve } from "./index-
|
|
32
|
-
import { R as _e } from "./app-
|
|
33
|
-
const Ze =
|
|
31
|
+
import { m as ve } from "./index-BLJQJJpG.js";
|
|
32
|
+
import { R as _e } from "./app-CF6qrgbf.js";
|
|
33
|
+
const Ze = $e.extend({
|
|
34
34
|
_id: ye.optional(),
|
|
35
35
|
business: ye.optional(),
|
|
36
36
|
file: Ye.any().nullish()
|
|
37
|
-
})
|
|
37
|
+
});
|
|
38
|
+
var Ke = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" };
|
|
39
|
+
const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
38
40
|
key: 0,
|
|
39
41
|
class: /* @__PURE__ */ re([
|
|
40
42
|
"p-16 pl-24 space-x-8",
|
|
@@ -42,21 +44,21 @@ const Ze = De.extend({
|
|
|
42
44
|
"flex items-center",
|
|
43
45
|
"justify-between"
|
|
44
46
|
])
|
|
45
|
-
},
|
|
47
|
+
}, tt = { class: "flex justify-end" }, ot = {
|
|
46
48
|
key: 1,
|
|
47
49
|
class: /* @__PURE__ */ re([
|
|
48
50
|
"flex items-center",
|
|
49
51
|
"border border-fm-color-neutral-gray-300",
|
|
50
52
|
"p-16 space-x-16 rounded-md"
|
|
51
53
|
])
|
|
52
|
-
},
|
|
54
|
+
}, at = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, nt = /* @__PURE__ */ ee({
|
|
53
55
|
__name: "ImportSegment",
|
|
54
56
|
props: {
|
|
55
57
|
importFile: {}
|
|
56
58
|
},
|
|
57
59
|
emits: ["update:file"],
|
|
58
60
|
setup(e, { emit: _ }) {
|
|
59
|
-
const x = e,
|
|
61
|
+
const x = e, h = _, { t: m } = Fe(), y = z(null), f = z(null), F = ["Id"], i = [
|
|
60
62
|
{
|
|
61
63
|
label: "CSV",
|
|
62
64
|
icon: "csv",
|
|
@@ -68,10 +70,10 @@ const Ze = De.extend({
|
|
|
68
70
|
value: "xlsx"
|
|
69
71
|
}
|
|
70
72
|
];
|
|
71
|
-
async function
|
|
73
|
+
async function n() {
|
|
72
74
|
if (x.importFile)
|
|
73
75
|
try {
|
|
74
|
-
const S = ze(), g = Oe(S, x.importFile), w = await je(g);
|
|
76
|
+
const S = ze(void 0, Ke.importFilesBucketUrl), g = Oe(S, x.importFile), w = await je(g);
|
|
75
77
|
window.open(w, "_blank");
|
|
76
78
|
} catch (S) {
|
|
77
79
|
console.log(S);
|
|
@@ -80,39 +82,39 @@ const Ze = De.extend({
|
|
|
80
82
|
async function c(S) {
|
|
81
83
|
switch (S) {
|
|
82
84
|
case "csv":
|
|
83
|
-
const g = new Blob([
|
|
85
|
+
const g = new Blob([F.join(",")], {
|
|
84
86
|
type: "text/csv;charset=utf-8;"
|
|
85
87
|
});
|
|
86
88
|
qe.saveAs(g, "ImportSegmentTemplate.csv");
|
|
87
89
|
break;
|
|
88
90
|
case "xlsx":
|
|
89
|
-
const w =
|
|
90
|
-
|
|
91
|
+
const w = ne.aoa_to_sheet([F]), I = ne.book_new();
|
|
92
|
+
ne.book_append_sheet(I, w, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
|
|
91
93
|
break;
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
function C(S) {
|
|
95
|
-
y.value = S,
|
|
97
|
+
y.value = S, h("update:file", y.value);
|
|
96
98
|
}
|
|
97
|
-
function
|
|
98
|
-
var w,
|
|
99
|
-
const g = ((
|
|
99
|
+
function A(S) {
|
|
100
|
+
var w, I;
|
|
101
|
+
const g = ((I = (w = S.target) == null ? void 0 : w.files) == null ? void 0 : I[0]) ?? null;
|
|
100
102
|
C(g);
|
|
101
103
|
}
|
|
102
104
|
return (S, g) => {
|
|
103
|
-
const w =
|
|
104
|
-
return p(), k("div",
|
|
105
|
+
const w = b("FmButton"), I = b("FmMenuItem"), u = b("FmMenu"), s = b("FmDropField");
|
|
106
|
+
return p(), k("div", Xe, [
|
|
105
107
|
g[2] || (g[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
|
|
106
|
-
S.importFile ? (p(), k("div",
|
|
108
|
+
S.importFile ? (p(), k("div", et, [
|
|
107
109
|
r(w, {
|
|
108
110
|
label: t(m)("View uploaded file"),
|
|
109
|
-
variant: t(
|
|
111
|
+
variant: t(ae).Plain,
|
|
110
112
|
icon: "file_present",
|
|
111
|
-
onClick:
|
|
113
|
+
onClick: n
|
|
112
114
|
}, null, 8, ["label", "variant"])
|
|
113
115
|
])) : le("", !0),
|
|
114
116
|
l("div", null, [
|
|
115
|
-
l("div",
|
|
117
|
+
l("div", tt, [
|
|
116
118
|
r(u, { class: "" }, {
|
|
117
119
|
"menu-button": E(() => [
|
|
118
120
|
r(w, {
|
|
@@ -122,30 +124,30 @@ const Ze = De.extend({
|
|
|
122
124
|
})
|
|
123
125
|
]),
|
|
124
126
|
default: E(() => [
|
|
125
|
-
(p(), k(O, null, ie(i, (v) => r(
|
|
127
|
+
(p(), k(O, null, ie(i, (v) => r(I, {
|
|
126
128
|
key: v.value,
|
|
127
129
|
icon: v.icon,
|
|
128
130
|
label: v.label,
|
|
129
|
-
onClick: (
|
|
131
|
+
onClick: (U) => c(v.value),
|
|
130
132
|
selectable: ""
|
|
131
133
|
}, null, 8, ["icon", "label", "onClick"])), 64))
|
|
132
134
|
]),
|
|
133
135
|
_: 1
|
|
134
136
|
})
|
|
135
137
|
]),
|
|
136
|
-
y.value ? (p(), k("div",
|
|
138
|
+
y.value ? (p(), k("div", ot, [
|
|
137
139
|
r(w, {
|
|
138
|
-
variant: t(
|
|
140
|
+
variant: t(ae).Tertiary,
|
|
139
141
|
"prepend-icon": "attach_file"
|
|
140
142
|
}, null, 8, ["variant"]),
|
|
141
|
-
l("p",
|
|
143
|
+
l("p", at, $(y.value.name), 1),
|
|
142
144
|
l("label", {
|
|
143
145
|
ref_key: "fileLabelRef",
|
|
144
146
|
ref: f,
|
|
145
147
|
htmlFor: "file"
|
|
146
148
|
}, [
|
|
147
149
|
r(w, {
|
|
148
|
-
variant: t(
|
|
150
|
+
variant: t(ae).Plain,
|
|
149
151
|
label: t(m)("Replace File"),
|
|
150
152
|
onClick: g[1] || (g[1] = () => {
|
|
151
153
|
var v;
|
|
@@ -158,7 +160,7 @@ const Ze = De.extend({
|
|
|
158
160
|
class: "hidden",
|
|
159
161
|
type: "file",
|
|
160
162
|
multiple: "",
|
|
161
|
-
onChange:
|
|
163
|
+
onChange: A
|
|
162
164
|
}, null, 32)
|
|
163
165
|
], 512)
|
|
164
166
|
])) : (p(), J(s, {
|
|
@@ -171,7 +173,7 @@ const Ze = De.extend({
|
|
|
171
173
|
]);
|
|
172
174
|
};
|
|
173
175
|
}
|
|
174
|
-
}),
|
|
176
|
+
}), st = { class: "space-y-16 pr-12" }, lt = { class: "fm-typo-en-title-md-800" }, it = { class: "flex space-x-8" }, rt = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, ct = { class: "text-fm-color-typo-secondary" }, dt = /* @__PURE__ */ ee({
|
|
175
177
|
__name: "ReviewSegment",
|
|
176
178
|
props: {
|
|
177
179
|
title: {},
|
|
@@ -181,57 +183,57 @@ const Ze = De.extend({
|
|
|
181
183
|
const _ = e, x = [
|
|
182
184
|
{
|
|
183
185
|
header: "Name",
|
|
184
|
-
accessorFn: (
|
|
186
|
+
accessorFn: (n) => n.name
|
|
185
187
|
},
|
|
186
188
|
{
|
|
187
189
|
header: "Id",
|
|
188
|
-
accessorFn: (
|
|
190
|
+
accessorFn: (n) => n._id
|
|
189
191
|
},
|
|
190
192
|
{
|
|
191
193
|
header: "Customer Since",
|
|
192
|
-
accessorFn: (
|
|
194
|
+
accessorFn: (n) => H(He(n._id.toString())).format("DD MMM YYYY")
|
|
193
195
|
},
|
|
194
196
|
{
|
|
195
197
|
header: "Phone",
|
|
196
|
-
accessorFn: (
|
|
198
|
+
accessorFn: (n) => n.phoneNumber
|
|
197
199
|
},
|
|
198
200
|
{
|
|
199
201
|
header: "Birthday",
|
|
200
|
-
accessorFn: (
|
|
202
|
+
accessorFn: (n) => H(n.birthday).format("DD MMM YYYY")
|
|
201
203
|
},
|
|
202
204
|
{
|
|
203
205
|
header: "Last Visit",
|
|
204
|
-
accessorFn: (
|
|
206
|
+
accessorFn: (n) => H(n.stats.lastVisit).format("DD MMM YYYY")
|
|
205
207
|
}
|
|
206
208
|
];
|
|
207
|
-
async function
|
|
208
|
-
return _.segment._id ? (console.log(
|
|
209
|
+
async function h(n) {
|
|
210
|
+
return _.segment._id ? (console.log(n), await B.paginateSegmentUsers(
|
|
209
211
|
_.segment._id,
|
|
210
|
-
|
|
212
|
+
n
|
|
211
213
|
)) : {
|
|
212
214
|
resources: [],
|
|
213
215
|
meta: {
|
|
214
216
|
totalResources: 0,
|
|
215
217
|
totalPages: 0,
|
|
216
|
-
skip:
|
|
217
|
-
limit:
|
|
218
|
-
sortBy:
|
|
218
|
+
skip: n.skip,
|
|
219
|
+
limit: n.limit,
|
|
220
|
+
sortBy: n.sortBy
|
|
219
221
|
}
|
|
220
222
|
};
|
|
221
223
|
}
|
|
222
|
-
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData:
|
|
224
|
+
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: F, onSearch: i } = we(h);
|
|
223
225
|
return Se(async () => {
|
|
224
|
-
await
|
|
225
|
-
}), (
|
|
226
|
-
l("div",
|
|
227
|
-
l("div",
|
|
228
|
-
l("div",
|
|
229
|
-
l("div",
|
|
226
|
+
await F();
|
|
227
|
+
}), (n, c) => (p(), k("div", st, [
|
|
228
|
+
l("div", lt, $(_.title), 1),
|
|
229
|
+
l("div", it, [
|
|
230
|
+
l("div", rt, $(n.segment.members.length), 1),
|
|
231
|
+
l("div", ct, [
|
|
230
232
|
c[1] || (c[1] = l("div", null, "contacts in your segment", -1)),
|
|
231
|
-
l("div", null, "as of " +
|
|
233
|
+
l("div", null, "as of " + $(t(H)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
232
234
|
])
|
|
233
235
|
]),
|
|
234
|
-
r(
|
|
236
|
+
r(be, {
|
|
235
237
|
loading: t(m).isLoading,
|
|
236
238
|
"row-data": t(y),
|
|
237
239
|
"row-count": t(m).totalRows,
|
|
@@ -240,11 +242,11 @@ const Ze = De.extend({
|
|
|
240
242
|
"page-count": t(m).pageCount,
|
|
241
243
|
"page-index": t(m).pageIndex,
|
|
242
244
|
onSortChange: t(f),
|
|
243
|
-
onPageChange: c[0] || (c[0] = (C) => t(
|
|
245
|
+
onPageChange: c[0] || (c[0] = (C) => t(F)({ pageSize: C.pageSize, pageIndex: C.pageIndex }))
|
|
244
246
|
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
245
247
|
]));
|
|
246
248
|
}
|
|
247
|
-
}),
|
|
249
|
+
}), ut = { class: "space-y-24" }, pt = { class: "grid grid-cols-2 gap-16" }, mt = { class: "fm-typo-en-title-sm-800" }, ft = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, yt = /* @__PURE__ */ ee({
|
|
248
250
|
__name: "SegmentTypeOption",
|
|
249
251
|
props: {
|
|
250
252
|
modelValue: {},
|
|
@@ -252,7 +254,7 @@ const Ze = De.extend({
|
|
|
252
254
|
},
|
|
253
255
|
emits: ["update:model-value"],
|
|
254
256
|
setup(e, { emit: _ }) {
|
|
255
|
-
const x = e,
|
|
257
|
+
const x = e, h = _, m = [
|
|
256
258
|
{
|
|
257
259
|
label: "Dynamic",
|
|
258
260
|
sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
|
|
@@ -265,12 +267,12 @@ const Ze = De.extend({
|
|
|
265
267
|
}
|
|
266
268
|
];
|
|
267
269
|
function y(f) {
|
|
268
|
-
f !== x.modelValue &&
|
|
270
|
+
f !== x.modelValue && h("update:model-value", f);
|
|
269
271
|
}
|
|
270
|
-
return (f,
|
|
271
|
-
const i =
|
|
272
|
-
return p(), k("div",
|
|
273
|
-
l("div",
|
|
272
|
+
return (f, F) => {
|
|
273
|
+
const i = b("FmCard"), n = b("FmHelperText");
|
|
274
|
+
return p(), k("div", ut, [
|
|
275
|
+
l("div", pt, [
|
|
274
276
|
(p(), k(O, null, ie(m, (c) => r(i, {
|
|
275
277
|
variant: "outlined",
|
|
276
278
|
class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
@@ -282,13 +284,13 @@ const Ze = De.extend({
|
|
|
282
284
|
key: c.value
|
|
283
285
|
}, {
|
|
284
286
|
default: E(() => [
|
|
285
|
-
l("div",
|
|
286
|
-
l("div",
|
|
287
|
+
l("div", mt, $(c.label), 1),
|
|
288
|
+
l("div", ft, $(c.sublabel), 1)
|
|
287
289
|
]),
|
|
288
290
|
_: 2
|
|
289
291
|
}, 1032, ["class", "onClick"])), 64))
|
|
290
292
|
]),
|
|
291
|
-
f.errorText ? (p(), J(
|
|
293
|
+
f.errorText ? (p(), J(n, {
|
|
292
294
|
key: 0,
|
|
293
295
|
class: "!mt-4",
|
|
294
296
|
text: f.errorText,
|
|
@@ -297,30 +299,30 @@ const Ze = De.extend({
|
|
|
297
299
|
]);
|
|
298
300
|
};
|
|
299
301
|
}
|
|
300
|
-
}),
|
|
302
|
+
}), gt = { class: "flex items-center gap-x-8" }, vt = {
|
|
301
303
|
key: 0,
|
|
302
304
|
class: "space-y-16 pr-12"
|
|
303
|
-
},
|
|
305
|
+
}, _t = { class: "flex flex-col space-y-16" }, xt = {
|
|
304
306
|
key: 0,
|
|
305
307
|
class: "flex flex-col space-y-16"
|
|
306
|
-
},
|
|
308
|
+
}, St = {
|
|
307
309
|
key: 1,
|
|
308
310
|
class: "flex flex-col space-y-16"
|
|
309
|
-
},
|
|
311
|
+
}, wt = {
|
|
310
312
|
key: 2,
|
|
311
313
|
class: "flex flex-col space-y-16"
|
|
312
|
-
},
|
|
314
|
+
}, bt = { class: "flex items-center gap-8" }, Ft = /* @__PURE__ */ ee({
|
|
313
315
|
__name: "SegmentSheet",
|
|
314
316
|
emits: ["update:model-value"],
|
|
315
317
|
setup(e, { expose: _, emit: x }) {
|
|
316
|
-
const
|
|
318
|
+
const h = Ve(), m = z(!1), y = z(!1), f = {
|
|
317
319
|
name: "",
|
|
318
320
|
isActive: !0,
|
|
319
321
|
type: R.enum.DYNAMIC,
|
|
320
322
|
rule: ge.scaffoldGroup(),
|
|
321
323
|
members: []
|
|
322
|
-
},
|
|
323
|
-
const u =
|
|
324
|
+
}, F = Ze, i = z(f), n = ce(() => {
|
|
325
|
+
const u = F.safeParse(i.value);
|
|
324
326
|
return u.success ? [] : u.error.errors;
|
|
325
327
|
});
|
|
326
328
|
function c(u) {
|
|
@@ -333,42 +335,42 @@ const Ze = De.extend({
|
|
|
333
335
|
function C() {
|
|
334
336
|
m.value = !1;
|
|
335
337
|
}
|
|
336
|
-
async function
|
|
337
|
-
|
|
338
|
+
async function A() {
|
|
339
|
+
F.safeParse(i.value).success && (y.value = !0);
|
|
338
340
|
}
|
|
339
341
|
function S() {
|
|
340
342
|
y.value = !1;
|
|
341
343
|
}
|
|
342
344
|
async function g() {
|
|
343
|
-
i.value.type === R.enum.STATIC ? (i.value.rule = ge.scaffoldGroup(), i.value.isActive = !0) : i.value.file = void 0,
|
|
345
|
+
i.value.type === R.enum.STATIC ? (i.value.rule = ge.scaffoldGroup(), i.value.isActive = !0) : i.value.file = void 0, I("update:model-value", i.value);
|
|
344
346
|
}
|
|
345
347
|
async function w(u) {
|
|
346
348
|
i.value.type = u;
|
|
347
349
|
}
|
|
348
350
|
Se(async () => {
|
|
349
351
|
});
|
|
350
|
-
const
|
|
352
|
+
const I = x;
|
|
351
353
|
return _({
|
|
352
354
|
showSheet: c,
|
|
353
355
|
hideSheet: C
|
|
354
356
|
}), (u, s) => {
|
|
355
|
-
const v =
|
|
356
|
-
return p(), J(
|
|
357
|
+
const v = b("FmButton"), U = b("FmSwitch"), a = b("FmSideSheet");
|
|
358
|
+
return p(), J(a, {
|
|
357
359
|
modelValue: t(m),
|
|
358
|
-
"onUpdate:modelValue": s[8] || (s[8] = (o) =>
|
|
360
|
+
"onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(m) ? m.value = o : null),
|
|
359
361
|
header: "Add segment",
|
|
360
362
|
"dismiss-away": "",
|
|
361
363
|
"close-button": !0,
|
|
362
364
|
"max-width": 1100
|
|
363
|
-
},
|
|
365
|
+
}, Me({
|
|
364
366
|
"side-sheet-footer": E(() => [
|
|
365
|
-
l("div",
|
|
367
|
+
l("div", bt, [
|
|
366
368
|
t(y) || t(i).type === t(R).enum.STATIC ? (p(), k(O, { key: 0 }, [
|
|
367
369
|
r(v, {
|
|
368
370
|
label: "Save Segment",
|
|
369
371
|
onClick: g,
|
|
370
|
-
loading: t(
|
|
371
|
-
disabled: t(
|
|
372
|
+
loading: t(h).isLoading,
|
|
373
|
+
disabled: t(n).length > 0 || t(h).isLoading
|
|
372
374
|
}, null, 8, ["loading", "disabled"]),
|
|
373
375
|
r(v, {
|
|
374
376
|
label: "Cancel",
|
|
@@ -378,8 +380,8 @@ const Ze = De.extend({
|
|
|
378
380
|
], 64)) : (p(), k(O, { key: 1 }, [
|
|
379
381
|
r(v, {
|
|
380
382
|
label: "Review Segment",
|
|
381
|
-
disabled: t(
|
|
382
|
-
onClick:
|
|
383
|
+
disabled: t(n).length > 0 || t(h).isLoading,
|
|
384
|
+
onClick: A
|
|
383
385
|
}, null, 8, ["disabled"]),
|
|
384
386
|
r(v, {
|
|
385
387
|
label: "Cancel",
|
|
@@ -392,29 +394,29 @@ const Ze = De.extend({
|
|
|
392
394
|
default: E(() => {
|
|
393
395
|
var o;
|
|
394
396
|
return [
|
|
395
|
-
t(y) ? (p(), J(
|
|
397
|
+
t(y) ? (p(), J(dt, {
|
|
396
398
|
key: 1,
|
|
397
399
|
title: t(i).name,
|
|
398
400
|
segment: t(i)
|
|
399
|
-
}, null, 8, ["title", "segment"])) : (p(), k("div",
|
|
400
|
-
r(
|
|
401
|
+
}, null, 8, ["title", "segment"])) : (p(), k("div", vt, [
|
|
402
|
+
r(Ue, {
|
|
401
403
|
modelValue: t(i).name,
|
|
402
404
|
"onUpdate:modelValue": s[1] || (s[1] = (d) => t(i).name = d),
|
|
403
405
|
label: "Segment title",
|
|
404
|
-
schema: t(
|
|
406
|
+
schema: t(Ne).typeAtPath(t(F), "name")
|
|
405
407
|
}, null, 8, ["modelValue", "schema"]),
|
|
406
|
-
l("div",
|
|
408
|
+
l("div", _t, [
|
|
407
409
|
s[10] || (s[10] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
|
|
408
|
-
r(
|
|
410
|
+
r(yt, {
|
|
409
411
|
"model-value": t(i).type,
|
|
410
412
|
"onUpdate:modelValue": s[2] || (s[2] = (d) => {
|
|
411
413
|
w(d);
|
|
412
414
|
})
|
|
413
415
|
}, null, 8, ["model-value"])
|
|
414
416
|
]),
|
|
415
|
-
t(i).type === t(R).enum.DYNAMIC ? (p(), k("div",
|
|
417
|
+
t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", xt, [
|
|
416
418
|
s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
417
|
-
r(
|
|
419
|
+
r(Le, {
|
|
418
420
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
419
421
|
includeOnly: "user",
|
|
420
422
|
"model-value": (o = t(i)) == null ? void 0 : o.rule,
|
|
@@ -422,7 +424,7 @@ const Ze = De.extend({
|
|
|
422
424
|
t(i).rule = d;
|
|
423
425
|
})
|
|
424
426
|
}, null, 8, ["model-value"])
|
|
425
|
-
])) : (p(), k("div",
|
|
427
|
+
])) : (p(), k("div", St, [
|
|
426
428
|
r(nt, {
|
|
427
429
|
importFile: t(i).importFile,
|
|
428
430
|
"onUpdate:file": s[4] || (s[4] = (d) => {
|
|
@@ -430,9 +432,9 @@ const Ze = De.extend({
|
|
|
430
432
|
})
|
|
431
433
|
}, null, 8, ["importFile"])
|
|
432
434
|
])),
|
|
433
|
-
t(i).type === t(R).enum.DYNAMIC ? (p(), k("div",
|
|
435
|
+
t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", wt, [
|
|
434
436
|
s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
|
|
435
|
-
r(
|
|
437
|
+
r(U, {
|
|
436
438
|
"model-value": t(i).isActive ?? !0,
|
|
437
439
|
"onUpdate:modelValue": s[5] || (s[5] = (d) => t(i).isActive = d),
|
|
438
440
|
label: "Active",
|
|
@@ -448,7 +450,7 @@ const Ze = De.extend({
|
|
|
448
450
|
t(y) ? {
|
|
449
451
|
name: "side-sheet-header",
|
|
450
452
|
fn: E(() => [
|
|
451
|
-
l("div",
|
|
453
|
+
l("div", gt, [
|
|
452
454
|
r(v, {
|
|
453
455
|
icon: "arrow_back",
|
|
454
456
|
variant: "tertiary",
|
|
@@ -462,57 +464,57 @@ const Ze = De.extend({
|
|
|
462
464
|
]), 1032, ["modelValue"]);
|
|
463
465
|
};
|
|
464
466
|
}
|
|
465
|
-
}), xe =
|
|
467
|
+
}), xe = Ge(), ht = Ce();
|
|
466
468
|
function se(e) {
|
|
467
|
-
const _ =
|
|
469
|
+
const _ = H(e);
|
|
468
470
|
return _.isValid() ? _.format("DD/MM/YYYY") : "";
|
|
469
471
|
}
|
|
470
|
-
const
|
|
472
|
+
const Ct = {
|
|
471
473
|
mapMemberExportRow: (e) => {
|
|
472
|
-
var
|
|
474
|
+
var n, c, C, A, S, g, w, I, u, s, v, U, a, o, d, P, D, N, V, j, q, G, te, M, Q, de, ue, pe;
|
|
473
475
|
const _ = ce(() => ht.locations.map((T) => ({
|
|
474
476
|
label: T.name,
|
|
475
477
|
value: T._id
|
|
476
|
-
}))), x = (
|
|
478
|
+
}))), x = (n = Pe.parseOneAddress(
|
|
477
479
|
e == null ? void 0 : e.email
|
|
478
|
-
)) != null &&
|
|
479
|
-
(T,
|
|
480
|
+
)) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, h = (C = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : C.reduce(
|
|
481
|
+
(T, L) => {
|
|
480
482
|
var Z, K;
|
|
481
483
|
const W = (K = (Z = xe.sortedTitles) == null ? void 0 : Z.find(
|
|
482
|
-
(oe) => oe._id ===
|
|
484
|
+
(oe) => oe._id === L.collectible
|
|
483
485
|
)) == null ? void 0 : K.name;
|
|
484
|
-
return !W ||
|
|
486
|
+
return !W || L.balance <= 0 || T.push(W), T;
|
|
485
487
|
},
|
|
486
488
|
[]
|
|
487
489
|
), m = (xe.sortedTitles || []).reduce(
|
|
488
|
-
(T,
|
|
490
|
+
(T, L) => {
|
|
489
491
|
var Z, K, oe, me;
|
|
490
492
|
const W = (me = (oe = (K = (((Z = e == null ? void 0 : e.collection) == null ? void 0 : Z.TITLE) || []).find(
|
|
491
|
-
(ke) => ke.collectible ===
|
|
493
|
+
(ke) => ke.collectible === L._id
|
|
492
494
|
)) == null ? void 0 : K.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : me.expiredAt;
|
|
493
|
-
return T[
|
|
495
|
+
return T[L.name] = W ? H(W).format("DD/MM/YYYY") : "", T;
|
|
494
496
|
},
|
|
495
497
|
{}
|
|
496
|
-
), y = ((g = (S = (
|
|
497
|
-
(T,
|
|
498
|
+
), y = ((g = (S = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : S.at(0)) == null ? void 0 : g.balance) || 0, f = ((s = (u = (I = (w = e.collection) == null ? void 0 : w.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : u.expiryBalance) == null ? void 0 : s.reduce(
|
|
499
|
+
(T, L) => T + L.amount,
|
|
498
500
|
0
|
|
499
|
-
)) || 0,
|
|
501
|
+
)) || 0, F = Je(y, 2);
|
|
500
502
|
return {
|
|
501
503
|
ID: e._id.toString(),
|
|
502
504
|
Name: ((v = e.name) == null ? void 0 : v.trim()) || "",
|
|
503
|
-
Phone: ((
|
|
505
|
+
Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
|
|
504
506
|
Email: x || "",
|
|
505
507
|
Gender: e.gender || "",
|
|
506
508
|
CardNo: e.cardNo || "",
|
|
507
509
|
Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
|
|
508
|
-
Credit: parseFloat((Number(
|
|
510
|
+
Credit: parseFloat((Number(F) - Number(f)).toFixed(2)),
|
|
509
511
|
FreeCredit: Number(f.toFixed(2)),
|
|
510
|
-
TotalCredit: Number(
|
|
511
|
-
Exp: e != null && e.collection ? ((d = (o = (
|
|
512
|
-
Point: e != null && e.collection ? ((
|
|
512
|
+
TotalCredit: Number(F),
|
|
513
|
+
Exp: e != null && e.collection ? ((d = (o = (a = e.collection) == null ? void 0 : a.POINT) == null ? void 0 : o.at(0)) == null ? void 0 : d.balance) ?? 0 : 0,
|
|
514
|
+
Point: e != null && e.collection ? ((N = (D = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : D.at(0)) == null ? void 0 : N.balance) ?? 0 : 0,
|
|
513
515
|
Level: e != null && e.collection ? ((q = (j = (V = e.collection) == null ? void 0 : V.TIER) == null ? void 0 : j.at(0)) == null ? void 0 : q.balance) ?? 0 : 0,
|
|
514
|
-
Tier: e != null && e.collection ? ((
|
|
515
|
-
Titles:
|
|
516
|
+
Tier: e != null && e.collection ? ((M = (te = (G = e.collection) == null ? void 0 : G.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : M.balance) ?? 0 : 0,
|
|
517
|
+
Titles: h.join(","),
|
|
516
518
|
...m,
|
|
517
519
|
TotalTransaction: e.stats.visitCount,
|
|
518
520
|
AvgSpent: Qe(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
@@ -530,21 +532,21 @@ const bt = {
|
|
|
530
532
|
)}`
|
|
531
533
|
};
|
|
532
534
|
}
|
|
533
|
-
},
|
|
535
|
+
}, kt = { class: "flex items-center" }, It = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Mt = { class: "px-24 flex flex-col gap-y-16" }, Tt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-md-600" }, At = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, uo = /* @__PURE__ */ ee({
|
|
534
536
|
__name: "Segment",
|
|
535
537
|
setup(e) {
|
|
536
|
-
const { minor: _ } =
|
|
538
|
+
const { minor: _ } = De, { t: x } = Fe(), h = Ce(), { mapMemberExportRow: m } = Ct, y = Re(), f = We(), F = z(0), i = [
|
|
537
539
|
{
|
|
538
540
|
header: x("connect.loyalty.segment.table.name"),
|
|
539
|
-
accessorFn: (
|
|
541
|
+
accessorFn: (a) => a.name
|
|
540
542
|
},
|
|
541
543
|
{
|
|
542
544
|
header: x("connect.loyalty.segment.table.status"),
|
|
543
545
|
enableSorting: !1,
|
|
544
|
-
cell(
|
|
545
|
-
const o =
|
|
546
|
+
cell(a) {
|
|
547
|
+
const o = a.row.original.isActive === !1 ? "Inactive" : "Active";
|
|
546
548
|
return Y(X.FmChip, {
|
|
547
|
-
class:
|
|
549
|
+
class: a.row.original.isActive === !1 ? "text-fm-color-typo-error bg-fm-color-system-error-100" : "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
548
550
|
label: o,
|
|
549
551
|
compact: !0
|
|
550
552
|
});
|
|
@@ -552,18 +554,18 @@ const bt = {
|
|
|
552
554
|
},
|
|
553
555
|
{
|
|
554
556
|
header: x("connect.loyalty.segment.table.total_customers"),
|
|
555
|
-
accessorFn: (
|
|
557
|
+
accessorFn: (a) => a.memberCount ?? 0
|
|
556
558
|
},
|
|
557
559
|
{
|
|
558
560
|
header: x("connect.loyalty.segment.table.customer_percentage"),
|
|
559
|
-
accessorFn: (
|
|
561
|
+
accessorFn: (a) => ((a.memberCount ?? 0) * 100 / F.value).toFixed(2)
|
|
560
562
|
},
|
|
561
563
|
{
|
|
562
564
|
header: x("connect.loyalty.segment.table.actions"),
|
|
563
565
|
meta: {
|
|
564
566
|
maxWidth: "100px"
|
|
565
567
|
},
|
|
566
|
-
cell(
|
|
568
|
+
cell(a) {
|
|
567
569
|
return Y("div", { class: "flex items-center justify-end" }, [
|
|
568
570
|
Y(
|
|
569
571
|
X.FmMenu,
|
|
@@ -584,7 +586,7 @@ const bt = {
|
|
|
584
586
|
X.FmMenuItem,
|
|
585
587
|
{
|
|
586
588
|
onClick: async (o) => {
|
|
587
|
-
o.stopPropagation(), w(
|
|
589
|
+
o.stopPropagation(), w(a.row.original);
|
|
588
590
|
}
|
|
589
591
|
},
|
|
590
592
|
{
|
|
@@ -601,7 +603,7 @@ const bt = {
|
|
|
601
603
|
X.FmMenuItem,
|
|
602
604
|
{
|
|
603
605
|
onClick: async (o) => {
|
|
604
|
-
o.stopPropagation(), g(
|
|
606
|
+
o.stopPropagation(), g(a.row.original);
|
|
605
607
|
}
|
|
606
608
|
},
|
|
607
609
|
{
|
|
@@ -620,63 +622,63 @@ const bt = {
|
|
|
620
622
|
]);
|
|
621
623
|
}
|
|
622
624
|
}
|
|
623
|
-
],
|
|
624
|
-
|
|
625
|
+
], n = z(null), { tableMeta: c, rowData: C, debouncedFetchData: A } = we(
|
|
626
|
+
B.readAll
|
|
625
627
|
);
|
|
626
628
|
async function S() {
|
|
627
629
|
await _(
|
|
628
630
|
async () => {
|
|
629
|
-
await
|
|
631
|
+
await B.refreshSegments(), await A({ pageSize: 10, pageIndex: 0 });
|
|
630
632
|
},
|
|
631
633
|
{ message: "Refreshing segmentations" }
|
|
632
634
|
);
|
|
633
635
|
}
|
|
634
|
-
async function g(
|
|
635
|
-
await
|
|
636
|
+
async function g(a) {
|
|
637
|
+
await Ae.remove(`Are you sure you want to remove ${a.name}?`) && await _(
|
|
636
638
|
async () => {
|
|
637
|
-
await
|
|
639
|
+
await B.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
|
|
638
640
|
},
|
|
639
641
|
{
|
|
640
|
-
message: `Removing ${
|
|
641
|
-
successMessage: `Removed ${
|
|
642
|
+
message: `Removing ${a.name}`,
|
|
643
|
+
successMessage: `Removed ${a.name} successfully`
|
|
642
644
|
}
|
|
643
645
|
);
|
|
644
646
|
}
|
|
645
|
-
async function w(
|
|
647
|
+
async function w(a) {
|
|
646
648
|
const o = {
|
|
647
649
|
sortBy: "_id",
|
|
648
650
|
descending: !1,
|
|
649
651
|
rowsPerPage: 1e3,
|
|
650
652
|
page: 1,
|
|
651
653
|
rowsNumber: 0
|
|
652
|
-
}, d = new
|
|
654
|
+
}, d = new Be(), P = (await ve.read({
|
|
653
655
|
limit: 1,
|
|
654
656
|
skip: 0,
|
|
655
657
|
sortBy: o.sortBy,
|
|
656
658
|
descending: o.descending
|
|
657
|
-
})).meta.totalResources ?? 0,
|
|
659
|
+
})).meta.totalResources ?? 0, D = o.rowsPerPage;
|
|
658
660
|
await _(
|
|
659
661
|
async () => {
|
|
660
|
-
for (let
|
|
662
|
+
for (let N = 0; N < P; N += D) {
|
|
661
663
|
const V = {
|
|
662
664
|
...o,
|
|
663
|
-
limit:
|
|
665
|
+
limit: D,
|
|
664
666
|
skip: o.page - 1,
|
|
665
667
|
sortBy: o.sortBy,
|
|
666
668
|
descending: o.descending
|
|
667
|
-
}, j = await
|
|
668
|
-
|
|
669
|
+
}, j = await B.paginateSegmentUsers(
|
|
670
|
+
a._id,
|
|
669
671
|
V
|
|
670
672
|
);
|
|
671
673
|
for (const q of j.resources) {
|
|
672
|
-
const
|
|
673
|
-
d.addRecord(
|
|
674
|
+
const G = m(q);
|
|
675
|
+
d.addRecord(G);
|
|
674
676
|
}
|
|
675
677
|
o.page++;
|
|
676
678
|
}
|
|
677
|
-
await
|
|
679
|
+
await he(
|
|
678
680
|
d.buildExcel(),
|
|
679
|
-
`[${
|
|
681
|
+
`[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
680
682
|
{
|
|
681
683
|
bookType: "xlsx",
|
|
682
684
|
bookSST: !1,
|
|
@@ -690,20 +692,20 @@ const bt = {
|
|
|
690
692
|
}
|
|
691
693
|
);
|
|
692
694
|
}
|
|
693
|
-
async function
|
|
695
|
+
async function I(a) {
|
|
694
696
|
await _(
|
|
695
697
|
async () => {
|
|
696
698
|
var o;
|
|
697
|
-
if (
|
|
699
|
+
if (a.type === R.enum.STATIC) {
|
|
698
700
|
const d = new FormData();
|
|
699
|
-
if (d.append("file",
|
|
700
|
-
const { members: P, _id:
|
|
701
|
-
d.append("segment", JSON.stringify(V)), await
|
|
701
|
+
if (d.append("file", a.file), a._id) {
|
|
702
|
+
const { members: P, _id: D, file: N, ...V } = a;
|
|
703
|
+
d.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, d);
|
|
702
704
|
} else {
|
|
703
|
-
const { file: P, ...
|
|
704
|
-
d.append("segment", JSON.stringify(
|
|
705
|
+
const { file: P, ...D } = a;
|
|
706
|
+
d.append("segment", JSON.stringify(D)), await B.createStatic(d);
|
|
705
707
|
}
|
|
706
|
-
|
|
708
|
+
a.file && y.open({
|
|
707
709
|
type: "info",
|
|
708
710
|
title: "Import begins soon. Check Queue for updates.",
|
|
709
711
|
action: "View",
|
|
@@ -714,12 +716,12 @@ const bt = {
|
|
|
714
716
|
});
|
|
715
717
|
}
|
|
716
718
|
});
|
|
717
|
-
} else if (
|
|
718
|
-
const { members: d, _id: P, ...
|
|
719
|
-
await
|
|
719
|
+
} else if (a._id) {
|
|
720
|
+
const { members: d, _id: P, ...D } = a;
|
|
721
|
+
await B.update(a._id, D);
|
|
720
722
|
} else
|
|
721
|
-
await
|
|
722
|
-
await
|
|
723
|
+
await B.create(a);
|
|
724
|
+
await A({ pageSize: 10, pageIndex: 0 }), (o = n.value) == null || o.hideSheet();
|
|
723
725
|
},
|
|
724
726
|
{
|
|
725
727
|
message: "Saving segment",
|
|
@@ -727,16 +729,16 @@ const bt = {
|
|
|
727
729
|
}
|
|
728
730
|
);
|
|
729
731
|
}
|
|
730
|
-
function u(
|
|
732
|
+
function u(a) {
|
|
731
733
|
var o;
|
|
732
|
-
(o =
|
|
734
|
+
(o = n.value) == null || o.showSheet(a);
|
|
733
735
|
}
|
|
734
736
|
const s = {
|
|
735
737
|
label: x("connect.navigation.queue"),
|
|
736
738
|
value: "queue",
|
|
737
739
|
isPrimary: !1,
|
|
738
740
|
prependIcon: "work_history"
|
|
739
|
-
}, v = ce(() =>
|
|
741
|
+
}, v = ce(() => h.isPremium ? [
|
|
740
742
|
s,
|
|
741
743
|
{
|
|
742
744
|
label: "Refresh segments",
|
|
@@ -750,8 +752,8 @@ const bt = {
|
|
|
750
752
|
prependIcon: "add"
|
|
751
753
|
}
|
|
752
754
|
] : []);
|
|
753
|
-
function
|
|
754
|
-
switch (
|
|
755
|
+
function U(a) {
|
|
756
|
+
switch (a) {
|
|
755
757
|
case "add":
|
|
756
758
|
u();
|
|
757
759
|
break;
|
|
@@ -767,25 +769,25 @@ const bt = {
|
|
|
767
769
|
}
|
|
768
770
|
}
|
|
769
771
|
return Te(async () => {
|
|
770
|
-
const { meta:
|
|
772
|
+
const { meta: a } = await ve.read({
|
|
771
773
|
limit: 1,
|
|
772
774
|
skip: 0,
|
|
773
775
|
sortBy: "_id",
|
|
774
776
|
search: void 0,
|
|
775
777
|
descending: !1
|
|
776
778
|
});
|
|
777
|
-
|
|
778
|
-
}), (
|
|
779
|
-
const d =
|
|
779
|
+
F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await h.readPremium(), await h.readLocations();
|
|
780
|
+
}), (a, o) => {
|
|
781
|
+
const d = b("FmPill"), P = b("FmPageHead"), D = b("FmIcon"), N = b("FmMenuItem"), V = b("FmMenu"), j = b("FmListItem"), q = b("FmList"), G = b("FmButton"), te = b("FmCard");
|
|
780
782
|
return p(), k(O, null, [
|
|
781
783
|
r(P, {
|
|
782
784
|
title: "Segments",
|
|
783
785
|
actions: t(v),
|
|
784
|
-
"onClick:action": o[0] || (o[0] = (
|
|
786
|
+
"onClick:action": o[0] || (o[0] = (M) => U(M))
|
|
785
787
|
}, {
|
|
786
788
|
title: E(() => [
|
|
787
|
-
l("div",
|
|
788
|
-
l("span",
|
|
789
|
+
l("div", kt, [
|
|
790
|
+
l("span", It, $(t(x)("connect.loyalty.segment.title")), 1),
|
|
789
791
|
r(d, { variant: "premium" })
|
|
790
792
|
])
|
|
791
793
|
]),
|
|
@@ -793,7 +795,7 @@ const bt = {
|
|
|
793
795
|
}, 8, ["actions"]),
|
|
794
796
|
l("div", Mt, [
|
|
795
797
|
t(C).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
|
|
796
|
-
r(
|
|
798
|
+
r(be, {
|
|
797
799
|
loading: t(c).isLoading,
|
|
798
800
|
"row-data": t(C),
|
|
799
801
|
"row-count": t(c).totalRows,
|
|
@@ -802,35 +804,35 @@ const bt = {
|
|
|
802
804
|
"page-count": t(c).pageCount,
|
|
803
805
|
"page-index": t(c).pageIndex,
|
|
804
806
|
"page-size": t(c).pageSize,
|
|
805
|
-
onRowClick: o[1] || (o[1] = (
|
|
806
|
-
u(
|
|
807
|
+
onRowClick: o[1] || (o[1] = (M) => {
|
|
808
|
+
u(M.original);
|
|
807
809
|
}),
|
|
808
|
-
onPageChange: t(
|
|
810
|
+
onPageChange: t(A)
|
|
809
811
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
810
812
|
r(q, { class: "w-full hidden xs:block" }, {
|
|
811
813
|
default: E(() => [
|
|
812
|
-
(p(!0), k(O, null, ie(t(C), (
|
|
813
|
-
key:
|
|
814
|
+
(p(!0), k(O, null, ie(t(C), (M) => (p(), J(j, {
|
|
815
|
+
key: M._id.toString(),
|
|
814
816
|
tag: "label",
|
|
815
|
-
onClick: (Q) => u(
|
|
817
|
+
onClick: (Q) => u(M)
|
|
816
818
|
}, {
|
|
817
819
|
default: E(() => [
|
|
818
820
|
l("div", null, [
|
|
819
|
-
l("div",
|
|
820
|
-
l("div",
|
|
821
|
-
l("div",
|
|
821
|
+
l("div", Tt, $((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
822
|
+
l("div", Et, $(M.name), 1),
|
|
823
|
+
l("div", At, $(((M.memberCount ?? 0) * 100 / t(F)).toFixed(2)) + "% of customers ", 1)
|
|
822
824
|
])
|
|
823
825
|
]),
|
|
824
826
|
append: E(() => [
|
|
825
827
|
r(V, { "stop-click-propagation": !0 }, {
|
|
826
828
|
"menu-button": E(() => [
|
|
827
|
-
r(
|
|
829
|
+
r(D, { name: "more_vert" })
|
|
828
830
|
]),
|
|
829
831
|
default: E(() => [
|
|
830
|
-
r(
|
|
832
|
+
r(N, {
|
|
831
833
|
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
832
834
|
label: "Remove",
|
|
833
|
-
"onUpdate:modelValue": (Q) => Q && g(
|
|
835
|
+
"onUpdate:modelValue": (Q) => Q && g(M)
|
|
834
836
|
}, null, 8, ["onUpdate:modelValue"])
|
|
835
837
|
]),
|
|
836
838
|
_: 2
|
|
@@ -855,20 +857,20 @@ const bt = {
|
|
|
855
857
|
l("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
856
858
|
l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Segments allow you to categorize your customers based on various criteria, enabling targeted marketing and personalized experiences. ")
|
|
857
859
|
], -1)),
|
|
858
|
-
r(
|
|
860
|
+
r(G, {
|
|
859
861
|
variant: "primary",
|
|
860
862
|
label: "Create segment",
|
|
861
|
-
disabled: !t(
|
|
863
|
+
disabled: !t(h).isPremium,
|
|
862
864
|
icon: "add",
|
|
863
|
-
onClick: o[2] || (o[2] = (
|
|
865
|
+
onClick: o[2] || (o[2] = (M) => u())
|
|
864
866
|
}, null, 8, ["disabled"])
|
|
865
867
|
]),
|
|
866
868
|
_: 1
|
|
867
869
|
})),
|
|
868
870
|
r(Ft, {
|
|
869
871
|
ref_key: "sheetRef",
|
|
870
|
-
ref:
|
|
871
|
-
"onUpdate:modelValue":
|
|
872
|
+
ref: n,
|
|
873
|
+
"onUpdate:modelValue": I
|
|
872
874
|
}, null, 512)
|
|
873
875
|
])
|
|
874
876
|
], 64);
|
|
@@ -876,5 +878,5 @@ const bt = {
|
|
|
876
878
|
}
|
|
877
879
|
});
|
|
878
880
|
export {
|
|
879
|
-
|
|
881
|
+
uo as default
|
|
880
882
|
};
|