@feedmepos/mf-connect 0.1.57-prod → 0.1.58-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 (128) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-BqvhYgCU.js +0 -427
  3. package/dist/App-Dtl_D0cH.js +0 -4630
  4. package/dist/Bin-y4ikpgPS.js +0 -166
  5. package/dist/Broadcast-DSROFwe4.js +0 -233
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CcsG6vOP.js +0 -121
  7. package/dist/Card-BiSEPsZb.js +0 -911
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-CX-nN7Xj.js +0 -458
  10. package/dist/Credit-IiV9b4cB.js +0 -228
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.js +0 -2194
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-sGh_SMCH.js +0 -348
  14. package/dist/Experience-Cf-EMhKy.js +0 -229
  15. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  17. package/dist/Game-C8mfJn6W.js +0 -284
  18. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
  19. package/dist/Index-DkvO1AoT.js +0 -259
  20. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  21. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  22. package/dist/MainLayout-B1aJoR95.js +0 -41
  23. package/dist/Marketing-xJTIo3RF.js +0 -319
  24. package/dist/Member-DZkYoKW8.js +0 -279
  25. package/dist/MemberList-CAYEJnf3.js +0 -1607
  26. package/dist/MemberOverview-wL_ailso.js +0 -58
  27. package/dist/MemberTransactions-Dc5aAQ69.js +0 -45
  28. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BSvlPzw8.js +0 -60553
  29. package/dist/Mission-C_NbNWZw.js +0 -302
  30. package/dist/Overview-DyxEwEfe.js +0 -1079
  31. package/dist/Point-CsEWk61V.js +0 -232
  32. package/dist/Promotion--pWgy9Dx.js +0 -289
  33. package/dist/Queue-k3qAQR7B.js +0 -260
  34. package/dist/Record-D5F5JyVA.js +0 -341
  35. package/dist/Reward-3FSrq5mX.js +0 -442
  36. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Dzj7a7UY.js +0 -150
  37. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DRl_Gjfx.js +0 -1763
  38. package/dist/Segment-BWJn6ODR.js +0 -882
  39. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BKsV_zcr.js +0 -181
  40. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3efGNC_.js +0 -188
  41. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cj7c2V3h.js +0 -147
  42. package/dist/Setting-UiTXazZV.js +0 -1936
  43. package/dist/Store-BrvmHPCX.js +0 -1842
  44. package/dist/StoreRewards-D_7fr-Ef.js +0 -423
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BXy0L5AH.js +0 -995
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DumcDlBs.js +0 -139
  47. package/dist/Tier-C4wvx8F7.js +0 -895
  48. package/dist/Title-CPHT85Uj.js +0 -566
  49. package/dist/Transaction-6Ig2W00P.js +0 -39
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DknFkIJh.js +0 -130
  51. package/dist/Voucher-Bbl-7gZ5.js +0 -384
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-xsswRZG8.js +0 -419
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js +0 -56
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  56. package/dist/app-BDVZwARN.js +0 -7057
  57. package/dist/app-CAEhNFRG.js +0 -57962
  58. package/dist/app-wDQR6dpb.js +0 -39
  59. package/dist/app.js +0 -6
  60. package/dist/business-6C_ol5wd.js +0 -82
  61. package/dist/campaign-B13G6pZ3.js +0 -1810
  62. package/dist/campaign-CpzFl8Vr.js +0 -4
  63. package/dist/campaign-DrQp6qBu.js +0 -94
  64. package/dist/campaign.enum-DnTrlaNC.js +0 -20
  65. package/dist/campaign.fn-BZse90_k.js +0 -758
  66. package/dist/collectible.enum-633Me0yR.js +0 -19
  67. package/dist/collection.fn-C96855j5.js +0 -26
  68. package/dist/dto-2bMujqmZ.js +0 -216
  69. package/dist/effect-C7lAJwKh.js +0 -78
  70. package/dist/email-addresses-3ayN-9jv.js +0 -705
  71. package/dist/export-BNbDV7SC.js +0 -97
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-CsfZ__dQ.js +0 -71
  74. package/dist/index-BLSAz0gK.js +0 -32
  75. package/dist/index-BY9I3Cer.js +0 -3
  76. package/dist/index-BdnRNcVO.js +0 -146
  77. package/dist/index-BmyNfpfG.js +0 -30076
  78. package/dist/index-CSBRkhKy.js +0 -38
  79. package/dist/index-Cf_fcvoS.js +0 -54
  80. package/dist/index-CqrO13uj.js +0 -76
  81. package/dist/index-CuvNtC_M.js +0 -61
  82. package/dist/index-D4kdSzs9.js +0 -3070
  83. package/dist/index-DcJq7tl4.js +0 -32269
  84. package/dist/index-DdjSIwSL.js +0 -44
  85. package/dist/index-LKr2k8J2.js +0 -8861
  86. package/dist/index-XAxwm-1v.js +0 -2130
  87. package/dist/index-b82LrGSB.js +0 -121
  88. package/dist/index-tcAb0W5F.js +0 -31
  89. package/dist/index-vh86FiIQ.js +0 -10
  90. package/dist/index.esm2017-BklqmujQ.js +0 -3069
  91. package/dist/loading-OXARGiqO.js +0 -71
  92. package/dist/lodash-B5I3zXaY.js +0 -3678
  93. package/dist/membership-D1Vb1rUo.js +0 -235
  94. package/dist/moment-D7p2TMB-.js +0 -2583
  95. package/dist/money-BpyAytEq.js +0 -15
  96. package/dist/number-C-PtPOOj.js +0 -12
  97. package/dist/object-qECH92oz.js +0 -26
  98. package/dist/objectId-dwaoBfJX.js +0 -7
  99. package/dist/objectid-BrLIKTmQ.js +0 -145
  100. package/dist/plugins-CjPWhNb2.js +0 -208
  101. package/dist/reward-DonQFzvW.js +0 -36
  102. package/dist/rule-AtNPBnbE.js +0 -1951
  103. package/dist/rule-builder-C0Q-3g6T.js +0 -102
  104. package/dist/style.css +0 -4
  105. package/dist/template-CNjE7eht.js +0 -190
  106. package/dist/tier-BJDhpH6X.js +0 -4
  107. package/dist/tiers/tier=1.png +0 -0
  108. package/dist/tiers/tier=2.png +0 -0
  109. package/dist/tiers/tier=3.png +0 -0
  110. package/dist/tiers/tier=4.png +0 -0
  111. package/dist/timezone-CYbdI3q2.js +0 -1151
  112. package/dist/titles/type=diamond.png +0 -0
  113. package/dist/titles/type=drinks.png +0 -0
  114. package/dist/titles/type=food.png +0 -0
  115. package/dist/titles/type=heart.png +0 -0
  116. package/dist/titles/type=medal.png +0 -0
  117. package/dist/titles/type=spend.png +0 -0
  118. package/dist/titles/type=thank-you.png +0 -0
  119. package/dist/titles/type=thumbs-up.png +0 -0
  120. package/dist/titles/type=years.png +0 -0
  121. package/dist/trigger-Bdi6n80h.js +0 -144
  122. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  123. package/dist/type_drinks-D6jnpvwV.js +0 -4
  124. package/dist/usePagination-Ds-cuHop.js +0 -223
  125. package/dist/user-BwGm78n8.js +0 -54
  126. package/dist/vue-i18n-D1nTd69a.js +0 -2365
  127. package/dist/xlsx-DF5iW3wh.js +0 -15491
  128. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -1,41 +0,0 @@
1
- import { defineComponent as n, openBlock as o, createElementBlock as a, createVNode as c, unref as e, ref as m, resolveComponent as u, normalizeClass as _, createBlock as p, createCommentVNode as h, withDirectives as f, createElementVNode as d, vShow as w } from "vue";
2
- import { _ as v, S as x } from "./LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js";
3
- import { u as r } from "./app-wDQR6dpb.js";
4
- import { useRoute as g } from "vue-router";
5
- const S = { class: "bg-white w-full flex min-h-[calc(100svh-56px)] items-center" }, V = /* @__PURE__ */ n({
6
- __name: "Splash",
7
- setup(l) {
8
- return (s, t) => (o(), a("div", S, [
9
- c(v, {
10
- class: "flex-1",
11
- json: e(x),
12
- width: 100,
13
- height: 100
14
- }, null, 8, ["json"])
15
- ]));
16
- }
17
- }), N = /* @__PURE__ */ n({
18
- __name: "MainLayout",
19
- setup(l) {
20
- const s = g(), t = m(s.query.showHeader !== "false");
21
- return (b, k) => {
22
- const i = u("RouterView");
23
- return o(), a("div", {
24
- class: _([
25
- "bg-fm-color-neutral-white w-full xs:overflow-y-scroll",
26
- e(t) ? "min-h-[calc(100svh-56px)] xs:h-[calc(100svh-56px)]" : "min-h-screen"
27
- ])
28
- }, [
29
- e(r)().isGlobalLoading == !0 ? (o(), p(V, { key: 0 })) : h("", !0),
30
- f(d("div", null, [
31
- c(i)
32
- ], 512), [
33
- [w, e(r)().isGlobalLoading == !1]
34
- ])
35
- ], 2);
36
- };
37
- }
38
- });
39
- export {
40
- N as default
41
- };
@@ -1,319 +0,0 @@
1
- import { openBlock as m, createElementBlock as p, defineComponent as z, ref as S, onMounted as Y, computed as H, h as J, resolveComponent as c, Fragment as x, createVNode as i, unref as r, createElementVNode as s, withCtx as F, renderList as $, createBlock as B, toDisplayString as f, createCommentVNode as j } from "vue";
2
- import { _ as q } from "./campaign-CpzFl8Vr.js";
3
- import { components as G } from "@feedmepos/ui-library";
4
- import { p as X } from "./plugins-CjPWhNb2.js";
5
- import { u as Q } from "./loading-OXARGiqO.js";
6
- import { defineStore as W } from "pinia";
7
- import { F as C } from "./index-CSBRkhKy.js";
8
- import { useCoreStore as Z } from "@feedmepos/mf-common";
9
- import { g as y, S as ee, b as te } from "./index-BmyNfpfG.js";
10
- import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- import { u as ae } from "./campaign-DrQp6qBu.js";
12
- import { h as oe } from "./moment-D7p2TMB-.js";
13
- import { u as re } from "./vue-i18n-D1nTd69a.js";
14
- var se = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc" };
15
- const h = () => {
16
- const o = ee.getBusinessId();
17
- if (!o) throw new Error("Invalid business ID");
18
- return te(`businesses/${o}/marketing-materials/`, {
19
- url: se.backendUrl,
20
- noIdRequired: !0
21
- });
22
- }, L = {
23
- async read() {
24
- return y(await h().get(""));
25
- },
26
- async createMarketing(o) {
27
- return y(await h().post("", o));
28
- },
29
- // add id
30
- async updateMarketing(o, t) {
31
- return y(
32
- await h().put(o, t)
33
- );
34
- },
35
- async deleteMarketing(o) {
36
- return y(await h().delete(o));
37
- }
38
- }, I = W("mf-connect-marketing", {
39
- state: () => {
40
- var o, t;
41
- return {
42
- marketing: [],
43
- defaultMarketing: {
44
- _id: void 0,
45
- business: ((t = (o = Z().currentBusiness) == null ? void 0 : o.value) == null ? void 0 : t._id) ?? "",
46
- name: "",
47
- campaign: null,
48
- keywords: "",
49
- image: "",
50
- headline: {
51
- content: "",
52
- key: void 0
53
- },
54
- assets: [
55
- {
56
- platform: C.enum.FACEBOOK,
57
- contents: [
58
- {
59
- type: "POST",
60
- size: {
61
- width: 1920,
62
- height: 1080
63
- },
64
- images: []
65
- },
66
- {
67
- type: "STORY",
68
- size: {
69
- width: 1080,
70
- height: 1920
71
- },
72
- images: []
73
- }
74
- ]
75
- },
76
- {
77
- platform: C.enum.INSTAGRAM,
78
- contents: [
79
- {
80
- type: "POST",
81
- size: {
82
- width: 1080,
83
- height: 1080
84
- },
85
- images: []
86
- },
87
- {
88
- type: "STORY",
89
- size: {
90
- width: 1080,
91
- height: 1920
92
- },
93
- images: []
94
- },
95
- {
96
- type: "REEL",
97
- size: {
98
- width: 1080,
99
- height: 1920
100
- },
101
- images: []
102
- }
103
- ]
104
- },
105
- {
106
- platform: C.enum.BRAND_APP,
107
- contents: [
108
- {
109
- type: "IMAGE",
110
- size: {
111
- width: 1080,
112
- height: 1920
113
- },
114
- images: []
115
- }
116
- ]
117
- }
118
- ],
119
- captions: [{ language: "en", content: "" }]
120
- }
121
- };
122
- },
123
- actions: {
124
- async readMarketingMaterial() {
125
- const o = await L.read();
126
- this.marketing = o;
127
- }
128
- },
129
- getters: {
130
- state(o) {
131
- return o;
132
- }
133
- }
134
- }), ie = {};
135
- function le(o, t) {
136
- return m(), p("div");
137
- }
138
- const ce = /* @__PURE__ */ ne(ie, [["render", le]]), me = { class: "px-24 flex flex-col gap-y-16" }, de = { class: "flex items-center justify-between w-full" }, pe = { class: "space-y-8" }, ue = { class: "fm-typo-en-body-lg-600" }, ge = { class: "fm-typo-en-body-lg-600" }, fe = { key: 0 }, ye = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary w-4/6 text-center" }, Ve = /* @__PURE__ */ z({
139
- __name: "Marketing",
140
- setup(o) {
141
- const { t } = re(), O = {
142
- label: t("connect.marketing.create"),
143
- value: "create",
144
- isPrimary: !0,
145
- prependIcon: "add"
146
- }, k = S(!1), _ = I(), b = ae(), { global: N, minor: U } = Q;
147
- Y(async () => {
148
- await N(async () => {
149
- await b.read(), await _.readMarketingMaterial();
150
- });
151
- });
152
- const d = H(() => _.marketing.filter(
153
- (n) => n.name.includes(l.value.searchKey.toLowerCase())
154
- )), u = S(
155
- I().defaultMarketing
156
- ), D = [
157
- {
158
- header: t("connect.marketing.table.name"),
159
- accessorFn: (n) => n.name
160
- },
161
- {
162
- header: t("connect.marketing.table.campaign"),
163
- accessorFn: (n) => {
164
- var e;
165
- return n.campaign === null || n.campaign === void 0 ? "-" : (e = b.campaigns.all.find(
166
- (v) => v._id === n.campaign
167
- )) == null ? void 0 : e.name;
168
- }
169
- },
170
- {
171
- header: t("connect.marketing.table.createdDate"),
172
- accessorFn: (n) => {
173
- const e = new Date(
174
- parseInt(n._id.toString().substring(0, 8), 16) * 1e3
175
- );
176
- return oe(e).format("DD MMM YYYY");
177
- }
178
- },
179
- {
180
- header: t("connect.marketing.table.actions"),
181
- cell(n) {
182
- return J(G.FmButton, {
183
- variant: "tertiary",
184
- icon: "delete",
185
- iconColor: "neutral-gray-400",
186
- onClick: (e) => {
187
- e.stopPropagation(), P(n.row.original);
188
- }
189
- });
190
- }
191
- }
192
- ];
193
- async function P(n) {
194
- await X.remove(
195
- t("connect.marketing.delete.confirm", { name: n.name })
196
- ) && await U(
197
- async () => {
198
- await L.deleteMarketing(n._id), await _.readMarketingMaterial();
199
- },
200
- {
201
- message: t("connect.marketing.delete.removing", { name: n.name }),
202
- successMessage: t("connect.marketing.delete.success", {
203
- name: n.name
204
- })
205
- }
206
- );
207
- }
208
- async function g(n) {
209
- n ? u.value = JSON.parse(JSON.stringify(n)) : u.value = JSON.parse(
210
- JSON.stringify(I().defaultMarketing)
211
- ), k.value = !0;
212
- }
213
- const l = S({
214
- searchKey: ""
215
- });
216
- return (n, e) => {
217
- const v = c("FmPageHead"), V = c("FmSearch"), E = c("FmTable"), T = c("FmButton"), K = c("FmListItem"), A = c("FmList"), R = c("FmCard");
218
- return m(), p(x, null, [
219
- i(v, {
220
- title: r(t)("connect.marketing.title"),
221
- class: "xs:hidden",
222
- actions: r(d).length > 0 ? [O] : [],
223
- "onClick:action": e[0] || (e[0] = () => g())
224
- }, null, 8, ["title", "actions"]),
225
- s("div", me, [
226
- i(V, {
227
- modelValue: l.value.searchKey,
228
- "onUpdate:modelValue": e[1] || (e[1] = (a) => l.value.searchKey = a),
229
- placeholder: r(t)("connect.marketing.search"),
230
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
231
- collapsible: ""
232
- }, null, 8, ["modelValue", "placeholder"]),
233
- i(ce, {
234
- modelValue: u.value,
235
- "onUpdate:modelValue": e[2] || (e[2] = (a) => u.value = a),
236
- "is-open": k.value,
237
- "onUpdate:isOpen": e[3] || (e[3] = (a) => k.value = a)
238
- }, null, 8, ["modelValue", "is-open"]),
239
- r(d).length > 0 ? (m(), p(x, { key: 0 }, [
240
- s("div", de, [
241
- i(V, {
242
- modelValue: l.value.searchKey,
243
- "onUpdate:modelValue": e[4] || (e[4] = (a) => l.value.searchKey = a),
244
- class: "xs:hidden",
245
- placeholder: r(t)("connect.marketing.search"),
246
- collapsible: ""
247
- }, null, 8, ["modelValue", "placeholder"])
248
- ]),
249
- i(E, {
250
- class: "xs:hidden",
251
- "row-data": r(d),
252
- "column-defs": D,
253
- "search-value": l.value.searchKey,
254
- "column-filter": [],
255
- onRowClick: e[5] || (e[5] = (a) => g(a.original)),
256
- "hide-footer": !0
257
- }, null, 8, ["row-data", "search-value"]),
258
- i(A, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
259
- default: F(() => [
260
- (m(!0), p(x, null, $(r(d).filter(
261
- (a) => a.name.toLowerCase().includes(l.value.searchKey.toLowerCase())
262
- ), (a) => (m(), B(K, {
263
- key: a._id.toString(),
264
- onClick: (w) => g(a),
265
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
266
- }, {
267
- default: F(() => {
268
- var w;
269
- return [
270
- s("div", pe, [
271
- s("div", ue, f(a.name), 1),
272
- s("div", ge, f(a.campaign === null || a.campaign === void 0 ? "-" : (w = r(b).campaigns.all.find(
273
- (M) => M._id === a.campaign
274
- )) == null ? void 0 : w.name), 1)
275
- ]),
276
- i(T, {
277
- icon: "delete",
278
- "icon-color": "neutral-gray-400",
279
- variant: "tertiary",
280
- onClick: (M) => (M.stopPropagation(), P(a))
281
- }, null, 8, ["onClick"])
282
- ];
283
- }),
284
- _: 2
285
- }, 1032, ["onClick"]))), 128))
286
- ]),
287
- _: 1
288
- }),
289
- r(d).length == 0 ? (m(), p("div", fe, [...e[7] || (e[7] = [
290
- s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
291
- ])])) : j("", !0)
292
- ], 64)) : (m(), B(R, {
293
- key: 1,
294
- variant: "outlined",
295
- class: "w-full justify-center items-center flex flex-col p-[24px] gap-[24px]"
296
- }, {
297
- default: F(() => [
298
- e[8] || (e[8] = s("img", {
299
- src: q,
300
- class: "w-[150px]"
301
- }, null, -1)),
302
- s("p", ye, f(r(t)("connect.marketing.emptyState.title")), 1),
303
- s("p", he, f(r(t)("connect.marketing.emptyState.description")), 1),
304
- i(T, {
305
- label: r(t)("connect.marketing.emptyState.action"),
306
- "prepend-icon": "add",
307
- onClick: e[6] || (e[6] = (a) => g())
308
- }, null, 8, ["label"])
309
- ]),
310
- _: 1
311
- }))
312
- ])
313
- ], 64);
314
- };
315
- }
316
- });
317
- export {
318
- Ve as default
319
- };
@@ -1,279 +0,0 @@
1
- import { defineComponent as L, ref as F, watch as P, resolveComponent as m, openBlock as x, createElementBlock as h, Fragment as R, createElementVNode as b, createVNode as u, unref as n, withCtx as M, renderList as $, createBlock as D, toDisplayString as O, normalizeClass as U, computed as Y, createCommentVNode as q } from "vue";
2
- import "./index-BY9I3Cer.js";
3
- import { useDialogChild as H, FmButtonVariant as S, useDialog as J, useSnackbar as Q } from "@feedmepos/ui-library";
4
- import { u as N } from "./vue-i18n-D1nTd69a.js";
5
- import { c as A } from "./index-D4kdSzs9.js";
6
- import "./index-LKr2k8J2.js";
7
- import "./index-XAxwm-1v.js";
8
- import "./index-CSBRkhKy.js";
9
- import "./index-Cf_fcvoS.js";
10
- import { u as g, w as j } from "./xlsx-DF5iW3wh.js";
11
- import { F as z } from "./FileSaver.min-NlMItPOc.js";
12
- import { useCoreStore as G } from "@feedmepos/mf-common";
13
- import { useRouter as W } from "vue-router";
14
- import { m as I } from "./index-CqrO13uj.js";
15
- import { R as E } from "./app-BDVZwARN.js";
16
- const K = { class: "space-y-8 mb-10" }, X = { class: "flex justify-end" }, Z = {
17
- key: 1,
18
- class: /* @__PURE__ */ U([
19
- "flex items-center",
20
- "border border-fm-color-neutral-gray-300",
21
- "p-16 space-x-16 rounded-md"
22
- ])
23
- }, ee = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, te = /* @__PURE__ */ L({
24
- __name: "ImportMemberDialog",
25
- setup(V) {
26
- const { t: a } = N(), { emitData: _ } = H(), c = F(null), v = F(null), w = F({
27
- resetCollectionExpiryBalance: !0
28
- }), s = [
29
- "Id",
30
- "Name",
31
- "Phone",
32
- "Email",
33
- "Gender",
34
- "CardNo",
35
- "Birthday",
36
- "Credit",
37
- "CreditExpiryDate",
38
- "Exp",
39
- "Point",
40
- "Tier",
41
- // 'Titles',
42
- "TotalTransaction",
43
- "AvgSpent",
44
- "TotalSpent",
45
- "LastVisit",
46
- "Feedback",
47
- "LastSeasonTierEarned",
48
- "LastSeasonPointEarned",
49
- "JoinedAt",
50
- "JoinedAtLocation",
51
- "VisitFrequency"
52
- ], p = [
53
- {
54
- label: "CSV",
55
- icon: "csv",
56
- value: "csv"
57
- /* csv */
58
- },
59
- {
60
- label: "Excel",
61
- icon: "description",
62
- value: "xlsx"
63
- /* xlsx */
64
- }
65
- ];
66
- async function d(i) {
67
- var t, f;
68
- c.value = ((f = (t = i.target) == null ? void 0 : t.files) == null ? void 0 : f[0]) ?? null;
69
- }
70
- async function y(i) {
71
- switch (i) {
72
- case "csv":
73
- C();
74
- break;
75
- case "xlsx":
76
- T();
77
- break;
78
- }
79
- }
80
- function C() {
81
- const i = new Blob([s.join(",")], {
82
- type: "text/csv;charset=utf-8;"
83
- });
84
- z.saveAs(i, "ImportMemberTemplate.csv");
85
- }
86
- function T() {
87
- const i = g.aoa_to_sheet([s]), t = g.book_new();
88
- g.book_append_sheet(t, i, "Sheet1"), j(t, "ImportMemberTemplate.xlsx");
89
- }
90
- return P(c, () => {
91
- _({ file: c.value, config: w.value });
92
- }), (i, t) => {
93
- const f = m("FmSwitch"), k = m("FmButton"), o = m("FmMenuItem"), l = m("FmMenu"), r = m("FmDropField");
94
- return x(), h(R, null, [
95
- b("div", K, [
96
- t[3] || (t[3] = b("div", { class: "fm-typo-en-body-lg-600" }, "Advanced Setting", -1)),
97
- u(f, {
98
- "model-value": n(w).resetCollectionExpiryBalance ?? !0,
99
- "onUpdate:modelValue": t[0] || (t[0] = (e) => n(w).resetCollectionExpiryBalance = e),
100
- label: "Replace Existing Free Credit",
101
- sublabel: "When enabled, this will clear existing free credit and replace with new values from the import.",
102
- "label-placement": "right"
103
- }, null, 8, ["model-value"])
104
- ]),
105
- b("div", X, [
106
- u(l, null, {
107
- "menu-button": M(() => [
108
- u(k, {
109
- variant: "tertiary",
110
- icon: "download",
111
- label: "Download Template"
112
- })
113
- ]),
114
- default: M(() => [
115
- (x(), h(R, null, $(p, (e) => u(o, {
116
- key: e.value,
117
- icon: e.icon,
118
- label: e.label,
119
- onClick: (B) => y(e.value),
120
- selectable: ""
121
- }, null, 8, ["icon", "label", "onClick"])), 64))
122
- ]),
123
- _: 1
124
- })
125
- ]),
126
- n(c) ? (x(), h("div", Z, [
127
- u(k, {
128
- variant: n(S).Tertiary,
129
- "prepend-icon": "attach_file"
130
- }, null, 8, ["variant"]),
131
- b("p", ee, O(n(c).name), 1),
132
- b("label", {
133
- ref_key: "fileLabelRef",
134
- ref: v,
135
- htmlFor: "file"
136
- }, [
137
- u(k, {
138
- variant: n(S).Plain,
139
- label: n(a)("Replace File"),
140
- onClick: t[2] || (t[2] = () => {
141
- var e;
142
- return (e = n(v)) == null ? void 0 : e.click();
143
- })
144
- }, null, 8, ["variant", "label"]),
145
- b("input", {
146
- id: "file",
147
- accept: ".csv, .xlsx",
148
- class: "hidden",
149
- type: "file",
150
- multiple: "",
151
- onChange: d
152
- }, null, 32)
153
- ], 512)
154
- ])) : (x(), D(r, {
155
- key: 0,
156
- onFileUpload: t[1] || (t[1] = (e) => c.value = e),
157
- accept: ".csv, .xlsx",
158
- "max-file-size": 5e6
159
- }))
160
- ], 64);
161
- };
162
- }
163
- }), ne = { class: "px-24 flex flex-col gap-y-16 pb-24" }, ye = /* @__PURE__ */ L({
164
- __name: "Member",
165
- setup(V) {
166
- var t, f, k;
167
- const a = W(), { t: _ } = N(), c = J(), v = Q(), w = G();
168
- _("connect.loyalty.member.import"), _("connect.navigation.queue");
169
- const s = [
170
- {
171
- label: _("connect.loyalty.member.tabs.member_list"),
172
- value: E["$connect-LOYALTY_MEMBER_LIST"],
173
- actions: (k = (f = (t = w.sessionUser) == null ? void 0 : t.value) == null ? void 0 : f.role) != null && k.isAdmin ? [] : []
174
- }
175
- ], p = Y(() => {
176
- var l, r, e;
177
- return a.currentRoute.value.name != E["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
178
- title: d.value.label,
179
- actions: d.value.actions,
180
- description: void 0
181
- } : (d.value = s[1], {
182
- backButton: !0,
183
- title: _("connect.loyalty.member.title"),
184
- actions: [],
185
- description: `${(l = y.value) == null ? void 0 : l.name} (${(r = y.value) == null ? void 0 : r._id}) (${(e = y.value) == null ? void 0 : e.phoneNumber})`,
186
- onBackButton: async () => {
187
- await a.push({ name: E["$connect-LOYALTY_MEMBER_LIST"] });
188
- }
189
- });
190
- }), d = F(
191
- s.find((o) => o.value === a.currentRoute.value.name) ?? s[0]
192
- ), y = F();
193
- async function C(o) {
194
- await a.push({ name: o });
195
- }
196
- async function T() {
197
- c.open({
198
- title: "Upload File",
199
- closeButton: !0,
200
- dismissAway: !1,
201
- contentComponent: te,
202
- primaryActions: { text: "Import", close: !1 }
203
- }).onPrimary(async (o) => {
204
- if (!o) {
205
- v.open({
206
- type: "error",
207
- title: "Please upload a file"
208
- });
209
- return;
210
- }
211
- const { file: l, config: r } = o;
212
- if (!l)
213
- v.open({
214
- type: "error",
215
- title: "Please upload a file"
216
- });
217
- else {
218
- const e = new FormData();
219
- e.append("file", l), e.append("config", JSON.stringify(r)), await I.import(e), v.open({
220
- type: "info",
221
- title: "Import begins soon. Check Queue for updates.",
222
- action: "View",
223
- onAction: async () => {
224
- await a.push({
225
- name: E["$connect-QUEUE"],
226
- query: { type: [A.enum.MEMBER_IMPORTED] }
227
- });
228
- }
229
- }), c.close();
230
- }
231
- });
232
- }
233
- function i(o) {
234
- switch (o) {
235
- case "import":
236
- T();
237
- break;
238
- case "queue":
239
- a.push({
240
- name: E["$connect-QUEUE"],
241
- query: { type: [A.enum.MEMBER_IMPORTED] }
242
- });
243
- break;
244
- }
245
- }
246
- return P(
247
- () => a.currentRoute.value.name,
248
- async (o) => {
249
- d.value = s.find((r) => r.value === o) ?? s[0];
250
- const l = a.currentRoute.value.params.id;
251
- l && (y.value = await I.readById(l)), await a.push({ name: o });
252
- }
253
- ), (o, l) => {
254
- const r = m("FmPageHead"), e = m("FmTabs"), B = m("RouterView");
255
- return x(), h(R, null, [
256
- u(r, {
257
- actions: n(p).actions,
258
- title: n(p).title,
259
- description: n(p).description,
260
- "back-button": n(p).backButton,
261
- "onClick:back": n(p).onBackButton,
262
- "onClick:action": i
263
- }, null, 8, ["actions", "title", "description", "back-button", "onClick:back"]),
264
- b("div", ne, [
265
- n(a).currentRoute.value.name != n(E)["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? (x(), D(e, {
266
- key: 0,
267
- "model-value": n(d).value,
268
- items: s,
269
- "onUpdate:modelValue": C
270
- }, null, 8, ["model-value"])) : q("", !0),
271
- u(B)
272
- ])
273
- ], 64);
274
- };
275
- }
276
- });
277
- export {
278
- ye as default
279
- };