@feedmepos/mf-connect 0.1.3-prod → 0.1.5-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 (87) hide show
  1. package/dist/Analytic-CC5xdRtS.js +423 -0
  2. package/dist/{App-DvtYt9h5.js → App-CFLVGljI.js} +276 -275
  3. package/dist/Broadcast-B5OnLTNo.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DoH4RX_Y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6oleems.js} +8 -8
  5. package/dist/Card-Cw9Ts0qN.js +824 -0
  6. package/dist/{Collections-C5-k8WkG.js → Collections-CTEOsTLk.js} +4 -4
  7. package/dist/Credit-Bt2ntvn6.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BaOM6fUL.js} +918 -901
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dxyv9AzJ.js +345 -0
  10. package/dist/Experience-CdiCyjUs.js +221 -0
  11. package/dist/Game-CD07hjmT.js +255 -0
  12. package/dist/Marketing-CodbC8LJ.js +316 -0
  13. package/dist/Member-Cr8ki7-7.js +69 -0
  14. package/dist/{MemberList-CMefeirT.js → MemberList-_-IwGMer.js} +75 -75
  15. package/dist/{MemberTransactions-B9oYdzjR.js → MemberTransactions-B3LWcATC.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B0T7ze7r.js → MessageInput.vue_vue_type_script_setup_true_lang-DF-PHN1Z.js} +2 -2
  17. package/dist/Mission-BqR_oPzu.js +261 -0
  18. package/dist/Point-wI_0oL5d.js +222 -0
  19. package/dist/Promotion-Dx6CD3_V.js +253 -0
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BGM1doWM.js → RuleGroup.vue_vue_type_script_setup_true_lang-DiaYx2vk.js} +15 -15
  21. package/dist/Segment-BzM2a7dM.js +565 -0
  22. package/dist/Setting-C8me75UN.js +1871 -0
  23. package/dist/Store-CT-y0pJ4.js +1530 -0
  24. package/dist/StoreRewards-l5qkiIy-.js +400 -0
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-JumDBZLs.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNyeXIL6.js} +10 -10
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BtBCggcN.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BYwjePth.js} +1 -1
  27. package/dist/{Tier-ms8r2E7c.js → Tier-gHTgMsQ3.js} +470 -445
  28. package/dist/{Title-BBKoBs46.js → Title-DQS7FHaO.js} +298 -282
  29. package/dist/Transaction-D7nTuNwj.js +39 -0
  30. package/dist/Voucher-Dr6IxBlt.js +490 -0
  31. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Jh7OW6Wa.js +141 -0
  32. package/dist/{app-CGgrMOc_.js → app-BCgzIoKj.js} +1 -1
  33. package/dist/app-CbpXeslU.js +5639 -0
  34. package/dist/app.js +4 -3
  35. package/dist/{business-DeMUnCNX.js → business-DDhQna1e.js} +1 -1
  36. package/dist/{campaign-CBszI6An.js → campaign-CGa533e7.js} +2 -2
  37. package/dist/{collection.fn-D4Qgx1aW.js → collection.fn-CalTbTcW.js} +2 -2
  38. package/dist/dto-i36GeVm3.js +2770 -0
  39. package/dist/{effect-2p4_SGbQ.js → effect-DdEyoxWE.js} +1 -1
  40. package/dist/{email-addresses-Bc9od2gA.js → email-addresses-DJkhLbVW.js} +1 -1
  41. package/dist/{export-BK6FgeQO.js → export-g24Ga1Ru.js} +3 -3
  42. package/dist/{helper-DUkKW7uc.js → helper-BILtwZxJ.js} +1 -1
  43. package/dist/{index-Cvbyv9Hx.js → index-61n4HR_9.js} +1 -1
  44. package/dist/{index-AZ8cKg9n.js → index-BOwZO-JV.js} +1 -1
  45. package/dist/{index-M1SmasnI.js → index-BzskWtcd.js} +3 -3
  46. package/dist/{index-CTmiZrHu.js → index-CLA_3YPs.js} +1 -1
  47. package/dist/{index-B9f-K1No.js → index-Ca1erv2G.js} +2 -2
  48. package/dist/{index-BWWnWRpt.js → index-DgfFUabi.js} +2 -2
  49. package/dist/{index-Ci8tkzSn.js → index-GQ4JIFWE.js} +1 -1
  50. package/dist/{index-BFcrfL4W.js → index-ZcMWfKwl.js} +1 -1
  51. package/dist/{index-g4L04WYz.js → index-bkuptzmD.js} +91 -86
  52. package/dist/index-hp-LjMMQ.js +3 -0
  53. package/dist/{index-DRaETKbn.js → index-lYDskqcR.js} +258 -256
  54. package/dist/{index-D4HYMbSu.js → index-p3dozIB_.js} +3 -3
  55. package/dist/{index.esm2017-kvuav0Sd.js → index.esm2017-DeO7Sly1.js} +38 -38
  56. package/dist/{loading-MNCADfHc.js → loading-CqDGv2I6.js} +11 -11
  57. package/dist/{membership-CsbTF-DX.js → membership-aP_8YmFK.js} +3 -3
  58. package/dist/{money-Lo7kavmu.js → money-BmmtBTzl.js} +1 -1
  59. package/dist/{number-BviV2K5O.js → number-By8HkTkQ.js} +1 -1
  60. package/dist/{rule-DKrUrnrM.js → rule-CI2g3FmQ.js} +3 -3
  61. package/dist/{rule-builder-DjPniLk6.js → rule-builder-BCBsbe_y.js} +1 -1
  62. package/dist/{template-DteMEC9C.js → template-CRNz0-Qj.js} +4 -4
  63. package/dist/{usePagination-BKTq-UbV.js → usePagination-D4IC9efy.js} +1 -1
  64. package/dist/vue-i18n-0zlAmAlF.js +2365 -0
  65. package/package.json +7 -4
  66. package/dist/Analytic-DiPWt78u.js +0 -423
  67. package/dist/Broadcast-Dv4XcvBh.js +0 -216
  68. package/dist/Card-DDvwlZF0.js +0 -823
  69. package/dist/Credit-BDQIr_FJ.js +0 -214
  70. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BQzgcn4V.js +0 -344
  71. package/dist/Experience-B9H3tOF0.js +0 -211
  72. package/dist/Game-cy3_ppLO.js +0 -250
  73. package/dist/Marketing-CWXV2n5F.js +0 -309
  74. package/dist/Member-DyTX22Zk.js +0 -92
  75. package/dist/Mission-DxSO3iES.js +0 -248
  76. package/dist/Point-C5UtlqkX.js +0 -220
  77. package/dist/Promotion-DhSGTj-R.js +0 -244
  78. package/dist/Segment-BzI6Ykxp.js +0 -564
  79. package/dist/Setting-SRUWwF9w.js +0 -1870
  80. package/dist/Store-CIrn_7Mh.js +0 -1533
  81. package/dist/StoreRewards-BYc0vgnr.js +0 -429
  82. package/dist/Transaction-IZL9-6fe.js +0 -36
  83. package/dist/Voucher-CIWulmcc.js +0 -485
  84. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  85. package/dist/app-BQvluJk_.js +0 -2974
  86. package/dist/dto-Dtvg93Bz.js +0 -1145
  87. package/dist/index-UR1Lxi0C.js +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-connect",
3
- "version": "0.1.3-prod",
3
+ "version": "0.1.5-prod",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -16,10 +16,10 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@feedmepos/core": "^2.14.6",
19
- "@feedmepos/menu": "1.0.34",
20
- "@feedmepos/mf-common": "1.8.37",
21
19
  "@feedmepos/mf-core-ui": "1.0.18",
22
20
  "@feedmepos/ui-library": "1.3.5",
21
+ "@feedmepos/menu": "1.0.34",
22
+ "@feedmepos/mf-common": "1.12.5",
23
23
  "@types/qrcode": "^1.5.5",
24
24
  "axios": "^1.7.2",
25
25
  "bson-objectid": "^2.0.4",
@@ -29,6 +29,7 @@
29
29
  "dotenv": "^16.4.5",
30
30
  "email-addresses": "^5.0.0",
31
31
  "fabric": "^6.4.2",
32
+ "i18next": "24.2.1",
32
33
  "firebase": "^10.12.4",
33
34
  "lodash": "^4.17.21",
34
35
  "moment": "^2.30.1",
@@ -38,11 +39,13 @@
38
39
  "unplugin-auto-import": "^0.17.8",
39
40
  "uuid": "^10.0.0",
40
41
  "vite-plugin-vue-devtools": "^7.6.4",
42
+ "vue-i18n": "10.0.5",
41
43
  "vue": "^3.4.33",
42
44
  "vue-router": "^4.4.0",
43
45
  "vue3-lottie": "^3.3.0",
44
46
  "xlsx": "^0.18.5",
45
- "zod": "3.22.4"
47
+ "zod": "3.22.4",
48
+ "zod-i18n-map": "2.27.0"
46
49
  },
47
50
  "devDependencies": {
48
51
  "@types/lodash": "^4.17.7",
@@ -1,423 +0,0 @@
1
- import { defineComponent as T, ref as y, watch as X, onMounted as j, resolveComponent as h, openBlock as d, createBlock as S, withCtx as L, createVNode as g, unref as a, createElementVNode as r, createElementBlock as C, Fragment as F, renderList as O, computed as P, toDisplayString as E, isRef as D, createSlots as Y, createCommentVNode as k, createTextVNode as ee, reactive as te, onBeforeMount as ae } from "vue";
2
- import { _ as ne } from "./campaign-CpzFl8Vr.js";
3
- import "./index-D4HYMbSu.js";
4
- import { F as le, C as oe } from "./dto-Dtvg93Bz.js";
5
- import { useRouter as se } from "vue-router";
6
- import { c as B } from "./index-CTmiZrHu.js";
7
- import { _ as ie, Z as re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
8
- import { J as ue } from "./JsonViewer-v8_C7l5N.js";
9
- import { u as ce } from "./loading-MNCADfHc.js";
10
- import { useSnackbar as de } from "@feedmepos/ui-library";
11
- import { u as me } from "./app-wDQR6dpb.js";
12
- import { g as pe } from "./object-qECH92oz.js";
13
- import { u as ve } from "./campaign-CBszI6An.js";
14
- import { u as fe } from "./membership-CsbTF-DX.js";
15
- const _e = { class: "ml-32 flex flex-col" }, ye = /* @__PURE__ */ T({
16
- __name: "CampaignCard",
17
- props: {
18
- title: {},
19
- items: {},
20
- modelValue: {}
21
- },
22
- emits: ["update:model-value"],
23
- setup(A, { emit: w }) {
24
- const u = A, m = w, b = (l) => {
25
- l ? _.value = u.items.map((e) => e.value) : _.value = [], p.value = l, m("update:model-value", _.value);
26
- }, f = (l) => {
27
- _.value = l, p.value = l.length === u.items.length, m("update:model-value", l);
28
- }, p = y(!1), _ = y([]);
29
- return X(
30
- () => u.modelValue,
31
- () => {
32
- _.value = u.modelValue.filter(
33
- (l) => u.items.find((e) => e.value === l)
34
- );
35
- }
36
- ), j(() => {
37
- _.value = u.modelValue.filter(
38
- (l) => u.items.find((e) => e.value === l)
39
- );
40
- }), (l, e) => {
41
- const o = h("FmCheckbox"), n = h("FmCard");
42
- return d(), S(n, {
43
- variant: "outlined",
44
- class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
45
- }, {
46
- default: L(() => [
47
- g(o, {
48
- "model-value": a(p),
49
- value: "1",
50
- label: u.title,
51
- indeterminate: a(_).length > 0,
52
- "onUpdate:modelValue": b
53
- }, null, 8, ["model-value", "label", "indeterminate"]),
54
- r("div", _e, [
55
- (d(!0), C(F, null, O(u.items, (s, V) => (d(), S(o, {
56
- key: V,
57
- "model-value": a(_),
58
- label: s.label,
59
- value: s.value,
60
- "onUpdate:modelValue": f
61
- }, null, 8, ["model-value", "label", "value"]))), 128))
62
- ])
63
- ]),
64
- _: 1
65
- });
66
- };
67
- }
68
- }), ge = { class: "space-y-16" }, he = { class: "flex items-center" }, be = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, xe = { class: "space-y-[40px]" }, Ce = /* @__PURE__ */ T({
69
- __name: "LinkCampaign",
70
- props: {
71
- modelValue: {
72
- type: Array,
73
- required: !0
74
- },
75
- campaigns: {
76
- type: Object,
77
- required: !0
78
- }
79
- },
80
- emits: ["update:model-value"],
81
- setup(A, { emit: w }) {
82
- const u = y(""), m = y([]), b = A, f = w, p = P(() => Object.entries(b.campaigns).reduce((l, [e, o]) => {
83
- const n = o.filter(
84
- (s) => s.label.toLowerCase().includes(u.value.toLowerCase())
85
- );
86
- return n.length > 0 && (l[e] = n), l;
87
- }, {}));
88
- function _(l, e) {
89
- m.value = m.value.filter(
90
- (o) => !e.map((n) => n.value).includes(o)
91
- ), m.value = [.../* @__PURE__ */ new Set([...m.value, ...l])], f("update:model-value", m.value);
92
- }
93
- return j(() => {
94
- m.value = b.modelValue;
95
- }), (l, e) => {
96
- const o = h("FmTextField");
97
- return d(), C(F, null, [
98
- g(ue, { json: A.campaigns }, null, 8, ["json"]),
99
- r("div", ge, [
100
- r("div", he, [
101
- r("div", be, E(a(m).length) + " campaign(s) linked ", 1),
102
- g(o, {
103
- modelValue: a(u),
104
- "onUpdate:modelValue": e[0] || (e[0] = (n) => D(u) ? u.value = n : null),
105
- "prepend-icon": "search",
106
- placeholder: "Search",
107
- class: "w-full"
108
- }, null, 8, ["modelValue"])
109
- ]),
110
- r("div", xe, [
111
- (d(!0), C(F, null, O(a(p), (n, s) => (d(), S(ye, {
112
- "model-value": a(m),
113
- title: s,
114
- items: n,
115
- "onUpdate:modelValue": (V) => _(V, n)
116
- }, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
117
- ])
118
- ])
119
- ], 64);
120
- };
121
- }
122
- }), ke = { class: "flex items-center gap-x-8" }, Ve = {
123
- key: 0,
124
- class: "space-y-16 pr-12"
125
- }, Se = /* @__PURE__ */ r("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1), we = /* @__PURE__ */ r("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1), Fe = { class: "flex items-center gap-x-16" }, Ae = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, $e = { class: "mt-16" }, Ue = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, Le = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Pe = { class: "flex items-center gap-8" }, Ge = /* @__PURE__ */ T({
126
- __name: "AnalyticSheet",
127
- emits: ["success"],
128
- setup(A, { expose: w, emit: u }) {
129
- const m = u, b = me();
130
- de();
131
- const f = y(!1), p = y(!1), _ = {
132
- name: "",
133
- campaigns: []
134
- }, l = y(""), e = y({ ..._ }), o = le.superRefine((i, t) => {
135
- }), n = y([]), s = y(null), { global: V, minor: $ } = ce, U = P(() => {
136
- const i = o.safeParse(e.value);
137
- return i.success ? [] : i.error.errors;
138
- });
139
- function H(i) {
140
- var t;
141
- f.value = !0, i ? (s.value = { ...i }, e.value = { ...i, campaigns: (t = i.pf_campaigns) == null ? void 0 : t.map((c) => c._id) }) : (s.value = null, e.value = { ..._ });
142
- }
143
- function M() {
144
- f.value = !1, s.value = null;
145
- }
146
- function K() {
147
- p.value = !0;
148
- }
149
- async function W() {
150
- const i = await B.readAll({
151
- limit: 1e3,
152
- skip: 0,
153
- sortBy: "_id",
154
- search: "",
155
- descending: !0
156
- });
157
- n.value = i.resources.filter(
158
- (t) => !["MEMBERSHIP", "REWARD_POOL"].includes(t.type) && !["ISSUE_REWARD"].includes("event" in t ? t == null ? void 0 : t.event.type : "")
159
- );
160
- }
161
- const I = P(() => {
162
- const i = (c) => c.map((x) => ({
163
- label: x.name,
164
- value: x._id
165
- }));
166
- return pe(
167
- n.value,
168
- (c) => oe.formattedType(c.type),
169
- i
170
- );
171
- }), q = P(() => Object.entries(I.value).reduce(
172
- (i, [t, c]) => {
173
- const x = c.filter((G) => {
174
- var R, v;
175
- return (v = (R = e.value) == null ? void 0 : R.campaigns) == null ? void 0 : v.includes(G.value);
176
- }).filter(
177
- (G) => G.label.toLowerCase().includes(l.value.toLowerCase())
178
- );
179
- return x.length > 0 && (i[t] = x), i;
180
- },
181
- {}
182
- ));
183
- function J(i) {
184
- var c, x;
185
- const t = (c = e.value.campaigns) == null ? void 0 : c.indexOf(i);
186
- t != null && t > -1 && ((x = e.value.campaigns) == null || x.splice(t, 1));
187
- }
188
- async function Z() {
189
- o.safeParse(e.value).success && await $(
190
- async () => {
191
- var t;
192
- s.value ? await B.updateGroup(
193
- (t = s.value) == null ? void 0 : t._id,
194
- e.value
195
- ) : await B.createGroup(e.value), m("success"), M();
196
- },
197
- {
198
- message: "Saving group",
199
- successMessage: "Group saved"
200
- }
201
- );
202
- }
203
- async function z() {
204
- await $(
205
- async () => {
206
- var i;
207
- await B.deleteGroup((i = s.value) == null ? void 0 : i._id), m("success"), M();
208
- },
209
- {
210
- message: "Deleting group",
211
- successMessage: "Group deleted"
212
- }
213
- );
214
- }
215
- return j(async () => {
216
- await W();
217
- }), w({
218
- showSheet: H,
219
- hideSheet: M
220
- }), (i, t) => {
221
- const c = h("FmButton"), x = h("FmTextField"), G = h("FmList"), R = h("FmSideSheet");
222
- return d(), S(R, {
223
- modelValue: a(f),
224
- "onUpdate:modelValue": t[7] || (t[7] = (v) => D(f) ? f.value = v : null),
225
- header: a(s) ? "Edit group" : "Add group",
226
- "dismiss-away": "",
227
- "close-button": !0,
228
- "max-width": 550
229
- }, Y({
230
- "side-sheet-footer": L(() => [
231
- r("div", Pe, [
232
- a(p) ? k("", !0) : (d(), C(F, { key: 0 }, [
233
- g(c, {
234
- label: "Submit",
235
- onClick: Z,
236
- disabled: a(U).length > 0 || a(b).isLoading
237
- }, null, 8, ["disabled"]),
238
- g(c, {
239
- label: "Cancel",
240
- onClick: t[4] || (t[4] = (v) => M()),
241
- variant: "tertiary"
242
- }),
243
- a(s) ? (d(), S(c, {
244
- key: 0,
245
- label: "Delete",
246
- variant: "plain",
247
- class: "ml-auto fm-color-system-error-300",
248
- onClick: t[5] || (t[5] = (v) => z())
249
- })) : k("", !0)
250
- ], 64)),
251
- a(p) ? (d(), S(c, {
252
- key: 1,
253
- label: "Confirm",
254
- onClick: t[6] || (t[6] = (v) => p.value = !1)
255
- })) : k("", !0)
256
- ])
257
- ]),
258
- default: L(() => [
259
- a(p) ? k("", !0) : (d(), C("div", Ve, [
260
- Se,
261
- g(ie, {
262
- modelValue: a(e).name,
263
- "onUpdate:modelValue": t[1] || (t[1] = (v) => a(e).name = v),
264
- label: "Name",
265
- schema: a(re).typeAtPath(a(o), "name")
266
- }, null, 8, ["modelValue", "schema"]),
267
- we,
268
- r("div", Fe, [
269
- r("div", Ae, E(a(e).campaigns.length) + " campaign(s) linked ", 1),
270
- g(x, {
271
- modelValue: a(l),
272
- "onUpdate:modelValue": t[2] || (t[2] = (v) => D(l) ? l.value = v : null),
273
- "prepend-icon": "search",
274
- placeholder: "Search",
275
- class: "w-auto"
276
- }, null, 8, ["modelValue"])
277
- ]),
278
- g(c, {
279
- variant: "plain",
280
- icon: "link",
281
- label: "Link Campaign",
282
- onClick: K
283
- })
284
- ])),
285
- a(p) ? (d(), S(Ce, {
286
- key: 1,
287
- modelValue: a(e).campaigns,
288
- "onUpdate:modelValue": t[3] || (t[3] = (v) => a(e).campaigns = v),
289
- campaigns: a(I)
290
- }, null, 8, ["modelValue", "campaigns"])) : k("", !0),
291
- r("div", $e, [
292
- a(p) ? k("", !0) : (d(!0), C(F, { key: 0 }, O(a(q), (v, Q) => (d(), C("div", null, [
293
- r("div", Ue, E(Q), 1),
294
- g(G, { separator: !0 }, {
295
- default: L(() => [
296
- (d(!0), C(F, null, O(v, (N) => (d(), C("div", Le, [
297
- r("div", null, E(N.label), 1),
298
- r("div", null, [
299
- g(c, {
300
- icon: "delete",
301
- onClick: (Te) => J(N.value),
302
- variant: "tertiary"
303
- }, null, 8, ["onClick"])
304
- ])
305
- ]))), 256))
306
- ]),
307
- _: 2
308
- }, 1024)
309
- ]))), 256))
310
- ])
311
- ]),
312
- _: 2
313
- }, [
314
- a(p) ? {
315
- name: "side-sheet-header",
316
- fn: L(() => [
317
- r("div", ke, [
318
- g(c, {
319
- icon: "arrow_back",
320
- variant: "tertiary",
321
- onClick: t[0] || (t[0] = (v) => p.value = !1)
322
- }),
323
- ee("Link campaign ")
324
- ])
325
- ]),
326
- key: "0"
327
- } : void 0
328
- ]), 1032, ["modelValue", "header"]);
329
- };
330
- }
331
- }), Be = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Me = { class: "space-y-16" }, Re = { class: "flex items-center justify-end" }, Ee = /* @__PURE__ */ r("img", {
332
- src: ne,
333
- class: "w-[150px]"
334
- }, null, -1), Oe = /* @__PURE__ */ r("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Analytics Dashboard Temporarily Unavailable ", -1), De = /* @__PURE__ */ r("div", { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, " We apologize for the inconvenience. The analytics dashboard is currently under maintenance to improve your experience. Please check back later for updates on system availability. ", -1), tt = /* @__PURE__ */ T({
335
- __name: "Analytic",
336
- setup(A) {
337
- const w = {
338
- label: "Add group",
339
- value: "create",
340
- isPrimary: !0,
341
- prependIcon: "add"
342
- }, u = ve(), m = y(), b = y([]), f = y("");
343
- te({
344
- totalCampaign: 0,
345
- totalProgram: 0,
346
- totalMember: 0
347
- });
348
- const p = y("1");
349
- function _(o) {
350
- var n;
351
- p.value = (/* @__PURE__ */ new Date()).toISOString(), (n = m.value) == null || n.showSheet(o);
352
- }
353
- async function l() {
354
- await u.readGroups();
355
- const o = await B.readAllGrouped({
356
- limit: 100,
357
- skip: 0,
358
- sortBy: "_id",
359
- search: "",
360
- descending: !0
361
- });
362
- b.value = o.resources;
363
- }
364
- P(() => b.value.filter((o) => {
365
- var n;
366
- return o.name.includes(f.value) || ((n = o.pf_campaigns) == null ? void 0 : n.filter((s) => s.name.includes(f.value)).length);
367
- }));
368
- const e = fe();
369
- return se(), y(!0), P(() => {
370
- var o, n, s, V;
371
- return !e.storeOption || !e.storeOption.company ? -1 : !e.payoutAccount || !e.payoutAccount.enable || e.payoutAccount.status != "APPROVED" ? 0 : (n = (o = e.store) == null ? void 0 : o.categories) != null && n.length ? (V = (s = e.store) == null ? void 0 : s.categories) != null && V.some(
372
- ($) => $.bundles.some((U) => U.isFeedvibe)
373
- ) ? 3 : 2 : 1;
374
- }), ae(async () => {
375
- await e.readMemberStore(), await e.readMembership(), await e.readPayoutAccount();
376
- }), (o, n) => {
377
- const s = h("FmPageHead"), V = h("FmSearch"), $ = h("FmCard");
378
- return h("FmButton"), h("FmIcon"), d(), C(F, null, [
379
- g(s, {
380
- title: "Analytic",
381
- actions: a(b).length > 0 ? [w] : [],
382
- "onClick:action": n[0] || (n[0] = (U) => _())
383
- }, null, 8, ["actions"]),
384
- r("div", Be, [
385
- r("div", Me, [
386
- r("div", Re, [
387
- g(V, {
388
- class: "xs:hidden",
389
- modelValue: a(f),
390
- "onUpdate:modelValue": n[1] || (n[1] = (U) => D(f) ? f.value = U : null),
391
- placeholder: "Search",
392
- collapsible: ""
393
- }, null, 8, ["modelValue"])
394
- ]),
395
- k("", !0)
396
- ]),
397
- k("", !0),
398
- a(b).length ? k("", !0) : (d(), S($, {
399
- key: 1,
400
- variant: "outlined",
401
- class: "flex flex-col gap-y-24 items-center p-16"
402
- }, {
403
- default: L(() => [
404
- Ee,
405
- Oe,
406
- De
407
- ]),
408
- _: 1
409
- })),
410
- k("", !0),
411
- g(Ge, {
412
- ref_key: "sheetRef",
413
- ref: m,
414
- onSuccess: l
415
- }, null, 512)
416
- ])
417
- ], 64);
418
- };
419
- }
420
- });
421
- export {
422
- tt as default
423
- };
@@ -1,216 +0,0 @@
1
- import { defineComponent as P, ref as g, computed as U, onMounted as M, resolveComponent as l, openBlock as i, createElementBlock as f, Fragment as _, createVNode as r, unref as a, createElementVNode as s, withCtx as h, renderList as j, createBlock as w, resolveDynamicComponent as E, toDisplayString as C, createCommentVNode as H, h as q } from "vue";
2
- import { _ as z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { u as Q, p as W } from "./loading-MNCADfHc.js";
5
- import { u as X } from "./business-DeMUnCNX.js";
6
- import { u as Y } from "./campaign-CBszI6An.js";
7
- import { g as F, a as k } from "./dto-Dtvg93Bz.js";
8
- import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js";
10
- import { u as te } from "./template-DteMEC9C.js";
11
- import { c as y } from "./index-CTmiZrHu.js";
12
- const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ne = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ie = { class: "space-y-4" }, ce = { class: "fm-typo-en-body-lg-600" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { key: 0 }, ue = /* @__PURE__ */ s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1), pe = [
13
- ue
14
- ], fe = /* @__PURE__ */ s("img", {
15
- src: z,
16
- class: "aspect-square w-[150px]"
17
- }, null, -1), ye = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
18
- /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, " Create your broadcast campaign "),
19
- /* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Broadcasting allows you to send text messages to all your customers, informing them about new deals, events, or important updates. ")
20
- ], -1), Ae = /* @__PURE__ */ P({
21
- __name: "Broadcast",
22
- setup(ge) {
23
- const A = {
24
- label: "Create campaign",
25
- value: "create",
26
- isPrimary: !0,
27
- prependIcon: "add"
28
- }, V = te("BROADCAST", G()), R = X(), c = Y(), { global: D, minor: b } = Q, L = g((/* @__PURE__ */ new Date()).toISOString()), n = g({
29
- searchKey: "",
30
- location: null
31
- }), u = U(
32
- () => c.campaigns.broadcast.filter(
33
- (e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
34
- )
35
- ), T = [
36
- {
37
- header: "Broadcast title",
38
- accessorFn: (e) => e.name
39
- },
40
- {
41
- header: "Status",
42
- cell(e) {
43
- return F(e.row.original);
44
- }
45
- },
46
- {
47
- header: "Summary",
48
- accessorFn: (e) => k(e)
49
- },
50
- {
51
- header: "Message sent",
52
- accessorFn: (e) => e.currentReceive ?? "N/A"
53
- },
54
- {
55
- header: "Actions",
56
- cell(e) {
57
- return q(J.FmButton, {
58
- variant: "tertiary",
59
- icon: "delete",
60
- iconColor: "neutral-gray-400",
61
- onClick: (o) => {
62
- o.stopPropagation(), x(e.row.original);
63
- }
64
- });
65
- }
66
- }
67
- ], v = g();
68
- async function x(e) {
69
- await W.remove(`Are you sure you want to remove ${e.name}?`) && await b(
70
- async () => {
71
- await y.delete(e._id), await c.read("BROADCAST");
72
- },
73
- {
74
- message: `Removing ${e.name}`,
75
- successMessage: `Removed ${e.name} successfully`
76
- }
77
- );
78
- }
79
- async function p(e) {
80
- L.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await o() : V.open(async (m) => {
81
- await o(m);
82
- });
83
- async function o(m) {
84
- var d;
85
- (d = v.value) == null || d.showSheet(
86
- !0,
87
- "BROADCAST",
88
- e ? await y.readById(e._id) : void 0,
89
- m
90
- );
91
- }
92
- }
93
- async function $(e) {
94
- await b(
95
- async () => {
96
- e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await c.read("BROADCAST");
97
- },
98
- {
99
- message: `${e.campaign._id ? "Updating" : "Creating"} broadcast`,
100
- successMessage: `Broadcast ${e.campaign._id ? "updated" : "created"} successfully`
101
- }
102
- );
103
- }
104
- return M(async () => {
105
- await D(async () => {
106
- await c.read("BROADCAST");
107
- });
108
- }), (e, o) => {
109
- const m = l("FmPageHead"), d = l("FmSearch"), K = l("FmTable"), S = l("FmButton"), I = l("FmListItem"), O = l("FmList"), N = l("FmCard");
110
- return i(), f(_, null, [
111
- r(m, {
112
- title: "Broadcast",
113
- actions: a(u).length > 0 ? [A] : [],
114
- "onClick:action": o[0] || (o[0] = () => p())
115
- }, null, 8, ["actions"]),
116
- s("div", oe, [
117
- r(d, {
118
- modelValue: a(n).searchKey,
119
- "onUpdate:modelValue": o[1] || (o[1] = (t) => a(n).searchKey = t),
120
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
121
- placeholder: "search",
122
- collapsible: ""
123
- }, null, 8, ["modelValue"]),
124
- a(c).campaigns.broadcast && a(c).campaigns.broadcast.length > 0 ? (i(), f(_, { key: 0 }, [
125
- s("div", ae, [
126
- s("div", se, [
127
- r(Z, {
128
- modelValue: a(n).location,
129
- "onUpdate:modelValue": o[2] || (o[2] = (t) => a(n).location = t),
130
- label: "Location: ",
131
- "show-item-label": !0,
132
- icon: "storefront",
133
- placement: "bottom-start",
134
- items: a(R).locationItems
135
- }, null, 8, ["modelValue", "items"])
136
- ]),
137
- r(d, {
138
- modelValue: a(n).searchKey,
139
- "onUpdate:modelValue": o[3] || (o[3] = (t) => a(n).searchKey = t),
140
- class: "xs:hidden",
141
- placeholder: "search",
142
- collapsible: ""
143
- }, null, 8, ["modelValue"])
144
- ]),
145
- r(K, {
146
- class: "xs:hidden",
147
- "row-data": a(u),
148
- "column-defs": T,
149
- "search-value": a(n).searchKey,
150
- "column-filter": [],
151
- onRowClick: o[4] || (o[4] = (t) => p(t.original)),
152
- "hide-footer": !0
153
- }, null, 8, ["row-data", "search-value"]),
154
- r(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
155
- default: h(() => [
156
- (i(!0), f(_, null, j(a(u).filter(
157
- (t) => t.name.toLowerCase().includes(a(n).searchKey.toLowerCase())
158
- ), (t) => (i(), w(I, {
159
- key: t._id.toString(),
160
- onClick: (B) => p(t),
161
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
162
- }, {
163
- default: h(() => [
164
- s("div", ne, [
165
- s("div", re, [
166
- (i(), w(E(a(F)(t)))),
167
- s("div", le, C(t.currentReceive ?? 0) + " sent ", 1)
168
- ]),
169
- s("div", ie, [
170
- s("div", ce, C(t.name), 1),
171
- s("div", me, C(a(k)(t)), 1)
172
- ])
173
- ]),
174
- r(S, {
175
- icon: "delete",
176
- "icon-color": "neutral-gray-400",
177
- variant: "tertiary",
178
- onClick: (B) => (B.stopPropagation(), x(t))
179
- }, null, 8, ["onClick"])
180
- ]),
181
- _: 2
182
- }, 1032, ["onClick"]))), 128))
183
- ]),
184
- _: 1
185
- }),
186
- a(u).length == 0 ? (i(), f("div", de, pe)) : H("", !0)
187
- ], 64)) : (i(), w(N, {
188
- key: 1,
189
- variant: "outlined",
190
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
191
- }, {
192
- default: h(() => [
193
- fe,
194
- ye,
195
- r(S, {
196
- variant: "primary",
197
- label: "Create broadcast campaign",
198
- icon: "add",
199
- onClick: o[5] || (o[5] = (t) => p())
200
- })
201
- ]),
202
- _: 1
203
- })),
204
- r(ee, {
205
- ref_key: "sheetRef",
206
- ref: v,
207
- "onSubmit:modelValue": $
208
- }, null, 512)
209
- ])
210
- ], 64);
211
- };
212
- }
213
- });
214
- export {
215
- Ae as default
216
- };