@feedmepos/mf-connect 0.0.10-prod → 0.0.11-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.
Files changed (65) hide show
  1. package/dist/{Analytic-BFeicKpw.js → Analytic-CpXLcGWV.js} +7 -7
  2. package/dist/{Broadcast-D0NyeAPC.js → Broadcast-CEMQS5PI.js} +7 -7
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DAUidvXJ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0Kvpl_V.js} +8 -8
  4. package/dist/{Card-DsFHDP5R.js → Card-BqX-aRK9.js} +177 -182
  5. package/dist/{Collections-mc47YFfd.js → Collections-SRmluAj0.js} +102 -84
  6. package/dist/{Credit-TQYanlxz.js → Credit-DdBKFsII.js} +7 -7
  7. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYNpBySQ.js +2600 -0
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-kA-uGqCI.js → EffectSheet.vue_vue_type_style_index_0_lang-admNNBWu.js} +1864 -1830
  9. package/dist/{Experience-CyASWXXY.js → Experience-CSfRrWqI.js} +7 -7
  10. package/dist/Game-BV--qn0e.js +250 -0
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-D-wHmyMe.js → ImageInput.vue_vue_type_script_setup_true_lang-DpYjrT3G.js} +1 -1
  12. package/dist/{MainLayout-zw-S_EV5.js → MainLayout-B_ZXQrMD.js} +1 -1
  13. package/dist/{Marketing-BcmbBw-5.js → Marketing-Bac3EbOu.js} +4 -4
  14. package/dist/{Member-DWRIIPj-.js → Member-CGMRVEuI.js} +2 -2
  15. package/dist/{MemberList-DNG0mNej.js → MemberList-CSyb4bNE.js} +196 -195
  16. package/dist/{MemberTransactions-xdm0zGuQ.js → MemberTransactions-BdraBHg6.js} +2 -2
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Bqs3tfs_.js → MessageInput.vue_vue_type_script_setup_true_lang-BvAFOoym.js} +2 -2
  18. package/dist/Mission-D8-D99g-.js +248 -0
  19. package/dist/Point-BOI4mT-K.js +220 -0
  20. package/dist/{Promotion-DlxqsZFt.js → Promotion-D0MLMo9m.js} +8 -8
  21. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DcLK4o-E.js → RuleGroup.vue_vue_type_script_setup_true_lang-1L68zx5t.js} +58 -58
  22. package/dist/Segment-BeUbkVj7.js +444 -0
  23. package/dist/{Setting-CWftoE15.js → Setting-uM4iKdyM.js} +386 -379
  24. package/dist/{Store-jqibjN4j.js → Store-BkccNTnM.js} +432 -413
  25. package/dist/{StoreRewards-DWbp79R_.js → StoreRewards-BLgP6Mfv.js} +9 -9
  26. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-b21Sy462.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Z0nqQyi8.js} +39 -38
  27. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BUOfEY4s.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C771jjYx.js} +1 -1
  28. package/dist/{Tier-lymEcCqJ.js → Tier-DwKAfz6f.js} +17 -16
  29. package/dist/{Title-CYkql8-l.js → Title-B1_yd9pC.js} +16 -15
  30. package/dist/{Transaction-Ca_AVh3S.js → Transaction-DcVCMUY4.js} +1 -1
  31. package/dist/{Voucher-DX70cORv.js → Voucher-Djvai5vL.js} +9 -9
  32. package/dist/{app-Bpd1FsZZ.js → app-BvizV9z5.js} +2757 -2743
  33. package/dist/app.js +1 -1
  34. package/dist/{campaign-CfsRf50J.js → campaign-BdSwq7MJ.js} +31 -27
  35. package/dist/dto-CkH5Zama.js +1150 -0
  36. package/dist/{effect-CiUKauPm.js → effect-DT4ivttr.js} +1 -1
  37. package/dist/{export-oV5_2WhN.js → export-BAJL8_2G.js} +3 -3
  38. package/dist/{helper-dCIRT9Az.js → helper-CiIZ1pUo.js} +21 -8
  39. package/dist/{index-Qqifr9f8.js → index-7uOMMdXt.js} +245 -184
  40. package/dist/{index-BL_KPUtI.js → index-8nrxC9d5.js} +1 -1
  41. package/dist/{index-De3pocAb.js → index-B5gJ6P15.js} +269 -21
  42. package/dist/{index-DL_XK8dd.js → index-BLWw_MlC.js} +1363 -1341
  43. package/dist/{index-D9opigZA.js → index-C5N8jeJ1.js} +1 -1
  44. package/dist/{index-Dd41k099.js → index-C8dIiNQb.js} +1 -1
  45. package/dist/{index-XTz7nzez.js → index-Ccn7PGoB.js} +268 -267
  46. package/dist/{index-BYvX1Aa7.js → index-CjZxaXvZ.js} +69 -64
  47. package/dist/{index-BgPP5w8f.js → index-DCs4-zXS.js} +7 -17
  48. package/dist/{index-C8kJRh0b.js → index-DMyaEjMn.js} +26 -20
  49. package/dist/{loading-Baon-6K7.js → loading-C1IzY-n2.js} +1312 -1312
  50. package/dist/{lodash-C7zZd2mb.js → lodash-BMQ4xbjY.js} +1 -1
  51. package/dist/membership-D3I4udu3.js +221 -0
  52. package/dist/{money-CI5RX_Uc.js → money-BQEcWGhZ.js} +1 -1
  53. package/dist/{number-BD3GORAT.js → number-DGx2QPUy.js} +1 -1
  54. package/dist/{rule-BnlZjqSN.js → rule-CvlhLEGy.js} +2 -2
  55. package/dist/{rule-builder-Qvpo2dS_.js → rule-builder-Di3qiIBb.js} +1 -1
  56. package/dist/{template-CG_Y7BYa.js → template-D6Abrya4.js} +5 -5
  57. package/dist/{usePagination-BHEEnWBL.js → usePagination-MhbjQgN7.js} +1 -1
  58. package/dist/{xlsx-DQZIpY73.js → xlsx-mL_3T1k3.js} +226 -226
  59. package/package.json +2 -2
  60. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BtEHnivB.js +0 -2002
  61. package/dist/Game-Tek__-5h.js +0 -242
  62. package/dist/Point-C1mfq_Fd.js +0 -211
  63. package/dist/Segment-BLMz7i-L.js +0 -407
  64. package/dist/dto-COz9T0F3.js +0 -1092
  65. package/dist/membership-Cg82yybg.js +0 -210
@@ -1,407 +0,0 @@
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-Baon-6K7.js";
3
- import { components as B } from "@feedmepos/ui-library";
4
- import { l as ee } from "./lodash-C7zZd2mb.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-XTz7nzez.js";
7
- import { u as ne } from "./app-Bpd1FsZZ.js";
8
- import { R as se } from "./rule-builder-Qvpo2dS_.js";
9
- import { _ as le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DcLK4o-E.js";
10
- import { h as D } from "./moment-BWErdI6_.js";
11
- import { u as ie, _ as re } from "./usePagination-BHEEnWBL.js";
12
- import { s as C } from "./membership-Cg82yybg.js";
13
- import { o as me } from "./objectId-dwaoBfJX.js";
14
- import { m as ce } from "./index-Dd41k099.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
- };