@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-beta.80

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 (127) hide show
  1. package/dist/Analytic-C84B4MSt.js +427 -0
  2. package/dist/{App-SRz4257n.js → App-CnbbBVSn.js} +441 -420
  3. package/dist/AuditLogs-KOxiG5Q0.js +1887 -0
  4. package/dist/Bin-BBSQDzD4.js +166 -0
  5. package/dist/{Broadcast-DmkrJGp2.js → Broadcast-DlvPEqW7.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-M1Za3MaN.js} +14 -10
  7. package/dist/Card-BluWm_EY.js +905 -0
  8. package/dist/Collections-DtHJpxRT.js +464 -0
  9. package/dist/{Credit-CcNrq9qk.js → Credit-Be2pcBVn.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-sqq_sO_a.js +2182 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js → EffectSheet.vue_vue_type_style_index_0_lang-CBsYx54P.js} +49 -49
  14. package/dist/{Experience-DNsQLzDH.js → Experience-CLPyvgs0.js} +32 -30
  15. package/dist/FileSaver.min-NlMItPOc.js +74 -0
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  17. package/dist/Game-5kEG7o4J.js +278 -0
  18. package/dist/Index-BSZi21Wo.js +259 -0
  19. package/dist/Marketing-CE1Sq3Pb.js +20071 -0
  20. package/dist/Member-DaBqmOYX.js +287 -0
  21. package/dist/MemberList-jIriR6B0.js +1606 -0
  22. package/dist/MemberTransactions-BGEZwpPO.js +45 -0
  23. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js → MessageInput.vue_vue_type_script_setup_true_lang-CSlafowP.js} +152 -137
  24. package/dist/Mission-BOByUsYC.js +296 -0
  25. package/dist/Overview-BQQs8TsL.js +1079 -0
  26. package/dist/{Point-Ck8EG_3k.js → Point-BuRBh_HC.js} +55 -53
  27. package/dist/Promotion-Py2WWNt0.js +289 -0
  28. package/dist/Queue-On8_svkl.js +260 -0
  29. package/dist/Record-CSWkHs9Y.js +341 -0
  30. package/dist/Reward-BLVyFkAH.js +442 -0
  31. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BW8kuoLt.js +150 -0
  32. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DC8JEmEC.js +1728 -0
  33. package/dist/Segment-BjBskgf9.js +880 -0
  34. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CrVw6j2M.js +181 -0
  35. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-oaAVUxO4.js +188 -0
  36. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CKOTgzL-.js +147 -0
  37. package/dist/Setting-CAMlhgGd.js +1932 -0
  38. package/dist/Store-0qvNbHne.js +1842 -0
  39. package/dist/StoreRewards-CjcHvUNa.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CdZ7QIaf.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-vJaZIDrx.js} +1 -1
  42. package/dist/{Tier-CJ9-d8Zg.js → Tier-D_pHKGSv.js} +350 -334
  43. package/dist/{Title-DZCpvg4q.js → Title-DgdtJ87h.js} +245 -222
  44. package/dist/{Transaction-DpnTxlbf.js → Transaction-CKlLWcjS.js} +2 -2
  45. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-2GOvljvv.js +130 -0
  46. package/dist/Voucher-Cg6zQSAy.js +354 -0
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-rpjQkheM.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js → ZodTextField.vue_vue_type_script_setup_true_lang-BRdY-P8U.js} +1 -1
  49. package/dist/{app-DzAexOqx.js → app-CScRp4SA.js} +2709 -1265
  50. package/dist/app-jGYefKeR.js +33357 -0
  51. package/dist/app.js +1 -1
  52. package/dist/business-DYhO4gjc.js +79 -0
  53. package/dist/campaign-BgXy1Ngd.js +1810 -0
  54. package/dist/{campaign-winsqufa.js → campaign-CZ5pMrUu.js} +2 -2
  55. package/dist/campaign.enum-CWBDlzqp.js +20 -0
  56. package/dist/campaign.fn-HHZ5mQKe.js +758 -0
  57. package/dist/collectible.enum-MvoLHpuA.js +19 -0
  58. package/dist/{collection.fn-CI5Llblg.js → collection.fn-BHUoLJPj.js} +2 -2
  59. package/dist/dto-DXdR0em1.js +214 -0
  60. package/dist/{effect-CdkrIYgX.js → effect-HLuo1A_f.js} +33 -16
  61. package/dist/email-addresses-DU4ehcHM.js +705 -0
  62. package/dist/{export-DGxfief1.js → export-BDRHAxZr.js} +5 -5
  63. package/dist/{helper-B8RqcTNu.js → helper-JhFOw8n-.js} +1 -1
  64. package/dist/{index-OzicErwL.js → index-BG_GpbnZ.js} +24 -21
  65. package/dist/{index-Cw_aXFH6.js → index-BZWr1bgh.js} +269 -173
  66. package/dist/{loading-DuEFUCwF.js → index-Bs-tzd5F.js} +4609 -4886
  67. package/dist/{index-wzdbEEcZ.js → index-C2nNcNjw.js} +1 -1
  68. package/dist/index-CIF8DeC8.js +54 -0
  69. package/dist/{index-HZC9LLAX.js → index-CqT8uK3R.js} +48 -4
  70. package/dist/index-CsaQJMAR.js +66 -0
  71. package/dist/{index-9w43_U1v.js → index-DVj1MyZp.js} +1506 -1480
  72. package/dist/{index-CZgQVRsm.js → index-GmHsjd7O.js} +1 -1
  73. package/dist/index-QDEKR2Rj.js +115 -0
  74. package/dist/{index-A34xEz20.js → index-cYKPj4fA.js} +2246 -871
  75. package/dist/index-eRBO4PzZ.js +56 -0
  76. package/dist/index-fS6fmvFv.js +29556 -0
  77. package/dist/index-l8E6r07W.js +32 -0
  78. package/dist/index-vh86FiIQ.js +10 -0
  79. package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-B-YrQ0sw.js} +206 -206
  80. package/dist/loading-C09t0mFj.js +71 -0
  81. package/dist/{membership-nsMtWeTC.js → membership-tHAn3VRs.js} +80 -66
  82. package/dist/money-DYVCca49.js +15 -0
  83. package/dist/number-VYuUME2F.js +12 -0
  84. package/dist/objectid-BTO4csVa.js +145 -0
  85. package/dist/plugins-CXgvBDMF.js +208 -0
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/reward-DX9TZrk4.js +36 -0
  88. package/dist/{rule-CPIMqt1h.js → rule-CbCZqulx.js} +185 -178
  89. package/dist/{rule-builder-CSs5XRKP.js → rule-builder-J8K_fjI-.js} +1 -1
  90. package/dist/style.css +1 -1
  91. package/dist/{template-CJZoYavu.js → template-BtYJpEBa.js} +5 -5
  92. package/dist/trigger-D6dpZFSN.js +144 -0
  93. package/dist/user-C0QvWk-o.js +54 -0
  94. package/dist/vue-i18n-cz2_cPSz.js +2365 -0
  95. package/dist/{xlsx-BZlnYinX.js → xlsx-BIPQrY49.js} +1 -1
  96. package/package.json +11 -7
  97. package/dist/Analytic-5QztrYSp.js +0 -622
  98. package/dist/Card-BsjFTVsH.js +0 -825
  99. package/dist/Collections-7wqZHOax.js +0 -453
  100. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js +0 -2813
  101. package/dist/Game-DlzDerT7.js +0 -255
  102. package/dist/Marketing-BqhpaG4o.js +0 -316
  103. package/dist/Member-AFgZcdtz.js +0 -69
  104. package/dist/MemberList-BKgrLz2C.js +0 -1733
  105. package/dist/MemberTransactions-BwT3zE2a.js +0 -38
  106. package/dist/Mission-BTAia7AS.js +0 -261
  107. package/dist/Promotion-0v3kvsK3.js +0 -247
  108. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js +0 -1753
  109. package/dist/Segment-BenLupqV.js +0 -437
  110. package/dist/Setting-0fpREqpJ.js +0 -1901
  111. package/dist/Store-BDGwe4ar.js +0 -1511
  112. package/dist/StoreRewards-TDZt9H1V.js +0 -401
  113. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js +0 -890
  114. package/dist/Voucher-DsP_rh8I.js +0 -490
  115. package/dist/app-Cg2pTZJK.js +0 -53428
  116. package/dist/business-Cw_qGw8y.js +0 -78
  117. package/dist/dto-ozu1smC3.js +0 -2770
  118. package/dist/index-BLACZ3-L.js +0 -206
  119. package/dist/index-BaozRfWB.js +0 -762
  120. package/dist/index-CjVmULNd.js +0 -99
  121. package/dist/index-CuvNtC_M.js +0 -61
  122. package/dist/index-DAEmawcj.js +0 -298
  123. package/dist/index-Oxr-mU6h.js +0 -29193
  124. package/dist/money-BGZPFtUc.js +0 -15
  125. package/dist/number-4J0xvXP9.js +0 -12
  126. package/dist/user-Bm4KttFq.js +0 -37
  127. package/dist/vue-i18n-CCyiVzOE.js +0 -2365
@@ -0,0 +1,464 @@
1
+ var ae = Object.defineProperty;
2
+ var le = (f, i, d) => i in f ? ae(f, i, { enumerable: !0, configurable: !0, writable: !0, value: d }) : f[i] = d;
3
+ var O = (f, i, d) => le(f, typeof i != "symbol" ? i + "" : i, d);
4
+ import { defineComponent as J, ref as p, computed as Q, watch as K, resolveComponent as u, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as v, createVNode as r, createElementBlock as N, Fragment as P, renderList as ne, createCommentVNode as R, onMounted as se, 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 "./index-Bs-tzd5F.js";
8
+ import { J as re } from "./JsonViewer-v8_C7l5N.js";
9
+ import { u as W } from "./loading-C09t0mFj.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-QDEKR2Rj.js";
13
+ import { e as m } from "./index-vh86FiIQ.js";
14
+ import { u as Y, w as de } from "./xlsx-BIPQrY49.js";
15
+ import { u as ce, _ as me } from "./usePagination-BeF5K3M7.js";
16
+ import { a as pe } from "./plugins-CXgvBDMF.js";
17
+ import { m as fe } from "./index-CqT8uK3R.js";
18
+ import { o as ge } from "./objectId-dwaoBfJX.js";
19
+ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, ve = { class: "flex items-center gap-8" }, he = /* @__PURE__ */ J({
20
+ __name: "CreateCollectionSheet",
21
+ emits: ["success"],
22
+ setup(f, { expose: i, emit: d }) {
23
+ const { minor: w } = W, F = X(), k = p(), _ = p(!1), A = d, g = p(!1);
24
+ function D(s) {
25
+ g.value = s, s && (a.value = {
26
+ quantity: 1,
27
+ code: "",
28
+ codeConfig: {
29
+ length: 8,
30
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
31
+ prefix: "",
32
+ suffix: "",
33
+ pattern: "########"
34
+ }
35
+ });
36
+ }
37
+ const a = p({
38
+ quantity: 1,
39
+ code: "",
40
+ codeConfig: {
41
+ length: 8,
42
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
43
+ prefix: "",
44
+ suffix: "",
45
+ pattern: "########"
46
+ }
47
+ }), E = [
48
+ {
49
+ label: "Bulk codes",
50
+ value: "bulk",
51
+ sublabel: "Bulk generate unique codes"
52
+ },
53
+ {
54
+ label: "Custom code",
55
+ value: "single",
56
+ sublabel: "Enter your own custom codes"
57
+ }
58
+ ], U = [
59
+ {
60
+ label: "Alphanumeric",
61
+ value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
62
+ },
63
+ {
64
+ label: "Alphabetic",
65
+ value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
66
+ },
67
+ { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
68
+ { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
69
+ { label: "Numbers", value: "0123456789" },
70
+ { label: "Custom", value: "" }
71
+ ], h = p(U[0].value), c = p("bulk"), y = p(!1), M = Q(() => F.params.id);
72
+ async function n(s) {
73
+ var e;
74
+ await ((e = k.value) == null ? void 0 : e.validateInputs()), _.value && await w(
75
+ async () => {
76
+ await q.createCollectionByCampaignId(M.value, s), await A("success");
77
+ },
78
+ {
79
+ message: "Creating claim(s)",
80
+ successMessage: "Claim(s) created"
81
+ }
82
+ );
83
+ }
84
+ i({
85
+ showSheet: D
86
+ }), K(
87
+ () => c.value,
88
+ (s, e) => {
89
+ 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 = "########");
90
+ }
91
+ );
92
+ function l(s) {
93
+ if (c.value !== "single") return !1;
94
+ const e = s.split(`
95
+ `).map((C) => C.trim()).filter(Boolean);
96
+ return new Set(e).size !== e.length;
97
+ }
98
+ function b(s) {
99
+ return /[ \t]/.test(s);
100
+ }
101
+ return K(
102
+ () => a.value.codeConfig.length,
103
+ (s, e) => {
104
+ s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
105
+ }
106
+ ), (s, e) => {
107
+ const C = u("FmRadio"), L = u("FmRadioGroup"), V = u("FmSwitch"), T = u("FmStepperField"), Z = u("FmSelect"), B = u("FmTextField"), ee = u("FmTextarea"), oe = u("FmForm"), $ = u("FmButton"), te = u("FmSideSheet");
108
+ return x(), z(te, {
109
+ "max-width": 560,
110
+ "dismiss-away": !0,
111
+ header: "Create collection",
112
+ modelValue: o(g),
113
+ "onUpdate:modelValue": [
114
+ e[14] || (e[14] = (t) => j(g) ? g.value = t : null),
115
+ e[15] || (e[15] = (t) => g.value = t)
116
+ ]
117
+ }, {
118
+ "side-sheet-footer": I(() => [
119
+ v("div", ve, [
120
+ r($, {
121
+ label: "Save",
122
+ onClick: e[12] || (e[12] = (t) => n(o(a))),
123
+ loading: o(ie)().isLoading
124
+ }, null, 8, ["loading"]),
125
+ r($, {
126
+ label: "Cancel",
127
+ type: "button",
128
+ variant: "tertiary",
129
+ onClick: e[13] || (e[13] = (t) => g.value = !1)
130
+ })
131
+ ])
132
+ ]),
133
+ default: I(() => [
134
+ r(re, { json: o(a) }, null, 8, ["json"]),
135
+ r(oe, {
136
+ ref_key: "form",
137
+ ref: k,
138
+ class: "space-y-40",
139
+ onValidationSuccess: e[10] || (e[10] = (t) => _.value = !0),
140
+ onValidationFailed: e[11] || (e[11] = (t) => _.value = !1)
141
+ }, {
142
+ default: I(() => [
143
+ v("div", null, [
144
+ e[16] || (e[16] = v("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
145
+ r(L, {
146
+ modelValue: o(c),
147
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => j(c) ? c.value = t : null),
148
+ inline: !1
149
+ }, {
150
+ default: I(() => [
151
+ (x(), N(P, null, ne(E, (t) => r(C, {
152
+ key: t.value,
153
+ value: t.value,
154
+ label: t.label,
155
+ sublabel: t.sublabel
156
+ }, null, 8, ["value", "label", "sublabel"])), 64))
157
+ ]),
158
+ _: 1
159
+ }, 8, ["modelValue"])
160
+ ]),
161
+ v("div", be, [
162
+ e[17] || (e[17] = v("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
163
+ o(c) === "bulk" ? (x(), N(P, { key: 0 }, [
164
+ r(V, {
165
+ "model-value": o(y),
166
+ "label-placement": "right",
167
+ value: "true",
168
+ label: "Advance code setting",
169
+ required: !0,
170
+ "onUpdate:modelValue": e[1] || (e[1] = () => y.value = !o(y))
171
+ }, null, 8, ["model-value"]),
172
+ o(y) ? (x(), N(P, { key: 0 }, [
173
+ r(T, {
174
+ modelValue: o(a).codeConfig.length,
175
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
176
+ label: "Code length",
177
+ max: 16,
178
+ min: 1,
179
+ rules: [
180
+ (t) => Number(t) >= 1 || "Code length must at least 1",
181
+ (t) => Number(t) <= 16 || "Code length must less than 16"
182
+ ],
183
+ required: !0
184
+ }, null, 8, ["modelValue", "rules"]),
185
+ r(Z, {
186
+ label: "Charset",
187
+ "model-value": o(h),
188
+ items: U,
189
+ "helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
190
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => {
191
+ h.value = t, o(a).codeConfig.charset = t;
192
+ })
193
+ }, null, 8, ["model-value", "helper-text"]),
194
+ o(h) === "" ? (x(), z(B, {
195
+ key: 0,
196
+ modelValue: o(a).codeConfig.charset,
197
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
198
+ label: "Custom Charset",
199
+ required: ""
200
+ }, null, 8, ["modelValue"])) : R("", !0),
201
+ v("div", Ce, [
202
+ r(B, {
203
+ modelValue: o(a).codeConfig.prefix,
204
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
205
+ label: "Prefix (Optional)"
206
+ }, null, 8, ["modelValue"]),
207
+ r(B, {
208
+ modelValue: o(a).codeConfig.suffix,
209
+ "onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
210
+ label: "Suffix (Optional)"
211
+ }, null, 8, ["modelValue"])
212
+ ]),
213
+ r(B, {
214
+ modelValue: o(a).codeConfig.pattern,
215
+ "onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
216
+ label: "Pattern",
217
+ required: !0
218
+ }, null, 8, ["modelValue"])
219
+ ], 64)) : R("", !0),
220
+ r(B, {
221
+ modelValue: o(a).quantity,
222
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
223
+ label: "Number of code",
224
+ rules: [
225
+ (t) => t >= 1 || "Quantity cannot be less than 1",
226
+ (t) => t <= 1e4 || "Quantity cannot more than 10,000"
227
+ ],
228
+ required: !0,
229
+ "helper-text": `${o(a).quantity} claim will be created`
230
+ }, null, 8, ["modelValue", "rules", "helper-text"])
231
+ ], 64)) : R("", !0),
232
+ o(c) !== "bulk" ? (x(), z(ee, {
233
+ key: 1,
234
+ modelValue: o(a).code,
235
+ "onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
236
+ label: "Custom Code",
237
+ rules: [
238
+ (t) => o(c) != "single" || !!t || "Custom code is required",
239
+ (t) => !l(t) || "Custom code must be unique",
240
+ (t) => !b(t) || "Custom code must not contain space"
241
+ ],
242
+ placeholder: "(For multiple codes, please enter in the new row.)"
243
+ }, null, 8, ["modelValue", "rules"])) : R("", !0)
244
+ ])
245
+ ]),
246
+ _: 1
247
+ }, 512)
248
+ ]),
249
+ _: 1
250
+ }, 8, ["modelValue"]);
251
+ };
252
+ }
253
+ });
254
+ class xe {
255
+ constructor() {
256
+ O(this, "data", []);
257
+ }
258
+ addRecord(i) {
259
+ this.data.push(i);
260
+ }
261
+ buildExcel() {
262
+ const i = Y.book_new(), d = Y.json_to_sheet(this.data);
263
+ return Y.book_append_sheet(i, d, "Collection"), i;
264
+ }
265
+ }
266
+ const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex items-center justify-end py-4 xs:hidden" }, Le = /* @__PURE__ */ J({
267
+ __name: "Collections",
268
+ setup(f) {
269
+ const i = ue(), d = X(), w = p(), F = Q(() => d.params.id), k = p(!1), { custom: _ } = W, A = [
270
+ {
271
+ header: "ID/Code",
272
+ accessorKey: "_id",
273
+ cell(n) {
274
+ return S("div", { class: "flex items-center" }, [
275
+ S(H.FmIcon, {
276
+ name: "content_copy",
277
+ outline: !0,
278
+ size: "sm",
279
+ class: "cursor-pointer mr-4",
280
+ onClick: (l) => {
281
+ l.preventDefault(), l.stopPropagation(), pe(
282
+ n.row.original.code || n.row.original._id.toString()
283
+ );
284
+ }
285
+ }),
286
+ S(
287
+ "div",
288
+ { class: "pr-2 text-ellipsis overflow-hidden" },
289
+ n.row.original.code || n.row.original._id.toString()
290
+ )
291
+ ]);
292
+ }
293
+ },
294
+ {
295
+ header: "User",
296
+ accessorKey: "user",
297
+ enableSorting: !1,
298
+ cell(n) {
299
+ const l = n.row.original.pf_user;
300
+ return S(
301
+ "div",
302
+ {
303
+ class: "flex items-center gap-x-8"
304
+ },
305
+ [
306
+ S(H.FmAvatar, {
307
+ name: l != null && l.photoUrl || l == null ? void 0 : l.name,
308
+ src: (l == null ? void 0 : l.photoUrl) ?? void 0,
309
+ size: "sm"
310
+ }),
311
+ S("span", l == null ? void 0 : l.name)
312
+ ]
313
+ );
314
+ }
315
+ },
316
+ {
317
+ header: "Phone",
318
+ accessorFn: (n) => {
319
+ var l;
320
+ return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
321
+ },
322
+ accessorKey: "pf_user.phoneNumber"
323
+ },
324
+ {
325
+ header: "Balance",
326
+ accessorKey: "balance"
327
+ },
328
+ {
329
+ header: "Created at",
330
+ accessorKey: "_id",
331
+ accessorFn: (n) => G(ge(n._id.toString())).format("DD MMM YYYY")
332
+ },
333
+ {
334
+ header: "Nearest expired at",
335
+ accessorKey: "expiryBalance",
336
+ accessorFn: (n) => {
337
+ var l;
338
+ return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
339
+ }
340
+ }
341
+ ], g = {
342
+ "$connect-STORE_REWARD_COLLECTIONS": fe.readCollectionsByRewardId,
343
+ "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": q.readCollectionsByCampaignId
344
+ }, D = (n) => {
345
+ const l = g[d.name];
346
+ return (b) => l(n, b);
347
+ }, { tableMeta: a, rowData: E, onSort: U, debouncedFetchData: h, onSearch: c } = ce(D(F.value));
348
+ async function y() {
349
+ var n;
350
+ await h(), (n = w.value) == null || n.showSheet(!1);
351
+ }
352
+ async function M() {
353
+ k.value || _(
354
+ async () => {
355
+ var s;
356
+ const n = new xe(), l = (await q.readCollectionsByCampaignId(F.value, {
357
+ limit: 1,
358
+ skip: 0,
359
+ sortBy: m.sortBy,
360
+ descending: m.descending
361
+ })).meta.totalResources ?? 0, b = m.rowsPerPage;
362
+ for (let e = 0; e < l; e += b) {
363
+ const C = {
364
+ ...m,
365
+ limit: b,
366
+ skip: m.page - 1,
367
+ sortBy: m.sortBy,
368
+ descending: m.descending
369
+ }, L = await q.readCollectionsByCampaignId(
370
+ F.value,
371
+ C
372
+ );
373
+ for await (const V of L.resources) {
374
+ const T = {
375
+ Id: (V == null ? void 0 : V.code) || ((s = V._id) == null ? void 0 : s.toString()) || ""
376
+ };
377
+ n.addRecord(T);
378
+ }
379
+ m.page++;
380
+ }
381
+ await de(
382
+ n.buildExcel(),
383
+ `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
384
+ {
385
+ bookType: "xlsx",
386
+ bookSST: !1,
387
+ type: "array"
388
+ }
389
+ ), m.page = 1;
390
+ },
391
+ {
392
+ isLoading: k
393
+ }
394
+ );
395
+ }
396
+ return se(async () => {
397
+ await h();
398
+ }), (n, l) => {
399
+ const b = u("FmPageHead"), s = u("FmSearch");
400
+ return x(), N(P, null, [
401
+ r(b, {
402
+ title: "Collections",
403
+ "back-button": !0,
404
+ actions: [
405
+ { label: "Export", value: "export", isPrimary: !1 },
406
+ {
407
+ label: "Create collection",
408
+ value: "create",
409
+ isPrimary: !0
410
+ }
411
+ ],
412
+ "onClick:back": l[0] || (l[0] = (e) => o(i).back()),
413
+ "onClick:action": l[1] || (l[1] = (e) => {
414
+ var C;
415
+ e === "create" && ((C = o(w)) == null || C.showSheet(!0)), e === "export" && M();
416
+ })
417
+ }),
418
+ v("div", ye, [
419
+ r(s, {
420
+ class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
421
+ modelValue: o(a).searchValue,
422
+ "onUpdate:modelValue": [
423
+ l[2] || (l[2] = (e) => o(a).searchValue = e),
424
+ o(c)
425
+ ],
426
+ placeholder: "Search",
427
+ collapsible: ""
428
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
429
+ v("div", Ve, [
430
+ r(s, {
431
+ modelValue: o(a).searchValue,
432
+ "onUpdate:modelValue": [
433
+ l[3] || (l[3] = (e) => o(a).searchValue = e),
434
+ o(c)
435
+ ],
436
+ placeholder: "Search",
437
+ collapsible: ""
438
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
439
+ ]),
440
+ r(me, {
441
+ loading: o(a).isLoading,
442
+ "row-data": o(E),
443
+ "column-defs": A,
444
+ "row-count": o(a).totalRows,
445
+ "page-count": o(a).pageCount,
446
+ "page-index": o(a).pageIndex,
447
+ "page-size": o(a).pageSize,
448
+ "shrink-at": !1,
449
+ onSortChange: o(U),
450
+ onPageChange: l[4] || (l[4] = (e) => o(h)({ pageSize: e.pageSize, pageIndex: e.pageIndex }))
451
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
452
+ r(he, {
453
+ ref_key: "sheetRef",
454
+ ref: w,
455
+ onSuccess: y
456
+ }, null, 512)
457
+ ])
458
+ ], 64);
459
+ };
460
+ }
461
+ });
462
+ export {
463
+ Le as default
464
+ };
@@ -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-DuEFUCwF.js";
5
- import { u as X } from "./business-Cw_qGw8y.js";
6
- import { u as Y } from "./campaign-winsqufa.js";
7
- import { g as V, b as L } from "./dto-ozu1smC3.js";
8
- import { u as Z } from "./vue-i18n-CCyiVzOE.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-Cuklmxur.js";
11
- import { u as te } from "./template-CJZoYavu.js";
12
- import { c as _ } from "./index-CjVmULNd.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-CXgvBDMF.js";
5
+ import { u as W } from "./loading-C09t0mFj.js";
6
+ import { u as X } from "./business-DYhO4gjc.js";
7
+ import { u as Y } from "./campaign-CZ5pMrUu.js";
8
+ import { g as Z, a as V, b as L } from "./campaign-BgXy1Ngd.js";
9
+ import { u as ee } from "./vue-i18n-cz2_cPSz.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-sqq_sO_a.js";
12
+ import { u as ae } from "./template-BtYJpEBa.js";
13
+ import { c as _ } from "./index-QDEKR2Rj.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
  };