@feedmepos/mf-connect 0.1.37-prod → 0.1.38-beta.10

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 (118) hide show
  1. package/dist/Analytic-BdyLURDk.js +761 -0
  2. package/dist/{App-Bpo0XZSs.js → App-BLV7hTax.js} +364 -352
  3. package/dist/AuditLogs-DbJczPj1.js +1887 -0
  4. package/dist/{Bin-ohZ2CZZR.js → Bin-BMEEisLw.js} +8 -8
  5. package/dist/{Broadcast-D5x0_-zC.js → Broadcast-kJ4PM-iv.js} +40 -40
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYb38NXA.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dyy6Iknj.js} +18 -18
  7. package/dist/{Card-BM-Lrm5y.js → Card-SrRupWyd.js} +159 -159
  8. package/dist/{Collections-Cr4aoJer.js → Collections-CNoranW5.js} +136 -123
  9. package/dist/{Credit-DzDVFv4H.js → Credit-tW7knMvR.js} +74 -74
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bs8o9n1V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BplJqfmQ.js} +491 -488
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-koqrPPqM.js → EffectSheet.vue_vue_type_style_index_0_lang-DKKptxcn.js} +91 -89
  13. package/dist/{Experience-CjaDdbvZ.js → Experience-DkZIYg_s.js} +41 -41
  14. package/dist/{FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js → FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js} +2 -6
  15. package/dist/{Game-BuiTygow.js → Game-D3smlHJp.js} +31 -31
  16. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  17. package/dist/{Index-CQGzUU-w.js → Index-3Iep5Agi.js} +10 -10
  18. package/dist/Marketing-e3He2TRQ.js +20073 -0
  19. package/dist/Member-CdOzAmzY.js +279 -0
  20. package/dist/MemberList-DPNBniHV.js +1606 -0
  21. package/dist/MemberOverview-wL_ailso.js +58 -0
  22. package/dist/{MemberTransactions-DzG1fY0c.js → MemberTransactions-B4ROd3yQ.js} +1 -1
  23. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CF0IVI5X.js +60482 -0
  24. package/dist/{Mission-BtypT2uF.js → Mission-BRnOVwzw.js} +21 -21
  25. package/dist/{Overview-Be7bUtRO.js → Overview-DJ4ihjSG.js} +335 -335
  26. package/dist/{Point-Bw4lnLqp.js → Point-X2XbIe2Q.js} +41 -41
  27. package/dist/Promotion-B6FXsO-R.js +289 -0
  28. package/dist/{Queue-CpPEVgn8.js → Queue-kzL4GDld.js} +52 -52
  29. package/dist/{Record-DQq4P69i.js → Record-CbpzqZvu.js} +9 -9
  30. package/dist/{Reward-DJH0eM8u.js → Reward-CnLgcOl6.js} +173 -173
  31. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-_kw_PR0h.js → RewardGroup.vue_vue_type_script_setup_true_lang-CGzaVt3L.js} +11 -11
  32. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BHSbFQ81.js +1751 -0
  33. package/dist/Segment-C9rvyN-t.js +882 -0
  34. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dx6Ew9Z_.js → SelectItems.vue_vue_type_script_setup_true_lang-Bq2TBHn4.js} +2 -2
  35. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B60_8Toi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-9rmFSymz.js} +11 -11
  36. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCaJ3xKT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-qAwMzxkn.js} +3 -3
  37. package/dist/Setting-CHWl3Rlt.js +1936 -0
  38. package/dist/{Store-H0UDQpln.js → Store-BEJYH91p.js} +211 -211
  39. package/dist/StoreRewards-C0LoDVM6.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Q7W66jrt.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jL1oGS.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-zupkP2uw.js} +1 -1
  42. package/dist/{Tier-CJufQcIz.js → Tier-8dGY0rNK.js} +106 -106
  43. package/dist/{Title-BBMgGUld.js → Title-BdgXkzgT.js} +133 -131
  44. package/dist/{Transaction-DsucPnfp.js → Transaction-BgFnK0ZU.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CwOcZEQX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-gMC5mLHh.js} +6 -6
  46. package/dist/{Voucher-BPvxKO_w.js → Voucher-B2ITqfZO.js} +153 -123
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BZ1uzuZz.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DMs4XKXM.js → ZodTextField.vue_vue_type_script_setup_true_lang-C9svkJkQ.js} +1 -1
  49. package/dist/{app-D3MT1deX.js → app-BpNK9Shm.js} +164 -125
  50. package/dist/{app-Bo0JpadQ.js → app-kfprY-bq.js} +1 -1
  51. package/dist/app.js +4 -3
  52. package/dist/business-DKrvq1V9.js +79 -0
  53. package/dist/{campaign-j1c3ou7l.js → campaign-DmYOJ9S0.js} +5 -3
  54. package/dist/{campaign-Z3l7BoMg.js → campaign-sim1PpwX.js} +9 -9
  55. package/dist/{campaign.enum-CVXPc5Pd.js → campaign.enum-BD2rWUV4.js} +1 -1
  56. package/dist/campaign.fn-CBkNQbkW.js +758 -0
  57. package/dist/{collectible.enum-CDSikBAy.js → collectible.enum-SmUqreZO.js} +1 -1
  58. package/dist/{collection.fn-Bz38mGMa.js → collection.fn-kt3pF_1n.js} +2 -2
  59. package/dist/{dto-D648NN4s.js → dto-CgQvfjEp.js} +4 -4
  60. package/dist/{effect-DbMAmVSR.js → effect-Cof8Q_oG.js} +1 -1
  61. package/dist/{email-addresses-KOVDrRiK.js → email-addresses-Bq1gqAtY.js} +1 -1
  62. package/dist/{export-cTZf8Avd.js → export-CvhFTpK3.js} +3 -3
  63. package/dist/{helper-BYyfcLqw.js → helper-fHTdEmqM.js} +1 -1
  64. package/dist/index-B5526zoT.js +56 -0
  65. package/dist/index-BKs8ARn4.js +32260 -0
  66. package/dist/{index-DPBHiqsJ.js → index-BOxj8CUi.js} +11 -4
  67. package/dist/{index-nF9iYTlh.js → index-CA6LB3uR.js} +1 -1
  68. package/dist/{index-BrKXRxe_.js → index-CDPz2U9g.js} +1 -1
  69. package/dist/{index-CTPMbFf5.js → index-CNB0Lbxl.js} +10 -9
  70. package/dist/{index-E-0tTd0_.js → index-CYkHKi_f.js} +1 -1
  71. package/dist/{index-B3p0hmIV.js → index-ChdZIg_A.js} +1 -1
  72. package/dist/index-CsaQJMAR.js +66 -0
  73. package/dist/{index-BTb8I_eB.js → index-DBwa778L.js} +1 -1
  74. package/dist/{index-B4MqsaBz.js → index-DFZmjlFv.js} +3 -3
  75. package/dist/{index-BMl2KZts.js → index-DR0MjqoO.js} +11415 -10933
  76. package/dist/{index-BIaCtk8e.js → index-DasON_G8.js} +192 -79
  77. package/dist/index-ZoiSAZFK.js +31 -0
  78. package/dist/{index-CvoShC5J.js → index-meUmYtul.js} +536 -461
  79. package/dist/{index.esm2017-DFYwde30.js → index.esm2017-C7S5pHXF.js} +127 -127
  80. package/dist/{loading-vUArhX_O.js → loading-CWqSCt18.js} +1 -1
  81. package/dist/{membership-BHKv29yt.js → membership-DetnBa1q.js} +3 -3
  82. package/dist/{money-Bl3_QRkE.js → money-BkjOh2D6.js} +1 -1
  83. package/dist/{number-hh_S9w7k.js → number-DgbK531o.js} +1 -1
  84. package/dist/objectid-BQwSaw2U.js +145 -0
  85. package/dist/{plugins-CVes2wzE.js → plugins-OrApXSK1.js} +2 -2
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/{reward-ANZOdWzf.js → reward-KXD18Lzr.js} +1 -1
  88. package/dist/{rule-BvFk5bQg.js → rule-BnAvQkaq.js} +3 -3
  89. package/dist/{rule-builder-BSN777PN.js → rule-builder-fPUwOVc7.js} +17 -17
  90. package/dist/style.css +4 -1
  91. package/dist/{template-Dh9lDLs_.js → template-SbZEb9hY.js} +64 -64
  92. package/dist/{trigger-C7THbt7R.js → trigger-CnST_aOW.js} +7 -7
  93. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  94. package/dist/{user-DtNR9JY2.js → user-D2wQnmQQ.js} +1 -1
  95. package/dist/{vue-i18n-BWyHnm4m.js → vue-i18n-DiFFrwf8.js} +375 -375
  96. package/dist/{xlsx-7u9SB0oa.js → xlsx-B47YZ_wM.js} +226 -226
  97. package/package.json +9 -3
  98. package/dist/Analytic-CavR2bzs.js +0 -427
  99. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  100. package/dist/Marketing-BSspYuhg.js +0 -319
  101. package/dist/Member-B4S0UNGq.js +0 -287
  102. package/dist/MemberList-CfnUJ3mh.js +0 -1606
  103. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  104. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-hZUWLTWj.js +0 -455
  105. package/dist/Promotion-Bg6x0rAh.js +0 -255
  106. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CRGep1RK.js +0 -1641
  107. package/dist/Segment-BLB4VWNJ.js +0 -882
  108. package/dist/Setting-GRIUo7vg.js +0 -1932
  109. package/dist/StoreRewards--TNIFaCo.js +0 -423
  110. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfB8tA5l.js +0 -995
  111. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Bg-9YqLP.js +0 -419
  112. package/dist/business-DMALI7ZO.js +0 -78
  113. package/dist/campaign.fn-rsRhHYZP.js +0 -758
  114. package/dist/index-BsCGyJMY.js +0 -29566
  115. package/dist/index-CuvNtC_M.js +0 -61
  116. package/dist/index-DFKmjCG1.js +0 -44
  117. package/dist/index-Dbd4WA4r.js +0 -61
  118. package/dist/objectid-CEyMlMge.js +0 -145
@@ -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-CVes2wzE.js";
5
- import { u as Q } from "./loading-vUArhX_O.js";
6
- import { defineStore as W } from "pinia";
7
- import { F as C } from "./index-BrKXRxe_.js";
8
- import { useCoreStore as Z } from "@feedmepos/mf-common";
9
- import { g as h, S as ee, b as te } from "./index-BMl2KZts.js";
10
- import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- import { u as ae } from "./campaign-j1c3ou7l.js";
12
- import { h as oe } from "./moment-BWErdI6_.js";
13
- import { u as re } from "./vue-i18n-BWyHnm4m.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 y = () => {
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 h(await y().get(""));
25
- },
26
- async createMarketing(o) {
27
- return h(await y().post("", o));
28
- },
29
- // add id
30
- async updateMarketing(o, t) {
31
- return h(
32
- await y().put(o, t)
33
- );
34
- },
35
- async deleteMarketing(o) {
36
- return h(await y().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 }, he = /* @__PURE__ */ s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1), ye = [
139
- he
140
- ], ke = /* @__PURE__ */ s("img", {
141
- src: q,
142
- class: "w-[150px]"
143
- }, null, -1), _e = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary w-4/6 text-center" }, Le = /* @__PURE__ */ z({
144
- __name: "Marketing",
145
- setup(o) {
146
- const { t } = re(), O = {
147
- label: t("connect.marketing.create"),
148
- value: "create",
149
- isPrimary: !0,
150
- prependIcon: "add"
151
- }, k = S(!1), _ = I(), b = ae(), { global: N, minor: U } = Q;
152
- Y(async () => {
153
- await N(async () => {
154
- await b.read(), await _.readMarketingMaterial();
155
- });
156
- });
157
- const d = H(() => _.marketing.filter(
158
- (n) => n.name.includes(l.value.searchKey.toLowerCase())
159
- )), u = S(
160
- I().defaultMarketing
161
- ), D = [
162
- {
163
- header: t("connect.marketing.table.name"),
164
- accessorFn: (n) => n.name
165
- },
166
- {
167
- header: t("connect.marketing.table.campaign"),
168
- accessorFn: (n) => {
169
- var e;
170
- return n.campaign === null || n.campaign === void 0 ? "-" : (e = b.campaigns.all.find(
171
- (v) => v._id === n.campaign
172
- )) == null ? void 0 : e.name;
173
- }
174
- },
175
- {
176
- header: t("connect.marketing.table.createdDate"),
177
- accessorFn: (n) => {
178
- const e = new Date(
179
- parseInt(n._id.toString().substring(0, 8), 16) * 1e3
180
- );
181
- return oe(e).format("DD MMM YYYY");
182
- }
183
- },
184
- {
185
- header: t("connect.marketing.table.actions"),
186
- cell(n) {
187
- return J(G.FmButton, {
188
- variant: "tertiary",
189
- icon: "delete",
190
- iconColor: "neutral-gray-400",
191
- onClick: (e) => {
192
- e.stopPropagation(), P(n.row.original);
193
- }
194
- });
195
- }
196
- }
197
- ];
198
- async function P(n) {
199
- await X.remove(
200
- t("connect.marketing.delete.confirm", { name: n.name })
201
- ) && await U(
202
- async () => {
203
- await L.deleteMarketing(n._id), await _.readMarketingMaterial();
204
- },
205
- {
206
- message: t("connect.marketing.delete.removing", { name: n.name }),
207
- successMessage: t("connect.marketing.delete.success", {
208
- name: n.name
209
- })
210
- }
211
- );
212
- }
213
- async function g(n) {
214
- n ? u.value = JSON.parse(JSON.stringify(n)) : u.value = JSON.parse(
215
- JSON.stringify(I().defaultMarketing)
216
- ), k.value = !0;
217
- }
218
- const l = S({
219
- searchKey: ""
220
- });
221
- return (n, e) => {
222
- const v = c("FmPageHead"), V = c("FmSearch"), E = c("FmTable"), T = c("FmButton"), K = c("FmListItem"), A = c("FmList"), R = c("FmCard");
223
- return m(), p(x, null, [
224
- i(v, {
225
- title: r(t)("connect.marketing.title"),
226
- class: "xs:hidden",
227
- actions: r(d).length > 0 ? [O] : [],
228
- "onClick:action": e[0] || (e[0] = () => g())
229
- }, null, 8, ["title", "actions"]),
230
- s("div", me, [
231
- i(V, {
232
- modelValue: l.value.searchKey,
233
- "onUpdate:modelValue": e[1] || (e[1] = (a) => l.value.searchKey = a),
234
- placeholder: r(t)("connect.marketing.search"),
235
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
236
- collapsible: ""
237
- }, null, 8, ["modelValue", "placeholder"]),
238
- i(ce, {
239
- modelValue: u.value,
240
- "onUpdate:modelValue": e[2] || (e[2] = (a) => u.value = a),
241
- "is-open": k.value,
242
- "onUpdate:isOpen": e[3] || (e[3] = (a) => k.value = a)
243
- }, null, 8, ["modelValue", "is-open"]),
244
- r(d).length > 0 ? (m(), p(x, { key: 0 }, [
245
- s("div", de, [
246
- i(V, {
247
- modelValue: l.value.searchKey,
248
- "onUpdate:modelValue": e[4] || (e[4] = (a) => l.value.searchKey = a),
249
- class: "xs:hidden",
250
- placeholder: r(t)("connect.marketing.search"),
251
- collapsible: ""
252
- }, null, 8, ["modelValue", "placeholder"])
253
- ]),
254
- i(E, {
255
- class: "xs:hidden",
256
- "row-data": r(d),
257
- "column-defs": D,
258
- "search-value": l.value.searchKey,
259
- "column-filter": [],
260
- onRowClick: e[5] || (e[5] = (a) => g(a.original)),
261
- "hide-footer": !0
262
- }, null, 8, ["row-data", "search-value"]),
263
- i(A, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
264
- default: F(() => [
265
- (m(!0), p(x, null, $(r(d).filter(
266
- (a) => a.name.toLowerCase().includes(l.value.searchKey.toLowerCase())
267
- ), (a) => (m(), B(K, {
268
- key: a._id.toString(),
269
- onClick: (w) => g(a),
270
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
271
- }, {
272
- default: F(() => {
273
- var w;
274
- return [
275
- s("div", pe, [
276
- s("div", ue, f(a.name), 1),
277
- s("div", ge, f(a.campaign === null || a.campaign === void 0 ? "-" : (w = r(b).campaigns.all.find(
278
- (M) => M._id === a.campaign
279
- )) == null ? void 0 : w.name), 1)
280
- ]),
281
- i(T, {
282
- icon: "delete",
283
- "icon-color": "neutral-gray-400",
284
- variant: "tertiary",
285
- onClick: (M) => (M.stopPropagation(), P(a))
286
- }, null, 8, ["onClick"])
287
- ];
288
- }),
289
- _: 2
290
- }, 1032, ["onClick"]))), 128))
291
- ]),
292
- _: 1
293
- }),
294
- r(d).length == 0 ? (m(), p("div", fe, ye)) : j("", !0)
295
- ], 64)) : (m(), B(R, {
296
- key: 1,
297
- variant: "outlined",
298
- class: "w-full justify-center items-center flex flex-col p-[24px] gap-[24px]"
299
- }, {
300
- default: F(() => [
301
- ke,
302
- s("p", _e, f(r(t)("connect.marketing.emptyState.title")), 1),
303
- s("p", be, 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
- Le as default
319
- };
@@ -1,287 +0,0 @@
1
- import { defineComponent as P, ref as w, watch as D, resolveComponent as m, openBlock as x, createElementBlock as g, Fragment as M, createElementVNode as f, createVNode as u, unref as t, withCtx as S, renderList as U, createBlock as N, toDisplayString as Y, normalizeClass as q, computed as H, createCommentVNode as J } from "vue";
2
- import "./index-BTb8I_eB.js";
3
- import { useDialogChild as Q, FmButtonVariant as A, useDialog as j, useSnackbar as z } from "@feedmepos/ui-library";
4
- import { u as V } from "./vue-i18n-BWyHnm4m.js";
5
- import { c as I } from "./index-CvoShC5J.js";
6
- import "./index-CTPMbFf5.js";
7
- import "./index-BIaCtk8e.js";
8
- import "./index-BrKXRxe_.js";
9
- import "./index-B4MqsaBz.js";
10
- import { u as B, w as G } from "./xlsx-7u9SB0oa.js";
11
- import { F as W } from "./FileSaver.min-NlMItPOc.js";
12
- import { useCoreStore as K } from "@feedmepos/mf-common";
13
- import { useRouter as X } from "vue-router";
14
- import { m as L } from "./index-nF9iYTlh.js";
15
- import { R as E } from "./app-D3MT1deX.js";
16
- const Z = { class: "space-y-8 mb-10" }, ee = /* @__PURE__ */ f("div", { class: "fm-typo-en-body-lg-600" }, "Advanced Setting", -1), te = { class: "flex justify-end" }, ne = {
17
- key: 1,
18
- class: /* @__PURE__ */ q([
19
- "flex items-center",
20
- "border border-fm-color-neutral-gray-300",
21
- "p-16 space-x-16 rounded-md"
22
- ])
23
- }, oe = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, ae = /* @__PURE__ */ P({
24
- __name: "ImportMemberDialog",
25
- setup($) {
26
- const { t: a } = V(), { emitData: b } = Q(), i = w(null), _ = w(null), h = w({
27
- resetCollectionExpiryBalance: !0
28
- }), F = [
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
- ], R = [
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 r(l) {
67
- var o, y;
68
- i.value = ((y = (o = l.target) == null ? void 0 : o.files) == null ? void 0 : y[0]) ?? null;
69
- }
70
- async function p(l) {
71
- switch (l) {
72
- case "csv":
73
- d();
74
- break;
75
- case "xlsx":
76
- v();
77
- break;
78
- }
79
- }
80
- function d() {
81
- const l = new Blob([F.join(",")], {
82
- type: "text/csv;charset=utf-8;"
83
- });
84
- W.saveAs(l, "ImportMemberTemplate.csv");
85
- }
86
- function v() {
87
- const l = B.aoa_to_sheet([F]), o = B.book_new();
88
- B.book_append_sheet(o, l, "Sheet1"), G(o, "ImportMemberTemplate.xlsx");
89
- }
90
- return D(i, () => {
91
- b({ file: i.value, config: h.value });
92
- }), (l, o) => {
93
- const y = m("FmSwitch"), k = m("FmButton"), C = m("FmMenuItem"), T = m("FmMenu"), n = m("FmDropField");
94
- return x(), g(M, null, [
95
- f("div", Z, [
96
- ee,
97
- u(y, {
98
- "model-value": t(h).resetCollectionExpiryBalance ?? !0,
99
- "onUpdate:modelValue": o[0] || (o[0] = (e) => t(h).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
- f("div", te, [
106
- u(T, null, {
107
- "menu-button": S(() => [
108
- u(k, {
109
- variant: "tertiary",
110
- icon: "download",
111
- label: "Download Template"
112
- })
113
- ]),
114
- default: S(() => [
115
- (x(), g(M, null, U(R, (e) => u(C, {
116
- key: e.value,
117
- icon: e.icon,
118
- label: e.label,
119
- onClick: (c) => p(e.value),
120
- selectable: ""
121
- }, null, 8, ["icon", "label", "onClick"])), 64))
122
- ]),
123
- _: 1
124
- })
125
- ]),
126
- t(i) ? (x(), g("div", ne, [
127
- u(k, {
128
- variant: t(A).Tertiary,
129
- "prepend-icon": "attach_file"
130
- }, null, 8, ["variant"]),
131
- f("p", oe, Y(t(i).name), 1),
132
- f("label", {
133
- ref_key: "fileLabelRef",
134
- ref: _,
135
- htmlFor: "file"
136
- }, [
137
- u(k, {
138
- variant: t(A).Plain,
139
- label: t(a)("Replace File"),
140
- onClick: o[2] || (o[2] = () => {
141
- var e;
142
- return (e = t(_)) == null ? void 0 : e.click();
143
- })
144
- }, null, 8, ["variant", "label"]),
145
- f("input", {
146
- id: "file",
147
- accept: ".csv, .xlsx",
148
- class: "hidden",
149
- type: "file",
150
- multiple: "",
151
- onChange: r
152
- }, null, 32)
153
- ], 512)
154
- ])) : (x(), N(n, {
155
- key: 0,
156
- onFileUpload: o[1] || (o[1] = (e) => i.value = e),
157
- accept: ".csv, .xlsx",
158
- "max-file-size": 5e6
159
- }))
160
- ], 64);
161
- };
162
- }
163
- }), le = { class: "px-24 flex flex-col gap-y-16 pb-24" }, xe = /* @__PURE__ */ P({
164
- __name: "Member",
165
- setup($) {
166
- var k, C, T;
167
- const a = X(), { t: b } = V(), i = j(), _ = z(), h = K(), F = {
168
- label: b("connect.loyalty.member.import"),
169
- value: "import",
170
- isPrimary: !0,
171
- prependIcon: "download"
172
- }, R = {
173
- label: b("connect.navigation.queue"),
174
- value: "queue",
175
- isPrimary: !1,
176
- prependIcon: "work_history"
177
- }, r = [
178
- {
179
- label: b("connect.loyalty.member.tabs.member_list"),
180
- value: E["$connect-LOYALTY_MEMBER_LIST"],
181
- actions: (T = (C = (k = h.sessionUser) == null ? void 0 : k.value) == null ? void 0 : C.role) != null && T.isAdmin ? [R, F] : []
182
- }
183
- ], p = H(() => {
184
- var e, c, s;
185
- return a.currentRoute.value.name != E["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
186
- title: d.value.label,
187
- actions: d.value.actions,
188
- description: void 0
189
- } : (d.value = r[1], {
190
- backButton: !0,
191
- title: b("connect.loyalty.member.title"),
192
- actions: [],
193
- description: `${(e = v.value) == null ? void 0 : e.name} (${(c = v.value) == null ? void 0 : c._id}) (${(s = v.value) == null ? void 0 : s.phoneNumber})`,
194
- onBackButton: async () => {
195
- await a.push({ name: E["$connect-LOYALTY_MEMBER_LIST"] });
196
- }
197
- });
198
- }), d = w(
199
- r.find((n) => n.value === a.currentRoute.value.name) ?? r[0]
200
- ), v = w();
201
- async function l(n) {
202
- await a.push({ name: n });
203
- }
204
- async function o() {
205
- i.open({
206
- title: "Upload File",
207
- closeButton: !0,
208
- dismissAway: !1,
209
- contentComponent: ae,
210
- primaryActions: { text: "Import", close: !1 }
211
- }).onPrimary(async (n) => {
212
- if (!n) {
213
- _.open({
214
- type: "error",
215
- title: "Please upload a file"
216
- });
217
- return;
218
- }
219
- const { file: e, config: c } = n;
220
- if (!e)
221
- _.open({
222
- type: "error",
223
- title: "Please upload a file"
224
- });
225
- else {
226
- const s = new FormData();
227
- s.append("file", e), s.append("config", JSON.stringify(c)), await L.import(s), _.open({
228
- type: "info",
229
- title: "Import begins soon. Check Queue for updates.",
230
- action: "View",
231
- onAction: async () => {
232
- await a.push({
233
- name: E["$connect-QUEUE"],
234
- query: { type: [I.enum.MEMBER_IMPORTED] }
235
- });
236
- }
237
- }), i.close();
238
- }
239
- });
240
- }
241
- function y(n) {
242
- switch (n) {
243
- case "import":
244
- o();
245
- break;
246
- case "queue":
247
- a.push({
248
- name: E["$connect-QUEUE"],
249
- query: { type: [I.enum.MEMBER_IMPORTED] }
250
- });
251
- break;
252
- }
253
- }
254
- return D(
255
- () => a.currentRoute.value.name,
256
- async (n) => {
257
- d.value = r.find((c) => c.value === n) ?? r[0];
258
- const e = a.currentRoute.value.params.id;
259
- e && (v.value = await L.readById(e)), await a.push({ name: n });
260
- }
261
- ), (n, e) => {
262
- const c = m("FmPageHead"), s = m("FmTabs"), O = m("RouterView");
263
- return x(), g(M, null, [
264
- u(c, {
265
- actions: t(p).actions,
266
- title: t(p).title,
267
- description: t(p).description,
268
- "back-button": t(p).backButton,
269
- "onClick:back": t(p).onBackButton,
270
- "onClick:action": y
271
- }, null, 8, ["actions", "title", "description", "back-button", "onClick:back"]),
272
- f("div", le, [
273
- t(a).currentRoute.value.name != t(E)["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? (x(), N(s, {
274
- key: 0,
275
- "model-value": t(d).value,
276
- items: r,
277
- "onUpdate:modelValue": l
278
- }, null, 8, ["model-value"])) : J("", !0),
279
- u(O)
280
- ])
281
- ], 64);
282
- };
283
- }
284
- });
285
- export {
286
- xe as default
287
- };