@feedmepos/mf-connect 0.1.0-beta.6 → 0.1.0-beta.61

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 (119) hide show
  1. package/dist/Analytic-u9mtlxSv.js +427 -0
  2. package/dist/{App-C2616cfr.js → App-BwTQE7Ft.js} +445 -420
  3. package/dist/AuditLogs-BVMRclSw.js +1886 -0
  4. package/dist/Bin-Cca-XOkz.js +166 -0
  5. package/dist/{Broadcast-CqSwLTAq.js → Broadcast-DRQgpwdP.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrR9Pmtb.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CeUu_T1u.js} +6 -8
  7. package/dist/Card-CnbB_u31.js +896 -0
  8. package/dist/Collections-BjlfOSC3.js +459 -0
  9. package/dist/{Credit-CPcLgnsq.js → Credit-BoElrcx9.js} +36 -34
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B3WVwem6.js +2181 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2buK6Dj.js → EffectSheet.vue_vue_type_style_index_0_lang-CGfpziKs.js} +18 -18
  14. package/dist/{Experience-BoBikt-x.js → Experience-SdGBf4vU.js} +32 -30
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  16. package/dist/{Game-DR8PyYZa.js → Game-ChLHibpB.js} +39 -37
  17. package/dist/Index-D7Kq6uyf.js +259 -0
  18. package/dist/Marketing-BDajIqR_.js +20071 -0
  19. package/dist/Member-BPZryqWL.js +317 -0
  20. package/dist/MemberList-C52Dop8Z.js +1598 -0
  21. package/dist/MemberTransactions-DHU78kgS.js +45 -0
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhtIZCjT.js → MessageInput.vue_vue_type_script_setup_true_lang-js1F2E4N.js} +83 -71
  23. package/dist/{Mission-CMpvz9zN.js → Mission-BQR3qjAu.js} +101 -87
  24. package/dist/Overview-BbLYWXjG.js +1078 -0
  25. package/dist/{Point-DkZn6p9s.js → Point-DbTcWJbQ.js} +55 -53
  26. package/dist/{Promotion-B7YzwPc_.js → Promotion-CIrpWBQD.js} +65 -57
  27. package/dist/Queue-B0Mfq2Vn.js +244 -0
  28. package/dist/Record-Z6ZrJeLc.js +340 -0
  29. package/dist/Reward-D6k0QFQA.js +442 -0
  30. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-GJ6j_jOh.js +150 -0
  31. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-gQxmX9ur.js +1637 -0
  32. package/dist/Segment-D6MF-EO8.js +568 -0
  33. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BWG-pz6F.js +181 -0
  34. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-HgorlHNz.js +147 -0
  35. package/dist/Setting--OFDS95z.js +1931 -0
  36. package/dist/Store-BqlRTC-c.js +1751 -0
  37. package/dist/{StoreRewards-6BzVwZqr.js → StoreRewards-BTu0IdDN.js} +33 -32
  38. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BX053DJA.js +943 -0
  39. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B6cAveco.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BAkuqLwy.js} +1 -1
  40. package/dist/{Tier-CW-46oJS.js → Tier-CE9LYAEX.js} +327 -318
  41. package/dist/{Title-CE9rWVdi.js → Title-DOOASUMI.js} +199 -184
  42. package/dist/{Transaction-B21RrC4M.js → Transaction-DPxUOBP-.js} +2 -2
  43. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CKwf0F_i.js +130 -0
  44. package/dist/Voucher-D69DD02z.js +354 -0
  45. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CFL0Nsez.js +419 -0
  46. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BiVZwBuG.js → ZodTextField.vue_vue_type_script_setup_true_lang-Byh6_EJM.js} +1 -1
  47. package/dist/app-C2u1t47T.js +7059 -0
  48. package/dist/app-DgfmbHZe.js +33357 -0
  49. package/dist/app.js +1 -1
  50. package/dist/{business-aHhRUXc0.js → business-BqCJB_vA.js} +1 -1
  51. package/dist/{campaign-DH9NUNf_.js → campaign-CWMPCmmU.js} +2 -2
  52. package/dist/campaign-D0dTbl5b.js +1810 -0
  53. package/dist/campaign.enum-DhE8N4pA.js +20 -0
  54. package/dist/campaign.fn-BpO-RQih.js +758 -0
  55. package/dist/collectible.enum-rWEc6Tsw.js +19 -0
  56. package/dist/{collection.fn-CYlsA-kW.js → collection.fn-biX2iFDQ.js} +2 -2
  57. package/dist/dto-3m7xZwfI.js +214 -0
  58. package/dist/{effect-LSc9YanX.js → effect-ZMGRxKCZ.js} +9 -9
  59. package/dist/email-addresses-lgY03bkq.js +705 -0
  60. package/dist/{export-Cf0-C5Ly.js → export-BOzeYUy8.js} +5 -5
  61. package/dist/{helper-CiZpeMCM.js → helper-CO29wun4.js} +1 -1
  62. package/dist/index-B3V7krW_.js +29000 -0
  63. package/dist/index-BVbiAxW8.js +115 -0
  64. package/dist/{index-D_83JP2i.js → index-Bvch9tuP.js} +48 -4
  65. package/dist/index-CYOwwy3h.js +44 -0
  66. package/dist/{index-D6cEOHP4.js → index-CbYXYVYp.js} +1501 -1480
  67. package/dist/{index-DtsDOuDx.js → index-ChrOXJDq.js} +24 -21
  68. package/dist/index-CsaQJMAR.js +66 -0
  69. package/dist/index-DNGenFnf.js +32 -0
  70. package/dist/{index-BVb5-Ht8.js → index-Dd22X409.js} +259 -173
  71. package/dist/{index-kPhrD63q.js → index-LYAWIqjk.js} +1 -1
  72. package/dist/index-Xh9cW6Y9.js +54 -0
  73. package/dist/{index-gxwjKu3-.js → index-XhqaicYu.js} +2212 -871
  74. package/dist/{index-DW3PRjPL.js → index-YsC4VklJ.js} +1 -1
  75. package/dist/index-vh86FiIQ.js +10 -0
  76. package/dist/{index.esm2017-B7oVYIbY.js → index.esm2017-CJ1flA6S.js} +121 -121
  77. package/dist/loading-CUs_CN1k.js +71 -0
  78. package/dist/{membership-Dw1ylJ9Y.js → membership-D-GVacos.js} +54 -46
  79. package/dist/money-CMtSALkX.js +15 -0
  80. package/dist/number-CDwwgAYM.js +12 -0
  81. package/dist/objectid-Bf9yKD81.js +145 -0
  82. package/dist/{loading-7yq1tinq.js → plugins-9sQTEyth.js} +3871 -3943
  83. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  84. package/dist/reward-DblXGhWc.js +36 -0
  85. package/dist/{rule-C0Q_SHow.js → rule-Cy8cTzuw.js} +180 -177
  86. package/dist/{rule-builder-iu17XIof.js → rule-builder-Cn5vZgFN.js} +1 -1
  87. package/dist/style.css +1 -1
  88. package/dist/{template-CyOanTMu.js → template-Cal94dUy.js} +5 -5
  89. package/dist/trigger-C1nwLSP8.js +144 -0
  90. package/dist/user-ir4Rn5bP.js +54 -0
  91. package/dist/{vue-i18n-B0fLJH7a.js → vue-i18n-eOHBBaH5.js} +243 -243
  92. package/dist/{xlsx-BYO_bB9J.js → xlsx-DulnT75_.js} +1 -1
  93. package/package.json +11 -7
  94. package/dist/Analytic-muDf0oMG.js +0 -622
  95. package/dist/Card-bhLoK0ZV.js +0 -825
  96. package/dist/Collections-DjtsAiol.js +0 -453
  97. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-U_QZneS6.js +0 -2813
  98. package/dist/Marketing-Dny2nMUl.js +0 -316
  99. package/dist/Member-CP_smyk8.js +0 -69
  100. package/dist/MemberList-CR3eYI9p.js +0 -1733
  101. package/dist/MemberTransactions-RTx_lKFb.js +0 -38
  102. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cs67_GLE.js +0 -1753
  103. package/dist/Segment-Bb4gHt5V.js +0 -437
  104. package/dist/Setting-Xj0AVzh3.js +0 -1901
  105. package/dist/Store-BWRHQ6Ie.js +0 -1511
  106. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BsFnT8BS.js +0 -890
  107. package/dist/Voucher-KK9fBI0u.js +0 -490
  108. package/dist/app-CjhXHUQv.js +0 -53428
  109. package/dist/app-Dvf_JNMf.js +0 -5764
  110. package/dist/dto-DArfyZAI.js +0 -2770
  111. package/dist/index-Bi_LGEtY.js +0 -99
  112. package/dist/index-CiQDG7Cm.js +0 -762
  113. package/dist/index-CuvNtC_M.js +0 -61
  114. package/dist/index-DQfjSSMF.js +0 -206
  115. package/dist/index-DcxssxPi.js +0 -29193
  116. package/dist/index-DqJVH2kv.js +0 -298
  117. package/dist/money-CPd0XTNv.js +0 -15
  118. package/dist/number-BgXY4un8.js +0 -12
  119. package/dist/user-Bm4KttFq.js +0 -37
@@ -0,0 +1,459 @@
1
+ var te = Object.defineProperty;
2
+ var ae = (g, u, c) => u in g ? te(g, u, { enumerable: !0, configurable: !0, writable: !0, value: c }) : g[u] = c;
3
+ var O = (g, u, c) => ae(g, typeof u != "symbol" ? u + "" : u, c);
4
+ import { defineComponent as J, ref as f, computed as Q, watch as K, resolveComponent as d, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as C, createVNode as r, createElementBlock as P, Fragment as N, renderList as le, createCommentVNode as R, onMounted as ne, h as S } from "vue";
5
+ import { h as G } from "./moment-BWErdI6_.js";
6
+ import { components as H } from "@feedmepos/ui-library";
7
+ import { a as se } from "./plugins-9sQTEyth.js";
8
+ import { J as re } from "./JsonViewer-v8_C7l5N.js";
9
+ import { u as W } from "./loading-CUs_CN1k.js";
10
+ import { u as ie } from "./app-wDQR6dpb.js";
11
+ import { useRoute as X, useRouter as ue } from "vue-router";
12
+ import { c as q } from "./index-BVbiAxW8.js";
13
+ import { e as p } from "./index-vh86FiIQ.js";
14
+ import { u as Y, w as de } from "./xlsx-DulnT75_.js";
15
+ import { u as ce, _ as me } from "./usePagination-BeF5K3M7.js";
16
+ import { m as pe } from "./index-Bvch9tuP.js";
17
+ import { o as fe } from "./objectId-dwaoBfJX.js";
18
+ const ge = { class: "space-y-16" }, be = { class: "gap-16 grid grid-cols-2" }, Ce = { class: "flex items-center gap-8" }, ve = /* @__PURE__ */ J({
19
+ __name: "CreateCollectionSheet",
20
+ emits: ["success"],
21
+ setup(g, { expose: u, emit: c }) {
22
+ const { minor: w } = W, F = X(), k = f(), _ = f(!1), A = c, b = f(!1);
23
+ function D(s) {
24
+ b.value = s, s && (a.value = {
25
+ quantity: 1,
26
+ code: "",
27
+ codeConfig: {
28
+ length: 8,
29
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
30
+ prefix: "",
31
+ suffix: "",
32
+ pattern: "########"
33
+ }
34
+ });
35
+ }
36
+ const a = f({
37
+ quantity: 1,
38
+ code: "",
39
+ codeConfig: {
40
+ length: 8,
41
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
42
+ prefix: "",
43
+ suffix: "",
44
+ pattern: "########"
45
+ }
46
+ }), E = [
47
+ {
48
+ label: "Bulk codes",
49
+ value: "bulk",
50
+ sublabel: "Bulk generate unique codes"
51
+ },
52
+ {
53
+ label: "Custom code",
54
+ value: "single",
55
+ sublabel: "Enter your own custom codes"
56
+ }
57
+ ], U = [
58
+ {
59
+ label: "Alphanumeric",
60
+ value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
61
+ },
62
+ {
63
+ label: "Alphabetic",
64
+ value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
65
+ },
66
+ { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
67
+ { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
68
+ { label: "Numbers", value: "0123456789" },
69
+ { label: "Custom", value: "" }
70
+ ], v = f(U[0].value), m = f("bulk"), h = f(!1), M = Q(() => F.params.id);
71
+ async function n(s) {
72
+ var e;
73
+ await ((e = k.value) == null ? void 0 : e.validateInputs()), _.value && await w(
74
+ async () => {
75
+ await q.createCollectionByCampaignId(M.value, s), await A("success");
76
+ },
77
+ {
78
+ message: "Creating claim(s)",
79
+ successMessage: "Claim(s) created"
80
+ }
81
+ );
82
+ }
83
+ u({
84
+ showSheet: D
85
+ }), K(
86
+ () => m.value,
87
+ (s, e) => {
88
+ e != s && (a.value.code = "", a.value.codeConfig.length = 8, a.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a.value.codeConfig.prefix = "", a.value.codeConfig.suffix = "", a.value.codeConfig.pattern = "########");
89
+ }
90
+ );
91
+ function l(s) {
92
+ if (m.value !== "single") return !1;
93
+ const e = s.split(`
94
+ `).map((i) => i.trim()).filter(Boolean);
95
+ return new Set(e).size !== e.length;
96
+ }
97
+ return K(
98
+ () => a.value.codeConfig.length,
99
+ (s, e) => {
100
+ s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
101
+ }
102
+ ), (s, e) => {
103
+ const i = d("FmRadio"), y = d("FmRadioGroup"), L = d("FmSwitch"), V = d("FmStepperField"), T = d("FmSelect"), B = d("FmTextField"), Z = d("FmTextarea"), ee = d("FmForm"), $ = d("FmButton"), oe = d("FmSideSheet");
104
+ return x(), z(oe, {
105
+ "max-width": 560,
106
+ "dismiss-away": !0,
107
+ header: "Create collection",
108
+ modelValue: o(b),
109
+ "onUpdate:modelValue": [
110
+ e[14] || (e[14] = (t) => j(b) ? b.value = t : null),
111
+ e[15] || (e[15] = (t) => b.value = t)
112
+ ]
113
+ }, {
114
+ "side-sheet-footer": I(() => [
115
+ C("div", Ce, [
116
+ r($, {
117
+ label: "Save",
118
+ onClick: e[12] || (e[12] = (t) => n(o(a))),
119
+ loading: o(ie)().isLoading
120
+ }, null, 8, ["loading"]),
121
+ r($, {
122
+ label: "Cancel",
123
+ type: "button",
124
+ variant: "tertiary",
125
+ onClick: e[13] || (e[13] = (t) => b.value = !1)
126
+ })
127
+ ])
128
+ ]),
129
+ default: I(() => [
130
+ r(re, { json: o(a) }, null, 8, ["json"]),
131
+ r(ee, {
132
+ ref_key: "form",
133
+ ref: k,
134
+ class: "space-y-40",
135
+ onValidationSuccess: e[10] || (e[10] = (t) => _.value = !0),
136
+ onValidationFailed: e[11] || (e[11] = (t) => _.value = !1)
137
+ }, {
138
+ default: I(() => [
139
+ C("div", null, [
140
+ e[16] || (e[16] = C("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
141
+ r(y, {
142
+ modelValue: o(m),
143
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => j(m) ? m.value = t : null),
144
+ inline: !1
145
+ }, {
146
+ default: I(() => [
147
+ (x(), P(N, null, le(E, (t) => r(i, {
148
+ key: t.value,
149
+ value: t.value,
150
+ label: t.label,
151
+ sublabel: t.sublabel
152
+ }, null, 8, ["value", "label", "sublabel"])), 64))
153
+ ]),
154
+ _: 1
155
+ }, 8, ["modelValue"])
156
+ ]),
157
+ C("div", ge, [
158
+ e[17] || (e[17] = C("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
159
+ o(m) === "bulk" ? (x(), P(N, { key: 0 }, [
160
+ r(L, {
161
+ "model-value": o(h),
162
+ "label-placement": "right",
163
+ value: "true",
164
+ label: "Advance code setting",
165
+ required: !0,
166
+ "onUpdate:modelValue": e[1] || (e[1] = () => h.value = !o(h))
167
+ }, null, 8, ["model-value"]),
168
+ o(h) ? (x(), P(N, { key: 0 }, [
169
+ r(V, {
170
+ modelValue: o(a).codeConfig.length,
171
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
172
+ label: "Code length",
173
+ max: 16,
174
+ min: 1,
175
+ rules: [
176
+ (t) => Number(t) >= 1 || "Code length must at least 1",
177
+ (t) => Number(t) <= 16 || "Code length must less than 16"
178
+ ],
179
+ required: !0
180
+ }, null, 8, ["modelValue", "rules"]),
181
+ r(T, {
182
+ label: "Charset",
183
+ "model-value": o(v),
184
+ items: U,
185
+ "helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
186
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => {
187
+ v.value = t, o(a).codeConfig.charset = t;
188
+ })
189
+ }, null, 8, ["model-value", "helper-text"]),
190
+ o(v) === "" ? (x(), z(B, {
191
+ key: 0,
192
+ modelValue: o(a).codeConfig.charset,
193
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
194
+ label: "Custom Charset",
195
+ required: ""
196
+ }, null, 8, ["modelValue"])) : R("", !0),
197
+ C("div", be, [
198
+ r(B, {
199
+ modelValue: o(a).codeConfig.prefix,
200
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
201
+ label: "Prefix (Optional)"
202
+ }, null, 8, ["modelValue"]),
203
+ r(B, {
204
+ modelValue: o(a).codeConfig.suffix,
205
+ "onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
206
+ label: "Suffix (Optional)"
207
+ }, null, 8, ["modelValue"])
208
+ ]),
209
+ r(B, {
210
+ modelValue: o(a).codeConfig.pattern,
211
+ "onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
212
+ label: "Pattern",
213
+ required: !0
214
+ }, null, 8, ["modelValue"])
215
+ ], 64)) : R("", !0),
216
+ r(B, {
217
+ modelValue: o(a).quantity,
218
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
219
+ label: "Number of code",
220
+ rules: [
221
+ (t) => t >= 1 || "Quantity cannot be less than 1",
222
+ (t) => t <= 1e4 || "Quantity cannot more than 10,000"
223
+ ],
224
+ required: !0,
225
+ "helper-text": `${o(a).quantity} claim will be created`
226
+ }, null, 8, ["modelValue", "rules", "helper-text"])
227
+ ], 64)) : R("", !0),
228
+ o(m) !== "bulk" ? (x(), z(Z, {
229
+ key: 1,
230
+ modelValue: o(a).code,
231
+ "onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
232
+ label: "Custom Code",
233
+ rules: [
234
+ (t) => o(m) != "single" || !!t || "Custom code is required",
235
+ (t) => !l(t) || "Custom code must be unique"
236
+ ],
237
+ placeholder: "(For multiple codes, please enter in the new row.)"
238
+ }, null, 8, ["modelValue", "rules"])) : R("", !0)
239
+ ])
240
+ ]),
241
+ _: 1
242
+ }, 512)
243
+ ]),
244
+ _: 1
245
+ }, 8, ["modelValue"]);
246
+ };
247
+ }
248
+ });
249
+ class xe {
250
+ constructor() {
251
+ O(this, "data", []);
252
+ }
253
+ addRecord(u) {
254
+ this.data.push(u);
255
+ }
256
+ buildExcel() {
257
+ const u = Y.book_new(), c = Y.json_to_sheet(this.data);
258
+ return Y.book_append_sheet(u, c, "Collection"), u;
259
+ }
260
+ }
261
+ const he = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ye = { class: "flex items-center justify-end py-4 xs:hidden" }, Ee = /* @__PURE__ */ J({
262
+ __name: "Collections",
263
+ setup(g) {
264
+ const u = ue(), c = X(), w = f(), F = Q(() => c.params.id), k = f(!1), { custom: _ } = W, A = [
265
+ {
266
+ header: "ID/Code",
267
+ accessorKey: "_id",
268
+ cell(n) {
269
+ return S("div", { class: "flex items-center" }, [
270
+ S(H.FmIcon, {
271
+ name: "content_copy",
272
+ outline: !0,
273
+ size: "sm",
274
+ class: "cursor-pointer mr-4",
275
+ onClick: (l) => {
276
+ l.preventDefault(), l.stopPropagation(), se(
277
+ n.row.original.code || n.row.original._id.toString()
278
+ );
279
+ }
280
+ }),
281
+ S(
282
+ "div",
283
+ { class: "pr-2 text-ellipsis overflow-hidden" },
284
+ n.row.original.code || n.row.original._id.toString()
285
+ )
286
+ ]);
287
+ }
288
+ },
289
+ {
290
+ header: "User",
291
+ accessorKey: "user",
292
+ enableSorting: !1,
293
+ cell(n) {
294
+ const l = n.row.original.pf_user;
295
+ return S(
296
+ "div",
297
+ {
298
+ class: "flex items-center gap-x-8"
299
+ },
300
+ [
301
+ S(H.FmAvatar, {
302
+ name: l != null && l.photoUrl || l == null ? void 0 : l.name,
303
+ src: (l == null ? void 0 : l.photoUrl) ?? void 0,
304
+ size: "sm"
305
+ }),
306
+ S("span", l == null ? void 0 : l.name)
307
+ ]
308
+ );
309
+ }
310
+ },
311
+ {
312
+ header: "Phone",
313
+ accessorFn: (n) => {
314
+ var l;
315
+ return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
316
+ },
317
+ accessorKey: "pf_user.phoneNumber"
318
+ },
319
+ {
320
+ header: "Balance",
321
+ accessorKey: "balance"
322
+ },
323
+ {
324
+ header: "Created at",
325
+ accessorKey: "_id",
326
+ accessorFn: (n) => G(fe(n._id.toString())).format("DD MMM YYYY")
327
+ },
328
+ {
329
+ header: "Nearest expired at",
330
+ accessorKey: "expiryBalance",
331
+ accessorFn: (n) => {
332
+ var l;
333
+ return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
334
+ }
335
+ }
336
+ ], b = {
337
+ "$connect-STORE_REWARD_COLLECTIONS": pe.readCollectionsByRewardId,
338
+ "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": q.readCollectionsByCampaignId
339
+ }, D = (n) => {
340
+ const l = b[c.name];
341
+ return (s) => l(n, s);
342
+ }, { tableMeta: a, rowData: E, onSort: U, debouncedFetchData: v, onSearch: m } = ce(D(F.value));
343
+ async function h() {
344
+ var n;
345
+ await v(), (n = w.value) == null || n.showSheet(!1);
346
+ }
347
+ async function M() {
348
+ k.value || _(
349
+ async () => {
350
+ var e;
351
+ const n = new xe(), l = (await q.readCollectionsByCampaignId(F.value, {
352
+ limit: 1,
353
+ skip: 0,
354
+ sortBy: p.sortBy,
355
+ descending: p.descending
356
+ })).meta.totalResources ?? 0, s = p.rowsPerPage;
357
+ for (let i = 0; i < l; i += s) {
358
+ const y = {
359
+ ...p,
360
+ limit: s,
361
+ skip: (p.page - 1) * p.rowsPerPage,
362
+ sortBy: p.sortBy,
363
+ descending: p.descending
364
+ }, L = await q.readCollectionsByCampaignId(
365
+ F.value,
366
+ y
367
+ );
368
+ for await (const V of L.resources) {
369
+ const T = {
370
+ Id: (V == null ? void 0 : V.code) || ((e = V._id) == null ? void 0 : e.toString()) || ""
371
+ };
372
+ n.addRecord(T);
373
+ }
374
+ p.page++;
375
+ }
376
+ await de(
377
+ n.buildExcel(),
378
+ `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
379
+ {
380
+ bookType: "xlsx",
381
+ bookSST: !1,
382
+ type: "array"
383
+ }
384
+ ), p.page = 1;
385
+ },
386
+ {
387
+ isLoading: k
388
+ }
389
+ );
390
+ }
391
+ return ne(async () => {
392
+ await v();
393
+ }), (n, l) => {
394
+ const s = d("FmPageHead"), e = d("FmSearch");
395
+ return x(), P(N, null, [
396
+ r(s, {
397
+ title: "Collections",
398
+ "back-button": !0,
399
+ actions: [
400
+ { label: "Export", value: "export", isPrimary: !1 },
401
+ {
402
+ label: "Create collection",
403
+ value: "create",
404
+ isPrimary: !0
405
+ }
406
+ ],
407
+ "onClick:back": l[0] || (l[0] = (i) => o(u).back()),
408
+ "onClick:action": l[1] || (l[1] = (i) => {
409
+ var y;
410
+ i === "create" && ((y = o(w)) == null || y.showSheet(!0)), i === "export" && M();
411
+ })
412
+ }),
413
+ C("div", he, [
414
+ r(e, {
415
+ class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
416
+ modelValue: o(a).searchValue,
417
+ "onUpdate:modelValue": [
418
+ l[2] || (l[2] = (i) => o(a).searchValue = i),
419
+ o(m)
420
+ ],
421
+ placeholder: "Search",
422
+ collapsible: ""
423
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
424
+ C("div", ye, [
425
+ r(e, {
426
+ modelValue: o(a).searchValue,
427
+ "onUpdate:modelValue": [
428
+ l[3] || (l[3] = (i) => o(a).searchValue = i),
429
+ o(m)
430
+ ],
431
+ placeholder: "Search",
432
+ collapsible: ""
433
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
434
+ ]),
435
+ r(me, {
436
+ loading: o(a).isLoading,
437
+ "row-data": o(E),
438
+ "column-defs": A,
439
+ "row-count": o(a).totalRows,
440
+ "page-count": o(a).pageCount,
441
+ "page-index": o(a).pageIndex,
442
+ "page-size": o(a).pageSize,
443
+ "shrink-at": !1,
444
+ onSortChange: o(U),
445
+ onPageChange: l[4] || (l[4] = (i) => o(v)({ pageSize: i.pageSize, pageIndex: i.pageIndex }))
446
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
447
+ r(ve, {
448
+ ref_key: "sheetRef",
449
+ ref: w,
450
+ onSuccess: h
451
+ }, null, 512)
452
+ ])
453
+ ], 64);
454
+ };
455
+ }
456
+ });
457
+ export {
458
+ Ee as default
459
+ };
@@ -1,26 +1,27 @@
1
- import { defineComponent as N, ref as S, computed as j, h as M, onMounted as A, resolveComponent as l, openBlock as c, createElementBlock as y, Fragment as h, createVNode as i, unref as a, createElementVNode as n, withCtx as C, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as g, createCommentVNode as z } from "vue";
1
+ import { defineComponent as N, ref as S, computed as j, h as M, onMounted as A, resolveComponent as l, openBlock as c, createElementBlock as y, Fragment as C, createVNode as i, unref as a, createElementVNode as n, withCtx as h, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as g, createCommentVNode as z } from "vue";
2
2
  import { _ as G } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as J, components as O } from "@feedmepos/ui-library";
4
- import { p as Q, u as W } from "./loading-7yq1tinq.js";
5
- import { u as X } from "./business-aHhRUXc0.js";
6
- import { u as Y } from "./campaign-DH9NUNf_.js";
7
- import { g as V, b as L } from "./dto-DArfyZAI.js";
8
- import { u as Z } from "./vue-i18n-B0fLJH7a.js";
9
- import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
- import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-U_QZneS6.js";
11
- import { u as te } from "./template-CyOanTMu.js";
12
- import { c as _ } from "./index-Bi_LGEtY.js";
13
- const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, ie = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ce = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { key: 0 }, Ve = /* @__PURE__ */ N({
4
+ import { p as Q } from "./plugins-9sQTEyth.js";
5
+ import { u as W } from "./loading-CUs_CN1k.js";
6
+ import { u as X } from "./business-BqCJB_vA.js";
7
+ import { u as Y } from "./campaign-CWMPCmmU.js";
8
+ import { g as Z, a as V, b as L } from "./campaign-D0dTbl5b.js";
9
+ import { u as ee } from "./vue-i18n-eOHBBaH5.js";
10
+ import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
+ import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-B3WVwem6.js";
12
+ import { u as ae } from "./template-Cal94dUy.js";
13
+ import { c as _ } from "./index-BVbiAxW8.js";
14
+ const ne = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { key: 0 }, Ie = /* @__PURE__ */ N({
14
15
  __name: "Credit",
15
- setup(fe) {
16
- const { t: r } = Z(), I = {
16
+ setup(ye) {
17
+ const { t: r } = ee(), I = {
17
18
  label: r("connect.program.common.actions.create", {
18
19
  type: r("connect.program.credit.title").toLowerCase()
19
20
  }),
20
21
  value: "create",
21
22
  isPrimary: !0,
22
23
  prependIcon: "add"
23
- }, R = te("CREDIT", J()), B = X(), m = Y(), { global: D, minor: w } = W, s = S({
24
+ }, R = ae("CREDIT", J()), B = X(), m = Y(), { global: D, minor: w } = W, s = S({
24
25
  searchKey: "",
25
26
  location: null
26
27
  }), d = j(
@@ -34,6 +35,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
34
35
  },
35
36
  {
36
37
  header: r("connect.program.common.table.status"),
38
+ accessorFn: (e) => Z(e),
37
39
  cell(e) {
38
40
  return V(e.row.original);
39
41
  }
@@ -102,13 +104,13 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
102
104
  });
103
105
  }), (e, o) => {
104
106
  const p = l("FmPageHead"), u = l("FmSearch"), K = l("FmTable"), F = l("FmButton"), $ = l("FmListItem"), P = l("FmList"), U = l("FmCard");
105
- return c(), y(h, null, [
107
+ return c(), y(C, null, [
106
108
  i(p, {
107
109
  title: a(r)("connect.program.credit.title"),
108
110
  actions: a(d).length > 0 ? [I] : [],
109
111
  "onClick:action": o[0] || (o[0] = () => f())
110
112
  }, null, 8, ["title", "actions"]),
111
- n("div", ae, [
113
+ n("div", ne, [
112
114
  i(u, {
113
115
  modelValue: a(s).searchKey,
114
116
  "onUpdate:modelValue": o[1] || (o[1] = (t) => a(s).searchKey = t),
@@ -116,10 +118,10 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
116
118
  placeholder: "search",
117
119
  collapsible: ""
118
120
  }, null, 8, ["modelValue"]),
119
- a(m).campaigns.credit && a(m).campaigns.credit.length > 0 ? (c(), y(h, { key: 0 }, [
120
- n("div", ne, [
121
- n("div", re, [
122
- i(ee, {
121
+ a(m).campaigns.credit && a(m).campaigns.credit.length > 0 ? (c(), y(C, { key: 0 }, [
122
+ n("div", re, [
123
+ n("div", se, [
124
+ i(oe, {
123
125
  modelValue: a(s).location,
124
126
  "onUpdate:modelValue": o[2] || (o[2] = (t) => a(s).location = t),
125
127
  label: "Location: ",
@@ -147,25 +149,25 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
147
149
  "hide-footer": a(d).length < 10
148
150
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
149
151
  i(P, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
150
- default: C(() => [
151
- (c(!0), y(h, null, H(a(d).filter(
152
+ default: h(() => [
153
+ (c(!0), y(C, null, H(a(d).filter(
152
154
  (t) => t.name.toLowerCase().includes(a(s).searchKey.toLowerCase())
153
155
  ), (t) => (c(), v($, {
154
156
  key: t._id.toString(),
155
157
  onClick: (k) => f(t),
156
158
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
157
159
  }, {
158
- default: C(() => [
159
- n("div", se, [
160
- n("div", ie, [
160
+ default: h(() => [
161
+ n("div", ie, [
162
+ n("div", le, [
161
163
  (c(), v(q(a(V)(t)))),
162
- n("div", le, g(t.currentReceive ?? 0) + " used ", 1)
164
+ n("div", ce, g(t.currentReceive ?? 0) + " used ", 1)
163
165
  ]),
164
- n("div", ce, [
165
- n("div", me, g(t.name), 1),
166
- n("div", de, g(a(L)(t)), 1)
166
+ n("div", me, [
167
+ n("div", de, g(t.name), 1),
168
+ n("div", pe, g(a(L)(t)), 1)
167
169
  ]),
168
- n("div", pe, " Credit received: " + g(t.currentReceive ?? 0), 1)
170
+ n("div", ue, " Credit received: " + g(t.currentReceive ?? 0), 1)
169
171
  ]),
170
172
  i(F, {
171
173
  icon: "delete",
@@ -179,7 +181,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
179
181
  ]),
180
182
  _: 1
181
183
  }),
182
- a(d).length == 0 ? (c(), y("div", ue, o[6] || (o[6] = [
184
+ a(d).length == 0 ? (c(), y("div", fe, o[6] || (o[6] = [
183
185
  n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
184
186
  ]))) : z("", !0)
185
187
  ], 64)) : (c(), v(U, {
@@ -187,7 +189,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
187
189
  variant: "outlined",
188
190
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
189
191
  }, {
190
- default: C(() => [
192
+ default: h(() => [
191
193
  o[7] || (o[7] = n("img", {
192
194
  src: G,
193
195
  class: "aspect-square w-[150px]"
@@ -205,7 +207,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
205
207
  ]),
206
208
  _: 1
207
209
  })),
208
- i(oe, {
210
+ i(te, {
209
211
  ref_key: "sheetRef",
210
212
  ref: b,
211
213
  "onSubmit:modelValue": E
@@ -216,5 +218,5 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
216
218
  }
217
219
  });
218
220
  export {
219
- Ve as default
221
+ Ie as default
220
222
  };