@feedmepos/mf-connect 0.1.32-prod → 0.1.33-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-DRJEtVnN.js → Analytic-Co2Hg28w.js} +11 -11
- package/dist/{App-C1IuGBAJ.js → App-YD2uTuCN.js} +6 -6
- package/dist/{Bin-CM9cU-iH.js → Bin-CS5h1RIu.js} +8 -8
- package/dist/{Broadcast-1Fy8Nob5.js → Broadcast-CZFyQp7d.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiAEDcl5.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BemXOK1e.js} +6 -6
- package/dist/{Card-CnuSjjCj.js → Card-z8Ulll5P.js} +16 -16
- package/dist/{Collections-DAj_A1iu.js → Collections-C-d6-7_x.js} +7 -7
- package/dist/{Credit-DLH2GYYz.js → Credit-dbi2wB84.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C4Sy1K8q.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DyUjlGB0.js} +29 -29
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D4--kNds.js → EffectSheet.vue_vue_type_style_index_0_lang-JLICv-XJ.js} +6 -6
- package/dist/{Experience-Dgyi4U-L.js → Experience-Cw6xpFeZ.js} +9 -9
- package/dist/{Game-VKYjF7hq.js → Game-B-e2kaT1.js} +10 -10
- package/dist/{Index-B0BkKPLD.js → Index-SoIcUgrm.js} +10 -10
- package/dist/{Marketing-Bzl7m10d.js → Marketing-CVrykKnH.js} +6 -6
- package/dist/{Member-CDmDoJFr.js → Member-DO-Y7K68.js} +10 -10
- package/dist/{MemberList-C4l_Q9y1.js → MemberList-DIN5h-gR.js} +25 -25
- package/dist/{MemberTransactions-SUlFwOov.js → MemberTransactions-nkBigpMB.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Buj3xx1j.js → MessageInput.vue_vue_type_script_setup_true_lang-CJdZuztF.js} +4 -4
- package/dist/{Mission-BriLVrc4.js → Mission-Be7oWF9U.js} +10 -10
- package/dist/{Overview-AklJfO0G.js → Overview-D5vsXK9o.js} +18 -18
- package/dist/{Point-B7VnNPaG.js → Point-CxipyJ-q.js} +9 -9
- package/dist/{Promotion-hlKzzWJD.js → Promotion-CxnPlE2K.js} +10 -10
- package/dist/{Queue-gOxy9cBG.js → Queue-CmqdtFUH.js} +10 -10
- package/dist/{Record-BwWXqFv6.js → Record-DMPpt6UJ.js} +8 -8
- package/dist/{Reward-JKh-M0oD.js → Reward-Dq4YJFIA.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DFogiHWh.js → RewardGroup.vue_vue_type_script_setup_true_lang-DWOILpY3.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTOfCYsE.js → RuleGroup.vue_vue_type_script_setup_true_lang-PBDAieUm.js} +13 -13
- package/dist/{Segment-BlMx0eoR.js → Segment-DLnAIOp1.js} +202 -200
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DCsFcqQ5.js → SelectItems.vue_vue_type_script_setup_true_lang-DJlk6P0T.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-G01kJeLd.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDQ65Cvv.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-gUoBLfVo.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CgFxMZkx.js} +3 -3
- package/dist/{Setting-CoKP6Z-F.js → Setting-DD2veGG7.js} +11 -11
- package/dist/{Store-CxUagz23.js → Store-BHX4yRF4.js} +19 -19
- package/dist/{StoreRewards-CLSQgaNo.js → StoreRewards-DcZwldzN.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-V4rH3vAQ.js → StoreTransactions.vue_vue_type_script_setup_true_lang-0_JejsOU.js} +18 -18
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DJ7incG7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DhQNoPO5.js} +1 -1
- package/dist/{Tier-DwTL1xNM.js → Tier--njI2EvF.js} +20 -20
- package/dist/{Title-DhBL_eYK.js → Title-D8YB1KwZ.js} +19 -19
- package/dist/{Transaction-CRskHsNr.js → Transaction-CzVitP3M.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DoE7rDgi.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Dn0amdd3.js} +6 -6
- package/dist/{Voucher-CxDqASF5.js → Voucher-DwtCnP8w.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-wkihtNI3.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DoRivv52.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BeLTXjOv.js → ZodTextField.vue_vue_type_script_setup_true_lang-DSB9k75Y.js} +1 -1
- package/dist/{app-CTFwjMxq.js → app-CQRB7I5K.js} +1 -1
- package/dist/{app-QgT2HXjv.js → app-H5Nfj0Kj.js} +30 -30
- package/dist/app.js +1 -1
- package/dist/{business-DhCzKu3V.js → business-BD1xVHsg.js} +1 -1
- package/dist/{campaign-DAgovrbX.js → campaign-2jAMivOE.js} +2 -2
- package/dist/{campaign-CFggCOe6.js → campaign-Bb1wuQdY.js} +9 -9
- package/dist/{campaign.enum-pZr63pXN.js → campaign.enum-OZ3v-5ZH.js} +1 -1
- package/dist/{campaign.fn-CM_t1wNu.js → campaign.fn-DGw-fFB0.js} +33 -33
- package/dist/{collectible.enum-fbWiJ-v2.js → collectible.enum-21CN4Vsl.js} +1 -1
- package/dist/{collection.fn-BrbSJ0dj.js → collection.fn-DpsET9oE.js} +2 -2
- package/dist/{dto-BcLrcoo_.js → dto-Ct9pFL11.js} +4 -4
- package/dist/{effect-WVUo2VX0.js → effect-CrY62aJn.js} +1 -1
- package/dist/{email-addresses-B8YBttOp.js → email-addresses-2mZ3tNRf.js} +1 -1
- package/dist/{export-FilTnKIf.js → export-cukcGV7Q.js} +3 -3
- package/dist/{helper-A-JE89j8.js → helper-CZvv8YqE.js} +1 -1
- package/dist/{index-BSavh-ab.js → index-B8uC64Qm.js} +346 -346
- package/dist/{index-CzbdA0d3.js → index-B_PlQ967.js} +1 -1
- package/dist/{index-DFS6jDHm.js → index-BbeEHgvu.js} +3 -3
- package/dist/{index-OehNKdCW.js → index-BdzOrIZ7.js} +1 -1
- package/dist/{index-CzH8ux-h.js → index-BkgbBp9l.js} +2 -2
- package/dist/{index-BPCfLPV5.js → index-BxEQR5a4.js} +1 -1
- package/dist/{index-DI956UFg.js → index-Bzkan3ZR.js} +1 -1
- package/dist/{index-CX4Q-ODj.js → index-CB4K6lnR.js} +1 -1
- package/dist/{index-CK_9lnGD.js → index-Cliq3cQb.js} +3 -3
- package/dist/{index-C1vwtNMj.js → index-D2vULsbp.js} +6 -6
- package/dist/{index-CyqffI0r.js → index-D_qaVSuj.js} +1 -1
- package/dist/{index-DvM-OpLR.js → index-DvESxk9B.js} +4 -4
- package/dist/{index-FsTLGrIL.js → index-uenvHfm3.js} +1 -1
- package/dist/{index.esm2017-CScWJGpE.js → index.esm2017-D4SYmjlC.js} +1 -1
- package/dist/{loading-CXZ39_xw.js → loading-zALstVD_.js} +1 -1
- package/dist/{membership-Bg_pBT1C.js → membership-B4kzNrdV.js} +3 -3
- package/dist/{money-D4vhiGvs.js → money-DD93KSIZ.js} +1 -1
- package/dist/{number-p3U-wKsr.js → number-RE8pNotC.js} +1 -1
- package/dist/{objectid-C_k8DXMk.js → objectid-B79yJhh3.js} +8 -8
- package/dist/{plugins-BzCgGFW_.js → plugins-77kIdghj.js} +2 -2
- package/dist/{reward-DL7dVgek.js → reward-DObERFDg.js} +1 -1
- package/dist/{rule-iUlMzG59.js → rule-CmevFzjt.js} +3 -3
- package/dist/{rule-builder-DZEGo8FL.js → rule-builder-CGw5WvTI.js} +1 -1
- package/dist/{template-FZF9V1B2.js → template-X_Z36LWQ.js} +4 -4
- package/dist/{trigger-woPb5C0Z.js → trigger-ybZ3np3i.js} +4 -4
- package/dist/{user-CoOoRDFP.js → user-CTQPhh1u.js} +1 -1
- package/dist/{vue-i18n-5r8XYctA.js → vue-i18n-BFISHEOF.js} +282 -282
- package/dist/{xlsx-Cx714TFU.js → xlsx-B9v9c4jL.js} +379 -379
- package/package.json +1 -1
|
@@ -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 C, createVNode as i, unref as t, createCommentVNode as le, createElementVNode as s, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as D, 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 $e } from "./plugins-
|
|
4
|
-
import { u as
|
|
5
|
-
import { FmButtonVariant as ae, useSnackbar as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { i as De, j as
|
|
9
|
-
import "./index-
|
|
10
|
-
import "./index-
|
|
11
|
-
import "./index-
|
|
12
|
-
import "./index-
|
|
13
|
-
import { u as ne, w as
|
|
14
|
-
import { e as Pe, M as Ne } from "./email-addresses-
|
|
3
|
+
import { p as $e } from "./plugins-77kIdghj.js";
|
|
4
|
+
import { u as Re } from "./loading-zALstVD_.js";
|
|
5
|
+
import { FmButtonVariant as ae, useSnackbar as Ae, components as X } from "@feedmepos/ui-library";
|
|
6
|
+
import { u as xe, _ as be } from "./usePagination-JoYaROkV.js";
|
|
7
|
+
import { u as we } from "./vue-i18n-BFISHEOF.js";
|
|
8
|
+
import { i as De, j as A, c as fe } from "./index-DvESxk9B.js";
|
|
9
|
+
import "./index-BkgbBp9l.js";
|
|
10
|
+
import "./index-D2vULsbp.js";
|
|
11
|
+
import "./index-B_PlQ967.js";
|
|
12
|
+
import "./index-Cliq3cQb.js";
|
|
13
|
+
import { u as ne, w as Fe } from "./xlsx-B9v9c4jL.js";
|
|
14
|
+
import { e as Pe, M as Ne } from "./email-addresses-2mZ3tNRf.js";
|
|
15
15
|
import { Z as Be } 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-BbeEHgvu.js";
|
|
18
|
+
import { R as ge } from "./rule-builder-CGw5WvTI.js";
|
|
19
|
+
import { _ as Ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DSB9k75Y.js";
|
|
20
|
+
import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-PBDAieUm.js";
|
|
21
|
+
import { u as ze, v as Oe, w as je } from "./index.esm2017-D4SYmjlC.js";
|
|
22
22
|
import { F as qe } from "./FileSaver.min-NlMItPOc.js";
|
|
23
23
|
import { h as G } from "./moment-BWErdI6_.js";
|
|
24
|
-
import { s as N, u as He } from "./membership-
|
|
24
|
+
import { s as N, u as He } from "./membership-B4kzNrdV.js";
|
|
25
25
|
import { o as Ge } from "./objectId-dwaoBfJX.js";
|
|
26
|
-
import { u as
|
|
27
|
-
import { f as Je } from "./number-
|
|
28
|
-
import { t as Qe } from "./money-
|
|
29
|
-
import "./index-
|
|
26
|
+
import { u as ke } from "./business-BD1xVHsg.js";
|
|
27
|
+
import { f as Je } from "./number-RE8pNotC.js";
|
|
28
|
+
import { t as Qe } from "./money-DD93KSIZ.js";
|
|
29
|
+
import "./index-D_qaVSuj.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
|
|
31
|
+
import { m as ve } from "./index-uenvHfm3.js";
|
|
32
|
+
import { R as _e } from "./app-H5Nfj0Kj.js";
|
|
33
|
+
const Ke = De.extend({
|
|
34
34
|
_id: ye.optional(),
|
|
35
35
|
business: ye.optional(),
|
|
36
36
|
file: Ye.any().nullish()
|
|
37
|
-
})
|
|
37
|
+
});
|
|
38
|
+
var Ze = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476" };
|
|
39
|
+
const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1), tt = {
|
|
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
|
+
}, ot = { class: "flex justify-end" }, at = {
|
|
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
|
+
}, nt = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, st = /* @__PURE__ */ ee({
|
|
53
55
|
__name: "ImportSegment",
|
|
54
56
|
props: {
|
|
55
57
|
importFile: {}
|
|
56
58
|
},
|
|
57
59
|
emits: ["update:file"],
|
|
58
60
|
setup(e, { emit: v }) {
|
|
59
|
-
const _ = e,
|
|
61
|
+
const _ = e, F = v, { t: m } = we(), y = z(null), f = z(null), w = ["Id"], l = [
|
|
60
62
|
{
|
|
61
63
|
label: "CSV",
|
|
62
64
|
icon: "csv",
|
|
@@ -71,8 +73,8 @@ const Ze = De.extend({
|
|
|
71
73
|
async function n() {
|
|
72
74
|
if (_.importFile)
|
|
73
75
|
try {
|
|
74
|
-
const h = ze(),
|
|
75
|
-
window.open(
|
|
76
|
+
const h = ze(void 0, Ze.importFilesBucketUrl), S = Oe(h, _.importFile), x = await je(S);
|
|
77
|
+
window.open(x, "_blank");
|
|
76
78
|
} catch (h) {
|
|
77
79
|
console.log(h);
|
|
78
80
|
}
|
|
@@ -80,31 +82,31 @@ const Ze = De.extend({
|
|
|
80
82
|
async function c(h) {
|
|
81
83
|
switch (h) {
|
|
82
84
|
case "csv":
|
|
83
|
-
const
|
|
85
|
+
const S = new Blob([w.join(",")], {
|
|
84
86
|
type: "text/csv;charset=utf-8;"
|
|
85
87
|
});
|
|
86
|
-
qe.saveAs(
|
|
88
|
+
qe.saveAs(S, "ImportSegmentTemplate.csv");
|
|
87
89
|
break;
|
|
88
90
|
case "xlsx":
|
|
89
|
-
const
|
|
90
|
-
ne.book_append_sheet(
|
|
91
|
+
const x = ne.aoa_to_sheet([w]), I = ne.book_new();
|
|
92
|
+
ne.book_append_sheet(I, x, "Sheet1"), Fe(I, "ImportSegmentTemplate.xlsx");
|
|
91
93
|
break;
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
|
-
function
|
|
95
|
-
y.value = h,
|
|
96
|
+
function k(h) {
|
|
97
|
+
y.value = h, F("update:file", y.value);
|
|
96
98
|
}
|
|
97
99
|
function $(h) {
|
|
98
|
-
var
|
|
99
|
-
const
|
|
100
|
-
|
|
100
|
+
var x, I;
|
|
101
|
+
const S = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
|
|
102
|
+
k(S);
|
|
101
103
|
}
|
|
102
|
-
return (h,
|
|
103
|
-
const
|
|
104
|
-
return p(),
|
|
105
|
-
|
|
106
|
-
h.importFile ? (p(),
|
|
107
|
-
i(
|
|
104
|
+
return (h, S) => {
|
|
105
|
+
const x = b("FmButton"), I = b("FmMenuItem"), u = b("FmMenu"), r = b("FmDropField");
|
|
106
|
+
return p(), C("div", Xe, [
|
|
107
|
+
et,
|
|
108
|
+
h.importFile ? (p(), C("div", tt, [
|
|
109
|
+
i(x, {
|
|
108
110
|
label: t(m)("View uploaded file"),
|
|
109
111
|
variant: t(ae).Plain,
|
|
110
112
|
icon: "file_present",
|
|
@@ -112,42 +114,42 @@ const Ze = De.extend({
|
|
|
112
114
|
}, null, 8, ["label", "variant"])
|
|
113
115
|
])) : le("", !0),
|
|
114
116
|
s("div", null, [
|
|
115
|
-
s("div",
|
|
117
|
+
s("div", ot, [
|
|
116
118
|
i(u, { class: "" }, {
|
|
117
119
|
"menu-button": E(() => [
|
|
118
|
-
i(
|
|
120
|
+
i(x, {
|
|
119
121
|
variant: "tertiary",
|
|
120
122
|
icon: "download",
|
|
121
123
|
label: "Download Template"
|
|
122
124
|
})
|
|
123
125
|
]),
|
|
124
126
|
default: E(() => [
|
|
125
|
-
(p(),
|
|
127
|
+
(p(), C(O, null, ie(l, (g) => i(I, {
|
|
126
128
|
key: g.value,
|
|
127
129
|
icon: g.icon,
|
|
128
130
|
label: g.label,
|
|
129
|
-
onClick: (
|
|
131
|
+
onClick: (U) => c(g.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(),
|
|
137
|
-
i(
|
|
138
|
+
y.value ? (p(), C("div", at, [
|
|
139
|
+
i(x, {
|
|
138
140
|
variant: t(ae).Tertiary,
|
|
139
141
|
"prepend-icon": "attach_file"
|
|
140
142
|
}, null, 8, ["variant"]),
|
|
141
|
-
s("p",
|
|
143
|
+
s("p", nt, D(y.value.name), 1),
|
|
142
144
|
s("label", {
|
|
143
145
|
ref_key: "fileLabelRef",
|
|
144
146
|
ref: f,
|
|
145
147
|
htmlFor: "file"
|
|
146
148
|
}, [
|
|
147
|
-
i(
|
|
149
|
+
i(x, {
|
|
148
150
|
variant: t(ae).Plain,
|
|
149
151
|
label: t(m)("Replace File"),
|
|
150
|
-
onClick:
|
|
152
|
+
onClick: S[1] || (S[1] = () => {
|
|
151
153
|
var g;
|
|
152
154
|
return (g = f.value) == null ? void 0 : g.click();
|
|
153
155
|
})
|
|
@@ -163,7 +165,7 @@ const Ze = De.extend({
|
|
|
163
165
|
], 512)
|
|
164
166
|
])) : (p(), J(r, {
|
|
165
167
|
key: 0,
|
|
166
|
-
onFileUpload:
|
|
168
|
+
onFileUpload: S[0] || (S[0] = (g) => k(g)),
|
|
167
169
|
accept: ".csv, .xlsx",
|
|
168
170
|
"max-file-size": 2e7
|
|
169
171
|
}))
|
|
@@ -171,7 +173,7 @@ const Ze = De.extend({
|
|
|
171
173
|
]);
|
|
172
174
|
};
|
|
173
175
|
}
|
|
174
|
-
}),
|
|
176
|
+
}), lt = { class: "space-y-16 pr-12" }, it = { class: "fm-typo-en-title-md-800" }, rt = { class: "flex space-x-8" }, ct = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, dt = { class: "text-fm-color-typo-secondary" }, ut = /* @__PURE__ */ s("div", null, "contacts in your segment", -1), pt = /* @__PURE__ */ ee({
|
|
175
177
|
__name: "ReviewSegment",
|
|
176
178
|
props: {
|
|
177
179
|
title: {},
|
|
@@ -204,7 +206,7 @@ const Ze = De.extend({
|
|
|
204
206
|
accessorFn: (n) => G(n.stats.lastVisit).format("DD MMM YYYY")
|
|
205
207
|
}
|
|
206
208
|
];
|
|
207
|
-
async function
|
|
209
|
+
async function F(n) {
|
|
208
210
|
return v.segment._id ? (console.log(n), await N.paginateSegmentUsers(
|
|
209
211
|
v.segment._id,
|
|
210
212
|
n
|
|
@@ -219,19 +221,19 @@ const Ze = De.extend({
|
|
|
219
221
|
}
|
|
220
222
|
};
|
|
221
223
|
}
|
|
222
|
-
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData:
|
|
223
|
-
return
|
|
224
|
-
await
|
|
225
|
-
}), (n, c) => (p(),
|
|
226
|
-
s("div",
|
|
227
|
-
s("div",
|
|
228
|
-
s("div",
|
|
229
|
-
s("div",
|
|
230
|
-
|
|
224
|
+
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: w, onSearch: l } = xe(F);
|
|
225
|
+
return Se(async () => {
|
|
226
|
+
await w();
|
|
227
|
+
}), (n, c) => (p(), C("div", lt, [
|
|
228
|
+
s("div", it, D(v.title), 1),
|
|
229
|
+
s("div", rt, [
|
|
230
|
+
s("div", ct, D(n.segment.members.length), 1),
|
|
231
|
+
s("div", dt, [
|
|
232
|
+
ut,
|
|
231
233
|
s("div", null, "as of " + D(t(G)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
232
234
|
])
|
|
233
235
|
]),
|
|
234
|
-
i(
|
|
236
|
+
i(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] = (
|
|
245
|
+
onPageChange: c[0] || (c[0] = (k) => t(w)({ pageSize: k.pageSize, pageIndex: k.pageIndex }))
|
|
244
246
|
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
245
247
|
]));
|
|
246
248
|
}
|
|
247
|
-
}),
|
|
249
|
+
}), mt = { class: "space-y-24" }, ft = { class: "grid grid-cols-2 gap-16" }, yt = { class: "fm-typo-en-title-sm-800" }, gt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ ee({
|
|
248
250
|
__name: "SegmentTypeOption",
|
|
249
251
|
props: {
|
|
250
252
|
modelValue: {},
|
|
@@ -252,38 +254,38 @@ const Ze = De.extend({
|
|
|
252
254
|
},
|
|
253
255
|
emits: ["update:model-value"],
|
|
254
256
|
setup(e, { emit: v }) {
|
|
255
|
-
const _ = e,
|
|
257
|
+
const _ = e, F = v, 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.",
|
|
259
|
-
value:
|
|
261
|
+
value: A.enum.DYNAMIC
|
|
260
262
|
},
|
|
261
263
|
{
|
|
262
264
|
label: "Static",
|
|
263
265
|
sublabel: "Segment statistics are based on imported data and will not be recalculated.",
|
|
264
|
-
value:
|
|
266
|
+
value: A.enum.STATIC
|
|
265
267
|
}
|
|
266
268
|
];
|
|
267
269
|
function y(f) {
|
|
268
|
-
f !== _.modelValue &&
|
|
270
|
+
f !== _.modelValue && F("update:model-value", f);
|
|
269
271
|
}
|
|
270
|
-
return (f,
|
|
271
|
-
const l =
|
|
272
|
-
return p(),
|
|
273
|
-
s("div",
|
|
274
|
-
(p(),
|
|
272
|
+
return (f, w) => {
|
|
273
|
+
const l = b("FmCard"), n = b("FmHelperText");
|
|
274
|
+
return p(), C("div", mt, [
|
|
275
|
+
s("div", ft, [
|
|
276
|
+
(p(), C(O, null, ie(m, (c) => i(l, {
|
|
275
277
|
variant: "outlined",
|
|
276
278
|
class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
277
279
|
"col-span-2": m.length == 1,
|
|
278
280
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
|
|
279
281
|
"hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
|
|
280
282
|
}]),
|
|
281
|
-
onClick: (
|
|
283
|
+
onClick: (k) => y(c.value),
|
|
282
284
|
key: c.value
|
|
283
285
|
}, {
|
|
284
286
|
default: E(() => [
|
|
285
|
-
s("div",
|
|
286
|
-
s("div",
|
|
287
|
+
s("div", yt, D(c.label), 1),
|
|
288
|
+
s("div", gt, D(c.sublabel), 1)
|
|
287
289
|
]),
|
|
288
290
|
_: 2
|
|
289
291
|
}, 1032, ["class", "onClick"])), 64))
|
|
@@ -297,93 +299,93 @@ const Ze = De.extend({
|
|
|
297
299
|
]);
|
|
298
300
|
};
|
|
299
301
|
}
|
|
300
|
-
}),
|
|
302
|
+
}), _t = { class: "flex items-center gap-x-8" }, ht = /* @__PURE__ */ s("div", null, "Review segment", -1), St = {
|
|
301
303
|
key: 0,
|
|
302
304
|
class: "space-y-16 pr-12"
|
|
303
|
-
}, xt = { class: "flex flex-col space-y-16" },
|
|
305
|
+
}, xt = { class: "flex flex-col space-y-16" }, bt = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1), wt = {
|
|
304
306
|
key: 0,
|
|
305
307
|
class: "flex flex-col space-y-16"
|
|
306
|
-
}, Ft = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1),
|
|
308
|
+
}, Ft = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), kt = {
|
|
307
309
|
key: 1,
|
|
308
310
|
class: "flex flex-col space-y-16"
|
|
309
311
|
}, Ct = {
|
|
310
312
|
key: 2,
|
|
311
313
|
class: "flex flex-col space-y-16"
|
|
312
|
-
},
|
|
314
|
+
}, It = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1), Mt = { class: "flex items-center gap-8" }, Tt = /* @__PURE__ */ ee({
|
|
313
315
|
__name: "SegmentSheet",
|
|
314
316
|
emits: ["update:model-value"],
|
|
315
317
|
setup(e, { expose: v, emit: _ }) {
|
|
316
|
-
const
|
|
318
|
+
const F = Ve(), m = z(!1), y = z(!1), f = {
|
|
317
319
|
name: "",
|
|
318
320
|
isActive: !0,
|
|
319
|
-
type:
|
|
321
|
+
type: A.enum.DYNAMIC,
|
|
320
322
|
rule: ge.scaffoldGroup(),
|
|
321
323
|
members: []
|
|
322
|
-
},
|
|
323
|
-
const u =
|
|
324
|
+
}, w = Ke, l = z(f), n = ce(() => {
|
|
325
|
+
const u = w.safeParse(l.value);
|
|
324
326
|
return u.success ? [] : u.error.errors;
|
|
325
327
|
});
|
|
326
328
|
function c(u) {
|
|
327
329
|
m.value = !0, y.value = !1, u ? l.value = {
|
|
328
330
|
...u,
|
|
329
331
|
isActive: u.isActive !== !1,
|
|
330
|
-
type: u.type ?? (u.importFile ?
|
|
332
|
+
type: u.type ?? (u.importFile ? A.enum.STATIC : A.enum.DYNAMIC)
|
|
331
333
|
} : l.value = { ...f };
|
|
332
334
|
}
|
|
333
|
-
function
|
|
335
|
+
function k() {
|
|
334
336
|
m.value = !1;
|
|
335
337
|
}
|
|
336
338
|
async function $() {
|
|
337
|
-
|
|
339
|
+
w.safeParse(l.value).success && (y.value = !0);
|
|
338
340
|
}
|
|
339
341
|
function h() {
|
|
340
342
|
y.value = !1;
|
|
341
343
|
}
|
|
342
|
-
async function
|
|
343
|
-
l.value.type ===
|
|
344
|
+
async function S() {
|
|
345
|
+
l.value.type === A.enum.STATIC ? (l.value.rule = ge.scaffoldGroup(), l.value.isActive = !0) : l.value.file = void 0, I("update:model-value", l.value);
|
|
344
346
|
}
|
|
345
|
-
async function
|
|
347
|
+
async function x(u) {
|
|
346
348
|
l.value.type = u;
|
|
347
349
|
}
|
|
348
|
-
|
|
350
|
+
Se(async () => {
|
|
349
351
|
});
|
|
350
|
-
const
|
|
352
|
+
const I = _;
|
|
351
353
|
return v({
|
|
352
354
|
showSheet: c,
|
|
353
|
-
hideSheet:
|
|
355
|
+
hideSheet: k
|
|
354
356
|
}), (u, r) => {
|
|
355
|
-
const g =
|
|
357
|
+
const g = b("FmButton"), U = b("FmSwitch"), o = b("FmSideSheet");
|
|
356
358
|
return p(), J(o, {
|
|
357
359
|
modelValue: t(m),
|
|
358
|
-
"onUpdate:modelValue": r[8] || (r[8] = (a) =>
|
|
360
|
+
"onUpdate:modelValue": r[8] || (r[8] = (a) => Ie(m) ? m.value = a : 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
367
|
s("div", Mt, [
|
|
366
|
-
t(y) || t(l).type === t(
|
|
368
|
+
t(y) || t(l).type === t(A).enum.STATIC ? (p(), C(O, { key: 0 }, [
|
|
367
369
|
i(g, {
|
|
368
370
|
label: "Save Segment",
|
|
369
|
-
onClick:
|
|
370
|
-
loading: t(
|
|
371
|
-
disabled: t(n).length > 0 || t(
|
|
371
|
+
onClick: S,
|
|
372
|
+
loading: t(F).isLoading,
|
|
373
|
+
disabled: t(n).length > 0 || t(F).isLoading
|
|
372
374
|
}, null, 8, ["loading", "disabled"]),
|
|
373
375
|
i(g, {
|
|
374
376
|
label: "Cancel",
|
|
375
377
|
onClick: r[6] || (r[6] = (a) => h()),
|
|
376
378
|
variant: "tertiary"
|
|
377
379
|
})
|
|
378
|
-
], 64)) : (p(),
|
|
380
|
+
], 64)) : (p(), C(O, { key: 1 }, [
|
|
379
381
|
i(g, {
|
|
380
382
|
label: "Review Segment",
|
|
381
|
-
disabled: t(n).length > 0 || t(
|
|
383
|
+
disabled: t(n).length > 0 || t(F).isLoading,
|
|
382
384
|
onClick: $
|
|
383
385
|
}, null, 8, ["disabled"]),
|
|
384
386
|
i(g, {
|
|
385
387
|
label: "Cancel",
|
|
386
|
-
onClick: r[7] || (r[7] = (a) =>
|
|
388
|
+
onClick: r[7] || (r[7] = (a) => k()),
|
|
387
389
|
variant: "tertiary"
|
|
388
390
|
})
|
|
389
391
|
], 64))
|
|
@@ -392,29 +394,29 @@ const Ze = De.extend({
|
|
|
392
394
|
default: E(() => {
|
|
393
395
|
var a;
|
|
394
396
|
return [
|
|
395
|
-
t(y) ? (p(), J(
|
|
397
|
+
t(y) ? (p(), J(pt, {
|
|
396
398
|
key: 1,
|
|
397
399
|
title: t(l).name,
|
|
398
400
|
segment: t(l)
|
|
399
|
-
}, null, 8, ["title", "segment"])) : (p(),
|
|
400
|
-
i(
|
|
401
|
+
}, null, 8, ["title", "segment"])) : (p(), C("div", St, [
|
|
402
|
+
i(Ue, {
|
|
401
403
|
modelValue: t(l).name,
|
|
402
404
|
"onUpdate:modelValue": r[1] || (r[1] = (d) => t(l).name = d),
|
|
403
405
|
label: "Segment title",
|
|
404
|
-
schema: t(Be).typeAtPath(t(
|
|
406
|
+
schema: t(Be).typeAtPath(t(w), "name")
|
|
405
407
|
}, null, 8, ["modelValue", "schema"]),
|
|
406
408
|
s("div", xt, [
|
|
407
|
-
|
|
408
|
-
i(
|
|
409
|
+
bt,
|
|
410
|
+
i(vt, {
|
|
409
411
|
"model-value": t(l).type,
|
|
410
412
|
"onUpdate:modelValue": r[2] || (r[2] = (d) => {
|
|
411
|
-
|
|
413
|
+
x(d);
|
|
412
414
|
})
|
|
413
415
|
}, null, 8, ["model-value"])
|
|
414
416
|
]),
|
|
415
|
-
t(l).type === t(
|
|
417
|
+
t(l).type === t(A).enum.DYNAMIC ? (p(), C("div", wt, [
|
|
416
418
|
Ft,
|
|
417
|
-
i(
|
|
419
|
+
i(Le, {
|
|
418
420
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
419
421
|
includeOnly: "user",
|
|
420
422
|
"model-value": (a = t(l)) == null ? void 0 : a.rule,
|
|
@@ -422,17 +424,17 @@ const Ze = De.extend({
|
|
|
422
424
|
t(l).rule = d;
|
|
423
425
|
})
|
|
424
426
|
}, null, 8, ["model-value"])
|
|
425
|
-
])) : (p(),
|
|
426
|
-
i(
|
|
427
|
+
])) : (p(), C("div", kt, [
|
|
428
|
+
i(st, {
|
|
427
429
|
importFile: t(l).importFile,
|
|
428
430
|
"onUpdate:file": r[4] || (r[4] = (d) => {
|
|
429
431
|
t(l).file = d;
|
|
430
432
|
})
|
|
431
433
|
}, null, 8, ["importFile"])
|
|
432
434
|
])),
|
|
433
|
-
t(l).type === t(
|
|
434
|
-
|
|
435
|
-
i(
|
|
435
|
+
t(l).type === t(A).enum.DYNAMIC ? (p(), C("div", Ct, [
|
|
436
|
+
It,
|
|
437
|
+
i(U, {
|
|
436
438
|
"model-value": t(l).isActive ?? !0,
|
|
437
439
|
"onUpdate:modelValue": r[5] || (r[5] = (d) => t(l).isActive = d),
|
|
438
440
|
label: "Active",
|
|
@@ -448,13 +450,13 @@ const Ze = De.extend({
|
|
|
448
450
|
t(y) ? {
|
|
449
451
|
name: "side-sheet-header",
|
|
450
452
|
fn: E(() => [
|
|
451
|
-
s("div",
|
|
453
|
+
s("div", _t, [
|
|
452
454
|
i(g, {
|
|
453
455
|
icon: "arrow_back",
|
|
454
456
|
variant: "tertiary",
|
|
455
457
|
onClick: r[0] || (r[0] = (a) => y.value = !1)
|
|
456
458
|
}),
|
|
457
|
-
|
|
459
|
+
ht
|
|
458
460
|
])
|
|
459
461
|
]),
|
|
460
462
|
key: "0"
|
|
@@ -462,57 +464,57 @@ const Ze = De.extend({
|
|
|
462
464
|
]), 1032, ["modelValue"]);
|
|
463
465
|
};
|
|
464
466
|
}
|
|
465
|
-
}), he = He(),
|
|
467
|
+
}), he = He(), Et = ke();
|
|
466
468
|
function se(e) {
|
|
467
469
|
const v = G(e);
|
|
468
470
|
return v.isValid() ? v.format("DD/MM/YYYY") : "";
|
|
469
471
|
}
|
|
470
|
-
const
|
|
472
|
+
const $t = {
|
|
471
473
|
mapMemberExportRow: (e) => {
|
|
472
|
-
var n, c,
|
|
473
|
-
const v = ce(() =>
|
|
474
|
+
var n, c, k, $, h, S, x, I, u, r, g, U, o, a, d, P, R, B, V, j, q, H, te, M, Q, de, ue, pe;
|
|
475
|
+
const v = ce(() => Et.locations.map((T) => ({
|
|
474
476
|
label: T.name,
|
|
475
477
|
value: T._id
|
|
476
478
|
}))), _ = (n = Pe.parseOneAddress(
|
|
477
479
|
e == null ? void 0 : e.email
|
|
478
|
-
)) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email,
|
|
479
|
-
(T,
|
|
480
|
-
var
|
|
481
|
-
const W = (
|
|
482
|
-
(oe) => oe._id ===
|
|
483
|
-
)) == null ? void 0 :
|
|
484
|
-
return !W ||
|
|
480
|
+
)) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, F = (k = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : k.reduce(
|
|
481
|
+
(T, L) => {
|
|
482
|
+
var K, Z;
|
|
483
|
+
const W = (Z = (K = he.sortedTitles) == null ? void 0 : K.find(
|
|
484
|
+
(oe) => oe._id === L.collectible
|
|
485
|
+
)) == null ? void 0 : Z.name;
|
|
486
|
+
return !W || L.balance <= 0 || T.push(W), T;
|
|
485
487
|
},
|
|
486
488
|
[]
|
|
487
489
|
), m = (he.sortedTitles || []).reduce(
|
|
488
|
-
(T,
|
|
489
|
-
var
|
|
490
|
-
const W = (me = (oe = (
|
|
491
|
-
(
|
|
492
|
-
)) == null ? void 0 :
|
|
493
|
-
return T[
|
|
490
|
+
(T, L) => {
|
|
491
|
+
var K, Z, oe, me;
|
|
492
|
+
const W = (me = (oe = (Z = (((K = e == null ? void 0 : e.collection) == null ? void 0 : K.TITLE) || []).find(
|
|
493
|
+
(Ce) => Ce.collectible === L._id
|
|
494
|
+
)) == null ? void 0 : Z.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : me.expiredAt;
|
|
495
|
+
return T[L.name] = W ? G(W).format("DD/MM/YYYY") : "", T;
|
|
494
496
|
},
|
|
495
497
|
{}
|
|
496
|
-
), y = ((
|
|
497
|
-
(T,
|
|
498
|
+
), y = ((S = (h = ($ = e.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : S.balance) || 0, f = ((r = (u = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : u.expiryBalance) == null ? void 0 : r.reduce(
|
|
499
|
+
(T, L) => T + L.amount,
|
|
498
500
|
0
|
|
499
|
-
)) || 0,
|
|
501
|
+
)) || 0, w = Je(y, 2);
|
|
500
502
|
return {
|
|
501
503
|
ID: e._id.toString(),
|
|
502
504
|
Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
|
|
503
|
-
Phone: ((
|
|
505
|
+
Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
|
|
504
506
|
Email: _ || "",
|
|
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(w) - Number(f)).toFixed(2)),
|
|
509
511
|
FreeCredit: Number(f.toFixed(2)),
|
|
510
|
-
TotalCredit: Number(
|
|
512
|
+
TotalCredit: Number(w),
|
|
511
513
|
Exp: e != null && e.collection ? ((d = (a = (o = e.collection) == null ? void 0 : o.POINT) == null ? void 0 : a.at(0)) == null ? void 0 : d.balance) ?? 0 : 0,
|
|
512
|
-
Point: e != null && e.collection ? ((B = (
|
|
514
|
+
Point: e != null && e.collection ? ((B = (R = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : R.at(0)) == null ? void 0 : B.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 = (H = e.collection) == null ? void 0 : H.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : M.balance) ?? 0 : 0,
|
|
517
|
+
Titles: F.join(","),
|
|
516
518
|
...m,
|
|
517
519
|
TotalTransaction: e.stats.visitCount,
|
|
518
520
|
AvgSpent: Qe(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
@@ -530,16 +532,16 @@ const Et = {
|
|
|
530
532
|
)}`
|
|
531
533
|
};
|
|
532
534
|
}
|
|
533
|
-
},
|
|
535
|
+
}, Rt = { class: "flex items-center" }, At = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Dt = { class: "px-24 flex flex-col gap-y-16" }, Pt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Nt = { class: "fm-typo-en-body-md-600" }, Bt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Vt = /* @__PURE__ */ s("img", {
|
|
534
536
|
src: Ee,
|
|
535
537
|
class: "aspect-square w-[150px]"
|
|
536
|
-
}, null, -1),
|
|
538
|
+
}, null, -1), Yt = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
537
539
|
/* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
538
540
|
/* @__PURE__ */ s("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. ")
|
|
539
|
-
], -1),
|
|
541
|
+
], -1), ho = /* @__PURE__ */ ee({
|
|
540
542
|
__name: "Segment",
|
|
541
543
|
setup(e) {
|
|
542
|
-
const { minor: v } =
|
|
544
|
+
const { minor: v } = Re, { t: _ } = we(), F = ke(), { mapMemberExportRow: m } = $t, y = Ae(), f = We(), w = z(0), l = [
|
|
543
545
|
{
|
|
544
546
|
header: _("connect.loyalty.segment.table.name"),
|
|
545
547
|
accessorFn: (o) => o.name
|
|
@@ -562,7 +564,7 @@ const Et = {
|
|
|
562
564
|
},
|
|
563
565
|
{
|
|
564
566
|
header: _("connect.loyalty.segment.table.customer_percentage"),
|
|
565
|
-
accessorFn: (o) => ((o.memberCount ?? 0) * 100 /
|
|
567
|
+
accessorFn: (o) => ((o.memberCount ?? 0) * 100 / w.value).toFixed(2)
|
|
566
568
|
},
|
|
567
569
|
{
|
|
568
570
|
header: _("connect.loyalty.segment.table.actions"),
|
|
@@ -590,7 +592,7 @@ const Et = {
|
|
|
590
592
|
X.FmMenuItem,
|
|
591
593
|
{
|
|
592
594
|
onClick: async (a) => {
|
|
593
|
-
a.stopPropagation(),
|
|
595
|
+
a.stopPropagation(), x(o.row.original);
|
|
594
596
|
}
|
|
595
597
|
},
|
|
596
598
|
{
|
|
@@ -607,7 +609,7 @@ const Et = {
|
|
|
607
609
|
X.FmMenuItem,
|
|
608
610
|
{
|
|
609
611
|
onClick: async (a) => {
|
|
610
|
-
a.stopPropagation(),
|
|
612
|
+
a.stopPropagation(), S(o.row.original);
|
|
611
613
|
}
|
|
612
614
|
},
|
|
613
615
|
{
|
|
@@ -626,7 +628,7 @@ const Et = {
|
|
|
626
628
|
]);
|
|
627
629
|
}
|
|
628
630
|
}
|
|
629
|
-
], n = z(null), { tableMeta: c, rowData:
|
|
631
|
+
], n = z(null), { tableMeta: c, rowData: k, debouncedFetchData: $ } = xe(
|
|
630
632
|
N.readAll
|
|
631
633
|
);
|
|
632
634
|
async function h() {
|
|
@@ -637,7 +639,7 @@ const Et = {
|
|
|
637
639
|
{ message: "Refreshing segmentations" }
|
|
638
640
|
);
|
|
639
641
|
}
|
|
640
|
-
async function
|
|
642
|
+
async function S(o) {
|
|
641
643
|
await $e.remove(`Are you sure you want to remove ${o.name}?`) && await v(
|
|
642
644
|
async () => {
|
|
643
645
|
await N.delete(o._id), await $({ pageSize: 10, pageIndex: 0 });
|
|
@@ -648,7 +650,7 @@ const Et = {
|
|
|
648
650
|
}
|
|
649
651
|
);
|
|
650
652
|
}
|
|
651
|
-
async function
|
|
653
|
+
async function x(o) {
|
|
652
654
|
const a = {
|
|
653
655
|
sortBy: "_id",
|
|
654
656
|
descending: !1,
|
|
@@ -660,13 +662,13 @@ const Et = {
|
|
|
660
662
|
skip: 0,
|
|
661
663
|
sortBy: a.sortBy,
|
|
662
664
|
descending: a.descending
|
|
663
|
-
})).meta.totalResources ?? 0,
|
|
665
|
+
})).meta.totalResources ?? 0, R = a.rowsPerPage;
|
|
664
666
|
await v(
|
|
665
667
|
async () => {
|
|
666
|
-
for (let B = 0; B < P; B +=
|
|
668
|
+
for (let B = 0; B < P; B += R) {
|
|
667
669
|
const V = {
|
|
668
670
|
...a,
|
|
669
|
-
limit:
|
|
671
|
+
limit: R,
|
|
670
672
|
skip: a.page - 1,
|
|
671
673
|
sortBy: a.sortBy,
|
|
672
674
|
descending: a.descending
|
|
@@ -680,7 +682,7 @@ const Et = {
|
|
|
680
682
|
}
|
|
681
683
|
a.page++;
|
|
682
684
|
}
|
|
683
|
-
await
|
|
685
|
+
await Fe(
|
|
684
686
|
d.buildExcel(),
|
|
685
687
|
`[${o.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
686
688
|
{
|
|
@@ -696,18 +698,18 @@ const Et = {
|
|
|
696
698
|
}
|
|
697
699
|
);
|
|
698
700
|
}
|
|
699
|
-
async function
|
|
701
|
+
async function I(o) {
|
|
700
702
|
await v(
|
|
701
703
|
async () => {
|
|
702
704
|
var a;
|
|
703
|
-
if (o.type ===
|
|
705
|
+
if (o.type === A.enum.STATIC) {
|
|
704
706
|
const d = new FormData();
|
|
705
707
|
if (d.append("file", o.file), o._id) {
|
|
706
|
-
const { members: P, _id:
|
|
708
|
+
const { members: P, _id: R, file: B, ...V } = o;
|
|
707
709
|
d.append("segment", JSON.stringify(V)), await N.updateStatic(o._id, d);
|
|
708
710
|
} else {
|
|
709
|
-
const { file: P, ...
|
|
710
|
-
d.append("segment", JSON.stringify(
|
|
711
|
+
const { file: P, ...R } = o;
|
|
712
|
+
d.append("segment", JSON.stringify(R)), await N.createStatic(d);
|
|
711
713
|
}
|
|
712
714
|
o.file && y.open({
|
|
713
715
|
type: "info",
|
|
@@ -721,8 +723,8 @@ const Et = {
|
|
|
721
723
|
}
|
|
722
724
|
});
|
|
723
725
|
} else if (o._id) {
|
|
724
|
-
const { members: d, _id: P, ...
|
|
725
|
-
await N.update(o._id,
|
|
726
|
+
const { members: d, _id: P, ...R } = o;
|
|
727
|
+
await N.update(o._id, R);
|
|
726
728
|
} else
|
|
727
729
|
await N.create(o);
|
|
728
730
|
await $({ pageSize: 10, pageIndex: 0 }), (a = n.value) == null || a.hideSheet();
|
|
@@ -742,7 +744,7 @@ const Et = {
|
|
|
742
744
|
value: "queue",
|
|
743
745
|
isPrimary: !1,
|
|
744
746
|
prependIcon: "work_history"
|
|
745
|
-
}, g = ce(() =>
|
|
747
|
+
}, g = ce(() => F.isPremium ? [
|
|
746
748
|
r,
|
|
747
749
|
{
|
|
748
750
|
label: "Refresh segments",
|
|
@@ -756,7 +758,7 @@ const Et = {
|
|
|
756
758
|
prependIcon: "add"
|
|
757
759
|
}
|
|
758
760
|
] : []);
|
|
759
|
-
function
|
|
761
|
+
function U(o) {
|
|
760
762
|
switch (o) {
|
|
761
763
|
case "add":
|
|
762
764
|
u();
|
|
@@ -780,63 +782,63 @@ const Et = {
|
|
|
780
782
|
search: void 0,
|
|
781
783
|
descending: !1
|
|
782
784
|
});
|
|
783
|
-
|
|
785
|
+
w.value = o.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await F.readPremium(), await F.readLocations();
|
|
784
786
|
}), (o, a) => {
|
|
785
|
-
const d =
|
|
786
|
-
return p(),
|
|
787
|
+
const d = b("FmPill"), P = b("FmPageHead"), R = b("FmIcon"), B = b("FmMenuItem"), V = b("FmMenu"), j = b("FmListItem"), q = b("FmList"), H = b("FmButton"), te = b("FmCard");
|
|
788
|
+
return p(), C(O, null, [
|
|
787
789
|
i(P, {
|
|
788
790
|
title: "Segments",
|
|
789
791
|
actions: t(g),
|
|
790
|
-
"onClick:action": a[0] || (a[0] = (
|
|
792
|
+
"onClick:action": a[0] || (a[0] = (M) => U(M))
|
|
791
793
|
}, {
|
|
792
794
|
title: E(() => [
|
|
793
|
-
s("div",
|
|
795
|
+
s("div", Rt, [
|
|
794
796
|
s("span", At, D(t(_)("connect.loyalty.segment.title")), 1),
|
|
795
797
|
i(d, { variant: "premium" })
|
|
796
798
|
])
|
|
797
799
|
]),
|
|
798
800
|
_: 1
|
|
799
801
|
}, 8, ["actions"]),
|
|
800
|
-
s("div",
|
|
801
|
-
t(
|
|
802
|
-
i(
|
|
802
|
+
s("div", Dt, [
|
|
803
|
+
t(k).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), C(O, { key: 0 }, [
|
|
804
|
+
i(be, {
|
|
803
805
|
loading: t(c).isLoading,
|
|
804
|
-
"row-data": t(
|
|
806
|
+
"row-data": t(k),
|
|
805
807
|
"row-count": t(c).totalRows,
|
|
806
808
|
"column-defs": l,
|
|
807
809
|
"shrink-at": !1,
|
|
808
810
|
"page-count": t(c).pageCount,
|
|
809
811
|
"page-index": t(c).pageIndex,
|
|
810
812
|
"page-size": t(c).pageSize,
|
|
811
|
-
onRowClick: a[1] || (a[1] = (
|
|
812
|
-
u(
|
|
813
|
+
onRowClick: a[1] || (a[1] = (M) => {
|
|
814
|
+
u(M.original);
|
|
813
815
|
}),
|
|
814
816
|
onPageChange: t($)
|
|
815
817
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
816
818
|
i(q, { class: "w-full hidden xs:block" }, {
|
|
817
819
|
default: E(() => [
|
|
818
|
-
(p(!0),
|
|
819
|
-
key:
|
|
820
|
+
(p(!0), C(O, null, ie(t(k), (M) => (p(), J(j, {
|
|
821
|
+
key: M._id.toString(),
|
|
820
822
|
tag: "label",
|
|
821
|
-
onClick: (Q) => u(
|
|
823
|
+
onClick: (Q) => u(M)
|
|
822
824
|
}, {
|
|
823
825
|
default: E(() => [
|
|
824
826
|
s("div", null, [
|
|
825
|
-
s("div",
|
|
826
|
-
s("div",
|
|
827
|
-
s("div",
|
|
827
|
+
s("div", Pt, D((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
828
|
+
s("div", Nt, D(M.name), 1),
|
|
829
|
+
s("div", Bt, D(((M.memberCount ?? 0) * 100 / t(w)).toFixed(2)) + "% of customers ", 1)
|
|
828
830
|
])
|
|
829
831
|
]),
|
|
830
832
|
append: E(() => [
|
|
831
833
|
i(V, { "stop-click-propagation": !0 }, {
|
|
832
834
|
"menu-button": E(() => [
|
|
833
|
-
i(
|
|
835
|
+
i(R, { name: "more_vert" })
|
|
834
836
|
]),
|
|
835
837
|
default: E(() => [
|
|
836
838
|
i(B, {
|
|
837
839
|
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
838
840
|
label: "Remove",
|
|
839
|
-
"onUpdate:modelValue": (Q) => Q &&
|
|
841
|
+
"onUpdate:modelValue": (Q) => Q && S(M)
|
|
840
842
|
}, null, 8, ["onUpdate:modelValue"])
|
|
841
843
|
]),
|
|
842
844
|
_: 2
|
|
@@ -853,22 +855,22 @@ const Et = {
|
|
|
853
855
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
854
856
|
}, {
|
|
855
857
|
default: E(() => [
|
|
856
|
-
Bt,
|
|
857
858
|
Vt,
|
|
859
|
+
Yt,
|
|
858
860
|
i(H, {
|
|
859
861
|
variant: "primary",
|
|
860
862
|
label: "Create segment",
|
|
861
|
-
disabled: !t(
|
|
863
|
+
disabled: !t(F).isPremium,
|
|
862
864
|
icon: "add",
|
|
863
|
-
onClick: a[2] || (a[2] = (
|
|
865
|
+
onClick: a[2] || (a[2] = (M) => u())
|
|
864
866
|
}, null, 8, ["disabled"])
|
|
865
867
|
]),
|
|
866
868
|
_: 1
|
|
867
869
|
})),
|
|
868
|
-
i(
|
|
870
|
+
i(Tt, {
|
|
869
871
|
ref_key: "sheetRef",
|
|
870
872
|
ref: n,
|
|
871
|
-
"onUpdate:modelValue":
|
|
873
|
+
"onUpdate:modelValue": I
|
|
872
874
|
}, null, 512)
|
|
873
875
|
])
|
|
874
876
|
], 64);
|
|
@@ -876,5 +878,5 @@ const Et = {
|
|
|
876
878
|
}
|
|
877
879
|
});
|
|
878
880
|
export {
|
|
879
|
-
|
|
881
|
+
ho as default
|
|
880
882
|
};
|