@feedmepos/mf-connect 0.0.16-beta.10 → 0.0.16-beta.12
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-BVk0jPDU.js → Analytic-DIc9BYb0.js} +32 -20
- package/dist/{App-BbAalq1k.js → App-BzzL9_Jw.js} +33 -27
- package/dist/Broadcast-dVPgK5QV.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiU3MnH0.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TnEPvafD.js} +18 -11
- package/dist/{Card-B5in1RMa.js → Card-Bj2Yd2pr.js} +178 -158
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-Fkb_zzqZ.js +453 -0
- package/dist/{Credit-Bc9EzdsC.js → Credit-DHn9OkE8.js} +78 -69
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js +2788 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D6mWny8y.js +344 -0
- package/dist/{Experience-CgKak5ik.js → Experience-DX3aJihS.js} +64 -55
- package/dist/{Game-QhfKqrN_.js → Game-CcVQvETd.js} +54 -45
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
- package/dist/MainLayout-B1aJoR95.js +41 -0
- package/dist/{Marketing-CSx4N7UJ.js → Marketing-B9kykWEh.js} +79 -72
- package/dist/{Member-CY6WMD8D.js → Member-RoJSCSC5.js} +25 -22
- package/dist/{MemberList-8iRwm7Sz.js → MemberList-BUDxqMEK.js} +321 -307
- package/dist/{MemberTransactions-CknqkWO3.js → MemberTransactions-Bh_tT1Rp.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Cj3-JHOX.js +432 -0
- package/dist/{Mission-BTy1p7lU.js → Mission-DDvgCLy0.js} +50 -40
- package/dist/{Point-A6B_ggSy.js → Point-BbPkt4kF.js} +67 -58
- package/dist/Promotion-DEo-lxpX.js +221 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js +1751 -0
- package/dist/{Segment-CFVXtyEj.js → Segment-DAcpZWIN.js} +145 -130
- package/dist/{Setting-Jmtw-_DV.js → Setting-CgXohUPt.js} +167 -154
- package/dist/{Store-DQypT-7e.js → Store-BVyHbQ8o.js} +504 -489
- package/dist/{StoreRewards-M-utm0iI.js → StoreRewards-sccMDbkj.js} +124 -108
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js → StoreTransactions.vue_vue_type_script_setup_true_lang--sdQ_l8g.js} +131 -123
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CXlkvt2u.js +139 -0
- package/dist/{Tier-D1jymeLK.js → Tier--P27XXbB.js} +144 -125
- package/dist/{Title-DN9DIP2k.js → Title-B27S3SxD.js} +107 -90
- package/dist/{Transaction-BAJvAoU6.js → Transaction-CYTtwwHY.js} +2 -2
- package/dist/Voucher-BZ8PKgO5.js +488 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +55 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-CnKzqAcN.js +53428 -0
- package/dist/app-FfENBuoE.js +5381 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +2 -1
- package/dist/business-CXyP9G7A.js +78 -0
- package/dist/campaign-0aM2KYOy.js +96 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/collection.fn-FicQhH1t.js +26 -0
- package/dist/dto-BiYLkVdL.js +1169 -0
- package/dist/effect-Cg-eNEjg.js +61 -0
- package/dist/{export-DjeNY5Pc.js → export-D7BuObOL.js} +19 -16
- package/dist/helper-DvD-D7c7.js +71 -0
- package/dist/index-B1Q0GAWp.js +95 -0
- package/dist/index-B4UZgSB-.js +28058 -0
- package/dist/index-B6c-fUij.js +203 -0
- package/dist/index-BP_5cfKa.js +38 -0
- package/dist/index-BRXg5Si1.js +2071 -0
- package/dist/index-BuDwICBJ.js +761 -0
- package/dist/index-CDMC-8iO.js +94 -0
- package/dist/index-CcZt3OrE.js +73 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-DA-fzkRR.js +1737 -0
- package/dist/index-Dbd4WA4r.js +61 -0
- package/dist/index-Dkeb_9ER.js +8832 -0
- package/dist/index-DmdKoKk_.js +298 -0
- package/dist/index-G-88ujCM.js +3 -0
- package/dist/loading-uCNeZibp.js +32697 -0
- package/dist/lodash-B5I3zXaY.js +3678 -0
- package/dist/membership-DFRO9TyM.js +221 -0
- package/dist/moment-BWErdI6_.js +2578 -0
- package/dist/money-OtkT4Pzp.js +15 -0
- package/dist/number-Cg3NCouc.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/rule-Ch2HRiGw.js +1973 -0
- package/dist/rule-builder-B_M9yvEe.js +89 -0
- package/dist/template-1o0LbOoJ.js +190 -0
- package/dist/usePagination-BeF5K3M7.js +223 -0
- package/dist/vue-i18n-AtGIa4qH.js +2365 -0
- package/dist/xlsx-pChq0adn.js +15491 -0
- package/dist/zod-W_PvIofQ.js +90 -0
- package/package.json +3 -3
- package/dist/Collections-CFCZ9YIG.js +0 -4
- package/dist/MainLayout-JbHzENFy.js +0 -4
- package/dist/app-BpzzygYP.js +0 -87765
- package/dist/money-DKGIIplY.js +0 -15
- package/dist/number-tPodRxTN.js +0 -12
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as A, onMounted as N, openBlock as u, createElementBlock as b, createElementVNode as a, toDisplayString as x, unref as t, createVNode as l, createCommentVNode as G, ref as w, computed as j, resolveComponent as c, createBlock as B, isRef as J, createSlots as W, withCtx as g, Fragment as I, h as R, reactive as Q, watch as X, onBeforeMount as ee, renderList as te } from "vue";
|
|
2
|
+
import { _ as oe } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { F as E, p as ae, u as ne } from "./loading-uCNeZibp.js";
|
|
3
4
|
import { components as L } from "@feedmepos/ui-library";
|
|
4
|
-
|
|
5
|
+
import { l as se } from "./lodash-B5I3zXaY.js";
|
|
6
|
+
import { u as le } from "./vue-i18n-AtGIa4qH.js";
|
|
7
|
+
import { Z as re } from "./zod-W_PvIofQ.js";
|
|
8
|
+
import { a as ie } from "./index-DA-fzkRR.js";
|
|
9
|
+
import { u as me } from "./app-wDQR6dpb.js";
|
|
10
|
+
import { R as de } from "./rule-builder-B_M9yvEe.js";
|
|
11
|
+
import { _ as ce } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js";
|
|
12
|
+
import { _ as ue } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js";
|
|
13
|
+
import { h as P } from "./moment-BWErdI6_.js";
|
|
14
|
+
import { u as pe, _ as fe } from "./usePagination-BeF5K3M7.js";
|
|
15
|
+
import { s as k } from "./membership-DFRO9TyM.js";
|
|
16
|
+
import { o as ge } from "./objectId-dwaoBfJX.js";
|
|
17
|
+
import { u as ye } from "./business-CXyP9G7A.js";
|
|
18
|
+
import { m as ve } from "./index-CcZt3OrE.js";
|
|
19
|
+
const _e = ie.extend({
|
|
5
20
|
_id: E.optional(),
|
|
6
21
|
business: E.optional()
|
|
7
22
|
}), he = { class: "space-y-16 pr-12" }, be = { class: "fm-typo-en-title-md-800" }, Se = { class: "flex space-x-8" }, xe = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, we = { class: "text-fm-color-typo-secondary" }, Fe = {
|
|
8
23
|
key: 0,
|
|
9
24
|
class: "w-full flex flex-col gap-16 items-center pt-16"
|
|
10
|
-
}, Ce = /* @__PURE__ */
|
|
25
|
+
}, Ce = /* @__PURE__ */ A({
|
|
11
26
|
__name: "ReviewSegment",
|
|
12
27
|
props: {
|
|
13
28
|
title: {},
|
|
@@ -17,78 +32,78 @@ const _e = ae.extend({
|
|
|
17
32
|
const y = D, v = [
|
|
18
33
|
{
|
|
19
34
|
header: "Name",
|
|
20
|
-
accessorFn: (
|
|
35
|
+
accessorFn: (n) => n.name
|
|
21
36
|
},
|
|
22
37
|
{
|
|
23
38
|
header: "Customer Since",
|
|
24
|
-
accessorFn: (
|
|
39
|
+
accessorFn: (n) => P(ge(n._id.toString())).format("DD MMM YYYY")
|
|
25
40
|
},
|
|
26
41
|
{
|
|
27
42
|
header: "Birthday",
|
|
28
|
-
accessorFn: (
|
|
43
|
+
accessorFn: (n) => P(n.birthday).format("DD MMM YYYY")
|
|
29
44
|
},
|
|
30
45
|
{
|
|
31
46
|
header: "Last Visit",
|
|
32
|
-
accessorFn: (
|
|
47
|
+
accessorFn: (n) => P(n.stats.lastVisit).format("DD MMM YYYY")
|
|
33
48
|
}
|
|
34
|
-
], _ = async (
|
|
35
|
-
limit:
|
|
36
|
-
skip:
|
|
49
|
+
], _ = async (n) => y.segment._id ? await k.paginateSegmentUsers(y.segment._id, {
|
|
50
|
+
limit: r.value.pageSize,
|
|
51
|
+
skip: n.pageIndex ?? 0,
|
|
37
52
|
sortBy: "_id",
|
|
38
|
-
search:
|
|
53
|
+
search: n.searchValue,
|
|
39
54
|
descending: !0
|
|
40
|
-
}) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta:
|
|
55
|
+
}) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: r, rowData: d, onSort: F, debouncedFetchData: i, onSearch: s } = pe(_);
|
|
41
56
|
return N(async () => {
|
|
42
|
-
await
|
|
43
|
-
}), (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
m[1] || (m[1] =
|
|
49
|
-
|
|
57
|
+
await i();
|
|
58
|
+
}), (n, m) => (u(), b("div", he, [
|
|
59
|
+
a("div", be, x(y.title), 1),
|
|
60
|
+
a("div", Se, [
|
|
61
|
+
a("div", xe, x(n.segment.members.length), 1),
|
|
62
|
+
a("div", we, [
|
|
63
|
+
m[1] || (m[1] = a("div", null, "contacts in your segment", -1)),
|
|
64
|
+
a("div", null, "as of " + x(t(P)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
50
65
|
])
|
|
51
66
|
]),
|
|
52
|
-
l(
|
|
53
|
-
loading: t(
|
|
67
|
+
l(fe, {
|
|
68
|
+
loading: t(r).isLoading,
|
|
54
69
|
"row-data": t(d),
|
|
55
|
-
"row-count": t(
|
|
70
|
+
"row-count": t(r).totalRows,
|
|
56
71
|
"column-defs": v,
|
|
57
|
-
"page-size": t(
|
|
58
|
-
"page-count": t(
|
|
59
|
-
"page-index": t(
|
|
72
|
+
"page-size": t(r).pageSize,
|
|
73
|
+
"page-count": t(r).pageCount,
|
|
74
|
+
"page-index": t(r).pageIndex,
|
|
60
75
|
onSortChange: t(F),
|
|
61
|
-
onPageChange: m[0] || (m[0] = (S) => t(
|
|
76
|
+
onPageChange: m[0] || (m[0] = (S) => t(i)({ pageSize: S.pageSize, pageIndex: S.pageIndex }))
|
|
62
77
|
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"]),
|
|
63
78
|
t(d).length == 0 ? (u(), b("div", Fe, m[2] || (m[2] = [
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
a("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1),
|
|
80
|
+
a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1)
|
|
66
81
|
]))) : G("", !0)
|
|
67
82
|
]));
|
|
68
83
|
}
|
|
69
84
|
}), ke = { class: "flex items-center gap-x-8" }, Me = {
|
|
70
85
|
key: 0,
|
|
71
86
|
class: "space-y-16 pr-12"
|
|
72
|
-
},
|
|
87
|
+
}, Re = { class: "flex items-center gap-8" }, Ie = /* @__PURE__ */ A({
|
|
73
88
|
__name: "SegmentSheet",
|
|
74
89
|
emits: ["update:model-value"],
|
|
75
90
|
setup(D, { expose: y, emit: v }) {
|
|
76
|
-
const _ =
|
|
91
|
+
const _ = me(), r = w(!1), d = w(!1), F = {
|
|
77
92
|
name: "",
|
|
78
|
-
rule:
|
|
93
|
+
rule: de.scaffoldGroup(),
|
|
79
94
|
members: []
|
|
80
|
-
},
|
|
81
|
-
const
|
|
82
|
-
return
|
|
95
|
+
}, i = _e, s = w(F), n = j(() => {
|
|
96
|
+
const o = i.safeParse(s.value);
|
|
97
|
+
return o.success ? [] : o.error.errors;
|
|
83
98
|
});
|
|
84
|
-
function m(
|
|
85
|
-
|
|
99
|
+
function m(o) {
|
|
100
|
+
r.value = !0, d.value = !1, o ? s.value = { ...o } : s.value = { ...F };
|
|
86
101
|
}
|
|
87
102
|
function S() {
|
|
88
|
-
|
|
103
|
+
r.value = !1;
|
|
89
104
|
}
|
|
90
105
|
async function $() {
|
|
91
|
-
|
|
106
|
+
i.safeParse(s.value).success && (d.value = !0);
|
|
92
107
|
}
|
|
93
108
|
function Y() {
|
|
94
109
|
d.value = !1;
|
|
@@ -102,34 +117,34 @@ const _e = ae.extend({
|
|
|
102
117
|
return y({
|
|
103
118
|
showSheet: m,
|
|
104
119
|
hideSheet: S
|
|
105
|
-
}), (
|
|
120
|
+
}), (o, e) => {
|
|
106
121
|
const h = c("FmButton"), V = c("FmSideSheet");
|
|
107
|
-
return u(),
|
|
108
|
-
modelValue: t(
|
|
109
|
-
"onUpdate:modelValue": e[5] || (e[5] = (p) => J(
|
|
122
|
+
return u(), B(V, {
|
|
123
|
+
modelValue: t(r),
|
|
124
|
+
"onUpdate:modelValue": e[5] || (e[5] = (p) => J(r) ? r.value = p : null),
|
|
110
125
|
header: "Add segment",
|
|
111
126
|
"dismiss-away": "",
|
|
112
127
|
"close-button": !0,
|
|
113
128
|
"max-width": 1100
|
|
114
129
|
}, W({
|
|
115
|
-
"side-sheet-footer":
|
|
116
|
-
|
|
117
|
-
t(d) ? (u(), b(
|
|
130
|
+
"side-sheet-footer": g(() => [
|
|
131
|
+
a("div", Re, [
|
|
132
|
+
t(d) ? (u(), b(I, { key: 0 }, [
|
|
118
133
|
l(h, {
|
|
119
134
|
label: "Save Segment",
|
|
120
135
|
onClick: C,
|
|
121
136
|
loading: t(_).isLoading,
|
|
122
|
-
disabled: t(
|
|
137
|
+
disabled: t(n).length > 0 || t(_).isLoading
|
|
123
138
|
}, null, 8, ["loading", "disabled"]),
|
|
124
139
|
l(h, {
|
|
125
140
|
label: "Cancel",
|
|
126
141
|
onClick: e[3] || (e[3] = (p) => Y()),
|
|
127
142
|
variant: "tertiary"
|
|
128
143
|
})
|
|
129
|
-
], 64)) : (u(), b(
|
|
144
|
+
], 64)) : (u(), b(I, { key: 1 }, [
|
|
130
145
|
l(h, {
|
|
131
146
|
label: "Review Segment",
|
|
132
|
-
disabled: t(
|
|
147
|
+
disabled: t(n).length > 0 || t(_).isLoading,
|
|
133
148
|
onClick: $
|
|
134
149
|
}, null, 8, ["disabled"]),
|
|
135
150
|
l(h, {
|
|
@@ -140,22 +155,22 @@ const _e = ae.extend({
|
|
|
140
155
|
], 64))
|
|
141
156
|
])
|
|
142
157
|
]),
|
|
143
|
-
default:
|
|
158
|
+
default: g(() => {
|
|
144
159
|
var p;
|
|
145
160
|
return [
|
|
146
|
-
t(d) ? (u(),
|
|
161
|
+
t(d) ? (u(), B(Ce, {
|
|
147
162
|
key: 1,
|
|
148
163
|
title: t(s).name,
|
|
149
164
|
segment: t(s)
|
|
150
165
|
}, null, 8, ["title", "segment"])) : (u(), b("div", Me, [
|
|
151
|
-
l(
|
|
166
|
+
l(ce, {
|
|
152
167
|
modelValue: t(s).name,
|
|
153
168
|
"onUpdate:modelValue": e[1] || (e[1] = (M) => t(s).name = M),
|
|
154
169
|
label: "Segment title",
|
|
155
|
-
schema: t(
|
|
170
|
+
schema: t(re).typeAtPath(t(i), "name")
|
|
156
171
|
}, null, 8, ["modelValue", "schema"]),
|
|
157
|
-
e[7] || (e[7] =
|
|
158
|
-
l(
|
|
172
|
+
e[7] || (e[7] = a("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
173
|
+
l(ue, {
|
|
159
174
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
160
175
|
includeOnly: "user",
|
|
161
176
|
"model-value": (p = t(s)) == null ? void 0 : p.rule,
|
|
@@ -170,14 +185,14 @@ const _e = ae.extend({
|
|
|
170
185
|
}, [
|
|
171
186
|
t(d) ? {
|
|
172
187
|
name: "side-sheet-header",
|
|
173
|
-
fn:
|
|
174
|
-
|
|
188
|
+
fn: g(() => [
|
|
189
|
+
a("div", ke, [
|
|
175
190
|
l(h, {
|
|
176
191
|
icon: "arrow_back",
|
|
177
192
|
variant: "tertiary",
|
|
178
193
|
onClick: e[0] || (e[0] = (p) => d.value = !1)
|
|
179
194
|
}),
|
|
180
|
-
e[6] || (e[6] =
|
|
195
|
+
e[6] || (e[6] = a("div", null, "Review segment", -1))
|
|
181
196
|
])
|
|
182
197
|
]),
|
|
183
198
|
key: "0"
|
|
@@ -185,30 +200,30 @@ const _e = ae.extend({
|
|
|
185
200
|
]), 1032, ["modelValue"]);
|
|
186
201
|
};
|
|
187
202
|
}
|
|
188
|
-
}), $e = { class: "flex items-center" }, Ve = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" },
|
|
203
|
+
}), $e = { class: "flex items-center" }, Ve = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Pe = { class: "px-24 flex flex-col gap-y-16" }, Be = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, De = { class: "fm-typo-en-body-md-600" }, Ye = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, et = /* @__PURE__ */ A({
|
|
189
204
|
__name: "Segment",
|
|
190
205
|
setup(D) {
|
|
191
|
-
const { minor: y } =
|
|
206
|
+
const { minor: y } = ne, { t: v } = le(), _ = ye(), r = w(0), d = [
|
|
192
207
|
{
|
|
193
208
|
header: v("connect.loyalty.segment.table.name"),
|
|
194
|
-
accessorFn: (
|
|
209
|
+
accessorFn: (o) => o.name
|
|
195
210
|
},
|
|
196
211
|
{
|
|
197
212
|
header: v("connect.loyalty.segment.table.total_customers"),
|
|
198
|
-
accessorFn: (
|
|
213
|
+
accessorFn: (o) => o.memberCount ?? 0
|
|
199
214
|
},
|
|
200
215
|
{
|
|
201
216
|
header: v("connect.loyalty.segment.table.customer_percentage"),
|
|
202
|
-
accessorFn: (
|
|
217
|
+
accessorFn: (o) => ((o.memberCount ?? 0) * 100 / r.value).toFixed(2)
|
|
203
218
|
},
|
|
204
219
|
{
|
|
205
220
|
header: v("connect.loyalty.segment.table.actions"),
|
|
206
221
|
meta: {
|
|
207
222
|
maxWidth: "100px"
|
|
208
223
|
},
|
|
209
|
-
cell(
|
|
210
|
-
return
|
|
211
|
-
|
|
224
|
+
cell(o) {
|
|
225
|
+
return R("div", { class: "flex items-center justify-end" }, [
|
|
226
|
+
R(
|
|
212
227
|
L.FmMenu,
|
|
213
228
|
{
|
|
214
229
|
placement: "bottom-end",
|
|
@@ -217,21 +232,21 @@ const _e = ae.extend({
|
|
|
217
232
|
}
|
|
218
233
|
},
|
|
219
234
|
{
|
|
220
|
-
"menu-button": () =>
|
|
235
|
+
"menu-button": () => R(L.FmButton, {
|
|
221
236
|
icon: "more_vert",
|
|
222
237
|
iconColor: "neutral-gray-400",
|
|
223
238
|
variant: "tertiary"
|
|
224
239
|
}),
|
|
225
240
|
default: () => [
|
|
226
|
-
|
|
241
|
+
R(
|
|
227
242
|
L.FmMenuItem,
|
|
228
243
|
{
|
|
229
244
|
onClick: async (e) => {
|
|
230
|
-
e.stopPropagation(), $(
|
|
245
|
+
e.stopPropagation(), $(o.row.original);
|
|
231
246
|
}
|
|
232
247
|
},
|
|
233
248
|
{
|
|
234
|
-
label:
|
|
249
|
+
label: R(
|
|
235
250
|
"div",
|
|
236
251
|
{
|
|
237
252
|
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
@@ -246,23 +261,23 @@ const _e = ae.extend({
|
|
|
246
261
|
]);
|
|
247
262
|
}
|
|
248
263
|
}
|
|
249
|
-
], F = Q({ searchKey: "", columnFilters: [] }),
|
|
264
|
+
], F = Q({ searchKey: "", columnFilters: [] }), i = w({
|
|
250
265
|
searchValue: "",
|
|
251
266
|
pageSize: 10,
|
|
252
267
|
pageCount: 0,
|
|
253
268
|
pageIndex: 0,
|
|
254
269
|
totalRows: 0,
|
|
255
270
|
isLoading: !1
|
|
256
|
-
}), s = w([]),
|
|
257
|
-
s.value = [],
|
|
271
|
+
}), s = w([]), n = w(null), m = async (o) => {
|
|
272
|
+
s.value = [], i.value.isLoading = !0;
|
|
258
273
|
const e = await k.readAll({
|
|
259
|
-
limit:
|
|
260
|
-
skip:
|
|
274
|
+
limit: o.pageSize,
|
|
275
|
+
skip: o.pageIndex ?? 0,
|
|
261
276
|
sortBy: "_id",
|
|
262
|
-
search:
|
|
277
|
+
search: i.value.searchValue,
|
|
263
278
|
descending: !0
|
|
264
279
|
});
|
|
265
|
-
s.value = e.resources,
|
|
280
|
+
s.value = e.resources, i.value.totalRows = e.meta.totalResources ?? 0, i.value.pageCount = e.meta.totalPages ?? 0, i.value.isLoading = !1;
|
|
266
281
|
};
|
|
267
282
|
async function S() {
|
|
268
283
|
await y(
|
|
@@ -272,27 +287,27 @@ const _e = ae.extend({
|
|
|
272
287
|
{ message: "Refreshing segmentations" }
|
|
273
288
|
);
|
|
274
289
|
}
|
|
275
|
-
async function $(
|
|
276
|
-
await
|
|
290
|
+
async function $(o) {
|
|
291
|
+
await ae.remove(`Are you sure you want to remove ${o.name}?`) && await y(
|
|
277
292
|
async () => {
|
|
278
|
-
await k.delete(
|
|
293
|
+
await k.delete(o._id), await m({ pageSize: 10, pageIndex: 0 });
|
|
279
294
|
},
|
|
280
295
|
{
|
|
281
|
-
message: `Removing ${
|
|
282
|
-
successMessage: `Removed ${
|
|
296
|
+
message: `Removing ${o.name}`,
|
|
297
|
+
successMessage: `Removed ${o.name} successfully`
|
|
283
298
|
}
|
|
284
299
|
);
|
|
285
300
|
}
|
|
286
|
-
async function Y(
|
|
301
|
+
async function Y(o) {
|
|
287
302
|
await y(
|
|
288
303
|
async () => {
|
|
289
304
|
var e;
|
|
290
|
-
if (
|
|
291
|
-
const { members: h, _id: V, ...p } =
|
|
292
|
-
await k.update(
|
|
305
|
+
if (o._id) {
|
|
306
|
+
const { members: h, _id: V, ...p } = o;
|
|
307
|
+
await k.update(o._id, p);
|
|
293
308
|
} else
|
|
294
|
-
await k.create(
|
|
295
|
-
await m({ pageSize: 10, pageIndex: 0 }), (e =
|
|
309
|
+
await k.create(o);
|
|
310
|
+
await m({ pageSize: 10, pageIndex: 0 }), (e = n.value) == null || e.hideSheet();
|
|
296
311
|
},
|
|
297
312
|
{
|
|
298
313
|
message: "Saving segment",
|
|
@@ -300,9 +315,9 @@ const _e = ae.extend({
|
|
|
300
315
|
}
|
|
301
316
|
);
|
|
302
317
|
}
|
|
303
|
-
function C(
|
|
318
|
+
function C(o) {
|
|
304
319
|
var e;
|
|
305
|
-
(e =
|
|
320
|
+
(e = n.value) == null || e.showSheet(o);
|
|
306
321
|
}
|
|
307
322
|
const z = j(() => _.isPremium ? [
|
|
308
323
|
{
|
|
@@ -317,37 +332,37 @@ const _e = ae.extend({
|
|
|
317
332
|
}
|
|
318
333
|
] : []);
|
|
319
334
|
return X(
|
|
320
|
-
() =>
|
|
321
|
-
|
|
335
|
+
() => i.value.searchValue,
|
|
336
|
+
se.debounce(() => {
|
|
322
337
|
m({ pageSize: 10, pageIndex: 0 });
|
|
323
338
|
}, 500)
|
|
324
339
|
), ee(async () => {
|
|
325
|
-
const { meta:
|
|
340
|
+
const { meta: o } = await ve.read({
|
|
326
341
|
limit: 1,
|
|
327
342
|
skip: 0,
|
|
328
343
|
sortBy: "_id",
|
|
329
|
-
search:
|
|
344
|
+
search: i.value.searchValue,
|
|
330
345
|
descending: !1
|
|
331
346
|
});
|
|
332
|
-
|
|
333
|
-
}), (
|
|
347
|
+
r.value = o.totalResources ?? 0, await m({ pageSize: 10, pageIndex: 0 }), await _.readPremium();
|
|
348
|
+
}), (o, e) => {
|
|
334
349
|
const h = c("FmPill"), V = c("FmPageHead"), p = c("FmTable"), M = c("FmIcon"), H = c("FmMenuItem"), O = c("FmMenu"), T = c("FmListItem"), K = c("FmList"), Z = c("FmButton"), q = c("FmCard");
|
|
335
|
-
return u(), b(
|
|
350
|
+
return u(), b(I, null, [
|
|
336
351
|
l(V, {
|
|
337
352
|
title: "Segments",
|
|
338
353
|
actions: t(z),
|
|
339
|
-
"onClick:action": e[0] || (e[0] = (
|
|
354
|
+
"onClick:action": e[0] || (e[0] = (f) => f === "add" ? C() : S())
|
|
340
355
|
}, {
|
|
341
|
-
title:
|
|
342
|
-
|
|
343
|
-
|
|
356
|
+
title: g(() => [
|
|
357
|
+
a("div", $e, [
|
|
358
|
+
a("span", Ve, x(t(v)("connect.loyalty.segment.title")), 1),
|
|
344
359
|
l(h, { variant: "premium" })
|
|
345
360
|
])
|
|
346
361
|
]),
|
|
347
362
|
_: 1
|
|
348
363
|
}, 8, ["actions"]),
|
|
349
|
-
|
|
350
|
-
t(s).length > 0 || t(
|
|
364
|
+
a("div", Pe, [
|
|
365
|
+
t(s).length > 0 || t(i).searchValue ? (u(), b(I, { key: 0 }, [
|
|
351
366
|
l(p, {
|
|
352
367
|
class: "xs:hidden",
|
|
353
368
|
"row-data": t(s),
|
|
@@ -355,34 +370,34 @@ const _e = ae.extend({
|
|
|
355
370
|
"search-value": t(F).searchKey,
|
|
356
371
|
"column-filter": [],
|
|
357
372
|
"hide-footer": !0,
|
|
358
|
-
onRowClick: e[1] || (e[1] = (
|
|
359
|
-
C(
|
|
373
|
+
onRowClick: e[1] || (e[1] = (f) => {
|
|
374
|
+
C(f.original);
|
|
360
375
|
})
|
|
361
376
|
}, null, 8, ["row-data", "search-value"]),
|
|
362
377
|
l(K, { class: "w-full hidden xs:block" }, {
|
|
363
|
-
default:
|
|
364
|
-
(u(!0), b(
|
|
365
|
-
key:
|
|
378
|
+
default: g(() => [
|
|
379
|
+
(u(!0), b(I, null, te(t(s), (f) => (u(), B(T, {
|
|
380
|
+
key: f._id.toString(),
|
|
366
381
|
tag: "label",
|
|
367
|
-
onClick: (
|
|
382
|
+
onClick: (U) => C(f)
|
|
368
383
|
}, {
|
|
369
|
-
default:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
384
|
+
default: g(() => [
|
|
385
|
+
a("div", null, [
|
|
386
|
+
a("div", Be, x((f.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
387
|
+
a("div", De, x(f.name), 1),
|
|
388
|
+
a("div", Ye, x(((f.memberCount ?? 0) * 100 / t(r)).toFixed(2)) + "% of customers ", 1)
|
|
374
389
|
])
|
|
375
390
|
]),
|
|
376
|
-
append:
|
|
391
|
+
append: g(() => [
|
|
377
392
|
l(O, { "stop-click-propagation": !0 }, {
|
|
378
|
-
"menu-button":
|
|
393
|
+
"menu-button": g(() => [
|
|
379
394
|
l(M, { name: "more_vert" })
|
|
380
395
|
]),
|
|
381
|
-
default:
|
|
396
|
+
default: g(() => [
|
|
382
397
|
l(H, {
|
|
383
398
|
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
384
399
|
label: "Remove",
|
|
385
|
-
"onUpdate:modelValue": (
|
|
400
|
+
"onUpdate:modelValue": (U) => U && $(f)
|
|
386
401
|
}, null, 8, ["onUpdate:modelValue"])
|
|
387
402
|
]),
|
|
388
403
|
_: 2
|
|
@@ -393,33 +408,33 @@ const _e = ae.extend({
|
|
|
393
408
|
]),
|
|
394
409
|
_: 1
|
|
395
410
|
})
|
|
396
|
-
], 64)) : (u(),
|
|
411
|
+
], 64)) : (u(), B(q, {
|
|
397
412
|
key: 1,
|
|
398
413
|
variant: "outlined",
|
|
399
414
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
400
415
|
}, {
|
|
401
|
-
default:
|
|
402
|
-
e[3] || (e[3] =
|
|
403
|
-
src:
|
|
416
|
+
default: g(() => [
|
|
417
|
+
e[3] || (e[3] = a("img", {
|
|
418
|
+
src: oe,
|
|
404
419
|
class: "aspect-square w-[150px]"
|
|
405
420
|
}, null, -1)),
|
|
406
|
-
e[4] || (e[4] =
|
|
407
|
-
|
|
408
|
-
|
|
421
|
+
e[4] || (e[4] = a("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
422
|
+
a("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
423
|
+
a("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. ")
|
|
409
424
|
], -1)),
|
|
410
425
|
l(Z, {
|
|
411
426
|
variant: "primary",
|
|
412
427
|
label: "Create segment",
|
|
413
428
|
disabled: !t(_).isPremium,
|
|
414
429
|
icon: "add",
|
|
415
|
-
onClick: e[2] || (e[2] = (
|
|
430
|
+
onClick: e[2] || (e[2] = (f) => C())
|
|
416
431
|
}, null, 8, ["disabled"])
|
|
417
432
|
]),
|
|
418
433
|
_: 1
|
|
419
434
|
})),
|
|
420
|
-
l(
|
|
435
|
+
l(Ie, {
|
|
421
436
|
ref_key: "sheetRef",
|
|
422
|
-
ref:
|
|
437
|
+
ref: n,
|
|
423
438
|
"onUpdate:modelValue": Y
|
|
424
439
|
}, null, 512)
|
|
425
440
|
])
|
|
@@ -428,5 +443,5 @@ const _e = ae.extend({
|
|
|
428
443
|
}
|
|
429
444
|
});
|
|
430
445
|
export {
|
|
431
|
-
|
|
446
|
+
et as default
|
|
432
447
|
};
|