@feedmepos/mf-connect 0.0.8 → 0.0.9
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-BxRuK2P2.js → Analytic-CwaN0mge.js} +68 -69
- package/dist/{Broadcast-BqGojAWW.js → Broadcast-Cjx5xzUC.js} +27 -28
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-VzcVMS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4mO5aik.js} +34 -34
- package/dist/Card-DbY6YaXk.js +827 -0
- package/dist/{Collections-DvdDRozp.js → Collections-DRN2gzwh.js} +158 -168
- package/dist/{Credit-BeHm7_2S.js → Credit-DOcrzykJ.js} +11 -12
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js} +359 -333
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js → EffectSheet.vue_vue_type_style_index_0_lang-EF_rHfwT.js} +5 -5
- package/dist/{Experience-CtDY9u4Y.js → Experience-aQj-3H2Y.js} +11 -12
- package/dist/{Game-DjaYuqcb.js → Game-Cnje-m_M.js} +22 -23
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js → ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js} +8 -8
- package/dist/{MainLayout-B-iAZM2k.js → MainLayout-Cxl9yLPs.js} +1 -1
- package/dist/{Marketing-BJJltAh-.js → Marketing-BYUcbcMU.js} +19 -20
- package/dist/{Member-eJ9Pdi5w.js → Member-D7K9fm_Q.js} +2 -2
- package/dist/MemberList-DbXkxUzF.js +1717 -0
- package/dist/{MemberTransactions-DRET8mSQ.js → MemberTransactions-DED1SYwX.js} +4 -4
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js +203 -0
- package/dist/{Point-DPTOgJbC.js → Point-CQm8whVQ.js} +11 -12
- package/dist/{Promotion-wzkRuNqO.js → Promotion-DzVXy_C9.js} +42 -44
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Z06eB5i5.js → RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js} +12 -12
- package/dist/Segment-D3o0D3Uv.js +407 -0
- package/dist/{Setting-CXuZu0-m.js → Setting-pCzenLoL.js} +17 -18
- package/dist/{Store-4Um9keEp.js → Store-DEwEIFYD.js} +18 -19
- package/dist/{StoreRewards-B-UFeyQM.js → StoreRewards-D7vnZN4f.js} +86 -87
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-ALzQU3th.js +793 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js} +1 -1
- package/dist/{Tier-C6KVsxGO.js → Tier-BJbX5CPB.js} +401 -377
- package/dist/{Title-DuN1ahIM.js → Title-C9xV6rBg.js} +274 -248
- package/dist/Transaction-C8OHlhzR.js +36 -0
- package/dist/Voucher-eZwm7N1D.js +481 -0
- package/dist/{app-CxBTTB31.js → app-DgbDbhL-.js} +34 -34
- package/dist/app.js +1 -1
- package/dist/{campaign-B0aXkadj.js → campaign-BkvrUTEJ.js} +2 -2
- package/dist/{dto-BtdVC-Ab.js → dto-YYVhW73A.js} +52 -53
- package/dist/{effect-BUN6rkQM.js → effect-f7DAPYC8.js} +1 -1
- package/dist/export-BXbCXTfd.js +97 -0
- package/dist/{helper-Cpq3x8K5.js → helper-BhvQ9m6d.js} +1 -1
- package/dist/{index-D2Juhkdw.js → index-BhacKx5B.js} +85 -83
- package/dist/{index-DDSLx7vu.js → index-BsEqtUmY.js} +2 -2
- package/dist/{index-0GYrZr4L.js → index-CdtrQ9tR.js} +5 -5
- package/dist/{index-8clzk3uX.js → index-Cfo2A0Se.js} +1 -1
- package/dist/index-Cz5RZlYh.js +73 -0
- package/dist/{index-BTntbYTS.js → index-DQC_1tRF.js} +1 -1
- package/dist/{index-DysVCkrx.js → index-Dd3hrFcQ.js} +3 -3
- package/dist/{index-CK9yJMj7.js → index-FWp9M1yS.js} +5 -5
- package/dist/{index-C6NgUSl2.js → index-VmFlM704.js} +1 -1
- package/dist/{index-BvnZdJBY.js → index-oQLJE4Uw.js} +2 -2
- package/dist/libs/packages/core/src/collectible/collectible.dto.d.ts +6 -0
- package/dist/{plugins-B_d-WFtN.js → loading-DQaawbHE.js} +8204 -8108
- package/dist/{lodash-DsT1nK-T.js → lodash-DzdmTD20.js} +1 -1
- package/dist/{membership-DtD45RXh.js → membership-Dq2-b-S_.js} +3 -3
- package/dist/{money-CFI1TMCS.js → money-vzwOUBrp.js} +1 -1
- package/dist/{number-BBtf4fYz.js → number-CBzs6rfW.js} +1 -1
- package/dist/packages/connect/src/components/campaign/CampaignSummary.vue.d.ts +13 -0
- package/dist/packages/connect/src/composables/export.d.ts +11 -0
- package/dist/packages/connect/src/export/base.export.d.ts +7 -0
- package/dist/packages/connect/src/export/card.export.d.ts +5 -6
- package/dist/packages/connect/src/export/collection-transaction.export.d.ts +14 -0
- package/dist/packages/connect/src/export/index.d.ts +1 -0
- package/dist/packages/connect/src/export/store-transaction.export.d.ts +14 -0
- package/dist/packages/connect/src/helpers/user.d.ts +6 -0
- package/dist/{rule-CB9Qlcx1.js → rule-BR5rrmUV.js} +2 -2
- package/dist/{rule-builder-BIKcA4Bg.js → rule-builder-7GBNrPXt.js} +1 -1
- package/dist/{template-qlb46PGl.js → template-CETJ6lkf.js} +5 -5
- package/dist/{usePagination-CX66ab1Y.js → usePagination-DdZeE4Tt.js} +57 -56
- package/dist/user-Bm4KttFq.js +37 -0
- package/dist/{xlsx-DMaFso0k.js → xlsx-CDAKxZE_.js} +1 -1
- package/package.json +1 -1
- package/dist/Card-Dlj5jQp4.js +0 -792
- package/dist/MemberList-CrhMqUfJ.js +0 -1664
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D-ttMwn2.js +0 -166
- package/dist/Segment-DnsPrP7Q.js +0 -371
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js +0 -660
- package/dist/Transaction-DdfX7Xfe.js +0 -34
- package/dist/Voucher-DarXrxZr.js +0 -454
- package/dist/index-Dg-PMgXV.js +0 -64
- package/dist/loading-Cxp7sI5p.js +0 -100
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { defineComponent as A, onMounted as E, openBlock as p, createElementBlock as x, createElementVNode as s, toDisplayString as k, unref as e, createVNode as i, createCommentVNode as j, ref as w, computed as O, resolveComponent as _, createBlock as P, isRef as K, createSlots as Z, withCtx as h, Fragment as Y, reactive as G, watch as J, onBeforeMount as W, renderList as q, h as $ } from "vue";
|
|
2
|
+
import { F as N, p as Q, u as X } from "./loading-DQaawbHE.js";
|
|
3
|
+
import { components as B } from "@feedmepos/ui-library";
|
|
4
|
+
import { l as ee } from "./lodash-DzdmTD20.js";
|
|
5
|
+
import { _ as te, Z as oe } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
6
|
+
import { a as ae } from "./index-Dd3hrFcQ.js";
|
|
7
|
+
import { u as ne } from "./app-DgbDbhL-.js";
|
|
8
|
+
import { R as se } from "./rule-builder-7GBNrPXt.js";
|
|
9
|
+
import { _ as le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js";
|
|
10
|
+
import { h as D } from "./moment-BWErdI6_.js";
|
|
11
|
+
import { u as ie, _ as re } from "./usePagination-DdZeE4Tt.js";
|
|
12
|
+
import { s as C } from "./membership-Dq2-b-S_.js";
|
|
13
|
+
import { o as me } from "./objectId-dwaoBfJX.js";
|
|
14
|
+
import { m as ce } from "./index-Cz5RZlYh.js";
|
|
15
|
+
const de = ae.extend({
|
|
16
|
+
_id: N.optional(),
|
|
17
|
+
business: N.optional()
|
|
18
|
+
}), ue = { class: "space-y-16 pr-12" }, pe = { class: "fm-typo-en-title-md-800" }, fe = { class: "flex space-x-8" }, ge = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, _e = { class: "text-fm-color-typo-secondary" }, ve = /* @__PURE__ */ s("div", null, "contacts in your segment", -1), he = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "w-full flex flex-col gap-16 items-center pt-16"
|
|
21
|
+
}, ye = /* @__PURE__ */ s("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1), Se = /* @__PURE__ */ s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1), be = [
|
|
22
|
+
ye,
|
|
23
|
+
Se
|
|
24
|
+
], we = /* @__PURE__ */ A({
|
|
25
|
+
__name: "ReviewSegment",
|
|
26
|
+
props: {
|
|
27
|
+
title: {},
|
|
28
|
+
segment: {}
|
|
29
|
+
},
|
|
30
|
+
setup(L) {
|
|
31
|
+
const f = L, y = [
|
|
32
|
+
{
|
|
33
|
+
header: "Name",
|
|
34
|
+
accessorFn: (a) => a.name
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
header: "Customer Since",
|
|
38
|
+
accessorFn: (a) => D(me(a._id.toString())).format("DD MMM YYYY")
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
header: "Birthday",
|
|
42
|
+
accessorFn: (a) => D(a.birthday).format("DD MMM YYYY")
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
header: "Last Visit",
|
|
46
|
+
accessorFn: (a) => D(a.stats.lastVisit).format("DD MMM YYYY")
|
|
47
|
+
}
|
|
48
|
+
], S = async (a) => f.segment._id ? await C.paginateSegmentUsers(f.segment._id, {
|
|
49
|
+
limit: r.value.pageSize,
|
|
50
|
+
skip: a.pageIndex ?? 0,
|
|
51
|
+
sortBy: "_id",
|
|
52
|
+
search: a.searchValue,
|
|
53
|
+
descending: !0
|
|
54
|
+
}) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: r, rowData: c, onSort: F, debouncedFetchData: m, onSearch: n } = ie(S);
|
|
55
|
+
return E(async () => {
|
|
56
|
+
await m();
|
|
57
|
+
}), (a, d) => (p(), x("div", ue, [
|
|
58
|
+
s("div", pe, k(f.title), 1),
|
|
59
|
+
s("div", fe, [
|
|
60
|
+
s("div", ge, k(a.segment.members.length), 1),
|
|
61
|
+
s("div", _e, [
|
|
62
|
+
ve,
|
|
63
|
+
s("div", null, "as of " + k(e(D)(a.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
64
|
+
])
|
|
65
|
+
]),
|
|
66
|
+
i(re, {
|
|
67
|
+
loading: e(r).isLoading,
|
|
68
|
+
"row-data": e(c),
|
|
69
|
+
"row-count": e(r).totalRows,
|
|
70
|
+
"column-defs": y,
|
|
71
|
+
"page-size": e(r).pageSize,
|
|
72
|
+
"page-count": e(r).pageCount,
|
|
73
|
+
"page-index": e(r).pageIndex,
|
|
74
|
+
onSortChange: e(F),
|
|
75
|
+
onPageChange: d[0] || (d[0] = (b) => e(m)({ pageSize: b.pageSize, pageIndex: b.pageIndex }))
|
|
76
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"]),
|
|
77
|
+
e(c).length == 0 ? (p(), x("div", he, be)) : j("", !0)
|
|
78
|
+
]));
|
|
79
|
+
}
|
|
80
|
+
}), xe = { class: "flex items-center gap-x-8" }, Fe = /* @__PURE__ */ s("div", null, "Review segment", -1), Ce = {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "space-y-16 pr-12"
|
|
83
|
+
}, ke = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), Me = { class: "flex items-center gap-8" }, Re = /* @__PURE__ */ A({
|
|
84
|
+
__name: "SegmentSheet",
|
|
85
|
+
emits: ["update:model-value"],
|
|
86
|
+
setup(L, { expose: f, emit: y }) {
|
|
87
|
+
const S = ne(), r = w(!1), c = w(!1), F = {
|
|
88
|
+
name: "",
|
|
89
|
+
rule: se.scaffoldGroup(),
|
|
90
|
+
members: []
|
|
91
|
+
}, m = de, n = w(F), a = O(() => {
|
|
92
|
+
const o = m.safeParse(n.value);
|
|
93
|
+
return o.success ? [] : o.error.errors;
|
|
94
|
+
});
|
|
95
|
+
function d(o) {
|
|
96
|
+
r.value = !0, c.value = !1, o ? n.value = { ...o } : n.value = { ...F };
|
|
97
|
+
}
|
|
98
|
+
function b() {
|
|
99
|
+
r.value = !1;
|
|
100
|
+
}
|
|
101
|
+
async function V() {
|
|
102
|
+
m.safeParse(n.value).success && (c.value = !0);
|
|
103
|
+
}
|
|
104
|
+
function z() {
|
|
105
|
+
c.value = !1;
|
|
106
|
+
}
|
|
107
|
+
async function M() {
|
|
108
|
+
t("update:model-value", n.value);
|
|
109
|
+
}
|
|
110
|
+
E(async () => {
|
|
111
|
+
});
|
|
112
|
+
const t = y;
|
|
113
|
+
return f({
|
|
114
|
+
showSheet: d,
|
|
115
|
+
hideSheet: b
|
|
116
|
+
}), (o, l) => {
|
|
117
|
+
const v = _("FmButton"), R = _("FmSideSheet");
|
|
118
|
+
return p(), P(R, {
|
|
119
|
+
modelValue: e(r),
|
|
120
|
+
"onUpdate:modelValue": l[5] || (l[5] = (g) => K(r) ? r.value = g : null),
|
|
121
|
+
header: "Add segment",
|
|
122
|
+
"dismiss-away": "",
|
|
123
|
+
"close-button": !0,
|
|
124
|
+
"max-width": 1100
|
|
125
|
+
}, Z({
|
|
126
|
+
"side-sheet-footer": h(() => [
|
|
127
|
+
s("div", Me, [
|
|
128
|
+
e(c) ? (p(), x(Y, { key: 0 }, [
|
|
129
|
+
i(v, {
|
|
130
|
+
label: "Save Segment",
|
|
131
|
+
onClick: M,
|
|
132
|
+
loading: e(S).isLoading,
|
|
133
|
+
disabled: e(a).length > 0 || e(S).isLoading
|
|
134
|
+
}, null, 8, ["loading", "disabled"]),
|
|
135
|
+
i(v, {
|
|
136
|
+
label: "Cancel",
|
|
137
|
+
onClick: l[3] || (l[3] = (g) => z()),
|
|
138
|
+
variant: "tertiary"
|
|
139
|
+
})
|
|
140
|
+
], 64)) : (p(), x(Y, { key: 1 }, [
|
|
141
|
+
i(v, {
|
|
142
|
+
label: "Review Segment",
|
|
143
|
+
disabled: e(a).length > 0 || e(S).isLoading,
|
|
144
|
+
onClick: V
|
|
145
|
+
}, null, 8, ["disabled"]),
|
|
146
|
+
i(v, {
|
|
147
|
+
label: "Cancel",
|
|
148
|
+
onClick: l[4] || (l[4] = (g) => b()),
|
|
149
|
+
variant: "tertiary"
|
|
150
|
+
})
|
|
151
|
+
], 64))
|
|
152
|
+
])
|
|
153
|
+
]),
|
|
154
|
+
default: h(() => {
|
|
155
|
+
var g;
|
|
156
|
+
return [
|
|
157
|
+
e(c) ? (p(), P(we, {
|
|
158
|
+
key: 1,
|
|
159
|
+
title: e(n).name,
|
|
160
|
+
segment: e(n)
|
|
161
|
+
}, null, 8, ["title", "segment"])) : (p(), x("div", Ce, [
|
|
162
|
+
i(te, {
|
|
163
|
+
modelValue: e(n).name,
|
|
164
|
+
"onUpdate:modelValue": l[1] || (l[1] = (I) => e(n).name = I),
|
|
165
|
+
label: "Segment title",
|
|
166
|
+
schema: e(oe).typeAtPath(e(m), "name")
|
|
167
|
+
}, null, 8, ["modelValue", "schema"]),
|
|
168
|
+
ke,
|
|
169
|
+
i(le, {
|
|
170
|
+
"trigger-type": "MEMBERSHIP_JOINED",
|
|
171
|
+
includeOnly: "user",
|
|
172
|
+
"model-value": (g = e(n)) == null ? void 0 : g.rule,
|
|
173
|
+
"onUpdate:modelValue": l[2] || (l[2] = (I) => {
|
|
174
|
+
e(n).rule = I;
|
|
175
|
+
})
|
|
176
|
+
}, null, 8, ["model-value"])
|
|
177
|
+
]))
|
|
178
|
+
];
|
|
179
|
+
}),
|
|
180
|
+
_: 2
|
|
181
|
+
}, [
|
|
182
|
+
e(c) ? {
|
|
183
|
+
name: "side-sheet-header",
|
|
184
|
+
fn: h(() => [
|
|
185
|
+
s("div", xe, [
|
|
186
|
+
i(v, {
|
|
187
|
+
icon: "arrow_back",
|
|
188
|
+
variant: "tertiary",
|
|
189
|
+
onClick: l[0] || (l[0] = (g) => c.value = !1)
|
|
190
|
+
}),
|
|
191
|
+
Fe
|
|
192
|
+
])
|
|
193
|
+
]),
|
|
194
|
+
key: "0"
|
|
195
|
+
} : void 0
|
|
196
|
+
]), 1032, ["modelValue"]);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}), Ie = { class: "px-24 flex flex-col gap-y-32 pb-24" }, $e = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Ve = { class: "fm-typo-en-body-md-600" }, De = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Ze = /* @__PURE__ */ A({
|
|
200
|
+
__name: "Segment",
|
|
201
|
+
setup(L) {
|
|
202
|
+
const { minor: f } = X, y = w(0), S = {
|
|
203
|
+
label: "Refresh segments",
|
|
204
|
+
value: "refresh"
|
|
205
|
+
// prependIcon: 'refresh',
|
|
206
|
+
}, r = {
|
|
207
|
+
label: "Add segment",
|
|
208
|
+
value: "add",
|
|
209
|
+
isPrimary: !0,
|
|
210
|
+
prependIcon: "add"
|
|
211
|
+
}, c = [
|
|
212
|
+
{
|
|
213
|
+
header: "Name",
|
|
214
|
+
accessorFn: (t) => t.name
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
header: "Total Customers in this Segment",
|
|
218
|
+
accessorFn: (t) => t.memberCount ?? 0
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
header: "% of customers",
|
|
222
|
+
accessorFn: (t) => ((t.memberCount ?? 0) * 100 / y.value).toFixed(2)
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
header: "Actions",
|
|
226
|
+
meta: {
|
|
227
|
+
maxWidth: "100px"
|
|
228
|
+
},
|
|
229
|
+
cell(t) {
|
|
230
|
+
return $("div", { class: "flex items-center justify-end" }, [
|
|
231
|
+
$(
|
|
232
|
+
B.FmMenu,
|
|
233
|
+
{
|
|
234
|
+
placement: "bottom-end",
|
|
235
|
+
onClick: (o) => {
|
|
236
|
+
o.stopPropagation();
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"menu-button": () => $(B.FmButton, {
|
|
241
|
+
icon: "more_vert",
|
|
242
|
+
iconColor: "neutral-gray-400",
|
|
243
|
+
variant: "tertiary"
|
|
244
|
+
}),
|
|
245
|
+
default: () => [
|
|
246
|
+
$(
|
|
247
|
+
B.FmMenuItem,
|
|
248
|
+
{
|
|
249
|
+
onClick: async (o) => {
|
|
250
|
+
o.stopPropagation(), V(t.row.original);
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
label: $(
|
|
255
|
+
"div",
|
|
256
|
+
{
|
|
257
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
258
|
+
},
|
|
259
|
+
"Remove"
|
|
260
|
+
)
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
]);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
], F = G({ searchKey: "", columnFilters: [] }), m = w({
|
|
270
|
+
searchValue: "",
|
|
271
|
+
pageSize: 10,
|
|
272
|
+
pageCount: 0,
|
|
273
|
+
pageIndex: 0,
|
|
274
|
+
totalRows: 0,
|
|
275
|
+
isLoading: !1
|
|
276
|
+
}), n = w([]), a = w(null), d = async (t) => {
|
|
277
|
+
n.value = [], m.value.isLoading = !0;
|
|
278
|
+
const o = await C.readAll({
|
|
279
|
+
limit: t.pageSize,
|
|
280
|
+
skip: t.pageIndex ?? 0,
|
|
281
|
+
sortBy: "_id",
|
|
282
|
+
search: m.value.searchValue,
|
|
283
|
+
descending: !0
|
|
284
|
+
});
|
|
285
|
+
n.value = o.resources, m.value.totalRows = o.meta.totalResources ?? 0, m.value.pageCount = o.meta.totalPages ?? 0, m.value.isLoading = !1;
|
|
286
|
+
};
|
|
287
|
+
async function b() {
|
|
288
|
+
await f(
|
|
289
|
+
async () => {
|
|
290
|
+
await C.refreshSegments(), await d({ pageSize: 10, pageIndex: 0 });
|
|
291
|
+
},
|
|
292
|
+
{ message: "Refreshing segmentations" }
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
async function V(t) {
|
|
296
|
+
await Q.remove(`Are you sure you want to remove ${t.name}?`) && await f(
|
|
297
|
+
async () => {
|
|
298
|
+
await C.delete(t._id), await d({ pageSize: 10, pageIndex: 0 });
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
message: `Removing ${t.name}`,
|
|
302
|
+
successMessage: `Removed ${t.name} successfully`
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
async function z(t) {
|
|
307
|
+
await f(
|
|
308
|
+
async () => {
|
|
309
|
+
var o;
|
|
310
|
+
if (t._id) {
|
|
311
|
+
const { members: l, _id: v, ...R } = t;
|
|
312
|
+
await C.update(t._id, R);
|
|
313
|
+
} else
|
|
314
|
+
await C.create(t);
|
|
315
|
+
await d({ pageSize: 10, pageIndex: 0 }), (o = a.value) == null || o.hideSheet();
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
message: "Saving segment",
|
|
319
|
+
successMessage: "Segment saved"
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
function M(t) {
|
|
324
|
+
var o;
|
|
325
|
+
(o = a.value) == null || o.showSheet(t);
|
|
326
|
+
}
|
|
327
|
+
return J(
|
|
328
|
+
() => m.value.searchValue,
|
|
329
|
+
ee.debounce(() => {
|
|
330
|
+
d({ pageSize: 10, pageIndex: 0 });
|
|
331
|
+
}, 500)
|
|
332
|
+
), W(async () => {
|
|
333
|
+
const { meta: t } = await ce.read({
|
|
334
|
+
limit: 1,
|
|
335
|
+
skip: 0,
|
|
336
|
+
sortBy: "_id",
|
|
337
|
+
search: m.value.searchValue,
|
|
338
|
+
descending: !1
|
|
339
|
+
});
|
|
340
|
+
y.value = t.totalResources ?? 0, await d({ pageSize: 10, pageIndex: 0 });
|
|
341
|
+
}), (t, o) => {
|
|
342
|
+
const l = _("FmPageHead"), v = _("FmTable"), R = _("FmIcon"), g = _("FmMenuItem"), I = _("FmMenu"), H = _("FmListItem"), T = _("FmList");
|
|
343
|
+
return p(), x(Y, null, [
|
|
344
|
+
i(l, {
|
|
345
|
+
title: "Segments",
|
|
346
|
+
actions: [S, r],
|
|
347
|
+
"onClick:action": o[0] || (o[0] = (u) => u === "add" ? M() : b())
|
|
348
|
+
}, null, 8, ["actions"]),
|
|
349
|
+
s("div", Ie, [
|
|
350
|
+
i(v, {
|
|
351
|
+
class: "xs:hidden",
|
|
352
|
+
"row-data": e(n),
|
|
353
|
+
"column-defs": c,
|
|
354
|
+
"search-value": e(F).searchKey,
|
|
355
|
+
"column-filter": [],
|
|
356
|
+
"hide-footer": !0,
|
|
357
|
+
onRowClick: o[1] || (o[1] = (u) => {
|
|
358
|
+
M(u.original);
|
|
359
|
+
})
|
|
360
|
+
}, null, 8, ["row-data", "search-value"]),
|
|
361
|
+
i(T, { class: "w-full hidden xs:block" }, {
|
|
362
|
+
default: h(() => [
|
|
363
|
+
(p(!0), x(Y, null, q(e(n), (u) => (p(), P(H, {
|
|
364
|
+
key: u._id.toString(),
|
|
365
|
+
tag: "label",
|
|
366
|
+
onClick: (U) => M(u)
|
|
367
|
+
}, {
|
|
368
|
+
default: h(() => [
|
|
369
|
+
s("div", null, [
|
|
370
|
+
s("div", $e, k((u.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
371
|
+
s("div", Ve, k(u.name), 1),
|
|
372
|
+
s("div", De, k(((u.memberCount ?? 0) * 100 / e(y)).toFixed(2)) + "% of customers ", 1)
|
|
373
|
+
])
|
|
374
|
+
]),
|
|
375
|
+
append: h(() => [
|
|
376
|
+
i(I, { "stop-click-propagation": !0 }, {
|
|
377
|
+
"menu-button": h(() => [
|
|
378
|
+
i(R, { name: "more_vert" })
|
|
379
|
+
]),
|
|
380
|
+
default: h(() => [
|
|
381
|
+
i(g, {
|
|
382
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
383
|
+
label: "Remove",
|
|
384
|
+
"onUpdate:modelValue": (U) => U && V(u)
|
|
385
|
+
}, null, 8, ["onUpdate:modelValue"])
|
|
386
|
+
]),
|
|
387
|
+
_: 2
|
|
388
|
+
}, 1024)
|
|
389
|
+
]),
|
|
390
|
+
_: 2
|
|
391
|
+
}, 1032, ["onClick"]))), 128))
|
|
392
|
+
]),
|
|
393
|
+
_: 1
|
|
394
|
+
}),
|
|
395
|
+
i(Re, {
|
|
396
|
+
ref_key: "sheetRef",
|
|
397
|
+
ref: a,
|
|
398
|
+
"onUpdate:modelValue": z
|
|
399
|
+
}, null, 512)
|
|
400
|
+
])
|
|
401
|
+
], 64);
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
export {
|
|
406
|
+
Ze as default
|
|
407
|
+
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { defineComponent as Re, ref as z, computed as oe, onMounted as Fe, resolveComponent as U, openBlock as V, createBlock as pe, withCtx as q, createElementVNode as b, createVNode as T, unref as m, isRef as De, createElementBlock as J, Fragment as ue, createTextVNode as ye, toDisplayString as k, renderList as Te, createCommentVNode as Ie } from "vue";
|
|
2
2
|
import { h as ot } from "./moment-BWErdI6_.js";
|
|
3
3
|
import { useDialog as ke } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as rt } from "./loading-
|
|
5
|
-
import { a as we, l as
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { _ as
|
|
10
|
-
import { _ as
|
|
11
|
-
import {
|
|
12
|
-
import { m as ut } from "./index-C6NgUSl2.js";
|
|
4
|
+
import { a as Ve, u as rt, p as it, f as H } from "./loading-DQaawbHE.js";
|
|
5
|
+
import { a as we, l as xe, u as st } from "./app-DgbDbhL-.js";
|
|
6
|
+
import { u as $e } from "./membership-Dq2-b-S_.js";
|
|
7
|
+
import { h as at } from "./index-CdtrQ9tR.js";
|
|
8
|
+
import { _ as Ne } from "./ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js";
|
|
9
|
+
import { _ as lt } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js";
|
|
10
|
+
import { _ as ct } from "./MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js";
|
|
11
|
+
import { m as ut } from "./index-VmFlM704.js";
|
|
13
12
|
import { o as dt } from "./objectId-dwaoBfJX.js";
|
|
14
13
|
import { a as ft } from "./object-qECH92oz.js";
|
|
15
14
|
var X = {}, gt = function() {
|
|
@@ -1504,12 +1503,12 @@ const rn = { class: "flex items-start" }, sn = /* @__PURE__ */ b("div", null, [
|
|
|
1504
1503
|
], -1), an = { class: "flex flex-col gap-16 mt-16" }, ln = ["src"], cn = /* @__PURE__ */ Re({
|
|
1505
1504
|
__name: "LinkDeviceDialog",
|
|
1506
1505
|
setup(t) {
|
|
1507
|
-
const e = we(), i =
|
|
1506
|
+
const e = we(), i = $e(), r = ke(), o = z(), n = z(), a = on.crmUrl, s = z(), l = oe(() => i.membership), f = oe(() => {
|
|
1508
1507
|
var h, u;
|
|
1509
1508
|
return `https://${(h = l.value) != null && h.url ? l.value.url : (u = l.value) == null ? void 0 : u.business}.${a}`;
|
|
1510
1509
|
});
|
|
1511
1510
|
async function g(h) {
|
|
1512
|
-
const u = await
|
|
1511
|
+
const u = await xe.getOtp(h);
|
|
1513
1512
|
return `${f.value}?link-device=${u.otp}`;
|
|
1514
1513
|
}
|
|
1515
1514
|
async function B(h) {
|
|
@@ -1553,7 +1552,7 @@ const rn = { class: "flex items-start" }, sn = /* @__PURE__ */ b("div", null, [
|
|
|
1553
1552
|
class: "mx-auto",
|
|
1554
1553
|
variant: "plain",
|
|
1555
1554
|
icon: "content_copy",
|
|
1556
|
-
onClick: u[2] || (u[2] = (d) => m(
|
|
1555
|
+
onClick: u[2] || (u[2] = (d) => m(Ve)(m(s)))
|
|
1557
1556
|
})
|
|
1558
1557
|
])
|
|
1559
1558
|
]),
|
|
@@ -1569,10 +1568,10 @@ const dn = { class: "hidden xs:flex items-center justify-between px-16 py-12 bor
|
|
|
1569
1568
|
}, hn = { class: "col-span-2 flex flex-col xs:col-span-3" }, mn = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, "Basic Information", -1), pn = { class: "space-y-24" }, yn = { class: "space-y-8" }, wn = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, "Counter App", -1), bn = { class: "fm-typo-body-lg-400" }, vn = { class: "fm-typo-body-md-400 text-fm-color-typo-secondary" }, Cn = { class: "fm-typo-body-md-400 text-fm-color-typo-secondary" }, En = { class: "space-y-8" }, _n = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, "Advertisement", -1), Bn = { class: "space-y-8" }, An = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, "SMS", -1), Mn = { class: "space-y-8" }, Sn = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, [
|
|
1570
1569
|
/* @__PURE__ */ ye(" Free Credit as Discount "),
|
|
1571
1570
|
/* @__PURE__ */ b("span", { class: "fm-typo-en-body-md-400 text-fm-color-typo-error" }, "*POS v6.56 or above")
|
|
1572
|
-
], -1), Tn = { class: "space-y-8" }, In = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, "Member Card", -1), Nn = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, "Activation Location", -1), Pn = { class: "flex justify-end pb-24" }, Ln = { class: "col-span-1 space-y-8 xs:hidden" }, Un = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-600" }, "Loyalty setting summary", -1), Rn = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Name ", -1), Fn = { class: "fm-typo-en-body-lg-600" }, Dn = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Advertisement ", -1), kn = { class: "fm-typo-en-body-lg-600" }, Vn = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Free Credit as Discount ", -1), xn = { class: "fm-typo-en-body-lg-600" }, $n = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Activated locations ", -1), zn = { class: "fm-typo-en-body-lg-600" },
|
|
1571
|
+
], -1), Tn = { class: "space-y-8" }, In = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, "Member Card", -1), Nn = /* @__PURE__ */ b("div", { class: "fm-typo-en-title-sm-800" }, "Activation Location", -1), Pn = { class: "flex justify-end pb-24" }, Ln = { class: "col-span-1 space-y-8 xs:hidden" }, Un = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-600" }, "Loyalty setting summary", -1), Rn = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Name ", -1), Fn = { class: "fm-typo-en-body-lg-600" }, Dn = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Advertisement ", -1), kn = { class: "fm-typo-en-body-lg-600" }, Vn = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Free Credit as Discount ", -1), xn = { class: "fm-typo-en-body-lg-600" }, $n = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Activated locations ", -1), zn = { class: "fm-typo-en-body-lg-600" }, to = /* @__PURE__ */ Re({
|
|
1573
1572
|
__name: "Setting",
|
|
1574
1573
|
setup(t) {
|
|
1575
|
-
const e =
|
|
1574
|
+
const e = st(), i = we(), r = $e(), { global: o, minor: n } = rt, a = ke(), s = z(), l = z(!1), f = [
|
|
1576
1575
|
(d) => !d || d.length >= 6 || "Invalid URL format, please enter at least 6 characters",
|
|
1577
1576
|
(d) => !d || new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/).test(d) || "Invalid URL format, url should start with a letter or number and can only include lowercase letters, numbers, or hyphens"
|
|
1578
1577
|
], g = un.appUrl, B = oe(() => {
|
|
@@ -1590,13 +1589,13 @@ const dn = { class: "hidden xs:flex items-center justify-between px-16 py-12 bor
|
|
|
1590
1589
|
});
|
|
1591
1590
|
}
|
|
1592
1591
|
async function M(d) {
|
|
1593
|
-
await
|
|
1592
|
+
await it.remove(
|
|
1594
1593
|
"Are you sure you want to unlink this device?",
|
|
1595
1594
|
"Unlink device",
|
|
1596
1595
|
"Unlink"
|
|
1597
1596
|
) && await n(
|
|
1598
1597
|
async () => {
|
|
1599
|
-
await
|
|
1598
|
+
await xe.unregisterDevice(d), await i.readLocationDevices();
|
|
1600
1599
|
},
|
|
1601
1600
|
{
|
|
1602
1601
|
message: "Unlinking device",
|
|
@@ -1678,7 +1677,7 @@ const dn = { class: "hidden xs:flex items-center justify-between px-16 py-12 bor
|
|
|
1678
1677
|
T(C, {
|
|
1679
1678
|
icon: "content_copy",
|
|
1680
1679
|
variant: "tertiary",
|
|
1681
|
-
onClick: c[1] || (c[1] = (E) => m(
|
|
1680
|
+
onClick: c[1] || (c[1] = (E) => m(Ve)(m(B)))
|
|
1682
1681
|
})
|
|
1683
1682
|
]),
|
|
1684
1683
|
_: 1
|
|
@@ -1859,5 +1858,5 @@ const dn = { class: "hidden xs:flex items-center justify-between px-16 py-12 bor
|
|
|
1859
1858
|
}
|
|
1860
1859
|
});
|
|
1861
1860
|
export {
|
|
1862
|
-
|
|
1861
|
+
to as default
|
|
1863
1862
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { defineComponent as G, computed as R, resolveComponent as V, openBlock as h, createBlock as E, withCtx as T, createElementVNode as v, createVNode as r, createElementBlock as P, toDisplayString as de, unref as e, Fragment as J, renderList as te, ref as A, isRef as ue, createCommentVNode as W, reactive as Ie, onMounted as me, watch as ve, toRaw as Re, createTextVNode as oe, h as De } from "vue";
|
|
2
2
|
import { _ as Be } from "./tier-BJDhpH6X.js";
|
|
3
3
|
import { useDialog as Pe, useDialogChild as Ne, components as Ae } from "@feedmepos/ui-library";
|
|
4
|
-
import {
|
|
5
|
-
import { u as Ue, C as le } from "./membership-
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { F as qe, a as Ke, b as We, c as Te } from "./index-BvnZdJBY.js";
|
|
4
|
+
import { d as Q, a as Ee, u as Me, p as ce, n as Oe, f as pe } from "./loading-DQaawbHE.js";
|
|
5
|
+
import { u as Ue, C as le } from "./membership-Dq2-b-S_.js";
|
|
6
|
+
import { a as je, c as $e } from "./object-qECH92oz.js";
|
|
7
|
+
import { d as D, z as L, i as fe, S as Le, u as be, J as he, b as He } from "./app-DgbDbhL-.js";
|
|
8
|
+
import { F as qe, a as Ke, b as We, c as Te } from "./index-oQLJE4Uw.js";
|
|
10
9
|
import { _ as Y, Z as H, g as q, a as K } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
11
|
-
import { _ as ie } from "./lodash-
|
|
12
|
-
import { _ as Je } from "./index-
|
|
13
|
-
import { _ as Ye } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import { _ as ie } from "./lodash-DzdmTD20.js";
|
|
11
|
+
import { _ as Je } from "./index-BhacKx5B.js";
|
|
12
|
+
import { _ as Ye } from "./ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js";
|
|
14
13
|
import { _ as ze } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
15
|
-
import { z as Ge, a as Ze } from "./money-
|
|
16
|
-
import { F as Qe } from "./number-
|
|
17
|
-
import { t as Xe } from "./helper-
|
|
14
|
+
import { z as Ge, a as Ze } from "./money-vzwOUBrp.js";
|
|
15
|
+
import { F as Qe } from "./number-CBzs6rfW.js";
|
|
16
|
+
import { t as Xe } from "./helper-BhvQ9m6d.js";
|
|
18
17
|
import { useRouter as et } from "vue-router";
|
|
19
|
-
import { m as ye } from "./index-
|
|
18
|
+
import { m as ye } from "./index-VmFlM704.js";
|
|
20
19
|
function tt(f) {
|
|
21
20
|
return Q.DineroFactory(f).toUnit();
|
|
22
21
|
}
|
|
@@ -461,7 +460,7 @@ const vt = { class: "space-y-8" }, ht = {
|
|
|
461
460
|
r(i, {
|
|
462
461
|
icon: "content_copy",
|
|
463
462
|
variant: "tertiary",
|
|
464
|
-
onClick: m[2] || (m[2] = (n) => e(
|
|
463
|
+
onClick: m[2] || (m[2] = (n) => e(Ee)(e(t)))
|
|
465
464
|
})
|
|
466
465
|
]),
|
|
467
466
|
_: 1
|
|
@@ -961,7 +960,7 @@ const Dt = /* @__PURE__ */ G({
|
|
|
961
960
|
return Number.isNaN(x) ? 0 : x;
|
|
962
961
|
});
|
|
963
962
|
function X() {
|
|
964
|
-
a.value.taxTotals = c.value, _("update", Te.parse(
|
|
963
|
+
a.value.taxTotals = c.value, _("update", Te.parse(je(a.value)));
|
|
965
964
|
}
|
|
966
965
|
function Z() {
|
|
967
966
|
return ie.cloneDeep(F);
|
|
@@ -1238,7 +1237,7 @@ const Dt = /* @__PURE__ */ G({
|
|
|
1238
1237
|
}, null, -1), Xt = /* @__PURE__ */ v("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
1239
1238
|
/* @__PURE__ */ v("div", { class: "fm-typo-en-title-sm-800" }, "Store bundle"),
|
|
1240
1239
|
/* @__PURE__ */ v("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Add item that you want to let your user spend and get here. It can be bunch of vouchers, benefits, experience and more! ")
|
|
1241
|
-
], -1),
|
|
1240
|
+
], -1), ho = /* @__PURE__ */ G({
|
|
1242
1241
|
__name: "Store",
|
|
1243
1242
|
setup(f) {
|
|
1244
1243
|
const b = {
|
|
@@ -1253,7 +1252,7 @@ const Dt = /* @__PURE__ */ G({
|
|
|
1253
1252
|
value: "create_category",
|
|
1254
1253
|
isPrimary: !0,
|
|
1255
1254
|
prependIcon: "add"
|
|
1256
|
-
}, _ = et(), t = Ue(), { global: p, minor: m } =
|
|
1255
|
+
}, _ = et(), t = Ue(), { global: p, minor: m } = Me, a = Pe(), d = R(() => t.sortedStoreCategories), i = A(), n = A();
|
|
1257
1256
|
async function y(C) {
|
|
1258
1257
|
var $;
|
|
1259
1258
|
C === "setting" ? ($ = i.value) == null || $.showSheet(!0, t.storeOption) : C === "create_category" ? g(-1) : C === "create_reward" && await _.push({ name: He["$connect-STORE_REWARDS"] });
|
|
@@ -1308,7 +1307,7 @@ const Dt = /* @__PURE__ */ G({
|
|
|
1308
1307
|
$ ?? ($ = (c = n.value) == null ? void 0 : c.target.category), U ?? (U = (N = n.value) == null ? void 0 : N.target.index);
|
|
1309
1308
|
const I = $e(d.value), M = I[$];
|
|
1310
1309
|
if (!M) {
|
|
1311
|
-
|
|
1310
|
+
Oe.error("Unexpected error", 2e3);
|
|
1312
1311
|
return;
|
|
1313
1312
|
}
|
|
1314
1313
|
if (C == null) {
|
|
@@ -1420,5 +1419,5 @@ const Dt = /* @__PURE__ */ G({
|
|
|
1420
1419
|
}
|
|
1421
1420
|
});
|
|
1422
1421
|
export {
|
|
1423
|
-
|
|
1422
|
+
ho as default
|
|
1424
1423
|
};
|